Browse Source

刀柄管理

oyq28 1 year ago
parent
commit
7b99e48d61

+ 171 - 0
imcs-ui/src/api/modelingCenter/toolHandle.js

@@ -0,0 +1,171 @@
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+  getList: {
+    method: 'POST',
+    url: `/authority/toolHandle/all`
+  },
+  getTreeList: {
+    method: 'POST',
+    url: `/authority/toolHandle/shelvesTreeList`
+  },
+  page: {
+    method: 'POST',
+    url: `/authority/toolHandle/page`
+  },
+  update: {
+    method: 'POST',
+    url: `/authority/toolHandle/update`
+  },
+  save: {
+    method: 'POST',
+    url: `/authority/toolHandle`
+  },
+  updateStatus: {
+    method: 'POST',
+    url: `/authority/toolHandle/status`
+  },
+  remove: {
+    method: 'DELETE',
+    url: `/authority/toolHandle`
+  },
+  delete: {
+    method: 'POST',
+    url: `/authority/toolHandle/delete`
+  },
+  list: {
+    method: 'POST',
+    url: `/authority/toolHandle/query`
+  },
+  preview: {
+    method: 'POST',
+    url: `/authority/toolHandle/preview`
+  },
+  export: {
+    method: 'POST',
+    url: `/authority/toolHandle/export`
+  },
+  import: {
+    method: 'POST',
+    url: `/authority/toolHandle/import`
+  },
+  getAllList: {
+    method: 'POST',
+    url: `/authority/productionresource/getList`
+  },
+  setRule: {
+    method: 'POST',
+    url: `/authority/toolHandle/setRule`
+  },
+  getRule: {
+    method: 'POST',
+    url: `/authority/toolHandle/getRule`
+  }
+}
+
+export default {
+  	getList (data) {
+	    return axiosApi({
+	      ...apiList.getList,
+	      data
+	    })
+ 	},
+	getTreeList (data) {
+	    return axiosApi({
+	      ...apiList.getTreeList,
+	      data
+	    })
+	},
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.update,
+      data
+    })
+  },
+  updateStatus (data) {
+    return axiosApi({
+      ...apiList.updateStatus,
+      data
+    })
+  },
+  checkField (data) {
+    return axiosApi({
+      method: 'POST',
+      url: `/authority/toolHandle/check`,
+      data
+    })
+  },
+  remove (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  delete (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  list (data) {
+    return axiosApi({
+      ...apiList.list,
+      data
+    })
+  },
+  check (code) {
+    return axiosApi({
+      method: 'GET',
+      url: `/authority/toolHandle/check/${code}`
+    })
+  },
+  preview (data) {
+    return axiosApi({
+      ...apiList.preview,
+      data
+    })
+  },
+  export (data) {
+    return axiosApi({
+      ...apiList.export,
+      responseType: "blob",
+      data
+    })
+  },
+  import (data) {
+    return axiosApi({
+      ...apiList.import,
+      data
+    })
+  },
+  getAllList(data) {
+    return axiosApi({
+      ...apiList.getAllList,
+      data
+    })
+  },
+  setRule(data) {
+    return axiosApi({
+      ...apiList.setRule,
+      data
+    })
+  },
+  getRule(data) {
+    return axiosApi({
+      ...apiList.getRule,
+      data
+    })
+  }
+}

+ 454 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/toolHandle/Index.vue

@@ -0,0 +1,454 @@
+<template>
+  <div class="app-container">
+		<!-- 搜索模块 -->
+    <div class="filter-container">
+    	<span>
+    		<span>刀柄名称:</span>
+    		<el-input v-model="queryParams.model.handleName" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    	</span>
+    	<span>
+    		<span>刀柄编码:</span>
+    		<el-input v-model="queryParams.model.handleCode" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    	</span>
+      <span style="margin-left: 15px;">
+	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
+	        {{ $t("table.search") }}
+	      </el-button>
+	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
+	        {{ $t("table.reset") }}
+	      </el-button>
+      </span>
+    </div>
+
+    <!-- 功能按钮 -->
+    <el-row class="filter-container">
+    	<el-col>
+    		<el-button type="primary" icon="el-icon-plus" size="medium" v-has-permission="['goodsShelves:add']" @click="add">{{ $t("common.add") }}</el-button>
+	      <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['goodsShelves:update']" @click="editOne">
+	        {{ $t("common.edit") }}
+	      </el-button>
+	      <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['goodsShelves:delete']" @click="batchDelete">
+	        {{ $t("table.delete") }}
+	      </el-button>
+    	</el-col>
+    </el-row>
+
+		<!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.records"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+    	<el-table-column label='' width="50" align="center"></el-table-column>
+      <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
+      <el-table-column prop="handleName" :label='"刀柄名称"' :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="handleCode" :label='"刀柄编号"' :show-overflow-tooltip="true" ></el-table-column>
+      <el-table-column prop="handleMaterial" :label='"刀柄材料"' :show-overflow-tooltip="true" ></el-table-column>
+      <el-table-column prop="handleLength" :label='"刀柄长度"' :show-overflow-tooltip="true" ></el-table-column>
+      <el-table-column prop="manufacturer" :label='"生产厂家"' :show-overflow-tooltip="true" ></el-table-column>
+      <el-table-column prop="createTime" :label='$t("lineSide.table.toolManagement.createTime")' width="180px"></el-table-column>
+      <el-table-column
+        :label="$t('table.operation')"
+        fixed="right"
+        align="center"
+        column-key="operation"
+        width="140px"
+      >
+        <template slot-scope="{ row }">
+          <el-tooltip class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
+	          <i
+	            class="el-icon-edit table-operation"
+	            style="color: #2db7f5;"
+	            @click="edit(row)"
+	          />
+          </el-tooltip>
+          <el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
+	          <i
+	            class="el-icon-delete table-operation"
+	            style="color: #f50;"
+	            @click="singleDelete(row)"
+	          />
+          </el-tooltip>
+          <el-tooltip class="item" :content='$t("common.frozen")' effect="dark" placement="top-start">
+	          <i
+	            class="el-icon-warning-outline table-operation"
+	            style="color: #f50;"
+	            @click="dongJieRow(row)"
+	          />
+          </el-tooltip>
+        </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"
+    />
+    <tenant-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+    <tenant-view
+      ref="view"
+      :dialog-visible="tenantViewVisible"
+      @close="viewClose"
+    />
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      :title='$t("common.preview")'
+      width="80%"
+      top="50px"
+      :visible.sync="preview.isVisible"
+    >
+      <el-scrollbar>
+        <div v-html="preview.context" />
+      </el-scrollbar>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+	import Pagination from "@/components/Pagination"
+	import TenantEdit from "./components/Edit"
+	import TenantView from "./components/View"
+	// 【货架管理】-API
+	import toolHandleApi from "@/api/modelingCenter/toolHandle"
+	import elDragDialog from '@/directive/el-drag-dialog'
+	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
+	// 加载工具类
+	import { convertEnum, createTreeData } from '@/utils/utils'
+	import axios from 'axios'
+	export default {
+	  name: "GoodsShelvesMgr",
+	  directives: { elDragDialog },
+	  components: { Pagination, TenantEdit, TenantView },
+	  props: {
+	  },
+	  data () {
+	    return {
+	    	audioStatus: [],
+	      dialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      preview: {
+	        isVisible: false,
+	        context: ''
+	      },
+	      tenantViewVisible: false,
+	      tableKey: 0,
+	      queryParams: initQueryParams({}),
+	      selection: [],
+	      loading: false,
+	      tableData: {
+	        total: 0
+	      },
+	      dicts: {
+          NATION: {}
+        },
+	      enums: {
+	        TenantTypeEnum: {},
+	        TenantStatusEnum: {}
+	      }
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 调用常量-审核状态
+	  	this.audioStatus = this.$constWKS.STATUSORTHERLIST
+	  	// 加载【字典】
+	  	initDicts(['NATION'], this.dicts);
+	  	// 加载列表数据
+	  	this.fetch()
+		},
+	  computed: {
+	  	/* 转树形数据 */
+	    optionData() {
+	    	if(this.tableData.records){
+	    		let cloneData = JSON.parse(JSON.stringify(this.tableData.records)) // 对源数据深度克隆
+		      if(cloneData){
+		      	return createTreeData(cloneData)
+		      }
+	    	}
+	    },
+	    currentUser () {
+	      return this.$store.state.account.user
+	    },
+	    nationList() {
+        return convertEnum(this.dicts.NATION)
+      }
+	  },
+	  mounted () {
+
+	  },
+	  methods: {
+	  	// 【启用/冻结】按钮-事件
+	    updateActiveStatus(status){
+	    	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
+	      }
+	    	// 传值
+	    	let obj = {};
+	    	obj = this.selection[0];
+	    	obj.status = status;
+	    	// 调用接口后的提示信息
+	    	let msg = this.$t("tips.frozen")
+	    	if(status == "1"){
+	    		msg = this.$t("tips.enable")
+	    	}
+	    	toolHandleApi.update(obj).then(response => {
+	        if (response.status == 200) {
+	          this.$message({
+	            message: msg,
+	            type: "success"
+	          })
+	          // 重新查询列表数据
+	          this.search()
+	        }
+	      })
+	    },
+	    // 【冻结】-Table的Row操作事件
+	    dongJieRow(row) {
+	    	// 传值
+	    	let obj = {};
+	    	obj = row;
+	    	obj.status = "0";
+	    	toolHandleApi.update(obj).then(response => {
+	        if (response.status == 200) {
+	          this.$message({
+	            message: this.$t("tips.frozen"),
+	            type: "success"
+	          })
+	          // 重新查询列表数据
+	          this.search()
+	        }
+	      })
+	    },
+	    viewClose () {
+	      this.tenantViewVisible = false
+	    },
+	    editClose () {
+	      this.dialog.isVisible = false
+	    },
+	    editSuccess () {
+	      this.search()
+	    },
+	    onSelectChange (selection) {
+	      this.selection = selection
+	    },
+	    search () {
+	      this.fetch({
+	        ...this.queryParams
+	      })
+	    },
+	    reset () {
+	      this.queryParams = initQueryParams({})
+	      this.$refs.table.clearSort()
+	      this.$refs.table.clearFilter()
+	      this.search()
+	    },
+	    add () {
+	      this.$refs.edit.type = "add"
+	      this.$refs.edit.setTenant(false, this.dicts)
+	      // 【上级货架】数据设置
+	      this.$refs.edit.list = this.tableData.records
+	      this.dialog.title = this.$t("common.add")
+	      this.dialog.isVisible = true
+	    },
+	    singleDelete (row) {
+	      this.$refs.table.clearSelection()
+	      this.$refs.table.toggleRowSelection(row, true)
+	      this.batchDelete()
+	    },
+	    batchDelete () {
+	      if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+
+	      const readonlyIndex = this.selection.findIndex(item => item.readonly)
+
+	      if (readonlyIndex > -1) {
+	        this.$message({
+	          message: this.$t("tips.systemData"),
+	          type: "warning"
+	        })
+	        return
+	      }
+
+	      this.$confirm(this.$t("lineSide.tips.shelvsTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+	      	const ids = []
+		      let contain = false
+		      this.selection.forEach(item => {
+		        if (item.readonly) {
+		          contain = true
+		          return
+		        }
+		        ids.push(item.id)
+		      })
+		      if (contain) {
+		        this.$message({
+		          message: this.$t("tips.systemData"),
+		          type: "warning"
+		        })
+		      } else {
+		        this.delete(ids)
+		      }
+	      }).catch(() => {})
+	    },
+	    clearSelections () {
+	      this.$refs.table.clearSelection()
+	    },
+	    delete (ids) {
+	      toolHandleApi.remove({ ids: ids }).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.$message({
+	            message: this.$t("tips.deleteSuccess"),
+	            type: "success"
+	          })
+	          this.search()
+	          // 清理已经删除的数据
+	          this.$refs.table.clearSelection()
+	        }
+	      })
+	    },
+	    view (row) {
+	      this.$refs.view.setTenant(row)
+	      this.tenantViewVisible = true
+	    },
+	    // 【修改】表头上Btn-事件
+	    editOne() {
+	    	if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.unSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	    	if (this.selection.length > 1) {
+	        this.$message({
+	          message: this.$t("tips.mustOne"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	    	this.edit(this.selection[0]);
+	    },
+	    edit (row) {
+	      if (row.readonly) {
+	        this.$message({
+	          message: this.$t("tips.systemData"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	      this.$refs.edit.setTenant(row, this.dicts)
+	      this.$refs.edit.type = "edit"
+	      this.dialog.title = this.$t("common.edit")
+	      // 【上级货架】数据设置
+	      this.$refs.edit.list = this.tableData.records
+	      this.dialog.isVisible = true
+	    },
+	    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
+	      toolHandleApi.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)
+	      }
+	    },
+      getTagType(toolType) {
+        switch (toolType) {
+          case '1':
+            return 'success'; // 第一种类型的标签颜色
+          case '2':
+            return 'warning'; // 第二种类型的标签颜色
+          case '3':
+            return 'info'; // 第三种类型的标签颜色
+          case '4':
+            return 'danger'; // 第四种类型的标签颜色
+          default:
+            return 'default'; // 默认标签颜色,你可以根据需要修改
+        }
+      },
+      getToolTypeText(toolType) {
+        switch (toolType) {
+          case '0':
+            return this.$t('lineSide.common.central'); // 第一种类型的文本
+          case '1':
+            return this.$t('lineSide.common.lathe'); // 第二种类型的文本
+          case '2':
+            return '机器人随行货架'; // 第三种类型的文本
+          case '3':
+            return '机床刀具缓存库'; // 第四种类型的文本
+          case '4':
+            return '接驳位'; // 第四种类型的文本
+          default:
+            return ''; // 默认文本,你可以根据需要修改
+        }
+      }
+	  }
+	}
+</script>
+<style lang="scss" scoped></style>

+ 313 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/toolHandle/components/Edit.vue

@@ -0,0 +1,313 @@
+<template>
+  <el-dialog
+  	:close-on-click-modal="false"
+  	:close-on-press-escape="false"
+  	:title="title"
+  	:append-to-body="true"
+  	:visible.sync="isVisible"
+  	:width="width"
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+      <el-form-item :label='"刀柄名称"' prop="handleName">
+        <el-input v-model="tenant.handleName" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item :label='"刀柄编号"' prop="handleCode">
+        <el-input v-model="tenant.handleCode" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item :label='$t("lineSide.form.toolNo")' prop="toolId"  >
+        <el-select v-model="tenant.toolId"   style="width: 50%">
+          <el-option v-for="(item, index) in toolList" :key="index" :label="item.cuttingToolName" :value="item.id" />
+        </el-select>
+      </el-form-item>
+      <el-form-item :label='"刀柄材料"' prop="handleMaterial">
+        <el-input v-model="tenant.handleMaterial" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item :label='"刀柄长度"' prop="handleLength">
+        <el-input v-model="tenant.handleLength" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item :label='"生产厂家"' prop="manufacturer">
+        <el-input v-model="tenant.manufacturer" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// 【货架管理】-API
+import toolHandleApi from "@/api/modelingCenter/toolHandle";
+import TreeSelect from "@/components/TreeSelect/TreeSelect";
+import locationMgrApi from "@/api/lineSideLibrary/toolStorge";
+
+export default {
+  name: 'TenantEdit',
+  components: {
+    TreeSelect
+  },
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    let validateExsit = (rule, value, callback) => {
+      //后台方法
+      if(this.type=="edit" && value === this.oldName){
+        return callback()
+      }
+      this.checkExist(value).then(res => {
+        res = res.data
+        if (res && res.data) {
+          callback(new Error('名称已存在'))
+        }else{
+          callback()
+        }
+      })
+    }
+    return {
+    	isClearable: true, // 可清空(可选)
+      isAccordion: true, // 可收起(可选)
+      props: {
+        // 配置项(必选)
+        value: "id",
+        label: "name",
+        children: "children"
+        // disabled:true
+      },
+      // 选项列表(必选)
+      list: [],
+      deviceList: [],
+      type: 'add',
+      oldName: '',
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      showToolType: false,
+      dicts:{
+        NATION: {}
+      },
+      toolList: [],
+      roles: [],
+      rules: {
+        handleName: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ],
+        handleCode: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ],
+      }
+    }
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+      this.getToolList()
+		},
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+  	// 取值
+    getValue(value) {
+      this.tenant.parentId = value;
+      console.log(this.tenant.parentId);
+    },
+    getDeviceValue(value) {
+      this.tenant.deviceId = value;
+      console.log("tenant.deviceId:", this.tenant.deviceId);
+    },
+    getToolList(){
+      locationMgrApi.toolPageList({}).then(res => {
+        res = res.data
+        if(res.isSuccess){
+          this.toolList = res.data
+        }
+      })
+    },
+    initTenant () {
+      return {
+        id: '',
+        handleName:'',
+        handleCode:'',
+        toolId:null,
+        handleMaterial:'',
+        handleLength:'',
+        manufacturer:'',
+      }
+    },
+    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){
+    		this.tenant = { ...val }
+        this.oldName = val.name
+    		console.log("row数据:", val)
+    	}else{
+    		// 新增没有数据
+    		this.tenant.parentId = '0'
+    	}
+      // 字典表
+      this.dicts = dicts
+      // 加载列表数据
+	  	//this.getTreeList()
+      //this.getProductionresourceList()
+    },
+    close () {
+      this.$emit('close')
+    },
+    checkExist(name){
+      return toolHandleApi.checkField({"name":name})
+    },
+    reset () {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate()
+      this.$refs.form.resetFields()
+      this.tenant = this.initTenant()
+      // 清楚数据
+      this.tenant.parentId = ''
+    },
+    submitForm () {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.confirmDisabled = true
+          if (this.type === 'add') {
+            this.save()
+          } else {
+            this.update()
+          }
+        } else {
+          return false
+        }
+      })
+    },
+    save () {
+      toolHandleApi.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 () {
+      toolHandleApi.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
+        })
+    },
+    // 获取【上级货架】下拉数据
+		getTreeList(){
+			toolHandleApi.getTreeList({}).then(res => {
+				res = res.data
+				if(res.isSuccess){
+					console.log("获取【上级货架】下拉数据: ", res)
+					this.list = res.data
+				}
+			})
+		},
+    /*updateShowToolType() {
+      // 根据选择的 type 控制是否显示 toolType 输入框
+      this.showToolType = this.tenant.toolType === '1'; // 或者根据其他条件设置 showToolType 的值
+    },*/
+    // 获取【上级货架】下拉数据
+    getProductionresourceList(){
+      toolHandleApi.getAllList({}).then(res => {
+        res = res.data
+        if(res.isSuccess){
+          console.log("获取【设备】下拉数据: ", res)
+          this.deviceList = res.data
+          if (this.deviceList.length == 1) {
+            this.deviceId = this.deviceList[0].id;
+          }
+        }
+      })
+    }
+  }
+}
+</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>

+ 214 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/toolHandle/components/View.vue

@@ -0,0 +1,214 @@
+<template>
+  <el-dialog
+    :title="$t(&quot;common.view&quot;)"
+    :width="width"
+    :append-to-body="true"
+    :visible.sync="isVisible"
+    class="tenant-view"
+  >
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="24">
+        <div class="img-wrapper">
+          <img :src="tenant.logo">
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-user" />
+          <span>{{ $t('table.tenant.code') +':' }}</span>
+          {{ tenant.code }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-suitcase" />
+          <span>{{ $t('table.tenant.name') +':' }}</span>
+          {{ tenant.name }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-trophy" />
+          <span>{{ $t('table.tenant.type') +':' }}</span>
+          {{ tenant.type.desc }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>{{ $t('table.tenant.status') +':' }}</span>
+          {{ tenant.status.desc }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-star-off" />
+          <span>{{ $t('table.tenant.duty') +':' }}</span>
+          {{ tenant.duty }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-bangzhu" />
+          <span>{{ $t('table.tenant.expirationTime') +':' }}</span>
+          {{ tenant.expirationTime ? tenant.expirationTime : '永久' }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>{{ $t('table.createTime') +':' }}</span>
+          {{ tenant.createTime }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>{{ $t('table.updateTime') +':' }}</span>
+          {{ tenant.updateTime }}
+        </div>
+      </el-col>
+    </el-row>
+    <!--    <el-row :gutter='10'>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-date' />-->
+    <!--          <span>{{ $t('table.tenant.isMultipleLogin') +':' }}</span>-->
+    <!--          {{ tenant.isMultipleLogin ? '是' : '否'}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-document' />-->
+    <!--          <span>{{ $t('table.tenant.passwordExpire') +':' }}</span>-->
+    <!--          {{ tenant.passwordExpire == '0' ? '永久有效' :tenant.passwordExpire}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
+    <!--    <el-row :gutter='10'>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-document' />-->
+    <!--          <span>{{ $t('table.tenant.passwordErrorNum') +':' }}</span>-->
+    <!--          {{ tenant.passwordErrorNum}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-date' />-->
+    <!--          <span>{{ $t('table.tenant.passwordErrorLockTime') +':' }}</span>-->
+    <!--          {{ tenant.passwordErrorLockTime | passwordErrorLockTimeFilter }}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="24">
+        <div class="view-item">
+          <i class="el-icon-date" />
+          <span>{{ $t('table.tenant.describe') +':' }}</span>
+          {{ tenant.describe }}
+        </div>
+      </el-col>
+    </el-row>
+  </el-dialog>
+</template>
+<script>
+export default {
+  name: 'TenantView',
+  filters: {
+    passwordErrorLockTimeFilter (time) {
+      if (time === '0') {
+        return '当天23点59分'
+      }
+      return time
+    }
+  },
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      screenWidth: 0,
+      width: this.initWidth(),
+      tenant: {
+        type: {
+          desc: ''
+        },
+        status: {
+          desc: ''
+        }
+      }
+    }
+  },
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 550) {
+        return '95%'
+      } else if (this.screenWidth < 990) {
+        return '580px'
+      } else if (this.screenWidth < 1400) {
+        return '600px'
+      } else {
+        return '650px'
+      }
+    },
+    setTenant (val) {
+      this.tenant = { ...val }
+    },
+    close () {
+      this.$emit('close')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.tenant-view {
+  .img-wrapper {
+    text-align: center;
+    margin-top: -1.5rem;
+    margin-bottom: 10px;
+    img {
+      width: 4rem;
+      border-radius: 50%;
+    }
+  }
+  .view-item {
+    margin: 7px;
+    i {
+      font-size: 0.97rem;
+    }
+    span {
+      margin-left: 5px;
+    }
+  }
+}
+</style>