From 08114b7451615854cb01556a7c477e32e17f520e Mon Sep 17 00:00:00 2001
From: zhuguifei <312353457@qq.com>
Date: 星期五, 03 四月 2026 09:47:04 +0800
Subject: [PATCH] refactor: 调整储丝单柜卷包产量计算逻辑
---
ruoyi-plus-soybean/src/views/analy/roller/modules/roller-data-operate-drawer.vue | 123 +++++++++++++++++++++++++++-------------
1 files changed, 83 insertions(+), 40 deletions(-)
diff --git a/ruoyi-plus-soybean/src/views/analy/roller/modules/roller-data-operate-drawer.vue b/ruoyi-plus-soybean/src/views/analy/roller/modules/roller-data-operate-drawer.vue
index 3932afb..f96d778 100755
--- a/ruoyi-plus-soybean/src/views/analy/roller/modules/roller-data-operate-drawer.vue
+++ b/ruoyi-plus-soybean/src/views/analy/roller/modules/roller-data-operate-drawer.vue
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
-import { jsonClone } from '~/packages/utils';
import { fetchCreateRollerData, fetchUpdateRollerData } from '@/service/api/analy/roller-data';
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
import { $t } from '@/locales';
+import { jsonClone } from '~/packages/utils';
defineOptions({
name: 'RollerDataOperateDrawer'
@@ -45,36 +45,32 @@
function createDefaultModel(): Model {
return {
- time: null,
- key: '',
- online: null,
- qty: null,
- badQty: null,
- lvbangVal: null,
- juanyanzhiVal: null,
- shuisongzhiVal: null,
- runTime: null,
- stopTime: null,
- stopTimes: null,
- speed: null,
- runStatus: null,
- cy: null,
- cyCs: null,
- cyOnline: '',
- recQty1: null,
- recQty2: null
+ time: null,
+ key: '',
+ online: null,
+ qty: null,
+ badQty: null,
+ lvbangVal: null,
+ juanyanzhiVal: null,
+ shuisongzhiVal: null,
+ runTime: null,
+ stopTime: null,
+ stopTimes: null,
+ speed: null,
+ runStatus: null,
+ cy: null,
+ cyCs: null,
+ cyOnline: '',
+ recQty1: null,
+ recQty2: null
};
}
-type RuleKey = Extract<
- keyof Model,
- | 'time'
- | 'key'
->;
+type RuleKey = Extract<keyof Model, 'time' | 'key'>;
const rules: Record<RuleKey, App.Global.FormRule> = {
time: createRequiredRule('鏃堕棿涓嶈兘涓虹┖'),
- key: createRequiredRule('key涓嶈兘涓虹┖'),
+ key: createRequiredRule('key涓嶈兘涓虹┖')
};
function handleUpdateModelWhenEdit() {
@@ -92,16 +88,73 @@
async function handleSubmit() {
await validate();
- const { time, key, online, qty, badQty, lvbangVal, juanyanzhiVal, shuisongzhiVal, runTime, stopTime, stopTimes, speed, runStatus, cy, cyCs, cyOnline, recQty1, recQty2 } = model.value;
+ const {
+ time,
+ key,
+ online,
+ qty,
+ badQty,
+ lvbangVal,
+ juanyanzhiVal,
+ shuisongzhiVal,
+ runTime,
+ stopTime,
+ stopTimes,
+ speed,
+ runStatus,
+ cy,
+ cyCs,
+ cyOnline,
+ recQty1,
+ recQty2
+ } = model.value;
// request
if (props.operateType === 'add') {
- const { error } = await fetchCreateRollerData({ time, key, online, qty, badQty, lvbangVal, juanyanzhiVal, shuisongzhiVal, runTime, stopTime, stopTimes, speed, runStatus, cy, cyCs, cyOnline, recQty1, recQty2 });
+ const { error } = await fetchCreateRollerData({
+ time,
+ key,
+ online,
+ qty,
+ badQty,
+ lvbangVal,
+ juanyanzhiVal,
+ shuisongzhiVal,
+ runTime,
+ stopTime,
+ stopTimes,
+ speed,
+ runStatus,
+ cy,
+ cyCs,
+ cyOnline,
+ recQty1,
+ recQty2
+ });
if (error) return;
}
if (props.operateType === 'edit') {
- const { error } = await fetchUpdateRollerData({ time, key, online, qty, badQty, lvbangVal, juanyanzhiVal, shuisongzhiVal, runTime, stopTime, stopTimes, speed, runStatus, cy, cyCs, cyOnline, recQty1, recQty2 });
+ const { error } = await fetchUpdateRollerData({
+ time,
+ key,
+ online,
+ qty,
+ badQty,
+ lvbangVal,
+ juanyanzhiVal,
+ shuisongzhiVal,
+ runTime,
+ stopTime,
+ stopTimes,
+ speed,
+ runStatus,
+ cy,
+ cyCs,
+ cyOnline,
+ recQty1,
+ recQty2
+ });
if (error) return;
}
@@ -131,12 +184,7 @@
/>
</NFormItem>
<NFormItem label="key" path="key">
- <NInput
- v-model:value="model.key"
- :rows="3"
- type="textarea"
- placeholder="璇疯緭鍏ey"
- />
+ <NInput v-model:value="model.key" :rows="3" type="textarea" placeholder="璇疯緭鍏ey" />
</NFormItem>
<NFormItem label="缃戠粶鐘舵��" path="online">
<NInputNumber v-model:value="model.online" placeholder="璇疯緭鍏ョ綉缁滅姸鎬�" class="w-full" />
@@ -182,12 +230,7 @@
<NInputNumber v-model:value="model.cyCs" placeholder="璇疯緭鍏ュ偍鐑熻澶囪溅閫�" class="w-full" />
</NFormItem>
<NFormItem label="鍌ㄧ儫璁惧缃戠粶" path="cyOnline">
- <NInput
- v-model:value="model.cyOnline"
- :rows="3"
- type="textarea"
- placeholder="璇疯緭鍏ュ偍鐑熻澶囩綉缁�"
- />
+ <NInput v-model:value="model.cyOnline" :rows="3" type="textarea" placeholder="璇疯緭鍏ュ偍鐑熻澶囩綉缁�" />
</NFormItem>
<NFormItem label="鎺ユ敹鏈轰骇閲�" path="recQty1">
<NInputNumber v-model:value="model.recQty1" placeholder="璇疯緭鍏ユ帴鏀舵満浜ч噺" class="w-full" />
--
Gitblit v1.9.3