Prechádzať zdrojové kódy

仓储协议费修改

wengyuwen 4 rokov pred
rodič
commit
6ab93f428b
1 zmenil súbory, kde vykonal 123 pridanie a 40 odobranie
  1. 123 40
      src/views/warehouseBusiness/agreement/index.vue

+ 123 - 40
src/views/warehouseBusiness/agreement/index.vue

@@ -178,7 +178,7 @@
             size="mini"
             type="text"
             icon="el-icon-view"
-            @click="check(scope.row,0)"
+            @click="check_s(scope.row,0)"
             v-hasPermi="['agreement:agreementStorage:edit']"
           >查看
           </el-button>
@@ -231,8 +231,8 @@
     />
 
     <!-- 添加或修改仓储费对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="65%" append-to-body :before-close="handleClose"
-               :close-on-click-modal="false" :show-close="false"
+    <el-dialog :title="title" :visible.sync="open" width="65%" append-to-body :show-close="colseButton"
+               :close-on-click-modal="false"
     >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px"
                style="display: flex;flex-wrap: wrap;"
@@ -297,7 +297,7 @@
           </el-select>
         </el-form-item>
       </el-form>
-      <el-button type="primary" @click="submit" :disabled="notChange" v-if="form.fBillstatus < 4">请 核</el-button>
+      <el-button type="primary" @click="submit" :disabled="notChange">请 核</el-button>
 
       <div class="dialogTableTitle flex a-center jlr">
         <h2>标题</h2>
@@ -430,8 +430,8 @@
         <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
         <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
         <el-button v-if="approve === true" @click="goApproval">审批</el-button>
-        <el-button type="danger" :disabled="disappear" @click="backApproval" v-if="form.fBillstatus == '4'">撤销审批</el-button>
-        <el-button type="info" v-if="notChange" @click="addOrUpdateHandle()">查看审批流</el-button>
+        <el-button type="danger" :disabled="disappear" @click="backApproval" v-if="form.fBillstatus == '4' && Operator == Lander">撤销审批</el-button>
+        <el-button type="info" v-if="form.fBillstatus >= 3" @click="addOrUpdateHandle()">查看审批流</el-button>
         <el-button type="success" @click="backrRconciliation" v-if="form.fBillstatus == '6'">撤销请核</el-button>
         <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
         <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
@@ -476,6 +476,7 @@ export default {
   },
   data() {
     return {
+      colseButton:true,
       cancelButton:true,
       // 审批状态
       approve:false,
@@ -567,6 +568,12 @@ export default {
         ],
         tPackages:[
           { required: true, message: ' ', trigger: 'blur' }
+        ],
+        fBegindate:[
+          { required: true, message: ' ', trigger: 'blur' }
+        ],
+        fEnddate:[
+          { required: true, message: ' ', trigger: 'blur' }
         ]
       }
     }
@@ -640,6 +647,7 @@ export default {
       if(this.approval) {
 
         this.approval = JSON.parse(this.approval)
+        this.colseButton = false
         this.hide = false
         this.open = true
         this.notChange = true
@@ -693,13 +701,74 @@ export default {
         this.Lander = response.user.userName
       })
     },
+    check_s(row, res) {
+      this.disappear = true
+      this.notChange = true
+      this.browseStatus = true
+      getAgreement(row.fId).then(response => {
+        this.Operator = response.data.corps.createBy
+        this.deptName = response.data.dept.deptName
+        this.form = response.data.tWarehouseAgreement
+        this.fMblnoOptions = response.data.corps
+        this.agreementitemsList = response.data.tWarehouseAgreementitems
+        for (let item in this.agreementitemsList) {
+          this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
+          // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
+        }
+        this.fWbuOptions = response.data.feesList
+        this.add = row
+        this.title = '修改仓储费'
+        // if (res == 1) {
+        //   this.notChange = true
+        //   if (this.Operator == this.Lander) {
+        //     this.disappear = false
+        //     this.reset()
+        //     // const fId = row.fId || this.ids
+        //     getAgreement(row.fId).then(response => {
+        //       this.deptName = response.data.dept.deptName
+        //       this.form = response.data.tWarehouseAgreement
+        //       this.fMblnoOptions = response.data.corps
+        //       this.agreementitemsList = response.data.tWarehouseAgreementitems
+        //       for (let item in this.agreementitemsList) {
+        //         this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
+        //         // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
+        //       }
+        //       this.fWbuOptions = response.data.feesList
+        //       this.add = row
+        //       this.open = true
+        //     })
+        //   }else {
+        //     this.notChange = true
+        //   }
+        // }else{
+        //   this.notChange = true
+        //   this.reset()
+        // }
+      })
+      const fId = row.fId || this.ids
+      getAgreement(row.fId).then(response => {
+        this.deptName = response.data.dept.deptName
+        this.form = response.data.tWarehouseAgreement
+        this.fMblnoOptions = response.data.corps
+        this.agreementitemsList = response.data.tWarehouseAgreementitems
+        for (let item in this.agreementitemsList) {
+          this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
+          // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
+        }
+        this.fWbuOptions = response.data.feesList
+        this.add = row
+        this.open = true
+      })
+    },
+
     // 查看按钮
     check(row, res) {
       this.disappear = false
       this.notChange = true
       this.browseStatus = true
       getAgreement(row.fId).then(response => {
-        this.Operator = response.data.corps.createBy
+        console.log(response.data.corps[0].createBy)
+        this.Operator = response.data.corps[0].createBy
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps
@@ -711,35 +780,36 @@ export default {
         this.fWbuOptions = response.data.feesList
         this.add = row
         this.title = '修改仓储费'
-        if (res == 1) {
-          this.notChange = true
-          if (this.Operator == this.Lander) {
-            this.disappear = false
-            this.reset()
-            // const fId = row.fId || this.ids
-            getAgreement(row.fId).then(response => {
-              this.deptName = response.data.dept.deptName
-              this.form = response.data.tWarehouseAgreement
-              this.fMblnoOptions = response.data.corps
-              this.agreementitemsList = response.data.tWarehouseAgreementitems
-              for (let item in this.agreementitemsList) {
-                this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
-                // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
-              }
-              this.fWbuOptions = response.data.feesList
-              this.add = row
-              this.open = true
-            })
-          }else {
-            this.notChange = true
-          }
-        }else{
-          this.notChange = true
-          this.reset()
-        }
+        // if (res == 1) {
+        //   this.notChange = true
+        //   if (this.Operator == this.Lander) {
+        //     this.disappear = false
+        //     this.reset()
+        //     // const fId = row.fId || this.ids
+        //     getAgreement(row.fId).then(response => {
+        //       this.deptName = response.data.dept.deptName
+        //       this.form = response.data.tWarehouseAgreement
+        //       this.fMblnoOptions = response.data.corps
+        //       this.agreementitemsList = response.data.tWarehouseAgreementitems
+        //       for (let item in this.agreementitemsList) {
+        //         this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
+        //         // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
+        //       }
+        //       this.fWbuOptions = response.data.feesList
+        //       this.add = row
+        //       this.open = true
+        //     })
+        //   }else {
+        //     this.notChange = true
+        //   }
+        // }else{
+        //   this.notChange = true
+        //   this.reset()
+        // }
       })
-      // const fId = row.fId || this.ids
+      const fId = row.fId || this.ids
       getAgreement(row.fId).then(response => {
+        console.log(response)
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps
@@ -924,7 +994,7 @@ export default {
         fFreedays: null,
         fBegindate: null,
         fEnddate: null,
-        fBillstatus: 'T',
+        fBillstatus: null,
         delFlag: null,
         createBy: null,
         createTime: null,
@@ -995,7 +1065,7 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset()
+      // this.reset()
       this.notChange = false
       this.browseStatus = false
       const fId = row.fId || this.ids
@@ -1025,6 +1095,18 @@ export default {
         this.KHblnoOptions = response.rows
       })
     },
+    debounce(fn, delay) {
+      console.log("防抖触发")
+      let timerId = null;
+      return function () {
+        let self = this;
+        let args = arguments;
+        timerId && clearTimeout(timerId);
+        timerId = setTimeout(function () {
+          fn.apply(self, args);
+        }, delay || 1000);
+      }
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs['form'].validate(valid => {
@@ -1037,9 +1119,9 @@ export default {
               formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
               addAgreement(formData).then(response => {
                 this.msgSuccess('修改成功')
-                this.open = false
+                // this.open = false
                 this.getList()
-                this.agreementitemsList = []
+                // this.agreementitemsList = []
               })
             })
           } else {
@@ -1049,9 +1131,10 @@ export default {
             formData.append('agreementitems', JSON.stringify(this.agreementitemsList))
             addAgreement(formData).then(response => {
               this.msgSuccess('新增成功')
-              this.open = false
+              // this.open = false
+              this.form.fId  = response.data.tWarehouseAgreement.fId;
               this.getList()
-              this.agreementitemsList = []
+              // this.agreementitemsList = []
             })
           }
         }