Explorar o código

对账中心查询结果、选定数据的明细翻页时已选项不清除

wfg hai 1 día
pai
achega
950fea3c27

+ 157 - 29
src/views/iosBasicData/SeafreightExportF/bills/assembly/DocumentCenter.vue

@@ -739,6 +739,58 @@ export default {
         that.addbtnfun2()
       });
     },
+    /**
+     * @param {string} text - 要折行的文本
+     * @param {number} maxLength - 每行的最大长度
+     * @returns {string} 折行后的文本
+     */
+    smartTextWrapRegex(text, maxLength) {
+      if (!text || maxLength <= 0) return [];
+
+      const wrapPattern = new RegExp(`(?:(?:\\d+|\\w+|[^\\w\\s]|\\s+){1,${maxLength}})(?=\\s|$)|.{1,${maxLength}}`, 'g');
+
+      // 分割为行
+      const lines = [];
+
+      let textLines = text.split('\n');
+      textLines.forEach(line => {
+        let remaining = line.trimEnd();
+
+        while (remaining.length > 0) {
+          // 尝试匹配不超过 maxLength 的段落(尊重单词和数字边界)
+          const match = remaining.match(new RegExp(`^.{1,${maxLength}}(?=\\s|$)|^.{1,${maxLength}}(?=[^\\w\\d]|$)|^.{${maxLength}}`));
+
+          if (!match) break;
+
+          let line = match[0];
+
+          // 如果行以单词或数字开始,但被截断,尝试调整
+          if (line.length === maxLength && remaining.length > maxLength) {
+            const nextChar = remaining[maxLength];
+            const lineEndsWithWordChar = /\w$/.test(line);
+            const nextIsWordChar = /\w/.test(nextChar);
+
+            if (lineEndsWithWordChar && nextIsWordChar) {
+              // 回退到最后一个空格或分隔符
+              const lastSpaceIndex = line.lastIndexOf(' ');
+              if (lastSpaceIndex > 0) {
+                line = line.substring(0, lastSpaceIndex);
+              } else {
+                // 没有空格,回退到非单词字符
+                const lastNonWordIndex = line.search(/[^\w]$/);
+                if (lastNonWordIndex > 0) {
+                  line = line.substring(0, lastNonWordIndex + 1);
+                }
+              }
+            }
+          }
+
+          lines.push(line.trimEnd());
+          remaining = remaining.substring(line.length);
+        }
+      })
+      return lines;
+    },
     addbtnfun2 () {
       if (!this.assemblyForm.id) {
         this.$message.warning("请先保存数据");
@@ -783,8 +835,12 @@ export default {
           }
         }
 
+        this.$set(this.documentForm, "hasLargeCmaENS", false);
         this.$set(this.documentForm, "cmaENS", "");
+        this.$set(this.documentForm, "largeCmaENS", "");
+        this.$set(this.documentForm, "hasLargeHlagICS2", false);
         this.$set(this.documentForm, "hlagICS2", "");
+        this.$set(this.documentForm, "largeHlagICS2", "");
 
         if(this.documentForm.hmmEdi){
           for(const key in this.documentForm.hmmEdi){
@@ -796,87 +852,131 @@ export default {
           let cmaENS = [], hlagICS2 = []
           if(hmmEdi.ensFillingFlag==='A'){
             // F12/F13
-            cmaENS.push("ENS申报方式:" + hmmEdi.ensFillingFlag + " - F12/F13")
-            if(hmmEdi.applicant) cmaENS.push("EORI NO" + hmmEdi.applicant)
-            if(hmmEdi.ensHblNo) cmaENS.push("HB/L NO" + hmmEdi.ensHblNo)
+            cmaENS.push("ENS TAG:" + hmmEdi.ensFillingFlag + " - F12/F13")
+            if(hmmEdi.applicant) cmaENS.push("EORI NO:" + hmmEdi.applicant)
+            if(hmmEdi.ensHblNo) cmaENS.push("HB/L NO:" + hmmEdi.ensHblNo)
           }
           if(hmmEdi.ensFillingFlag==='B'){
             // F10
-            cmaENS.push("ENS申报方式:" + hmmEdi.ensFillingFlag + " - F10")
-            if(hmmEdi.ucrNo) cmaENS.push("UCR NO" + hmmEdi.ucrNo)
-            if(hmmEdi.cusCode) cmaENS.push("CUS CODE" + hmmEdi.cusCode)
+            cmaENS.push("ENS TAG:" + hmmEdi.ensFillingFlag + " - F10")
+            if(hmmEdi.ucrNo) cmaENS.push("UCR NO:" + hmmEdi.ucrNo)
+            if(hmmEdi.cusCode) cmaENS.push("CUS CODE:" + hmmEdi.cusCode)
             let lines1 = hmmEdi.sellerDetails.split("\n")
             if(lines1.length>0) {
-              cmaENS.push("Seller:" + lines1[0])
+              cmaENS.push("")
+              cmaENS.push("SELLER:" + lines1[0])
               for (var i=1; i<lines1.length;i++) {
-                cmaENS.push("       " + lines1[i]);
+                cmaENS.push(lines1[i]);
               }
             }
+            let bs = true;
             if(hmmEdi.buyerCode){
-              cmaENS.push("Buyer EORI NO:" + hmmEdi.buyerCode)
+              cmaENS.push("")
+              cmaENS.push("BUYER EORI NO:" + hmmEdi.buyerCode)
+              bs=false;
             }
             let lines2 = hmmEdi.buyerDetails.split("\n")
             if(lines2.length>0) {
-              cmaENS.push("Buyer:" + lines2[0])
+              if(bs){
+                cmaENS.push("")
+              }
+              cmaENS.push("BUYER:" + lines2[0])
               for (var i=1; i<lines2.length;i++) {
-                cmaENS.push("      " + lines2[i]);
+                cmaENS.push(lines2[i]);
               }
             }
           }
           if(hmmEdi.ensFillingFlag==='C'){
             // F11
-            cmaENS.push("ENS申报方式:" + hmmEdi.ensFillingFlag + " - F11")
-            if(hmmEdi.ucrNo) cmaENS.push("UCR NO:" + hmmEdi.ucrNo)
+            cmaENS.push("ENS TAG:" + hmmEdi.ensFillingFlag + " - F11")
+            if(hmmEdi.ucrNo) cmaENS.push("UCR NO:" + hmmEdi.ucrNo)
+
+            let bs = true;
 
             let lines1 = hmmEdi.hblShipperDetails.split("\n")
             if(lines1.length>0) {
-              cmaENS.push("HBL发货人:" + lines1[0])
+              cmaENS.push("")
+              cmaENS.push("HBL SHIPPER:" + lines1[0])
               for (var i=1; i<lines1.length;i++) {
-                cmaENS.push("       " + lines1[i]);
+                cmaENS.push(lines1[i]);
               }
             }
 
+            bs = true;
             if(hmmEdi.hblConsigneeCode){
-              cmaENS.push("HBL收货人 EORI NO:" + hmmEdi.hblConsigneeCode)
+              cmaENS.push("")
+              bs=false;
+              cmaENS.push("HBL CONSIGNEE EORI NO:" + hmmEdi.hblConsigneeCode)
             }
             let lines2 = hmmEdi.hblConsigneeDetails.split("\n")
             if(lines2.length>0) {
-              cmaENS.push("HBL收货人:" + lines2[0])
+              if(bs) cmaENS.push("")
+              cmaENS.push("HBL CONSIGNEE:" + lines2[0])
               for (var i=1; i<lines2.length;i++) {
-                cmaENS.push("      " + lines2[i]);
+                cmaENS.push(lines2[i]);
               }
             }
 
+            bs = true;
             if(hmmEdi.hblNotifyCode){
-              cmaENS.push("HBL通知人 EORI NO:" + hmmEdi.hblNotifyCode)
+              cmaENS.push("")
+              bs=false;
+              cmaENS.push("HBL NOTIFY EORI NO:" + hmmEdi.hblNotifyCode)
             }
             let lines3 = hmmEdi.hblNotifyDetails.split("\n")
             if(lines3.length>0) {
-              cmaENS.push("HBL通知人:" + lines3[0])
+              if(bs) cmaENS.push("")
+              cmaENS.push("HBL NOTIFY:" + lines3[0])
               for (var i=1; i<lines3.length;i++) {
-                cmaENS.push("      " + lines3[i]);
+                cmaENS.push(lines3[i]);
               }
             }
 
             let lines8 = hmmEdi.sellerDetails.split("\n")
             if(lines8.length>0) {
-              cmaENS.push("Seller:" + lines8[0])
+              if(bs) cmaENS.push("")
+              cmaENS.push("SELLER:" + lines8[0])
               for (var i=1; i<lines8.length;i++) {
-                cmaENS.push("       " + lines8[i]);
+                cmaENS.push(lines8[i]);
               }
             }
+            bs = true;
             if(hmmEdi.buyerCode){
-              cmaENS.push("Buyer EORI NO:" + hmmEdi.buyerCode)
+              cmaENS.push("")
+              bs=false;
+              cmaENS.push("BUYER EORI NO:" + hmmEdi.buyerCode)
             }
             let lines9 = hmmEdi.buyerDetails.split("\n")
             if(lines9.length>0) {
-              cmaENS.push("Buyer:" + lines9[0])
+              if(bs) cmaENS.push("")
+              cmaENS.push("BUYER:" + lines9[0])
               for (var i=1; i<lines9.length;i++) {
-                cmaENS.push("      " + lines9[i]);
+                cmaENS.push(lines9[i]);
               }
             }
           }
 
+          // 打印时判断
+          /*
+          cmaENS = this.formatBLText(cmaENS.join("\n"), 35);
+          hlagICS2 = this.formatBLText(hlagICS2.join("\n"), 35);
+
+          if(cmaENS.length>12){
+            this.$set(this.documentForm, "hasLargeCmaENS", true);
+            this.$set(this.documentForm, "cmaENS", " SEE ATTACHED PAPER");
+            this.$set(this.documentForm, "largeCmaENS", cmaENS.join("\n"));
+          }else{
+            this.$set(this.documentForm, "cmaENS", cmaENS.join("\n"));
+          }
+
+          if(hlagICS2.length>12){
+            this.$set(this.documentForm, "hasLargeHlagICS2", true);
+            this.$set(this.documentForm, "hlagICS2", " SEE ATTACHED PAPER");
+            this.$set(this.documentForm, "largeHlagICS2", hlagICS2.join("\n"));
+          }else{
+            this.$set(this.documentForm, "hlagICS2", hlagICS2.join("\n"));
+          }
+          */
           this.$set(this.documentForm, "cmaENS", cmaENS.join("\n"));
           this.$set(this.documentForm, "hlagICS2", hlagICS2.join("\n"));
         }
@@ -888,7 +988,7 @@ export default {
         }
         console.log(this.documentForm);
         this.documentVisible = true;
-      });
+      })
     },
     focusBusinesstypeData(row) {
       var bus = this.reportTypeData.find(b => b.groupCode == row.groupCode && b.reportsType == row.reportsCode);
@@ -1256,9 +1356,16 @@ export default {
 
       return lines;
     },
-    async handleReportPreview(row, url, data) {
+    async handleReportPreview(row, url, printObj) {
       let rptType = this.reportTypeData.find(r => r.groupCode == row.groupCode);
 
+      let data;
+      if(printObj){
+        data = JSON.parse(JSON.stringify(printObj));
+      }else{
+        data = {}
+      }
+
       // 处理时间
       data.end = data.end ? data.end.slice(0, 10) : "";
       data.goodsTime = data.goodsTime ? data.goodsTime.slice(0, 10) : "";
@@ -1395,7 +1502,7 @@ export default {
                     data.extraLongText = extraLongText
                 }
             }
-            */
+      */
       if (rptType && rptType.params) {
         let m = rptType.params.marks;
         if (m) {
@@ -1411,6 +1518,7 @@ export default {
             }
           }
         }
+
         m = rptType.params.commodityDescr;
         if (m) {
           if (m.lineLength && m.lineLength > 0) {
@@ -1427,6 +1535,26 @@ export default {
         }
       }
 
+      // 打印时判断
+      let cmaENS = this.formatBLText(data.cmaENS, 35);
+      let hlagICS2 = this.formatBLText(data.hlagICS2, 35);
+
+      if(cmaENS.length>12){
+        data.hasLargeCmaENS=true
+        data.cmaENS = "SEE ATTACHED PAPER"
+        data.largeCmaENS = cmaENS.join("\n")
+      }else{
+        data.cmaENS = cmaENS.join("\n")
+      }
+
+      if(hlagICS2.length>12){
+        data.hasLargeHlagICS2=true
+        data.hlagICS2="SEE ATTACHED PAPER"
+        data.largeHlagICS2=hlagICS2.join("\n")
+      }else{
+        data.hlagICS2=hlagICS2.join("\n")
+      }
+
       // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
       var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
 

+ 19 - 9
src/views/iosBasicData/accounts/assembly/accitemsopenblc.vue

@@ -1,5 +1,7 @@
 <template>
     <div>
+      <!--                   @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
+      <!--                   @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323.1)"-->
         <avue-crud :option="option"
                    :table-loading="loading"
                    :data="form.accItemsOpenblcList"
@@ -7,19 +9,18 @@
                    id="out-table"
                    :header-cell-class-name="headerClassName"
                    @selection-change="selectionChange"
-                   @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 323.1)"
-                   @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 323.1)">
+        >
             <template slot="menuLeft">
                 <el-button type="primary"
                            size="small"
-                           :disabled="form.isItem == 0"
+                           :disabled="!getCanModify"
                            icon="el-icon-plus" @click="addButtonfun">新 增
                 </el-button>
                 <el-button type="danger"
                            size="small"
                            icon="el-icon-delete"
                            plain
-                           :disabled="form.isItem == 0"
+                           :disabled="!getCanModify"
                            @click="handleDelete">删 除
                 </el-button>
             </template>
@@ -120,7 +121,7 @@
                 </el-input>
                 <span v-else>{{row.quantityCr}}</span>
             </template>
-            <template slot="menu" slot-scope="{row}">
+            <template slot="menu" slot-scope="{row}" v-if="getCanModify">
                 <el-button type="text"
                            size="small"
                            v-if="row.edit"
@@ -180,7 +181,9 @@
                     viewBtn:false,
                     delBtn:false,
                     editBtn:false,
-                    menuWidth:"100",
+                    menuWidth: 100,
+                    columnBtn: false, // 隐藏列设置
+                    refreshBtn:false, // 刷新按钮
                     column: [
                         {
                             label: "客户名称",
@@ -328,9 +331,16 @@
             }
         },
         async created() {
-            this.option = await this.getColumnData(this.getColumnName(323.1), this.optionBack);
+            this.option = this.optionBack; // await this.getColumnData(this.getColumnName(323.1), this.optionBack);
         },
         methods:{
+            getCanModify(){
+              if(this.form){
+                return this.form.isDetail && (this.form.isCorp==1 || this.form.isDept==1 || this.form.isEmpl==1 || this.form.isItem==1);
+              }else{
+                return false;
+              }
+            },
             // 添加
             addButtonfun(){
                 this.form.accItemsOpenblcList.push({
@@ -517,11 +527,11 @@
 
 <style scoped>
 ::v-deep#out-table .back-one {
-    //background: #ecf5ff !important;
+    /* background: #ecf5ff !important; */
     text-align: center;
 }
 ::v-deep#out-table .back-two {
-    //background: #ecf5ff !important;
+    /* background: #ecf5ff !important; */
     text-align: center;
 }
 </style>

+ 255 - 147
src/views/iosBasicData/accounts/assembly/accountsDialog.vue

@@ -88,8 +88,8 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-col :span="24" >
-          <el-form-item label="辅助核算:" >
+        <el-col :span="24">
+          <el-form-item label="辅助核算:">
             <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isItem" :disabled="!isDetail">项目</el-checkbox>
             <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isCorp" :disabled="!isDetail">客户</el-checkbox>
             <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isDept" :disabled="!isDetail">部门</el-checkbox>
@@ -139,7 +139,7 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountOpenDr')"
+                @change="amountChange(form, 'amountOpenDr')"
               >
               </el-input-number>
             </el-form-item>
@@ -158,14 +158,24 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountOpenCr')"
+                @change="amountChange(form, 'amountOpenCr')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="年初余额" prop="amountOpenBlc" label-width="60px">
-              <el-input-number style="width: 100%;" v-model="form.amountOpenBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false" >
+              <el-input-number
+                style="width: 100%"
+                v-model="form.amountOpenBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -183,7 +193,7 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountDr')"
+                @change="amountChange(form, 'amountDr')"
               >
               </el-input-number>
             </el-form-item>
@@ -202,14 +212,24 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountCr')"
+                @change="amountChange(form, 'amountCr')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="当前余额" prop="amountBlc" label-width="60px">
-              <el-input-number style="width: 100%" v-model="form.amountBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
+              <el-input-number
+                style="width: 100%"
+                v-model="form.amountBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -232,7 +252,7 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountOpenDrUsd')"
+                @change="amountChange(form, 'amountOpenDrUsd')"
               >
               </el-input-number>
             </el-form-item>
@@ -251,14 +271,24 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountOpenCrUsd')"
+                @change="amountChange(form, 'amountOpenCrUsd')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="年初余额" prop="amountOpenUsdBlc" label-width="60px">
-              <el-input-number style="width: 100%" v-model="form.amountOpenUsdBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
+              <el-input-number
+                style="width: 100%"
+                v-model="form.amountOpenUsdBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -276,7 +306,7 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountDrUsd')"
+                @change="amountChange(form, 'amountDrUsd')"
               >
               </el-input-number>
             </el-form-item>
@@ -295,14 +325,24 @@
                 :controls="false"
                 value-on-clear="0"
                 align="right"
-                @change="amountChange(row, 'amountCrUsd')"
+                @change="amountChange(form, 'amountCrUsd')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="当前余额" prop="amountUsdBlc" label-width="60px">
-              <el-input-number style="width: 100%" v-model="form.amountUsdBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
+              <el-input-number
+                style="width: 100%"
+                v-model="form.amountUsdBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -324,7 +364,7 @@
                 :precision="2"
                 :controls="false"
                 value-on-clear="0"
-                @change="amountChange(row, 'quantityOpenDr')"
+                @change="amountChange(form, 'quantityOpenDr')"
               >
               </el-input-number>
             </el-form-item>
@@ -342,14 +382,24 @@
                 :precision="2"
                 :controls="false"
                 value-on-clear="0"
-                @change="amountChange(row, 'quantityOpenCr')"
+                @change="amountChange(form, 'quantityOpenCr')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="年初余额" prop="quantityOpenBlc" label-width="60px">
-              <el-input-number style="width: 100%" v-model="form.quantityOpenBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
+              <el-input-number
+                style="width: 100%"
+                v-model="form.quantityOpenBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -366,7 +416,7 @@
                 :precision="2"
                 :controls="false"
                 value-on-clear="0"
-                @change="amountChange(row, 'quantityDr')"
+                @change="amountChange(form, 'quantityDr')"
               >
               </el-input-number>
             </el-form-item>
@@ -384,14 +434,24 @@
                 :precision="2"
                 :controls="false"
                 value-on-clear="0"
-                @change="amountChange(row, 'quantityCr')"
+                @change="amountChange(form, 'quantityCr')"
               >
               </el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="4">
             <el-form-item label="当前余额" prop="quantityBlc" label-width="60px">
-              <el-input-number style="width: 100%" v-model="form.quantityBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
+              <el-input-number
+                style="width: 100%"
+                v-model="form.quantityBlc"
+                size="small"
+                autocomplete="off"
+                :disabled="true"
+                clearable
+                placeholder=""
+                :precision="2"
+                :controls="false"
+              >
               </el-input-number>
             </el-form-item>
           </el-col>
@@ -403,142 +463,190 @@
 
 <script>
 import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
-import {getRateList} from "@/api/iosBasicData/rateManagement";
-import {getBunitsPage} from "@/api/iosBasicData/bunits";
-import {baccitemstypeList} from "@/api/iosBasicData/baccitemstype";
-import {getWorkDicts} from "@/api/system/dictbiz";
-import {regularInteger} from "@/util/regularJudgment";
+import { getRateList } from "@/api/iosBasicData/rateManagement";
+import { getBunitsPage } from "@/api/iosBasicData/bunits";
+import { baccitemstypeList } from "@/api/iosBasicData/baccitemstype";
+import { getWorkDicts } from "@/api/system/dictbiz";
+import { regularInteger } from "@/util/regularJudgment";
 
 export default {
-    components: {SearchQuery},
-    props:{
-        form:{
-            type:Object,
-            default:{}
+  components: { SearchQuery },
+  props: {
+    form: {
+      type: Object,
+      default: {},
+    },
+    itemClassifyList: {
+      type: Object,
+      default: [],
+    },
+  },
+  data() {
+    return {
+      // 方向数据
+      dcData: [
+        {
+          label: "借方",
+          value: "D",
         },
-        itemClassifyList:{
-          type: Object,
-          default:[]
+        {
+          label: "贷方",
+          value: "C",
         },
+      ],
+      curData: [], // 币别数据
+      unitNoData: [], // 单位
+      propertyData: [], // 核算项目数据
+      itemClassifyList: [], // 核算大类
+    };
+  },
+  mounted() {},
+  computed: {
+    isCalc() {
+      return this.form && (this.form.isCorp == 1 || this.form.isDept == 1 || this.form.isEmpl == 1 || this.form.isItem == 1);
     },
-    data(){
-        return {
-            // 方向数据
-            dcData:[
-                {
-                    label:'借方',
-                    value:'D',
-                },
-                {
-                    label:'贷方',
-                    value:'C',
-                }
-            ],
-            curData:[], // 币别数据
-            unitNoData:[], // 单位
-            propertyData:[], // 核算项目数据
-            itemClassifyList:[], // 核算大类
-
+    isDetail() {
+      return this.form && this.form.isDetail == 1;
+    },
+  },
+  methods: {
+    // 科目代码只能输入整数数字
+    numinput(val) {
+      this.$set(this.form, "code", regularInteger(val));
+    },
+    forceAmt(val) {
+      let amt = Number(val);
+      return isNaN(amt) ? 0.0 : Number(amt.toFixed(2));
+    },
+    amountChange(row, fieldName) {
+      if (fieldName === "amountOpenDr" || fieldName === "amountOpenCr") {
+        if (row.dc === "D") {
+          this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenDr) - this.forceAmt(row.amountOpenCr));
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
+        }else{
+          this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenCr) - this.forceAmt(row.amountOpenDr));
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
         }
+      }
+      if (fieldName === "amountDr" || fieldName === "amountCr") {
+        if (row.dc === "D") {
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
+        }else{
+          this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
+        }
+      }
+      if (fieldName === "amountOpenDrUsd" || fieldName === "amountOpenCrUsd") {
+        if (row.dc === "D") {
+          this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenDrUsd) - this.forceAmt(row.amountOpenCrUsd));
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
+        }else{
+          this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenCrUsd) - this.forceAmt(row.amountOpenDrUsd));
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
+        }
+      }
+      if (fieldName === "amountDrUsd" || fieldName === "amountCrUsd") {
+        if (row.dc === "D") {
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
+        }else{
+          this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
+        }
+      }
+      if (fieldName === "quantityOpenDr" || fieldName === "quantityOpenCr") {
+        if (row.dc === "D") {
+          this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenDr) - this.forceAmt(row.quantityOpenCr));
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
+        }else{
+          this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenCr) - this.forceAmt(row.quantityOpenDr));
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
+        }
+      }
+      if (fieldName === "quantityDr" || fieldName === "quantityCr") {
+        if (row.dc === "D") {
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
+        }else{
+          this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
+        }
+      }
     },
-    mounted() {
+    // 金额计算
+    countBlur() {
+      this.$set(this.form, "price", this.form.price ? Number(this.form.price) : 0); // 单价
+      this.$set(this.form, "quantityOpenDr", this.form.quantityOpenDr ? Number(this.form.quantityOpenDr) : 0); // 期初借方数量
+      this.$set(this.form, "quantityOpenCr", this.form.quantityOpenCr ? Number(this.form.quantityOpenCr) : 0); // 期初贷方数量
+      this.$set(this.form, "quantityDr", this.form.quantityDr ? Number(this.form.quantityDr) : 0); // 本期借方数量
+      this.$set(this.form, "quantityCr", this.form.quantityCr ? Number(this.form.quantityCr) : 0); // 本期贷方数量
+      if (this.form.curCode == "USD") {
+        // 期初借方外币金额 = 单价 * 期初借方数量
+        this.$set(this.form, "amountOpenDrUsd", Number(this.form.price) * Number(this.form.quantityOpenDr));
+        // 期初贷方外币金额 = 单价 * 期初贷方数量
+        this.$set(this.form, "amountOpenCrUsd", Number(this.form.price) * Number(this.form.quantityOpenCr));
+        // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
+        this.$set(this.form, "amountOpenUsdBlc", Number(this.form.amountOpenCrUsd) - Number(this.form.amountOpenDrUsd));
+        // 本期借方外币金额 = 单价 * 本期借方数量
+        this.$set(this.form, "amountDrUsd", Number(this.form.price) * Number(this.form.quantityDr));
+        // 本期贷方外币金额 = 单价 * 本期贷方数量
+        this.$set(this.form, "amountCrUsd", Number(this.form.price) * Number(this.form.quantityCr));
+        // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
+        this.$set(this.form, "amountUsdBlc", Number(this.form.amountCrUsd) - Number(this.form.amountDrUsd));
+      } else {
+        // 期初借方本币金额 = 单价 * 期初借方数量
+        this.$set(this.form, "amountOpenDr", Number(this.form.price) * Number(this.form.quantityOpenDr));
+        // 期初贷方本币金额 = 单价 * 期初贷方数量
+        this.$set(this.form, "amountOpenCr", Number(this.form.price) * Number(this.form.quantityOpenCr));
+        // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
+        this.$set(this.form, "amountOpenBlc", Number(this.form.amountOpenCr) - Number(this.form.amountOpenDr));
+        // 本期借方本币金额 = 单价 * 本期借方数量
+        this.$set(this.form, "amountDr", Number(this.form.price) * Number(this.form.quantityDr));
+        // 本期贷方本币金额 = 单价 * 本期贷方数量
+        this.$set(this.form, "amountCr", Number(this.form.price) * Number(this.form.quantityCr));
+        // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
+        this.$set(this.form, "amountBlc", Number(this.form.amountCr) - Number(this.form.amountDr));
+      }
+      // 期初余额数量 = 期初贷方数量 - 期初借方数量
+      this.$set(this.form, "quantityOpenBlc", Number(this.form.quantityOpenCr) - Number(this.form.quantityOpenDr));
+      // 本期余额数量 = 本期贷方数量 - 本期借方数量
+      this.$set(this.form, "quantityBlc", Number(this.form.quantityCr) - Number(this.form.quantityDr));
     },
-    computed: {
-      isCalc(){
-        return this.form && (this.form.isCorp == 1 || this.form.isDept == 1 || this.form.isEmpl == 1 || this.form.isItem == 1 );
-      },
-      isDetail(){
-        return this.form && this.form.isDetail == 1;
-      },
+    // 下拉回调
+    corpChange(value, name) {
+      if (name === "curCode") {
+        for (let item of this.curData) {
+          if (item.code == value) {
+            this.$set(this.form, "curCode", item.code);
+            this.$set(this.form, "exrate", item.exrate);
+          }
+        }
+      } else if (name === "itemClassifyId") {
+        this.$set(this.form, name, value);
+        let cl = this.itemClassifyList.find((item) => item.id == value);
+        if (cl) {
+          this.$set(this.form, "itemClassify", cl.cnName);
+        }
+        console.log(this.form);
+      } else {
+        this.$set(this.form, name, value);
+      }
     },
-    methods:{
-        // 科目代码只能输入整数数字
-        numinput(val){
-            this.$set(this.form,'code',regularInteger(val))
-        },
-        amountChange(row, fieldName){
-
-        },
-        // 金额计算
-        countBlur(){
-            this.$set(this.form,'price',this.form.price?Number(this.form.price):0) // 单价
-            this.$set(this.form,'quantityOpenDr',this.form.quantityOpenDr?Number(this.form.quantityOpenDr):0) // 期初借方数量
-            this.$set(this.form,'quantityOpenCr',this.form.quantityOpenCr?Number(this.form.quantityOpenCr):0) // 期初贷方数量
-            this.$set(this.form,'quantityDr',this.form.quantityDr?Number(this.form.quantityDr):0) // 本期借方数量
-            this.$set(this.form,'quantityCr',this.form.quantityCr?Number(this.form.quantityCr):0) // 本期贷方数量
-            if (this.form.curCode == 'USD') {
-                // 期初借方外币金额 = 单价 * 期初借方数量
-                this.$set(this.form,'amountOpenDrUsd',Number(this.form.price) * Number(this.form.quantityOpenDr))
-                // 期初贷方外币金额 = 单价 * 期初贷方数量
-                this.$set(this.form,'amountOpenCrUsd',Number(this.form.price) * Number(this.form.quantityOpenCr))
-                // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
-                this.$set(this.form,'amountOpenUsdBlc',Number(this.form.amountOpenCrUsd) - Number(this.form.amountOpenDrUsd))
-                // 本期借方外币金额 = 单价 * 本期借方数量
-                this.$set(this.form,'amountDrUsd',Number(this.form.price) * Number(this.form.quantityDr))
-                // 本期贷方外币金额 = 单价 * 本期贷方数量
-                this.$set(this.form,'amountCrUsd',Number(this.form.price) * Number(this.form.quantityCr))
-                // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
-                this.$set(this.form,'amountUsdBlc',Number(this.form.amountCrUsd) - Number(this.form.amountDrUsd))
-            }else {
-                // 期初借方本币金额 = 单价 * 期初借方数量
-                this.$set(this.form,'amountOpenDr',Number(this.form.price) * Number(this.form.quantityOpenDr))
-                // 期初贷方本币金额 = 单价 * 期初贷方数量
-                this.$set(this.form,'amountOpenCr',Number(this.form.price) * Number(this.form.quantityOpenCr))
-                // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
-                this.$set(this.form,'amountOpenBlc',Number(this.form.amountOpenCr) - Number(this.form.amountOpenDr))
-                // 本期借方本币金额 = 单价 * 本期借方数量
-                this.$set(this.form,'amountDr',Number(this.form.price) * Number(this.form.quantityDr))
-                // 本期贷方本币金额 = 单价 * 本期贷方数量
-                this.$set(this.form,'amountCr',Number(this.form.price) * Number(this.form.quantityCr))
-                // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
-                this.$set(this.form,'amountBlc',Number(this.form.amountCr) - Number(this.form.amountDr))
-            }
-            // 期初余额数量 = 期初贷方数量 - 期初借方数量
-            this.$set(this.form,'quantityOpenBlc',Number(this.form.quantityOpenCr) - Number(this.form.quantityOpenDr))
-            // 本期余额数量 = 本期贷方数量 - 本期借方数量
-            this.$set(this.form,'quantityBlc',Number(this.form.quantityCr) - Number(this.form.quantityDr))
-        },
-        // 下拉回调
-        corpChange(value,name){
-            if (name === 'curCode') {
-                for (let item of this.curData) {
-                    if (item.code == value) {
-                        this.$set(this.form,'curCode',item.code)
-                        this.$set(this.form,'exrate',item.exrate)
-                    }
-                }
-            }else if (name === 'itemClassifyId') {
-              this.$set(this.form, name, value)
-              let cl = this.itemClassifyList.find(item=>item.id == value)
-              if(cl){
-                this.$set(this.form, "itemClassify", cl.cnName)
-              }
-              console.log(this.form)
-            }else {
-                this.$set(this.form, name, value)
-            }
-        },
-        // 获取币别数据
-        getRateListfun(cnName){
-            getRateList({current:1,size:10,cnName}).then(res=>{
-                this.curData = res.data.data.records
-            })
-        },
-        // 获取计算属性
-        getBunitsPagefun(){
-            getBunitsPage().then(res=>{
-                this.unitNoData = res.data.data
-            })
-        },
-        // 核算项目数据
-        propertyWorkDictsfun(cnName){
-            getWorkDicts('account_propertys').then((res) => {
-                this.propertyData = res.data.data
-            });
-        },
-
-    }
-}
+    // 获取币别数据
+    getRateListfun(cnName) {
+      getRateList({ current: 1, size: 10, cnName }).then((res) => {
+        this.curData = res.data.data.records;
+      });
+    },
+    // 获取计算属性
+    getBunitsPagefun() {
+      getBunitsPage().then((res) => {
+        this.unitNoData = res.data.data;
+      });
+    },
+    // 核算项目数据
+    propertyWorkDictsfun(cnName) {
+      getWorkDicts("account_propertys").then((res) => {
+        this.propertyData = res.data.data;
+      });
+    },
+  },
+};
 </script>
 
 <style scoped>

+ 0 - 15
src/views/iosBasicData/accounts/index.vue

@@ -75,21 +75,6 @@
               <span v-else>否</span>
             </template>
             -->
-            <template slot="quantityOpenDr" slot-scope="{ row }">
-              <el-input-number
-                style="width: 100%"
-                v-model="row.quantityOpenDr"
-                v-if="row.edit"
-                min="0"
-                :controls="false"
-                size="mini"
-                autocomplete="off"
-                clearable
-                placeholder="请输入期初借方数量"
-              >
-              </el-input-number>
-              <span v-else>{{ row.quantityOpenDr }}</span>
-            </template>
           </avue-crud>
         </basic-container>
       </el-col>

+ 1 - 0
src/views/iosBasicData/financialManagement/finstlbills/components/pickedData.vue

@@ -228,6 +228,7 @@ export default {
         stripe: true,
         align: "center",
         rowKey: "accBillId",
+        reserveSelection: true, // 翻页时,已选的行不丢失
         selection: true,
         column: [
           {

+ 2 - 0
src/views/iosBasicData/financialManagement/finstlbills/components/queryData.vue

@@ -158,6 +158,7 @@ export default {
         stripe: true,
         align: "center",
         rowKey: "accBillId",
+        reserveSelection: true, // 翻页时,已选的行不丢失
         selection: true,
         // highlightCurrentRow: true,
         column: [
@@ -598,6 +599,7 @@ export default {
         });
         finstlbillsSubmit(obj)
           .then((res) => {
+            this.$refs.crud.toggleSelection()
             this.$message.success("操作成功");
             this.$emit("update", res.data.data.id, "query");
           })