|
@@ -7,21 +7,21 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="券名称/券副标题">
|
|
|
- <a-input id="couponDetails-name" v-model.trim="queryParam.name" allowClear placeholder="请输入券名称/券副标题"/>
|
|
|
+ <a-input id="couponDetails-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入券名称/券副标题"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="客户名称">
|
|
|
- <a-input id="couponDetails-customerName" v-model.trim="queryParam.customerName" allowClear placeholder="请输入客户名称"/>
|
|
|
+ <selectCust ref="custList" :isValidateEnabled="true" id="couponDetails-customerSn" @change="custChange" v-model="queryParam.customerSn"></selectCust>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="券状态">
|
|
|
<v-select
|
|
|
- v-model="queryParam.state"
|
|
|
+ v-model="queryParam.ticketState"
|
|
|
ref="sourceType"
|
|
|
- id="couponDetails-state"
|
|
|
- code="PROMO_STATE"
|
|
|
+ id="couponDetails-ticketState"
|
|
|
+ code="TICKET_STATE"
|
|
|
placeholder="请选择优惠券使用状态"
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
@@ -45,30 +45,41 @@
|
|
|
:scroll="{ y: tableHeight }"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
+ <!-- 有效期 -->
|
|
|
+ <template slot="dateBox" slot-scope="text, record">
|
|
|
+ <span v-if="record.validStartDate&&record.validEndDate">
|
|
|
+ {{ record.validStartDate }}-{{ record.validEndDate }}
|
|
|
+ </span>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </template>
|
|
|
+ <!-- 优惠券状态 ticketState 已使用USED 未使用 UNUSED 已过期 DATED -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
|
size="small"
|
|
|
+ v-if="record.ticketState==='UNUSED'"
|
|
|
type="link"
|
|
|
class="button-success"
|
|
|
@click="handleWriteoff(record)"
|
|
|
- id="productOnlineInfoList-detail-btn">核销</a-button>
|
|
|
+ :id="'couponDetails-cancel-btn'+record.id">核销</a-button>
|
|
|
+ <span v-else>--</span>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-spin>
|
|
|
<!-- 核销 -->
|
|
|
- <writeOffModal :openModal="openModal" @close="openModal = false"/>
|
|
|
+ <writeOffModal :itemObj="writeOffObj" :openModal="openModal" @ok="$refs.table.refresh()" @close="closeModal"/>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
-import { promoTerminalList } from '@/api/promoTerminal'
|
|
|
+import { ticketQueryPage } from '@/api/ticket'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import selectCust from '@/views/common/selectCust.vue'
|
|
|
import writeOffModal from './writeOffModal.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'UrgentOffsetList',
|
|
|
- components: { STable, VSelect, writeOffModal },
|
|
|
+ components: { STable, VSelect, writeOffModal, selectCust },
|
|
|
mixins: [commonMixin],
|
|
|
data () {
|
|
|
return {
|
|
@@ -78,38 +89,36 @@ export default {
|
|
|
openShowModal: false, // 促销展示弹窗
|
|
|
time: [],
|
|
|
queryParam: { // 查询条件
|
|
|
- beginDate: undefined,
|
|
|
- endDate: undefined,
|
|
|
- name: '', // 促销名称
|
|
|
- showFlag: undefined, // 显示状态
|
|
|
- state: undefined// 促销状态
|
|
|
+ queryWord: undefined,
|
|
|
+ customerSn: undefined,
|
|
|
+ ticketState: undefined
|
|
|
},
|
|
|
+ writeOffObj: null,
|
|
|
descInfo: '', // 促销描述
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
- { title: '销售单号', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '客户名称', dataIndex: 'name1', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '券名称', dataIndex: 'name2', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '券副标题', dataIndex: 'name3', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return text || text == 0 ? this.toThousands(text, 2) : '--' } },
|
|
|
- { title: '促销名称', dataIndex: 'name', width: '24%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '有效期', dataIndex: 'stateDictValue1', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '券状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '销售单号', dataIndex: 'usedBizNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '客户名称', dataIndex: 'customerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '券名称', dataIndex: 'ruleName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '券副标题', dataIndex: 'ruleTitle', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '券金额', dataIndex: 'ticketValue', width: '10%', align: 'right', customRender: text => { return text || text == 0 ? this.toThousands(text, 2) : '--' } },
|
|
|
+ { title: '促销名称', dataIndex: 'promoActiveName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '有效期', scopedSlots: { customRender: 'dateBox' }, width: '20%', align: 'center' },
|
|
|
+ { title: '券状态', dataIndex: 'ticketStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return promoTerminalList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return ticketQueryPage(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
|
|
|
- data.list[i].images = data.list[i].images ? data.list[i].images.split(',') : []
|
|
|
}
|
|
|
this.disabled = false
|
|
|
}
|
|
@@ -121,46 +130,45 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 核销
|
|
|
- handleWriteoff () {
|
|
|
+ handleWriteoff (row) {
|
|
|
+ this.writeOffObj = {
|
|
|
+ customerName: row.customerName,
|
|
|
+ ticketSn: row.ticketSn
|
|
|
+ }
|
|
|
this.openModal = true
|
|
|
},
|
|
|
- // 时间 change
|
|
|
- dateChange (date) {
|
|
|
- this.queryParam.beginDate = date[0]
|
|
|
- this.queryParam.endDate = date[1]
|
|
|
+ // 关闭核销弹窗
|
|
|
+ closeModal () {
|
|
|
+ this.writeOffObj = null
|
|
|
+ this.openModal = false
|
|
|
},
|
|
|
- // 查看促销描述
|
|
|
- handleDescModal (row) {
|
|
|
- this.descInfo = row.description
|
|
|
+ // 客户名称
|
|
|
+ custChange (obj) {
|
|
|
const _this = this
|
|
|
- this.$nextTick(() => {
|
|
|
- _this.openDescModal = true
|
|
|
- })
|
|
|
- },
|
|
|
- // 促销展示
|
|
|
- handleSaleShow (row) {
|
|
|
- const _this = this
|
|
|
- _this.openShowModal = true
|
|
|
- this.$nextTick(() => {
|
|
|
- _this.$refs.promotionShow.getDetail({ id: row.promoActiveSn, showType: row.contentType })
|
|
|
- })
|
|
|
+ if (obj && obj.key) {
|
|
|
+ const cust = obj.row
|
|
|
+ _this.queryParam.customerSn = cust.customerSn
|
|
|
+ } else {
|
|
|
+ _this.$refs.custList.resetForm()
|
|
|
+ }
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.$refs.rangeDate.resetDate(this.time)
|
|
|
- this.queryParam.beginDate = undefined
|
|
|
- this.queryParam.endDate = undefined
|
|
|
- this.queryParam.name = ''
|
|
|
- this.queryParam.showFlag = undefined
|
|
|
- this.queryParam.state = undefined
|
|
|
+ this.queryParam.queryWord = undefined
|
|
|
+ this.queryParam.customerSn = undefined
|
|
|
+ this.queryParam.ticketState = undefined
|
|
|
+ this.$refs.custList.resetForm()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
+ _this.resetSearchForm()
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
_this.setTableH()
|
|
|
})
|
|
|
},
|
|
|
+ // 计算表格高度
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
this.tableHeight = window.innerHeight - tableSearchH - 203
|
|
@@ -169,7 +177,6 @@ export default {
|
|
|
mounted () {
|
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
this.pageInit()
|
|
|
- this.resetSearchForm()
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -181,7 +188,6 @@ export default {
|
|
|
// 如果是新页签打开,则重置当前页面
|
|
|
if (this.$store.state.app.isNewTab) {
|
|
|
this.pageInit()
|
|
|
- this.resetSearchForm()
|
|
|
}
|
|
|
// 只刷新列表
|
|
|
if (this.$store.state.app.updateList) {
|