Browse Source

添加新字段及优化检验项目列保存时会新增数据的bug

master
李磊 3 years ago
parent
commit
666f51d434
  1. 56
      src/components/drawerDialog/index.vue

56
src/components/drawerDialog/index.vue

@ -23,12 +23,21 @@
:model="formTemplate"
class="small-space"
label-position="left"
label-width="80px"
label-width="110px"
style="margin-left: 50px"
>
<el-form-item label="模板名称" prop="tempName" required>
<el-input v-model="formTemplate.tempName" type="text" style="width:400px" />
</el-form-item>
<el-form-item label="通用模板文件名" prop="commonFilename">
<el-input v-model="formTemplate.commonFilename" type="text" style="width:400px" />
<el-alert
type="warning"
title="用于处理多类别品种下或多检验类别下对应一份模板的情况,为空时取模板名称"
style="display: inline"
:closable="false"
/>
</el-form-item>
<el-form-item label="模板类型" prop="tempCategory" required>
<el-select
v-model="formTemplate.tempCategory"
@ -268,7 +277,7 @@
>
<template slot-scope="scope">
<div>
{{ scope.row.writeMode && writeModes[scope.row.writeMode] }}
{{ writeModes[scope.row.writeMode] }}
</div>
</template>
</el-table-column>
@ -305,7 +314,7 @@
>
<template slot-scope="scope">
<div>
{{ scope.row.tableType === 1 ? "检验项目" : "目录页" }}
{{ scope.row.tableType === 0 ? "检验项目" : "目录页" }}
</div>
</template>
</el-table-column>
@ -474,6 +483,17 @@
</el-dialog>
<el-dialog title="新增" :visible.sync="dialogVisible1" width="50%" @close="close">
<el-form ref="templateSettingForm" :model="form">
<el-form-item
label="检验项目模式"
prop="writeMode"
label-width="150px"
>
<el-radio-group v-model="form.jyxmMode">
<el-radio v-for="(item, jyxmModeIndex) in jyxmModes" :key="jyxmModeIndex" :label="jyxmModeIndex">
{{ item }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="检验项目索引" prop="sort" label-width="150px">
<el-input-number v-model="form.sort" :min="0" :max="100" />
<el-alert
@ -621,10 +641,10 @@
prop="tableType"
label-width="150px"
>
<el-radio v-model="form.tableType" :label="1">
<el-radio v-model="form.tableType" :label="0">
检验项目
</el-radio>
<el-radio v-model="form.tableType" :label="2">
<el-radio v-model="form.tableType" :label="1">
目录页
</el-radio>
</el-form-item>
@ -639,6 +659,23 @@
inactive-text="不是"
/>
</el-form-item>
<el-form-item
label="检验项目列数据转换"
prop="hasJyxmFiledValueConvertState"
label-width="150px"
>
<el-switch
v-model="form.hasJyxmFiledValueConvertState"
active-text="存在"
inactive-text="不存在"
/>
<el-alert
type="warning"
title="例如存在用户签名字段则为true,如果为false并且写入模式为CN或DN模式时,不需要配置检验项目列!"
style="display: inline"
:closable="false"
/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible1 = false"> </el-button>
@ -767,6 +804,7 @@ export default {
templateSettingId: ''
},
totalCount1: 0,
jyxmModes: ['检验项目', '附表', '不合格整改检验项目', '大型起重机械检验项目', '报告检验项目'],
writeModes: ['CN模式', 'DN模式', 'KV模式', 'CFI模式', 'SA模式']
}
},
@ -904,11 +942,7 @@ export default {
},
editFn(row) {
this.dialogVisible = true
this.formLabelAlign.field = row.filed
this.formLabelAlign.fieldMode = row.fieldMode
this.formLabelAlign.indexFromRight = row.indexFromRight
this.formLabelAlign.templateSettingId = row.id
this.formLabelAlign.templateId = this.id
this.formLabelAlign = this.common.deepCopy(row)
},
handleChange(value) {
this.formLabelAlign.indexFromRight = value
@ -918,7 +952,7 @@ export default {
this.formLabelAlign.templateId = this.id
this.api({
url: '/templateJyxm',
method: 'post',
method: this.formLabelAlign.id ? 'put' : 'post',
data: this.formLabelAlign
}).then((res) => {
this.dialogVisible = false

Loading…
Cancel
Save