1. 账单详情  出货结算 付款审核 客户列表 库存卡对应的分页
2. 定价单:预估总价显示问题 当为待审核是不用判断是否为补单数据
3. 上传对应的接口url更新
This commit is contained in:
admin 2024-06-06 16:47:00 +08:00
parent 6725ac0f3f
commit ebd6e37efa
10 changed files with 147 additions and 76 deletions

View File

@ -26,7 +26,9 @@
<view <view
>{{ state.type === "1" ? "应付" : "应收" }}金额<text class="num" >{{ 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 }}</text
></view ></view
> >
@ -85,22 +87,25 @@ const getList = (v?: boolean) => {
ReceiveApi.getOrderPage(params).then((res) => { ReceiveApi.getOrderPage(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => { pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false }; return { ...item, isChecked: false };
}); })
);
pageList.total = (res.data as any).total; pageList.total = (res.data as any).total;
} }
}); });
} else if (state.type === "2") { } else if (state.type === "2") {
ShipmentApi.getOrderPage(params).then((res) => { ShipmentApi.getOrderPage(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => {
return { ...item, isChecked: false };
});
pageList.total = (res.data as any).total;
pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false };
})
);
pageList.total = (res.data as any).total;
} }
}); });
} }

View File

@ -79,13 +79,10 @@ const handleSelect = (item: any) => {
}; };
const getList = () => { const getList = () => {
if (props.isShipment) { if (props.isShipment) {
GoodsApi.getChildrenList().then((res) => { GoodsApi.getChildrenList().then((res) => {
if (res.code === 200) {
if (res.code === 200) { if (res.code === 200) {
state.list = res.data; state.list = res.data;
} }
}
}); });
} else { } else {
ReceiveProductApi.getAllReProducts().then((res) => { ReceiveProductApi.getAllReProducts().then((res) => {

View File

@ -65,7 +65,7 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id; deleteId.value = id;
}; };
const handleOk = () => { const handleOk = () => {
deleteCustomer({id: deleteId.value}) deleteCustomer({ id: deleteId.value });
}; };
const state = reactive<any>({ const state = reactive<any>({
name: "", name: "",
@ -125,16 +125,16 @@ const getList = (v?: boolean) => {
params.supplierTypeId = state.supplierTypeId; params.supplierTypeId = state.supplierTypeId;
} }
pageList.isLoading = true; pageList.isLoading = true;
CustomerApi.getCustomUserPage(params).then((res) => { CustomerApi.getCustomUserPage(params).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = (res.data as any).list; pageList.list = pageList.list = pageList.list.concat(res.data.list);
pageList.total = (res.data as any).total; pageList.total = res.data.total;
} }
}); });
}; };
onShow(() => { onShow(() => {
resetPageList() resetPageList();
getList(); getList();
}); });
</script> </script>

View File

@ -125,12 +125,10 @@ const getList = (v?: boolean) => {
}; };
pageList.isLoading = true; pageList.isLoading = true;
ProfileApi.getRoleList(params).then((res) => { ProfileApi.getRoleList(params).then((res) => {
if (res.code === 200) {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = res.data as any; (pageList as any).list = res.data as any;
} }
}
}); });
}; };

View File

@ -71,7 +71,7 @@ const handleModal = (v: boolean, id: number) => {
deleteId.value = id; deleteId.value = id;
}; };
const handleOk = () => { const handleOk = () => {
deleteStockCard({id: deleteId.value}) deleteStockCard({ id: deleteId.value });
}; };
const state = reactive<any>({ const state = reactive<any>({
@ -131,17 +131,18 @@ const getList = (v?: boolean) => {
if (state.supplierTypeId > -1) { if (state.supplierTypeId > -1) {
params.supplierTypeId = state.supplierTypeId; 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) {
if (res.code === 200) { pageList.isLoading = false;
(pageList as any).list = (res.data as any).list; pageList.list = pageList.list = pageList.list.concat(res.data.list);
} pageList.total = res.data.total;
} }
}); });
}; };
onShow(() => { onShow(() => {
resetPageList() resetPageList();
getList(); getList();
}); });
</script> </script>

View File

@ -551,10 +551,15 @@ watch(
} }
} }
model1.order.totalPrice = model1.order.totalPrice =
(model1.order.price || 0) * (model1.order.netWeight || 0); Math.round(
(model1.order.price || 0) * (model1.order.netWeight || 0) * 100
) / 100;
// = // =
if (<number>model1.order.balanceTotalPrice <= 0) {
model1.order.balanceTotalPrice = model1.order.totalPrice; model1.order.balanceTotalPrice = model1.order.totalPrice;
} }
}
); );
// SupplierApi.getSupplierUserList({}).then((res) => { // SupplierApi.getSupplierUserList({}).then((res) => {
@ -590,7 +595,6 @@ const handleBack = () => {
// const files = ref<FileObj[]>([]); // const files = ref<FileObj[]>([]);
const filesRef = ref(); const filesRef = ref();
const handleUpload = () => { const handleUpload = () => {
// console.log(event.tempFilePaths)
return filesRef.value[0].filesList.map((item: any, index: number) => { return filesRef.value[0].filesList.map((item: any, index: number) => {
if (item.fileID) { if (item.fileID) {
return; return;
@ -621,7 +625,6 @@ const handleUpload = () => {
* *
*/ */
const handleDelete = (e: any) => { const handleDelete = (e: any) => {
console.log(model1.order.fileLists);
if (e.tempFile.fileID) { if (e.tempFile.fileID) {
PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => { PictureApi.deleteById({ id: e.tempFile.fileID }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
@ -703,9 +706,14 @@ const save = () => {
}; };
const startSave = () => { const startSave = () => {
Promise.all(handleUpload()).then((res) => { Promise.all(handleUpload()).then((res) => {
console.log("***** 所有文件已经上传成功", res);
if (res.filter((item) => item).length > 0) { if (res.filter((item) => item).length > 0) {
PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then( PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then(
(res1) => { (res1) => {
console.log(
"***** 关联的内容是",
res.filter((item) => item)
);
if (res1.code === 200) { if (res1.code === 200) {
console.log("*** 资源文件更新成功"); console.log("*** 资源文件更新成功");
} }
@ -724,6 +732,8 @@ const updateOrder = () => {
零皮重 scaleState = 2 带审核 零皮重 scaleState = 2 带审核
*/ */
// //
//
if (<number>model1.order.scaleStatus < 2) {
if (!model1.order.repairFlag) { if (!model1.order.repairFlag) {
if (model1.order.weighingMethod === 0) { if (model1.order.weighingMethod === 0) {
model1.order.scaleStatus = 1; model1.order.scaleStatus = 1;
@ -731,6 +741,7 @@ const updateOrder = () => {
model1.order.scaleStatus = 2; model1.order.scaleStatus = 2;
} }
} }
}
// //
/** /**
@ -812,7 +823,7 @@ onLoad((option) => {
} }
uni.$on("pricingParams", (data) => { uni.$on("pricingParams", (data) => {
model1.order.userName = data.name model1.order.userName = data.name;
}); });
}); });

View File

@ -289,12 +289,14 @@ const getList = (v?: boolean) => {
pageNumber: pageList.pageNum, pageNumber: pageList.pageNum,
scaleStatus: currentTab.value, scaleStatus: currentTab.value,
userName: keyword.value userName: keyword.value
}).then((res) => { }).then((res:any) => {
if (res.code === 200) { if (res.code === 200) {
pageList.isLoading = false; pageList.isLoading = false;
(pageList as any).list = (res.data.list as any).map((item: any) => { pageList.list = pageList.list.concat(
res.data.list.map((item: any) => {
return { ...item, isChecked: false }; return { ...item, isChecked: false };
}); })
);
pageList.total = (res.data as any).total; pageList.total = (res.data as any).total;
} }
}); });

View File

@ -243,8 +243,8 @@ const getList = (v?: boolean) => {
// (pageList as any).list = (res.data.list as any).map((item: any) => { // (pageList as any).list = (res.data.list as any).map((item: any) => {
// return { ...item, isChecked: false }; // return { ...item, isChecked: false };
// }); // });
(pageList as any).list = (pageList as any).list.concat( pageList.list = pageList.list.concat(
(res.data.list as any).map((item: any) => { res.data.list.map((item: any) => {
return { ...item, isChecked: false }; return { ...item, isChecked: false };
}) })
); );

View File

@ -9,7 +9,8 @@ let baseUrl = "";
// #endif // #endif
const store = useMemberStore(pinia); 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 = { const obj = {
// 拦截前触发 // 拦截前触发
@ -18,12 +19,11 @@ const obj = {
options.timeout = 10000; options.timeout = 10000;
// 拼接完整路径 // 拼接完整路径
if (!options.url.startsWith("http")) { 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; options.url = baseUrl + store.profile.childPath + options.url;
} else { } else {
options.url = baseUrl + options.url; options.url = baseUrl + options.url;
} }
} }
// 请求头标识 // 请求头标识
// 1.小程序唯一标识 // 1.小程序唯一标识
@ -56,8 +56,14 @@ interface Data<T> {
*/ */
export const http = <T>(options: UniApp.RequestOptions) => { export const http = <T>(options: UniApp.RequestOptions) => {
return new Promise<Data<T>>((resolve, reject) => { return new Promise<Data<T>>((resolve, reject) => {
console.log(options);
if ((options as any).header?.type === "UPLOAD") { if ((options as any).header?.type === "UPLOAD") {
// 压缩图片
uni.compressImage({
src: (options as any).data.path,
quality: 80, // 压缩质量
success: (compressRes) => {
const compressedTempFilePath = compressRes.tempFilePath;
console.log('******* 压缩啦', compressedTempFilePath)
uni.uploadFile({ uni.uploadFile({
header: { header: {
"x-userToken": store.profile?.token, "x-userToken": store.profile?.token,
@ -65,13 +71,14 @@ export const http = <T>(options: UniApp.RequestOptions) => {
"Content-Type": "multipart/form-data", "Content-Type": "multipart/form-data",
// #endif // #endif
}, },
url: baseUrl + options.url, //仅为示例,非真实的接口地址 timeout: 1800000,
url: baseUrl + store.profile.childPath + options.url,//仅为示例,非真实的接口地址
fileType: "image", fileType: "image",
// #ifdef H5 // #ifdef H5
files: (options as any).data.files, files: (options as any).data.files,
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
filePath: (options as any).data.path, filePath: compressedTempFilePath,
// #endif // #endif
name: "file", name: "file",
formData: { formData: {
@ -81,10 +88,60 @@ export const http = <T>(options: UniApp.RequestOptions) => {
resolve(JSON.parse(res.data) as Data<T>); resolve(JSON.parse(res.data) as Data<T>);
}, },
fail(err) { fail(err) {
console.log(err); console.log("上传失败了", err);
resolve(err as any); 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);
// }
// });
},
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 { } else {
uni.request({ uni.request({
...options, ...options,
@ -141,7 +198,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
icon: "none", icon: "none",
// title: JSON.stringify(err), // title: JSON.stringify(err),
title: "网络错误,请检查网络", title: "网络错误,请检查网络",
}); });
reject(err); reject(err);
}, },

View File

@ -259,3 +259,4 @@ export function getScaleStatus(type: number, value: number) {
} }
} }
} }