|
@@ -9,7 +9,9 @@
|
|
|
@cancle="isShow=false"
|
|
|
width="80%">
|
|
|
<div>
|
|
|
- <p>产品信息: 产品名称(产品编码)</p>
|
|
|
+ <p>产品信息:
|
|
|
+ {{ nowData ? (nowData.productEntity?(nowData.productEntity.name || '--') : '--') : '--' }}({{ nowData ? (nowData.productEntity?(nowData.productEntity.code || '--') : '--') : '--' }})
|
|
|
+ </p>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable"
|
|
@@ -18,18 +20,9 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1360, y: 400 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :scroll="{ x: 1180, y: 400 }"
|
|
|
bordered>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="link"
|
|
|
- @click="handleDetail(record)"
|
|
|
- class="button-success"
|
|
|
- id="orderStatisticsDetail-edit-btn">详情</a-button>
|
|
|
- <!-- <span>--</span> -->
|
|
|
- </template>
|
|
|
</s-table>
|
|
|
<div class="btn-cont"><a-button id="orderStatisticsDetail-back" @click="isShow = false">返回列表</a-button></div>
|
|
|
</div>
|
|
@@ -38,7 +31,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable } from '@/components'
|
|
|
-// import { custFindById } from '@/api/customer'
|
|
|
+import { getOperationalPrecision } from '@/libs/tools.js'
|
|
|
+import { salesDetailList } from '@/api/salesDetail'
|
|
|
export default {
|
|
|
name: 'OrderStatisticsDetailModal',
|
|
|
components: { STable },
|
|
@@ -47,9 +41,15 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- itemId: {
|
|
|
+ itemSn: {
|
|
|
type: [Number, String],
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ nowData: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
@@ -58,42 +58,29 @@ export default {
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '采购单号', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原价', dataIndex: 'productTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '促销价', dataIndex: 'productTotalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '数量', dataIndex: 'psroductTotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '单位', dataIndex: 'suppliersName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '原价小计', dataIndex: 'productTotdalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '促销价小计', dataIndex: 'productTdotalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '节省金额小计', dataIndex: 'productTdostalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '促销类型', dataIndex: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ { title: '采购单号', dataIndex: 'purchaseBillNo', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原价', dataIndex: 'origPrice', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '原价小计', dataIndex: 'priceSubtotal', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销价小计', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '节省金额小计', dataIndex: 'totalEconomizeAmount', width: 130, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销类型', dataIndex: 'promotionRulesName', width: 150, align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- // return sparePartsPurList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- // const data = res.data
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
- // }
|
|
|
- // return data
|
|
|
- // })
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [
|
|
|
- { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
|
|
|
- { id: '2', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' },
|
|
|
- { id: '3', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', inventoryNumss: '0' }
|
|
|
- ]
|
|
|
- }
|
|
|
+ return salesDetailList(Object.assign(parameter, { productSn: this.itemSn, promotionFlag: 1 })).then(res => {
|
|
|
+ const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ const origPrice = data.list[i].origPrice || 0
|
|
|
+ const qty = data.list[i].qty || 0
|
|
|
+ // 成本小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
+ data.list[i].priceSubtotal = getOperationalPrecision(origPrice, qty)
|
|
|
}
|
|
|
- resolve(data)
|
|
|
+ return data
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -112,7 +99,7 @@ export default {
|
|
|
this.$emit('close')
|
|
|
}
|
|
|
},
|
|
|
- itemId (newValue, oldValue) {
|
|
|
+ itemSn (newValue, oldValue) {
|
|
|
if (this.isShow && newValue) {
|
|
|
const _this = this
|
|
|
setTimeout(() => {
|