Commit 242d293a authored by 仇晓婷's avatar 仇晓婷

dd

parent 0d8e82ad
......@@ -79,9 +79,9 @@
</Form>
</template>
<script>
import Api from './api'
import Api from "./api";
export default {
name: 'Add',
name: "Add",
data() {
return {
disabled: false,
......@@ -94,15 +94,15 @@ export default {
stage: 1
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
name: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: 'Follow',
app: "Follow",
eid: null,
name: '',
field: ''
name: "",
field: ""
}
}
};
},
props: {
v: Object,
......@@ -113,67 +113,67 @@ export default {
}
},
mounted() {
this.parms.eid = this.$u.guid()
this.$refs.refFile.intFiles()
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
this.$refs.form.validate(v => {
if (v) {
this.entity.accessory = ''
this.entity.accessory = "";
if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList
let names = []
nameList.forEach((e) => {
names.push(e.fileName)
})
let nameList = this.$refs.refFile.nameList;
let names = [];
nameList.forEach(e => {
names.push(e.fileName);
});
this.entity.accessory = JSON.stringify(names)
.replace('[', '')
.replace(']', '')
.replace(/\"/g, '') //附件本地库暂存文件名称
.replace("[", "")
.replace("]", "")
.replace(/\"/g, ""); //附件本地库暂存文件名称
}
this.disabled = true
this.disabled = true;
Api.create(this.entity)
.then((r) => {
this.disabled = false
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error('保存失败')
this.$Message.error("保存失败");
}
this.$refs.refFile.intFiles()
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
this.$refs.refFile.intFiles();
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
})
});
},
handleClose() {
this.$emit('on-close')
this.$emit("on-close");
},
l(key) {
key = 'Follow' + '.' + key
return this.$t(key)
key = "Follow" + "." + key;
return this.$t(key);
}
},
watch: {
'addId.projectId'(v) {
"addId.projectId"(v) {
if (v > 0) {
this.entity.projectId = v
this.entity.projectId = v;
}
},
'addId.customerId'(v) {
"addId.customerId"(v) {
if (v > 0) {
this.entity.customerId = v
this.entity.customerId = v;
}
},
'addId.principal'(v) {
this.entity.principal = v
"addId.principal"(v) {
this.entity.principal = v;
}
}
}
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment