diff --git a/src/PagesStatistics/components/ProductDialog.vue b/src/PagesStatistics/components/ProductDialog.vue index 0643147..011cf8f 100644 --- a/src/PagesStatistics/components/ProductDialog.vue +++ b/src/PagesStatistics/components/ProductDialog.vue @@ -92,7 +92,7 @@ onMounted(() => { border: 1px solid rgba(153, 153, 153, 0.64); text-align: center; cursor: pointer; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; margin-right: 10rpx; diff --git a/src/PagesStatistics/components/ProductTypeDialog.vue b/src/PagesStatistics/components/ProductTypeDialog.vue index 17ee13d..6e906e1 100644 --- a/src/PagesStatistics/components/ProductTypeDialog.vue +++ b/src/PagesStatistics/components/ProductTypeDialog.vue @@ -115,7 +115,7 @@ onMounted(() => { border: 1px solid rgba(153, 153, 153, 0.64); text-align: center; cursor: pointer; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; margin-bottom: 20rpx; margin-left: 10rpx; margin-right: 10rpx; diff --git a/src/components/PageView/index.vue b/src/components/PageView/index.vue index 122ff37..28afe25 100644 --- a/src/components/PageView/index.vue +++ b/src/components/PageView/index.vue @@ -5,11 +5,19 @@ @scrolltolower="loadMore" :style="{ 'max-height': clientHeight + 'px' }" > - + - 加载中... - - + + + + + + @@ -20,14 +28,19 @@ import { onLoad } from "@dcloudio/uni-app"; const props = withDefaults( defineProps<{ noMoreData: boolean; + isLoading: boolean + list: any; + height: number; }>(), { noMoreData: false, + isLoading: false, + list: [], + height: 80, } ); const emit = defineEmits(["loadList"]); -const isLoading = ref(false); const clientHeight = ref(500); const loadMore = () => { @@ -50,7 +63,8 @@ const getBarHeight = () => { const getClineHeight = () => { uni.getSystemInfo({ success: (res) => { - clientHeight.value = res.windowHeight - uni.upx2px(80) - getBarHeight(); + clientHeight.value = + res.windowHeight - uni.upx2px(props.height) - getBarHeight(); }, }); }; diff --git a/src/pages.json b/src/pages.json index 00e44a1..1e5a198 100644 --- a/src/pages.json +++ b/src/pages.json @@ -105,12 +105,6 @@ "navigationBarTitleText": "待定价" } }, - { - "path": "tareing", - "style": { - "navigationBarTitleText": "待过皮重" - } - }, { "path": "payReview", "style": { diff --git a/src/pagesApp/components/addCustomer.vue b/src/pagesApp/components/addCustomer.vue index f0a3fb3..a751943 100644 --- a/src/pagesApp/components/addCustomer.vue +++ b/src/pagesApp/components/addCustomer.vue @@ -186,7 +186,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addReceiveProduct.vue b/src/pagesApp/components/addReceiveProduct.vue index 2631f03..ac9bb72 100644 --- a/src/pagesApp/components/addReceiveProduct.vue +++ b/src/pagesApp/components/addReceiveProduct.vue @@ -203,7 +203,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addReceiveType.vue b/src/pagesApp/components/addReceiveType.vue index 76a7494..48cd0e5 100644 --- a/src/pagesApp/components/addReceiveType.vue +++ b/src/pagesApp/components/addReceiveType.vue @@ -155,7 +155,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addRole.vue b/src/pagesApp/components/addRole.vue index 60515d7..6b0f695 100644 --- a/src/pagesApp/components/addRole.vue +++ b/src/pagesApp/components/addRole.vue @@ -223,7 +223,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addShipmentProduct.vue b/src/pagesApp/components/addShipmentProduct.vue index 4bc8e0b..54ca567 100644 --- a/src/pagesApp/components/addShipmentProduct.vue +++ b/src/pagesApp/components/addShipmentProduct.vue @@ -223,7 +223,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addShipmentType.vue b/src/pagesApp/components/addShipmentType.vue index 09ac4f2..5d9950f 100644 --- a/src/pagesApp/components/addShipmentType.vue +++ b/src/pagesApp/components/addShipmentType.vue @@ -157,7 +157,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addStockCard.vue b/src/pagesApp/components/addStockCard.vue index 29ef3bd..3961b2e 100644 --- a/src/pagesApp/components/addStockCard.vue +++ b/src/pagesApp/components/addStockCard.vue @@ -166,7 +166,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addSupplier.vue b/src/pagesApp/components/addSupplier.vue index ac0120e..0ca40b7 100644 --- a/src/pagesApp/components/addSupplier.vue +++ b/src/pagesApp/components/addSupplier.vue @@ -259,7 +259,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addSupplierType.vue b/src/pagesApp/components/addSupplierType.vue index 25332fd..3cbb820 100644 --- a/src/pagesApp/components/addSupplierType.vue +++ b/src/pagesApp/components/addSupplierType.vue @@ -155,7 +155,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/components/addUser.vue b/src/pagesApp/components/addUser.vue index 85663b7..4293ff5 100644 --- a/src/pagesApp/components/addUser.vue +++ b/src/pagesApp/components/addUser.vue @@ -218,7 +218,7 @@ onLoad((option) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/customerMgt.vue b/src/pagesApp/customerMgt.vue index f1dc2d9..1a5fbda 100644 --- a/src/pagesApp/customerMgt.vue +++ b/src/pagesApp/customerMgt.vue @@ -107,7 +107,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/receiveProduct.vue b/src/pagesApp/receiveProduct.vue index b6e7841..0213ebc 100644 --- a/src/pagesApp/receiveProduct.vue +++ b/src/pagesApp/receiveProduct.vue @@ -119,7 +119,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 28rpx; color: #000000; diff --git a/src/pagesApp/receiveSpl.vue b/src/pagesApp/receiveSpl.vue index 5af33b4..dda7d97 100644 --- a/src/pagesApp/receiveSpl.vue +++ b/src/pagesApp/receiveSpl.vue @@ -366,7 +366,7 @@ const handleTime = (v: any) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/receiveType.vue b/src/pagesApp/receiveType.vue index b47b56b..f0edf03 100644 --- a/src/pagesApp/receiveType.vue +++ b/src/pagesApp/receiveType.vue @@ -106,7 +106,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/role.vue b/src/pagesApp/role.vue index bbf69df..cb1c4ba 100644 --- a/src/pagesApp/role.vue +++ b/src/pagesApp/role.vue @@ -122,7 +122,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/shipmentProduct.vue b/src/pagesApp/shipmentProduct.vue index 51d4247..a073d45 100644 --- a/src/pagesApp/shipmentProduct.vue +++ b/src/pagesApp/shipmentProduct.vue @@ -119,7 +119,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 28rpx; color: #000000; diff --git a/src/pagesApp/shipmentSpl.vue b/src/pagesApp/shipmentSpl.vue index f341119..48177ad 100644 --- a/src/pagesApp/shipmentSpl.vue +++ b/src/pagesApp/shipmentSpl.vue @@ -387,7 +387,7 @@ const handleTime = (v: any) => { // box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; margin: 30rpx 25rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; ::v-deep .u-form-item { height: auto; } diff --git a/src/pagesApp/shipmentType.vue b/src/pagesApp/shipmentType.vue index 56e1906..081f6d7 100644 --- a/src/pagesApp/shipmentType.vue +++ b/src/pagesApp/shipmentType.vue @@ -130,7 +130,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/stockCard.vue b/src/pagesApp/stockCard.vue index 90d4127..bdc2cb2 100644 --- a/src/pagesApp/stockCard.vue +++ b/src/pagesApp/stockCard.vue @@ -108,7 +108,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/supplierMgt.vue b/src/pagesApp/supplierMgt.vue index b8850f0..ebcf67c 100644 --- a/src/pagesApp/supplierMgt.vue +++ b/src/pagesApp/supplierMgt.vue @@ -141,7 +141,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 28rpx; color: #000000; diff --git a/src/pagesApp/supplierType.vue b/src/pagesApp/supplierType.vue index d62a57e..334ff6d 100644 --- a/src/pagesApp/supplierType.vue +++ b/src/pagesApp/supplierType.vue @@ -130,7 +130,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesApp/user.vue b/src/pagesApp/user.vue index c0cea77..1ef9122 100644 --- a/src/pagesApp/user.vue +++ b/src/pagesApp/user.vue @@ -20,6 +20,7 @@ } " :noMoreData="pageList.noMoreData" + :list="pageList.list" > @@ -142,7 +143,7 @@ onMounted(() => { background: #ffffff; box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(5, 68, 37, 0.12); border-radius: 13rpx; - padding: 10rpx 20rpx; + padding: 0rpx 20rpx; font-weight: 400; font-size: 26rpx; color: #000000; diff --git a/src/pagesHome/index.vue b/src/pagesHome/index.vue index 58660b8..05d070c 100644 --- a/src/pagesHome/index.vue +++ b/src/pagesHome/index.vue @@ -212,7 +212,7 @@ const receiveList = reactive([ num: 0, fn: () => { uni.navigateTo({ - url: "/pagesReceive/pricing", // 要跳转到的页面路径 + url: "/pagesReceive/pricing?scaleStatus=0", // 要跳转到的页面路径 }); }, }, @@ -221,7 +221,7 @@ const receiveList = reactive([ num: 0, fn: () => { uni.navigateTo({ - url: "/pagesReceive/tareing", // 要跳转到的页面路径 + url: "/pagesReceive/pricing?scaleStatus=1", // 要跳转到的页面路径 }); }, }, diff --git a/src/pagesReceive/form/pricingForm.vue b/src/pagesReceive/form/pricingForm.vue index 0a71897..1512665 100644 --- a/src/pagesReceive/form/pricingForm.vue +++ b/src/pagesReceive/form/pricingForm.vue @@ -7,14 +7,16 @@ ref="form" :labelWidth="80" :labelStyle="{ padding: '0rpx 10rpx' }" + :errorType="'border-bottom'" > - - + @@ -112,21 +113,45 @@ const model1 = reactive<{ order: Order }>({ buttonType: 0, // 0扣杂1扣点 weighingMethod: 0, // 0:有皮重 1:零皮重 multiCategory: 0, // 0:单品类 1:多品类 - fileList: [], + fileLists: [], scaleStatus: 1, }, }); -const rules = ref({ - "userInfo.userName": { +const rules = reactive({ + "order.userName": { type: "string", required: true, - message: "请输入手机号", + message: "请输入选择供应商", trigger: ["blur", "change"], }, - "userInfo.password": { + "order.productName": { type: "string", required: true, - message: "请输入密码", + message: "请选择收货产品名称", + trigger: ["blur", "change"], + }, + "order.price": { + type: "number", + required: true, + message: "请输入单价", + trigger: ["blur", "change"], + }, + "order.grossWeight": { + type: "number", + required: true, + message: "请输入毛重", + trigger: ["blur", "change"], + }, + "order.weighingMethod": { + type: "number", + required: true, + message: "请选择称重方式", + trigger: ["blur", "change"], + }, + "order.multiCategory": { + type: "number", + required: true, + message: "请选择品类", trigger: ["blur", "change"], }, }); @@ -282,67 +307,97 @@ const handleSelect = (key: string, v: any) => { } }; -onLoad((option) => { - model1.order.id = parseInt((option as any).id); - if (model1.order.id) { - ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => { - if (res.code === 200) { - model1.order = res.data; - } - }); - PictureApi.getAnnex({ - businessId: model1.order.id.toString(), - orderType: 1, - imagesType: ImagesType.NORMARL, - }).then((res) => { - if (res.code === 200) { - } - }); - } -}); +const handleBack = () => { + uni.navigateBack(); +}; + // const files = ref([]); const filesRef = ref(); const handleUpload = () => { // console.log(event.tempFilePaths) - const list = filesRef.value[0].filesList; - return list.map((item: any) => { + return filesRef.value[0].filesList.map((item: any, index: number) => { + if (item.fileID) { + return; + } return new Promise((resolve) => { PictureApi.upload({ files: item, path: item.path, - }).then((res) => { - if (res.code === 200) { - resolve({ - ...(res.data as any), - businessId: model1.order.id, - imagesType: ImagesType.NORMARL, // 普通资源 - orderType: OrderType.Receive, // 入库单 - }); - } - }); + }) + .then((res) => { + if (res.code === 200) { + resolve({ + ...(res.data as any), + businessId: model1.order.id, + imagesType: ImagesType.NORMARL, // 普通资源 + orderType: OrderType.Receive, // 入库单 + }); + } + }) + .catch((e) => { + return; + }); }); }); }; +/** + * + */ +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) { + uni.showToast({ title: "已删除" }); + } + }); + } +}; + /** * 点击保存 先执行upload接口 * 上传成功后 保存图片资源 和更新订单数据 */ -const save = () => { - Promise.all(handleUpload()).then((res) => { - // 上传多个资源 - if (res.length > 0) { - PictureApi.addListAnnex({ annexPos: res }).then((res1) => { - if (res1.code === 200) { - uni.showToast({ - title: "图片资源上传成功", - icon: "success", - }); - } +const form = ref(); +const check = () => { + return new Promise((resolve) => { + form.value + .validate() + .then((res: boolean) => { + resolve(res); + }) + .catch((errors: any) => { + resolve(false); + uni.showToast({ + icon: "none", + title: errors[0].message || "校验失败", + }); }); + }); +}; +const save = () => { + check().then((res) => { + if (res) { + startSave(); } }); +}; +const startSave = () => { + Promise.all(handleUpload()).then((res) => { + if (res.filter((item) => item).length > 0) { + PictureApi.addListAnnex({ annexPos: res.filter((item) => item) }).then( + (res1) => { + if (res1.code === 200) { + updateOrder() + } + } + ); + } + }); +}; +const updateOrder = () => { // 更新定价单 /** * 0:有皮重 1:零皮重 @@ -375,18 +430,43 @@ const save = () => { icon: "success", }); // 0:有皮重 1:零皮重 - if (model1.order.weighingMethod === 0) { - uni.navigateTo({ - url: "/pagesReceive/tareing", // 要跳转到的页面路径 - }); - } else if (model1.order.weighingMethod === 1) { - uni.navigateTo({ - url: "/pages/index/payReview", // 要跳转到的页面路径 - }); - } + uni.redirectTo({ + url: "/pagesHome/index", // 要跳转到的页面路径 + }); } }); }; + +onLoad((option) => { + model1.order.id = parseInt((option as any).id); + if (model1.order.id) { + ReceiveApi.getDetailById({ id: model1.order.id }).then((res) => { + if (res.code === 200) { + // 基于id查询重新赋值 + model1.order = { + ...res.data, + buttonType: res.data.buttonType !== null ? res.data.buttonType : 0, + weighingMethod: + res.data.weighingMethod !== null ? res.data.weighingMethod : 0, + multiCategory: + res.data.multiCategory !== null ? res.data.multiCategory : 0, + fileLists: model1.order.fileLists.map((item: any) => { + return { ...item, fileID: item.id }; + }), + }; + } + }); + PictureApi.getAnnex({ + businessId: model1.order.id.toString(), + orderType: 1, + imagesType: ImagesType.NORMARL, + }).then((res) => { + if (res.code === 200) { + model1.order.fileLists = res.data; + } + }); + } +}); diff --git a/src/pagesScenePhoto/index.vue b/src/pagesScenePhoto/index.vue index f71a462..2e606b4 100644 --- a/src/pagesScenePhoto/index.vue +++ b/src/pagesScenePhoto/index.vue @@ -17,12 +17,16 @@ + + + +