123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <!--控制记录-->
- <template>
- <div class="app-container control">
- <div class="scrollbar-box" v-if="pageType == 0">
- <el-form :model="param" ref="queryForm" :inline="true" label-width="80px">
- <el-form-item label="关键字" prop="name">
- <el-input
- maxlength="10"
- v-model="param.searchValue"
- placeholder="预案名称/创建人"
- clearable
- size="small"
- />
- </el-form-item>
- <el-form-item label="启动条件" prop="startCondition" label-width="100px">
- <el-select v-model="param.startCondition" placeholder="请选择启动条件" clearable size="small">
- <el-option
- v-for="dict in deptOptions"
- :key="dict.describe"
- :label="dict.describe"
- :value="dict.describe"
- ></el-option>
- </el-select>
- </el-form-item>
- <!--<el-form-item label="创建时间">-->
- <!--<el-date-picker-->
- <!--:clearable="false"-->
- <!--v-model="dateRange"-->
- <!--size="small"-->
- <!--style="width: 240px"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--type="daterange"-->
- <!--range-separator="-"-->
- <!--start-placeholder="开始日期"-->
- <!--end-placeholder="结束日期"-->
- <!--></el-date-picker>-->
- <!--</el-form-item>-->
- <el-form-item style="float: right;" v-hasPermi="['laboratory:plan:add']">
- <p class="inquire-button-one" style="width:130px;" @click="tableClickButton(4)">定制预案</p>
- </el-form-item>
- <el-form-item>
- <p class="inquire-button-one" @click="onSearch">查询</p>
- <p class="reset-button-one" @click="resetForm">重置</p>
- </el-form-item>
- </el-form>
- <el-table v-loading="loading" border :data="tableData">
- <el-table-column label="预案名称" align="center" prop="name" :show-overflow-tooltip="true"/>
- <el-table-column label="启动条件" align="center" prop="startCondition" :show-overflow-tooltip="true" width="340"/>
- <el-table-column label="创建人" align="center" prop="createBy" width="180"/>
- <el-table-column label="创建时间" align="center" prop="createTime" width="200"/>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="340" v-if="tableButtonType">
- <template slot-scope="scope">
- <div class="button-box">
- <p class="table-min-button" style="margin-left:20px!important;" v-hasPermi="['laboratory:planjoin:edit']" @click="tableClickButton(1,scope.row)">关联实验室</p>
- <p class="table-min-button" style="margin-left:40px!important;" v-show="userId==scope.row.userId" v-hasPermiAnd="['laboratory:plan:query','laboratory:plan:edit']" @click="tableClickButton(2,scope.row)">编辑</p>
- <p class="table-min-button" style="margin-left:40px!important;color:#FE2B2B;" v-show="userId==scope.row.userId" v-hasPermi="['laboratory:plan:remove']" @click="tableClickButton(3,scope.row)">删除</p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- layout="total, prev, pager, next, sizes, jumper"
- :page.sync="param.pageNum"
- :limit.sync="param.pageSize"
- @pagination="getListPlan"
- />
- </div>
- <!--添加编辑-->
- <add-plan-page v-if="pageType == 1" :addPlanData="addPlanData"></add-plan-page>
- <!-- 查看 -->
- <detail-plan-page v-if="pageType == 2" :pageData2="pageData2"></detail-plan-page>
- <!--关联实验室-->
- <association-page v-if="pageType == 4" :associationData="associationData"></association-page>
- <!-- 关联记录 -->
- <el-dialog title='关联记录' @close="handleClose" :visible.sync="dialogVisible2" width="80%">
- <div class="scrollbar-box" style="padding:0;margin:0 auto;height:700px;overflow-y: scroll;display: flex;flex-direction: column;flex:1;">
- <relevance-record-page v-if="pageType == 3" :pageData3="pageData3" style="display: flex;flex-direction: column;flex:1;"></relevance-record-page>
- </div>
- </el-dialog>
- <!--新增预案-->
- <el-dialog title="定制预案" v-if="addFormOpen" :visible.sync="addFormOpen" width="500px" append-to-body>
- <el-form ref="addForm" :model="addForm" :rules="rules" label-width="80px">
- <el-form-item label="预案名称" prop="name">
- <el-input v-model="addForm.name" placeholder="请输入预案名称" maxLength="15"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- <el-button style="width:100px;" type="primary" @click="submitForm">配置规则</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- updatePlan,
- listPlan,
- getUserRoleBySub,
- getLabRiskPlanRepeat,
- getLabRiskPlanJoinSub,
- riskPlanJoinSub,
- delPlan,
- getUserRoleBySubOperation
- } from "@/api/laboratory/plan";
- import addPlanPage from "./newAddPlan.vue";
- import detailPlanPage from "./detailPlan.vue";
- import associationPage from "./newAssociatedPage.vue";
- import relevanceRecordPage from "../distribution/index";
- import {listDepartments} from "@/api/system/dept";
- import {listClassifiedAll} from "@/api/laboratory/classified";
- import {listClasstypeAll} from "@/api/laboratory/classtype";
- import {authListSubject} from "@/api/laboratory/subject";
- import { selectRiskPlanLeveList, addPlan, delPlanData } from "@/api/evacuation3_2/index";
- import { optionSensor } from "@/api/laboratory/sensor";
- export default {
- components: {
- addPlanPage,
- detailPlanPage,
- relevanceRecordPage,
- associationPage
- },
- name: "Plan",
- data() {
- return {
- tableButtonType:this.hasPermiDom(['laboratory:plan:query','laboratory:planjoin:edit','laboratory:distribution:list','laboratory:plan:query','laboratory:plan:edit','laboratory:plan:remove']),
- //页面状态
- pageType:0,
- // 遮罩层
- loading: false,
- dateRange: [],
- //启动条件
- deptOptions:[],
- // 查询参数
- param: {
- pageNum: 1,
- pageSize:20,
- searchValue: null,
- startCondition: null,
- },
- tableData: [],
- total: 0,
- pageData2:{},
- pageData3:{},
- //关联实验室
- dialogVisible:false,
- //关联记录
- dialogVisible2:false,
- typeList:[],
- levelList:[],
- dialogTable:[],
- checkedLabList:[],//需要选中的实验室
- joinSubOper:[],
- userId:localStorage.getItem('userId'),
- //新增预案
- addFormOpen:false,
- addForm:{},
- // 表单校验
- rules: {
- name: [
- { required: true, message: "请输入预案名称", trigger: "change" },
- { required: true, message: "请输入预案名称", validator: this.spaceJudgment, trigger: "change" }
- ],
- },
- //关联页面传参数据
- associationData:{},
- addPlanData:{},
- };
- },
- methods: {
- // 操作按钮 1.关联 2.编辑 3.删除 4.新增
- tableClickButton(type,item){
- console.log('tableClickButton',type)
- let self = this;
- if(type == 1){
- this.$set(this,'associationData',JSON.parse(JSON.stringify(item)));
- this.$set(this,'pageType',4);
- }else if(type == 2){
- this.$set(this,'addPlanData',JSON.parse(JSON.stringify({id:item.id,name:item.name})));
- this.$set(this,'pageType',1);
- }else if(type == 3){
- this.$confirm('是否确认删除该预案?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- delPlanData(item.id).then(response => {
- self.msgSuccess(response.msg)
- self.getListPlan();
- });
- }).then(() => {
- }).catch(() => {});
- }else if(type == 4){
- this.$set(this,'addFormOpen',true);
- this.$set(this,'addForm',{});
- }else if(type == 5){
- this.$set(this,'pageType',0);
- this.getListPlan();
- }else if(type == 6){
- this.$set(this,'pageType',1);
- }
- },
- //新增预案-关闭
- cancel(){
- this.$set(this,'addFormOpen',false);
- this.$set(this,'addForm',{});
- },
- //新增预案-提交
- submitForm(){
- let self = this;
- this.$refs["addForm"].validate(valid => {
- if (valid) {
- let obj = {
- name:this.addForm.name
- }
- addPlan(obj).then((response) => {
- this.msgSuccess(response.msg)
- this.$set(this,'addFormOpen',false);
- setTimeout(function(){
- self.tableClickButton(2,{id:response.data,name:self.addForm.name,});
- },500);
- // this.tableClickButton(2,{id:response.data,name:this.addForm.name,});
- // this.$set(this,'addPlanData',{
- //
- // });
- // self.$set(this,'addForm',{});
- // self.$set(this,'pageType',1);
- });
- }
- })
- },
- //查询
- onSearch() {
- this.getListPlan();
- },
- //重置
- resetForm() {
- this.$set(this.param,'searchValue',null);
- this.$set(this.param,'startCondition',null);
- this.onSearch();
- },
- //监听关联记录弹窗关闭
- handleClose(){
- this.pageType=0
- },
- /** 查询启动条件 */
- getDeptListTow() {
- optionSensor({}).then(response => {
- this.$set(this, 'deptOptions', response.data)
- });
- },
- /**获取分级*/
- getListClassifiedAll(){
- listClassifiedAll().then(response=>{
- if(response.code==200){
- this.levelList = response.data
- }
- })
- },
- /**获取分类*/
- getListClasstypeAll(){
- listClasstypeAll().then(response=>{
- if(response.code==200){
- this.typeList = response.data;
- }
- });
- },
- /** 查询风险预案列表 */
- getListPlan() {
- let _this=this;
- this.loading = true;
- selectRiskPlanLeveList(this.param).then(response => {
- this.$set(this,'tableData',response.rows)
- // this.tableData = response.rows;
- this.total = response.total;
- this.loading = false;
- // this.getList();
- });
- },
- },
- mounted(){
- this.getDeptListTow();
- this.getListClassifiedAll();
- this.getListClasstypeAll();
- this.getListPlan();
- },
- }
- </script>
- <style scoped lang="scss">
- /*#app .app-container{
- background: #fff;
- border-radius: 0px;
- overflow: hidden;
- padding: 10px;
- margin: 0;
- box-shadow:none;
- }*/
- .control{
- flex: 1;
- display: flex!important;
- flex-direction: column;
- overflow: hidden;
- box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
- .scrollbar-box{
- overflow: hidden;
- display: flex!important;
- flex-direction: column;
- height: 100%;
- width: 100%;
- padding:20px!important;
- box-sizing: border-box;
- /* box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
- padding:20px!important;*/
- }
- .button-box{
- width:326px;
- display: flex;
- }
- .form-box{
- display:flex;
- .null-p{
- flex:1;
- }
- }
- }
- </style>
|