Bläddra i källkod

财务对账修改000

wengyuwen 4 år sedan
förälder
incheckning
cad1b71cfc
1 ändrade filer med 153 tillägg och 83 borttagningar
  1. 153 83
      src/views/finance/contrast/index.vue

+ 153 - 83
src/views/finance/contrast/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-form
-      :model="queryParams_s"
+      :model="tablefilter"
       ref="queryParams_s"
       :inline="true"
       v-show="showSearch"
@@ -9,7 +9,7 @@
     >
       <el-form-item label="货权方" prop="fCtrlcorpid">
         <el-input
-          v-model="queryParams_s.fCtrlcorpid"
+          v-model="tablefilter.fCtrlcorpid"
           placeholder="请输入客户名称"
           filterable
           remote
@@ -30,7 +30,7 @@
 
       <el-form-item label="结算单位" prop="fCorpid">
         <el-select
-          v-model="queryParams_s.fCorpid"
+          v-model="tablefilter.fCorpid"
           placeholder="请选择结算单位"
           filterable
           remote
@@ -91,7 +91,7 @@
 
       <el-form-item label="对账日期" prop="dateRange">
         <el-date-picker
-          v-model="queryParams_s.dateRange"
+          v-model="tablefilter.dateRange"
           size="small"
           style="width: 240px"
           value-format="yyyy-MM-dd"
@@ -125,7 +125,7 @@
       </el-form-item>-->
       <el-form-item label="系统编号" prop="fBillno">
         <el-input
-          v-model="queryParams_s.fBillno"
+          v-model="tablefilter.fBillno"
           placeholder="请输入系统编号"
           clearable
           size="small"
@@ -236,14 +236,13 @@
         label="操作"
         align="center"
         class-name="small-padding fixed-width"
-        width="200"
       >
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-view"
-            @click="check(scope.row)"
+            @click="check(scope.row,0)"
             v-hasPermi="['finance:contrast:edit']"
             v-if="scope.row.fBillstatus == 6"
           >查看</el-button
@@ -252,9 +251,9 @@
             size="mini"
             type="text"
             icon="el-icon-view"
-            @click="check(scope.row)"
+            @click="check(scope.row,1)"
             v-hasPermi="['finance:contrast:edit']"
-            v-if="scope.row.fBillstatus >= 3 && scope.row.fBillstatus <= 6"
+            v-if="scope.row.fBillstatus == 4 || scope.row.fBillstatus == 5"
           >审批进度</el-button>
           <el-button
             size="mini"
@@ -380,12 +379,12 @@
         </el-form-item>
 
         <div style="width: 100%">
-          <el-button type="warning" size="small" @click="reconciliation" :disabled="notChange"
+          <el-button type="warning" size="small" @click="reconciliation" :disabled="notChange" v-if="queryParams.fBillstatus < '4'"
             >对账</el-button>
-          <el-button type="primary" size="small" @click="confirmReconciliation" :disabled="notChange">确认对账</el-button>
+          <el-button type="primary" size="small" @click="confirmReconciliation" :disabled="notChange" v-if="queryParams.fBillstatus < '4'">确认对账</el-button>
           <el-button type="success" size="small" @click="backrRconciliation" v-if="queryParams.fBillstatus === '6'">撤销对账</el-button>
           <el-button type="info" size="small" @click="printing" :disabled="notChange">打印</el-button>
-          <el-button type="danger" size="small" v-show="Lander == Operator">撤销审批</el-button>
+          <el-button type="danger" size="small" :disabled="disappear" v-if="queryParams.fBillstatus === '6'">撤销审批</el-button>
         </div>
 
         <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
@@ -440,7 +439,7 @@
 
       <div slot="footer" class="dialog-footer">
         <el-button v-if="approve = false" @click="addOrUpdateHand">审批</el-button>
-        <el-button type="info" v-if="notChange" @click="addOrUpdateHandle">查看审批流</el-button>
+        <el-button type="info" v-if="notChange" @click="addOrUpdateHandle()">查看审批流</el-button>
         <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
         <el-button type="primary" @click="submitForm" :disabled="notChange">保 存</el-button>
         <el-button @click="cancel">取 消</el-button>
@@ -763,12 +762,15 @@ export default {
 
   data() {
     return {
+      disappear:false,
+      addIndex:[],
       addOrUpdateVisible: false,
       contrastId:210,
       // 审批状态
       approve:true,
       // 打印表
       printObject:[],
+      //登陆人
       Lander:'',
       openPrint:false,
       statrGo:true,
@@ -806,7 +808,7 @@ export default {
       selection: '',
       // 弹出层标题
       title: "",
-      //  登录
+      //  操作
       Operator:'',
       // 是否显示弹出层
       open: false,
@@ -860,7 +862,7 @@ export default {
         timeReconci: null
       },
       // 主表查询参数
-      queryParams_s: {
+      tablefilter: {
         pageNum: 1,
         pageSize: 10,
         fBillno: null,
@@ -925,7 +927,7 @@ export default {
   },
   created() {
     this.getList()
-    this.register()
+    // this.register()
   },
   methods: {
     getDataList(){
@@ -995,18 +997,25 @@ export default {
     },
     // 确认对账按钮功能
     confirmReconciliation(){
-      this.queryParams.fBillstatus = '4'
-      let formDate = new window.FormData()
-        formDate.append('tFee',JSON.stringify(this.queryParams))
-        formDate.append("tFeeDo", JSON.stringify(this.DzfeeList))
-
-      Cfee(formDate).then(response=>{
-        console.log(response)
-        this.msgSuccess("操作成功")
+      this.$refs['ruless'].validate(valid => {
+        if(valid){
+          if(this.DzfeeList.length){
+            this.queryParams.fBillstatus = '4'
+            let formDate = new window.FormData()
+            formDate.append('tFee',JSON.stringify(this.queryParams))
+            formDate.append("tFeeDo", JSON.stringify(this.DzfeeList))
 
+            Cfee(formDate).then(response=>{
+            console.log(response)
+            this.open = false
+            this.msgSuccess("操作成功")
+            this.getList()
+          })
+        }else{
+            this.$message.error('表单为空不允许操作');
+          }
+        }
       })
-      this.open = false
-      this.getList()
     },
     // 对账按钮功能
     reconciliation(){
@@ -1016,17 +1025,17 @@ export default {
       this.innerVisible = true
     },
     // 默认录入人
-    register() {
-      queryUserVal().then((response)=>{
-        // this.Lander = response.user.userName
-        console.log(response)
-        this.Lander = response.user.userName
-        this.queryParams_s.createBy = response.user.userName
-      this.queryParams.createBy = response.user.userName
-      console.log(this.DzfeeList.createBy)
-      console.log(response.user.userName)
-      })
-    },
+    // register() {
+    //   queryUserVal().then((response)=>{
+    //     // this.Lander = response.user.userName
+    //     console.log(response)
+    //     this.Lander = response.user.userName
+    //     this.queryParams_s.createBy = response.user.userName
+    //   this.queryParams.createBy = response.user.userName
+    //   console.log(this.DzfeeList.createBy)
+    //   console.log(response.user.userName)
+    //   })
+    // },
 
     getSummaries(param) {
         const { columns, data } = param;
@@ -1089,13 +1098,18 @@ export default {
     },
     /** 查询财务数据主列表 */
     getList() {
-      console.log(this)
+      this.addIndex = this.$route.query.data
+      if(this.addIndex){
+        console.log(this.addIndex)
+        this.open = true
+      }
+      console.log(this.addIndex)
       this.loading = true;
        this.getDicts("approval_process").then(response => {
         // this.feeList = response.rows;
         this.options = response.data
       });
-      listFee(this.queryParams_s).then(response => {
+      listFee(this.tableFilter).then(response => {
         console.log(response)
         this.contrastList = response.rows
         this.total = response.total
@@ -1143,6 +1157,23 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      // this.resetForm("queryParams_s");
+      this.tableFilter ={
+        pageNum: 1,
+          pageSize: 10,
+          fBillno: null,
+          fCtrlcorpid: null,
+          fId:null,
+          fCorpid: null,
+          tMblno: null,
+          fAmtdr: null,
+          fAmtcr: null,
+          fBilltype: null,
+          fBillstatus: null,
+          fRemarks: null,
+          fAccbilldate: null,
+          fDeptid: null,
+      }
       console.log(this.queryParams_s)
       this.queryParams_s = {
         pageNum: 1,
@@ -1237,59 +1268,96 @@ export default {
         createBy: null,
         timeReconci: null
       }
-      queryUserVal().then((response)=>{
-      this.contrastList.createBy = response.user.userName
-      console.log(response.user.userName)
-      this.queryParams = {
-        pageNum: 1,
-        pageSize: 10,
-        fBillno: null,
-        fCtrlcorpid: null,
-        fCorpid: null,
-        tMblno: null,
-        fAmtdr: null,
-        fId:null,
-        fAmtcr: null,
-        fBilltype: null,
-        fBillstatus: null,
-        fRemarks: null,
-        fAccbilldate: null,
-        fDeptid: null,
-        createBy: response.user.userName,
-        timeReconci: null
-      }
-      })
+      // queryUserVal().then((response)=>{
+      // this.contrastList.createBy = response.user.userName
+      // console.log(response.user.userName)
+      // this.queryParams = {
+      //   pageNum: 1,
+      //   pageSize: 10,
+      //   fBillno: null,
+      //   fCtrlcorpid: null,
+      //   fCorpid: null,
+      //   tMblno: null,
+      //   fAmtdr: null,
+      //   fId:null,
+      //   fAmtcr: null,
+      //   fBilltype: null,
+      //   fBillstatus: null,
+      //   fRemarks: null,
+      //   fAccbilldate: null,
+      //   fDeptid: null,
+      //   createBy: response.user.userName,
+      //   timeReconci: null
+      // }
+      // })
     },
     // 查看按钮
-    check(row) {
+    check(row,res) {
       this.notChange = true
-      this.reset();
-      this.pass={
-        fAmtdr:'',    //应收合计
-        fAmtcr:'',    //应付合计
-        fMblno:'',    //提单号
-        fName:'',      //货权方
-        fFeesName:'',   //结算单位
-        fCorpid:''     //结算单位ID
-      }
-      const fId = row.fId || this.ids
-      console.log(fId)
-      getFee(fId).then(response => {
-        console.log(this.DzfeeList)
-        console.log(response)
+      getFee(row.fId).then(response => {
+        this.Operator = response.data.tFee.createBy
         this.DzfeeList = response.data.feeDoList
         this.fWbuOptions = response.data.feesList
         this.queryParams = response.data.tFee
-        console.log(this.queryParams)
+        this.fWbuOptions = response.data.feesList
         this.fMblnoOptions = response.data.corps
         this.open = true;
         this.title = "修改财务数据主";
-      });
-      console.log(this.queryParams)
+        if (res == 1) {
+          this.notChange = true
+          this.disappear = false
+          console.log(this.notChange)
+          if (this.Operator == this.Lander) {
+            console.log(res)
+            this.reset()
+            this.pass = {
+              fAmtdr: '',    //应收合计
+              fAmtcr: '',    //应付合计
+              fMblno: '',    //提单号
+              fName: '',      //货权方
+              fFeesName: '',   //结算单位
+              fCorpid: ''     //结算单位ID
+            }
+            const fId = row.fId || this.ids
+            console.log(fId)
+            getFee(fId).then(response => {
+              this.DzfeeList = response.data.feeDoList
+              this.fWbuOptions = response.data.feesList
+              this.queryParams = response.data.tFee
+              this.fWbuOptions = response.data.feesList
+              this.fMblnoOptions = response.data.corps
+              this.open = true;
+            });
+          } else {
+            this.notChange = true
+          }
+        } else {
+          this.notChange = true
+          this.reset()
+          this.pass = {
+            fAmtdr: '',    //应收合计
+            fAmtcr: '',    //应付合计
+            fMblno: '',    //提单号
+            fName: '',      //货权方
+            fFeesName: '',   //结算单位
+            fCorpid: ''     //结算单位ID
+          }
+          const fId = row.fId || this.ids
+          console.log(fId)
+          getFee(fId).then(response => {
+            this.DzfeeList = response.data.feeDoList
+            this.fWbuOptions = response.data.feesList
+            this.queryParams = response.data.tFee
+            this.fWbuOptions = response.data.feesList
+            this.fMblnoOptions = response.data.corps
+            this.open = true;
+          })
+        }
+      })
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.notChange = false
+      this.notChange = true
       this.hide = false
       this.reset();
       this.pass={
@@ -1346,8 +1414,10 @@ export default {
 
 
             updateFee(formDate).then(response => {
+              console.log(response)
+              this.queryParams = response.data.tFee
               this.msgSuccess("新增成功");
-              this.DzfeeList = []
+              // this.DzfeeList = []
               // this.open = false;
               this.getList();
             });
@@ -1360,8 +1430,8 @@ export default {
             console.log(this.queryParams)
             addFee(formDate).then(response => {
               this.msgSuccess("修改成功");
-              this.DzfeeList = []
-              this.open = false;
+              // this.DzfeeList = []
+              // this.open = false;
               this.getList();
             });
           }