Merge branch 'feature_0521' of http://git.51jingcheng.com/zhenghuang/bsdgy-front into feature_0521

feature_0521
liuyang 5 years ago
commit f1f89e5212

@ -1,12 +1,19 @@
<template> <template>
<div class="activityManager"> <div class="activityManager">
<Spin v-show="loading" fix>加载中...</Spin> <Spin v-show="loading"
fix>加载中...</Spin>
<Row> <Row>
<i-col class="activityListClass" v-for="(item, index) in activityList" :key="index" span="7" offset="1"> <i-col class="activityListClass"
v-for="(item, index) in activityList"
:key="index"
span="7"
offset="1">
<Card> <Card>
<div class="operateAndThemeItem"> <div class="operateAndThemeItem">
<div class="ThemeItem"> <div class="ThemeItem">
<div class="schedule-image"><img class="img" :src="'/kiisoo-ic' + item.logo" alt /></div> <div class="schedule-image"><img class="img"
:src="'/kiisoo-ic' + item.logo"
alt /></div>
<div class="tipItem"> <div class="tipItem">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span>{{ item.description }}</span> <span>{{ item.description }}</span>
@ -94,7 +101,7 @@ export default {
}, },
getActivityTable () { getActivityTable () {
let that = this; let that = this;
ActivityManager.getActivityList({}, function (data) { ActivityManager.getActivityList({ categoryCode: "promotion" }, function (data) {
that.activityList = data.data.results; that.activityList = data.data.results;
}); });
}, },
@ -132,9 +139,9 @@ export default {
</script> </script>
<style scoped> <style scoped>
.activityManager { .activityManager {
min-height: 600px; min-height: 600px;
} }
.operateAndThemeItem { .operateAndThemeItem {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -174,16 +181,16 @@ export default {
line-height: 100px; line-height: 100px;
cursor: pointer; cursor: pointer;
} }
.schedule-image { .schedule-image {
width: 50px; width: 50px;
height: 50px; height: 50px;
display: flex; display: flex;
align-items: center; align-items: center;
border-radius: 5px; border-radius: 5px;
background-color: #eee; background-color: #eee;
} }
.schedule-image img { .schedule-image img {
width: 100%; width: 100%;
height: auto; height: auto;
} }
</style> </style>

@ -64,20 +64,25 @@
@on-row-dblclick="showDetail" @on-row-dblclick="showDetail"
:columns="columns1" :columns="columns1"
:data="data"> :data="data">
<template slot-scope="{row}" slot="qrCodeAction"> <template slot-scope="{row}"
<img :src="require('../../../static/img/qrCode-init.png')" @click="navigateCode(row)" slot="qrCodeAction">
class="table-img-qr-code"/> <img :src="require('../../../static/img/qrCode-init.png')"
</template> @click="navigateCode(row)"
<template slot="action" slot-scope="{row}"> class="table-img-qr-code" />
<i-col span="12"> </template>
<Button ghost class="router-btn" <template slot="action"
@click="() => {stop(row)}">终止</Button> slot-scope="{row}">
</i-col> <i-col span="12">
<i-col span="12"> <Button ghost
<Button ghost class="router-btn" class="router-btn"
@click="() => {modify(row)}">修改</Button> @click="() => {stop(row)}">终止</Button>
</i-col> </i-col>
</template> <i-col span="12">
<Button ghost
class="router-btn"
@click="() => {modify(row)}">修改</Button>
</i-col>
</template>
</Table> </Table>
<Page :total="totalSize" <Page :total="totalSize"
@ -103,21 +108,23 @@
:detail="detail"></planDetail> :detail="detail"></planDetail>
</Modal> </Modal>
<!-- 预览二维码 --> <!-- 预览二维码 -->
<Modal <Modal v-model="isShow"
v-model="isShow" :title="showStoreName"
:title="showStoreName" :footer-hide="true"
:footer-hide="true" width="230"
width="230" class-name="vertical-center-modal"
class-name="vertical-center-modal" @on-ok="ok">
@on-ok="ok"> <div slot="header">
<div slot="header"> <p></p>
<p></p> </div>
</div> <p>{{this.showStoreName}}</p>
<p>{{this.showStoreName}}</p> <img :src="qrCodeImage"
<img :src="qrCodeImage" style="width:200px;height:200px;"/> style="width:200px;height:200px;" />
<div style="text-align: center;"> <div style="text-align: center;">
<Button ghost type="primary" @click="download(rowData)"></Button> <Button ghost
</div> type="primary"
@click="download(rowData)">下载</Button>
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
@ -139,7 +146,7 @@ export default {
data () { data () {
const _this = this; const _this = this;
return { return {
showStoreName:"", showStoreName: "",
isShow: false, isShow: false,
loading: false, loading: false,
isShowDetail: false, isShowDetail: false,
@ -456,6 +463,7 @@ export default {
if (params.status == 0) { if (params.status == 0) {
params.status = undefined; params.status = undefined;
} }
params.categoryCode = "promotion"
params.date = undefined; params.date = undefined;
http.get("/activity/instance/list", params).then(res => { http.get("/activity/instance/list", params).then(res => {
const data = res.data.results.this || {}; const data = res.data.results.this || {};
@ -496,7 +504,7 @@ export default {
debugger debugger
let fileName = index.name + "-门店码"; let fileName = index.name + "-门店码";
http.downloadImg({ http.downloadImg({
url: index.qrCodeAction url: index.qrCodeAction
}, fileName, function (/*data*/) { }, fileName, function (/*data*/) {
}) })
@ -517,7 +525,7 @@ export default {
} }
.router-btn { .router-btn {
border: none; border: none;
color: #3496EB !important; color: #3496eb !important;
margin-left: -15px; margin-left: -15px;
} }
.table-img-qr-code { .table-img-qr-code {
@ -527,6 +535,6 @@ export default {
height: 30px; height: 30px;
} }
button:hover { button:hover {
background:inherit!important; background: inherit !important;
} }
</style> </style>

@ -1,41 +1,40 @@
<template> <template>
<div class="use_box"> <div class="use_box">
<Modal <Modal :scrollable="false"
:scrollable="false" v-model="showUse"
v-model="showUse" title="使用活动"
title="使用活动" @on-cancel="cancel"
@on-cancel="cancel" :loading="true"
:loading="true" width="70%">
width="70%" <Steps style="padding: 40px;"
> :current="currentStep">
<Steps style="padding: 40px;" :current="currentStep"> <Step :title="isModify ? '修改零售公司' : '选择零售公司'"
<Step :title="isModify ? '修改零售公司' : '选择零售公司'" content></Step> content></Step>
<Step :title="isModify ? '修改店铺' : '选择店铺'" content></Step> <Step :title="isModify ? '修改店铺' : '选择店铺'"
content></Step>
</Steps> </Steps>
<useActivityStepTwo :schedule="schedule" :isModify="isModify" v-if="currentStep == 0"></useActivityStepTwo> <useActivityStepTwo :schedule="schedule"
<useActivityStepThree :schedule="schedule" :isModify="isModify" v-if="currentStep == 1"></useActivityStepThree> :isModify="isModify"
v-if="currentStep == 0"></useActivityStepTwo>
<useActivityStepThree :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 1"></useActivityStepThree>
<div slot="footer"> <div slot="footer">
<Button <Button v-if="currentStep !== 0"
v-if="currentStep !== 0" type="primary"
type="primary" shape="circle"
shape="circle" :loading="modal_loading"
:loading="modal_loading" @click="back">上一步</Button>
@click="back" <Button v-if="currentStep !== 1"
>上一步</Button> type="primary"
<Button shape="circle"
v-if="currentStep !== 1" :loading="modal_loading"
type="primary" @click="next">下一步</Button>
shape="circle" <Button v-if="currentStep == 1"
:loading="modal_loading" type="primary"
@click="next" shape="circle"
>下一步</Button> :loading="modal_loading"
<Button @click="finish">完成</Button>
v-if="currentStep == 1"
type="primary"
shape="circle"
:loading="modal_loading"
@click="finish"
>完成</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -56,7 +55,7 @@ export default {
useActivityStepThree, useActivityStepThree,
useActivityStepFoure useActivityStepFoure
}, },
data() { data () {
return { return {
currentStep: -1, currentStep: -1,
modal_loading: false, modal_loading: false,
@ -73,27 +72,28 @@ export default {
} }
}, },
watch: { watch: {
show() { show () {
this.showUse = this.show; this.showUse = this.show;
this.currentStep = 0; this.currentStep = 0;
this.modal_loading = false;
}, },
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;
if (!this.isModify) { // if (!this.isModify) {
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); console.log("data1", data);
if (this.currentStep === 0) { if (this.currentStep === 0) {
@ -118,10 +118,10 @@ export default {
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);

@ -44,9 +44,15 @@
</FormItem> </FormItem>
<FormItem label="配置范围: "> <FormItem label="配置范围: ">
<span <span
@click="showStores"
v-if="welcome.stores.length > 0" v-if="welcome.stores.length > 0"
>{{ welcome.stores[0].name }}{{ welcome.stores.length }}家店铺</span> >{{ welcome.stores[0].name }}{{ welcome.stores.length }}家店铺</span>
<Button type="text" @click="showStores" icon="md-add">全部店铺</Button> <Button
type="text"
v-if="welcome.stores.length <= 0"
@click="showStores"
icon="md-add"
>全部店铺</Button>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" long @click="submit"></Button> <Button type="primary" long @click="submit"></Button>
@ -63,6 +69,7 @@
:on-success="uploadImgSuccess" :on-success="uploadImgSuccess"
:format="['jpg', 'jpeg', 'png']" :format="['jpg', 'jpeg', 'png']"
:max-size="2048" :max-size="2048"
:on-exceeded-size="onExceededSize"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
multiple multiple
type="drag" type="drag"
@ -70,7 +77,7 @@
style="width: 100%;" style="width: 100%;"
> >
<div style="width: 100%;"> <div style="width: 100%;">
<Button long type="primary">图片</Button> <Button long type="primary">{{imageUploading ? "上传中..." : "图片"}}</Button>
</div> </div>
</Upload> </Upload>
</i-col> </i-col>
@ -133,6 +140,7 @@ export default {
showMini: false, showMini: false,
id: 0, id: 0,
showMessageTypes: false, showMessageTypes: false,
imageUploading: false,
welcome: { welcome: {
content: "", content: "",
params: [], params: [],
@ -194,6 +202,9 @@ export default {
this.showStoreCheck = false; this.showStoreCheck = false;
this.welcome = store.getters.useData; this.welcome = store.getters.useData;
}, },
onExceededSize() {
console.log("失败");
},
getDetail(instanceId) { getDetail(instanceId) {
let _this = this; let _this = this;
ActivityManager.instanceDetail( ActivityManager.instanceDetail(
@ -283,6 +294,8 @@ export default {
const me = this; const me = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
console.log(data);
this.imageUploading = true;
axios({ axios({
method: "post", method: "post",
url: "/upload", url: "/upload",
@ -291,6 +304,7 @@ export default {
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
} }
}).then(function(res) { }).then(function(res) {
me.imageUploading = false;
if (res.data.success) { if (res.data.success) {
// me.formValidate.logo = res.data.results; // me.formValidate.logo = res.data.results;
me.welcome.params.push({ me.welcome.params.push({
@ -312,10 +326,12 @@ export default {
submit() { submit() {
let _this = this; let _this = this;
if (this.welcome.params.length <= 0) { if (this.welcome.params.length <= 0) {
_this.$Message.error("请添加图片/网页/小程序消息"); _this.$Message.error("图片/网页/小程序消息至少添加一个");
return false;
} }
if (this.welcome.stores.length <= 0) { if (this.welcome.stores.length <= 0) {
_this.$Message.error("请至少选择一个店铺"); _this.$Message.error("请至少选择一个店铺");
return false;
} }
this.$refs["welcomeForm"].validate(valid => { this.$refs["welcomeForm"].validate(valid => {
if (valid) { if (valid) {

@ -1,61 +1,77 @@
<template> <template>
<div> <div>
<Row class="search-row"> <Row class="search-row">
<i-col span="24" class="search-col"> <i-col span="24"
class="search-col">
<Row class="row-style"> <Row class="row-style">
<Button @click="handleEdit" type="primary">配置欢迎语</Button> <Button @click="handleEdit"
type="primary">配置欢迎语</Button>
</Row> </Row>
</i-col> </i-col>
</Row> </Row>
<Table <Table :columns="columns1"
:columns="columns1" :data="data"
:data="data" :loading="loading"
:loading="loading" @on-cell-click="clickCell"
style="margin-top: 20px;" style="margin-top: 20px;"
size="small" size="small">
> <template slot-scope="{ row, index }"
<template slot-scope="{ row, index }" slot="action"> slot="action">
<Button type="primary" size="small" @click="handleEdit(row, index)">修改</Button> <Button type="primary"
<Button type="error" size="small" @click="handleDelete(row, index)">删除</Button> size="small"
@click="handleEdit(row, index)">修改</Button>
<Button type="error"
size="small"
@click="handleDelete(row, index)">删除</Button>
</template> </template>
</Table> </Table>
<Page <Page :total="total"
:total="total" :current="pageNum"
:current="pageNum" :page-size="pageSize"
:page-size="pageSize" show-elevator
show-elevator show-total
show-total placement="top"
placement="top" @on-change="handlePage"
@on-change="handlePage" class="ks-page"></Page>
class="ks-page" <Modal v-model="showDetail"
></Page> title="配置范围"
width="70%"
:footer-hide="true">
<welcomeDetail v-if="showDetail"
:detail="detail"></welcomeDetail>
</Modal>
</div> </div>
</template> </template>
<script> <script>
import ActivityManager from "../../services/ActivityManager/ActivityManager";
import data from "../../utils/PhoneRegionData"; import data from "../../utils/PhoneRegionData";
import http from "../../services/store/IncreaseStoreManager"; import http from "../../services/store/IncreaseStoreManager";
import staff from "../../services/staff/staff"; import staff from "../../services/staff/staff";
import welcomeDetail from "./WelcomeDetail";
export default { export default {
name: "IncreaseWelcomeList", name: "IncreaseWelcomeList",
inject: ["setMenuName"], inject: ["setMenuName"],
data() { components: { welcomeDetail },
data () {
let _this = this; let _this = this;
return { return {
loading: false, loading: false,
// //
total: 0, total: 0,
pageSize: 10, pageSize: 10,
showDetail: false,
data: [], data: [],
pageNum: 1, pageNum: 1,
detail: {},
columns1: [ columns1: [
{ {
width: 60, width: 60,
align: "center", align: "center",
title: "序号", title: "序号",
render(h, params) { render (h, params) {
console.log(params); console.log(params);
let num = parseInt(params.index) + 1; let num = parseInt(params.index) + 1;
console.log(_this.pageSize); console.log(_this.pageSize);
@ -68,23 +84,20 @@ export default {
{ {
title: "欢迎语", title: "欢迎语",
key: "scheduleVO.description", key: "scheduleVO.description",
render(h, params) { render (h, params) {
return h("span", params.row.content); return h("span", params.row.content);
} }
}, },
{ {
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.companyCount || 0) +
"等" + "家零售公司, " +
(params.row.storeCount || 0) + (params.row.storeCount || 0) +
"家公司" "家店铺"
); );
} }
}, },
@ -95,13 +108,34 @@ export default {
formValidate: {} formValidate: {}
}; };
}, },
mounted() { mounted () {
this.setMenuName("门店推广", "欢迎语"); this.setMenuName("门店推广", "欢迎语");
this.handlePaginate(); this.handlePaginate();
}, },
methods: { methods: {
clickCell (row, column, data, event) {
if (column.key === "shop") {
let _this = this;
this.getDetail(row.id).then(res => {
_this.detail = res;
_this.showDetail = true;
});
}
},
getDetail (instanceId) {
return new Promise((resolve, reject) => {
ActivityManager.instanceDetail(
{
instanceId
},
res => {
resolve(res.data.results);
}
);
});
},
// //
handlePaginate() { handlePaginate () {
this.loading = true; this.loading = true;
let params = { let params = {
pageNum: this.pageNum, pageNum: this.pageNum,
@ -117,27 +151,36 @@ export default {
}); });
}, },
// //
handlePage: function(value) { handlePage: function (value) {
this.pageNum = value; this.pageNum = value;
this.handlePaginate(); this.handlePaginate();
}, },
// //
handleEdit(row) { handleEdit (row) {
this.$router.push({ this.$router.push({
path: "/shop/increase/welcome/edit", path: "/shop/increase/welcome/edit",
query: { id: row.id } query: { id: row.id }
}); });
}, },
// //
handleDelete(row) { handleDelete (row) {
let _this = this; let _this = this;
this.$Modal.confirm({ this.$Modal.confirm({
title: "删除欢迎语", title: "删除欢迎语",
content: "您确定要删除该欢迎语?", content: "您确定要删除该欢迎语?",
onOk: () => { onOk: () => {
http.deleteWelcome({ id: row.scheduleId }).then(_this.handlePaginate); http.deleteWelcome({ id: row.scheduleId }).then(res => {
if (_this.data.length <= 1) {
if (_this.pageNum > 1) {
_this.pageNum = _this.pageNum - 1;
} else {
_this.pageNum = 1;
}
}
_this.handlePaginate()
});
}, },
onCancel: () => {} onCancel: () => { }
}); });
} }
} }

@ -0,0 +1,92 @@
<template>
<div style="padding: 0 40px;">
<Form ref="formValidate"
:model="useData"
:label-width="80">
<Row>
<i-col span="22"
offset="2">
<FormItem label="配置范围"
prop="activityRange">
<Collapse simple>
<Panel :key="index"
v-for="(item, index) in groups">
{{
item.name
}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
item.stores.length
}}家店铺
<div slot="content">
<div class="activityShopClass">
<div class="mr10"
v-for="(item, index) in item.stores"
:key="index">
<Tag class="tagClass"
color="blue">{{ item.name }}</Tag>
</div>
</div>
</div>
</Panel>
</Collapse>
</FormItem>
</i-col>
</Row>
</Form>
</div>
</template>
<script>
import store from "../../store/index";
export default {
name: "useActivityStepFoure",
data () {
return {
useData: store.getters.useData,
operate: "收起",
displayActivityShopFlag: false,
groups: [],
};
},
props: {
detail: Object
},
created () {
let _this = this;
this.$nextTick(() => {
console.log(123, this.detail)
_this.detail.organizations.forEach((item) => {
item.stores = _this._.filter(
_this.detail.stores,
(s) => s.companyId == item.id || s.parentId == item.id
);
console.log(item.stores)
_this.groups.push(item);
});
});
},
methods: {
isDisplay () {
if (this.operate === "展开") {
this.operate = "收起";
this.displayActivityShopFlag = false;
} else {
this.operate = "展开";
this.displayActivityShopFlag = true;
}
},
},
};
</script>
<style scoped>
.activityShopClass {
display: flex;
justify-content: start;
flex-wrap: wrap;
}
.mr10 {
margin-right: 20px;
}
.tagClass {
text-align: center;
}
</style>

@ -7,9 +7,7 @@ import commonUtils from '../utils/Common'
// http://mf.kiisoo.com:58080/ // http://mf.kiisoo.com:58080/
// axios.defaults.baseURL = 'https://wxtk.bsdits.com/kiisoo-ic/'; // axios.defaults.baseURL = 'https://wxtk.bsdits.com/kiisoo-ic/';
axios.defaults.baseURL = axios.defaults.baseURL =
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production' ? '/kiisoo-ic' : '/kiisoo-ic'
? 'http://111.231.218.44:8080/kiisoo-ic'
: '/kiisoo-ic'
//响应时间 //响应时间
axios.defaults.timeout = 120000 axios.defaults.timeout = 120000

Loading…
Cancel
Save