update 国内、海外提出问题
This commit is contained in:
@@ -36,6 +36,8 @@ const getDomesticStandardNoSystem = (params) => getAction('/laws/standard/common
|
|||||||
const getDomesticStandardDetail = (params) => getAction('/laws/standard/domestic/getByIdAndModule', params)
|
const getDomesticStandardDetail = (params) => getAction('/laws/standard/domestic/getByIdAndModule', params)
|
||||||
// 国内标准-获取更新记录
|
// 国内标准-获取更新记录
|
||||||
const getDomesticStandardUpdateRecord = (params) => getAction('/laws/standard/domestic/getUpdateRecordList', params)
|
const getDomesticStandardUpdateRecord = (params) => getAction('/laws/standard/domestic/getUpdateRecordList', params)
|
||||||
|
// 国内标准-提交问题
|
||||||
|
const submitDomesticQuestion = (params) => postAction('/laws/library/lawsProblemLibrary/addProblem/GB', params)
|
||||||
|
|
||||||
// 海外标准-获取查询条件
|
// 海外标准-获取查询条件
|
||||||
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
|
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
|
||||||
@@ -67,6 +69,8 @@ const removeOverseasStandard = (params) => getAction('/laws/standard/overseas/re
|
|||||||
const addOverseasStandard = (params) => postAction('/laws/standard/overseas/commonAdd', params)
|
const addOverseasStandard = (params) => postAction('/laws/standard/overseas/commonAdd', params)
|
||||||
// 海外标准-编辑标准
|
// 海外标准-编辑标准
|
||||||
const editOverseasStandard = (params) => postAction('/laws/standard/overseas/commonEdit', params)
|
const editOverseasStandard = (params) => postAction('/laws/standard/overseas/commonEdit', params)
|
||||||
|
// 海外标准-提出问题
|
||||||
|
const submitOverseasQuestion = (params) => postAction('/laws/library/lawsProblemLibrary/addProblem/FB', params)
|
||||||
|
|
||||||
// 动态消息-保存
|
// 动态消息-保存
|
||||||
const saveDynamicMessage = (params) => postAction('/laws/standard/lawsNewsFeed/save', params)
|
const saveDynamicMessage = (params) => postAction('/laws/standard/lawsNewsFeed/save', params)
|
||||||
@@ -110,6 +114,7 @@ export {
|
|||||||
getDomesticStandardNoSystem,
|
getDomesticStandardNoSystem,
|
||||||
getDomesticStandardDetail,
|
getDomesticStandardDetail,
|
||||||
getDomesticStandardUpdateRecord,
|
getDomesticStandardUpdateRecord,
|
||||||
|
submitDomesticQuestion,
|
||||||
|
|
||||||
// 海外标准
|
// 海外标准
|
||||||
getOverseasStandardSearchForm,
|
getOverseasStandardSearchForm,
|
||||||
@@ -127,6 +132,7 @@ export {
|
|||||||
removeOverseasStandard,
|
removeOverseasStandard,
|
||||||
addOverseasStandard,
|
addOverseasStandard,
|
||||||
editOverseasStandard,
|
editOverseasStandard,
|
||||||
|
submitOverseasQuestion,
|
||||||
|
|
||||||
// 动态消息
|
// 动态消息
|
||||||
saveDynamicMessage,
|
saveDynamicMessage,
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ export default {
|
|||||||
* 提交问题
|
* 提交问题
|
||||||
*/
|
*/
|
||||||
submitQuestion () {
|
submitQuestion () {
|
||||||
this.$refs.submitQuestionModal.open()
|
this.$refs.submitQuestionModal.open(this.detailData.standard_number, this.type)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 分享
|
* 分享
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<!-- 项目-->
|
<!-- 项目-->
|
||||||
<a-form-item :label="$t('project')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item :label="$t('project')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-select :placeholder="$t('pleaseSelect') + $t('project')" v-decorator="['project', validatorRules.project]">
|
<a-select :placeholder="$t('pleaseSelect') + $t('project')" v-decorator="['project', validatorRules.project]">
|
||||||
<a-select-option v-for="item in projectSelectOptions" :key="item">{{ item }}</a-select-option>
|
<a-select-option v-for="item in projectSelectOptions" :key="item.id">{{ item.projectName }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@@ -38,10 +38,13 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<!-- 回答人-->
|
<!-- 提问时间-->
|
||||||
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.respondent')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.problemOccurrenceTime')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<user-selection v-decorator="['respondent', validatorRules.respondent]"
|
<a-date-picker :placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.standardDetail.problemOccurrenceTime')"
|
||||||
:placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.standardDetail.respondent')" />
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
||||||
|
v-decorator="['quizTime', validatorRules.quizTime]"
|
||||||
|
showTime
|
||||||
|
style="width: 100%" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
@@ -54,7 +57,7 @@
|
|||||||
@change="event => event.target.value = event.target.value.trim()"
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
:maxLength="500"
|
:maxLength="500"
|
||||||
v-decorator="['problemDescription', validatorRules.problemDescription]" />
|
v-decorator="['problemDescription', validatorRules.problemDescription]" />
|
||||||
<j-upload v-decorator="['fileIds', validatorRules.fileIds]" />
|
<j-upload v-decorator="['file', validatorRules.file]" return-id/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -63,11 +66,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UserSelection from '../../../../components/selection/UserSelection.vue'
|
import { submitDomesticQuestion, submitOverseasQuestion } from '../../../../api/standardRegulationLibraryApi.js'
|
||||||
|
import { getCarTypeProjectList } from '../../../../api/api.js'
|
||||||
|
import { StandardSource } from '../../../../enums/commonEnums.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SubmitQuestionModal',
|
name: 'SubmitQuestionModal',
|
||||||
components: { UserSelection },
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
width: 800,
|
width: 800,
|
||||||
@@ -108,32 +112,74 @@ export default {
|
|||||||
validateTrigger: 'blur'
|
validateTrigger: 'blur'
|
||||||
},
|
},
|
||||||
// 问题发生时间
|
// 问题发生时间
|
||||||
problemOccurrenceTime: {
|
quizTime: {
|
||||||
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.standardDetail.problemOccurrenceTime') }],
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.standardDetail.problemOccurrenceTime') }],
|
||||||
validateTrigger: 'change'
|
validateTrigger: 'change'
|
||||||
},
|
},
|
||||||
// 回答人
|
|
||||||
respondent: {
|
|
||||||
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.standardDetail.respondent') }],
|
|
||||||
validateTrigger: 'change'
|
|
||||||
},
|
|
||||||
// 问题描述
|
// 问题描述
|
||||||
problemDescription: {
|
problemDescription: {
|
||||||
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.standardDetail.problemDescription') }],
|
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.standardDetail.problemDescription') }],
|
||||||
validateTrigger: 'blur'
|
validateTrigger: 'blur'
|
||||||
},
|
},
|
||||||
// 附件
|
// 附件
|
||||||
fileIds: {}
|
file: {},
|
||||||
|
type: null
|
||||||
},
|
},
|
||||||
projectSelectOptions: [] // 项目下拉数据
|
projectSelectOptions: [] // 项目下拉数据
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open () {
|
open (standardNumber, type) {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
this.initProjectOptions()
|
||||||
|
this.type = type
|
||||||
|
const param = {}
|
||||||
|
param.standardNumber = standardNumber
|
||||||
|
param.quizTime = new Date().getFullYear() + '-' + new Date().getMonth() + '-' + new Date().getDay() + ' ' +
|
||||||
|
new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(param)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取项目下拉框数据
|
||||||
|
initProjectOptions () {
|
||||||
|
getCarTypeProjectList().then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.projectSelectOptions = res.result
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleOk () {
|
handleOk () {
|
||||||
|
if (this.confirmLoading) return
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
let submitFunc
|
||||||
|
switch (this.type) {
|
||||||
|
case StandardSource.DOMESTIC.value:
|
||||||
|
submitFunc = submitDomesticQuestion
|
||||||
|
break
|
||||||
|
case StandardSource.OVERSEAS.value:
|
||||||
|
submitFunc = submitOverseasQuestion
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.confirmLoading = true
|
||||||
|
const param = Object.assign({}, values)
|
||||||
|
submitFunc(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel () {
|
||||||
this.close()
|
this.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user