|
@@ -0,0 +1,259 @@
|
|
|
|
+<template>
|
|
|
|
+ <a-card size="small" :bordered="false" class="orderStatisticsList-wrap">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
|
+ <a-row :gutter="15">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="创建时间">
|
|
|
|
+ <a-range-picker
|
|
|
|
+ style="width:100%"
|
|
|
|
+ id="orderStatisticsList-createDate"
|
|
|
|
+ :disabledDate="disabledDate"
|
|
|
|
+ v-model="createDate"
|
|
|
|
+ :format="dateFormat"
|
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </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>
|
|
|
|
+ </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-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>
|
|
|
|
+ </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"
|
|
|
|
+ placeholder="请选择业务状态"
|
|
|
|
+ allowClear
|
|
|
|
+ ></v-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </template>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <span class="table-page-search-submitButtons" style="margin-top: 3px;">
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="orderStatisticsList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="orderStatisticsList-reset">重置</a-button>
|
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
|
+ </a>
|
|
|
|
+ </span>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </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>
|
|
|
|
+ </a-alert>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="default"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :scroll="{ x: 1360, y: tableHeight }"
|
|
|
|
+ bordered>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="link"
|
|
|
|
+ @click="handleDetail(record)"
|
|
|
|
+ class="button-success"
|
|
|
|
+ id="orderStatisticsList-edit-btn">详情</a-button>
|
|
|
|
+ <!-- <span>--</span> -->
|
|
|
|
+ </template>
|
|
|
|
+ </s-table>
|
|
|
|
+ <!-- 详情 -->
|
|
|
|
+ <orderStatisticsDetailModal :openModal="openModal" :itemId="itemId" @close="closeModal" />
|
|
|
|
+ </a-card>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import moment from 'moment'
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import orderStatisticsDetailModal from './detailModal.vue'
|
|
|
|
+// import { sparePartsPurList, sparePartsPurCount } from '@/api/sparePartsPur'
|
|
|
|
+// import { supplierAllList } from '@/api/supplier'
|
|
|
|
+export default {
|
|
|
|
+ components: { STable, VSelect, orderStatisticsDetailModal },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ advanced: false, // 高级搜索 展开/关闭
|
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
+ exportLoading: false, // 导出loading
|
|
|
|
+ supplierList: [], // 供应商列表数据
|
|
|
|
+ createDate: [], // 创建时间
|
|
|
|
+ dateFormat: 'YYYY-MM-DD',
|
|
|
|
+ tableHeight: 0,
|
|
|
|
+ // 查询参数
|
|
|
|
+ queryParam: {
|
|
|
|
+ sparePartsPurchaseNo: '', // 散件单号
|
|
|
|
+ supplierSn: undefined, // 供应商
|
|
|
|
+ state: undefined, // 单据状态
|
|
|
|
+ settleState: 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: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
+ ],
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ this.disabled = true
|
|
|
|
+ if (this.tableHeight == 0) {
|
|
|
|
+ this.tableHeight = window.innerHeight - 440
|
|
|
|
+ }
|
|
|
|
+ // 创建时间
|
|
|
|
+ if (this.createDate && this.createDate.length > 0) {
|
|
|
|
+ this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
|
|
|
|
+ this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
|
|
|
|
+ } else {
|
|
|
|
+ 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' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ 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
|
|
|
|
+ resolve(data)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ openModal: false, // 弹框是否显示
|
|
|
|
+ itemId: '', // 当前id
|
|
|
|
+ productTotal: { // 合计信息
|
|
|
|
+ productTotalCost: '',
|
|
|
|
+ productTotalQty: ''
|
|
|
|
+ },
|
|
|
|
+ dataTotalCount: '' // 列表数据总条数
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 不可选日期
|
|
|
|
+ disabledDate (date, dateStrings) {
|
|
|
|
+ return date && date.valueOf() > Date.now()
|
|
|
|
+ },
|
|
|
|
+ // 合计
|
|
|
|
+ getTotal (param) {
|
|
|
|
+ // sparePartsPurCount(param).then(res => {
|
|
|
|
+ // if (res.status == 200 && res.data) {
|
|
|
|
+ // this.productTotal = res.data
|
|
|
|
+ // } else {
|
|
|
|
+ // this.productTotal = {
|
|
|
|
+ // // 合计信息
|
|
|
|
+ // productTotalCost: '',
|
|
|
|
+ // productTotalQty: ''
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ },
|
|
|
|
+ // 详情
|
|
|
|
+ handleDetail (row) {
|
|
|
|
+ this.itemId = row.id
|
|
|
|
+ this.openModal = true
|
|
|
|
+ },
|
|
|
|
+ // 重置
|
|
|
|
+ resetSearchForm () {
|
|
|
|
+ this.queryParam.sparePartsPurchaseNo = ''
|
|
|
|
+ this.queryParam.supplierSn = undefined
|
|
|
|
+ this.queryParam.state = undefined
|
|
|
|
+ this.queryParam.settleState = undefined
|
|
|
|
+ this.createDate = undefined
|
|
|
|
+ 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 = []
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
|
+ next(vm => {
|
|
|
|
+ vm.getSupplierList()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style lang="less">
|
|
|
|
+ .orderStatisticsList-wrap{
|
|
|
|
+ .sTable{
|
|
|
|
+ margin-top: 15px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|