[update] 新增表单编辑时字典回显问题,标准选择传source,企标详情修改

This commit is contained in:
lideqin
2023-09-19 17:35:16 +08:00
parent 2479b33556
commit 2eafb3a179
5 changed files with 42 additions and 21 deletions
+10 -7
View File
@@ -35,7 +35,7 @@
v-model="formInline[item.dbFieldName]"
:filedName="item.dbFieldName"
@nameChange="userSelectNameChange"
:nameStr="formInline[item.dbFieldName + '_name']"
:nameStr="formInline[item.dbFieldName + '_dictText']"
type="radio"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
<!-- <user-or-organ-selection :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
@@ -104,6 +104,7 @@
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
<standard-selection :query="item"
:source="flag"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:standard="formInline"
@change="standardSelectionChange"
@@ -222,7 +223,7 @@
</a-form-model-item>
</div>
</a-col>
<!--14 年份选择-->
<!-- 14, 年份选择 -->
<a-col :span="12" v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value">
<div class="box-title-text" :title="item.dbFieldTxt">
<div class="title-text">
@@ -372,7 +373,8 @@ export default {
this.loading = false
return
}
this.getDocumentInfoFunc({ id: item.id }).then((res) => {
// type标识是新增表单还是详情页
this.getDocumentInfoFunc({ id: item.id, type: this.type }).then((res) => {
if (res.success) {
// 处理树结构多选回显
const formList = Object.values(this.dataList).reduce((acc, cur) => acc.concat(cur), [])
@@ -390,6 +392,10 @@ export default {
this.formInline[field.dbFieldName] = valueArr
}
})
const dictField = formList.filter(tt => tt.fieldShowType === FieldType.OPTION_SINGLE.value)
dictField.forEach(field => {
this.formInline[field.dbFieldName] = this.formInline[field.dbFieldName] || null
})
this.loading = false
} else {
this.loading = false
@@ -455,7 +461,6 @@ export default {
rules[res.dbFieldName] = rule
}
})
console.log(rules)
this.rules = rules
this.isFormInline = true
this.confirmLoading = false
@@ -508,7 +513,7 @@ export default {
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_name'] = value
this.formInline[fieldName + '_dictText'] = value
},
submit () {
this.$refs.ruleForm.validate(valid => {
@@ -539,8 +544,6 @@ export default {
</script>
<style scoped lang="less">
/deep/ .ant-form-item-children {
width: 100%;
display: inline-block;
@@ -70,6 +70,10 @@ export default {
default: () => {
return {}
}
},
source: {
type: [String, Number],
default: '1'
}
},
data () {
@@ -134,7 +138,8 @@ export default {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize
pageSize: this.ipagination.pageSize,
source: this.source
}
this.selectedRowKeys = []
this.loading = true
@@ -27,7 +27,7 @@
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<template v-if="record.key === mouseInNodeKey && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" v-has="'enterpriseStandard:tree:add'"
@click="handleTreeAdd(record)"></a-button>
@@ -43,7 +43,7 @@
class="tree-operate-node-btn" @click="handleTreeDelete(record.id)">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
</a-button>
</template>
</div>
</div>
</template>
</a-tree>
@@ -141,7 +141,7 @@
<!-- 左侧树节点的新增和编辑 -->
<tree-node-modal ref="treeNodeModal" @ok="treeNodeModalOk"></tree-node-modal>
<!-- 分享需要选人 -->
<user-select-modal ref="userSelectModal" @change="userSelectChange"></user-select-modal>
<user-select-modal ref="userSelectModal" type="checkbox" @change="userSelectChange"></user-select-modal>
</a-card>
</template>
@@ -37,14 +37,20 @@
<span>{{ formItem.dbFieldTxt }}</span>
<a-button v-if="formIndex === 0" type="primary" ghost icon="file-text">{{ $t('enterpriseStandardLibrary.standard.standardResolutionSheet') }}</a-button>
</div>
<div class="detail-page-process-manuscript-file" v-for="file in detailData[formItem.dbFieldName]" :key="file.id">
<div class="detail-page-process-manuscript-file" v-for="(fileId, index) in detailData[formItem.dbFieldName].split(',')" :key="fileId">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name">{{ file.fileName }}</div>
<div class="detail-page-process-manuscript-file-name">{{ detailData[formItem.dbFieldName + '_dictText'].split(',')[index] }}</div>
</div>
<div class="detail-page-process-manuscript-file-operate">
<a-button type="link" icon="download">{{ $t('download') }}</a-button>
<a-button type="link">
<a-button type="link"
icon="download"
@click="downloadDraft(fileId, detailData[formItem.dbFieldName + '_dictText'].split(',')[index])">
{{ $t('download') }}
</a-button>
<a-button
type="link"
@click="downloadDraftNoWater(fileId, detailData[formItem.dbFieldName + '_dictText'].split(',')[index])">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
@@ -87,6 +93,7 @@
<script>
import '@assets/less/common.less'
import { downloadFile } from '@/api/manage'
import { getEnterpriseStandardInfoById, getEnterpriseStandardAddForm } from '@/api/enterpriseStandardLibraryApi'
import UpdateRecordModal from '../../../standardRegulationLibrary/commonPage/modules/UpdateRecordModal'
import SubmitQuestionModal from '../../../standardRegulationLibrary/commonPage/modules/SubmitQuestionModal'
@@ -157,6 +164,14 @@ export default {
this.$message.warning(res.message)
}
})
},
// 过程稿件里的下载
downloadDraft (fileId, fileName) {
downloadFile(`/sys/common/download/${fileId}`, fileName)
},
// 过程稿件里的无水印下载
downloadDraftNoWater (fileId, fileName) {
},
// 企标评价
handleEvaluate () {
@@ -12,8 +12,9 @@
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<div class="custom-drawer-style-scroll">
<add-form ref="addForm"
flag="3"
:defaultValue="{year_number: new Date().getFullYear() + ''}"
:disabledFieldList="['replaced_stand_num', 'referenced_standard']"
:disabledFieldList="['replaced_standard_num', 'referenced_standard']"
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
@submitFormData="submitFormData" />
@@ -158,11 +159,8 @@ export default {
postAction(url, formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
if (this.formInline.id) {
this.$emit('ok')
} else {
this.$emit('ok')
}
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}