Explorar o código

Merge remote-tracking branch 'origin/dev' into dev

wfg hai 1 ano
pai
achega
7c54233b4a

+ 15 - 1
src/router/views/index.js

@@ -3183,6 +3183,20 @@ export default [{
       component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/reportClose/AIreportClose/index')
     }]
   },
-
+  // 空运进口报关
+  {
+    path: '/iosBasicData/finvouchers/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/iosBasicData/finvouchers/index',
+      name: '财务凭证(F)',
+      meta: {
+        i18n: '/iosBasicData/finvouchers/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/finvouchers/index')
+    }]
+  },
 
 ]

+ 54 - 8
src/views/iosBasicData/AirtransportExport/bills/billsDetails.vue

@@ -341,6 +341,7 @@ import {
                     createUserId:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // 默认登录人
                     businessType:'AE', // 业务类型 默认
                     billType:'DD', // 单据类型 默认 直单
+                    accDeptName:'',// 核算部门 默认登录人的部门
                     issueType:'正本', // 签单方式 默认 正本
                     mpaymode:'PP', // 主单付费方式 默认PP
                     hpaymode:'PP', // 分单付费方式 默认 PP
@@ -455,7 +456,7 @@ import {
                                 label: "MB/L NO",
                                 text:"请输入MB/L NO",
                                 prop: "mblno",
-                                span:19,
+                                span:18,
                                 disabled:false,
 
                             },
@@ -466,7 +467,7 @@ import {
                                 type:'select',
                                 labelWidth:'30px',
                                 disabled:false,
-                                span:5,
+                                span:6,
                                 dicData:[],
                                 forParameter:{
                                     key:'dictKey',
@@ -507,12 +508,31 @@ import {
                                 },
                             },
                         ],
-                        {
-                            label: "REF MBLNO", // Co-Loader 中文名称  往来单位 类别
-                            text:"请输入REF MBLNO",
-                            prop: "refno",
-                            disabled:false,
-                        },
+                        [
+                            {
+                                label: "REF MBLNO", // Co-Loader 中文名称  往来单位 类别
+                                text:"请输入REF MBLNO",
+                                prop: "refno",
+                                disabled:false,
+                            },
+                            {
+                                label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
+                                text:"请选择核算部门",
+                                prop: "accDeptName",
+                                type:'tree',
+                                dicData:[],
+                                disabled:false,
+                                forParameter:{
+                                    label: "title",
+                                    children:'children'
+                                },
+                                rules: [{
+                                    required: true,
+                                    message: " ",
+                                    trigger: "blur"
+                                }]
+                            },
+                        ],
                         [
                             {
                                 label: "业务编号",
@@ -694,6 +714,7 @@ import {
                 this.userGetListfun(undefined,true) // 获取用户管理数据
             }
             this.ownDeptLazyTreefun() // 获取公司数据
+            this.getLazylistfun() // 获取审核数据
             this.mpaymodeWorkDictsfun() // 获取 付款方式字典
             this.srcTypeWorkDictsfun()
             // 获取所属团队数据
@@ -745,6 +766,15 @@ import {
             userGetListfun(account = undefined,type = false,){
                 userGetList(1,10,{account},this.saberUserInfo.dept_pid.split(',')[0]).then(res=>{
                     // this.columnforfun('operatorName').dicData = res.data.data.records
+                    if (type) {
+                        // 核算部门 默认登录人的部门
+                        for (let item of res.data.data.records) {
+                            if (item.name == this.form.operatorName) {
+                                this.$set(this.form,'accDeptName',item.deptName)
+                                this.$set(this.form,'accDept',item.deptId)
+                            }
+                        }
+                    }
                 })
             },
             // 获取付款方式字典数据
@@ -755,6 +785,12 @@ import {
                     console.log(this.columnforfun('hpaymode'),792)
                 })
             },
+            // 获取核算部分数据 // 机构管理接口
+            getLazylistfun(){
+                getDeptTree().then(res=>{
+                    this.columnforfun('accDeptName').dicData = res.data.data
+                })
+            },
             // 获取客户名称数据 往来单位数据
             getBcorpsListfun(cnName){
                 getBcorpsList(1,10,{cnName}).then(res=>{
@@ -869,6 +905,8 @@ import {
             remoteMethod(value,name) {
                 if (name == 'operatorName') {
                     this.userGetListfun(value)
+                }else if (name == 'accDeptName') {
+                    this.getLazylistfun(value)
                 }else if (name == 'corpCnName') {
                     this.getBcorpsListfun(value)
                 }else if (name == 'mPayplace') {
@@ -914,6 +952,14 @@ import {
                         }
                     }
                 }
+                else if (name == 'accDeptName') {
+                    for(let item of this.columnforfun('accDeptName').dicData) {
+                        if (item.title == value) {
+                            this.form.accDeptName = item.title
+                            this.form.accDept = item.id
+                        }
+                    }
+                }
                 else if (name == 'corpCnName') {
                     if (value) {
                         this.columnforfun('corpAttnName').disabled = false

+ 52 - 9
src/views/iosBasicData/AirtransportImport/bills/billsDetails.vue

@@ -342,6 +342,7 @@ import {
                     createUserId:JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // 默认登录人
                     businessType:'AI', // 业务类型 默认
                     billType:'DD', // 单据类型 默认 直单
+                    accDeptName:'',// 核算部门 默认登录人的部门
                     issueType:'正本', // 签单方式 默认 正本
                     mpaymode:'PP', // 主单付费方式 默认PP
                     hpaymode:'PP', // 分单付费方式 默认 PP
@@ -456,9 +457,8 @@ import {
                                 label: "MB/L NO",
                                 text:"请输入MB/L NO",
                                 prop: "mblno",
-                                span:19,
+                                span:18,
                                 disabled:false,
-
                             },
                             {
                                 label: "",  // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
@@ -467,7 +467,7 @@ import {
                                 type:'select',
                                 labelWidth:'30px',
                                 disabled:false,
-                                span:5,
+                                span:6,
                                 dicData:[],
                                 forParameter:{
                                     key:'dictKey',
@@ -508,12 +508,31 @@ import {
                                 },
                             },
                         ],
-                        {
-                            label: "REF MBLNO", // Co-Loader 中文名称  往来单位 类别
-                            text:"请输入REF MBLNO",
-                            prop: "refno",
-                            disabled:false,
-                        },
+                        [
+                            {
+                                label: "REF MBLNO", // Co-Loader 中文名称  往来单位 类别
+                                text:"请输入REF MBLNO",
+                                prop: "refno",
+                                disabled:false,
+                            },
+                            {
+                                label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
+                                text:"请选择核算部门",
+                                prop: "accDeptName",
+                                type:'tree',
+                                dicData:[],
+                                disabled:false,
+                                forParameter:{
+                                    label: "title",
+                                    children:'children'
+                                },
+                                rules: [{
+                                    required: true,
+                                    message: " ",
+                                    trigger: "blur"
+                                }]
+                            },
+                        ],
                         [
                             {
                                 label: "业务编号",
@@ -695,6 +714,7 @@ import {
                 this.userGetListfun(undefined,true) // 获取用户管理数据
             }
             this.ownDeptLazyTreefun() // 获取公司数据
+            this.getLazylistfun() // 获取审核数据
             this.mpaymodeWorkDictsfun() // 获取 付款方式字典
             this.srcTypeWorkDictsfun()
             // 获取所属团队数据
@@ -744,6 +764,15 @@ import {
             userGetListfun(account = undefined,type = false,){
                 userGetList(1,10,{account}).then(res=>{
                     // this.columnforfun('operatorName').dicData = res.data.data.records
+                    if (type) {
+                        // 核算部门 默认登录人的部门
+                        for (let item of res.data.data.records) {
+                            if (item.name == this.form.operatorName) {
+                                this.$set(this.form,'accDeptName',item.deptName)
+                                this.$set(this.form,'accDept',item.deptId)
+                            }
+                        }
+                    }
                 })
             },
             // 获取付款方式字典数据
@@ -756,6 +785,12 @@ import {
                     console.log(this.columnforfun('hpaymode'),792)
                 })
             },
+            // 获取核算部分数据 // 机构管理接口
+            getLazylistfun(){
+                getDeptTree().then(res=>{
+                    this.columnforfun('accDeptName').dicData = res.data.data
+                })
+            },
             // 获取客户名称数据 往来单位数据
             getBcorpsListfun(cnName){
                 getBcorpsList(1,10,{cnName}).then(res=>{
@@ -915,6 +950,14 @@ import {
                         }
                     }
                 }
+                else if (name == 'accDeptName') {
+                    for(let item of this.columnforfun('accDeptName').dicData) {
+                        if (item.title == value) {
+                            this.form.accDeptName = item.title
+                            this.form.accDept = item.id
+                        }
+                    }
+                }
                 else if (name == 'corpCnName') {
                     if (value) {
                         this.columnforfun('corpAttnName').disabled = false

+ 3 - 3
src/views/iosBasicData/OceanFreightImport/bills/assembly/DistributionBox/containers.vue

@@ -465,7 +465,7 @@ import {getToken} from "@/util/auth";
 
       rowSave(row, done, loading) {
         containersSubmit(row).then(() => {
-          this.onLoad(this.page);
+          // this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -478,7 +478,7 @@ import {getToken} from "@/util/auth";
       },
       rowUpdate(row, index, done, loading) {
         containersSubmit(row).then(() => {
-          this.onLoad(this.page);
+          // this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -500,7 +500,7 @@ import {getToken} from "@/util/auth";
             return containersRemove(row.id);
           })
           .then(() => {
-            this.onLoad(this.page);
+            // this.onLoad(this.page);
             this.$message({
               type: "success",
               message: "操作成功!"

+ 7 - 0
src/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -374,6 +374,13 @@ import {number} from "echarts";
         },
         // 平均箱量
         equalDistribution(){
+            if (!this.assemblyForm.id) {
+                this.$message({
+                    message: '请先保存数据之后才能添加',
+                    type: 'warning'
+                });
+                return
+            }
             if(this.assemblyForm.waitingBoxList.length <= 0) {
                 this.$message({
                     type: "warning",

+ 4 - 4
src/views/iosBasicData/OceanFreightImport/bills/billsDetails.vue

@@ -481,7 +481,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                                 label: "MB/L NO",
                                 text:"请输入MB/L NO",
                                 prop: "mblno",
-                                span:19,
+                                span:18,
                                 disabled:false,
 
                             },
@@ -492,7 +492,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                                 type:'select',
                                 labelWidth:'30px',
                                 disabled:false,
-                                span:5,
+                                span:6,
                                 dicData:[],
                                 forParameter:{
                                     key:'dictKey',
@@ -777,7 +777,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                         for (let item of this.columnforfun('operatorName').dicData) {
                             if (item.name == this.form.operatorName) {
                                 this.$set(this.form,'accDeptName',item.deptName)
-                                this.$set(this.form,'accDeptId',item.deptId)
+                                this.$set(this.form,'accDept',item.deptId)
                             }
                         }
                     }
@@ -985,7 +985,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                     for(let item of this.columnforfun('accDeptName').dicData) {
                         if (item.title == value) {
                             this.form.accDeptName = item.title
-                            this.form.accDeptId = item.id
+                            this.form.accDept = item.id
                         }
                     }
                 }

+ 4 - 4
src/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox/containers.vue

@@ -450,7 +450,7 @@ import {getToken} from "@/util/auth";
 
       rowSave(row, done, loading) {
         containersSubmit(row).then(() => {
-          this.onLoad(this.page);
+          // this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -463,7 +463,7 @@ import {getToken} from "@/util/auth";
       },
       rowUpdate(row, index, done, loading) {
         containersSubmit(row).then(() => {
-          this.onLoad(this.page);
+          // this.onLoad(this.page);
           this.$message({
             type: "success",
             message: "操作成功!"
@@ -485,7 +485,7 @@ import {getToken} from "@/util/auth";
             return containersRemove(row.id);
           })
           .then(() => {
-            this.onLoad(this.page);
+            // this.onLoad(this.page);
             this.$message({
               type: "success",
               message: "操作成功!"
@@ -507,7 +507,7 @@ import {getToken} from "@/util/auth";
             return containersRemove(this.ids);
           })
           .then(() => {
-            this.onLoad(this.page);
+            // this.onLoad(this.page);
             this.$message({
               type: "success",
               message: "操作成功!"

+ 1 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue

@@ -881,6 +881,7 @@ import {regularFloating, regularInteger} from "@/util/regularJudgment";
             },
             assemblyForm:{
                 type:Object,
+                default: {}
             },
             // 是否生成账单
             generateBillsfalse:{

+ 11 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -106,7 +106,10 @@ import {
       components: {SearchQuery},
       props:{
           pid:{},
-          assemblyForm:{},
+          assemblyForm:{
+              type:Object,
+              default: {}
+          },
           seeDisabled:{
               type:Boolean,
               default:false,
@@ -382,6 +385,13 @@ import {
         },
         // 平均箱量
         equalDistribution(){
+            if (!this.assemblyForm.id) {
+                this.$message({
+                    message: '请先点击右上角保存按钮,保存数据之后才能添加!',
+                    type: 'warning'
+                });
+                return
+            }
             if(this.assemblyForm.waitingBoxList.length <= 0) {
                 this.$message({
                     type: "warning",

+ 4 - 4
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -483,7 +483,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                                 label: "MB/L NO",
                                 text:"请输入MB/L NO",
                                 prop: "mblno",
-                                span:19,
+                                span:18,
                                 disabled:false,
 
                             },
@@ -494,7 +494,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                                 type:'select',
                                 labelWidth:'30px',
                                 disabled:false,
-                                span:5,
+                                span:6,
                                 dicData:[],
                                 forParameter:{
                                     key:'dictKey',
@@ -813,7 +813,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                         for (let item of this.columnforfun('operatorName').dicData) {
                             if (item.name == this.form.operatorName) {
                                 this.$set(this.form,'accDeptName',item.deptName)
-                                this.$set(this.form,'accDeptId',item.deptId)
+                                this.$set(this.form,'accDept',item.deptId)
                             }
                         }
                     }
@@ -1028,7 +1028,7 @@ import {editypesList} from "@/api/iosBasicData/editypes";
                     for(let item of this.columnforfun('accDeptName').dicData) {
                         if (item.title == value) {
                             this.form.accDeptName = item.title
-                            this.form.accDeptId = item.id
+                            this.form.accDept = item.id
                         }
                     }
                 }

+ 4 - 3
src/views/iosBasicData/VoucherTemplates/index.vue

@@ -73,6 +73,7 @@
                                           :buttonIf="false"
                                           :forParameter="{key:'id',label:'code',value:'code'}"
                                           @corpFocus="accountsListfun"
+                                          @remoteMethod="accountsListfun"
                                           @corpChange="corpChange($event,'subjectCode')">
                             </search-query>
                         </template>
@@ -348,8 +349,8 @@
                 })
             },
             // 获取科目类型数据
-            accountsListfun(){
-                accountsList(1,10,).then(res=>{
+            accountsListfun(code){
+                accountsList(1,10,{code}).then(res=>{
                     this.subjectData = res.data.data.records
                 })
             },
@@ -370,7 +371,7 @@
             rowUpdate(row, index, done, loading) {
                 console.log(row,'编辑')
                 vouchertemplateSubmit(row).then(() => {
-                    this.onLoad(this.page);
+                    this.onLoad(this.page, this.search);
                     this.$message({
                         type: "success",
                         message: "操作成功!"

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

@@ -44,7 +44,7 @@
                                           :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
                                           @remoteMethod="propertyWorkDictsfun"
                                           @corpChange="corpChange($event,'property')"
-                                          @corpFocus="propertyWorkDictsfun">
+                                          @corpFocus="propertyWorkDictsfun" >
                             </search-query>
                         </el-form-item>
                     </el-col>
@@ -188,8 +188,6 @@
                             </el-input>
                         </el-form-item>
                     </el-col>
-
-
                 </el-row>
 
             </el-row>

+ 48 - 9
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -46,6 +46,7 @@
                                       :buttonIf="false"
                                       :forParameter="{key:'id',label:'code',value:'id'}"
                                       @corpFocus="accountsListfun"
+                                      @remoteMethod="accountsListfun"
                                       @corpChange="corpChange($event,'accountId',row)">
                         </search-query>
                         <el-tooltip class="item" effect="dark" content="修改" placement="top">
@@ -82,7 +83,7 @@
                     label="借方" width="120px" >
                     <template slot-scope="{ row }">
                         <el-input style="width: 100%;" type="number" v-model="row.amountDr"
-                                  size="small" autocomplete="off" :disabled="row.curCode == 'USD' || !row.accountId"
+                                  size="small" autocomplete="off" :disabled="!row.accountId"
                                    placeholder="请输入借方" @blur="amountBlur(row,'D')" >
                         </el-input>
                     </template>
@@ -92,7 +93,7 @@
                     label="货方" width="120px" >
                     <template slot-scope="{ row }">
                         <el-input style="width: 100%;" type="number" v-model="row.amountCr"
-                                  size="small" autocomplete="off" :disabled="row.curCode == 'USD' || !row.accountId"
+                                  size="small" autocomplete="off" :disabled="!row.accountId"
                                    placeholder="请输入货方" @blur="amountBlur(row,'C')" >
                         </el-input>
                     </template>
@@ -105,7 +106,15 @@
                 </el-table-column>
                 <el-table-column
                     prop="exrate"
-                    label="汇率" width="80px">
+                    label="汇率" width="100px">
+                    <template slot-scope="{ row }">
+                        <el-input v-if="row.curCode == 'USD'" style="width: 100%;" type="number"
+                                  v-model="row.exrate"
+                                  size="small" autocomplete="off"
+                                  clearable placeholder="请输入借方" @blur="amountBlur(row,'exrate')" >
+                        </el-input>
+                        <span v-else >{{row.exrate}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
                     prop="amountDrUsd"
@@ -113,7 +122,7 @@
                     <template slot-scope="{ row }">
                         <el-input style="width: 100%;" type="number" v-model="row.amountDrUsd"
                                   size="small" autocomplete="off" :disabled="row.curCode == 'CNY' || !row.accountId"
-                                  clearable placeholder="请输入借方" @blur="amountBlur(row,'Dusd')" >
+                                  clearable placeholder="请输入借方" @blur="amountUSDBlur(row,'Dusd')" >
                         </el-input>
                     </template>
                 </el-table-column>
@@ -123,7 +132,7 @@
                     <template slot-scope="{ row }">
                         <el-input style="width: 100%;" type="number" v-model="row.amountCrUsd"
                                   size="small" autocomplete="off" :disabled="row.curCode == 'CNY' || !row.accountId"
-                                  clearable placeholder="请输入货方" @blur="amountBlur(row,'Cusd')" >
+                                  clearable placeholder="请输入货方" @blur="amountUSDBlur(row,'Cusd')" >
                         </el-input>
                     </template>
                 </el-table-column>
@@ -201,6 +210,7 @@
                                     return prev;
                                 }
                             }, 0);
+                            sums[index] = sums[index].toFixed(2) // 把合计的参数保留两位小数
                             sums[index] += ' 元';
                         } else {
                             sums[index] = ' ';
@@ -209,7 +219,7 @@
                 });
                 return sums;
             },
-            // 借方/贷方
+            // 借方/贷方 本币的计算
             amountBlur(row,name){
                 if (name == 'D') {
                     this.$set(row,'amountCr',0)
@@ -217,16 +227,39 @@
                 if (name == 'C') {
                     this.$set(row,'amountDr',0)
                 }
+                // if (name == 'Dusd') {
+                //     this.$set(row,'amountCrUsd',0)
+                // }
+                // if (name == 'Cusd') {
+                //     this.$set(row,'amountDrUsd',0)
+                // }
+                if (row.curCode == 'USD') {
+                    this.$set(row,'exrate',row.exrate?Number(row.exrate):0)
+                    this.$set(row,'amountCr',row.amountCr?Number(row.amountCr):0)
+                    this.$set(row,'amountDr',row.amountDr?Number(row.amountDr):0)
+
+                    this.$set(row,'amountCrUsd',(row.amountCr * row.exrate).toFixed(2))
+                    this.$set(row,'amountDrUsd',(row.amountDr * row.exrate).toFixed(2))
+                }
+            },
+            // 外币的计算
+            amountUSDBlur(row,name){
                 if (name == 'Dusd') {
                     this.$set(row,'amountCrUsd',0)
                 }
                 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,'amountCr',(row.amountCrUsd / row.exrate).toFixed(2))
+                this.$set(row,'amountDr',(row.amountDrUsd / row.exrate).toFixed(2))
             },
             // 获取科目类型数据
-            accountsListfun(){
-                accountsList(1,10,).then(res=>{
+            accountsListfun(code){
+                accountsList(1,10,{code}).then(res=>{
                     this.accountData = res.data.data.records
                 })
             },
@@ -382,5 +415,11 @@
 </script>
 
 <style scoped>
-
+/deep/ input::-webkit-outer-spin-button,
+/deep/ input::-webkit-inner-spin-button {
+    -webkit-appearance: none !important;
+}
+/deep/ input[type="number"] {
+    -moz-appearance: textfield !important;
+}
 </style>

+ 89 - 26
src/views/iosBasicData/finvouchers/finvouchersitems.vue

@@ -114,14 +114,14 @@
 
         <!--辅助核算-->
         <el-dialog
-            title="辅助核算"
+            title=" "
             append-to-body
             :visible.sync="auxiliaryVisible"
             class="el-dialogDeep"
             width="70%"
             :before-close="handleClose">
             <div>科目名称:{{subjectRow.accountCnName}}</div>
-            <div style="margin-top: 20px">
+            <div style="margin-top: 10px">
                 <el-form :model="subjectRow" ref="subjectRow" label-width="70px" class="demo-ruleForm">
                     <!--#region-->
                     <!--<div>外币核算:</div>-->
@@ -231,25 +231,31 @@
                     <!--#endregion-->
                     <el-row :gutter="40">
                         <el-col :span="12" v-if="subjectAccount.isCorp">
-                            <div>客户核算:</div>
+                            <!--<div>客户核算:</div>-->
                             <el-form-item label="客户名称:" prop="corpCnName">
                                 <search-query style="width: 100%"
+                                              ref="searchQueryRef"
                                               :datalist="corpCnNameData"
                                               :selectValue="subjectRow.corpCnName"
                                               :filterable="true"
                                               :clearable="true"
                                               :remote="true"
-                                              :buttonIf="false"
+                                              :buttonIf="true"
                                               placeholder="请选择客户名称"
                                               :forParameter="{key:'id',label:'cnName',value:'cnName'}"
                                               @corpFocus="getBcorpsListfun"
                                               @remoteMethod="getBcorpsListfun"
-                                              @corpChange="corpChange($event,'corpCnName')">
+                                              @corpChange="corpChange($event,'corpCnName')"
+                                              @eldialogConfirm="eldialogConfirm('bcorps')"
+                                              @bottonSearchfun="bottonSearchfun('bcorps')" >
+                                    <bcorps ref="bcorps"
+                                            :eldialog="true"
+                                            @selectionChange="eldialogMultipleChoice($event,'bcorps')" ></bcorps>
                                 </search-query>
                             </el-form-item>
                         </el-col>
                         <el-col :span="12" v-if="subjectAccount.isDept">
-                            <div>部门核算:</div>
+                            <!--<div>部门核算:</div>-->
                             <el-form-item label="部门名称:" prop="deptName">
                                 <tree-select v-model="subjectRow.deptName"
                                              filterable
@@ -265,7 +271,7 @@
                             </el-form-item>
                         </el-col>
                         <el-col :span="12" v-if="subjectAccount.isEmpl">
-                            <div>职员核算:</div>
+                            <!--<div>职员核算:</div>-->
                             <el-form-item label="职员名称:" prop="emplName">
                                 <search-query :datalist="emplData"
                                               :selectValue="subjectRow.emplName"
@@ -327,9 +333,10 @@
     import {getDeptLazyTree, getDeptTree} from "@/api/system/dept";
     import {getList as userGetList} from '@/api/system/user'
     import {baccitemstypeList} from "@/api/iosBasicData/baccitemstype";
+    import bcorps from "@/views/iosBasicData/bcorps/index.vue";
 
     export default {
-        components: {TreeSelect, SearchQuery,fromtableDetails},
+        components: {bcorps, TreeSelect, SearchQuery,fromtableDetails},
         data(){
             return {
                 pageLoading:false, // 整个的动画
@@ -355,13 +362,55 @@
             this.getWorkDictsfun()
         },
         methods:{
+            // 下拉弹窗打开操作
+            bottonSearchfun(name){
+                this.$nextTick(()=>{
+                    if (this.$refs.bcorps.selectionList.length == 0) return
+                    this.$refs.bcorps.$refs.crud.toggleSelection() // 先清空所以选择的数据
+                })
+            },
+            // 下拉多选弹窗的确认
+            eldialogConfirm(name){
+                if (name == 'bcorps') {
+                    if (this.$refs.bcorps.isShow) {
+                        console.log('列表确认')
+                        this.$set(this.subjectRow,'corpCnName',this.$refs.bcorps.selectionList[0].cnName)
+                        this.$set(this.subjectRow,'corpEnName',this.$refs.bcorps.selectionList[0].enName)
+                        this.$set(this.subjectRow,'corpId',this.$refs.bcorps.selectionList[0].id)
+                    }else {
+                        console.log('详情确认')
+                        this.$refs.bcorps.$refs.detail.submitForm()
+                        this.$set(this.subjectRow,'corpCnName',this.$refs.bcorps.$refs.detail.formData.cnName)
+                        this.$set(this.subjectRow,'corpEnName',this.$refs.bcorps.$refs.detail.formData.enName)
+                        this.$set(this.subjectRow,'corpId',this.$refs.bcorps.$refs.detail.formData.id)
+                    }
+                }else {
+                    console.log('其他的组件')
+                }
+                this.$refs.searchQueryRef.corpVisible = false
+            },
+            // 下拉多选弹窗数据多选回调
+            eldialogMultipleChoice(list,name){
+                if (name == 'bcorps') {
+                    let arr = []
+                    if (list.length > 1) {
+                        this.$refs.bcorps.$refs.crud.toggleSelection() // 先清空所以选择的数据
+                        arr = [list[list.length -1]] // 获取最新点击的数组
+                        this.$refs.bcorps.$refs.crud.toggleSelection(arr,true) // 把刚点击的数组变成选择状态
+                    }else {
+                        arr = list
+                    }
+                    this.$refs.bcorps.selectionList = arr
+                }else {
+                    console.log('其他的组件')
+                }
+            },
             // 详情接口
             finvouchersDetailfun(id) {
                 this.pageLoading = true
                 finvouchersDetail(id).then(res=>{
                     this.pageLoading = false
                     this.form = res.data.data
-                    console.log(this.form,361)
                 })
             },
             // 添加分录
@@ -391,11 +440,23 @@
                 if (this.handleSelectionData.length == 0) {
                     return this.$message.warning('请选择至少一条数据')
                 }
-                let arr = this.handleSelectionData.map(item=>{
-                    return item.id
+                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 数据
+                // 把选中的删除掉
+                multiList.forEach((item)=>{
+                    for (let index in arr) {
+                        if (JSON.stringify(item) == JSON.stringify(arr[index])) {
+                            arr.splice(Number(index),1)
+                        }
+                    }
                 })
-                console.log(arr.join(','))
-                this.finvouchersitemsRemovefun(arr.join(','))
+                // 有id 的处理
+                if(itemsWithId.length != 0) {
+                    this.finvouchersitemsRemovefun(arrIds.join(','))
+                }
             },
             // 大保存
             finvouchersSubmitfun(){
@@ -404,23 +465,25 @@
                 if (this.form.finVouchersItemsList.length < 2) {
                     return this.$message.warning('请填写至少两天数据')
                 }
-                // 判断币种是否一样
-                for (let item of this.form.finVouchersItemsList) {
-                    if (this.form.finVouchersItemsList[0].curCode != item.curCode) {
-                        return this.$message.warning('请选择相同币种的科目')
-                    }
-                }
+                // // 判断币种是否一样
+                // for (let item of this.form.finVouchersItemsList) {
+                //     if (this.form.finVouchersItemsList[0].curCode != item.curCode) {
+                //         return this.$message.warning('请选择相同币种的科目')
+                //     }
+                // }
                 // 判断借方金额合计 是否等于 贷方金额合计
                 let amountDrSum = 0
                 let amountCrSum = 0
                 for (let item of this.form.finVouchersItemsList) {
-                    if (item.curCode == 'USD') {
-                        amountDrSum += Number(item.amountDrUsd)
-                        amountCrSum += Number(item.amountCrUsd)
-                    }else {
-                        amountDrSum += Number(item.amountDr)
-                        amountCrSum += Number(item.amountCr)
-                    }
+                    amountDrSum += Number(item.amountDr)
+                    amountCrSum += Number(item.amountCr)
+                    // if (item.curCode == 'USD') {
+                    //     amountDrSum += Number(item.amountDrUsd)
+                    //     amountCrSum += Number(item.amountCrUsd)
+                    // }else {
+                    //     amountDrSum += Number(item.amountDr)
+                    //     amountCrSum += Number(item.amountCr)
+                    // }
                 }
                 if (amountDrSum != amountCrSum) {
                     return this.$message.warning('凭证借贷金额不平衡')

+ 23 - 1
src/views/iosBasicData/finvouchers/index.vue

@@ -64,6 +64,7 @@
   import {mapGetters} from "vuex";
   import finvouchersitems from "@/views/iosBasicData/finvouchers/finvouchersitems.vue";
   import finstlbillsDetails from "@/views/iosBasicData/finstlbills/finstlbillsDetails.vue";
+  import {getWorkDicts} from "@/api/system/dictbiz";
 
   export default {
     data() {
@@ -178,6 +179,7 @@
               prop: "isForeign",
               search: true,
               type:'select',
+              dicData:[],
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=ifInvoice",
               props: {
                 label: "dictValue",
@@ -190,6 +192,7 @@
               prop: "isQuantity",
               search: true,
               type:'select',
+              dicData:[],
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=ifInvoice",
               props: {
                  label: "dictValue",
@@ -222,6 +225,7 @@
               prop: "voucherStatus",
               search: true,
               type:'select',
+              dicData:[],
               dicUrl: "/api/blade-system/dict-biz/dictionary?code=voucher_status_los",
               props: {
                  label: "dictValue",
@@ -260,8 +264,21 @@
     },
     async created() {
         this.option = await this.getColumnData(this.getColumnName(321), this.optionBack);
+        this.voucherStatusWorkDictsfun()
     },
     methods: {
+      // 获取字典数据
+        voucherStatusWorkDictsfun(){
+          getWorkDicts("voucher_status_los").then(res => {
+              this.findObject(this.option.column, "voucherStatus").dicData = 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;
+          })
+      },
+
       // 凭证记账
       voucherAccountingfun(){
           if (this.selectionList.length === 0) {
@@ -398,7 +415,12 @@
         finvouchersList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
           const data = res.data.data;
           this.page.total = data.total;
-          this.data = data.records;
+          this.data = data.records.map(item=>{
+              item.isForeign = item.isForeign + ''
+              item.isQuantity = item.isQuantity + ''
+              item.voucherStatus = item.voucherStatus + ''
+              return item
+          })
           this.loading = false;
           this.selectionClear();
         });