From e890f87ea274436461aacca1391bb9717240f210 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期四, 04 九月 2025 14:21:39 +0800 Subject: [PATCH] 商家端订单列表 --- manager/src/views/activity-prize/index.vue | 138 ++++++++++++++++++++++++++++----------------- 1 files changed, 86 insertions(+), 52 deletions(-) diff --git a/manager/src/views/activity-prize/index.vue b/manager/src/views/activity-prize/index.vue index dc68f1e..b3b0f58 100644 --- a/manager/src/views/activity-prize/index.vue +++ b/manager/src/views/activity-prize/index.vue @@ -78,7 +78,7 @@ @click="publishPrizeActivity(row)" :loading="row.statusLoading" > - {{row.enableStatus === 'on' ? '鍏抽棴' : '寮�鍚�'}} + {{row.enableStatus === 'ON' ? '鍏抽棴' : '寮�鍚�'}} </Button> <Button type="info" @@ -88,18 +88,27 @@ <Button type="info" size="small" + :disabled="!row.canSet" @click="setPrize(row)" >濂栧搧璁剧疆</Button> <Button type="info" size="small" - @click="openEdit(row)" - >缂栬緫</Button> - <Button - type="error" - size="small" - @click="delById(row)" - >鍒犻櫎</Button> + :disabled="row.popup" + @click="setPopup(row)" + > + 寮圭獥娲诲姩 + </Button> +<!-- <Button--> +<!-- type="info"--> +<!-- size="small"--> +<!-- @click="openEdit(row)"--> +<!-- >缂栬緫</Button>--> +<!-- <Button--> +<!-- type="error"--> +<!-- size="small"--> +<!-- @click="delById(row)"--> +<!-- >鍒犻櫎</Button>--> </div> </template> @@ -282,8 +291,8 @@ <Col span="24"> <div class="detail-item"> <label>娲诲姩鐘舵�侊細</label> - <Tag :color="detailData.enableStatus === 'on' ? 'success' : 'default'"> - {{ detailData.enableStatus === 'on' ? '宸插惎鐢�' : '鏈惎鐢�' }} + <Tag :color="detailData.enableStatus === 'ON' ? 'success' : 'default'"> + {{ detailData.enableStatus === 'ON' ? '宸插惎鐢�' : '鏈惎鐢�' }} </Tag> </div> </Col> @@ -334,7 +343,7 @@ </span> </Col> <Col span="12"> - <span>姒傜巼: {{ prize.probability}}%</span> + <span>姒傜巼: {{ prize.prizeProbability}}%</span> </Col> </Row> </div> @@ -437,7 +446,7 @@ v-model="row.prizeNum" :min="1" :max="999999" - placeholder="璇疯緭鍏ユ瘡鏃ユ渶澶т腑濂栨暟" + placeholder="鏁伴噺" style="width: 100%" @on-change="(val) => handlePrizeNumChange(val, index)" ></InputNumber> @@ -489,7 +498,8 @@ del, addActivityRefPrizeList, getActivityRefPrizeByActivityId, - publishPrizeActivity + publishPrizeActivity, + popup } from '@/api/activity-prize.js' import {delByKey, uploadFileByLmk} from "../../api/common"; @@ -656,7 +666,7 @@ prizeNum:0, activityImg:'', activityCover:'', - enableStatus:'off' + enableStatus:'' }, loading:false, columns:[ @@ -707,9 +717,9 @@ render: (h, params) => { return h('Tag', { props: { - color: params.row.enableStatus === 'on' ? 'green' : 'default' + color: params.row.enableStatus === 'ON' ? 'green' : 'default' } - }, params.row.enableStatus === 'on' ? '寮�鍚�' : '鍏抽棴') + }, params.row.enableStatus === 'ON' ? '寮�鍚�' : '鍏抽棴') } }, { @@ -746,6 +756,16 @@ this.init(); }, methods: { + setPopup(row){ + popup(row.id).then(res =>{ + if (res.code === 200){ + this.$Message.success(res.msg) + this.getPage() + }else { + this.$Message.error(res.msg) + } + }) + }, handleProbabilityInput(event, index) { const inputValue = event.target.value; let numericValue = parseFloat(inputValue); @@ -787,7 +807,6 @@ // 鏍煎紡鍖栧鍝佺被鍨� replaceText(type) { - console.log(type) if (type === "coupon") { return "浼樻儬鍒�"; } @@ -820,7 +839,7 @@ }, // 妫�鏌ュ鍝佹槸鍚﹀凡琚�夋嫨 isPrizeChosen(prizeId) { - return this.choiceData.some(item => item.id === prizeId); + return this.choiceData.some(item => item.prizeId === prizeId); }, choicePrize(row){ //鍒ゆ柇鏁扮粍闀垮害 @@ -828,7 +847,9 @@ this.$Message.warning("鏈�澶氭坊鍔�5涓鍝�") return; } + console.log(row.prizeId) if (this.isPrizeChosen(row.id)){ + this.$Message.warning("宸叉坊鍔�") return; } @@ -895,11 +916,11 @@ //濂栧搧璁剧疆 setPrize(row){ //鍒ゆ柇鏄惁鍚姩锛岃嫢鍚姩鍒欙紝鏃犳硶缂栬緫 - if("on" === row.enableStatus){ + if("ON" === row.enableStatus){ this.$Message.error("鎶藉宸插紑鍚紝涓嶈兘缂栬緫!") return } - + //鍒ゆ柇鏄惁宸叉湁濂栧搧鏈夌殑璇濅笉璁╄缃� this.activityPrizeId = row.id; this.getPrizeList(); this.prizeSettingShow = true; @@ -908,6 +929,9 @@ getActivityRefPrizeByActivityId(row.id).then(res =>{ this.choiceLoading = false; if (res.code === 200){ + res.data.forEach(item =>{ + item.id =null; + }) this.choiceData = res.data } @@ -1068,25 +1092,29 @@ console.log(this.detailData) }, - openEdit(row){ - this.modelShow = true; - this.modelTitle = "缂栬緫娲诲姩"; - this.activityFrom= { - id:row.id, - activityName:row.activityName, - activityDes:row.activityDes, - beginTime:this.formatDate(row.beginTime, 'YYYY-MM-DD HH:mm:ss'), - endTime: this.formatDate(row.endTime, 'YYYY-MM-DD HH:mm:ss'), - maxPrize:row.maxPrize, - prizeNum:row.prizeNum, - activityImg:row.activityImg, - activityCover:row.activityCover, - enableStatus:row.enableStatus, - } - this.coverTempUrl = row.activityCoverUrl; - this.imgTempUrl = row.activityImgUrl; - - }, + // openEdit(row){ + // if("ON" === row.enableStatus){ + // this.$Message.error("鎶藉宸插紑鍚紝涓嶈兘缂栬緫!") + // return + // } + // this.modelShow = true; + // this.modelTitle = "缂栬緫娲诲姩"; + // this.activityFrom= { + // id:row.id, + // activityName:row.activityName, + // activityDes:row.activityDes, + // beginTime:this.formatDate(row.beginTime, 'YYYY-MM-DD HH:mm:ss'), + // endTime: this.formatDate(row.endTime, 'YYYY-MM-DD HH:mm:ss'), + // maxPrize:row.maxPrize, + // prizeNum:row.prizeNum, + // activityImg:row.activityImg, + // activityCover:row.activityCover, + // enableStatus:row.enableStatus, + // } + // this.coverTempUrl = row.activityCoverUrl; + // this.imgTempUrl = row.activityImgUrl; + // + // }, handleSearch(type,value){ if (type === 'beginTime') { @@ -1098,6 +1126,7 @@ }, openAdd(){ this.$refs.form.resetFields() + this.activityFrom.id = null; this.modelShow = true; this.modelTitle = "鏂板娲诲姩"; this.coverTempUrl = null; @@ -1105,16 +1134,21 @@ this.prizeImg = null; this.imgTempUrl = null; }, - delById(row){ - del(row.id).then(res=>{ - if (res.code === 200){ - this.$Message.success(res.msg) - }else { - this.$Message.error(res.msg) - } - this.getPage() - }) - }, + // delById(row){ + // if("ON" === row.enableStatus){ + // this.$Message.error("鎶藉宸插紑鍚紝鏃犳硶鍒犻櫎!") + // return + // } + // //鑻ュ叧鑱斿晢鍝佷笉璁╁垹 + // del(row.id).then(res=>{ + // if (res.code === 200){ + // this.$Message.success(res.msg) + // }else { + // this.$Message.error(res.msg) + // } + // this.getPage() + // }) + // }, // 鑾峰彇瀵屾枃鏈紪杈戝櫒鐨勫唴瀹� // 鍒濆鍖栨暟鎹� init() { @@ -1138,15 +1172,15 @@ this.prizeSearchForm.pageNumber = page this.getPrizeList() }, - publishPrizeActivity(row){ - publishPrizeActivity(row.id).then(res =>{ + async publishPrizeActivity(row){ + await publishPrizeActivity(row.id).then(res =>{ if (res.code === 200){ this.$Message.success(res.msg) }else{ this.$Message.error(res.msg) } }) - this.getPage() + await this.getPage() }, }, -- Gitblit v1.8.0