From 234d1f0154a481e119ff53c3d86cb528badf55ac Mon Sep 17 00:00:00 2001
From: cqf <2252655793@qq.com>
Date: 星期三, 18 五月 2022 18:01:32 +0800
Subject: [PATCH] 接口对接

---
 src/views/safetyHazardAccount/index.vue |  476 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 301 insertions(+), 175 deletions(-)

diff --git a/src/views/safetyHazardAccount/index.vue b/src/views/safetyHazardAccount/index.vue
index 22d59ab..e15ac5a 100644
--- a/src/views/safetyHazardAccount/index.vue
+++ b/src/views/safetyHazardAccount/index.vue
@@ -5,7 +5,7 @@
                 <el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input>
             </el-form-item>
             <el-form-item label="检查单位">
-                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择"  @change="changeJCDW">
+                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeJCDW">
                     <el-option
                         v-for="item in JCDWList"
                         :key="item.value"
@@ -115,7 +115,7 @@
                     </el-option>
                 </el-select>
             </el-form-item>
-             <el-form-item label="深入现场情况">
+            <el-form-item label="深入现场情况">
                 <el-select v-model="listQuery.form.createBy" placeholder="请选择">
                     <el-option
                         v-for="item in llrList"
@@ -125,7 +125,7 @@
                     </el-option>
                 </el-select>
             </el-form-item>
-             <el-form-item label="是否关联">
+            <el-form-item label="是否关联">
                 <el-select v-model="listQuery.form.createBy" placeholder="请选择">
                     <el-option
                         v-for="item in llrList"
@@ -135,7 +135,7 @@
                     </el-option>
                 </el-select>
             </el-form-item>
-             <el-form-item label="复查单位">
+            <el-form-item label="复查单位">
                 <el-select v-model="listQuery.form.createBy" placeholder="请选择">
                     <el-option
                         v-for="item in llrList"
@@ -147,48 +147,53 @@
             </el-form-item>
             <el-form-item label="检查时间">
                 <el-col :span="11">
-                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
+                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateStart"
+                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                 </el-col>
                 <el-col style="text-align:center" :span="2">-</el-col>
                 <el-col :span="11">
-                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd" style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
+                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.check_dateEnd"
+                                    style="width: 100%;" value-format="yyyy-MM-dd"></el-date-picker>
                 </el-col>
             </el-form-item>
             <el-form-item label="限改时间">
                 <el-col :span="11">
-                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
+                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeStart"
+                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                 </el-col>
                 <el-col style="text-align:center" :span="2">-</el-col>
                 <el-col :span="11">
-                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd" value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
+                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.alter_timeEnd"
+                                    value-format="yyyy-MM-dd" style="width: 100%;"></el-date-picker>
                 </el-col>
             </el-form-item>
             <el-form-item style="text-align:center;padding:0 50px">
-                <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询</el-button>
+                <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询
+                </el-button>
                 <el-button type="primary" class="btns" size="small" @click="reset()">重置</el-button>
                 <el-button type="primary" class="btns" size="small" icon="el-icon-upload2">导出excel</el-button>
             </el-form-item>
         </el-form>
-           <el-row class="title-center">
+        <el-row class="title-center">
             <el-col :span="12">
-              <el-radio-group v-model="radio1">
-            <el-radio-button label="超期整改">超期整改</el-radio-button>
-            <el-radio-button label="到期未整改">到期未整改</el-radio-button>
-            <el-radio-button label="二次整改">二次整改</el-radio-button>
-            <el-radio-button label="正在整改">正在整改</el-radio-button>
-             <el-radio-button label="正在复查">正在复查</el-radio-button>
-              <el-radio-button label="整改完成">整改完成</el-radio-button>
-               <el-radio-button label="全部隐患">全部隐患</el-radio-button>
-          </el-radio-group>
+                <el-radio-group v-model="YHType">
+                    <el-radio-button label="1">超期整改</el-radio-button>
+                    <el-radio-button label="2">到期未整改</el-radio-button>
+                    <el-radio-button label="3">二次整改</el-radio-button>
+                    <el-radio-button label="4">正在整改</el-radio-button>
+                    <el-radio-button label="5">正在复查</el-radio-button>
+                    <el-radio-button label="6">整改完成</el-radio-button>
+                    <el-radio-button label="0">全部隐患</el-radio-button>
+                </el-radio-group>
             </el-col>
-            <el-col :span="12" style="text-align:right;" v-if="radio1=='全部隐患'">
-                <el-button type="primary" class="btns" size="small">督查督办</el-button>
-                <el-button type="primary" class="btns" size="small">举一反三</el-button>
+            <el-col :span="12" style="text-align:right;" v-if="YHType=='0'">
+                <el-button type="primary" class="btns" size="small" @click="supervision('1')">督查督办</el-button>
+                <el-button type="primary" class="btns" size="small" @click="supervision('2')">举一反三</el-button>
                 <el-button type="primary" class="btns" size="small" @click="base()">双基考核</el-button>
-                <el-button type="primary" class="btns" size="small">删除</el-button>
+                <el-button type="primary" class="btns" size="small" @click='deleteBatch'>删除</el-button>
             </el-col>
         </el-row>
-        <el-table :data="tableData" style="width: 100%"  @selection-change="changeBox">
+        <el-table :data="tableData" ref="pageTable" style="width: 100%" @selection-change="changeBox">
             <el-table-column type="selection" width="55" align="center"></el-table-column>
             <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
             <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
@@ -196,25 +201,25 @@
             <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
             <el-table-column label="隐患项目" align="center">
                 <el-table-column prop="check_date" label="检查时间" width="120" align="center"></el-table-column>
-                <el-table-column prop="address" label="地点" align="center"> </el-table-column>
-                <el-table-column prop="ht_content" label="内容" align="center"> </el-table-column>
-                <el-table-column prop="ht_typesub" label="类别" align="center"> </el-table-column>
-                <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
+                <el-table-column prop="address" label="地点" align="center"></el-table-column>
+                <el-table-column prop="ht_content" label="内容" align="center"></el-table-column>
+                <el-table-column prop="ht_typesub" label="类别" align="center"></el-table-column>
+                <el-table-column prop="ht_level" label="级别" align="center"></el-table-column>
             </el-table-column>
             <el-table-column label="整改计划" align="center">
-                <el-table-column prop="measure" label="整改措施" align="center"> </el-table-column>
-                <el-table-column prop="ht_branch" label="隐患部门" align="center"> </el-table-column>
-                <el-table-column prop="duty_officer" label="责任人" align="center"> </el-table-column>
+                <el-table-column prop="measure" label="整改措施" align="center"></el-table-column>
+                <el-table-column prop="ht_branch" label="隐患部门" align="center"></el-table-column>
+                <el-table-column prop="duty_officer" label="责任人" align="center"></el-table-column>
                 <el-table-column prop="alter_time" label="限改时间" width="120" align="center"></el-table-column>
                 <!-- <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column> -->
             </el-table-column>
             <el-table-column label="整改情况" align="center">
-                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" align="center"> </el-table-column>
-                <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"> </el-table-column>
-                <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"> </el-table-column>
-                <el-table-column prop="CALLBACKTIME" label="复查时间"  width="120" align="center"></el-table-column>
+                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" align="center"></el-table-column>
+                <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"></el-table-column>
+                <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"></el-table-column>
+                <el-table-column prop="CALLBACKTIME" label="复查时间" width="120" align="center"></el-table-column>
             </el-table-column>
-            <el-table-column  label="隐患处理状态" align="center">
+            <el-table-column label="隐患处理状态" align="center">
                 <template slot-scope="scope">
                     <span v-if="scope.row.step =='1'">初始状态</span>
                     <span v-if="scope.row.step =='2'">整改中</span>
@@ -224,19 +229,20 @@
             </el-table-column>
             <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                 <template slot-scope="scope">
-                    <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
+                    <span
+                        v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                     <span v-else>已关联</span>
                 </template>
             </el-table-column>
-            <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
-            <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
-            <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
+            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
+            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
+            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
             <!-- <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                 <template slot-scope="scope">
                     <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                 </template>
             </el-table-column> -->
-            <el-table-column prop="date" label="操作" align="center"  fixed="right">
+            <el-table-column prop="date" label="操作" align="center" fixed="right">
                 <template slot-scope="scope">
                     <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                     <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
@@ -256,34 +262,70 @@
             >
             </el-pagination>
         </div>
+
+        <!--批量复查弹窗-->
+        <el-dialog
+            title="提示"
+            :visible.sync="dialogVisible"
+            :close-on-click-modal="false"
+            width="40%"
+        >
+            <el-form>
+                <el-row>
+                    <el-checkbox style="width: 80px;height: 30px" v-for="item in YHBMList" v-model="checked"
+                                 :label="item.branch_id">{{
+                            item.branch_name
+                        }}
+                    </el-checkbox>
+                </el-row>
+                <el-row>
+                    <el-col :span="22">
+                        <el-form-item style="text-align: center;">
+                            <el-button class="btn" size="small" type="primary" @click="submitForm()">
+                                保存
+                            </el-button>
+                            <el-button size="small" @click="close()">关闭</el-button>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+        </el-dialog>
+
     </div>
+
 </template>
 <script>
-import {getPageList,delDanger} from "@/api/sgyhpczl/hiddenDangerRegistration";
-import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
+import {getPageList, inspect_do, draw_inferences_do} from "@/api/sgyhpczl/safetyHazardAccount";
+import {delDanger} from "@/api/sgyhpczl/hiddenDangerRegistration";
+
+import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
+
 export default {
     data() {
         return {
-            radio1:'超期整改',
-            selectedList:[],
-            reList:[{label:"未关联",value:0}],
-            llrList:[],
+            dialogVisible: false,
+            checked: [],
+            YHType: '0',
+            selectedList: [],
+            reList: [{label: "未关联", value: 0}],
+            llrList: [],
             options: [],
-            form:{},
-
-            JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
-            JCBMList:[],
-            YHLXList:[],
-            BCList:[],
-            JCLBList:[],
-            YHBMList:[],
-            YHJBList:[],
+            form: {},
+            buttonType: "",
+            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
+            JCBMList: [],
+            YHLXList: [],
+            BCList: [],
+            JCLBList: [],
+            YHBMList: [],
+            YHJBList: [],
             tableData: [],
-            listQuery:{
-                page:1,
-                limit:10,
-                form:{
-                    ht_community:"众泰煤焦化"
+            requestData: {},
+            listQuery: {
+                page: 1,
+                limit: 10,
+                form: {
+                    ht_community: "众泰煤焦化"
                 },
             },
             currentPage: 1,
@@ -291,7 +333,18 @@
             recordTotal: 0,
         };
     },
-    mounted(){
+    watch: {
+        "YHType": function (newVal, oldVal) {
+            if (newVal) {
+                this.listQuery.type = parseInt(newVal);
+                this.getPageList();
+            }
+        },
+        "dialogVisible": function (newVal, oldVal) {
+            this.checked = [];
+        }
+    },
+    mounted() {
         this.getPageList()
         this.initYHLX()
         this.initYHJB()
@@ -300,21 +353,24 @@
         this.initLlr()
         this.initYHBM()
     },
-    methods:{
-        deleteBatch(){
-            if(this.selectedList==null ||this.selectedList.length==0 ){
-                this.$message({type:'warning', message:'至少选中一条数据', duration:3000})
+    methods: {
+        close() {
+            this.dialogVisible = false;
+        },
+        deleteBatch() {
+            if (this.selectedList == null || this.selectedList.length == 0) {
+                this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
                 return
             }
-            var ids=this.selectedList.map((obj) => {
+            var ids = this.selectedList.map((obj) => {
                 return obj.id
             }).join(",")
-            this.$confirm('确认删除吗','提示', {
+            this.$confirm('确认删除吗', '提示', {
                 confirmButtonText: '确认',
                 cancelButtonText: '取消',
                 type: 'warning'
             })
-                .then(()=>{
+                .then(() => {
                     delDanger(ids).then(() => {
                         this.getPageList()
                         this.$notify({
@@ -325,168 +381,168 @@
                         });
                     });
                 })
-                .catch(error =>{
+                .catch(error => {
                 });
         },
-        changeBox(val){
+        changeBox(val) {
             this.selectedList = []
             val.forEach((item) => {
                 this.selectedList.push(item)
             })
         },
-        initLlr(){
-            initLlr().then(res=>{
-                if (res.data.ok==1){
-                    this.llrList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initLlr() {
+            initLlr().then(res => {
+                if (res.data.ok == 1) {
+                    this.llrList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        initYHBM(){
-            initYHBM().then(res=>{
-                if (res.data.ok==1){
-                    this.YHBMList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initYHBM() {
+            initYHBM().then(res => {
+                if (res.data.ok == 1) {
+                    this.YHBMList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        changeJCDW(val){
-            initJCBM(val).then(res=>{
-                if (res.data.ok==1){
-                    this.JCBMList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        changeJCDW(val) {
+            initJCBM(val).then(res => {
+                if (res.data.ok == 1) {
+                    this.JCBMList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        checkTime(){
-            if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
-                if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
-                }else {
-                    this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
+        checkTime() {
+            if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
+                if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
+                } else {
+                    this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000})
                     return
                 }
 
             }
-            if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
-                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
-                }else {
-                    this.$message({type:'error', message:"请选择检查开始时间", duration:3000})
+            if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
+                if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
+                } else {
+                    this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000})
                     return
                 }
             }
-            if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){
-                if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){
-                }else {
-                    this.$message({type:'error', message:"请选择限改结束时间", duration:3000})
+            if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
+                if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
+                } else {
+                    this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000})
                     return
                 }
 
             }
-            if(this.listQuery.form.alter_timeEnd!=null && this.listQuery.form.alter_timeEnd!=''){
-                if(this.listQuery.form.alter_timeStart!=null && this.listQuery.form.alter_timeStart!=''){
-                }else {
-                    this.$message({type:'error', message:"请选择改开始时间", duration:3000})
+            if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
+                if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
+                } else {
+                    this.$message({type: 'error', message: "请选择改开始时间", duration: 3000})
                     return
                 }
             }
         },
-        getPageList(){
-            this.listQuery.page=1
+        getPageList() {
+            this.listQuery.page = 1
             this.checkTime()
-            getPageList(this.listQuery).then(res=>{
-                if (res.data.ok==1) {
+            getPageList(this.listQuery).then(res => {
+                if (res.data.ok == 1) {
                     this.tableData = res.data.data.items
-                     this.recordTotal=res.data.data.total
-                }else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+                    this.recordTotal = res.data.data.total
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        reset(){
-            this.listQuery.form={ht_community:"众泰煤焦化"}
+        reset() {
+            this.listQuery.form = {ht_community: "众泰煤焦化"}
             this.getPageList()
         },
-        handleSizeChange(val){
+        handleSizeChange(val) {
             this.listQuery.limit = val
             this.getPageListForPagination();
         },
-        handleCurrentChange(val){
+        handleCurrentChange(val) {
             this.listQuery.page = val
             this.getPageListForPagination();
         },
-        getPageListForPagination(){
+        getPageListForPagination() {
             this.checkTime()
-            getPageList(this.listQuery).then(res=>{
-                if (res.data.ok==1) {
+            getPageList(this.listQuery).then(res => {
+                if (res.data.ok == 1) {
                     this.tableData = res.data.data.items
-                    this.recordTotal=res.data.data.total
-                }else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+                    this.recordTotal = res.data.data.total
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        initYHLX(){
-            initYHLX().then(res=>{
-                if (res.data.ok==1){
-                    this.YHLXList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initYHLX() {
+            initYHLX().then(res => {
+                if (res.data.ok == 1) {
+                    this.YHLXList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        initYHJB(){
-            initYHJB().then(res=>{
-                if (res.data.ok==1){
-                    this.YHJBList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initYHJB() {
+            initYHJB().then(res => {
+                if (res.data.ok == 1) {
+                    this.YHJBList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        initBC(){
-            initBC().then(res=>{
-                if (res.data.ok==1){
-                    this.BCList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initBC() {
+            initBC().then(res => {
+                if (res.data.ok == 1) {
+                    this.BCList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        initJCLB(){
-            initJCLB().then(res=>{
-                if (res.data.ok==1){
-                    this.JCLBList=res.data.data
-                } else{
-                    this.$message({type:'error', message:res.data.msg, duration:3000})
+        initJCLB() {
+            initJCLB().then(res => {
+                if (res.data.ok == 1) {
+                    this.JCLBList = res.data.data
+                } else {
+                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                 }
             })
         },
-        updateClick(row){
+        updateClick(row) {
             this.$router.push({
-                path:"/safetyedit"
+                path: "/hiddenDangerAdd?id=" + row.id +"&route=safetyHazardAccount"
             })
         },
-        jump(){
+        jump() {
             this.$router.push({
-                path:"/hiddenDangerAdd"
+                path: "/hiddenDangerAdd"
             })
         },
         // 发送隐患单跳转
-        handleClick(row){
+        handleClick(row) {
             this.$router.push({
-                path:"/hiddenDangerList?id="+row.id,
+                path: "/hiddenDangerList?id=" + row.id,
             })
         },
-        deleteClick(row){
-            this.$confirm('确认删除吗','提示', {
+        deleteClick(row) {
+            this.$confirm('确认删除吗', '提示', {
                 confirmButtonText: '确认',
                 cancelButtonText: '取消',
                 type: 'warning'
             })
-                .then(()=>{
+                .then(() => {
                     delDanger(row.id).then(() => {
                         this.getPageList()
                         this.$notify({
@@ -497,34 +553,104 @@
                         });
                     });
                 })
-                .catch(error =>{
+                .catch(error => {
                 });
         },
-        base(){
+        base() {
             this.$router.push({
-                path:"/Dualbase"
+                path: "/Dualbase"
             })
+        },
+        supervision(type) {
+            var selectDataList = this.$refs.pageTable.selection;
+            this.buttonType = type;
+            if (selectDataList.length != 1) {
+                this.$message({
+                    type: 'warning',
+                    message: '请选择一条数据!'
+                });
+                return false;
+            } else {
+                this.requestData.id = selectDataList[0].id;
+                this.dialogVisible = true;
+
+            }
+        },
+        submitForm() {
+            if (this.checked.length == 0) {
+                this.$message({
+                    type: 'warning',
+                    message: '请勾选需要发送的部门!'
+                });
+                return;
+            }
+            this.requestData.branchIds = this.checked.join(";");
+            if (this.buttonType == '1') {
+                inspect_do(this.requestData).then(res => {
+                    if (res.data.ok) {
+                        this.$message({
+                            type: 'success',
+                            message: res.data.msg
+                        });
+                        this.dialogVisible = false;
+                        this.getPageList();
+                    } else {
+                        this.$message({
+                            type: 'error',
+                            message: res.data.msg
+                        });
+                    }
+                })
+            } else {
+                var checkData = this.YHBMList.filter(n => {
+                    return this.checked.indexOf(n.branch_id) != -1;
+                })
+                var branchNames = "";
+                checkData.forEach(n => {
+                    branchNames += n.branch_name + ";";
+                })
+                this.requestData.branchNames = branchNames;
+                draw_inferences_do(this.requestData).then(res => {
+                    if (res.data.ok) {
+                        this.$message({
+                            type: 'success',
+                            message: res.data.msg
+                        });
+                        this.dialogVisible = false;
+                        this.getPageList();
+                    } else {
+                        this.$message({
+                            type: 'error',
+                            message: res.data.msg
+                        });
+                    }
+                })
+            }
         }
     }
 };
 </script>
 <style scoped>
- .inquire {
-        display: flex;
-        justify-content: left;
-        flex-wrap: wrap;
-    }
-    .inquire .el-form-item {
-        padding: 0 30px;
-    }
-    .title-center {
-        padding: 20px 0;
-    }
-    .btns {
-        background-color: #034ea2;
-        border: 1px solid #034ea2;
-    }
-    .title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
+.inquire {
+    display: flex;
+    justify-content: left;
+    flex-wrap: wrap;
+}
+
+.inquire .el-form-item {
+    padding: 0 30px;
+}
+
+.title-center {
+    padding: 20px 0;
+}
+
+.btns {
+    background-color: #034ea2;
+    border: 1px solid #034ea2;
+}
+
+.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
     border: none;
 }
 

--
Gitblit v1.9.2