Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/wbsm/step1.vue
T

864 lines
30 KiB
Vue

<!--外部署名推荐审批流程-->
<template>
<div class="wbsmStep1">
<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="flex: auto; overflow: auto;">
<ProcessTitle>
<template slot="title">基础信息</template>
</ProcessTitle>
<div class="tableTitle">
<div class="tableButton">
<el-button :disabled="disabledXX" plain class="common-button-primary" size="mini" @click="addList">添加</el-button>
<el-button :disabled="disabledXX" plain class="common-button-primary" size="mini" @click="deleteList">批量删除</el-button>
</div>
</div>
<el-table
:data="dataList"
border
ref="entryTable"
height="90%"
@selection-change="selectedDelete"
style="width: 100%"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column
prop="code"
width="180px"
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="标准名称"
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="标准类别" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<a>{{ scope.row.standSortShow }}</a>
</template>
</el-table-column>
<el-table-column prop="workPeople" label="推荐署名人及单位" align="center">
<template slot-scope="scope">
<el-input :disabled="disabledXX" v-model="scope.row.workPeopleId" style="display: none;" clearable readonly/>
<el-tooltip v-if="scope.row.workPeople" class="item" :content="scope.row.workPeople" placement="top">
<el-input :disabled="disabledXX" v-model="scope.row.workPeople" clearable placeholder="请选择推荐署名人及单位"
@click.native="choiceZRRS(scope.row, scope.$index)" readonly/>
</el-tooltip>
<el-input :disabled="disabledXX" v-else v-model="scope.row.workPeople" clearable placeholder="请选择推荐署名人及单位"
@click.native="choiceZRRS(scope.row, scope.$index)" readonly/>
</template>
</el-table-column>
<el-table-column prop="reason" label="推荐署名原因" align="center">
<template slot-scope="scope">
<el-input :disabled="disabledXX"
v-model="scope.row.reason"
placeholder="请填写推荐署名原因"
></el-input>
</template>
</el-table-column>
<el-table-column prop="expenses" label="费用" align="center">
<template slot-scope="scope">
<el-input :disabled="disabledXX"
v-model="scope.row.expenses"
placeholder="请填写费用"
></el-input>
</template>
</el-table-column>
</el-table>
</div>
<el-collapse accordion>
<el-collapse-item title="回执说明">
<div style="margin: 10px 0;">
<el-input :disabled="disabledXX"
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'">
<div class="block" style="padding-top: 20px;">
<el-timeline>
<el-form
ref="Form"
:model="roleForm"
:rules="roleFormRules"
class="label-input-form">
<el-timeline-item timestamp="发起流程" placement="top" :color="roleForm.startUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="startUserName" style="margin-bottom: 0">
<h4>标准法规工程师</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input :disabled="disabledXX" v-model="roleForm.prcCreateUser" style="display: none;"></el-input>
<el-input :disabled="disabledXX" v-model="roleForm.prcCreateUserName" placeholder="流程发起人"
disabled></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择署名人领导,填写意见" placement="top"
:color="roleForm.dockUser ? '#66b1ff' : ''" >
<el-card>
<el-form-item prop="dockUserName" style="margin-bottom: 0">
<h4>署名人领导</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input :disabled="disabledXX" v-model="roleForm.dockUser" style="display: none;"></el-input>
<el-input :disabled="disabledXX" v-model="roleForm.dockUserName" readonly placeholder="选择署名人领导"
@click.native="choiceZRR('dockUser', '选择署名人领导', roleForm.dockUser)">
</el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="标准法规部部长审批" placement="top"
:color="roleForm.ministerUser ? '#66b1ff' : ''" >
<el-card>
<el-form-item prop="ministerUserName" style="margin-bottom: 0">
<h4>标准法规部部长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input :disabled="disabledXX" v-model="roleForm.ministerUser" style="display: none;"></el-input>
<el-input :disabled="disabledXX" v-model="roleForm.ministerUserName" readonly placeholder="选择标准法规部部长"
@click.native="choiceZRR('ministerUser', '选择标准法规部部长', roleForm.ministerUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="技术管理中心主任审批" placement="top"
:color="roleForm.directorUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="directorUserName" style="margin-bottom: 0">
<h4>技术管理中心主任</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input :disabled="disabledXX" v-model="roleForm.directorUser" style="display: none;"></el-input>
<el-input :disabled="disabledXX" v-model="roleForm.directorUserName" readonly placeholder="选择技术管理中心主任"
@click.native="choiceZRR('directorUser', '选择技术管理中心主任', roleForm.directorUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="工程研究总院院长" placement="top"
:color="roleForm.directorUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="presidentName" style="margin-bottom: 0">
<h4>工程研究总院院长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input :disabled="disabledXX" v-model="roleForm.president" style="display: none;"></el-input>
<el-input :disabled="disabledXX" v-model="roleForm.presidentName" readonly placeholder="选择工程研究总院院长"
@click.native="choiceZRR('president', '工程研究总院院长', roleForm.president)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
</el-form>
</el-timeline>
</div>
</div>
<!-- 添加标准抽屉-->
<el-drawer
title="添加标准"
:visible.sync="standModel"
size="900px"
custom-class="demo-drawer"
>
<div class="demo-drawer-content">
<div style="position: absolute;bottom: 48px;top:60px;left: 0;right: 0">
<div style="position: absolute;bottom: 55px;top: 0;right: 0;left: 0">
<div class="left">
<el-form :modal="standardSearch" :inline="true" class="label-input-form"
style="margin-left:10px">
<el-form-item label="类型" class="search-item search-item-last">
<el-select :disabled="disabledXX"
@change="typeChange"
v-model="standardSearch.standType"
placeholder="请选择"
filterable
>
<el-option
v-for="item in standardTypeOptions"
:value="item.value"
:key="item.value"
:label="item.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="标准号/标准名称" class="search-item search-item-last">
<el-input :disabled="disabledXX"
v-model="standardSearch.standNumber"
placeholder="请输入标准号或标准名称"
></el-input>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button :disabled="disabledXX"
type="primary"
class="common-button-primary"
size="small"
v-btn-permission="''"
@click="getStandDataBtn">
查询
</el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button :disabled="disabledXX"
class="common-button-default"
size="small"
v-btn-permission="''"
@click="clearStandSearch">清空
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="standardData"
tooltip-effect="dark"
style="width: 100%"
border
ref="table"
height="90%"
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectThree"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="code"
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"
align="center"
label="标准名称"
>
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
align="center"
label="发布日期">
<template slot-scope="scope">
<span>{{ scope.row.issueTime ? $moment(scope.row.issueTime).format("YYYY-MM-DD") : "" }}</span>
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQ"
align="center"
label="新车型实施日期">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="ZCCSSRQ"
align="center"
label="在产车实施日期">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="textStatus"
align="center"
label="文本状态">
<template slot-scope="scope">
<span>{{ textStatusMap[scope.row.textStatus] }}</span>
</template>
</el-table-column>
</el-table>
</div>
<pagination
:page="pageNo"
:pageSize="pageSizeNo"
:total="totalNo"
@pageChange="pageChangeNo"
@pageSizeChange="pageSizeChangeNo"
/>
</div>
</div>
<div class="demo-drawer-footer">
<el-button :disabled="disabledXX" size="mini" @click="cancelStand">取消</el-button>
<el-button :disabled="disabledXX" type="primary" size="mini" @click="okStand">添加</el-button>
</div>
</el-drawer>
<ProcessFooter v-show="!disabledXX"
show-save
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
>
</ProcessFooter>
<Role-tree
check-box
:is-title="drawerTitle"
:is-visible.sync="modalshowflag"
@checkedRole="checkedRole"
:nodeList="nodeList"
></Role-tree>
<!-- 多选责任人-->
<Role-tree
is-title="选择署名人"
:is-visible.sync="modalshowflag2"
@checkedRole="checkedRole2"
:nodeList="nodeList2"
></Role-tree>
</div>
</template>
<script>
import ProcessHeader from '../../components/ProcessHeader'
import ProcessFooter from '../../components/ProcessFooter'
import ProcessTitle from '../../components/ProcessTitle'
import { startProcess, completeTask, saveTaskFirst, queryTaskFirst, inboundLiaisonDetail,taskDel } from "@/api/process.js";
export default {
name: "wbsmStep1",
data() {
return {
disabledXX:!!this.$route.query.disabledXX,
bpnId: '',
commentText: '', // 意见
active: '1', // 默认显示
isSubmit: false,
saveLoading: false,
dataList: [],
taskID: '',
deleteDataList: [],
drawerTitle: "", //drawer标题
modalshowflag: false, // 选择人员drawer开关
modalshowflag2: false,
standModel: false, //添加标准抽屉
zrIndex: "",
nodeList: [], //存放人员信息数组
nodeList2: [],
standOptions: [], //标准类别
standardData:[],
pageNo: 1,
totalNo: 0,
pageSizeNo: this.$store.getters.userInfo.configContent,
standardTypeOptions: [
{
value: "INLAND",
label: "国内标准法规",
item: "INLAND"
},
{
value: "FOREIGN",
label: "国外标准法规",
item: "FOREIGN"
}
],
textStatusMap: {},// 文本状态id与name对应
standList:[],
//查询添加标准相关数据
standardSearch: {
standType: "",
standNumber: "",
pageNo: 1,
pageSizeNo: this.$store.getters.userInfo.configContent
},
roleForm: {
prcCreateUserName: this.$store.getters.userInfo.userName,
prcCreateUser: this.$store.getters.userInfo.userId,
passUserName: this.$store.getters.userInfo.userName,
passUser: this.$store.getters.userInfo.userId,
dockUser: "",
ministerUser: "" ,
directorUser: "",
president: "",
dockUserName: "",
ministerUserName: "" ,
directorUserName: "",
presidentName: '',
},
//必填人员校验规则
roleFormRules: {
dockUserName: [
{required: true, message: "请选择署名人领导", trigger: "change"}
],
ministerUserName: [
{required: true, message: "请选择标准法规部部长", trigger: "change"}
],
directorUserName: [
{required: true, message: "请选择技术管理中心主任", trigger: "change"}
],
presidentName: [
{required: true, message: "请选择工程研究总院院长", trigger: "change"}
]
},
}
},
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
mounted() {
this.bpnId = this.$route.query.bpnId
if (this.bpnId !== undefined) {
this.getDatas()
}
this.getStandData()
this.getData()
//从数据库中查询下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '',{
_this:this
},res =>{
this.standOptions = res.data.STANDCLASSIFY
this.standStateOptions = res.data.WBZTCLASS; // 文本状态
this.setMap(this.standStateOptions);
}, e => {
})
},
methods: {
getDatas(){
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes)
this.roleForm = mes.roleForm
this.dataList = mes.dataList
this.commentText = mes.commentText
});
},
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
});
},
//点击新增事件
addList() {
this.standModel = true
},
// 批量删除按钮table,选择数据
selectedDelete(data) {
this.deleteDataList = data
// this.deleteDataList = []
// for (let i = 0; i < val.length; i++) {
// this.deleteDataList.push(val[i].id);
// }
},
// 点击批量删除事件
deleteList() {
if(this.deleteDataList.length < 1){
this.$message.warning('请选择需要删除的数据')
}else{
this.$confirm('您确认删除这些数据?', '提示', {
confirmButtonText: "确认",
confirmButtonClass: "common-button-primary",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
let exits = [];
this.deleteDataList.map(item => {
let index;
index = this.dataList.findIndex(items => {
return items.id === item.id;
});
if (index > -1) {
this.dataList.splice(index, 1);
}
exits.push(item);
});
this.deleteDataList = [];
}).catch(() => {
});
}
},
// 将文本状态的id与name对应
setMap(data) {
data.forEach(item => {
this.$set(this.textStatusMap, item.value, item.label);
});
},
// // 点击查看
// handlePreview (item) {
// let routeUrl = this.$router.resolve({
// name: 'OtherStandardDetails',
// params: {
// id: item.standId,
// pageType: item.standType + '_STAND'
// }
// })
// window.open(routeUrl.href, '_blank')
// },
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: "OtherStandardDetails",
params: {
id: item.id,
pageType: "INLAND_STAND"
}
});
window.open(routeUrl.href, "_blank");
},
handleTabs(name) {
this.active = name
},
//添加标准select的改变
selectThree(data) {
this.standList = data;
},
choiceZRRS(row, index) {
this.nodeList2 = [];
this.zrIndex = index;
if(row.workPeopleId){
this.nodeList2 = row.workPeopleId.split(",");
}else{
this.nodeList2.push(row);
}
this.modalshowflag2 = true;
},
typeChange(type) {
this.standardSearch.standType = type;
},
//添加标准取消事件
cancelStand() {
this.standModel = false;
},
//添加标准确定事件
okStand() {
this.getStandData()
if(this.standList.length < 1){
this.$message.warning('请选择需要添加的数据')
}else{
let exits = [];
this.standList.map(item => {
let newStand = false;
for (let itemKey of this.dataList) {
if (item.id == itemKey.id) {
newStand = true;
break;
}
}
if (newStand) {
this.$message.warning("请勿重复添加数据");
} else {
this.$set(item, "workPeople", '');
this.$set(item, "reason", '');
this.$set(item, "expenses", '');
this.dataList.push(item);
exits.push(item.id);
}
});
this.standardData = [];
this.standModel = false;
}
},
pageChangeNo(page) {
this.pageNo = page;
this.getStandData();
},
pageSizeChangeNo(pageSize) {
this.pageSizeNo = this.$store.getters.userInfo.configContent;
this.getStandData();
},
clearStandSearch() {
this.standardSearch = {
standType: "",
standNumber: ""
};
this.getStandData();
},
getStandDataBtn(){
this.pageNo =1;
this.getStandData();
},
//查询项目下的标准
getStandData() {
this.$http.get("sarStandardsInfo/sar-standards-info/getSarStandardsInfoPageByWk1", {
standType: this.standardSearch.standType,
standNumber: this.standardSearch.standNumber,
page: this.pageNo,
pageSize: this.pageSizeNo
}, {
_this: this
}, res => {
this.standardData = res.data.list;
this.standardData.forEach(item => {
this.$set(item, "ZCCSSRQ", item.zccssrq);
this.$set(item, "XCXSSRQ", item.xcxssrq);
})
this.totalNo = res.data.count;
}, e => {
});
},
// 保存按钮
handleSave() {
this.saveLoading = true
let _formData = new FormData()
_formData.append('id', this.bpnId || '')
_formData.append('createUser', this.$store.getters.userInfo.userId)
_formData.append('createUserName', this.$store.getters.userInfo.userName)
_formData.append('prcType', '16')
_formData.append('json', JSON.stringify({
roleForm: this.roleForm,
dataList: this.dataList,
commentText: this.commentText
}))
saveTaskFirst(_formData).then(res => {
this.saveLoading = false
this.$message.success('保存成功')
this.bpnId = res.result
}).catch(e => {
this.saveLoading = false
})
},
// 提交按钮
handleSubmit() {
if(this.$route.query.prcNum === undefined){
if (this.dataList.length < 1) {
this.$message.warning("标准不能为空");
} else {
this.dataList.forEach(item => {
if( item.workPeople === ''){
this.$message.warning('请选择推荐署名人及单位')
}
})
let json = {
commentText: this.commentText,
roleForm: this.roleForm,
dataList: this.dataList,
}
this.$refs["Form"].validate((valid) => {
if (valid) {
this.isSubmit = true
this.$http.post("lawss/activiti/startProcessRollBack", {
createUser: this.$store.getters.userInfo.userId,
createUserName: this.$store.getters.userInfo.userName,
type: '16',
json: JSON.stringify({
roleForm: this.roleForm,
dataList: this.dataList,
commentText: this.commentText
})
}, {
_this: this
}, res => {
if (res.ok) {
this.$http.post("lawss/activiti/completeTask", {
taskIds: res.data,
userId: this.$store.getters.userInfo.userId,
json: JSON.stringify(json)
}, {
_this: this
}, res => {
if (res.success) {
this.$message.success(res.message);
if (this.bpnId !== '') {
let taskId = {
id: this.bpnId
}
taskDel(taskId).then(res=>{
return res
})
}
this.$router.push("/processCenter");
}
this.isSubmit = false
});
}
});
} else {
return this.$message.warning("请完善人员信息");
}
});
}
}else{
if (this.dataList.length < 1) {
this.$message.warning("标准不能为空");
} else {
this.dataList.forEach(item => {
if( item.workPeople === ''){
this.$message.warning('请选择推荐署名人及单位')
}
})
let json = {
commentText: this.commentText,
roleForm: this.roleForm,
dataList: this.dataList,
}
this.$refs["Form"].validate((valid) => {
if (valid) {
this.isSubmit = true
this.$http.post("lawss/activiti/completeTask", {
taskIds: this.$route.query.taskIds,
userId: this.$store.getters.userInfo.userId,
json: JSON.stringify(json)
}, {
_this: this
}, res => {
if (res.success) {
this.$message.success(res.message);
this.$router.push("/processCenter");
}
this.isSubmit = false
});
} else {
return this.$message.warning("请完善人员信息");
}
});
}
}
},
// 流程阶段负责人选择
choiceZRR(type, title, id) {
this.nodeList = [];
this.nodeList.push(id);
this.type = type;
this.drawerTitle = title;
this.modalshowflag = true;
},
checkedRole (data) {
if (this.type === "dockUser") {
this.roleForm.dockUser = data[0].id;
this.roleForm.dockUserName = data[0].name;
} else if (this.type === "directorUser") {
this.roleForm.directorUser = data[0].id;
this.roleForm.directorUserName = data[0].name;
}else if(this.type === 'ministerUser'){
this.roleForm.ministerUser = data[0].id;
this.roleForm.ministerUserName = data[0].name;
}else if(this.type === 'president'){
this.roleForm.president = data[0].id;
this.roleForm.presidentName = data[0].name;
}
this.modalshowflag = false;
},
checkedRole2(data){
let idList = "";
let nameList = "";
data.forEach(item => {
if (nameList.length) {
nameList += ",";
idList += ",";
}
idList += item.id;
nameList += item.name + '(' + item.institutionName + ')';
});
const newRow = JSON.parse(JSON.stringify(this.dataList[this.zrIndex]));
newRow.workPeopleId = idList
newRow.workPeople = nameList
this.$set(this.dataList, this.zrIndex, newRow);
},
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.wbsmStep1 {
/deep/.el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
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-center {
padding: 10px 0px 10px 10px;
}
.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>