[update] 修改bug87442
This commit is contained in:
@@ -14,28 +14,28 @@ module.exports = {
|
||||
templateExport: 'Enterprise Standard Template',
|
||||
pleaseSelectLeastOneNode: 'Please select Level 2 and below system first',
|
||||
myCollectNotRemove: 'My collection system cannot be removed from the standard',
|
||||
authorizationDepart: '授权部门',
|
||||
authorizationUser: '授权人员',
|
||||
maturityDate: '授权到期日期',
|
||||
detailTitle: '企业标准详情页',
|
||||
evaluate: '企标评价',
|
||||
updateRecord: '更新记录',
|
||||
submitQuestion: '提交问题',
|
||||
standardResolutionSheet: '标准分解单',
|
||||
nodeName: '节点名称',
|
||||
subjectToClause: '章节条款',
|
||||
standardContentOrRequirements: '标准内容或要求',
|
||||
rectificationDepartment: '整改部门',
|
||||
auditContent: '稽查内容',
|
||||
disabledBatchDel: '选中数据中存在没有操作权限的数据,请重新选择',
|
||||
pleaseSelectUserOrDepart: '授权部门和授权人员至少需要选择一个',
|
||||
youNot: '您没有',
|
||||
dataPremissReCheck: '数据权限,请重新选择',
|
||||
authorizationExpirationDate: '授权到期日期',
|
||||
cancelAuthor: '解除授权',
|
||||
authorizationDate: '授权日期',
|
||||
authorizationStandard: '授权企标',
|
||||
confirmCancelAuthor: '确认解除授权?'
|
||||
authorizationDepart: 'Authorized department',
|
||||
authorizationUser: 'Authorized officer',
|
||||
maturityDate: 'Authorization expiration date',
|
||||
detailTitle: 'Enterprise Standards Details page',
|
||||
evaluate: 'Evaluation of enterprise standard',
|
||||
updateRecord: 'Update record',
|
||||
submitQuestion: 'Submit a question',
|
||||
standardResolutionSheet: 'Standard resolution sheet',
|
||||
nodeName: 'Node name',
|
||||
subjectToClause: 'Section clause',
|
||||
standardContentOrRequirements: 'Standard content or requirements',
|
||||
rectificationDepartment: 'Rectification department',
|
||||
auditContent: 'Monitoring content',
|
||||
disabledBatchDel: 'If the selected data has no operation permission, select another data',
|
||||
pleaseSelectUserOrDepart: 'The authorized department and authorized person must select at least one',
|
||||
youNot: "You didn't",
|
||||
dataPremissReCheck: 'Data permission, please re-select',
|
||||
authorizationExpirationDate: 'Authorization expiration date',
|
||||
cancelAuthor: 'deauthorize',
|
||||
authorizationDate: 'Authorization date',
|
||||
authorizationStandard: 'Authorized bid',
|
||||
confirmCancelAuthor: 'Confirm the deauthorization?'
|
||||
},
|
||||
// 评审会记录
|
||||
reviewMeeting: {
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = {
|
||||
subjectToClause: '章节条款',
|
||||
standardContentOrRequirements: '标准内容或要求',
|
||||
rectificationDepartment: '整改部门',
|
||||
auditContent: '稽查内容',
|
||||
auditContent: '监察内容',
|
||||
disabledBatchDel: '选中数据中存在没有操作权限的数据,请重新选择',
|
||||
pleaseSelectUserOrDepart: '授权部门和授权人员至少需要选择一个',
|
||||
youNot: '您没有',
|
||||
|
||||
@@ -326,7 +326,7 @@ export default {
|
||||
'formInline.try_flag' (val) {
|
||||
if (val && this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
|
||||
if (val === IsTrial.YES.value) {
|
||||
// 试行周期给默认值24
|
||||
// 试行周期给默认值12
|
||||
this.formInline.trial_period = '12'
|
||||
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
||||
// 试行,试行周期必填
|
||||
|
||||
@@ -2,52 +2,43 @@
|
||||
<j-modal
|
||||
:title="title"
|
||||
:maskClosable="true"
|
||||
:width="500"
|
||||
:width="800"
|
||||
:closable="true"
|
||||
@cancel="handleCancel"
|
||||
fullscreen
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
:visible="visible">
|
||||
<div class="content">
|
||||
<!-- 左侧文件预览 -->
|
||||
<div class="content-left">
|
||||
<a-spin :spinning="leftLoading" class="left-spin">
|
||||
<iframe v-if="iframeSrc" :src="iframeSrc" width="100%" frameborder="0"></iframe>
|
||||
<a-empty class="empty-file" v-else :description="$t('noFileAvailableForPreview')"></a-empty>
|
||||
</a-spin>
|
||||
</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="[ 'clause', validatorRules.clause ]" />
|
||||
</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="500"
|
||||
:rows="4"
|
||||
type="textarea"
|
||||
v-decorator.trim="[ 'requirement', validatorRules.requirement ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</div>
|
||||
</div>
|
||||
<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="[ 'clause', validatorRules.clause ]" />
|
||||
</a-form-item>
|
||||
<!-- 整改部门 -->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.rectificationDepartment')">
|
||||
<j-select-depart :placeholder="$t('pleaseSelect') + $t('enterpriseStandardLibrary.standard.rectificationDepartment')"
|
||||
v-decorator.trim="[ 'rectificationDepartment', validatorRules.rectificationDepartment ]"
|
||||
@back="rectificationDepartmentBack"
|
||||
backDepart />
|
||||
</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="500"
|
||||
:rows="4"
|
||||
type="textarea"
|
||||
v-decorator.trim="[ 'requirement', validatorRules.requirement ]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { getFileInfo } from '@/api/api'
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
const Base64 = require('js-base64').Base64
|
||||
|
||||
export default {
|
||||
name: 'CheckContentModal',
|
||||
@@ -56,7 +47,6 @@ export default {
|
||||
title: '',
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
leftLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
model: {},
|
||||
labelCol: {
|
||||
@@ -74,6 +64,12 @@ export default {
|
||||
],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
rectificationDepartment: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseSelect') + this.$t('enterpriseStandardLibrary.standard.rectificationDepartment') }
|
||||
],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
requirement: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements') }
|
||||
@@ -81,28 +77,15 @@ export default {
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
index: undefined, // 编辑的表格的下标
|
||||
iframeSrc: '' // 左侧预览的路径
|
||||
index: undefined // 编辑的表格的下标
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add (fileId) {
|
||||
this.leftLoading = true
|
||||
this.getFileInfo(fileId).then(res => {
|
||||
this.handlePreview(res)
|
||||
}).finally(() => {
|
||||
this.leftLoading = false
|
||||
})
|
||||
add () {
|
||||
this.visible = true
|
||||
this.form.resetFields()
|
||||
},
|
||||
edit (fileId, record, index) {
|
||||
this.leftLoading = true
|
||||
this.getFileInfo(fileId).then(res => {
|
||||
this.handlePreview(res)
|
||||
}).finally(() => {
|
||||
this.leftLoading = false
|
||||
})
|
||||
edit (record, index) {
|
||||
this.visible = true
|
||||
this.index = index
|
||||
this.form.resetFields()
|
||||
@@ -111,36 +94,14 @@ export default {
|
||||
this.form.setFieldsValue(pick(this.model, 'clause', 'requirement'))
|
||||
})
|
||||
},
|
||||
getFileInfo (fileId) {
|
||||
return new Promise(resolve => {
|
||||
let fileInfo
|
||||
getFileInfo({ id: fileId }).then(res => {
|
||||
if (res.success) {
|
||||
fileInfo = res.result
|
||||
}
|
||||
}).finally(() => {
|
||||
resolve(fileInfo)
|
||||
})
|
||||
})
|
||||
},
|
||||
handlePreview (file) {
|
||||
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1].toLowerCase() : ''
|
||||
if (fileSuffix === 'pdf') {
|
||||
// pdf预览
|
||||
const url = previewPdf(file.id)
|
||||
this.iframeSrc = url
|
||||
} else if (fileSuffix === 'docx' || fileSuffix === 'doc') {
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
||||
// word文件仍使用KKFile进行预览
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||
this.iframeSrc = url
|
||||
}
|
||||
// 整改部门返回
|
||||
rectificationDepartmentBack (val) {
|
||||
this.model.rectificationDepartment_dictText = val.map(item => item.text).join(',')
|
||||
},
|
||||
close () {
|
||||
this.visible = false
|
||||
this.model = {}
|
||||
this.index = undefined
|
||||
this.iframeSrc = ''
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
|
||||
@@ -124,11 +124,8 @@ export default {
|
||||
title: this.$t('enterpriseStandardLibrary.standard.rectificationDepartment'),
|
||||
align: 'center',
|
||||
width: 200,
|
||||
dataIndex: 'rectificationDepartment',
|
||||
customRender: (value, row, index) => {
|
||||
return <j-select-depart v-model={this.dataSource[index].rectificationDepartment}
|
||||
backDepart={true} />
|
||||
}
|
||||
dataIndex: 'rectificationDepartment_dictText',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
@@ -168,51 +165,13 @@ export default {
|
||||
},
|
||||
// 稽查内容的添加
|
||||
handleAdd () {
|
||||
const value = this.$refs.addForm.formInline
|
||||
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
|
||||
const needSuffixArr = ['doc', 'docx', 'pdf']
|
||||
let fileId = ''
|
||||
for (const item of fieldArr) {
|
||||
if (!fileId && value[item + '_dictText']) {
|
||||
const fileNameArr = value[item + '_dictText'].split(',')
|
||||
for (let i = 0; i < fileNameArr.length; i++) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileNameArr[i] ? fileNameArr[i].split('.')[fileNameArr[i].split('.').length - 1] : '').toLowerCase()
|
||||
if (needSuffixArr.includes(fileSuffix)) {
|
||||
// 说明是可以预览的文件格式
|
||||
console.log('支持文件预览的文件', value[item].split(',')[i], value[item + '_dictText'].split(',')[i])
|
||||
fileId = value[item].split(',')[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.checkContentModal.title = this.$t('newlyAdded')
|
||||
this.$refs.checkContentModal.add(fileId)
|
||||
this.$refs.checkContentModal.add()
|
||||
},
|
||||
// 稽查内容的编辑
|
||||
handleEdit (record, index) {
|
||||
const value = this.$refs.addForm.formInline
|
||||
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
|
||||
const needSuffixArr = ['doc', 'docx', 'pdf']
|
||||
let fileId = ''
|
||||
for (const item of fieldArr) {
|
||||
if (!fileId && value[item + '_dictText']) {
|
||||
const fileNameArr = value[item + '_dictText'].split(',')
|
||||
for (let i = 0; i < fileNameArr.length; i++) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileNameArr[i] ? fileNameArr[i].split('.')[fileNameArr[i].split('.').length - 1] : '').toLowerCase()
|
||||
if (needSuffixArr.includes(fileSuffix)) {
|
||||
// 说明是支持文件预览的文件格式
|
||||
console.log('支持文件预览的文件', value[item].split(',')[i], value[item + '_dictText'].split(',')[i])
|
||||
fileId = value[item].split(',')[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.checkContentModal.title = this.$t('edit')
|
||||
this.$refs.checkContentModal.edit(fileId, record, index)
|
||||
this.$refs.checkContentModal.edit(record, index)
|
||||
},
|
||||
// 稽查内容的删除
|
||||
handleDelete (index) {
|
||||
|
||||
Reference in New Issue
Block a user