Commit 4c7a1f5f by caoyanzhi

update: 奥莱抵金券

parent a35cdd77
......@@ -209,6 +209,7 @@ export const addStore = params => requests(PREFIX + 'save-write-off-store', para
export const setStraff = params => requests(PREFIX + 'save-write-off-staff', params);
// 查询手机号是否重复
export const searchRePhone = params => requests(PREFIX + 'check-write-off-staff', params);
export const getStoreByCode = params => requests('/api-plug/query-store-by-code-name-new', params);
export const getStoreWidgetStore = params => requests('/api-plug/get-store-widget-store', params);
export const importCostStore = params => requests('/api-marketing/import-cost-store', params, true);
......
......@@ -9,7 +9,7 @@ import sendPreview from './partials/send-preview';
import { formatDateTimeByType, deepClone, getTimesByReq } from '@/utils/index.js';
import xxSysp_mix from '@/mixins/selector.js'; // 商品选择器方法
import { listEntepriseWeimobShop, listEntepriseWeimobCoupon } from '@/service/api/commonApi.js';
import { getCardDetail, saveUpdateCard, copyCardDetailService, getCardManualSetting, getCategoryList, getPropertyList, getLatestReptileTime, getPropertyValueList, getWeimobCouponBindCount, getCardEffectiveMode, getStoreWidgetStore, importCostStore } from '@/service/api/cardApi.js';
import { getCardDetail, saveUpdateCard, copyCardDetailService, getCardManualSetting, getCategoryList, getPropertyList, getLatestReptileTime, getPropertyValueList, getWeimobCouponBindCount, getCardEffectiveMode, getStoreWidgetStore, getStoreByCode, importCostStore } from '@/service/api/cardApi.js';
import dmGoodsInput from '@/components/goods-input/index.vue';
import { getLinkResourceStatus } from '@/service/api/ecmApi.js';
import { RecycleScroller } from 'vue-virtual-scroller';
......@@ -445,23 +445,36 @@ export default {
}
},
onStoreChange(id) {
getStoreWidgetStore({ key: id, pageSize: 99999, currentPage: 1 }).then(res => {
const { result, errorCode } = res || {};
if (errorCode == 0 && Array.isArray(result.result)) {
this.selectedStoreList = result.result.map(el => {
const { storeId, storeCode, storeName } = el;
return { storeId, storeCode, storeName, costValueProportion: undefined, costValue: 0 };
});
if (this.isEdit) {
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this.selectedStoreList = this.selectedStoreList.filter(el => this.form.costStoreList.every(item => item.storeId != el.storeId));
this.originStoreList = [...this.selectedStoreList, ...this.form.costStoreList];
} else if (this.isAdd || this.isCopy) {
// 新建卡券时直接覆盖
this.originStoreList = this.selectedStoreList;
if (this.storeMode == 0) {
getStoreByCode({ key: this.storeUuid, isClique: 0, pageSize: 99999, currentPage: 1 }).then(res => {
const { result, errorCode } = res || {};
if (errorCode == 0 && Array.isArray(result.result)) {
this.selectedStoreList = result.result.map(el => {
const { storeId, storeCode, storeName } = el;
return { storeId, storeCode, storeName, costValueProportion: undefined, costValue: 0 };
});
}
}
});
this.originStoreList = this.selectedStoreList;
});
} else {
getStoreWidgetStore({ key: id, pageSize: 99999, currentPage: 1 }).then(res => {
const { result, errorCode } = res || {};
if (errorCode == 0 && Array.isArray(result.result)) {
this.selectedStoreList = result.result.map(el => {
const { storeId, storeCode, storeName } = el;
return { storeId, storeCode, storeName, costValueProportion: undefined, costValue: 0 };
});
if (this.isEdit) {
// 编辑卡券通过门店选择器添加门店时,需要先过滤掉已经选中的门店,再与form.costStoreList合并
this.selectedStoreList = this.selectedStoreList.filter(el => this.form.costStoreList.every(item => item.storeId != el.storeId));
this.originStoreList = [...this.selectedStoreList, ...this.form.costStoreList];
} else if (this.isAdd || this.isCopy) {
// 新建卡券时直接覆盖
this.originStoreList = this.selectedStoreList;
}
}
});
}
},
onSortStore(sortType) {
this.sortType = sortType;
......
......@@ -97,7 +97,7 @@
<i class="iconfont icon-QuestionCircleOutlined"></i>
</el-tooltip>
</div>
<dm-store-selector :uuid.sync="storeUuid" :options="[5]" :store-type-disabled="isEdit && form.costValueType == 0" @optionsChange="onOptionsChange" @store-change="onStoreChange"></dm-store-selector>
<dm-store-selector :uuid.sync="storeUuid" :default-all="false" :options="[5]" :store-type-disabled="isEdit && form.costValueType == 0" @optionsChange="onOptionsChange" @store-change="onStoreChange"></dm-store-selector>
<div v-if="form.costValueProportionFlag == 1" class="cost-box">
<div v-if="form.costValueType == 0" class="fixed-cost">
<el-form-item label="成本比例" prop="costValueProportion" label-width="85px"><el-input-number v-model="form.costValueProportion" :disabled="isEdit || isInfo" :min="0" :max="100" :precision="0" :controls="false" style="margin-right: 10px; width: 130px" placeholder="请输入成本比例"></el-input-number>%</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