|
@@ -17,36 +17,27 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
|
|
|
- <a-select
|
|
|
- id="orderStatisticsList-supplierSn"
|
|
|
- placeholder="请选择客户名称"
|
|
|
- allowClear
|
|
|
- v-model="queryParam.supplierSn"
|
|
|
- :showSearch="true"
|
|
|
- option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in supplierList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
|
|
|
- </a-select>
|
|
|
+ <custList ref="custList" id="orderStatisticsList-buyerSn" @change="custChange"></custList>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="销售单号">
|
|
|
- <a-input id="orderStatisticsList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入销售单号"/>
|
|
|
+ <a-input id="orderStatisticsList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<template v-if="advanced">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="活动名称">
|
|
|
- <a-input id="orderStatisticsList-sparePartsPurchaseNo" v-model.trim="queryParam.sparePartsPurchaseNo" allowClear placeholder="请输入活动名称"/>
|
|
|
+ <a-form-item label="促销名称">
|
|
|
+ <promoList ref="promoList" id="orderStatisticsList-promoActiveSn" @change="promoChange"></promoList>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="业务状态">
|
|
|
<v-select
|
|
|
- v-model="queryParam.state"
|
|
|
- ref="state"
|
|
|
- id="orderStatisticsList-state"
|
|
|
- code="SPARE_PARTS_PURCHASE"
|
|
|
+ v-model="queryParam.billStatus"
|
|
|
+ ref="billStatus"
|
|
|
+ id="orderStatisticsList-billStatus"
|
|
|
+ code="SALES_BILL_STATUS"
|
|
|
placeholder="请选择业务状态"
|
|
|
allowClear
|
|
|
></v-select>
|
|
@@ -68,7 +59,14 @@
|
|
|
</div>
|
|
|
<!-- alert -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">促销品原价总额: <strong>{{ dataTotalCount }}</strong> ;促销品促销价总额: <strong>{{ productTotal.productTotalQty }}</strong> ;总单数:<strong>{{ productTotal.productTotalCost }}</strong>;总款数:<strong>{{ productTotal.productTotalCost }}</strong>;节省总额:<strong>{{ productTotal.productTotalCost }}</strong>;总条数:<strong>{{ productTotal.productTotalCost }}</strong>。 </div>
|
|
|
+ <div slot="message">
|
|
|
+ 促销品原价总额:<strong>{{ productTotal ? ((productTotal.totalOrigAmount || productTotal.totalOrigAmount==0) ? productTotal.totalOrigAmount : '--') : '--' }}</strong>,
|
|
|
+ 促销品促销价总额:<strong>{{ productTotal ? ((productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--') : '--' }}</strong>,
|
|
|
+ 节省总额:<strong>{{ productTotal ? ((productTotal.totalEconomizeAmount || productTotal.totalEconomizeAmount==0) ? productTotal.totalEconomizeAmount : '--') : '--' }}</strong>,
|
|
|
+ 总单数:<strong>{{ productTotal ? ((productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--') : '--' }}</strong>,
|
|
|
+ 总款数:<strong>{{ productTotal ? ((productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--') : '--' }}</strong>,
|
|
|
+ 总数量:<strong>{{ productTotal ? ((productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--') : '--' }}</strong>
|
|
|
+ </div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -78,7 +76,7 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 1360, y: tableHeight }"
|
|
|
+ :scroll="{ x: 1690, y: tableHeight }"
|
|
|
bordered>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -88,22 +86,22 @@
|
|
|
@click="handleDetail(record)"
|
|
|
class="button-success"
|
|
|
id="orderStatisticsList-edit-btn">详情</a-button>
|
|
|
- <!-- <span>--</span> -->
|
|
|
</template>
|
|
|
</s-table>
|
|
|
<!-- 详情 -->
|
|
|
- <orderStatisticsDetailModal :openModal="openModal" :itemId="itemId" @close="closeModal" />
|
|
|
+ <orderStatisticsDetailModal :openModal="openModal" :itemSn="itemSn" :nowData="nowData" @close="closeModal" />
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import moment from 'moment'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
+import promoList from '@/views/common/promoList.vue'
|
|
|
import orderStatisticsDetailModal from './detailModal.vue'
|
|
|
-// import { sparePartsPurList, sparePartsPurCount } from '@/api/sparePartsPur'
|
|
|
-// import { supplierAllList } from '@/api/supplier'
|
|
|
+import { salesPromoList, salesPromoCount } from '@/api/sales'
|
|
|
export default {
|
|
|
- components: { STable, VSelect, orderStatisticsDetailModal },
|
|
|
+ components: { STable, VSelect, orderStatisticsDetailModal, custList, promoList },
|
|
|
data () {
|
|
|
return {
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
@@ -115,25 +113,25 @@ export default {
|
|
|
tableHeight: 0,
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- sparePartsPurchaseNo: '', // 散件单号
|
|
|
- supplierSn: undefined, // 供应商
|
|
|
- state: undefined, // 单据状态
|
|
|
- settleState: undefined // 结算状态
|
|
|
+ buyerSn: undefined,
|
|
|
+ promoActiveSn: undefined,
|
|
|
+ salesBillNo: '',
|
|
|
+ billStatus: undefined
|
|
|
},
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
|
|
|
- { title: '单据来源', dataIndex: 'suspplierName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '销售单号', dataIndex: 'sparePartsPurchaseNo', width: 220, align: 'center' },
|
|
|
- { title: '促销名称', dataIndex: 'supplierName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '客户名称', dataIndex: 'productTotalCategory', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { 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: '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: 'stateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单据来源', dataIndex: 'salesBillSourceDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售单号', dataIndex: 'salesBillNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '促销名称', dataIndex: 'promoName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '客户名称', dataIndex: 'buyerName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '促销品款数', dataIndex: 'totalPromoCategory', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销品数量', dataIndex: 'totalPromoQty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '原价总额', dataIndex: 'promoTotal', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '促销品总额', dataIndex: 'totalPromoAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '节省总额', dataIndex: 'totalEconomizeAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '业务状态', dataIndex: 'billStatusDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -150,43 +148,26 @@ export default {
|
|
|
this.queryParam.beginDate = undefined
|
|
|
this.queryParam.endDate = undefined
|
|
|
}
|
|
|
- // 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
|
|
|
- // }
|
|
|
- // this.disabled = false
|
|
|
- // this.dataTotalCount = data.count
|
|
|
- // this.getTotal(Object.assign(parameter, this.queryParam))
|
|
|
- // 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 salesPromoList(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
|
|
|
+ const promotionActivityNameList = data.list[i].promotionActivityNameList || []
|
|
|
+ data.list[i].promoName = promotionActivityNameList.join(',')
|
|
|
+ const totalPromoAmount = data.list[i].totalPromoAmount || 0
|
|
|
+ const totalEconomizeAmount = data.list[i].totalEconomizeAmount || 0
|
|
|
+ data.list[i].promoTotal = Number(totalPromoAmount) + Number(totalEconomizeAmount)
|
|
|
}
|
|
|
- _this.disabled = false
|
|
|
- resolve(data)
|
|
|
+ this.disabled = false
|
|
|
+ this.getTotal(Object.assign(parameter, this.queryParam))
|
|
|
+ return data
|
|
|
})
|
|
|
},
|
|
|
openModal: false, // 弹框是否显示
|
|
|
- itemId: '', // 当前id
|
|
|
- productTotal: { // 合计信息
|
|
|
- productTotalCost: '',
|
|
|
- productTotalQty: ''
|
|
|
- },
|
|
|
- dataTotalCount: '' // 列表数据总条数
|
|
|
+ itemSn: '', // 当前sn
|
|
|
+ nowData: null,
|
|
|
+ productTotal: null
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -194,58 +175,46 @@ export default {
|
|
|
disabledDate (date, dateStrings) {
|
|
|
return date && date.valueOf() > Date.now()
|
|
|
},
|
|
|
+ custChange (obj) {
|
|
|
+ this.queryParam.buyerSn = obj.key
|
|
|
+ },
|
|
|
+ promoChange (obj) {
|
|
|
+ this.queryParam.promoActiveSn = obj.key
|
|
|
+ },
|
|
|
// 合计
|
|
|
getTotal (param) {
|
|
|
- // sparePartsPurCount(param).then(res => {
|
|
|
- // if (res.status == 200 && res.data) {
|
|
|
- // this.productTotal = res.data
|
|
|
- // } else {
|
|
|
- // this.productTotal = {
|
|
|
- // // 合计信息
|
|
|
- // productTotalCost: '',
|
|
|
- // productTotalQty: ''
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
+ salesPromoCount(param).then(res => {
|
|
|
+ if (res.status == 200 && res.data) {
|
|
|
+ this.productTotal = res.data
|
|
|
+ } else {
|
|
|
+ this.productTotal = null
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 详情
|
|
|
handleDetail (row) {
|
|
|
- this.itemId = row.id
|
|
|
+ this.itemSn = row.salesBillSn
|
|
|
+ this.nowData = row
|
|
|
this.openModal = true
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.sparePartsPurchaseNo = ''
|
|
|
- this.queryParam.supplierSn = undefined
|
|
|
- this.queryParam.state = undefined
|
|
|
- this.queryParam.settleState = undefined
|
|
|
- this.createDate = undefined
|
|
|
+ this.queryParam.buyerSn = undefined
|
|
|
+ this.queryParam.promoActiveSn = undefined
|
|
|
+ this.queryParam.salesBillNo = ''
|
|
|
+ this.queryParam.billStatus = undefined
|
|
|
+ this.createDate = []
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 关闭弹框
|
|
|
closeModal () {
|
|
|
this.openModal = false
|
|
|
- this.itemId = ''
|
|
|
- },
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
- },
|
|
|
- // 供应商下拉数据
|
|
|
- getSupplierList () {
|
|
|
- // supplierAllList().then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // this.supplierList = res.data
|
|
|
- // } else {
|
|
|
- // this.supplierList = []
|
|
|
- // }
|
|
|
- // })
|
|
|
+ this.itemSn = ''
|
|
|
}
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
- vm.getSupplierList()
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
}
|