| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="box" style="max-height:calc(100% - 60px);margin-bottom:50px;overflow-y: auto" > |
| | | <el-form :model="form" ref="form"> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã1ãæ³¨åå¥å±</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="积åå¥å±" label-width="150px" prop="regIntegralRewardStatus"> |
| | | <el-switch v-model="form.regIntegralRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="æ°äººæ³¨åé" label-width="250px" prop="regIntegralReward"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.regIntegralReward" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">积å</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="伿 å¸å¥å±" label-width="150px" prop="regCouponRewardStatus"> |
| | | <el-switch v-model="form.regCouponRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <div > |
| | | <el-form-item label="æ°äººæ³¨åé伿 å¸" label-width="250px" prop="regCouponRewardList"> |
| | | </el-form-item> |
| | | <div style="margin-left: 150px;border: 1px solid #f2f2f2"> |
| | | <el-table style="width: 600px;" :data="form.regCouponRewardList"> |
| | | <el-table-column prop="shopPrice" label="伿 å¸" min-width="300px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-select v-model="row.couponId" style="width: 200px;margin: 0px 20px" clearable filterable placeholder="è¯·éæ©ä¼æ å¸" > |
| | | <el-option v-for="item in couponList" :label="item.name" :value="item.id"> </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="num" label="æ°é" min-width="200px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-input style="width: 100px;margin: 0px 20px" type="number" v-model="row.num" placeholder="请è¾å
¥æ°é" v-trim/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100px" align="center"> |
| | | <template slot-scope="scope" > |
| | | <el-button style="color: red;border: none;" @click="delCoupon(0,scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button s type="primary" icon="el-icon-plus" @click="addCoupon(0)" style="height: 30px;margin: 10px;">æ·»å </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã2ãé请好åå¥å±</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="积åå¥å±" label-width="150px" prop="shareIntegralRewardStatus"> |
| | | <el-switch v-model="form.shareIntegralRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="好åæå注åéé请人" label-width="250px" prop="shareIntegralReward"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.shareIntegralReward" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">积å</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="伿 å¸å¥å±" label-width="150px" prop="shareCouponRewardStatus"> |
| | | <el-switch v-model="form.shareCouponRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <div > |
| | | <el-form-item label="好å宿é¦åééè¯·äººä¼æ å¸" label-width="250px" prop="shareCouponRewardList"> |
| | | </el-form-item> |
| | | <div style="margin-left: 150px;border: 1px solid #f2f2f2"> |
| | | <el-table style="width: 600px;" :data="form.shareCouponRewardList"> |
| | | <el-table-column prop="couponId" label="伿 å¸" min-width="300px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-select v-model="row.couponId" style="width: 200px;margin: 0px 20px" clearable filterable placeholder="è¯·éæ©ä¼æ å¸" > |
| | | <el-option v-for="item in couponList" :label="item.name" :value="item.id"> </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="num" label="æ°é" min-width="200px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-input style="width: 100px;margin: 0px 20px" type="number" v-model="row.num" placeholder="请è¾å
¥æ°é" v-trim/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100px" align="center"> |
| | | <template slot-scope="scope" > |
| | | <el-button style="color: red;border: none;" @click="delCoupon(1,scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button s type="primary" icon="el-icon-plus" @click="addCoupon(1)" style="height: 30px;margin: 10px;">æ·»å </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã3ãæ¶è´¹è¿ç§¯å</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="è¿ç¨æ·ç§¯å" label-width="150px" prop="returnMemberIntegralStatus"> |
| | | <el-switch v-model="form.returnMemberIntegralStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="订åå®ä»é颿¯æ»¡" label-width="250px" prop="returnMemberIntegral"> |
| | | <el-input style="width: 250px;margin: 0px 20px" type="number" v-model="form.returnMemberIntegral" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">å
è¿ç¨æ·1积å</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼å®ä»éé¢å»é¤è¿è´¹</p> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="è¿ç»éå积å" label-width="150px" prop="returnShopIntegralStatus"> |
| | | <el-switch v-model="form.returnShopIntegralStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="订åå®ä»é颿¯æ»¡" label-width="250px" prop="returnShopIntegral"> |
| | | <el-input style="width: 250px;margin: 0px 20px" type="number" v-model="form.returnShopIntegral" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">å
è¿ç»éå1积å</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼å®ä»éé¢å»é¤è¿è´¹</p> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã4ãåè®¡ä¼æ æ¿æ
æ¯ä¾</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="æ»é¨æ¿æ
" label-width="150px" prop="totalRate"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.totalRate" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼è®¾ç½®æ»é¨åç»éåå¨è®¢ååè®¡ä¼æ éé¢ä¸ï¼ä¼æ å¸+ç§¯åæµæ£ï¼åèªæ¿æ
çæ¯ä¾</p> |
| | | </el-form-item> |
| | | </div> |
| | | <el-form-item style="margin-top: 100px;width: 100%;text-align: center"> |
| | | <el-button type="primary" style="width: 300px" :loading="working" @click="submit">ä¿åé
置项</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getPlatformConfig, updPlatformConfig } from '@/api/system/dictData' |
| | | import { allList } from '@/api/business/coupon' |
| | | export default { |
| | | name: '', |
| | | data () { |
| | | return { |
| | | uploadData: { |
| | | folder: '' |
| | | }, |
| | | isUploading: false, |
| | | working: false, |
| | | couponList: [], |
| | | form: { |
| | | dictCode: 'ORDER_SET', |
| | | regIntegralRewardStatus: 0, |
| | | shareIntegralRewardStatus: 0, |
| | | regCouponRewardStatus: 0, |
| | | shareCouponRewardStatus: 0, |
| | | regIntegralReward: 0, |
| | | shareIntegralReward: 0, |
| | | regCouponRewardList: [], |
| | | shareCouponRewardList: [], |
| | | returnMemberIntegralStatus: 0, |
| | | returnShopIntegralStatus: 0, |
| | | returnMemberIntegral: 0, |
| | | returnShopIntegral: 0, |
| | | totalRate: 0 |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | this.getCouponList() |
| | | this.getData() |
| | | }, |
| | | |
| | | methods: { |
| | | getCouponList () { |
| | | allList({}) |
| | | .then(res => { |
| | | if (res) { |
| | | this.couponList = res || [] |
| | | } |
| | | }) |
| | | }, |
| | | delCoupon (type, index) { |
| | | if (type === 0) { |
| | | this.form.regCouponRewardList.splice(index, 1) |
| | | } else if (type === 1) { |
| | | this.form.shareCouponRewardList.splice(index, 1) |
| | | } |
| | | }, |
| | | addCoupon (type) { |
| | | if (type === 0) { |
| | | this.form.regCouponRewardList.push({ couponId: null, num: null }) |
| | | } else if (type === 1) { |
| | | this.form.shareCouponRewardList.push({ couponId: null, num: null }) |
| | | } |
| | | }, |
| | | getData () { |
| | | getPlatformConfig({}) |
| | | .then(res => { |
| | | if (res) { |
| | | this.form = { |
| | | dictCode: 'ORDER_SET', |
| | | regIntegralRewardStatus: res.regIntegralRewardStatus || 0, |
| | | shareIntegralRewardStatus: res.shareIntegralRewardStatus || 0, |
| | | regCouponRewardStatus: res.regCouponRewardStatus || 0, |
| | | shareCouponRewardStatus: res.shareCouponRewardStatus || 0, |
| | | regIntegralReward: res.regIntegralReward || 0, |
| | | shareIntegralReward: res.shareIntegralReward || 0, |
| | | regCouponRewardList: res.regCouponRewardList || [], |
| | | shareCouponRewardList: res.shareCouponRewardList || [], |
| | | returnMemberIntegralStatus: res.returnMemberIntegralStatus || 0, |
| | | returnShopIntegralStatus: res.returnShopIntegralStatus || 0, |
| | | returnMemberIntegral: res.returnMemberIntegral || 0, |
| | | returnShopIntegral: res.returnShopIntegral || 0, |
| | | totalRate: res.totalRate || 0 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | submit () { |
| | | console.log(this.form) |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | this.isWorking = true |
| | | updPlatformConfig(this.form).then(res => { |
| | | this.$message.success('ä¿åæå') |
| | | this.getData() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .el-container /deep/ .el-main{ |
| | | width: 100%; |
| | | overflow-y: auto !important ; |
| | | height: calc(100% - 94px); |
| | | } |
| | | .item-content{ |
| | | display: flex; |
| | | width: 100%; |
| | | } |
| | | .header{ |
| | | margin: 20px 0 20px 0;padding:10px;background-color: #E0DEDE; |
| | | } |
| | | /deep/ .el-main{ |
| | | width: 100%; |
| | | //height: 100%; |
| | | overflow-y: auto !important ; |
| | | height: calc(100% - 94px); |
| | | } |
| | | .box { |
| | | width: 100%; |
| | | padding: 0 30px; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | | } |
| | | </style> |