浏览代码

Merge remote-tracking branch 'origin/dev' into dev

qinbai 3 年之前
父节点
当前提交
972746044c

+ 25 - 6
src/views/financialManagement/paymentSettle/paymentSettle.vue

@@ -129,12 +129,31 @@
       },
       //编辑打开
       editOpen(row, status){
-        this.detailData = {
-          id: row.id,
-          status: status
-        };
-        this.show = false;
-        this.$store.commit("PAY_IN_DETAIL");
+        const data = {
+          moduleName: 'ff',
+          tableName: 'finance_settlement',
+          billId: row.id,
+          no: 1
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.detailData = {
+              disabled: true,
+              id: row.id,
+              status: status
+            };
+            this.show = false;
+            this.$store.commit("PAY_IN_DETAIL");
+          }
+        }).catch(error => {
+          this.detailData = {
+            disabled: true,
+            id: row.id,
+            status: status
+          };
+          this.show = false;
+          this.$store.commit("PAY_IN_DETAIL");
+        })
       },
       rowDel(row, index, done) {
         if(row.id){

+ 46 - 11
src/views/financialManagement/paymentSettle/paymentSettleDetailsPage.vue

@@ -6,12 +6,17 @@
                    @click="backToList">返回列表
         </el-button>
         <div class="upper_right_button">
-
+          <el-button
+            type="primary"
+            size="small"
+            @click="editHandle"
+            v-if="editDisable"
+          >编 辑</el-button>
           <el-button type="warning"
                      class="el-button--small-yh"
                      size="small"
                      :loading="buttonLoading"
-                     :disabled="!form.id"
+                     :disabled="!form.id || editDisable"
                      @click.stop="confirmSettlement"
           >{{financeButton?"付费":"撤销付费"}}
           </el-button>
@@ -20,6 +25,7 @@
                      size="small"
                      :loading="buttonLoading"
                      @click.stop="saveSettlement"
+                     :disabled="editDisable"
           >保存数据
           </el-button>
         </div>
@@ -33,7 +39,7 @@
             <crop-select
               v-model="form.corpId"
               corpType="KG"
-              :disabled="!financeDisabled && form.id"
+              :disabled="(!financeDisabled && form.id) || editDisable"
               @getCorpData="returnBack"
               style="width: 100%"
             ></crop-select>
@@ -41,7 +47,7 @@
           <template slot="accountNo">
             <el-select v-model="form.accountNo"
                        placeholder="请选择"
-                       :disabled="!financeDisabled && form.id"
+                       :disabled="(!financeDisabled && form.id) || editDisable"
                        @change="accountNoChange"
                        clearable
                        filterable>
@@ -80,7 +86,7 @@
                        size="small"
                        :loading="buttonLoading"
                        icon="el-icon-shopping-cart-2"
-                       :disabled="!financeButton"
+                       :disabled="!financeButton || editDisable"
                        @click="selectPurchase">选择采购合同
             </el-button>
           </template>
@@ -89,7 +95,7 @@
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeButton"
+              :disabled="!financeButton || editDisable"
               @click.stop="rowCell(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
@@ -97,7 +103,7 @@
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeButton"
+              :disabled="!financeButton || editDisable"
               @click.stop="rowDel(scope.row,scope.index)"
             >删除
             </el-button>
@@ -387,6 +393,7 @@
         oldDataList:[],
         category: '',
         allAmount: 0,
+        editDisable: false,
       }
     },
     components:{
@@ -414,7 +421,7 @@
       this.getWorkDicts("currency").then(res =>{
         this.currencyDic = res.data.data
       })
-
+      this.detailData.disabled && (this.editDisable = true)
       if (this.detailData.id) {
         this.buttonLoading = true
         this.id = this.detailData.id;//字符串转数字  超长用BigInt
@@ -593,9 +600,12 @@
               itemsList:this.dataList,
               settlementType:1
             }
-
+// 如果有id解锁,没有跳过
+            this.form.id && this.unLock({moduleName: 'ff',tableName: 'finance_settlement', billId: this.form.id})
             saveOrEdit(params).then(res=>{
               this.$message.success("操作成功!")
+              this.detailData.disabled = true
+              this.editDisable = true
               this.afterEcho(res.data.data)
               done();
             }).finally(()=>{
@@ -615,7 +625,7 @@
         this.oldForm = Object.assign({},this.form);
         this.financeDisabled =  this.form.financeStatus == "待结算"?true:false;
         //审核状态为空时  说明为新单进来
-        if(this.financeDisabled){
+        if(this.financeDisabled || !this.editDisable){
           this.financeButton = true
           this.option.column.forEach(item =>{
             if( item.prop === "remark" || item.prop === "settlementDate"){
@@ -627,7 +637,7 @@
             }
           })
         }
-        else{
+        if (!this.financeDisabled || this.editDisable){
           this.financeButton = false
           this.option.column.forEach(item =>{
             if( item.prop === "remark"){
@@ -685,6 +695,31 @@
           return this.$message.error('本次使用的溢付款不能超过总溢付款')
         }
       },
+      editHandle() {
+        const data = {
+          moduleName: 'ff',
+          tableName: 'finance_settlement',
+          billId: this.form.id,
+          no: 1
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.onLock(data).then(response => {
+            })
+            this.detailData.disabled = false;
+            this.editDisable = false;
+            this.buttonLoading = true
+            getDetail(this.form.id).then(data => {
+              this.afterEcho(data.data.data)
+            }).finally(()=>{
+              this.buttonLoading = false
+            })
+          }
+        }).catch(error => {
+        }).finally(() => {
+          this.buttonLoading = false
+        })
+      },
     }
   }
 </script>

+ 23 - 5
src/views/financialManagement/receiptSettle/receiptSettle.vue

@@ -116,11 +116,29 @@
       },
       //编辑打开
       editOpen(row,status){
-        this.detailData = {
-          id: row.id,
-          status: status
-        };
-        this.show = false;
+        const data = {
+          moduleName: 'sf',
+          tableName: 'finance_settlement',
+          billId: row.id,
+          no: 1
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.detailData = {
+              disabled: true,
+              id: row.id,
+              status: status
+            };
+            this.show = false;
+          }
+        }).catch(error => {
+          this.detailData = {
+            disabled: true,
+            id: row.id,
+            status: status
+          };
+          this.show = false;
+        })
       },
       rowDel(row, index, done) {
         if(row.id){

+ 48 - 11
src/views/financialManagement/receiptSettle/receiptSettleDetailsPage.vue

@@ -6,16 +6,22 @@
                    @click="backToList">返回列表
         </el-button>
         <div class="upper_right_button">
+          <el-button
+            type="primary"
+            size="small"
+            @click="editHandle"
+            v-if="editDisable"
+          >编 辑</el-button>
           <el-button type="primary"
                      size="small"
-                     :disabled="!form.id"
+                     :disabled="!form.id || editDisable"
                      @click="postMessage"
           >发送消息</el-button>
           <el-button type="warning"
                      size="small"
                      class="el-button--small-yh"
                      :buttonLoading="buttonLoading"
-                     :disabled="!form.id"
+                     :disabled="!form.id || editDisable"
                      @click.stop="confirmSettlement"
           >{{financeDisabled?"收费":"撤销收费"}}
           </el-button>
@@ -23,7 +29,7 @@
                      type="primary"
                      size="small"
                      :buttonLoading="buttonLoading"
-                     :disabled="!financeDisabled"
+                     :disabled="!financeDisabled || editDisable"
                      @click.stop="saveSettlement"
           >保存数据
           </el-button>
@@ -38,7 +44,7 @@
             <crop-select
               v-model="form.corpId"
               corpType="KG"
-              :disabled="!financeDisabled"
+              :disabled="!financeDisabled || editDisable"
               @getCorpData="returnBack"
               style="width: 100%"
             ></crop-select>
@@ -46,7 +52,7 @@
           <template slot="accountNo">
             <el-select v-model="form.accountNo"
                        placeholder="请选择"
-                       :disabled="!financeDisabled"
+                       :disabled="!financeDisabled || editDisable"
                        @change="accountNoChange"
                        clearable
                        filterable>
@@ -65,7 +71,7 @@
               v-model="form.caseOverPayment"
               @change="caseOverPaymentChange"
               v-input-limit="2"
-              :disabled="dataList.length == 0"
+              :disabled="dataList.length == 0 || !financeDisabled || editDisable"
             ></el-input>
           </template>
           <template slot="remark">
@@ -96,7 +102,7 @@
             <el-button type="primary"
                        size="small"
                        icon="el-icon-shopping-cart-2"
-                       :disabled="!financeDisabled"
+                       :disabled="!financeDisabled || editDisable"
                        :buttonLoading="buttonLoading"
                        @click="selectRecipt"
             >选择销售合同
@@ -125,7 +131,7 @@
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeDisabled"
+              :disabled="!financeDisabled || editDisable"
               @click.stop="rowCell(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
@@ -133,7 +139,7 @@
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeDisabled"
+              :disabled="!financeDisabled || editDisable"
               @click.stop="rowDel(scope.row,scope.index)"
             >删除
             </el-button>
@@ -403,6 +409,7 @@
             value: '停用',
             label: '停用'
           }],
+        editDisable: false, //编辑状态禁用
       }
     },
     created() {
@@ -427,6 +434,7 @@
       this.getWorkDicts("currency").then(res =>{
         this.currencyDic = res.data.data
       })
+      this.detailData.disabled && (this.editDisable = true)
       if (this.detailData.id) {
         this.buttonLoading = true
         this.id = this.detailData.id;//字符串转数字  超长用BigInt
@@ -610,8 +618,12 @@
               settlementType:1
             }
 
+            // 如果有id解锁,没有跳过
+            this.form.id && this.unLock({moduleName: 'sf',tableName: 'finance_settlement', billId: this.form.id})
             saveOrEdit(params).then(res=>{
               this.$message.success("操作成功!")
+              this.detailData.disabled = true
+              this.editDisable = true
               this.afterEcho(res.data.data)
             }).finally(()=>{
               this.buttonLoading = false
@@ -632,7 +644,7 @@
 
         this.financeDisabled = this.form.financeStatus === "待结算"?true:false;
 
-        if(this.financeDisabled){
+        if(this.financeDisabled || !this.editDisable){
           this.option.column.forEach(item =>{
             if( item.prop === "remark"){
               this.$set(item,"disabled",false)
@@ -643,7 +655,7 @@
             }
           })
         }
-        if(this.financeDisabled === false){
+        if(this.financeDisabled === false || this.editDisable){
           this.option.column.forEach(item =>{
             if( item.prop === "remark"){
               this.$set(item,"disabled",false)
@@ -710,6 +722,31 @@
       closeDialog() {
         this.messageVisble = false
       },
+      editHandle() {
+        const data = {
+          moduleName: 'sf',
+          tableName: 'finance_settlement',
+          billId: this.form.id,
+          no: 1
+        }
+        this.checkLock(data).then(res => {
+          if (res.data.code == 200) {
+            this.onLock(data).then(response => {
+            })
+            this.detailData.disabled = false;
+            this.editDisable = false;
+            this.buttonLoading = true
+            getDetail(this.form.id).then(data => {
+              this.afterEcho(data.data.data)
+            }).finally(()=>{
+              this.buttonLoading = false
+            })
+          }
+        }).catch(error => {
+        }).finally(() => {
+          this.buttonLoading = false
+        })
+      },
     }
   }
 </script>