From 5519cbf2e00c7ba4c650a542d98da99978124a30 Mon Sep 17 00:00:00 2001 From: 曹睿 <360930172@qq.com> Date: 星期四, 24 四月 2025 16:43:01 +0800 Subject: [PATCH] test: 测试生产管理 --- src/pages/production/wire/report/wire.vue | 32 +- src/pages/production/list/index.vue | 35 ++ src/api/product/manage.ts | 25 ++ src/pages/production/twist/receive/plate/index.vue | 22 +- src/pages/production/wire/selfInspect/index.vue | 62 +++-- src/pages/production/detail/wireDetail.vue | 13 + src/pages/production/twist/report/form.vue | 92 ++++--- src/pages/production/twist/backman/index.vue | 52 +++- src/pages/index/index.vue | 4 src/pages/production/wire/backman/index.vue | 50 +++- src/pages/production/twist/report/index.vue | 40 +- src/api/product/twist.ts | 6 src/pages/mine/index.vue | 8 src/pages/production/wire/report/wireForm.vue | 28 ++ src/pages/production/detail/twistDetail.vue | 13 + src/pages/production/twist/selfInspect/index.vue | 62 +++-- src/pages/production/wire/backman/form.vue | 45 +++ src/pages/production/twist/receive/steelCore/index.vue | 11 src/components/product_card/index.vue | 14 19 files changed, 401 insertions(+), 213 deletions(-) diff --git a/src/api/product/manage.ts b/src/api/product/manage.ts index a8dad1b..6560356 100644 --- a/src/api/product/manage.ts +++ b/src/api/product/manage.ts @@ -36,6 +36,31 @@ data: params, }); }, + + // 鏌ヨ鏉傚伐淇℃伅 + getBackmanDetail(params: any) { + return request<BaseResult<any>>({ + url: "/app/getBackmanDetail", + method: "GET", + data: params, + }); + }, + + // 鑾峰彇鏉傚伐椤圭洰 + getBackmanDetailByType(params: any) { + return request<BaseResult<any>>({ + url: "/app/getBackmanDetailByType", + method: "GET", + data: params, + }); + }, + addBackmanDetail(params: any) { + return request<BaseResult<any>>({ + url: "/app/addBackmanDetail", + method: "POST", + data: params, + }); + }, }; export default ManageApi; diff --git a/src/api/product/twist.ts b/src/api/product/twist.ts index 78caaa4..57996cd 100644 --- a/src/api/product/twist.ts +++ b/src/api/product/twist.ts @@ -11,10 +11,10 @@ }); }, - // 鏂板鎷変笣鎶ュ伐 - addWireOutput(data: any) { + // 鏂板缁炰笣鎶ュ伐 + addTwistOutput(data: any) { return request<BaseResult<any>>({ - url: "/app/addWireOutput", + url: "/app/addWireOutput1", method: "POST", data: data, }); diff --git a/src/components/product_card/index.vue b/src/components/product_card/index.vue index 799875e..3cb28bb 100644 --- a/src/components/product_card/index.vue +++ b/src/components/product_card/index.vue @@ -2,9 +2,9 @@ <wd-card class="card_bg"> <template #title> <view class="flex justify-between w-full"> - <text class="font-medium text-[#252525]">璁惧缂栧彿: {{ data.deviceModel }}</text> + <text class="font-medium text-[#252525]">璁惧缂栧彿: {{ data[map.deviceModel] }}</text> <wd-tag color="#0D867F" bg-color="#E7F4EC"> - <text class="text-xs">{{ data.model }}</text> + <text class="text-xs">{{ data[map.model] }}</text> </wd-tag> </view> </template> @@ -16,7 +16,7 @@ </view> <text class="text-[#646874] mx-2"> 鎬婚渶姹傛暟閲�: - <text class="text-[#252525]">{{ data.totalAmount }}m</text> + <text class="text-[#252525]">{{ data[map.totalAmount] }}m</text> </text> </view> </wd-col> @@ -29,7 +29,7 @@ </view> <text class="text-[#646874] mx-2"> 宸茬敓浜ф暟閲�: - <text class="text-[#252525]">{{ data.amount }}m</text> + <text class="text-[#252525]">{{ data[map.amount] }}m</text> </text> </view> </wd-col> @@ -40,7 +40,7 @@ </view> <text class="text-[#646874] mx-2"> 寰呮帓浜ф暟閲�: - <text class="text-[#252525]">{{ data.unAmount }}m</text> + <text class="text-[#252525]">{{ data[map.unAmount] }}m</text> </text> </view> </wd-col> @@ -54,6 +54,10 @@ type: Object, default: () => {}, }, + map: { + type: Object, + default: () => {}, + }, }); </script> diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index a52c19c..6024963 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -32,7 +32,7 @@ </wd-grid> <!-- 鏁版嵁缁熻 --> - <wd-grid :column="2" :gutter="2"> + <!-- <wd-grid :column="2" :gutter="2"> <wd-grid-item use-slot custom-class="custom-item"> <view class="flex justify-start pl-5"> <view class="flex-center"> @@ -55,7 +55,7 @@ </view> </view> </wd-grid-item> - </wd-grid> + </wd-grid> --> <wd-card> <template #title> diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue index b76ea6e..04fb976 100644 --- a/src/pages/mine/index.vue +++ b/src/pages/mine/index.vue @@ -39,7 +39,7 @@ </view> <!-- 鏁版嵁缁熻 --> - <view class="stats-container"> + <!-- <view class="stats-container"> <view class="stat-item" @click="navigateToSection('wallet')"> <view class="stat-value">0.00</view> <view class="stat-label">鎴戠殑浣欓</view> @@ -54,10 +54,10 @@ <view class="stat-value">0</view> <view class="stat-label">娴忚鍘嗗彶</view> </view> - </view> + </view> --> <!-- 鎴戠殑璁㈠崟 --> - <view class="card-container"> + <!-- <view class="card-container"> <view class="card-header"> <view class="card-title"> <wd-icon name="cart" size="18" :color="themeStore.primaryColor" /> @@ -101,7 +101,7 @@ <view class="status-label">鍞悗</view> </view> </view> - </view> + </view> --> <!-- 甯哥敤宸ュ叿 --> <view class="card-container"> diff --git a/src/pages/production/detail/twistDetail.vue b/src/pages/production/detail/twistDetail.vue index 5c12575..6ccb078 100644 --- a/src/pages/production/detail/twistDetail.vue +++ b/src/pages/production/detail/twistDetail.vue @@ -1,6 +1,15 @@ <template> <view> - <ProductCard :data="cardData" /> + <ProductCard + :data="cardData" + :map="{ + deviceModel: 'deviceModel', + model: 'model', + totalAmount: 'totalAmount', + amount: 'amount', + unAmount: 'unAmount', + }" + /> <view class="mx-3"> <wd-grid class="rounded-lg" clickable> <wd-grid-item @@ -18,7 +27,7 @@ <wd-grid-item icon="tips" link-type="navigateTo" - url="/pages/production/twist/backman/index" + :url="`/pages/production/twist/backman/index?id=${paramsId}`" text="鏉傚伐" /> <wd-grid-item diff --git a/src/pages/production/detail/wireDetail.vue b/src/pages/production/detail/wireDetail.vue index 1e67d52..19abcd5 100644 --- a/src/pages/production/detail/wireDetail.vue +++ b/src/pages/production/detail/wireDetail.vue @@ -1,6 +1,15 @@ <template> <view class="pt-2"> - <ProductCard :data="cardData" /> + <ProductCard + :data="cardData" + :map="{ + deviceModel: 'deviceModel', + model: 'model', + totalAmount: 'totalAmount', + amount: 'amount', + unAmount: 'unAmount', + }" + /> <view class="mx-3"> <wd-grid class="rounded-lg" clickable> <wd-grid-item @@ -18,7 +27,7 @@ <wd-grid-item icon="tips" link-type="navigateTo" - url="/pages/production/wire/backman/index" + :url="`/pages/production/wire/backman/index?id=${paramsId}`" text="鏉傚伐" /> <wd-grid-item diff --git a/src/pages/production/list/index.vue b/src/pages/production/list/index.vue index 7d6c9ac..e64a901 100644 --- a/src/pages/production/list/index.vue +++ b/src/pages/production/list/index.vue @@ -13,13 +13,8 @@ <ProductCard v-for="(item, index) in list" :key="index" - :data="{ - deviceModel: item.deviceModel, - model: item.model, - totalAmount: item.totalLength, - amount: item.length, - unAmount: item.unLength, - }" + :data="item" + :map="map" @click="toDetail(item.id, item.type)" /> </z-paging> @@ -34,6 +29,13 @@ const userStore = useUserStore(); const userInfo: any = computed(() => userStore.userInfo); const pagingRef = ref(); +const map = reactive({ + deviceModel: "deviceModel", + model: "model", + totalAmount: "totalAmount", + amount: "amount", + unAmount: "unAmount", +}); const props = defineProps({ api: { type: Function, @@ -68,12 +70,25 @@ size: pageSize, }); if (code == 200) { - if (data.total == 0) { + if (data.type == "缁炵嚎") { + map.deviceModel = "deviceModel"; + map.model = "model"; + map.totalAmount = "totalLength"; + map.amount = "length"; + map.unAmount = "unLength"; + } else if (data.type == "鎷変笣") { + map.deviceModel = "deviceModel"; + map.model = "model"; + map.totalAmount = "totalAmount"; + map.amount = "amount"; + map.unAmount = "unAmount"; + } + if (data.data.total == 0) { pagingRef.value.complete(true); } else { - pagingRef.value.complete(data.records); + pagingRef.value.complete(data.data.records); } - emits("ok", data.total); + emits("ok", data.data.total); } }; </script> diff --git a/src/pages/production/twist/backman/index.vue b/src/pages/production/twist/backman/index.vue index 2ba997f..428cfc7 100644 --- a/src/pages/production/twist/backman/index.vue +++ b/src/pages/production/twist/backman/index.vue @@ -1,8 +1,16 @@ <template> - <view class="page pt-2"> - <CardTitle title="缁炵嚎鏉傚伐淇℃伅" :hideAction="true" @action="addReport" /> - <view class="list"> - <wd-card type="rectangle" custom-class="round"> + <view class="list"> + <z-paging + ref="pagingRef" + v-model="cardList" + :fixed="false" + :auto-show-back-to-top="true" + @query="getList" + > + <template #top> + <CardTitle title="缁炵嚎鏉傚伐淇℃伅" :hideAction="true" @action="addReport" /> + </template> + <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round"> <template #title> <view class="flex justify-between"> <view> @@ -14,7 +22,7 @@ </template> <ProductionCard :data="cardAttr" color="#0D867F" /> </wd-card> - </view> + </z-paging> <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> <view class="action px-3"> <wd-button type="text" @click="cancel">鍙栨秷</wd-button> @@ -31,12 +39,17 @@ import ProductionCard from "../../components/ProductionCard.vue"; import { useToast } from "wot-design-uni"; import BackmanForm from "./form.vue"; +import { onLoad } from "@dcloudio/uni-app"; +import zPaging from "@/components/z-paging/z-paging.vue"; +import ManageApi from "@/api/product/manage"; +const paramsId = ref(); +const pagingRef = ref(); const toast = useToast(); const dialog = reactive({ visible: false, }); - +const cardList = ref<any[]>([]); const cardAttr = ref<any[]>([ { label: "鍗曚綅", @@ -83,20 +96,29 @@ toast.show("鍙栨秷"); dialog.visible = false; }; + +const getList = async () => { + const { code, data } = await ManageApi.getBackmanDetail({ + wireId: paramsId.value, + }); + if (code == 200) { + pagingRef.value.complete(data); + } +}; +onLoad((options: any) => { + paramsId.value = options.id; +}); </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 80px); + padding: 12px; background: #f3f9f8; - .list { - height: calc(100vh - 120px); - margin: 12px; - overflow: scroll; - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } diff --git a/src/pages/production/twist/receive/plate/index.vue b/src/pages/production/twist/receive/plate/index.vue index a49fb1a..128db14 100644 --- a/src/pages/production/twist/receive/plate/index.vue +++ b/src/pages/production/twist/receive/plate/index.vue @@ -17,21 +17,21 @@ <wd-icon name="a-rootlist" color="#0D867F"></wd-icon> <text class="text-[#252525] ml-2 font-medium">{{ item.diskMaterial }}</text> </view> - <view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view> + <view class="text-[#A8A8A8]" @click="toEdit(item.id)">缂栬緫</view> </view> </template> <ProductionCard :data="cardAttr" :value="item" color="#0D867F" /> </wd-card> </z-paging> + <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> + <view class="action px-3"> + <wd-button type="text" @click="cancel">鍙栨秷</wd-button> + <wd-button type="text" @click="submit">纭畾</wd-button> + </view> + <PlateForm ref="plateFormRef" @refresh="reloadList" /> + </wd-popup> + <wd-toast /> </view> - <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> - <view class="action px-3"> - <wd-button type="text" @click="cancel">鍙栨秷</wd-button> - <wd-button type="text" @click="submit">纭畾</wd-button> - </view> - <PlateForm ref="plateFormRef" @refresh="reloadList" /> - </wd-popup> - <wd-toast /> </template> <script setup lang="ts"> @@ -74,9 +74,9 @@ }, ]); -const toEdit = () => { +const toEdit = (id: number) => { uni.navigateTo({ - url: "/pages/production/twist/receive/plate/edit", + url: `/pages/production/twist/receive/plate/edit?id=${id}`, }); }; diff --git a/src/pages/production/twist/receive/steelCore/index.vue b/src/pages/production/twist/receive/steelCore/index.vue index 8ae3589..21b8d6f 100644 --- a/src/pages/production/twist/receive/steelCore/index.vue +++ b/src/pages/production/twist/receive/steelCore/index.vue @@ -17,7 +17,7 @@ <wd-icon name="a-rootlist" color="#0D867F"></wd-icon> <text class="text-[#252525] ml-2 font-medium">{{ item.model }}</text> </view> - <view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view> + <view class="text-[#A8A8A8]" @click="toEdit(item.id)">缂栬緫</view> </view> </template> <ProductionCard :data="cardAttr" :value="item" color="#0D867F" /> @@ -69,9 +69,9 @@ }, ]); -const toEdit = () => { +const toEdit = (id: number) => { uni.navigateTo({ - url: "/pages/production/twist/receive/steelCore/edit", + url: `/pages/production/twist/receive/steelCore/edit?id=${id}`, }); }; @@ -79,9 +79,8 @@ dialog.visible = true; }; -const submit = () => { - toast.show("鎻愪氦"); - dialog.visible = false; +const submit = async () => { + dialog.visible = !(await steelCoreRef.value.submit()); }; const cancel = () => { diff --git a/src/pages/production/twist/report/form.vue b/src/pages/production/twist/report/form.vue index 00bf68e..b03ee0b 100644 --- a/src/pages/production/twist/report/form.vue +++ b/src/pages/production/twist/report/form.vue @@ -3,75 +3,59 @@ <wd-cell-group :border="true"> <wd-input v-model="model.contractNo" - label="鍚堝悓鍙�" + label="棰嗙敤鏉嗗彿" label-width="100px" prop="contractNo" clearable - placeholder="璇疯緭鍏ュ悎鍚屽彿" + placeholder="璇疯緭鍏ラ鐢ㄦ潌鍙�" /> <wd-input v-model="model.status" - label="鐘舵��" + label="鏉嗛噸(kg)" label-width="100px" prop="status" clearable - placeholder="璇疯緭鍏ョ姸鎬�" + placeholder="璇疯緭鍏ユ潌閲�" /> <wd-input v-model="model.clientName" - label="瀹㈡埛鍚嶇О" + label="鍗曚笣鐩樺彿" label-width="100px" prop="clientName" clearable - placeholder="璇疯緭鍏ュ鎴峰悕绉�" + placeholder="璇疯緭鍏ュ崟涓濈洏鍙�" /> <wd-input v-model="model.workbench" - label="鏈哄彴" + label="瀹為檯閲嶉噺(kg)" label-width="100px" prop="workbench" clearable - placeholder="璇疯緭鍏ユ満鍙�" + placeholder="璇疯緭鍏ュ疄闄呴噸閲�" /> <wd-input v-model="model.quality" - label="璐ㄩ噺杩芥函鍙�" - label-width="100px" - prop="quality" - clearable - placeholder="璇疯緭鍏ヨ川閲忚拷婧彿" - /> - <wd-input - v-model="model.specification" - label="瑙勬牸鍨嬪彿" - label-width="100px" - prop="specification" - clearable - placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" - /> - <wd-input - v-model="model.disc" label="鐩橀暱(m)" label-width="100px" - prop="disc" + prop="quality" clearable placeholder="璇疯緭鍏ョ洏闀�" /> <wd-input - v-model="model.produced" - label="宸茬敓浜�(m)" + v-model="model.specification" + label="鐞嗚閲嶉噺(kg)" label-width="100px" - prop="produced" + prop="specification" clearable - placeholder="璇疯緭鍏ュ凡鐢熶骇" + placeholder="璇疯緭鍏ョ悊璁洪噸閲�" /> <wd-input - v-model="model.beProduced" - label="寰呯敓浜�(m)" + v-model="model.disc" + label="瑙勬牸鍨嬪彿" label-width="100px" - prop="beProduced" + prop="disc" clearable - placeholder="璇疯緭鍏ュ崟涓濈洏闀�" + placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" /> </wd-cell-group> </wd-form> @@ -79,17 +63,41 @@ <script lang="ts" setup> import useFormData from "@/hooks/useFormData"; +import { useToast } from "wot-design-uni"; +import TwistApi from "@/api/product/twist"; +const paramsId = ref(); +const toast = useToast(); const { form: model } = useFormData({ - contractNo: undefined, // 鍚堝悓鍙� - status: undefined, // 鐘舵�� - clientName: undefined, // 瀹㈡埛鍚嶇О - workbench: undefined, // 鏈哄彴 - quality: undefined, // 璐ㄩ噺杩芥函鍙� - specification: undefined, // 瑙勬牸鍨嬪彿 - disc: undefined, // 鐩橀暱 - produced: undefined, // 宸茬敓浜� - beProduced: undefined, // 寰呯敓浜� + poleNumber: undefined, // 棰嗙敤鏉嗗彿 + poleWeight: undefined, // 鏉嗛噸(kg) + monofilamentNumber: undefined, // 鍗曚笣鐩樺彿 + actuallyWeight: undefined, // 瀹為檯閲嶉噺(kg) + ontLength: undefined, // 鐩橀暱(m) + theoryWeight: undefined, // 鐞嗚閲嶉噺(kg) + model: undefined, // 瑙勬牸鍨嬪彿 +}); + +const submit = async () => { + const { code } = await TwistApi.addTwistOutput({ + wireId: paramsId.value, + ...model, + }); + if (code == 200) { + toast.success("鎻愪氦鎴愬姛"); + return true; + } else { + toast.error("鎻愪氦澶辫触"); + return false; + } +}; + +onLoad((options: any) => { + paramsId.value = options.id; +}); + +defineExpose({ + submit, }); </script> diff --git a/src/pages/production/twist/report/index.vue b/src/pages/production/twist/report/index.vue index 9c6b5c0..a0383eb 100644 --- a/src/pages/production/twist/report/index.vue +++ b/src/pages/production/twist/report/index.vue @@ -1,6 +1,6 @@ <template> - <view class="page pt-2"> - <z-paging ref="pagingRef" v-model="twistReportList" class="list" @query="getTwistReportList"> + <view class="list"> + <z-paging ref="pagingRef" v-model="twistReportList" :fixed="false" @query="getTwistReportList"> <template #top> <CardTitle title="鎶ュ伐淇℃伅" :hideAction="true" :full="false" @action="addReport" /> </template> @@ -10,14 +10,14 @@ <view> <wd-icon name="user" color="#0D867F"></wd-icon> <text class="text-[#0D867F] ml-2 font-medium">鐢熶骇浜�</text> - <text class="text-[#333333] ml-2">鏂瑰厗鐜�</text> + <text class="text-[#333333] ml-2">{{ item.productUser }}</text> </view> <view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view> </view> </template> <ProductionCard :data="cardAttr" :value="item" /> <template #footer> - <wd-button size="small" plain @click="toCheck">鑷</wd-button> + <wd-button size="small" plain @click="toCheck(item.id)">鑷</wd-button> </template> </wd-card> </z-paging> @@ -27,7 +27,7 @@ <wd-button type="text" @click="cancel">鍙栨秷</wd-button> <wd-button type="text" @click="submit">纭畾</wd-button> </view> - <TwistForm /> + <TwistForm ref="twistFormRef" /> </wd-popup> <wd-toast /> </view> @@ -42,6 +42,7 @@ const pagingRef = ref(); const paramsId = ref(); +const twistFormRef = ref(); const toast = useToast(); const dialog = reactive({ visible: false, @@ -61,8 +62,8 @@ prop: "monofilamentNumber", }, { - label: "瑙勬牸鍨嬪彿", - prop: "model", + label: "瀹為檯閲嶉噺(kg)", + prop: "actuallyWeight", }, { label: "鐩橀暱(m)", @@ -73,8 +74,8 @@ prop: "theoryWeight", }, { - label: "瀹為檯閲嶉噺(kg)", - prop: "actuallyWeight", + label: "瑙勬牸鍨嬪彿", + prop: "model", }, ]); @@ -91,8 +92,7 @@ }; const submit = () => { - toast.show("鎻愪氦"); - dialog.visible = false; + dialog.visible = twistFormRef.value.submit(); }; const cancel = () => { @@ -100,9 +100,9 @@ dialog.visible = false; }; -const toCheck = () => { +const toCheck = (id: number) => { uni.navigateTo({ - url: "/pages/production/twist/selfInspect/index", + url: `/pages/production/twist/selfInspect/index?id=${id}`, }); }; @@ -121,16 +121,14 @@ </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 120px); + padding: 12px; background: #f3f9f8; - .list { - margin: 12px; - - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } diff --git a/src/pages/production/twist/selfInspect/index.vue b/src/pages/production/twist/selfInspect/index.vue index 9d98a20..9d524c2 100644 --- a/src/pages/production/twist/selfInspect/index.vue +++ b/src/pages/production/twist/selfInspect/index.vue @@ -1,20 +1,22 @@ <template> - <view class="page pt-2"> - <CardTitle title="缁炵嚎鑷" :hideAction="true" @action="addReport" /> - <view class="list"> - <wd-card type="rectangle" custom-class="round"> + <view class="list"> + <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList"> + <template #top> + <CardTitle title="缁炵嚎鑷" :hideAction="false" /> + </template> + <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round"> <template #title> <view class="flex justify-between"> <view> <wd-icon name="a-rootlist" color="#0D867F"></wd-icon> - <text class="text-[#252525] ml-2 font-medium">鑷椤圭洰鍚嶇О</text> + <text class="text-[#252525] ml-2 font-medium">{{ item.inspectionProject }}</text> </view> <view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view> </view> </template> - <ProductionCard :data="cardAttr" color="#0D867F" /> + <ProductionCard :data="cardAttr" :value="item" color="#0D867F" /> </wd-card> - </view> + </z-paging> <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> <view class="action px-3"> <wd-button type="text" @click="cancel">鍙栨秷</wd-button> @@ -31,7 +33,10 @@ import ProductionCard from "../../components/ProductionCard.vue"; import { useToast } from "wot-design-uni"; import SelfInspectForm from "./form.vue"; +import ManageApi from "@/api/product/manage"; +const pagingRef = ref(); +const paramsId = ref(); const toast = useToast(); const dialog = reactive({ visible: false, @@ -39,25 +44,27 @@ const cardAttr = ref<any[]>([ { label: "鍗曚綅", - value: "n惟路m", + prop: "inspectionUnit", }, { label: "鏍囧噯鍊�", - value: "1246", + prop: "standardValue", }, { label: "鑷鍊�", - value: "1245", + prop: "inspectionItem", }, { label: "鑷缁撴灉", - value: "涓嶅悎鏍�", + prop: "inspectionResult", color: "#FF1E1E", }, ]); -const addReport = () => { - dialog.visible = true; -}; +const cardList = ref<any[]>([]); + +// const addReport = () => { +// dialog.visible = true; +// }; const toEdit = () => { uni.navigateTo({ @@ -73,20 +80,29 @@ toast.show("鍙栨秷"); dialog.visible = false; }; + +const getList = async () => { + const { data } = await ManageApi.getSelfInspection({ + outPutId: paramsId.value, + type: "缁炵嚎", + }); + pagingRef.value.complete(data); +}; + +onLoad((options: any) => { + paramsId.value = options.id; +}); </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 120px); + padding: 12px; background: #f3f9f8; - .list { - height: calc(100vh - 120px); - margin: 12px; - overflow: scroll; - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } diff --git a/src/pages/production/wire/backman/form.vue b/src/pages/production/wire/backman/form.vue index e4cf542..47ac348 100644 --- a/src/pages/production/wire/backman/form.vue +++ b/src/pages/production/wire/backman/form.vue @@ -1,13 +1,12 @@ <template> <wd-form ref="form" :model="model" class="relative form_box"> <wd-cell-group :border="true"> - <wd-input + <wd-picker v-model="model.workbench" + :columns="columns" label="鏉傚伐鍚嶇О" label-width="100px" - prop="workbench" - clearable - placeholder="璇疯緭鍏ユ潅宸ュ悕绉�" + placeholder="璇烽�夋嫨鏉傚伐鍚嶇О" /> <wd-input v-model="model.poleNo" @@ -47,6 +46,13 @@ <script setup lang="ts"> import useFormData from "@/hooks/useFormData"; +import ManageApi from "@/api/product/manage"; +import { onLoad } from "@dcloudio/uni-app"; +import { useToast } from "wot-design-uni"; + +const columns = ref([]); +const paramsId = ref(); +const toast = useToast(); const { form: model } = useFormData({ backmanName: undefined, // 鏉傚伐鍚嶇О unit: undefined, // 鍗曚綅 @@ -54,6 +60,37 @@ caller: undefined, // 鎶ュ伐浜� callerDate: undefined, // 鎶ュ伐鏃ユ湡 }); + +const getBackman = async () => { + const { data } = await ManageApi.getBackmanDetailByType({ type: "鎷変笣" }); + columns.value = data.map((item: any) => item.backmanProject); +}; + +const submit = async () => { + const { code } = await ManageApi.addBackmanDetail([ + { + wireId: paramsId.value, + type: "鎷変笣", + ...model, + }, + ]); + if (code == 200) { + toast.success("鎻愪氦鎴愬姛"); + return true; + } else { + toast.error("鎻愪氦澶辫触"); + return false; + } +}; + +onLoad((options: any) => { + paramsId.value = options.id; + getBackman(); +}); + +defineExpose({ + submit, +}); </script> <style lang="scss" scoped> .form_box { diff --git a/src/pages/production/wire/backman/index.vue b/src/pages/production/wire/backman/index.vue index 17c724d..9def21c 100644 --- a/src/pages/production/wire/backman/index.vue +++ b/src/pages/production/wire/backman/index.vue @@ -1,8 +1,10 @@ <template> - <view class="page pt-2"> - <CardTitle title="鏉傚伐淇℃伅" :hideAction="true" @action="addReport" /> - <view class="list"> - <wd-card type="rectangle" custom-class="round"> + <view class="list"> + <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList"> + <template #top> + <CardTitle title="鏉傚伐淇℃伅" :full="false" :hideAction="true" @action="addReport" /> + </template> + <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round"> <template #title> <view class="flex justify-between"> <view> @@ -14,13 +16,13 @@ </template> <ProductionCard :data="cardAttr" color="#0D867F" /> </wd-card> - </view> + </z-paging> <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> <view class="action px-3"> <wd-button type="text" @click="cancel">鍙栨秷</wd-button> <wd-button type="text" @click="submit">纭畾</wd-button> </view> - <BackmanForm /> + <BackmanForm ref="backmanFormRef" /> </wd-popup> <wd-toast /> </view> @@ -31,7 +33,11 @@ import ProductionCard from "../../components/ProductionCard.vue"; import { useToast } from "wot-design-uni"; import BackmanForm from "./form.vue"; +import ManageApi from "@/api/product/manage"; +const pagingRef = ref(); +const backmanFormRef = ref(); +const paramsId = ref(); const toast = useToast(); const dialog = reactive({ visible: false, @@ -64,6 +70,8 @@ }, ]); +const cardList = ref<any[]>([]); + const toEdit = () => { uni.navigateTo({ url: "/pages/production/wire/backman/edit", @@ -75,28 +83,36 @@ }; const submit = () => { - toast.show("鎻愪氦"); - dialog.visible = false; + dialog.visible = backmanFormRef.value.submit(); }; const cancel = () => { toast.show("鍙栨秷"); dialog.visible = false; }; + +const getList = async () => { + const { data } = await ManageApi.getBackmanDetail({ + outPutId: paramsId.value, + type: "鎷変笣", + }); + pagingRef.value.complete(data); +}; + +onLoad((options: any) => { + paramsId.value = options.id; +}); </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 120px); + padding: 12px; background: #f3f9f8; - .list { - height: calc(100vh - 120px); - margin: 12px; - overflow: scroll; - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } diff --git a/src/pages/production/wire/report/wire.vue b/src/pages/production/wire/report/wire.vue index 496ae82..3a129dc 100644 --- a/src/pages/production/wire/report/wire.vue +++ b/src/pages/production/wire/report/wire.vue @@ -1,6 +1,6 @@ <template> - <view class="page pt-2"> - <z-paging ref="pagingRef" v-model="wireReportList" class="list" @query="getWireReportList"> + <view class="list"> + <z-paging ref="pagingRef" v-model="wireReportList" :fixed="false" @query="getWireReportList"> <template #top> <CardTitle title="鎶ュ伐淇℃伅" :hideAction="true" :full="false" @action="addReport" /> </template> @@ -26,7 +26,6 @@ </template> </wd-card> </z-paging> - <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> <view class="action px-3"> <wd-button type="text" @click="cancel">鍙栨秷</wd-button> @@ -45,7 +44,6 @@ import zPaging from "@/components/z-paging/z-paging.vue"; import { onLoad } from "@dcloudio/uni-app"; import ManageApi from "@/api/product/manage"; -import WireApi from "@/api/product/wire"; const pagingRef = ref(); const wireFormRef = ref(); @@ -74,7 +72,7 @@ }, { label: "鐩橀暱(m)", - prop: "ontLength", + prop: "oneLength", }, { label: "鐞嗚閲嶉噺(kg)", @@ -98,13 +96,8 @@ dialog.visible = true; }; -const submit = async () => { - toast.show("鎻愪氦"); - await WireApi.addWireOutput({ - wireId: paramsId.value, - type: "鎷変笣", - ...wireFormRef.value.model, - }); +const submit = () => { + dialog.visible = wireFormRef.value.submit(); }; const cancel = () => { @@ -133,17 +126,14 @@ </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 120px); + padding: 12px; background: #f3f9f8; - .list { - margin: 12px; - background: #f3f9f8; - - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } diff --git a/src/pages/production/wire/report/wireForm.vue b/src/pages/production/wire/report/wireForm.vue index 4fb91c4..b248788 100644 --- a/src/pages/production/wire/report/wireForm.vue +++ b/src/pages/production/wire/report/wireForm.vue @@ -58,23 +58,47 @@ placeholder="璇疯緭鍏ュ疄闄呴噸閲�" /> </wd-cell-group> + <wd-toast /> </wd-form> </template> <script lang="ts" setup> import useFormData from "@/hooks/useFormData"; +import { useToast } from "wot-design-uni"; +import WireApi from "@/api/product/wire"; +const paramsId = ref(); +const toast = useToast(); const { form: model } = useFormData({ poleNumber: undefined, // 棰嗙敤鏉嗗彿 poleWeight: undefined, // 瀹㈡埛鍚嶇О monofilamentNumber: undefined, // 鍗曚笣鐩樺彿 model: undefined, // 瑙勬牸鍨嬪彿 - ontLength: undefined, // 鐩橀暱 + oneLength: undefined, // 鐩橀暱 singleDisc: undefined, // 鍗曚笣鐩橀暱 }); +const submit = async () => { + const { code } = await WireApi.addWireOutput({ + wireId: paramsId.value, + type: "鎷変笣", + ...model, + }); + if (code == 200) { + toast.success("鎻愪氦鎴愬姛"); + return true; + } else { + toast.error("鎻愪氦澶辫触"); + return false; + } +}; + +onLoad((options: any) => { + paramsId.value = options.id; +}); + defineExpose({ - model, + submit, }); </script> diff --git a/src/pages/production/wire/selfInspect/index.vue b/src/pages/production/wire/selfInspect/index.vue index 7b18466..bbd9cb9 100644 --- a/src/pages/production/wire/selfInspect/index.vue +++ b/src/pages/production/wire/selfInspect/index.vue @@ -1,20 +1,22 @@ <template> - <view class="page pt-2"> - <CardTitle title="鎷変笣鑷" :hideAction="true" @action="addReport" /> - <view class="list"> - <wd-card type="rectangle" custom-class="round"> + <view class="list"> + <z-paging ref="pagingRef" v-model="cardList" :fixed="false" @query="getList"> + <template #top> + <CardTitle title="鎷変笣鑷" :hideAction="false" /> + </template> + <wd-card v-for="(item, index) in cardList" :key="index" type="rectangle" custom-class="round"> <template #title> <view class="flex justify-between"> <view> <wd-icon name="a-rootlist" color="#0D867F"></wd-icon> - <text class="text-[#252525] ml-2 font-medium">鑷椤圭洰鍚嶇О</text> + <text class="text-[#252525] ml-2 font-medium">{{ item.inspectionProject }}</text> </view> <view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view> </view> </template> - <ProductionCard :data="cardAttr" color="#0D867F" /> + <ProductionCard :data="cardAttr" :value="item" color="#0D867F" /> </wd-card> - </view> + </z-paging> <wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup"> <view class="action px-3"> <wd-button type="text" @click="cancel">鍙栨秷</wd-button> @@ -31,7 +33,10 @@ import ProductionCard from "../../components/ProductionCard.vue"; import { useToast } from "wot-design-uni"; import SelfInspectForm from "./form.vue"; +import ManageApi from "@/api/product/manage"; +const pagingRef = ref(); +const paramsId = ref(); const toast = useToast(); const dialog = reactive({ visible: false, @@ -39,25 +44,27 @@ const cardAttr = ref<any[]>([ { label: "鍗曚綅", - value: "n惟路m", + prop: "inspectionUnit", }, { label: "鏍囧噯鍊�", - value: "1246", + prop: "standardValue", }, { label: "鑷鍊�", - value: "1245", + prop: "inspectionItem", }, { label: "鑷缁撴灉", - value: "涓嶅悎鏍�", + prop: "inspectionResult", color: "#FF1E1E", }, ]); -const addReport = () => { - dialog.visible = true; -}; +const cardList = ref<any[]>([]); + +// const addReport = () => { +// dialog.visible = true; +// }; const toEdit = () => { uni.navigateTo({ @@ -73,20 +80,29 @@ toast.show("鍙栨秷"); dialog.visible = false; }; + +const getList = async () => { + const { data } = await ManageApi.getSelfInspection({ + outPutId: paramsId.value, + type: "鎷変笣", + }); + pagingRef.value.complete(data); +}; + +onLoad((options: any) => { + paramsId.value = options.id; +}); </script> <style lang="scss" scoped> -.page { +.list { + height: calc(100vh - 120px); + padding: 12px; background: #f3f9f8; - .list { - height: calc(100vh - 120px); - margin: 12px; - overflow: scroll; - :deep() { - .round { - border-radius: 4px; - } + :deep() { + .round { + border-radius: 4px; } } } -- Gitblit v1.9.3