|
@@ -58,7 +58,7 @@
|
|
</a-tabs>
|
|
</a-tabs>
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
<a-button type="primary" @click="handleAdd">批量添加</a-button>
|
|
<a-button type="primary" @click="handleAdd">批量添加</a-button>
|
|
- <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
|
|
|
|
|
|
+ <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项,数量合计{{ selectCount.totalNum }}个,售价小计合计{{ toThousands(selectCount.totalPrice) }}元</span>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
@@ -145,24 +145,37 @@ export default {
|
|
selectTotal () {
|
|
selectTotal () {
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
},
|
|
},
|
|
|
|
+ // 数量合计、售价小计
|
|
|
|
+ selectCount () {
|
|
|
|
+ let totalNum = 0
|
|
|
|
+ let totalPrice = 0
|
|
|
|
+ if (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length) {
|
|
|
|
+ this.rowSelectionInfo.selectedRows.forEach(item => {
|
|
|
|
+ totalNum += item.qty
|
|
|
|
+ totalPrice += item.totalAmount
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return { totalNum, totalPrice }
|
|
|
|
+ },
|
|
columns () {
|
|
columns () {
|
|
|
|
+ const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '销售单号', dataIndex: 'borrowBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '销售单号', dataIndex: 'borrowBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '客户名称', dataIndex: 'buyerName', width: '11%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '原厂编码', dataIndex: 'productEntity.origCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '原厂编码', dataIndex: 'productEntity.origCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '包装数', dataIndex: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
|
|
|
+ { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '70px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '50px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '包装数', dataIndex: 'packQtyV', width: '50px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
]
|
|
]
|
|
const idx = 7
|
|
const idx = 7
|
|
if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
|
|
if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
|
|
- arr.splice(idx, 0, { title: '售价', dataIndex: 'price', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
- arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
- arr.push({ title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
|
|
+ arr.splice(idx, 0, { title: '售价', dataIndex: 'price', width: '70px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
|
+ arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } })
|
|
|
|
+ arr.push({ title: '售价小计', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
}
|
|
}
|
|
return arr
|
|
return arr
|
|
}
|
|
}
|