|
@@ -0,0 +1,247 @@
|
|
|
+<template>
|
|
|
+ <a-card size="small" :bordered="false" class="jg-page-wrap promotionInfoList-wrap">
|
|
|
+ <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="发布时间">
|
|
|
+ <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="促销名称">
|
|
|
+ <a-input id="promotionInfoList-urgentBillNo" v-model.trim="queryParam.urgentBillNo" allowClear placeholder="请输入急件单号"/>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="显示状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.status"
|
|
|
+ ref="status"
|
|
|
+ id="chainTransferInList-status"
|
|
|
+ code="URGENT_STATUS"
|
|
|
+ placeholder="请选择显示状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-form-item label="促销状态">
|
|
|
+ <v-select
|
|
|
+ v-model="queryParam.sourceType"
|
|
|
+ ref="sourceType"
|
|
|
+ id="promotionInfoList-sourceType"
|
|
|
+ code="SALES_SOURCE"
|
|
|
+ placeholder="请选择促销状态"
|
|
|
+ allowClear></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="4" :sm="24">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionInfoList-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="promotionInfoList-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable fixPagination"
|
|
|
+ ref="table"
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ bordered>
|
|
|
+ <!-- 参与客户 -->
|
|
|
+ <template slot="joinCustomers" slot-scope="text, record">
|
|
|
+ <span @click="openCustomerModal = true">共<span style="color:red;">17</span>个客户</span>
|
|
|
+ </template>
|
|
|
+ <!-- 状态 -->
|
|
|
+ <template slot="status" slot-scope="text, record">
|
|
|
+ <stateIcon :title="record.statusDictValue" :state="record.status=='WAIT'?'2':'1'"></stateIcon>
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.status == 'WAIT' && $hasPermissions('B_urgentWriteDown')"
|
|
|
+ @click="handleWriteDown(record)"
|
|
|
+ class="button-primary"
|
|
|
+ id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-spin>
|
|
|
+ <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"/>
|
|
|
+ <promotion-desc-modal :openModal="openDescModal" @close="openDescModal = false"/>
|
|
|
+ <promotion-show-modal :openModal="openShowModal" @close="openShowModal = false"/>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { urgentList, urgentWriteDown } from '@/api/urgent'
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
+import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import stateIcon from '@/views/common/stateIcon'
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
+import lookUpCustomersModal from './lookUpCustomersModal'
|
|
|
+import promotionDescModal from './promotionDescModal'
|
|
|
+import promotionShowModal from './promotionShowModal'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'UrgentOffsetList',
|
|
|
+ components: { STable, VSelect, rangeDate, custList, stateIcon, lookUpCustomersModal, promotionDescModal, promotionShowModal },
|
|
|
+ mixins: [commonMixin],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ tableHeight: 0,
|
|
|
+ openCustomerModal: false, // 参与客户弹窗
|
|
|
+ openDescModal: false, // 促销描述弹窗
|
|
|
+ openShowModal: true, // 促销展示弹窗
|
|
|
+ time: [
|
|
|
+ getDate.getCurrMonthDays().starttime,
|
|
|
+ getDate.getCurrMonthDays().endtime
|
|
|
+ ],
|
|
|
+ queryParam: { // 查询条件
|
|
|
+ beginDate: getDate.getCurrMonthDays().starttime,
|
|
|
+ endDate: getDate.getCurrMonthDays().endtime,
|
|
|
+ buyerNameCurrent: undefined, // 客户名称
|
|
|
+ bizBillNo: '', // 关联单号
|
|
|
+ urgentBillNo: '', // 急件单号
|
|
|
+ status: undefined, // 状态
|
|
|
+ sourceType: undefined // 单据来源
|
|
|
+ },
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
+ columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
+ { title: '发布时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '促销名称', dataIndex: 'buyerNameCurrent', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '促销时间', dataIndex: 'offSetTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '15%', align: 'center' },
|
|
|
+ { title: '促销描述', dataIndex: 'bizBillNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '促销展示', scopedSlots: { customRender: 'status' }, width: '15%', align: 'center' },
|
|
|
+ { title: '显示状态', dataIndex: 'bizBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '状态', dataIndex: 'bizBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
+ ],
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ return urgentList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ 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.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 时间 change
|
|
|
+ dateChange (date) {
|
|
|
+ this.queryParam.beginDate = date[0]
|
|
|
+ this.queryParam.endDate = date[1]
|
|
|
+ },
|
|
|
+ // 冲减
|
|
|
+ handleWriteDown (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定要进行冲减吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.disabled = true
|
|
|
+ _this.spinning = true
|
|
|
+ urgentWriteDown({ urgentBillSn: row.urgentBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ _this.disabled = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ resetSearchForm () {
|
|
|
+ this.$refs.rangeDate.resetDate(this.time)
|
|
|
+ this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
|
|
|
+ this.queryParam.endDate = getDate.getCurrMonthDays().endtime
|
|
|
+ this.queryParam.buyerNameCurrent = undefined
|
|
|
+ this.queryParam.bizBillNo = ''
|
|
|
+ this.queryParam.urgentBillNo = ''
|
|
|
+ this.queryParam.status = undefined
|
|
|
+ this.queryParam.sourceType = undefined
|
|
|
+ this.$refs.custList.resetForm()
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ handleDetail (row) {
|
|
|
+ this.$router.push({ path: `/salesManagement/urgentItemsOffset/detail/${row.urgentBillSn}` })
|
|
|
+ },
|
|
|
+ pageInit () {
|
|
|
+ const _this = this
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
+ _this.setTableH()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setTableH () {
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 195
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
+ this.pageInit()
|
|
|
+ this.resetSearchForm()
|
|
|
+ }
|
|
|
+ // 只刷新列表
|
|
|
+ if (this.$store.state.app.updateList) {
|
|
|
+ this.pageInit()
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
+ next(vm => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+ .promotionInfoList-wrap{
|
|
|
+ .red{
|
|
|
+ color: #ed1c24;
|
|
|
+ }
|
|
|
+ .green{
|
|
|
+ color: #19be6b;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|