From f3cac4aa2db56d6017c1d1dc035bcfeaec76c3e2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 18:31:13 +0800
Subject: [PATCH] feat(crm): 投标保证金迁移到销售管理并接入销售台账
---
src/views/mes/pro/feedback/data.ts | 193 ++++--------------------------------------------
1 files changed, 17 insertions(+), 176 deletions(-)
diff --git a/src/views/mes/pro/feedback/data.ts b/src/views/mes/pro/feedback/data.ts
index 573f29c..e4b989d 100644
--- a/src/views/mes/pro/feedback/data.ts
+++ b/src/views/mes/pro/feedback/data.ts
@@ -10,16 +10,16 @@
DICT_TYPE,
MesAutoCodeRuleCode,
MesProTaskStatusEnum,
- MesProWorkOrderStatusEnum,
} from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
+import { formatDate } from '@vben/utils';
import { Button } from 'ant-design-vue';
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';
@@ -137,17 +137,20 @@
{ field: 'workstationName', title: '宸ヤ綔绔�', width: 120 },
{ field: 'processName', title: '宸ュ簭', width: 100 },
{ field: 'workOrderCode', title: '鐢熶骇璁㈠崟缂栫爜', width: 160 },
+ { field: 'reelNo', title: '鐩樺彿', minWidth: 120 },
{ field: 'itemCode', title: '浜у搧鐗╂枡缂栫爜', width: 120 },
{ field: 'itemName', title: '浜у搧鐗╂枡鍚嶇О', minWidth: 140 },
{ field: 'itemSpecification', title: '瑙勬牸鍨嬪彿', width: 120 },
{ field: 'unitMeasureName', title: '鍗曚綅', width: 80 },
{ field: 'feedbackQuantity', title: '鎶ュ伐鏁伴噺', width: 100 },
+ { field: 'qualifiedQuantity', title: '璐ㄦ鍚堟牸鏁伴噺', width: 120 },
+ { field: 'unqualifiedQuantity', title: '璐ㄦ涓嶅悎鏍兼暟閲�', width: 130 },
{ field: 'feedbackUserNickname', title: '鎶ュ伐浜�', width: 100 },
{
field: 'feedbackTime',
title: '鎶ュ伐鏃堕棿',
width: 180,
- formatter: 'formatDateTime',
+ formatter: 'formatDate',
},
{ field: 'approveUserNickname', title: '瀹℃牳浜�', width: 100 },
{
@@ -174,9 +177,8 @@
* - create / update锛氬綍鍏ユ姤宸ヤ富浣撲俊鎭拰鏁伴噺
* - submit / approve / detail锛氫富浣撳瓧娈靛彧璇�
*
- * 鏁伴噺鍖哄煙鏍规嵁 `checkFlag` 鍜� `unqualifiedQuantity` 鍔ㄦ�佹樉绀猴細
- * - 闈炶川妫�宸ュ簭锛氭姤宸ユ暟閲� = 鍚堟牸 + 涓嶈壇锛涗笉鑹� > 0 鏃跺啀灞曞紑宸ュ簾/鏂欏簾/鍏朵粬搴熷搧
- * - 璐ㄦ宸ュ簭锛氬彧濉姤宸ユ暟閲忥紙瑙嗕负寰呮鏁伴噺锛�
+ * 鎶ュ伐鍙~鍐�"鎶ュ伐鏁伴噺"锛涘悎鏍煎搧/涓嶈壇鍝佹暟閲忕敱璐ㄦ纭畾锛屾姤宸ョ幆鑺備笉閲囬泦銆�
+ * 鎶ュ伐瀹℃壒鍚庝骇鍑哄潎寰呮楠岋紝鍚堟牸鍝佺粡妫�楠屽悗鍏ュ簱銆�
*/
export function useFormSchema(
formType: FormType,
@@ -188,12 +190,6 @@
fieldName: 'id',
component: 'Input',
dependencies: { triggerFields: [''], show: () => false },
- },
- {
- fieldName: 'checkFlag',
- component: 'Input',
- dependencies: { triggerFields: [''], show: () => false },
- defaultValue: true,
},
{
fieldName: 'routeId',
@@ -253,11 +249,9 @@
componentProps: {
disabled: isHeaderReadonly,
placeholder: '璇烽�夋嫨璁㈠崟',
- status: MesProWorkOrderStatusEnum.CONFIRMED,
// 璁㈠崟鍙樻洿锛氭竻绌轰换鍔″強浠诲姟甯﹀嚭鐨勪骇鍝佷俊鎭�佹暟閲忓尯鍩熸帶鍒朵綅
onChange: async () => {
await formApi?.setValues({
- checkFlag: true,
itemCode: undefined,
itemId: undefined,
itemName: undefined,
@@ -287,7 +281,7 @@
workstationId: values.workstationId,
}),
},
- // 浠诲姟鍙樻洿锛氳嚜鍔ㄥ~鍏呭叧鑱斿瓧娈点�佷骇鍝佷俊鎭�乧heckFlag锛屽苟鍔犺浇浠诲姟缁戝畾鐨勫伐鑹哄弬鏁�
+ // 浠诲姟鍙樻洿锛氳嚜鍔ㄥ~鍏呭叧鑱斿瓧娈点�佷骇鍝佷俊鎭紝骞跺姞杞戒换鍔$粦瀹氱殑宸ヨ壓鍙傛暟
componentProps: {
onChange: async (task?: MesProTaskApi.Task) => {
await loadParamDetails(task?.id);
@@ -305,21 +299,6 @@
workstationId: task.workstationId,
reportableQuantity: task.reportableQuantity,
});
- // 宸ヨ壓璺嚎宸ュ簭鐨� checkFlag 鍐冲畾鏁伴噺鍖哄煙灞曠ず
- if (task.routeId && task.processId) {
- try {
- const routeProcess = await getRouteProcessByRouteAndProcess(
- task.routeId,
- task.processId,
- );
- await formApi?.setFieldValue(
- 'checkFlag',
- routeProcess?.checkFlag ?? false,
- );
- } catch {
- await formApi?.setFieldValue('checkFlag', true);
- }
- }
},
},
rules: 'selectRequired',
@@ -404,151 +383,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',
@@ -616,8 +453,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: '浜у搧鍚嶇О' },
@@ -631,7 +468,11 @@
{ field: 'materialScrapQuantity', label: '鏂欏簾鏁伴噺' },
{ field: 'otherScrapQuantity', label: '鍏朵粬搴熷搧' },
{ field: 'feedbackUserNickname', label: '鎶ュ伐浜�' },
- { field: 'feedbackTime', label: '鎶ュ伐鏃堕棿' },
+ {
+ field: 'feedbackTime',
+ label: '鎶ュ伐鏃堕棿',
+ render: (val) => formatDate(val) as string,
+ },
{ field: 'approveUserNickname', label: '瀹℃牳浜�' },
{ field: 'remark', label: '澶囨敞' },
];
--
Gitblit v1.9.3