【add】 问题征集 功能的开发
This commit is contained in:
@@ -74,6 +74,7 @@ export const constantRouterMap = [
|
||||
component: SignUpPage,
|
||||
hidden: true,
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
/**
|
||||
@@ -471,5 +472,20 @@ export const routerData = [
|
||||
},
|
||||
name: 'work-team-detail',
|
||||
id: '14'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/standardsAssociation/problemCollection/problemCollectionDetailList",
|
||||
component: 'standardsAssociation/problemCollection/ProblemCollectionDetailList',
|
||||
redirect: null,
|
||||
hidden: true,
|
||||
route: '1',
|
||||
meta: {
|
||||
icon: '', // 菜单前图标
|
||||
componentName: 'WorkTeamDetail',
|
||||
keepAlive: false,
|
||||
title: '问题征集详情' // 菜单名称
|
||||
},
|
||||
name: 'problem-collection-detail-list',
|
||||
id: '15'
|
||||
},
|
||||
]
|
||||
|
||||
@@ -110,6 +110,17 @@
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!-- 标协会议、增加问题征集相关字段 -->
|
||||
<a-row :gutter="24" class="flex-col" v-if="Number(model.meetingType) === MeetingTypeEnums.standard.index">
|
||||
<a-col :span="12">
|
||||
<label>问题征集:</label>
|
||||
<span>{{ model.isAddQuestion === '1' ? '需要' : '不需要'}} </span>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="model.isAddQuestion === '1'">
|
||||
<label>征集截止时间:</label>
|
||||
<span>{{ model.endTimeAddQuestion }}</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" class="flex-col">
|
||||
<a-col :span="24">
|
||||
<label>会议内容:</label>
|
||||
@@ -588,6 +599,15 @@
|
||||
:show-detail-bool="showDetailBool"></file-table>
|
||||
</section>
|
||||
<!--会议纪要end-->
|
||||
<!--问题征集 --标协会议:并且会议的是否需要会议征集为需要 && 报名状态是已报名 存在 begin-->
|
||||
<section
|
||||
class="base-info"
|
||||
v-if="model.meetingType === MeetingTypeEnums.standard.index && model.isAddQuestion === '1' && hasQuestionList"
|
||||
>
|
||||
<h3 class="title">问题征集</h3>
|
||||
<problem-collection-table :can-ope="canOpe" :meeting-id="model.id" :table-data="model.questionList" ref="problemCollectionTable"></problem-collection-table>
|
||||
</section>
|
||||
<!-- --标协会议 存在 end-->
|
||||
<!--到账信息 begin 2021-12-10 版需求变更去掉了-->
|
||||
<!-- <section class="payment-info">
|
||||
<h3 class="title">付款信息</h3>
|
||||
@@ -607,6 +627,7 @@
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
</template>
|
||||
<edit-sign-up-info ref="editSignUpInfoForm"></edit-sign-up-info>
|
||||
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
@@ -622,6 +643,8 @@ import SignStep from './modules/SignStep'
|
||||
import {MeetingSignUpTypeEnums, MeetingTypeEnums} from '../../enums/commonEnum'
|
||||
import {compareCurrentTime} from '../../utils/meetingJudgeUtil'
|
||||
import EditSignUpInfo from '@views/meetingActivity/modules/EditSignUpInfo'
|
||||
// 问题征集的表格
|
||||
import ProblemCollectionTable from './modules/ProblemCollectionTable'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -679,7 +702,8 @@ export default {
|
||||
JImageUpload,
|
||||
FileTable,
|
||||
SignStep,
|
||||
EditSignUpInfo
|
||||
EditSignUpInfo,
|
||||
ProblemCollectionTable
|
||||
},
|
||||
props: {
|
||||
// 是否是从会议点进来的 默认走消息
|
||||
@@ -692,8 +716,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
MeetingSignUpTypeEnums,
|
||||
MeetingTypeEnums,
|
||||
title: '会议详情',
|
||||
width: 800,
|
||||
width: 900,
|
||||
visible: false,
|
||||
model: {},
|
||||
// 会议信息
|
||||
@@ -710,7 +735,8 @@ export default {
|
||||
// 显示更多的开票邮寄信息
|
||||
showMoreInfo: false,
|
||||
|
||||
showDetailBool: true
|
||||
showDetailBool: true,
|
||||
hasQuestionList: false, // 是否显示问题征集表格
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -725,6 +751,14 @@ export default {
|
||||
// 收费二维码 src
|
||||
paymentQrCodeSrc() {
|
||||
return `${window._CONFIG['domianURL']}/sys/common/download/${this.model.paymentQrCode}`
|
||||
},
|
||||
// 比较当前会议的 问题征集面板 是否可以提问问题
|
||||
canOpe() {
|
||||
if(!this.model.endTimeAddQuestion) {
|
||||
return false
|
||||
} else {
|
||||
return !compareCurrentTime(this.model.endTimeAddQuestion)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
@@ -826,11 +860,17 @@ export default {
|
||||
},
|
||||
getSingUpUserInfoFunc(param) {
|
||||
return new Promise(resolve => {
|
||||
this.hasQuestionList = false
|
||||
// 存在报名信息
|
||||
if (param.situationId) {
|
||||
getSingUpUserInfo({id: param.situationId}).then(res => {
|
||||
if (res.success) {
|
||||
this.situationInfo = res.result
|
||||
// 对当前的会议状态做判断,处理当前详情模态框是否显示问题征集 表格
|
||||
let registerProcess = Number(this.situationInfo.registerProcess)
|
||||
if(registerProcess === 6 || registerProcess === 7 || registerProcess === 8 || registerProcess === 9 || registerProcess === 10 || registerProcess === 14 || registerProcess === 15) {
|
||||
this.hasQuestionList = true
|
||||
}
|
||||
} else {
|
||||
this.situationInfo = {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
|
||||
<!-- 问题征集的表格--会议详情页展示-->
|
||||
<template>
|
||||
<div class="problem-collection-table-container">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:scroll="{x:true}"
|
||||
:pagination="false"
|
||||
:columns="columns"
|
||||
:dataSource="tableData"
|
||||
class="j-table-force-nowrap"
|
||||
>
|
||||
<template slot="text" slot-scope="text">
|
||||
<a-tooltip>
|
||||
<template v-if="text" slot="title">{{ text }}</template>
|
||||
<div class="table-text">{{ text }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<span slot="action" slot-scope="record" class="action-span-cell">
|
||||
<a class="color-blue" @click="addQuestion(record)">{{ canOpe ? '我要提问' : '查看' }}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function (t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '标准号',
|
||||
align: 'center',
|
||||
dataIndex: 'standardNumber',
|
||||
width: 200,
|
||||
scopedSlots: {customRender: 'text'}
|
||||
},
|
||||
{
|
||||
title: '标准名称',
|
||||
align: 'center',
|
||||
dataIndex: 'standardName',
|
||||
width: 100,
|
||||
scopedSlots: {customRender: 'text'}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
dataIndex: '',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
width: 100
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'ProblemCollectionTable',
|
||||
props: {
|
||||
/*会议id*/
|
||||
meetingId:{
|
||||
type:String,
|
||||
required:false
|
||||
},
|
||||
// 表格数据
|
||||
tableData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [{id: 1}]
|
||||
}
|
||||
},
|
||||
canOpe: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columns,
|
||||
tableList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 我要提问
|
||||
addQuestion(record) {
|
||||
|
||||
const routeUrl = this.$router.resolve({
|
||||
path: '/standardsAssociation/problemCollection/problemCollectionDetailList',
|
||||
query: {
|
||||
standardId: record.id,
|
||||
meetingId: this.meetingId
|
||||
}
|
||||
})
|
||||
window.open(routeUrl.href, '_blank')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -44,6 +44,25 @@
|
||||
<span> {{ item.meetingContactsName + (item.meetingContactsPhone ?':': '') + item.meetingContactsPhone + ' ' }}</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!-- 标协会议(标准宣贯、学习培训) -是否具有问题征集 -->
|
||||
<template v-if="currentMeetingInfo.meetingType === '2' && (currentMeetingInfo.tbMeetingType === '1' || currentMeetingInfo.tbMeetingType === '2')">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<label>问题征集:</label>
|
||||
<span>{{ currentMeetingInfo.isAddQuestion === '1' ? '需要' : '不需要'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="currentMeetingInfo.isAddQuestion === '1'">
|
||||
<label>征集截止时间:</label>
|
||||
<span>{{ currentMeetingInfo.endTimeAddQuestion }}</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24" v-if="currentMeetingInfo.isAddQuestion === '1'">
|
||||
<a-col :span="12" v-for="(item,index) of currentMeetingInfo.questionList" :key="index">
|
||||
<label>标准号及标准名称{{index + 1}}:</label>
|
||||
<span> {{ item.standardNumber + ' ( ' + item.standardName + ' ) '}}</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<label>召开时间:</label>
|
||||
|
||||
@@ -513,10 +513,14 @@ export default {
|
||||
httpAction(url, submitData, method).then(res => {
|
||||
if (res.success) {
|
||||
that.$emit('ok')
|
||||
|
||||
let messageText = '报名成功'
|
||||
// 标协会议增加不同的提示语
|
||||
if(submitData.meetingType === '2') {
|
||||
messageText = '报名成功!请到会议详情页-问题征集处进行提问'
|
||||
}
|
||||
// that.$message.success(res.message)
|
||||
that.$notification.success({
|
||||
message: '报名成功',
|
||||
message: messageText,
|
||||
})
|
||||
setTimeout(() => {
|
||||
that.handleCancel()
|
||||
|
||||
@@ -293,6 +293,8 @@ export default {
|
||||
// this.meetingType = this.$route.query.meetingType
|
||||
// this.filter.meetingType = this.$route.query.meetingType
|
||||
}
|
||||
// 先重置会议分类
|
||||
this.filter.meetingSignUpType = '0'
|
||||
this.initData(1)
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
<!--问题征集详情页,用于展示当前用户对某一个会议提出的全部问题-->
|
||||
<template>
|
||||
<div class="problem-collection-detail-list main-box">
|
||||
<div class="title">
|
||||
<!-- <a-icon type="user"/>-->
|
||||
<span class="my-meeting">{{ $route.meta.title }}</span>
|
||||
</div>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域-start -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label=" 标准号">
|
||||
{{ otherFilter.standardNumber }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="标准名称">
|
||||
{{ otherFilter.standardName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="章节编号">
|
||||
<a-input placeholder="请输入章节编号" v-model="queryParam.number" :maxLength="50"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-form-item label="问题描述">
|
||||
<a-input placeholder="请输入问题描述" v-model="queryParam.questionName" :maxLength="500"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" icon="search" @click="searchQuery">查询</a-button>
|
||||
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 查询区域-end-->
|
||||
|
||||
<!-- 操作按钮区域-->
|
||||
<div class="table-operator">
|
||||
<a-button type="primary" icon="plus" v-if="canOpe" @click="handleAdd">新增</a-button>
|
||||
<a-button type="danger" icon="delete" v-if="canOpe" @click="batchDel">批量删除</a-button>
|
||||
</div>
|
||||
<!-- 操作按钮区域-end-->
|
||||
|
||||
<!-- table表格区域-->
|
||||
<div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:scroll="{x: 1100}"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange"
|
||||
class="j-table-force-nowrap">
|
||||
|
||||
<template slot="text" slot-scope="text">
|
||||
<a-tooltip>
|
||||
<template v-if="text" slot="title">{{ text }}</template>
|
||||
<div class="table-text">{{ text }}</div>
|
||||
</a-tooltip>
|
||||
</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>
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">详情</a>
|
||||
<a @click="handleDelete(record.id)" v-if="canOpe">删除</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<problem-collection-modal ref="modalForm" :standard-id="filters.standardId"
|
||||
@ok="modalFormOk"></problem-collection-modal>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import ProblemCollectionModal from './modules/ProblemCollectionModal'
|
||||
import { getMeetInfoById } from '../../../api/incomePaymentsApi'
|
||||
import { compareCurrentTime } from '../../../utils/meetingJudgeUtil'
|
||||
|
||||
export default {
|
||||
name: 'ProblemCollectionDetailList',
|
||||
mixins: [JeroListMixin],
|
||||
components: {
|
||||
ProblemCollectionModal
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 10 }
|
||||
},
|
||||
url: {
|
||||
list: '/payMeetingQuestion/payMeetingQuestion/listOne',
|
||||
delete: '/payMeetingQuestion/payMeetingQuestion/delete',
|
||||
deleteBatch: '/payMeetingQuestion/payMeetingQuestion/deleteBatch'
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: '',
|
||||
key: 'rowIndex',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function(t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '章节条目',
|
||||
align: 'center',
|
||||
dataIndex: 'number',
|
||||
width: 250,
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: '问题描述',
|
||||
align: 'center',
|
||||
dataIndex: 'questionName',
|
||||
scopedSlots: { customRender: 'name-text' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 180,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
filters: {
|
||||
meetingId: '', // 会议id
|
||||
standardId: '' // 标准号Id
|
||||
},
|
||||
otherFilter: {},
|
||||
disableMixinCreated: true,
|
||||
canOpe: true, // 是否可新增、删除 等操作
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
/*
|
||||
* 通过会议id获取会议性情
|
||||
* */
|
||||
queryMeetingInfoById(id) {
|
||||
return new Promise(resolve => {
|
||||
let result = {}
|
||||
getMeetInfoById({ id }).then(res => {
|
||||
if (res.success) {
|
||||
result = res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve(result)
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
console.log('-----------this.$route-------', this.$route.params)
|
||||
this.filters.meetingId = this.$route.query.meetingId || ''
|
||||
this.filters.standardId = this.$route.query.standardId || ''
|
||||
|
||||
if (!this.filters.meetingId) return
|
||||
this.meetingObj = await this.queryMeetingInfoById(this.filters.meetingId)
|
||||
let questionList = this.meetingObj.questionList || []
|
||||
let arr = questionList.filter(tt => tt.id === this.filters.standardId)
|
||||
if(arr.length > 0) {
|
||||
this.otherFilter = arr[0]
|
||||
}
|
||||
// 判断 征集截止时间 和当前时间的关系
|
||||
this.canOpe = !compareCurrentTime(this.meetingObj.endTimeAddQuestion)
|
||||
// this.canOpe = this.meetingObj.endTimeAddQuestion
|
||||
this.loadData()
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
//.table-name-text {
|
||||
// white-space: pre-wrap;
|
||||
//}
|
||||
|
||||
.title {
|
||||
height: 56px;
|
||||
line-height: 56px;
|
||||
background: #fff;
|
||||
border-bottom: 2px solid #f2f2f2;
|
||||
padding: 0 20px;
|
||||
|
||||
.my-meeting {
|
||||
margin-left: 6px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-page-search-wrapper {
|
||||
|
||||
.ant-form-inline {
|
||||
|
||||
.ant-form-item {
|
||||
display: flex;
|
||||
margin-bottom: 24px;
|
||||
margin-right: 0;
|
||||
|
||||
.ant-form-item-control-wrapper {
|
||||
flex: 1 1;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
> .ant-form-item-label {
|
||||
line-height: 32px;
|
||||
padding-right: 8px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.ant-form-item-control {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
.ant-btn + .ant-btn {
|
||||
margin-left: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.table-text {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.name-text-tooltip .ant-tooltip-inner {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,163 @@
|
||||
<!--新增这问题的接口-->
|
||||
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<a-col>
|
||||
<a-form-item label="章节编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input
|
||||
placeholder="请输入章节编号"
|
||||
v-decorator="['number',validatorRules.number]"
|
||||
:maxLength='50'
|
||||
:disabled="isDetail"
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col>
|
||||
<a-form-item label="问题描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-textarea
|
||||
placeholder="请输入问题描述"
|
||||
:auto-size="{ minRows: 4, maxRows: 8 }"
|
||||
v-decorator="['questionName',validatorRules.questionName]"
|
||||
:maxLength='500'
|
||||
:disabled="isDetail"
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { httpAction } from '../../../../api/manage'
|
||||
|
||||
export default {
|
||||
name: 'ProblemCollectionModal',
|
||||
props: {
|
||||
// 标准号Id
|
||||
standardId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
width: 800,
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 4 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 18 }
|
||||
},
|
||||
url: {
|
||||
add: '/payMeetingQuestion/payMeetingQuestion/add',
|
||||
edit: '/payMeetingQuestion/payMeetingQuestion/edit'
|
||||
},
|
||||
validatorRules: {
|
||||
number: {
|
||||
rules: [{ required: true, message: '请输入章节编号' }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
questionName: {
|
||||
rules: [{ required: true, message: '请输入问题描述' }],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
otherParams: {
|
||||
|
||||
},
|
||||
isDetail: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
edit(record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.isDetail = !!this.model.id
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'number', 'questionName'))
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('close')
|
||||
this.visible = false
|
||||
},
|
||||
handleOk() {
|
||||
if (this.confirmLoading) {
|
||||
return
|
||||
}
|
||||
|
||||
this.confirmLoading = true
|
||||
const that = this
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
let httpurl = ''
|
||||
let method = 'post'
|
||||
if (!this.model.id) {
|
||||
httpurl += this.url.add
|
||||
} else {
|
||||
httpurl += this.url.edit
|
||||
that.$emit('ok')
|
||||
that.close()
|
||||
this.confirmLoading = false
|
||||
return
|
||||
}
|
||||
const formData = Object.assign(this.model, values)
|
||||
formData.standardId = this.standardId
|
||||
httpAction(httpurl, formData, method).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
that.close()
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
setTimeout(() => {
|
||||
this.confirmLoading = false
|
||||
}, 1000)
|
||||
})
|
||||
} else {
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user