Browse Source

业务锁修改

lichao 3 years ago
parent
commit
571909e02b

+ 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 = {