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