Forráskód Böngészése

fix:修改刀具基础数据

wang.sq@aliyun.com 5 hónapja
szülő
commit
ecb7d890c6

+ 61 - 30
imcs-ui/src/views/zuihou/prepareProductMgr/cuttingToolMgr/components/customizeCuttingTool/components/Edit.vue

@@ -8,30 +8,28 @@
   	width="750px"
   	top="50px"
   >
-    <el-form ref="form" :disabled="formDisabled" :model="customizeCuttingTool" :rules="rules" label-position="right" label-width="100px">
-      <!-- 刀具规格 -->
-      <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.specifications")+":"' prop="specifications">
-        <el-input v-model.trim="customizeCuttingTool.specifications"  :label='$t("common.pleaseEnter")' maxlength="255"></el-input>
+    <el-form ref="form" :disabled="formDisabled" :model="customizeCuttingTool" :rules="rules" label-position="right" label-width="130px">
+      <!-- 刀具 -->
+      <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.cuttingToolNo")+":"' prop="cuttingToolNo">
+        <el-input v-model.trim="customizeCuttingTool.cuttingToolNo"  :label='$t("common.pleaseEnter")' maxlength="128" style="width: 93%;"></el-input>
       </el-form-item>
-
       <!-- 刀具名称-->
       <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.cuttingToolName")+":"' prop="cuttingToolName">
-        <el-input v-model.trim="customizeCuttingTool.cuttingToolName"  :label='$t("common.pleaseEnter")' maxlength="128"></el-input>
+        <el-input v-model.trim="customizeCuttingTool.cuttingToolName"  :label='$t("common.pleaseEnter")' maxlength="128" style="width: 93%;"></el-input>
       </el-form-item>
-
+      <!-- 刀具规格 -->
+      <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.specifications")+":"' prop="specifications">
+        <el-input v-model.trim="customizeCuttingTool.specifications"  :label='$t("common.pleaseEnter")' maxlength="255" style="width: 93%;"></el-input>
+      </el-form-item>
+      <!-- 刀具类型-->
       <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.cuttingToolType")+":"' prop="cuttingToolType">
-      	<el-select v-model="customizeCuttingTool.cuttingToolType.key" :placeholder='$t("common.pleaseSelect")' style="width: 50%;">
+      	<el-select v-model="customizeCuttingTool.cuttingToolType.key" :placeholder='$t("common.pleaseSelect")' style="width: 93%;">
           <el-option :key="index" :label="item" :value="key" v-for="(item, key, index) in dicts.CUTTING_TOOL_TYPE" />
       	</el-select>
-      </el-form-item>      
-      <el-form-item v-if="customizeCuttingTool.cutterNo > 0"  :label='$t("cuttingTool.form.customizeCuttingtool.deviceId")+":"' prop="deviceId" >        
-      	<el-select v-model="customizeCuttingTool.deviceId" :placeholder='$t("common.pleaseSelect")' style="width: 50%;" >
-          <el-option :key="item.name" :label="item.name" :value="item.id" v-for="(item, index) in deviceData.records" />
-      	</el-select>
       </el-form-item>
-
-      <el-form-item v-if="customizeCuttingTool.cutterNo > 0 " :label='$t("cuttingTool.form.customizeCuttingtool.cutterNo")+":"' prop="cutterNo">
-      	<el-input-number v-model="customizeCuttingTool.cutterNo" :min="1"></el-input-number>
+      <!-- 刀位号 -->
+      <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.cutterNo")+":"' prop="cutterNo">
+      	<el-input-number v-model="customizeCuttingTool.cutterNo" :min="0" :max="1000"></el-input-number>
       </el-form-item>
 
       <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.cuttingToolPicture")+":"' prop="cuttingToolPicture">
@@ -80,7 +78,18 @@
           <el-image :src="customizeCuttingTool.cuttingToolInstallPicture" fit="cover" />
         </div>
       </el-form-item>
-
+      <!-- 刀具组刀参数-->
+      <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.toolSetToCheckParameter")+":"' prop="toolSetToCheckParameter">
+        <el-input v-model.trim="customizeCuttingTool.toolSetToCheckParameter" type="textarea" :rows="3"  style="width: 93%;" :label='$t("common.pleaseEnter")' maxlength="255"></el-input>
+        <el-tooltip
+          class="item"
+          :content="'长度不能超过3000位'"
+          effect="dark"
+          placement="top-end"
+        >
+          <i class="el-icon-question" />
+        </el-tooltip>
+      </el-form-item>
       <!-- 备注-->
       <el-form-item :label='$t("cuttingTool.form.customizeCuttingtool.remark")+":"' prop="remark">
         <el-input v-model.trim="customizeCuttingTool.remark" type="textarea" :rows="3"  style="width: 93%;" :label='$t("common.pleaseEnter")' maxlength="255"></el-input>
@@ -156,16 +165,23 @@ export default {
         title: ""
       },
       dicts:{
-        CUTTING_TOOL_TYPE: {}
+        CUTTING_TOOL_TYPE: {},
+        CUTTING_TOOL_CATEGORY: {},
       },
       roles: [],
       rules: {
+        cuttingToolNo: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' },
+        ],
         specifications: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'blur' },
         ],
         cuttingToolName: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'change' },
         ],
+        cutterCode: [
+          { required: true, message: this.$t("rules.require"), trigger: 'change' },
+        ],
         deviceId: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'change' },
         ],
@@ -179,12 +195,22 @@ export default {
             }
           }, trigger: ['blur','change'] }
         ],
+        cuttingToolCategory: [
+          { required: true, validator: (rule, value, callback) => {
+              console.log("this.customizeCuttingTool.cuttingToolCategory.key="+this.customizeCuttingTool.cuttingToolCategory.key)
+              if (this.customizeCuttingTool.cuttingToolCategory.key === null || this.customizeCuttingTool.cuttingToolCategory.key === "") {
+                callback(new Error("请选择刀具类别"))
+              } else {
+                callback()
+              }
+            }, trigger: ['blur','change'] }
+        ],
       }
     }
   },
   // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
   created() {
-	},
+  },
   computed: {
     headers() {
       return {
@@ -228,16 +254,22 @@ export default {
       return {
         id: '',
         specifications: '',
+
         cuttingToolName: '',
         cuttingToolType: {
-            key: ''
+            key: ""
+        },
+        cuttingToolCategory: {
+            key: ""
         },
         deviceId: '',
-        cutterNo: 1,
+        resourceIdList: [],
+        cutterNo: 0,
         cuttingToolPicture: '',
         cuttingToolInstallPicture: '',
         remark: '',
-        status: '1'
+        status: '1',
+        cutterCode: '',
       }
     },
     initWidth () {
@@ -251,14 +283,14 @@ export default {
       }
     },
     setCustomizeCuttingTool (val, dicts) {
+      console.log("dicts:",dicts);
     	if(val){
-    		this.customizeCuttingTool = { ...val }      
-        
+    		this.customizeCuttingTool = { ...val }
     	}
       // 字典表
       this.dicts = dicts
-      this.fetch({}) 
-      console.log(this.customizeCuttingTool)
+      this.fetch({})
+      console.log(this.dicts)
     },
     close () {
       this.$emit('close')
@@ -266,18 +298,17 @@ export default {
     fetch (params = {}) {
 	      this.loading = true
 	      this.queryMachineParams.current = params.current ? params.current : this.queryMachineParams.current
-	      this.queryMachineParams.size = 100 
+	      this.queryMachineParams.size = 100
 
         // 查询必须参数
         machineCustomizeCuttingToolMgrApi.getPageList(this.queryMachineParams).then(response => {
 	        const res = response.data
 	        if (res.isSuccess) {
-	          this.deviceData = res.data	         
+	          this.deviceData = res.data
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading = false)
-
-	    },
+    },
     reset () {
       // 先清除校验,再清除表单,不然有奇怪的bug
       this.$refs.form.clearValidate()

+ 374 - 373
imcs-ui/src/views/zuihou/prepareProductMgr/cuttingToolMgr/components/customizeCuttingTool/index.vue

@@ -1,376 +1,377 @@
 <template>
-  <div class="app-container">
-		<!-- 搜索模块 -->
-    <div class="filter-container">
-    	<span>
-    		<span>{{$t("cuttingTool.searchForm.customizeCuttingtool.cuttingtoolName")}}:</span>
-    		<el-input v-model="queryParams.model.cuttingToolName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
-    	</span>
-    	<span style="margin-left: 15px;">
-    		<span>{{$t("cuttingTool.searchForm.customizeCuttingtool.specifications")}}:</span>
-    		<el-input v-model="queryParams.model.specifications" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
-    	</span>
+	<div class="app-container">
+		  <!-- 搜索模块 -->
+	  <div class="filter-container">
+		  <span>
+			  <span>{{$t("cuttingTool.searchForm.customizeCuttingtool.cuttingtoolName")}}:</span>
+			  <el-input v-model="queryParams.model.cuttingToolName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
+		  </span>
+		  <span style="margin-left: 15px;">
+			  <span>{{$t("cuttingTool.searchForm.customizeCuttingtool.specifications")}}:</span>
+			  <el-input v-model="queryParams.model.specifications" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
+		  </span>
+  <!--		<span style="margin-left: 15px;">
+			  <span>{{$t("cuttingTool.searchForm.customizeCuttingtool.deviceId")}}:</span>
+			  <el-select v-model="queryParams.model.deviceId" :placeholder='$t("common.pleaseSelect")' style="width: 150px;">
+					<el-option :key="item.name" :label="item.name" :value="item.id" v-for="(item, index) in deviceData.records" />
+				</el-select>
+		  </span>-->
 		<span style="margin-left: 15px;">
-    		<span>{{$t("cuttingTool.searchForm.customizeCuttingtool.deviceId")}}:</span>
-			<el-select v-model="queryParams.model.deviceId" :placeholder='$t("common.pleaseSelect")' style="width: 150px;">
-          		<el-option :key="item.name" :label="item.name" :value="item.id" v-for="(item, index) in deviceData.records" />
-      		</el-select>
-    	</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" @click="add">{{ $t("common.add") }}</el-button>
-	      <el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
-	        {{ $t("common.edit") }}
-	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @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%;"
-      @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 align="center" prop="cuttingToolName" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolName")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 刀具规格 -->
-      <el-table-column align="center" prop="specifications" :label='$t("cuttingTool.table.customizeCuttingtool.specifications")' :show-overflow-tooltip="true"></el-table-column>
-      <!-- 设备名称 -->
-	  <el-table-column align="center" prop="deviceName" :label='$t("cuttingTool.table.customizeCuttingtool.storgeName")' :show-overflow-tooltip="true">
-	    <template slot-scope="{ row }">
-			{{row['deviceName']? row['deviceName'] : row['storgeName']}}
-	    </template>		
-	 </el-table-column>
-	  
-	  <!-- 刀具类型 -->
-      <el-table-column align="center"
-        :filter-multiple="false"
-        :filters="cuttingToolTypeList"
-        column-key="cuttingToolType.key"
-        :label="$t('cuttingTool.table.customizeCuttingtool.cuttingToolType')"
-        :show-overflow-tooltip="true"
-      >
-        <template slot-scope="scope">
-          <span>{{ scope.row.cuttingToolType['data'] ? scope.row.cuttingToolType['data'] : scope.row.cuttingToolType['key'] }}</span>
-        </template>
-      </el-table-column>
-      <!-- 刀具图片 -->
-<!--      <el-table-column prop="cuttingToolPicture" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolPicture")' :show-overflow-tooltip="true"></el-table-column>-->
-      <el-table-column align="center" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolPicture")' :show-overflow-tooltip="true">
-        <template slot-scope="{ row }">
-          <el-image
-            style="width: 100px; height: 100px"
-            :src="row.cuttingToolPicture"
-            :preview-src-list="[row.cuttingToolPicture]">
-          </el-image>
-        </template>
-      </el-table-column>
-      <!-- 装夹方式 -->
-      <el-table-column align="center" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolInstallPicture")' :show-overflow-tooltip="true">
-        <template slot-scope="{ row }">
-          <el-image
-            style="width: 100px; height: 100px"
-            :src="row.cuttingToolInstallPicture"
-            :preview-src-list="[row.cuttingToolInstallPicture]">
-          </el-image>
-        </template>
-      </el-table-column>
-      <!-- 启用状态 -->
-      <el-table-column prop="status" :label='$t("runCenter.table.oder.status")' align="center">
-      	<template slot-scope="{ row }">
-          <el-tag :type="row.status=='1' ? 'success' : 'danger'">
-          	{{ row.status=='1' ? $t("common.status.valid") : $t("common.frozen") }}
-          </el-tag>
-        </template>
-      </el-table-column>
-	  <!-- 启用状态 -->
-      <el-table-column prop="programId" :label='$t("runCenter.table.oder.state")' align="center">
-      	<template slot-scope="{ row }">
-          <el-tag :type="row.programId==null ? 'success' : 'danger'">
-          	{{ row.programId==null ? '可用' : '占用' }}
-          </el-tag>
-        </template>
-      </el-table-column>
-      <!-- 操作 -->
-      <el-table-column
-        :label="$t('table.operation')"
-        fixed="right"
-        align="center"
-        column-key="operation"
-        width="80px"
-      >
-        <template slot-scope="{ row }">
-          <el-tooltip class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
-			  {{row.cutterNo}}			  
-	          <i
-			    v-if="row.cutterNo==0"
-	            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
-			   v-if="row.cutterNo==0"
-	            class="el-icon-delete table-operation"
-	            style="color: #f50;"
-	            @click="singleDelete(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"
-    />
-    <edit
-      ref="edit"
-      :dialog-visible="dialog.isVisible"
-      :title="dialog.title"
-      @close="editClose"
-      @success="editSuccess"
-    />
-  </div>
-</template>
-
-<script>
-	import Pagination from "@/components/Pagination"
-	import Edit from "./components/Edit"
-  import { convertEnum } from '@/utils/utils'
-	// 【刀具基础数据】-API
-  // 【刀具管理】-API
-  import machineCustomizeCuttingToolMgrApi from "@/api/prepareProductMgr/machineCustomizeCuttingTool"
-  import customizeCuttingToolMgrApi from "@/api/prepareProductMgr/customizeCuttingTool"
-	import elDragDialog from '@/directive/el-drag-dialog'
-	import { initDicts,initQueryParams } from '@/utils/commons'
-	export default {
-	  name: "CustomizeCuttingTool",
-	  directives: { elDragDialog },
-	  components: { Pagination, Edit },
-	  props: {
-	  },
-	  data () {
-	    return {
-	      dialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-        dicts: {
-          CUTTING_TOOL_TYPE: {}
-        },
-	      tableKey: 0,
-	      queryParams: initQueryParams({
-            model: {
-              cuttingToolType: {
-                  key: ''
-              },
-
-            }
-        }),
-		queryMachineParams: initQueryParams({}),
-	      selection: [],
-	      loading: false,
-		  deviceData: [],
-	      tableData: {
-	        total: 0
-	      }
-	    }
-	  },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-      // 加载【字典】
-      initDicts(['CUTTING_TOOL_TYPE'], this.dicts);
-	  	// 加载列表数据
-	  	this.fetch()
-		this.device()
-	  },
-	  computed: {
-      cuttingToolTypeList() {
-          return convertEnum(this.dicts.CUTTING_TOOL_TYPE)
-      }
-	  },
-	  mounted () {
-	  },
-	  methods: {
-	    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.setCustomizeCuttingTool(false, this.dicts)
-	      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
-	      }
-
-	      this.$confirm(this.$t("runCenter.tips.orderTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	      	const ids = []
-		      this.selection.forEach(item => {
-		        ids.push(item.id)
-		      })
-		      this.delete(ids)
-	      }).catch(() => {})
-	    },
-	    clearSelections () {
-	      this.$refs.table.clearSelection()
-	    },
-	    delete (ids) {
-          customizeCuttingToolMgrApi.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()
-	        }
-	      })
-	    },
-	    // 【修改】表头上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]);
-	    },
-	    edit (row) {
-	      this.$refs.edit.setCustomizeCuttingTool(row, this.dicts)
-	      this.$refs.edit.type = "edit"
-	      this.dialog.title = this.$t("common.edit")
-	      this.dialog.isVisible = true
-	    },
-	    fetch (params = {}) {
-	      this.loading = true
-	      if (this.queryParams.timeRange) {
-	        this.queryParams.map.deliveryTime_st = this.queryParams.timeRange[0]
-	        this.queryParams.map.deliveryTime_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
-        customizeCuttingToolMgrApi.page(this.queryParams).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.tableData = res.data
-              console.log(this.tableData)
-              // 给列表设置条数
-	          this.$emit('setTabNums', res.data.total, 'tab2')
-	        }
-	        // eslint-disable-next-line no-return-assign
-	      }).finally(() => this.loading = false)
-
-	    },
-		device (params = {}) {
-	      this.loading = true
-	      this.queryMachineParams.current = params.current ? params.current : this.queryMachineParams.current
-	      this.queryMachineParams.size = 100 
-
-        // 查询必须参数
-        machineCustomizeCuttingToolMgrApi.getPageList(this.queryMachineParams).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.deviceData = 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)
-	      }
-	    }
+			<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" @click="add">{{ $t("common.add") }}</el-button>
+			<el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+			  {{ $t("common.edit") }}
+			</el-button>
+			<el-button type="danger" icon="el-icon-delete" size="medium" @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%;"
+		@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 align="center" prop="cuttingToolNo" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolNo")' :show-overflow-tooltip="true"></el-table-column>
+		<!-- 刀具名称 -->
+		<el-table-column align="center" prop="cuttingToolName" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolName")' :show-overflow-tooltip="true"></el-table-column>
+		<!-- 刀具规格 -->
+		<el-table-column align="center" prop="specifications" :label='$t("cuttingTool.table.customizeCuttingtool.specifications")' :show-overflow-tooltip="true"></el-table-column>
+		<!-- 设备名称 -->
+  <!--	  <el-table-column align="center" prop="deviceName" :label='$t("cuttingTool.table.customizeCuttingtool.deviceName")' :show-overflow-tooltip="true"></el-table-column>-->
+		<!-- 刀具类型 -->
+	   <el-table-column align="center"
+		  :filter-multiple="false"
+		  :filters="cuttingToolTypeList"
+		  column-key="cuttingToolType.key"
+		  :label="$t('cuttingTool.table.customizeCuttingtool.cuttingToolType')"
+		  :show-overflow-tooltip="true"
+		>
+		  <template slot-scope="scope">
+			<span>{{ scope.row.cuttingToolType['data'] ? scope.row.cuttingToolType['data'] : scope.row.cuttingToolType['key'] }}</span>
+		  </template>
+		</el-table-column>
+   
+		<!-- 刀具图片 -->
+	   <el-table-column align="center" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolPicture")' :show-overflow-tooltip="true">
+		  <template slot-scope="{ row }">
+			<el-image
+			  style="width: 100px; height: 100px"
+			  :src="row.cuttingToolPicture"
+			  :preview-src-list="[row.cuttingToolPicture]">
+			</el-image>
+		  </template>
+		</el-table-column>
+		&lt;!&ndash; 装夹方式 &ndash;&gt;
+		<el-table-column align="center" :label='$t("cuttingTool.table.customizeCuttingtool.cuttingToolInstallPicture")' :show-overflow-tooltip="true">
+		  <template slot-scope="{ row }">
+			<el-image
+			  style="width: 100px; height: 100px"
+			  :src="row.cuttingToolInstallPicture"
+			  :preview-src-list="[row.cuttingToolInstallPicture]">
+			</el-image>
+		  </template>
+		</el-table-column>
+		<el-table-column prop="toolSetToCheckParameter" :label='$t("cuttingTool.table.customizeCuttingtool.toolSetToCheckParameter")' :show-overflow-tooltip="true"></el-table-column>
+		<!-- 启用状态 -->
+		<el-table-column prop="status" :label='$t("runCenter.table.oder.status")' align="center">
+			<template slot-scope="{ row }">
+			<el-tag :type="row.status=='1' ? 'success' : 'danger'">
+				{{ row.status=='1' ? $t("common.status.valid") : $t("common.frozen") }}
+			</el-tag>
+		  </template>
+		</el-table-column>
+		<!-- 启用状态 -->
+		<!-- <el-table-column prop="programId" :label='$t("runCenter.table.oder.state")' align="center">
+			<template slot-scope="{ row }">
+			<el-tag :type="row.programId==null ? 'success' : 'danger'">
+				{{ row.programId==null ? '可用' : '占用' }}
+			</el-tag>
+		  </template>
+		</el-table-column> -->
+		<!-- 操作 -->
+		<el-table-column
+		  :label="$t('table.operation')"
+		  fixed="right"
+		  align="center"
+		  column-key="operation"
+		  width="80px"
+		>
+		  <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>
+		  </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"
+	  />
+	  <edit
+		ref="edit"
+		:dialog-visible="dialog.isVisible"
+		:title="dialog.title"
+		@close="editClose"
+		@success="editSuccess"
+	  />
+	</div>
+  </template>
+  
+  <script>
+	  import Pagination from "@/components/Pagination"
+	  import Edit from "./components/Edit"
+	import { convertEnum } from '@/utils/utils'
+	  // 【刀具基础数据】-API
+	// 【刀具管理】-API
+	import machineCustomizeCuttingToolMgrApi from "@/api/prepareProductMgr/machineCustomizeCuttingTool"
+	import customizeCuttingToolMgrApi from "@/api/prepareProductMgr/customizeCuttingTool"
+	  import elDragDialog from '@/directive/el-drag-dialog'
+	  import { initDicts,initQueryParams } from '@/utils/commons'
+	  export default {
+		name: "CustomizeCuttingTool",
+		directives: { elDragDialog },
+		components: { Pagination, Edit },
+		props: {
+		},
+		data () {
+		  return {
+			dialog: {
+			  isVisible: false,
+			  title: ""
+			},
+		  dicts: {
+			CUTTING_TOOL_TYPE: {},
+			CUTTING_TOOL_CATEGORY: {}
+		  },
+			tableKey: 0,
+			queryParams: initQueryParams({
+			  model: {
+				cuttingToolType: {
+					key: ''
+				}
+			  }
+		  }),
+		  queryMachineParams: initQueryParams({}),
+			selection: [],
+			loading: false,
+			deviceData: [],
+			tableData: {
+			  total: 0
+			}
+		  }
+		},
+		// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+		created() {
+		// 加载【字典】
+		initDicts(['CUTTING_TOOL_TYPE','CUTTING_TOOL_CATEGORY'], this.dicts);
+			// 加载列表数据
+			this.fetch()
+		  this.device()
+		},
+		computed: {
+		cuttingToolTypeList() {
+			return convertEnum(this.dicts.CUTTING_TOOL_TYPE)
+		},
+		cuttingToolCategoryList() {
+		  return convertEnum(this.dicts.CUTTING_TOOL_CATEGORY)
+		}
+		},
+		mounted () {
+		},
+		methods: {
+		  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.setCustomizeCuttingTool(false, this.dicts)
+			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
+			}
+  
+			this.$confirm(this.$t("runCenter.tips.orderTips"), this.$t("common.tips"), {
+				distinguishCancelAndClose: true,
+			  confirmButtonText: this.$t("common.confirm"),
+			  cancelButtonText: this.$t("common.cancel"),
+			  type: "warning"
+			}).then(() => {
+				const ids = []
+				this.selection.forEach(item => {
+				  ids.push(item.id)
+				})
+				this.delete(ids)
+			}).catch(() => {})
+		  },
+		  clearSelections () {
+			this.$refs.table.clearSelection()
+		  },
+		  delete (ids) {
+			customizeCuttingToolMgrApi.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()
+			  }
+			})
+		  },
+		  // 【修改】表头上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]);
+		  },
+		  edit (row) {
+		  //查询刀具可执行设备
+  
+			this.$refs.edit.setCustomizeCuttingTool(row, this.dicts)
+			this.$refs.edit.type = "edit"
+			this.dialog.title = this.$t("common.edit")
+			this.dialog.isVisible = true
+		  },
+		  fetch (params = {}) {
+			this.loading = true
+			if (this.queryParams.timeRange) {
+			  this.queryParams.map.deliveryTime_st = this.queryParams.timeRange[0]
+			  this.queryParams.map.deliveryTime_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
+		  customizeCuttingToolMgrApi.page(this.queryParams).then(response => {
+			  const res = response.data
+			  if (res.isSuccess) {
+				this.tableData = res.data
+				console.log(this.tableData)
+				// 给列表设置条数
+				this.$emit('setTabNums', res.data.total, 'tab2')
+			  }
+			  // eslint-disable-next-line no-return-assign
+			}).finally(() => this.loading = false)
+  
+		  },
+		  device (params = {}) {
+			this.loading = true
+			this.queryMachineParams.current = params.current ? params.current : this.queryMachineParams.current
+			this.queryMachineParams.size = 100
+  
+		  // 查询必须参数
+		  machineCustomizeCuttingToolMgrApi.getPageList(this.queryMachineParams).then(response => {
+			  const res = response.data
+			  if (res.isSuccess) {
+				this.deviceData = 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" scoped></style>
+  </script>
+  <style lang="scss" scoped></style>
+