Pārlūkot izejas kodu

fix:关联订单

maliang 1 dienu atpakaļ
vecāks
revīzija
7b1747b77d

+ 2 - 2
jshERP-web/src/views/bill/AllocationOutList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/AssembleList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/DisassembleList.vue

@@ -95,12 +95,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/OtherInList.vue

@@ -117,12 +117,12 @@
             >待入库({{ waitTotal }})</a-button
           >
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/OtherOutList.vue

@@ -117,12 +117,12 @@
             >待出库({{ waitTotal }})</a-button
           >
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/PurchaseApplyList.vue

@@ -83,12 +83,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/PurchaseBackList.vue

@@ -130,12 +130,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/PurchaseInList.vue

@@ -138,12 +138,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/PurchaseOrderList.vue

@@ -107,12 +107,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/RetailBackList.vue

@@ -128,12 +128,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/RetailOutList.vue

@@ -123,12 +123,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/SaleBackList.vue

@@ -131,12 +131,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/SaleOrderList.vue

@@ -98,12 +98,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 2 - 2
jshERP-web/src/views/bill/SaleOutList.vue

@@ -139,12 +139,12 @@
         <div class="table-operator" style="margin-top: 5px">
           <a-button v-if="btnEnableList.indexOf(1) > -1" @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
           <a-button v-if="btnEnableList.indexOf(1) > -1" icon="delete" @click="batchDel">删除</a-button>
-          <!-- <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
+          <a-button v-if="checkFlag && btnEnableList.indexOf(2) > -1" icon="check" @click="batchSetStatus(1)"
             >审核</a-button
           >
           <a-button v-if="checkFlag && btnEnableList.indexOf(7) > -1" icon="stop" @click="batchSetStatus(0)"
             >反审核</a-button
-          > -->
+          >
           <a-button v-if="isShowExcel && btnEnableList.indexOf(3) > -1" icon="download" @click="handleExport"
             >导出</a-button
           >

+ 10 - 10
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -494,11 +494,12 @@ export const BillModalMixin = {
     },
     // 自动计算表格价格
     autoCalcPrice(editTableVm,taxRate){
+      const that = this
       editTableVm.getValues((error, values) => {
         const updateRows = []
         console.log('9999999------',values)
         for(let row of values){
-          const allPrice = row.allPrice - 0
+          const allPrice =  row.allPrice - 0
           const taxMoney = (taxRate * 0.01 * allPrice).toFixed(2) - 0
           const taxLastMoney = (allPrice + taxMoney).toFixed(2) - 0
           updateRows.push({
@@ -508,7 +509,7 @@ export const BillModalMixin = {
         }
         editTableVm.setValues(updateRows)
         editTableVm.recalcAllStatisticsColumns()
-        this.autoChangePrice(editTableVm)
+        that.autoChangePrice(editTableVm)
         editTableVm.$forceUpdate()
       })
     },
@@ -588,7 +589,7 @@ export const BillModalMixin = {
                     const rawInfo = mList[i]
                     const item = values[i]
                     const mObj = that.parseInfoToObj(rawInfo)
-                    mObj.allPrice = ((mObj.unitPrice - 0) * (mObj.ratio - 0) * (mObj.operNumber))
+                    mObj.allPrice = ((mObj.unitPrice - 0)* (mObj.operNumber))
                     mObj.taxRate = formTaxRate || 0
                     mObj.taxMoney = (mObj.taxRate * 0.01 * mObj.allPrice)
                     mObj.taxLastMoney = (mObj.allPrice + mObj.taxMoney)
@@ -611,7 +612,7 @@ export const BillModalMixin = {
                   target.$nextTick(() => {
                     that.autoChangePrice(target)
                   })
-                }, newRows.map(item => item.id))
+                }, false,newRows.map(item => item.id))
               })
             }
           })
@@ -727,7 +728,6 @@ export const BillModalMixin = {
     },
     //转为商品对象
     parseInfoToObj(mInfo) {
-      debugger
       return {
         barCode: mInfo.barCode,
         name: mInfo.name,
@@ -739,7 +739,7 @@ export const BillModalMixin = {
         unit: mInfo.commodityUnit,
         sku: mInfo.sku,
         operNumber: 1,
-        unitPrice: mInfo.billPrice,
+        unitPrice: mInfo.billPrice * (mInfo.ratio||1), //单价
         wholesaleDecimal:mInfo.defaultWholesaleDecimal, //销售价
         defaultWholesaleDecimal: mInfo.defaultWholesaleDecimal, //默认销售价 不展示
         defaultPurchaseDecimal: mInfo.defaultPurchaseDecimal, //默认采购价 不展示
@@ -822,10 +822,10 @@ export const BillModalMixin = {
     },
     //改变优惠、本次付款、欠款的值
     autoChangePrice(target) {
-      let allTaxLastMoney = target.getStatisticsValue('taxLastMoney')
-      let discount = this.form.getFieldValue('discount') - 0
+      let allTaxLastMoney = target.getStatisticsValue('taxLastMoney')||0
+      let discount = this.form.getFieldValue('discount') ? this.form.getFieldValue('discount') - 0 : 0
       let otherMoney = this.form.getFieldValue('otherMoney') ? this.form.getFieldValue('otherMoney') - 0 : 0
-      let deposit = this.form.getFieldValue('deposit')
+      let deposit = this.form.getFieldValue('deposit') ? this.form.getFieldValue('deposit') - 0 : 0
       let discountMoney = (discount * 0.01 * allTaxLastMoney).toFixed(2) - 0
       let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
       let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2) - 0
@@ -839,7 +839,7 @@ export const BillModalMixin = {
           discountMoney: discountMoney,
           discountLastMoney: discountLastMoney,
           changeAmount: changeAmountNew,
-          debt: 0,
+          debt: (discountLastMoney + (otherMoney || 0) - deposit - changeAmountNew).toFixed(2),
         })
       })
     },

+ 10 - 0
jshERP-web/src/views/bill/modules/OtherInModal.vue

@@ -33,6 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -77,6 +78,15 @@
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
             <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"

+ 10 - 4
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -33,7 +33,7 @@
                 :dropdownMatchSelectWidth="false"
                 showSearch
                 optionFilterProp="children"
-                @change="handleOrganChange"
+                @change="getTatRate"
               >
                 <div slot="dropdownRender" slot-scope="menu">
                   <v-nodes :vnodes="menu" />
@@ -68,9 +68,6 @@
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               label="仓库名"
-              data-step="4"
-              data-title=""
-              data-intro="仓库名"
             >
               <a-select v-decorator="['depotId',validatorRules.depotId]" placeholder="请选择仓库名" @change="changeDepot($event,refKeys[0])">
                 <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.id">
@@ -81,6 +78,15 @@
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
             <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="税率"
+            >
+              <a-input placeholder="自动带出" disabled v-decorator="['taxRate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
               v-if="inOutManageFlag && !model.billType"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"

+ 55 - 54
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -586,7 +586,7 @@ export default {
           { title: '入库时间', key: 'warehousingTime', width: '200px', type: FormTypes.date },
 
           { title: '备注', key: 'remark', width: '200px', type: FormTypes.input },
-          { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
+          // { title: '关联id', key: 'linkId', width: '120px', type: FormTypes.hidden },
         ],
       },
       confirmLoading: false,
@@ -761,62 +761,63 @@ export default {
       this.$refs.linkBillList.title = '请选择采购订单'
     },
     linkBillListOk(selectBillDetailRows, linkNumber, organId, discountMoney, deposit, remark, depotId, accountId) {
-      // let that = this
-      // this.rowCanEdit = false
-      // this.materialTable.columns[1].type = FormTypes.normal
+      let that = this
+      this.rowCanEdit = false
       // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
       // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
-      // if (selectBillDetailRows && selectBillDetailRows.length > 0) {
-      //   let listEx = []
-      //   let allTaxLastMoney = 0
-      //   for (let j = 0; j < selectBillDetailRows.length; j++) {
-      //     let info = selectBillDetailRows[j]
-      //     if (info.finishNumber > 0) {
-      //       info.operNumber = info.preNumber - info.finishNumber
-      //       info.allPrice = info.operNumber * info.unitPrice - 0
-      //       let taxRate = info.taxRate - 0
-      //       info.taxMoney = ((info.allPrice * taxRate) / 100).toFixed(2) - 0
-      //       info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2) - 0
-      //     }
-      //     info.linkId = info.id
-      //     allTaxLastMoney += info.taxLastMoney
-      //     listEx.push(info)
-      //     this.changeColumnShow(info)
-      //   }
-      //   this.materialTable.dataSource = listEx
+      console.log('selectBillDetailRows', selectBillDetailRows)
+      if (selectBillDetailRows && selectBillDetailRows.length > 0) {
+        let listEx = []
+        let allTaxLastMoney = 0
+        for (let j = 0; j < selectBillDetailRows.length; j++) {
+          let info = selectBillDetailRows[j]
+          if (info.finishNumber > 0) {
+            info.operNumber = info.preNumber - info.finishNumber
+            info.allPrice = info.operNumber * info.unitPrice - 0
+            let taxRate = info.taxRate - 0
+            info.taxMoney = ((info.allPrice * taxRate) / 100).toFixed(2) - 0
+            info.taxLastMoney = (info.allPrice + info.taxMoney).toFixed(2) - 0
+          }
+          info.linkId = info.id
+          allTaxLastMoney += info.taxLastMoney
+          listEx.push(info)
+          this.changeColumnShow(info)
+        }
+        this.materialTable.dataSource = listEx
 
-      //   ///给优惠后金额重新赋值
-      //   allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
-      //   let discount = 0
-      //   if (allTaxLastMoney !== 0) {
-      //     discount = ((discountMoney / allTaxLastMoney) * 100).toFixed(2) - 0
-      //   }
-      //   let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
-      //   let changeAmount = discountLastMoney
-      //   if (deposit) {
-      //     this.depositStatus = true
-      //     changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
-      //   }
-      //   this.$nextTick(() => {
-      //     this.form.setFieldsValue({
-      //       organId: organId,
-      //       linkNumber: linkNumber,
-      //       discount: discount,
-      //       discountMoney: discountMoney,
-      //       discountLastMoney: discountLastMoney,
-      //       deposit: deposit,
-      //       changeAmount: changeAmount,
-      //       accountId: accountId,
-      //       remark: remark,
-      //     })
-      //   })
-      //   //判断后进行仓库的切换
-      //   if (depotId) {
-      //     setTimeout(function () {
-      //       that.batchSetDepotModalFormOk(depotId)
-      //     }, 1000)
-      //   }
-      // }
+        ///给优惠后金额重新赋值
+        allTaxLastMoney = allTaxLastMoney ? allTaxLastMoney : 0
+        let discount = 0
+        if (allTaxLastMoney !== 0) {
+          discount = ((discountMoney / allTaxLastMoney) * 100).toFixed(2) - 0
+        }
+        let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2) - 0
+        let changeAmount = discountLastMoney
+        if (deposit) {
+          this.depositStatus = true
+          changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
+        }
+        this.form.setFieldsValue({
+          organId: organId,
+          linkNumber: linkNumber,
+          discount: discount,
+          discountMoney: discountMoney,
+          discountLastMoney: discountLastMoney,
+          deposit: deposit,
+          changeAmount: changeAmount,
+          accountId: accountId,
+          remark: remark,
+          depotId: depotId,
+        })
+        this.$nextTick(() => {
+          console.log('discount===',this.form.getFieldValue('discount'))
+          this.getTatRate(organId)
+        })
+        //判断后进行仓库的切换
+        if (depotId) {
+          this.changeDepot(depotId, this.refKeys[0])
+        }
+      }
     },
     getUnitInfo(val) {
       this.unitList = val

+ 21 - 21
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -813,9 +813,9 @@ export default {
     ) {
       let that = this
       this.rowCanEdit = false
-      this.materialTable.columns[1].type = FormTypes.normal
-      this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
-      this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
+      // this.materialTable.columns[1].type = FormTypes.normal
+      // this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
+      // this.changeFormTypes(this.materialTable.columns, 'finishNumber', 1)
       if (selectBillDetailRows && selectBillDetailRows.length > 0) {
         let listEx = []
         let allTaxLastMoney = 0
@@ -846,28 +846,28 @@ export default {
           this.depositStatus = true
           changeAmount = (discountLastMoney - deposit).toFixed(2) - 0
         }
+        this.form.setFieldsValue({
+          organId: organId,
+          linkNumber: linkNumber,
+          discount: discount,
+          discountMoney: discountMoney,
+          discountLastMoney: discountLastMoney,
+          deposit: deposit,
+          changeAmount: changeAmount,
+          accountId: accountId,
+          remark: remark,
+          receiverName,
+          receiverPhone,
+          receiverAddress,
+        })
+        this.personList.value = salesMan
         this.$nextTick(() => {
-          this.form.setFieldsValue({
-            organId: organId,
-            linkNumber: linkNumber,
-            discount: discount,
-            discountMoney: discountMoney,
-            discountLastMoney: discountLastMoney,
-            deposit: deposit,
-            changeAmount: changeAmount,
-            accountId: accountId,
-            remark: remark,
-            receiverName,
-            receiverPhone,
-            receiverAddress,
-          })
-          this.personList.value = salesMan
+          console.log('discount===',this.form.getFieldValue('discount'))
+          this.getTatRate(organId)
         })
         //判断后进行仓库的切换
         if (depotId) {
-          setTimeout(function () {
-            that.batchSetDepotModalFormOk(depotId)
-          }, 1000)
+          this.changeDepot(depotId, this.refKeys[0])
         }
       }
     },