|
@@ -50,7 +50,7 @@
|
|
|
@click="handleExport"
|
|
|
:disabled="disabled"
|
|
|
:loading="exportLoading"
|
|
|
- v-if="$hasPermissions('M_salesReturnReportExport')"
|
|
|
+ v-if="$hasPermissions('B_salesRankingReportExport')"
|
|
|
class="button-warning"
|
|
|
id="salesDetailReportList-export-btn">导出</a-button>
|
|
|
<a @click="advanced=!advanced" style="margin-left: 8px">
|
|
@@ -88,6 +88,7 @@
|
|
|
:maxTagCount="3"
|
|
|
:tree-data="colsArr"
|
|
|
tree-checkable
|
|
|
+ @change="handleShowFlag"
|
|
|
placeholder="请选择要显示的列(多选)"
|
|
|
/>
|
|
|
</div>
|
|
@@ -102,7 +103,7 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
:style="{ height: tableHeight+84+'px' }"
|
|
|
- :scroll="{ x: 1820,y: tableHeight}"
|
|
|
+ :scroll="{ x: 1800,y: tableHeight}"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
<!-- 产品分类 -->
|
|
@@ -136,7 +137,7 @@
|
|
|
</template>
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
|
- v-if="record.sysFlag==1"
|
|
|
+ v-if="record.sysFlag==1&&$hasPermissions('B_salesRankingAddCar')"
|
|
|
size="small"
|
|
|
type="link"
|
|
|
class="button-primary"
|
|
@@ -242,29 +243,34 @@ export default {
|
|
|
const _this = this
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
|
- { title: '品牌', dataIndex: 'productBrandName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '分类', scopedSlots: { customRender: 'productType' }, width: 100, align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', width: 150, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '品牌', dataIndex: 'productBrandName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '分类', scopedSlots: { customRender: 'productType' }, width: 150, align: 'center' },
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', width: 300, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '原厂编码', dataIndex: 'productOrigCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '单位', dataIndex: 'productUnit', width: 70, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ slots: { title: 'salesNumTit' }, dataIndex: 'salesTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '销售金额', dataIndex: 'salesTotalAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '销售折扣金额', dataIndex: 'salesTotalDiscountAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '销售折后金额', dataIndex: 'salesTotalDiscountedAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
- { title: '销售成本金额', dataIndex: 'salesTotalCost', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '当前库存数量', dataIndex: 'stockTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '当前库存金额', dataIndex: 'stockTotalCost', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 120, align: 'center', fixed: 'right' }
|
|
|
]
|
|
|
+ if (this.$hasPermissions('M_ShowAllCost')) {
|
|
|
+ arr.splice(11, 0, { title: '销售成本金额', dataIndex: 'salesTotalCost', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ }
|
|
|
if (this.showCols.includes('returnFlag')) {
|
|
|
arr.splice(12, 0, { slots: { title: 'salesReturnNum' }, dataIndex: 'salesReturnTotalQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
arr.splice(13, 0, { title: '销售退货金额', dataIndex: 'salesReturnTotalAmount', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.splice(14, 0, { title: '销售退货折扣金额', dataIndex: 'salesReturnTotalDiscountAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
arr.splice(15, 0, { title: '销售退货折后金额', dataIndex: 'salesReturnTotalDiscountedAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
- arr.splice(16, 0, { title: '销售退货成本金额', dataIndex: 'salesReturnTotalCost', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
- arr.splice(17, 0, { title: '销售数量合计', dataIndex: 'totalQty', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
- arr.splice(18, 0, { title: '销售金额合计', dataIndex: 'totalAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ if (this.$hasPermissions('M_ShowAllCost')) {
|
|
|
+ arr.splice(16, 0, { title: '销售退货成本金额', dataIndex: 'salesReturnTotalCost', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ }
|
|
|
+ const pos = this.showCols.includes('returnFlag') ? 17 : 16
|
|
|
+ arr.splice(pos, 0, { title: '销售数量合计', dataIndex: 'totalQty', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
+ arr.splice(pos * 1 + 1, 0, { title: '销售金额合计', dataIndex: 'totalAmount', width: 120, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
@@ -326,6 +332,7 @@ export default {
|
|
|
if (valid) {
|
|
|
const params = JSON.parse(JSON.stringify(_this.queryParam))
|
|
|
params.returnFlag = _this.showCols.includes('returnFlag') ? 1 : 0
|
|
|
+ params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
|
|
|
delete params.time
|
|
|
_this.exportLoading = true
|
|
|
_this.spinning = true
|
|
@@ -340,6 +347,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 判断是否显示销售退货(明细)
|
|
|
+ handleShowFlag (e) {
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
// 加入购物车
|
|
|
addShopCar (row) {
|
|
|
this.spinning = true
|