|
@@ -72,9 +72,16 @@
|
|
|
<!-- alert -->
|
|
|
<div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
- <a-button type="primary" :disabled="newLoading" class="button-info" v-if="showConvertPromoGifts" @click="handlePlPurchase">批量转采购额</a-button>
|
|
|
+ <a-button id="dispatch-plAdd" type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
|
|
|
<a-button
|
|
|
+ id="dispatch-plPurchase"
|
|
|
+ type="primary"
|
|
|
+ :disabled="newLoading"
|
|
|
+ class="button-info"
|
|
|
+ v-if="showConvertPromoGifts"
|
|
|
+ @click="handlePlPurchase">批量转采购额</a-button>
|
|
|
+ <a-button
|
|
|
+ id="dispatch-plCancel"
|
|
|
type="primary"
|
|
|
v-if="hasNormalProduct"
|
|
|
ghost
|
|
@@ -82,6 +89,7 @@
|
|
|
:disabled="newLoading"
|
|
|
@click="handlePlCancel">批量取消</a-button>
|
|
|
<a-button
|
|
|
+ id="dispatch-cancelAll"
|
|
|
type="primary"
|
|
|
v-if="hasPrompActive&&hasNoPushedActive"
|
|
|
ghost
|
|
@@ -95,6 +103,7 @@
|
|
|
<a-icon style="font-size: 14px;" type="question-circle" />
|
|
|
</a-tooltip>
|
|
|
<span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
+ <a-button type="primary" style="margin-left: 15px" class="button-info" id="dispatch-updateStock">整单转采购单</a-button>
|
|
|
</div>
|
|
|
<div style="padding-left: 20px;">
|
|
|
总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
@@ -150,15 +159,15 @@ export default {
|
|
|
mixins: [commonMixin],
|
|
|
components: { STable, VSelect, chooseWarehouse, detailModal },
|
|
|
props: {
|
|
|
- newLoading: {
|
|
|
+ newLoading: { // loading
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- maxHeight: {
|
|
|
+ maxHeight: { // 最大高度
|
|
|
type: [String, Number],
|
|
|
default: '300'
|
|
|
},
|
|
|
- showHeader: {
|
|
|
+ showHeader: { // 是否显示表格头部
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
}
|
|
@@ -166,12 +175,12 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
advanced: true, // 高级搜索 展开/关闭
|
|
|
- openDetailModal: false,
|
|
|
+ openDetailModal: false, // 活动规则详情弹框
|
|
|
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
- detailSn: null,
|
|
|
- productType: [],
|
|
|
- salesBillSn: '',
|
|
|
- detailData: null,
|
|
|
+ detailSn: null, // 活动详情sn
|
|
|
+ productType: [], // 产品类型
|
|
|
+ salesBillSn: '', // 销售单sn
|
|
|
+ detailData: null, // 详情数据
|
|
|
queryParam: {
|
|
|
pushProductType: '', // 类型
|
|
|
productCode: '', // 产品编码
|
|
@@ -181,15 +190,15 @@ export default {
|
|
|
productTypeSn1: '', // 产品一级分类
|
|
|
productTypeSn2: '', // 产品二级分类
|
|
|
productTypeSn3: '', // 产品三级分类
|
|
|
- salesBillSn: '',
|
|
|
- warehouseSn: undefined,
|
|
|
- convertPromoGiftsFlag: undefined
|
|
|
+ salesBillSn: '', // 销售单sn
|
|
|
+ warehouseSn: undefined, // 仓库sn
|
|
|
+ convertPromoGiftsFlag: undefined // 转采购额
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
activeList: [], // 活动列表
|
|
|
spinning: false,
|
|
|
- dataSource: [],
|
|
|
- tableData: [],
|
|
|
+ dataSource: [], // 原始数据
|
|
|
+ tableData: [], // 表格数据
|
|
|
cellStyleOption: {
|
|
|
bodyCellClass: ({ row, column, rowIndex }) => {
|
|
|
if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
|
|
@@ -206,30 +215,36 @@ export default {
|
|
|
cellSpanOption: {
|
|
|
bodyCellSpan: this.bodyCellSpan
|
|
|
},
|
|
|
- showEmpty: false,
|
|
|
- showTableHead: true,
|
|
|
- disableSelectedRowKeys: [],
|
|
|
- selectedRowKeys: [],
|
|
|
- colspanNums: 16,
|
|
|
- hasNormalProduct: false
|
|
|
+ showEmpty: false, // 空图片
|
|
|
+ showTableHead: true, // 表格头部
|
|
|
+ disableSelectedRowKeys: [], // 禁用数据
|
|
|
+ selectedRowKeys: [], // 已选数据
|
|
|
+ colspanNums: 16, // 列合并数量
|
|
|
+ hasNormalProduct: false // 是否有正常产品
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 表格高度
|
|
|
tableHeight () {
|
|
|
return (this.showEmpty ? 200 : this.maxHeight) + 'px'
|
|
|
},
|
|
|
+ // 是否有促销活动产品
|
|
|
hasPrompActive () {
|
|
|
return this.detailData && this.detailData.promoFlag == 1
|
|
|
},
|
|
|
+ // 是否有下推产品
|
|
|
hasNoPushedActive () {
|
|
|
return this.detailData && this.detailData.totalPushedQty == 0 || !this.detailData.totalPushedQty
|
|
|
},
|
|
|
+ // 是否有转采购额
|
|
|
hasConvertPromoGifts () {
|
|
|
return this.detailData && this.detailData.totalConvertPromoGiftsAmount > 0
|
|
|
},
|
|
|
+ // 是否显示转采购额选项
|
|
|
showConvertPromoGifts () {
|
|
|
return this.activeList && this.activeList.find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
|
|
|
},
|
|
|
+ // 表格复选框
|
|
|
checkboxOption () {
|
|
|
return {
|
|
|
disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
@@ -246,6 +261,7 @@ export default {
|
|
|
},
|
|
|
columns () {
|
|
|
const _this = this
|
|
|
+ // 价格
|
|
|
const priceFormat = function (record, data, h) {
|
|
|
return (
|
|
|
<div>
|
|
@@ -256,9 +272,11 @@ export default {
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
+ // 数字
|
|
|
const numsFormat = function (data) {
|
|
|
return data || data == 0 ? data : '--'
|
|
|
}
|
|
|
+ // 单号
|
|
|
const codeFormat = function (record, data, h) {
|
|
|
let ftext = ''
|
|
|
let fcolor = ''
|
|
@@ -286,6 +304,7 @@ export default {
|
|
|
return (
|
|
|
<div>
|
|
|
<a-input-number
|
|
|
+ id={'dispacth-cancelNums-' + record.productSn}
|
|
|
size="small"
|
|
|
value={record.cancelNums}
|
|
|
onChange={e => _this.cancelNumsChange(e, record)}
|
|
@@ -307,6 +326,7 @@ export default {
|
|
|
return (
|
|
|
<div>
|
|
|
<a-input-number
|
|
|
+ id={'dispacth-maxConvertNums-' + record.productSn}
|
|
|
size="small"
|
|
|
value={record.convertPromoGiftsQty}
|
|
|
onChange={e => _this.convertPromoGiftsChange(e, record)}
|
|
@@ -329,6 +349,7 @@ export default {
|
|
|
return (
|
|
|
<div>
|
|
|
<a-button
|
|
|
+ id={'dispacth-handleAdd-' + record.productSn}
|
|
|
size="small"
|
|
|
type="link"
|
|
|
class="button-info"
|
|
@@ -350,7 +371,7 @@ export default {
|
|
|
<div>
|
|
|
<strong style="font-size:14px;">{record.promo.promotion.description} </strong>
|
|
|
<span>({record.promo.promotionRule.description})</span>
|
|
|
- <span style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
|
|
|
+ <span id={'dispacth-desc-' + record.promo.promoRuleSn} style="margin-left:20px;color:#00aaff;cursor: pointer;" onClick={() => _this.showDesc(record.promo)}>
|
|
|
<a-icon title="查看活动详情" type="eye"/> 活动详情
|
|
|
</span>
|
|
|
</div>
|
|
@@ -384,7 +405,7 @@ export default {
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
arr.push({ title: '销售价', field: 'price', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row, row[column.field], h) } })
|
|
|
}
|
|
|
- if (this.$hasPermissions('B_salesDispatch_costPrice')) {
|
|
|
+ if (this.$hasPermissions('B_salesDispatch_costPrice')) { // 成本价权限
|
|
|
this.colspanNums = this.colspanNums + 1
|
|
|
arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'g', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return _this.toThousands(row[column.field]) || '--' } })
|
|
|
}
|
|
@@ -398,6 +419,7 @@ export default {
|
|
|
{ title: '待下推', field: 'unpushedQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
|
|
|
{ title: '取消数量', field: 'cancelNums', width: 80, key: 'r', align: 'center', fixed: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return inputFormat(row, row[column.field], h) } }
|
|
|
])
|
|
|
+ // 是否显示转采购额
|
|
|
if (this.showConvertPromoGifts) {
|
|
|
arr.push({ title: '转采购额数量',
|
|
|
field: 'convertPromoGiftsQty',
|
|
@@ -442,10 +464,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 取消数量变更
|
|
|
cancelNumsChange (v, record) {
|
|
|
record.cancelNums = v
|
|
|
this.dataSource.splice()
|
|
|
},
|
|
|
+ // 转采购数量变更
|
|
|
convertPromoGiftsChange (v, record) {
|
|
|
record.convertPromoGiftsQty = v
|
|
|
this.dataSource.splice()
|
|
@@ -479,6 +503,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 查询列表
|
|
|
async searchTable () {
|
|
|
this.selectedRowKeys = []
|
|
|
this.disableSelectedRowKeys = []
|
|
@@ -488,7 +513,7 @@ export default {
|
|
|
this.queryParam.salesBillSn = this.salesBillSn
|
|
|
this.queryParam.showStock = true
|
|
|
const params = this.queryParam
|
|
|
- console.log(params)
|
|
|
+ // 获取活动列表
|
|
|
const active = this.activeList
|
|
|
// 正常产品
|
|
|
const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
|
|
@@ -544,7 +569,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(listData)
|
|
|
this.dataSource = listData
|
|
|
|
|
|
// 格式化数据
|
|
@@ -568,7 +592,7 @@ export default {
|
|
|
} else {
|
|
|
item.maxConvertNums = 0
|
|
|
}
|
|
|
-
|
|
|
+ // 转采购额数量
|
|
|
item.bakConvertPromoGiftsQty = item.convertPromoGiftsQty
|
|
|
|
|
|
// 库存为0或待下推数为0,不可添加
|