|
@@ -1,13 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<!-- 已选配件列表 -->
|
|
<!-- 已选配件列表 -->
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
- <!-- 总计 -->
|
|
|
|
- <div style="padding:0 0 5px 0;" v-if="countData">
|
|
|
|
- 总款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>;
|
|
|
|
- 总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : 0 }}</strong>;
|
|
|
|
- <span v-if="$hasPermissions('B_salesDetail_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '0.00' }}</strong>;</span>
|
|
|
|
- </div>
|
|
|
|
- <div :style="{marginTop:type=='normal'?'0px':'10px'}">
|
|
|
|
|
|
+ <div :style="{position:'relative'}">
|
|
|
|
+ <!-- 总计 -->
|
|
|
|
+ <div style="padding:5px 0;" v-if="countData">
|
|
|
|
+ 总款数:<strong>{{ countData&&(countData.totalCategory || countData.totalCategory==0) ? countData.totalCategory : 0 }}</strong>;
|
|
|
|
+ 总数量:<strong>{{ countData&&(countData.totalQty || countData.totalQty==0) ? countData.totalQty : 0 }}</strong>;
|
|
|
|
+ <span v-if="$hasPermissions('B_salesDetail_salesPrice')">总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '0.00' }}</strong>;</span>
|
|
|
|
+ </div>
|
|
<ve-table
|
|
<ve-table
|
|
border-y
|
|
border-y
|
|
:scroll-width="0"
|
|
:scroll-width="0"
|
|
@@ -86,7 +86,7 @@ export default {
|
|
// 最大高度
|
|
// 最大高度
|
|
maxHeight: {
|
|
maxHeight: {
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
- default: '302'
|
|
|
|
|
|
+ default: '300'
|
|
},
|
|
},
|
|
// 是否显示表格头部
|
|
// 是否显示表格头部
|
|
showHeader: {
|
|
showHeader: {
|
|
@@ -165,7 +165,12 @@ export default {
|
|
{ title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
{ title: '序号', field: 'no', key: 'a', width: 50, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
{ title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
|
|
{ title: '产品编码', field: 'productCode', key: 'b', width: 150, align: 'left', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row, row[column.field], h) } },
|
|
{ title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
{ title: '产品名称', field: 'productName', key: 'c', width: 250, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
- {
|
|
|
|
|
|
+ { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
+ { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
|
|
|
|
+ ]
|
|
|
|
+ // 如果是活动产品列表
|
|
|
|
+ if (this.type == 'active') {
|
|
|
|
+ arr.splice(3, 0, {
|
|
title: '规则数量',
|
|
title: '规则数量',
|
|
field: 'rulesNums',
|
|
field: 'rulesNums',
|
|
key: '4',
|
|
key: '4',
|
|
@@ -174,27 +179,26 @@ export default {
|
|
operationColumn: false,
|
|
operationColumn: false,
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
return (
|
|
return (
|
|
- <a-popover placement="right">
|
|
|
|
- <template slot="content">
|
|
|
|
- {row.promoRuleSnList.map(item => {
|
|
|
|
- return (
|
|
|
|
- <div
|
|
|
|
- id={'dispacth-ruleDetail-' + row.productSn}
|
|
|
|
- title="点击查看详情"
|
|
|
|
- style="padding:5px 0;cursor: pointer;"
|
|
|
|
- onClick={() => _this.showRuleDetail(item)}
|
|
|
|
- >{ _this.activeRuleFilter(item) }</div>
|
|
|
|
- )
|
|
|
|
- })}
|
|
|
|
- </template>
|
|
|
|
- <a-button type="link" id={'dispacth-ruleSn-' + row.productSn} size="small" class="button-info">{row.promoRuleNum}<span style="zoom:0.6;color: #666;">个∨</span></a-button>
|
|
|
|
- </a-popover>
|
|
|
|
|
|
+ row.promoRuleSnList
|
|
|
|
+ ? <a-popover placement="right">
|
|
|
|
+ <template slot="content">
|
|
|
|
+ {row.promoRuleSnList.map(item => {
|
|
|
|
+ return (
|
|
|
|
+ <div
|
|
|
|
+ id={'dispacth-ruleDetail-' + row.productSn}
|
|
|
|
+ title="点击查看详情"
|
|
|
|
+ style="padding:5px 0;cursor: pointer;"
|
|
|
|
+ onClick={() => _this.showRuleDetail(item)}
|
|
|
|
+ >{ _this.activeRuleFilter(item) }</div>
|
|
|
|
+ )
|
|
|
|
+ })}
|
|
|
|
+ </template>
|
|
|
|
+ <a-button type="link" id={'dispacth-ruleSn-' + row.productSn} size="small" class="button-info">{row.promoRuleNum}<span style="zoom:0.6;color: #666;">个∨</span></a-button>
|
|
|
|
+ </a-popover> : '--'
|
|
)
|
|
)
|
|
}
|
|
}
|
|
- },
|
|
|
|
- { title: '原厂编码', field: 'productOrigCode', key: 'd', width: 150, align: 'left', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
|
- { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
|
|
|
|
- ]
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
// 计算可合并单元格数
|
|
// 计算可合并单元格数
|
|
if (this.$hasPermissions(this.authCode + '_costPrice')) { // 成本价权限
|
|
if (this.$hasPermissions(this.authCode + '_costPrice')) { // 成本价权限
|
|
arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
|
|
arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
|
|
@@ -293,6 +297,11 @@ export default {
|
|
// 赋值
|
|
// 赋值
|
|
this.dataSource = this.type == 'normal' ? normalList : activeList
|
|
this.dataSource = this.type == 'normal' ? normalList : activeList
|
|
|
|
|
|
|
|
+ // 没用数据,则不显示当前表格
|
|
|
|
+ if (this.dataSource.length == 0) {
|
|
|
|
+ this.$emit('hideTable', true)
|
|
|
|
+ }
|
|
|
|
+
|
|
// 格式化数据
|
|
// 格式化数据
|
|
let f = 0
|
|
let f = 0
|
|
let str = ''
|
|
let str = ''
|
|
@@ -333,7 +342,13 @@ export default {
|
|
|
|
|
|
const listLen = this.dataSource.length
|
|
const listLen = this.dataSource.length
|
|
this.showEmpty = listLen <= 0
|
|
this.showEmpty = listLen <= 0
|
|
- this.tableHeight = (this.showEmpty ? 0 : (listLen > 10 ? this.maxHeight : ((listLen + 1) * 30 + 2))) + 'px'
|
|
|
|
|
|
+ // 高度自适应
|
|
|
|
+ if (this.maxHeight == 'auto') {
|
|
|
|
+ this.tableHeight = (listLen + 1) * 30
|
|
|
|
+ this.tableHeight = this.tableHeight > 300 ? 300 : this.tableHeight
|
|
|
|
+ } else {
|
|
|
|
+ this.tableHeight = this.maxHeight
|
|
|
|
+ }
|
|
this.spinning = false
|
|
this.spinning = false
|
|
this.disabled = false
|
|
this.disabled = false
|
|
}
|
|
}
|
|
@@ -346,6 +361,9 @@ export default {
|
|
color: #999;
|
|
color: #999;
|
|
text-align: center;
|
|
text-align: center;
|
|
padding: 20px;
|
|
padding: 20px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 50px;
|
|
|
|
+ width: 100%;
|
|
}
|
|
}
|
|
.ve-table-body-td{
|
|
.ve-table-body-td{
|
|
.active-title{
|
|
.active-title{
|