Commit 6b73abdbc38d4c79856117acf5e4970a690ecd01
1 parent
7f2cddcb
开发完成运营功能
Showing
18 changed files
with
2067 additions
and
7 deletions
src/api/account/couponDetailManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取优惠券详情列表 | ||
| 4 | +export function listCouponDetail(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/couponDetail.listCouponDetail', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + if (res.code === 0) { | ||
| 13 | + resolve({ | ||
| 14 | + data: res.data, | ||
| 15 | + total: res.records | ||
| 16 | + }) | ||
| 17 | + } else { | ||
| 18 | + reject(new Error(res.msg || '获取优惠券详情列表失败')) | ||
| 19 | + } | ||
| 20 | + }).catch(error => { | ||
| 21 | + reject(error) | ||
| 22 | + }) | ||
| 23 | + }) | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +// 添加优惠券详情 | ||
| 27 | +export function saveCouponDetail(data) { | ||
| 28 | + return new Promise((resolve, reject) => { | ||
| 29 | + request({ | ||
| 30 | + url: '/couponDetail.saveCouponDetail', | ||
| 31 | + method: 'post', | ||
| 32 | + data | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + if (res.code === 0) { | ||
| 36 | + resolve(res) | ||
| 37 | + } else { | ||
| 38 | + reject(new Error(res.msg || '添加优惠券详情失败')) | ||
| 39 | + } | ||
| 40 | + }).catch(error => { | ||
| 41 | + reject(error) | ||
| 42 | + }) | ||
| 43 | + }) | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +// 更新优惠券详情 | ||
| 47 | +export function updateCouponDetail(data) { | ||
| 48 | + return new Promise((resolve, reject) => { | ||
| 49 | + request({ | ||
| 50 | + url: '/couponDetail.updateCouponDetail', | ||
| 51 | + method: 'post', | ||
| 52 | + data | ||
| 53 | + }).then(response => { | ||
| 54 | + const res = response.data | ||
| 55 | + if (res.code === 0) { | ||
| 56 | + resolve(res) | ||
| 57 | + } else { | ||
| 58 | + reject(new Error(res.msg || '更新优惠券详情失败')) | ||
| 59 | + } | ||
| 60 | + }).catch(error => { | ||
| 61 | + reject(error) | ||
| 62 | + }) | ||
| 63 | + }) | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +// 删除优惠券详情 | ||
| 67 | +export function deleteCouponDetail(data) { | ||
| 68 | + return new Promise((resolve, reject) => { | ||
| 69 | + request({ | ||
| 70 | + url: '/couponDetail.deleteCouponDetail', | ||
| 71 | + method: 'post', | ||
| 72 | + data | ||
| 73 | + }).then(response => { | ||
| 74 | + const res = response.data | ||
| 75 | + if (res.code === 0) { | ||
| 76 | + resolve(res) | ||
| 77 | + } else { | ||
| 78 | + reject(new Error(res.msg || '删除优惠券详情失败')) | ||
| 79 | + } | ||
| 80 | + }).catch(error => { | ||
| 81 | + reject(error) | ||
| 82 | + }) | ||
| 83 | + }) | ||
| 84 | +} | ||
| 0 | \ No newline at end of file | 85 | \ No newline at end of file |
src/api/account/couponPoolManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取优惠券池列表 | ||
| 4 | +export function listCouponPool(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/couponPool.listCouponPool', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + if (res.code === 0) { | ||
| 13 | + resolve(res) | ||
| 14 | + } else { | ||
| 15 | + reject(new Error(res.msg || '获取优惠券池列表失败')) | ||
| 16 | + } | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 添加优惠券池 | ||
| 24 | +export function saveCouponPool(data) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/couponPool.saveCouponPool', | ||
| 28 | + method: 'post', | ||
| 29 | + data | ||
| 30 | + }).then(response => { | ||
| 31 | + const res = response.data | ||
| 32 | + if (res.code === 0) { | ||
| 33 | + resolve(res) | ||
| 34 | + } else { | ||
| 35 | + reject(new Error(res.msg || '添加优惠券池失败')) | ||
| 36 | + } | ||
| 37 | + }).catch(error => { | ||
| 38 | + reject(error) | ||
| 39 | + }) | ||
| 40 | + }) | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +// 更新优惠券池 | ||
| 44 | +export function updateCouponPool(data) { | ||
| 45 | + return new Promise((resolve, reject) => { | ||
| 46 | + request({ | ||
| 47 | + url: '/couponPool.updateCouponPool', | ||
| 48 | + method: 'post', | ||
| 49 | + data | ||
| 50 | + }).then(response => { | ||
| 51 | + const res = response.data | ||
| 52 | + if (res.code === 0) { | ||
| 53 | + resolve(res) | ||
| 54 | + } else { | ||
| 55 | + reject(new Error(res.msg || '更新优惠券池失败')) | ||
| 56 | + } | ||
| 57 | + }).catch(error => { | ||
| 58 | + reject(error) | ||
| 59 | + }) | ||
| 60 | + }) | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +// 删除优惠券池 | ||
| 64 | +export function deleteCouponPool(data) { | ||
| 65 | + return new Promise((resolve, reject) => { | ||
| 66 | + request({ | ||
| 67 | + url: '/couponPool.deleteCouponPool', | ||
| 68 | + method: 'post', | ||
| 69 | + data | ||
| 70 | + }).then(response => { | ||
| 71 | + const res = response.data | ||
| 72 | + if (res.code === 0) { | ||
| 73 | + resolve(res) | ||
| 74 | + } else { | ||
| 75 | + reject(new Error(res.msg || '删除优惠券池失败')) | ||
| 76 | + } | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
src/api/mall/junkRequirementManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取旧货需求列表 | ||
| 4 | +export function listJunkRequirements(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request | ||
| 7 | + .get('/junkRequirement.listJunkRequirements', { params }) | ||
| 8 | + .then(response => { | ||
| 9 | + const res = response.data | ||
| 10 | + if (res.code === 0) { | ||
| 11 | + resolve({ | ||
| 12 | + data: res.data, | ||
| 13 | + total: res.total | ||
| 14 | + }) | ||
| 15 | + } else { | ||
| 16 | + reject(new Error(res.msg || 'Failed to get junk requirements list')) | ||
| 17 | + } | ||
| 18 | + }) | ||
| 19 | + .catch(error => { | ||
| 20 | + reject(error) | ||
| 21 | + }) | ||
| 22 | + }) | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +// 更新旧货需求 | ||
| 26 | +export function updateJunkRequirement(data) { | ||
| 27 | + return new Promise((resolve, reject) => { | ||
| 28 | + request | ||
| 29 | + .post('/junkRequirement.updateJunkRequirement', data) | ||
| 30 | + .then(response => { | ||
| 31 | + const res = response.data | ||
| 32 | + if (res.code === 0) { | ||
| 33 | + resolve(res) | ||
| 34 | + } else { | ||
| 35 | + reject(new Error(res.msg || 'Failed to update junk requirement')) | ||
| 36 | + } | ||
| 37 | + }) | ||
| 38 | + .catch(error => { | ||
| 39 | + reject(error) | ||
| 40 | + }) | ||
| 41 | + }) | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +// 删除旧货需求 | ||
| 45 | +export function deleteJunkRequirement(data) { | ||
| 46 | + return new Promise((resolve, reject) => { | ||
| 47 | + request | ||
| 48 | + .post('/junkRequirement.deleteJunkRequirement', data) | ||
| 49 | + .then(response => { | ||
| 50 | + const res = response.data | ||
| 51 | + if (res.code === 0) { | ||
| 52 | + resolve(res) | ||
| 53 | + } else { | ||
| 54 | + reject(new Error(res.msg || 'Failed to delete junk requirement')) | ||
| 55 | + } | ||
| 56 | + }) | ||
| 57 | + .catch(error => { | ||
| 58 | + reject(error) | ||
| 59 | + }) | ||
| 60 | + }) | ||
| 61 | +} | ||
| 0 | \ No newline at end of file | 62 | \ No newline at end of file |
src/components/account/AddCouponDetail.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('couponDetailManage.add.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="formData" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="120px" | ||
| 13 | + label-position="right" | ||
| 14 | + > | ||
| 15 | + <el-form-item | ||
| 16 | + :label="$t('couponDetailManage.add.poolId')" | ||
| 17 | + prop="poolId" | ||
| 18 | + > | ||
| 19 | + <el-input | ||
| 20 | + v-model="formData.poolId" | ||
| 21 | + :placeholder="$t('couponDetailManage.add.poolIdPlaceholder')" | ||
| 22 | + /> | ||
| 23 | + </el-form-item> | ||
| 24 | + <el-form-item | ||
| 25 | + :label="$t('couponDetailManage.add.shopId')" | ||
| 26 | + prop="shopId" | ||
| 27 | + > | ||
| 28 | + <el-input | ||
| 29 | + v-model="formData.shopId" | ||
| 30 | + :placeholder="$t('couponDetailManage.add.shopIdPlaceholder')" | ||
| 31 | + /> | ||
| 32 | + </el-form-item> | ||
| 33 | + <el-form-item | ||
| 34 | + :label="$t('couponDetailManage.add.couponName')" | ||
| 35 | + prop="couponName" | ||
| 36 | + > | ||
| 37 | + <el-input | ||
| 38 | + v-model="formData.couponName" | ||
| 39 | + :placeholder="$t('couponDetailManage.add.couponNamePlaceholder')" | ||
| 40 | + /> | ||
| 41 | + </el-form-item> | ||
| 42 | + <el-form-item | ||
| 43 | + :label="$t('couponDetailManage.add.actualPrice')" | ||
| 44 | + prop="actualPrice" | ||
| 45 | + > | ||
| 46 | + <el-input | ||
| 47 | + v-model.number="formData.actualPrice" | ||
| 48 | + type="number" | ||
| 49 | + :placeholder="$t('couponDetailManage.add.actualPricePlaceholder')" | ||
| 50 | + /> | ||
| 51 | + </el-form-item> | ||
| 52 | + <el-form-item | ||
| 53 | + :label="$t('couponDetailManage.add.buyPrice')" | ||
| 54 | + prop="buyPrice" | ||
| 55 | + > | ||
| 56 | + <el-input | ||
| 57 | + v-model.number="formData.buyPrice" | ||
| 58 | + type="number" | ||
| 59 | + :placeholder="$t('couponDetailManage.add.buyPricePlaceholder')" | ||
| 60 | + /> | ||
| 61 | + </el-form-item> | ||
| 62 | + <el-form-item | ||
| 63 | + :label="$t('couponDetailManage.add.amount')" | ||
| 64 | + prop="amount" | ||
| 65 | + > | ||
| 66 | + <el-input | ||
| 67 | + v-model.number="formData.amount" | ||
| 68 | + type="number" | ||
| 69 | + :placeholder="$t('couponDetailManage.add.amountPlaceholder')" | ||
| 70 | + /> | ||
| 71 | + </el-form-item> | ||
| 72 | + <el-form-item | ||
| 73 | + :label="$t('couponDetailManage.add.buyCount')" | ||
| 74 | + prop="buyCount" | ||
| 75 | + > | ||
| 76 | + <el-input | ||
| 77 | + v-model.number="formData.buyCount" | ||
| 78 | + type="number" | ||
| 79 | + :placeholder="$t('couponDetailManage.add.buyCountPlaceholder')" | ||
| 80 | + /> | ||
| 81 | + </el-form-item> | ||
| 82 | + <el-form-item | ||
| 83 | + :label="$t('couponDetailManage.add.validityDay')" | ||
| 84 | + prop="validityDay" | ||
| 85 | + > | ||
| 86 | + <el-input | ||
| 87 | + v-model.number="formData.validityDay" | ||
| 88 | + type="number" | ||
| 89 | + :placeholder="$t('couponDetailManage.add.validityDayPlaceholder')" | ||
| 90 | + /> | ||
| 91 | + </el-form-item> | ||
| 92 | + </el-form> | ||
| 93 | + <span slot="footer" class="dialog-footer"> | ||
| 94 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 95 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.save') }}</el-button> | ||
| 96 | + </span> | ||
| 97 | + </el-dialog> | ||
| 98 | +</template> | ||
| 99 | + | ||
| 100 | +<script> | ||
| 101 | +import { saveCouponDetail } from '@/api/account/couponDetailManageApi' | ||
| 102 | + | ||
| 103 | +export default { | ||
| 104 | + name: 'AddCouponDetail', | ||
| 105 | + data() { | ||
| 106 | + return { | ||
| 107 | + visible: false, | ||
| 108 | + formData: { | ||
| 109 | + poolId: '', | ||
| 110 | + shopId: '', | ||
| 111 | + couponName: '', | ||
| 112 | + actualPrice: '', | ||
| 113 | + buyPrice: '', | ||
| 114 | + amount: '', | ||
| 115 | + buyCount: '', | ||
| 116 | + validityDay: '' | ||
| 117 | + }, | ||
| 118 | + rules: { | ||
| 119 | + poolId: [ | ||
| 120 | + { required: true, message: this.$t('couponDetailManage.validate.poolIdRequired'), trigger: 'blur' }, | ||
| 121 | + { max: 30, message: this.$t('couponDetailManage.validate.poolIdMaxLength'), trigger: 'blur' } | ||
| 122 | + ], | ||
| 123 | + shopId: [ | ||
| 124 | + { required: true, message: this.$t('couponDetailManage.validate.shopIdRequired'), trigger: 'blur' }, | ||
| 125 | + { max: 30, message: this.$t('couponDetailManage.validate.shopIdMaxLength'), trigger: 'blur' } | ||
| 126 | + ], | ||
| 127 | + couponName: [ | ||
| 128 | + { required: true, message: this.$t('couponDetailManage.validate.couponNameRequired'), trigger: 'blur' }, | ||
| 129 | + { max: 64, message: this.$t('couponDetailManage.validate.couponNameMaxLength'), trigger: 'blur' } | ||
| 130 | + ], | ||
| 131 | + actualPrice: [ | ||
| 132 | + { required: true, message: this.$t('couponDetailManage.validate.actualPriceRequired'), trigger: 'blur' }, | ||
| 133 | + { type: 'number', message: this.$t('couponDetailManage.validate.actualPriceNumber'), trigger: 'blur' } | ||
| 134 | + ], | ||
| 135 | + buyPrice: [ | ||
| 136 | + { required: true, message: this.$t('couponDetailManage.validate.buyPriceRequired'), trigger: 'blur' }, | ||
| 137 | + { type: 'number', message: this.$t('couponDetailManage.validate.buyPriceNumber'), trigger: 'blur' } | ||
| 138 | + ], | ||
| 139 | + amount: [ | ||
| 140 | + { required: true, message: this.$t('couponDetailManage.validate.amountRequired'), trigger: 'blur' }, | ||
| 141 | + { type: 'number', message: this.$t('couponDetailManage.validate.amountNumber'), trigger: 'blur' } | ||
| 142 | + ], | ||
| 143 | + buyCount: [ | ||
| 144 | + { required: true, message: this.$t('couponDetailManage.validate.buyCountRequired'), trigger: 'blur' }, | ||
| 145 | + { type: 'number', message: this.$t('couponDetailManage.validate.buyCountNumber'), trigger: 'blur' } | ||
| 146 | + ], | ||
| 147 | + validityDay: [ | ||
| 148 | + { required: true, message: this.$t('couponDetailManage.validate.validityDayRequired'), trigger: 'blur' }, | ||
| 149 | + { type: 'number', message: this.$t('couponDetailManage.validate.validityDayNumber'), trigger: 'blur' } | ||
| 150 | + ] | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + }, | ||
| 154 | + methods: { | ||
| 155 | + open() { | ||
| 156 | + this.visible = true | ||
| 157 | + }, | ||
| 158 | + handleClose() { | ||
| 159 | + this.$refs.form.resetFields() | ||
| 160 | + }, | ||
| 161 | + handleSubmit() { | ||
| 162 | + this.$refs.form.validate(async valid => { | ||
| 163 | + if (valid) { | ||
| 164 | + try { | ||
| 165 | + await saveCouponDetail(this.formData) | ||
| 166 | + this.$message.success(this.$t('couponDetailManage.add.success')) | ||
| 167 | + this.visible = false | ||
| 168 | + this.$emit('success') | ||
| 169 | + } catch (error) { | ||
| 170 | + this.$message.error(error.message) | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | + }) | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | +} | ||
| 177 | +</script> | ||
| 0 | \ No newline at end of file | 178 | \ No newline at end of file |
src/components/account/AddCouponPool.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('couponPoolManage.add.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="150px" | ||
| 13 | + label-position="right" | ||
| 14 | + > | ||
| 15 | + <el-form-item | ||
| 16 | + :label="$t('couponPoolManage.add.couponType')" | ||
| 17 | + prop="couponType" | ||
| 18 | + > | ||
| 19 | + <el-select | ||
| 20 | + v-model="form.couponType" | ||
| 21 | + :placeholder="$t('couponPoolManage.add.selectCouponType')" | ||
| 22 | + style="width: 100%" | ||
| 23 | + > | ||
| 24 | + <el-option | ||
| 25 | + label="普通劵" | ||
| 26 | + value="1001" | ||
| 27 | + /> | ||
| 28 | + </el-select> | ||
| 29 | + </el-form-item> | ||
| 30 | + <el-form-item | ||
| 31 | + :label="$t('couponPoolManage.add.couponName')" | ||
| 32 | + prop="couponName" | ||
| 33 | + > | ||
| 34 | + <el-input | ||
| 35 | + v-model="form.couponName" | ||
| 36 | + :placeholder="$t('couponPoolManage.add.inputCouponName')" | ||
| 37 | + /> | ||
| 38 | + </el-form-item> | ||
| 39 | + <el-form-item | ||
| 40 | + :label="$t('couponPoolManage.add.actualPrice')" | ||
| 41 | + prop="actualPrice" | ||
| 42 | + > | ||
| 43 | + <el-input | ||
| 44 | + v-model="form.actualPrice" | ||
| 45 | + type="number" | ||
| 46 | + :placeholder="$t('couponPoolManage.add.inputActualPrice')" | ||
| 47 | + /> | ||
| 48 | + </el-form-item> | ||
| 49 | + <el-form-item | ||
| 50 | + :label="$t('couponPoolManage.add.buyPrice')" | ||
| 51 | + prop="buyPrice" | ||
| 52 | + > | ||
| 53 | + <el-input | ||
| 54 | + v-model="form.buyPrice" | ||
| 55 | + type="number" | ||
| 56 | + :placeholder="$t('couponPoolManage.add.inputBuyPrice')" | ||
| 57 | + /> | ||
| 58 | + </el-form-item> | ||
| 59 | + <el-form-item | ||
| 60 | + :label="$t('couponPoolManage.add.couponStock')" | ||
| 61 | + prop="couponStock" | ||
| 62 | + > | ||
| 63 | + <el-input | ||
| 64 | + v-model="form.couponStock" | ||
| 65 | + type="number" | ||
| 66 | + :placeholder="$t('couponPoolManage.add.inputCouponStock')" | ||
| 67 | + /> | ||
| 68 | + </el-form-item> | ||
| 69 | + <el-form-item | ||
| 70 | + :label="$t('couponPoolManage.add.validityDay')" | ||
| 71 | + prop="validityDay" | ||
| 72 | + > | ||
| 73 | + <el-input | ||
| 74 | + v-model="form.validityDay" | ||
| 75 | + type="number" | ||
| 76 | + :placeholder="$t('couponPoolManage.add.inputValidityDay')" | ||
| 77 | + /> | ||
| 78 | + </el-form-item> | ||
| 79 | + <el-form-item | ||
| 80 | + :label="$t('couponPoolManage.add.seq')" | ||
| 81 | + prop="seq" | ||
| 82 | + > | ||
| 83 | + <el-input | ||
| 84 | + v-model="form.seq" | ||
| 85 | + type="number" | ||
| 86 | + :placeholder="$t('couponPoolManage.add.inputSeq')" | ||
| 87 | + /> | ||
| 88 | + </el-form-item> | ||
| 89 | + </el-form> | ||
| 90 | + <span slot="footer" class="dialog-footer"> | ||
| 91 | + <el-button @click="visible = false"> | ||
| 92 | + {{ $t('couponPoolManage.add.cancel') }} | ||
| 93 | + </el-button> | ||
| 94 | + <el-button type="primary" @click="handleSubmit"> | ||
| 95 | + {{ $t('couponPoolManage.add.save') }} | ||
| 96 | + </el-button> | ||
| 97 | + </span> | ||
| 98 | + </el-dialog> | ||
| 99 | +</template> | ||
| 100 | + | ||
| 101 | +<script> | ||
| 102 | +import { saveCouponPool } from '@/api/account/couponPoolManageApi' | ||
| 103 | + | ||
| 104 | +export default { | ||
| 105 | + name: 'AddCouponPool', | ||
| 106 | + data() { | ||
| 107 | + return { | ||
| 108 | + visible: false, | ||
| 109 | + form: { | ||
| 110 | + couponType: '', | ||
| 111 | + couponName: '', | ||
| 112 | + actualPrice: '', | ||
| 113 | + buyPrice: '', | ||
| 114 | + couponStock: '', | ||
| 115 | + validityDay: '', | ||
| 116 | + seq: '' | ||
| 117 | + }, | ||
| 118 | + rules: { | ||
| 119 | + couponType: [ | ||
| 120 | + { required: true, message: this.$t('couponPoolManage.add.couponTypeRequired'), trigger: 'blur' } | ||
| 121 | + ], | ||
| 122 | + couponName: [ | ||
| 123 | + { required: true, message: this.$t('couponPoolManage.add.couponNameRequired'), trigger: 'blur' }, | ||
| 124 | + { max: 64, message: this.$t('couponPoolManage.add.couponNameMaxLength'), trigger: 'blur' } | ||
| 125 | + ], | ||
| 126 | + actualPrice: [ | ||
| 127 | + { required: true, message: this.$t('couponPoolManage.add.actualPriceRequired'), trigger: 'blur' }, | ||
| 128 | + { max: 10, message: this.$t('couponPoolManage.add.actualPriceMaxLength'), trigger: 'blur' } | ||
| 129 | + ], | ||
| 130 | + buyPrice: [ | ||
| 131 | + { required: true, message: this.$t('couponPoolManage.add.buyPriceRequired'), trigger: 'blur' }, | ||
| 132 | + { max: 10, message: this.$t('couponPoolManage.add.buyPriceMaxLength'), trigger: 'blur' } | ||
| 133 | + ], | ||
| 134 | + couponStock: [ | ||
| 135 | + { required: true, message: this.$t('couponPoolManage.add.couponStockRequired'), trigger: 'blur' }, | ||
| 136 | + { max: 20, message: this.$t('couponPoolManage.add.couponStockMaxLength'), trigger: 'blur' } | ||
| 137 | + ], | ||
| 138 | + validityDay: [ | ||
| 139 | + { required: true, message: this.$t('couponPoolManage.add.validityDayRequired'), trigger: 'blur' }, | ||
| 140 | + { max: 20, message: this.$t('couponPoolManage.add.validityDayMaxLength'), trigger: 'blur' } | ||
| 141 | + ], | ||
| 142 | + seq: [ | ||
| 143 | + { required: true, message: this.$t('couponPoolManage.add.seqRequired'), trigger: 'blur' }, | ||
| 144 | + { max: 11, message: this.$t('couponPoolManage.add.seqMaxLength'), trigger: 'blur' } | ||
| 145 | + ] | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + }, | ||
| 149 | + methods: { | ||
| 150 | + open() { | ||
| 151 | + this.visible = true | ||
| 152 | + }, | ||
| 153 | + handleClose() { | ||
| 154 | + this.$refs.form.resetFields() | ||
| 155 | + }, | ||
| 156 | + handleSubmit() { | ||
| 157 | + this.$refs.form.validate(async valid => { | ||
| 158 | + if (valid) { | ||
| 159 | + try { | ||
| 160 | + await saveCouponPool(this.form) | ||
| 161 | + this.$message.success(this.$t('couponPoolManage.add.success')) | ||
| 162 | + this.visible = false | ||
| 163 | + this.$emit('success') | ||
| 164 | + } catch (error) { | ||
| 165 | + this.$message.error(error.message || this.$t('couponPoolManage.add.error')) | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + }) | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | +} | ||
| 172 | +</script> | ||
| 0 | \ No newline at end of file | 173 | \ No newline at end of file |
src/components/account/DeleteCouponDetail.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('couponDetailManage.delete.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="delete-content"> | ||
| 9 | + <i class="el-icon-warning" style="color: #e6a23c; font-size: 24px;"></i> | ||
| 10 | + <span style="margin-left: 10px;">{{ $t('couponDetailManage.delete.confirm') }}</span> | ||
| 11 | + </div> | ||
| 12 | + <span slot="footer" class="dialog-footer"> | ||
| 13 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 14 | + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button> | ||
| 15 | + </span> | ||
| 16 | + </el-dialog> | ||
| 17 | +</template> | ||
| 18 | + | ||
| 19 | +<script> | ||
| 20 | +import { deleteCouponDetail } from '@/api/account/couponDetailManageApi' | ||
| 21 | + | ||
| 22 | +export default { | ||
| 23 | + name: 'DeleteCouponDetail', | ||
| 24 | + data() { | ||
| 25 | + return { | ||
| 26 | + visible: false, | ||
| 27 | + detailId: '' | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + methods: { | ||
| 31 | + open(row) { | ||
| 32 | + this.detailId = row.detailId | ||
| 33 | + this.visible = true | ||
| 34 | + }, | ||
| 35 | + handleClose() { | ||
| 36 | + this.detailId = '' | ||
| 37 | + }, | ||
| 38 | + async handleConfirm() { | ||
| 39 | + try { | ||
| 40 | + await deleteCouponDetail({ detailId: this.detailId }) | ||
| 41 | + this.$message.success(this.$t('couponDetailManage.delete.success')) | ||
| 42 | + this.visible = false | ||
| 43 | + this.$emit('success') | ||
| 44 | + } catch (error) { | ||
| 45 | + this.$message.error(error.message) | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | +} | ||
| 50 | +</script> | ||
| 51 | + | ||
| 52 | +<style scoped> | ||
| 53 | +.delete-content { | ||
| 54 | + display: flex; | ||
| 55 | + align-items: center; | ||
| 56 | + justify-content: center; | ||
| 57 | + padding: 20px 0; | ||
| 58 | +} | ||
| 59 | +</style> | ||
| 0 | \ No newline at end of file | 60 | \ No newline at end of file |
src/components/account/DeleteCouponPool.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('couponPoolManage.delete.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div style="text-align: center"> | ||
| 9 | + <p>{{ $t('couponPoolManage.delete.confirm') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="visible = false"> | ||
| 13 | + {{ $t('couponPoolManage.delete.cancel') }} | ||
| 14 | + </el-button> | ||
| 15 | + <el-button type="primary" @click="handleSubmit"> | ||
| 16 | + {{ $t('couponPoolManage.delete.confirmDelete') }} | ||
| 17 | + </el-button> | ||
| 18 | + </span> | ||
| 19 | + </el-dialog> | ||
| 20 | +</template> | ||
| 21 | + | ||
| 22 | +<script> | ||
| 23 | +import { deleteCouponPool } from '@/api/account/couponPoolManageApi' | ||
| 24 | + | ||
| 25 | +export default { | ||
| 26 | + name: 'DeleteCouponPool', | ||
| 27 | + data() { | ||
| 28 | + return { | ||
| 29 | + visible: false, | ||
| 30 | + poolId: '' | ||
| 31 | + } | ||
| 32 | + }, | ||
| 33 | + methods: { | ||
| 34 | + open(data) { | ||
| 35 | + this.poolId = data.poolId | ||
| 36 | + this.visible = true | ||
| 37 | + }, | ||
| 38 | + handleClose() { | ||
| 39 | + this.poolId = '' | ||
| 40 | + }, | ||
| 41 | + async handleSubmit() { | ||
| 42 | + try { | ||
| 43 | + await deleteCouponPool({ poolId: this.poolId }) | ||
| 44 | + this.$message.success(this.$t('couponPoolManage.delete.success')) | ||
| 45 | + this.visible = false | ||
| 46 | + this.$emit('success') | ||
| 47 | + } catch (error) { | ||
| 48 | + this.$message.error(error.message || this.$t('couponPoolManage.delete.error')) | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | +} | ||
| 53 | +</script> | ||
| 0 | \ No newline at end of file | 54 | \ No newline at end of file |
src/components/account/EditCouponPool.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('couponPoolManage.edit.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form | ||
| 9 | + ref="form" | ||
| 10 | + :model="form" | ||
| 11 | + :rules="rules" | ||
| 12 | + label-width="150px" | ||
| 13 | + label-position="right" | ||
| 14 | + > | ||
| 15 | + <el-form-item | ||
| 16 | + :label="$t('couponPoolManage.edit.couponType')" | ||
| 17 | + > | ||
| 18 | + <el-select | ||
| 19 | + v-model="form.couponType" | ||
| 20 | + disabled | ||
| 21 | + style="width: 100%" | ||
| 22 | + > | ||
| 23 | + <el-option | ||
| 24 | + label="普通劵" | ||
| 25 | + value="1001" | ||
| 26 | + /> | ||
| 27 | + </el-select> | ||
| 28 | + </el-form-item> | ||
| 29 | + <el-form-item | ||
| 30 | + :label="$t('couponPoolManage.edit.couponName')" | ||
| 31 | + > | ||
| 32 | + <el-input | ||
| 33 | + v-model="form.couponName" | ||
| 34 | + disabled | ||
| 35 | + /> | ||
| 36 | + </el-form-item> | ||
| 37 | + <el-form-item | ||
| 38 | + :label="$t('couponPoolManage.edit.state')" | ||
| 39 | + prop="state" | ||
| 40 | + > | ||
| 41 | + <el-select | ||
| 42 | + v-model="form.state" | ||
| 43 | + :placeholder="$t('couponPoolManage.edit.selectState')" | ||
| 44 | + style="width: 100%" | ||
| 45 | + > | ||
| 46 | + <el-option | ||
| 47 | + :label="$t('couponPoolManage.edit.stateOff')" | ||
| 48 | + value="1001" | ||
| 49 | + /> | ||
| 50 | + <el-option | ||
| 51 | + :label="$t('couponPoolManage.edit.stateOn')" | ||
| 52 | + value="2002" | ||
| 53 | + /> | ||
| 54 | + </el-select> | ||
| 55 | + </el-form-item> | ||
| 56 | + <el-form-item | ||
| 57 | + :label="$t('couponPoolManage.edit.actualPrice')" | ||
| 58 | + > | ||
| 59 | + <el-input | ||
| 60 | + v-model="form.actualPrice" | ||
| 61 | + disabled | ||
| 62 | + /> | ||
| 63 | + </el-form-item> | ||
| 64 | + <el-form-item | ||
| 65 | + :label="$t('couponPoolManage.edit.buyPrice')" | ||
| 66 | + prop="buyPrice" | ||
| 67 | + > | ||
| 68 | + <el-input | ||
| 69 | + v-model="form.buyPrice" | ||
| 70 | + type="number" | ||
| 71 | + /> | ||
| 72 | + </el-form-item> | ||
| 73 | + <el-form-item | ||
| 74 | + :label="$t('couponPoolManage.edit.couponStock')" | ||
| 75 | + prop="couponStock" | ||
| 76 | + > | ||
| 77 | + <el-input | ||
| 78 | + v-model="form.couponStock" | ||
| 79 | + type="number" | ||
| 80 | + /> | ||
| 81 | + </el-form-item> | ||
| 82 | + <el-form-item | ||
| 83 | + :label="$t('couponPoolManage.edit.validityDay')" | ||
| 84 | + > | ||
| 85 | + <el-input | ||
| 86 | + v-model="form.validityDay" | ||
| 87 | + disabled | ||
| 88 | + /> | ||
| 89 | + </el-form-item> | ||
| 90 | + <el-form-item | ||
| 91 | + :label="$t('couponPoolManage.edit.seq')" | ||
| 92 | + > | ||
| 93 | + <el-input | ||
| 94 | + v-model="form.seq" | ||
| 95 | + disabled | ||
| 96 | + /> | ||
| 97 | + </el-form-item> | ||
| 98 | + </el-form> | ||
| 99 | + <span slot="footer" class="dialog-footer"> | ||
| 100 | + <el-button @click="visible = false"> | ||
| 101 | + {{ $t('couponPoolManage.edit.cancel') }} | ||
| 102 | + </el-button> | ||
| 103 | + <el-button type="primary" @click="handleSubmit"> | ||
| 104 | + {{ $t('couponPoolManage.edit.save') }} | ||
| 105 | + </el-button> | ||
| 106 | + </span> | ||
| 107 | + </el-dialog> | ||
| 108 | +</template> | ||
| 109 | + | ||
| 110 | +<script> | ||
| 111 | +import { updateCouponPool } from '@/api/account/couponPoolManageApi' | ||
| 112 | + | ||
| 113 | +export default { | ||
| 114 | + name: 'EditCouponPool', | ||
| 115 | + data() { | ||
| 116 | + return { | ||
| 117 | + visible: false, | ||
| 118 | + form: { | ||
| 119 | + poolId: '', | ||
| 120 | + couponType: '', | ||
| 121 | + couponName: '', | ||
| 122 | + state: '', | ||
| 123 | + actualPrice: '', | ||
| 124 | + buyPrice: '', | ||
| 125 | + couponStock: '', | ||
| 126 | + validityDay: '', | ||
| 127 | + seq: '' | ||
| 128 | + }, | ||
| 129 | + rules: { | ||
| 130 | + buyPrice: [ | ||
| 131 | + { required: true, message: this.$t('couponPoolManage.edit.buyPriceRequired'), trigger: 'blur' }, | ||
| 132 | + { max: 10, message: this.$t('couponPoolManage.edit.buyPriceMaxLength'), trigger: 'blur' } | ||
| 133 | + ], | ||
| 134 | + couponStock: [ | ||
| 135 | + { required: true, message: this.$t('couponPoolManage.edit.couponStockRequired'), trigger: 'blur' }, | ||
| 136 | + { max: 20, message: this.$t('couponPoolManage.edit.couponStockMaxLength'), trigger: 'blur' } | ||
| 137 | + ], | ||
| 138 | + state: [ | ||
| 139 | + { required: true, message: this.$t('couponPoolManage.edit.stateRequired'), trigger: 'blur' } | ||
| 140 | + ] | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + }, | ||
| 144 | + methods: { | ||
| 145 | + open(data) { | ||
| 146 | + this.form = { ...data } | ||
| 147 | + this.visible = true | ||
| 148 | + }, | ||
| 149 | + handleClose() { | ||
| 150 | + this.$refs.form.resetFields() | ||
| 151 | + }, | ||
| 152 | + handleSubmit() { | ||
| 153 | + this.$refs.form.validate(async valid => { | ||
| 154 | + if (valid) { | ||
| 155 | + try { | ||
| 156 | + await updateCouponPool(this.form) | ||
| 157 | + this.$message.success(this.$t('couponPoolManage.edit.success')) | ||
| 158 | + this.visible = false | ||
| 159 | + this.$emit('success') | ||
| 160 | + } catch (error) { | ||
| 161 | + this.$message.error(error.message || this.$t('couponPoolManage.edit.error')) | ||
| 162 | + } | ||
| 163 | + } | ||
| 164 | + }) | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | +} | ||
| 168 | +</script> | ||
| 0 | \ No newline at end of file | 169 | \ No newline at end of file |
src/components/mall/DeleteJunkRequirement.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('junkRequirement.delete.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="close" | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('junkRequirement.delete.confirm') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="close">{{ $t('common.cancel') }}</el-button> | ||
| 13 | + <el-button type="primary" @click="deleteJunkRequirement">{{ $t('common.confirm') }}</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script> | ||
| 19 | +import { deleteJunkRequirement } from '@/api/mall/junkRequirementManageApi' | ||
| 20 | + | ||
| 21 | +export default { | ||
| 22 | + name: 'DeleteJunkRequirement', | ||
| 23 | + data() { | ||
| 24 | + return { | ||
| 25 | + visible: false, | ||
| 26 | + junkRequirementId: '' | ||
| 27 | + } | ||
| 28 | + }, | ||
| 29 | + methods: { | ||
| 30 | + open(row) { | ||
| 31 | + this.junkRequirementId = row.junkRequirementId | ||
| 32 | + this.visible = true | ||
| 33 | + }, | ||
| 34 | + close() { | ||
| 35 | + this.visible = false | ||
| 36 | + this.junkRequirementId = '' | ||
| 37 | + }, | ||
| 38 | + async deleteJunkRequirement() { | ||
| 39 | + try { | ||
| 40 | + await deleteJunkRequirement({ | ||
| 41 | + junkRequirementId: this.junkRequirementId, | ||
| 42 | + communityId: this.$store.getters.communityId | ||
| 43 | + }) | ||
| 44 | + this.$message.success(this.$t('junkRequirement.delete.success')) | ||
| 45 | + this.$emit('success') | ||
| 46 | + this.close() | ||
| 47 | + } catch (error) { | ||
| 48 | + this.$message.error(error.message || this.$t('junkRequirement.delete.error')) | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | +} | ||
| 53 | +</script> | ||
| 0 | \ No newline at end of file | 54 | \ No newline at end of file |
src/components/mall/EditJunkRequirement.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('junkRequirement.edit.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="close" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="editJunkRequirementInfo" label-width="120px"> | ||
| 9 | + <el-form-item :label="$t('junkRequirement.edit.classification')"> | ||
| 10 | + <el-select | ||
| 11 | + v-model="editJunkRequirementInfo.classification" | ||
| 12 | + :disabled="true" | ||
| 13 | + class="form-item" | ||
| 14 | + > | ||
| 15 | + <el-option | ||
| 16 | + v-for="item in classificationOptions" | ||
| 17 | + :key="item.value" | ||
| 18 | + :label="item.label" | ||
| 19 | + :value="item.value" | ||
| 20 | + /> | ||
| 21 | + </el-select> | ||
| 22 | + </el-form-item> | ||
| 23 | + <el-form-item :label="$t('junkRequirement.edit.context')"> | ||
| 24 | + <el-input | ||
| 25 | + v-model="editJunkRequirementInfo.context" | ||
| 26 | + :disabled="true" | ||
| 27 | + class="form-item" | ||
| 28 | + /> | ||
| 29 | + </el-form-item> | ||
| 30 | + <el-form-item :label="$t('junkRequirement.edit.referencePrice')"> | ||
| 31 | + <el-input | ||
| 32 | + v-model="editJunkRequirementInfo.referencePrice" | ||
| 33 | + :disabled="true" | ||
| 34 | + class="form-item" | ||
| 35 | + /> | ||
| 36 | + </el-form-item> | ||
| 37 | + <el-form-item :label="$t('junkRequirement.edit.publishUserName')"> | ||
| 38 | + <el-input | ||
| 39 | + v-model="editJunkRequirementInfo.publishUserName" | ||
| 40 | + :disabled="true" | ||
| 41 | + class="form-item" | ||
| 42 | + /> | ||
| 43 | + </el-form-item> | ||
| 44 | + <el-form-item :label="$t('junkRequirement.edit.publishUserLink')"> | ||
| 45 | + <el-input | ||
| 46 | + v-model="editJunkRequirementInfo.publishUserLink" | ||
| 47 | + :disabled="true" | ||
| 48 | + class="form-item" | ||
| 49 | + /> | ||
| 50 | + </el-form-item> | ||
| 51 | + <el-form-item | ||
| 52 | + :label="$t('junkRequirement.edit.state')" | ||
| 53 | + prop="state" | ||
| 54 | + :rules="[ | ||
| 55 | + { required: true, message: $t('junkRequirement.edit.stateRequired'), trigger: 'change' } | ||
| 56 | + ]" | ||
| 57 | + > | ||
| 58 | + <el-select | ||
| 59 | + v-model="editJunkRequirementInfo.state" | ||
| 60 | + class="form-item" | ||
| 61 | + > | ||
| 62 | + <el-option | ||
| 63 | + v-for="item in stateOptions" | ||
| 64 | + :key="item.value" | ||
| 65 | + :label="item.label" | ||
| 66 | + :value="item.value" | ||
| 67 | + /> | ||
| 68 | + </el-select> | ||
| 69 | + </el-form-item> | ||
| 70 | + </el-form> | ||
| 71 | + <span slot="footer" class="dialog-footer"> | ||
| 72 | + <el-button @click="close">{{ $t('common.cancel') }}</el-button> | ||
| 73 | + <el-button type="primary" @click="editJunkRequirement">{{ $t('common.review') }}</el-button> | ||
| 74 | + </span> | ||
| 75 | + </el-dialog> | ||
| 76 | +</template> | ||
| 77 | + | ||
| 78 | +<script> | ||
| 79 | +import { updateJunkRequirement } from '@/api/mall/junkRequirementManageApi' | ||
| 80 | + | ||
| 81 | +export default { | ||
| 82 | + name: 'EditJunkRequirement', | ||
| 83 | + data() { | ||
| 84 | + return { | ||
| 85 | + visible: false, | ||
| 86 | + editJunkRequirementInfo: { | ||
| 87 | + junkRequirementId: '', | ||
| 88 | + classification: '', | ||
| 89 | + context: '', | ||
| 90 | + referencePrice: '', | ||
| 91 | + publishUserName: '', | ||
| 92 | + publishUserLink: '', | ||
| 93 | + state: '' | ||
| 94 | + }, | ||
| 95 | + classificationOptions: [ | ||
| 96 | + { value: '10001', label: this.$t('junkRequirement.classification.furniture') }, | ||
| 97 | + { value: '10002', label: this.$t('junkRequirement.classification.appliance') } | ||
| 98 | + ], | ||
| 99 | + stateOptions: [ | ||
| 100 | + { value: '12001', label: this.$t('junkRequirement.state.unreviewed') }, | ||
| 101 | + { value: '13001', label: this.$t('junkRequirement.state.reviewed') }, | ||
| 102 | + { value: '14001', label: this.$t('junkRequirement.state.reviewFailed') }, | ||
| 103 | + { value: '15001', label: this.$t('junkRequirement.state.completed') } | ||
| 104 | + ] | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + methods: { | ||
| 108 | + open(row) { | ||
| 109 | + this.resetForm() | ||
| 110 | + this.editJunkRequirementInfo = { ...row } | ||
| 111 | + this.visible = true | ||
| 112 | + }, | ||
| 113 | + close() { | ||
| 114 | + this.visible = false | ||
| 115 | + this.$refs.form.resetFields() | ||
| 116 | + }, | ||
| 117 | + editJunkRequirement() { | ||
| 118 | + this.$refs.form.validate(async valid => { | ||
| 119 | + if (valid) { | ||
| 120 | + try { | ||
| 121 | + await updateJunkRequirement({ | ||
| 122 | + ...this.editJunkRequirementInfo, | ||
| 123 | + communityId: this.$store.getters.communityId | ||
| 124 | + }) | ||
| 125 | + this.$message.success(this.$t('junkRequirement.edit.success')) | ||
| 126 | + this.$emit('success') | ||
| 127 | + this.close() | ||
| 128 | + } catch (error) { | ||
| 129 | + this.$message.error(error.message || this.$t('junkRequirement.edit.error')) | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | + }) | ||
| 133 | + }, | ||
| 134 | + resetForm() { | ||
| 135 | + this.editJunkRequirementInfo = { | ||
| 136 | + junkRequirementId: '', | ||
| 137 | + classification: '', | ||
| 138 | + context: '', | ||
| 139 | + referencePrice: '', | ||
| 140 | + publishUserName: '', | ||
| 141 | + publishUserLink: '', | ||
| 142 | + state: '' | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | +} | ||
| 147 | +</script> | ||
| 148 | + | ||
| 149 | +<style scoped> | ||
| 150 | +.form-item { | ||
| 151 | + width: 100%; | ||
| 152 | +} | ||
| 153 | +</style> | ||
| 0 | \ No newline at end of file | 154 | \ No newline at end of file |
src/i18n/index.js
| @@ -105,6 +105,9 @@ import { messages as marketLogMessages } from '../views/market/marketLogLang' | @@ -105,6 +105,9 @@ import { messages as marketLogMessages } from '../views/market/marketLogLang' | ||
| 105 | import { messages as advertManageMessages } from '../views/admin/advertManageLang' | 105 | import { messages as advertManageMessages } from '../views/admin/advertManageLang' |
| 106 | import { messages as convenienceMenusManageMessages } from '../views/mall/convenienceMenusManageLang' | 106 | import { messages as convenienceMenusManageMessages } from '../views/mall/convenienceMenusManageLang' |
| 107 | import { messages as storeInfoManageMessages } from '../views/mall/storeInfoManageLang' | 107 | import { messages as storeInfoManageMessages } from '../views/mall/storeInfoManageLang' |
| 108 | +import { messages as junkRequirementManageMessages } from '../views/mall/junkRequirementManageLang' | ||
| 109 | +import { messages as couponPoolManageMessages } from '../views/account/couponPoolManageLang' | ||
| 110 | +import { messages as couponDetailManageMessages } from '../views/account/couponDetailManageLang' | ||
| 108 | 111 | ||
| 109 | Vue.use(VueI18n) | 112 | Vue.use(VueI18n) |
| 110 | 113 | ||
| @@ -214,6 +217,9 @@ const messages = { | @@ -214,6 +217,9 @@ const messages = { | ||
| 214 | ...advertManageMessages.en, | 217 | ...advertManageMessages.en, |
| 215 | ...convenienceMenusManageMessages.en, | 218 | ...convenienceMenusManageMessages.en, |
| 216 | ...storeInfoManageMessages.en, | 219 | ...storeInfoManageMessages.en, |
| 220 | + ...junkRequirementManageMessages.en, | ||
| 221 | + ...couponPoolManageMessages.en, | ||
| 222 | + ...couponDetailManageMessages.en, | ||
| 217 | }, | 223 | }, |
| 218 | zh: { | 224 | zh: { |
| 219 | ...loginMessages.zh, | 225 | ...loginMessages.zh, |
| @@ -319,6 +325,9 @@ const messages = { | @@ -319,6 +325,9 @@ const messages = { | ||
| 319 | ...advertManageMessages.zh, | 325 | ...advertManageMessages.zh, |
| 320 | ...convenienceMenusManageMessages.zh, | 326 | ...convenienceMenusManageMessages.zh, |
| 321 | ...storeInfoManageMessages.zh, | 327 | ...storeInfoManageMessages.zh, |
| 328 | + ...junkRequirementManageMessages.zh, | ||
| 329 | + ...couponPoolManageMessages.zh, | ||
| 330 | + ...couponDetailManageMessages.zh, | ||
| 322 | } | 331 | } |
| 323 | } | 332 | } |
| 324 | 333 |
src/router/index.js
| @@ -502,15 +502,30 @@ const routes = [ | @@ -502,15 +502,30 @@ const routes = [ | ||
| 502 | component: () => import('@/views/admin/advertManageList.vue') | 502 | component: () => import('@/views/admin/advertManageList.vue') |
| 503 | }, | 503 | }, |
| 504 | { | 504 | { |
| 505 | - path:'/pages/admin/convenienceMenusManage', | ||
| 506 | - name:'/pages/admin/convenienceMenusManage', | 505 | + path: '/pages/admin/convenienceMenusManage', |
| 506 | + name: '/pages/admin/convenienceMenusManage', | ||
| 507 | component: () => import('@/views/mall/convenienceMenusManageList.vue') | 507 | component: () => import('@/views/mall/convenienceMenusManageList.vue') |
| 508 | + }, | ||
| 509 | + { | ||
| 510 | + path: '/pages/admin/storeInfoManage', | ||
| 511 | + name: '/pages/admin/storeInfoManage', | ||
| 512 | + component: () => import('@/views/mall/storeInfoManageList.vue') | ||
| 513 | + }, | ||
| 514 | + { | ||
| 515 | + path: '/pages/proxy/junkRequirementManage', | ||
| 516 | + name: '/pages/proxy/junkRequirementManage', | ||
| 517 | + component: () => import('@/views/mall/junkRequirementManageList.vue') | ||
| 518 | + }, | ||
| 519 | + { | ||
| 520 | + path: '/pages/admin/couponPoolManage', | ||
| 521 | + name: '/pages/admin/couponPoolManage', | ||
| 522 | + component: () => import('@/views/account/couponPoolManageList.vue') | ||
| 523 | + }, | ||
| 524 | + { | ||
| 525 | + path:'/pages/admin/couponDetailManage', | ||
| 526 | + name:'/pages/admin/couponDetailManage', | ||
| 527 | + component: () => import('@/views/account/couponDetailManageList.vue') | ||
| 508 | }, | 528 | }, |
| 509 | - { | ||
| 510 | - path:'/pages/admin/storeInfoManage', | ||
| 511 | - name:'/pages/admin/storeInfoManage', | ||
| 512 | - component: () => import('@/views/mall/storeInfoManageList.vue') | ||
| 513 | - }, | ||
| 514 | // 其他子路由可以在这里添加 | 529 | // 其他子路由可以在这里添加 |
| 515 | ] | 530 | ] |
| 516 | }, | 531 | }, |
src/views/account/couponDetailManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + couponDetailManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + poolId: 'Please enter coupon', | ||
| 7 | + shopId: 'Please enter shop ID' | ||
| 8 | + }, | ||
| 9 | + list: { | ||
| 10 | + title: 'Merchant Purchase Records' | ||
| 11 | + }, | ||
| 12 | + table: { | ||
| 13 | + detailId: 'Detail ID', | ||
| 14 | + shopName: 'Shop', | ||
| 15 | + couponName: 'Coupon Name', | ||
| 16 | + actualPrice: 'Face Value', | ||
| 17 | + buyPrice: 'Purchase Price', | ||
| 18 | + amount: 'Payment Amount', | ||
| 19 | + buyCount: 'Purchase Quantity', | ||
| 20 | + validityDay: 'Validity Period' | ||
| 21 | + }, | ||
| 22 | + add: { | ||
| 23 | + title: 'Add Merchant Purchase Record', | ||
| 24 | + poolId: 'Coupon', | ||
| 25 | + poolIdPlaceholder: 'Required, please enter coupon', | ||
| 26 | + shopId: 'Shop', | ||
| 27 | + shopIdPlaceholder: 'Required, please enter shop ID', | ||
| 28 | + couponName: 'Coupon Name', | ||
| 29 | + couponNamePlaceholder: 'Required, please enter coupon name', | ||
| 30 | + actualPrice: 'Face Value', | ||
| 31 | + actualPricePlaceholder: 'Required, please enter face value', | ||
| 32 | + buyPrice: 'Purchase Price', | ||
| 33 | + buyPricePlaceholder: 'Required, please enter purchase price', | ||
| 34 | + amount: 'Payment Amount', | ||
| 35 | + amountPlaceholder: 'Required, please enter payment amount', | ||
| 36 | + buyCount: 'Purchase Quantity', | ||
| 37 | + buyCountPlaceholder: 'Required, please enter purchase quantity', | ||
| 38 | + validityDay: 'Validity Period', | ||
| 39 | + validityDayPlaceholder: 'Required, please enter validity period', | ||
| 40 | + success: 'Added successfully' | ||
| 41 | + }, | ||
| 42 | + edit: { | ||
| 43 | + title: 'Edit Merchant Purchase Record', | ||
| 44 | + poolId: 'Coupon', | ||
| 45 | + poolIdPlaceholder: 'Required, please enter coupon', | ||
| 46 | + shopId: 'Shop', | ||
| 47 | + shopIdPlaceholder: 'Required, please enter shop ID', | ||
| 48 | + couponName: 'Coupon Name', | ||
| 49 | + couponNamePlaceholder: 'Required, please enter coupon name', | ||
| 50 | + actualPrice: 'Face Value', | ||
| 51 | + actualPricePlaceholder: 'Required, please enter face value', | ||
| 52 | + buyPrice: 'Purchase Price', | ||
| 53 | + buyPricePlaceholder: 'Required, please enter purchase price', | ||
| 54 | + amount: 'Payment Amount', | ||
| 55 | + amountPlaceholder: 'Required, please enter payment amount', | ||
| 56 | + buyCount: 'Purchase Quantity', | ||
| 57 | + buyCountPlaceholder: 'Required, please enter purchase quantity', | ||
| 58 | + validityDay: 'Validity Period', | ||
| 59 | + validityDayPlaceholder: 'Required, please enter validity period', | ||
| 60 | + success: 'Updated successfully' | ||
| 61 | + }, | ||
| 62 | + delete: { | ||
| 63 | + title: 'Confirm Operation', | ||
| 64 | + confirm: 'Are you sure to delete this merchant purchase record?', | ||
| 65 | + success: 'Deleted successfully' | ||
| 66 | + }, | ||
| 67 | + validate: { | ||
| 68 | + detailIdRequired: 'Detail ID is required', | ||
| 69 | + poolIdRequired: 'Coupon is required', | ||
| 70 | + poolIdMaxLength: 'Coupon cannot exceed 30 characters', | ||
| 71 | + shopIdRequired: 'Shop ID is required', | ||
| 72 | + shopIdMaxLength: 'Shop ID cannot exceed 30 characters', | ||
| 73 | + couponNameRequired: 'Coupon name is required', | ||
| 74 | + couponNameMaxLength: 'Coupon name cannot exceed 64 characters', | ||
| 75 | + actualPriceRequired: 'Face value is required', | ||
| 76 | + actualPriceNumber: 'Face value must be a number', | ||
| 77 | + buyPriceRequired: 'Purchase price is required', | ||
| 78 | + buyPriceNumber: 'Purchase price must be a number', | ||
| 79 | + amountRequired: 'Payment amount is required', | ||
| 80 | + amountNumber: 'Payment amount must be a number', | ||
| 81 | + buyCountRequired: 'Purchase quantity is required', | ||
| 82 | + buyCountNumber: 'Purchase quantity must be a number', | ||
| 83 | + validityDayRequired: 'Validity period is required', | ||
| 84 | + validityDayNumber: 'Validity period must be a number' | ||
| 85 | + }, | ||
| 86 | + fetchError: 'Failed to fetch coupon details' | ||
| 87 | + } | ||
| 88 | + }, | ||
| 89 | + zh: { | ||
| 90 | + couponDetailManage: { | ||
| 91 | + search: { | ||
| 92 | + title: '查询条件', | ||
| 93 | + poolId: '请输入优惠券', | ||
| 94 | + shopId: '请输入店铺ID' | ||
| 95 | + }, | ||
| 96 | + list: { | ||
| 97 | + title: '商家购买记录' | ||
| 98 | + }, | ||
| 99 | + table: { | ||
| 100 | + detailId: '商家购买记录表ID', | ||
| 101 | + shopName: '店铺', | ||
| 102 | + couponName: '优惠券名称', | ||
| 103 | + actualPrice: '面值', | ||
| 104 | + buyPrice: '购买价格', | ||
| 105 | + amount: '付款金额', | ||
| 106 | + buyCount: '购买数量', | ||
| 107 | + validityDay: '有效期' | ||
| 108 | + }, | ||
| 109 | + add: { | ||
| 110 | + title: '添加商家购买记录表', | ||
| 111 | + poolId: '优惠券', | ||
| 112 | + poolIdPlaceholder: '必填,请填写优惠券', | ||
| 113 | + shopId: '店铺', | ||
| 114 | + shopIdPlaceholder: '必填,请填写店铺ID', | ||
| 115 | + couponName: '优惠券名称', | ||
| 116 | + couponNamePlaceholder: '必填,请填写优惠券名称', | ||
| 117 | + actualPrice: '面值', | ||
| 118 | + actualPricePlaceholder: '必填,请填写面值', | ||
| 119 | + buyPrice: '购买价格', | ||
| 120 | + buyPricePlaceholder: '必填,请填写购买价格', | ||
| 121 | + amount: '付款金额', | ||
| 122 | + amountPlaceholder: '必填,请填写付款金额', | ||
| 123 | + buyCount: '购买数量', | ||
| 124 | + buyCountPlaceholder: '必填,请填写购买数量', | ||
| 125 | + validityDay: '有效期', | ||
| 126 | + validityDayPlaceholder: '必填,请填写有效期', | ||
| 127 | + success: '添加成功' | ||
| 128 | + }, | ||
| 129 | + edit: { | ||
| 130 | + title: '修改商家购买记录表', | ||
| 131 | + poolId: '优惠券', | ||
| 132 | + poolIdPlaceholder: '必填,请填写优惠券', | ||
| 133 | + shopId: '店铺', | ||
| 134 | + shopIdPlaceholder: '必填,请填写店铺ID', | ||
| 135 | + couponName: '优惠券名称', | ||
| 136 | + couponNamePlaceholder: '必填,请填写优惠券名称', | ||
| 137 | + actualPrice: '面值', | ||
| 138 | + actualPricePlaceholder: '必填,请填写面值', | ||
| 139 | + buyPrice: '购买价格', | ||
| 140 | + buyPricePlaceholder: '必填,请填写购买价格', | ||
| 141 | + amount: '付款金额', | ||
| 142 | + amountPlaceholder: '必填,请填写付款金额', | ||
| 143 | + buyCount: '购买数量', | ||
| 144 | + buyCountPlaceholder: '必填,请填写购买数量', | ||
| 145 | + validityDay: '有效期', | ||
| 146 | + validityDayPlaceholder: '必填,请填写有效期', | ||
| 147 | + success: '修改成功' | ||
| 148 | + }, | ||
| 149 | + delete: { | ||
| 150 | + title: '请确认您的操作', | ||
| 151 | + confirm: '确定删除商家购买记录', | ||
| 152 | + success: '删除成功' | ||
| 153 | + }, | ||
| 154 | + validate: { | ||
| 155 | + detailIdRequired: '记录ID不能为空', | ||
| 156 | + poolIdRequired: '优惠券不能为空', | ||
| 157 | + poolIdMaxLength: '优惠券不能超过30', | ||
| 158 | + shopIdRequired: '店铺ID不能为空', | ||
| 159 | + shopIdMaxLength: '店铺ID不能超过30', | ||
| 160 | + couponNameRequired: '优惠券名称不能为空', | ||
| 161 | + couponNameMaxLength: '优惠券名称不能超过64', | ||
| 162 | + actualPriceRequired: '面值不能为空', | ||
| 163 | + actualPriceNumber: '面值必须是数字', | ||
| 164 | + buyPriceRequired: '购买价格不能为空', | ||
| 165 | + buyPriceNumber: '购买价格必须是数字', | ||
| 166 | + amountRequired: '付款金额不能为空', | ||
| 167 | + amountNumber: '付款金额必须是数字', | ||
| 168 | + buyCountRequired: '购买数量不能为空', | ||
| 169 | + buyCountNumber: '购买数量必须是数字', | ||
| 170 | + validityDayRequired: '有效期不能为空', | ||
| 171 | + validityDayNumber: '有效期必须是数字' | ||
| 172 | + }, | ||
| 173 | + fetchError: '获取优惠券详情失败' | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | +} | ||
| 0 | \ No newline at end of file | 177 | \ No newline at end of file |
src/views/account/couponDetailManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="coupon-detail-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="clearfix text-left"> | ||
| 6 | + <span>{{ $t('couponDetailManage.search.title') }}</span> | ||
| 7 | + </div> | ||
| 8 | + <el-row :gutter="20"> | ||
| 9 | + <el-col :span="4"> | ||
| 10 | + <el-input v-model="searchForm.poolId" :placeholder="$t('couponDetailManage.search.poolId')" clearable | ||
| 11 | + @keyup.enter.native="handleSearch" /> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="4"> | ||
| 14 | + <el-input v-model="searchForm.shopId" :placeholder="$t('couponDetailManage.search.shopId')" clearable | ||
| 15 | + @keyup.enter.native="handleSearch" /> | ||
| 16 | + </el-col> | ||
| 17 | + <el-col :span="4"> | ||
| 18 | + <el-button type="primary" @click="handleSearch"> | ||
| 19 | + <i class="el-icon-search"></i> | ||
| 20 | + {{ $t('common.search') }} | ||
| 21 | + </el-button> | ||
| 22 | + </el-col> | ||
| 23 | + </el-row> | ||
| 24 | + </el-card> | ||
| 25 | + | ||
| 26 | + <!-- 数据列表 --> | ||
| 27 | + <el-card class="list-wrapper"> | ||
| 28 | + <div slot="header" class="clearfix text-left"> | ||
| 29 | + <span>{{ $t('couponDetailManage.list.title') }}</span> | ||
| 30 | + </div> | ||
| 31 | + | ||
| 32 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | ||
| 33 | + <el-table-column prop="detailId" :label="$t('couponDetailManage.table.detailId')" align="center" /> | ||
| 34 | + <el-table-column prop="shopName" :label="$t('couponDetailManage.table.shopName')" align="center" /> | ||
| 35 | + <el-table-column prop="couponName" :label="$t('couponDetailManage.table.couponName')" align="center" /> | ||
| 36 | + <el-table-column prop="actualPrice" :label="$t('couponDetailManage.table.actualPrice')" align="center" /> | ||
| 37 | + <el-table-column prop="buyPrice" :label="$t('couponDetailManage.table.buyPrice')" align="center" /> | ||
| 38 | + <el-table-column prop="amount" :label="$t('couponDetailManage.table.amount')" align="center" /> | ||
| 39 | + <el-table-column prop="buyCount" :label="$t('couponDetailManage.table.buyCount')" align="center" /> | ||
| 40 | + <el-table-column prop="validityDay" :label="$t('couponDetailManage.table.validityDay')" align="center" /> | ||
| 41 | + </el-table> | ||
| 42 | + | ||
| 43 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 44 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 45 | + @current-change="handleCurrentChange" /> | ||
| 46 | + </el-card> | ||
| 47 | + | ||
| 48 | + </div> | ||
| 49 | +</template> | ||
| 50 | + | ||
| 51 | +<script> | ||
| 52 | +import { | ||
| 53 | + listCouponDetail, | ||
| 54 | +} from '@/api/account/couponDetailManageApi' | ||
| 55 | + | ||
| 56 | +export default { | ||
| 57 | + name: 'CouponDetailManageList', | ||
| 58 | + components: { | ||
| 59 | + }, | ||
| 60 | + data() { | ||
| 61 | + return { | ||
| 62 | + loading: false, | ||
| 63 | + searchForm: { | ||
| 64 | + poolId: '', | ||
| 65 | + shopId: '' | ||
| 66 | + }, | ||
| 67 | + tableData: [], | ||
| 68 | + page: { | ||
| 69 | + current: 1, | ||
| 70 | + size: 10, | ||
| 71 | + total: 0 | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + }, | ||
| 75 | + created() { | ||
| 76 | + this.getList() | ||
| 77 | + }, | ||
| 78 | + methods: { | ||
| 79 | + async getList() { | ||
| 80 | + try { | ||
| 81 | + this.loading = true | ||
| 82 | + const params = { | ||
| 83 | + page: this.page.current, | ||
| 84 | + row: this.page.size, | ||
| 85 | + ...this.searchForm | ||
| 86 | + } | ||
| 87 | + const { data, total } = await listCouponDetail(params) | ||
| 88 | + this.tableData = data | ||
| 89 | + this.page.total = total | ||
| 90 | + } catch (error) { | ||
| 91 | + this.$message.error(this.$t('couponDetailManage.fetchError')) | ||
| 92 | + } finally { | ||
| 93 | + this.loading = false | ||
| 94 | + } | ||
| 95 | + }, | ||
| 96 | + handleSearch() { | ||
| 97 | + this.page.current = 1 | ||
| 98 | + this.getList() | ||
| 99 | + }, | ||
| 100 | + handleSizeChange(val) { | ||
| 101 | + this.page.size = val | ||
| 102 | + this.getList() | ||
| 103 | + }, | ||
| 104 | + handleCurrentChange(val) { | ||
| 105 | + this.page.current = val | ||
| 106 | + this.getList() | ||
| 107 | + }, | ||
| 108 | + handleSuccess() { | ||
| 109 | + this.getList() | ||
| 110 | + }, | ||
| 111 | + handleAdd() { | ||
| 112 | + this.$refs.addCouponDetail.open() | ||
| 113 | + }, | ||
| 114 | + handleEdit(row) { | ||
| 115 | + this.$refs.editCouponDetail.open(row) | ||
| 116 | + }, | ||
| 117 | + handleDelete(row) { | ||
| 118 | + this.$refs.deleteCouponDetail.open(row) | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | +} | ||
| 122 | +</script> | ||
| 123 | + | ||
| 124 | +<style lang="scss" scoped> | ||
| 125 | +.coupon-detail-container { | ||
| 126 | + padding: 20px; | ||
| 127 | + | ||
| 128 | + .search-wrapper { | ||
| 129 | + margin-bottom: 20px; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + .el-pagination { | ||
| 133 | + margin-top: 20px; | ||
| 134 | + text-align: right; | ||
| 135 | + } | ||
| 136 | +} | ||
| 137 | +</style> | ||
| 0 | \ No newline at end of file | 138 | \ No newline at end of file |
src/views/account/couponPoolManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + couponPoolManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + couponName: 'Please enter coupon name', | ||
| 7 | + validityDay: 'Please enter validity period' | ||
| 8 | + }, | ||
| 9 | + list: { | ||
| 10 | + title: 'Coupon Pool Information', | ||
| 11 | + create: 'Create' | ||
| 12 | + }, | ||
| 13 | + table: { | ||
| 14 | + poolId: 'Coupon Pool ID', | ||
| 15 | + couponType: 'Coupon Type', | ||
| 16 | + couponName: 'Coupon Name', | ||
| 17 | + actualPrice: 'Face Value', | ||
| 18 | + buyPrice: 'Purchase Price', | ||
| 19 | + couponStock: 'Quantity', | ||
| 20 | + validityDay: 'Validity Period', | ||
| 21 | + seq: 'Sequence', | ||
| 22 | + operation: 'Operation', | ||
| 23 | + edit: 'Edit' | ||
| 24 | + }, | ||
| 25 | + add: { | ||
| 26 | + title: 'Add Coupon Pool', | ||
| 27 | + couponType: 'Coupon Type', | ||
| 28 | + selectCouponType: 'Please select coupon type', | ||
| 29 | + couponName: 'Coupon Name', | ||
| 30 | + inputCouponName: 'Required, please enter coupon name', | ||
| 31 | + actualPrice: 'Face Value', | ||
| 32 | + inputActualPrice: 'Required, please enter face value', | ||
| 33 | + buyPrice: 'Purchase Price', | ||
| 34 | + inputBuyPrice: 'Required, please enter purchase price', | ||
| 35 | + couponStock: 'Quantity', | ||
| 36 | + inputCouponStock: 'Required, please enter quantity', | ||
| 37 | + validityDay: 'Validity Period', | ||
| 38 | + inputValidityDay: 'Required, please enter validity period', | ||
| 39 | + seq: 'Sequence', | ||
| 40 | + inputSeq: 'Required, please enter sequence', | ||
| 41 | + cancel: 'Cancel', | ||
| 42 | + save: 'Save', | ||
| 43 | + success: 'Added successfully', | ||
| 44 | + error: 'Failed to add', | ||
| 45 | + couponTypeRequired: 'Coupon type is required', | ||
| 46 | + couponNameRequired: 'Coupon name is required', | ||
| 47 | + couponNameMaxLength: 'Coupon name cannot exceed 64 characters', | ||
| 48 | + actualPriceRequired: 'Face value is required', | ||
| 49 | + actualPriceMaxLength: 'Face value cannot exceed 10 characters', | ||
| 50 | + buyPriceRequired: 'Purchase price is required', | ||
| 51 | + buyPriceMaxLength: 'Purchase price cannot exceed 10 characters', | ||
| 52 | + couponStockRequired: 'Quantity is required', | ||
| 53 | + couponStockMaxLength: 'Quantity cannot exceed 20 characters', | ||
| 54 | + validityDayRequired: 'Validity period is required', | ||
| 55 | + validityDayMaxLength: 'Validity period cannot exceed 20 characters', | ||
| 56 | + seqRequired: 'Sequence is required', | ||
| 57 | + seqMaxLength: 'Sequence cannot exceed 11 characters' | ||
| 58 | + }, | ||
| 59 | + edit: { | ||
| 60 | + title: 'Edit Coupon Pool', | ||
| 61 | + couponType: 'Coupon Type', | ||
| 62 | + couponName: 'Coupon Name', | ||
| 63 | + state: 'Status', | ||
| 64 | + selectState: 'Please select status', | ||
| 65 | + stateOff: 'Off Shelf', | ||
| 66 | + stateOn: 'Normal', | ||
| 67 | + actualPrice: 'Face Value', | ||
| 68 | + buyPrice: 'Purchase Price', | ||
| 69 | + couponStock: 'Quantity', | ||
| 70 | + validityDay: 'Validity Period', | ||
| 71 | + seq: 'Sequence', | ||
| 72 | + cancel: 'Cancel', | ||
| 73 | + save: 'Save', | ||
| 74 | + success: 'Updated successfully', | ||
| 75 | + error: 'Failed to update', | ||
| 76 | + buyPriceRequired: 'Purchase price is required', | ||
| 77 | + buyPriceMaxLength: 'Purchase price cannot exceed 10 characters', | ||
| 78 | + couponStockRequired: 'Quantity is required', | ||
| 79 | + couponStockMaxLength: 'Quantity cannot exceed 20 characters', | ||
| 80 | + stateRequired: 'Status is required' | ||
| 81 | + }, | ||
| 82 | + delete: { | ||
| 83 | + title: 'Confirm Operation', | ||
| 84 | + confirm: 'Are you sure to delete this coupon?', | ||
| 85 | + cancel: 'Cancel', | ||
| 86 | + confirmDelete: 'Confirm Delete', | ||
| 87 | + success: 'Deleted successfully', | ||
| 88 | + error: 'Failed to delete' | ||
| 89 | + }, | ||
| 90 | + fetchError: 'Failed to fetch coupon pool data' | ||
| 91 | + } | ||
| 92 | + }, | ||
| 93 | + zh: { | ||
| 94 | + couponPoolManage: { | ||
| 95 | + search: { | ||
| 96 | + title: '查询条件', | ||
| 97 | + couponName: '请输入优惠券名称', | ||
| 98 | + validityDay: '请输入有效期' | ||
| 99 | + }, | ||
| 100 | + list: { | ||
| 101 | + title: '优惠券池信息', | ||
| 102 | + create: '制作' | ||
| 103 | + }, | ||
| 104 | + table: { | ||
| 105 | + poolId: '优惠券池ID', | ||
| 106 | + couponType: '优惠券类型', | ||
| 107 | + couponName: '优惠券名称', | ||
| 108 | + actualPrice: '面值', | ||
| 109 | + buyPrice: '购买价格', | ||
| 110 | + couponStock: '数量', | ||
| 111 | + validityDay: '有效期', | ||
| 112 | + seq: '排序', | ||
| 113 | + operation: '操作', | ||
| 114 | + edit: '修改' | ||
| 115 | + }, | ||
| 116 | + add: { | ||
| 117 | + title: '添加优惠券池', | ||
| 118 | + couponType: '优惠券类型', | ||
| 119 | + selectCouponType: '请选择优惠券类型', | ||
| 120 | + couponName: '优惠券名称', | ||
| 121 | + inputCouponName: '必填,请填写优惠券名称', | ||
| 122 | + actualPrice: '面值', | ||
| 123 | + inputActualPrice: '必填,请填写面值', | ||
| 124 | + buyPrice: '购买价格', | ||
| 125 | + inputBuyPrice: '必填,请填写购买价格', | ||
| 126 | + couponStock: '数量', | ||
| 127 | + inputCouponStock: '必填,请填写数量', | ||
| 128 | + validityDay: '有效期', | ||
| 129 | + inputValidityDay: '必填,请填写有效期', | ||
| 130 | + seq: '排序', | ||
| 131 | + inputSeq: '必填,请填写排序', | ||
| 132 | + cancel: '取消', | ||
| 133 | + save: '保存', | ||
| 134 | + success: '添加成功', | ||
| 135 | + error: '添加失败', | ||
| 136 | + couponTypeRequired: '优惠券类型不能为空', | ||
| 137 | + couponNameRequired: '优惠券名称不能为空', | ||
| 138 | + couponNameMaxLength: '优惠券名称不能超过64', | ||
| 139 | + actualPriceRequired: '面值不能为空', | ||
| 140 | + actualPriceMaxLength: '面值不能超过10', | ||
| 141 | + buyPriceRequired: '购买价格不能为空', | ||
| 142 | + buyPriceMaxLength: '购买价格不能超过10', | ||
| 143 | + couponStockRequired: '数量不能为空', | ||
| 144 | + couponStockMaxLength: '数量不能超过20', | ||
| 145 | + validityDayRequired: '有效期不能为空', | ||
| 146 | + validityDayMaxLength: '有效期不能超过20', | ||
| 147 | + seqRequired: '排序不能为空', | ||
| 148 | + seqMaxLength: '排序不能超过11' | ||
| 149 | + }, | ||
| 150 | + edit: { | ||
| 151 | + title: '修改优惠券池', | ||
| 152 | + couponType: '优惠券类型', | ||
| 153 | + couponName: '优惠券名称', | ||
| 154 | + state: '券状态', | ||
| 155 | + selectState: '请选择券状态', | ||
| 156 | + stateOff: '下架', | ||
| 157 | + stateOn: '正常', | ||
| 158 | + actualPrice: '面值', | ||
| 159 | + buyPrice: '购买价格', | ||
| 160 | + couponStock: '数量', | ||
| 161 | + validityDay: '有效期', | ||
| 162 | + seq: '排序', | ||
| 163 | + cancel: '取消', | ||
| 164 | + save: '保存', | ||
| 165 | + success: '修改成功', | ||
| 166 | + error: '修改失败', | ||
| 167 | + buyPriceRequired: '购买价格不能为空', | ||
| 168 | + buyPriceMaxLength: '购买价格不能超过10', | ||
| 169 | + couponStockRequired: '数量不能为空', | ||
| 170 | + couponStockMaxLength: '数量不能超过20', | ||
| 171 | + stateRequired: '券状态不能为空' | ||
| 172 | + }, | ||
| 173 | + delete: { | ||
| 174 | + title: '请确认您的操作', | ||
| 175 | + confirm: '确定删除优惠券', | ||
| 176 | + cancel: '点错了', | ||
| 177 | + confirmDelete: '确认删除', | ||
| 178 | + success: '删除成功', | ||
| 179 | + error: '删除失败' | ||
| 180 | + }, | ||
| 181 | + fetchError: '获取优惠券池数据失败' | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | +} | ||
| 0 | \ No newline at end of file | 185 | \ No newline at end of file |
src/views/account/couponPoolManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="coupon-pool-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="clearfix text-left"> | ||
| 6 | + <span>{{ $t('couponPoolManage.search.title') }}</span> | ||
| 7 | + </div> | ||
| 8 | + <el-row :gutter="20" class="padding-bottom"> | ||
| 9 | + <el-col :span="4"> | ||
| 10 | + <el-input v-model="searchForm.couponName" :placeholder="$t('couponPoolManage.search.couponName')" clearable | ||
| 11 | + @keyup.enter.native="handleSearch" /> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="4"> | ||
| 14 | + <el-input v-model="searchForm.validityDay" :placeholder="$t('couponPoolManage.search.validityDay')" clearable | ||
| 15 | + @keyup.enter.native="handleSearch" /> | ||
| 16 | + </el-col> | ||
| 17 | + </el-row> | ||
| 18 | + </el-card> | ||
| 19 | + | ||
| 20 | + <!-- 优惠券池信息 --> | ||
| 21 | + <el-card class="list-wrapper"> | ||
| 22 | + <div slot="header" class="clearfix flex justify-between"> | ||
| 23 | + <span>{{ $t('couponPoolManage.list.title') }}</span> | ||
| 24 | + <el-button type="primary" size="small" style="float: right" @click="handleAdd"> | ||
| 25 | + {{ $t('couponPoolManage.list.create') }} | ||
| 26 | + </el-button> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | ||
| 30 | + <el-table-column prop="poolId" :label="$t('couponPoolManage.table.poolId')" align="center" /> | ||
| 31 | + <el-table-column prop="couponTypeName" :label="$t('couponPoolManage.table.couponType')" align="center" /> | ||
| 32 | + <el-table-column prop="couponName" :label="$t('couponPoolManage.table.couponName')" align="center" /> | ||
| 33 | + <el-table-column prop="actualPrice" :label="$t('couponPoolManage.table.actualPrice')" align="center" /> | ||
| 34 | + <el-table-column prop="buyPrice" :label="$t('couponPoolManage.table.buyPrice')" align="center" /> | ||
| 35 | + <el-table-column prop="couponStock" :label="$t('couponPoolManage.table.couponStock')" align="center" /> | ||
| 36 | + <el-table-column prop="validityDay" :label="$t('couponPoolManage.table.validityDay')" align="center" /> | ||
| 37 | + <el-table-column prop="seq" :label="$t('couponPoolManage.table.seq')" align="center" /> | ||
| 38 | + <el-table-column :label="$t('couponPoolManage.table.operation')" align="center" width="150"> | ||
| 39 | + <template slot-scope="scope"> | ||
| 40 | + <el-button size="mini" type="primary" @click="handleEdit(scope.row)"> | ||
| 41 | + {{ $t('couponPoolManage.table.edit') }} | ||
| 42 | + </el-button> | ||
| 43 | + </template> | ||
| 44 | + </el-table-column> | ||
| 45 | + </el-table> | ||
| 46 | + | ||
| 47 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 48 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 49 | + @current-change="handleCurrentChange" /> | ||
| 50 | + </el-card> | ||
| 51 | + | ||
| 52 | + <add-coupon-pool ref="addCouponPool" @success="handleSuccess" /> | ||
| 53 | + <edit-coupon-pool ref="editCouponPool" @success="handleSuccess" /> | ||
| 54 | + <delete-coupon-pool ref="deleteCouponPool" @success="handleSuccess" /> | ||
| 55 | + </div> | ||
| 56 | +</template> | ||
| 57 | + | ||
| 58 | +<script> | ||
| 59 | +import { listCouponPool } from '@/api/account/couponPoolManageApi' | ||
| 60 | +import AddCouponPool from '@/components/account/AddCouponPool' | ||
| 61 | +import EditCouponPool from '@/components/account/EditCouponPool' | ||
| 62 | +import DeleteCouponPool from '@/components/account/DeleteCouponPool' | ||
| 63 | + | ||
| 64 | +export default { | ||
| 65 | + name: 'CouponPoolManageList', | ||
| 66 | + components: { | ||
| 67 | + AddCouponPool, | ||
| 68 | + EditCouponPool, | ||
| 69 | + DeleteCouponPool | ||
| 70 | + }, | ||
| 71 | + data() { | ||
| 72 | + return { | ||
| 73 | + loading: false, | ||
| 74 | + searchForm: { | ||
| 75 | + couponName: '', | ||
| 76 | + validityDay: '' | ||
| 77 | + }, | ||
| 78 | + tableData: [], | ||
| 79 | + page: { | ||
| 80 | + current: 1, | ||
| 81 | + size: 10, | ||
| 82 | + total: 0 | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + }, | ||
| 86 | + created() { | ||
| 87 | + this.getList() | ||
| 88 | + }, | ||
| 89 | + methods: { | ||
| 90 | + async getList() { | ||
| 91 | + try { | ||
| 92 | + this.loading = true | ||
| 93 | + const params = { | ||
| 94 | + page: this.page.current, | ||
| 95 | + row: this.page.size, | ||
| 96 | + ...this.searchForm | ||
| 97 | + } | ||
| 98 | + const { data, total } = await listCouponPool(params) | ||
| 99 | + this.tableData = data | ||
| 100 | + this.page.total = total | ||
| 101 | + } catch (error) { | ||
| 102 | + this.$message.error(this.$t('couponPoolManage.fetchError')) | ||
| 103 | + } finally { | ||
| 104 | + this.loading = false | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + handleSearch() { | ||
| 108 | + this.page.current = 1 | ||
| 109 | + this.getList() | ||
| 110 | + }, | ||
| 111 | + handleAdd() { | ||
| 112 | + this.$refs.addCouponPool.open() | ||
| 113 | + }, | ||
| 114 | + handleEdit(row) { | ||
| 115 | + this.$refs.editCouponPool.open(row) | ||
| 116 | + }, | ||
| 117 | + handleDelete(row) { | ||
| 118 | + this.$refs.deleteCouponPool.open(row) | ||
| 119 | + }, | ||
| 120 | + handleSuccess() { | ||
| 121 | + this.getList() | ||
| 122 | + }, | ||
| 123 | + handleSizeChange(val) { | ||
| 124 | + this.page.size = val | ||
| 125 | + this.getList() | ||
| 126 | + }, | ||
| 127 | + handleCurrentChange(val) { | ||
| 128 | + this.page.current = val | ||
| 129 | + this.getList() | ||
| 130 | + } | ||
| 131 | + } | ||
| 132 | +} | ||
| 133 | +</script> | ||
| 134 | + | ||
| 135 | +<style lang="scss" scoped> | ||
| 136 | +.coupon-pool-manage-container { | ||
| 137 | + padding: 20px; | ||
| 138 | + | ||
| 139 | + .search-wrapper { | ||
| 140 | + margin-bottom: 20px; | ||
| 141 | + | ||
| 142 | + .el-row { | ||
| 143 | + margin-bottom: -20px; | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + .list-wrapper { | ||
| 148 | + .el-pagination { | ||
| 149 | + margin-top: 20px; | ||
| 150 | + text-align: right; | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | +} | ||
| 154 | +</style> | ||
| 0 | \ No newline at end of file | 155 | \ No newline at end of file |
src/views/mall/junkRequirementManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + junkRequirement: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + classification: 'Please select classification', | ||
| 7 | + publishUserName: 'Please enter publisher name', | ||
| 8 | + publishUserLink: 'Please enter contact information', | ||
| 9 | + state: 'Please select state' | ||
| 10 | + }, | ||
| 11 | + list: { | ||
| 12 | + title: 'Junk Information' | ||
| 13 | + }, | ||
| 14 | + table: { | ||
| 15 | + junkRequirementId: 'Code', | ||
| 16 | + classification: 'Classification', | ||
| 17 | + referencePrice: 'Reference Price', | ||
| 18 | + publishUserName: 'Publisher', | ||
| 19 | + publishUserLink: 'Contact', | ||
| 20 | + state: 'State' | ||
| 21 | + }, | ||
| 22 | + edit: { | ||
| 23 | + title: 'Edit Junk', | ||
| 24 | + classification: 'Classification', | ||
| 25 | + context: 'Content', | ||
| 26 | + referencePrice: 'Reference Price', | ||
| 27 | + publishUserName: 'Publisher', | ||
| 28 | + publishUserLink: 'Contact', | ||
| 29 | + state: 'State', | ||
| 30 | + stateRequired: 'State is required', | ||
| 31 | + success: 'Review successful', | ||
| 32 | + error: 'Review failed' | ||
| 33 | + }, | ||
| 34 | + delete: { | ||
| 35 | + title: 'Confirm Operation', | ||
| 36 | + confirm: 'Are you sure to delete this junk?', | ||
| 37 | + success: 'Delete successful', | ||
| 38 | + error: 'Delete failed' | ||
| 39 | + }, | ||
| 40 | + classification: { | ||
| 41 | + furniture: 'Furniture', | ||
| 42 | + appliance: 'Appliance' | ||
| 43 | + }, | ||
| 44 | + state: { | ||
| 45 | + unreviewed: 'Unreviewed', | ||
| 46 | + reviewed: 'Reviewed', | ||
| 47 | + reviewFailed: 'Review Failed', | ||
| 48 | + completed: 'Completed' | ||
| 49 | + }, | ||
| 50 | + fetchError: 'Failed to fetch junk requirements' | ||
| 51 | + }, | ||
| 52 | + common: { | ||
| 53 | + search: 'Search', | ||
| 54 | + hide: 'Hide', | ||
| 55 | + more: 'More', | ||
| 56 | + review: 'Review', | ||
| 57 | + cancel: 'Cancel', | ||
| 58 | + confirm: 'Confirm', | ||
| 59 | + delete: 'Delete', | ||
| 60 | + operation: 'Operation', | ||
| 61 | + success: 'Success', | ||
| 62 | + error: 'Error' | ||
| 63 | + } | ||
| 64 | + }, | ||
| 65 | + zh: { | ||
| 66 | + junkRequirement: { | ||
| 67 | + search: { | ||
| 68 | + title: '查询条件', | ||
| 69 | + classification: '请选择类别', | ||
| 70 | + publishUserName: '请输入发布人', | ||
| 71 | + publishUserLink: '请输入联系方式', | ||
| 72 | + state: '请选择状态' | ||
| 73 | + }, | ||
| 74 | + list: { | ||
| 75 | + title: '旧货信息' | ||
| 76 | + }, | ||
| 77 | + table: { | ||
| 78 | + junkRequirementId: '编码', | ||
| 79 | + classification: '类别', | ||
| 80 | + referencePrice: '参考价格', | ||
| 81 | + publishUserName: '发布人', | ||
| 82 | + publishUserLink: '联系方式', | ||
| 83 | + state: '状态' | ||
| 84 | + }, | ||
| 85 | + edit: { | ||
| 86 | + title: '修改旧货', | ||
| 87 | + classification: '类别', | ||
| 88 | + context: '内容', | ||
| 89 | + referencePrice: '参考价格', | ||
| 90 | + publishUserName: '发布人', | ||
| 91 | + publishUserLink: '联系方式', | ||
| 92 | + state: '状态', | ||
| 93 | + stateRequired: '状态不能为空', | ||
| 94 | + success: '审核成功', | ||
| 95 | + error: '审核失败' | ||
| 96 | + }, | ||
| 97 | + delete: { | ||
| 98 | + title: '请确认您的操作', | ||
| 99 | + confirm: '确定删除旧货吗?', | ||
| 100 | + success: '删除成功', | ||
| 101 | + error: '删除失败' | ||
| 102 | + }, | ||
| 103 | + classification: { | ||
| 104 | + furniture: '家具', | ||
| 105 | + appliance: '电器' | ||
| 106 | + }, | ||
| 107 | + state: { | ||
| 108 | + unreviewed: '未审核', | ||
| 109 | + reviewed: '审核通过', | ||
| 110 | + reviewFailed: '审核失败', | ||
| 111 | + completed: '处理完成' | ||
| 112 | + }, | ||
| 113 | + fetchError: '获取旧货需求失败' | ||
| 114 | + }, | ||
| 115 | + common: { | ||
| 116 | + search: '查询', | ||
| 117 | + hide: '隐藏', | ||
| 118 | + more: '更多', | ||
| 119 | + review: '审核', | ||
| 120 | + cancel: '取消', | ||
| 121 | + confirm: '确认', | ||
| 122 | + delete: '删除', | ||
| 123 | + operation: '操作', | ||
| 124 | + success: '成功', | ||
| 125 | + error: '错误' | ||
| 126 | + } | ||
| 127 | + } | ||
| 128 | +} | ||
| 0 | \ No newline at end of file | 129 | \ No newline at end of file |
src/views/mall/junkRequirementManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="junk-requirement-container"> | ||
| 3 | + <!-- Search Conditions --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="clearfix flex justify-between"> | ||
| 6 | + <span>{{ $t('junkRequirement.search.title') }}</span> | ||
| 7 | + <el-button style="float: right; padding: 3px 0" type="text" @click="_moreCondition"> | ||
| 8 | + {{ junkRequirementManageInfo.moreCondition ? $t('common.hide') : $t('common.more') }} | ||
| 9 | + </el-button> | ||
| 10 | + </div> | ||
| 11 | + <el-row :gutter="20"> | ||
| 12 | + <el-col :span="6"> | ||
| 13 | + <el-select v-model="junkRequirementManageInfo.conditions.classification" | ||
| 14 | + :placeholder="$t('junkRequirement.search.classification')" clearable class="search-item"> | ||
| 15 | + <el-option v-for="item in classificationOptions" :key="item.value" :label="item.label" :value="item.value" /> | ||
| 16 | + </el-select> | ||
| 17 | + </el-col> | ||
| 18 | + <el-col :span="6"> | ||
| 19 | + <el-input v-model="junkRequirementManageInfo.conditions.publishUserName" | ||
| 20 | + :placeholder="$t('junkRequirement.search.publishUserName')" clearable class="search-item" /> | ||
| 21 | + </el-col> | ||
| 22 | + <el-col :span="6"> | ||
| 23 | + <el-select v-model="junkRequirementManageInfo.conditions.publishUserLink" | ||
| 24 | + :placeholder="$t('junkRequirement.search.state')" clearable class="search-item"> | ||
| 25 | + <el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value" /> | ||
| 26 | + </el-select> | ||
| 27 | + </el-col> | ||
| 28 | + <el-col :span="6"> | ||
| 29 | + <el-button type="primary" @click="_queryJunkRequirementMethod"> | ||
| 30 | + <i class="el-icon-search"></i> | ||
| 31 | + {{ $t('common.search') }} | ||
| 32 | + </el-button> | ||
| 33 | + </el-col> | ||
| 34 | + </el-row> | ||
| 35 | + <el-row v-if="junkRequirementManageInfo.moreCondition" :gutter="20"> | ||
| 36 | + <el-col :span="6"> | ||
| 37 | + <el-input v-model="junkRequirementManageInfo.conditions.publishUserLink" | ||
| 38 | + :placeholder="$t('junkRequirement.search.publishUserLink')" clearable class="search-item" /> | ||
| 39 | + </el-col> | ||
| 40 | + </el-row> | ||
| 41 | + </el-card> | ||
| 42 | + | ||
| 43 | + <!-- List Table --> | ||
| 44 | + <el-card class="list-wrapper"> | ||
| 45 | + <div slot="header" class="clearfix flex justify-between"> | ||
| 46 | + <span>{{ $t('junkRequirement.list.title') }}</span> | ||
| 47 | + </div> | ||
| 48 | + <el-table v-loading="loading" :data="junkRequirementManageInfo.junkRequirements" border style="width: 100%"> | ||
| 49 | + <el-table-column prop="junkRequirementId" :label="$t('junkRequirement.table.junkRequirementId')" align="center" /> | ||
| 50 | + <el-table-column prop="classification" :label="$t('junkRequirement.table.classification')" align="center" /> | ||
| 51 | + <el-table-column prop="referencePrice" :label="$t('junkRequirement.table.referencePrice')" align="center" /> | ||
| 52 | + <el-table-column prop="publishUserName" :label="$t('junkRequirement.table.publishUserName')" align="center" /> | ||
| 53 | + <el-table-column prop="publishUserLink" :label="$t('junkRequirement.table.publishUserLink')" align="center" /> | ||
| 54 | + <el-table-column prop="stateName" :label="$t('junkRequirement.table.state')" align="center" /> | ||
| 55 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | ||
| 56 | + <template slot-scope="scope"> | ||
| 57 | + <el-button size="mini" type="primary" @click="_openEditJunkRequirementModel(scope.row)"> | ||
| 58 | + {{ $t('common.review') }} | ||
| 59 | + </el-button> | ||
| 60 | + <el-button size="mini" type="danger" @click="_openDeleteJunkRequirementModel(scope.row)"> | ||
| 61 | + {{ $t('common.delete') }} | ||
| 62 | + </el-button> | ||
| 63 | + </template> | ||
| 64 | + </el-table-column> | ||
| 65 | + </el-table> | ||
| 66 | + | ||
| 67 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 68 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 69 | + @current-change="handleCurrentChange" /> | ||
| 70 | + </el-card> | ||
| 71 | + | ||
| 72 | + <edit-junk-requirement ref="editJunkRequirement" @success="handleSuccess" /> | ||
| 73 | + <delete-junk-requirement ref="deleteJunkRequirement" @success="handleSuccess" /> | ||
| 74 | + </div> | ||
| 75 | +</template> | ||
| 76 | + | ||
| 77 | +<script> | ||
| 78 | +import { | ||
| 79 | + listJunkRequirements | ||
| 80 | +} from '@/api/mall/junkRequirementManageApi' | ||
| 81 | +import EditJunkRequirement from '@/components/mall/EditJunkRequirement' | ||
| 82 | +import DeleteJunkRequirement from '@/components/mall/DeleteJunkRequirement' | ||
| 83 | + | ||
| 84 | +export default { | ||
| 85 | + name: 'JunkRequirementManageList', | ||
| 86 | + components: { | ||
| 87 | + EditJunkRequirement, | ||
| 88 | + DeleteJunkRequirement | ||
| 89 | + }, | ||
| 90 | + data() { | ||
| 91 | + return { | ||
| 92 | + loading: false, | ||
| 93 | + junkRequirementManageInfo: { | ||
| 94 | + junkRequirements: [], | ||
| 95 | + moreCondition: false, | ||
| 96 | + pageName: 'Junk', | ||
| 97 | + conditions: { | ||
| 98 | + classification: '', | ||
| 99 | + publishUserName: '', | ||
| 100 | + publishUserLink: '', | ||
| 101 | + typeCd: '222222' | ||
| 102 | + } | ||
| 103 | + }, | ||
| 104 | + page: { | ||
| 105 | + current: 1, | ||
| 106 | + size: 10, | ||
| 107 | + total: 0 | ||
| 108 | + }, | ||
| 109 | + classificationOptions: [ | ||
| 110 | + { value: '10001', label: this.$t('junkRequirement.classification.furniture') }, | ||
| 111 | + { value: '10002', label: this.$t('junkRequirement.classification.appliance') } | ||
| 112 | + ], | ||
| 113 | + stateOptions: [ | ||
| 114 | + { value: '12001', label: this.$t('junkRequirement.state.unreviewed') }, | ||
| 115 | + { value: '13001', label: this.$t('junkRequirement.state.reviewed') }, | ||
| 116 | + { value: '14001', label: this.$t('junkRequirement.state.reviewFailed') }, | ||
| 117 | + { value: '15001', label: this.$t('junkRequirement.state.completed') } | ||
| 118 | + ] | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | + created() { | ||
| 122 | + this._listJunkRequirements(this.page.current, this.page.size) | ||
| 123 | + this.junkRequirementManageInfo.conditions.typeCd = this.$route.query.typeCd | ||
| 124 | + if (this.$route.query.typeCd === '333333') { | ||
| 125 | + this.junkRequirementManageInfo.pageName = 'Requirement' | ||
| 126 | + } else { | ||
| 127 | + this.junkRequirementManageInfo.pageName = 'Junk' | ||
| 128 | + } | ||
| 129 | + }, | ||
| 130 | + methods: { | ||
| 131 | + async _listJunkRequirements(page, size) { | ||
| 132 | + try { | ||
| 133 | + this.loading = true | ||
| 134 | + const params = { | ||
| 135 | + page: page, | ||
| 136 | + row: size, | ||
| 137 | + ...this.junkRequirementManageInfo.conditions, | ||
| 138 | + communityId: this.$store.getters.communityId | ||
| 139 | + } | ||
| 140 | + const { data, total } = await listJunkRequirements(params) | ||
| 141 | + this.junkRequirementManageInfo.junkRequirements = data | ||
| 142 | + this.page.total = total | ||
| 143 | + } catch (error) { | ||
| 144 | + this.$message.error(this.$t('junkRequirement.fetchError')) | ||
| 145 | + } finally { | ||
| 146 | + this.loading = false | ||
| 147 | + } | ||
| 148 | + }, | ||
| 149 | + _openEditJunkRequirementModel(row) { | ||
| 150 | + this.$refs.editJunkRequirement.open(row) | ||
| 151 | + }, | ||
| 152 | + _openDeleteJunkRequirementModel(row) { | ||
| 153 | + this.$refs.deleteJunkRequirement.open(row) | ||
| 154 | + }, | ||
| 155 | + _queryJunkRequirementMethod() { | ||
| 156 | + this.page.current = 1 | ||
| 157 | + this._listJunkRequirements(this.page.current, this.page.size) | ||
| 158 | + }, | ||
| 159 | + _moreCondition() { | ||
| 160 | + this.junkRequirementManageInfo.moreCondition = !this.junkRequirementManageInfo.moreCondition | ||
| 161 | + }, | ||
| 162 | + handleSuccess() { | ||
| 163 | + this._listJunkRequirements(this.page.current, this.page.size) | ||
| 164 | + }, | ||
| 165 | + handleSizeChange(val) { | ||
| 166 | + this.page.size = val | ||
| 167 | + this._listJunkRequirements(this.page.current, val) | ||
| 168 | + }, | ||
| 169 | + handleCurrentChange(val) { | ||
| 170 | + this.page.current = val | ||
| 171 | + this._listJunkRequirements(val, this.page.size) | ||
| 172 | + } | ||
| 173 | + } | ||
| 174 | +} | ||
| 175 | +</script> | ||
| 176 | + | ||
| 177 | +<style lang="scss" scoped> | ||
| 178 | +.junk-requirement-container { | ||
| 179 | + padding: 20px; | ||
| 180 | + | ||
| 181 | + .search-wrapper { | ||
| 182 | + margin-bottom: 20px; | ||
| 183 | + | ||
| 184 | + .search-item { | ||
| 185 | + width: 100%; | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + .list-wrapper { | ||
| 190 | + .el-pagination { | ||
| 191 | + margin-top: 20px; | ||
| 192 | + text-align: right; | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | +} | ||
| 196 | +</style> | ||
| 0 | \ No newline at end of file | 197 | \ No newline at end of file |