diff --git a/src/pagesApp/components/addSupplier.vue b/src/pagesApp/components/addSupplier.vue index 3e9d6ca..00b0ce4 100644 --- a/src/pagesApp/components/addSupplier.vue +++ b/src/pagesApp/components/addSupplier.vue @@ -320,7 +320,7 @@ const startSave = (v: boolean) => { delta: 1, success: (res) => { uni.$emit("pricingParams", { - name: model1.formData.name + name: model1.formData.name, }); }, }); @@ -366,18 +366,21 @@ onMounted(() => { onLoad((option: any) => { // 接收传递的标题参数 const title = option.title; - SupplierApi.getSupplierUserList({ id: option.item }).then((res: any) => { - if (res.code === 200) { - if (res.data.length > 0) { - model1.formData = res.data[0]; - if (model1.formData.cardCode) { - model1.formData.stockCardName = model1.formData.cardCode; + if (option.item) { + SupplierApi.getSupplierUserList({ id: option.item }).then((res: any) => { + if (res.code === 200) { + if (res.data.length > 0) { + model1.formData = res.data[0]; + if (model1.formData.cardCode) { + model1.formData.stockCardName = model1.formData.cardCode; + } + } else { + uni.showToast({ title: "未查询到供应商" }); } - } else { - uni.showToast({ title: "未查询到供应商" }); } - } - }); + }); + } + // 新增供应商卡号必填 编辑供应商卡号非必填 if (!option.item) { formAttrList[1].required = true; diff --git a/src/pagesApp/supplierMgt.vue b/src/pagesApp/supplierMgt.vue index 1eb9463..a954f33 100644 --- a/src/pagesApp/supplierMgt.vue +++ b/src/pagesApp/supplierMgt.vue @@ -118,7 +118,6 @@ const update = (item: any) => { }; const edit = (item: any) => { - console.log(JSON.stringify(item)) uni.navigateTo({ url: "/pagesApp/components/addSupplier?title=编辑供应商&item=" +