|
@@ -0,0 +1,273 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false">
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div ref="tableSearch" 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-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入活动名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="货架名称">
|
|
|
+ <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入货架名称"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="配件经销商">
|
|
|
+ <dealerList ref="dealerList" @change="dealerChange" id="redPacket-dealerChange"></dealerList>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <template v-if="advanced">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="汽车修理厂">
|
|
|
+ <storeList ref="storeList" @change="storeChange" id="redPacket-storeChange"></storeList>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="员工姓名">
|
|
|
+ <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工姓名"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="员工手机号码">
|
|
|
+ <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工手机号码"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="订单编号">
|
|
|
+ <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工手机号码"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="订单类型">
|
|
|
+ <v-select id="redPacket-state" code="SHELF_STATE" v-model="queryParam.state" allowClear placeholder="请选择订单类型"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="iSCM销售单号">
|
|
|
+ <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入iSCM销售单号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="红包奖励时间">
|
|
|
+ <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="红包发放状态">
|
|
|
+ <v-select id="redPacket-state" code="SHELF_STATE" v-model="queryParam.state" allowClear placeholder="请选择红包发放状态"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </template>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" id="redPacket-search">查询</a-button>
|
|
|
+ <a-button type="" @click="reset" id="gredPacket-reset" style="margin-left: 10px;">重置</a-button>
|
|
|
+ <a-button type="primary" class="button-warning" id="gredPacket-export" style="margin-left: 10px;">导出</a-button>
|
|
|
+ <a @click="advanced=!advanced" style="margin-left: 8px">
|
|
|
+ {{ advanced ? '收起' : '展开' }}
|
|
|
+ <a-icon :type="advanced ? 'up' : 'down'"/>
|
|
|
+ </a>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button type="primary" class="button-error" id="redPacket-handleEdit">批量标记已发</a-button>
|
|
|
+ <span>已选2项</span>
|
|
|
+ </div>
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
|
+ <div slot="message">
|
|
|
+ 售价总计:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
|
|
|
+ 成本总计:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
|
|
|
+ 毛利总计:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
|
|
|
+ 红包金额总计:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '--' }}</strong>;
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ </div>
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+84.5+'px', wordBreak: 'break-all' }"
|
|
|
+ size="small"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="columns"
|
|
|
+ :row-selection="{ columnWidth: 40 }"
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight, x: 2360 }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button size="small" type="link" class="button-info" @click="handlePublish(record)">标记已发</a-button>
|
|
|
+ <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import { getShelfList } from '@/api/shelf.js'
|
|
|
+import dealerList from '@/views/common/dealerList.vue'
|
|
|
+import storeList from '@/views/common/storeList.vue'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+export default {
|
|
|
+ name: 'UserList',
|
|
|
+ components: { STable, VSelect, storeList, dealerList, rangeDate },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ advanced: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ state: '', // 货架状态
|
|
|
+ settleType: '' // 结算状态
|
|
|
+ },
|
|
|
+ itemData: null, // 编辑行数据
|
|
|
+ // 表头
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
|
|
|
+ { title: '活动名称', dataIndex: 'shelfName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '货架名称', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '配件经销商', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '汽车修理厂', dataIndex: 'storeName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '员工姓名', dataIndex: 'createDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '员工手机号码', dataIndex: 'dealerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '订单编号', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '订单类型', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '订单状态', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '下单时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: 'VIN', dataIndex: 'settleTypeDictValue', width: '140px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '车型', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '下单数量', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '售价', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '售价小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '成本小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '毛利小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '红包奖励时间', dataIndex: 'createDate', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '红包毛利比例', dataIndex: 'shelfPlaceNum', width: '90px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '红包金额', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '红包发放状态', dataIndex: 'shelfPlaceNum', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '红包发放时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
+ { title: '操作', width: '120px', align: 'left', scopedSlots: { customRender: 'action' }, fixed: 'right' }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.spinning = true
|
|
|
+ return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ for (let i = 0; i < data.list.length; i++) {
|
|
|
+ const _item = data.list[i]
|
|
|
+ _item.no = no + i + 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ rowSelectionInfo: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 表格选中项
|
|
|
+ rowSelectionFun (obj) {
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
+ },
|
|
|
+ // 创建时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0] || ''
|
|
|
+ this.queryParam.endDate = date[1] || ''
|
|
|
+ },
|
|
|
+ // 经销商 change
|
|
|
+ dealerChange (obj) {
|
|
|
+ this.queryParam.dealerSn = obj.key || undefined
|
|
|
+ },
|
|
|
+ // 汽车修理厂 change
|
|
|
+ storeChange (obj) {
|
|
|
+ this.queryParam.storeSn = obj.key || undefined
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ reset () {
|
|
|
+ this.queryParam = {
|
|
|
+ shelfName: '', // 货架名称
|
|
|
+ state: undefined// 货架状态
|
|
|
+ }
|
|
|
+ if (this.advanced) {
|
|
|
+ this.$refs.rangeDate.resetDate()
|
|
|
+ this.queryParam.beginDate = ''
|
|
|
+ this.queryParam.endDate = ''
|
|
|
+ }
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 编辑/新增
|
|
|
+ handleEdit (row) {
|
|
|
+ if (row) { // 编辑
|
|
|
+ this.$router.push({ name: 'redPacketEdit', params: { shelfSn: row.sn } })
|
|
|
+ } else {
|
|
|
+ this.$router.push({ name: 'redPacketAdd' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 发布
|
|
|
+ handlePublish (row) {
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ handleDelete (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认要删除吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ productAudit({ sn: row.productSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.spinning = false
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 255
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.pageInit()
|
|
|
+ this.reset()
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {
|
|
|
+ if (from.name == 'redPacketEdit' || from.name == 'redPacketAdd') {
|
|
|
+ vm.$refs.table.refresh()
|
|
|
+ } else {
|
|
|
+ vm.reset()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|