|
@@ -57,17 +57,17 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- alert -->
|
|
|
- <div style="margin-bottom: 10px;display: flex;" v-if="detailData">
|
|
|
- <div>
|
|
|
+ <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="danger" :disabled="newLoading" class="button-error" @click="handlePlCancel">批量取消</a-button>
|
|
|
- <!-- <a-button type="default" :disabled="newLoading" @click="handleOneDispatch">有货一键下推</a-button> -->
|
|
|
+ <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
|
|
|
</div>
|
|
|
<div style="padding-left: 20px;">
|
|
|
总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
|
|
|
已取消数量:<strong>{{ detailData&&(detailData.totalCancelQty || detailData.totalCancelQty==0) ? detailData.totalCancelQty : '--' }}</strong>;
|
|
|
已下推数量:<strong>{{ detailData&&(detailData.totalPushedQty || detailData.totalPushedQty==0) ? detailData.totalPushedQty : '--' }}</strong>;
|
|
|
- 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;<br/>
|
|
|
+ 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
|
|
|
<span v-if="$hasPermissions('B_salesDispatch_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
|
|
|
<span v-if="$hasPermissions('B_salesDispatch_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
|
|
|
<span v-if="$hasPermissions('B_salesDispatch_costPrice')&&$hasPermissions('B_salesDispatch_salesPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
|
|
@@ -93,6 +93,7 @@
|
|
|
:cell-style-option="cellStyleOption"
|
|
|
:cell-span-option="cellSpanOption"
|
|
|
:column-width-resize-option="columnWidthResizeOption"
|
|
|
+ :checkbox-option="checkboxOption"
|
|
|
/>
|
|
|
<div v-show="showEmpty" class="empty-data">暂无数据</div>
|
|
|
</a-spin>
|
|
@@ -163,8 +164,22 @@ export default {
|
|
|
cellSpanOption: {
|
|
|
bodyCellSpan: this.bodyCellSpan,
|
|
|
},
|
|
|
+ checkboxOption:{
|
|
|
+ disableSelectedRowKeys: this.disableSelectedRowKeys,
|
|
|
+ selectedRowKeys: this.selectedRowKeys,
|
|
|
+ // 行选择改变事件
|
|
|
+ selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
+ this.selectedRowChange({ row, isSelected, selectedRowKeys })
|
|
|
+ },
|
|
|
+ // 全选改变事件
|
|
|
+ selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
+ this.selectedAllChange({ isSelected, selectedRowKeys })
|
|
|
+ },
|
|
|
+ },
|
|
|
showEmpty: false,
|
|
|
- showTableHead: true
|
|
|
+ showTableHead: true,
|
|
|
+ disableSelectedRowKeys: [],
|
|
|
+ selectedRowKeys: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -259,6 +274,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
let arr= [
|
|
|
+ { title: "", field: "", key: "acheck", type: "checkbox", align: "center" },
|
|
|
{ title: '序号', field: 'no',key: "a", width: 50, align: 'center', operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return noFormat(row,row[column.field],h)} },
|
|
|
{ title: '产品编码', field: 'productCode',key: "b", width: 150, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return codeFormat(row,row[column.field],h)} },
|
|
|
{ title: '产品名称', field: 'productName',key: "c", width: 250, align: 'center',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
|
|
@@ -293,7 +309,7 @@ export default {
|
|
|
if(column.field=='no'){
|
|
|
return {
|
|
|
rowspan: 1,
|
|
|
- colspan: 16,
|
|
|
+ colspan: 17,
|
|
|
};
|
|
|
}else{
|
|
|
return {
|
|
@@ -303,6 +319,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 选择单元格
|
|
|
+ selectedRowChange({ row, isSelected, selectedRowKeys }){
|
|
|
+ console.log(row, isSelected, selectedRowKeys);
|
|
|
+ this.selectedRowKeys = selectedRowKeys;
|
|
|
+ },
|
|
|
+ // 全选行
|
|
|
+ selectedAllChange({ isSelected, selectedRowKeys }){
|
|
|
+ console.log(isSelected, selectedRowKeys);
|
|
|
+ this.selectedRowKeys = this.dataSource.map((x) => x.rowKey);
|
|
|
+ },
|
|
|
// 获取销售单参与的活动列表
|
|
|
getActiveList(){
|
|
|
salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
|
|
@@ -327,6 +353,7 @@ export default {
|
|
|
// total: norTotal
|
|
|
},...proList]
|
|
|
const active = this.activeList
|
|
|
+ this.disableSelectedRowKeys.push('promo-normal')
|
|
|
// 活动产品
|
|
|
for(let i=0;i<active.length;i++){
|
|
|
const promo = active[i]
|
|
@@ -342,7 +369,7 @@ export default {
|
|
|
promo: promo,
|
|
|
// total: acTotal
|
|
|
},...aclist]
|
|
|
-
|
|
|
+ this.disableSelectedRowKeys.push('promo-'+i)
|
|
|
listData = aclist&&aclist.length ? listData.concat(retList) : listData
|
|
|
}
|
|
|
|
|
@@ -447,10 +474,6 @@ export default {
|
|
|
|
|
|
this.$emit('cancelProduct', obj)
|
|
|
},
|
|
|
- // 一键下推
|
|
|
- handleOneDispatch () {
|
|
|
- this.$emit('oneDispatch')
|
|
|
- },
|
|
|
// 产品分类 change
|
|
|
changeProductType (val, opt) {
|
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|