|  | @@ -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('凭证借贷金额不平衡')
 |