diff --git a/src/api/mes/task/index.ts b/src/api/mes/task/index.ts
index 3441d359..26880cc2 100644
--- a/src/api/mes/task/index.ts
+++ b/src/api/mes/task/index.ts
@@ -13,6 +13,7 @@ export interface TaskVO {
status: number // 状态
processInstanceId: string // 流程实例的编号
remark: string // 备注
+ fileUrl?: string // 附件 URL
isEnable: boolean // 是否启用
}
// 物料 VO
diff --git a/src/locales/en.ts b/src/locales/en.ts
index 847c7ccb..f7d30a5f 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -4433,8 +4433,10 @@ export default {
urgentYesLabel: 'Yes',
dialogRemarkLabel: 'Remark',
dialogRemarkPlaceholder: 'Please enter remark',
+ dialogFileUrlLabel: 'Attachment',
dialogSubmitButtonText: 'Confirm',
dialogCancelButtonText: 'Cancel',
+ fileUploadingTip: 'Attachment is uploading. Please submit later.',
validatorTaskNameRequired: 'Task name cannot be empty',
validatorCustomerRequired: 'Customer cannot be empty',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index d40b53e8..e4ed5394 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -4286,8 +4286,10 @@ export default {
urgentYesLabel: '是',
dialogRemarkLabel: '备注',
dialogRemarkPlaceholder: '请输入备注',
+ dialogFileUrlLabel: '附件',
dialogSubmitButtonText: '确 定',
dialogCancelButtonText: '取 消',
+ fileUploadingTip: '附件上传中,请稍后提交',
validatorTaskNameRequired: '任务单名称不能为空',
validatorCustomerRequired: '客户不能为空',
diff --git a/src/views/mes/task/TaskForm.vue b/src/views/mes/task/TaskForm.vue
index e64971e0..98b5b57c 100644
--- a/src/views/mes/task/TaskForm.vue
+++ b/src/views/mes/task/TaskForm.vue
@@ -5,7 +5,7 @@
:model="formData"
:rules="formRules"
label-width="120px"
- v-loading="formLoading"
+ v-loading="formLoading || fileUploading"
>
@@ -95,9 +95,18 @@
type="textarea"
/>
+
+
+
+
-
+
{{ t('ProductionPlan.Task.dialogSubmitButtonText') }}
@@ -230,6 +239,7 @@ type TaskFormData = {
isUrgent?: string
processInstanceId?: string
remark?: string
+ fileUrl?: string
isEnable?: boolean
isCode?: boolean
}
@@ -238,6 +248,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const fileUploading = ref(false)
const formData = ref({
id: undefined,
taskName: undefined,
@@ -251,6 +262,7 @@ const formData = ref({
isUrgent: undefined,
processInstanceId: undefined,
remark: undefined,
+ fileUrl: undefined,
isEnable: undefined,
isCode: undefined
})
@@ -366,6 +378,10 @@ const clearCustomer = () => {
formRef.value?.clearValidate('customerId')
}
+const handleFileUploadingChange = (uploading: boolean) => {
+ fileUploading.value = uploading
+}
+
const hydrateCustomerName = async () => {
const customerId = formData.value.customerId
if (!customerId || formData.value.customerName) return
@@ -403,6 +419,10 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
const submitForm = async () => {
+ if (fileUploading.value) {
+ message.warning(t('ProductionPlan.Task.fileUploadingTip'))
+ return
+ }
// 校验表单
await formRef.value.validate()
// 提交请求
@@ -440,10 +460,12 @@ const resetForm = () => {
status: undefined,
processInstanceId: undefined,
remark: undefined,
+ fileUrl: undefined,
isEnable: true,
isCode: true
}
formRef.value?.resetFields()
+ fileUploading.value = false
}