Sfoglia il codice sorgente

国内贸易修改

lichao 3 anni fa
parent
commit
d2dfae407e

+ 2 - 2
src/views/businessManagement/purchaseOrder/configuration/customerContact.json

@@ -148,8 +148,8 @@
         }
       ]
     },{
-      "label": "最新单价",
-      "prop": "price",
+      "label": "采购价格",
+      "prop": "purchaseAmount",
       "index": 6,
       "width":100,
       "cell": false,

+ 74 - 16
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -23,7 +23,7 @@
             审核处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
-            <el-dropdown-item :disabled="true">请核数据</el-dropdown-item>
+            <el-dropdown-item @click.native="pleaseCheck">请核数据</el-dropdown-item>
             <el-dropdown-item v-if="false">审核进度</el-dropdown-item>
             <el-dropdown-item v-if="false">撤销请核</el-dropdown-item>
           </el-dropdown-menu>
@@ -540,7 +540,7 @@ import { contrastObj, contrastList } from "@/util/contrastData";
 //账单组件
 import ApplyPayment from "../../../components/finance/applyPayment";
 import  billApplication from "@/components/bill/billApplication";
-import { getlistBankBy } from "@/api/basicData/configuration"
+import { getlistBankBy, pleaseCheck, } from "@/api/basicData/configuration"
 import feeInfo from "@/components/fee-info/main";
 import {
   isDiscount,
@@ -875,21 +875,24 @@ export default {
       this.pageLoading = true
       detail(id).then(res => {
         this.form = res.data.data;
+        this.contactsData = this.form.itemsVOList? this.form.itemsVOList: []
+        this.advantageProjectData = this.form.orderFeesList? this.form.orderFeesList: []
+        this.bankOfDepositData = this.form.orderFilesList? this.form.orderFilesList: []
         if (!this.form.itemsVOList) {
           this.contactsData = []
         } else {
           this.contactsData = this.form.itemsVOList
         }
-        if (!this.form.orderFeesList) {
-          this.advantageProjectData = []
-        } else {
-          this.advantageProjectData = this.form.orderFeesList
-        }
-        if (!this.form.orderFilesList) {
-          this.bankOfDepositData = []
-        } else {
-          this.bankOfDepositData = this.form.orderFilesList
-        }
+        // if (!this.form.orderFeesList) {
+        //   this.advantageProjectData = []
+        // } else {
+        //   this.advantageProjectData = this.form.orderFeesList
+        // }
+        // if (!this.form.orderFilesList) {
+        //   this.bankOfDepositData = []
+        // } else {
+        //   this.bankOfDepositData = this.form.orderFilesList
+        // }
         if (this.form.corpsName) {
           this.configuration.dicData = this.form.corpsName
         }
@@ -1401,14 +1404,14 @@ export default {
     // 计算费用
     changeContractAmt(row) {
       let orderQuantity = 0;
-      let price = 0;
+      let purchaseAmount = 0;
       if (row.price) {
-        price = row.price;
+        purchaseAmount = row.purchaseAmount;
       }
       if (row.orderQuantity) {
         orderQuantity = row.orderQuantity;
       }
-      this.$set(row, "amount", Number(orderQuantity) * Number(price)).toFixed(2);
+      this.$set(row, "amount", Number(orderQuantity) * Number(purchaseAmount)).toFixed(2);
     },
     // 去重
     removeRepeat() {
@@ -1431,6 +1434,10 @@ export default {
               return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
             }
           }
+          this.form.orderAmount = 0;
+          this.contactsData.forEach(item => {
+            this.form.orderAmount = Number(this.form.orderAmount) + Number(item.amount)
+          })
           //商品信息
           this.form.itemsVOList = this.contactsData
           // this.form.orderFeesList = this.advantageProjectData
@@ -1492,7 +1499,8 @@ export default {
         accDate: this.form.businesDate,
         srcType: 1,
         tradeType: 'GN',
-        optionType: 'GN'
+        optionType: 'GN',
+        amount: this.form.orderAmount
       }
       if(bool){ //申请货款
         this.billData.srcId = -1
@@ -1646,6 +1654,56 @@ export default {
     onClose(val) {
       this.switchDialog = val;
     },
+    //请核
+    pleaseCheck() {
+      // this.verification()
+      if (this.verification()) {
+        this.$confirm("您确定提交此次申请吗?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          const data = {
+            id : this.form.id,
+            checkType: 'cgqh',
+            url: '/businessManagement/purchaseOrder/index',
+            pageStatus:"this.$store.getters.domPurStatus",
+            pageLabel:"采购订单(N)",
+            checkFlag: 1,
+          }
+          this.pageLoading = true
+          pleaseCheck(data).then(res => {
+            this.$message.success('请核成功')
+            // this.pageLoading = false
+            this.saveActives = ''
+            this.queryData(this.form.id)
+          }).finally(() => {
+            this.pageLoading = false
+          })
+        })
+      } else {
+      }
+    },
+    verification() {
+      let getFeeList = this.$refs.feeInfo.submitData()
+      if (contrastObj(this.form, this.oldForm) ||
+        contrastList(this.contactsData, this.oldGoodsList) ||
+        // contrastList(getFeeList, this.oldFeesList) ||
+        contrastList(this.bankOfDepositData, this.oldUploadList)
+      ) {
+        this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.editCustomer(false)
+        }).catch(() => {
+          return false;   //取消改动数据
+        })
+      } else {
+        return true;  //没有动过数据
+      }
+    },
   }
 }
 </script>

+ 7 - 1
src/views/businessManagement/purchaseOrder/index.vue

@@ -64,6 +64,7 @@
             icon="el-icon-delete"
             size="small"
             @click.stop="rowDel(scope.row,scope.index)"
+            :disabled="scope.row.status > 0"
           >删除
           </el-button>
         </template>
@@ -262,6 +263,7 @@ export default {
         seeDisabled: true,
       };
       this.isShow = false;
+      this.$store.commit("DOMCG_IN_DETAIL");
     },
     //新增跳转页面
     beforeOpen(row, index) {
@@ -269,12 +271,14 @@ export default {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("DOMCG_IN_DETAIL");
     },
     editOpen(row, index) {
       this.detailData = {
         id: row.id,
       };
       this.isShow = false;
+      this.$store.commit("DOMCG_IN_DETAIL");
     },
     // 复制新单
     copyOrder() {
@@ -283,6 +287,7 @@ export default {
         copyId: id,
       };
       this.isShow = false;
+      this.$store.commit("DOMCG_IN_DETAIL");
     },
     //点击新增时触发
     beforeClose(done) {
@@ -427,7 +432,8 @@ export default {
           taxRate: '0',
           accDate: item.businesDate,
           srcType: 1,
-          tradeType: 'GN'
+          tradeType: 'GN',
+          amount: item.orderAmount
         }
         a.push(form)
       })

+ 2 - 2
src/views/businessManagement/receipt/configuration/customerContact.json

@@ -123,7 +123,7 @@
       "prop": "purchaseQuantity",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {
@@ -137,7 +137,7 @@
       "prop": "purchaseAmount",
       "index": 6,
       "width":100,
-      "cell": true,
+      "cell": false,
       "overHidden": true,
       "rules": [
         {

+ 4 - 0
src/views/businessManagement/receipt/detailsPageEdit.vue

@@ -897,6 +897,10 @@ export default {
     },
     // 入库数量变化时调用
     actualQuantityChange(row) {
+      if (Number(row.actualQuantity) > Number(row.purchaseQuantity)) {
+        this.$message.error('入库数量不能超过采购数量')
+        row.actualQuantity = 0
+      }
       // if (row.scale) {
       //   row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
       // }

+ 19 - 33
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -83,7 +83,7 @@
     <div class="customer-main">
       <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
         <containerTitle title="基础资料"></containerTitle>
-        <basic-container style="margin-bottom: 10px">
+        <basic-container :showBtn="true">
           <el-row>
             <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
@@ -155,7 +155,7 @@
           </el-row>
         </basic-container>
         <containerTitle title="发货信息"></containerTitle>
-        <basic-container style="margin-bottom: 10px">
+        <basic-container :showBtn="true">
           <el-row>
             <el-col v-for="(item,index) in contactInformation.column" :key="index" :span="item.span?item.span:8">
               <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
@@ -327,7 +327,8 @@
               <el-button type="warning"
                          icon="el-icon-plus"
                          size="small"
-                         :disabled="selection.length < 1 || detailData.seeDisabled || !form.status || form.status < 3"
+                         :disabled="selection.length < 1 || detailData.seeDisabled || !form.status || form.status < 3
+                         || (Number(form.debitAmount) !== Number(form.settlmentAmount))"
                          @click="getShipmentD"
                          v-show="goodsActives == 'goods'">生成客户确认
               </el-button>
@@ -971,8 +972,9 @@ export default {
               }
             ]
           }, {
-            label: '使用溢付款',
-            prop: 'caseOverPayment',
+            label: '其他费用',
+            prop: 'otherAmount',
+            type: 'number',
             rules: [
               {
                 required: false,
@@ -980,7 +982,7 @@ export default {
                 trigger: 'blur'
               }
             ]
-          }, {
+          },{
             label: '总溢付款',
             prop: 'overPayment',
             disabled: true,
@@ -1058,17 +1060,6 @@ export default {
                 trigger: 'blur'
               }
             ]
-          },{
-            label: '其他费用',
-            prop: 'otherAmount',
-            type: 'number',
-            rules: [
-              {
-                required: false,
-                message: ' ',
-                trigger: 'blur'
-              }
-            ]
           },
           {
             label: '保证金',
@@ -2770,10 +2761,10 @@ export default {
     },
     // 计算应收未收款
     computedCost() {
-      if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
-        this.form.caseOverPayment = 0;
-        return this.$message.error('本次使用的溢付款不能超过总溢付款')
-      }
+      // if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
+      //   this.form.caseOverPayment = 0;
+      //   return this.$message.error('本次使用的溢付款不能超过总溢付款')
+      // }
       if (Number(this.form.thisUsedProfit) > Number(this.form.profit)) {
         this.form.thisUsedProfit = 0;
         return this.$message.error('本次使用的返利不能超过返利余额')
@@ -2783,19 +2774,10 @@ export default {
       // 已收款
       let settlmentAmount = this.form.settlmentAmount? this.form.settlmentAmount: 0
       // 本次溢付款
-      let caseOverPayment = this.form.caseOverPayment? this.form.caseOverPayment: 0
+      // let caseOverPayment = this.form.caseOverPayment? this.form.caseOverPayment: 0
       // 本次试用返利
       let thisUsedProfit = this.form.thisUsedProfit? this.form.thisUsedProfit: 0
-      // if (this.form.orderAmount) {
-      //   orderAmount = this.form.orderAmount
-      // }
-      // if (this.form.settlmentAmount) {
-      //   settlmentAmount = this.form.settlmentAmount
-      // }
-      // if (this.form.caseOverPayment) {
-      //   caseOverPayment = this.form.caseOverPayment
-      // }
-      this.$set(this.form, 'debitAmount', ((Number(orderAmount) - Number(caseOverPayment) - Number(thisUsedProfit)).toFixed(2)))
+      this.$set(this.form, 'debitAmount', ((Number(orderAmount) - Number(thisUsedProfit)).toFixed(2)))
       this.$set(this.form, "balanceAmount", (Number(this.form.debitAmount) - Number(settlmentAmount)).toFixed(2));
     },
     quantityChange(row) {
@@ -3079,10 +3061,14 @@ export default {
           const data = {
             id : this.form.id,
             checkType: 'xsqh',
-            url: '/businessManagement/salesOrder/index'
+            url: '/businessManagement/salesOrder/index',
+            pageStatus:"this.$store.getters.domSaleStatus",
+            pageLabel:"销售订单(N)",
+            checkFlag: 2,
           }
           this.pageLoading = true
           pleaseCheck(data).then(res => {
+            this.$message.success('请核成功')
             // this.pageLoading = false
             this.saveActives = ''
             this.queryData(this.form.id)