Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/xmpg2/step1-1.vue
T
2021-12-13 14:24:46 +08:00

767 lines
25 KiB
Vue

<!--项目合规评估流程-项目维度-->
<template>
<div class="xmpg2-step1">
<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">
<process-title>
<template slot="title">基础信息</template>
</process-title>
<el-form
:model="listForm"
:rules="formRules"
ref="listForm"
class="label-input-form prc-content-border"
label-width="150px"
>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="选择项目" prop="orgName" class="add-form-item form-item-disabled">
<el-button size="mini" type="primary" style="margin-left: 10px;" @click="choiceShow">选择项目</el-button>
</el-form-item>
<el-form-item label="项目编号" prop="projectNumber" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.projectNumber"
placeholder="请输入项目编号"
clearable
></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="projectName" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.projectName"
placeholder="请输入项目名称"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<process-title style="margin-top:5px; margin-bottom: 5px">
<template slot="title">填写信息</template>
</process-title>
<el-table
:data="dataList"
border
ref="selection"
height="70%"
style="width: 100%; border:1px solid #ccc"
@selection-change="selectStandChange"
@select="handleSelectionChange"
: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>
<el-table-column
align="center"
label="标准号"
>
<template slot-scope="scope">
<a v-if="scope.row.standYear" class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSort
}} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>
<a v-else @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standSort }}
{{ 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="standEnName"
label="英文名称"
align="center"
>
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standEnName }}</a>
</template>
</el-table-column>
<el-table-column
prop="standEnName"
label="分解单来源"
align="center"
>
<template slot-scope="scope">
<el-select
@change="fileTypeChange"
v-model="scope.row.fileType"
placeholder="请选择"
filterable
>
<el-option
v-for="item in decomposeOptions"
:value="item.attrField"
:key="item.id"
:label="item.attrName"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
prop="ssrq"
width="190px"
align="center"
label="标准实施日期">
</el-table-column>
<el-table-column
prop="xcxssrq"
width="190px"
align="center"
label="新车型实施日期">
</el-table-column>
<el-table-column
prop="zccssrq"
align="center"
width="190px"
label="在产车实施日期">
</el-table-column>
<el-table-column
prop="zrbm"
label="责任部门"
align="center"
width="180px"
>
</el-table-column>
</el-table>
</div>
<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>
<div class="content" v-show="active === '2'">
<div class="block" style="padding-top: 20px;">
<el-timeline>
<el-form
ref="roleForm"
: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 v-model="roleForm.startUser" style="display: none;"></el-input>
<el-input v-model="roleForm.startUserName" placeholder="流程发起人" disabled></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择标准法规业务经理" placement="top" :color="roleForm.serviceManager ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="serviceManagerName" style="margin-bottom: 0">
<h4>审批责任人</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.serviceManager" style="display: none;"></el-input>
<el-input v-model="roleForm.serviceManagerName" placeholder="标准法规业务经理"
@click.native="choiceZRR('serviceManager', '选择业务经理', roleForm.serviceManager)">
</el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择工程经理进行转办" placement="top"
:color="roleForm.engineeringManager ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="engineeringManagerName" style="margin-bottom: 0">
<h4>工程经理</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.engineeringManager" style="display: none;"></el-input>
<el-input v-model="roleForm.engineeringManagerName" placeholder="选择工程经理"
@click.native="choiceZRR('engineeringManager', '选择工程经理', roleForm.engineeringManager)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="标准法规部部长审批" placement="top" :color="roleForm.statuteMinister ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="statuteMinisterName" style="margin-bottom: 0">
<h4>标准法规部部长</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.statuteMinister" style="display: none;"></el-input>
<el-input v-model="roleForm.statuteMinisterName" placeholder="选择标准法规部部长"
@click.native="choiceZRR('statuteMinister', '选择技术管理中心主任', roleForm.statuteMinister)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
</el-form>
</el-timeline>
</div>
<Role-tree
check-box
:is-title="drawerTitle"
:is-visible.sync="modalshowflag"
@checkedRole="checkedRole"
:nodeList="nodeList"
></Role-tree>
</div>
<ProcessFooter
show-save
show-submit
:submitLoading="isSubmit"
:saveLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
>
</ProcessFooter>
<!-- 选择项目抽屉-->
<el-drawer
title="选择项目"
:visible.sync="projectModel"
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="projectSearch" :inline="true" class="label-input-form" style="margin-left:10px">
<el-form-item label="项目编号" class="search-item search-item-last">
<el-input
v-model="projectSearch.projectNumber"
placeholder="请输入项目编号"
></el-input>
</el-form-item>
<el-form-item label="项目名称" class="search-item search-item-last">
<el-input
v-model="projectSearch.projectName"
placeholder="请输入项目名称"
></el-input>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
:loading="searching"
type="primary"
class="common-button-primary"
size="small"
v-btn-permission="'072efe80c5459dd47fedd2d14f59ff7f'"
@click="getProjectDataBtn">
查询
</el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
size="small"
v-btn-permission="'3480a13964a18e000196e4d5bc6ef117'"
@click="clearSearch">清空
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="ProjectDatas"
tooltip-effect="dark"
style="width: 100%"
border
height="100%"
:header-cell-style="{background: '#f5f1f1', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="selectListChange"
@select="handleSelectionChanges"
ref="selection"
>
<el-table-column
type="selection"
width="55"
align="center" />
<el-table-column
prop="projectNumber"
align="center"
label="项目编号"
/>
<el-table-column
prop="projectName"
align="center"
label="项目名称"
/>
<el-table-column
prop="projectClassification"
align="center"
label="项目分类"
/>
<el-table-column
prop="projectManager"
align="center"
label="项目经理"
/>
</el-table>
</div>
<pagination
:page="page"
:pageSize="pageSize"
:total="total"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"
/>
</div>
</div>
<div class="demo-drawer-footer">
<el-button size="mini" @click="closeDrawer">取消</el-button>
<el-button type="primary" size="mini" @click="OkDrawer">带入</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle";
import { saveTaskFirst, queryTaskFirst } from "api/process";
export default {
name: "xmpg2Step1-1",
components: {
ProcessFooter,
ProcessHeader,
ProcessTitle
},
data() {
return {
active: "1", //当前选中的type
isSubmit: false,
saveLoading: false,
commentText: "",
fileType: '',
decomposeOptions: [], //分解单数据
//表单的数据
listForm: {
projectNumber: "", //项目编号
projectName: "", //项目名称
dataList: [], //项目下的标准数据
breakdownList: [] //标准下的分解单数据
},
dataList: [], //下面标准的数据
breakdownList: [], //标准下的条款数据
//表单的验证
formRules: {
projectNumber: [
{ required: true, message: "请填写项目编号", trigger: "change" }
],
projectName: [
{ required: true, message: "请填写项目名称", trigger: "change" }
]
},
//选人的验证
roleFormRules: {
serviceManagerName: [
{ required: true, message: "请选择业务经理", trigger: "change" }
],
engineeringManagerName: [
{ required: true, message: "请选择工程经理", trigger: "change" }
],
statuteMinisterName: [
{ required: true, message: "请选择法规部部长", trigger: "cahnge" }
]
},
//选择人的数据
roleForm: {
startUserName: this.$store.getters.userInfo.userName,
startUser: this.$store.getters.userInfo.userId,
serviceManager: "", //业务经理
serviceManagerName: "",
engineeringManager: "", //工程经理
engineeringManagerName: "",
statuteMinister: "", //标准法规部部长
statuteMinisterName: ""
},
modalshowflag: false, // drawer开关
drawerTitle: "", //drawer标题
nodeList: [],
projectModel: false, //项目抽屉开关
projectId: "", //项目id 用来查询标准
standId: [], //标准id 用来条款
searching: false,
//项目检索条件
projectSearch: {
projectNumber: "",
projectName: ""
},
//项目数据
ProjectDatas: [],
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
//存放被勾选的项目的数据
selectedList: []
};
},
methods: {
fileTypeChange(type){
this.fileType = type
let ids = [];
let fileTypes = []
this.dataList.forEach(item => {
ids.push(item.standId);
fileTypes.push(item.fileType)
});
this.standId = ids.join(",");
this.fileType = fileTypes.join(",")
if(fileTypes.includes('')){
return
}else{
this.getClauseData()
}
},
// 表格勾选
handleSelectionChange(selection, val) {
if (selection.length > 1) {
let del_row = selection.shift();
this.$refs.selection.toggleRowSelection(del_row, false);
// this.$refs.listSelection.toggleRowSelection(del_row, false);
}
},
handleSelectionChanges(selection, val) {
if (selection.length > 1) {
let del_row = selection.shift();
this.$refs.selection.toggleRowSelection(del_row, false);
}
},
getData() {
queryTaskFirst({
bpnId: this.$route.query.bpnId
}).then(res => {
let mes = JSON.parse(res.mes);
this.listForm = mes.form;
this.dataList = mes.form.dataList;
this.roleForm = mes.roleForm;
this.commentText = mes.commentText;
});
},
//tab发生变化
handleTabs(type) {
this.active = type;
},
//点击选择项目事件
choiceShow() {
this.projectModel = true;
},
//项目查询按钮
getProjectDataBtn() {
this.page = 1;
this.getProjectData();
},
//获取项目数据
getProjectData() {
this.$http.get("sarStandProjectLibrary/queryProject", {
page: this.page,
pageSize: this.pageSize,
...this.projectSearch
}, {
_this: this
}, res => {
this.ProjectDatas = res.data.Maintenance.records;
this.total = res.data.Maintenance.total;
});
},
//点击清空按钮事件
clearSearch() {
this.projectSearch = {
projectName: "",
projectNumber: ""
};
this.getProjectData();
},
//带入项目确定事件
OkDrawer() {
if (this.selectedList.length > 1) {
this.$message.warning("您只能选择一条数据进行带入");
} else if (this.selectedList.length === 0) {
this.$message.warning("请选择一条数据进行带入");
} else {
this.projectId = this.selectedList[0].id;
this.listForm.projectNumber = this.selectedList[0].projectNumber;
this.listForm.projectName = this.selectedList[0].projectName;
this.listForm.productLine = this.selectedList[0].productLine;
this.getStandData();
this.projectModel = false;
}
},
//带入项目取消事件
closeDrawer() {
this.projectModel = false;
},
//查询项目下的标准
getStandData() {
this.$http.get("sarStandProjectLibrary/queryStandInfo", { id: this.projectId }, {
_this: this
}, res => {
res.data.records.forEach(item => {
if(item.zrbm === "[]"){
item.zrbm = ''
}
})
this.listForm.dataList = res.data.records;
this.dataList = res.data.records;
let ids = [];
this.dataList.forEach(item => {
ids.push(item.standId);
});
this.standId = ids.join(",");
});
},
//查询标准下的条款
getClauseData() {
this.$http.get("SarStandItems/sar-stand-items/workflowFindItems", {
ids: this.standId,
type: this.fileType
},
{
_this: this
}, res => {
this.listForm.breakdownList = res.data;
});
},
//标准的多选框改变
selectStandChange(data) {
},
//项目的多选框改变
selectListChange(data) {
this.selectedList = data;
},
pageChange(page) {
this.page = page;
this.getProjectData();
},
pageSizeChange(pageSize) {
this.pageSize = pageSize;
this.getProjectData();
},
// 点击查看
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: "OtherStandardDetails",
params: {
id: item.standId,
pageType: "INLAND_STAND"
}
});
window.open(routeUrl.href, "_blank");
},
//流程保存事件
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", "6");
_formData.append("json", JSON.stringify({
form: this.form,
roleForm: this.roleForm,
commentText: this.commentText
}));
saveTaskFirst(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
this.bpnId = res.result;
}).catch(e => {
this.saveLoading = false;
});
},
//流程提交事件
handleSubmit() {
let fileFlag = true
this.dataList.forEach(item => {
if(!item.fileType){
fileFlag = false
}
})
if(!fileFlag){
this.$message.warning('请选择分解单来源')
}else{
if (this.listForm.dataList.length < 1) {
this.$message.warning("请选择带标准的项目");
} else {
this.listForm.commentText = this.commentText;
var json = Object.assign(this.listForm, this.roleForm);
json.prcCreateUser = this.$store.getters.userInfo.userId;
json.prcCreateUserName = this.$store.getters.userInfo.userName;
json.standId = this.listForm.standId;
this.$refs["listForm"].validate((valid) => {
if (valid) {
this.$refs["roleForm"].validate((valid) => {
if (valid) {
this.isSubmit = true;
this.$http.get("lawss/activiti/startProcess", { type: "6" }, {
_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);
this.$router.push("/processCenter");
}
this.isSubmit = false;
});
}
});
} else {
return this.$message.warning("请完善人员信息");
}
});
} 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 === "serviceManager") {
this.roleForm.serviceManager = data[0].id;
this.roleForm.serviceManagerName = data[0].name;
} else if (this.type === "engineeringManager") {
this.roleForm.engineeringManager = data[0].id;
this.roleForm.engineeringManagerName = data[0].name;
} else if (this.type === "statuteMinister") {
this.roleForm.statuteMinister = data[0].id;
this.roleForm.statuteMinisterName = data[0].name;
}
}
},
mounted() {
//查找分解单来源数据
this.$http.get('lawss/sarStandAttrDetails/getListData',{},{
_this: this
}, res => {
this.decomposeOptions.push(
{
attrField: 'BDR',
attrName: '不带入'
}
)
res.data.forEach(item => {
if(item.sarType === 'STAND' || item.sarType === 'INLAND_STAND' || item.sarType === 'FOREIGN_STAND'){
this.decomposeOptions.push(item)
}
})
})
this.getData();
this.getProjectData();
}
};
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.xmpg2-step1 {
/deep/ .el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
/deep/ .el-table__header-wrapper .el-checkbox {
display: none;
}
.choiceBtn {
.el-button--primary {
width: 150px;
}
}
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;
}
.accessStandardsAndRegulations {
height: 100%;
}
}
}
.demo-drawer-content {
margin-top: 10px;
}
}
</style>