From 8a09b751a8be8c4ed376f42e7f64e0794001e06a Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期三, 23 四月 2025 13:27:03 +0800
Subject: [PATCH] test: 绞线新城测试
---
src/pages/production/components/ProductionCard.vue | 2
src/pages/production/twist/receive/plate/index.vue | 23 ++++++-
src/pages/production/twist/receive/plate/form.vue | 50 +++++++++++++---
src/pages/production/twist/receive/steelCore/index.vue | 30 ++++------
src/pages/production/twist/receive/steelCore/form.vue | 35 ++++-------
5 files changed, 84 insertions(+), 56 deletions(-)
diff --git a/src/pages/production/components/ProductionCard.vue b/src/pages/production/components/ProductionCard.vue
index 1649729..d691c8c 100644
--- a/src/pages/production/components/ProductionCard.vue
+++ b/src/pages/production/components/ProductionCard.vue
@@ -4,7 +4,7 @@
<view class="flex justify-between w-full h-[20px]">
<view class="text-[#646874] pl-1">{{ item.label }}</view>
<view class="font-medium pr-1" :style="{ color: item.color ?? color }">
- {{ value[item.prop] }} {{ item.unit }}
+ {{ value[item.prop] }} {{ value[item.unitProp] }} {{ item.unit }}
</view>
</view>
</wd-col>
diff --git a/src/pages/production/twist/receive/plate/form.vue b/src/pages/production/twist/receive/plate/form.vue
index 950e5e1..1d584b0 100644
--- a/src/pages/production/twist/receive/plate/form.vue
+++ b/src/pages/production/twist/receive/plate/form.vue
@@ -2,39 +2,67 @@
<wd-form ref="form" :model="model" class="relative form_box">
<wd-cell-group :border="true">
<wd-input
- v-model="model.plateType"
+ v-model="model.diskMaterial"
label="鐩樺叿绫诲瀷"
label-width="100px"
- prop="plateType"
+ prop="diskMaterial"
clearable
placeholder="璇疯緭鍏ョ洏鍏风被鍨�"
/>
<wd-input
- v-model="model.length"
+ v-model="model.model"
label="灏哄"
label-width="100px"
- prop="length"
+ prop="model"
clearable
placeholder="璇疯緭鍏ュ昂瀵�"
/>
<wd-input
- v-model="model.weigth"
- label="閲嶉噺"
+ v-model="model.amount"
+ label="鏁伴噺"
label-width="100px"
- prop="weigth"
+ prop="amount"
clearable
- placeholder="璇疯緭鍏ラ噸閲�"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ />
+ <wd-input
+ v-model="model.supplier"
+ label="鍘傚"
+ label-width="100px"
+ prop="supplier"
+ clearable
+ placeholder="璇疯緭鍏ュ巶瀹�"
/>
</wd-cell-group>
+ <wd-toast />
</wd-form>
</template>
<script setup lang="ts">
import useFormData from "@/hooks/useFormData";
+import TwistApi from "@/api/product/twist";
+import { useToast } from "wot-design-uni";
+
+const emits = defineEmits(["refresh"]);
+const toast = useToast();
const { form: model } = useFormData({
- plateType: undefined, // 鐩樺叿绫诲瀷
- length: undefined, // 灏哄
- weigth: undefined, // 閲嶉噺
+ diskMaterial: undefined, // 鐩樺叿绫诲瀷
+ model: undefined, // 灏哄
+ amount: undefined, // 鏁伴噺
+ supplier: undefined,
+});
+
+const submit = async () => {
+ const { code } = await TwistApi.addStrandedWireDish([model]);
+ if (code == 200) {
+ toast.success("鏂板鎴愬姛");
+ emits("refresh");
+ return true;
+ }
+};
+
+defineExpose({
+ submit,
});
</script>
<style lang="scss" scoped>
diff --git a/src/pages/production/twist/receive/plate/index.vue b/src/pages/production/twist/receive/plate/index.vue
index 144f557..a5c6432 100644
--- a/src/pages/production/twist/receive/plate/index.vue
+++ b/src/pages/production/twist/receive/plate/index.vue
@@ -15,7 +15,7 @@
<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.diskMaterial }}</text>
</view>
<view class="text-[#A8A8A8]" @click="toEdit">缂栬緫</view>
</view>
@@ -29,7 +29,7 @@
<wd-button type="text" @click="cancel">鍙栨秷</wd-button>
<wd-button type="text" @click="submit">纭畾</wd-button>
</view>
- <PlateForm />
+ <PlateForm ref="plateFormRef" @refresh="reloadList" />
</wd-popup>
<wd-toast />
</template>
@@ -45,6 +45,7 @@
const paramsId = ref();
const pagingRef = ref();
+const plateFormRef = ref();
const toast = useToast();
const dialog = reactive({
visible: false,
@@ -61,6 +62,16 @@
prop: "weight",
unit: "kg",
},
+ {
+ label: "鏁伴噺",
+ prop: "amount",
+ },
+ {},
+ {
+ label: "鍘傚",
+ prop: "supplier",
+ span: 14,
+ },
]);
const toEdit = () => {
@@ -73,9 +84,9 @@
dialog.visible = true;
};
-const submit = () => {
+const submit = async () => {
toast.show("鎻愪氦");
- dialog.visible = false;
+ dialog.visible = !(await plateFormRef.value.submit());
};
const cancel = () => {
@@ -83,6 +94,10 @@
dialog.visible = false;
};
+const reloadList = () => {
+ pagingRef.value.refresh();
+};
+
const getList = async () => {
const { code, data } = await ManageApi.getStrandedWireDish({
wireId: paramsId.value,
diff --git a/src/pages/production/twist/receive/steelCore/form.vue b/src/pages/production/twist/receive/steelCore/form.vue
index 0c174b0..92dfb7e 100644
--- a/src/pages/production/twist/receive/steelCore/form.vue
+++ b/src/pages/production/twist/receive/steelCore/form.vue
@@ -2,36 +2,28 @@
<wd-form ref="form" :model="model" class="relative form_box">
<wd-cell-group :border="true">
<wd-input
- v-model="model.steelCoreName"
- label="閽㈣姱鍚嶇О"
+ v-model="model.model"
+ label="瑙勬牸鍨嬪彿"
label-width="100px"
- prop="steelCoreName"
+ prop="model"
clearable
- placeholder="璇疯緭鍏ラ挗鑺悕绉�"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
/>
<wd-input
- v-model="model.plateNo"
- label="鐩樺彿"
+ v-model="model.monofilamentNumber"
+ label="鏍峰搧缂栧彿"
label-width="100px"
- prop="plateNo"
+ prop="monofilamentNumber"
clearable
placeholder="璇疯緭鍏ョ洏鍙�"
/>
<wd-input
- v-model="model.length"
- label="闀垮害"
+ v-model="model.amount"
+ label="鏁伴噺"
label-width="100px"
- prop="length"
+ prop="amount"
clearable
placeholder="璇疯緭鍏ラ暱搴�"
- />
- <wd-input
- v-model="model.weight"
- label="閲嶉噺"
- label-width="100px"
- prop="weight"
- clearable
- placeholder="璇疯緭鍏ラ噸閲�"
/>
<wd-input
v-model="model.manufacturers"
@@ -49,10 +41,9 @@
import useFormData from "@/hooks/useFormData";
const { form: model } = useFormData({
- steelCoreName: undefined, // 閽㈣姱鍚嶇О
- plateNo: undefined, // 鐩樺彿
- length: undefined, // 闀垮害
- weight: undefined, // 閲嶉噺
+ model: undefined, // 瑙勬牸鍨嬪彿
+ monofilamentNumber: undefined, // 鏍峰搧缂栧彿
+ amount: undefined, // 鏁伴噺
manufacturers: undefined, // 鍘傚
});
</script>
diff --git a/src/pages/production/twist/receive/steelCore/index.vue b/src/pages/production/twist/receive/steelCore/index.vue
index 0423e2e..5b190c6 100644
--- a/src/pages/production/twist/receive/steelCore/index.vue
+++ b/src/pages/production/twist/receive/steelCore/index.vue
@@ -15,12 +15,12 @@
<view class="flex justify-between">
<view>
<wd-icon name="a-rootlist" color="#0D867F"></wd-icon>
- <text class="text-[#252525] ml-2 font-medium">JX28201021-1</text>
+ <text class="text-[#252525] ml-2 font-medium">{{ item.model }}</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>
</z-paging>
</view>
@@ -29,7 +29,7 @@
<wd-button type="text" @click="cancel">鍙栨秷</wd-button>
<wd-button type="text" @click="submit">纭畾</wd-button>
</view>
- <PlateForm />
+ <SteelCore ref="steelCoreRef" />
</wd-popup>
<wd-toast />
</template>
@@ -38,13 +38,14 @@
import CardTitle from "@/components/card-title/index.vue";
import ProductionCard from "../../../components/ProductionCard.vue";
import { useToast } from "wot-design-uni";
-import PlateForm from "./form.vue";
+import SteelCore from "./form.vue";
import { onLoad } from "@dcloudio/uni-app";
import ManageApi from "@/api/product/manage";
import zPaging from "@/components/z-paging/z-paging.vue";
const paramsId = ref();
const pagingRef = ref();
+const steelCoreRef = ref();
const toast = useToast();
const dialog = reactive({
visible: false,
@@ -53,24 +54,17 @@
const cardAttr = ref<any[]>([
{
- label: "鐩樺彿",
- value: "1902101",
+ label: "鏍峰搧缂栧彿",
+ prop: "monofilamentNumber",
},
{
- label: "闀垮害",
- value: "46kg",
- },
- {
- label: "閲嶉噺",
- value: "10kg",
- },
- {
- label: undefined,
- value: undefined,
+ label: "鏁伴噺",
+ prop: "amount",
+ unitProp: "unit",
},
{
label: "鍘傚",
- value: "姹熻嫃鐪佸崡閫氬競鑺鏁板瓧鍘�",
+ prop: "supplier",
span: 16,
},
]);
@@ -98,7 +92,7 @@
const getList = async () => {
const { code, data } = await ManageApi.getStrandedWireDish({
wireId: paramsId.value,
- type: "鐩樺叿",
+ type: "閽㈣姱",
});
if (code == 200) {
pagingRef.value.complete(data);
--
Gitblit v1.9.3