优化
This commit is contained in:
@ -25,9 +25,6 @@
|
||||
<el-form-item label="保管单位" prop="storageUnit">
|
||||
<el-input v-model="queryParams.storageUnit" placeholder="请输入保管单位" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷情况" prop="defectDescription">
|
||||
<el-input v-model="queryParams.defectDescription" placeholder="请输入缺陷情况" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@ -277,42 +274,45 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MaterialIssueForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '1',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
issueUnit: undefined,
|
||||
storageUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
id: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
stockQuantity: undefined,
|
||||
issuedQuantity: undefined,
|
||||
remainingQuantity: undefined,
|
||||
name: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
// 定义一个函数来生成初始表单数据
|
||||
const getInitFormData = () => {
|
||||
return {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
materialSource: '1',
|
||||
formCode: undefined,
|
||||
projectName: undefined,
|
||||
materialName: undefined,
|
||||
orderingUnit: undefined,
|
||||
supplierUnit: undefined,
|
||||
issueUnit: undefined,
|
||||
storageUnit: undefined,
|
||||
defectDescription: undefined,
|
||||
certCount: undefined,
|
||||
certCountFileId: undefined,
|
||||
reportCount: undefined,
|
||||
reportCountFileId: undefined,
|
||||
techDocCount: undefined,
|
||||
techDocCountFileId: undefined,
|
||||
licenseCount: undefined,
|
||||
licenseCountFileId: undefined,
|
||||
remark: undefined,
|
||||
itemList: [
|
||||
{
|
||||
id: undefined,
|
||||
specification: undefined,
|
||||
unit: undefined,
|
||||
stockQuantity: undefined,
|
||||
issuedQuantity: undefined,
|
||||
remainingQuantity: undefined,
|
||||
name: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
||||
const data = reactive<PageData<MaterialIssueForm, MaterialIssueQuery>>({
|
||||
form: { ...initFormData },
|
||||
form: getInitFormData(),
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@ -352,7 +352,7 @@ const cancel = () => {
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
form.value = getInitFormData();
|
||||
materialIssueFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user