Compare commits

...

2 Commits

@ -11,7 +11,7 @@
<span class="" style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;" @click="showStores"></span> <span class="" style="border: 0px; color: rgb(52, 150, 235); margin-left: 15px; cursor: pointer;" @click="showStores"></span>
</i-col> </i-col>
<i-col span="8"> <i-col span="8">
<i-switch size="large"> <i-switch size="large" @on-change="witchChange">
<span slot="open">开启</span> <span slot="open">开启</span>
<span slot="close">关闭</span> <span slot="close">关闭</span>
</i-switch> </i-switch>
@ -52,8 +52,9 @@ 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";
export default { export default {
inject:['reload'],
components: { components: {
selectStoreStep, selectStoreStep,
}, },
@ -69,7 +70,9 @@ export default {
inidData:{}, inidData:{},
showUpload:false, showUpload:false,
btnStr:'编辑', btnStr:'编辑',
imgUrl:'' imgUrl:'',
onWitch:false,
uploadUrl:""
}; };
}, },
mounted: function() { mounted: function() {
@ -79,15 +82,17 @@ export default {
this.initData(); this.initData();
}, },
methods: { methods: {
witchChange(status) {
this.onWitch = status;
},
initData(){ initData(){
let that = this; let that = this;
bulletinService.getDetail({}, function (data) { bulletinService.getDetail({}, function (data) {
console.log(data); console.log(data);
data.data.results.scheduleVO.params.forEach(item => { if(data.data.results.scheduleVO.params.length>0){
item.defaultVal = http.getBaseUrl() + item.defaultVal; that.imgUrl = http.getBaseUrl() + data.data.results.scheduleVO.params[0].defaultVal;
}); }
that.initData = data.data.results; that.initData = data.data.results;
that.imgUrl = that.initData.scheduleVO.params[0].defaultVal
}, function (err) { }, function (err) {
that.$Message.error("网络异常,请重试"); that.$Message.error("网络异常,请重试");
@ -97,10 +102,7 @@ export default {
doShow () { doShow () {
this.showStoreCheck = false this.showStoreCheck = false
this.welcome = store.getters.useData this.welcome = store.getters.useData
console.log(this.welcome) console.log(this.welcome);
},
change (status) {
this.$Message.info('开关状态:' + status);
}, },
showStores () { showStores () {
console.log({ ...store.getters.useData, ...this.welcome }) console.log({ ...store.getters.useData, ...this.welcome })
@ -108,8 +110,44 @@ export default {
this.showStoreCheck = true this.showStoreCheck = true
}, },
onEdit(){ onEdit(){
this.showUpload = true; if(this.btnStr == '编辑'){
this.btnStr = '保存' this.showUpload = true;
this.btnStr = '保存'
}else{
this.initData.isGetActivityInfo = true;
try{
if(this.welcome.stores.length>0){
this.initData.stores = this.welcome.stores;
}
}catch(e){
console.log(e);
}
if(this.onWitch){
this.initData.status = 1;
this.initData.stores.forEach(item => {
item.status = 1;
})
}else{
this.initData.status = 3;
this.initData.stores.forEach(item => {
item.status = 2;
})
}
if(this.uploadUrl != ""){
this.initData.scheduleVO.params.forEach(item => {
item.defaultVal = item.description = this.uploadUrl;
})
}
let that = this;
bulletinService.dosave(this.initData, function (data) {
console.log(data);
that.reload();
}, function (err) {
that.$Message.error("网络异常,请重试");
that.setNoLoading();
});
}
}, },
onCancel(){ onCancel(){
this.showUpload = false; this.showUpload = false;
@ -119,7 +157,7 @@ export default {
this.imageName = file.name; this.imageName = file.name;
}, },
handleBeforeUpload (res) { handleBeforeUpload (res) {
const me = this; const _this = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
axios({ axios({
@ -131,6 +169,9 @@ export default {
}, },
}).then(function (res) { }).then(function (res) {
if (res.data.success) { if (res.data.success) {
console.log(res);
_this.uploadUrl = res.data.results.localPath;
_this.imgUrl = http.getBaseUrl() + res.data.results.localPath;
} }
}); });
return false; return false;

@ -5,6 +5,11 @@ export function getDetail(params, call) {
return http.get('/fission/detail', params).then(call) return http.get('/fission/detail', params).then(call)
} }
export function dosave(params, call) {
return http.post('/fission/save', params).then(call)
}
export default { export default {
getDetail, getDetail,
dosave
} }

Loading…
Cancel
Save