Jelajahi Sumber

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

lijiang007 2 tahun lalu
induk
melakukan
6129a29258

+ 1 - 7
src/api/technology/control/index.js

@@ -9,13 +9,7 @@ export default {
     }
   },
 
-  //详情
-  getCode: async () => {
-    const res = await request.get(`/main/codemanage/getCode/produce_control`);
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-  },
+
   //保存
   save: async (data) => {
     const res = await request.post('/main/producecontrol/save', data);

+ 1 - 7
src/api/technology/work/index.js

@@ -20,13 +20,7 @@ export default {
       return res.data.data;
     }
   },
-  //详情
-  getCode: async () => {
-    const res = await request.get(`/main/codemanage/getCode/work_center`);
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-  },
+
   //保存
   save: async (data) => {
     const res = await request.post('/main/workcenter/save', data);

+ 1 - 0
src/components/Dict/DictSelection.vue

@@ -4,6 +4,7 @@
     style="width: 100%"
     v-bind="$attrs"
     v-on="$listeners"
+    filterable
   >
     <el-option
       v-for="item in dictList"

+ 1 - 1
src/views/ItemInformation/detail.vue

@@ -188,7 +188,7 @@
   import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
   export default {
     name: 'ManageMaterial',
-    components: {
+    components: {      
       linkMsg,
       GroupDialog,
       deptSelect,

+ 14 - 9
src/views/factoryModel/plant/index.vue

@@ -25,12 +25,15 @@
             添加
           </el-button>
         </template>
-        <template v-slot:factory="{ row }">
-          {{ showgfactory(row, 1) }}
-        </template>
+
         <template v-slot:parent="{ row }">
           {{ showgfactory(row, 2) }}
         </template>
+
+        <template v-slot:factory="{ row }">
+          {{ showgfactory(row, 1) }}
+        </template>
+
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
@@ -102,17 +105,19 @@
             label: '联系方式',
             prop: 'extInfo.phone'
           },
-          {
-            label: '所属工厂',
-            prop: 'extInfo.parentId',
-            slot: 'factory'
-          },
+
           {
             label: '工厂编码',
-            prop: 'parent[0].id',
+            prop: 'parentCode',
             slot: 'parent'
            
           },
+          {
+            label: '所属工厂',
+            prop: 'extInfo.parentId',
+            slot: 'factory'
+          },
+       
           {
             label: '省/市/区',
             prop: 'extInfo.location'

+ 31 - 43
src/views/factoryModel/productionLine/index.vue

@@ -1,54 +1,37 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <search
-        ref="search"
-        @search="search"
-        :options_groupId="dict.groupId"
-        :options_factory="dict.factory"
-      ></search>
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        cache-key="systemRoleTable"
-      >
+      <search ref="search" @search="search" :options_groupId="dict.groupId" :options_factory="dict.factory"></search>
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" cache-key="systemRoleTable">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="openEdit('add')"
-          >
+          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">
             添加
           </el-button>
         </template>
         <template v-slot:workshop="{ row }">
           {{ showWorkshop(row) }}
         </template>
+
+
+        <template v-slot:parent="{ row }">
+          {{ showgfactory(row, 2) }}
+        </template>
+
         <template v-slot:factory="{ row }">
-          {{ showgfactory(row) }}
+          {{ showgfactory(row, 1) }}
         </template>
+
+
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit('edit', row)"
-          >
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit('edit', row)">
             修改
           </el-link>
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此角色吗?"
-            @confirm="remove(row)"
-          >
+          <el-popconfirm class="ele-action" title="确定要删除此角色吗?" @confirm="remove(row)">
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
                 删除
@@ -58,12 +41,7 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <edit
-      ref="edit"
-      @done="done"
-      :options_groupId="dict.groupId"
-      :options_factory="dict.factory"
-    ></edit>
+    <edit ref="edit" @done="done" :options_groupId="dict.groupId" :options_factory="dict.factory"></edit>
   </div>
 </template>
 <script>
@@ -93,11 +71,18 @@ export default {
           label: '产线名称',
           prop: 'name'
         },
+
+        {
+          label: '工厂编码',
+          prop: 'parentCode',
+          slot: 'parent'
+        },
         {
           label: '所属工厂',
           prop: 'extInfo.factoryId',
           slot: 'factory'
         },
+
         {
           label: '所属车间',
           prop: 'parentId',
@@ -156,9 +141,9 @@ export default {
       });
     },
     openEdit(type, row) {
-      if(row){
-        if(typeof row.mainFactoryCapacityList == 'string'){
-           this.$set(row,'mainFactoryCapacityList', [])
+      if (row) {
+        if (typeof row.mainFactoryCapacityList == 'string') {
+          this.$set(row, 'mainFactoryCapacityList', [])
         }
       }
       this.$refs.edit.open(type, row);
@@ -171,11 +156,14 @@ export default {
       });
     },
     // 回显工厂名称
-    showgfactory(row) {
+    showgfactory(row, type) {
       let result = row.parent.find((n) => n.id == row.extInfo.factoryId);
-      if (result) {
+      if (result && type == 1) {
         return result.name;
-      } else {
+      } else if (result && type == 2) {
+        return result.code;
+      }
+      else {
         return '';
       }
     },

+ 21 - 5
src/views/factoryModel/workshop/index.vue

@@ -28,9 +28,15 @@
         <template v-slot:groupId="{ row }">
           {{ showgroupName(row.groupId) }}
         </template>
+
+        <template v-slot:parent="{ row }">
+          {{ showgfactory(row, 2) }}
+        </template>
+
         <template v-slot:factory="{ row }">
-          {{ showgfactory(row.parentId) }}
+          {{ showgfactory(row, 1) }}
         </template>
+  
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -95,11 +101,18 @@
             prop: 'groupId',
             slot: 'groupId'
           },
+          {
+            label: '工厂编码',
+            prop: 'parentCode',
+            slot: 'parent'
+           
+          },
           {
             label: '所属工厂',
             prop: 'parentId',
             slot: 'factory'
           },
+   
           {
             label: '详细地址',
             prop: 'extInfo.location'
@@ -159,11 +172,14 @@
         }
       },
       // 回显工厂名称
-      showgfactory (id) {
-        let result = this.dict.factory.find((n) => n.id == id);
-        if (result) {
+      showgfactory (row, type) {
+        let result = row.parent.find((n) => n.id == row.parentId);
+        if (result && type == 1) {
           return result.name;
-        } else {
+        } else if(result && type == 2) {
+          return result.code;
+        }
+        else {
           return '';
         }
       },

+ 3 - 6
src/views/technology/control/components/user-edit.vue

@@ -16,7 +16,7 @@
           <el-form-item label="编码:" prop="code">
             <el-input
               clearable
-              disabled
+             
               v-model="form.code"
               placeholder="请输入"
             />
@@ -199,15 +199,12 @@
       async visible(visible) {
         if (visible) {
           if (this.data) {
-            console.log(111111);
-
+        
             // const res = await work.getById(this.data.id);
-
             this.$util.assignObject(this.form, this.data);
             this.isUpdate = true;
           } else {
-            const res = await control.getCode();
-            this.form.code = res;
+           
             this.isUpdate = false;
           }
         } else {

+ 61 - 59
src/views/technology/production/components/WorkCenter.vue

@@ -1,48 +1,30 @@
 <template>
-  <el-dialog
-    title="选择工作中心"
-    :visible.sync="centerVisible"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="60%"
-  >
+  <el-dialog title="选择工作中心" :visible.sync="centerVisible" :before-close="handleClose" :close-on-click-modal="false"
+    :close-on-press-escape="false" append-to-body width="60%">
     <div>
+      <workCenter-search @search="reload" />
       <el-row>
         <el-col :span="24" class="table_col">
-          <el-table
-            :data="tableData"
-            height="450"
-            highlight-current-row
-            @row-click="single"
-          >
+          <el-table :data="tableData" height="520" highlight-current-row @row-click="single">
             <el-table-column label="工作中心编码" prop="code" width="200"></el-table-column>
             <el-table-column label="工作中心名称" prop="name"></el-table-column>
             <el-table-column label="工作中心类别" prop="categoryType">
-               <template slot-scope="scope">
-                 {{ checkcategoryType(scope.row.categoryType) }}
-               </template>
+              <template slot-scope="scope">
+                {{ checkcategoryType(scope.row.categoryType) }}
+              </template>
             </el-table-column>
             <el-table-column label="负责人" prop="leaderUserName">
             </el-table-column>
             <el-table-column label="选择" align="center">
-               <template slot-scope="scope">
-            	 <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
-               </template>
+              <template slot-scope="scope">
+                <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
+              </template>
             </el-table-column>
           </el-table>
-         <div class="pagination">
-            <el-pagination
-              background
-              layout="total, sizes, prev, pager, next, jumper"
-              :total="total"
-              :page-sizes="[10, 20, 50, 100]"
-              :page-size="pagination.size"
-              :current-page.sync="pagination.pageNum"
-              @current-change="handleCurrent"
-              @size-change="handleSize"
-            >
+          <div class="pagination">
+            <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
+              :page-sizes="[10, 20, 50, 100]" :page-size="pagination.size" :current-page.sync="pagination.pageNum"
+              @current-change="handleCurrent" @size-change="handleSize">
             </el-pagination>
           </div>
         </el-col>
@@ -56,20 +38,25 @@
 </template>
 
 <script>
- import work from '@/api/technology/work';
+import work from '@/api/technology/work';
+import workCenterSearch from './workCenter-search';
 export default {
-  data () {
+  components: {
+    workCenterSearch
+  },
+  data() {
     return {
       centerVisible: false,
       tableData: [],
-      search:{},
+      search: {},
       pagination: {
         pageNum: 1,
         size: 10,
       },
+      where: null,
       total: 0,
       radio: '',
-      current:null,
+      current: null,
       categoryTypes: [
         { label: '设备', value: 0 },
         { label: '设备组', value: 1 },
@@ -85,10 +72,10 @@ export default {
 
   },
   methods: {
-    open(item){
-      if(item){
+    open(item) {
+      if (item) {
         this.current = {
-          id:item.workCenterId,
+          id: item.workCenterId,
           name: item.workCenterName
         }
         this.radio = item.workCenterId
@@ -98,42 +85,52 @@ export default {
     },
 
     // 单击获取id
-    single (row) {
-        this.current = row
-        this.radio = row.id
+    single(row) {
+      this.current = row
+      this.radio = row.id
     },
 
-    handleClose () {
+    handleClose() {
       this.centerVisible = false
       this.current = null
       this.radio = ''
     },
-    handleCurrent (page) {
+    handleCurrent(page) {
       this.pagination.pageNum = page
       this.getList()
     },
-    handleSize (size) {
+    handleSize(size) {
       this.pagination.pageNum = 1
       this.pagination.size = size
       this.getList()
     },
-    getList(){
-      let params = {...this.pagination}
-      work.list(params).then(res=>{
-         this.tableData = res.list
-         this.total = res.count
+    getList() {
+      let params = { ...this.pagination }
+      if(this.where) {
+        params = { ...this.where }
+      }
+      work.list(params).then(res => {
+        this.tableData = res.list
+        this.total = res.count
       })
     },
-    selected(){
-       if(!this.current){
-         return this.$message.warning('请选择工作中心')
-       }
-       this.$emit('changeCenter',this.current)
-       this.handleClose()
+
+    /* 刷新表格 */
+    reload(where) {
+     this.where = where
+     this.getList()
+    },
+
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请选择工作中心')
+      }
+      this.$emit('changeCenter', this.current)
+      this.handleClose()
     },
 
     /*回显类别 */
-    checkcategoryType (value) {
+    checkcategoryType(value) {
       return this.categoryTypes.find((f) => f.value == value).label;
     },
 
@@ -149,21 +146,26 @@ export default {
   height: 500px;
   overflow: auto;
 }
+
 .table_col {
   padding-left: 10px;
+
   ::v-deep .el-table th.el-table__cell {
     background: #f2f2f2;
   }
 }
+
 .pagination {
   text-align: right;
   padding: 10px 0;
 }
+
 .btns {
   text-align: center;
   padding: 10px 0;
 }
-.topsearch{
-	margin-bottom:15px;
+
+.topsearch {
+  margin-bottom: 15px;
 }
 </style>

+ 77 - 0
src/views/technology/production/components/workCenter-search.vue

@@ -0,0 +1,77 @@
+<!-- 搜索表单 -->
+<template>
+    <el-form
+      label-width="120px"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row :gutter="24">
+
+        <el-col v-bind="styleResponsive ? { sm: 10 } : { span: 10 }">
+          <el-form-item label="工作中心编码:">
+            <el-input clearable v-model="where.code" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { sm: 10 } : { span: 10 }">
+          <el-form-item label="工作中心名称:">
+            <el-input clearable v-model="where.name" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+  
+
+  
+        <el-col v-bind="styleResponsive ? { sm: 4 } : { span: 4 }">
+          <div class="ele-form-actions">
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+            >
+              查询
+            </el-button>
+            <el-button @click="reset">重置</el-button>
+          </div>
+        </el-col>
+      </el-row>
+    </el-form>
+  </template>
+  
+  <script>
+    export default {
+      data() {
+        // 默认表单数据
+        const defaultWhere = {
+          code: '',
+          name: '',
+    
+        };
+        return {
+          // 表单数据
+          where: { ...defaultWhere }
+        };
+      },
+      props: {
+
+      },
+      computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+          return this.$store.state.theme.styleResponsive;
+        }
+      },
+      methods: {
+        /* 搜索 */
+        search() {
+          this.$emit('search', this.where);
+        },
+        /*  重置 */
+        reset() {
+          this.where = { ...this.defaultWhere };
+          this.search();
+        }
+      }
+    };
+  </script>
+  

+ 1 - 4
src/views/technology/work/components/user-edit.vue

@@ -16,7 +16,6 @@
           <el-form-item label="工作中心编码:" prop="code">
             <el-input
               clearable
-              disabled
               v-model="form.code"
               placeholder="请输入"
             />
@@ -123,7 +122,7 @@
           name: [
             { required: true, message: '请输入工序名称', trigger: 'blur' }
           ],
-          code: [{ required: true, trigger: 'change' }],
+          code: [{ required: true, message: '工作中心编码', trigger: 'change' }],
           factoryId: [
             { required: true, message: '请选择所属工厂', trigger: 'blur' }
           ],
@@ -190,8 +189,6 @@
             this.$util.assignObject(this.form, this.data);
             this.isUpdate = true;
           } else {
-            const res = await work.getCode();
-            this.form.code = res;
             this.isUpdate = false;
           }
         } else {

+ 1 - 1
src/views/technology/work/index.vue

@@ -23,7 +23,7 @@
             type="primary"
             icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="openEdit"
+            @click="openEdit()"
           >
             新建
           </el-button>