2
This commit is contained in:
@@ -11,9 +11,29 @@ const _sfc_main = {
|
||||
onLoad(query) {
|
||||
if (query && query.id) {
|
||||
this.id = Number(query.id);
|
||||
this.load();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async load() {
|
||||
if (!this.id)
|
||||
return;
|
||||
try {
|
||||
const d = await common_http.get(`/api/suppliers/${this.id}`);
|
||||
this.form = {
|
||||
name: (d == null ? void 0 : d.name) || "",
|
||||
contactName: (d == null ? void 0 : d.contactName) || "",
|
||||
mobile: (d == null ? void 0 : d.mobile) || "",
|
||||
phone: (d == null ? void 0 : d.phone) || "",
|
||||
address: (d == null ? void 0 : d.address) || "",
|
||||
apOpening: Number((d == null ? void 0 : d.apOpening) || 0),
|
||||
apPayable: Number((d == null ? void 0 : d.apPayable) || 0),
|
||||
remark: (d == null ? void 0 : d.remark) || ""
|
||||
};
|
||||
} catch (e) {
|
||||
common_vendor.index.showToast({ title: (e == null ? void 0 : e.message) || "加载失败", icon: "none" });
|
||||
}
|
||||
},
|
||||
async save() {
|
||||
if (!this.form.name)
|
||||
return common_vendor.index.showToast({ title: "请填写供应商名称", icon: "none" });
|
||||
|
||||
Reference in New Issue
Block a user