Files
foton-laws-system-front/src/pages/processCenter/pages/phone/wbsm/step5.vue
T

473 lines
13 KiB
Vue

<template>
<div class="phoneWbsmStep5 phoneBox">
<ProcessHeaderPhone toggle>
<template slot="proName">外部署名推荐审批流程</template>
<template slot="proNode">工程研究总院院长/FU/BU/SBU领导审批</template>
</ProcessHeaderPhone>
<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="flex: auto;">
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<el-table
:data="dataList"
border
ref="entryTable"
height="90%"
style="width: 100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}">
<el-table-column
prop="code"
min-width="180"
align="center"
label="标准号">
<template slot-scope="scope">
<a v-if="scope.row.standYear" class="table-jump"
@click="handlePreview(scope.row)">{{ scope.row.standSortShow }} {{
scope.row.standNumber
}}-{{ scope.row.standYear }}</a>
<a v-else @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standSortShow }}
{{ scope.row.standNumber }}</a>
</template>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
min-width="300"
align="center"
>
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column prop="standSortShow" label="标准类别" min-width="150" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<a>{{ scope.row.standSortShow }}</a>
</template>
</el-table-column>
<el-table-column prop="workPeople" min-width="300" label="推荐署名人及单位" align="center">
</el-table-column>
<el-table-column prop="reason" min-width="300" label="推荐署名原因" align="center">
</el-table-column>
<el-table-column prop="expenses" min-width="150" label="费用" align="center">
</el-table-column>
</el-table>
</div>
<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'">
<Phone-histort-table :prc-num="$route.query.prcNum"></Phone-histort-table>
</div>
<ProcessFooter
show-transfer
show-back
show-submit
:submitLoading="isSubmit"
:isSubmitBack="isSubmit"
:saveLoading="isSubmit"
:approval="true"
@transfer="handleTransfer"
@back="beforeBack"
@submit="handleSubmit"
>
</ProcessFooter>
<phone-role
:role-title="drawerTitle"
:result-list="phoneRoleList"
:is-show-phone.sync="phoneshowflag"
@checkedRole="drawerCheck"
/>
</div>
</template>
<script>
import { Dialog } from 'vant';
import ProcessHeaderPhone from '../../components/ProcessHeaderPhone'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { inboundLiaisonDetail, processCreateStand, changeAssigneeNew, execTask, saveTaskForPub } from 'api/process';
import axios from 'axios';
import ProcessHeader from 'process/components/ProcessHeader';
import hwh5 from '@/api/hwh5-cloudonline.js'
export default {
name: 'phoneWbsmStep5',
components: {
ProcessTitle,
ProcessHeader,
ProcessHeaderPhone,
ProcessFooter
},
data() {
return {
phoneshowflag: false,
phoneRoleList: [],
phoneDrawerTitle: '',
passInfo: 0,
detailData: [],
loading: false,
commentText: '', // 意见
title: '', // 新增编辑抽屉标题
isTransfer: false,
ListModel: false, // 新增编辑抽屉开关
taskIds: this.$route.query.taskIds,
pId: this.$route.query.prcId,
userId: this.$route.query.taskAssignee,
nonSearch: {
standSerialNumber: '',
standId: '', // 标准号/名称
productName: '', // 项目名称
responsibleUnit: '' // 责任部门
},
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
turnLoading: false,
drawerModal: false,
dataList: [],
endDataList: [],
lastDataList: [],
// 新增选择分发责任人数组
multipleSelection: [],
// 当前页数
pageNo: 1,
total: 0,
myLoading: false,
// 责任部门
zNodesSItem: [],
clearSelection: false,
nodeList: [],
drawerTitle: '', //drawer标题
modalshowflag: false, // drawer开关
roleForm: {
dutyUserInfo: [],
dutyUserInfoName: [],
dutyPeopleInfo: '',
dutyPeople: ''
},
rowDutyPeople: {},
props: { label: 'name', children: 'children', value: 'id', multiple: true, disabled: false },
dutyUserCaseData: [],
roleFormRules: {},
treeData: [], // 人员数据
defaultProps: {
children: 'children',
label: 'name'
},
}
},
created() {
this.processTable();
this.getData();
},
computed: {
listNoDataText() {
return this.processType === 1 ? '暂无待办流程' : '暂无已办流程';
}
},
watch: {
nonSearch(val) {
this.nonSearch = val
}
},
methods: {
//确认转办
checkedTransferRole (data) {
this.assigneeNewLoading = true
changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id
assignee: data[0].id, // 被委托人
userId: this.$store.getters.userInfo.account, // 委托人
pId: this.$route.query.prcId // 流程实例
}).then(res => {
this.isTransfer = false
if (res.success) {
this.drawerModal = false
this.$message.success('调整成功')
// hwh5.close()
// this.$router.go(-2)
this.$close()
// this.$router.push("/processCenter");
// this.processNum()
} else {
this.$message.warning(res.message)
}
})
},
processTable() {
this.$http.get('lawss/activiti/get_list_by_instance', {
prcNum: this.$route.query.prcNum,
sortWord: this.shunxu ? this.paixu : '',
shunxu: this.shunxu
}, {
loading: 'loading',
_this: this
}, res => {
this.detailData = res
}, e => {
})
},
getData() {
return new Promise((resolve, reject) => {
inboundLiaisonDetail({
taskIds: this.$route.query.taskIds,
pId: this.$route.query.prcId
}).then(res => {
if (res) {
const processForm = JSON.parse(res.mesg);
this.getFormFieldList(processForm);
}
}).catch(e => {
});
});
},
/**
* @description: 动态表单读取
*/
getFormFieldList(item) {
console.log(item);
this.$nextTick(() => {
this.dataList = item.dataList
this.roleForm = item.roleForm
});
},
// 批量选择分发责任人
dutyEngineerList(id) {
if (this.multipleSelection.length === 0) {
this.$message.warning('请选择至少一条数据进行分发责任人');
} else {
this.nodeList = []
this.nodeList.push(id)
this.modalshowflag = true
}
},
// 每行选择负责人点击操作
clickOpen(val, id) {
this.$refs.multipleTable.clearSelection()
this.rowDutyPeople = val
this.nodeList = []
this.nodeList.push(id)
this.modalshowflag = true
},
// 选择勾选项的集合
handleSelectionChange(value) {
this.multipleSelection = value
},
handleTabs(name) {
this.active = name
},
// 转办按钮
handleTurnTo() {
this.modalshowflag = true
this.drawerTitle = '转办处理人'
},
// 保存按钮
handleSave() {
this.isSubmit = true
const _formData = new FormData()
_formData.append('taskIds', this.taskIds)
_formData.append('json', JSON.stringify({
// roleForm: this.roleForm,
standardInfoList: this.dataList,
commentText: this.commentText
}))
saveTaskForPub(_formData).then(res => {
this.$message.success('保存成功')
this.bpnId = res.result
}).finally(() => {
this.isSubmit = false
})
},
// 提交按钮
handleSubmit() {
this.isSubmit = true
const son = {
yzFlag: '1',
commentText: this.commentText,
dataList: this.dataList,
roleForm: this.roleForm
}
const json = JSON.stringify(son)
this.$http.post('lawss/activiti/completeTask', {
taskIds: this.taskIds,
userId: this.userId,
json: json
}, {
_this: this
}, res => {
if (res.success) {
this.$message.success(res.message);
// hwh5.close()
// this.$router.go(-2)
this.$close()
// this.$router.push("/processCenter");
}
this.isSubmit = false
}, e => {
});
},
//驳回按钮
beforeBack(){
if(!this.commentText){
this.$message.warning('请填写审批意见')
}else{
const son = {
yzFlag: '2',
commentText: this.commentText,
dataList: this.dataList,
roleForm: this.roleForm
}
const json = JSON.stringify(son)
this.isSubmit = true
this.$http.post('lawss/activiti/completeTask', {
taskIds: this.taskIds,
userId: this.userId,
json: json
}, {
_this: this
}, res => {
if (res.success) {
this.$message.success(res.message);
// hwh5.close()
// this.$router.go(-2)
this.$close()
// this.$router.push("/processCenter");
}
this.isSubmit = false
}, e => {
});
}
},
//转办按钮
handleTransfer(){
this.phoneshowflag = true
this.phoneRoleList = this.roleTransfer
this.phoneDrawerTitle = '转办处理人'
},
//确认转办
drawerCheck (data) {
this.roleTransfer = data
this.phoneRoleList = this.roleTransfer
this.turnLoading = true
this.isSubmit = true
changeAssigneeNew({
taskId: this.$route.query.taskIds, // 任务id
assignee: data[0].id, // 被委托人
userId: this.$store.getters.userInfo.account, // 委托人
pId: this.$route.query.prcId // 流程实例
}).then(res =>{
if (res.success) {
this.turnLoading = false
this.$message.success('调整成功')
// hwh5.close()
// this.$router.go(-2)
this.$close()
// this.$router.push("/processCenter")
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.isSubmit = false
})
this.modalshowflag = false
},
// 流程阶段负责人选择
choiceZRR (type, title, id) {
this.nodeList = []
this.nodeList.push(id)
this.type = type
this.drawerTitle = title
this.modalshowflag = true
},
// 点击查看
handlePreview (item) {
const routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.standId,
// pageType: 'FOREIGN_STAND'
pageType: item.standType + '_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 清空 查询条件
clearAllSearch () {
this.nonSearch = {
standId: '',
standSerialNumber: '',
productName: '',
responsibleUnit: ''
}
this.getData()
},
// 分页事件
pageChange (page) {
this.pageNo = page
this.getTableByPage()
},
pageSizeChange () {
this.getTableByPage()
},
}
};
</script>
<style lang="less" scoped>
@import '~@/assets/styles/phone';
.phoneWbsmStep5 {
/deep/.van-dialog__content {
min-height: 300px;
padding: 10px;
}
.prc-content-border {
overflow: auto;
}
/deep/.prc-content-border .el-form-item__content {
width: 270px;
}
.content {
border-top: 1px solid #DCDFE6;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-top: 52px;
//height: calc(~'100% - 155px');
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>