dongjh 4 月之前
父節點
當前提交
030cc26e19

+ 21 - 8
src/views/module_cmms/inspect/InspectList.vue

@@ -82,6 +82,12 @@
           </a-button>
         </template>
 
+        <span slot="status" slot-scope="text, record">
+          <a-tag v-if="record.status === '0'">{{ text }}</a-tag>
+          <a-tag v-if="record.status === '1'" color="green">{{ text }}</a-tag>
+          <a-tag v-if="record.status === '2'" color="blue">{{ text }}</a-tag>
+        </span>
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">巡检反馈</a>
 
@@ -104,7 +110,7 @@
       </a-table>
     </div>
 
-    <inspect-modal ref="modalForm" @ok="modalFormOk"></inspect-modal>
+    <inspect-modal ref="modalForm" @ok="modalFormOk" @custom-event="receiveFromChild"></inspect-modal>
   </a-card>
 </template>
 
@@ -155,18 +161,19 @@
           {
             title:'状态',
             align:"center",
-            dataIndex: 'status_dictText'
+            dataIndex: 'status_dictText',
+            scopedSlots: { customRender: 'status' }
           },
           {
             title:'巡检细项',
             align:"center",
             dataIndex: 'inspectdetail'
           },
-          {
-            title:'巡检计划ID',
-            align:"center",
-            dataIndex: 'inspectplanid'
-          },
+          // {
+          //   title:'巡检计划ID',
+          //   align:"center",
+          //   dataIndex: 'inspectplanid'
+          // },
           {
             title:'待办人',
             align:"center",
@@ -220,7 +227,13 @@
         fieldList.push({type:'string',value:'inspectplanid',text:'巡检计划ID',dictCode:''})
         fieldList.push({type:'string',value:'chargeruser',text:'待办人',dictCode:''})
         this.superFieldList = fieldList
-      }
+      },
+      // 接收子组件是否保存信息
+      receiveFromChild(ifSave) {
+        if (ifSave) {
+          this.loadData();
+        }
+      },
     }
   }
 </script>

+ 65 - 20
src/views/module_cmms/inspect/modules/InspectForm.vue

@@ -8,7 +8,8 @@
               :tree-data="treeData"
               show-icon
               showLine
-              default-expand-all
+              tree-default-expand-all
+              :expandedKeys="defaultExpandedKeys"
               :selected-keys="selectedKeys"
               :replaceFields="replaceFields"
               @select="onSelect"
@@ -37,11 +38,11 @@
               bordered
               rowKey="id"
               :columns="columns"
-              :dataSource="model.allItemList"
+              :dataSource="model.itemList"
               :pagination="false"
               class="j-table-force-nowrap">
               <template slot="iresult" slot-scope="text, record,index">
-                <a-form-model-item :prop="'allItemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
+                <a-form-model-item :prop="'itemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
                   <a-radio-group name="radioGroup" v-model="record.iresult">
                     <a-radio value="0">
                       正常
@@ -53,7 +54,7 @@
                 </a-form-model-item>
               </template>
               <template slot="iremark" slot-scope="text, record,index">
-                <a-form-model-item :prop="'allItemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
+                <a-form-model-item :prop="'itemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
                   <a-input v-model="record.iremark" placeholder="请输入点检备注"></a-input>
                 </a-form-model-item>
               </template>
@@ -118,17 +119,18 @@
           title:'title',
           key:'id'
         },
+        defaultExpandedKeys: [], // 默认展开节点的ID
         columns: [
-          // {
-          //   title: '序号',
-          //   dataIndex: '',
-          //   key:'rowIndex',
-          //   width:60,
-          //   align:"center",
-          //   customRender:function (t,r,index) {
-          //     return parseInt(index)+1;
-          //   }
-          // },
+          {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
           {
             title:'巡检标准编号',
             align:"center",
@@ -284,7 +286,7 @@
           this.treeData = this.setIcon(res.result.children)
           this.confirmLoading = false
           this.getAllItem();
-          console.log("allItemList", this.model.allItemList);
+          console.log("allItemList", this.model.allItemList, this.defaultExpandedKeys);
         })
       },
       // 设置树结构图标
@@ -303,8 +305,29 @@
         return setIconData
       },
       onSelect(selectedKeys, info) {
+        console.log("tree", selectedKeys, info, this.selectedKeys)
+        // setSelectedKeys(prevSelectedKeys => {
+        //   if (prevSelectedKeys.includes(info.node.key)) {
+        //     // 如果已经选中,则去除
+        //     return prevSelectedKeys.filter(key => key !== info.node.key);
+        //   } else {
+        //     // 如果未选中,则添加
+        //     return [...prevSelectedKeys, info.node.key];
+        //   }
+        // });
         //  二次点击树节点时selectedKeys为空,直接return中断执行
         if (selectedKeys.length === 0) return
+
+        // 先将itemList信息保存进allItemList中
+        this.model.itemList.forEach(item => {
+          for (var i = 0; i < this.model.allItemList.length; i++) {
+            if (this.model.allItemList[i].id === item.id) {
+              this.model.allItemList[i].iresult = item.iresult;
+              this.model.allItemList[i].iremark = item.iremark;
+            }
+          }
+        });
+
         this.selectedKeys = selectedKeys
         var props = info.selectedNodes[0].data.props
         if(props.type === '巡检内容'){
@@ -321,26 +344,36 @@
       },
       getAllItem() {
         var _this = this
-        _this.model.allItemList = [];
+        _this.model.itemList = [];
         this.treeData.forEach(option =>{
+          _this.defaultExpandedKeys.push(option.id);
           if (option.type == "巡检点") {
             option.children.forEach(address => {
+            _this.defaultExpandedKeys.push(address.id);
               address.inspectTcontentItemList.forEach(item => {
-                item.equipmentname = props.equipmentname
-                _this.model.allItemList.push(item)
+                _this.defaultExpandedKeys.push(item.id);
+                item.equipmentname = address.equipmentid
+                item.equipmentname = address.equipmentname
+                _this.model.itemList.push(item)
               });
             });
           }
           else if (option.type == "巡检路线") {
             option.children.forEach(line => {
+              _this.defaultExpandedKeys.push(line.id);
               line.children.forEach(address => {
+                _this.defaultExpandedKeys.push(address.id);
                 address.inspectTcontentItemList.forEach(item => {
-                  _this.model.allItemList.push(item)
+                  _this.defaultExpandedKeys.push(item.id);
+                  item.equipmentname = address.equipmentid
+                  item.equipmentname = address.equipmentname
+                  _this.model.itemList.push(item)
                 });
               });
             });
           }
         })
+        _this.model.allItemList = JSON.parse(JSON.stringify(_this.model.itemList));
       },
       getItemList(id){
         getAction(this.url.queryItemByCountId, {countId: id, inspectId: this.model.id}).then((res) => {
@@ -350,9 +383,21 @@
       },
       handleFeedback(){
         this.confirmLoading = true
-        putAction(this.url.feedback, this.model.itemList).then((res) => {
+
+        // 先将itemList信息保存进allItemList中
+        this.model.itemList.forEach(item => {
+          for (var i = 0; i < this.model.allItemList.length; i++) {
+            if (this.model.allItemList[i].id === item.id) {
+              this.model.allItemList[i].iresult = item.iresult;
+              this.model.allItemList[i].iremark = item.iremark;
+            }
+          }
+        });
+
+        putAction(this.url.feedback, this.model.allItemList).then((res) => {
           if(res.success){
             this.$message.success(res.message);
+            this.$emit('custom-event', true);
             this.edit(this.model)
           }else{
             this.$message.warning(res.message);

+ 8 - 2
src/views/module_cmms/inspect/modules/InspectModal.vue

@@ -6,7 +6,7 @@
     :bottons="false"
     @cancel="handleCancel">
 
-    <inspect-form ref="realForm" :disabled="disableSubmit"></inspect-form>
+    <inspect-form ref="realForm" :disabled="disableSubmit" @custom-event="receiveFromChild"></inspect-form>
   </u-modal>
 </template>
 
@@ -23,7 +23,8 @@
         title:'',
         width:800,
         visible: false,
-        disableSubmit: false
+        disableSubmit: false,
+        ifSave: false,
       }
     },
     methods: {
@@ -33,7 +34,12 @@
           this.$refs.realForm.edit(record);
         })
       },
+      // 接收子组件是否保存信息
+      receiveFromChild(ifSave) {
+        this.ifSave = ifSave;
+      },
       close () {
+        this.$emit('custom-event', this.ifSave);
         this.$emit('close');
         this.visible = false;
       },

+ 0 - 8
src/views/module_cmms/inspectAbnormalItems/InspectAbnormalItemsList.vue

@@ -257,7 +257,6 @@
       // 获取设备下拉列表
       getDeviceOption(){
         getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
-          console.log(111,res.result)
           this.deviceOptions = res.result.map((res) => {
             return {
               id: res.id,
@@ -267,12 +266,10 @@
           })
           // 存一个完整的设备表
           this.deviceOptionsAll = this.deviceOptions
-          console.log(7878,this.deviceOptionsAll)
         })
       },
       // 筛选设备
       searchDevice(value) {
-        console.log(1212,value,value.trim().length)
         // 若输入的值删除,则重新赋完整的设备列表
         if (value.trim().length === 0) {
           this.deviceOptions = this.deviceOptionsAll
@@ -281,15 +278,12 @@
         let panDuan = isNaN(parseFloat(value))
         if (!panDuan) {
           // 数字
-          console.log(777)
           let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentcode.includes(value));
           this.deviceOptions = filteredArray
         } else {
-          console.log(888)
           let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentname.includes(value));
           this.deviceOptions = filteredArray
         }
-        console.log(999,this.deviceOptions)
       },
       // 解决筛选后option不回显问题
       filterOptions(input, option) {                    
@@ -310,7 +304,6 @@
       },
       // 转报修
       handleTransrepair(record){
-        console.log(record)
         var obj = {
           repairname: record.inspectname,
           equipmentname: record.equipmentname,
@@ -322,7 +315,6 @@
           relid: record.id,
           unusualstatus: '2',
         }
-        console.log(obj)
         postAction(this.url.transrepair, obj).then((res) => {
           if(res.success){
             this.$message.success(res.message);

+ 2 - 8
src/views/module_cmms/spotcheck/modules/SpotcheckForm.vue

@@ -272,12 +272,10 @@
           })
           // 存一个完整的设备表
           this.deviceOptionsAll = this.deviceOptions
-          console.log(7878,this.deviceOptionsAll)
         })
       },
       // 筛选设备
       searchDevice(value) {
-        console.log(1212,value,value.trim().length)
         // 若输入的值删除,则重新赋完整的设备列表
         if (value.trim().length === 0) {
           this.deviceOptions = this.deviceOptionsAll
@@ -286,15 +284,12 @@
         let panDuan = isNaN(parseFloat(value))
         if (!panDuan) {
           // 数字
-          console.log(777)
           let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentcode.includes(value));
           this.deviceOptions = filteredArray
         } else {
-          console.log(888)
           let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentname.includes(value));
           this.deviceOptions = filteredArray
         }
-        console.log(999,this.deviceOptions)
       },
       // 解决筛选后option不回显问题
       filterOptions(input, option) {                    
@@ -310,13 +305,14 @@
       // 监听选择的设备
       handleChange(value){
         getAction(`/cmmsSpotcheck/cmmsSpotcheck/getInfoByEquipmentid/${value}`).then((res) => {
-          console.log(999,res)
           // this.model = res.result
           this.model.equipmentcode = res.result.equipmentcode
           this.model.equipmentname = res.result.equipmentname
           this.model.contentname = res.result.contentname
           this.model.contentcode = res.result.contentcode
+          this.model.contentcode = res.result.contentcode
           this.model.spotcheckdate = res.result.spotcheckdate
+          this.model.spotcheckcontid = res.result.id
           this.model.cmmsSpotcheckTitemList = res.result.cmmsSpotcheckTitemList
           this.model.id = ""
         })
@@ -365,7 +361,6 @@
                     url: res
                   }
                 })
-                console.log("00",this.modelWX)
                 httpurl2+=this.url.add2;
                 httpAction(httpurl2,this.modelWX,method).then((res)=>{
                   if(res.success){
@@ -379,7 +374,6 @@
               httpurl+=this.url.edit;
                method = 'put';
             }
-            console.log('怎么回事呀',!this.model.files)
             if (!this.model.files == true) {
               this.model.files = []
             } else {

+ 343 - 0
src/views/module_cmms/spotcheckAbnormalItems/spotcheckAbnormalItemsList.vue

@@ -0,0 +1,343 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="设备名称">
+              <!-- <a-input placeholder="请输入设备名称" v-model="queryParam.equipmentname"></a-input> -->
+              <!-- <j-search-select-tag v-model="queryParam.tcontequiptid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" /> -->
+              <a-select
+              v-model="queryParam.tcontequiptid"
+              placeholder="请输入设备名称或设备编号"
+              show-search
+              :filterOption="filterOptions"
+              @search="searchDevice"
+              allowClear>
+                <a-select-option v-for="(item, index) in deviceOptions" :key="index" :value="item.id" :label="item.equipmentname">
+                  <span>{{item.equipmentname}}</span>
+                  <span style="position: absolute;right: 2%;">{{ item.equipmentcode }}</span>
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="点检内容名称">
+              <a-input placeholder="请输入点检内容名称" v-model="queryParam.contentname"></a-input>
+            </a-form-item>
+          </a-col>
+          <template v-if="toggleSearchStatus">
+            <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="状态">
+                <j-dict-select-tag v-model="queryParam.unusualstatus" dictCode="common_status" placeholder="请选择状态" />
+              </a-form-item>
+            </a-col> -->
+          </template>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a> -->
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
+      <!-- <a-button type="primary" icon="download" @click="handleExportXls('巡检工单')">导出</a-button> -->
+      <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload> -->
+      <!-- 高级查询区域 -->
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
+      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown> -->
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div> -->
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="unusualstatus" slot-scope="text, record">
+          <a-tag v-if="record.unusualstatus === '0'">{{ text }}</a-tag>
+          <a-tag v-if="record.unusualstatus === '1'" color="orange">{{ text }}</a-tag>
+          <a-tag v-if="record.unusualstatus === '2'" color="red">{{ text }}</a-tag>
+        </span>
+
+        <span slot="action" slot-scope="text, record">
+          <!-- <a @click="handleEdit(record)">查看</a>
+          <a-divider type="vertical" /> -->
+          <!-- <a @click="handleEdit(record)">确认</a> -->
+          <a-popconfirm v-if="record.unusualstatus === '0' || record.unusualstatus === '' || record.unusualstatus === null" title="是否执行异常项目确认操作?" @confirm="() => handleConfirm(record)">
+            <a>确认</a>
+          </a-popconfirm>
+          <a-popconfirm v-else disabled>
+            <a style="color:#cdcdcd">确认</a>
+          </a-popconfirm>
+          <a-divider type="vertical" />
+          <a-popconfirm v-if="record.unusualstatus === '1' && record.equipmentid !== null && record.equipmentid !== ''" title="是否执行异常项目转报修操作?" @confirm="() => handleTransrepair(record)">
+            <a>转报修</a>
+          </a-popconfirm>
+          <a-popconfirm v-else disabled title="请先确认再转报修!">
+            <a style="color:#cdcdcd">转报修</a>
+          </a-popconfirm>
+
+          <!-- <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown> -->
+        </span>
+
+      </a-table>
+    </div>
+
+  </a-card>
+</template>
+
+<script>
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { postAction, getAction } from '@/api/manage'
+
+  export default {
+    name: 'spotAbnormalItemsList',
+    mixins:[JeecgListMixin, mixinDevice],
+    data () {
+      return {
+        description: '异常项目管理页面',
+        // 表头
+        columns: [
+          {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备编号',
+            align:"center",
+            dataIndex: 'equipmentcode'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'反馈时间',
+            align:"center",
+            dataIndex: 'itime'
+          },
+          // {
+          //   title:'安装地点',
+          //   align:"center",
+          //   dataIndex: 'address'
+          // },
+          {
+            title:'点检标准编号',
+            align:"center",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'点检标准名称',
+            align:"center",
+            dataIndex: 'itemname'
+          },
+          {
+            title:'状态',
+            align:"center",
+            dataIndex: 'unusualstatus_dictText',
+            scopedSlots: { customRender: 'unusualstatus' }
+          },
+          {
+            title:'处理人',
+            align:"center",
+            dataIndex: 'handleuser'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/cmmsSpotcheckTitem/cmmsSpotcheckTitem/list",
+          queryById: "/cmmsSpotcheckTitem/cmmsSpotcheckTitem/queryById",
+          // exportXlsUrl: "/cmmsInspect/cmmsInspect/exportXls",
+          transrepair: "/cmmsSpotcheckTitem/cmmsSpotcheckTitem/transrepair",
+          confirm: "/cmmsSpotcheckTitem/cmmsSpotcheckTitem/confirm",
+        },
+        dictOptions:{},
+        superFieldList:[],
+        deviceOptions: [],
+        deviceOptionsAll: [],
+      }
+    },
+    created() {
+      this.getSuperFieldList();
+      this.getDeviceOption();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          this.deviceOptionsAll = this.deviceOptions
+        })
+      },
+      // 筛选设备
+      searchDevice(value) {
+        // 若输入的值删除,则重新赋完整的设备列表
+        if (value.trim().length === 0) {
+          this.deviceOptions = this.deviceOptionsAll
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        let panDuan = isNaN(parseFloat(value))
+        if (!panDuan) {
+          // 数字
+          let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentcode.includes(value));
+          this.deviceOptions = filteredArray
+        } else {
+          let filteredArray = this.deviceOptionsAll.filter(item => item.equipmentname.includes(value));
+          this.deviceOptions = filteredArray
+        }
+      },
+      // 解决筛选后option不回显问题
+      filterOptions(input, option) {                    
+        return this.deviceOptions
+      },
+      // 确认
+      handleConfirm(record){
+        postAction(this.url.confirm, record).then((res) => {
+          if(res.success){
+            this.$message.success(res.message);
+            this.loadData();
+          }else{
+            this.$message.warning(res.message);
+          }
+        }).finally(() => {
+          // this.confirmLoading = false;
+        })
+      },
+      // 转报修
+      handleTransrepair(record){
+        var obj = {
+          repairname: record.contentname,
+          equipmentname: record.equipmentname,
+          equipmentid: record.equipmentid,
+          equipmentcode: record.equipmentcode,
+          priority: '0',
+          faultdate: record.itime,
+          faultdesc: '点检标准:' + record.itemname + '-异常',
+          relid: record.id,
+          unusualstatus: '2',
+        }
+        postAction(this.url.transrepair, obj).then((res) => {
+          if(res.success){
+            this.$message.success(res.message);
+            this.loadData();
+          }else{
+            this.$message.warning(res.message);
+          }
+        }).finally(() => {
+          // this.confirmLoading = false;
+        })
+      },
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        // fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        // fieldList.push({type:'string',value:'inspectcode',text:'工单编号',dictCode:''})
+        // fieldList.push({type:'string',value:'inspectname',text:'工单名称',dictCode:''})
+        // fieldList.push({type:'string',value:'tasktype',text:'任务类型:单次任务、周期任务',dictCode:''})
+        // fieldList.push({type:'string',value:'status',text:'状态:0待处理、1处理中、2已完成',dictCode:''})
+        // fieldList.push({type:'string',value:'inspectdetail',text:'巡检细项',dictCode:''})
+        // fieldList.push({type:'string',value:'inspectplanid',text:'巡检计划ID',dictCode:''})
+        // fieldList.push({type:'string',value:'chargeruser',text:'待办人',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 126 - 113
src/views/module_tpm/healthDiagnosis/index.vue

@@ -157,7 +157,7 @@
     </a-row>
     <a-row>
       <a-col>
-        <div class="trend-charts" ref="trendCharts"></div>
+        <div class="trend-charts" ref="trendCharts" :style="{ height: echartsHeight + 'px' }"></div>
       </a-col>
     </a-row>
   </div>
@@ -189,6 +189,7 @@ export default {
       gd03us: [],
       gd05us: [],
       gd06us: [],
+      echartsHeight: window.innerHeight - 140,
       // 表头
       columns: [
         {
@@ -358,144 +359,156 @@ export default {
       var _this = this
       var chartDom = this.$refs.trendCharts
       _this.myChart = echarts.init(chartDom)
+      _this.echartsHeight = 4 * 300;
+      var leftValue = '5%';
 
       var option = {
-        tooltip: {
-          trigger: 'axis',
-          // position: function (pt) {
-          //   return [pt[0], '5%']
-          // },
-        },
         title: {
           left: 'left',
           text: '报警时设备运行数据',
         },
-        // legend: {
-        //   data: ['GD02 U', 'GD03 U', 'GD05 U', 'GD06 U'],
-        // },
-        xAxis: {
-          type: 'category',
-          boundaryGap: false,
-          data: _this.times,
-        },
-        yAxis: {
-          type: 'value',
-          boundaryGap: [0, '100%'],
-        },
-        // dataZoom: [
-        //   {
-        //     type: 'inside',
-        //     start: 0,
-        //     end: 100,
-        //     xAxisIndex: 0,
-        //   },
-        //   {
-        //     start: 0,
-        //     end: 10,
-        //   },
-        //   {
-        //     show: true,
-        //     yAxisIndex: 0,
-        //     filterMode: 'empty',
-        //     width: 30,
-        //     height: '80%',
-        //     right: '7%',
-        //   },
-        // ],
+        grid: [
+          { left: leftValue, top: "5%", bottom: "78%" },
+          { left: leftValue, top: "26%", bottom: "54%" },
+          { left: leftValue, top: "54%", bottom: "26%" },
+          { left: leftValue, top: "78%", bottom: "5%" }
+        ],
+        xAxis: [
+          {
+            type: 'category',
+            gridIndex: 0,
+            boundaryGap: false,
+            name: '电流',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 1,
+            boundaryGap: false,
+            name: '电压',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 2,
+            boundaryGap: false,
+            name: '温度',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 3,
+            boundaryGap: false,
+            name: '湿度',
+            data: _this.times,
+          },
+        ],
+        yAxis: [
+          { type: 'value', gridIndex: 0 },
+          { type: 'value', gridIndex: 1 },
+          { type: 'value', gridIndex: 2 },
+          { type: 'value', gridIndex: 3 }
+        ],
         series: [
           {
-            name: 'GD02 U',
+            name: '实际值',
             type: 'line',
             symbol: 'none',
             sampling: 'lttb',
+            xAxisIndex: 0,
+            yAxisIndex: 0,
             itemStyle: {
               color: '#91CC75',
             },
+            data: _this.gd02us,
             markArea: {
               // 覆盖面积
               itemStyle: {
                 color: 'rgba(255, 173, 177, 0.4)',
               },
               data: [
-                // [
-                //   {
-                //     // name: 'Morning Peak',
-                //     xAxis: '07:02',
-                //   },
-                //   {
-                //     xAxis: '07:15',
-                //   },
-                // ],
                 [
-                  {
-                    // name: 'Evening Peak',
-                    xAxis: '11:14',
-                  },
-                  {
-                    xAxis: '11:28',
-                  },
+                  { xAxis: '11:14', },
+                  { xAxis: '11:28', },
                 ],
               ],
             },
-            // markPoint: { // 记录最大值和最小值
-            //   data: [
-            //     { type: 'max', name: 'Max' },
-            //     { type: 'min', name: 'Min' },
-            //   ],
-            // },
+          },
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 1,
+            yAxisIndex: 1,
+            itemStyle: {
+              color: '#91CC75',
+            },
             data: _this.gd02us,
+            markArea: {
+              // 覆盖面积
+              itemStyle: {
+                color: 'rgba(255, 173, 177, 0.4)',
+              },
+              data: [
+                [
+                  { xAxis: '11:14', },
+                  { xAxis: '11:28', },
+                ],
+              ],
+            },
           },
-          // {
-          //   name: 'GD03 U',
-          //   type: 'line',
-          //   symbol: 'none',
-          //   sampling: 'lttb',
-          //   itemStyle: {
-          //     color: '#EE6666',
-          //   },
-          //   markPoint: {
-          //     data: [
-          //       { type: 'max', name: 'Max' },
-          //       { type: 'min', name: 'Min' },
-          //     ],
-          //   },
-          //   data: _this.gd03us,
-          // },
-          // {
-          //   name: 'GD05 U',
-          //   type: 'line',
-          //   symbol: 'none',
-          //   sampling: 'lttb',
-          //   itemStyle: {
-          //     color: '#FAAD14',
-          //   },
-          //   markPoint: {
-          //     data: [
-          //       { type: 'max', name: 'Max' },
-          //       { type: 'min', name: 'Min' },
-          //     ],
-          //   },
-          //   data: _this.gd05us,
-          // },
-          // {
-          //   name: 'GD06 U',
-          //   type: 'line',
-          //   symbol: 'none',
-          //   sampling: 'lttb',
-          //   itemStyle: {
-          //     color: '#5470C6',
-          //   },
-          //   markPoint: {
-          //     data: [
-          //       { type: 'max', name: 'Max' },
-          //       { type: 'min', name: 'Min' },
-          //     ],
-          //   },
-          //   data: _this.gd06us,
-          // },
-        ],
-      }
-
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 2,
+            yAxisIndex: 2,
+            itemStyle: {
+              color: '#91CC75',
+            },
+            data: _this.gd02us,
+            markArea: {
+              // 覆盖面积
+              itemStyle: {
+                color: 'rgba(255, 173, 177, 0.4)',
+              },
+              data: [
+                [
+                  { xAxis: '11:14', },
+                  { xAxis: '11:28', },
+                ],
+              ],
+            },
+          },
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 3,
+            yAxisIndex: 3,
+            itemStyle: {
+              color: '#91CC75',
+            },
+            data: _this.gd02us,
+            markArea: {
+              // 覆盖面积
+              itemStyle: {
+                color: 'rgba(255, 173, 177, 0.4)',
+              },
+              data: [
+                [
+                  { xAxis: '11:14', },
+                  { xAxis: '11:28', },
+                ],
+              ],
+            },
+          },
+        ]
+      };
+      
       option && _this.myChart.setOption(option)
       setTimeout(() => {
         _this.myChart.resize()