|
@@ -7,7 +7,7 @@
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="创建时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-range-picker
|
|
|
- id="winRecord-time"
|
|
|
+ id="gift-card-time"
|
|
|
v-model="time"
|
|
|
:format="dateFormat"
|
|
|
:placeholder="['开始时间','结束时间']"
|
|
@@ -19,42 +19,48 @@
|
|
|
<a-form-item label="礼品卡内容" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-input
|
|
|
allowClear
|
|
|
- v-model="searchData.activeName"
|
|
|
+ v-model="searchData.goldNum"
|
|
|
:maxLength="30"
|
|
|
placeholder="请输入礼品卡内容"
|
|
|
suffix="乐豆"
|
|
|
- id="gift-card-name" />
|
|
|
+ id="gift-card-goldNum" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="实体卡编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input allowClear v-model="searchData.activeName" :maxLength="30" placeholder="请输入实体卡编号" id="gift-card-name" />
|
|
|
+ <a-input allowClear v-model="searchData.optionalSequence" :maxLength="30" placeholder="请输入实体卡编号" id="gift-card-optionalSequence" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="是否已充值" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <v-select code="FLAG" v-model="searchData.state" allowClear placeholder="请选择" id="gift-card-enable-state"></v-select>
|
|
|
+ <v-select
|
|
|
+ ref="giftCardState"
|
|
|
+ code="GIFT_CARD_STATE"
|
|
|
+ v-model="searchData.state"
|
|
|
+ allowClear
|
|
|
+ placeholder="请选择"
|
|
|
+ id="gift-card-enable-state"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="充值时间" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-range-picker
|
|
|
- id="winRecord-time"
|
|
|
- v-model="time"
|
|
|
+ id="gift-card-rechargeTime"
|
|
|
+ v-model="rechargeTime"
|
|
|
:format="dateFormat"
|
|
|
:placeholder="['开始时间','结束时间']"
|
|
|
:disabledDate="disabledDate"
|
|
|
- @change="onChange" />
|
|
|
+ @change="onRechargeChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="充值用户" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input allowClear v-model="searchData.activeName" :maxLength="30" placeholder="请输入充值用户" id="gift-card-name" />
|
|
|
+ <a-input allowClear v-model="searchData.customPhone" :maxLength="30" placeholder="请输入充值用户" id="gift-card-customPhone" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="充值码" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input allowClear v-model="searchData.activeName" :maxLength="30" placeholder="请输入充值码" id="gift-card-name" />
|
|
|
+ <a-input allowClear v-model="searchData.sequence" :maxLength="30" placeholder="请输入充值码" id="gift-card-sequence" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
@@ -75,16 +81,17 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
+ <!-- 操作按钮 -->
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a-button id="gift-card-getCode" class="blue" type="link" @click="getCode(record)">获取充值码</a-button>
|
|
|
<a-button id="gift-card-handleEdit" class="green" type="link" @click="handleEdit(record)">编辑</a-button>
|
|
|
- <a-button id="gift-card-handleDel" class="red" type="link" @click="handleDel(record)">删除</a-button>
|
|
|
+ <a-button v-if="record.state==0" id="gift-card-handleDel" class="red" type="link" @click="handleDel(record)">删除</a-button>
|
|
|
</span>
|
|
|
</s-table>
|
|
|
<!-- 新增礼品卡 -->
|
|
|
- <add-card-modal :openModal="openAddCardModal" @close="closeModal" />
|
|
|
+ <add-card-modal :openModal="openAddCardModal" @close="closeModal" @refresh="refreshFun" />
|
|
|
<!-- 编辑礼品卡 -->
|
|
|
- <edit-card-modal :openModal="openEditCardModal" :cardId="cardId" @close="closeModal" />
|
|
|
+ <edit-card-modal :openModal="openEditCardModal" :cardId="cardId" @refresh="refreshFun" @close="closeModal" />
|
|
|
<!-- 获取充值码 -->
|
|
|
<get-code-modal :openModal="openGetCodeModal" :cardId="cardId" @close="closeModal" />
|
|
|
</a-card>
|
|
@@ -95,7 +102,7 @@ import { STable, VSelect } from '@/components'
|
|
|
import AddCardModal from './addCardModal.vue'
|
|
|
import EditCardModal from './editCardModal.vue'
|
|
|
import GetCodeModal from './getCodeModal.vue'
|
|
|
-import { getLuckyDrawList } from '@/api/luckyDraw.js'
|
|
|
+import { giftCardQuery, giftCardDel } from '@/api/giftCard.js'
|
|
|
|
|
|
export default {
|
|
|
components: { STable, VSelect, GetCodeModal, AddCardModal, EditCardModal },
|
|
@@ -106,29 +113,37 @@ export default {
|
|
|
wrapperCol: { span: 15 }
|
|
|
},
|
|
|
searchData: {
|
|
|
- beginDate: null,
|
|
|
- endDate: null,
|
|
|
- activeName: '',
|
|
|
- state: undefined
|
|
|
+ startTime: null, // 创建时间 开始
|
|
|
+ endTime: null, // 创建时间 结束
|
|
|
+ goldNum: null, // 礼品卡内容
|
|
|
+ optionalSequence: null, // 实体卡编号
|
|
|
+ state: undefined, // 是否已充值
|
|
|
+ useTimeStart: null, // 充值时间 开始
|
|
|
+ useTimeEnd: null, // 充值时间 结束
|
|
|
+ customPhone: null, // 充值用户
|
|
|
+ sequence: null // 充值码
|
|
|
},
|
|
|
showEditModal: false, // 默认关闭弹窗
|
|
|
itemId: null, // 编辑行id
|
|
|
- time: [],
|
|
|
+ time: [], // 创建时间
|
|
|
+ rechargeTime: [], // 充值时间
|
|
|
dateFormat: 'YYYY-MM-DD',
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: 100, align: 'center' },
|
|
|
- { title: '活动名称', dataIndex: 'activeName', width: 100, align: 'center' },
|
|
|
- { title: '活动时间', dataIndex: 'actime', width: 100, align: 'center' },
|
|
|
- { title: '状态', dataIndex: 'state', width: 100, align: 'center' },
|
|
|
+ { title: '创建人', dataIndex: 'name', width: 100, align: 'center' },
|
|
|
+ { title: '礼品卡内容', dataIndex: 'content', width: 100, align: 'center' },
|
|
|
+ { title: '实体卡编号', dataIndex: 'optionalSequence', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
|
|
|
+ { title: '是否已充值', dataIndex: 'stateDictValue', width: 100, align: 'center' },
|
|
|
+ { title: '充值时间', dataIndex: 'useTime', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
|
|
|
+ { title: '充值用户', dataIndex: 'customPhone', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
|
|
|
+ { title: '备注', dataIndex: 'remarks', width: 100, align: 'center', customRender: (text) => { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, align: 'center', width: 100 }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- return getLuckyDrawList(
|
|
|
- Object.assign(parameter, this.searchData)
|
|
|
- ).then(res => {
|
|
|
+ return giftCardQuery(Object.assign(parameter, this.searchData)).then(res => {
|
|
|
const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
if (res.status == 200) {
|
|
|
for (let i = 0; i < res.data.list.length; i++) {
|
|
@@ -153,8 +168,15 @@ export default {
|
|
|
// 创建时间change
|
|
|
onChange (dates, dateStrings) {
|
|
|
if ((dates, dateStrings)) {
|
|
|
- this.searchData.beginDate = dateStrings[0]
|
|
|
- this.searchData.endDate = dateStrings[1]
|
|
|
+ this.searchData.startTime = dateStrings[0]
|
|
|
+ this.searchData.endTime = dateStrings[1]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 充值时间change
|
|
|
+ onRechargeChange (dates, dateStrings) {
|
|
|
+ if ((dates, dateStrings)) {
|
|
|
+ this.searchData.useTimeStart = dateStrings[0]
|
|
|
+ this.searchData.useTimeEnd = dateStrings[1]
|
|
|
}
|
|
|
},
|
|
|
// 获取充值码
|
|
@@ -179,6 +201,11 @@ export default {
|
|
|
this.openEditCardModal = false
|
|
|
this.openGetCodeModal = false
|
|
|
},
|
|
|
+ // 刷新数据
|
|
|
+ refreshFun (state) {
|
|
|
+ // 新增需刷新第一页数据。编辑为当前页数据
|
|
|
+ this.$refs.table.refresh(state)
|
|
|
+ },
|
|
|
// 删除
|
|
|
handleDel (record) {
|
|
|
this.$confirm({
|
|
@@ -188,21 +215,26 @@ export default {
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
onOk: () => {
|
|
|
- // deleteLuckyDraw({
|
|
|
- // id: record.id
|
|
|
- // }).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // this.$message.success(res.message)
|
|
|
- // this.$refs.table.refresh()
|
|
|
- // }
|
|
|
- // })
|
|
|
+ giftCardDel({ id: record.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 重置
|
|
|
resetForm () {
|
|
|
- this.searchData.activeName = ''
|
|
|
- this.searchData.state = ''
|
|
|
+ this.searchData.startTime = null
|
|
|
+ this.searchData.endTime = null
|
|
|
+ this.searchData.goldNum = null
|
|
|
+ this.searchData.optionalSequence = null
|
|
|
+ this.searchData.state = null
|
|
|
+ this.searchData.useTimeStart = null
|
|
|
+ this.searchData.useTimeEnd = null
|
|
|
+ this.searchData.customPhone = null
|
|
|
+ this.searchData.sequence = null
|
|
|
this.$refs.table.refresh(true)
|
|
|
}
|
|
|
}
|