Commit 2989e1a9 by chenyu

update: add new storeSelector

parent 331ee0db
......@@ -23,6 +23,7 @@
<!-- 组件引用cdn -->
<script src="//web-1251519181.file.myqcloud.com/components/header.2.0.58.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/store-selector.1.0.3.js"></script>
<!-- <script src="//web-1251519181.file.myqcloud.com/components/card.2.0.19.js"></script>卡券选择器 -->
<script src="//web-1251519181.file.myqcloud.com/components/store.2.0.01.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js"></script>
......
......@@ -81,6 +81,7 @@ export default {
lowest_cost_count: '',
max_cost_count: '',
// store_mode: 0,
consumerStoreType: 0, // 0 固定门店 1 门店条件
order_store: '',
storedLowest: 0,
storedMax: 0
......@@ -459,13 +460,14 @@ export default {
// 处理消费触发
if (consumTrigger) {
// 触发门店初始化
if (this.form.effectAction === 'consume' && consumTrigger.store_mode) {
this.consumeChecked.store = Boolean(consumTrigger.store_mode) || false; /** 门店类型: 0: 所有门店, 1: 部分(包含部分门店, 部分分组等) **/
this.form.consumerStoreType = result.consumerStoreType || 0; /** 消费门店类型 **/
this.form.order_store = consumTrigger.order_store || ''; /** 消费门店key值 **/
if (this.form.effectAction === 'consume' && consumTrigger.store_mode && result.consumerStoreType === 0) {
this.$nextTick(_ => {
this.$refs.storeCard.init();
});
}
this.consumeChecked.store = Boolean(consumTrigger.store_mode) || false; /** 门店类型: 0: 所有门店, 1: 部分(包含部分门店, 部分分组等) **/
this.form.order_store = consumTrigger.order_store || ''; /** 消费门店key值 **/
// 消费商品
if (res.result.goodsEnable && consumTrigger.goods_filter_id) {
this.xxSysp.goodsFilterId = consumTrigger.goods_filter_id || '';
......@@ -727,9 +729,9 @@ export default {
if (this.form.effectAction === 'consume') {
// 这里判断部分门店是否为空
if (this.consumeChecked.store && this.consumeChecked.store) {
let data = await this.$refs.storeCard.getRightList();
let data = this.form.consumerStoreType === 1 ? await this.$refs.newStoreCard.getList() : await this.$refs.storeCard.getRightList();
if (!data.length) {
this.$tips({ type: 'warning', message: '部分门店不能为空' });
this.$tips({ type: 'warning', message: '门店不能为空' });
return;
}
}
......@@ -873,6 +875,7 @@ export default {
// 门店
let consumeObj = {
store_mode: this.consumeChecked.store ? 1 : 0,
consumerStoreType: this.form.consumerStoreType,
order_store: this.consumeChecked.store ? this.form.order_store : ''
};
// 勾选消费金额 --不填代表没有上下限,不传该字段
......
......@@ -111,7 +111,15 @@
<el-checkbox class="el-form-item__label align-left" :disabled="!isAdd" v-model="consumeChecked.store" @change="initStoreCardLeft">消费门店</el-checkbox>
<div>
<span class="fz14 gray" v-show="!consumeChecked.store">所有消费门店</span>
<vue-gic-store-card v-bind="storeParams" :readonly="!isAdd" v-show="consumeChecked.store" ref="storeCard" :uuid.sync="form.order_store"></vue-gic-store-card>
<!-- <template v-if="true"> -->
<el-radio-group :disabled="!isAdd" v-show="consumeChecked.store" v-model="form.consumerStoreType">
<el-radio :label="0">固定门店</el-radio>
<el-radio :label="1">按门店条件</el-radio>
</el-radio-group>
<dm-store-selector style="margin:20px 0 0 35px" v-if="form.consumerStoreType === 1" ref="newStoreCard" :uuid.sync="form.order_store"></dm-store-selector>
<vue-gic-store-card style="margin:20px 0 0 35px" v-if="form.consumerStoreType === 0" v-bind="storeParams" :readonly="!isAdd" ref="storeCard" :uuid.sync="form.order_store"></vue-gic-store-card>
<!-- </template>
<vue-gic-store-card v-else-if="consumeChecked.store" v-bind="storeParams" :readonly="!isAdd" ref="storeCard" :uuid.sync="form.order_store"></vue-gic-store-card> -->
</div>
</div>
</el-form-item>
......
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