Commit 8a7e6896 authored by 邓春圆's avatar 邓春圆

添加优惠活动

parent c464a206
...@@ -78,4 +78,11 @@ export function calculationPrice(data){ ...@@ -78,4 +78,11 @@ export function calculationPrice(data){
method: 'post', method: 'post',
data: data data: data
}) })
} }
\ No newline at end of file //新增商品可用优惠信息列表
export function product_coupon_newProd(){
return request({
url:'/product/coupon/newProd/list',
method:'get',
})
}
...@@ -106,9 +106,9 @@ ...@@ -106,9 +106,9 @@
<el-table-column :label="$t('修改时间')" align="center"> <el-table-column :label="$t('修改时间')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{parseTime(scope.row.updateTime)}}</span> <span>{{parseTime(scope.row.updateTime)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="status" align="center" :label="$t('状态')" width="120"> <!-- <el-table-column prop="status" align="center" :label="$t('状态')" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -206,11 +206,24 @@ ...@@ -206,11 +206,24 @@
<el-radio v-model.number="form.needBook" :label="1">{{$t('是')}}</el-radio> <el-radio v-model.number="form.needBook" :label="1">{{$t('是')}}</el-radio>
<el-radio v-model.number="form.needBook" :label="0">{{$t('否')}}</el-radio> <el-radio v-model.number="form.needBook" :label="0">{{$t('否')}}</el-radio>
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('可参与优惠活动')" prop="you"> <el-form-item v-if="this.form.id == null " :label="$t('可参与优惠')">
<el-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable> <!-- <el-select multiple v-model="form.couponlds" size="5" style="min-width: 300px; border:1px solid #DCDFE6; border-radius:4px">-->
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" /> <!-- <el-option v-for="item in preferentialList" :value="item.couponId" :label="item.titleZh" :key="item.couponId" :disabled="item.mandatory">{{item.titleZh}}</el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> --> <div style="width: 300px;height: 400px;border: 1px solid;overflow-y: auto">
<div @click="selectMoveAbout(item)" style="display: flex;justify-content: space-between; align-items: center;" :style="{'cursor':item.mandatory ? 'no-drop' : 'pointer' }" v-for="item in preferentialList">
<div>
{{$l(item, 'title')}}
</div>
<i v-if="form.couponIds.includes(item.couponId)" style="margin-right: 20px;" class="el-icon-check"></i>
</div>
</div>
</el-form-item>
<!-- <el-form-item :label="$t('可参与优惠活动')" prop="you">
<el-select v-model="form.you" :placeholder="$t('可参与优惠活动')" clearable>
<el-option v-for="packageItem in packagingList" :key="packageItem.value" :label="packageItem.label" :value="packageItem.value" />
</el-select>
</el-form-item> -->
<el-form-item :label="$t('每日入仓上限')" prop="dayLimit" v-if="form.needBook==1"> <el-form-item :label="$t('每日入仓上限')" prop="dayLimit" v-if="form.needBook==1">
<el-input v-model.number="form.dayLimit" type="number"> <el-input v-model.number="form.dayLimit" type="number">
<template slot="append">{{$t('立方米')}}</template> <template slot="append">{{$t('立方米')}}</template>
...@@ -227,7 +240,15 @@ ...@@ -227,7 +240,15 @@
</template> </template>
<script> <script>
import { createProduct, updateProduct, deleteProduct, getProduct, getProductPage, exportProductExcel } from "@/api/ecw/product"; import {
createProduct,
updateProduct,
deleteProduct,
getProduct,
getProductPage,
exportProductExcel,
product_coupon_newProd
} from "@/api/ecw/product";
import { getProductAttrList } from "@/api/ecw/productAttr"; import { getProductAttrList } from "@/api/ecw/productAttr";
import { getProductTypeList } from "@/api/ecw/productType"; import { getProductTypeList } from "@/api/ecw/productType";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
...@@ -305,7 +326,8 @@ export default { ...@@ -305,7 +326,8 @@ export default {
auditStatusDictDatas: getDictDatas(DICT_TYPE.AUDIT_STATUS), auditStatusDictDatas: getDictDatas(DICT_TYPE.AUDIT_STATUS),
materialList: getDictDatas(DICT_TYPE.ECW_PRODUCT_MATERIAL), materialList: getDictDatas(DICT_TYPE.ECW_PRODUCT_MATERIAL),
packagingList: getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE), packagingList: getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE),
locationList: getDictDatas(DICT_TYPE.ECW_CONTAINER_LOCATION) locationList: getDictDatas(DICT_TYPE.ECW_CONTAINER_LOCATION),
preferentialList:[],
}; };
}, },
...@@ -360,6 +382,10 @@ export default { ...@@ -360,6 +382,10 @@ export default {
this.getAttrList(); this.getAttrList();
this.getTypeList(); this.getTypeList();
this.getList(); this.getList();
product_coupon_newProd().then(r => {
this.preferentialList = r.data
this.reset()
})
}, },
methods: { methods: {
/** 获取产品属性列表 */ /** 获取产品属性列表 */
...@@ -433,8 +459,11 @@ export default { ...@@ -433,8 +459,11 @@ export default {
auditStatus: undefined, auditStatus: undefined,
status: undefined, status: undefined,
requirements: 0, requirements: 0,
needBook: 0 needBook: 0,
couponIds:[],
}; };
let c = this.preferentialList.filter(i => i.isDefault).map(i => i.couponId)
this.form.couponIds = c
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -485,7 +514,6 @@ export default { ...@@ -485,7 +514,6 @@ export default {
} }
//商品特性转字符串 //商品特性转字符串
this.form.attrId = this.form.attrArray.join(','); this.form.attrId = this.form.attrArray.join(',');
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
updateProduct(this.form).then(response => { updateProduct(this.form).then(response => {
...@@ -576,7 +604,21 @@ export default { ...@@ -576,7 +604,21 @@ export default {
ids: this.ids ids: this.ids
} }
}); });
},
selectMoveAbout(val){
if(!val.mandatory){
let index = this.form.couponIds.findIndex(i => val.couponId == i)
if(index >= 0){
this.form.couponIds.splice(index,1)
}else {
this.form.couponIds.push(val.couponId)
}
}
} }
} }
}; };
</script> </script>
<style lang="scss" scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment