|
@@ -100,19 +100,11 @@
|
|
|
>批量操作<a-icon type="down" /> </a-button>
|
|
|
</a-dropdown>
|
|
|
<span v-if="selectTotal" style="margin:0 10px;">已选 {{ selectTotal }} 项</span>
|
|
|
- </a-col>
|
|
|
- <a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
- <a-button
|
|
|
- :id="'salesEdit-searchBox-'+id"
|
|
|
- type="link"
|
|
|
- class="button-info"
|
|
|
- @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
|
|
|
<a-button
|
|
|
:id="'salesEdit-allSetWare-'+id"
|
|
|
type="link"
|
|
|
class="button-info"
|
|
|
size="small"
|
|
|
- style="margin-right:10px;"
|
|
|
@click="handleMenuClick({key:3})"
|
|
|
><a-icon type="setting"/> 全部仓库设置</a-button>
|
|
|
<a-button
|
|
@@ -123,6 +115,13 @@
|
|
|
@click="handleMenuClick({key:2})"
|
|
|
><a-icon type="delete"/> 全部删除</a-button>
|
|
|
</a-col>
|
|
|
+ <a-col :md="12" :sm="24" style="text-align:right;">
|
|
|
+ <a-button
|
|
|
+ :id="'salesEdit-searchBox-'+id"
|
|
|
+ type="link"
|
|
|
+ class="button-info"
|
|
|
+ @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
</div>
|
|
|
|
|
@@ -141,6 +140,7 @@
|
|
|
:table-data="dataSource"
|
|
|
row-key-field-name="id"
|
|
|
:checkbox-option="checkboxOption"
|
|
|
+ :cell-style-option="cellStyleOption"
|
|
|
/>
|
|
|
<div v-show="dataSource.length==0" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
|
|
|
</a-spin>
|
|
@@ -224,6 +224,13 @@ export default {
|
|
|
// column resize min width
|
|
|
minWidth: 50
|
|
|
},
|
|
|
+ cellStyleOption: {
|
|
|
+ headerCellClass: ({ column, rowIndex }) => {
|
|
|
+ if (column.align != 'center') {
|
|
|
+ return 'table-header-cell-center'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
dataSource: [],
|
|
|
showSearchBox: true, // 是否显示筛选条件
|
|
|
openWarehouseModal: false, // 打开仓库设置
|
|
@@ -289,14 +296,14 @@ export default {
|
|
|
return data || data == 0 ? data : '--'
|
|
|
}
|
|
|
const arr = [
|
|
|
- { title: '', field: '', key: '0', width: 40, type: 'checkbox', align: 'center' },
|
|
|
- { title: '序号', field: 'no', key: '1', width: 50, align: 'center', operationColumn: false },
|
|
|
+ { title: '', field: '', key: '0', width: 30, type: 'checkbox', align: 'center' },
|
|
|
+ { title: '序号', field: 'no', key: '1', width: 30, align: 'center', operationColumn: false },
|
|
|
{
|
|
|
title: '产品编码',
|
|
|
field: 'productCode',
|
|
|
key: '2',
|
|
|
- align: 'center',
|
|
|
- width: 120,
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
operationColumn: false,
|
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
return (
|
|
@@ -311,12 +318,32 @@ export default {
|
|
|
)
|
|
|
}
|
|
|
},
|
|
|
- { title: '产品名称', field: 'productName', key: '3', width: 150, align: 'center', operationColumn: false, ellipsis: { showTitle: true }, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.productEntity.name || '--' } },
|
|
|
+ {
|
|
|
+ title: '产品名称',
|
|
|
+ field: 'productName',
|
|
|
+ key: '3',
|
|
|
+ width: 150,
|
|
|
+ align: 'left',
|
|
|
+ operationColumn: false,
|
|
|
+ ellipsis: { showTitle: true },
|
|
|
+ renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
+ return (
|
|
|
+ <div class="ellipsisCon">
|
|
|
+ <a-tooltip placement="rightBottom">
|
|
|
+ <template slot="title">
|
|
|
+ <span>{ row.productEntity.name || '--' }</span>
|
|
|
+ </template>
|
|
|
+ <span class="ellipsisText">{ row.productEntity.name || '--' }</span>
|
|
|
+ </a-tooltip>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
title: '规则数量',
|
|
|
field: 'rulesNums',
|
|
|
key: '4',
|
|
|
- width: 60,
|
|
|
+ width: 50,
|
|
|
align: 'center',
|
|
|
operationColumn: false,
|
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
@@ -339,7 +366,7 @@ export default {
|
|
|
</a-popover> : '--'
|
|
|
)
|
|
|
} },
|
|
|
- { title: '起订量', field: 'promoUnit', key: '5', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
+ { title: '起订量', field: 'promoUnit', key: '5', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
|
|
|
{
|
|
|
title: '销售数量',
|
|
|
field: 'salesNums',
|
|
@@ -388,7 +415,7 @@ export default {
|
|
|
{
|
|
|
title: '出库仓库',
|
|
|
field: 'warehouseBox',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
key: '8',
|
|
|
align: 'center',
|
|
|
operationColumn: false,
|
|
@@ -417,7 +444,7 @@ export default {
|
|
|
{
|
|
|
title: '操作',
|
|
|
field: 'action',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
key: 'action',
|
|
|
align: 'center',
|
|
|
fixed: 'right',
|
|
@@ -431,7 +458,7 @@ export default {
|
|
|
id={'salesEdit-upactive-' + row.id}
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- loading={_this.delLoading}
|
|
|
+ disabled={_this.delLoading}
|
|
|
class="button-primary"
|
|
|
onClick={() => _this.handleUpdateActive(row)}
|
|
|
>换促销</a-button> : ''
|
|
@@ -442,7 +469,7 @@ export default {
|
|
|
id={'salesEdit-del-' + row.id}
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- loading={_this.delLoading}
|
|
|
+ disabled={_this.delLoading}
|
|
|
class="button-error"
|
|
|
onClick={() => _this.handleDel(row)}
|
|
|
>删除{row.regularPromotionSameFlag}</a-button> : ''
|
|
@@ -452,23 +479,28 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
- if (this.showStockCol) {
|
|
|
- arr.splice(7, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
|
|
|
- }
|
|
|
// 售价权限
|
|
|
- if (this.$hasPermissions('B_salesEdit_salesPrice')) {
|
|
|
- arr.splice(4, 0, { title: '售价(原价)',
|
|
|
+ if (_this.$hasPermissions('B_salesEdit_salesPrice')) {
|
|
|
+ arr.splice(4, 0, {
|
|
|
+ title: '售价(原价)',
|
|
|
field: 'price',
|
|
|
- width: 120,
|
|
|
+ width: 100,
|
|
|
key: 'price',
|
|
|
- align: 'center',
|
|
|
+ align: 'right',
|
|
|
operationColumn: false,
|
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
return <div>{_this.toThousands(row[column.field])}<span style="color:#666;margin-left:3px;" title="原价">({_this.toThousands(row.origPrice)})</span></div>
|
|
|
}
|
|
|
})
|
|
|
- arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 80, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
|
|
|
- arr.splice((_this.showStockCol ? 10 : 9), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
|
|
|
+ arr.splice(5, 0, { title: '价格级别', field: 'priceLevelDictValue', width: 60, key: 'priceLevel', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } })
|
|
|
+ if (_this.showStockCol) {
|
|
|
+ arr.splice(10, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
|
|
|
+ }
|
|
|
+ arr.splice((_this.showStockCol ? 11 : 10), 0, { title: '售价小计', field: 'totalAmount', key: 'totalAmount', width: 60, align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
|
|
|
+ } else {
|
|
|
+ if (_this.showStockCol) {
|
|
|
+ arr.splice(8, 0, { title: '第三方库存', field: 'thirdStockQty', key: 'thirdStockQty', width: 60, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
|
|
|
+ }
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -557,8 +589,8 @@ export default {
|
|
|
},
|
|
|
// 查询第三方库存
|
|
|
searchThreeStockOk () {
|
|
|
- this.showStockCol = true
|
|
|
this.resetSearchForm()
|
|
|
+ this.showStockCol = true
|
|
|
},
|
|
|
// 表格选中项
|
|
|
rowSelectionFun (obj) {
|
|
@@ -585,7 +617,6 @@ export default {
|
|
|
this.rowSelectionInfo = null
|
|
|
this.getTableData()
|
|
|
this.clearTableSelect()
|
|
|
- this.showStockCol = false
|
|
|
},
|
|
|
// 查询产品,不重置
|
|
|
searchProduct () {
|
|
@@ -629,7 +660,7 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.success('产品添加成功', 2.5)
|
|
|
this.resetSearchForm(true)
|
|
|
- this.$emit('refash', 'promo')
|
|
|
+ this.$emit('refash', 'promo', 'add')
|
|
|
}
|
|
|
this.spinning = false
|
|
|
this.isInster = false
|
|
@@ -664,7 +695,7 @@ export default {
|
|
|
}
|
|
|
this.$message.success('累计产品添加成功', 2.5)
|
|
|
this.resetSearchForm(true)
|
|
|
- this.$emit('refash', 'promo')
|
|
|
+ this.$emit('refash', 'promo', 'add')
|
|
|
}
|
|
|
this.spinning = false
|
|
|
this.isInster = false
|
|
@@ -680,6 +711,7 @@ export default {
|
|
|
_this.$message.warning('请先选择要批量取消的产品!')
|
|
|
return
|
|
|
}
|
|
|
+ const len = this.selectedRowKeys.length
|
|
|
const rowSelect = this.dataSource.filter(item => this.selectedRowKeys.includes(item.id))
|
|
|
// 判断是否全部为赠品
|
|
|
const obj = []
|
|
@@ -714,11 +746,11 @@ export default {
|
|
|
salesBillSn: _this.salesBillSn
|
|
|
}
|
|
|
// 更换活动
|
|
|
- _this.$emit('upActive', '0', params)
|
|
|
+ _this.$emit('upActive', params, 1)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 删除全部产品 this.promo ? this.promo.salesPromoSn : ''
|
|
|
+ // 删除全部产品
|
|
|
handleBatchDelAll () {
|
|
|
const _this = this
|
|
|
if (_this.dataSource.length == 0) {
|
|
@@ -731,10 +763,10 @@ export default {
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
_this.spinning = true
|
|
|
- deleteAll({ salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
+ deleteAll({ salesBillSn: _this.salesBillSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.searchProduct()
|
|
|
- _this.$emit('refash', 'promo')
|
|
|
+ _this.$emit('refash', 'promo', 'batchDel')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.spinning = false
|
|
@@ -759,12 +791,11 @@ export default {
|
|
|
_this.spinning = true
|
|
|
salesDetailBatchDel({
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: '',
|
|
|
salesBillDetailSnList: obj
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.searchProduct()
|
|
|
- _this.$emit('refash', 'promo')
|
|
|
+ _this.$emit('refash', 'promo', 'batchDel')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.spinning = false
|
|
@@ -778,8 +809,7 @@ export default {
|
|
|
const ajax_data = {
|
|
|
warehouseSn: row.warehouseSn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
- salesBillSn: this.salesBillSn,
|
|
|
- salesPromoSn: ''
|
|
|
+ salesBillSn: this.salesBillSn
|
|
|
}
|
|
|
this.setWarehouseInfo(ajax_data)
|
|
|
},
|
|
@@ -794,7 +824,6 @@ export default {
|
|
|
warehouseSn: sn,
|
|
|
salesBillDetailSnList: snArr,
|
|
|
salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: '',
|
|
|
allFlag: _this.warehouseTit ? true : undefined
|
|
|
}
|
|
|
_this.setWarehouseInfo(ajax_data)
|
|
@@ -807,7 +836,7 @@ export default {
|
|
|
console.log(res)
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- _this.$emit('refash', 'promo')
|
|
|
+ _this.$emit('refash', 'promo', 'update')
|
|
|
}
|
|
|
_this.openWarehouseModal = false
|
|
|
_this.searchProduct()
|
|
@@ -837,6 +866,7 @@ export default {
|
|
|
} else if (e.key == 4) { // 批量取消促销
|
|
|
_this.handleBatchCancelActive()
|
|
|
} else { // 全部删除
|
|
|
+ _this.clearTableSelect()
|
|
|
_this.handleBatchDelAll()
|
|
|
}
|
|
|
},
|
|
@@ -859,11 +889,10 @@ export default {
|
|
|
salesDetailUpdateQty({
|
|
|
salesBillDetailSn: record.salesBillDetailSn,
|
|
|
qty: record.qty,
|
|
|
- salesBillSn: _this.salesBillSn,
|
|
|
- salesPromoSn: ''
|
|
|
+ salesBillSn: _this.salesBillSn
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- _this.$emit('refash', 'promo')
|
|
|
+ _this.$emit('refash', 'promo', 'update')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.searchProduct()
|
|
@@ -884,10 +913,10 @@ export default {
|
|
|
onOk () {
|
|
|
_this.delLoading = true
|
|
|
_this.spinning = true
|
|
|
- salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn, salesPromoSn: '' }).then(res => {
|
|
|
+ salesDetailDel({ salesBillDetailSn: row.salesBillDetailSn, salesBillSn: _this.salesBillSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.searchProduct()
|
|
|
- _this.$emit('refash', 'promo')
|
|
|
+ _this.$emit('refash', 'promo', 'del')
|
|
|
_this.$message.success(res.message)
|
|
|
}
|
|
|
_this.delLoading = false
|
|
@@ -928,36 +957,11 @@ export default {
|
|
|
position: absolute;
|
|
|
bottom: 50px;
|
|
|
width: 100%;
|
|
|
+ }
|
|
|
+ .table-header-cell-center{
|
|
|
+ text-align: center!important;
|
|
|
}
|
|
|
.ant-input-number-sm input{
|
|
|
text-align: center;
|
|
|
}
|
|
|
- .alert-bar{
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- .countData{
|
|
|
- span{
|
|
|
- margin: 0 2px;
|
|
|
- color: rgb(0, 153, 255);
|
|
|
- }
|
|
|
- span.cor1{
|
|
|
- color: rgb(248, 132, 0);
|
|
|
- }
|
|
|
- b{
|
|
|
- font-weight: bold;
|
|
|
- span{
|
|
|
- color: red;
|
|
|
- font-weight: normal;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- > div{
|
|
|
- &:first-child{
|
|
|
- flex-grow: 1;
|
|
|
- width:70%;
|
|
|
- padding-right: 100px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
</style>
|