[add] 企标稽查计划

This commit is contained in:
danshihao
2023-10-30 15:32:11 +08:00
parent c08f52b145
commit e24aaf8415
11 changed files with 1181 additions and 3 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ export default {
},
{ // 企标稽查计划
title: this.$t('workCenter.newProcess.enterpriseStandardAuditPlan'),
path: ''
path: '/workCenter/EnterpriseStandardInspectionPlan'
},
{ // 企标稽查流程
title: this.$t('workCenter.newProcess.processOfEnterpriseStandardAudit'),
@@ -0,0 +1,278 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<!-- 基础信息 -->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<!-- 人员信息 -->
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!--基本信息-->
<div class="detail-page-scroll-content" v-show="switchValue === 'base'">
<!-- 流程信息 -->
<div class="process-part-title">{{ $t('processInformation') }}</div>
<a-form :form="processInfoForm">
<a-row>
<a-col :span="12">
<!-- 流程名称 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
:disabled="disabled || processDisabled"
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled || processDisabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled || processDisabled"
v-decorator="['processExplain']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<inspection-plan-table :current-node="currentNode" />
<!-- 会签表单 -->
<a-form :form="countersignForm" v-if="currentNode === '3'">
<a-row type="flex">
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.isCountersign')">
<j-dict-select-tag :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.isCountersign')"
type="radio"
dictCode="yn"
@change="changeIsCountersign"
v-decorator="['isCountersign', validatorRules.isCountersign]" />
</a-form-item>
</a-col>
<a-col :span="12"></a-col>
<a-col :span="12">
<a-form-item v-if="isCountersign" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionPlan.countersignRelevantPersonnel')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.countersignRelevantPersonnel')"
type="checkbox"
v-decorator="['countersignRelevantPersonnel', validatorRules.countersignRelevantPersonnel]" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['file']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
</process-detail-list>
</div>
<div class="detail-page-bottom-operate-box">
<a-button type="primary" :loading="loading" @click="handleSave" ghost><i class="iconfont icon-save" />{{ $t('preservation') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
</div>
</internal-detail-page>
</template>
<script>
import '@assets/less/common.less'
import Vue from 'vue'
import InternalDetailPage from '@comp/InternalDetailPage'
import PersonnelInfo from '@comp/PersonnelInfo'
import ProcessDetailList from '@comp/ProcessDetailList'
import { USER_INFO } from '@/store/mutation-types'
import InspectionPlanTable from '@views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanTable'
import UserSelection from '@comp/selection/UserSelection'
const { realname, username } = Vue.ls.get(USER_INFO)
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '稽查联络人发起计划',
nodeRoleName: '稽查联络人',
canChoose: false,
userList: `${realname}(${username})`
},
{
id: 2,
nodeName: '稽查征求意见对象填写征求意见',
nodeRoleName: '征求意见对象',
canChoose: true,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 3,
nodeName: '稽查联络人汇总',
nodeRoleName: '稽查联络人',
canChoose: true,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 4,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
},
{
id: 5,
nodeName: '联络人主管级领导批准',
nodeRoleName: '联络人主管级领导',
canChoose: true,
chooseType: 'radio',
// chooseSource: 'contactManage',
fieldName: 'contactUser'
}
]
export default {
name: 'EnterpriseStandardInspectionPlanFlow',
components: { UserSelection, InspectionPlanTable, ProcessDetailList, PersonnelInfo, InternalDetailPage },
data () {
return {
loading: false,
switchValue: 'base',
disabled: false,
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
longLabelCol: {
xs: { span: 24 },
sm: { span: 2 }
},
longWrapperCol: {
xs: { span: 24 },
sm: { span: 22 }
},
currentNode: '4',
personnelInfoData: [], // 人员信息数据
validatorRules: {
// 流程名称
processName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
// 备注
remarks: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
},
// 是否会签
isCountersign: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.esInspectionPlan.isCountersign') }
],
validateTrigger: 'change'
},
countersignRelevantPersonnel: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.esInspectionPlan.countersignRelevantPersonnel') }
],
validateTrigger: 'change'
}
},
processInfoForm: this.$form.createForm(this),
countersignForm: this.$form.createForm(this),
approvalInfoForm: this.$form.createForm(this),
// 是否会签
isCountersign: null,
url: {
list: '' // 人员信息右侧表的分页查询接口
}
}
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
},
processDisabled () {
return +this.currentNode > 1
}
},
methods: {
switchChange (value) {
this.switchValue = value
},
handleSave () {
// if (this.loading) return
},
handleSubmit () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
},
handleAgree () {
if (this.loading) return
this.currentNode = +this.currentNode + 1 + ''
},
// 是否会签改变
changeIsCountersign (val) {
if (val === '1') {
this.isCountersign = true
} else if (val === '2') {
this.isCountersign = false
} else {
this.isCountersign = null
}
}
},
mounted () {
this.personnelInfoData = approvalPersonalInfo
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,291 @@
<template>
<a-drawer
:title="title"
:maskClosable="false"
:width="width"
placement="right"
:destroyOnClose="true"
:closable="true"
@close="handleCancel"
:visible="visible"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<!-- 稽查依据标准号 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<standard-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.inspectionBasisStandardNumber')"
disabledInput disabledSourceSearch source="3" @nameChange="changeStandardName" type="radio"
v-decorator="['inspectionBasisStandardNumber', validatorRules.inspectionBasisStandardNumber]" />
</a-form-item>
<!-- 稽查依据标准名称 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.inspectionBasisStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.inspectionBasisStandardName')"
disabled class="box-input" :maxLength="50"
v-decorator="['inspectionBasisStandardName', validatorRules.inspectionBasisStandardName]" />
</a-form-item>
<!-- 计划稽查对象 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.planInspectionObjects')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-depart :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.inspectionBasisStandardNumber')"
multi :disabled="disabled"
v-decorator="['planInspectionObjects', validatorRules.planInspectionObjects]" />
</a-form-item>
<!-- 主责标准化工作组 -->
<!--<a-form-item :label="$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-tree-select-->
<!-- allowClear-->
<!-- tree-node-filter-prop="title"-->
<!-- :maxTagCount="1"-->
<!-- :show-search="true"-->
<!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
<!-- style="width: 100%"-->
<!-- :tree-data="workingGroupTreeList"-->
<!-- :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.mainDutyStandardizationGroup')"-->
<!-- v-decorator="['mainDutyStandardizationGroup', validatorRules.mainDutyStandardizationGroup]" />-->
<!--</a-form-item>-->
<!-- 主责标准化工作组 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<work-group-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.mainDutyStandardizationGroup')"
v-decorator="['mainDutyStandardizationGroup', validatorRules.mainDutyStandardizationGroup]" />
</a-form-item>
<!-- 所属部门 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.department')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-depart :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.inspectionBasisStandardNumber')"
multi :disabled="disabled"
v-decorator="['department', validatorRules.department]" />
</a-form-item>
<!-- 计划稽查日期 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.planInspectionDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date date-format="YYYY-MM-DD" style="width: 100%" showType="day"
:placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionPlan.planInspectionDate')"
v-decorator="['planInspectionDate', validatorRules.planInspectionDate]" />
</a-form-item>
<!-- 稽查负责人 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.inspectionDirector')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.solicitingOpinionsFrom')"
type="radio"
v-decorator="['inspectionDirector', validatorRules.inspectionDirector]" />
</a-form-item>
<!-- 标准化组对接人 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.standardizationGroupContactPerson')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.solicitingOpinionsFrom')"
type="radio"
v-decorator="['standardizationGroupContactPerson', validatorRules.standardizationGroupContactPerson]" />
</a-form-item>
<!-- 征求意见对象 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.solicitingOpinionsFrom')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.solicitingOpinionsFrom')"
type="checkbox"
v-decorator="['solicitingOpinionsFrom', validatorRules.solicitingOpinionsFrom]" />
</a-form-item>
<!-- 备注 -->
<a-form-item :label="$t('workCenter.esInspectionPlan.remark')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionPlan.remark')"
:maxLength="500" :rows="4"
v-decorator="['remark', validatorRules.remark]" />
</a-form-item>
</a-form>
</a-spin>
</div>
<div class="custom-drawer-style-bottom-btn">
<!-- 取消 -->
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
<!-- 确定 -->
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import '@/assets/less/common.less'
import StandardSelection from '@comp/selection/StandardSelection'
import UserSelection from '@comp/selection/UserSelection'
import { getWorkGroupTreeList } from '@api/api'
import WorkGroupSelection from '@comp/selection/WorkGroupSelection'
export default {
name: 'InspectionPlanDrawer',
components: { WorkGroupSelection, UserSelection, StandardSelection },
data () {
return {
width: 800,
title: this.$t('workCenter.esInspectionPlan.inspectionPlan'),
visible: false,
confirmLoading: false,
disabled: false,
model: {},
form: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
// 内部工作组树
workingGroupTreeList: [],
validatorRules: {
// 稽查依据标准号
inspectionBasisStandardNumber: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber') + this.$t('cannotEmpty')
}
]
},
// 稽查依据标准名称
inspectionBasisStandardName: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName') + this.$t('cannotEmpty')
}
]
},
// 计划稽查对象
planInspectionObjects: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.planInspectionObjects') + this.$t('cannotEmpty')
}
]
},
// 主责标准化工作组
mainDutyStandardizationGroup: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup') + this.$t('cannotEmpty')
}
]
},
// 所属部门
department: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.department') + this.$t('cannotEmpty')
}
]
},
// 计划稽查日期
planInspectionDate: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.planInspectionDate') + this.$t('cannotEmpty')
}
]
},
// 稽查负责人
inspectionDirector: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.inspectionDirector') + this.$t('cannotEmpty')
}
]
},
// 标准化组对接人
standardizationGroupContactPerson: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.standardizationGroupContactPerson') + this.$t('cannotEmpty')
}
]
},
// 征求意见对象
solicitingOpinionsFrom: {
rules: [
{
required: true,
trigger: 'change',
message: this.$t('workCenter.esInspectionPlan.solicitingOpinionsFrom') + this.$t('cannotEmpty')
}
]
}
}
}
},
created () {
this.getWorkGroupTree()
},
methods: {
add () {
this.edit({})
},
edit (record) {
this.visible = true
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
},
handleSubmit () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
const value = Object.assign({}, values, this.model)
this.confirmLoading = true
this.$emit('ok', value)
this.confirmLoading = false
this.close()
}
})
},
handleCancel () {
this.close()
},
close () {
this.model = {}
this.visible = false
},
// 标准号选择,回显标准名称
changeStandardName (value) {
console.log(value)
this.form.setFieldsValue({
inspectionBasisStandardName: value
})
},
// 获取内部工作组树
getWorkGroupTree () {
getWorkGroupTreeList().then((res) => {
if (res.success) {
this.workingGroupTreeList = this.dealTreeData(res.result || [])
} else {
this.workingGroupTreeList = []
}
})
},
// 处理内部工作组数据结构
dealTreeData (treeData) {
return treeData.map(item => {
item.label = item.name
item.value = item.id
item.disabled = !!(item.subset && item.subset.length)
item.children = this.dealTreeData(item.subset)
return item
})
}
}
}
</script>
<style lang="less" scoped>
</style>
@@ -0,0 +1,286 @@
<template>
<div>
<div class="table-operator">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入 -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button icon="upload" type="primary" ghost v-has="'enterpriseStandard:upload'">{{ $t('import') }}</a-button>
</a-upload>
<!-- 批量删除 -->
<a-button icon="delete" type="primary" ghost @click="batchDel" v-has="'enterpriseStandard:batchDel'">{{ $t('batchDelete') }}</a-button>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
@change="tableOnChange">
<!-- 企标号企标名称 -->
<template v-slot:standard="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="table-text can-click-table-text" @click="detailClick(record)" v-if="(text || text === 0) && record.detailFlag">{{ text }}</a>
<div class="table-text" v-else-if="(text || text === 0) && !record.detailFlag">{{ text }}</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 所属部门意见 -->
<template v-slot:departOpinion="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="table-text can-click-table-text" @click="showDepartOpinion(record)" v-if="(text || text === 0)">{{ $t('view') }}</a>
<div class="table-text" v-else-if="(text || text === 0)">{{ text }}</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="{text, record, index}">
<!-- 编辑 and 删除:节点1 节点3 节点2且当前登录人是创建人 -->
<template v-if="['1', '3'].includes(currentNode) || (currentNode === '2' && $store.getters.userInfo.id === record.userId)">
<a @click="handleEdit(record, index)" >{{ $t('edit') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
</template>
<!-- 意见 or 填写意见节点2非自己创建的就是意见和填写意见 -->
<template v-else-if="currentNode === '2'">
<a v-if="!!record.opinion" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template>
</template>
</j-table>
</div>
<!-- 新增/编辑稽查计划 -->
<inspection-plan-drawer ref="modalForm" @ok="modalFormOk"/>
<!-- 填写意见意见回显 -->
<write-opinion-modal ref="writeOpinionModal" @ok="modalFormOk"/>
<!-- 节点3所属部门意见-查看 -->
<show-opinion-modal ref="showOpinionModal" @ok="modalFormOk"/>
</div>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import JTable from '@comp/jero/JTable'
import InspectionPlanDrawer from '@views/workCenter/enterpriseStandardInspectionPlan/modules/InspectionPlanDrawer'
import WriteOpinionModal from '@views/workCenter/enterpriseStandardInspectionPlan/modules/WriteOpinionModal'
import ShowOpinionModal from '@views/workCenter/enterpriseStandardInspectionPlan/modules/ShowOpinionModal'
export default {
name: 'InspectionPlanTable',
components: { ShowOpinionModal, WriteOpinionModal, InspectionPlanDrawer, JTable },
mixins: [JeroListMixin],
props: {
// 当前节点
currentNode: {
type: String,
required: true
}
},
data () {
return {
url: {
list: ''
},
model: {},
dataSource: [
{
id: 1,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 3,
inspectionBasisStandardName: 'qaaa',
inspectionBasisStandardNumber: '12asdasdas3',
detailFlag: true,
departOpinion: '123',
opinion: [],
mainDutyStandardizationGroup: '1699358097292472322'
},
{
id: 2,
inspectionBasisStandardName: '123',
inspectionBasisStandardNumber: '123',
detailFlag: true,
departOpinion: '123',
userId: 'e9ca23d68d884d4ebb19d07889727dae'
// mainDutyStandardizationGroup: '1699358097292472322'
}
],
allColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 稽查依据标准号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardNumber',
scopedSlots: { customRender: 'standard' }
},
{ // 稽查依据标准名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardName',
scopedSlots: { customRender: 'standard' }
},
{ // 计划稽查对象
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center',
width: 120,
dataIndex: 'planInspectionObjects',
scopedSlots: { customRender: 'text' }
},
{ // 主责标准化工作组
title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center',
width: 150,
dataIndex: 'mainDutyStandardizationGroup',
scopedSlots: { customRender: 'text' }
},
{ // 所属部门
title: this.$t('workCenter.esInspectionPlan.department'),
align: 'center',
width: 120,
dataIndex: 'department',
scopedSlots: { customRender: 'text' }
},
{ // 计划稽查日期
title: this.$t('workCenter.esInspectionPlan.planInspectionDate'),
align: 'center',
width: 120,
dataIndex: 'planInspectionDate',
scopedSlots: { customRender: 'text' }
},
{ // 稽查负责人
title: this.$t('workCenter.esInspectionPlan.inspectionDirector'),
align: 'center',
width: 120,
dataIndex: 'inspectionDirector',
scopedSlots: { customRender: 'text' }
},
{ // 标准化组对接人
title: this.$t('workCenter.esInspectionPlan.standardizationGroupContactPerson'),
align: 'center',
width: 140,
dataIndex: 'standardizationGroupContactPerson',
scopedSlots: { customRender: 'text' }
},
{ // 所属部门人员
title: this.$t('workCenter.esInspectionPlan.departmentPersonnel'),
align: 'center',
width: 120,
dataIndex: 'departmentPersonnel',
showCodeList: ['1'],
scopedSlots: { customRender: 'text' }
},
{ // 创建人
title: this.$t('workCenter.esInspectionPlan.creator'),
align: 'center',
width: 120,
dataIndex: 'creator',
showCodeList: ['2'],
scopedSlots: { customRender: 'text' }
},
{ // 发起人
title: this.$t('workCenter.esInspectionPlan.initiator'),
align: 'center',
width: 120,
dataIndex: 'initiator',
showCodeList: ['3', '4', '5'],
scopedSlots: { customRender: 'text' }
},
{ // 所属部门意见
title: this.$t('workCenter.esInspectionPlan.departOpinion'),
align: 'center',
width: 120,
dataIndex: 'departOpinion',
showCodeList: ['3'],
scopedSlots: { customRender: 'departOpinion' }
},
{
fixed: 'right',
// 操作
showCodeList: ['1', '2', '3'],
title: this.$t('operation'),
// dataIndex: 'action',
align: 'center',
width: 180,
scopedSlots: { customRender: 'action' }
}
]
}
},
computed: {
// 按节点进行过滤
columns () {
return this.allColumns.filter(item => {
// 没有这个属性,就默认显示
if (!item.showCodeList) {
return true
}
// 如果有,就根据当前节点显示
return item.showCodeList.includes(this.currentNode)
})
}
},
mounted () {
},
methods: {
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
},
tableOnChange (pagination, filters, sorter) {
this.orderBy = sorter.order === 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.ipagination = pagination
this.getTableList()
},
// 显示意见
handleShowOpinion (record) {
this.$refs.writeOpinionModal.show(record, true)
},
// 填写意见
handleWriteOpinion (record) {
this.$refs.writeOpinionModal.show(record)
},
// 查看所属部门意见
showDepartOpinion (record) {
this.$refs.showOpinionModal.show(record)
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,92 @@
<template>
<j-modal
:title="title"
:width="drawerWidth"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
:cancelText="$t('close')">
<a-spin :spinning="confirmLoading">
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%'}"
@change="tableOnChange">
</j-table>
</a-spin>
</j-modal>
</template>
<script>
import JTable from '@comp/jero/JTable'
import { JeroListMixin } from '@/mixins/JeroListMixin'
export default {
name: 'ShowOpinionModal',
mixins: [JeroListMixin],
components: { JTable },
data () {
return {
title: this.$t('workCenter.esInspectionPlan.solicitOpinion'),
drawerWidth: 1000,
visible: false,
model: {},
confirmLoading: false,
url: {
list: ''
},
dataSource: [],
columns: [
{ // 征求意见对象
title: this.$t('workCenter.esInspectionPlan.solicitOpinionObject'),
align: 'center',
width: 180,
dataIndex: 'solicitOpinionObject',
scopedSlots: { customRender: 'text' }
},
{ // 意见
title: this.$t('workCenter.esInspectionPlan.opinion'),
align: 'center',
width: 180,
dataIndex: 'opinion',
scopedSlots: { customRender: 'text' }
}
]
}
},
methods: {
show (record) {
this.model = Object.assign({}, record)
this.visible = true
},
// 确定
handleOk () {
this.close()
},
// 关闭
handleCancel () {
this.close()
},
close () {
this.$emit('close')
this.visible = false
},
tableOnChange (pagination, filters, sorter) {
this.orderBy = sorter.order === 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.ipagination = pagination
this.getTableList()
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,167 @@
<template>
<j-modal
:title="title"
:width="drawerWidth"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
:cancelText="$t('close')">
<a-spin :spinning="confirmLoading">
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
ref="table"
size="middle"
bordered>
<!-- 企标号企标名称 -->
<template v-slot:standard="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="table-text can-click-table-text" @click="detailClick(record)" v-if="(text || text === 0) && record.detailFlag">{{ text }}</a>
<div class="table-text" v-else-if="(text || text === 0) && !record.detailFlag">{{ text }}</div>
<div class="table-text" v-else>{{ global.emptyLine }}</div>
</a-tooltip>
</template>
</j-table>
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item
prop="opinion"
:label="$t('workCenter.esInspectionPlan.opinion')">
<a-textarea :max-length="500" :rows="4" :disabled="disabled"
:placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionPlan.opinion')" v-model="model.opinion"/>
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import JTable from '@comp/jero/JTable'
export default {
name: 'WriteOpinionModal',
components: { JTable },
data () {
return {
disabled: false,
title: this.$t('workCenter.esInspectionPlan.writeOpinion'),
drawerWidth: 1000,
visible: false,
model: {},
confirmLoading: false,
validatorRules: {
opinion: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('workCenter.esInspectionPlan.opinion'), trigger: 'blur' }
]
},
columns: [
{ // 稽查依据标准号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardNumber',
scopedSlots: { customRender: 'standard' }
},
{ // 稽查依据标准名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'inspectionBasisStandardName',
scopedSlots: { customRender: 'standard' }
},
{ // 计划稽查对象
title: this.$t('workCenter.esInspectionPlan.planInspectionObjects'),
align: 'center',
width: 120,
dataIndex: 'planInspectionObjects',
scopedSlots: { customRender: 'text' }
},
{ // 主责标准化工作组
title: this.$t('workCenter.esInspectionPlan.mainDutyStandardizationGroup'),
align: 'center',
width: 150,
dataIndex: 'mainDutyStandardizationGroup',
scopedSlots: { customRender: 'text' }
},
{ // 所属部门
title: this.$t('workCenter.esInspectionPlan.department'),
align: 'center',
width: 120,
dataIndex: 'department',
scopedSlots: { customRender: 'text' }
},
{ // 计划稽查日期
title: this.$t('workCenter.esInspectionPlan.planInspectionDate'),
align: 'center',
width: 120,
dataIndex: 'planInspectionDate',
scopedSlots: { customRender: 'text' }
}
],
dataSource: []
}
},
methods: {
show (record, disabled) {
// 是否禁用表单
this.disabled = disabled
this.dataSource = [record]
this.model = Object.assign({}, record)
this.visible = true
},
// 确定
handleOk () {
const that = this
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true
const fun = () => {}
const formData = Object.assign({}, this.model)
fun(formData).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
that.close()
})
} else {
return false
}
})
},
// 关闭
handleCancel () {
this.close()
},
close () {
this.$emit('close')
this.visible = false
this.$refs.form.resetFields()
},
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
}
}
}
</script>
<style scoped>
</style>