|
@@ -396,7 +396,7 @@ export default {
|
|
expireTime: "",
|
|
expireTime: "",
|
|
code: "",
|
|
code: "",
|
|
};
|
|
};
|
|
- this.fileList = [];
|
|
|
|
|
|
+ // this.fileList = [];
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
},
|
|
},
|
|
//删除
|
|
//删除
|
|
@@ -488,19 +488,32 @@ export default {
|
|
//新增
|
|
//新增
|
|
async addDataFn() {
|
|
async addDataFn() {
|
|
console.log(this.fileList);
|
|
console.log(this.fileList);
|
|
|
|
+
|
|
await this.$refs.addForm.validate();
|
|
await this.$refs.addForm.validate();
|
|
|
|
|
|
const res = this.dealerList.filter(
|
|
const res = this.dealerList.filter(
|
|
(v) => v.id === this.addForm.customerId
|
|
(v) => v.id === this.addForm.customerId
|
|
)[0];
|
|
)[0];
|
|
console.log(res);
|
|
console.log(res);
|
|
- await addDataList({
|
|
|
|
- ...this.addForm,
|
|
|
|
- orgNumber: res.useOrgNumber,
|
|
|
|
|
|
|
|
- fileName: this.fileList[0].name,
|
|
|
|
- fileUrl: this.fileList[0].url,
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.fileList.length == 1) {
|
|
|
|
+ await addDataList({
|
|
|
|
+ ...this.addForm,
|
|
|
|
+ orgNumber: res.useOrgNumber,
|
|
|
|
+
|
|
|
|
+ fileName: this.fileList[0].name,
|
|
|
|
+ fileUrl: this.fileList[0].url,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ await addDataList({
|
|
|
|
+ ...this.addForm,
|
|
|
|
+ orgNumber: res.useOrgNumber,
|
|
|
|
+
|
|
|
|
+ fileName: "",
|
|
|
|
+ fileUrl: "",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
if (this.id) {
|
|
if (this.id) {
|
|
await deleDataList({ ids: this.id });
|
|
await deleDataList({ ids: this.id });
|
|
}
|
|
}
|