|
|
@@ -43,7 +43,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
|
|
|
- <avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
+ <avue-form ref="form" class="trading-form" v-model="form" :option="option" :upload-after="uploadAfter">
|
|
|
<template slot="corpsTypeIdLabel">
|
|
|
<span style="color: #409eff; cursor: pointer" @click="corpTypeVisible = true"> 店面分类 </span>
|
|
|
</template>
|
|
|
@@ -604,7 +604,7 @@ export default {
|
|
|
dicData: [],
|
|
|
dataType: "string",
|
|
|
type: "cascader",
|
|
|
- emitPath:false,
|
|
|
+ emitPath: false,
|
|
|
props: {
|
|
|
label: "name",
|
|
|
value: "code",
|
|
|
@@ -761,20 +761,48 @@ export default {
|
|
|
}, 100);
|
|
|
},
|
|
|
methods: {
|
|
|
+ uploadAfter(res, done, loading, column) {
|
|
|
+ let obj = {
|
|
|
+ url: res.link,
|
|
|
+ name: res.originalName,
|
|
|
+ extname: this.getFileExtension(res.originalName),
|
|
|
+ };
|
|
|
+ this.form.businessLicense = JSON.stringify(obj);
|
|
|
+ done();
|
|
|
+ this.$message.success("上传后的方法");
|
|
|
+ },
|
|
|
+ getFileExtension(filename) {
|
|
|
+ return filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2);
|
|
|
+ },
|
|
|
allClick(name) {
|
|
|
if (name == "提交审批") {
|
|
|
- this.$confirm("是否提交审批?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- let obj = {
|
|
|
- id: this.form.id,
|
|
|
- };
|
|
|
- submitApply(obj).then((res) => {
|
|
|
- this.$message.success("操作成功");
|
|
|
- this.getDetail(this.form.id);
|
|
|
- });
|
|
|
+ this.$refs.form.validate((valid, done) => {
|
|
|
+ done();
|
|
|
+ if (valid) {
|
|
|
+ if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
|
|
|
+ if (this.data.length == 0) return this.$message.error("请添加地址信息");
|
|
|
+ if (this.corpsFiles.length == 0) return this.$message.error("请添加门店照片");
|
|
|
+ if (this.corpsFiles.filter((item) => item.mainImage == 1).length > 1)
|
|
|
+ return this.$message.error("门店照片主图只允许选一个");
|
|
|
+ if (this.corpsFiles.filter((item) => item.mainImage == 1).length == 0) {
|
|
|
+ this.corpsFiles[0].mainImage = 1;
|
|
|
+ }
|
|
|
+ this.$confirm("是否提交审批?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {
|
|
|
+ id: this.form.id,
|
|
|
+ };
|
|
|
+ submitApply(obj).then((res) => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getDetail(this.form.id);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
if (name == "审批") {
|
|
|
@@ -834,8 +862,8 @@ export default {
|
|
|
this.form.deliveryWarehouseName = null;
|
|
|
}
|
|
|
}
|
|
|
- if(name=='label'){
|
|
|
- this.form.label=row.names
|
|
|
+ if (name == "label") {
|
|
|
+ this.form.label = row.names;
|
|
|
}
|
|
|
},
|
|
|
// 启用或禁用
|
|
|
@@ -1011,8 +1039,12 @@ export default {
|
|
|
if (valid) {
|
|
|
if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
|
|
|
if (this.data.length == 0) return this.$message.error("请添加地址信息");
|
|
|
+ if (this.corpsFiles.length == 0) return this.$message.error("请添加门店照片");
|
|
|
if (this.corpsFiles.filter((item) => item.mainImage == 1).length > 1)
|
|
|
return this.$message.error("附件主图只允许选一个");
|
|
|
+ if (this.corpsFiles.filter((item) => item.mainImage == 1).length == 0) {
|
|
|
+ this.corpsFiles[0].mainImage = 1;
|
|
|
+ }
|
|
|
this.loadingBtn = true;
|
|
|
submit({
|
|
|
...this.form,
|