|
|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div v-for="(item) in datasource" style="margin-bottom: 10px">
|
|
|
+ <!-- <div v-for="(item) in datasource" style="margin-bottom: 10px">
|
|
|
<div>
|
|
|
<div style="margin-bottom: 10px;font-weight: bold;">
|
|
|
<div>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
- <span>销售订单:</span>
|
|
|
+ <span><span>{{ index + 1 }}</span> 销售订单:</span>
|
|
|
<span>{{ item.orderNo }}</span>
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
+ <el-divider direction="vertical"></el-divider> -->
|
|
|
<!-- <span>计价方式:</span>
|
|
|
<span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
|
|
|
<!-- <el-divider direction="vertical"></el-divider> -->
|
|
|
- <span>总金额:</span>
|
|
|
+ <!-- <span>总金额:</span>
|
|
|
<span>{{item.amountTotalPrice}}</span>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<span>应收金额:</span>
|
|
|
@@ -54,7 +54,7 @@
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<!-- <template v-slot:productName="{ row,$index }">-->
|
|
|
<!-- <el-popover-->
|
|
|
<!-- placement="right"-->
|
|
|
@@ -70,10 +70,74 @@
|
|
|
<!-- <el-button type="text" slot="reference">{{ row.productName }}</el-button>-->
|
|
|
<!-- </el-popover>-->
|
|
|
<!-- </template>-->
|
|
|
- </ele-pro-table>
|
|
|
+ <!-- </ele-pro-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-collapse-item v-for="(item, index) in datasource" :key="index" :name="index">
|
|
|
+ <template slot="title">
|
|
|
+ <div class="collapse-title">
|
|
|
+ <div class="collapse-title-left"><span class="collapse-title-index">{{ index + 1 }}</span> {{ type === 'purchase' ? '采购订单' : '销售订单' }}:{{ item.orderNo }}</div>
|
|
|
+ <div class="collapse-title-right">
|
|
|
+ <span>订单金额:{{ item.amountTotalPrice || 0 }}元</span>
|
|
|
+ <span>已对账金额:{{ item.statementAmount || 0 }}元</span>
|
|
|
+ <span>未对账金额:{{ item.unStatementAmount || 0 }}元</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div>
|
|
|
+ <el-tabs type="border-card">
|
|
|
+ <el-tab-pane :label="type === 'purchase' ? '收货单' : '发货单'">
|
|
|
+ <ele-pro-table :show-summary="false" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
|
|
|
+ :columns="getColumns(item, 'deliveryProducts')" max-height="500px" style="margin-bottom: 10px" :datasource="item.deliveryProducts || []"
|
|
|
+ cache-key="systemRoleTable17-11121" class="time-form">
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <div class="headbox">
|
|
|
+ <div>
|
|
|
+ <span class="amount">对账金额合计:{{ getSummariesA(item.deliveryProducts || []) }}元</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ row,$index }">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="退货单">
|
|
|
+ <ele-pro-table :show-summary="false" :summary-method="getSummaries" ref="table" row-key="id" :needPage="false"
|
|
|
+ :columns="getColumns(item, 'returnProducts')" max-height="500px" style="margin-bottom: 10px" :datasource="item.returnProducts || []"
|
|
|
+ cache-key="systemRoleTable17-11122" class="time-form">
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <div class="headbox">
|
|
|
+ <div>
|
|
|
+ <span class="amount">对账金额合计:{{ getSummariesA(item.returnProducts || []) }}元</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ row,$index }">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" v-if="dialogType!=='view'" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
|
|
|
<!-- <el-row v-if="dialogType=='view'" style="margin-top: 10px">-->
|
|
|
<!-- <el-col :span="6" style="float: right;">-->
|
|
|
@@ -90,14 +154,15 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
+import { pricingWayList } from '@/enum/dict';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
components: {},
|
|
|
- props: ['datasource', 'dialogType', 'dataForm'],
|
|
|
+ props: ['datasource', 'dialogType', 'dataForm', 'type'],
|
|
|
computed: {
|
|
|
getColumns() {
|
|
|
- return (j)=>{
|
|
|
+ return (item, type)=>{
|
|
|
let basicFields = [
|
|
|
{
|
|
|
width: 60,
|
|
|
@@ -107,10 +172,18 @@ export default {
|
|
|
align: 'center',
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
+ {
|
|
|
+ minWidth: 130,
|
|
|
+ prop: 'statementSubOrderNo',
|
|
|
+ label: type == 'deliveryProducts'? this.type === 'purchase'?'收货单编码':'发货单编码':'退货单编码',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'statementSubOrderNo',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
{
|
|
|
minWidth: 130,
|
|
|
prop: 'productOperateTime',
|
|
|
- label: this.subColumnsTypeList[j.subType],
|
|
|
+ label: type == 'deliveryProducts'? this.type === 'purchase'?'收货日期':'发货日期':'退货日期',
|
|
|
align: 'center',
|
|
|
slot: 'productOperateTime',
|
|
|
showOverflowTooltip: true
|
|
|
@@ -131,17 +204,17 @@ export default {
|
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
- {
|
|
|
- minWidth: 140,
|
|
|
- prop: 'subType',
|
|
|
- label: '退货产品类型',
|
|
|
- slot: 'subType',
|
|
|
- align: 'center',
|
|
|
- show:j.subType==11,
|
|
|
- showOverflowTooltip: true,formatter(_row, _column, cellValue){
|
|
|
- return cellValue==12?'实物赔偿':'原货'
|
|
|
- }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // minWidth: 140,
|
|
|
+ // prop: 'subType',
|
|
|
+ // label: '退货产品类型',
|
|
|
+ // slot: 'subType',
|
|
|
+ // align: 'center',
|
|
|
+ // show:j.subType==11,
|
|
|
+ // showOverflowTooltip: true,formatter(_row, _column, cellValue){
|
|
|
+ // return cellValue==12?'实物赔偿':'原货'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
|
|
|
{
|
|
|
minWidth: 100,
|
|
|
@@ -159,34 +232,35 @@ export default {
|
|
|
slot: 'modelType',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'provenance',
|
|
|
- label: '产地',
|
|
|
- slot: 'provenance',
|
|
|
- align: 'center',
|
|
|
- // show:this.contractBookType==2,
|
|
|
- minWidth: 200,
|
|
|
- showOverflowTooltip: true,
|
|
|
- formatter: (row, column) => {
|
|
|
-
|
|
|
- return row.provenance && row.provenance.length
|
|
|
- ? row.provenance
|
|
|
- .map((item) => this.getDictValue('产地', item ))
|
|
|
- .join(',')
|
|
|
- : '';
|
|
|
- }
|
|
|
- },
|
|
|
// {
|
|
|
- // minWidth: 100,
|
|
|
- // prop: 'pricingWay',
|
|
|
- // label: '计价方式',
|
|
|
+ // prop: 'provenance',
|
|
|
+ // label: '产地',
|
|
|
+ // slot: 'provenance',
|
|
|
// align: 'center',
|
|
|
- // slot: 'pricingWay',
|
|
|
+ // // show:this.contractBookType==2,
|
|
|
+ // minWidth: 200,
|
|
|
// showOverflowTooltip: true,
|
|
|
- // formatter: (_row, _column, cellValue) => {
|
|
|
- // return _row.pricingWay == 1 ? '按数量计价' :_row.pricingWay == 2? '按重量计价':''
|
|
|
+ // formatter: (row, column) => {
|
|
|
+
|
|
|
+ // return row.provenance && row.provenance.length
|
|
|
+ // ? row.provenance
|
|
|
+ // .map((item) => this.getDictValue('产地', item ))
|
|
|
+ // .join(',')
|
|
|
+ // : '';
|
|
|
// }
|
|
|
// },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'pricingWay',
|
|
|
+ label: '计价方式',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'pricingWay',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ let pricingWay = pricingWayList.find(item => item.id == cellValue)
|
|
|
+ return pricingWay ? pricingWay.name : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
minWidth: 100,
|
|
|
prop: 'totalCount',
|
|
|
@@ -237,40 +311,44 @@ export default {
|
|
|
label: '单价',
|
|
|
align: 'center',
|
|
|
slot: 'singlePrice',
|
|
|
- show:j.subType==11
|
|
|
},
|
|
|
{
|
|
|
minWidth: 100,
|
|
|
- prop: 'discountSinglePrice',
|
|
|
- label: '单价',
|
|
|
+ prop: 'taxRate',
|
|
|
+ label: '税率',
|
|
|
align: 'center',
|
|
|
- slot: 'discountSinglePrice',
|
|
|
- show:j.subType!=11
|
|
|
-
|
|
|
},
|
|
|
{
|
|
|
width: 150,
|
|
|
- prop: 'notaxSinglePrice',
|
|
|
+ prop: 'notTaxSinglePrice',
|
|
|
label: '不含税单价',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
prop: 'totalPrice',
|
|
|
- label: '合计金额',
|
|
|
+ label: '合计',
|
|
|
slot: 'totalPrice',
|
|
|
align: 'center',
|
|
|
- show:j.subType==11,
|
|
|
- fixed: 'right'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'discountRatio',
|
|
|
+ label: '折让比例',
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'discountSinglePrice',
|
|
|
+ label: '折让单价',
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
prop: 'discountTotalPrice',
|
|
|
- label: '合计金额',
|
|
|
+ label: '折让合计',
|
|
|
slot: 'discountTotalPrice',
|
|
|
align: 'center',
|
|
|
- show:j.subType!=11,
|
|
|
- fixed: 'right'
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -396,47 +474,75 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getTitle(){
|
|
|
- return (j)=>{
|
|
|
- let title=this.subTypeList[j.subType]+(j.statementSubOrderCode||'')+' '
|
|
|
- if(j.subType==11&&j.subExecType){
|
|
|
- if(j.subExecType=='10'){
|
|
|
- title=title+' 退货方式:全部原货 '
|
|
|
- }
|
|
|
- if(j.subExecType=='20'){
|
|
|
- title=title+' 退货方式:部分原货+实物赔偿'
|
|
|
- }
|
|
|
- if(j.subExecType=='30'){
|
|
|
- title=title+' 退货方式:部分原货+现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
|
|
|
- }
|
|
|
- if(j.subExecType=='40'){
|
|
|
- title=title+' 退货方式:全部实物赔偿'
|
|
|
- }
|
|
|
- if(j.subExecType=='50'){
|
|
|
- title=title+' 退货方式:全部现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
|
|
|
- }
|
|
|
- }
|
|
|
- return title
|
|
|
+ return (item, type)=>{
|
|
|
+ // let title=this.subTypeList[j.subType]+(j.statementSubOrderCode||'')+' '
|
|
|
+ // if(j.subType==11&&j.subExecType){
|
|
|
+ // if(j.subExecType=='10'){
|
|
|
+ // title=title+' 退货方式:全部原货 '
|
|
|
+ // }
|
|
|
+ // if(j.subExecType=='20'){
|
|
|
+ // title=title+' 退货方式:部分原货+实物赔偿'
|
|
|
+ // }
|
|
|
+ // if(j.subExecType=='30'){
|
|
|
+ // title=title+' 退货方式:部分原货+现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
|
|
|
+ // }
|
|
|
+ // if(j.subExecType=='40'){
|
|
|
+ // title=title+' 退货方式:全部实物赔偿'
|
|
|
+ // }
|
|
|
+ // if(j.subExecType=='50'){
|
|
|
+ // title=title+' 退货方式:全部现金赔偿 '+' 赔偿金额:'+j.amountPayablePrice
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ console.log(item[type])
|
|
|
+ const total = item[type]?.reduce((prev, curr) => {
|
|
|
+ console.log(curr.discountTotalPrice)
|
|
|
+ return prev + Number(curr.discountTotalPrice || 0) + '元';
|
|
|
+ }, 0);
|
|
|
+ return `对账金额合计:${total}`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getFHDatasource() {
|
|
|
+ return (item)=>{
|
|
|
+ return item.subList?.detailList
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- created(){
|
|
|
- this.requestDict('产地');
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
+ activeNames: [],
|
|
|
rules: {},
|
|
|
form: {},
|
|
|
subTypeList:{
|
|
|
10:'发货单:',
|
|
|
11:'退货单:',
|
|
|
12:'实物赔偿清单:',
|
|
|
+ 30:'调拨单:',
|
|
|
},
|
|
|
subColumnsTypeList:{
|
|
|
- 10:'发货日期',
|
|
|
- 11:'退货日期',
|
|
|
+ 10: '发货',
|
|
|
+ 11: '退货',
|
|
|
+ 30: '调拨'
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ datasource: {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
+ if (newVal.length > 0) {
|
|
|
+ this.activeNames = newVal.map((item, index) => index);
|
|
|
+ console.log('this.activeNames~~~', this.activeNames)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+ this.requestDict('产地');
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // this.activeNames = this.datasource.map((item, index) => index.toString());
|
|
|
+ // console.log('activeNames~~~', this.activeNames)
|
|
|
+ },
|
|
|
methods: {
|
|
|
remove(tableIndex, lineIndex, delType) {
|
|
|
let params = {
|
|
|
@@ -472,11 +578,45 @@ export default {
|
|
|
});
|
|
|
|
|
|
return sums;
|
|
|
+ },
|
|
|
+ getSummariesA(table) {
|
|
|
+ return table.reduce((prev, curr) => {
|
|
|
+ return prev + Number(curr.discountTotalPrice || 0)
|
|
|
+ }, 0)
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.collapse-title {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ width: 96%;
|
|
|
+}
|
|
|
+.collapse-title-left {
|
|
|
+ display: flex;
|
|
|
+ /* justify-content: center; */
|
|
|
+ align-items: center;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+.collapse-title-index {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background: #63a103;
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 24px;
|
|
|
+ border-radius: 50%;
|
|
|
+ color: #fff;
|
|
|
+ margin-right: 10px;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+.collapse-title-right {
|
|
|
+ display:grid;
|
|
|
+ grid-auto-flow: column;
|
|
|
+ gap: 18px;
|
|
|
+}
|
|
|
.headbox {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|