From 6c0b0dd81a98a3163e45f1b5b5417e02af165fd8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 29 八月 2026 10:04:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/mes/pro/feedback/data.ts | 157 ++-------------------------------------------------
1 files changed, 8 insertions(+), 149 deletions(-)
diff --git a/src/views/mes/pro/feedback/data.ts b/src/views/mes/pro/feedback/data.ts
index 8e2580a..32056e7 100644
--- a/src/views/mes/pro/feedback/data.ts
+++ b/src/views/mes/pro/feedback/data.ts
@@ -19,6 +19,7 @@
import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { getRouteProcessByRouteAndProcess } from '#/api/mes/pro/route/process';
import { getSimpleUserList } from '#/api/system/user';
+import { loadParamDetails } from './param-state';
import { getRangePickerDefaultProps } from '#/utils';
import { MdItemSelect } from '#/views/mes/md/item/components';
import { MdWorkstationSelect } from '#/views/mes/md/workstation/components';
@@ -173,9 +174,8 @@
* - create / update锛氬綍鍏ユ姤宸ヤ富浣撲俊鎭拰鏁伴噺
* - submit / approve / detail锛氫富浣撳瓧娈靛彧璇�
*
- * 鏁伴噺鍖哄煙鏍规嵁 `checkFlag` 鍜� `unqualifiedQuantity` 鍔ㄦ�佹樉绀猴細
- * - 闈炶川妫�宸ュ簭锛氭姤宸ユ暟閲� = 鍚堟牸 + 涓嶈壇锛涗笉鑹� > 0 鏃跺啀灞曞紑宸ュ簾/鏂欏簾/鍏朵粬搴熷搧
- * - 璐ㄦ宸ュ簭锛氬彧濉姤宸ユ暟閲忥紙瑙嗕负寰呮鏁伴噺锛�
+ * 鎶ュ伐鍙~鍐�"鎶ュ伐鏁伴噺"锛涘悎鏍煎搧/涓嶈壇鍝佹暟閲忕敱璐ㄦ纭畾锛屾姤宸ョ幆鑺備笉閲囬泦銆�
+ * 璐ㄦ宸ュ簭鎶ュ伐鍚庤繘鍏ュ緟妫�楠岋紙uncheckQuantity = 鎶ュ伐鏁伴噺锛夛紝闈炶川妫�宸ュ簭鐩存帴瀹岀粨銆�
*/
export function useFormSchema(
formType: FormType,
@@ -286,9 +286,10 @@
workstationId: values.workstationId,
}),
},
- // 浠诲姟鍙樻洿锛氳嚜鍔ㄥ~鍏呭叧鑱斿瓧娈点�佷骇鍝佷俊鎭�乧heckFlag
+ // 浠诲姟鍙樻洿锛氳嚜鍔ㄥ~鍏呭叧鑱斿瓧娈点�佷骇鍝佷俊鎭�乧heckFlag锛屽苟鍔犺浇浠诲姟缁戝畾鐨勫伐鑹哄弬鏁�
componentProps: {
onChange: async (task?: MesProTaskApi.Task) => {
+ await loadParamDetails(task?.id);
if (!task) {
return;
}
@@ -402,151 +403,9 @@
class: 'w-full',
min: 0,
precision: 2,
- },
- dependencies: {
- triggerFields: ['checkFlag'],
- // 闈炶川妫�宸ュ簭鏃讹紝鎶ュ伐鏁伴噺 = 鍚堟牸 + 涓嶈壇锛岀鐢ㄧ洿鎺ョ紪杈�
- componentProps: (values) => ({
- class: 'w-full',
- disabled: !values.checkFlag,
- min: 0,
- placeholder: '璇疯緭鍏ユ姤宸ユ暟閲�',
- precision: 2,
- }),
+ placeholder: '璇疯緭鍏ユ姤宸ユ暟閲�',
},
rules: 'required',
- },
- {
- fieldName: 'qualifiedQuantity',
- label: '鍚堟牸鍝佹暟閲�',
- component: 'InputNumber',
- componentProps: {
- class: 'w-full',
- min: 0,
- precision: 2,
- // 鍚堟牸/涓嶈壇鍙樻洿锛岃嚜鍔ㄧ疮璁′负鎶ュ伐鏁伴噺
- onChange: async () => {
- const values = await formApi?.getValues();
- await formApi?.setFieldValue(
- 'feedbackQuantity',
- (values?.qualifiedQuantity || 0) +
- (values?.unqualifiedQuantity || 0),
- );
- },
- },
- defaultValue: 0,
- dependencies: {
- triggerFields: ['checkFlag'],
- show: (values) => !values.checkFlag,
- },
- },
- {
- fieldName: 'unqualifiedQuantity',
- label: '涓嶈壇鍝佹暟閲�',
- component: 'InputNumber',
- componentProps: {
- class: 'w-full',
- min: 0,
- precision: 2,
- // 鍚堟牸/涓嶈壇鍙樻洿锛岃嚜鍔ㄧ疮璁′负鎶ュ伐鏁伴噺
- onChange: async () => {
- const values = await formApi?.getValues();
- await formApi?.setFieldValue(
- 'feedbackQuantity',
- (values?.qualifiedQuantity || 0) +
- (values?.unqualifiedQuantity || 0),
- );
- },
- },
- defaultValue: 0,
- dependencies: {
- triggerFields: ['checkFlag'],
- show: (values) => !values.checkFlag,
- },
- },
- {
- fieldName: 'laborScrapQuantity',
- label: '宸ュ簾鏁伴噺',
- component: 'InputNumber',
- componentProps: {
- class: 'w-full',
- min: 0,
- precision: 2,
- // 搴熷搧鍒嗙被鍙樻洿锛岃嚜鍔ㄧ疮璁′负涓嶈壇鍝佹暟閲忓強鎶ュ伐鏁伴噺
- onChange: async () => {
- const values = await formApi?.getValues();
- const unqualified =
- (values?.laborScrapQuantity || 0) +
- (values?.materialScrapQuantity || 0) +
- (values?.otherScrapQuantity || 0);
- await formApi?.setValues({
- feedbackQuantity: (values?.qualifiedQuantity || 0) + unqualified,
- unqualifiedQuantity: unqualified,
- });
- },
- },
- defaultValue: 0,
- dependencies: {
- triggerFields: ['checkFlag', 'unqualifiedQuantity'],
- show: (values) =>
- !values.checkFlag && (values.unqualifiedQuantity || 0) > 0,
- },
- },
- {
- fieldName: 'materialScrapQuantity',
- label: '鏂欏簾鏁伴噺',
- component: 'InputNumber',
- componentProps: {
- class: 'w-full',
- min: 0,
- precision: 2,
- // 搴熷搧鍒嗙被鍙樻洿锛岃嚜鍔ㄧ疮璁′负涓嶈壇鍝佹暟閲忓強鎶ュ伐鏁伴噺
- onChange: async () => {
- const values = await formApi?.getValues();
- const unqualified =
- (values?.laborScrapQuantity || 0) +
- (values?.materialScrapQuantity || 0) +
- (values?.otherScrapQuantity || 0);
- await formApi?.setValues({
- feedbackQuantity: (values?.qualifiedQuantity || 0) + unqualified,
- unqualifiedQuantity: unqualified,
- });
- },
- },
- defaultValue: 0,
- dependencies: {
- triggerFields: ['checkFlag', 'unqualifiedQuantity'],
- show: (values) =>
- !values.checkFlag && (values.unqualifiedQuantity || 0) > 0,
- },
- },
- {
- fieldName: 'otherScrapQuantity',
- label: '鍏朵粬搴熷搧',
- component: 'InputNumber',
- componentProps: {
- class: 'w-full',
- min: 0,
- precision: 2,
- // 搴熷搧鍒嗙被鍙樻洿锛岃嚜鍔ㄧ疮璁′负涓嶈壇鍝佹暟閲忓強鎶ュ伐鏁伴噺
- onChange: async () => {
- const values = await formApi?.getValues();
- const unqualified =
- (values?.laborScrapQuantity || 0) +
- (values?.materialScrapQuantity || 0) +
- (values?.otherScrapQuantity || 0);
- await formApi?.setValues({
- feedbackQuantity: (values?.qualifiedQuantity || 0) + unqualified,
- unqualifiedQuantity: unqualified,
- });
- },
- },
- defaultValue: 0,
- dependencies: {
- triggerFields: ['checkFlag', 'unqualifiedQuantity'],
- show: (values) =>
- !values.checkFlag && (values.unqualifiedQuantity || 0) > 0,
- },
},
{
fieldName: 'feedbackUserId',
@@ -614,8 +473,8 @@
render: (val) =>
h(DictTag, { type: DICT_TYPE.MES_PRO_FEEDBACK_TYPE, value: val }),
},
- { field: 'workOrderId', label: '鐢熶骇璁㈠崟', render: (_val, data) => data.workOrderCode },
- { field: 'taskId', label: '鐢熶骇浠诲姟', render: (_val, data) => data.taskCode },
+ { field: 'workOrderId', label: '鐢熶骇璁㈠崟', render: (_val, data) => data?.workOrderCode },
+ { field: 'taskId', label: '鐢熶骇浠诲姟', render: (_val, data) => data?.taskCode },
{ field: 'workstationName', label: '宸ヤ綔绔�' },
{ field: 'itemCode', label: '浜у搧缂栫爜' },
{ field: 'itemName', label: '浜у搧鍚嶇О' },
--
Gitblit v1.9.3