feature_0521
郑皇 5 years ago
parent 4715dc2d6e
commit 6ef2a253ef

@ -1,40 +1,41 @@
<template> <template>
<div class="use_box"> <div class="use_box">
<Modal :scrollable="false" <Modal
v-model="showUse" :scrollable="false"
title="使用活动" v-model="showUse"
@on-cancel="cancel" title="使用活动"
:loading="true" @on-cancel="cancel"
width="70%"> :loading="true"
<Steps style="padding: 40px;" width="70%"
:current="currentStep"> >
<Step :title="isModify ? '修改零售公司' : '选择零售公司'" <Steps style="padding: 40px;" :current="currentStep">
content></Step> <Step :title="isModify ? '修改零售公司' : '选择零售公司'" content></Step>
<Step :title="isModify ? '修改店铺' : '选择店铺'" <Step :title="isModify ? '修改店铺' : '选择店铺'" content></Step>
content></Step>
</Steps> </Steps>
<useActivityStepTwo :schedule="schedule" <useActivityStepTwo :schedule="schedule" :isModify="isModify" v-if="currentStep == 0"></useActivityStepTwo>
:isModify="isModify" <useActivityStepThree :schedule="schedule" :isModify="isModify" v-if="currentStep == 1"></useActivityStepThree>
v-if="currentStep == 0"></useActivityStepTwo>
<useActivityStepThree :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 1"></useActivityStepThree>
<div slot="footer"> <div slot="footer">
<Button v-if="currentStep !== 0" <Button
type="primary" v-if="currentStep !== 0"
shape="circle" type="primary"
:loading="modal_loading" shape="circle"
@click="back">上一步</Button> :loading="modal_loading"
<Button v-if="currentStep !== 1" @click="back"
type="primary" >上一步</Button>
shape="circle" <Button
:loading="modal_loading" v-if="currentStep !== 1"
@click="next">下一步</Button> type="primary"
<Button v-if="currentStep == 1" shape="circle"
type="primary" :loading="modal_loading"
shape="circle" @click="next"
:loading="modal_loading" >下一步</Button>
@click="finish">完成</Button> <Button
v-if="currentStep == 1"
type="primary"
shape="circle"
:loading="modal_loading"
@click="finish"
>完成</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -46,20 +47,20 @@ import useActivityStepThree from "./useActivityStepThree";
import useActivityStepFoure from "./useActivityStepFoure"; import useActivityStepFoure from "./useActivityStepFoure";
import ActivityManager from "../../services/ActivityManager/ActivityManager"; import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from "../../store/index"; import store from "../../store/index";
import { formatDate } from '../../utils/Common'; import { formatDate } from "../../utils/Common";
export default { export default {
name: "useTable", name: "useTable",
components: { components: {
useActivityStepOne, useActivityStepOne,
useActivityStepTwo, useActivityStepTwo,
useActivityStepThree, useActivityStepThree,
useActivityStepFoure, useActivityStepFoure
}, },
data () { data() {
return { return {
currentStep: 0, currentStep: 0,
modal_loading: false, modal_loading: false,
showUse: false, showUse: false
}; };
}, },
props: { props: {
@ -72,27 +73,26 @@ export default {
} }
}, },
watch: { watch: {
show () { show() {
this.showUse = this.show; this.showUse = this.show;
}, },
schedule () { schedule() {
store.getters.useData.scheduleId = this.schedule.id; store.getters.useData.scheduleId = this.schedule.id;
}, }
}, },
mounted () { }, mounted() {},
methods: { methods: {
cancel () { cancel() {
this.currentStep = 0; this.currentStep = 0;
},
cancel () {
store.commit("RSET_useData"); store.commit("RSET_useData");
this.$emit("doShow", false); this.$emit("doShow", false);
this.modal_loading = false; this.modal_loading = false;
this.showUse = false; this.showUse = false;
this.currentStep = 0; this.currentStep = 0;
}, },
next () { next() {
let data = store.getters.useData; let data = store.getters.useData;
console.log("data1", data);
if (this.currentStep === 0) { if (this.currentStep === 0) {
if (!data.company || data.company.length === 0) { if (!data.company || data.company.length === 0) {
this.$Message.error("请至少选择1家公司"); this.$Message.error("请至少选择1家公司");
@ -111,19 +111,19 @@ export default {
if (typeof data.endTime == "object") { if (typeof data.endTime == "object") {
data.endTime = formatDate(data.endTime); data.endTime = formatDate(data.endTime);
} }
console.log("data", data) console.log("data", data);
store.commit("SET_useData", data); store.commit("SET_useData", data);
this.currentStep = this.currentStep + 1; this.currentStep = this.currentStep + 1;
}, },
back () { back() {
this.currentStep = this.currentStep - 1; this.currentStep = this.currentStep - 1;
}, },
finish () { finish() {
let that = this; let that = this;
this.modal_loading = true; this.modal_loading = true;
that.$emit("doShow", false); that.$emit("doShow", false);
}, }
}, }
}; };
</script> </script>

@ -45,7 +45,7 @@ export default {
}, },
mounted() { mounted() {
let _this = this; let _this = this;
console.log(111, store.getters.useData); console.log(1, store.getters.useData);
if ( if (
store.getters.useData.company && store.getters.useData.company &&
store.getters.useData.company.length > 0 store.getters.useData.company.length > 0
@ -57,7 +57,6 @@ export default {
}); });
} else if (store.getters.useData.stores) { } else if (store.getters.useData.stores) {
store.getters.useData.stores.forEach(item => { store.getters.useData.stores.forEach(item => {
console.log(112221, item.parentId);
if (item.parentId && _this.checkCompanys.indexOf(item.parentId) == -1) { if (item.parentId && _this.checkCompanys.indexOf(item.parentId) == -1) {
_this.checkCompanys.push(item.parentId); _this.checkCompanys.push(item.parentId);
} }
@ -67,6 +66,7 @@ export default {
}, },
methods: { methods: {
onChange(data) { onChange(data) {
console.log(2, store.getters.useData);
let _this = this; let _this = this;
if (data.length === this.companyList.length) { if (data.length === this.companyList.length) {
this.indeterminate = false; this.indeterminate = false;
@ -85,6 +85,7 @@ export default {
store.getters.useData.company.push(c); store.getters.useData.company.push(c);
} }
}); });
console.log(3, store.getters.useData);
}, },
doSearch(e) { doSearch(e) {
const keyword = e.target.value; const keyword = e.target.value;
@ -126,7 +127,6 @@ export default {
that.orginCompanyList = that.companyList; that.orginCompanyList = that.companyList;
}); });
store.getters.useData.company = []; store.getters.useData.company = [];
console.log(123, that.checkCompanys, that.companyListdata);
that.checkCompanys.forEach(item => { that.checkCompanys.forEach(item => {
const c = that._.find( const c = that._.find(
that.companyListdata, that.companyListdata,

@ -137,7 +137,9 @@ export default {
content: "", content: "",
params: [], params: [],
company: [], company: [],
stores: [] stores: [],
categoryCode: "welcome",
id: null
}, },
welcomeRules: { welcomeRules: {
content: [ content: [
@ -164,6 +166,18 @@ export default {
miniForm: { appid: "", uri: "" } miniForm: { appid: "", uri: "" }
}; };
}, },
watch: {
welcome: {
handler() {
store.commit("SET_useData", {
...store.getters.useData,
...this.welcome
});
},
immediate: true,
deep: true
}
},
created() { created() {
this.id = this.$route.query.id; this.id = this.$route.query.id;
// store.commit("SET_useData", { ...store.getters.useData, ...this.welcome }); // store.commit("SET_useData", { ...store.getters.useData, ...this.welcome });
@ -179,7 +193,6 @@ export default {
doShow() { doShow() {
this.showStoreCheck = false; this.showStoreCheck = false;
this.welcome = store.getters.useData; this.welcome = store.getters.useData;
console.log(this.welcome);
}, },
getDetail(instanceId) { getDetail(instanceId) {
let _this = this; let _this = this;

@ -7,7 +7,13 @@
</Row> </Row>
</i-col> </i-col>
</Row> </Row>
<Table :columns="columns1" :data="data" style="margin-top: 20px;" size="small"> <Table
:columns="columns1"
:data="data"
:loading="loading"
style="margin-top: 20px;"
size="small"
>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<Button type="primary" size="small" @click="handleEdit(row, index)">修改</Button> <Button type="primary" size="small" @click="handleEdit(row, index)">修改</Button>
<Button type="error" size="small" @click="handleDelete(row, index)">删除</Button> <Button type="error" size="small" @click="handleDelete(row, index)">删除</Button>
@ -38,7 +44,7 @@ export default {
data() { data() {
let _this = this; let _this = this;
return { return {
loading: true, loading: false,
// //
total: 0, total: 0,
pageSize: 10, pageSize: 10,
@ -70,6 +76,9 @@ export default {
title: "配置范围", title: "配置范围",
key: "shop", key: "shop",
render(h, params) { render(h, params) {
if (params.row.storeName == null) {
return h("span", "店铺插入中...");
}
return h( return h(
"span", "span",
params.row.storeName + params.row.storeName +
@ -110,6 +119,7 @@ export default {
// //
handlePage: function(value) { handlePage: function(value) {
this.pageNum = value; this.pageNum = value;
this.handlePaginate();
}, },
// //
handleEdit(row) { handleEdit(row) {

Loading…
Cancel
Save