|
@@ -97,7 +97,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
<div class="hc-form-item">
|
|
<div class="hc-form-item">
|
|
- <el-form-item label="样品编号" prop="specificationNumber">
|
|
|
|
|
|
+ <el-form-item label="样品编号">
|
|
<el-input v-model="addEditFormModel.specificationNumber"/>
|
|
<el-input v-model="addEditFormModel.specificationNumber"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="取样日期">
|
|
<el-form-item label="取样日期">
|
|
@@ -203,7 +203,7 @@
|
|
<HcDialog :show="copyTableModal" title="复制样品登记信息" widths="60rem" isTable :loading="copyTableLoading" @close="copyTableModalClose" @save="copyTableClick">
|
|
<HcDialog :show="copyTableModal" title="复制样品登记信息" widths="60rem" isTable :loading="copyTableLoading" @close="copyTableModalClose" @save="copyTableClick">
|
|
<HcTable :column="copyTableColumn" :datas="copyTableData">
|
|
<HcTable :column="copyTableColumn" :datas="copyTableData">
|
|
<template #specificationNumber="{row}">
|
|
<template #specificationNumber="{row}">
|
|
- <el-input v-model="row.specificationNumber" :class="row.isSpecificationNumber?'is-error':''" placeholder="请输入样品编号" @blur="specificationNumberBlur(row)"/>
|
|
|
|
|
|
+ <el-input v-model="row.specificationNumber" placeholder="请输入样品编号"/>
|
|
</template>
|
|
</template>
|
|
<template #action="{index}">
|
|
<template #action="{index}">
|
|
<el-button type="danger" size="small" plain @click="specificationNumberDel(index)">删除</el-button>
|
|
<el-button type="danger" size="small" plain @click="specificationNumberDel(index)">删除</el-button>
|
|
@@ -440,23 +440,7 @@ const addEditFormRules = {
|
|
required: true,
|
|
required: true,
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
message: "请输入样品名称"
|
|
message: "请输入样品名称"
|
|
- },
|
|
|
|
- specificationNumber: {
|
|
|
|
- required: true,
|
|
|
|
- validator: async (rule, value, callback) => {
|
|
|
|
- if (!value) {
|
|
|
|
- callback(new Error('请输入样品编号'))
|
|
|
|
- } else {
|
|
|
|
- const ver = await verification(value)
|
|
|
|
- if (!ver) {
|
|
|
|
- callback(new Error('样品编号必须是惟一的'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- trigger: 'blur'
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//校验材料编号是否唯一
|
|
//校验材料编号是否唯一
|
|
@@ -511,17 +495,6 @@ const copyTableModalClick = () => {
|
|
copyTableData.value = deepClone(tableCheckedKeys.value)
|
|
copyTableData.value = deepClone(tableCheckedKeys.value)
|
|
}
|
|
}
|
|
|
|
|
|
-//效验材料编号
|
|
|
|
-const specificationNumberBlur = async (row) => {
|
|
|
|
- const number = row?.specificationNumber ?? ''
|
|
|
|
- if (number) {
|
|
|
|
- const ver = await verification(number)
|
|
|
|
- row.isSpecificationNumber = !ver
|
|
|
|
- } else {
|
|
|
|
- row.isSpecificationNumber = true
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
//删除
|
|
//删除
|
|
const specificationNumberDel = (index) => {
|
|
const specificationNumberDel = (index) => {
|
|
copyTableData.value.splice(index, 1);
|
|
copyTableData.value.splice(index, 1);
|
|
@@ -541,19 +514,10 @@ const copyTableClick = () => {
|
|
copyTableModal.value = false
|
|
copyTableModal.value = false
|
|
const rows = copyTableData.value
|
|
const rows = copyTableData.value
|
|
if (rows.length > 0) {
|
|
if (rows.length > 0) {
|
|
- //判断是否满足条件
|
|
|
|
- const result = rows.every(({isSpecificationNumber})=> {
|
|
|
|
- return isSpecificationNumber === false
|
|
|
|
- })
|
|
|
|
- //判断状态
|
|
|
|
- if (result) {
|
|
|
|
- for (let i = 0; i < rows.length; i++) {
|
|
|
|
- rows[i].dataNumber = i
|
|
|
|
- }
|
|
|
|
- tableCopyData(rows)
|
|
|
|
- } else {
|
|
|
|
- window.$message?.warning('请先完善材料编号')
|
|
|
|
|
|
+ for (let i = 0; i < rows.length; i++) {
|
|
|
|
+ rows[i].dataNumber = i
|
|
}
|
|
}
|
|
|
|
+ tableCopyData(rows)
|
|
} else {
|
|
} else {
|
|
window.$message?.warning('请先在列表勾选要复制的数据')
|
|
window.$message?.warning('请先在列表勾选要复制的数据')
|
|
copyTableModal.value = false
|
|
copyTableModal.value = false
|