[update] 企标新增和详情页修改

This commit is contained in:
lideqin
2023-09-19 15:11:37 +08:00
parent ab4469aed8
commit 74301d1419
12 changed files with 934 additions and 65 deletions
+11
View File
@@ -29,6 +29,13 @@ const cancelCollectStandard = (params) => postAction('/personal/lawsStandardColl
// 分享企标
const shareStandard = (params) => postAction('/personal/lawsStandardSharing/enterprise/add', params)
// 企标详情-获取更新记录
const detailGetUpdateRecord = (params) => getAction('', params)
// 企标详情-提交问题
const detailSubmitQuestion = (params) => postAction('', params)
// 企标详情-企标评价
const detailEvaluate = (params) => getAction('', params)
// 企标评审会记录-设置优质标准
const setQualityStandard = (params) => getAction('/enterprise/reviewMeeting/setQualityStandards', params)
// 获取评分详情
@@ -63,6 +70,10 @@ export {
cancelCollectStandard,
shareStandard,
detailGetUpdateRecord,
detailSubmitQuestion,
detailEvaluate,
setQualityStandard,
getScoreDetail,
@@ -1,7 +1,7 @@
// 企标库的所有翻译
module.exports = {
// 企业标准
enterpriseStandard: {
standard: {
allocationStandard: 'Allocation Standard',
shiftOutStandard: 'Shift Out Standard',
initChange: 'Initiate Changes',
@@ -18,7 +18,9 @@ module.exports = {
updateRecord: '更新记录',
submitQuestion: '提交问题',
standardResolutionSheet: '标准分解单',
nodeName: '节点名称'
nodeName: '节点名称',
subjectToClause: '依据条款',
standardContentOrRequirements: '标准内容或要求'
},
// 评审会记录
reviewMeeting: {
@@ -18,7 +18,9 @@ module.exports = {
updateRecord: '更新记录',
submitQuestion: '提交问题',
standardResolutionSheet: '标准分解单',
nodeName: '节点名称'
nodeName: '节点名称',
subjectToClause: '依据条款',
standardContentOrRequirements: '标准内容或要求'
},
// 评审会记录
reviewMeeting: {
+1 -3
View File
@@ -352,7 +352,7 @@ export default {
isFormInline: false,
rules: {},
confirmLoading: false,
type: 'add',
type: 2,
dataList: [],
ruleList: [],
uploadName: '',
@@ -363,11 +363,9 @@ export default {
add () {
this.formInline = Object.assign({}, this.defaultValue)
this.$forceUpdate()
this.type = 'add'
this.getForm()
},
edit (item) {
this.type = 'edit'
this.loading = true
this.getForm(() => {
if (!this.getDocumentInfoFunc || typeof this.getDocumentInfoFunc !== 'function') {
@@ -88,8 +88,8 @@
<template slot="operation" slot-scope="{text, record}">
<a v-for="(operation, index) in operationList.slice(0, operateMaxNum)" :key="index" @click="operationClick(operation,record)">
<template v-if="operation.text === $t('enterpriseStandardLibrary.standard.collection')">
<i class="iconfont icon-star1" v-show="record.collectFlag === 1" />
<i class="iconfont icon-star" v-show="!record.collectFlag || record.collectFlag === 0" />
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</template>
</a>
<a-divider v-if="operationList.length >= operateMaxNum" type="vertical" />
@@ -424,9 +424,7 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.setTimeout(() => {
this.collectionFlag = false
}, 100)
this.collectionFlag = false
})
} else {
const params = {}
@@ -440,9 +438,7 @@ export default {
this.$message.warning(res.message)
}
}).finally(() => {
this.setTimeout(() => {
this.collectionFlag = false
}, 100)
this.collectionFlag = false
})
}
},
@@ -1,18 +1,15 @@
<template>
<div class="detail-page">
<div class="detail-page-title">{{ pageTitle }}{{ $t('enterpriseStandardLibrary.standard.detailTitle') }}</div>
<div class="detail-page-title">{{ $t('enterpriseStandardLibrary.standard.detailTitle') }}</div>
<div class="detail-page-part" v-for="(part, index) in partList" :key="part + index">
<div class="detail-page-part-title">
<span>{{ part }}</span>
<div class="detail-page-part-title-operate-box" v-if="index === 0">
<!-- 企标评价-->
<a-button type="icon-edit-1" @click="handleEvaluate">
<i class="iconfont icon-root-list" />
<a-button type="link" @click="handleEvaluate">
<i class="iconfont icon-edit-1" />
{{ $t('enterpriseStandardLibrary.standard.evaluate') }}
</a-button>
<!-- 收藏-->
<!-- <i class="iconfont icon-star1" v-if="form[part].collect === '0'" />-->
<!-- <i class="iconfont icon-star" v-else />-->
<!-- 更新记录-->
<a-button type="link" @click="handleOpenUpdateRecord">
<i class="iconfont icon-root-list" />
@@ -28,7 +25,9 @@
<div class="detail-page-part-form" v-if="index !== 3">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<span>{{ detailData[formItem.dbFieldName] }}</span>
<span v-if="detailData[formItem.dbFieldName + '_dictText']">{{ detailData[formItem.dbFieldName + '_dictText'] }}</span>
<span v-else-if="detailData[formItem.dbFieldName]">{{ detailData[formItem.dbFieldName] }}</span>
<span v-else></span>
</div>
</div>
<!-- 过程稿件特殊处理-->
@@ -53,68 +52,91 @@
</div>
</div>
</div>
</div>
<!-- 稽查内容 -->
<div class="detail-page-part">
<div class="detail-page-part-title">
<span>稽查内容</span>
</div>
<div class=detail-page-part-table>
<a-table
:scroll="{x: 500}"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
bordered
rowKey="id">
<!-- 稽查内容特殊处理-->
<div>
<a-table></a-table>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
</div>
<!-- 企标评价 -->
<enterprise-standard-evaluate-modal ref="enterpriseStandardEvaluateModal"></enterprise-standard-evaluate-modal>
<!-- 更新记录弹框 -->
<update-record-modal ref="updateRecordModal"></update-record-modal>
<!-- 提交问题弹框 -->
<submit-question-modal ref="submitQuestionModal"></submit-question-modal>
</div>
</template>
<script>
import '@assets/less/common.less'
import { getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
import { getEnterpriseStandardInfoById, getEnterpriseStandardAddForm } from '@/api/enterpriseStandardLibraryApi'
import UpdateRecordModal from '../../../standardRegulationLibrary/commonPage/modules/UpdateRecordModal'
import SubmitQuestionModal from '../../../standardRegulationLibrary/commonPage/modules/SubmitQuestionModal'
import EnterpriseStandardEvaluateModal from './module/EnterpriseStandardEvaluateModal'
export default {
name: 'EnterpriseStandardDetail',
components: { EnterpriseStandardEvaluateModal, SubmitQuestionModal, UpdateRecordModal },
data () {
return {
partList: [], // 页面模块列表
form: {}, // 页面字段
detailData: {
modification_list: [
{
id: 1,
fileName: '国内文字占位符段落标题标准.pdf'
},
{
id: 2,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
},
{
id: 3,
fileName: '国内标准国内标准.pdf'
detailData: {}, // 页面数据
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
width: 100,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
],
draft_for_review: [{
id: 11,
fileName: '国内文字占位符段落标题标准.pdf'
}],
draft_for_approval: [{
id: 21,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
}],
draft_for_comment: [{
id: 31,
fileName: '国内标准国内标准.pdf'
}],
draft: [{
id: 311,
fileName: '国内标准国内标准.pdf'
}]
} // 页面数据
},
{
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center',
width: 200,
dataIndex: 'subjectToClause',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center',
dataIndex: 'standardContentOrRequirements',
scopedSlots: { customRender: 'text' }
}
], // 稽查内容表格列参数
dataSource: [] // 稽查内容数据
}
},
created () {
this.initForm()
this.initData()
},
methods: {
initForm () {
const params = {}
params.id = this.$route.query.id
params.module = '3'
getEnterpriseStandardInfoById(params).then(res => {
params.type = 1
getEnterpriseStandardAddForm(params).then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
@@ -123,11 +145,37 @@ export default {
this.$message.warn(res.message)
}
})
},
initData () {
const params = {}
params.id = this.$route.query.id
params.type = 1
getEnterpriseStandardInfoById(params).then(res => {
if (res.success) {
this.detailData = res.result
} else {
this.$message.warning(res.message)
}
})
},
// 企标评价
handleEvaluate () {
this.$refs.enterpriseStandardEvaluateModal.open(this.detailData.id)
},
// 更新记录
handleOpenUpdateRecord () {
this.$refs.updateRecordModal.open(this.detailData.standardNumber)
},
// 提交问题
submitQuestion () {
this.$refs.submitQuestionModal.open()
}
}
}
</script>
<style scoped>
<style scoped lang="less">
.detail-page-part-table {
margin: 20px;
}
</style>
@@ -0,0 +1,348 @@
<template>
<a-modal
:title="title"
:maskClosable="true"
:width="1000"
:closable="true"
@cancel="handleCancel"
:footer="false"
:visible="visible">
<a-spin :spinning="confirmLoading">
<div class="content-wrapper">
<div class="left-wrapper">
<div v-for="item in nameArr" :key="item" class="name-div">
<a-button class="left-btn" :type="leftCurr === item ? 'primary' : ''" @click="leftChange(item)">{{ item }}</a-button>
</div>
</div>
<div class="right-wrapper">
<a-table
bordered
:scroll="{x: '100%'}"
:columns="columns"
:dataSource="dataSource"
rowKey="id"
:pagination="false"
>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div>{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
</div>
</a-spin>
</a-modal>
</template>
<script>
import { detailEvaluate } from '@/api/enterpriseStandardLibraryApi'
const fixDataSourse = [
{
id: 1,
project: '文本格式(15)',
desc: '评估标准文件的格式是否符合GB/T 1.1的要求,包括文件名、编号、版本号、' +
'发布日期、生效日期、引用文件章节、图表等内容是否齐全、准确、清晰。',
score: '一般',
scoreRange: '0~5'
},
{
id: 2,
score: '优秀',
scoreRange: '6~10'
},
{
id: 3,
score: '优秀',
scoreRange: '11~15'
},
{
id: 4,
project: '标准内容(45)',
desc: '评估标准文件的内容是否详细准确、内容详实、逻辑清晰、科学合理。包括术语定义、' +
'引用标准、技术要求、试验检测方法等各个方面是否符合/严于法律法规、国家标准、行业标准等要求。',
score: '一般',
scoreRange: '0~20'
},
{
id: 5,
score: '优秀',
scoreRange: '21~35'
},
{
id: 6,
score: '优秀',
scoreRange: '36~45'
},
{
id: 7,
project: '适用性 (10)',
desc: '评估标准文件的应用范围是否明确、适用,是否与研发工艺、质量、生产、采购等环节相符合。',
score: '一般',
scoreRange: '0~3'
},
{
id: 8,
score: '优秀',
scoreRange: '4~6'
},
{
id: 9,
score: '优秀',
scoreRange: '7~10'
},
{
id: 10,
project: '完整性 (15)',
desc: '评估标准文件所涉及的专业领域是否全面、系统,是否涵盖了所有相关模版' +
'(比如设计规范模版、释放规范模版、产品技术条件模版)所规定的要素和环节。',
score: '一般',
scoreRange: '0~5'
},
{
id: 11,
score: '优秀',
scoreRange: '6~10'
},
{
id: 12,
score: '优秀',
scoreRange: '11~15'
},
{
id: 13,
project: '可读性 (5)',
desc: '评估标准文件的可读性是否良好,是否有错别字,是否易于阅读和理解。',
score: '一般',
scoreRange: '0~2'
},
{
id: 14,
score: '优秀',
scoreRange: '3~4'
},
{
id: 15,
score: '优秀',
scoreRange: '5'
},
{
id: 16,
project: '权威性及可执行性(10)',
desc: '评估标准文件的权威性是否足够,是否得到了相关方的认可和信任,是否得到了有效的贯彻和执行。',
score: '一般',
scoreRange: '0~3'
},
{
id: 17,
score: '优秀',
scoreRange: '4~6'
},
{
id: 18,
score: '优秀',
scoreRange: '7~10'
}
]
export default {
name: 'EnterpriseStandardEvaluateModal',
data () {
return {
title: this.$t('enterpriseStandardLibrary.reviewMeeting.scoreDetailTitle'),
visible: false,
confirmLoading: false,
scoreData: {},
nameArr: [],
leftCurr: '',
columns: [
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.project'),
align: 'center',
width: 100,
dataIndex: 'project',
customRender: (text, row, index) => {
const obj = {
children: text || this.global.emptyLine,
attrs: {}
}
if (index % 3 === 0) {
obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) {
obj.attrs.rowSpan = 0
}
if (index === 19) {
obj.attrs.colSpan = 6
}
return obj
}
},
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.desc'),
align: 'center',
// width: 100,
dataIndex: 'desc',
customRender: (text, row, index) => {
const obj = {
children: text || this.global.emptyLine,
attrs: {}
}
if (index % 3 === 0) {
obj.attrs.rowSpan = 3
} else if (index % 3 !== 0 && index !== 19) {
obj.attrs.rowSpan = 0
}
if (index === 19) {
obj.attrs.colSpan = 0
}
return obj
}
},
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.score'),
align: 'center',
width: 100,
dataIndex: 'score',
colSpan: 2,
customRender: (text, row, index) => {
const obj = {
children: text || this.global.emptyLine,
attrs: {}
}
if (index === 19) {
obj.attrs.colSpan = 0
}
return obj
}
},
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.score'),
align: 'center',
width: 100,
dataIndex: 'scoreRange',
colSpan: 0
},
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.grade'),
align: 'center',
width: 100,
dataIndex: 'evaluateScore',
customRender: (text, row, index) => {
const obj = {
children: text || this.global.emptyLine,
attrs: {}
}
if (index === 19) {
obj.attrs.colSpan = 0
}
if (index % 3 === 0) {
obj.attrs.rowSpan = 3
} else {
obj.attrs.rowSpan = 0
}
return obj
}
},
{
title: this.$t('enterpriseStandardLibrary.reviewMeeting.groundsForDemerit'),
align: 'center',
width: 100,
dataIndex: 'deductionScoreReason',
customRender: (text, row, index) => {
const obj = {
children: text || this.global.emptyLine,
attrs: {}
}
if (index === 19) {
obj.attrs.colSpan = 0
}
if (index % 3 === 0) {
obj.attrs.rowSpan = 3
} else {
obj.attrs.rowSpan = 0
}
return obj
}
}
],
dataSource: []
}
},
watch: {
leftCurr: {
immediate: true,
handler (val) {
console.log('leftCurr改变')
if (val) {
// 左侧选中改变,右侧表格数据也随之改变
const dataArr = this.scoreData[val]
if (dataArr) {
for (const i in fixDataSourse) {
this.dataSource[i] = { ...fixDataSourse[i] }
if (i % 3 === 0) {
this.dataSource[i].evaluateScore = dataArr[Math.floor(i / 3)].evaluateScore || ''
this.dataSource[i].deductionScoreReason = dataArr[Math.floor(i / 3)].deductionScoreReason || ''
}
}
} else {
this.dataSource = [...fixDataSourse]
}
}
}
}
},
methods: {
open (id) {
this.visible = true
this.initData(id)
},
initData (id) {
this.confirmLoading = true
detailEvaluate({ id: id }).then(res => {
if (res.success) {
this.scoreData = res.result
this.nameArr = Object.keys(this.scoreData)
this.leftCurr = this.nameArr[0]
} else {
this.$message.warning(res.message)
this.scoreData = []
this.nameArr = []
this.leftCurr = ''
}
}).finally(() => {
this.confirmLoading = false
})
},
// 左侧选中改变
leftChange (value) {
this.leftCurr = value
},
// 通过
handleCancel () {
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.content-wrapper {
display: flex;
.left-wrapper {
width: 20%;
display: flex;
flex-direction: column;
align-items: center;
.left-btn {
margin-bottom: 10px;
}
}
.right-wrapper {
width: 80%;
}
}
</style>
@@ -0,0 +1,178 @@
<template>
<j-modal
:title="$t('standardRegulationLibrary.submitQuestion')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-row :gutter="24">
<a-col :span="12">
<!-- 标题-->
<a-form-item :label="$t('title')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter') + $t('title')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
v-decorator="['title', validatorRules.title]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 项目-->
<a-form-item :label="$t('project')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<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>
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 标准编号-->
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.standardNumber')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.standardDetail.standardNumber')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
disabled
v-decorator="['standardNumber', validatorRules.standardNumber]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 问题发生时间-->
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.problemOccurrenceTime')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker class="box-input"
:placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.standardDetail.problemOccurrenceTime')"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-decorator="['problemOccurrenceTime', validatorRules.problemOccurrenceTime]"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 回答人-->
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.respondent')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<user-selection v-decorator="['respondent', validatorRules.respondent]"
:placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.standardDetail.respondent')" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 问题描述-->
<a-form-item :label="$t('standardRegulationLibrary.standardDetail.problemDescription')"
:labelCol="longLabelCol"
:wrapperCol="longWrapperCol">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.standardDetail.problemDescription')"
type="textarea"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="500"
v-decorator="['problemDescription', validatorRules.problemDescription]" />
<j-upload v-decorator="['fileIds', validatorRules.fileIds]" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</j-modal>
</template>
<script>
import UserSelection from '@/components/selection/UserSelection.vue'
import { detailSubmitQuestion } from '@/api/enterpriseStandardLibraryApi'
export default {
name: 'SubmitQuestionModal',
components: { UserSelection },
data () {
return {
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
modal: {},
labelCol: {
xs: { span: 24 },
sm: { span: 8 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
longLabelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
longWrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 标题
title: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('title') }],
validateTrigger: 'blur'
},
// 项目
project: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('project') }],
validateTrigger: 'change'
},
// 标准编号
standardNumber: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.standardDetail.standardNumber') }],
validateTrigger: 'blur'
},
// 问题发生时间
problemOccurrenceTime: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.standardDetail.problemOccurrenceTime') }],
validateTrigger: 'change'
},
// 回答人
respondent: {
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.standardDetail.respondent') }],
validateTrigger: 'change'
},
// 问题描述
problemDescription: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.standardDetail.problemDescription') }],
validateTrigger: 'blur'
},
// 附件
fileIds: {}
},
projectSelectOptions: [] // 项目下拉数据
}
},
methods: {
open () {
this.visible = true
},
handleOk () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const param = Object.assign({}, values)
param.id = this.model.id
detailSubmitQuestion(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancel () {
this.close()
},
close () {
this.visible = false
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,72 @@
<template>
<j-modal
:title="$t('enterpriseStandardLibrary.standard.updateRecord')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<div class="record-item" v-for="record in recordList" :key="record.id">
{{ record.content }}
</div>
</a-spin>
<template v-slot:footer>
<a-button @click="handleCancel">{{ $t('close') }}</a-button>
</template>
</j-modal>
</template>
<script>
import { detailGetUpdateRecord } from '@/api/enterpriseStandardLibraryApi'
export default {
name: 'UpdateRecordModal',
data () {
return {
width: 800,
visible: false,
confirmLoading: false,
recordList: []
}
},
methods: {
open (standardNumber) {
this.visible = true
this.initRecord(standardNumber)
},
initRecord (standardNumber) {
this.confirmLoading = true
detailGetUpdateRecord({ standardNumber }).then(res => {
if (res.success) {
this.recordList = res.result || []
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
handleCancel () {
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.record-item {
padding: 20px 0;
border-bottom: 1px solid #E5E6EB;
}
.record-item:first-child {
padding-top: 0;
}
.record-item:last-child {
border-bottom: none;
}
</style>
@@ -0,0 +1,130 @@
<template>
<j-modal
:title="title"
:maskClosable="true"
:width="500"
:closable="true"
@cancel="handleCancel"
fullscreen
@ok="handleOk"
:visible="visible">
<div class="content">
<!-- 左侧文件预览 -->
<div class="content-left">
<iframe></iframe>
</div>
<!-- 右侧表单区域 -->
<div class="content-right">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.subjectToClause')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.subjectToClause')"
:maxLength="50"
v-decorator.trim="[ 'subjectToClause', validatorRules.subjectToClause ]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.standardContentOrRequirements')">
<a-input :placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.standardContentOrRequirements')"
:maxLength="50"
v-decorator.trim="[ 'standardContentOrRequirements', validatorRules.standardContentOrRequirements ]" />
</a-form-item>
</a-form>
</a-spin>
</div>
</div>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
export default {
name: 'CheckContentModal',
data () {
return {
title: '',
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
validatorRules: {
subjectToClause: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.subjectToClause') }
],
validateTrigger: 'blur'
},
standardContentOrRequirements: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
],
validateTrigger: 'blur'
}
},
index: undefined // 编辑的表格的下标
}
},
methods: {
add () {
this.visible = true
this.form.resetFields()
},
edit (record, index) {
this.visible = true
this.index = index
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'subjectToClause', 'standardContentOrRequirements'))
})
},
close () {
this.visible = false
this.model = {}
},
handleCancel () {
this.close()
},
handleOk () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const param = Object.assign({}, values)
console.log(param)
this.$emit('ok', param, this.index)
this.close()
this.confirmLoading = false
}
})
}
}
}
</script>
<style scoped lang="less">
.content {
width: 100%;
height: 100%;
display: flex;
.content-left {
width: 60%;
height: 100%;
overflow-y: scroll;
}
.content-right {
width: 40%;
height: 100%;
overflow-y: scroll;
}
}
</style>
@@ -17,6 +17,32 @@
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
@submitFormData="submitFormData" />
<div class="header-text-btn">
<p class="header-text">稽查内容</p>
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
</div>
<div>
<a-table
:scroll="{x: 500}"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
rowKey="id">
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作栏 -->
<template slot="action" slot-scope="text, record, index" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn">{{ $t('edit') }}</a>
<a @click="handleDelete(index)" class="table-ope-btn" style="margin-left: 8px">{{ $t('delete') }}</a>
</template>
</a-table>
</div>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;">
@@ -25,6 +51,7 @@
<a-button @click="handleCancel" style="margin-bottom: 0;">{{ $t('close') }}</a-button>
</div>
</a-spin>
<check-content-modal ref="checkContentModal" @ok="checkContentOk"></check-content-modal>
</a-drawer>
</template>
@@ -33,10 +60,11 @@ import '@assets/less/common.less'
import AddForm from '@/components/customField/AddForm'
import { getEnterpriseStandardAddForm, getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
import { postAction } from '@/api/manage'
import CheckContentModal from './CheckContentModal'
export default {
name: 'EnterpriseStandardModal',
components: { AddForm },
components: { CheckContentModal, AddForm },
data () {
return {
visible: false,
@@ -47,6 +75,29 @@ export default {
confirmLoading: false,
getFormFunc: getEnterpriseStandardAddForm,
getDocumentInfoFunc: getEnterpriseStandardInfoById,
columns: [
{
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center',
width: 180,
dataIndex: 'subjectToClause',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center',
width: 180,
dataIndex: 'standardContentOrRequirements',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
width: 200
}
],
dataSource: [],
url: {
add: '/laws/standard/enterprise/commonAdd',
edit: '/laws/standard/enterprise/commonEdit'
@@ -66,6 +117,32 @@ export default {
this.$refs.addForm.edit(record)
})
},
// 稽查内容的添加
handleAdd () {
this.$refs.checkContentModal.title = this.$t('newlyAdded')
this.$refs.checkContentModal.add()
},
// 稽查内容的编辑
handleEdit (record, index) {
console.log(record, index)
this.$refs.checkContentModal.title = this.$t('edit')
this.$refs.checkContentModal.edit(record, index)
},
// 稽查内容的删除
handleDelete (index) {
this.dataSource.splice(index, 1)
},
// 稽查内容新增编辑完成
checkContentOk (value, index) {
console.log(value, index)
if (index || index === 0) {
// 有下标,说明是编辑
this.dataSource.splice(index, 1, value)
} else {
// 没有下标, 是新增
this.dataSource.push(value)
}
},
handleOk () {
this.$refs.addForm.submit()
},
@@ -104,6 +181,14 @@ export default {
}
</script>
<style scoped>
<style scoped lang="less">
.header-text-btn {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
.header-text {
margin-bottom: 0;
}
}
</style>
@@ -28,7 +28,6 @@
</div>
<j-table
ref="table"
:bordered="true"
size="middle"
rowKey="id"
:can-drag="true"