Procházet zdrojové kódy

禅道问题修改

jiangn před 3 roky
rodič
revize
a4031c813f

+ 7 - 1
src/api/pages/pdm/work-station-user.js

@@ -8,5 +8,11 @@ export default {
     prefix:'/mdm-server/pdm/workStationUser/',
     //查询工位对应工号
     getWorkStationUser:'get_work_station_user',
-  }
+  },
+
+  workStationPrinterService:{
+    prefix:'/mdm-server/pdm/wsPrinter/',
+    //查询工位对应工位打印机
+    getWsPrinterById:'get_work_station_printer_by_id',
+  },
 }

+ 9 - 0
src/config/index.js

@@ -383,6 +383,15 @@ export default {
     userRight: 'userRight',
   },
   /**
+   * @desc   : 绑定用户/工位打印机
+   * @author : 姜宁
+   * @date   : 2023/2/7 15:37
+   */
+  workStationDetailTab: {
+    workStationUser: 'workStationUser',
+    workStationPrinter: 'workStationPrinter',
+  },
+  /**
    * @desc   : 模具产出
    * @author : 姜宁
    * @date   : 2023/2/7 15:37

+ 4 - 0
src/locale/lang/zh-CN.js

@@ -225,6 +225,8 @@ export const formTitle = {
   'mold-damage': '开模报损',
   'prodSuspend': '产品挂起',
   'register':'计件',
+  'workStationPrinter':'工位打印机',
+  'workStationUser':'工位工号',
 }
 
 /**
@@ -498,6 +500,7 @@ export const columns = {
   packNodeIds: '组装工序',
   labelKindName: '标签类型',
   printType: '模板分类',
+  printTypeName:'模板分类',
 //   *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 
   //工艺流程相关
@@ -753,6 +756,7 @@ export const columns = {
   stationUsers:'工位工号',
   printerId:'打印机',
   printLayoutId:'打印模板',
+  printLayoutName:'打印模板',
   stationInformation:'生产工位',
   userInformation:'工位工号',
   printerInformation:'工位打印机',

+ 98 - 5
src/view/pdm/work-station/index.vue

@@ -25,25 +25,68 @@
                   @collapse-change="collapseChange" :set-flag="false"
                   :search-content="searchContent"></SearchCond>
     </div>
-    <div>
-      <DkTable :id="'table-'+$options.name" ref="table-select" :data="tableData"
+
+    <!--  表格部分  -->
+    <DkSplit mode="vertical" v-model="split" :height="tableHeight">
+      <DkTable slot="top" :id="'table-'+$options.name" ref="table-select" :data="tableData"
                :page-total="pageInfo.total"
                :current-page="pageInfo.currentPage"
                :multiple="false"
-               :height="this.tableHeight" primaryKey="stationId"
+               :height="this.tableHeight * split - 45" primaryKey="stationId"
+               @current-change="currentChangeEvent($event)"
                :choose-flag="false"
                @pageChange="pageSizeChange">
         <DkTableColumn field="stationCode"></DkTableColumn>
         <DkTableColumn field="stationName"></DkTableColumn>
         <DkTableColumn field="levelName" :title="$t('spaceId')"></DkTableColumn>
         <DkTableColumn field="nodeName"></DkTableColumn>
-        <DkTableColumn field="stationUsers"></DkTableColumn>
+<!--        <DkTableColumn field="stationUsers"></DkTableColumn>-->
         <DkTableColumn field="uniqueCode" :title="$t('kilnCode')" ></DkTableColumn>
         <DkTableColumn field="flgValid" type="switch" :title="$t('flgValid')" @on-switch-change="onSwitchChange"
                        :switch-disabled=false min-width="100px"></DkTableColumn>
         <DkTableColumn field="remarks" min-width="200" width="auto" :filter=false></DkTableColumn>
       </DkTable>
-    </div>
+
+      <div slot="bottom">
+        <DkTabs v-model="workStationDetailTab" :options="detailOptions"></DkTabs>
+        <!-- 用户 -->
+        <DkTable v-show="workStationDetailTab === this.$config.workStationDetailTab.workStationUser" :pageFlag="false"
+                 :pageTotalFlag="false"
+                 primaryKey="userId"
+                 :id="'table-'+$options.name"
+                 :height="this.tableHeight * (1-split) - 15"
+                 name="table"
+                 ref="workTeam-select"
+                 :choose-flag="false"
+                 :data="workStationUser">
+          <DkTableColumn field="userCode" width="200px"></DkTableColumn>
+          <DkTableColumn field="userName" width="400px"></DkTableColumn>
+          <DkTableColumn field="kindName" width="200px" :title="$t('userKind')"></DkTableColumn>
+          <DkTableColumn field="displayNo" width="auto" :data-type="$config.dataType.number"></DkTableColumn>
+        </DkTable>
+
+        <!--打印机信息-->
+        <DkTable v-show="workStationDetailTab === this.$config.workStationDetailTab.workStationPrinter" :pageFlag="false"
+                 :pageTotalFlag="false"
+                 primaryKey="wspId"
+                 :id="'table-'+$options.name"
+                 :height="this.tableHeight * (1-split) - 15"
+                 name="table"
+                 ref="workTeam-select"
+                 :choose-flag="false"
+                 :data="workStationPrinter">
+          <DkTableColumn field="printerName" width="400px"></DkTableColumn>
+          <DkTableColumn field="printTypeName" width="200px"></DkTableColumn>
+          <DkTableColumn field="printLayoutName" width="200px"></DkTableColumn>
+          <DkTableColumn field="stationName" width="200px"></DkTableColumn>
+          <DkTableColumn field="displayNo" width="100px" :data-type="$config.dataType.number"></DkTableColumn>
+          <DkTableColumn field="remarks" width="auto"></DkTableColumn>
+        </DkTable>
+      </div>
+    </DkSplit>
+<!--    <div>-->
+
+<!--    </div>-->
     <!--新建编辑-->
     <DkModal
       :loading="loading"
@@ -184,6 +227,12 @@ export default {
         },
         self.$config.flgValidSearch,// 有效标识
       ],
+      workStationUser: [], // 用于存放用户信息
+      workStationPrinter: [], // 用于存放工位打印机信息
+      workStationDetailTab: this.$config.workStationDetailTab.workStationUser,
+      detailOptions: [{label: self.$t('workStationUser'), name: 'workStationUser'}, //用户信息
+        {label: self.$t('workStationPrinter'), name: 'workStationPrinter'},//工位打印机
+      ],
     }
   },
   methods: {
@@ -314,6 +363,50 @@ export default {
         }
       })
     },
+   /**
+    * @desc   : 生产工号行切换事件
+    * @author : 姜宁
+    * @date   : 2023/3/14 17:10
+    */
+    currentChangeEvent({row}) {
+      if (row != null) {
+        // 获取用户信息
+        this.getWorkStationUserList(row.stationId);
+        // 查询工位打印机
+        this.getWorkStationPrinter(row.userId);
+      }
+    }
+    ,
+    /**
+     * @desc   : 获取工位工号
+     * @author : 姜宁
+     * @date   : 2023/3/14 17:14
+     */
+    getWorkStationUserList(stationId) {
+      let params = {
+        ftyId: this.$store.state.user.ftyId,
+        stationId: stationId
+      }
+      this.excute(this.$service.workStationUserService,this.$service.workStationUserService.getWorkStationUser,params).then(res =>{
+        if(res.code === this.$config.SUCCESS_CODE){
+          this.workStationUser = res.data
+        }
+      })
+    },
+    /**
+     * @desc   : 获取工位打印机
+     * @author : 姜宁
+     * @date   : 2023/3/14 17:14
+     */
+    getWorkStationPrinter(userId) {
+      // 查询数据
+      return this.excuteNoParam(this.$service.workStationPrinterService, this.$service.workStationPrinterService.getWsPrinterById, [userId], false).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.workStationPrinter = res.data;
+        }
+      });
+    }
+    ,
 
     /**
     * @desc   : 工号删除