|
|
|
@ -1,29 +1,36 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="div-page">
|
|
|
|
<div class="div-page">
|
|
|
|
|
|
|
|
<Spin size="large" fix v-if="loading"></Spin>
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<Row class="search-row">
|
|
|
|
<Row class="search-row">
|
|
|
|
<i-col span="8">
|
|
|
|
<i-col span="8">
|
|
|
|
<p class=""
|
|
|
|
<p
|
|
|
|
style="font-size: 16px;line-height: 22px;margin-top: 10px;margin-left: 20px;margin-right: 20px;">
|
|
|
|
class
|
|
|
|
招募令
|
|
|
|
style="font-size: 16px;line-height: 22px;margin-top: 10px;margin-left: 20px;margin-right: 20px;"
|
|
|
|
</p>
|
|
|
|
>招募令</p>
|
|
|
|
<p class=""
|
|
|
|
<p
|
|
|
|
style="font-size: 13px;line-height: 32px;margin-left: 20px;margin-right: 20px;">
|
|
|
|
class
|
|
|
|
便于门店进行推广员招募
|
|
|
|
style="font-size: 13px;line-height: 32px;margin-left: 20px;margin-right: 20px;"
|
|
|
|
</p>
|
|
|
|
>便于门店进行推广员招募</p>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="8">
|
|
|
|
<i-col span="8">
|
|
|
|
<span class="">使用范围:{{ recruit.organizations.length || 0 }}家零售公司,{{
|
|
|
|
<span class>
|
|
|
|
|
|
|
|
使用范围:{{ recruit.organizations.length || 0 }}家零售公司,{{
|
|
|
|
recruit.stores.length || 0
|
|
|
|
recruit.stores.length || 0
|
|
|
|
}}家店铺</span>
|
|
|
|
}}家店铺
|
|
|
|
<span class=""
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span
|
|
|
|
|
|
|
|
class
|
|
|
|
style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;"
|
|
|
|
style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;"
|
|
|
|
@click="showStores">修改</span>
|
|
|
|
@click="showStores"
|
|
|
|
|
|
|
|
>修改</span>
|
|
|
|
</i-col>
|
|
|
|
</i-col>
|
|
|
|
<i-col span="8">
|
|
|
|
<i-col span="8">
|
|
|
|
<i-switch size="large"
|
|
|
|
<i-switch
|
|
|
|
|
|
|
|
size="large"
|
|
|
|
v-model="recruit.status !== undefined && recruit.status == 2"
|
|
|
|
v-model="recruit.status !== undefined && recruit.status == 2"
|
|
|
|
@on-change="witchChange">
|
|
|
|
@on-change="witchChange"
|
|
|
|
|
|
|
|
>
|
|
|
|
<span slot="open">开启</span>
|
|
|
|
<span slot="open">开启</span>
|
|
|
|
<span slot="close">关闭</span>
|
|
|
|
<span slot="close">关闭</span>
|
|
|
|
</i-switch>
|
|
|
|
</i-switch>
|
|
|
|
@ -32,12 +39,11 @@
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<p style="margin:10px 0 10px -480px;text-align:center">招募海报</p>
|
|
|
|
<p style="margin:10px 0 10px -480px;text-align:center">招募海报</p>
|
|
|
|
<div style="text-align: center;">
|
|
|
|
<div style="text-align: center;">
|
|
|
|
<img style="width:500px;height:500px"
|
|
|
|
<img style="width:500px;height:500px" :src="recruit.scheduleVO.logo" alt />
|
|
|
|
:src="recruit.scheduleVO.logo"
|
|
|
|
|
|
|
|
alt="" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <div style="margin-top:20px;text-align: center;"><Button ghost type="primary">上传</Button></div> -->
|
|
|
|
<!-- <div style="margin-top:20px;text-align: center;"><Button ghost type="primary">上传</Button></div> -->
|
|
|
|
<Upload v-show="showUpload"
|
|
|
|
<Upload
|
|
|
|
|
|
|
|
v-show="showUpload"
|
|
|
|
ref="upload"
|
|
|
|
ref="upload"
|
|
|
|
:show-upload-list="false"
|
|
|
|
:show-upload-list="false"
|
|
|
|
:on-success="uploadImgSuccess"
|
|
|
|
:on-success="uploadImgSuccess"
|
|
|
|
@ -45,42 +51,35 @@
|
|
|
|
:max-size="2048"
|
|
|
|
:max-size="2048"
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
:before-upload="handleBeforeUpload"
|
|
|
|
multiple
|
|
|
|
multiple
|
|
|
|
action=""
|
|
|
|
action
|
|
|
|
style="padding-top:10px;text-align: center;">
|
|
|
|
style="padding-top:10px;text-align: center;"
|
|
|
|
<Button ghost
|
|
|
|
>
|
|
|
|
type="primary">上传</Button>
|
|
|
|
<Button ghost type="primary">上传</Button>
|
|
|
|
</Upload>
|
|
|
|
</Upload>
|
|
|
|
<div style="margin-top:20px;text-align: center;">
|
|
|
|
<div style="margin-top:20px;text-align: center;">
|
|
|
|
<Button type="primary"
|
|
|
|
<Button type="primary" size="large" @click="onEdit" style="margin-right:10px">{{ btnStr }}</Button>
|
|
|
|
size="large"
|
|
|
|
<Button v-show="showUpload" type="text" size="large" @click="onCancel">取消</Button>
|
|
|
|
@click="onEdit"
|
|
|
|
|
|
|
|
style="margin-right:10px">{{ btnStr }}</Button>
|
|
|
|
|
|
|
|
<Button v-show="showUpload"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
size="large"
|
|
|
|
|
|
|
|
@click="onCancel">取消</Button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<selectStoreStep @doShow="doShow"
|
|
|
|
<selectStoreStep @doShow="doShow" :schedule="recruit" :show="showStoreCheck"></selectStoreStep>
|
|
|
|
:schedule="recruit"
|
|
|
|
|
|
|
|
:show="showStoreCheck"></selectStoreStep>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import selectStoreStep from '../activity/selectStoreStep'
|
|
|
|
import selectStoreStep from "../activity/selectStoreStep";
|
|
|
|
import store from '../../store'
|
|
|
|
import store from "../../store";
|
|
|
|
import bulletinService from '../../services/recruit/Bulletin'
|
|
|
|
import bulletinService from "../../services/recruit/Bulletin";
|
|
|
|
import http from '../../services/CommonHttp'
|
|
|
|
import http from "../../services/CommonHttp";
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from "axios";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
selectStoreStep,
|
|
|
|
selectStoreStep
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
showStoreCheck: false,
|
|
|
|
showStoreCheck: false,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
recruit: {
|
|
|
|
recruit: {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
status: 0,
|
|
|
|
status: 0,
|
|
|
|
@ -89,7 +88,7 @@ export default {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
name: "招募令",
|
|
|
|
name: "招募令",
|
|
|
|
categoryId: 4,
|
|
|
|
categoryId: 4,
|
|
|
|
categoryCode: 'recruit',
|
|
|
|
categoryCode: "recruit",
|
|
|
|
logo: "",
|
|
|
|
logo: "",
|
|
|
|
description: "",
|
|
|
|
description: "",
|
|
|
|
appId: "",
|
|
|
|
appId: "",
|
|
|
|
@ -97,152 +96,169 @@ export default {
|
|
|
|
title: "招募令",
|
|
|
|
title: "招募令",
|
|
|
|
mediaId: "",
|
|
|
|
mediaId: "",
|
|
|
|
uri: "",
|
|
|
|
uri: "",
|
|
|
|
params: [],
|
|
|
|
params: []
|
|
|
|
},
|
|
|
|
},
|
|
|
|
categoryCode: 'recruit',
|
|
|
|
categoryCode: "recruit",
|
|
|
|
name: "招募令",
|
|
|
|
name: "招募令",
|
|
|
|
beginTime: '2020-06-03',
|
|
|
|
beginTime: "2020-06-03",
|
|
|
|
endTime: '2020-06-22',
|
|
|
|
endTime: "2020-06-22",
|
|
|
|
content: '招募令',
|
|
|
|
content: "招募令",
|
|
|
|
params: [],
|
|
|
|
params: [],
|
|
|
|
organizations: [],
|
|
|
|
organizations: [],
|
|
|
|
stores: [],
|
|
|
|
stores: []
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showUpload: false,
|
|
|
|
showUpload: false,
|
|
|
|
btnStr: '编辑',
|
|
|
|
btnStr: "编辑",
|
|
|
|
imgUrl: '',
|
|
|
|
imgUrl: "",
|
|
|
|
onWitch: false,
|
|
|
|
onWitch: false,
|
|
|
|
uploadUrl: '',
|
|
|
|
uploadUrl: "",
|
|
|
|
oldImg: '',
|
|
|
|
oldImg: ""
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted: function() {},
|
|
|
|
mounted: function() {},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.initData()
|
|
|
|
this.initData();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inject: ['reload'],
|
|
|
|
inject: ["reload"],
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
witchChange(status) {
|
|
|
|
witchChange(status) {
|
|
|
|
if (status) {
|
|
|
|
if (status) {
|
|
|
|
this.recruit.status = 2
|
|
|
|
this.recruit.status = 2;
|
|
|
|
this.recruit.scheduleVO.status = 1;
|
|
|
|
this.recruit.scheduleVO.status = 1;
|
|
|
|
this.recruit.scheduleVO.params.forEach((item) => {
|
|
|
|
this.recruit.scheduleVO.params.forEach(item => {
|
|
|
|
item.status = 1
|
|
|
|
item.status = 1;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.recruit.params.forEach((item) => {
|
|
|
|
this.recruit.params.forEach(item => {
|
|
|
|
item.status = 1
|
|
|
|
item.status = 1;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.recruit.stores.forEach((item) => {
|
|
|
|
this.recruit.stores.forEach(item => {
|
|
|
|
item.status = 1
|
|
|
|
item.status = 1;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.recruit.status = 3
|
|
|
|
this.recruit.status = 3;
|
|
|
|
this.recruit.scheduleVO.status = 2;
|
|
|
|
this.recruit.scheduleVO.status = 2;
|
|
|
|
this.recruit.scheduleVO.params.forEach((item) => {
|
|
|
|
this.recruit.scheduleVO.params.forEach(item => {
|
|
|
|
item.status = 2
|
|
|
|
item.status = 2;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.recruit.params.forEach((item) => {
|
|
|
|
this.recruit.params.forEach(item => {
|
|
|
|
item.status = 2
|
|
|
|
item.status = 2;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.recruit.stores.forEach((item) => {
|
|
|
|
this.recruit.stores.forEach(item => {
|
|
|
|
item.status = 2
|
|
|
|
item.status = 2;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.save();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
initData() {
|
|
|
|
initData() {
|
|
|
|
let that = this
|
|
|
|
let that = this;
|
|
|
|
bulletinService.getDetail(
|
|
|
|
bulletinService.getDetail(
|
|
|
|
{},
|
|
|
|
{},
|
|
|
|
function(data) {
|
|
|
|
function(data) {
|
|
|
|
if (data.data.results !== null) {
|
|
|
|
if (data.data.results !== null) {
|
|
|
|
if (data.data.results.scheduleVO.params.length > 0) {
|
|
|
|
if (data.data.results.scheduleVO.params.length > 0) {
|
|
|
|
that.imgUrl = data.data.results.scheduleVO.params[0].defaultVal
|
|
|
|
that.imgUrl = data.data.results.scheduleVO.params[0].defaultVal;
|
|
|
|
that.oldImg = data.data.results.scheduleVO.params[0].defaultVal
|
|
|
|
that.oldImg = data.data.results.scheduleVO.params[0].defaultVal;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
that.recruit = { ...that.recruit, ...data.data.results }
|
|
|
|
that.recruit = { ...that.recruit, ...data.data.results };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function(err) {
|
|
|
|
function(err) {
|
|
|
|
that.$Message.error('网络异常,请重试')
|
|
|
|
that.$Message.error("网络异常,请重试");
|
|
|
|
that.setNoLoading()
|
|
|
|
that.setNoLoading();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
doShow() {
|
|
|
|
doShow() {
|
|
|
|
this.showStoreCheck = false
|
|
|
|
this.showStoreCheck = false;
|
|
|
|
let _this = this;
|
|
|
|
let _this = this;
|
|
|
|
this.recruit = { ...this.recruit, ...store.getters.useData }
|
|
|
|
this.recruit = { ...this.recruit, ...store.getters.useData };
|
|
|
|
this.recruit.organizations = this._.filter(store.getters.useData.company, item => {
|
|
|
|
this.recruit.organizations = this._.filter(
|
|
|
|
return _this._.find(store.getters.useData.stores, store => store.parentId == item.id) !== undefined
|
|
|
|
store.getters.useData.company,
|
|
|
|
})
|
|
|
|
item => {
|
|
|
|
store.commit('ReSET_useData');
|
|
|
|
return (
|
|
|
|
this.$forceUpdate()
|
|
|
|
_this._.find(
|
|
|
|
|
|
|
|
store.getters.useData.stores,
|
|
|
|
|
|
|
|
store => store.parentId == item.id
|
|
|
|
|
|
|
|
) !== undefined
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
store.commit("ReSET_useData");
|
|
|
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
|
|
|
this.save();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showStores() {
|
|
|
|
showStores() {
|
|
|
|
this.recruit.company = [...this.recruit.organizations]
|
|
|
|
this.recruit.company = [...this.recruit.organizations];
|
|
|
|
store.commit('SET_useData', {
|
|
|
|
store.commit("SET_useData", {
|
|
|
|
...store.getters.useData,
|
|
|
|
...store.getters.useData,
|
|
|
|
...this.recruit
|
|
|
|
...this.recruit
|
|
|
|
})
|
|
|
|
});
|
|
|
|
console.log({
|
|
|
|
console.log({
|
|
|
|
...store.getters.useData,
|
|
|
|
...store.getters.useData,
|
|
|
|
...this.recruit,
|
|
|
|
...this.recruit
|
|
|
|
})
|
|
|
|
});
|
|
|
|
this.showStoreCheck = true
|
|
|
|
this.showStoreCheck = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onEdit() {
|
|
|
|
onEdit() {
|
|
|
|
if (this.btnStr == '编辑') {
|
|
|
|
if (this.btnStr == "编辑") {
|
|
|
|
this.showUpload = true
|
|
|
|
this.showUpload = true;
|
|
|
|
this.btnStr = '保存'
|
|
|
|
this.btnStr = "保存";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let _this = this
|
|
|
|
this.save();
|
|
|
|
let param = { ...this.recruit }
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
save() {
|
|
|
|
|
|
|
|
let _this = this;
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
let param = { ...this.recruit };
|
|
|
|
if (param.stores.length <= 0) {
|
|
|
|
if (param.stores.length <= 0) {
|
|
|
|
_this.$Message.error('请至少选择一个店铺')
|
|
|
|
_this.$Message.error("请至少选择一个店铺");
|
|
|
|
_this.loading = false
|
|
|
|
_this.loading = false;
|
|
|
|
return false
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
param.isGetActivityInfo = true
|
|
|
|
param.isGetActivityInfo = true;
|
|
|
|
bulletinService.dosave(
|
|
|
|
bulletinService.dosave(
|
|
|
|
param,
|
|
|
|
param,
|
|
|
|
function(data) {
|
|
|
|
function(data) {
|
|
|
|
console.log(data)
|
|
|
|
console.log(data);
|
|
|
|
_this.$Message.info('保存成功')
|
|
|
|
_this.$Message.info("保存成功");
|
|
|
|
_this.btnStr = '编辑'
|
|
|
|
_this.btnStr = "编辑";
|
|
|
|
_this.showUpload = false
|
|
|
|
_this.showUpload = false;
|
|
|
|
|
|
|
|
_this.loading = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function(err) {
|
|
|
|
function(err) {
|
|
|
|
_this.$Message.error('网络异常,请重试')
|
|
|
|
_this.$Message.error("网络异常,请重试");
|
|
|
|
_this.setNoLoading()
|
|
|
|
_this.setNoLoading();
|
|
|
|
}
|
|
|
|
_this.loading = false;
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onCancel() {
|
|
|
|
onCancel() {
|
|
|
|
this.showUpload = false
|
|
|
|
this.showUpload = false;
|
|
|
|
this.imgUrl = this.oldImg
|
|
|
|
this.imgUrl = this.oldImg;
|
|
|
|
this.btnStr = '编辑'
|
|
|
|
this.btnStr = "编辑";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
uploadImgSuccess(res, file) {
|
|
|
|
uploadImgSuccess(res, file) {
|
|
|
|
this.imageName = file.name
|
|
|
|
this.imageName = file.name;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleBeforeUpload(res) {
|
|
|
|
handleBeforeUpload(res) {
|
|
|
|
const _this = this
|
|
|
|
const _this = this;
|
|
|
|
let data = new FormData()
|
|
|
|
let data = new FormData();
|
|
|
|
data.append('file', res)
|
|
|
|
data.append("file", res);
|
|
|
|
axios({
|
|
|
|
axios({
|
|
|
|
method: 'post',
|
|
|
|
method: "post",
|
|
|
|
url: '/upload',
|
|
|
|
url: "/upload",
|
|
|
|
data: data,
|
|
|
|
data: data,
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'multipart/form-data',
|
|
|
|
"Content-Type": "multipart/form-data"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}).then(function(res) {
|
|
|
|
}).then(function(res) {
|
|
|
|
if (res.data.success) {
|
|
|
|
if (res.data.success) {
|
|
|
|
console.log(res)
|
|
|
|
console.log(res);
|
|
|
|
_this.uploadUrl = res.data.results.localPath
|
|
|
|
_this.uploadUrl = res.data.results.localPath;
|
|
|
|
_this.imgUrl = res.data.results.localPath
|
|
|
|
_this.imgUrl = res.data.results.localPath;
|
|
|
|
_this.recruit.params = [{
|
|
|
|
_this.recruit.params = [
|
|
|
|
|
|
|
|
{
|
|
|
|
attr: 2,
|
|
|
|
attr: 2,
|
|
|
|
defaultVal: res.data.results.localPath,
|
|
|
|
defaultVal: res.data.results.localPath,
|
|
|
|
description: "",
|
|
|
|
description: "",
|
|
|
|
@ -252,15 +268,16 @@ export default {
|
|
|
|
limitUpper: "",
|
|
|
|
limitUpper: "",
|
|
|
|
name: "recruitImage",
|
|
|
|
name: "recruitImage",
|
|
|
|
type: 1
|
|
|
|
type: 1
|
|
|
|
}]
|
|
|
|
|
|
|
|
_this.recruit.scheduleVO.params = _this.recruit.params
|
|
|
|
|
|
|
|
_this.recruit.scheduleVO.logo = res.data.results.localPath
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
];
|
|
|
|
return false
|
|
|
|
_this.recruit.scheduleVO.params = _this.recruit.params;
|
|
|
|
},
|
|
|
|
_this.recruit.scheduleVO.logo = res.data.results.localPath;
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|
|
|
|
<style scoped></style>
|
|
|
|
|