فهرست منبع

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 سال پیش
والد
کامیت
c5ed9b71f5

+ 5 - 1
src/components/finance/financialAccount.vue

@@ -135,6 +135,10 @@
       billType: {
         type: String
       },
+      srcType: {
+        type: Number,
+        default: 1,
+      },
       billData: {
         type: Object
       },
@@ -311,7 +315,7 @@
         const itemsList = this.data.map(item => {
           item.corpId = this.corpId;
           item.tradeType = this.billData.optionType?this.billData.optionType: item.tradeType
-          // item.srcType = 1
+          item.srcType = this.srcType
           return item
         })
         const params = {

+ 4 - 4
src/util/keyData.js

@@ -1,3 +1,4 @@
+import { unLock } from "@/api/lock/lock"
 //进入详情页时,保存id和其他参数
 export function inDetailsKey(key, obj) {
   let list = []
@@ -33,8 +34,7 @@ export function delTabsKey(key) {
   let data = list.find(e => e.key == key)
   if (data) {
     //执行解锁接口
-
-
+    unLock(data)
     //执行完接口清除key
     leaveDetailsKey(key)
   }
@@ -47,7 +47,7 @@ export function delAllTabsKey(key) {
     //关闭所有或者当前为首页的其他tab
     list.forEach(e => {
       //执行解锁
-
+      unLock(e)
       //执行完接口清除key
       leaveDetailsKey(e.key)
     });
@@ -56,7 +56,7 @@ export function delAllTabsKey(key) {
     list.forEach(e => {
       if (e.key != key) {
         //执行解锁
-
+        unLock(e)
         //执行完接口清除key
         leaveDetailsKey(e.key)
       }

+ 0 - 1
src/views/approveData/index.vue

@@ -183,7 +183,6 @@ let previousRouterName = ""
               }
             });
           }else{
-            this.$router.$avueRouter.closeTag(row.url);
             this.$router.push({
               path: row.url,
               query: {check : row},

+ 16 - 8
src/views/businessManagement/deliveryNotice/configuration/customerContact.json

@@ -150,10 +150,18 @@
           "trigger": "blur"
         }
       ]
-    },{
+    },
+    {
+      "label": "采购金额",
+      "prop": "purchaseTotalAmount",
+      "index": 9,
+      "width":100,
+      "overHidden": true
+    },
+    {
       "label": "出库数量",
       "prop": "actualQuantity",
-      "index": 9,
+      "index": 10,
       "width":100,
       "cell": false,
       "slot": true,
@@ -168,7 +176,7 @@
     },{
       "label": "出库金额",
       "prop": "deliveryAmount",
-      "index": 10,
+      "index": 11,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -182,7 +190,7 @@
     },{
       "label": "库存数量",
       "prop": "inventoryNumber",
-      "index": 11,
+      "index": 12,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -196,7 +204,7 @@
     },{
       "label": "库存金额",
       "prop": "inventoryAmount",
-      "index": 12,
+      "index": 13,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -210,7 +218,7 @@
     },{
       "label": "到货数量",
       "prop": "arrivalQuantity",
-      "index": 13,
+      "index": 14,
       "width":100,
       "cell": false,
       "slot": true,
@@ -226,7 +234,7 @@
     {
       "label": "积分倍数",
       "prop": "integralMultiples",
-      "index": 14,
+      "index": 15,
       "width":100,
       "cell": false,
       "overHidden": true,
@@ -241,7 +249,7 @@
     {
       "label": "赠送积分",
       "prop": "integral",
-      "index": 15,
+      "index": 16,
       "width":100,
       "cell": false,
       "overHidden": true,

+ 15 - 5
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -1005,7 +1005,8 @@ export default {
         this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
         this.$set(item, "arrivalQuantity", item.actualQuantity)
         this.$set(item, "deliveryAmount", item.amount)
-        this.$set(item, "deliveryAmount", item.amount)
+        this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
+        item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
         this.$set(item, "inventoryNumber", item.storageQuantity)
         this.form.deliveryAmount += Number(item.deliveryAmount)
         this.form.totalQuantity += Number(item.actualQuantity)
@@ -1632,10 +1633,10 @@ export default {
           this.saveLoading = true
           this.form.billType = 'FH'
           // 如果有id解锁,没有跳过
-          this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
+          // !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
           typeSave(this.form).then(res => {
             this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
-            this.detailData.seeDisabled = true;
+            // this.$set(this.detailData, 'seeDisabled', true);
             if (isBack) {
               //成功关闭此页面回到列表页
               this.$emit("goBack");
@@ -1681,12 +1682,12 @@ export default {
         }).then(() => {
           this.editCustomer(true)
         }).catch(() => {
-          this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
+          !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
           this.$emit("goBack");
           this.leaveDetailsKey(this.$route.name)
         })
       } else {
-        this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
+        !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
         this.$emit("goBack");
         this.leaveDetailsKey(this.$route.name)
       }
@@ -1853,6 +1854,8 @@ export default {
         this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
         this.$set(item, 'arrivalQuantity', item.actualQuantity)
         this.$set(item, "srcId", item.id)
+        this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
+        item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
         if (this.goodsActives == "goods") {
           this.$set(item, 'goodType', 0)
         } else {
@@ -1897,6 +1900,7 @@ export default {
       }
     },
     async resetColumn() {
+      this.customerContact = customerContact
       const inSave = await this.delColumnData(
         this.getColumnName(21),
         customerContact
@@ -2004,7 +2008,13 @@ export default {
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {
+            this.saveActives = ''
             this.queryData(this.form.id)
+            this.inDetailsKey(this.$route.name, {
+              moduleName: 'fh',
+              tableName: 'business_delivery',
+              billId: this.form.id,
+            })
             this.detailData.seeDisabled = false;
           })
         }

+ 0 - 5
src/views/businessManagement/deliveryNotice/index.vue

@@ -255,11 +255,6 @@ export default {
         billId: row.id,
         no: localStorage.getItem('browserID')
       }
-      this.inDetailsKey(this.$route.name, {
-        moduleName: 'fh',
-        tableName: 'business_delivery',
-        billId: row.id,
-      })
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {

+ 12 - 5
src/views/businessManagement/purchaseOrder/detailsPageEdit.vue

@@ -1526,10 +1526,10 @@ export default {
           this.form.billType = 'CG'
           this.$set(this.form, 'tradeType', 'GN')
           // 如果有id解锁,没有跳过
-          this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
+          // this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
           typeSave(this.form).then(res => {
             this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
-            this.detailData.seeDisabled = true;
+            // this.$set(this.detailData, 'seeDisabled', true);
             if (isBack) {
               //成功关闭此页面回到列表页
               this.$emit("goBack");
@@ -1583,7 +1583,7 @@ export default {
         exchangeRate: '1',
         taxRate: '0',
         accDate: this.form.businesDate,
-        srcType: 1,
+        srcType: 1, // 1.采购or销售主表货款申请 2. 采购or销售-费用明细申请  3.收发货-费用明细
         tradeType: 'GN',
         optionType: 'GN',
         amount: this.form.orderAmount,
@@ -1664,12 +1664,12 @@ export default {
         }).then(() => {
           this.editCustomer(true)
         }).catch(() => {
-          this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
+          !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
           this.$emit("goBack");
           this.leaveDetailsKey(this.$route.name)
         })
       } else {
-        this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
+        !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'cg',tableName: 'business_order', billId: this.form.id})
         this.$emit("goBack");
         this.leaveDetailsKey(this.$route.name)
       }
@@ -1699,6 +1699,7 @@ export default {
       }
     },
     async resetColumn() {
+      this.customerContact = customerContact
       const inSave = await this.delColumnData(
         this.getColumnName(18),
         customerContact
@@ -1844,6 +1845,12 @@ export default {
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {
+            this.queryData(this.form.id)
+          })
+          this.inDetailsKey(this.$route.name, {
+            moduleName: 'cg',
+            tableName: 'business_order',
+            billId: this.form.id,
           })
           this.detailData.seeDisabled = false;
         }

+ 0 - 5
src/views/businessManagement/purchaseOrder/index.vue

@@ -314,11 +314,6 @@ export default {
         billId: row.id,
         no: localStorage.getItem('browserID')
       }
-      this.inDetailsKey(this.$route.name, {
-        moduleName: 'cg',
-        tableName: 'business_order',
-        billId: row.id,
-      })
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.detailData = {

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

@@ -1350,10 +1350,10 @@ export default {
           if (typeof this.form.corpsTypeId == 'object') {
             this.form.corpsTypeId = this.form.corpsTypeId.join(",")
           }
-          this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
+          // this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
           this.saveLoading = true
           typeSave(this.form).then(res => {
-            this.detailData.seeDisabled = true;
+            // this.$set(this.detailData, 'seeDisabled', true);
             this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
             if (isBack) {
               //成功关闭此页面回到列表页
@@ -1397,12 +1397,12 @@ export default {
         }).then(() => {
           this.editCustomer(true)
         }).catch(() => {
-          this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
+          !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
           this.$emit("goBack");
           this.leaveDetailsKey(this.$route.name)
         })
       } else {
-        this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
+        !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'sh',tableName: 'business_delivery', billId: this.form.id})
         this.$emit("goBack");
         this.leaveDetailsKey(this.$route.name)
       }
@@ -1432,6 +1432,7 @@ export default {
       }
     },
     async resetColumn() {
+      this.customerContact = customerContact
       const inSave = await this.delColumnData(
         this.getColumnName(24),
         customerContact
@@ -1474,6 +1475,12 @@ export default {
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {
+            this.queryData(this.form.id)
+          })
+          this.inDetailsKey(this.$route.name, {
+            moduleName: 'sh',
+            tableName: 'business_delivery',
+            billId: this.form.id,
           })
           this.detailData.seeDisabled = false;
         }

+ 0 - 5
src/views/businessManagement/receipt/index.vue

@@ -258,11 +258,6 @@ export default {
         billId: row.id,
         no: localStorage.getItem('browserID')
       }
-      this.inDetailsKey(this.$route.name, {
-        moduleName: 'sh',
-        tableName: 'business_delivery',
-        billId: row.id,
-      })
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.detailData = {

+ 14 - 7
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -2060,7 +2060,7 @@ export default {
           orderItemIds: lsit
         }
         generateShipment(data).then(res => {
-          this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
+          // this.$router.$avueRouter.closeTag("/businessManagement/deliveryNotice/index");
           this.$router.push({
             path: "/businessManagement/deliveryNotice/index",
             query: {
@@ -2891,10 +2891,10 @@ export default {
           }
           this.form.billType = 'XS'
           // 如果有id解锁,没有跳过
-          this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
+          // this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
           this.saveLoading = true
           typeSave(this.form).then(res => {
-            this.detailData.seeDisabled = true;
+            // this.$set(this.detailData, 'seeDisabled', true);
             this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
             if (isBack) {
               //成功关闭此页面回到列表页
@@ -3036,12 +3036,12 @@ export default {
         }).then(() => {
           this.editCustomer(true)
         }).catch(() => {
-          this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
+          !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
           this.$emit("goBack");
           this.leaveDetailsKey(this.$route.name)
         })
       } else {
-        this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
+        !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'xs',tableName: 'business_order', billId: this.form.id})
         this.$emit("goBack");
         this.leaveDetailsKey(this.$route.name)
       }
@@ -3071,6 +3071,7 @@ export default {
       }
     },
     async resetColumn() {
+      this.customerContact = customerContact
       const inSave = await this.delColumnData(
         this.getColumnName(15),
         customerContact
@@ -3132,7 +3133,7 @@ export default {
                 actualQuantitySum = _.add(actualQuantitySum, Number(e.actualQuantity));
                 integralSum = _.add(integralSum, Number(e.integral));
               })
-            };
+            }
             // 订货数量合计
             if (item.property == "orderQuantity") {
               sums[index] = orderQuantitySum ? orderQuantitySum.toFixed(2) : "0.00";
@@ -3268,7 +3269,6 @@ export default {
             this.pageLoading = false
           })
         })
-      } else {
       }
     },
     // 验证新旧值对比
@@ -3334,6 +3334,13 @@ export default {
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {
+            this.saveActives = ''
+            this.queryData(this.form.id)
+          })
+          this.inDetailsKey(this.$route.name, {
+            moduleName: 'xs',
+            tableName: 'business_order',
+            billId: this.form.id,
           })
           this.detailData.seeDisabled = false;
         }

+ 0 - 5
src/views/businessManagement/salesOrder/index.vue

@@ -311,11 +311,6 @@ export default {
         billId: row.id,
         no: localStorage.getItem('browserID')
       }
-      this.inDetailsKey(this.$route.name, {
-        moduleName: 'xs',
-        tableName: 'business_order',
-        billId: row.id,
-      })
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.detailData = {

+ 38 - 2
src/views/purchase/contract/detailsPage.vue

@@ -367,6 +367,7 @@
       <financial-account
         :billType="billType"
         :billData="billData"
+        :checkData="checkData"
         @choceFun="choceFun"
       >
       </financial-account>
@@ -413,6 +414,7 @@ export default {
   },
   data() {
     return {
+      lockData:{},
       form: {},
       disabled: false,
       customerContact: {},
@@ -446,6 +448,12 @@ export default {
         placeholder:'请点击右边按钮选择',
         dicData:[]
       },
+      checkData:{
+        url:"/financialManagement/paymentRequest/index",
+        pageStatus:"this.$store.getters.pqStatus",
+        pageLabel:"付费申请",
+        checkType: 'ffsq'
+      },
       //对比新旧数据信息
       oldContactsData:[],
       oldForm:{},
@@ -732,6 +740,14 @@ export default {
   },
   async created() {
     this.customerContact = await this.getColumnData(this.getColumnName(37), customerContact);
+    // this.lockData = {
+    //   moduleName: 'cg',
+    //   tableName: 'business_order',
+    //   billId: this.detailData.id,
+    //   billNo:this.detailData.srcBillNo,
+    //   no: localStorage.getItem('browserID')
+    // }
+
     //币别
     this.getWorkDicts("currency").then(res =>{
       this.currencyDic = res.data.data
@@ -948,10 +964,23 @@ export default {
         this.copyData()
       }
     },
-    openDisabled(){
+
+    openDisabled() {
       this.viewDisabled = false
       this.checkDisabled = false
     },
+
+    // async openDisabled(){
+    //   this.viewDisabled = false
+    //   this.checkDisabled = false
+    //   if(!await this.checkLocks(this.lockData)){
+    //     this.onLock(this.lockData)
+    //     this.viewDisabled = false
+    //     this.checkDisabled = false
+    //   }else{
+    //     this.$message.warning("此订单已被锁定,请稍后操作!")
+    //   }
+    // },
     selectionContact(row){
       this.selectContact = row;
     },
@@ -1169,7 +1198,13 @@ export default {
         this.$message.success("复制成功!")
       }
     },
-    backToList() {
+     backToList() {
+      //如果单据已被锁定 并且编辑按钮存在  则直接返回
+      // if(await this.checkLocks(this.lockData) && this.viewDisabled){
+      //   this.$emit("goBack");
+      //   return
+      // }
+
       this.orderFeesList = this.$refs.feeInfo.submitData();
       if(contrastObj(this.form,this.oldForm) || contrastList(this.contactsData,this.oldContactsData)
         || contrastList(this.orderFeesList,this.oldFeesList) || contrastList(this.orderFilesList,this.oldFilesList)
@@ -1181,6 +1216,7 @@ export default {
         }).then(() => {
           this.editCustomer(true)
         }).catch(()=>{
+          // this.unLock(this.lockData) //解锁
           this.$emit("goBack");
         })
       }else{