Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/xmpg/step1.vue
T
2021-12-16 17:48:27 +08:00

1184 lines
41 KiB
Vue

<!--项目合规评估流程 xmpgStep1-->
<template>
<div class="xmpg-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-collapse-transition>
<el-form
v-if="foldFormFlag === false"
: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="分解单来源" class="add-form-item form-item-disabled">
<el-select
@change="fileTypeChange"
v-model="listForm.fileType"
placeholder="请选择"
filterable
>
<el-option
v-for="item in decomposeOptions"
:value="item.attrField"
:key="item.id"
:label="item.attrName"
>
</el-option>
</el-select>
</el-form-item>
<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="standNumber" class="add-form-item form-item-disabled">
<el-input
v-if="listForm.standNumber && listForm.standNumber.length>0"
class="input-jump"
@click.native="handlePreview(listForm)"
readonly
v-model="listForm.standNumber"
placeholder="请输入标准编号"
></el-input>
<el-input
v-else
class="input-jump"
readonly
v-model="listForm.standNumber"
placeholder="请输入标准编号"
></el-input>
</el-form-item>
<el-form-item label="标准名称" prop="standName" class="add-form-item form-item-disabled">
<el-input
v-if="listForm.standName && listForm.standName.length>0"
class="input-jump"
@click.native="handlePreview(listForm)"
readonly
v-model="listForm.standName"
placeholder="请输入标准名称"
></el-input>
<el-input
v-else
class="input-jump"
readonly
v-model="listForm.standName"
placeholder="请输入标准名称"
></el-input>
</el-form-item>
<el-form-item label="截止日期" prop="endTime" class="add-form-item form-item-disabled">
<el-date-picker
v-model="listForm.endTime"
type="date"
placeholder="请选择截止日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="认证工程师" prop="certifiedEngineerName" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.certifiedEngineerName"
placeholder="请选择认证工程师"
clearable
@click.native="choiceZRR(null,'certifiedEngineer', '选择认证工程师', roleForm.certifiedEngineer)"
></el-input>
</el-form-item>
<el-form-item label="质量工程师" prop="qualityEngineerName" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.qualityEngineerName"
placeholder="请选择质量工程师"
clearable
@click.native="choiceZRR(null,'qualityEngineer', '选择质量工程师', roleForm.qualityEngineer)"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</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
v-if="foldFormFlag === true"
style="display: none"
: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="standNumber" class="add-form-item form-item-disabled">
<el-input
@click.native="handlePreview(listForm)"
readonly
v-model="listForm.standNumber"
placeholder="请输入标准编号"
></el-input>
<el-input
@click.native="handlePreview(listForm)"
readonly
v-model="listForm.standNumber"
placeholder="请输入标准编号"
></el-input>
</el-form-item>
<el-form-item label="标准名称" prop="standName" class="add-form-item form-item-disabled">
<el-input
@click.native="handlePreview(listForm)"
readonly
v-model="listForm.standName"
placeholder="请输入标准名称"
></el-input>
</el-form-item>
<el-form-item label="认证工程师" prop="certifiedEngineerName" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.certifiedEngineerName"
placeholder="请选择认证工程师"
clearable
@click.native="choiceZRR(null,'certifiedEngineer', '选择认证工程师', roleForm.certifiedEngineer)"
></el-input>
</el-form-item>
<el-form-item label="质量工程师" prop="qualityEngineerName" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.qualityEngineerName"
placeholder="请选择质量工程师"
clearable
@click.native="choiceZRR(null,'qualityEngineer', '选择质量工程师', roleForm.qualityEngineer)"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<process-title>
<template slot="title">填写信息</template>
</process-title>
<div class="tableTitle">
<div class="tableButton">
<el-button plain class="common-button-primary" size="mini" @click="addList">添加</el-button>
<el-button plain class="common-button-primary" size="mini" @click="deleteList">批量删除</el-button>
</div>
</div>
<el-table
:data="dataList"
border
ref="selection"
height="49%"
style="width: 100%;"
@selection-change="selectStandChange"
: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
prop="productLine"
label="产品线">
</el-table-column>
<el-table-column
prop="uname"
label="产品线责任人">
</el-table-column>
<el-table-column
prop="distributePerson"
label="分发责任人">
<template slot-scope="scope">
<el-input v-model="scope.row.distributePersonId" style="display: none;" />
<el-input v-model="scope.row.distributePerson" placeholder="请选择责任人"
@click.native="choiceZRR(scope,'distributePerson', '选择分发责任人', roleForm.distributePerson)" />
</template>
</el-table-column>
</el-table>
</div>
</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 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.dockUser ? '#66b1ff' : ''">
<el-card>
<el-form-item prop="dockUserName" style="margin-bottom: 0">
<h4>标准法法规业务经理</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.dockUser" style="display: none;"></el-input>
<el-input v-model="roleForm.dockUserName" placeholder="选择业务经理"
@click.native="choiceZRR(null,'dockUser', '选择业务经理', roleForm.dockUser)">
</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="ministerUserName" style="margin-bottom: 0">
<h4>标准法规部领导</h4>
<div style="margin-top: 10px;width: 300px;">
<el-input v-model="roleForm.ministerUser" style="display: none;"></el-input>
<el-input v-model="roleForm.ministerUserName" placeholder="请选择标准法规部领导"
@click.native="choiceZRR(null,'ministerUser', '选择标准法规部领导', roleForm.ministerUser)"></el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
</el-form>
</el-timeline>
</div>
</div>
<!-- 选择已拆分标准抽屉-->
<el-drawer
title="选择已拆分标准"
:visible.sync="ListModel"
size="900px"
custom-class="demo-drawer"
>
<div class="demo-drawer-content">
<loading :loading="tableLoading">数据获取中</loading>
<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
@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
v-model="standardSearch.standName"
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="getStandDataBtn">
查询
</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="sarAccessListDatas"
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"
ref="selection"
>
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="code"
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="标准名称"
>
<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"
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="xcxssrqgj"
label="新车型实施日期">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="zccssrqgj"
label="在产车实施日期">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="textStatus"
label="文本状态">
<template slot-scope="scope">
<span>{{ textStatusMap[scope.row.textStatus] }}</span>
</template>
</el-table-column>
</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>
<!-- 添加抽屉-->
<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="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.productLine"
placeholder="请输入产品线"
></el-input>
</el-form-item>
<el-form-item label="产品线责任人" class="search-item search-item-last">
<el-input
v-model="projectSearch.uname"
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=""
@click="getProductData">
查询
</el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
size="small"
v-btn-permission=""
@click="clearProject">清空
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="productData"
tooltip-effect="dark"
style="width: 100%"
border
ref="projectTable"
height="100%"
: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="productLine"
label="产品线">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="uname"
label="产品线责任人">
</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 size="mini" @click="cancelStand">取消</el-button>
<el-button type="primary" size="mini" @click="okStand">添加</el-button>
</div>
</el-drawer>
<ProcessFooter
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>
</div>
</template>
<script>
import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle";
import { saveTaskFirst } from "api/process";
import file from "@/pages/knowledgeGraph/components/file";
export default {
name: "xmpgStep1",
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
data() {
return {
//折叠的标志,true为折叠,false为不折叠
foldFormFlag: false,
//用来判断提交事件条件是否满足
satisfyFlag: true,
active: "1",
standModel: false,
tableLoading: false,
sarAccessListDatas: [],
productData: [], //添加抽屉的数据
standList: [], //新添加的标准
modalshowflag: false, // drawer开关
commentText: "",
drawerTitle: "", //drawer标题
// 查询相关参数
searching: false,
fileType: "",
projectSearch: {
productLine: '',
uname: '',
},
standardSearch: {
standType: "",
standName: ""
},
decomposeOptions: [], //分解单数据
standardTypeOptions: [
{
value: "INLAND",
label: "国内标准法规",
item: "INLAND"
},
{
value: "FOREIGN",
label: "海外标准法规",
item: "FOREIGN"
}
],
nodeList: [],
defaultProps: {
children: "children",
label: "name"
},
roleForm: {
prcCreateUserName: this.$store.getters.userInfo.userName,
prcCreateUser: this.$store.getters.userInfo.userId,
qualityEngineer: "",
certifiedEngineer: "",
qualityEngineerName: "",
certifiedEngineerName: "",
distributePerson: "",
dockUser: "",
ministerUser: "",
dockUserName: "",
ministerUserName: ""
},
formRules: {
standName: [
{ required: true, message: "请填写标准名称", trigger: "change" }
],
standNumber: [
{ required: true, message: "请填写标准编号", trigger: "change" }
],
endTime: [
{required: true, message: '请输入截止时间', trigger: 'change'},
],
qualityEngineer: [
{ required: true, message: "请选择质量工程师", trigger: "change" }
],
certifiedEngineer: [
{ required: true, message: "请选择认证工程师", trigger: "change" }
]
},
roleFormRules: {
dockUserName: [
{ required: true, message: "请选择业务经理", trigger: "change" }
],
ministerUserName: [
{ required: true, message: "请选择标准法规部领导", trigger: "change" }
]
},
ListModel: false, //选择拆分标准抽屉状态
treeData: [], // 人员数据
selectList: [], //选择标准的选择框
currentIndex: -1, // 当前操作行索引
isSubmit: false,
saveLoading: false,
selectedList: [], //拆分标准的选择框
dataList: [],
page: 1,
total: 0,
pageSize: this.$store.getters.userInfo.configContent,
pageNo: 1,
totalNo: 0,
pageSizeNo: this.$store.getters.userInfo.configContent,
product: new Map(),
listForm: {
standNumber: "", //标准编号
standName: "",//标准名称
endTime:'',
standType: "", //标准类型
XCXSSRQ: "", //新车型实施日期
ZCCSSRQ: "", //在产车实施日期
certifiedEngineer: "", //认证工程师
qualityEngineer: "", //质量工程师
breakdownList: [{
applyArctic: "",
busStandCover: "",
claimType: "",
id: "",
itemsName: "",
itemsNum: "",
responsibleUnit: "", //责任部门
responsibleEngineer: "", //责任工程师
standId: "",
svpps: ""
}],
dataList: [{
projectLine: "", //产品线
uname: "",//产品线责任人
projectManager: "",// 产品线责任人id
distributePerson: "", //分发责任人
distributePersonId: "", //分发责任人id
id: "",
pastProject: [], //用来存放上次选中的产品线信息
sarStandProjectLibraries: [{
projectManager: "",
projectLevel: "",
projectNumber: "",
projectEndDate: "",
currentNode: "",
projectGroup: "",
productLine: "",
projectClassification: "",
projectStatus: "",
projectStartDate: "",
id: "",
projectName: "",
projectPlatfor: ""
}]
}]
},
choiceForm: {}, //选择标准清单列表
showColumn: true,
textStatusMap: {}// 文本状态id与name对应
};
},
methods: {
//折叠/展开基础信息方法
foldForm() {
this.foldFormFlag = !this.foldFormFlag
},
checkedRole(data) {
if (this.type === "dockUser") {
this.roleForm.dockUser = data[0].id;
this.roleForm.dockUserName = data[0].name;
} else if (this.type === "ministerUser") {
this.roleForm.ministerUser = data[0].id;
this.roleForm.ministerUserName = data[0].name;
} else if (this.type === "qualityEngineer") {
this.roleForm.qualityEngineer = data[0].id;
this.roleForm.qualityEngineerName = data[0].name;
this.listForm.qualityEngineer = data[0].id;
this.listForm.qualityEngineerName = data[0].name;
} else if (this.type === "certifiedEngineer") {
this.roleForm.certifiedEngineer = data[0].id;
this.roleForm.certifiedEngineerName = data[0].name;
this.listForm.certifiedEngineer = data[0].id;
this.listForm.certifiedEngineerName = data[0].name;
} else if (this.type === "distributePerson") {
// 如果有勾选,则视为批量选择责任人
if (this.selectList.length) {
this.dataList.forEach((item, index) => {
if (this.selectList.includes(item.productLine)) {
const newItem = JSON.parse(JSON.stringify(item));
newItem.distributePersonId = data[0].id;
newItem.distributePerson = data[0].name;
this.$set(this.dataList, index, newItem);
}
});
} else {
const newItem = JSON.parse(JSON.stringify(this.dataList[this.currentIndex]));
newItem.distributePersonId = data[0].id;
newItem.distributePerson = data[0].name;
this.$set(this.dataList, this.currentIndex, newItem);
this.listForm.dataList[this.currentIndex].distributePersonId = data[0].id;
this.listForm.dataList[this.currentIndex].distributePerson = data[0].name;
this.currentIndex = -1;
}
}
this.modalshowflag = false;
},
cancelUserInfo() {
this.modalshowflag = false;
},
//tab发生变化
handleTabs(name) {
this.active = name;
},
typeChange(type) {
this.standardSearch.standType = type;
},
choiceShow() {
if(!this.fileType){
this.$message.warning('请先选择分解单来源')
}else{
this.getStandData();
this.ListModel = true;
}
},
drawerCheck(data) {
var getlist = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
if (getlist.length == 1) {
this.roleRow = getlist[0];
} else {
this.$refs.tree.setCheckedKeys([data.id]);
this.roleRow = this.$refs.tree.getCheckedNodes()[0];
}
},
//导入功能
leading() {
},
//点击添加事件
addList() {
this.standModel = true;
this.$nextTick(() => {
this.$refs.projectTable.clearSelection();
});
},
// 点击批量删除事件
deleteList() {
if (this.selectList.length < 1) {
this.$message.warning("请选择一条数据进行删除");
} else {
this.$confirm("您确认删除这些数据?", "提示", {
confirmButtonText: "确认",
confirmButtonClass: "common-button-primary",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.selectList.map(item => {
let index;
index = this.dataList.findIndex(items => {
return items.productLine === item;
});
if (index > -1) {
this.dataList.splice(index, 1);
}
});
this.selectList = [];
}).catch(() => {
});
}
},
//取消添加事件
cancelStand() {
this.standModel = false;
},
//确认添加事件
okStand() {
this.pastProject = JSON.parse(localStorage.getItem('projectList'))
let proData = [];
if (this.dataList.length >= 1) {
this.dataList.forEach(item => {
if (proData.length === 0) {
proData.push(item.productLine);
} else if (!proData.includes(item.productLine)) {
proData.push(item.productLine);
}
});
this.standList.forEach(items => {
if (!proData.includes(items.productLine)) {
this.dataList.push(items);
}
});
this.standModel = false;
} else {
if (this.standList.length >= 1) {
if (this.pastProject === null){
this.dataList = this.standList;
}else {
this.pastProject.forEach(item => {
this.standList.map(items => {
if( item.productLine === items.productLine){
items.distributePersonId = item.distributePersonId
items.distributePerson = item.distributePerson
}
})
})
this.dataList = this.standList
}
this.listForm.dataList = this.standList;
this.roleForm.directorUser = this.dataList[0].uname;
this.standModel = false;
} else {
this.$message.warning("请选择一条数据进行添加");
}
}
},
//保存事件
handleSave() {
this.saveLoading = true;
let _formData = new FormData();
_formData.append("createUser", this.$store.getters.userInfo.userId);
_formData.append("createUserName", this.$store.getters.userInfo.uName);
_formData.append("prcType", "5");
_formData.append("json", JSON.stringify({
taskInfo: "选择已拆分标准",
form: this.listForm,
roleForm: this.roleForm,
commentText: this.commentText
}));
saveTaskFirst(_formData).then(res => {
this.saveLoading = false;
this.$message.success("保存成功");
}).catch(e => {
this.saveLoading = false;
});
},
//提交事件
handleSubmit() {
if (this.dataList.length < 1) {
this.satisfyFlag = false
this.$message.warning("请添加产品线信息");
}else {
this.satisfyFlag = true
}
this.dataList.forEach(item => {
if (!item.distributePerson) {
this.satisfyFlag = false
this.$message.warning("请选择分发责任人");
}else {
this.satisfyFlag = true
}
});
if(this.satisfyFlag){
this.isSubmit = true;
this.listForm.commentText = this.commentText;
var json = Object.assign(this.listForm, this.roleForm);
localStorage.setItem('projectList', JSON.stringify(this.dataList))
this.$refs["listForm"].validate((valid) => {
if (valid) {
this.$refs["roleForm"].validate((valid) => {
if (valid) {
this.$http.post("lawss/activiti/startProcessRollBack", {
id: this.bpnId || '',
createUser: this.$store.getters.userInfo.userId,
createUserName: this.$store.getters.userInfo.userName,
type: '5',
json: JSON.stringify({
taskInfo: "选择已拆分标准",
form: this.listForm,
roleForm: this.roleForm,
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);
this.$router.push("/processCenter");
}
this.isSubmit = false;
});
}
});
} else {
this.isSubmit = false;
return this.$message.warning("请完善人员信息");
}
});
} else {
this.isSubmit = false;
return this.$message.warning("请完善基础信息");
}
});
}
},
//选择拆分标准取消事件
closeDrawer() {
this.ListModel = false;
},
// 点击查看
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: "OtherStandardDetails",
params: {
id: item.id,
pageType: "INLAND_STAND"
}
});
window.open(routeUrl.href, "_blank");
},
//选择拆分标准确定事件
OkDrawer() {
if (this.selectedList.length === 1) {
this.listForm.standNumber = this.selectedList[0].standSortShow + "\xa0\xa0" + this.selectedList[0].standNumber + "-" + this.selectedList[0].standYear;
this.listForm.standName = this.selectedList[0].standName;
this.listForm.standType = this.selectedList[0].standType;
this.listForm.standId = this.selectedList[0].id;
this.listForm.XCXSSRQ = this.selectedList[0].xcxssrqgj;
this.listForm.ZCCSSRQ = this.selectedList[0].zccssrqgj;
this.listForm.id = this.selectedList[0].id;
this.$http.get("SarStandItems/sar-stand-items/findAllItems", {
ids: this.listForm.id,
type: this.fileType
}, {
_this: this
}, res => {
let breakdown = res.data
breakdown.forEach(item => {
delete item.termsConditions
})
this.listForm.breakdownList = breakdown;
this.ListModel = false;
}, e => {
this.$message.error("添加失败");
});
} else if (this.selectedList.length > 1) {
this.$message.warning("您只能选择一条数据进行带入");
} else {
this.$message.warning("请选择一条数据带入");
}
},
//选择拆分标准选择框改变
selectListChange(data) {
this.selectedList = data;
},
//标准表格选择框改变
selectStandChange(data) {
this.selectList = [];
for (let i = 0; i < data.length; i++) {
this.selectList.push(data[i].productLine);
}
},
//添加产品线select的改变
selectThree(data) {
this.standList = data;
},
choiceZRR(scope, type, title, id) {
if (scope != null) {
this.currentIndex = scope.$index;
}
this.nodeList = [];
this.nodeList.push(id);
this.type = type;
this.drawerTitle = title;
this.modalshowflag = true;
},
getTree() {
this.$http.get("SarInstitution/institution/institutionAndUser", {}, {}, res => {
this.treeData = res.data;
});
},
pageChange(page) {
this.page = page;
this.getStandData();
},
pageSizeChange(pageSize) {
this.pageSize = pageSize;
this.getStandData();
},
pageChangeNo(page) {
this.pageNo = page;
this.getProductData();
},
pageSizeChangeNo(pageSize) {
this.pageSizeNo = this.$store.getters.userInfo.configContent;
this.getProductData();
},
//清空产品线数据
clearProject(){
this.projectSearch = {
productLine: '',
uname: '',
}
this.getProductData()
},
//获取产品线数据
getProductData() {
this.$http.get("sarStandProjectLibrary/queryProjectManager", {
current: this.pageNo,
PageSize: this.pageSizeNo,
...this.projectSearch
}, {
_this: this
}, res => {
this.productData = res.data.records;
this.totalNo = res.data.total;
}, e => {
});
},
//获取标准查询按钮
getStandDataBtn() {
this.page = 1;
this.getStandData();
},
fileTypeChange(type){
this.fileType = type
},
//获取标准数据
getStandData() {
this.tableLoading = true
this.$http.post("SarStandItems/sar-stand-items/findStand", {
page: this.page,
size: this.pageSize,
fileType: this.fileType,
...this.standardSearch
}, {
_this: this
}, res => {
this.sarAccessListDatas = res.records;
this.total = res.total;
this.tableLoading = false
}, e => {
});
},
clearSearch() {
this.standardSearch = {
standName: "",
standType: ""
};
this.getStandData();
},
// 将文本状态的id与name对应
setMap(data) {
data.forEach(item => {
this.$set(this.textStatusMap, item.value, item.label);
});
}
},
computed: {},
watch: {
// dataList: {
// deep: true,
// handler (val) {
// console.log('dataList update', val)
// }
// }
},
mounted() {
//从数据库中查询下拉框数据
this.$http.get("sys/dictype/getDicTypeListCode", {}, {
_this: this
}, res => {
this.countryOptions = res.data.COUNTRY;
this.standStateOptions = res.data.WBZTCLASS; // 文本状态
this.setMap(this.standStateOptions);
});
//查找分解单来源数据
this.$http.get('lawss/sarStandAttrDetails/getListData',{},{
_this: this
}, res => {
res.data.forEach(item => {
if(item.sarType === 'STAND' || item.sarType === 'INLAND_STAND' || item.sarType === 'FOREIGN_STAND'){
this.decomposeOptions.push(item)
}
})
})
this.getTree();
this.getProductData();
}
};
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.xmpg-step1 {
/deep/ .el-drawer__container {
.prc-content-border {
border: none;
padding: 0 20px 0;
}
}
.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%;
}
}
.input-jump {
/deep/.el-input__inner{
color: #409EFF;
}
}
}
.demo-drawer-content {
margin-top: 10px;
}
}
</style>