|
|
@@ -31,7 +31,7 @@
|
|
|
:clearable="true"
|
|
|
:remote="true"
|
|
|
:buttonIf="false"
|
|
|
- placeholder="请选择核算单位名称"
|
|
|
+ placeholder="请选择客户名称"
|
|
|
:forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
@remoteMethod="corpBcorpsListfun"
|
|
|
@corpChange="corpChange($event,'corpCnName',row)"
|
|
|
@@ -39,6 +39,36 @@
|
|
|
</search-query>
|
|
|
<span v-else>{{row.corpCnName}}</span>
|
|
|
</template>
|
|
|
+ <template slot="deptName" slot-scope="{row}">
|
|
|
+ <tree-select v-if="row.edit"
|
|
|
+ v-model="row.deptName" filterable
|
|
|
+ :data="deptData"
|
|
|
+ :props="{label:'title',children:'children'}"
|
|
|
+ nodeKey="title"
|
|
|
+ size="small"
|
|
|
+ :multiple="false"
|
|
|
+ placeholder="请选择部门名称"
|
|
|
+ @input="corpChange($event,'deptName',row)"
|
|
|
+ @focus="deptDeptLazyTreefun" >
|
|
|
+ </tree-select>
|
|
|
+ <span v-else>{{row.deptName}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="emplName" slot-scope="{row}">
|
|
|
+ <search-query v-if="row.edit"
|
|
|
+ :datalist="emplData"
|
|
|
+ :selectValue="row.emplName"
|
|
|
+ :filterable="true"
|
|
|
+ :clearable="true"
|
|
|
+ :remote="true"
|
|
|
+ :buttonIf="false"
|
|
|
+ placeholder="请选择职工名称"
|
|
|
+ :forParameter="{key:'id',label:'name',value:'name'}"
|
|
|
+ @remoteMethod="userPagelistfun"
|
|
|
+ @corpChange="corpChange($event,'emplName',row)"
|
|
|
+ @corpFocus="userPagelistfun">
|
|
|
+ </search-query>
|
|
|
+ <span v-else>{{row.emplName}}</span>
|
|
|
+ </template>
|
|
|
<template slot="itemName" slot-scope="{row}">
|
|
|
<search-query v-if="row.edit"
|
|
|
:datalist="itemData"
|
|
|
@@ -57,36 +87,36 @@
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{row}">
|
|
|
<el-input v-if="row.edit" style="width: 100%;" v-model="row.price"
|
|
|
- size="small" autocomplete="off" @input="openingInput(row)"
|
|
|
+ size="small" autocomplete="off" @blur="priceInputfun(row)"
|
|
|
clearable placeholder="请输入单价" >
|
|
|
</el-input>
|
|
|
<span v-else>{{row.price}}</span>
|
|
|
</template>
|
|
|
<template slot="quantityOpenDr" slot-scope="{row}">
|
|
|
<el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityOpenDr"
|
|
|
- size="small" autocomplete="off" @input="openingInput(row)"
|
|
|
+ size="small" autocomplete="off" @blur="openingInput(row)"
|
|
|
clearable placeholder="请输入期初借方数量" >
|
|
|
</el-input>
|
|
|
<span v-else>{{row.quantityOpenDr}}</span>
|
|
|
</template>
|
|
|
<template slot="quantityOpenCr" slot-scope="{row}">
|
|
|
<el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityOpenCr"
|
|
|
- size="small" autocomplete="off" @input="openingInput(row)"
|
|
|
- clearable placeholder="请输入期初借方数量" >
|
|
|
+ size="small" autocomplete="off" @blur="openingInput(row)"
|
|
|
+ clearable placeholder="请输入期初贷方数量" >
|
|
|
</el-input>
|
|
|
<span v-else>{{row.quantityOpenCr}}</span>
|
|
|
</template>
|
|
|
<template slot="quantityDr" slot-scope="{row}">
|
|
|
<el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityDr"
|
|
|
- size="small" autocomplete="off" @input="currentPeriodInput(row)"
|
|
|
+ size="small" autocomplete="off" @blur="currentPeriodInput(row)"
|
|
|
clearable placeholder="请输入本期借方数量" >
|
|
|
</el-input>
|
|
|
<span v-else>{{row.quantityDr}}</span>
|
|
|
</template>
|
|
|
<template slot="quantityCr" slot-scope="{row}">
|
|
|
<el-input v-if="row.edit" style="width: 100%;" v-model="row.quantityCr"
|
|
|
- size="small" autocomplete="off" @input="currentPeriodInput(row)"
|
|
|
- clearable placeholder="请输入本期借方数量" >
|
|
|
+ size="small" autocomplete="off" @blur="currentPeriodInput(row)"
|
|
|
+ clearable placeholder="请输入本期贷方数量" >
|
|
|
</el-input>
|
|
|
<span v-else>{{row.quantityCr}}</span>
|
|
|
</template>
|
|
|
@@ -115,9 +145,13 @@
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
import {getBcorpslistByType} from "@/api/iosBasicData/bcorps";
|
|
|
import {baccitemstypeList} from "@/api/iosBasicData/baccitemstype";
|
|
|
+ import {getDeptTree} from "@/api/system/dept"
|
|
|
+ import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
|
|
|
+ import { getList as userPagelist } from "@/api/system/user"
|
|
|
+ import {accountsSubmit} from "@/api/iosBasicData/accounts";
|
|
|
|
|
|
export default {
|
|
|
- components: {SearchQuery},
|
|
|
+ components: {TreeSelect, SearchQuery},
|
|
|
props:{
|
|
|
form:{
|
|
|
type:Object,
|
|
|
@@ -127,6 +161,8 @@
|
|
|
data(){
|
|
|
return {
|
|
|
corpData:[], // 客户数据
|
|
|
+ deptData:[], // 部门名称数据
|
|
|
+ emplData:[], // 员工数据
|
|
|
itemData:[], // 核算项目
|
|
|
multipleChoiceList:[], // 多选数据
|
|
|
option:{},
|
|
|
@@ -156,15 +192,6 @@
|
|
|
prop: "deptName",
|
|
|
width:"100",
|
|
|
},
|
|
|
- // {
|
|
|
- // label: "核算职员 Id",
|
|
|
- // prop: "emplId",
|
|
|
- // rules: [{
|
|
|
- // required: true,
|
|
|
- // message: "请输入核算职员 Id",
|
|
|
- // trigger: "blur"
|
|
|
- // }]
|
|
|
- // },
|
|
|
{
|
|
|
label: "核算职员",
|
|
|
prop: "emplName",
|
|
|
@@ -189,94 +216,106 @@
|
|
|
width: "90"
|
|
|
},
|
|
|
{
|
|
|
- label: "期初借方数量",
|
|
|
- prop: "quantityOpenDr",
|
|
|
- width: "100",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初贷方数量",
|
|
|
- prop: "quantityOpenCr",
|
|
|
- width: "100",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初数量期初余额",
|
|
|
- prop: "quantityOpenBlc",
|
|
|
- width: "100",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初外币借方金额",
|
|
|
- prop: "amountOpenDrUsd",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初外币贷方金额",
|
|
|
- prop: "amountOpenCrUsd",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初外币期初余额",
|
|
|
- prop: "amountOpenUsdBlc",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "期初本币借方金额(CNY)",
|
|
|
- prop: "amountOpenDr",
|
|
|
- width: "130",
|
|
|
+ label: "期初借方",
|
|
|
+ children:[
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityOpenDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币金额",
|
|
|
+ prop: "amountOpenDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币金额",
|
|
|
+ prop: "amountOpenDr",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "期初本币贷方金额(CNY)",
|
|
|
- prop: "amountOpenCr",
|
|
|
- width: "130",
|
|
|
+ label: "期初贷方",
|
|
|
+ children:[
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityOpenCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币金额",
|
|
|
+ prop: "amountOpenCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币金额",
|
|
|
+ prop: "amountOpenCr",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "期初本币余额(CNY)",
|
|
|
- prop: "amountOpenBlc",
|
|
|
- width: "130",
|
|
|
+ label: "期初余额",
|
|
|
+ children:[
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityOpenBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币",
|
|
|
+ prop: "amountOpenUsdBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币",
|
|
|
+ prop: "amountOpenBlc",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "本期数量借方",
|
|
|
- prop: "quantityDr",
|
|
|
- width: "100",
|
|
|
+ label: "本期借方",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币金额",
|
|
|
+ prop: "amountDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币金额",
|
|
|
+ prop: "amountDr",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "本期数量贷方",
|
|
|
- prop: "quantityCr",
|
|
|
- width: "100",
|
|
|
+ label: "本期贷方",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币金额",
|
|
|
+ prop: "amountCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币金额",
|
|
|
+ prop: "amountCr",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
- label: "本期数量余额",
|
|
|
- prop: "quantityBlc",
|
|
|
- width: "100",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期外币借方金额",
|
|
|
- prop: "amountDrUsd",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期外币贷方金额",
|
|
|
- prop: "amountCrUsd",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期外币余额",
|
|
|
- prop: "amountUsdBlc",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期本币借方金额(CNY)",
|
|
|
- prop: "amountDr",
|
|
|
- width: "130",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期本币贷方金额(CNY)",
|
|
|
- prop: "amountCr",
|
|
|
- width: "130",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "本期本币余额(CNY)",
|
|
|
- prop: "amountBlc",
|
|
|
- width: "130",
|
|
|
+ label: "本期余额",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ label: "数量",
|
|
|
+ prop: "quantityBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "外币",
|
|
|
+ prop: "amountUsdBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本币",
|
|
|
+ prop: "amountBlc",
|
|
|
+ },
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "备注",
|
|
|
@@ -306,6 +345,7 @@
|
|
|
editFun(row){
|
|
|
this.$set(row,'edit',!row.edit)
|
|
|
},
|
|
|
+ // 批量删除
|
|
|
handleDelete(){
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -330,31 +370,54 @@
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ // 单价改变
|
|
|
+ priceInputfun(row){
|
|
|
+ this.openingInput(row)
|
|
|
+ this.currentPeriodInput(row)
|
|
|
+ },
|
|
|
// 期初
|
|
|
openingInput(row){
|
|
|
- this.$set(row,'quantityOpenBlc',Number(row.quantityOpenCr) - Number(row.quantityOpenDr))
|
|
|
+ this.$set(row,'quantityOpenDr',row.quantityOpenDr?row.quantityOpenDr:0)
|
|
|
+ this.$set(row,'quantityOpenCr',row.quantityOpenCr?row.quantityOpenCr:0)
|
|
|
if (this.form.curCode == 'USD') {
|
|
|
+ // 期初借方外币金额 = 单价 * 期初借方数量
|
|
|
this.$set(row,'amountOpenDrUsd',Number(row.price) * Number(row.quantityOpenDr))
|
|
|
+ // 期初贷方外币金额 = 单价 * 期初贷方数量
|
|
|
this.$set(row,'amountOpenCrUsd',Number(row.price) * Number(row.quantityOpenCr))
|
|
|
+ // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
|
|
|
this.$set(row,'amountOpenUsdBlc',Number(row.amountOpenCrUsd) - Number(row.amountOpenDrUsd))
|
|
|
}else {
|
|
|
+ // 期初借方本币金额 = 单价 * 期初借方数量
|
|
|
this.$set(row,'amountOpenDr',Number(row.price) * Number(row.quantityOpenDr))
|
|
|
+ // 期初贷方本币金额 = 单价 * 期初贷方数量
|
|
|
this.$set(row,'amountOpenCr',Number(row.price) * Number(row.quantityOpenCr))
|
|
|
+ // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
|
|
|
this.$set(row,'amountOpenBlc',Number(row.amountOpenCr) - Number(row.amountOpenDr))
|
|
|
}
|
|
|
+ // 期初余额数量 = 期初贷方数量 - 期初借方数量
|
|
|
+ this.$set(row,'quantityOpenBlc',Number(row.quantityOpenCr) - Number(row.quantityOpenDr))
|
|
|
},
|
|
|
// 本期
|
|
|
currentPeriodInput(row){
|
|
|
- this.$set(row,'quantityBlc',Number(row.quantityCr) - Number(row.quantityDr))
|
|
|
+ this.$set(row,'quantityDr',row.quantityDr?row.quantityDr:0)
|
|
|
+ this.$set(row,'quantityCr',row.quantityCr?row.quantityCr:0)
|
|
|
if (this.form.curCode == 'USD') {
|
|
|
+ // 本期借方外币金额 = 单价 * 本期借方数量
|
|
|
this.$set(row,'amountDrUsd',Number(row.price) * Number(row.quantityDr))
|
|
|
+ // 本期贷方外币金额 = 单价 * 本期贷方数量
|
|
|
this.$set(row,'amountCrUsd',Number(row.price) * Number(row.quantityCr))
|
|
|
+ // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
|
|
|
this.$set(row,'amountUsdBlc',Number(row.amountCrUsd) - Number(row.amountDrUsd))
|
|
|
}else {
|
|
|
+ // 本期借方本币金额 = 单价 * 本期借方数量
|
|
|
this.$set(row,'amountDr',Number(row.price) * Number(row.amountDrUsd))
|
|
|
+ // 本期贷方本币金额 = 单价 * 本期借方数量
|
|
|
this.$set(row,'amountCr',Number(row.price) * Number(row.amountCrUsd))
|
|
|
+ // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
|
|
|
this.$set(row,'amountBlc',Number(row.amountCr) - Number(row.amountDr))
|
|
|
}
|
|
|
+ // 本期余额数量 = 本期贷方数量 - 本期借方数量
|
|
|
+ this.$set(row,'quantityBlc',Number(row.quantityCr) - Number(row.quantityDr))
|
|
|
},
|
|
|
// 下拉数据
|
|
|
corpChange(value,name,row){
|
|
|
@@ -366,13 +429,23 @@
|
|
|
this.$set(row,'corpEnName',item.enName)
|
|
|
}
|
|
|
}
|
|
|
- }else if (name == 'itemName') {
|
|
|
+ }else if (name == 'emplName') {
|
|
|
+ for (let item of this.emplData) {
|
|
|
+ if (item.name == value) {
|
|
|
+ this.$set(row,'emplId',item.id)
|
|
|
+ this.$set(row,'emplName',item.name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (name == 'itemName') {
|
|
|
for (let item of this.itemData) {
|
|
|
if (item.cnName == value) {
|
|
|
+ console.log(item,417)
|
|
|
this.$set(row,'itemId',item.id)
|
|
|
this.$set(row,'itemName',item.cnName)
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ this.$set(row,name,value)
|
|
|
}
|
|
|
},
|
|
|
// 获取核算客户数据
|
|
|
@@ -381,6 +454,18 @@
|
|
|
this.corpData = res.data.data.records
|
|
|
})
|
|
|
},
|
|
|
+ // 获取部分数据
|
|
|
+ deptDeptLazyTreefun(){
|
|
|
+ getDeptTree().then(res=>{
|
|
|
+ this.deptData = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取员工数据
|
|
|
+ userPagelistfun(realName){
|
|
|
+ userPagelist(1,10,{realName}).then(res=>{
|
|
|
+ this.emplData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取核算项目数据
|
|
|
baccitemstypeListfun(cnName){
|
|
|
baccitemstypeList(1,10,{cnName}).then(res=>{
|
|
|
@@ -430,11 +515,11 @@
|
|
|
|
|
|
<style scoped>
|
|
|
::v-deep#out-table .back-one {
|
|
|
- background: #ecf5ff !important;
|
|
|
+ //background: #ecf5ff !important;
|
|
|
text-align: center;
|
|
|
}
|
|
|
::v-deep#out-table .back-two {
|
|
|
- background: #ecf5ff !important;
|
|
|
+ //background: #ecf5ff !important;
|
|
|
text-align: center;
|
|
|
}
|
|
|
</style>
|