Explorar o código

Merge branch 'master' of http://gogs.renlianiot.com:4000/zmcoding/smart-tool-ui

tongshanglei %!s(int64=3) %!d(string=hai) anos
pai
achega
a670eece15

+ 1 - 1
src/config/componentsMap.js

@@ -76,7 +76,7 @@ export default {
     fan: () =>
         import ('@/views/wind/fan'),
     worklocation: () =>
-        import ('@/views/device/worklocation'),
+        import ('@/views/wind/worklocation'),
     //同步方案
     synscheme: () =>
         import ('@/views/device/synscheme'),

+ 39 - 196
src/views/wind/worklocation/formModel.vue

@@ -1,12 +1,14 @@
 <template>
   <ele-form-dialog
-    v-bind="formConfig"
+   v-bind="formConfig"
     v-model="formFieldsData"
     v-dialogDrag
     :title="title"
     :request-fn="handleFormSubmit"
     :visible.sync="DialogVisible"
+    width="550px"
     custom-class="abow_dialog"
+    label-width="100px"
     label-position="left"
     :dialogAttrs="{ 'close-on-click-modal': false,'top':'8vh'}"
   />
@@ -21,72 +23,20 @@ export default {
       formData: {},
       formFieldsData: {
         id:"",
-        is_used:"",
-        department_id: "",
         number: "",
-        name: "",
-        model: "",
         fan_id:"",
-        outside:"",
-        torque:"",
-        wrench:"",
-        stress:"",
-        bolt_size:"",
-        bolt_number:"",
-        install_position:"",
-        brand:"",
-        supplier:"",
-        out_date:"",
-        fastening_scheme:"",
-        remark: "",
+        work_location:"",
+        parts:"",
+        bolt_style:"",
+        boit_type:"",
+        info: "",
 
       }, 
-      url: "flange",
+      url: "workLocation",
       formConfig: {
         formDesc: {
-           is_used: {
-            break:true,
-            layout:12,
-            type: "select",
-            label: "使用状态",
-            required: true,
-            isOptions: true,
-            options: [
-              {
-                text: "使用",
-                value: 1
-              },
-              {
-                text: "未使用",
-                value: -1
-              },
-              {
-                text: "已废弃",
-                value: -2
-              }
-            ]
-          },
-          
-           department_id: {
-            layout:12,
-            type: "cascader",
-            label: "所属部门",
-            isOptions: true,
-            options: [],
-            required: true,
-            attrs: {
-              props: {
-                label: "department_name",
-                value: "id",
-                emitPath: false,
-                checkStrictly: true
-
-              }
-            }
-          },
           //风场id
           fan_id:{
-             layout:12,
               type: "cascader",
               label: "风机编号",
               isOptions: true,
@@ -105,159 +55,65 @@ export default {
             }
 
           },
-          number: {
-            layout:12,
+          number: {  
             required:true,
             type: "input",
             label: "编号",
            
           },
-           name: {
-            layout:12,
+           work_location: {
+            
             type: "input",
-            label: "名称",
+            label: "工作位置",
             required:true
           },
-          model: {
-            layout:12,
+          parts: {
+            
             required:true,
             type: "select",
-            label: "型号",
+            label: "所属部件",
             required:true,
             options:[]
           },
-           outside:{
-            layout:12,
+           bolt_style:{
+            
             type: "input",
-            label: "外径",
+            label: "螺丝样式",
              required:true
           },
-           torque:{
-             layout:12,
+           boit_type:{
+             
              type: "input",
-             label: "扭矩",
+             label: "螺丝型号",
              required:true,
              rules: [
              {pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*)|0)$/,message: '请輸入正数,最多保存两位小数'}
             ]
           },
-          wrench:{
-             layout:12,
-             type: "select",
-              label: "液压扳手",
-              isOptions: true,
-              options: [],
-              required: true,
-              attrs: {
-                //查询
-                filterable:true,
-                multiple:true,
-                props: {
-                  label: "text",
-                  value: "value",
-                  emitPath: false,
-                  checkStrictly: false,
-                  multiple:false
-                }
-            }
-
-          },
-          fastening_scheme:{
-             layout:12,
-             type: "select",
-              label: "紧固方案",
-              isOptions: true,
-              options: [],
-              required: true,
-              attrs: {
-                //查询
-                filterable:true,
-                multiple:true,
-                props: {
-                  label: "text",
-                  value: "value",
-                  emitPath: false,
-                  checkStrictly: false,
-                  multiple:false
-                }
-            }
-
-          },
-          stress:{
-             layout:12,
-             required: true,
-             type: "input",
-             label: "压力",
-             rules: [
-               {pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*)|0)$/,message: '请輸入正数,最多保存两位小数'}
-            ]
-          },
-          bolt_size: {
-             layout:12,
-             type: "input",
-             label: "螺栓尺寸",
-             rules: [
-             {pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*)|0)$/,message: '请輸入正数,最多保存两位小数'}
-            ]
-          },
-           bolt_number: {
-            required: true,
-            layout:12,
-             type: "input",
-             label: "螺栓数量",
-             rules: [
-              
-               {pattern: /^[1-9]\d*$/,message: '请輸入正整数'}
-              
-            ]
-          },
-          install_position:{
-             layout:12,
-            type: "input",
-            label: "安装位置",
-            vif:true
-          },
-           brand: {
-             layout:12,
-            type: "input",
-            label: "品牌"
-          },
-           supplier: {
-            layout:12,
-            type: "input",
-            label: "供应商"
-          },
-            out_date: {
-            layout:12,
-            type: "date",
-            label: "出厂日期"
-          },
-          remark: {
+          info: {
+            
             type: "textarea",
             label: "备注"
           }
         },
-        order: ["is_used","model","department_id","fan_id","number", "name","outside","wrench","torque","fastening_scheme","stress","bolt_size","bolt_number","install_position","brand","supplier","out_date","remark"]
+        order: ["number","fan_id","work_location","parts","bolt_style", "boit_type","info","info"]
       }
     };
   },
   created() {
-    this.$http.get("departments").then(response => {
-      this.formConfig.formDesc.department_id.options = response.data;
-    });
-  
-     this.$http.get("getwindfan").then(response => {
-      this.formConfig.formDesc.fan_id.options = response.data;
-    });
-    this.$http.get("get_device_mold",{ params: {type:2} }).then(resp => {
-        this.formConfig.formDesc.model.options = resp.data
-     });
-    this.$http.get("wrenchtype").then(response => {
-      this.formConfig.formDesc.wrench.options = response.data;
-    });
-    this.$http.get("synschemetype").then(response => {
-      this.formConfig.formDesc.fastening_scheme.options = response.data;
-    });
+   
+    //  this.$http.get("getwindfan").then(response => {
+    //   this.formConfig.formDesc.fan_id.options = response.data;
+    // });
+    // this.$http.get("get_device_mold",{ params: {type:2} }).then(resp => {
+    //     this.formConfig.formDesc.model.options = resp.data
+    //  });
+    // this.$http.get("wrenchtype").then(response => {
+    //   this.formConfig.formDesc.wrench.options = response.data;
+    // });
+    // this.$http.get("synschemetype").then(response => {
+    //   this.formConfig.formDesc.fastening_scheme.options = response.data;
+    // });
 
 
 
@@ -275,26 +131,13 @@ export default {
     }
   },
 
+
   computed: {
     DialogVisible: {
       set(val) {
         this.$emit("sendVal", val); // 表示将子组件改变的值传递给父组件
       },
       get() {
-        if(this.formModelVisible)
-        {
-      
-            if(!this.formFieldsData.id)
-            {
-                this.formConfig.formDesc.fan_id.vif=false;
-                this.formConfig.formDesc.install_position.vif=false;
-            }
-            else
-            {
-              this.formConfig.formDesc.fan_id.vif=true;
-              this.formConfig.formDesc.install_position.vif=false;
-            }
-        }
         return this.formModelVisible; // 表示获取父组件的值
       }
     }

+ 37 - 109
src/views/wind/worklocation/index.vue

@@ -35,14 +35,7 @@
             @keyup.enter.native="handleSearch"
           />
         </div>
-        <div class="search-item">
-          <!-- <el-input
-            v-model="queryParam.model_typer"
-            placeholder="型号"
-            clearable
-            class="filter-item form-search-input fl"
-            @keyup.enter.native="handleSearch"
-          /> -->
+        <div class="search-item"> 
                <el-select
                   v-model="queryParam.model"
                   placeholder="模型"
@@ -122,27 +115,20 @@
         fixed="left"
         width="55"
       ></el-table-column>
-      <el-table-column
-        prop="depart_name"
-        label="所属部门"
-        align="center"
-        v-if="showColumn.depart_name"
-        :show-overflow-tooltip="true"
-        width="150"
-      />
+
        <el-table-column
         prop="wind_name"
         label="风场名称"
         align="center"
-        v-if="showColumn.number"
+        v-if="showColumn.wind_name"
         :show-overflow-tooltip="true"
         width="150"
       />
       <el-table-column
         prop="fan_number"
-        label="风机号"
+        label="风机机位号"
         align="center"
-        v-if="showColumn.number"
+        v-if="showColumn.fan_number"
         :show-overflow-tooltip="true"
         width="150"
       />
@@ -155,83 +141,35 @@
         width="150"
       />
       <el-table-column
-        prop="name"
-        label="名称"
+        prop="work_local"
+        label="工作位置"
         align="center"
-        v-if="showColumn.name"
+        v-if="showColumn.work_local"
         :show-overflow-tooltip="true"
       />
       <el-table-column
-        prop="brand"
-        label="品牌"
+        prop="parts"
+        label="所属部件"
         align="center"
-        v-if="showColumn.brand"
+        v-if="showColumn.parts"
         :show-overflow-tooltip="true"
       />
       <el-table-column
-        prop="supplier"
-        label="供应商"
+        prop="bolt_style"
+        label="螺栓样式"
         align="center"
-        v-if="showColumn.supplier"
+        v-if="showColumn.bolt_style"
         :show-overflow-tooltip="true"
         width="120"
       />
       <el-table-column
-        prop="model_type"
-        label="型号"
+        prop="boit_type"
+        label="螺栓型号"
         align="center"
-        v-if="showColumn.model"
+        v-if="showColumn.boit_type"
         :show-overflow-tooltip="true"
       />
       <el-table-column
-        prop="out_date"
-        label="出厂日期"
-        align="center"
-        v-if="showColumn.out_date"
-        :show-overflow-tooltip="true"
-        width="150"
-      />
-      <el-table-column
-        prop="is_used"
-        label="使用状态"
-        align="center"
-        v-if="showColumn.is_used"
-        :show-overflow-tooltip="true"
-        width="120"
-      >
-        <template slot-scope="record">
-          <el-tag type="danger" v-if="record.row.is_used == -1"
-            >未使用</el-tag>
-           <el-tag type="info" v-if="record.row.is_used == -2"
-            >报废</el-tag>
-          <el-tag type="success" v-if="record.row.is_used == 1"
-            >使用中</el-tag>
-        </template>
-      </el-table-column>
-      <el-table-column
-        prop="creator_user"
-        label="导入用户"
-        align="center"
-        v-if="showColumn.creator_user"
-        :show-overflow-tooltip="true"
-      />
-      <el-table-column
-        prop="created_at"
-        label="添加时间"
-        align="center"
-        v-if="showColumn.created_at"
-        :show-overflow-tooltip="true"
-        width="200"
-        sortable
-      />
-       <el-table-column
-        prop="remark"
-        label="备注"
-        align="center"
-        v-if="showColumn.remark"
-        width="100"
-      />
-      <el-table-column
         label="操作"
         width="150"
         align="center"
@@ -270,16 +208,12 @@
         <div class="content">
           <div class="head">选择显示字段</div>
           <div class="body">
-            <el-checkbox v-model="checkList.depart_name" disabled>所属部门</el-checkbox>
-            <el-checkbox v-model="checkList.wind_name" disabled>所属风场</el-checkbox>
-            <el-checkbox v-model="checkList.fan_number" disabled>所属风机编号</el-checkbox>
+            <el-checkbox v-model="checkList.wind_name" disabled>风场名称</el-checkbox>
+            <el-checkbox v-model="checkList.fan_number" disabled>风机机位号</el-checkbox>
             <el-checkbox v-model="checkList.number">编号</el-checkbox>
-            <el-checkbox v-model="checkList.name">名称</el-checkbox>
-            <el-checkbox v-model="checkList.brand">品牌</el-checkbox>
-            <el-checkbox v-model="checkList.supplier">供应商</el-checkbox>
-            <el-checkbox v-model="checkList.model_type">型号</el-checkbox>
-            <el-checkbox v-model="checkList.out_date">出厂日期</el-checkbox>
-            <el-checkbox v-model="checkList.is_used">使用状态</el-checkbox>
+            <el-checkbox v-model="checkList.parts">所属部件</el-checkbox>
+            <el-checkbox v-model="checkList.bolt_style">螺丝样式</el-checkbox>
+            <el-checkbox v-model="checkList.boit_type">螺栓型号</el-checkbox>
           </div>
           <div class="footer">
             <el-button size="small" type="primary" plain @click="saveColumn"
@@ -336,7 +270,7 @@ import { action } from "@/directive/permission/index.js";
 import detail from "./detail.vue"
 import formModel from './formModel.vue'
 export default {
-  name: "flange",
+  name: "workLocation",
   directives: { action },
   mixins: [rlListOperate],
   components: {
@@ -345,7 +279,7 @@ export default {
   },
   data() {
     return {
-      url: "flange",
+      url: "workLocation",
       queryParam: {
         number: "",
         department_id: [],
@@ -358,7 +292,7 @@ export default {
         0: "success",
         1: "danger",
       },
-      formName:'hydraulic',
+      formName:'workLocation',
       formVisible:false,
       //搜索
       searchDisplay: true,
@@ -373,16 +307,13 @@ export default {
       // 列的配置化对象,存储配置信息
       checkList: {},
       showColumn: {
-        depart_name: true,
         wind_name:true,
         fan_number:true,
-        alarm_state_text: true,
-        net_state:true,
         number: true,
-        name: true,
-        brand: true,
-        supplier: true,
-        model_type: true,
+        work_local: true,
+        parts:true,
+        bolt_style: true,
+        boit_type: true,
       }
     };
   },
@@ -424,7 +355,7 @@ export default {
       this.isShowColumn = true;
     },
     saveColumn() {
-      localStorage.setItem("flangeSet", JSON.stringify(this.checkList));
+      localStorage.setItem("WorklocalSet", JSON.stringify(this.checkList));
       this.isShowColumn = false;
     },
     handleDetail(row){
@@ -466,20 +397,17 @@ export default {
       this.searchDis();
     });
     // 发请求得到checkListInitData的列的名字
-    if (localStorage.getItem("flangeSet")) {
-      this.checkList = JSON.parse(localStorage.getItem("flangeSet"));
+    if (localStorage.getItem("WorklocalSet")) {
+      this.checkList = JSON.parse(localStorage.getItem("WorklocalSet"));
     } else {
       this.checkList = {
-        depart_name: true,
-        wind_name:true,
+         wind_name:true,
         fan_number:true,
-        alarm_state_text: true,
-        net_state:true,
         number: true,
-        name: true,
-        brand: true,
-        supplier: true,
-        model_type: true,
+        work_local: true,
+        parts:true,
+        bolt_style: true,
+        boit_type: true,
       };
     }
   },