|
|
@ -1,5 +1,5 @@ |
|
|
import _ from 'lodash' |
|
|
import _ from 'lodash' |
|
|
import { getuuid, isEqual, isValueEmpty,isRegent } from '@/utils/index.js' |
|
|
|
|
|
|
|
|
import { getuuid, isEqual, isValueEmpty, isRegent } from '@/utils/index.js' |
|
|
import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js' |
|
|
import { isShowOtherByCheckboxTree } from '@/utils/formPackageCommon.js' |
|
|
import moment from 'moment' |
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
@ -63,8 +63,8 @@ export default { |
|
|
this.$set(this.errors, key, false) |
|
|
this.$set(this.errors, key, false) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getOrangeBg(key,sItem) { |
|
|
|
|
|
if(sItem.compareText){ |
|
|
|
|
|
|
|
|
getOrangeBg(key, sItem) { |
|
|
|
|
|
if (sItem.compareText) { |
|
|
return sItem.compareText == this.formFields[key] |
|
|
return sItem.compareText == this.formFields[key] |
|
|
} |
|
|
} |
|
|
return this.orangeBgFields[key] |
|
|
return this.orangeBgFields[key] |
|
|
@ -82,8 +82,8 @@ export default { |
|
|
}, |
|
|
}, |
|
|
//试剂/仪器等弹窗提交
|
|
|
//试剂/仪器等弹窗提交
|
|
|
onRegentSubmit(data, inputValue, key, item) { |
|
|
onRegentSubmit(data, inputValue, key, item) { |
|
|
if(data.selectInfo){ |
|
|
|
|
|
this.formFields[`selectInfo_${key}`] = JSON.parse(JSON.stringify(data.selectInfo)); |
|
|
|
|
|
|
|
|
if (data.selectInfo) { |
|
|
|
|
|
this.formFields[`selectInfo_${key}`] = JSON.parse(JSON.stringify(data.selectInfo)); |
|
|
} |
|
|
} |
|
|
if (data.type === "yq") { |
|
|
if (data.type === "yq") { |
|
|
this.formFields[`yqInfo_${key}`] = JSON.parse(JSON.stringify(data.row)); |
|
|
this.formFields[`yqInfo_${key}`] = JSON.parse(JSON.stringify(data.row)); |
|
|
@ -391,45 +391,46 @@ export default { |
|
|
currentConfig.otherCode |
|
|
currentConfig.otherCode |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 处理可能存在的直接otherCode字段
|
|
|
|
|
|
if (item.config?.otherCode) { |
|
|
|
|
|
config[item.config?.otherCode] = item.config?.otherCode |
|
|
|
|
|
} |
|
|
|
|
|
if (item.config?.thirdOtherCode) { |
|
|
|
|
|
config[item.config?.thirdOtherCode] = item.config?.thirdOtherCode |
|
|
|
|
|
} |
|
|
|
|
|
if (isRegent(item.config) || isRegent(item.config,"subType")) { |
|
|
|
|
|
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
|
|
|
|
|
|
// 优先使用this.formFields中以selectInfo_开头的字段
|
|
|
|
|
|
let selectInfoKeys = [], yqInfoKeys = []; |
|
|
|
|
|
if (this.formFields) { |
|
|
|
|
|
selectInfoKeys = Object.keys(this.formFields).filter((key) => |
|
|
|
|
|
key.startsWith('selectInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
yqInfoKeys = Object.keys(this.formFields).filter((key) => |
|
|
|
|
|
key.startsWith('yqInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
// 处理可能存在的直接otherCode字段
|
|
|
|
|
|
if (currentConfig.otherCode) { |
|
|
|
|
|
config[currentConfig.otherCode] = currentConfig.otherCode |
|
|
} |
|
|
} |
|
|
// 如果this.formFields中没有,则使用formData中的
|
|
|
|
|
|
if (selectInfoKeys.length === 0 && formData) { |
|
|
|
|
|
selectInfoKeys = Object.keys(formData).filter((key) => |
|
|
|
|
|
key.startsWith('selectInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if (currentConfig.thirdOtherCode) { |
|
|
|
|
|
config[currentConfig.thirdOtherCode] = currentConfig.thirdOtherCode |
|
|
} |
|
|
} |
|
|
if (yqInfoKeys.length === 0 && formData) { |
|
|
|
|
|
yqInfoKeys = Object.keys(formData).filter((key) => |
|
|
|
|
|
key.startsWith('yqInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if (isRegent(currentConfig) || isRegent(currentConfig, "subType")) { |
|
|
|
|
|
// 处理selectInfo_开头的字段,步骤表单需要保留selectInfo_开头的字段
|
|
|
|
|
|
// 优先使用this.formFields中以selectInfo_开头的字段
|
|
|
|
|
|
let selectInfoKeys = [], yqInfoKeys = []; |
|
|
|
|
|
if (this.formFields) { |
|
|
|
|
|
selectInfoKeys = Object.keys(this.formFields).filter((key) => |
|
|
|
|
|
key.startsWith('selectInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
yqInfoKeys = Object.keys(this.formFields).filter((key) => |
|
|
|
|
|
key.startsWith('yqInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
// 如果this.formFields中没有,则使用formData中的
|
|
|
|
|
|
if (selectInfoKeys.length === 0 && formData) { |
|
|
|
|
|
selectInfoKeys = Object.keys(formData).filter((key) => |
|
|
|
|
|
key.startsWith('selectInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
if (yqInfoKeys.length === 0 && formData) { |
|
|
|
|
|
yqInfoKeys = Object.keys(formData).filter((key) => |
|
|
|
|
|
key.startsWith('yqInfo_') |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
selectInfoKeys.forEach((key) => { |
|
|
|
|
|
result[key] = this.formFields[key] || formData[key] || '' |
|
|
|
|
|
}) |
|
|
|
|
|
yqInfoKeys.forEach((key) => { |
|
|
|
|
|
result[key] = this.formFields[key] || formData[key] || '' |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
selectInfoKeys.forEach((key) => { |
|
|
|
|
|
result[key] = this.formFields[key] || formData[key] || '' |
|
|
|
|
|
}) |
|
|
|
|
|
yqInfoKeys.forEach((key) => { |
|
|
|
|
|
result[key] = this.formFields[key] || formData[key] || '' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -649,7 +650,6 @@ export default { |
|
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
if (validateResult.valid && subComponentValidateResult.valid) { |
|
|
if (validateResult.valid && subComponentValidateResult.valid) { |
|
|
console.log(this.formFields, 'this.formFields') |
|
|
|
|
|
resolve(this.formFields) |
|
|
resolve(this.formFields) |
|
|
} else if (!validateResult.valid) { |
|
|
} else if (!validateResult.valid) { |
|
|
// this.$message.error("表单内容未填完,请填写后再提交");
|
|
|
// this.$message.error("表单内容未填完,请填写后再提交");
|
|
|
|