diff --git a/.env.development b/.env.development index 0293dd2..5af3ce8 100644 --- a/.env.development +++ b/.env.development @@ -8,6 +8,6 @@ VUE_APP_BASE_API = '/api' # VUE_APP_URL = "http://jianguan.yyundong.com/shgfapi" -VUE_APP_URL = "http://192.168.2.106:7201" +VUE_APP_URL = "http://192.168.2.101:7201" VUE_APP_REPORT_URL = "http://192.168.2.106:7202" ##VUE_APP_URL = "http://8.130.39.13:8112" diff --git a/src/api/marketingCard/marketingCard.js b/src/api/marketingCard/marketingCard.js index 7b4ef9a..4571926 100644 --- a/src/api/marketingCard/marketingCard.js +++ b/src/api/marketingCard/marketingCard.js @@ -93,6 +93,15 @@ export default { }) }, + // 作废提货卡 + cancelCard: function(sid) { + return request({ + url: '/lpkgiftcard/cancelCard/'+sid, + method: 'get' + }); + }, + + // 获取提货卡页面 礼包列表 giftBagList: function(data) { diff --git a/src/views/marketingCard/index.vue b/src/views/marketingCard/index.vue index b5a0544..1c79e38 100644 --- a/src/views/marketingCard/index.vue +++ b/src/views/marketingCard/index.vue @@ -42,12 +42,12 @@ diff --git a/src/views/marketingCard/pickupCardSet.vue b/src/views/marketingCard/pickupCardSet.vue index 9992035..3d560c0 100644 --- a/src/views/marketingCard/pickupCardSet.vue +++ b/src/views/marketingCard/pickupCardSet.vue @@ -35,10 +35,10 @@ @@ -100,13 +100,13 @@ :row-style="{height: '40px'}"> - + @@ -485,8 +485,8 @@ editRow(row) { this.editDialog = true }, - showRow(row) { - this.listQuery.params.sid = row.sid + showRow(sid) { + this.listQuery.params.sid =sid this.viewState = 2 req.recordDetails(this.listQuery) .then(resp => { @@ -624,11 +624,14 @@ req.cardGrant(this.from) .then(resp => { - this.$message({ - showClose: true, - type: 'success', - message: resp.msg - }) + + if(resp.success){ + this.$message({ + showClose: true, + type: 'success', + message: resp.msg + }) + } this.editDialog = false this.from = { start: "", @@ -684,20 +687,44 @@ // _this.reportFileList.push(upfile) }, handleRemove(file, fileList) { - const _this = this - let delete_index = 0 - for (let i = 0, len = _this.reportFileList.length; i < len; i++) { - if (file.uid === _this.reportFileList[i].fileuid) { - delete_index = i - break - } - } - _this.reportFileList.splice(delete_index, 1) }, submitUpload() { this.$refs.upload.submit() + }, + delectItem(row){ + console.log("row", row); + + const tip = '请确认是否作废所选卡券?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.cancelCard(row.sid).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ + type: 'success', + message: resp.msg, + showClose: true + }) + this.showRow(this.listQuery.params.sid) + } else { + // 根据resp.code进行异常情况处理 + } + }).catch(e => { + loading.close() + }) + }).catch(() => {}) + } }