Explorar el Código

Merge branch 'master' of http://152.136.206.27:3000/dongjh/ems_client

dongjh hace 1 año
padre
commit
8e8e6a9911

+ 141 - 0
src/components/module_ems/UEquipmentTypeTree/UEquipmentTypeTree.vue

@@ -0,0 +1,141 @@
+<template>
+  <div class="equipment-tree-container">
+    <a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
+    <div class="tree-container">
+      <a-tree
+        :expanded-keys="expandedKeys"
+        auto-expand-parent
+        :tree-data="tpmTreeData"
+        @expand="onExpand"
+        :replace-fields="replaceFields"
+        @select="selectNode"
+        >
+        <!-- :filter-tree-node="filterTreeNode" -->
+      </a-tree>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { getAction } from '@api/manage'
+  export default({
+    name: 'UEquipmentTree',
+    components: {
+    },
+    data () {
+      return {
+        expandedKeys: [],
+        searchValue: '',
+        autoExpandParent: true,
+        tpmListData: [], // 原始数据
+        tpmTreeData: [], // 树形列表使用数据
+        replaceFields: {
+          children: 'children',
+          title: 'name',
+        },
+      }
+    },
+    created() {
+      this.getTpmTreeData()
+    },
+    methods: {
+      getTpmTreeData(){
+        getAction(`/tpmEquipmentTree/tpmEquipmentTree/listtypetree`).then(res=>{
+          if (res.success) {
+            // 防止res.result对tpmListData造成地址赋值的问题
+            this.tpmListData = JSON.parse(JSON.stringify(res.result))
+            this.tpmTreeData = this.handleTree(res.result, "id", "parentid")
+            console.log(this.tpmTreeData)
+          } else {
+            
+          }
+        })
+      },
+      filterTreeNode(node) {
+        // console.log(node)
+        // if (!inputValue) return true;
+        return node.title.indexOf('设备') !== -1;
+      },
+      onExpand(expandedKeys) {
+        this.expandedKeys = expandedKeys;
+        this.autoExpandParent = false;
+      },
+      onChange(e) {
+        const value = e.target.value;
+        // 筛选后数据
+        var filterData = []
+        // 筛选符合条件的数据:包含当前搜索的项
+        console.log(this.tpmListData)
+        filterData = this.tpmListData.filter(item => (item.name.indexOf(value) !== -1))
+        // var data = []
+        // filterData.forEach(item => {
+        //   var arr = this.tpmListData.filter(data => item.parentid === data.id)
+        //   console.log('父级', arr)
+        //   // filterData = [...filterData, ...arr]
+        // })
+        // 循环寻找父级
+        // console.log(this.findParents(this.tpmTreeData, '287813167808513'))
+
+        
+
+        
+        this.tpmTreeData = this.handleTree(filterData, "id", "parentid")
+        // const expandedKeys = dataList.map(item => {
+        //   if (item.name.indexOf(value) > -1) {
+        //       // return getParentKey(item.key, gData);
+        //       return this.filterNode(item.key, gData);
+        //   }
+        //   return null;
+        // }).filter((item, i, self) => item && self.indexOf(item) === i);
+        // Object.assign(this, {
+        //   expandedKeys,
+        //   searchValue: value,
+        //   autoExpandParent: true,
+        // });
+      },
+      // findParents(treeData,id){
+      //   let allparents = []
+      //   if(treeData.length==0){
+      //     return 
+      //   }
+
+      //   let findele = (data,id) => {
+      //     if(!id) return
+      //     data.forEach((item,index) => {
+      //       if(item.id == id){
+      //         allparents.unshift(item.id)
+      //         findele(treeData,item.parentid)
+
+      //       }else{
+      //         if(!!item.children){
+      //             findele(item.children,id)
+      //         }
+              
+      //       }
+      //     })
+      //   }
+
+      //   findele(treeData,id)
+      //   return allparents
+
+      // },
+      selectNode(selectedKeys, e){
+        this.$emit('select', selectedKeys, e)
+      },
+    },
+  })
+</script>
+
+<style lang="less" scoped>
+.equipment-tree-container{
+  width: 100%;
+  height: 100%;
+  background-color: #fff;
+  padding: 15px;
+  .tree-container{
+    width: 100%;
+    height: calc(100% - 40px);
+    overflow: auto;
+  }
+}
+</style>

+ 59 - 3
src/views/module_cmms/inspectAbnormalItems/InspectAbnormalItemsList.vue

@@ -7,7 +7,19 @@
           <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" />
+              <!-- <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">
@@ -138,7 +150,7 @@
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { postAction } from '@/api/manage'
+  import { postAction, getAction } from '@/api/manage'
 
   export default {
     name: 'InspectList',
@@ -222,10 +234,13 @@
         },
         dictOptions:{},
         superFieldList:[],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     created() {
-    this.getSuperFieldList();
+      this.getSuperFieldList();
+      this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -233,6 +248,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       // 确认
       handleConfirm(record){
         postAction(this.url.confirm, record).then((res) => {

+ 57 - 1
src/views/module_cmms/inspectContent/modules/InspectContentForm.vue

@@ -29,7 +29,19 @@
           <a-col :span="12" v-if="model.classification === '1'">
             <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
               <div class="u-flex select-equipment">
-                <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id"  />
+                <!-- <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id"  /> -->
+                <a-select
+                v-model="model.equipmentid"
+                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>
                 <div class="u-flex-jac search-btn" @click="chooseEquipment">
                   <a-icon type="search" style="color: #fff;font-size: 18px;" />
                 </div>
@@ -166,6 +178,8 @@
             dataIndex: 'remark'
           }
         ],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -176,8 +190,50 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {
+        return this.deviceOptions
+      },
       inspectTypeChange(){
         this.model.cmmsInspectContentItemList = []
         this.$refs.addItemRef.type = this.model.classification

+ 59 - 2
src/views/module_cmms/repairManage/RepairManageList.vue

@@ -16,7 +16,19 @@
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="设备名称">
-              <j-search-select-tag v-model="queryParam.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" />
+              <!-- <j-search-select-tag v-model="queryParam.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" /> -->
+              <a-select
+              v-model="queryParam.equipmentid"
+              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>
           <template v-if="toggleSearchStatus">
@@ -170,6 +182,7 @@
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import RepairManageModal from './modules/RepairManageModal'
   import RepairManageDetail from './modules/RepairManageDetail.vue'
+  import { httpAction, getAction } from '@/api/manage'
 
   export default {
     name: 'RepairManageList',
@@ -318,10 +331,13 @@
         },
         dictOptions:{},
         superFieldList:[],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     created() {
-    this.getSuperFieldList();
+      this.getSuperFieldList();
+      this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -329,6 +345,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       // 派单
       handleDisptch (record) {
         this.$refs.modalForm.title = "派单";

+ 58 - 2
src/views/module_cmms/repairManage/modules/RepairManageForm.vue

@@ -10,7 +10,19 @@
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-              <j-search-select-tag v-model="model.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" />
+              <!-- <j-search-select-tag v-model="model.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" /> -->
+              <a-select
+              v-model="model.equipmentid"
+              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-model-item>
           </a-col>
           <a-col :span="24">
@@ -107,7 +119,9 @@
           add: "/cmmsRepair/cmmsRepair/add",
           edit: "/cmmsRepair/cmmsRepair/edit",
           queryById: "/cmmsRepair/cmmsRepair/queryById"
-        }
+        },
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -118,8 +132,50 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {
+        return this.deviceOptions
+      },
       add () {
         this.edit(this.modelDefault);
       },

+ 58 - 1
src/views/module_cmms/repairMy/RepairMyList.vue

@@ -16,7 +16,19 @@
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="设备名称">
-              <j-search-select-tag v-model="queryParam.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" />
+              <!-- <j-search-select-tag v-model="queryParam.equipmentid" placeholder="请选择设备" dict="tpm_equipment,equipmentname,id" /> -->
+              <a-select
+              v-model="queryParam.equipmentid"
+              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>
           <template v-if="toggleSearchStatus">
@@ -144,6 +156,7 @@
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import RepairMyModal from './modules/RepairMyModal'
+  import { httpAction, getAction } from '@/api/manage'
 
   export default {
     name: 'RepairMyList',
@@ -288,10 +301,13 @@
         },
         dictOptions:{},
         superFieldList:[],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     created() {
     this.getSuperFieldList();
+    this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -299,6 +315,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       handleFeedback(record){
         this.$refs.modalForm.title = "维修反馈";
         this.$refs.modalForm.modalType = "feedback";

+ 61 - 3
src/views/module_cmms/spotcheck/modules/SpotcheckForm.vue

@@ -11,7 +11,21 @@
           </a-col> -->
           <a-col :span="12">
             <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-              <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" placeholder="请选择设备" @change="handleChange" :disabled="disabledEdit"/>
+              <!-- <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" placeholder="请选择设备" @change="handleChange" :disabled="disabledEdit"/> -->
+              <a-select
+              v-model="model.equipmentid"
+              placeholder="请输入设备名称或设备编号"
+              show-search
+              :disabled="disabledEdit"
+              :filterOption="filterOptions"
+              @search="searchDevice"
+              @change="handleChange"
+              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-model-item>
           </a-col>
           <a-col :span="12">
@@ -229,7 +243,9 @@
           add2: "/cmmsRepair/cmmsRepair/add",
           edit: "/cmmsSpotcheck/cmmsSpotcheck/edit",
           queryById: "/cmmsSpotcheck/cmmsSpotcheck/queryById"
-        }
+        },
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -240,10 +256,52 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       add () {
-        this.edit(this.modelDefault);
+        // this.edit(this.modelDefault);
         this.disabledEdit = false
         // 第二版
         // this.model = this.dataList

+ 59 - 2
src/views/module_cmms/spotcheckContent/modules/SpotcheckContentForm.vue

@@ -18,7 +18,20 @@
               </a-col>
               <a-col :span="12">
                 <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-                  <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" :disabled="disabledEdit" />
+                  <!-- <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" :disabled="disabledEdit" /> -->
+                  <a-select
+                  v-model="model.equipmentid"
+                  placeholder="请输入设备名称或设备编号"
+                  show-search
+                  :disabled="disabledEdit"
+                  :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-model-item>
               </a-col>
               <a-col :span="12">
@@ -154,7 +167,9 @@
           edit: "/cmmsSpotcheckContent/cmmsSpotcheckContent/edit",
           // queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryById"
           queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryContentAndItemById"
-        }
+        },
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -165,8 +180,50 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       add () {
         // this.edit(this.modelDefault);
         this.model = Object.assign({}, this.modelDefault);

+ 68 - 3
src/views/module_cmms/submission/modules/SubmissionForm.vue

@@ -5,7 +5,20 @@
         <a-row>
           <a-col :span="24">
             <a-form-model-item label="检定设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentids">
-              <j-search-select-tag v-model="model.equipmentids" dict="tpm_equipment,equipmentname,id"  placeholder="请选择检定设备" mode="multiple"/>
+              <!-- <j-search-select-tag v-model="model.equipmentids" dict="tpm_equipment,equipmentname,id"  placeholder="请选择检定设备" mode="multiple"/> -->
+              <a-select
+              v-model="model.equipmentids"
+              placeholder="请输入设备名称或设备编号"
+              show-search
+              mode="multiple"
+              :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: 6%;">{{ item.equipmentcode }}</span>
+                </a-select-option>
+              </a-select>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -72,7 +85,9 @@
           add: "/cmmsSubmission/cmmsSubmission/add",
           edit: "/cmmsSubmission/cmmsSubmission/edit",
           queryById: "/cmmsSubmission/cmmsSubmission/queryById"
-        }
+        },
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -83,13 +98,56 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {
+        return this.deviceOptions
+      },
       add () {
         this.edit(this.modelDefault);
       },
       edit (record) {
         this.model = Object.assign({}, record);
+        this.model.equipmentids = record.equipmentids.split(",")
         this.visible = true;
       },
       submitForm () {
@@ -107,6 +165,7 @@
               httpurl+=this.url.edit;
                method = 'put';
             }
+            this.model.equipmentids = this.model.equipmentids.toString()
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
@@ -123,4 +182,10 @@
       },
     }
   }
-</script>
+</script>
+
+<style scoped>
+::v-deep .ant-select-selection--multiple .ant-select-selection__choice{
+  width: 99% !important;
+}
+</style>

+ 59 - 2
src/views/module_cmms/upkeep/UpkeepList.vue

@@ -17,7 +17,19 @@
           <template v-if="toggleSearchStatus">
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
               <a-form-item label="设备">
-                <j-search-select-tag v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"  placeholder="请选择设备"/>
+                <!-- <j-search-select-tag v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"  placeholder="请选择设备"/> -->
+                <a-select
+                v-model="queryParam.equipmentid"
+                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">
@@ -141,6 +153,7 @@
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import UpkeepModal from './modules/UpkeepModal'
+  import { httpAction, getAction } from '@/api/manage'
 
   export default {
     name: 'UpkeepList',
@@ -276,11 +289,14 @@
         // },
         dictOptions:{},
         superFieldList:[],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     created() {
       console.log(777,this.url)
-    this.getSuperFieldList();
+      this.getSuperFieldList();
+      this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -288,6 +304,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       handleEdit: function (record) {
         this.$refs.modalForm.edit(record);
         this.$refs.modalForm.title = "反馈";

+ 58 - 2
src/views/module_cmms/upkeepPlan/UpkeepPlanList.vue

@@ -36,7 +36,19 @@
             </a-col> -->
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
               <a-form-item label="设备">
-                <j-search-select-tag v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"  placeholder="请选择设备"/>
+                <!-- <j-search-select-tag v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"  placeholder="请选择设备"/> -->
+                <a-select
+                v-model="queryParam.equipmentid"
+                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-input placeholder="请输入保养项编号" v-model="queryParam.itemcode"></a-input> -->
               </a-form-item>
             </a-col>
@@ -313,11 +325,14 @@
         },
         dictOptions:{},
         superFieldList:[],
-        model: {}
+        model: {},
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     created() {
     this.getSuperFieldList();
+    this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -325,6 +340,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 58 - 1
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanForm.vue

@@ -18,7 +18,20 @@
               </a-col>
               <a-col :span="12">
                 <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-                  <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" :disabled="disabledEdit" style="width: 100%"/>
+                  <!-- <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id" :disabled="disabledEdit" style="width: 100%"/> -->
+                  <a-select
+                  v-model="model.equipmentid"
+                  placeholder="请输入设备名称或设备编号"
+                  show-search
+                  :disabled="disabledEdit"
+                  :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-button type="primary" icon="search" /> -->
                 </a-form-model-item>
               </a-col>
@@ -250,6 +263,8 @@
             dataIndex: 'remark'
           },
         ],
+        deviceOptions: [],
+        deviceOptionsAll: [],
       }
     },
     computed: {
@@ -260,8 +275,50 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getDeviceOption();
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       add () {
         // this.edit(this.modelDefault);
         this.model = Object.assign({}, this.modelDefault);

+ 5 - 1
src/views/module_ems/photovoltaic/inverterMonitor/index.vue

@@ -683,7 +683,7 @@ export default {
     background: url('../../../../assets/images/ns2.png') no-repeat center center;
     background-size: 70%;
   }
-  
+
   .i{
     font-size: 2vw;
     border-radius: 100%;
@@ -815,4 +815,8 @@ export default {
   background-color: #01ADA8 !important;
   color: #fff;
 }
+::v-deep .ant-table-thead{
+  background-color: #01ADA8 !important;
+  color: #fff;
+}
 </style>

+ 84 - 10
src/views/module_tpm/equipment/EquipmentList.vue

@@ -4,9 +4,31 @@
     <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-col :xl="10" :lg="7" :md="8" :sm="24">
             <a-form-item label="设备名称">
-              <a-input placeholder="请输入设备名称" v-model="queryParam.equipmentname"></a-input>
+              <!-- <a-input placeholder="请输入设备名称" v-model="queryParam.equipmentname"></a-input> -->
+              <a-select
+              v-model="queryParam.id"
+              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">
+                <!-- <div style="display: flex; width: 100%;"> -->
+                  <!-- 换行 -->
+                  <!-- <div style="width: 72%; overflow: hidden;white-space: normal; margin-right: 3%;">{{item.equipmentname}}</div> -->
+                  <!-- <div style="width: 72%; overflow: hidden;text-overflow: ellipsis;">{{item.equipmentname}}</div>
+                  <div style="width: 20%; text-align: right; display: flex; align-items: center;">{{ item.equipmentcode }}</div>
+                </div> -->
+                <!-- <a-row>
+                  <a-col :span="12">{{item.equipmentname}}</a-col>
+                  <a-col :span="12" style="text-align: right;">{{ item.equipmentcode }}</a-col>
+                </a-row> -->
+                <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">
@@ -108,6 +130,10 @@
         class="j-table-force-nowrap"
         @change="handleTableChange">
 
+        <template slot="equipmentCycle" slot-scope="text,record">
+          <span v-if="text">{{record.equipmentCycle + "("}}{{record.cycleUnit_dictText +")"}}</span>
+        </template>
+
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
@@ -157,13 +183,16 @@
   import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
   import EquipmentModal from './modules/EquipmentModal.vue'
   import EquipmentDetail from './modulesDetail/EquipmentDetail.vue'
+  import { httpAction, getAction } from '@/api/manage'
+import Template1 from '../../jeecg/JVxeDemo/layout-demo/Template1.vue'
 
   export default {
     name: 'EquipmentList',
     mixins:[JeecgListMixin, mixinDevice],
     components: {
         EquipmentModal,
-        EquipmentDetail
+        EquipmentDetail,
+        Template1
     },
     props: {
       selectData: {
@@ -224,14 +253,15 @@
           {
             title:'送检周期',
             align:"center",
-            dataIndex: 'equipmentCycle'
-          },
-          {
-            title:'周期单位',
-            align:"center",
-            dataIndex: 'cycleUnit_dictText'
+            dataIndex: 'equipmentCycle',
+            scopedSlots: { customRender: 'equipmentCycle' }
           },
           // {
+          //   title:'周期单位',
+          //   align:"center",
+          //   dataIndex: 'cycleUnit_dictText'
+          // },
+          // {
           //   title:'出厂编号',
           //   align:"center",
           //   dataIndex: 'factoryNo'
@@ -284,11 +314,14 @@
 
         },
         dictOptions:{},
+        deviceOptions: [],
+        deviceOptionsAll: [],
         superFieldList:[],
       }
     },
     created() {
-    this.getSuperFieldList();
+      this.getSuperFieldList();
+      this.getDeviceOption();
     },
     computed: {
       importExcelUrl: function(){
@@ -296,6 +329,47 @@
       },
     },
     methods: {
+      // 获取设备下拉列表
+      getDeviceOption(){
+        getAction(`/tpmEquipment/tpmEquipment/selectEquipmentList`).then(res=>{
+          console.log(111,res.result)
+          this.deviceOptions = res.result.map((res) => {
+            return {
+              id: res.id,
+              equipmentname: res.equipmentname,
+              equipmentcode: res.equipmentcode,
+            }
+          })
+          // 存一个完整的设备表
+          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
+        }
+        // 通过判断字符串中是数字还是文字进而判断是通过设备名筛选还是设备编号筛选
+        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) {                    
+        return this.deviceOptions
+      },
       getDataList(){
         console.log(111,this.selectData)
         this.queryParam.equipmenttreeid = this.selectData.equipmenttreeid

+ 4 - 1
src/views/module_tpm/equipment/index.vue

@@ -1,7 +1,8 @@
 <template>
     <div class="all">
         <div class="left">
-            <u-equipment-tree @select="selectEquipment"></u-equipment-tree>
+            <!-- <u-equipment-tree @select="selectEquipment"></u-equipment-tree> -->
+            <u-equipment-type-tree @select="selectEquipment"></u-equipment-type-tree>
         </div>
         <div class="right">
             <equipment-list ref="realForm" :selectData="selectData"></equipment-list>
@@ -10,10 +11,12 @@
 </template>
 
 <script>
+import UEquipmentTypeTree from '@/components/module_ems/UEquipmentTypeTree/UEquipmentTypeTree'
 import EquipmentList from '@/views/module_tpm/equipment/EquipmentList'
 
     export default({
         components: {
+          UEquipmentTypeTree,
             EquipmentList
         },
         data () {

+ 17 - 21
src/views/module_tpm/equipment/modules/EquipmentForm.vue

@@ -11,7 +11,7 @@
           <a-col :span="12">
             <a-form-model-item label="设备分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmenttreeid">
               <!-- <j-category-select v-model="model.equipmenttreeid" pcode="id" placeholder="请选择设备分类" back="name" @change="handleCategoryChange" /> -->
-              <j-tree-select
+              <!-- <j-tree-select
                 ref="treeSelect"
                 placeholder="请选择设备分类"
                 v-model="model.equipmenttreeid"
@@ -19,10 +19,17 @@
                 pidField="parentid"
                 pidValue="0"
                 hasChildField="has_child"
-                style="width:85%;"
+                style="width:89%;"
                 >
-              </j-tree-select>
-              <a-button type="primary">1</a-button>
+              </j-tree-select> -->
+              <a-tree-select
+                v-model="model.equipmenttreeid"
+                style="width: 89%"
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                :tree-data="treeData"
+                placeholder="请选择设备分类"
+              ></a-tree-select>
+              <a-button type="primary" icon="plus" @click="handleAdd"></a-button>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
@@ -115,6 +122,7 @@
         </a-row>
       </a-form-model>
     </j-form-container>
+    <equipment-tree-modal ref="modalForm" @fMethod="modalFormOk2"></equipment-tree-modal>
   </a-spin>
 </template>
 
@@ -123,10 +131,12 @@
   import { httpAction, getAction } from '@/api/manage'
   import { duplicateCheck } from '@/api/api'
   import { validateDuplicateValue } from '@/utils/util'
+  import EquipmentTreeModal from '@/views/module_tpm/equipmentTree/modules/EquipmentTreeModal'
 
   export default {
     name: 'EquipmentForm',
     components: {
+      EquipmentTreeModal
     },
     props: {
       //表单禁用
@@ -143,7 +153,8 @@
           // spaceid: "1780065347359883265",
           // responseDepartment: "67fc001af12a4f9b8458005d3f19934a",
           spec: "无",
-         },
+        },
+        treeData:[],
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -191,24 +202,9 @@
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      this.getTpmTreeData()
     },
     methods: {
-      validateTemplateCode(rule, value, callback){
-        var params = {
-          tableName: "tpm_equipment",
-          fieldName: "equipmentcode",
-          fieldVal: value,
-          dataId: this.model.id
-        }
-        duplicateCheck(params).then((res)=>{
-          if(res.success){
-            callback();
-          }else{
-            callback("设备编号已存在,请重新输入");
-          }
-        })
-
-      },
       add () {
         this.edit(this.modelDefault);
       },

+ 2 - 0
src/views/module_tpm/equipmentTree/modules/EquipmentTreeModal.vue

@@ -136,6 +136,8 @@
               if(res.success){
                 that.$message.success(res.message);
                 this.$emit('ok');
+                // this.$parent.modalFormOk2();
+                this.$emit('fMethod');
               }else{
                 that.$message.warning(res.message);
               }