Files
foton-laws-system-front/src/pages/processCenter/pages/creatProcess/bzqdfb/step1.vue
T
2021-07-24 17:10:31 +08:00

1439 lines
50 KiB
Vue

<!--标准清单发布/更新流程-->
<template>
<div class="bzqdfb-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
ref="qdfbForm"
:model="listForm"
:rules="formRules"
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-radio-group v-model="listType" @change="selectionList">
<el-radio label="country">国家/地区清单</el-radio>
<el-radio label="project">项目清单</el-radio>
<el-radio label="other">其他清单</el-radio>
</el-radio-group>
<el-button size="mini" type="primary" style="margin-left: 40px;" @click="choiceShow">
选择清单
</el-button>
</el-form-item>
<el-form-item label="清单名称" prop="listName" class="add-form-item form-item-disabled">
<el-input
disabled
v-model="listForm.listName"
placeholder="请输入清单名称"
clearable
></el-input>
</el-form-item>
<el-form-item label="清单说明" prop="descriptionList" class="add-form-item form-item-disabled">
<el-input
v-model="listForm.descriptionList"
placeholder="请输入清单说明"
clearable
></el-input>
</el-form-item>
<el-form-item label="附件" prop="fileId" class="add-form-item form-item-disabled">
<el-upload
v-if="listForm.fileId == null || this.listForm.fileId== 'undefined' || this.listForm.fileId == '' "
:action="uploadFileListPath"
show-file-list
:file-list="fileInfoList"
name="file"
accept=".PDF, .pdf, .doc, .DOC, .docx, .DOCX, .xls, .xlsx, .ppt, .pptx, .PPT, .PPTX, .JPG, .JPEG, .PNG, .jpg, .jpeg, .png"
:on-remove="delFileInfo"
:on-success="uploadBackSuccess"
:before-upload="beforeUpload"
>
<el-button class="common-button-default" size="mini">
点击上传
</el-button>
</el-upload>
<el-input
v-else
v-model="listForm.fileId"
placeholder=""
></el-input>
</el-form-item>
<el-form-item label="会签" prop="sign" class="add-form-item form-item-disabled">
<el-radio-group v-model="signFlag" @change="selectSign">
<el-radio label="1"></el-radio>
<el-radio label="2"></el-radio>
</el-radio-group>
</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="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"
width="260px"
>
</el-table-column>
<el-table-column
prop="issueTime"
align="center"
label="发布日期">
</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"
width="120px"
label="文本状态">
</el-table-column>
</el-table>
</div>
</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 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' : ''" v-if="signFlag === '1'">
<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="choiceZRRS">
</el-input>
</div>
</el-form-item>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="选择会签责任人,填写意见" placement="top"
:color="roleForm.dockUser ? '#66b1ff' : ''" v-if="signFlag === '2'">
<el-card>
<el-form-item prop="dockUserName2" 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('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 v-model="roleForm.ministerUser" style="display: none;"></el-input>
<el-input v-model="roleForm.ministerUserName" 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 v-model="roleForm.directorUser" style="display: none;"></el-input>
<el-input v-model="roleForm.directorUserName" placeholder="选择业务经理"
@click.native="choiceZRR('directorUser', '选择技术管理中心主任', roleForm.directorUser)"></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">
<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="sarSarAccessEOSearch" :inline="true" class="label-input-form"
style="margin-left:10px">
<el-form-item label="清单名称" class="search-item search-item-last">
<el-input
v-model="sarSarAccessEOSearch.detailedListName"
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="queryDetailsData">
查询
</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
v-if="listType === 'country'"
: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="countryArea"
label="国家/地区"
align="center">
</el-table-column>
<el-table-column
prop="detailedListName"
label="清单名称"
align="center"
>
<template slot-scope="scope">
<a class="table-jump" @click.stop="showTable(scope.row)">{{
scope.row.detailedListName }}</a>
</template>
</el-table-column>
<el-table-column
prop="detailedListState"
label="清单状态"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.detailedListState === '0'">未发布</span>
<span v-if="scope.row.detailedListState === '1'">已发布</span>
<span v-if="scope.row.detailedListState === '3'">审核中</span>
</template>
</el-table-column>
<el-table-column
prop="detailedListVision"
label="清单版本"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.detailedListVision != null && scope.row.detailedListVision !== ''">{{ scope.row.detailedListVision
}}</span>
</template>
</el-table-column>
<el-table-column
prop="applicationScope"
label="适用领域"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.applicationScope != null && scope.row.applicationScope !== ''">{{ scope.row.applicationScope
}}</span>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间"
sortable
align="center">
<template slot-scope="scope">
<div>
{{ scope.row.updateTime ? $moment(scope.row.updateTime).format("YYYY-MM-DD hh:mm:ss") : scope.row.updateTime
}}
</div>
</template>
</el-table-column>
<el-table-column
prop="updatePeople"
label="更新人"
align="center">
</el-table-column>
</el-table>
<el-table
v-if="listType === 'project'"
: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="projectName"
label="项目名称"
align="center">
</el-table-column>
<el-table-column
prop="detailedListName"
label="清单名称"
align="center"
>
<template slot-scope="scope">
<a class="table-jump" @click.stop="showTable(scope.row)">{{
scope.row.detailedListName }}</a>
</template>
</el-table-column>
<el-table-column
prop="detailedListState"
label="清单状态"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.detailedListState === '0'">未发布</span>
<span v-if="scope.row.detailedListState === '1'">已发布</span>
<span v-if="scope.row.detailedListState === '3'">审核中</span>
</template>
</el-table-column>
<el-table-column
prop="detailedListVision"
label="清单版本"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.detailedListVision != null && scope.row.detailedListVision !== ''">{{ scope.row.detailedListVision
}}</span>
</template>
</el-table-column>
<el-table-column
prop="applicationScope"
label="适用领域"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.applicationScope != null && scope.row.applicationScope !== ''">{{ scope.row.applicationScope
}}</span>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间"
sortable
align="center">
<template slot-scope="scope">
<div>
{{ scope.row.updateTime ? $moment(scope.row.updateTime).format("YYYY-MM-D hh:mm:ss") : scope.row.updateTime
}}
</div>
</template>
</el-table-column>
<el-table-column
prop="updatePeople"
label="更新人"
align="center">
</el-table-column>
</el-table>
<el-table
v-if="listType === 'other'"
: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="detailedList"
label="清单类别"
align="center">
</el-table-column>
<el-table-column
prop="detailedListName"
label="清单名称"
align="center"
>
<template slot-scope="scope">
<a class="table-jump" @click.stop="showTable(scope.row)">{{
scope.row.detailedListName }}</a>
</template>
</el-table-column>
<el-table-column
prop="detailedListState"
label="清单状态"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.detailedListState === '0'">未发布</span>
<span v-if="scope.row.detailedListState === '1'">已发布</span>
<span v-if="scope.row.detailedListState === '3'">审核中</span>
</template>
</el-table-column>
<el-table-column
prop="detailedListVision"
label="清单版本"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.detailedListVision != null && scope.row.detailedListVision !== ''">{{ scope.row.detailedListVision
}}</span>
</template>
</el-table-column>
<el-table-column
prop="applicationScope"
label="适用领域"
align="center">
<template slot-scope="scope">
<span
v-if="scope.row.applicationScope != null && scope.row.applicationScope !== ''">{{ scope.row.applicationScope
}}</span>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
label="更新时间"
sortable
align="center">
<template slot-scope="scope">
<div>
{{ scope.row.updateTime ? $moment(scope.row.updateTime).format("YYYY-MM-DD hh:mm:ss") : scope.row.updateTime
}}
</div>
</template>
</el-table-column>
<el-table-column
prop="updatePeople"
label="更新人"
align="center">
</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="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.standNumber"
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="addList">
查询
</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="clearStandSearch">清空
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="standardData"
tooltip-effect="dark"
style="width: 100%"
border
ref="table"
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="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="标准名称"
>
</el-table-column>
<el-table-column
prop="issueTime"
align="center"
label="发布日期">
</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="文本状态">
</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
is-title="选择责任部门对接人"
:is-visible.sync="modalshowflag2"
@checkedRole="checkedRole2"
:nodeList="nodeList2"
></Role-tree>
<Role-tree
check-box
:is-title="drawerTitle"
:is-visible.sync="modalshowflag"
@checkedRole="checkedRole"
:nodeList="nodeList"
></Role-tree>
<el-dialog width="400px" :visible.sync="fileMadel" title="上传文件">
<el-upload
multiple
drag
:action="fileUrl"
ref="importfile"
name="file"
accept=".ZIP, .zip, .docx, .DOCX, .xls, .xlsx"
:before-upload="beginImportFile"
:on-success="importFileSuccess"
:show-file-list="false"
>
<div style="padding: 20px 0">
<i class="el-icon-upload" style="color: #3399ff"></i>
<p>点击或拖拽上传文件</p>
</div>
</el-upload>
</el-dialog>
</div>
</template>
<script>
import ProcessHeader from "../../components/ProcessHeader";
import ProcessFooter from "../../components/ProcessFooter";
import ProcessTitle from "../../components/ProcessTitle";
import { saveTaskFirst } from "api/process";
import seeDatalis from "@/pages/localTool/standContrast/pages/seeDatalis";
export default {
name: "bzqdfbStep1",
components: {
ProcessHeader,
ProcessFooter,
ProcessTitle
},
data() {
return {
fileUrl: "api/att/attFile/upload",
fileMadel: false,
searching: false,
// 查询选择清单相关参数
sarSarAccessEOSearch: {
countryArea: "",
detailedListName: "",
},
//查询添加标准相关数据
standardSearch: {
standType: "",
standNumber: "",
pageNo: 1,
pageSizeNo: this.$store.getters.userInfo.configContent
},
standList: [], //新添加的标准
modalshowflag: false, // drawer开关
modalshowflag2: false,
nodeList2: [],
drawerTitle: "", //drawer标题
nodeList: [],
defaultProps: {
children: "children",
label: "name"
},
roleForm: {
startUserName: this.$store.getters.userInfo.userName,
startUser: this.$store.getters.userInfo.id,
dockUser: "",
responUserList: "",
ministerUser: "",
directorUser: "",
presidentUser: "",
dockUserName: "",
responUserListName: "",
ministerUserName: "",
directorUserName: "",
presidentUserName: ""
},
formRules: {
listType: [
{ required: true, message: "请选择清单类型", trigger: "change" }
],
listName: [
{ required: true, message: "请填写清单名称", trigger: "change" }
]
},
roleFormRules: {
dockUserName: [
{ required: true, message: "请选择会签责任人", trigger: "change" }
],
ministerUserName: [
{ required: true, message: "请选择修订责任人", trigger: "change" }
],
directorUserName: [
{ required: true, message: "请选择审批责任人", trigger: "change" }
]
},
dataList: [],//清单里的标准数据
sarAccessListDatas: [], //国家地区清单表格
uploadFileListPath: "api/att/attFile/upload", // 上传的地址
fileInfoList: [], // 上传的附件
fileIds: [], // 上传的附件
fileListName: [], //上传的附件名称
standardData: [], //添加标准数据
standardData1: [], //添加标准数据
ListModel: false, //选择清单抽屉状态
standModel: false, // 选择标准抽屉状态
active: "1",
signFlag: "1", //是否会签 1为会签 2为不会签
listType: "country", //选择的清单类型
isSubmit: false,
saveLoading: false,
tabValue: "listOfCountries",
selectedList: [], //选择清单的选择框
selectList: [], //选择标准的选择框
bringData: [],
page: 1,
total: 0,
pageSize: this.$store.getters.userInfo.configContent,
pageNo: 1,
totalNo: 0,
pageSizeNo: this.$store.getters.userInfo.configContent,
listForm: {
listType: "", //区分是哪个清单
listName: "", //清单名称
descriptionList: "", //清单说明
fileId: "",
model: "", // 上传模板
modelName: "",
standId: "", //选择的清单的id
signFlag: "1", //是否会签 1为会签 2为不会签
inforlist: "", //用来存放标准列表的标准id
dataList: [{
code: "", //标准号
standName: "", //标准名称
issueTime: "", //发布日期
xcxssrq: "", //新车型实施日期
zccssrq: "", //在产车实施日期
textStatus: "", //文本状态
id: ""
}]
},
choiceForm: {}, //选择标准清单列表
// countryOptions: [], //适用区域下拉框数据
standardTypeOptions: [
{
value: "INLAND",
label: "国内标准法规",
item: "INLAND"
},
{
value: "FOREIGN",
label: "海外标准法规",
item: "FOREIGN"
}
],
user1: "",
user2: "",
user3: "",
user4: "",
user5: "",
standMap: new Map()
};
},
methods: {
checkedRole(data) {
if (this.type === "dockUser") {
this.roleForm.dockUser = this.roleRow.id;
this.roleForm.dockUserName = this.roleRow.name;
} else if (this.type === "ministerUser") {
this.roleForm.ministerUser = data[0].id;
this.roleForm.ministerUserName = data[0].name;
} else if (this.type === "directorUser") {
this.roleForm.directorUser = data[0].id;
this.roleForm.directorUserName = data[0].name;
} else if (this.type === "presidentUser") {
this.roleForm.presidentUser = data[0].id;
this.roleForm.presidentUserName = data[0].name;
}
this.modalshowflag = false;
},
checkedRole2(data) {
var idList = "";
var nameList = "";
data.forEach(item => {
if (nameList.length > 0) {
nameList += ",";
idList += ",";
}
idList += item.id;
nameList += item.name;
});
this.roleForm.dockUser = idList;
this.roleForm.dockUserName = nameList;
},
cancleUserInfo() {
this.modalshowflag = false;
},
//tab发生变化
handleTabs(name) {
this.active = name;
},
choiceShow() {
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];
}
},
//判断当前是否会签
selectSign(type) {
if (type === "1") {
this.listForm.signFlag = 1;
} else if (type == "2") {
this.listForm.signFlag = 2;
}
},
queryDetailsData(){
this.page = 1
this.selectionList()
},
// //判断当前选中的是哪个清单
selectionList(type) {
type = this.listType;
if (type === "project") {
this.$http.get("sarLawsDetailedList/sar-laws-detailed-list/getAllStand", {
page: this.page,
pageSize: this.pageSize,
...this.sarSarAccessEOSearch,
sortKey: 2
}, {
_this: this
}, res => {
this.sarAccessListDatas = res.data.records;
this.total = res.data.total;
}, e => {
});
} else if (type === "other") {
this.$http.get("sarLawsDetailedList/sar-laws-detailed-list/getAllStand", {
page: this.page,
pageSize: this.pageSize,
...this.sarSarAccessEOSearch,
sortKey: 3
}, {
_this: this
}, res => {
this.sarAccessListDatas = res.data.records;
this.total = res.data.total;
}, e => {
});
} else if (type === "country") {
this.$http.get("sarLawsDetailedList/sar-laws-detailed-list/getAllStand", {
page: this.page,
pageSize: this.pageSize,
...this.sarSarAccessEOSearch,
sortKey: 1
}, {
_this: this
}, res => {
this.sarAccessListDatas = res.data.records;
this.total = res.data.total;
}, e => {
});
}
},
clearSearch() {
this.sarSarAccessEOSearch = {
countryArea: "",
detailedListName: ""
};
this.selectionList();
},
clearStandSearch(){
this.standardSearch = {
standType: "",
standNumber: ""
};
this.addList();
},
//点击添加事件
addList() {
this.$http.get("sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage", {
standType: this.standardSearch.standType,
standNumber: this.standardSearch.standNumber,
page: this.pageNo,
pageSize: this.pageSizeNo
}, {
_this: this
}, res => {
this.standardData = res.data.list;
this.totalNo = res.data.count;
}, e => {
});
this.standModel = true;
},
// 点击批量删除事件
deleteList() {
if (this.selectList.length < 1) {
this.$message.warning("请选择一条数据进行删除");
} else {
this.$confirm("您确认删除这些数据?", "提示", {
confirmButtonText: "确认",
confirmButtonClass: "common-button-primary",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
let exits = [];
this.selectList.map(item => {
let index;
index = this.dataList.findIndex(items => {
return items.id = item;
});
if (index > -1) {
this.dataList.splice(index, 1);
}
exits.push(item);
});
this.selectList = [];
}).catch(() => {
});
}
},
//保存事件
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', '4')
_formData.append('json', JSON.stringify({
form: this.listForm,
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() {
if(this.dataList.length < 1){
this.$message.warning('标准不能为空')
}else{
let json = this.listForm;
this.listForm.fileId = this.fileIds.join(",");
this.listForm.fileName = this.fileListName.join(",");
this.listForm.model = this.listForm.fileId;
this.listForm.modelName = this.listForm.fileName;
json.zrUserId = this.roleForm.dockUser; //会签人
json.jlUserId = this.roleForm.directorUser; //业务经理
json.applyUpdUserId = this.roleForm.ministerUser; // 修订人
json.approvalOpinion = "";
json.prcCreateUser = this.$store.getters.userInfo.userId;
json.prcCreateUserName = this.$store.getters.userInfo.uName;
json.standName = this.listForm.listName;
json.standId = this.listForm.standId;
this.$refs["qdfbForm"].validate((valid) => {
if (valid) {
this.$refs["Form"].validate((valid) => {
if (valid) {
this.$http.get("lawss/activiti/startProcess", { type: "4" }, {
_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");
}
});
}
});
} else {
return this.$message.warning("请完善人员信息");
}
});
} else {
return this.$message.warning("请完善基础信息");
}
});
}
},
// 删除上传的文件
delFileInfo(file, fileList) {
let middle = [];
let files = [];
fileList.forEach(item => {
middle.push(item.name);
files.push(item.response.data.id);
});
this.fileListName = middle;
this.fileIds = files;
},
fileUpload() {
this.fileMadel = true;
},
// 上传文件成功回调
uploadBackSuccess(res, file, fileList) {
if (res.ok) {
let middle = [];
fileList.forEach(item => {
middle.push(item.name);
});
this.fileListName = middle;
this.fileIds.push(file.response.data.id);
this.$message.success('上传成功')
} else {
this.$message.error(res.message);
fileList.pop();
}
},
// 相关附件 上传之前钩子
beforeUpload(file) {
var filename = file.name;
var index1 = filename.lastIndexOf(".");
var index2 = filename.length;
var fileSuffix = filename.substring(index1, index2);
//把后缀转大写
if (fileSuffix !== undefined && fileSuffix !== null) {
fileSuffix = fileSuffix.toUpperCase();
}
// 判断上传文件格式
if (fileSuffix === ".PDF" || fileSuffix === ".DOC" || fileSuffix === ".DOCX" || fileSuffix === ".PPT"
|| fileSuffix === ".PPTX" || fileSuffix === ".XLS" || fileSuffix === ".XLSX"
|| fileSuffix === ".PNG" || fileSuffix === ".JPG" || fileSuffix === ".JPEG") {
return true;
} else {
this.$message.error("文件" + file.name + "格式不正确,请上传pdf、doc、docx、ppt、pptx、xls、xlsx、png、jpg、jpeg等文件");
return false;
}
// 判断文件上传大小
if (file.size / 1024 / 1024 > 300) {
this.$message.warning("文件" + file.name + "大小不能超过300M");
return false;
}
return true;
},
// 点击查看
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: "OtherStandardDetails",
params: {
id: item.id,
pageType: "INLAND_STAND"
}
});
window.open(routeUrl.href, "_blank");
},
// 导入标准数据成功后执行
importFileSuccess(response, file) {
if (response.ok) {
this.fileMadel = false;
this.listForm.model = response.data.id;
this.listForm.modelName = response.data.name;
this.$message({
showClose: true,
message: response.message,
type: "success"
});
}
},
// 导入按钮 上传之前的钩子
beginImportFile(file) {
var filename = file.name;
var index1 = filename.lastIndexOf(".");
var index2 = filename.length;
var fileSuffix = filename.substring(index1, index2);
// const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式
if (fileSuffix === ".PDF" || fileSuffix === ".DOC" || fileSuffix === ".DOCX" || fileSuffix === ".PPT"
|| fileSuffix === ".PPTX" || fileSuffix === ".XLS" || fileSuffix === ".XLSX"
|| fileSuffix === ".PNG" || fileSuffix === ".JPG" || fileSuffix === ".JPEG" ||
fileSuffix === ".pdf" || fileSuffix === ".doc" || fileSuffix === ".docx" || fileSuffix === ".ppt"
|| fileSuffix === ".pptx" || fileSuffix === ".xls" || fileSuffix === ".xlsx"
|| fileSuffix === ".png" || fileSuffix === ".jpg" || fileSuffix === ".jpeg") {
return true;
} else {
this.spinShow = false;
this.$message.error("文件" + file.name + "格式不正确,请上传pdf、doc、docx、ppt、pptx、xls、xlsx、png、jpg、jpeg等文件");
return false;
}
// 判断文件上传大小
// eslint-disable-next-line no-unreachable
if (file.size / 1024 / 1024 <= 200) {
return true;
} else {
this.$message.error("文件" + file.name + "大小不超过200M");
return false;
}
return true;
},
// beginImportFile (file) {
// var filename = file.name
// var index1 = filename.lastIndexOf('.')
// var index2 = filename.length
// var fileSuffix = filename.substring(index1, index2)
// // const fileSuffix = file.name.split('.')[1] // 后缀名
// // 判断上传文件格式
// // 判断上传文件格式
// if (fileSuffix === '.PDF' || fileSuffix === '.DOC' || fileSuffix === '.DOCX' || fileSuffix === '.PPT'
// || fileSuffix === '.PPTX'|| fileSuffix === '.XLS'|| fileSuffix === '.XLSX'
// || fileSuffix === '.PNG'|| fileSuffix === '.JPG'|| fileSuffix === '.JPEG') {
// return true
// } else {
// this.spinShow = false
// this.$message.error('文件' + file.name + '格式不正确,请上传pdf、doc、docx、ppt、pptx、xls、xlsx、png、jpg、jpeg等文件')
// return false
// }
// // 判断文件上传大小
// // eslint-disable-next-line no-unreachable
// if (file.size / 1024 / 1024 <= 200) {
// return true
// } else {
// this.$message.error('文件' + file.name + '大小不超过200M')
// return false
// }
// return true
// },
//选择清单取消事件
closeDrawer() {
this.ListModel = false;
},
typeChange(type) {
this.standardSearch.standType = type;
},
//添加标准取消事件
cancelStand() {
this.standModel = false;
},
//添加标准确定事件
okStand() {
let _this = this;
if (this.standList.length < 1) {
_this.$message.warning("请选择需要添加进清单的数据");
} else {
_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.dataList.push(item);
}
});
this.standardData = [];
_this.standModel = false;
}
},
//选择清单确定事件
OkDrawer() {
if (this.selectedList.length === 1) {
let deposit = new Map();
this.sarAccessListDatas.forEach(item => {
deposit.set(item.id, item);
});
let bringData = [];
for (let i = 0; i < this.selectedList.length; i++) {
bringData.push(deposit.get(this.selectedList[i]));
}
this.listForm.standId = bringData[0].id;
this.listForm.listName = bringData[0].detailedListName;
this.listForm.descriptionList = bringData[0].remark;
this.listForm.fileId = bringData[0].fileId;
this.ListModel = false;
this.$http.get("sarLawsAttrDetailedList/sar-laws-attr-detailed-list/selectLawsById",
{ id: bringData[0].id, page: this.page, Size:this.pageSize}, {
_this: this
}, res => {
if (res.data == null) {
res.data = [];
}
this.dataList = res.data;
this.listForm.dataList = res.data;
let formId = [];
this.dataList.map(item => {
formId.push(item.id);
});
this.listForm.inforlist = formId.join(",");
}, e => {
});
} else if (this.selectedList.length > 1) {
this.$message.warning("只能选择一条数据进行带入");
} else {
this.$message.warning("请选择一条数据进行带入");
}
},
//选择清单选择框改变
selectListChange(data) {
this.selectedList = [];
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id);
}
},
//标准表格选择框改变
selectStandChange(data) {
this.selectList = [];
for (let i = 0; i < data.length; i++) {
this.selectList.push(data[i].id);
}
},
//添加标准select的改变
selectThree(data) {
this.standList = data;
},
choiceZRR(type, title, id) {
this.nodeList = [];
this.nodeList.push(id);
this.type = type;
this.drawerTitle = title;
this.modalshowflag = true;
},
choiceZRRS() {
this.nodeList2 = [];
if (this.roleForm.dockUser.length > 0) {
this.nodeList2 = this.roleForm.dockUser.split(",");
}
this.modalshowflag2 = true;
},
getTree() {
this.$http.get("SarInstitution/institution/institutionAndUser", {}, {}, res => {
this.treeData = res.data;
});
},
pageChange(page) {
console.log(page);
this.page = page;
this.selectionList();
},
pageSizeChange(pageSize) {
this.pageSize = this.$store.getters.userInfo.configContent;
this.selectionList();
},
pageChangeNo(page) {
this.pageNo = page;
this.addList();
},
pageSizeChangeNo(pageSize) {
this.pageSizeNo = this.$store.getters.userInfo.configContent;
this.addList();
}
},
computed: {},
mounted() {
//从数据库中查询下拉框数据
this.$http.get("sys/dictype/getDicTypeListCode", {}, {
_this: this
}, res => {
this.countryOptions = res.data.COUNTRY;
});
this.selectionList();
this.selectSign();
this.getTree();
for (let i = 0; i < this.dataList.length; i++) {
this.standMap.set(this.dataList[i].id, this.dataList[i]);
}
}
};
</script>
<style lang="less" scoped>
@import '~@/assets/styles/style';
.bzqdfb-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%;
}
}
}
.add-form-el-select {
/deep/ .el-select {
width: 210px;
}
}
.demo-drawer-content {
margin-top: 10px;
}
}
</style>