Sfoglia il codice sorgente

供货商开单需要抹零

jf 5 anni fa
parent
commit
f8b6fdd954
2 ha cambiato i file con 62 aggiunte e 72 eliminazioni
  1. 22 1
      ghs/src/views/order/add.vue
  2. 40 71
      ghsApp/src/admin/billing/affirm.vue

+ 22 - 1
ghs/src/views/order/add.vue

@@ -210,6 +210,18 @@
             <el-button :type="payType=='已收款'?'primary':''" @keyup.enter.native="payType='已收款'" @click="payType='已收款'">已收款</el-button>
           </div>
         </div>
+        <div class="accounts-list">
+          总金额
+          <div class="accounts-center">{{totalMoney.toFixed(2)}}</div>
+        </div>
+        <div class="accounts-list">
+          实收
+          <el-input style="width: 80%" v-model="realMoney" clearable></el-input>
+        </div>
+        <div class="accounts-list">
+          优惠
+          <div class="accounts-center">{{(totalMoney - realMoney).toFixed(2)}}</div>
+        </div>
         <div class="accounts-list">
           备注
           <div class="accounts-center">
@@ -223,7 +235,7 @@
         <div class="accounts-list">
           {{ payType }}
           <div class="accounts-center">
-            ¥{{ totalMoney.toFixed(2) }}
+            ¥{{ realMoney }}
           </div>
         </div>
         <div class="accounts-list">
@@ -306,6 +318,7 @@ export default {
       big:null,//大单位(扎)
       small:null,//小单位(支)
       totalMoney:0,//总价
+      realMoney:0,//实际收款
       allList:'',//所有-可搜索数据
       seekVal:'',//搜索值
       seekOldVal:'',//旧-搜索值(上一次搜索值)
@@ -396,6 +409,7 @@ export default {
           return;
         }
         self.isAccounts = true;
+
         if(self.$util.isEmpty(self.allShopList)){
           self.getShopAll();
         }else{
@@ -408,6 +422,10 @@ export default {
     }
   },
   methods: {
+    realMoneyFun(money){
+      let realMoney =  this.$util.copyObject(money)
+      return realMoney.toFixed(2);
+    },
     todays(type) {
       var myDate = new Date();
       let todaty = '';
@@ -447,6 +465,7 @@ export default {
         product:JSON.stringify(product),
         remark:this.remark,
         clearType:this.payType=='欠款'?1:2,
+        realPrice: this.realMoney,
       }
       this.$service.order.orderCreate(parameter).then(res => {
         this.orderMsg = res;
@@ -571,6 +590,7 @@ export default {
       })
       this.totalMoney = totalMoney;
       this.number = this.totalMoney
+      this.realMoney = this.totalMoney;
     },
     /**关闭选择扎支弹窗-初始化**/
     escFun(){
@@ -694,6 +714,7 @@ export default {
     },
     freightInput(){
        this.totalMoney = Number(this.freight) +  this.number
+       this.realMoney = Number(this.freight) +  this.number
     }
   }
 };

+ 40 - 71
ghsApp/src/admin/billing/affirm.vue

@@ -61,101 +61,64 @@
         </view>
         <!-- 登录信息 -->
         <view class="module-com input-line-wrap">
-          <tui-list-cell
-            class="line-cell"
-            :hover="false"
-            :arrow="true"
-            @click="showCustomer = true"
-          >
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="showCustomer = true">
             <view class="tui-title">客户</view>
-            <view
-              class="tui-input"
-              v-if="form.customId"
-            >{{
-              form.customName
-            }}</view>
-            <view
-              class="tui-placeholder"
-              style="width: 100%"
-              v-else
-            >请选择客户</view>
+            <view class="tui-input" v-if="form.customId" >{{ form.customName }}</view>
+            <view class="tui-placeholder" style="width: 100%" v-else >请选择客户</view>
           </tui-list-cell>
-          <tui-list-cell
-            class="line-cell"
-            :hover="false"
-            :arrow="false"
-          >
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">送货</view>
-            <button
-              @tap="courier(2)"
-              class="admin-button-com mini-btn"
-              :class="form.sendType == 2 ? 'blue' : 'default'"
-            >
+            <button @tap="courier(2)" class="admin-button-com mini-btn" :class="form.sendType == 2 ? 'blue' : 'default'">
               自取
             </button>
-            <button
-              @click="courier(1)"
-              class="admin-button-com mini-btn"
-              :class="form.sendType == 1 ? 'blue' : 'default'"
-            >
+            <button @click="courier(1)" class="admin-button-com mini-btn" :class="form.sendType == 1 ? 'blue' : 'default'">
               配送
             </button>
           </tui-list-cell>
-          <tui-list-cell
-            class="line-cell"
-            :hover="false"
-            :arrow="false"
-            v-show="form.sendType == 1"
-          >
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1" >
             <view class="tui-title">运费</view>
-            <input
-              @blur="sendCostBlur"
-              type="number"
-              placeholder="留空表示免运费"
-              @input="countAllPrices"
-              v-model="form.sendCost"
-              placeholder-class="tui-placeholder"
-            />
+            <input @blur="sendCostBlur" type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
           </tui-list-cell>
-          <tui-list-cell
-            class="line-cell"
-            :hover="false"
-            :arrow="false"
-          >
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
             <view class="tui-title">付款方式</view>
-            <button
-              @tap="form.debt = 1"
-              class="admin-button-com mini-btn"
-              :class="form.debt == 1 ? 'blue' : 'default'"
-            >
+            <button @tap="form.debt = 1" class="admin-button-com mini-btn" :class="form.debt == 1 ? 'blue' : 'default'">
               欠款
             </button>
-            <button
-              @click="form.debt = 0"
-              class="admin-button-com mini-btn"
-              :class="form.debt == 0 ? 'blue' : 'default'"
-            >
+            <button @click="form.debt = 0" class="admin-button-com mini-btn" :class="form.debt == 0 ? 'blue' : 'default'">
               已收款
             </button>
           </tui-list-cell>
+
+									<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+										<view class="tui-title">总金额</view>
+										<text style="color: #3385FF" v-if="form.sendType == 1">{{	(allPrice + Number(form.sendCost)).toFixed(2) }}</text>
+										<text style="color: #3385FF" v-else >{{ allPrice.toFixed(2) }}</text>
+									</tui-list-cell>
+
+									<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+										<view class="tui-title">实收金额</view>
+										<input style="border: 1px solid #eee;color: #3385FF;width: calc(100%);" type="number" v-model="realMoney" placeholder-class="tui-placeholder"/>
+									</tui-list-cell>
+
+									<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+										<view class="tui-title">优惠</view>
+										<text style="color: #3385FF">{{	(allPrice.toFixed(2) - realMoney + Number(this.form.sendCost)).toFixed(2) }}</text>
+									</tui-list-cell>
+
         </view>
       </form>
     </view>
     <view class="under-bar">
       <view class="price-view">
-        <text class="price-title">{{
-          form.debt == 1 ? "欠款" : "已收款"
-        }}</text>
+        <text class="price-title">{{form.debt == 1 ? "欠款" : "已收款"}}</text>
         <text class="price-number">
           ¥
-          <text class="large" v-if="form.sendType == 1">{{	(allPrice + Number(form.sendCost)).toFixed(2) }}</text>
-          <text class="large" v-else >{{ allPrice.toFixed(2) }}</text>
+          <!--<text class="large" v-if="form.sendType == 1">{{	(allPrice + Number(form.sendCost)).toFixed(2) }}</text>-->
+          <!--<text class="large" v-else >{{ allPrice.toFixed(2) }}</text>-->
+          <text class="large" >{{ realMoney?realMoney:0 }}</text>
         </text>
       </view>
-      <button
-        class="admin-button-com blue middle"
-        @click="affirmFormSubmit"
-      >
+      <button class="admin-button-com blue middle" @click="affirmFormSubmit">
         开单
       </button>
     </view>
@@ -217,6 +180,7 @@ export default {
         product: "",
       },
       money: "",
+						realMoney: 0,
       showCustomer: false,
     };
   },
@@ -232,6 +196,7 @@ export default {
         title: this.getMerchantInfo.name,
       });
     }
+    this.realMoney = this.allPrice.toFixed(2);
   },
   computed: {
     ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
@@ -243,6 +208,9 @@ export default {
     },
     countAllPrices (e) {
       this.allPrices = this.allPrices + Number(this.form.sendCost);
+      let allPrices = this.allPrice.toFixed(2)
+      this.realMoney = (Number(allPrices) + Number(this.form.sendCost)).toFixed(2);
+
     },
     courier (type) {
       this.form.sendType = type;
@@ -296,7 +264,8 @@ export default {
       if (options.sendType == 2) {
         options.sendCost = "";
       }
-      createOrder(options).then((res) => {
+
+      createOrder({...options,realPrice: this.realMoney,}).then((res) => {
         this.resetSelectInfoByType(this.pageType);
         const {
           data: { id, orderSn },