浏览代码

货代凭证修改 2024-2-28

caojunjie 1 年之前
父节点
当前提交
b924ecb529

+ 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')
+    }]
+  },
 
 ]

+ 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: "操作成功!"

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

@@ -188,8 +188,6 @@
                             </el-input>
                         </el-form-item>
                     </el-col>
-
-
                 </el-row>
 
             </el-row>

+ 43 - 6
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -82,7 +82,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 +92,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 +105,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 +121,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 +131,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 +209,7 @@
                                     return prev;
                                 }
                             }, 0);
+                            sums[index] = sums[index].toFixed(2) // 把合计的参数保留两位小数
                             sums[index] += ' 元';
                         } else {
                             sums[index] = ' ';
@@ -217,12 +226,34 @@
                 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(){
@@ -382,5 +413,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('凭证借贷金额不平衡')