Sfoglia il codice sorgente

前端页面功能处理

oyq28 3 mesi fa
parent
commit
9c14fc201a

+ 10 - 0
imcs-ui/src/api/lineSideLibrary/lineSideMgr.js

@@ -59,6 +59,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/stockInfo/getGoodsList`
   },
+  getMachineInfo: {
+    method: 'POST',
+    url: `/authority/productionresourceBiz/getMachineInfo`
+  },
   preview: {
     method: 'POST',
     url: `/authority/stockInfo/preview`
@@ -169,6 +173,12 @@ export default {
       data
     })
   },
+  getMachineInfo (data) {
+    return axiosApi({
+      ...apiList.getMachineInfo,
+      data
+    })
+  },
   check (code) {
     return axiosApi({
       method: 'GET',

+ 13 - 7
imcs-ui/src/api/prepareProductMgr/machineCustomizeCuttingTool.js

@@ -25,10 +25,6 @@ const apiList = {
     method: 'DELETE',
     url: `/authority/machineCuttingTool`
   },
-  get: {
-    method: 'POST',
-    url: `/authority/machineCuttingTool/get`
-  },
   list: {
     method: 'POST',
     url: `/authority/machineCuttingTool/query`
@@ -44,6 +40,10 @@ const apiList = {
   getResource: {
     method: 'POST',
     url: `/authority/customizeCuttingTool/getResource`
+  },
+  getMachineList: {
+    method: 'POST',
+    url: `/authority/machineCuttingTool/getList`
   }
 }
 
@@ -96,10 +96,10 @@ export default {
       data
     })
   },
-  get (data) {
+  get (id) {
     return axiosApi({
-      ...apiList.get,
-      data
+      url: `/authority/machineCuttingTool/get/${id}`,
+      method: 'GET'
     })
   },
   list (data) {
@@ -108,6 +108,12 @@ export default {
       data
     })
   },
+  getMachineList (data) {
+    return axiosApi({
+      ...apiList.getMachineList,
+      data
+    })
+  },
   synCuttingTools (data) {
     return axiosApi({
       ...apiList.synCuttingTools,

+ 344 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/cutterCategoriesGroup/tab/groupCutter/components/View.vue

@@ -0,0 +1,344 @@
+<template>
+    <el-dialog
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :title="title"
+        :append-to-body="true"
+        :visible.sync="isVisible"
+        width="900px"
+        top="50px"
+    >
+      <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+          <!-- 列表数据 -->
+          <el-table
+            :key="tableKey"
+            ref="table"
+            v-loading="loading"
+            :data="tableData.data"
+            border
+            fit
+            row-key="id"
+            style="width: 100%;"
+            @selection-change="onSelectChange"
+            @cell-click="cellClick"
+          >
+              <!-- 序号 -->
+              <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+                <template slot-scope="scope">
+                  <div>
+                    {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+                  </div>
+                </template>
+            </el-table-column>
+            <!--<el-table-column align="center" type="selection" width="50" :reserve-selection="true" />-->
+            <!-- 产品类型 -->
+            <el-table-column prop="categoryDesc" label='产品类型' :show-overflow-tooltip="true"></el-table-column>
+            <!-- 产品编号 -->
+            <el-table-column prop="brandNo" label='产品编号' width="90px"></el-table-column>
+            <!-- 入库产品名称 -->
+            <el-table-column prop="brandName" label='入库产品名称' width="180px"></el-table-column>
+            <!-- 产品唯一码 -->
+            <el-table-column prop="uniqueCode" label='产品唯一码' width="180px"></el-table-column>
+            <!-- 库存编码 -->
+            <el-table-column prop="storgeNo" label='库存编码' width="180px"></el-table-column>
+            <!-- 数量 -->
+            <el-table-column prop="num" :label='$t("lineSide.table.emulateProd.name6")' width="60px"></el-table-column>
+            <!-- 入库时间 -->
+               <el-table-column prop="createTime" :label='$t("lineSide.table.emulateProd.name9")' width="180px"></el-table-column>
+            <!-- 是否锁定 -->
+            <el-table-column prop="lockStatus" :label='$t("lineSide.table.emulateProd.name10")' align="center" width="90px">
+                <template slot-scope="{ row }">
+                <el-tag :type="row.status=='1' ? 'success' : 'danger'">
+                    {{ row.status=='1' ? $t("common.yes") : $t("common.no") }}
+                </el-tag>
+              </template>
+            </el-table-column>
+          <!-- 是否冻结 -->
+          <el-table-column prop="status" :label='$t("lineSide.table.emulateProd.name11")' align="center" width="90px">
+                <template slot-scope="{ row }">             
+                <el-tag :type="row.status=='0' ? 'danger':'success'">
+                    {{ row.status=='0' ? $t("common.yes") : $t("common.no") }}
+                </el-tag>
+              </template>
+            </el-table-column>
+          <el-table-column  prop="targetName" :label='$t("lineSide.table.emulateProd.name12")' align="center" width="180px">
+            <template slot-scope="{ row }">
+              <el-tag :type="row.targetName ? 'success' : 'danger'">
+                  {{ row.targetName? row.targetName: '无'}}
+              </el-tag>  
+              </template>
+          </el-table-column>
+          <el-table-column prop="completeBatchNo" :label='$t("lineSide.table.emulateProd.name13")' align="center" width="200px">
+            <template slot-scope="{ row }">
+              {{ row.completeBatchNo? row.completeBatchNo: (row.campId? row.campId: '')}}
+              </template>
+          </el-table-column>        
+          </el-table>
+          <!--<pagination
+            v-show="tableData.total > 0"
+            :limit.sync="queryParams.size"
+            :page.sync="queryParams.current"
+            :total="Number(tableData.total)"
+            @pagination="fetch"
+          />-->
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      </div>
+    </el-dialog>
+  </template>
+  <script>
+  
+  import { initQueryParams } from '@/utils/commons'
+  // import Pagination from "@/components/Pagination"
+  // 【仓库类型管理】-API
+  import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
+  // 【边线库管理】-API
+  import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
+  
+  export default {
+    name: 'TenantEdit',
+    components: {
+    //	Pagination
+    },
+    props: {
+      dialogVisible: {
+        type: Boolean,
+        default: false
+      },
+      title: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        type: 'add',
+        dialog: {
+          isVisible: false,
+          title: ""
+        },
+        tableKey: 0,
+        queryParams: initQueryParams({}),
+        selection: [],
+        loading: false,
+        tableData: {
+          total: 0
+        },
+  
+        tenant: this.initTenant(),
+        screenWidth: 0,
+        width: this.initWidth(),
+        confirmDisabled: false,
+        dicts:{
+          NATION: {}
+        },
+        roles: [],
+        rules: {
+          name: [
+              { required: true, message: this.$t("rules.require"), trigger: 'blur' }
+          ]
+        }
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+        // 加载列表数据
+        // this.fetch()
+      },
+    computed: {
+      isVisible: {
+        get () {
+          return this.dialogVisible
+        },
+        set () {
+          this.close()
+          this.reset()
+        }
+      }
+    },
+    mounted () {
+      window.onresize = () => {
+        return (() => {
+          this.width = this.initWidth()
+        })()
+      }
+    },
+    methods: {
+      initTenant () {
+        return {
+          id: '',
+          name: '',
+          status: '1'
+        }
+      },
+      initWidth () {
+        this.screenWidth = document.body.clientWidth
+        if (this.screenWidth < 991) {
+          return '90%'
+        } else if (this.screenWidth < 1400) {
+          return '45%'
+        } else {
+          return '800px'
+        }
+      },
+      setTenant (val, dicts) {
+          if(val){
+              console.log("库位产品:", val);
+              this.tenant = { ...val }
+              // 加载列表数据
+                this.getList(val);
+          }
+        // 字典表
+        this.dicts = dicts
+      },
+      close () {
+        this.$emit('close')
+      },
+      onSelectChange (selection) {
+        this.selection = selection
+      },
+      reset () {
+        // 先清除校验,再清除表单,不然有奇怪的bug
+        this.$refs.form.clearValidate()
+        this.$refs.form.resetFields()
+        this.tenant = this.initTenant()
+      },
+      submitForm () {
+        this.$refs.form.validate((valid) => {
+          if (valid) {
+            this.confirmDisabled = true
+            if (this.type === 'add') {
+              this.save()
+            } else {
+              this.update()
+            }
+          } else {
+            return false
+          }
+        })
+      },
+      save () {
+        warehouseTypeMgrApi.save(this.tenant)
+          .then((response) => {
+            const res = response.data
+            if (res.isSuccess) {
+              this.isVisible = false
+              this.$message({
+                message: this.$t('tips.createSuccess'),
+                type: 'success'
+              })
+              // 通知列表
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");
+            }
+          }).finally(() => {
+            this.confirmDisabled = false
+            return true
+          })
+      },
+      update () {
+        warehouseTypeMgrApi.update(this.tenant)
+          .then((response) => {
+            const res = response.data
+            if (res.isSuccess) {
+              this.isVisible = false
+              this.$message({
+                message: this.$t('tips.updateSuccess'),
+                type: 'success'
+              })
+              // 通知列表
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");
+            }
+          }).finally(() => {
+            this.confirmDisabled = false
+            return true
+          })
+      },
+  
+      // 获取列表数据
+      getList (row) {
+            this.loading = true
+            lineSideMgrApi.getGoodsListBystorgeId({ storgeId: row.id }).then(response => {
+              const res = response.data
+              console.log("res123123214==== ", res);
+              if (res.isSuccess) {
+                this.tableData = res
+              }
+              // eslint-disable-next-line no-return-assign
+            }).finally(() => this.loading = false)
+  
+          },
+  
+      fetch (params = {}) {
+            this.loading = true
+            if (this.queryParams.timeRange) {
+              this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
+              this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
+            }
+  
+            this.queryParams.current = params.current ? params.current : this.queryParams.current
+            this.queryParams.size = params.size ? params.size : this.queryParams.size
+            lineSideMgrApi.page(this.queryParams).then(response => {
+              const res = response.data
+              if (res.isSuccess) {
+                this.tableData = res.data
+              }
+              // eslint-disable-next-line no-return-assign
+            }).finally(() => this.loading = false)
+  
+          },
+          cellClick (row, column) {
+            if (column['columnKey'] === "operation") {
+              return
+            }
+            let flag = false
+            this.selection.forEach((item) => {
+              if (item.id === row.id) {
+                flag = true
+                this.$refs.table.toggleRowSelection(row)
+              }
+            })
+  
+            if (!flag) {
+              this.$refs.table.toggleRowSelection(row, true)
+            }
+          }
+  
+    }
+  }
+  </script>
+  <style lang="scss" >
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409eff;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    text-align: center;
+  }
+  .avatar {
+    width: 100px;
+    height: 100px;
+    display: block;
+  }
+  .checkUsed{
+      display: inline-block;
+      margin-left: 10px;
+      color: #1890ff;
+  }
+  </style>
+  

+ 344 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/cutterCategoriesGroup/tab/groupCutter/components/View2.vue

@@ -0,0 +1,344 @@
+<template>
+    <el-dialog
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :title="title"
+        :append-to-body="true"
+        :visible.sync="isVisible"
+        width="900px"
+        top="50px"
+    >
+      <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+          <!-- 列表数据 -->
+          <el-table
+            :key="tableKey"
+            ref="table"
+            v-loading="loading"
+            :data="tableData.data"
+            border
+            fit
+            row-key="id"
+            style="width: 100%;"
+            @selection-change="onSelectChange"
+            @cell-click="cellClick"
+          >
+              <!-- 序号 -->
+              <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+                <template slot-scope="scope">
+                  <div>
+                    {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+                  </div>
+                </template>
+            </el-table-column>
+            <!--<el-table-column align="center" type="selection" width="50" :reserve-selection="true" />-->
+            <!-- 产品类型 -->
+            <el-table-column prop="categoryDesc" label='产品类型' :show-overflow-tooltip="true"></el-table-column>
+            <!-- 产品编号 -->
+            <el-table-column prop="cuttingToolId" label='产品编号' width="90px"></el-table-column>
+            <!-- 入库产品名称 -->
+            <el-table-column prop="cuttingToolName" label='刀具名称' width="240px"></el-table-column>
+            <!-- 产品唯一码 -->
+            <el-table-column prop="knifepStandNumber" label='刀架号' width="100px"></el-table-column>
+            <!-- 库存编码 -->
+            <el-table-column prop="cuttingToolPosition" label='刀位号' width="100px"></el-table-column>
+            <!-- 数量 -->
+            <el-table-column prop="num" :label='$t("lineSide.table.emulateProd.name6")' width="60px"></el-table-column>
+            <!-- 入库时间 -->
+               <el-table-column prop="earlyWarnning" label='极限报警' width="120px"></el-table-column>
+            <!-- 是否锁定 -->
+            <el-table-column prop="status" :label='$t("lineSide.table.emulateProd.name10")' align="center" width="90px">
+                <template slot-scope="{ row }">
+                <el-tag :type="row.status=='1' ? 'success' : 'danger'">
+                    {{ row.status=='1' ? $t("common.yes") : $t("common.no") }}
+                </el-tag>
+              </template>
+            </el-table-column>          
+          <el-table-column prop="isMainShaft" label='是否主轴' align="center" width="90px">
+                <template slot-scope="{ row }">             
+                <el-tag :type="row.isMainShaft=='1' ? 'danger':'success'">
+                    {{ row.isMainShaft=='1' ? $t("common.yes") : $t("common.no") }}
+                </el-tag>
+              </template>
+            </el-table-column>
+          <el-table-column  prop="rd" label='取刀具号' align="center" width="180px">
+            <template slot-scope="{ row }">
+              <el-tag :type="row.rd ? 'success' : 'danger'">
+                  {{ row.rd? row.rd: '无'}}
+              </el-tag>  
+              </template>
+          </el-table-column>
+          <el-table-column prop="doc" label='换刀标识' align="center" width="200px">
+            <template slot-scope="{ row }">
+              {{ !row.doc? '':(row.doc=='HD'?'换刀':(row.doc=='FDJ'?'放刀架':''))}}
+              </template>
+          </el-table-column>        
+          </el-table> 
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      </div>
+    </el-dialog>
+  </template>
+  <script>
+  
+  import { initQueryParams } from '@/utils/commons'
+  // 【边线库管理】-API
+  import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
+  import machineCustomizeCuttingToolMgrApi from "@/api/prepareProductMgr/machineCustomizeCuttingTool"
+  
+  export default {
+    name: 'TenantEdit',
+    components: {
+    //	Pagination
+    },
+    props: {
+      dialogVisible: {
+        type: Boolean,
+        default: false
+      },
+      title: {
+        type: String,
+        default: ''
+      }
+    },
+    data () {
+      return {
+        type: 'add',
+        dialog: {
+          isVisible: false,
+          title: ""
+        },
+        tableKey: 0,
+        queryParams: initQueryParams({}),
+        selection: [],
+        loading: false,
+        tableData: {
+          total: 0
+        },
+  
+        tenant: this.initTenant(),
+        screenWidth: 0,
+        width: this.initWidth(),
+        confirmDisabled: false,
+        dicts:{
+          NATION: {}
+        },
+        roles: [],
+        rules: {
+          name: [
+              { required: true, message: this.$t("rules.require"), trigger: 'blur' }
+          ]
+        }
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+        // 加载列表数据
+        // this.fetch()
+      },
+    watch: {
+	  	// 如果rowData.id的值改变了
+	  	'tenant.id': {
+	  		handler(val, oldVal) {
+	        // 加载列表数据
+	  			//this.getPidCode()
+	      }
+	  	}
+	},  
+    computed: {
+      isVisible: {
+        get () {
+          return this.dialogVisible
+        },
+        set () {
+          this.close()
+          this.reset()
+        }
+      }
+    },
+    mounted () {
+      window.onresize = () => {
+        return (() => {
+          this.width = this.initWidth()
+        })()
+      }
+    },
+    methods: {
+      initTenant () {
+        return {
+          id: '',
+          name: '',
+          status: '1'
+        }
+      },
+      initWidth () {
+        this.screenWidth = document.body.clientWidth
+        if (this.screenWidth < 991) {
+          return '90%'
+        } else if (this.screenWidth < 1400) {
+          return '45%'
+        } else {
+          return '800px'
+        }
+      },
+      setTenant (val, dicts) {
+          if(val){
+              console.log("库位产品:", val);
+              this.tenant = { ...val }
+              // 加载列表数据
+              this.getList(val);
+          }
+        // 字典表
+        this.dicts = dicts
+      },
+      close () {
+        this.$emit('close')
+      },
+      onSelectChange (selection) {
+        this.selection = selection
+      },
+      reset () {
+        // 先清除校验,再清除表单,不然有奇怪的bug
+        this.$refs.form.clearValidate()
+        this.$refs.form.resetFields()
+        this.tenant = this.initTenant()
+      },
+      submitForm () {
+        this.$refs.form.validate((valid) => {
+          if (valid) {
+            this.confirmDisabled = true
+            if (this.type === 'add') {
+              this.save()
+            } else {
+              this.update()
+            }
+          } else {
+            return false
+          }
+        })
+      },
+      save () {
+        warehouseTypeMgrApi.save(this.tenant)
+          .then((response) => {
+            const res = response.data
+            if (res.isSuccess) {
+              this.isVisible = false
+              this.$message({
+                message: this.$t('tips.createSuccess'),
+                type: 'success'
+              })
+              // 通知列表
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");
+            }
+          }).finally(() => {
+            this.confirmDisabled = false
+            return true
+          })
+      },
+      update () {
+        warehouseTypeMgrApi.update(this.tenant)
+          .then((response) => {
+            const res = response.data
+            if (res.isSuccess) {
+              this.isVisible = false
+              this.$message({
+                message: this.$t('tips.updateSuccess'),
+                type: 'success'
+              })
+              // 通知列表
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");
+            }
+          }).finally(() => {
+            this.confirmDisabled = false
+            return true
+          })
+      },
+  
+      // 获取列表数据
+      getList (row) {
+            this.loading = true            
+            machineCustomizeCuttingToolMgrApi.get( row.id ).then(response => {
+              const res = response.data              
+              if (res.isSuccess) {               
+                res.data.num = 1
+                res.data.categoryDesc='刀具'
+                this.tableData.data = [res.data]
+              }
+              // eslint-disable-next-line no-return-assign
+            }).finally(() => this.loading = false)
+  
+          },
+  
+      fetch (params = {}) {
+            this.loading = true
+            if (this.queryParams.timeRange) {
+              this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
+              this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
+            }
+  
+            this.queryParams.current = params.current ? params.current : this.queryParams.current
+            this.queryParams.size = params.size ? params.size : this.queryParams.size
+            lineSideMgrApi.page(this.queryParams).then(response => {
+              const res = response.data
+              if (res.isSuccess) {
+                this.tableData = res.data
+              }
+              // eslint-disable-next-line no-return-assign
+            }).finally(() => this.loading = false)
+  
+          },
+          cellClick (row, column) {
+            if (column['columnKey'] === "operation") {
+              return
+            }
+            let flag = false
+            this.selection.forEach((item) => {
+              if (item.id === row.id) {
+                flag = true
+                this.$refs.table.toggleRowSelection(row)
+              }
+            })
+  
+            if (!flag) {
+              this.$refs.table.toggleRowSelection(row, true)
+            }
+          }
+  
+    }
+  }
+  </script>
+  <style lang="scss" >
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409eff;
+  }
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+    text-align: center;
+  }
+  .avatar {
+    width: 100px;
+    height: 100px;
+    display: block;
+  }
+  .checkUsed{
+      display: inline-block;
+      margin-left: 10px;
+      color: #1890ff;
+  }
+  </style>
+  

+ 409 - 95
imcs-ui/src/views/zuihou/centralToolMagazine/cutterCategoriesGroup/tab/groupCutter/index.vue

@@ -1,47 +1,42 @@
 <template>
-  <div class="app-container">
-    <!-- 搜索模块 -->
-    <div class="filter-container">
-      <!-- <span>
-        <span>刀具名:</span>
-        <el-input
-          v-model="queryParams.model.cutterName"
-          :placeholder="$t('common.pleaseEnter')"
-          style="width: 150px"
-          size="medium"
-        />
-      </span>
-      <span>
-        <span>刀号:</span>
-        <el-input
-          v-model="queryParams.model.cutterT"
-          :placeholder="$t('common.pleaseEnter')"
-          style="width: 150px"
-          size="medium"
-        />
-      </span> -->
-      <!-- <span style="margin-left: 15px">
-        <span>刀具类型:</span>
-        <el-select v-model="queryParams.model.cutterTyp" clearable :placeholder="$t('common.pleaseEnter')">
-          <el-option
-            v-for="item in cutterTypList"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
-      </span> -->
-      <!-- <span style="margin-left: 15px">
-        <span>数据状态:</span>
-        <el-select v-model="queryParams.model.status" clearable :placeholder="$t('common.pleaseEnter')">
-          <el-option
-            v-for="item in cutterStatusList"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
-          </el-option>
-        </el-select>
-      </span> -->
+  <div class="app-container">    
+    <!-- 货架区域 -->
+  	<div class="areaDiv" style="width: 100%;overflow-x: auto;">
+		<template>
+			<div class="tableBlock" v-for="item in shelvesTreeList" :key="item.id">
+				<table class="contentDiv" border="0" cellspacing="0" cellpadding="6">					
+	  				<tr v-for="(objTr, objIndex) in item.layList" :key="objIndex">
+	  					<td v-for="objTd in objTr.stockList" :key="objTd.id" :class="objTd.storgeStockCount>0 ? 'blueBg' : ''" @click="view(objTd)">
+	  						{{objTd.no}}
+	  						<el-image v-if="objTd.lockStatus == '0'" class="locked" :src="resolveLogo(lockImg)" fit="contain"></el-image>
+	  					</td>	  					
+	  				</tr>
+				</table>
+				<div class="footerDiv">{{item.name}}({{item.no}})</div>
+			</div>
+			<div></div>
+			
+			<div class="tableBlock" v-for="(machine, mIndex) in machineTreeList" :key="mIndex">	                
+		    	<table class="contentDiv" border="0" cellspacing="0" cellpadding="6">
+	  				<tr v-for=" (row,index) in numbers" :key="machine.id+'_'+index">
+						<td v-for="(item, itemIndex) in row" :key="machine.id+'_'+index+'_'+itemIndex" :class="cutterMap.has(machine.id) && cutterMap.get(machine.id).includes(item) ? (machine.cutterNameList && cutterNameMap.get(machine.id).has(item.toString()) && machine.cutterNameList.includes(cutterNameMap.get(machine.id).get(item.toString())) ? 'yellowBg': 'blueBg') : ''" @click="cutterView(machine.id, item)" >																			
+						    <span >
+								{{ item }}
+								<el-image v-if="lockMap.has(machine.id) && lockMap.get(machine.id).includes(item)" class="locked" :src="resolveLogo(lockImg)" fit="contain"></el-image>
+							</span>							
+						</td>	  					  			
+	  				</tr>	  				
+	  			</table>
+				<div class="footerDiv">
+					{{machine.name}}({{machine.code}})
+				    {{machine.programName? '机床加工中('+ machine.programName +')' : '机床空闲中'}}
+				</div>
+			</div>
+		</template>
+	</div>
+
+	<!-- 搜索模块 -->
+    <div class="filter-container">      
       <span style="margin-left: 15px">
         <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
 	        {{ $t("table.search") }}
@@ -53,22 +48,6 @@
     </div>
     <!-- 搜索结束 -->
 
-    <!-- 功能按钮 -->
-    <el-row class="filter-container">
-    	<el-col>
-    		<!-- <el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['classSchedule:add']" @click="add">{{ $t("common.add") }}</el-button>
-	    	<el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['classSchedule:update']" @click="editOne">
-	        	{{ $t("common.edit") }}
-	    	</el-button>
-	      	<el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['classSchedule:delete']" @click="batchDelete">
-	        	{{ $t("table.delete") }}
-	      	</el-button>
-	      	<el-button type="primary" icon="el-icon-thumb" size="medium" v-has-permission="['classSchedule:submitAudit']" @click="updateStatus('1')">{{$t("common.audio.addAudio")}}</el-button>
-	      	<el-button type="primary" icon="el-icon-suitcase" size="medium" v-has-permission="['classSchedule:audit']" @click="audioBtn()">{{$t("common.audio.audio")}}</el-button> -->
-			<!-- <el-button  type="primary" icon="el-icon-c-scale-to-original" size="medium" v-has-permission="['classSchedule:audit']" @click="openDrawerWin()">导入</el-button> -->
-		</el-col>
-    </el-row>
-
 		<!-- 列表数据 -->
     <el-table
       :key="tableKey"
@@ -137,6 +116,26 @@
 		@success="editSuccess"
 	  />
 	</div>
+
+	<!--新增修改 -->
+	<div>
+	  <tenant-view
+		ref="view"
+		:dialog-visible="dialog2.isVisible"
+		:title="dialog2.title"	
+		@close="viewClose"		
+	  />
+	</div>
+
+	<div>
+	  <view2 
+		ref="view2"
+		:dialog-visible="dialog3.isVisible"
+		:title="dialog3.title"	
+		@close="view2Close"		
+	  />
+	</div>
+
   </div>
 
 </template>
@@ -145,22 +144,36 @@
 <script>
 	import classScheduleMgrApi from "@/api/modelingCenter/cutterCategoriesGroup"
 	import { initDicts, initQueryParams } from '@/utils/commons'
+	import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
+	import machineCustomizeCuttingToolMgrApi from "@/api/prepareProductMgr/machineCustomizeCuttingTool"
+
 
 	// 引入组件
 	//分页
 	import Pagination from "@/components/Pagination"
 	import Edit from "./components/Edit"
+	import TenantView from "./components/View"
+	import View2 from "./components/View2"
 
 	import { convertEnum } from '@/utils/utils'
 
 	export default {
 	  name: "WarehouseTypeMgr",
-	  components: { Pagination , Edit},
+	  components: { Pagination , Edit, TenantView, View2},
 	  props: {
 	  },
 	  data () {
 	    return {
 		drawerVisible: false,
+		shelvesTreeList: [],
+		machineTreeList: [],
+		layList: [],
+		cutterList:[],	
+		cutterMap: new Map(),
+		lockMap: new Map(),	
+		cutterNameMap : new Map(),
+		numbers: [[1,2,3,4,5,6,7,8],[9,10,11,12,13,14,15,16],[17,18,19,20,21,22,23,24],[25,26,27,28,29,30,31,32],[33,34,35,36,37,38,39,40]],
+		lockImg: 'locked.png',
         cutterTypList: [{
           value: 'A0',
           label: '普通铣刀'
@@ -275,6 +288,14 @@
 	        isVisible: false,
 	        title: ""
 	      },
+		  dialog2: {
+	        isVisible: false,
+	        title: ""
+	      },
+		  dialog3: {
+	        isVisible: false,
+	        title: ""
+	      },		  
 		  cutterTtest:{
 	        isVisible: true,
 	        title: "对刀仪检测"
@@ -308,9 +329,12 @@
 	  	// 调用常量-审核状态
 	  	// this.audioStatus = this.$constWKS.AUDIOLIST
 	  	// // 加载【字典】
-		initDicts(['CUTTING_TOOL_TYPE','CUTTING_TOOL_CATEGORY'], this.dicts);
+		initDicts(['CUTTING_TOOL_TYPE','CUTTING_TOOL_CATEGORY'], this.dicts);		
 	  	// 加载列表数据
-	  	this.fetch()
+		  this.fetch();
+		  this.getTabList();
+		  this.machineDataList();
+		  
 		},
 	  computed: {
 		cuttingToolTypeList() {
@@ -324,6 +348,8 @@
       }
 	  },
 	  mounted () {
+		
+			
 	  },
 	  methods: {
 		spanMethod({rowIndex,columnIndex}) {
@@ -381,9 +407,76 @@
                 }
             }
         },
+		getTabList(){
+	    	lineSideMgrApi.iconList({}).then(res => {
+	    		res = res.data	    		
+	    		if(res.isSuccess){
+    				// 设备的货架数据
+    				this.shelvesTreeList.push(res.data.shelvesTreeList[2])
+					res.data.shelvesTreeList[0].layList[0].stockList = res.data.shelvesTreeList[0].layList[0].stockList.filter(item=>item.no.indexOf('线后')>-1);					
+					this.shelvesTreeList.push(res.data.shelvesTreeList[0])
+	    		}
+	    	})
+			this.queryParams.current = 1
+	        this.queryParams.size = 10000
+			lineSideMgrApi.getMachineInfo({}).then(res => {
+	    		res = res.data				
+	    		//console.log("机床列表:", res);				
+	    		if(res.isSuccess){
+    				// 设备的货架数据
+    				this.machineTreeList = res.data
+					this.machineTreeList.forEach(item => {
+						if(item.programName){			
+							this.queryParams.model.programName = item.programName				
+	      					classScheduleMgrApi.pageListByPartNeedCutter(this.queryParams).then(response => {
+                                const res2 = response.data
+								if (res2.isSuccess) {	
+									item['cutterCategoryList'] = res2.data.records							    
+									item['cutterNameList'] = res2.data.records.map(item=>item.cutterName); 																	
+								}
+							});
+						}	
+					});					
+	    		}
+	    	});		
+						
+	    },
+		machineDataList(){
+            machineCustomizeCuttingToolMgrApi.getMachineList().then(res => {
+	    		res = res.data
+	    		//console.log("方块列表2:", res)				
+	    		if(res.isSuccess){
+    				// 设备的货架数据					   
+					this.layList = res.data 										                    
+					this.machineTreeList.forEach(item=>{
+						let objs = this.layList[item.id]
+						let dataList = []
+						let lockList = []						
+						let cutterNames = new Map()
+                        objs.forEach(obj=>{		
+							dataList.push(obj.knifepStandNumber);
+							if(obj.status=='1'){
+								lockList.push(obj.knifepStandNumber);
+							}		
+							cutterNames.set(obj.knifepStandNumber.toString(), obj.cuttingToolName)						
+						});
+											
+						if(dataList.length>0){						
+							this.cutterMap.set(item.id, dataList);
+						}											
+						if(cutterNames){							
+							this.cutterNameMap.set(item.id, cutterNames);
+						}
+						if(lockList.length>0){							
+						    this.lockMap.set(item.id, lockList);		
+						}		
+					})		
+								
+	    		}
+				
+	    	})
 
-
-
+		},
 	  	// 【设置班表】按钮-事件
 	  	settingClass(row){
 	  		this.objData = row
@@ -484,7 +577,10 @@
 	      })
 	    },
 	    viewClose () {
-	      this.tenantViewVisible = false
+			this.dialog2.isVisible = false
+	    },
+		view2Close () {
+			this.dialog3.isVisible = false
 	    },
 	    editClose () {
 	      this.dialog.isVisible = false
@@ -569,35 +665,27 @@
 	      })
 	    },
 	    view (row) {
-	      this.$refs.view.setTenant(row)
-	      this.tenantViewVisible = true
+	      this.$refs.view.setTenant(row, this.dicts)
+	      this.$refs.view.type = "edit"
+	      this.dialog2.title = this.$t("common.edit")
+	      this.dialog2.isVisible = true
+	    },
+		view2 (row) {
+	      this.$refs.view2.setTenant(row, this.dicts)
+	      this.$refs.view2.type = "edit"
+	      this.dialog3.title = this.$t("common.edit")
+	      this.dialog3.isVisible = true
 	    },
+		cutterView(machineId, index){
+			let rowList = this.layList[machineId]
+			let row = rowList.filter(item=>item.knifepStandNumber===index);		
+			this.view2(row[0])	
+		},
 	    // 【修改】表头上Btn-事件
-	    editOne() {
-	    	if (!this.selection.length) {
-	        this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	if (this.selection.length > 1) {
-	        this.$message({
-	          message: this.$t("tips.mustOne"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	    	this.edit(this.selection[0]);
+	    editOne(row) {
+	    	this.edit(row);
 	    },
-	    edit (row) {
-	      if (row.readonly) {
-	        this.$message({
-	          message: this.$t("tips.systemData"),
-	          type: "warning"
-	        })
-	        return
-	      }
+	    edit (row) {	      
 	      this.$refs.edit.setTenant(row, this.dicts)
 	      this.$refs.edit.type = "edit"
 	      this.dialog.title = this.$t("common.edit")
@@ -616,7 +704,6 @@
 	      this.queryParams.size = params.size ? params.size : this.queryParams.size
 	      classScheduleMgrApi.page(this.queryParams).then(response => {
 	        const res = response.data
-          console.log("====="+ res);
 	        if (res.isSuccess) {
 	          this.tableData = res.data 
 	          // 给列表设置条数
@@ -644,6 +731,9 @@
 	        this.$refs.table.toggleRowSelection(row, true)
 	      }
 	    },
+		resolveLogo(logo) {
+        return require(`@/assets/icon/${logo}`);
+      },
 		openDrawerWin (){
 			console.log("打开弹框");
 			this.drawerVisible = true;
@@ -667,15 +757,239 @@
 	  }
 	}
 </script>
+
+<style lang="scss" scoped>
+	.blockDiv{
+		position: relative;
+		border: 1px solid #EEEEEE;
+		padding-left: 15px;
+		-moz-border-radius: 5px;
+		-webkit-border-radius: 5px;
+		border-radius: 5px;
+		text-align: center;
+		color: white;
+		-moz-box-shadow: 1px 5px 5px #c0b7b7;
+		webkit-box-shadow: 1px 5px 5px #c0b7b7;
+		box-shadow: 1px 5px 5px #c0b7b7;
+		h1{
+			margin: 20px;
+			font-size: 45px;
+		}
+		p{
+			text-align: left;
+			color: #FFFFFF;
+		}
+	}
+	.danweiSpan{
+		display: inline-block;
+		font-size: 16px;
+		color: black;
+	}
+	.blockBg1{
+		background: #0F79DC;
+		border: 1px solid #0F79DC;
+	}
+	.blockBg2{
+		background: #8E66E4;
+		border: 1px solid #8E66E4;
+	}
+	.blockBg3{
+		background: #3EB64B;
+		border: 1px solid #3EB64B;
+	}
+	.blockBg4{
+		background: #0BA6D5;
+		border: 1px solid #0BA6D5;
+	}
+	.blockBg5{
+		background: #E57878;
+		border: 1px solid #E57878;
+	}
+	.blockBg6{
+		background: #E37B3D;
+		border: 1px solid #E37B3D;
+	}
+	.rowCls{
+		background: white;
+		box-sizing: border-box;
+		border-bottom: 2px dotted #AAAAAA;
+		margin-bottom: 15px;
+	}
+	.rowCls .el-col{
+		margin-bottom: 20px;
+	}
+	.doubleTable{
+		width: 100%;
+	}
+	.doubleTable h1{
+		margin: 17px 0;
+	}
+	.el-card{
+		display: inline-block;
+		min-width: 290px;
+		margin: 0 5px 5px 0;
+	}
+	.areaTitle{
+		margin-bottom: 15px;
+	}
+	.areaTitle span{
+		position: relative;
+		display: inline-block;
+		padding-right: 20px;
+		font-weight: bold;
+	}
+	.areaTitle span:before{
+		position: absolute;
+		content: '';
+		background: #42d885;
+		top: 0px;
+		right: 0px;
+		width: 10px;
+		height: 100%;
+	}
+	.contentView{
+		background: #CCCCCC;
+		text-align: center;
+		padding: 3px 5px;
+		margin-bottom: 5px;
+		border-bottom: 4px solid red;
+	}
+	.hebingDiv{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-wrap: wrap;
+		max-width: 140px;
+		min-height: 60px;
+		border-bottom: 8px solid red;
+		word-break: break-all;
+	}
+	.lineBianku{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		background: #CCCCCC;
+		text-align: center;
+		padding: 3px 5px;
+		min-height: 60px;
+		max-width: 190px;
+		word-break: break-all;
+	}
+	.eqTitle{
+		width: 100%;
+		max-width: 70px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		font-size: 12px;
+		margin-bottom: 15px;
+	}
+	.eqTitle2{
+		width: 100%;
+		max-width: 70px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		font-size: 12px;
+	}
+	.recordSpan{
+		display: inline-block;
+		background: #0F79DC;
+		font-size: 12px;
+		padding: 2px 10px;
+		color: white;
+		-moz-border-radius: 3px;
+		-webkit-border-radius: 3px;
+		border-radius: 3px;
+	}
+	.jinduTiao{
+		margin: 5px 0;
+	}
+	.statusDiv{
+		text-align: right;
+	}
+	.statusDiv span{
+		display: inline-block;
+		font-size: 12px;
+		padding: 2px 10px;
+		color: white;
+		-moz-border-radius: 2px;
+		-webkit-border-radius: 2px;
+		border-radius: 2px;
+	}
+	.footerDiv{
+		text-align: center;
+		width: 100%;
+		padding: 7px 0;
+		border: 1px solid #AAAAAA;
+	}
+	.footerDiv a{
+		display: inline-block;
+		background: #0F79DC;
+		font-size: 12px;
+		padding: 5px 15px;
+		color: white;
+		-moz-border-radius: 3px;
+		-webkit-border-radius: 3px;
+		border-radius: 3px;
+	}
+	.footerDiv a:hover{
+		opacity: 0.7;
+	}
+	.tableBlock{
+		margin: 15px 30px 15px 0;
+		display: inline-block;
+	}
+	.topDiv{
+		text-align: center;
+	}
+	.topSpan{
+		display: inline-block;
+		padding: 10px;
+		color: white;
+		border: 1px solid #FFFFFF;
+		border-radius: 5px;
+		margin-right: 5px;
+	}
+	.contentDiv{
+		margin: 10px 0;
+		border-left: 1px solid #AAAAAA;
+		border-top: 1px solid #AAAAAA;
+	}
+	.contentDiv tr td {
+		position: relative;
+		cursor: pointer;
+		padding: 10px 25px;
+		border-right: 1px solid #AAAAAA;
+		border-bottom: 1px solid #AAAAAA;
+	}
+	.blueBg{
+		background: #548EC5;
+		color: white;
+	}
+	.redBg{
+		background: #d33941;
+		color: white;   
+	}
+	.yellowBg{
+		background: #abbd22;
+		color: white;
+	}
+	.locked{
+		position: absolute;
+		right: 2px;
+		top: 0;
+		width: 20px;
+		height: 25px;
+	}
+</style>
 <style>
 	.dialogNoTop .el-dialog__body{
 		padding: 0;
 	}
 </style>
-<style lang="scss" scoped></style>
-
 <style scoped>
      ::v-deep .topStyle {
         border-top:1px solid rgb(0, 149, 255);
     }
-</style>
+</style>

+ 1 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/cutterCategoriesGroup/tab/partNeedGroupCutter/index.vue

@@ -90,6 +90,7 @@
 		<el-table-column prop="bomName" label='零件名称' width="200px"></el-table-column>
 		<el-table-column prop="partsNo" label='零件编号' width="160px"></el-table-column>
 		<el-table-column prop="drawingNo" label='图号' width="160px"></el-table-column>
+		<el-table-column prop="priority" label='优先级' width="80px"></el-table-column>
 		<el-table-column prop="cutterT" label='刀号' width="100px"></el-table-column>
 		<el-table-column prop="cutterName" label='刀具名' width="220px"></el-table-column>
 		<el-table-column prop="cuttingToolType" label='刀具类型' width="100px">