Przeglądaj źródła

Merge branch 'master' of http://git.echepei.com/zhujiawei/Warehouse_management_ui

翁玉文 4 lat temu
rodzic
commit
f060d62a7f
1 zmienionych plików z 110 dodań i 52 usunięć
  1. 110 52
      src/views/finance/charge/index.vue

+ 110 - 52
src/views/finance/charge/index.vue

@@ -14,7 +14,7 @@
         <el-input
           v-model="queryParams_s.fCtrlcorpid"
           placeholder="请输入货权方"
-          clearable
+          clearablef
           size="small"
           @keyup.enter.native="handleQuery"
         />
@@ -127,12 +127,19 @@
       <el-table-column label="应付合计" align="center" prop="fAmtcr"/>
       <el-table-column label="备注" align="center" prop="fRemarks"/>
       <el-table-column label="状态" align="center" prop="fBillstatus">
-        已入账
+        <template slot-scope="scope">
+          <span v-if="scope.row.fBillstatus == '1'">新建</span>
+          <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
+          <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
+          <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
+          <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
+          <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
+        </template>
       </el-table-column>
 
       <!--      <el-table-column label="单据类型" align="center" prop="fBilltype"/>-->
       <!--      <el-table-column label="制单部门" align="center" prop="fDeptid"/>-->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -163,7 +170,7 @@
     />
 
     <!-- 添加或修改财务数据主对话框 -->
-    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="65%" append-to-body>
+    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="70%" append-to-body>
       <el-form :model="queryParams" :rules="ruless" ref="ruless" :inline="true" v-show="showSearch"
                label-width="68px"
       >
@@ -236,7 +243,11 @@
         <el-table-column label="提单号" align="center" prop="fMblno"/>
         <el-table-column label="存货单号" align="center" prop="fBscorpno"/>
         <el-table-column label="品名" align="center" prop="fProductName"/>
-        <el-table-column label="业务日期" align="center" prop="fBsdate"/>
+        <el-table-column label="业务日期" align="center" prop="fBsdate">
+          <template slot-scope="scope">
+            <span>{{scope.row.fBsdate.slice(0,10)}}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="费用名称" align="center" prop="fFeeName"/>
         <el-table-column label="收/付" align="center" prop="fDc">
           <template slot-scope="scope">
@@ -247,19 +258,31 @@
         <el-table-column label="业务类型" align="center" prop="fBilltype">
           <template slot-scope="scope">
             <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
+
             <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
-            <span v-else-if="scope.row.fBilltype == 'CKDB'">调拨</span>
-            <span v-else-if="scope.row.fBilltype == 'HQZY'">货权转移</span>
+            <span v-else>{{scope.row.fBilltype}}</span>
           </template>
         </el-table-column>
         <el-table-column label="本次金额" align="center" prop="fAmt"/>
         <el-table-column label="备注" align="center" prop="fRemarks"/>
+
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click.native.prevent="deleteRow(scope.$index, increase_s)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
-      <el-dialog :close-on-click-modal="false" width="65%" :visible.sync="innerVisible" title="导入数据" append-to-body>
+      <el-dialog :close-on-click-modal="false" width="70%" :visible.sync="innerVisible" title="导入数据" append-to-body>
         <el-form ref="form" :model="queryParameter" :rules="rules" label-width="80px"
                  style="display: flex;flex-wrap: wrap;"
         >
@@ -273,7 +296,7 @@
               style="width: 200px"
               @keyup.enter.native="handleQuery"
               :remote-method="corpsRemoteMethod"
-              placeholder="请输入结算单位"
+              placeholder="请选择货权方"
             >
               <el-option
                 v-for="(dict, index) in fMblnoOptions"
@@ -314,7 +337,6 @@
                 v-model="queryParameter.fFeeid"
                 filterable
                 remote
-                :disabled="browseStatus"
                 :remote-method="fWRemoteMethod"
                 placeholder="费用名称"
                 multiple
@@ -366,7 +388,8 @@
             <template slot-scope="scope">
               <span v-if="scope.row.fBilltype =='SJRK'">入库</span>
 
-              <span v-else="scope.row.fBilltype == 'SJCK'">出库</span>
+              <span v-else-if="scope.row.fBilltype == 'SJCK'">出库</span>
+              <span v-else>{{scope.row.fBilltype}}</span>
             </template>
           </el-table-column>
           <el-table-column label="审核日期" align="center" prop="fReviewDate"/>
@@ -375,14 +398,16 @@
           <el-table-column label="本次金额" align="center" prop="fAmt">
             <template slot-scope="scope">
               <el-input
-                v-model="scope.row.fNewAmount"
+                v-model="scope.row.fAmt"
                 placeholder="请输入本次金额"
                 clearable
                 size="small"
+                oninput="value=value.replace(/[^\d]/g,'')"
+                @input="imgChange1(scope.row.fAmtdr,scope.row.fAmt)"
               />
             </template>
           </el-table-column>
-          <el-table-column label="备注" align="center" prop="fRemarks">
+          <el-table-column label="备1注" align="center" prop="fRemarks">
             <template slot-scope="scope">
               <el-input
                 v-model="scope.row.fRemarks"
@@ -414,13 +439,16 @@ import {
   listCorps
 } from '@/api/finance/charge'
 import { listFees } from '@/api/basicdata/fees'
+import log from '@/views/monitor/job/log'
 
 export default {
   name: 'Charge',
   components: {},
   data() {
     return {
-      browseStatus: false,
+      browseStatus: true,
+      //导入状态
+      state_s: true ,
       fWbuOptions: [],
       options:'',
       // 遮罩层
@@ -529,33 +557,49 @@ export default {
     this.getList()
   },
   methods: {
+    imgChange1(fAmtdr,fAmt){
+      if (fAmt <= fAmtdr){
+        console.log("小了!")
+        this.state_s = true
+      }else if(fAmt > fAmtdr){
+        console.log("大了!")
+        this.$message.error('本次金额不能大于原定金额');
+        this.state_s = false
+      }
+    },
     //确认导入
     confirmImport() {
-      if (this.selection.length == '0') {
-        console.log('未选择')//写入提示
-      } else {
-        console.log(this.selection[0].fMblno)
-        for (let item in this.selection){
-          console.log(this.selection[item])
-          console.log(this.selection[item].fMblno)
-          if(item > 1){
-            this.fMblno = this.selection[item].fMblno + "..."
-          }else if(item == 0){
-            this.fMblno = this.selection[item].fMblno
+      console.log(this.state_s)
+      if(this.state_s == true){
+        if (this.selection.length == '0') {
+          console.log('未选择')//写入提示
+        }else {
+          console.log(this.selection[0].fMblno)
+          for (let item in this.selection){
+            console.log(this.selection[item])
+            console.log(this.selection[item].fMblno)
+            if(item > 1){
+              this.fMblno = this.selection[item].fMblno + "..."
+            }else if(item == 0){
+              this.fMblno = this.selection[item].fMblno
+            }
+          }
+          this.increase_s = this.selection
+          this.innerVisible = false
+          this.chargeList_s = []
+          this.queryParameter = {
+            fCorpid: '',
+            fToCorpid: '',
+            fMblno: '',
+            fStatementNo: '',
+            fFeeid: '',
+            timeExamine: '',
+            timeInterval: ''
           }
         }
-        this.increase_s = this.selection
-        this.innerVisible = false
-        this.chargeList_s = []
-        this.queryParameter = {
-          fCorpid: '',
-          fToCorpid: '',
-          fMblno: '',
-          fStatementNo: '',
-          fFeeid: '',
-          timeExamine: '',
-          timeInterval: ''
-        }
+        this.queryParams.tMblno = this.fMblno
+      }else if(this.state_s == false){
+        this.$message.error('本次金额不能大于原定金额');
       }
     },
     /** 查询财务数据主列表 */
@@ -607,16 +651,14 @@ export default {
     },
     /** 导入搜索 */
     importSearch() {
-      console.log(this.queryParameter.fFeeid)
-      // console.log(this.queryParameter.fFeeid.join(','))
+      console.log(this.queryParameter)
+      // console.log(this.queryParameter[0].fFeeid.join(','))
       // .join(',')
       this.chargeList_s = []
       this.$refs['form'].validate(valid => {
         if (valid) {
-          console.log(this.queryParameter)
           search(this.queryParameter).then(response => {
             this.chargeList_s = response.rows
-            console.log(response)
           })
         }
       })
@@ -676,19 +718,38 @@ export default {
       this.reset()
       // this.queryParams = []
       this.increase_s = []
+      this.queryParams = {
+        pageNum: 1,
+          pageSize: 10,
+          fBillno: null,
+          fCtrlcorpid: null,
+          fCorpid: null,
+          tMblno: null,
+          fAmtdr: null,
+          fAmtcr: null,
+          fBilltype: null,
+          fBillstatus: null,
+          fRemarks: null,
+          fAccbilldate: null,
+          fDeptid: null
+      },
       this.resetForm('queryParams')
       this.open = true
       this.title = '添加财务数据主'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      console.log(row)
       this.reset()
       const fId = row.fId || this.ids
+      console.log(fId)
       getCharge(fId).then(response => {
         console.log(response)
-        this.increase_s = response.data.tFeeDoList
+        this.increase_s = 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
         this.title = '修改财务数据主'
       })
@@ -699,24 +760,17 @@ export default {
       this.$refs['ruless'].validate(valid => {
         console.log(valid)
         if (valid) {
-          if (this.form.fId != null) {
-            updateCharge(this.form).then(response => {
-              this.msgSuccess('修改成功')
-              this.open = false
-              this.getList()
-            })
-          } else {
+          console.log(this.queryParams)
+            this.chargeList.fBillstatus = '1'
             let formData = new window.FormData()
             formData.append('tFee', JSON.stringify(this.queryParams))
             formData.append('tFeeDo', JSON.stringify(this.increase_s))
-
             addCharge(formData).then(response => {
               this.msgSuccess('新增成功')
               this.increase_s = []
               this.open = false
               this.getList()
             })
-          }
         }
       })
     },
@@ -746,7 +800,11 @@ export default {
       }).then(response => {
         this.download(response.msg)
       })
-    }
+    },
+    //清空一行
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
   }
 }
 </script>