update:
1. 账单详情 出货结算 付款审核 客户列表 库存卡对应的分页 2. 定价单:预估总价显示问题 当为待审核是不用判断是否为补单数据 3. 上传对应的接口url更新
This commit is contained in:
parent
6725ac0f3f
commit
ebd6e37efa
|
@ -26,7 +26,9 @@
|
|||
<view
|
||||
>{{ state.type === "1" ? "应付" : "应收" }}金额:<text class="num"
|
||||
>¥{{
|
||||
state.type === "1" ? formatMoney(item.balanceTotalPrice) : formatMoney(item.totalPrice)
|
||||
state.type === "1"
|
||||
? formatMoney(item.balanceTotalPrice)
|
||||
: formatMoney(item.totalPrice)
|
||||
}}</text
|
||||
></view
|
||||
>
|
||||
|
@ -85,22 +87,25 @@ const getList = (v?: boolean) => {
|
|||
ReceiveApi.getOrderPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.list = pageList.list.concat(
|
||||
res.data.list.map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
})
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
|
||||
}
|
||||
});
|
||||
} else if (state.type === "2") {
|
||||
ShipmentApi.getOrderPage(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
|
||||
pageList.list = pageList.list.concat(
|
||||
res.data.list.map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
})
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -79,12 +79,9 @@ const handleSelect = (item: any) => {
|
|||
};
|
||||
const getList = () => {
|
||||
if (props.isShipment) {
|
||||
|
||||
GoodsApi.getChildrenList().then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
state.list = res.data;
|
||||
}
|
||||
state.list = res.data;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -65,7 +65,7 @@ const handleModal = (v: boolean, id: number) => {
|
|||
deleteId.value = id;
|
||||
};
|
||||
const handleOk = () => {
|
||||
deleteCustomer({id: deleteId.value})
|
||||
deleteCustomer({ id: deleteId.value });
|
||||
};
|
||||
const state = reactive<any>({
|
||||
name: "",
|
||||
|
@ -125,16 +125,16 @@ const getList = (v?: boolean) => {
|
|||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
pageList.isLoading = true;
|
||||
CustomerApi.getCustomUserPage(params).then((res) => {
|
||||
CustomerApi.getCustomUserPage(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
pageList.total = (res.data as any).total;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
onShow(() => {
|
||||
resetPageList()
|
||||
resetPageList();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -126,10 +126,8 @@ const getList = (v?: boolean) => {
|
|||
pageList.isLoading = true;
|
||||
ProfileApi.getRoleList(params).then((res) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = res.data as any;
|
||||
}
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = res.data as any;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ const handleModal = (v: boolean, id: number) => {
|
|||
deleteId.value = id;
|
||||
};
|
||||
const handleOk = () => {
|
||||
deleteStockCard({id: deleteId.value})
|
||||
deleteStockCard({ id: deleteId.value });
|
||||
};
|
||||
|
||||
const state = reactive<any>({
|
||||
|
@ -131,17 +131,18 @@ const getList = (v?: boolean) => {
|
|||
if (state.supplierTypeId > -1) {
|
||||
params.supplierTypeId = state.supplierTypeId;
|
||||
}
|
||||
StockCardApi.getStockCardList(params).then((res) => {
|
||||
pageList.isLoading = true;
|
||||
StockCardApi.getStockCardList(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === 200) {
|
||||
(pageList as any).list = (res.data as any).list;
|
||||
}
|
||||
pageList.isLoading = false;
|
||||
pageList.list = pageList.list = pageList.list.concat(res.data.list);
|
||||
pageList.total = res.data.total;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
onShow(() => {
|
||||
resetPageList()
|
||||
resetPageList();
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -551,9 +551,14 @@ watch(
|
|||
}
|
||||
}
|
||||
model1.order.totalPrice =
|
||||
(model1.order.price || 0) * (model1.order.netWeight || 0);
|
||||
Math.round(
|
||||
(model1.order.price || 0) * (model1.order.netWeight || 0) * 100
|
||||
) / 100;
|
||||
|
||||
// 货款金额默认=预估总价,当系统自动算出预估总价时,值需同步
|
||||
model1.order.balanceTotalPrice = model1.order.totalPrice;
|
||||
if (<number>model1.order.balanceTotalPrice <= 0) {
|
||||
model1.order.balanceTotalPrice = model1.order.totalPrice;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -590,7 +595,6 @@ const handleBack = () => {
|
|||
// const files = ref<FileObj[]>([]);
|
||||
const filesRef = ref();
|
||||
const handleUpload = () => {
|
||||
// console.log(event.tempFilePaths)
|
||||
return filesRef.value[0].filesList.map((item: any, index: number) => {
|
||||
if (item.fileID) {
|
||||
return;
|
||||
|
@ -621,7 +625,6 @@ const handleUpload = () => {
|
|||
*
|
||||
*/
|
||||
const handleDelete = (e: any) => {
|
||||
console.log(model1.order.fileLists);
|
||||
if (e.tempFile.fileID) {
|
||||
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
|
@ -703,9 +706,14 @@ const save = () => {
|
|||
};
|
||||
const startSave = () => {
|
||||
Promise.all(handleUpload()).then((res) => {
|
||||
console.log("***** 所有文件已经上传成功", res);
|
||||
if (res.filter((item) => item).length > 0) {
|
||||
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
|
||||
(res1) => {
|
||||
console.log(
|
||||
"***** 关联的内容是",
|
||||
res.filter((item) => item)
|
||||
);
|
||||
if (res1.code === 200) {
|
||||
console.log("*** 资源文件更新成功");
|
||||
}
|
||||
|
@ -724,11 +732,14 @@ const updateOrder = () => {
|
|||
零皮重 scaleState = 2 带审核
|
||||
*/
|
||||
// 若是补单数据 则不做此判断
|
||||
if (!model1.order.repairFlag) {
|
||||
if (model1.order.weighingMethod === 0) {
|
||||
model1.order.scaleStatus = 1;
|
||||
} else if (model1.order.weighingMethod === 1) {
|
||||
model1.order.scaleStatus = 2;
|
||||
// 到待审核状态不用关心补单的逻辑
|
||||
if (<number>model1.order.scaleStatus < 2) {
|
||||
if (!model1.order.repairFlag) {
|
||||
if (model1.order.weighingMethod === 0) {
|
||||
model1.order.scaleStatus = 1;
|
||||
} else if (model1.order.weighingMethod === 1) {
|
||||
model1.order.scaleStatus = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,7 +823,7 @@ onLoad((option) => {
|
|||
}
|
||||
|
||||
uni.$on("pricingParams", (data) => {
|
||||
model1.order.userName = data.name
|
||||
model1.order.userName = data.name;
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -289,12 +289,14 @@ const getList = (v?: boolean) => {
|
|||
pageNumber: pageList.pageNum,
|
||||
scaleStatus: currentTab.value,
|
||||
userName: keyword.value
|
||||
}).then((res) => {
|
||||
}).then((res:any) => {
|
||||
if (res.code === 200) {
|
||||
pageList.isLoading = false;
|
||||
(pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
});
|
||||
pageList.list = pageList.list.concat(
|
||||
res.data.list.map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
})
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -243,11 +243,11 @@ const getList = (v?: boolean) => {
|
|||
// (pageList as any).list = (res.data.list as any).map((item: any) => {
|
||||
// return { ...item, isChecked: false };
|
||||
// });
|
||||
(pageList as any).list = (pageList as any).list.concat(
|
||||
(res.data.list as any).map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
})
|
||||
);
|
||||
pageList.list = pageList.list.concat(
|
||||
res.data.list.map((item: any) => {
|
||||
return { ...item, isChecked: false };
|
||||
})
|
||||
);
|
||||
pageList.total = (res.data as any).total;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -9,7 +9,8 @@ let baseUrl = "";
|
|||
// #endif
|
||||
|
||||
const store = useMemberStore(pinia);
|
||||
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV].VITE_APP_BASE_URL;
|
||||
baseUrl = (process.env as any).config[(process.env as any).NODE_ENV]
|
||||
.VITE_APP_BASE_URL;
|
||||
|
||||
const obj = {
|
||||
// 拦截前触发
|
||||
|
@ -18,12 +19,11 @@ const obj = {
|
|||
options.timeout = 10000;
|
||||
// 拼接完整路径
|
||||
if (!options.url.startsWith("http")) {
|
||||
if (options.url.indexOf('/prod/gateway/api/db/getDbInfo') === -1 ) {
|
||||
if (options.url.indexOf("/prod/gateway/api/db/getDbInfo") === -1) {
|
||||
options.url = baseUrl + store.profile.childPath + options.url;
|
||||
} else {
|
||||
options.url = baseUrl + options.url;
|
||||
}
|
||||
|
||||
}
|
||||
// 请求头标识
|
||||
// 1.小程序唯一标识
|
||||
|
@ -56,35 +56,92 @@ interface Data<T> {
|
|||
*/
|
||||
export const http = <T>(options: UniApp.RequestOptions) => {
|
||||
return new Promise<Data<T>>((resolve, reject) => {
|
||||
console.log(options);
|
||||
if ((options as any).header?.type === "UPLOAD") {
|
||||
uni.uploadFile({
|
||||
header: {
|
||||
"x-userToken": store.profile?.token,
|
||||
// #ifdef H5
|
||||
"Content-Type": "multipart/form-data",
|
||||
// #endif
|
||||
// 压缩图片
|
||||
uni.compressImage({
|
||||
src: (options as any).data.path,
|
||||
quality: 80, // 压缩质量
|
||||
success: (compressRes) => {
|
||||
const compressedTempFilePath = compressRes.tempFilePath;
|
||||
console.log('******* 压缩啦', compressedTempFilePath)
|
||||
uni.uploadFile({
|
||||
header: {
|
||||
"x-userToken": store.profile?.token,
|
||||
// #ifdef H5
|
||||
"Content-Type": "multipart/form-data",
|
||||
// #endif
|
||||
},
|
||||
timeout: 1800000,
|
||||
url: baseUrl + store.profile.childPath + options.url,//仅为示例,非真实的接口地址
|
||||
fileType: "image",
|
||||
// #ifdef H5
|
||||
files: (options as any).data.files,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: compressedTempFilePath,
|
||||
// #endif
|
||||
name: "file",
|
||||
formData: {
|
||||
file: (options as any).data.files,
|
||||
}, // HTTP 请求中其他额外的 form data
|
||||
success: (res) => {
|
||||
resolve(JSON.parse(res.data) as Data<T>);
|
||||
},
|
||||
fail(err) {
|
||||
console.log("上传失败了", err);
|
||||
resolve(err as any);
|
||||
},
|
||||
});
|
||||
|
||||
// 上传图片
|
||||
// uni.uploadFile({
|
||||
// url: 'https://your-api-upload-endpoint.com/upload', // 你的上传接口
|
||||
// filePath: compressedTempFilePath,
|
||||
// name: 'file',
|
||||
// formData: {
|
||||
// 'user': 'test'
|
||||
// },
|
||||
// success: (uploadFileRes) => {
|
||||
// console.log('upload success:', uploadFileRes);
|
||||
// },
|
||||
// fail: (uploadFileErr) => {
|
||||
// console.error('upload fail:', uploadFileErr);
|
||||
// }
|
||||
// });
|
||||
},
|
||||
url: baseUrl + options.url, //仅为示例,非真实的接口地址
|
||||
fileType: "image",
|
||||
// #ifdef H5
|
||||
files: (options as any).data.files,
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
filePath: (options as any).data.path,
|
||||
// #endif
|
||||
name: "file",
|
||||
formData: {
|
||||
file: (options as any).data.files,
|
||||
}, // HTTP 请求中其他额外的 form data
|
||||
success: (res) => {
|
||||
resolve(JSON.parse(res.data) as Data<T>);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
resolve(err as any);
|
||||
fail: (compressErr) => {
|
||||
console.error("compress fail:", compressErr);
|
||||
},
|
||||
});
|
||||
|
||||
// uni.uploadFile({
|
||||
// header: {
|
||||
// "x-userToken": store.profile?.token,
|
||||
// // #ifdef H5
|
||||
// "Content-Type": "multipart/form-data",
|
||||
// // #endif
|
||||
// },
|
||||
// timeout: 1800000,
|
||||
// url: baseUrl + store.profile.childPath + options.url,//仅为示例,非真实的接口地址
|
||||
// fileType: "image",
|
||||
// // #ifdef H5
|
||||
// files: (options as any).data.files,
|
||||
// // #endif
|
||||
// // #ifdef MP-WEIXIN
|
||||
// filePath: (options as any).data.path,
|
||||
// // #endif
|
||||
// name: "file",
|
||||
// formData: {
|
||||
// file: (options as any).data.files,
|
||||
// }, // HTTP 请求中其他额外的 form data
|
||||
// success: (res) => {
|
||||
// resolve(JSON.parse(res.data) as Data<T>);
|
||||
// },
|
||||
// fail(err) {
|
||||
// console.log("上传失败了", err);
|
||||
// resolve(err as any);
|
||||
// },
|
||||
// });
|
||||
} else {
|
||||
uni.request({
|
||||
...options,
|
||||
|
@ -141,7 +198,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
|
|||
icon: "none",
|
||||
// title: JSON.stringify(err),
|
||||
title: "网络错误,请检查网络",
|
||||
|
||||
});
|
||||
reject(err);
|
||||
},
|
||||
|
|
|
@ -259,3 +259,4 @@ export function getScaleStatus(type: number, value: number) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue