Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/bzjd/step2.vue
T
zyn a5e3fd56a7 Merge remote-tracking branch 'origin/dev_test' into dev_test
# Conflicts:
#	src/pages/processCenter/pages/creatProcess/xmpg/step3.vue
#	src/pages/processCenter/pages/creatProcess/xmpg/step4.vue
#	src/pages/processCenter/pages/creatProcess/xmpg/step5.vue
2023-11-30 17:56:31 +08:00

664 lines
27 KiB
Vue

<template>
<div class="bzjdStep2">
<!-- 标准调研流程-->
<ProcessHeader toggle>
<template slot="proName">标准解读流程</template>
<template slot="proNode">选择责任人</template>
</ProcessHeader>
<div class="headerTabs">
<div class="headerTabsItem" :class="active === '1' ? 'active' : ''" @click="handleTabs('1')">基础信息</div>
<div class="headerTabsItem" :class="active === '2' ? 'active' : ''" @click="handleTabs('2')">审批历史</div>
</div>
<div class="content" v-show="active === '1'">
<div style="overflow: auto;">
<el-form
ref="bzzqyjForm"
:model="form"
class="label-input-form"
label-width="210px"
>
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<el-collapse-transition>
<div class="prc-content-border" v-if="foldFormFlag === false">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="标准编号" prop="cid" class="add-form-item form-item-disabled">
<span class="file-box-span" @click="handlePreview(form.itemsNum)" :title="form.itemsNum">{{ form.itemsNum }}</span>
</el-form-item>
<el-form-item label="标准名称" prop="cname" class="add-form-item form-item-disabled">
<span class="file-box-span" @click="handlePreview(form.itemsNum)" :title="form.itemsName">{{ form.itemsName }}</span>
</el-form-item>
<el-form-item label="上一版本标准号/政策号" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsNum1"
clearable
></el-input>
</el-form-item>
<el-form-item label="上一版本标准名称/政策名称" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.itemsName1"
clearable
></el-input>
</el-form-item>
<el-form-item label="截止日期" prop="endTime" class="add-form-item form-item-disabled">
<el-date-picker
v-model="form.endTime"
type="date"
disabled
placeholder="请选择截止日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</div>
</el-collapse-transition>
<el-button v-if="foldFormFlag === false" style="width: 100%" icon="el-icon-caret-top" @click="foldForm">隐藏基础信息</el-button>
<el-button v-if="foldFormFlag === true" style="width: 100%" icon="el-icon-caret-bottom" @click="foldForm">展开基础信息</el-button>
</el-form>
</div>
<ProcessTitle>
<template slot="title">拆分信息</template>
</ProcessTitle>
<div class="action-bar">
<el-button :disabled="!itemList.length" type="primary" class="common-button-primary add-button" size="mini" @click="choiceZRRS('', 2, '')">批量编辑</el-button>
</div>
<el-table border
ref="filterTable"
:data="itemList"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column
fixed
type="index"
width="55"
label="序号"
align="center">
</el-table-column>
<el-table-column
prop="itemsNum"
label="条款号"
fixed
width="120"
align="center">
</el-table-column>
<el-table-column
prop="itemsName"
width="170"
label="条款名称"
fixed
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="itermsConditions"
label="条款内容"
fixed
width="200"
show-overflow-tooltip
align="center">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="itermsConditionsOpen(scope.row.itermsConditions)" class="common-button-primary">
查看条款内容
</el-button>
</template>
</el-table-column>
<el-table-column
prop="newData"
width="180"
show-overflow-tooltip
label="新车型实施日期"
align="center">
</el-table-column>
<el-table-column
prop="onlineData"
width="180"
show-overflow-tooltip
label="在产车型实施日期"
align="center">
</el-table-column>
<el-table-column
prop="applyArctic"
width="200"
label="适用车型"
show-overflow-tooltip
align="center">
<template slot-scope="scope">
{{ JSON.parse(scope.row.applyArctic).join(',') }}
</template>
</el-table-column>
<el-table-column
v-if="!form.itemsNum1"
prop="technicalRequir"
label="核心技术要求"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
prop="changePoint"
v-if="form.itemsNum1"
label="基于上一版本差异"
show-overflow-tooltip
align="center">
</el-table-column>
<!-- <el-table-column-->
<!-- v-if="sarType === 'FOREIGN' && form.itemsNum1"-->
<!-- prop="changePoint"-->
<!-- width="150"-->
<!-- label="相对于国行标差异点"-->
<!-- show-overflow-tooltip-->
<!-- align="center">-->
<!-- </el-table-column>-->
<el-table-column
label="责任人"
width="170"
align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.zxUserId" style="display: none;"/>
<el-input v-model="scope.row.zxUserIdName" placeholder="请选择责任人" @click.native="choiceZRRS(scope.row.zxUserId, 1, scope.$index)"/>
</template>
</el-table-column>
</el-table>
<ReceiptDescription
title="回执说明"
v-model="commentText2"
></ReceiptDescription>
<loading :loading="loading">数据获取中</loading>
<!--<el-collapse accordion>-->
<!-- <el-collapse-item title="回执说明">-->
<!-- <div style="margin: 10px 0;">-->
<!-- <el-input-->
<!-- type="textarea"-->
<!-- :rows="3"-->
<!-- resize="none"-->
<!-- placeholder="请输入意见"-->
<!-- v-model="commentText2">-->
<!-- </el-input>-->
<!-- </div>-->
<!-- </el-collapse-item>-->
<!--</el-collapse>-->
</div>
<div class="content" v-show="active === '2'">
<el-table
height="100%"
ref="selection"
:data="histortData"
tooltip-effect="dark"
style="width: 100%"
border
row-key="id"
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}">
<el-table-column
type="index"
width="55"
label="序号"
align="center">
</el-table-column>
<el-table-column
prop="name"
label="任务步骤"
align="center"
>
</el-table-column>
<el-table-column
prop="assignee"
label="任务受理人"
align="center"
>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime ? $moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column
prop="endTime"
label="完成时间"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.endTime ? $moment(scope.row.endTime).format('YYYY-MM-DD HH:mm:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column
prop="comment"
label="流程信息"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.commentText }}</span>
</template>
</el-table-column>
<el-table-column
prop="completeFlag"
label="状态"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.endTime ? '已完成' : '未完成'}}</span>
</template>
</el-table-column>
</el-table>
</div>
<ProcessFooter
show-save
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
show-transfer
@transfer="handleTransfer"
@save="handleSave"
@submit="handleSubmit"
>
</ProcessFooter>
<Role-tree
check-box
is-title="转办处理人"
:is-visible.sync="drawerModal"
@checkedRole="checkedRole"
></Role-tree>
<Role-tree
check-box
:is-title="drawerTitle"
:is-visible.sync="modalshowflag2"
@checkedRole="saveUserInfo"
:nodeList="nodeList2"
></Role-tree>
<loading :loading="loading">加载中...</loading>
<el-dialog
title="查看条款内容"
:visible.sync="itermsConditionsFlag"
size="800px">
<div class="itemsTextBox" v-html="itermsConditionsTitle"></div>
<div slot="footer">
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="itermsConditionsClose">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail, processCreateStand, saveTaskForPub,changeAssigneeNew} from 'api/process'
import axios from "axios";
import ReceiptDescription from '@/components/hzwlComponents/ReceiptDescription'
export default {
name: "bzjdStep2",
data() {
return {
commentText2: '',
drawerModal: false,
//折叠的标志,true为折叠,false为不折叠
foldFormFlag: false,
itermsConditionsFlag: false,
itermsConditionsTitle: '',
type: '',
drawerTitle: '',
histortData: [],
sarType: '',
zxIndex: '',
zxType: '',
zxIdList: [],
modalshowflag2: false,
nodeList2: [],
loading: true,
commentText: '',
taskIds: this.$route.query.taskIds,
pId: this.$route.query.prcId,
roleRow: {},
textarea: '', // 意见
ListModel: false, // 新增编辑抽屉开关
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
form: {
itemsNum: '',
itemsName: '',
itemsNum1: '',
itemsName1: '',
endTime: '',
},
json: {},
itemList: []
}
},
components: {
ReceiptDescription,
ProcessHeader,
ProcessFooter,
ProcessTitle
},
methods: {
handleResize() {
this.$nextTick(()=> {
this.$refs.filterTable.doLayout();
});
},
handleTransfer() {
this.drawerModal = true
},
checkedRole (data) {
this.saveLoading = true
this.isSubmit = true
changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id
userId:this.$store.getters.userInfo.userId, // 委托人
assignee: data[0].id, // 被委托人
pId: this.$route.query.prcId, // 流程实例
}).then(res => {
if (res.success) {
this.drawerModal = false
this.$message.success('调整成功')
this.processNum()
this.$router.push({path:'/processCenter?tabsName=ProcessCenter'})
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
})
},
// 点击跳转标准详情
handlePreview (item) {
let replaceStandInfoEO ={}
replaceStandInfoEO.standNumber = item
this.$http.get('sarStandardsInfo/sar-standards-info/queryInfoByStandNum', replaceStandInfoEO, {
_this: this
}, res => {
if (res.data != null) {
let dataType ='INLAND_STAND'
if(res.data.standType ==='FOREIGN'){
dataType ='FOREIGN_STAND'
}
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: res.data.id,
pageType:dataType
}
})
window.open(routeUrl.href, '_blank')
} else {
this.$message.error('标准号不存在!')
}
}, e => {
})
},
// 请求转换流程图
processNum (row) {
axios.request({
url: '/api/lawss/activiti/getImg?_t=' + new Date().getTime(),
responseType: 'blob',
method: 'get',
params: {
prcNum: this.$route.query.prcNum
}
}).then(res => {
this.processStep = window.URL.createObjectURL(res.data)
})
},
//折叠/展开基础信息方法
foldForm() {
this.foldFormFlag = !this.foldFormFlag
},
itermsConditionsClose () {
this.itermsConditionsFlag = false
},
itermsConditionsOpen (row) {
this.itermsConditionsFlag = true
this.itermsConditionsTitle = row.replace(/''/g, '\'')
},
getHistoryData () {
this.$http.get('lawss/activiti/get_list_by_instance', {
prcNum: this.$route.query.prcNum,
}, {}, res => {
this.histortData = res
}, e => {})
},
choiceZRRS (row, type, index) {
this.type = type
if (type === 1) {
this.drawerTitle = '选择责任人'
this.nodeList2 = []
this.zxIndex = index
this.nodeList2.push(row)
this.modalshowflag2 = true
} else {
// 批量
this.drawerTitle = '批量选择责任人'
if (this.zxIdList.length > 0) {
this.nodeList2 = []
this.modalshowflag2 = true
} else {
this.$message.warning('请选择要编辑的数据')
}
}
},
saveUserInfo (data) {
if (this.type === 1) {
this.itemList[this.zxIndex].zxUserId = data[0].id
this.itemList[this.zxIndex].zxUserIdName = data[0].name
let row = JSON.parse(JSON.stringify(this.itemList[this.zxIndex]))
row.zxUserId = data[0].id
row.zxUserIdName = data[0].name
this.$set(this.itemList, this.zxIndex, row)
} else {
for (let a = 0; a < this.itemList.length; a++) {
for (let b = 0; b < this.zxIdList.length; b++) {
if (this.itemList[a].id === this.zxIdList[b]) {
this.itemList[a].zxUserId = data[0].id
this.itemList[a].zxUserIdName = data[0].name
let row = JSON.parse(JSON.stringify(this.itemList[a]))
row.zxUserId = data[0].id
row.zxUserIdName = data[0].name
this.$set(this.itemList, a, row)
}
}
}
}
this.modalshowflag = false
this.$refs.filterTable.clearSelection()
},
handleTabs(name) {
this.active = name
},
handleSave() {
this.saveLoading = true
this.isSubmit = true
let _formData = new FormData()
_formData.append('taskIds', this.taskIds)
_formData.append('json', JSON.stringify({
form: this.form,
roleForm: this.roleForm,
commentText2: this.commentText2,
itemList: this.itemList,
standInData: this.sarType
}))
saveTaskForPub(_formData).then(res => {
this.$message.success('保存成功')
}).finally(() => {
this.saveLoading = false
this.isSubmit = false
})
},
handleSubmit() {
this.$refs['bzzqyjForm'].validate((valid) => {
if (valid) {
let b = 0
for (let a = 0; a < this.itemList.length; a++) {
if (!this.itemList[a].zxUserId) {
b++
}
}
if (b > 0) {
this.$message.warning('请选择执行人')
} else {
this.isSubmit = true
this.saveLoading = true
var json = this.json
json.itemList = this.itemList
json.commentText = this.commentText2
this.$http.post('lawss/activiti/completeTask', {
json: JSON.stringify(json),
taskId: this.taskIds,
userId: this.$store.getters.userInfo.userId
}, {}, res => {
if (res.success) {
this.$message.success('提交成功')
this.$router.push('/processCenter')
}
this.isSubmit = false
this.saveLoading = false
})
}
} else {
return this.$message.warning('请完善基础信息')
}
})
},
handleSelectionChange (val){
this.zxIdList = []
val.forEach( item => {
this.zxIdList.push(item.id)
})
},
getData() {
return new Promise((resolve, reject) => {
inboundLiaisonDetail({
taskIds: this.taskIds,
pId: this.pId
}).then(res => {
let data = JSON.parse(res.mesg)
console.log(data);
this.form.itemsNum = data.itemsNum || data.form.itemsNum
this.form.deptUserId = data.form ? data.form.deptUserId : data.deptUserId
this.form.deptUserIdName = data.form ? data.form.deptUserIdName : data.deptUserIdName
this.form.itemsName = data.itemsName || data.form.itemsName
this.commentText2 = data.commentText2 || ''
this.form.endTime = data.endTime || data.form.endTime
if (data.form) {
this.form.itemsName1 = data.form.itemsName1 || ''
this.form.itemsNum1 = data.form.itemsNum1 || ''
} else {
this.form.itemsName1 = data.itemsName1 || ''
this.form.itemsNum1 = data.itemsNum1 || ''
}
this.sarType = data.standInData || data.sarType
this.json = data
let arr = []
if (typeof(data.itemList) === 'string') {
arr = JSON.parse(data.itemList)
} else {
arr = data.itemList
}
arr.forEach(item => {
item.zxUserId = item.zxUserId || ''
item.zxUserIdName = item.zxUserIdName || ''
})
this.itemList = arr
this.loading = false
}).catch(e => {
})
})
},
},
mounted () {
window.addEventListener('resize', this.handleResize);
this.getHistoryData()
this.getData()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.bzjdStep2 {
.itemsTextBox {
min-height: 300px;
max-height: 500px;
overflow: auto;
line-height: 20px;
/deep/ td {
border: 1px solid #606266;
text-align: center;
}
}
/deep/.el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
.fileClass {
cursor: pointer;
}
.fileClass:hover{
color: #0c91e5;
}
.file-box-span{
color: #4498f0;
cursor: pointer;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
position: relative;
height: 100%;
.headerTabs {
height: 52px;
display: flex;
align-items: center;
position: absolute;
top: 0;
right: 10px;
.headerTabsItem {
border: 1px solid #c1c1c1;
padding: 0 5px;
height: 30px;
line-height: 30px;
cursor: pointer;
}
.active {
border: 1px solid #E6A23C;
color: #fff;
background: #E6A23C;
}
}
.content {
display: flex;
flex-direction: column;
justify-content: space-between;
height: calc(~'100% - 103px');
overflow: auto;
.tableTitle {
margin-bottom: 10px;
height: 30px;
line-height: 30px;
position: relative;
font-size: 13px;
font-weight: bold;
.tableButton {
position: absolute;
right: 0;
top: 0;
}
}
}
}
</style>