拆分属性查看与编辑框一致

This commit is contained in:
shenyanpei
2021-12-29 09:36:26 +08:00
parent 3dc4806176
commit 7285c160d2
@@ -319,7 +319,7 @@
@close="showItemInfoModal = false"
class="demo-drawer"
>
<div class="see-drawer-content">
<!-- <div class="see-drawer-content">
<div class="see-drawer-div">
<label class="see-drawer-name" title="条款号">条款号</label>
<span class="see-drawer-val" :title="showItemInfoEO.itemsNum">{{ showItemInfoEO.itemsNum }}</span>
@@ -332,7 +332,7 @@
<label class="see-drawer-name" title="内容简介">内容简介</label>
<span class="see-drawer-val" :title="showItemInfoEO.itermsConditions ? showItemInfoEO.itermsConditions.replace(/<.*?>/ig, ' ') : ''">{{ showItemInfoEO.itermsConditions ? showItemInfoEO.itermsConditions.replace(/<.*?>/ig, ' ') : '' }}</span>
</div>
<!-- <div class="see-drawer-div">
<div class="see-drawer-div">
<label class="see-drawer-name" title="责任部门">责任部门</label>
<span class="see-drawer-val" :title="showItemInfoEO.responsibleUnitShow">{{ showItemInfoEO.responsibleUnitShow }}</span>
</div>
@@ -359,7 +359,123 @@
<div class="see-drawer-div">
<label class="see-drawer-name" title="企标覆盖关系">企标覆盖关系</label>
<span class="see-drawer-val" :title="getDicTypeName('BZFGGXOUIUJ', showItemInfoEO.busStandCover)">{{ getDicTypeName('BZFGGXOUIUJ', showItemInfoEO.busStandCover) }}</span>
</div>-->
</div>
</div>-->
<div class="demo-drawer-content">
<el-form
ref="sarStandardsItemForm"
:model="standItemEO"
class="label-input-form"
:rules="sarStandardItemRules"
label-width="150px"
>
<el-input v-model="standItemEO.id" v-if="false"></el-input>
<el-form-item label="条款号" prop="itemsNum" class="add-form-item">
<el-input v-model="standItemEO.itemsNum" readonly placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="条款名称" prop="itemsName" class="add-form-item">
<el-input v-model="standItemEO.itemsName" readonly placeholder="请输入内容"></el-input>
</el-form-item>
<!-- <custom-org
key="责任部门"
:config="{
attrName: '责任部门',
attrField: 'responsibleUnit',
selVal: 'ORGLIST',
valueName: standItemEO.responsibleUnitShow
}"
v-model="standItemEO.ZRBM"
@on-checked="onChecked"
></custom-org>
<custom-org
key="FO"
:config="{
attrName: 'FO',
attrField: 'FO',
selVal: 'ROLELIST',
valueName: standItemEO.foShow
}"
v-model="standItemEO.fo"
check-enable
:data-model="standItemEO"
@on-checked="checkedName => {standItemEO.foShow = checkedName}"
></custom-org>
<custom-role-tree
:key = "Math.random() + 'dutyEngineer'"
:config="{
attrName: '项目评估角色',
attrField: 'dutyEngineer',
valueName: standItemEO.dutyEngineerShow
}"
v-model="standItemEO.dutyEngineer"
:data-model="standItemEO"
@on-checked="checkedName => {standItemEO.dutyEngineerShow = checkedName}"
></custom-role-tree>
<custom-SVPPS
:key = "Math.random() + 'svpps'"
:config="{
attrName: 'SVPPS',
attrField: 'svpps',
valueName: standItemEO.svppsShow
}"
v-model="standItemEO.svpps"
:data-model="standItemEO"
@on-checked="checkedName => {standItemEO.svppsShow = checkedName}"
></custom-SVPPS>
<el-form-item label="适用车辆类型" prop="applyArctic" class="add-form-item">
<el-select v-model="standItemEO.applyArctic" multiple placeholder="请选择" :filterable="true">
<el-option
v-for="opt in applyArcticOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="要求类型" prop="claimType" class="add-form-item">
<el-select v-model="standItemEO.claimType" placeholder="请选择" :filterable="true">
<el-option
v-for="opt in requestOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="企标覆盖关系" prop="busStandCover" class="add-form-item">
<el-select v-model="standItemEO.busStandCover" placeholder="请选择">
<el-option
v-for="item in BZFGGXOUIUJ"
:key="item.value"
:value="item.value"
:label="item.label"></el-option>
</el-select>
</el-form-item>-->
<el-divider content-position="left">内容简介</el-divider>
<div style="border:1px dashed #999;margin-bottom:20px;padding:10px">
<div v-for="(item, index) in itemsContentList" :key="index">
<el-row>
<el-col :span="18" v-if="item.type === 'TEXT'">
<el-input v-model.trim="item.id" v-if="false"></el-input>
<el-input type="textarea" :autosize="true" readonly class="updateContentInput" v-model.trim="item.itemContent" placeholder="请输入" clearable :maxlength="1000"></el-input>
</el-col>
<el-col :span="16" v-if="item.type === 'IMG'">
<div style="padding-top: 10px">
<el-input v-model.trim="item.id" v-if="false"></el-input>
<div style="width: 30%;height: 30%;" v-html="item.itemContent" @click="previewImage(item.itemContent)">{{item.itemContent}}</div>
</div>
</el-col>
<el-col :span="16" v-if="item.type === 'TABLE'">
<div style="padding-top: 10px" class="wordTableStyle">
<el-input v-model.trim="item.id" v-if="false"></el-input>
<div class="updateContentInput" v-html="item.itemContent">
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</el-form>
</div>
</el-drawer>
<!--编辑条款内容-->
@@ -1873,35 +1989,6 @@ export default {
})
}
},
// 获取关联文件名称
getFileName (row) {
this.referanceStandList = []
if (row.referenceStand != null && row.referenceStand !== '') {
this.referanceStandList = row.referenceStand.split(',')
}
if (row.relevanceFile === null) {
this.standItemEO.FileNameList = []
this.showItemInfoModal = true
return false
} else {
this.$http.get('att/attFile/getMultiFileInfos', {
fileIds: row.relevanceFile
}, {
_this: this
}, res => {
// let fileNameList = []
// this.standItemEO.relevanceFileName = ''
// res.data.map((item) => {
// fileNameList.push(item.oldFileName)
// })
// this.standItemEO.relevanceFileName = fileNameList.join('')
this.standItemEO.FileNameList = res.data
this.showItemInfoModal = true
}, e => {
this.showItemInfoModal = true
})
}
},
addSpecialRequest (item, index) {
let specialObj = {
description: '',
@@ -2084,7 +2171,7 @@ export default {
// this.clause(command[0])
// break
case '属性':
this.attribute(command[0])
this.attribute(command[2], command[0])
break
case '编辑':
this.editLawsInfo(command[2], command[0])
@@ -2154,9 +2241,65 @@ export default {
this.showItemRequestDetails()
},
// 点击表格 属性按钮事件
attribute (row) {
this.getFileName(row)
this.showItemInfoEO = JSON.parse(JSON.stringify(row))
attribute (index, row) {
this.isSubmit = false
this.standItemEO.id = row.id
this.showItemInfoModal = true
this.saveEditItemIndex = index
this.standItemEO = JSON.parse(JSON.stringify(row))
if (this.standItemEO.applyArctic && !(this.standItemEO.applyArctic instanceof Array)) {
let a = this.standItemEO.applyArctic.split(',')
this.standItemEO.applyArctic = a // 适用车型
}
if (this.standItemEO.newcarPutTime != null && this.standItemEO.newcarPutTime !== '') {
this.standItemEO.newcarPutTime = this.standItemEO.newcarPutTime.replace(new RegExp(/-/gm), '/')
this.standItemEO.newcarPutTime = new Date(this.standItemEO.newcarPutTime)
}
if (this.standItemEO.productPutTime != null && this.standItemEO.productPutTime !== '') {
this.standItemEO.productPutTime = this.standItemEO.productPutTime.replace(new RegExp(/-/gm), '/')
this.standItemEO.productPutTime = new Date(this.standItemEO.productPutTime)
}
if (this.standItemEO.paramsList == null || this.standItemEO.paramsList.length < 1) {
let specialObj = {
description: '',
figure: ''
}
this.standItemEO.paramsList.push(specialObj)
}
this.standItemEO.ZRBM = this.standItemEO.responsibleUnit
this.saveItemId = row.id
this.showUpdateItemInfo()
// this.getFileName(row)
// this.showItemInfoEO = JSON.parse(JSON.stringify(row))
},
// 获取关联文件名称
getFileName (row) {
this.referanceStandList = []
if (row.referenceStand != null && row.referenceStand !== '') {
this.referanceStandList = row.referenceStand.split(',')
}
if (row.relevanceFile === null) {
this.standItemEO.FileNameList = []
this.showItemInfoModal = true
return false
} else {
this.$http.get('att/attFile/getMultiFileInfos', {
fileIds: row.relevanceFile
}, {
_this: this
}, res => {
// let fileNameList = []
// this.standItemEO.relevanceFileName = ''
// res.data.map((item) => {
// fileNameList.push(item.oldFileName)
// })
// this.standItemEO.relevanceFileName = fileNameList.join('')
this.standItemEO.FileNameList = res.data
this.showItemInfoModal = true
}, e => {
this.showItemInfoModal = true
})
}
},
getDicTypeName(opt, type) {
const _type = type ? type.split(',') : []