Просмотр исходного кода

审核路径,海运出口批量更改,凭证添加核销记录

wfg 1 неделя назад
Родитель
Сommit
e340213241

+ 10 - 0
src/api/iosBasicData/finvouchers.js

@@ -65,3 +65,13 @@ export const finvouchersitemsRemove = (ids) => {
     }
   })
 }
+// 获取核销记录
+export const getOffVoucherItems = (item) => {
+  return request({
+    url: '/api/blade-los/finvouchers/getOffVoucherItems',
+    method: 'post',
+    params: item
+  })
+}
+
+

+ 18 - 6
src/views/approveDataH/check.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
 <!--    <avue-form class="trading-form" :option="option" ref="form" v-model="form"> </avue-form>-->
-    <div class="dialogButton" style="padding: 4px;">
-      <el-button size="small" :loading="buttonLoading" @click="$emit('gotoRecord', false)">上一笔</el-button>
-      <el-button size="small" :loading="buttonLoading" @click="$emit('gotoRecord', true)">下一笔</el-button>
+    <div class="dialogButton" :style="{padding: batch ? '16px' : '4px'}">
+      <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('gotoRecord', false)">上一笔</el-button>
+      <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('gotoRecord', true)">下一笔</el-button>
 
-      <el-button size="small" :loading="buttonLoading" @click="$emit('choceCheckFun', false)">关闭</el-button>
+      <el-button v-if="!batch" size="small" :loading="buttonLoading" @click="$emit('choceCheckFun', false)">关闭</el-button>
       <el-button type="primary" :loading="buttonLoading" size="small" @click="approved(1)">审批通过</el-button>
       <el-button type="warning" :loading="buttonLoading" size="small" @click="submit(2)">审批驳回</el-button>
 
@@ -18,6 +18,8 @@
         placeholder="审批意见"
       >
       </el-input>
+
+      <el-button v-if="batch" size="small" :loading="buttonLoading" @click="$emit('choceCheckFun', false)">关闭</el-button>
     </div>
     <mail-component ref="mail" @choceCheckFun="$emit('choceCheckFun', false)"></mail-component>
   </div>
@@ -33,6 +35,10 @@ export default {
   },
   name: "check",
   props: {
+    batch:{
+      type: Boolean,
+      deburred: true,
+    },
     checkData: {
       type: Object
     },
@@ -141,6 +147,12 @@ export default {
       //   cancelButtonText: "取消",
       //   type: "warning",
       // }).then(() => {
+      let cacheRow = this.checkData
+      console.log('cacheRow', cacheRow);
+      this.$emit("choceCheckFun", false, cacheRow);
+
+      return
+
       this.checkData.operate = operate;
       if (this.idList.length !== 0) {
         //批量
@@ -178,7 +190,7 @@ export default {
                       .then(res => {
                         if (res.data.success) {
                           this.$message.success("操作成功!");
-                          this.$emit("choceCheckFun", true);
+                          this.$emit("choceCheckFun", false, cacheRow);
                         }
                         if (!this.checkDetail) {
                           //关闭付费申请页面
@@ -210,7 +222,7 @@ export default {
             .then(res => {
               if (res.data.success) {
                 this.$message.success("操作成功!");
-                this.$emit("choceCheckFun", true);
+                this.$emit("choceCheckFun", false, cacheRow);
               }
               if (!this.checkDetail) {
                 //关闭付费申请页面

+ 25 - 5
src/views/approveDataH/index.vue

@@ -163,16 +163,20 @@
     <!--单个审批-->
     <el-dialog
       append-to-body
-      title="审批"
+      title="批量审批"
       class="el-dialogDeep"
       :visible.sync="checkDialog"
-      width="50%"
+      width="500px"
       :close-on-click-modal="false"
       :destroy-on-close="true"
       :close-on-press-escape="false"
       v-dialog-drag
     >
+      <div style="padding: 16px;">
+        <span>共选择批量审核单据 {{idList.length}} 张!</span>
+      </div>
       <check
+        :batch = "true"
         :checkData="checkData"
         :checkDetail="true"
         :idList="idList"
@@ -448,7 +452,7 @@ export default {
       getreportsList(1, 10, obj).then((res) => {
         this.reportRadio(res.data.data.records[0]);
         if (!this.selectionList.includes(row)) {
-          this.$refs.crud.toggleRowSelection(row);
+          this.$refs.crud.toggleRowSelection(row, true);
         }
       });
     },
@@ -640,17 +644,33 @@ export default {
         this.checkData = row;
       }
     },
-    choceCheckFun(reload) {
+    choceCheckFun(reload, removeRow) {
       // this.checkDialog = false;
       this.$refs.reportContainer.visible = false;
       if (reload === true) {
         this.refreshChange();
+      }else if(removeRow){
+        let selList = this.selectionList.filter(item => item != removeRow)
+        let i1 = this.dataList.indexOf(removeRow);
+        if(i1>=0) this.dataList.splice(i1, 1)
+        this.$nextTick(()=>{
+          selList.forEach(item => {
+            console.log(item.id, this.dataList.indexOf(item));
+            this.$refs.crud.toggleRowSelection(item, true);
+          })
+        })
       }
     },
-    choceCheckFFSQ(reload) {
+    choceCheckFFSQ(reload, removeRow) {
       this.checkDialog = false;
       if (reload === true) {
         this.refreshChange();
+      }else if(removeRow){
+        let i1 = this.dataList.indexOf(removeRow);
+        let i2 = this.selectionList.indexOf(removeRow);
+        console.log("choceCheckFFSQ", i1, i2);
+        if(i2>=0) this.selectionList.splice(i2, 1)
+        if(i1>=0) this.dataList.splice(i1, 1)
       }
     },
     openCheckSchedule(row) {

+ 9 - 5
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -363,7 +363,7 @@
     </el-dialog>
 
 <!--    批量更改-->
-    <update-batch-field ref="updateFieldRef"></update-batch-field>
+    <update-batch-field ref="updateFieldRef" @refreshData="refreshData"></update-batch-field>
 
     <!--导入模板-->
     <!-- <el-dialog title="导入 Magic Hand 文件" append-to-body :visible.sync="magicHandBox" width="555px"
@@ -582,8 +582,9 @@ export default {
         expand: true,
         expandRowKeys: [],
         rowKey: "id",
-        height: 500,
-        calcHeight: 30,
+        // height: 500,
+        height: "auto",
+        calcHeight: 6,
         tip: false,
         searchShow: true,
         searchMenuSpan: 12,
@@ -2952,10 +2953,13 @@ export default {
   text-align: center;
 }
 
-/deep/ .el-col-md-8 {
-  width: 24.33333%;
+::v-deep .el-table__row {
+  height: 24px;
 }
 
+::v-deep.el-col-md-8 {
+  width: 24.33333%;
+}
 ::v-deep.el-form-item {
   margin-bottom: 0;
 }

Разница между файлами не показана из-за своего большого размера
+ 520 - 499
src/views/iosBasicData/SeafreightExportF/bills/updateBatchField.vue


+ 2 - 1
src/views/iosBasicData/accounts/assembly/accountsDialog.vue

@@ -81,7 +81,8 @@
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isEmpl">职员</el-checkbox>
                         <!--<el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isStock">库存</el-checkbox>-->
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isManual" style="margin-left: 50px;">允许手工凭证使用</el-checkbox>
-                        <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isArAp">应收/应付科目</el-checkbox>
+                        <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isDc">应收/应付科目</el-checkbox>
+                      <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isArAp">预收/预付科目</el-checkbox>
                     </el-form-item>
                 </el-col>
 

+ 19 - 1
src/views/iosBasicData/accounts/index.vue

@@ -346,6 +346,24 @@ import {
             },
             {
               label: "应收/应付科目",
+              prop: "isDc",
+              overHidden: true,
+              search: true,
+              type:'select',
+              width: 120,
+              dicData:[
+                {
+                  label:'否',
+                  value:'0',
+                },
+                {
+                  label:'是',
+                  value:'1',
+                }
+              ]
+            },
+            {
+              label: "预收/预付科目",
               prop: "isArAp",
               overHidden: true,
               search: true,
@@ -831,7 +849,7 @@ import {
     cursor:pointer;
     color: #1e9fff;
 }
-/deep/ .el-col-md-8 {
+::v-deep .el-col-md-8 {
     width: 24.33333%;
 }
 </style>

+ 37 - 24
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -18,9 +18,10 @@
       <el-table-column type="index" width="40" style="text-align: center"> </el-table-column>
       <el-table-column prop="descr" label="摘要" width="auto" style="padding: 0">
         <template slot-scope="{ row }">
+<!--          type="textarea"-->
           <el-input
             style="width: 100%"
-            type="textarea"
+            type="text"
             v-model="row.descr"
             size="small"
             autocomplete="off"
@@ -31,9 +32,11 @@
           </el-input>
         </template>
       </el-table-column>
-      <el-table-column prop="accountCode" label="科目代码" width="400px">
+      <el-table-column prop="accountCode" label="科目代码" width="360px">
         <template slot-scope="{ row }">
-          <div style="display: flex; align-items: center; justify-content: space-between">
+          <div
+            style="display: flex; align-items: center; justify-content: space-between"
+          >
             <search-query
               style="width: 100%"
               :datalist="accountData"
@@ -50,9 +53,12 @@
               @corpChange="corpChange($event, 'accountId', row)"
             >
             </search-query>
-            <el-tooltip v-if="!disabled" class="item" effect="dark" content="修改" placement="top">
+            <el-tooltip v-if="!disabled &&(row.isEmpl===1 || row.isCorp === 1 || row.isDept === 1 || row.isItem === 1)" class="item" effect="dark" content="核算项目" placement="top">
               <el-button size="mini" type="primary" icon="el-icon-edit" circle @click="auxiliaryAccountingfun(row)" :disabled="disabled"></el-button>
             </el-tooltip>
+            <el-tooltip v-if="!disabled && row.isDc === 1" class="item" effect="dark" content="预收/预付核销" placement="top">
+              <el-button size="mini" type="primary" icon="el-icon-scissors" circle @click="showOffRecordsfun(row)" :disabled="disabled"></el-button>
+            </el-tooltip>
           </div>
           <div style="display: flex">
             <!--            _【职员】  _【部门】  _【客户】-->
@@ -60,7 +66,8 @@
               (row.accountCnName ? row.accountCnName : " ") +
               (row.isEmpl === 1 && row.emplName ? "/" + row.emplName : "") +
               (row.isDept === 1 && row.deptName ? "/" + row.deptName : "") +
-              (row.isCorp === 1 && row.corpShortName ? "/" + row.corpShortName : "")
+              (row.isCorp === 1 && row.corpShortName ? "/" + row.corpShortName : "") +
+              (row.isItem === 1 ? "/" + row.itemClassify + "-" + (row.itemName ? row.itemName : "") : "")
             }}</span>
           </div>
         </template>
@@ -68,15 +75,7 @@
 
       <el-table-column prop="dc" label="方向" width="60px" style="padding: 0">
         <template slot-scope="{ row }">
-          <el-input
-            style="width: 100%; text-align: center"
-            v-text="row.dc == 'D' ? '借' : '贷'"
-            size="small"
-            autocomplete="off"
-            clearable
-            :disabled="true"
-          >
-          </el-input>
+          <span>{{ row.dc == 'D' ? '借' : '贷' }}</span>
         </template>
       </el-table-column>
 
@@ -121,7 +120,7 @@
         <el-table-column prop="exrate" label="汇率" width="100px">
           <template slot-scope="{ row }">
             <el-input-number
-              v-if="row.curCode == 'USD'"
+              v-if="row.curCode === 'USD'"
               style="width: 100%"
               v-model="row.exrate"
               size="small"
@@ -141,11 +140,12 @@
         <el-table-column prop="amountDrUsd" label="借方" width="120px">
           <template slot-scope="{ row }">
             <el-input-number
+              v-if="row.changeMode !== 'd'"
               style="width: 100%; text-align: right"
               v-model="row.amountDrUsd"
               size="small"
               autocomplete="off"
-              :disabled="row.curCode == 'CNY' || !row.accountId || disabled"
+              :disabled="row.curCode === 'CNY' || !row.accountId || disabled"
               clearable
               placeholder="请输入借方"
               :precision="2"
@@ -158,11 +158,12 @@
         <el-table-column prop="amountCrUsd" label="货方" width="120px">
           <template slot-scope="{ row }">
             <el-input-number
+              v-if="row.changeMode !== 'd'"
               style="width: 100%"
               v-model="row.amountCrUsd"
               size="small"
               autocomplete="off"
-              :disabled="row.curCode == 'CNY' || !row.accountId || disabled"
+              :disabled="row.curCode === 'CNY' || !row.accountId || disabled"
               clearable
               placeholder="请输入货方"
               :precision="2"
@@ -202,7 +203,7 @@
               :disabled="disabled"
             ></el-button>
           </el-tooltip>
-          <el-tooltip class="item" effect="dark" content="删除" placement="top">
+          <el-tooltip class="item" effect="dark" :content="scope.row.changeMode === 'd' ? '恢复' : '删除'" placement="top">
             <el-button
               size="mini"
               type="danger"
@@ -267,7 +268,7 @@ export default {
           sums[index] = "合计";
           return;
         }
-        const values = data.map((item) => Number(item[column.property]));
+        const values = data.map((item) => item.changeMode === 'd' ? 0.00 : Number(item[column.property]));
         // 显示列的统计 金额
         let arr = ["amountDr", "amountCr", "amountDrUsd", "amountCrUsd"];
         // 判断是否有这个数据
@@ -282,7 +283,7 @@ export default {
               }
             }, 0);
             sums[index] = sums[index].toFixed(2); // 把合计的参数保留两位小数
-            sums[index] += " 元";
+            // sums[index] += " 元";
           } else {
             sums[index] = " ";
           }
@@ -337,7 +338,7 @@ export default {
       //     this.$set(row,'amountDrUsd',0)
       // }
       if (row.curCode == "USD") {
-        this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 0);
+        this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
         this.$set(row, "amountCr", row.amountCr ? Number(row.amountCr) : 0);
         this.$set(row, "amountDr", row.amountDr ? Number(row.amountDr) : 0);
 
@@ -354,9 +355,9 @@ export default {
       if (name == "Cusd") {
         this.$set(row, "amountDrUsd", 0);
       }
-      this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 0);
-      this.$set(row, "amountCr", row.amountCrUsd ? Number(row.amountCrUsd) : 0);
-      this.$set(row, "amountDr", row.amountDrUsd ? Number(row.amountDrUsd) : 0);
+      this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
+      this.$set(row, "amountCrUsd", row.amountCrUsd ? Number(row.amountCrUsd) : 0);
+      this.$set(row, "amountDrUsd", row.amountDrUsd ? Number(row.amountDrUsd) : 0);
 
       this.$set(row, "amountCr", (row.amountCrUsd * row.exrate).toFixed(2));
       this.$set(row, "amountDr", (row.amountDrUsd * row.exrate).toFixed(2));
@@ -384,6 +385,12 @@ export default {
       }
       this.$emit("auxiliaryAccountingfun", row);
     },
+    showOffRecordsfun (row){
+      if (!row.accountId) {
+        return this.$message.warning("请先选择科目代码");
+      }
+      this.$emit("showOffRecordsfun", row);
+    },
     // 下拉回调
     corpChange(value, name, row) {
       let found = false;
@@ -415,6 +422,9 @@ export default {
             this.$set(row, "isItem", item.isItem);
             this.$set(row, "itemClassifyId", item.itemClassifyId);
             this.$set(row, "itemClassify", item.itemClassify);
+
+            this.$set(row, "isDc", item.isDc);
+            this.$set(row, "isArAp", item.isArAp);
             // 打开弹窗
             this.$emit("auxiliaryAccountingfun", row);
           }
@@ -444,6 +454,9 @@ export default {
           this.$set(row, "itemClassifyId", 0);
           this.$set(row, "itemClassify", "");
 
+          this.$set(row, "isDc", 0);
+          this.$set(row, "isArAp", 0);
+
           this.$set(row, "exrate", 0);
         }
 

+ 494 - 86
src/views/iosBasicData/finvouchers/finvouchersitems.vue

@@ -2,7 +2,9 @@
   <div class="borderless" v-loading="pageLoading">
     <div class="customer-head">
       <div class="customer-back">
-        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList">返回列表 </el-button>
+        <el-button type="danger" style="border: none; background: none; color: red" icon="el-icon-arrow-left" @click="backToList"
+          >返回列表
+        </el-button>
       </div>
       <div class="add-customer-btn">
         <el-button type="primary" size="small" @click="addEdit()">新建财务凭证 </el-button>
@@ -27,10 +29,10 @@
         </el-button>
       </div>
     </div>
-    <div style="margin: 55px 5px 0px 5px;'">
-<!--      :style="{'text-align': 'center', 'line-height': '40px', 'background-color': 'white'}"-->
-      <div style="text-align: center; line-height: 40px; background-color: white;">
-        <span style="font-size: 24px;">{{form.voucherTypeName}}</span>
+    <div style="margin: 55px 5px 0 5px;'">
+      <!--      :style="{'text-align': 'center', 'line-height': '40px', 'background-color': 'white'}"-->
+      <div :style="{ 'text-align': 'center', 'line-height': '40px', 'background-color': 'white' }">
+        <span style="font-size: 24px">{{ form.voucherTypeName }}</span>
       </div>
       <el-card class="box-card">
         <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
@@ -69,37 +71,29 @@
             <el-col :span="4">
               <el-form :model="form" ref="form1">
                 <el-row>
-                <el-col :span="10">
-                  <el-form-item prop="voucherType">
-                    <search-query
-                      :datalist="voucherTypeData"
-                      :selectValue="form.voucherType"
-                      :clearable="false"
-                      :buttonIf="false"
-                      :disabled="!getVoucherCanModify"
-                      :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
-                      placeholder="请选择凭证类型"
-                      @corpChange="corpChange($event, 'voucherType')"
-                    >
-                    </search-query>
-                  </el-form-item>
-                </el-col>
-                  <el-col :span="4" style="line-height: 40px; text-align: center;">
-                      <span>字 第</span>
+                  <el-col :span="10">
+                    <el-form-item prop="voucherType">
+                      <search-query
+                        :datalist="voucherTypeData"
+                        :selectValue="form.voucherType"
+                        :clearable="false"
+                        :buttonIf="false"
+                        :disabled="!getVoucherCanModify"
+                        :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
+                        placeholder="请选择凭证类型"
+                        @corpChange="corpChange($event, 'voucherType')"
+                      >
+                      </search-query>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="4" style="line-height: 40px; text-align: center">
+                    <span>字 第</span>
+                  </el-col>
+                  <el-col :span="10">
+                    <el-form-item label="" prop="voucherNo">
+                      <el-input v-model="form.voucherNo" size="small" autocomplete="off" :disabled="true" clearable placeholder="凭证号"> </el-input>
+                    </el-form-item>
                   </el-col>
-                <el-col :span="10">
-                  <el-form-item label="" prop="voucherNo">
-                    <el-input
-                      v-model="form.voucherNo"
-                      size="small"
-                      autocomplete="off"
-                      :disabled="true"
-                      clearable
-                      placeholder="凭证号"
-                    >
-                    </el-input>
-                  </el-form-item>
-                </el-col>
                 </el-row>
               </el-form>
             </el-col>
@@ -108,7 +102,7 @@
                 <el-date-picker
                   v-model="form.voucherDate"
                   clearable
-                  style="width: 100%;"
+                  style="width: 100%"
                   type="date"
                   size="small"
                   value-format="yyyy-MM-dd"
@@ -121,7 +115,7 @@
             <el-col :span="4">
               <el-form-item label="REF NO" prop="billNo">
                 <el-input
-                  style="width: 100%;"
+                  style="width: 100%"
                   v-model="form.billNo"
                   size="small"
                   autocomplete="off"
@@ -150,26 +144,24 @@
             </el-col>
             <el-col :span="4">
               <el-form-item label="来源业务编号" prop="srcBlllNo">
+                <el-input style="width: 100%" v-model="form.srcBlllNo" size="small" autocomplete="off" :disabled="true" clearable placeholder="无">
+                </el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label="附件" prop="attachmentCount">
                 <el-input
-                  style="width: 100%;"
-                  v-model="form.srcBlllNo"
+                  type="number"
+                  style="width: 100%"
+                  v-model="form.attachmentCount"
                   size="small"
                   autocomplete="off"
-                  :disabled="true"
                   clearable
-                  placeholder=""
+                  placeholder="请输入附件"
                 >
                 </el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="4">
-                <el-form-item label="附件" prop="attachmentCount">
-                    <el-input type="number" style="width: 100%;" v-model="form.attachmentCount"
-                              size="small" autocomplete="off"
-                              clearable placeholder="请输入附件" >
-                    </el-input>
-                </el-form-item>
-            </el-col>
           </el-row>
         </el-form>
       </el-card>
@@ -218,13 +210,14 @@
           @addRowsfun="addRowsfun"
           @deletefun="deletefun"
           @auxiliaryAccountingfun="auxiliaryAccountingfun"
+          @showOffRecordsfun="showOffRecordsfun"
         >
         </fromtable-details>
       </el-card>
     </div>
 
     <!--辅助核算-->
-    <el-dialog title=" " append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%" :before-close="handleClose">
+    <el-dialog title="核算项目维护" append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%" :before-close="handleClose">
       <div>科目名称: {{ subjectRow.accountFullName }}</div>
       <div style="margin-top: 10px">
         <el-form :model="subjectRow" ref="subjectRow" label-width="70px" class="demo-ruleForm">
@@ -425,13 +418,222 @@
         <el-button type="primary" @click="auxiliaryDeterminefun">确 定</el-button>
       </span>
     </el-dialog>
+
+    <!--预收预付核销-->
+    <el-dialog
+      title="预收预付核销管理"
+      append-to-body
+      :visible.sync="offRecordsVisible"
+      class="el-dialogDeep"
+      width="80%"
+      :before-close="handleClose"
+    >
+      <div>
+        科目名称:
+        {{
+          subjectRow.accountCode +
+          " " +
+          subjectRow.accountFullName +
+          (subjectRow.isEmpl === 1 && subjectRow.emplName ? "/" + subjectRow.emplName : "") +
+          (subjectRow.isDept === 1 && subjectRow.deptName ? "/" + subjectRow.deptName : "") +
+          (subjectRow.isCorp === 1 && subjectRow.corpShortName ? "/" + subjectRow.corpShortName : "") +
+          (subjectRow.isItem === 1 ? "/" + subjectRow.itemClassify + "-" + (subjectRow.itemName ? subjectRow.itemName : "") : "")
+        }}
+        方向:{{ subjectRow.dc === "D" ? "借" : "贷" }}
+      </div>
+      <div>
+        借方金额: CNY {{ fixedAmt(subjectRow.amountDr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountDrUsd, 16) : "" }}
+      </div>
+      <div>
+        贷方金额: CNY {{ fixedAmt(subjectRow.amountCr, 16) }} {{ subjectRow.isForeign === 1 ? "USD " + fixedAmt(subjectRow.amountCrUsd, 16) : "" }}
+      </div>
+      <div style="margin-top: 10px">
+        <!--        show-summary-->
+        <!--        :summary-method="summaryMethod"-->
+        <el-table
+          ref="tableOffRecords"
+          :cell-style="{ padding: '0px', fontSize: '12px' }"
+          :header-cell-style="tableHeaderCellStyle"
+          :close-on-click-modal="false"
+          :data="offRecordsData"
+          :border="true"
+          style="width: 100%"
+          @selection-change="handleOffRecordsSelectionChange"
+          :row-class-name="rowClassName"
+        >
+          <el-table-column fixed="left" type="selection" width="50"> </el-table-column>
+          <el-table-column type="index" width="40" style="text-align: center"> </el-table-column>
+          <el-table-column prop="descr" label="摘要" width="200" style="padding: 0">
+            <template slot-scope="{ row }">
+              <span>{{ row.descr }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="accountCode" label="科目名称" width="240" style="padding: 0">
+            <template slot-scope="{ row }">
+              <span>
+                {{
+                  row.accountCode +
+                  " " +
+                  row.accountFullName +
+                  (row.isEmpl === 1 && row.emplName ? "/" + row.emplName : "") +
+                  (row.isDept === 1 && row.deptName ? "/" + row.deptName : "") +
+                  (row.isCorp === 1 && row.corpShortName ? "/" + row.corpShortName : "") +
+                  (row.isItem === 1 ? "/" + row.itemClassify + "-" + (row.itemName ? row.itemName : "") : "")
+                }}
+              </span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="dc" label="借贷" width="40px" style="padding: 0">
+            <template slot-scope="{ row }">
+              <span>{{ row.dc === "C" ? "借" : "贷" }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="本币金额">
+            <el-table-column label="借方">
+              <el-table-column prop="amountDr" label="金额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountDr) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountDrOff" label="本次可核销" width="120px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <el-input-number
+                    v-if="subjectRow.dc === 'C' && row.amountDrBlc !== '0.00'"
+                    style="width: 100%"
+                    v-model="row.amountDrOffCurrent"
+                    size="small"
+                    autocomplete="off"
+                    :disabled="form.voucherStatus == 1"
+                    placeholder="请输入借方"
+                    :precision="2"
+                    @change="offAmountBlur(row, 'D')"
+                    :controls="false"
+                  >
+                  </el-input-number>
+                  <span v-if="subjectRow.dc === 'D' || row.amountDr === '0.00'">{{ displayAmt(row.amountDrOff) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountDrBlc" label="核销余额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountDrBlc) }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column label="货方">
+              <el-table-column prop="amountCr" label="金额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountCr) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountCrOff" label="本次可核销" width="120px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <el-input-number
+                    v-if="subjectRow.dc !== 'C' && row.amountCrBlc !== '0.00'"
+                    style="width: 100%"
+                    v-model="row.amountCrOffCurrent"
+                    size="small"
+                    autocomplete="off"
+                    :disabled="form.voucherStatus == 1"
+                    placeholder="请输入货方"
+                    :precision="2"
+                    @change="offAmountBlur(row, 'C')"
+                    :controls="false"
+                  >
+                  </el-input-number>
+                  <span v-if="subjectRow.dc === 'C' || row.amountCrBlc === '0.00'">{{ displayAmt(row.amountCrOff) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountCrBlc" label="核销余额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountCrBlc) }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+          </el-table-column>
+          <el-table-column label="外币金额">
+            <el-table-column prop="curCode" label="币种" width="50px" align="center"> </el-table-column>
+            <el-table-column prop="exrate" label="汇率" width="80px" style="text-align: right">
+              <template slot-scope="{ row }">
+                <span>{{ row.exrate ? Number(row.exrate).toFixed(4) : "" }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="借方">
+              <el-table-column prop="amountDrUsd" label="金额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountDrUsd) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountDrUsdOff" label="本次可核销" width="120px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <el-input-number
+                    v-if="subjectRow.dc === 'C' && row.amountDrUsdBlc !== '0.00'"
+                    style="width: 100%; text-align: right"
+                    v-model="row.amountDrUsdOffCurrent"
+                    size="small"
+                    autocomplete="off"
+                    :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
+                    clearable
+                    placeholder="请输入借方"
+                    :precision="2"
+                    @change="offAmountUSDBlur(row, 'Dusd')"
+                    :controls="false"
+                  >
+                  </el-input-number>
+                  <span v-if="subjectRow.dc === 'D' || row.amountDrUsdBlc === '0.00'">{{ displayAmt(row.amountDrUsdOff) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountDrUsdBlc" label="核销余额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountDrUsdBlc) }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column label="货方">
+              <el-table-column prop="amountCrUsd" label="金额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountCrUsd) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountCrUsdOff" label="金额" width="120px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <el-input-number
+                    v-if="subjectRow.dc !== 'C' && row.amountCrUsdBlc !== '0.00'"
+                    style="width: 100%"
+                    v-model="row.amountCrUsdOffCurrent"
+                    size="small"
+                    autocomplete="off"
+                    :disabled="form.voucherStatus == 1 || row.curCode == 'CNY'"
+                    clearable
+                    placeholder="请输入货方"
+                    :precision="2"
+                    @change="offAmountUSDBlur(row, 'Cusd')"
+                    :controls="false"
+                  >
+                  </el-input-number>
+                  <span v-if="subjectRow.dc === 'C' || row.amountCrUsdBlc === '0.00'">{{ displayAmt(row.amountCrUsdOff) }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column prop="amountCrUsdBlc" label="核销余额" width="100px" style="text-align: right">
+                <template slot-scope="{ row }">
+                  <span>{{ displayAmt(row.amountCrUsdBlc) }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+          </el-table-column>
+        </el-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="offRecordsVisible = false">取 消</el-button>
+        <el-button type="primary" @click="offRecordsDeterminefun">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
 import { getWorkDicts } from "@/api/system/dictbiz";
-import { finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit } from "@/api/iosBasicData/finvouchers";
+import { finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit, getOffVoucherItems } from "@/api/iosBasicData/finvouchers";
 import { getCurrentDate, getYearDate } from "@/util/date";
 import fromtableDetails from "@/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue";
 import { accountsDetail } from "@/api/iosBasicData/accounts";
@@ -458,33 +660,70 @@ export default {
         voucherType: "VOUNO-TRANS", // 凭证类型
         voucherTypeName: "转账凭证",
         voucherDate: getCurrentDate(),
-        finVouchersItemsList: []
+        finVouchersItemsList: [],
       },
+      removedFinvouchersitems: [],
       voucherTypeData: [], // 凭证字数据
       voucherSourceData: [], // 业务类型
       auxiliaryVisible: false, // 辅助核算弹窗
+      offRecordsVisible: false, // 预收预付核销弹窗
+      offRecordsData: [], // 预收预付核销数据
+      offRecordsSelectionData: [],
       handleSelectionData: [], // 分录多选的数据
       subjectRow: {}, // 科目弹窗的显示数据
       subjectAccount: {}, // 当前选择科目的数据
       corpCnNameData: [], // 客户核算 下拉数据
       deptData: [], // 部门核算 下拉数据
       emplData: [], // 职员核算 下拉数据
-      itemData: [] // 项目核算 下拉数据
+      itemData: [], // 项目核算 下拉数据
     };
   },
   created() {
     this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
-    if(!this.saberUserInfo){
-      this.saberUserInfo = {}
+    if (!this.saberUserInfo) {
+      this.saberUserInfo = {};
     }
     this.getWorkDictsfun();
   },
-  computed:{
-    getVoucherCanModify(){
-      return !this.form.id || (this.saberUserInfo.user_id==this.form.createUser && this.form.voucherStatus != 1 && this.form.voucherSource === 'MANUAL');
+  computed: {
+    getVoucherCanModify() {
+      return (
+        !this.form.id || (this.saberUserInfo.user_id == this.form.createUser && this.form.voucherStatus != 1 && this.form.voucherSource === "MANUAL")
+      );
     },
   },
   methods: {
+    fixedAmt(amt, len) {
+      let N = Number(amt);
+      let S = isNaN(N) ? "0.00" : N.toFixed(2);
+      while (S.length < len) {
+        S = "_" + S;
+      }
+      return S;
+    },
+    displayAmt(amt, len) {
+      let N = Number(amt);
+      let S = isNaN(N) ? "" : N.toFixed(len ? len : 2);
+      let Z = 0;
+      return S === Z.toFixed(len ? len : 2) ? "" : S;
+    },
+    // 表头样式
+    tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
+      return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;text-align:center";
+    },
+    summaryMethod(param) {},
+    rowClassName({ row, rowIndex }) {
+      let rowName = "",
+        findRow = this.handleSelectionData.find((c) => c.rowIndex === row.rowIndex);
+      if (findRow) {
+        rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
+      }
+      return rowName; //也可以再加上其他类名 如果有需求的话
+    },
+    // 表格多选数据
+    handleOffRecordsSelectionChange(list) {
+      this.offRecordsSelectionData = list;
+    },
     addEdit() {
       if (this.form.voucherStatus == 1) {
         this.$emit("toAddEdit");
@@ -539,7 +778,7 @@ export default {
     finvouchersDetailfun(id) {
       this.pageLoading = true;
       finvouchersDetail(id)
-        .then(res => {
+        .then((res) => {
           this.form = res.data.data;
         })
         .finally(() => {
@@ -558,27 +797,47 @@ export default {
     addRowsfun(row, index) {
       //第二个参数为0的时候,是可以添加参数的,1的时候是删除
       this.form.finVouchersItemsList.splice(index, 0, {
-        descr: row.descr
+        descr: row.descr,
       });
     },
     // 行删除
     deletefun(row, index) {
+      let offVouItems = Array.isArray(row.offVouItems) ? row.offVouItems : [];
+
       if (row.id) {
-        this.finvouchersitemsRemovefun(row.id);
+        this.$set(row, "changeMode", row.changeMode === "d" ? "u" : "d");
+        // this.finvouchersitemsRemovefun(row.id);
+        this.removedFinvouchersitems.push(row);
+        this.form.finVouchersItemsList.splice(index, 1);
       } else this.form.finVouchersItemsList.splice(index, 1);
+
+      offVouItems.forEach((item) => {
+        let rowIdx = this.form.finVouchersItemsList.indexOf(item);
+        if (rowIdx >= 0) {
+          if (item.id) {
+            this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
+            // this.finvouchersitemsRemovefun(row.id);
+            this.removedFinvouchersitems.push(item);
+            this.form.finVouchersItemsList.splice(rowIdx, 1);
+          } else this.form.finVouchersItemsList.splice(rowIdx, 1);
+        }
+      });
     },
     // 删除分录
     deleteEntryfun() {
       if (this.handleSelectionData.length == 0) {
         return this.$message.warning("请选择至少一条数据");
       }
+      let offVouItems = [];
       let multiList = this.handleSelectionData;
       let arr = this.form.finVouchersItemsList;
       // 获取有id 的数据
-      const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
-      let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
+      const itemsWithId = multiList.filter((item) => item.hasOwnProperty("id"));
+      let arrIds = itemsWithId.map((item) => item.id); // 获取id 数据
       // 把选中的删除掉
-      multiList.forEach(item => {
+      multiList.forEach((item) => {
+        offVouItems = offVouItems.concat(Array.isArray(item.offVouItems) ? item.offVouItems : []);
+
         if (!item.hasOwnProperty("id")) {
           for (let index in arr) {
             if (JSON.stringify(item) == JSON.stringify(arr[index])) {
@@ -589,8 +848,29 @@ export default {
       });
       // 有id 的处理
       if (itemsWithId.length != 0) {
-        this.finvouchersitemsRemovefun(arrIds.join(","));
+        // this.finvouchersitemsRemovefun(arrIds.join(","));
+        arrIds.forEach((id) => {
+          let i = this.form.finVouchersItemsList.findIndex((item) => item.id === id);
+          if (i >= 0) {
+            let row = this.form.finVouchersItemsList[i];
+            this.$set(row, "changeMode", "d");
+            this.removedFinvouchersitems.push();
+            this.form.finVouchersItemsList.splice(i, 1);
+          }
+        });
       }
+
+      offVouItems.forEach((item) => {
+        let rowIdx = this.form.finVouchersItemsList.indexOf(item);
+        if (rowIdx >= 0) {
+          if (item.id) {
+            this.$set(item, "changeMode", item.changeMode === "d" ? "u" : "d");
+            // this.finvouchersitemsRemovefun(row.id);
+            this.removedFinvouchersitems.push(item);
+            this.form.finVouchersItemsList.splice(rowIdx, 1);
+          } else this.form.finVouchersItemsList.splice(rowIdx, 1);
+        }
+      });
     },
     forceNumber(n) {
       try {
@@ -611,7 +891,7 @@ export default {
     finvouchersSubmitfun(type) {
       this.form.businessTypeCode = "PZDH";
       this.form.billNoFormat = "BILL-NO";
-      this.form.attachmentCount = parseInt(this.forceNumber(this.form.attachmentCount))
+      this.form.attachmentCount = parseInt(this.forceNumber(this.form.attachmentCount));
       if (this.form.finVouchersItemsList.length < 2) {
         return this.$message.warning("请填写至少凭证两笔分录后再保存!");
       }
@@ -621,6 +901,7 @@ export default {
       let amountCrSum = 0;
       let index = 0;
       for (let item of this.form.finVouchersItemsList) {
+        // console.log(item);
         index++;
         let amtDr = this.forceNumber(item.amountDr);
         let amtCr = this.forceNumber(item.amountCr);
@@ -660,13 +941,15 @@ export default {
         return this.$message({
           dangerouslyUseHTMLString: true,
           message: msgs.join("<br /><br />"),
-          type: "warning"
+          type: "warning",
         });
       }
 
       this.pageLoading = true;
-      finvouchersSubmit(this.form)
-        .then(res => {
+      let data = JSON.parse(JSON.stringify(this.form));
+      data.finVouchersItemsList = data.finVouchersItemsList.concat(this.removedFinvouchersitems);
+      finvouchersSubmit(data)
+        .then((res) => {
           this.$message.success("操作成功");
           if (type == "toAddEdit") {
             this.$emit("toAddEdit");
@@ -679,12 +962,12 @@ export default {
     },
     // 分录删除接口
     finvouchersitemsRemovefun(id) {
-      finvouchersitemsRemove(id).then(res => {
+      finvouchersitemsRemove(id).then((res) => {
         this.$message.success("操作成功");
         // this.finvouchersDetailfun();
         let ids = id.split(",");
-        ids.forEach(id => {
-          let i = this.form.finVouchersItemsList.findIndex(item => item.id === id);
+        ids.forEach((id) => {
+          let i = this.form.finVouchersItemsList.findIndex((item) => item.id === id);
           if (i >= 0) {
             this.form.finVouchersItemsList.splice(i, 1);
           }
@@ -694,11 +977,11 @@ export default {
     // 科目编辑打开辅助核算弹窗
     auxiliaryAccountingfun(row) {
       // 获取状态
-      accountsDetail(row.accountId).then(res => {
+      accountsDetail(row.accountId).then((res) => {
         this.subjectAccount = res.data.data;
         this.subjectRow = row;
         // 如果三个都没有勾选 直接不自动打开弹窗
-        if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl) {
+        if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl || res.data.data.isItem) {
           this.auxiliaryVisible = true;
         }
       });
@@ -707,6 +990,94 @@ export default {
     auxiliaryDeterminefun() {
       this.auxiliaryVisible = false;
     },
+    // 获取核销记录
+    showOffRecordsfun(row) {
+      // 获取状态
+      getOffVoucherItems(row).then((res) => {
+        this.offRecordsSelectionData = [];
+        let data = Array.isArray(res.data.data) ? res.data.data : [];
+        this.offRecordsData = data;
+        this.subjectRow = row;
+        this.offRecordsVisible = true;
+      });
+    },
+    offRecordsDeterminefun() {
+      if (!Array.isArray(this.offRecordsData)) {
+        this.offRecordsVisible = false;
+        return;
+      }
+      let row = this.subjectRow;
+      let amt = row.dc === "D" ? Number(row.amountCr) : Number(row.amountDr);
+      let usd = row.dc === "D" ? Number(row.amountCrUsd) : Number(row.amountDrUsd);
+      let amtOff = 0.0,
+        usdOff = 0;
+      let rows = [];
+      this.offRecordsData.forEach((item) => {
+        let currAmt = 0;
+        if (row.dc === "D") {
+          currAmt = Number(item.amountCrOffCurrent);
+          amtOff = amtOff + currAmt;
+          if (item.curCode === "USD") {
+            usdOff = usdOff + Number(item.amountCrUsdOffCurrent);
+          }
+        } else {
+          currAmt = Number(item.amountDrOffCurrent);
+          amtOff = amtOff + currAmt;
+          if (item.curCode === "USD") {
+            usdOff = usdOff + Number(item.amountDrUsdOffCurrent);
+          }
+        }
+        currAmt = currAmt > 0.0 ? currAmt.toFixed(2) : "0.00";
+        if (currAmt !== "0.00") {
+          rows.push(item);
+        }
+      });
+
+      if (amt.toFixed(2) !== amtOff.toFixed(2)) {
+        return this.$message({
+          dangerouslyUseHTMLString: true,
+          message: "<div>选定核销金额与应核销金额不一致!</div>",
+          type: "warning",
+        });
+      }
+
+      rows.forEach((item) => {
+        let obj = {};
+        let flds = "accountId,accountCode,accountCnName,accountEnName,accountFullName,accountLevel,accountProperty,dc,";
+        flds += "isArAp,isCorp,isDc,isDept,isEmpl,isForeign,curCode,isQuantity,unitNo,isItem,itemClassify,itemClassifyId,itemId,itemName,";
+        flds += "corpId,corpShortName,corpCnName,corpEnName,deptId,deptName,emplId,emplName,exrate";
+        flds.split(",").forEach((name) => {
+          obj[name] = item[name];
+        });
+        obj.descr = row.descr;
+        if (row.dc === "D") {
+          obj.amountDr = item.amountCrOffCurrent;
+          obj.amountCr = 0.0;
+          if (item.curCode === "USD") {
+            obj.amountDrUsd = item.amountCrUsdOffCurrent;
+            obj.amountCrUsd = 0.0;
+          }
+        } else {
+          obj.amountCr = item.amountDrOffCurrent;
+          obj.amountDr = 0.0;
+          if (item.curCode === "USD") {
+            obj.amountCrUsd = item.amountDrUsdOffCurrent;
+            obj.amountDrUsd = 0.0;
+          }
+        }
+        obj.isOff = 1;
+        obj.offSrcItemId = item.id;
+        obj.offVouItemId = row.id;
+        obj.offVouItemIndex = this.form.finVouchersItemsList.indexOf(row);
+        obj.offVouItem = row;
+        if (!Array.isArray(row.offVouItems)) row.offVouItems = [];
+        row.offVouItems.push(obj);
+
+        this.form.finVouchersItemsList.push(obj);
+      });
+
+      this.offRecordsVisible = false;
+    },
     // 下拉回调
     corpChange(value, name) {
       let found = false;
@@ -784,16 +1155,53 @@ export default {
         this.$set(this.form, name, value);
       }
     },
+    // 借方/贷方 本币的计算
+    offAmountBlur(row, name) {
+      if (name === "D") {
+        this.$set(row, "amountCrOffCurrent", 0);
+      }
+      if (name === "C") {
+        this.$set(row, "amountDrOffCurrent", 0);
+      }
+
+      let a = row.amountCrOffCurrent ? Number(row.amountCrOffCurrent) : 0;
+      this.$set(row, "amountCrOffCurrent", a > Number(row.amountCrBlc) ? Number(row.amountCrBlc) : a);
+      a = row.amountDrOff ? Number(row.amountDrOff) : 0;
+      this.$set(row, "amountDrOffCurrent", a > Number(row.amountDrBlc) ? Number(row.amountDrBlc) : a);
+
+      if (row.curCode === "USD") {
+        this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
+        this.$set(row, "amountCrUsdOffCurrent", (row.amountCrOffCurrent / row.exrate).toFixed(2));
+        this.$set(row, "amountDrUsdOffCurrent", (row.amountDrOffCurrent / row.exrate).toFixed(2));
+      }
+    },
+    // 外币的计算
+    offAmountUSDBlur(row, name) {
+      if (name === "Dusd") {
+        this.$set(row, "amountCrUsdOffCurrent", 0);
+      }
+      if (name === "Cusd") {
+        this.$set(row, "amountDrUsdOffCurrent", 0);
+      }
+      let a = row.amountCrUsdOffCurrent ? Number(row.amountCrUsdOffCurrent) : 0;
+      this.$set(row, "amountCrUsdOffCurrent", a > Number(row.amountCrUsdBlc) ? Number(row.amountCrUsdBlc) : a);
+      a = row.amountDrUsdOffCurrent ? Number(row.amountDrUsdOffCurrent) : 0;
+      this.$set(row, "amountDrUsdOffCurrent", a > Number(row.amountDrUsdBlc) ? Number(row.amountDrUsdBlc) : a);
+
+      this.$set(row, "exrate", row.exrate ? Number(row.exrate) : 1);
+      this.$set(row, "amountCrOffCurrent", (row.amountCrUsdOffCurrent * row.exrate).toFixed(2));
+      this.$set(row, "amountDrOffCurrent", (row.amountDrUsdOffCurrent * row.exrate).toFixed(2));
+    },
     // 接口数据调用
     // 客户
     getBcorpsListfun(cnName) {
-      getBcorpsList(1, 10, { cnName }).then(res => {
+      getBcorpsList(1, 10, { cnName }).then((res) => {
         this.corpCnNameData = res.data.data.records;
       });
     },
     // 部门
     getDeptTreefun() {
-      getDeptLazyTree(JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_pid.split(",")[0]).then(res => {
+      getDeptLazyTree(JSON.parse(localStorage.getItem("saber-userInfo")).content.dept_pid.split(",")[0]).then((res) => {
         this.deptData = res.data.data;
       });
     },
@@ -802,9 +1210,9 @@ export default {
       // userGetList(1, 10, { account }, JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res => {
       //     this.emplData = res.data.data.records
       // })
-      selectEmpls(1, 10, { cname: account, whetherEmployedOrNot: 1 }).then(res => {
+      selectEmpls(1, 10, { cname: account, whetherEmployedOrNot: 1 }).then((res) => {
         if (Array.isArray(res.data.data.records)) {
-          res.data.data.records.forEach(item => {
+          res.data.data.records.forEach((item) => {
             item.name = item.cname;
           });
         }
@@ -813,7 +1221,7 @@ export default {
     },
     // 项目核算
     baccitemstypeListfun(cnName) {
-      baccitemstypeList(1, 10, { cnName }).then(res => {
+      baccitemstypeList(1, 10, { cnName }).then((res) => {
         this.itemData = res.data.data.records;
       });
     },
@@ -828,9 +1236,9 @@ export default {
     // 获取字典数据
     getWorkDictsfun() {
       // 凭证字数据
-      getWorkDicts("voucher_word_los").then(res => {
+      getWorkDicts("voucher_word_los").then((res) => {
         this.voucherTypeData = res.data.data;
-        let vt = this.voucherTypeData.find(j => j.dictValue == this.form.voucherType);
+        let vt = this.voucherTypeData.find((j) => j.dictValue == this.form.voucherType);
         if (vt) {
           this.$set(this.form, "voucherTypeName", vt.dictValue);
         } else if (this.voucherTypeData.length > 0) {
@@ -840,10 +1248,10 @@ export default {
         }
         console.log(this.form);
       });
-      bbusinesstypeList(1,100,{enableVoucher:'1'}).then(res => {
-        let data=[{id: 0, code: "MANUAL", cnName: "手工凭证"}].concat(res.data.data.records)
+      bbusinesstypeList(1, 100, { enableVoucher: "1" }).then((res) => {
+        let data = [{ id: 0, code: "MANUAL", cnName: "手工凭证" }].concat(res.data.data.records);
         this.voucherSourceData = data;
-      })
+      });
 
       // getWorkDicts("voucher_source_los").then(res => {
       //   this.voucherSourceData = res.data.data;
@@ -852,8 +1260,8 @@ export default {
     //返回列表
     backToList() {
       this.$emit("goBack");
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 72 - 10
src/views/iosBasicData/finvouchers/index.vue

@@ -74,6 +74,7 @@ export default {
         currentPage: 1,
         total: 0
       },
+      voucherTypeData: [],
       selectionList: [],
       option: {},
       optionBack: {
@@ -82,6 +83,7 @@ export default {
         tip: false,
         searchShow: true,
         searchMenuSpan: 6,
+        searchSpan: 6,
         border: true,
         index: true,
         viewBtn: true,
@@ -89,27 +91,40 @@ export default {
         dialogClickModal: false,
         menuWidth: '100',
         searchIcon: true,
-        searchIndex: 3,
+        searchIndex: 4,
         column: [
           {
             label: "单据编号",
             prop: "billNo",
             search: true,
+            searchOrder: 5,
             overHidden: true,
             width: 120,
           },
           {
             label: "类型",
-            prop: "voucherTypeName",
+            prop: "voucherType",
             overHidden: true,
-            width: 60,
+            width: 80,
+
+            type: "select",
+            props: {
+              label: "dictValue",
+              value: "dictKey",
+            },
+            dicData: [],
+            search: true,
+            searchOrder: 1,
+            sortable: true
           },
           {
             label: "凭证号",
             prop: "voucherNo",
             search: true,
+            searchOrder: 2,
             overHidden: true,
-            width: 80,
+            width: 100,
+            sortable: true
           },
           {
             label: "凭证日期",
@@ -121,6 +136,7 @@ export default {
             label: "凭证开始日期",
             prop: "voucherDateStart",
             search: true,
+            searchOrder: 3,
             overHidden: true,
             searchLabelWidth: "100",
             hide: true,
@@ -133,6 +149,7 @@ export default {
             label: "凭证结束日期",
             prop: "voucherDateEnd",
             search: true,
+            searchOrder: 4,
             overHidden: true,
             searchLabelWidth: "100",
             hide: true,
@@ -141,6 +158,7 @@ export default {
             valueFormat: "yyyy-MM-dd HH:mm:ss",
             width: 100,
           },
+          /*
           {
             label: "年",
             prop: "accountYear",
@@ -153,11 +171,14 @@ export default {
             overHidden: true,
             width: 40,
           },
+          */
           {
             label: "摘要",
             prop: "descr",
             overHidden: true,
             width: 200,
+            search: true,
+            searchOrder: 6,
           },
           {
             label: "借方金额(CNY)",
@@ -172,6 +193,15 @@ export default {
             width: 120,
           },
           {
+            label: "CNY金额",
+            prop: "amountDr",
+            overHidden: true,
+            width: 120,
+            hide: true,
+            search: true,
+            searchOrder: 7,
+          },
+          {
             label: "借方金额(USD)",
             prop: "amountDrUsd",
             overHidden: true,
@@ -184,9 +214,19 @@ export default {
             width: 120,
           },
           {
+            label: "USD金额",
+            prop: "amountDrUsd",
+            overHidden: true,
+            width: 120,
+            hide: true,
+            search: true,
+            searchOrder: 8,
+          },
+          {
             label: "外币",
             prop: "isForeign",
             search: true,
+            searchOrder: 9,
             type: 'select',
             dicData: [],
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=ifInvoice",
@@ -197,6 +237,7 @@ export default {
             overHidden: true,
             width: 60,
           },
+          /*
           {
             label: "数量",
             prop: "isQuantity",
@@ -211,10 +252,12 @@ export default {
             overHidden: true,
             width: 60,
           },
+           */
           {
             label: "凭证来源",
             prop: "voucherSource",
             search: true,
+            searchOrder: 10,
             type: 'select',
             dicData: [],
             // dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_source_los",
@@ -226,6 +269,14 @@ export default {
             width: 100,
           },
           {
+            label: "来源单号",
+            prop: "srcBlllNo",
+            overHidden: true,
+            width: 140,
+            search: true,
+            searchOrder: 12,
+          },
+          {
             label: "制单人",
             prop: "createUserName",
             overHidden: true,
@@ -264,7 +315,6 @@ export default {
           {
             label: "状态",
             prop: "voucherStatus",
-            search: true,
             type: 'select',
             dicData: [],
             dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_status_los",
@@ -323,23 +373,31 @@ export default {
       this.datekey = Date.now()
     },
     // 获取字典数据
+    setColumnDictData(name, data) {
+      let col = this.findObject(this.option.column, name);
+      if(col && typeof col === "object") col.dicData = Array.isArray(data) ? data : [];
+    },
     voucherStatusWorkDictsfun() {
       getWorkDicts("voucher_status_los").then(res => {
-        this.findObject(this.option.column, "voucherStatus").dicData = res.data.data;
+        this.setColumnDictData("voucherStatus", res.data.data);
       })
       // 是否字典
       getWorkDicts("ifInvoice").then(res => {
-        this.findObject(this.option.column, "isForeign").dicData = res.data.data;
-        this.findObject(this.option.column, "isQuantity").dicData = res.data.data;
+        this.setColumnDictData("isForeign", res.data.data);
+        this.setColumnDictData("isQuantity", res.data.data);
       })
 
       bbusinesstypeList(1,100,{enableVoucher:'1'}).then(res => {
         let data=[{id: 0, code: "MANUAL", cnName: "手工凭证"}].concat(res.data.data.records)
-        this.findObject(this.option.column, "voucherSource").dicData = data;
+        this.setColumnDictData("voucherSource", data);
       })
       // getWorkDicts("voucher_source_los").then(res => {
       //   this.findObject(this.option.column, "voucherSource").dicData = res.data.data;
       // })
+      getWorkDicts("voucher_word_los").then((res) => {
+        this.voucherTypeData = res.data.data;
+        this.setColumnDictData("voucherType", res.data.data);
+      });
     },
 
     // 凭证记账
@@ -512,7 +570,9 @@ export default {
       done();
     },
     searchReset() {
-      this.query = {};
+      this.query = {
+        voucherStatus: "0",
+      };
       this.onLoad(this.page);
     },
     searchChange(params, done) {
@@ -582,6 +642,8 @@ export default {
       if (inSave) {
         this.$message.success("重置成功");
         this.$refs[ref].$refs.dialogColumn.columnBox = false;
+
+        this.voucherStatusWorkDictsfun()
       }
     },
     // 更改表格颜色

Некоторые файлы не были показаны из-за большого количества измененных файлов