feature_0521
liuyang 5 years ago
parent 91db056057
commit f86657a7e9

@ -74,7 +74,8 @@
slot-scope="{row}">
<i-col span="12">
<Button ghost
class="router-btn"
:disabled="row.status==3?true:false"
:class="row.status==3?'router-btn-gray':'router-btn'"
@click="() => {stop(row)}">终止</Button>
</i-col>
<i-col span="12">
@ -528,6 +529,11 @@ export default {
color: #3496eb !important;
margin-left: -15px;
}
.router-btn-gray {
border: none;
color: #666 !important;
margin-left: -15px;
}
.table-img-qr-code {
margin-left: 5px;
margin-top: 5px;

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

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

Loading…
Cancel
Save