[update] -问题征集问题的修改

This commit is contained in:
fengchenchen
2022-07-18 17:38:10 +08:00
parent 44f2a7fb89
commit b9815bc457
3 changed files with 74 additions and 14 deletions
@@ -172,7 +172,16 @@
<!-- 问题征集的详细信息--> <!-- 问题征集的详细信息-->
<section v-if="isAddQuestion"> <section v-if="isAddQuestion">
<a-row :gutter="24" v-for="(question, index) in model.questionList" :key="index"> <a-row :gutter="24" v-for="(question, index) in model.questionList" :key="index">
<a-col> </a-col> <!-- 存儲初始化的id-->
<a-col v-show="false">
<a-form-item :label="'标准号id ' + (index + 1) " :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
v-decorator="['questionList['+index+'].id']"
placeholder="请输入标准号id"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="8" :xl="10" :sm="24"> <a-col :xxl="8" :xl="10" :sm="24">
<a-form-item :label="'标准号 ' + (index + 1) " :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="'标准号 ' + (index + 1) " :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input <a-input
@@ -661,7 +670,7 @@ export default {
// 问题征集列表 // 问题征集列表
this.model.questionList = [{ this.model.questionList = [{
standardNumber: undefined, standardNumber: undefined,
standardName: '' standardName: undefined
}] }]
} }
this.model.isAddQuestion = this.model.isAddQuestion || 0 // 处理历史数据的问题 this.model.isAddQuestion = this.model.isAddQuestion || 0 // 处理历史数据的问题
@@ -680,7 +689,7 @@ export default {
// 问题征集列表 // 问题征集列表
this.model.questionList = [{ this.model.questionList = [{
standardNumber: undefined, standardNumber: undefined,
standardName: '' standardName: undefined
}] }]
// 新增取路由参数 // 新增取路由参数
this.meetingType = this.$route.query.meetingType this.meetingType = this.$route.query.meetingType
@@ -723,6 +732,7 @@ export default {
if(this.model.isAddQuestion) { if(this.model.isAddQuestion) {
otherKeys = ['endTimeAddQuestion', 'questionList'] otherKeys = ['endTimeAddQuestion', 'questionList']
} }
this.tbMeetingType = Number(this.model.tbMeetingType)
// 标准宣贯或者学习培训 // 标准宣贯或者学习培训
this.$refs.standardMeetingType.setCurrentDictOptions(arr.splice(0, 2)) this.$refs.standardMeetingType.setCurrentDictOptions(arr.splice(0, 2))
} }
@@ -763,6 +773,10 @@ export default {
} else { } else {
httpurl = this.url.add httpurl = this.url.add
} }
// 判断问题征集的列表 如果没有则增加key
if(!values.questionList) {
values.questionList = null
}
// let placeName = values.convokeLocale // let placeName = values.convokeLocale
//{venue: this.getPcaText(placeName)} //{venue: this.getPcaText(placeName)}
const formData = Object.assign(this.model, values) const formData = Object.assign(this.model, values)
@@ -802,6 +816,7 @@ export default {
formData.endSignInTime = this.newSignInTime[1] formData.endSignInTime = this.newSignInTime[1]
} }
formData.convokeLocale = '10001' formData.convokeLocale = '10001'
console.log('表单提交数据', formData) console.log('表单提交数据', formData)
httpAction(httpurl, formData, method).then((res) => { httpAction(httpurl, formData, method).then((res) => {
if (res.success) { if (res.success) {
@@ -1026,8 +1041,8 @@ export default {
} }
const {form} = this const {form} = this
const obj = { const obj = {
standardNumber: '', standardNumber: undefined,
standardName: '' standardName: undefined
} }
const keys = form.getFieldValue('questionList') const keys = form.getFieldValue('questionList')
// 增加数据后重新赋值 // 增加数据后重新赋值
@@ -58,7 +58,7 @@
<a-row class="flex-col mul-row-row" v-if="currentMeetingInfo.isAddQuestion === '1'"> <a-row class="flex-col mul-row-row" v-if="currentMeetingInfo.isAddQuestion === '1'">
<label class="label">标准号及标准名称:</label> <label class="label">标准号及标准名称:</label>
<span class="mul-row-content"> <span class="mul-row-content">
<span class="content" v-for="(item,index) of currentMeetingInfo.questionList" :key="index">{{ '标准号:' + item.standardNumber + '&nbsp;&nbsp;' + ' 标准名称:' + item.standardName }}</span> <span class="content" v-for="(item,index) of currentMeetingInfo.questionList" :key="index">{{item.standardNumber + ' ( ' + item.standardName + ' ) '}}</span>
</span> </span>
</a-row> </a-row>
</template> </template>
@@ -12,7 +12,7 @@
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{model.addQuestionStatue}}</span> <span>{{model.addQuestionStatue_dictText}}</span>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -55,7 +55,7 @@
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:scroll="{x: 1600}" :scroll="{x: 1200}"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@@ -69,6 +69,13 @@
</a-tooltip> </a-tooltip>
</template> </template>
<template slot="name-text" slot-scope="text">
<a-tooltip overlayClassName="name-text-tooltip">
<template v-if="text" slot="title">{{ text }}</template>
<div class="table-text table-name-text">{{ text }}</div>
</a-tooltip>
</template>
</a-table> </a-table>
</div> </div>
<business-management-module ref="modalForm" @ok="modalFormOk"></business-management-module> <business-management-module ref="modalForm" @ok="modalFormOk"></business-management-module>
@@ -128,27 +135,30 @@ export default {
{ {
title: '章条编号', title: '章条编号',
align: 'center', align: 'center',
width: 280, width: 200,
dataIndex: 'number', dataIndex: 'number',
scopedSlots: {customRender: 'text'} scopedSlots: {customRender: 'text'}
}, },
{ {
title: '问题描述', title: '问题描述',
align: 'center', align: 'center',
width: 180, width: 250,
dataIndex: 'questionName' dataIndex: 'questionName',
scopedSlots: {customRender: 'name-text'}
}, },
{ {
title: '提问人', title: '提问人',
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'status_dictText' dataIndex: 'creater',
scopedSlots: {customRender: 'text'}
}, },
{ {
title: '提问人邮箱', title: '提问人邮箱',
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'createTime' dataIndex: 'email',
scopedSlots: {customRender: 'text'}
} }
], ],
url: { url: {
@@ -167,9 +177,28 @@ export default {
this.getStandardNumberListFunc() this.getStandardNumberListFunc()
this.loadData(1) this.loadData(1)
}, },
/*
* 当前时间是否超过征集截止时间
* */
compareCurrentTime(time) {
let date = new Date()
let compareTime = new Date(time)
if (date.getTime() > compareTime.getTime()) {
return true
} else {
return false
}
},
// 初始化数据 // 初始化数据
initData(record) { initData(record) {
this.lastQueryParam = {}
this.queryParam = {}
if(record.registerDeadline && !record.addQuestionStatue) {
let canOpe = !this.compareCurrentTime(record.registerDeadline)
record.addQuestionStatue_dictText = canOpe ? '征集中' : '已结束'
}
this.model = Object.assign({}, record) this.model = Object.assign({}, record)
this.filters.meetingId = record.id this.filters.meetingId = record.id
}, },
// 获取 标准类别名称 // 获取 标准类别名称
@@ -199,5 +228,21 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.table-name-text {
//white-space: pre-wrap;
}
.table-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/*表格滚动条*/
/deep/.ant-table-body {
overflow-x: auto!important;
}
</style>
<style>
.name-text-tooltip .ant-tooltip-inner {
white-space: pre-wrap;
}
</style> </style>