|
@@ -3,15 +3,15 @@
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
<el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
- @click="backToList">返回列表
|
|
|
+ @click="backToList">返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button size="small" type="success" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" :disabled="form.voucherStatus==1">凭证标错
|
|
|
+ <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ :disabled="form.voucherStatus == 1">凭证标错
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="primary" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" @click="finvouchersSubmitfun" :disabled="form.voucherStatus==1">保 存
|
|
|
+ <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ @click="finvouchersSubmitfun" :disabled="form.voucherStatus == 1">保 存
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -21,56 +21,42 @@
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="凭证类型" prop="voucherType">
|
|
|
- <search-query :datalist="voucherTypeData"
|
|
|
- :selectValue="form.voucherType"
|
|
|
- :clearable="true"
|
|
|
- :buttonIf="false"
|
|
|
- :disabled="form.voucherStatus==1"
|
|
|
- :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
|
|
|
- placeholder="请选择凭证类型"
|
|
|
- @corpChange="corpChange($event,'voucherType')">
|
|
|
+ <search-query :datalist="voucherTypeData" :selectValue="form.voucherType" :clearable="true"
|
|
|
+ :buttonIf="false" :disabled="form.voucherStatus == 1"
|
|
|
+ :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
|
|
|
+ placeholder="请选择凭证类型" @corpChange="corpChange($event, 'voucherType')">
|
|
|
</search-query>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="凭证号" prop="voucherNo">
|
|
|
- <el-input style="width: 100%;" v-model="form.voucherNo"
|
|
|
- size="small" autocomplete="off"
|
|
|
- :disabled="true"
|
|
|
- clearable placeholder="请输入凭证号" >
|
|
|
+ <el-input style="width: 100%;" v-model="form.voucherNo" size="small" autocomplete="off"
|
|
|
+ :disabled="true" clearable placeholder="请输入凭证号">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="凭证日期" prop="voucherDate">
|
|
|
- <el-date-picker v-model="form.voucherDate" clearable
|
|
|
- style="width: 100%;"
|
|
|
- type="date" size="small"
|
|
|
- value-format="yyyy-MM-dd HH:mm"
|
|
|
- :disabled="form.voucherStatus==1"
|
|
|
- placeholder="选择凭证日期">
|
|
|
+ <el-date-picker v-model="form.voucherDate" clearable style="width: 100%;" type="date"
|
|
|
+ size="small" value-format="yyyy-MM-dd HH:mm" :disabled="form.voucherStatus == 1"
|
|
|
+ placeholder="选择凭证日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="凭证来源" prop="voucherSource">
|
|
|
- <search-query :datalist="voucherSourceData"
|
|
|
- :selectValue="form.voucherSource"
|
|
|
- :clearable="true"
|
|
|
- :buttonIf="false"
|
|
|
- :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
|
|
|
- placeholder="请选择凭证类型"
|
|
|
- :disabled="form.voucherStatus==1"
|
|
|
- @corpChange="corpChange($event,'voucherSource')">
|
|
|
+ <search-query :datalist="voucherSourceData" :selectValue="form.voucherSource"
|
|
|
+ :clearable="true" :buttonIf="false"
|
|
|
+ :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
|
|
|
+ placeholder="请选择凭证类型" :disabled="form.voucherStatus == 1"
|
|
|
+ @corpChange="corpChange($event, 'voucherSource')">
|
|
|
</search-query>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="REF NO" prop="billNo">
|
|
|
- <el-input style="width: 100%;" v-model="form.billNo"
|
|
|
- size="small" autocomplete="off"
|
|
|
- :disabled="true"
|
|
|
- clearable placeholder="请输入编号" >
|
|
|
+ <el-input style="width: 100%;" v-model="form.billNo" size="small" autocomplete="off"
|
|
|
+ :disabled="true" clearable placeholder="请输入编号">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -88,46 +74,37 @@
|
|
|
|
|
|
<el-card style="margin-top: 10px">
|
|
|
<div style="margin-bottom: 10px">
|
|
|
- <el-button size="small" type="primary" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" @click="addEntryfun" :disabled="form.voucherStatus==1">添加分录
|
|
|
+ <el-button size="small" type="primary" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ @click="addEntryfun" :disabled="form.voucherStatus == 1">添加分录
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="danger" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" @click="deleteEntryfun" :disabled="form.voucherStatus==1" >删除分录
|
|
|
+ <el-button size="small" type="danger" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ @click="deleteEntryfun" :disabled="form.voucherStatus == 1">删除分录
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="success" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" :disabled="form.voucherStatus==1">项目属性
|
|
|
+ <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ :disabled="form.voucherStatus == 1">项目属性
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="success" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" :disabled="form.voucherStatus==1">凭证断号观察器
|
|
|
+ <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ :disabled="form.voucherStatus == 1">凭证断号观察器
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="success" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" :disabled="form.voucherStatus==1">断号优化
|
|
|
+ <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ :disabled="form.voucherStatus == 1">断号优化
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="success" style="margin-right: 8px"
|
|
|
- :loading="saveLoading" :disabled="form.voucherStatus==1">科目余额查询
|
|
|
+ <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
|
|
|
+ :disabled="form.voucherStatus == 1">科目余额查询
|
|
|
</el-button>
|
|
|
</div>
|
|
|
- <fromtable-details :tableData="form.finVouchersItemsList"
|
|
|
- :handleSelectionData="handleSelectionData"
|
|
|
- :disabled="form.voucherStatus==1"
|
|
|
- @handleSelectionChange="handleSelectionChange"
|
|
|
- @addRowsfun="addRowsfun"
|
|
|
- @deletefun="deletefun"
|
|
|
- @auxiliaryAccountingfun="auxiliaryAccountingfun">
|
|
|
+ <fromtable-details :tableData="form.finVouchersItemsList" :handleSelectionData="handleSelectionData"
|
|
|
+ :disabled="form.voucherStatus == 1" @handleSelectionChange="handleSelectionChange"
|
|
|
+ @addRowsfun="addRowsfun" @deletefun="deletefun" @auxiliaryAccountingfun="auxiliaryAccountingfun">
|
|
|
</fromtable-details>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<!--辅助核算-->
|
|
|
- <el-dialog
|
|
|
- title=" "
|
|
|
- append-to-body
|
|
|
- :visible.sync="auxiliaryVisible"
|
|
|
- class="el-dialogDeep"
|
|
|
- width="40%"
|
|
|
+ <el-dialog title=" " append-to-body :visible.sync="auxiliaryVisible" class="el-dialogDeep" width="40%"
|
|
|
:before-close="handleClose">
|
|
|
- <div>科目名称:{{subjectRow.accountCnName}}</div>
|
|
|
+ <div>科目名称:{{ subjectRow.accountCnName }}</div>
|
|
|
<div style="margin-top: 10px">
|
|
|
<el-form :model="subjectRow" ref="subjectRow" label-width="70px" class="demo-ruleForm">
|
|
|
<!--#region-->
|
|
@@ -240,57 +217,36 @@
|
|
|
<el-col :span="12" v-if="subjectAccount.isCorp">
|
|
|
<!--<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="true"
|
|
|
- placeholder="请选择客户名称"
|
|
|
- :forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
- @corpFocus="getBcorpsListfun"
|
|
|
- @remoteMethod="getBcorpsListfun"
|
|
|
- @corpChange="corpChange($event,'corpCnName')"
|
|
|
- @eldialogConfirm="eldialogConfirm('bcorps')"
|
|
|
- @bottonSearchfun="bottonSearchfun('bcorps')" >
|
|
|
- <bcorps ref="bcorps"
|
|
|
- :eldialog="true"
|
|
|
- @selectionChange="eldialogMultipleChoice($event,'bcorps')" ></bcorps>
|
|
|
+ <search-query style="width: 100%" ref="searchQueryRef" :datalist="corpCnNameData"
|
|
|
+ :selectValue="subjectRow.corpCnName" :filterable="true" :clearable="true" :remote="true"
|
|
|
+ :buttonIf="true" placeholder="请选择客户名称"
|
|
|
+ :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
|
|
|
+ @corpFocus="getBcorpsListfun" @remoteMethod="getBcorpsListfun"
|
|
|
+ @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>-->
|
|
|
<el-form-item label="部门名称:" prop="deptName">
|
|
|
- <tree-select v-model="subjectRow.deptName"
|
|
|
- filterable
|
|
|
- :data="deptData"
|
|
|
- :props="{label:'title',children:'children'}"
|
|
|
- nodeKey="title"
|
|
|
- size="small"
|
|
|
- :multiple="false"
|
|
|
- placeholder="请选择部门名称"
|
|
|
- @focus="getDeptTreefun"
|
|
|
- @input="corpChange($event,'deptName')">
|
|
|
+ <tree-select v-model="subjectRow.deptName" filterable :data="deptData"
|
|
|
+ :props="{ label: 'title', children: 'children' }" nodeKey="title" size="small"
|
|
|
+ :multiple="false" placeholder="请选择部门名称" @focus="getDeptTreefun"
|
|
|
+ @input="corpChange($event, 'deptName')">
|
|
|
</tree-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12" v-if="subjectAccount.isEmpl">
|
|
|
<!--<div>职员核算:</div>-->
|
|
|
<el-form-item label="职员名称:" prop="emplName">
|
|
|
- <search-query :datalist="emplData"
|
|
|
- :selectValue="subjectRow.emplName"
|
|
|
- :clearable="true"
|
|
|
- :buttonIf="false"
|
|
|
- :filterable="true"
|
|
|
- :remote="true"
|
|
|
- placeholder="请选择职员名称"
|
|
|
- :forParameter="{ key:'id', label:'name', value:'name'}"
|
|
|
- @corpFocus="userGetListfun"
|
|
|
- @corpChange="corpChange($event,'emplName')"
|
|
|
- @remoteMethod="userGetListfun" >
|
|
|
+ <search-query :datalist="emplData" :selectValue="subjectRow.emplName" :clearable="true"
|
|
|
+ :buttonIf="false" :filterable="true" :remote="true" placeholder="请选择职员名称"
|
|
|
+ :forParameter="{ key: 'id', label: 'name', value: 'name' }" @corpFocus="userGetListfun"
|
|
|
+ @corpChange="corpChange($event, 'emplName')" @remoteMethod="userGetListfun">
|
|
|
</search-query>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -329,306 +285,309 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
- import {getWorkDicts} from "@/api/system/dictbiz";
|
|
|
- import {finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit} from "@/api/iosBasicData/finvouchers";
|
|
|
- import {getCurrentDate, getYearDate} from "@/util/date";
|
|
|
- import fromtableDetails from "@/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue";
|
|
|
- import {accountsDetail} from "@/api/iosBasicData/accounts";
|
|
|
- import {getBcorpsList} from "@/api/iosBasicData/bcorps";
|
|
|
- import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
|
|
|
- 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";
|
|
|
+import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
+import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
+import { finvouchersDetail, finvouchersitemsRemove, finvouchersSubmit } from "@/api/iosBasicData/finvouchers";
|
|
|
+import { getCurrentDate, getYearDate } from "@/util/date";
|
|
|
+import fromtableDetails from "@/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue";
|
|
|
+import { accountsDetail } from "@/api/iosBasicData/accounts";
|
|
|
+import { getBcorpsList } from "@/api/iosBasicData/bcorps";
|
|
|
+import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
|
|
|
+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: {bcorps, TreeSelect, SearchQuery,fromtableDetails},
|
|
|
- data(){
|
|
|
- return {
|
|
|
- pageLoading:false, // 整个的动画
|
|
|
- saveLoading:false, // 按钮动画
|
|
|
- // 获取的数据
|
|
|
- form:{
|
|
|
- voucherType:'PZDH-J', // 凭证类型
|
|
|
- voucherDate:getCurrentDate(),
|
|
|
- finVouchersItemsList:[],
|
|
|
- },
|
|
|
- voucherTypeData:[], // 凭证字数据
|
|
|
- voucherSourceData:[], // 业务类型
|
|
|
- auxiliaryVisible:false, // 辅助核算弹窗
|
|
|
- handleSelectionData:[], // 分录多选的数据
|
|
|
- subjectRow:{}, // 科目弹窗的显示数据
|
|
|
- subjectAccount:{},// 当前选择科目的数据
|
|
|
- corpCnNameData:[], // 客户核算 下拉数据
|
|
|
- deptData:[], // 部门核算 下拉数据
|
|
|
- emplData:[], // 职员核算 下拉数据
|
|
|
- itemData:[], // 项目核算 下拉数据
|
|
|
- }
|
|
|
+export default {
|
|
|
+ components: { bcorps, TreeSelect, SearchQuery, fromtableDetails },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageLoading: false, // 整个的动画
|
|
|
+ saveLoading: false, // 按钮动画
|
|
|
+ // 获取的数据
|
|
|
+ form: {
|
|
|
+ voucherType: 'PZDH-J', // 凭证类型
|
|
|
+ voucherDate: getCurrentDate(),
|
|
|
+ finVouchersItemsList: [],
|
|
|
+ },
|
|
|
+ voucherTypeData: [], // 凭证字数据
|
|
|
+ voucherSourceData: [], // 业务类型
|
|
|
+ auxiliaryVisible: false, // 辅助核算弹窗
|
|
|
+ handleSelectionData: [], // 分录多选的数据
|
|
|
+ subjectRow: {}, // 科目弹窗的显示数据
|
|
|
+ subjectAccount: {},// 当前选择科目的数据
|
|
|
+ corpCnNameData: [], // 客户核算 下拉数据
|
|
|
+ deptData: [], // 部门核算 下拉数据
|
|
|
+ emplData: [], // 职员核算 下拉数据
|
|
|
+ itemData: [], // 项目核算 下拉数据
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getWorkDictsfun()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 下拉弹窗打开操作
|
|
|
+ bottonSearchfun(name) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.bcorps.selectionList.length == 0) return
|
|
|
+ this.$refs.bcorps.$refs.crud.toggleSelection() // 先清空所以选择的数据
|
|
|
+ })
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getWorkDictsfun()
|
|
|
+ // 下拉多选弹窗的确认
|
|
|
+ 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
|
|
|
},
|
|
|
- methods:{
|
|
|
- // 下拉弹窗打开操作
|
|
|
- bottonSearchfun(name){
|
|
|
- this.$nextTick(()=>{
|
|
|
- if (this.$refs.bcorps.selectionList.length == 0) return
|
|
|
+ // 下拉多选弹窗数据多选回调
|
|
|
+ eldialogMultipleChoice(list, name) {
|
|
|
+ if (name == 'bcorps') {
|
|
|
+ let arr = []
|
|
|
+ if (list.length > 1) {
|
|
|
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('其他的组件')
|
|
|
+ arr = [list[list.length - 1]] // 获取最新点击的数组
|
|
|
+ this.$refs.bcorps.$refs.crud.toggleSelection(arr, true) // 把刚点击的数组变成选择状态
|
|
|
+ } else {
|
|
|
+ arr = list
|
|
|
}
|
|
|
- },
|
|
|
- // 详情接口
|
|
|
- finvouchersDetailfun(id) {
|
|
|
- this.pageLoading = true
|
|
|
- finvouchersDetail(id).then(res=>{
|
|
|
- this.pageLoading = false
|
|
|
- this.form = res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 添加分录
|
|
|
- addEntryfun(){
|
|
|
- let obj = {}
|
|
|
- if (this.form.finVouchersItemsList.length > 0){
|
|
|
- obj.descr = this.form.finVouchersItemsList[this.form.finVouchersItemsList.length - 1].descr
|
|
|
- }
|
|
|
- this.form.finVouchersItemsList.push(obj)
|
|
|
- },
|
|
|
- // 行添加
|
|
|
- addRowsfun(row,index){
|
|
|
- //第二个参数为0的时候,是可以添加参数的,1的时候是删除
|
|
|
- this.form.finVouchersItemsList.splice(index,0,{
|
|
|
- descr:row.descr
|
|
|
- });
|
|
|
- },
|
|
|
- // 行删除
|
|
|
- deletefun(row,index){
|
|
|
- if (row.id) {
|
|
|
- this.finvouchersitemsRemovefun(row.id)
|
|
|
- }
|
|
|
- this.form.finVouchersItemsList.splice(index,1)
|
|
|
- },
|
|
|
- // 删除分录
|
|
|
- deleteEntryfun(){
|
|
|
- if (this.handleSelectionData.length == 0) {
|
|
|
- return this.$message.warning('请选择至少一条数据')
|
|
|
- }
|
|
|
- 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)
|
|
|
- }
|
|
|
+ this.$refs.bcorps.selectionList = arr
|
|
|
+ } else {
|
|
|
+ console.log('其他的组件')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 详情接口
|
|
|
+ finvouchersDetailfun(id) {
|
|
|
+ this.pageLoading = true
|
|
|
+ finvouchersDetail(id).then(res => {
|
|
|
+ this.form = res.data.data
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 添加分录
|
|
|
+ addEntryfun() {
|
|
|
+ let obj = {}
|
|
|
+ if (this.form.finVouchersItemsList.length > 0) {
|
|
|
+ obj.descr = this.form.finVouchersItemsList[this.form.finVouchersItemsList.length - 1].descr
|
|
|
+ }
|
|
|
+ this.form.finVouchersItemsList.push(obj)
|
|
|
+ },
|
|
|
+ // 行添加
|
|
|
+ addRowsfun(row, index) {
|
|
|
+ //第二个参数为0的时候,是可以添加参数的,1的时候是删除
|
|
|
+ this.form.finVouchersItemsList.splice(index, 0, {
|
|
|
+ descr: row.descr
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 行删除
|
|
|
+ deletefun(row, index) {
|
|
|
+ if (row.id) {
|
|
|
+ this.finvouchersitemsRemovefun(row.id)
|
|
|
+ }
|
|
|
+ this.form.finVouchersItemsList.splice(index, 1)
|
|
|
+ },
|
|
|
+ // 删除分录
|
|
|
+ deleteEntryfun() {
|
|
|
+ if (this.handleSelectionData.length == 0) {
|
|
|
+ return this.$message.warning('请选择至少一条数据')
|
|
|
+ }
|
|
|
+ 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)
|
|
|
}
|
|
|
- })
|
|
|
- // 有id 的处理
|
|
|
- if(itemsWithId.length != 0) {
|
|
|
- this.finvouchersitemsRemovefun(arrIds.join(','))
|
|
|
- }
|
|
|
- },
|
|
|
- // 大保存
|
|
|
- finvouchersSubmitfun(){
|
|
|
- this.form.businessTypeCode = 'PZDH'
|
|
|
- this.form.billNoFormat = this.form.voucherType
|
|
|
- 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('请选择相同币种的科目')
|
|
|
- // }
|
|
|
+ })
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ this.finvouchersitemsRemovefun(arrIds.join(','))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 大保存
|
|
|
+ finvouchersSubmitfun() {
|
|
|
+ this.form.businessTypeCode = 'PZDH'
|
|
|
+ this.form.billNoFormat = this.form.voucherType
|
|
|
+ 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('请选择相同币种的科目')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 判断借方金额合计 是否等于 贷方金额合计
|
|
|
+ let amountDrSum = 0
|
|
|
+ let amountCrSum = 0
|
|
|
+ for (let item of this.form.finVouchersItemsList) {
|
|
|
+ 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)
|
|
|
// }
|
|
|
- // 判断借方金额合计 是否等于 贷方金额合计
|
|
|
- let amountDrSum = 0
|
|
|
- let amountCrSum = 0
|
|
|
- for (let item of this.form.finVouchersItemsList) {
|
|
|
- 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('凭证借贷金额不平衡')
|
|
|
- }
|
|
|
- console.log(this.form,379)
|
|
|
+ }
|
|
|
+ if (amountDrSum != amountCrSum) {
|
|
|
+ return this.$message.warning('凭证借贷金额不平衡')
|
|
|
+ }
|
|
|
+ console.log(this.form, 379)
|
|
|
|
|
|
- this.pageLoading = true
|
|
|
- finvouchersSubmit(this.form).then(res=>{
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.pageLoading = false
|
|
|
- this.finvouchersDetailfun(res.data.data.id)
|
|
|
- })
|
|
|
- },
|
|
|
- // 分录删除接口
|
|
|
- finvouchersitemsRemovefun(id){
|
|
|
- finvouchersitemsRemove(id).then(res=>{
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.finvouchersDetailfun()
|
|
|
- })
|
|
|
- },
|
|
|
- // 科目编辑打开辅助核算弹窗
|
|
|
- auxiliaryAccountingfun(row){
|
|
|
- // 获取状态
|
|
|
- accountsDetail(row.accountId).then(res=>{
|
|
|
- this.subjectAccount = res.data.data
|
|
|
- this.subjectRow = row
|
|
|
- // 如果三个都没有勾选 直接不自动打开弹窗
|
|
|
- if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl) {
|
|
|
- this.auxiliaryVisible = true
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 辅助核算弹窗确认按钮
|
|
|
- auxiliaryDeterminefun(){
|
|
|
- this.auxiliaryVisible = false
|
|
|
- },
|
|
|
- // 下拉回调
|
|
|
- corpChange(value,name){
|
|
|
- // 客户名称
|
|
|
- if (name == 'corpCnName') {
|
|
|
- for (let item of this.corpCnNameData) {
|
|
|
- if (item.cnName == value) {
|
|
|
- this.$set(this.subjectRow,'corpEnName',item.enName)
|
|
|
- this.$set(this.subjectRow,'corpCnName',item.cnName)
|
|
|
- this.$set(this.subjectRow,'corpId',item.id)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.pageLoading = true
|
|
|
+ finvouchersSubmit(this.form).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.finvouchersDetailfun(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 分录删除接口
|
|
|
+ finvouchersitemsRemovefun(id) {
|
|
|
+ finvouchersitemsRemove(id).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.finvouchersDetailfun()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 科目编辑打开辅助核算弹窗
|
|
|
+ auxiliaryAccountingfun(row) {
|
|
|
+ // 获取状态
|
|
|
+ accountsDetail(row.accountId).then(res => {
|
|
|
+ this.subjectAccount = res.data.data
|
|
|
+ this.subjectRow = row
|
|
|
+ // 如果三个都没有勾选 直接不自动打开弹窗
|
|
|
+ if (res.data.data.isCorp || res.data.data.isDept || res.data.data.isEmpl) {
|
|
|
+ this.auxiliaryVisible = true
|
|
|
}
|
|
|
- // 核算
|
|
|
- else if (name == 'deptName') {
|
|
|
- for (let item of this.deptData) {
|
|
|
- if (item.title == value) {
|
|
|
- this.$set(this.subjectRow,'deptName',item.title)
|
|
|
- this.$set(this.subjectRow,'deptId',item.id)
|
|
|
- }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 辅助核算弹窗确认按钮
|
|
|
+ auxiliaryDeterminefun() {
|
|
|
+ this.auxiliaryVisible = false
|
|
|
+ },
|
|
|
+ // 下拉回调
|
|
|
+ corpChange(value, name) {
|
|
|
+ // 客户名称
|
|
|
+ if (name == 'corpCnName') {
|
|
|
+ for (let item of this.corpCnNameData) {
|
|
|
+ if (item.cnName == value) {
|
|
|
+ this.$set(this.subjectRow, 'corpEnName', item.enName)
|
|
|
+ this.$set(this.subjectRow, 'corpCnName', item.cnName)
|
|
|
+ this.$set(this.subjectRow, 'corpId', item.id)
|
|
|
}
|
|
|
}
|
|
|
- // 职员
|
|
|
- else if (name == 'emplName') {
|
|
|
- for (let item of this.emplData) {
|
|
|
- if (item.name == value) {
|
|
|
- this.$set(this.subjectRow,'emplName',item.name)
|
|
|
- this.$set(this.subjectRow,'emplId',item.id)
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 核算
|
|
|
+ else if (name == 'deptName') {
|
|
|
+ for (let item of this.deptData) {
|
|
|
+ if (item.title == value) {
|
|
|
+ this.$set(this.subjectRow, 'deptName', item.title)
|
|
|
+ this.$set(this.subjectRow, 'deptId', item.id)
|
|
|
}
|
|
|
}
|
|
|
- // 项目核算
|
|
|
- else if (name == 'itemName') {
|
|
|
- for (let item of this.itemData) {
|
|
|
- if (item.cnName == value) {
|
|
|
- this.$set(this.subjectRow,'itemName',item.cnName)
|
|
|
- this.$set(this.subjectRow,'itemId',item.id)
|
|
|
- }
|
|
|
+ }
|
|
|
+ // 职员
|
|
|
+ else if (name == 'emplName') {
|
|
|
+ for (let item of this.emplData) {
|
|
|
+ if (item.name == value) {
|
|
|
+ this.$set(this.subjectRow, 'emplName', item.name)
|
|
|
+ this.$set(this.subjectRow, 'emplId', item.id)
|
|
|
}
|
|
|
- }else if (name == 'voucherType' || name == 'voucherSource') {
|
|
|
- this.$set(this.form,name,value)
|
|
|
}
|
|
|
- },
|
|
|
- // 接口数据调用
|
|
|
- // 客户
|
|
|
- getBcorpsListfun(cnName){
|
|
|
- getBcorpsList(1,10,{cnName}).then(res=>{
|
|
|
- this.corpCnNameData = res.data.data.records
|
|
|
- })
|
|
|
- },
|
|
|
- // 部门
|
|
|
- getDeptTreefun(){
|
|
|
- getDeptLazyTree(JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res=>{
|
|
|
- this.deptData = res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 职员
|
|
|
- userGetListfun(account = undefined,type = false,){
|
|
|
- userGetList(1,10,{account},JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res=>{
|
|
|
- this.emplData = res.data.data.records
|
|
|
- })
|
|
|
- },
|
|
|
+ }
|
|
|
// 项目核算
|
|
|
- baccitemstypeListfun(cnName){
|
|
|
- baccitemstypeList(1,10,{cnName}).then(res=>{
|
|
|
- this.itemData = res.data.data.records
|
|
|
- })
|
|
|
- },
|
|
|
- // 表格多选数据
|
|
|
- handleSelectionChange(list){
|
|
|
- this.handleSelectionData = list
|
|
|
- },
|
|
|
- // 弹窗点击差号
|
|
|
- handleClose(done) {
|
|
|
- this.$confirm('确认关闭?')
|
|
|
- .then(_ => {
|
|
|
- done();
|
|
|
- })
|
|
|
- .catch(_ => {});
|
|
|
- },
|
|
|
- // 获取字典数据
|
|
|
- getWorkDictsfun(){
|
|
|
- // 凭证字数据
|
|
|
- getWorkDicts('voucher_word_los').then(res=>{
|
|
|
- this.voucherTypeData = res.data.data
|
|
|
- })
|
|
|
- getWorkDicts('voucher_source_los').then(res=>{
|
|
|
- this.voucherSourceData = res.data.data
|
|
|
+ else if (name == 'itemName') {
|
|
|
+ for (let item of this.itemData) {
|
|
|
+ if (item.cnName == value) {
|
|
|
+ this.$set(this.subjectRow, 'itemName', item.cnName)
|
|
|
+ this.$set(this.subjectRow, 'itemId', item.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (name == 'voucherType' || name == 'voucherSource') {
|
|
|
+ this.$set(this.form, name, value)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 接口数据调用
|
|
|
+ // 客户
|
|
|
+ getBcorpsListfun(cnName) {
|
|
|
+ getBcorpsList(1, 10, { cnName }).then(res => {
|
|
|
+ this.corpCnNameData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 部门
|
|
|
+ getDeptTreefun() {
|
|
|
+ getDeptLazyTree(JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res => {
|
|
|
+ this.deptData = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 职员
|
|
|
+ userGetListfun(account = undefined, type = false,) {
|
|
|
+ userGetList(1, 10, { account }, JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]).then(res => {
|
|
|
+ this.emplData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 项目核算
|
|
|
+ baccitemstypeListfun(cnName) {
|
|
|
+ baccitemstypeList(1, 10, { cnName }).then(res => {
|
|
|
+ this.itemData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 表格多选数据
|
|
|
+ handleSelectionChange(list) {
|
|
|
+ this.handleSelectionData = list
|
|
|
+ },
|
|
|
+ // 弹窗点击差号
|
|
|
+ handleClose(done) {
|
|
|
+ this.$confirm('确认关闭?')
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
})
|
|
|
- },
|
|
|
- //返回列表
|
|
|
- backToList() {
|
|
|
- this.$emit('goBack')
|
|
|
- },
|
|
|
- }
|
|
|
+ .catch(_ => { });
|
|
|
+ },
|
|
|
+ // 获取字典数据
|
|
|
+ getWorkDictsfun() {
|
|
|
+ // 凭证字数据
|
|
|
+ getWorkDicts('voucher_word_los').then(res => {
|
|
|
+ this.voucherTypeData = res.data.data
|
|
|
+ })
|
|
|
+ getWorkDicts('voucher_source_los').then(res => {
|
|
|
+ this.voucherSourceData = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ backToList() {
|
|
|
+ this.$emit('goBack')
|
|
|
+ },
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
::v-deep.el-form-item {
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
+
|
|
|
.borderBox {
|
|
|
border: 1px solid #b6b6b6;
|
|
|
padding: 5px;
|
|
@@ -637,20 +596,23 @@
|
|
|
position: relative;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
+
|
|
|
.positionCheckbox {
|
|
|
position: absolute;
|
|
|
top: -10px;
|
|
|
left: 10px;
|
|
|
background: #fff;
|
|
|
}
|
|
|
+
|
|
|
.cardRight {
|
|
|
margin-right: 10px;
|
|
|
height: 220px;
|
|
|
}
|
|
|
+
|
|
|
.borderCheckbox {
|
|
|
border-bottom: 1px solid #4a9de6;
|
|
|
padding-bottom: 5px;
|
|
|
- color:#4a9de6;
|
|
|
+ color: #4a9de6;
|
|
|
margin-bottom: 5px;
|
|
|
}
|
|
|
|