|
@@ -93,14 +93,14 @@
|
|
|
<span>{{ row.accStatus ? '是' : '否' }}</span>
|
|
|
</template>
|
|
|
<template slot="corpCnName" slot-scope="{ row }">
|
|
|
- <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.corpCnName"
|
|
|
- :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
|
|
|
- :forParameter="{ key: 'id', label: 'shortName', value: 'cnName' }"
|
|
|
- @remoteMethod="getBcorpsListfun($event, 'corpCnName')"
|
|
|
- @corpChange="corpChange($event, 'corpCnName', row, 'D')"
|
|
|
- @corpFocus="getBcorpsListfun($event, 'corpCnName')">
|
|
|
+ <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName" :filterable="true"
|
|
|
+ :clearable="true" :remote="true" :buttonIf="false"
|
|
|
+ :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
|
|
|
+ @remoteMethod="getBcorpsListfun($event, 'shortName')"
|
|
|
+ @corpChange="corpChange($event, 'shortName', row, 'D')"
|
|
|
+ @corpFocus="getBcorpsListfun($event, 'shortName')">
|
|
|
</search-query>
|
|
|
- <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ getKeyName(row.corpCnName) }}</span>
|
|
|
+ <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
|
|
|
</template>
|
|
|
<template slot="feeCnName" slot-scope="{ row }">
|
|
|
<search-query v-if="row.edit" :datalist="feeCnNameData" :selectValue="row.feeCnName" :filterable="true"
|
|
@@ -224,14 +224,14 @@
|
|
|
<span>{{ row.accStatus ? '是' : '否' }}</span>
|
|
|
</template>
|
|
|
<template slot="corpCnName" slot-scope="{ row }">
|
|
|
- <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.corpCnName"
|
|
|
- :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
|
|
|
- :forParameter="{ key: 'id', label: 'shortName', value: 'cnName' }"
|
|
|
- @remoteMethod="getBcorpsListfun($event, 'corpCnName')"
|
|
|
- @corpChange="corpChange($event, 'corpCnName', row, 'C')"
|
|
|
- @corpFocus="getBcorpsListfun($event, 'corpCnName')">
|
|
|
+ <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName" :filterable="true"
|
|
|
+ :clearable="true" :remote="true" :buttonIf="false"
|
|
|
+ :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
|
|
|
+ @remoteMethod="getBcorpsListfun($event, 'shortName')"
|
|
|
+ @corpChange="corpChange($event, 'shortName', row, 'C')"
|
|
|
+ @corpFocus="getBcorpsListfun($event, 'shortName')">
|
|
|
</search-query>
|
|
|
- <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ getKeyName(row.corpCnName) }}</span>
|
|
|
+ <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
|
|
|
</template>
|
|
|
<template slot="feeCnName" slot-scope="{ row }">
|
|
|
<search-query v-if="row.edit" :datalist="feeCnNameData" :selectValue="row.feeCnName" :filterable="true"
|
|
@@ -302,20 +302,19 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-card>
|
|
|
+ <avue-crud id="out-table" :option="sumOption" :data="sumData"></avue-crud>
|
|
|
<!--有admin 显示,有收和付各一个也显示出来-->
|
|
|
<div v-if="roleName.indexOf('admin') != -1 || ((roleName.indexOf('应收修改') != -1 || roleName.indexOf('应收查看') != -1) && (roleName.indexOf('应付修改') != -1 || roleName.indexOf('应付查看') != -1))"
|
|
|
style="display: flex;align-items: center;justify-content: space-around">
|
|
|
<div style="width: 30%">
|
|
|
<div class="bottomFlex" style="justify-content: space-around">
|
|
|
- <div style="text-align: center">
|
|
|
- <div class="weightfont">¥</div>
|
|
|
- <div>CNY</div>
|
|
|
- </div>
|
|
|
<div>
|
|
|
<div style="color: #81B337">
|
|
|
<span>应收:</span>
|
|
|
<span class="weightnum">¥{{ assemblyForm.amountDr }}元</span>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
<div style="color: #6BBCD1">
|
|
|
<span>应付:</span>
|
|
|
<span class="weightnum">¥{{ assemblyForm.amountCr }}元</span>
|
|
@@ -329,15 +328,13 @@
|
|
|
</div>
|
|
|
<div style="width: 30%">
|
|
|
<div class="bottomFlex" style="justify-content: space-around">
|
|
|
- <div style="text-align: center">
|
|
|
- <div class="weightfont">$</div>
|
|
|
- <div>USD</div>
|
|
|
- </div>
|
|
|
<div>
|
|
|
<div style="color: #81B337">
|
|
|
<span>应收:</span>
|
|
|
<span class="weightnum">${{ assemblyForm.amountDrUsd }}元</span>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
<div style="color: #6BBCD1">
|
|
|
<span>应付:</span>
|
|
|
<span class="weightnum">${{ assemblyForm.amountCrUsd }}元</span>
|
|
@@ -351,15 +348,14 @@
|
|
|
</div>
|
|
|
<div style="width: 30%">
|
|
|
<div class="bottomFlex" style="justify-content: space-around">
|
|
|
- <div style="text-align: center">
|
|
|
- <div class="weightfont">¥</div>
|
|
|
- <div>CNY合计</div>
|
|
|
- </div>
|
|
|
<div>
|
|
|
<div style="color: #81B337">
|
|
|
<span>应收:</span>
|
|
|
<span class="weightnum">¥{{ assemblyForm.amountDrLoc }}元</span>
|
|
|
</div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
<div style="color: #6BBCD1">
|
|
|
<span>应付:</span>
|
|
|
<span class="weightnum">¥{{ assemblyForm.amountCrLoc }}元</span>
|
|
@@ -535,6 +531,47 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ sumData: [],
|
|
|
+ sumOption: {
|
|
|
+ border: true,
|
|
|
+ align: 'center',
|
|
|
+ menuAlign: 'center',
|
|
|
+ menu: false,
|
|
|
+ header: false,
|
|
|
+ addBtn: false,
|
|
|
+ // height: '100px',
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '客户',
|
|
|
+ prop: 'corpCnName',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: 'RMB应收',
|
|
|
+ prop: 'rmbD',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: 'RMB应付',
|
|
|
+ prop: 'rmbC',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: 'USD应收',
|
|
|
+ prop: 'usdD',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: 'USD应付',
|
|
|
+ prop: 'usdC',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '合计应收',
|
|
|
+ prop: 'sumD',
|
|
|
+ overHidden: true,
|
|
|
+ }, {
|
|
|
+ label: '合计应付',
|
|
|
+ prop: 'sumC',
|
|
|
+ overHidden: true,
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
reportOption: {
|
|
|
nodeKey: "id",
|
|
|
addBtn: false,
|
|
@@ -576,8 +613,8 @@ export default {
|
|
|
{
|
|
|
label: "币别",
|
|
|
prop: "curCode",
|
|
|
- width:100,
|
|
|
- cell:true,
|
|
|
+ width: 100,
|
|
|
+ cell: true,
|
|
|
type: 'select',
|
|
|
dicData: [{
|
|
|
label: '全部',
|
|
@@ -1085,6 +1122,69 @@ export default {
|
|
|
console.log()
|
|
|
},
|
|
|
methods: {
|
|
|
+ getSum() {
|
|
|
+ let sumArr = []
|
|
|
+ let corpArr = []
|
|
|
+ let newArr = []
|
|
|
+ this.sumData = []
|
|
|
+ sumArr = this.assemblyForm.feeCenterListD.concat(this.assemblyForm.feeCenterListC)
|
|
|
+ sumArr.forEach(e => {
|
|
|
+ if (e.shortName) {
|
|
|
+ corpArr.push(e.shortName)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ newArr = [... new Set(corpArr)]
|
|
|
+ console.log(sumArr)
|
|
|
+ newArr.forEach(e => {
|
|
|
+ let rmbD = 0
|
|
|
+ let rmbC = 0
|
|
|
+ let usdD = 0
|
|
|
+ let usdC = 0
|
|
|
+ let sumD = 0
|
|
|
+ let sumC = 0
|
|
|
+ sumArr.forEach(item => {
|
|
|
+ if (e == item.shortName) {
|
|
|
+ if (item.curCode == 'CNY' && item.dc == 'D') {
|
|
|
+ rmbD += Number(item.rmbAmount)
|
|
|
+ sumD += Number(item.rmbAmount)
|
|
|
+ }
|
|
|
+ if (item.curCode == 'CNY' && item.dc == 'C') {
|
|
|
+ rmbC += Number(item.rmbAmount)
|
|
|
+ sumC += Number(item.rmbAmount)
|
|
|
+ }
|
|
|
+ if (item.curCode == 'USD' && item.dc == 'D') {
|
|
|
+ usdD += Number(item.usdAmount)
|
|
|
+ sumD += Number(item.usdAmount) * Number(item.exrate)
|
|
|
+ }
|
|
|
+ if (item.curCode == 'USD' && item.dc == 'C') {
|
|
|
+ usdC += Number(item.usdAmount)
|
|
|
+ sumC += Number(item.usdAmount) * Number(item.exrate)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.sumData.push({
|
|
|
+ corpCnName: e,
|
|
|
+ rmbD: rmbD,
|
|
|
+ rmbC: rmbC,
|
|
|
+ usdD: usdD,
|
|
|
+ usdC: usdC,
|
|
|
+ sumD: sumD,
|
|
|
+ sumC: sumC
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uniqueItems(list) {
|
|
|
+ const unique = [];
|
|
|
+ const seen = new Set();
|
|
|
+ for (const item of list) {
|
|
|
+ const key = item.id; // 假设根据id属性去重
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ unique.push(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return unique;
|
|
|
+ },
|
|
|
getKeyName(key) {
|
|
|
const item = this.corpCnNameData.find(item => item.cnName === key);
|
|
|
return item ? item.shortName : key;
|
|
@@ -1112,7 +1212,7 @@ export default {
|
|
|
reportCode: this.reportformsObj.classifyCode,
|
|
|
groupCode: this.reportformsObj.groupCode,
|
|
|
corpIds: row.id,
|
|
|
- curCode:row.curCode,
|
|
|
+ curCode: row.curCode,
|
|
|
type: 'HYCK'
|
|
|
}).then(res => {
|
|
|
this.handleReportPreview(this.reportformsObj.url, res.data.data.data)
|
|
@@ -1173,7 +1273,7 @@ export default {
|
|
|
this.printingLoading = false
|
|
|
res.data.data.forEach(e => {
|
|
|
e.$cellEdit = true
|
|
|
- e.curCode=null
|
|
|
+ e.curCode = null
|
|
|
})
|
|
|
this.PrintingData = res.data.data
|
|
|
})
|
|
@@ -1394,9 +1494,9 @@ export default {
|
|
|
// obj.usdAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmountNet
|
|
|
} else {
|
|
|
// 往来单位拿主表客户名称
|
|
|
- // obj.corpId = this.assemblyForm.corpId
|
|
|
- // obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
|
|
|
- // obj.corpEnName = this.assemblyForm.corpEnName
|
|
|
+ obj.corpId = this.assemblyForm.corpId
|
|
|
+ obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
|
|
|
+ obj.corpEnName = this.assemblyForm.corpEnName
|
|
|
// 预付/到付
|
|
|
obj.paymode = this.assemblyForm.mpaymode
|
|
|
}
|
|
@@ -1468,9 +1568,9 @@ export default {
|
|
|
// obj.usdAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmountNet
|
|
|
} else {
|
|
|
// 往来单位拿主表客户名称
|
|
|
- // obj.corpId = this.assemblyForm.corpId
|
|
|
- // obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
|
|
|
- // obj.corpEnName = this.assemblyForm.corpEnName
|
|
|
+ obj.corpId = this.assemblyForm.corpId
|
|
|
+ obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
|
|
|
+ obj.corpEnName = this.assemblyForm.corpEnName
|
|
|
// 预付/到付
|
|
|
obj.paymode = this.assemblyForm.mpaymode
|
|
|
}
|
|
@@ -1713,14 +1813,18 @@ export default {
|
|
|
},
|
|
|
// 客户的回调
|
|
|
async corpChange(value, name, row, dc) {
|
|
|
- if (name == 'corpCnName') {
|
|
|
+ if (name == 'shortName') {
|
|
|
+ console.log(value, name)
|
|
|
if (!value) {
|
|
|
+ this.$set(row, 'shortName', '')
|
|
|
this.$set(row, 'corpCnName', '')
|
|
|
this.$set(row, 'corpEnName', '')
|
|
|
this.$set(row, 'corpId', '')
|
|
|
}
|
|
|
for (let item of this.corpCnNameData) {
|
|
|
- if (item.cnName == value) {
|
|
|
+ if (item.shortName == value) {
|
|
|
+ console.log(item)
|
|
|
+ this.$set(row, 'shortName', item.shortName)
|
|
|
this.$set(row, 'corpCnName', item.cnName)
|
|
|
this.$set(row, 'corpEnName', item.enName)
|
|
|
this.$set(row, 'corpId', item.id)
|
|
@@ -2545,6 +2649,26 @@ export default {
|
|
|
},
|
|
|
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // 监听业务类型 如果不是分单 可以编辑分单号
|
|
|
+ 'assemblyForm.feeCenterListD': {
|
|
|
+ // 执行方法
|
|
|
+ handler(oldValue, newValue) {
|
|
|
+ this.getSum()
|
|
|
+ },
|
|
|
+ deep: true, // 深度监听
|
|
|
+ immediate: true // 第一次改变就执行
|
|
|
+ },
|
|
|
+ // 监听箱信息数据 箱信息中有温度 自动切换 冻货
|
|
|
+ 'assemblyForm.feeCenterListC': {
|
|
|
+ // 执行方法
|
|
|
+ handler(oldValue, newValue) {
|
|
|
+ this.getSum()
|
|
|
+ },
|
|
|
+ deep: true, // 深度监听
|
|
|
+ immediate: true // 第一次改变就执行,
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|