Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/bzjd/step2.vue
T
2021-07-22 13:59:21 +08:00

486 lines
20 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>
<div class="prc-content-border">
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="标准编号" prop="cid" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.number"
placeholder="请输入标准编号"
clearable
></el-input>
</el-form-item>
<el-form-item label="标准名称" prop="cname" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="form.name"
placeholder="请输入标准名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="上一版本标准号/政策号" class="add-form-item form-item-disabled" v-if="sarType === 'INLAND'">
<el-input
disabled
v-model="form.number1"
clearable
></el-input>
</el-form-item>
<el-form-item label="相对标准号/政策号" class="add-form-item form-item-disabled" v-if="sarType === 'FOREIGN'">
<el-input
disabled
v-model="form.number1"
clearable
></el-input>
</el-form-item>
<el-form-item label="上一版本标准名称/政策名称" class="add-form-item form-item-disabled" v-if="sarType === 'INLAND'">
<el-input
disabled
v-model="form.name1"
clearable
></el-input>
</el-form-item>
<el-form-item label="相对标准名称/政策名称" class="add-form-item form-item-disabled" v-if="sarType === 'FOREIGN'">
<el-input
disabled
v-model="form.name1"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
</div>
<ProcessTitle>
<template slot="title">拆分信息</template>
</ProcessTitle>
<div class="action-bar">
<el-button type="primary" class="common-button-primary add-button" size="mini" @click="choiceZRRS('', 2, '')">批量编辑</el-button>
</div>
<el-table border
ref="selection"
: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
prop="itemsNum"
label="条款号"
width="170"
align="center">
</el-table-column>
<el-table-column
prop="itemsName"
label="条款名称"
width="170"
align="center">
</el-table-column>
<el-table-column
prop="itermsConditions"
label="条款内容"
show-overflow-tooltip
align="center">
</el-table-column>
<el-table-column
label="责任人"
width="170"
prop="zrUserIdName"
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>
<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="commentText">
</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
prop="name"
label="任务步骤"
align="center"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="assignee"
label="任务受理人"
align="center"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
sortable="custom"
align="center">
<template slot-scope="scope">
<span>{{ scope.row.createTime ? $moment(scope.row.createTime).format('YYYY-MM-DD') : '' }}</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') : '' }}</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"
@save="handleSave"
@submit="handleSubmit"
>
</ProcessFooter>
<el-drawer
title="选择责任部门对接人"
:visible.sync="modalshowflag2"
:wrapperClosable="false"
size="800px">
<el-tree
v-if="modalshowflag2"
node-key="id"
style="height: 100%; overflow: auto;"
class="filter-tree"
:data="treeData"
:props="defaultProps"
:default-checked-keys="nodeList2"
highlight-current
check-strictly
@check="drawerCheck2"
default-expand-all
:expand-on-click-node="false"
show-checkbox
ref="tree2">
</el-tree>
<div id="roleFormButton2" class="demo-drawer-footer">
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="saveUserInfo2">确定</el-button>
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="cancleUserInfo2">取消</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import {inboundLiaisonDetail,processCreateStand} from 'api/process'
export default {
name: "bzjdStep2",
data() {
return {
histortData: [],
sarType: '',
zxIndex: '',
zxType: '',
zxIdList: [],
modalshowflag2: false,
treeData: [],
nodeList2: [],
defaultProps: {
children: 'children',
label: 'name'
},
loading: false,
commentText: '',
taskIds: this.$route.query.taskIds,
pId: this.$route.query.prcId,
roleRow: {},
type: '',
drawerTitle: '', //drawer标题
textarea: '', // 意见
ListModel: false, // 新增编辑抽屉开关
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
form: {
number: '',
name: '',
},
json: {},
itemList: []
}
},
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
methods: {
getHistoryData () {
this.$http.get('lawss/activiti/get_list_by_instance', {
prcNum: this.$route.query.prcNum,
}, {}, res => {
this.histortData = res
}, e => {})
},
drawerCheck2 (data) {
var getlist = this.$refs.tree2.getCheckedNodes().concat(this.$refs.tree2.getHalfCheckedNodes());
if(getlist.length == 1) {
this.roleRow = getlist[0]
}else {
this.$refs.tree2.setCheckedKeys([data.id]);
this.roleRow = this.$refs.tree2.getCheckedNodes()[0]
}
},
choiceZRRS (row, type, index) {
if (type === 1) {
this.nodeList2 = []
this.zxIndex= index
this.zxType = type
this.nodeList2.push(row)
this.modalshowflag2 = true
} else {
// 批量
if (this.zxIdList.length > 0) {
this.zxType = type
this.nodeList2 = []
this.modalshowflag2 = true
} else {
this.$message.warning('请选择要编辑的数据')
}
}
},
saveUserInfo2 () {
var idList = ''
var nameList = ''
this.$refs.tree2.getCheckedNodes().concat(this.$refs.tree2.getHalfCheckedNodes()).forEach( item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
if (this.zxType == 1) {
this.itemList[this.zxIndex].zxUserId = idList
this.itemList[this.zxIndex].zxUserIdName = nameList
} else {
this.itemList.forEach( item => {
this.zxIdList.forEach( items => {
if (item.id === items) {
item.zxUserId = idList
item.zxUserIdName = nameList
}
})
})
}
this.modalshowflag2 = false
},
cancleUserInfo2 () {
this.modalshowflag2 = false
},
getTree () {
this.$http.get('SarInstitution/institution/institutionAndUser', {}, {}, res=> {
this.treeData = res.data
})
},
handleTabs(name) {
this.active = name
},
handleSave() {},
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('请选择执行人')
}
var json = this.json
json.itemList = this.itemList
json.commentText = this.commentText
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')
}
})
} 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)
this.form.number = data.number
this.form.name = data.name
this.form.number1 = data.number1
this.form.name1 = data.name1
this.sarType = data.standInData
this.json = data
var arr = []
arr = JSON.parse(data.itemList)
arr.forEach(item => {
item.zxUserId = ''
item.zxUserIdName = ''
})
this.itemList = arr
}).catch(e => {
})
})
},
},
mounted () {
this.getHistoryData()
this.getTree()
this.getData()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.bzjdStep2 {
/deep/.el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
.fileClass {
cursor: pointer;
}
.fileClass:hover{
color: #0c91e5;
}
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>