feature_0521
郑皇 5 years ago
parent 716713daad
commit 4d3f82c38a

@ -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) {

@ -76,15 +76,12 @@ 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.companyCount || 0) +
"" + "家零售公司, " +
(params.row.storeCount || 0) + (params.row.storeCount || 0) +
"家公司" "家店铺"
); );
} }
}, },

Loading…
Cancel
Save