update: 新增供应增加判断是否获取详情

This commit is contained in:
admin 2024-06-17 16:07:33 +08:00
parent 5f07e0d5e8
commit 4dbcdab87b
2 changed files with 14 additions and 12 deletions

View File

@ -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;

View File

@ -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=" +