wang.sq@aliyun.com 3 minggu lalu
induk
melakukan
1bbfaa9614

+ 38 - 14
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/Index.vue

@@ -34,7 +34,7 @@
             <!-- 列表数据 -->
             <span style="font-size: 18px;">{{ deviceName }}需要放入 <span style="color: red;font-size: 30px;">{{ allCount }}</span> 把刀</span>
             <span style="font-size: 18px;">,还缺 <span style="color: red;font-size: 30px;">{{ remainingToolCount }}</span> 把刀</span>
-            <el-button  v-show="false" class="el-button--primary generateTask" @click="saveToolTask()">生成任务</el-button>
+            <!-- <el-button  v-show="false" class="el-button--primary generateTask" @click="saveToolTask()">生成任务</el-button> -->
             <el-table
               :key="tableKey"
               ref="table"
@@ -46,20 +46,40 @@
               style="width: 100%;"
               @selection-change="onSelectChange"
             >
-              <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="deviceName" :label='"设备名称"' :show-overflow-tooltip="true"></el-table-column>
-              <el-table-column prop="cutterNo" :label='"刀位号"' :show-overflow-tooltip="true" ></el-table-column>
-              <el-table-column prop="cuttingToolNo" :label='"刀具号"' :show-overflow-tooltip="true" ></el-table-column>
+				<el-table-column :label='$t("common.serialNo")' width="60" align="center">
+					<template slot-scope="scope">
+						<div>
+						{{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+						</div>
+					</template>
+				</el-table-column>
+              <!-- <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="deviceName" :label='"设备名称"' :show-overflow-tooltip="true"></el-table-column> -->
+              <!-- <el-table-column prop="cutterNo" :label='"刀位号"' :show-overflow-tooltip="true" ></el-table-column> -->
+              <el-table-column prop="cuttingToolNo" :label='"刀具号"' :show-overflow-tooltip="true" width="100"></el-table-column>
               <el-table-column prop="cuttingToolName" :label='"刀具名称"' :show-overflow-tooltip="true" ></el-table-column>			  
-              <el-table-column prop="toolSetToCheckParameter" :label='"刀具参数"' :show-overflow-tooltip="true" ></el-table-column>
-              <el-table-column prop="toolLifeSpan" :label='"刀具寿命"' :show-overflow-tooltip="true" ></el-table-column>
-              <el-table-column prop="toolRatedUsageCount" :label='"刀具额定次数"' :show-overflow-tooltip="true" ></el-table-column>
-              <el-table-column prop="toolUsedCount" :label='"刀具使用次数"' :show-overflow-tooltip="true" ></el-table-column>
-              <el-table-column prop="checkLock" :label='"待装刀具"' align="center" width="90px">
+              <el-table-column prop="specifications" :label='"刀具规格"' :show-overflow-tooltip="true" ></el-table-column>		  
+			  <el-table-column align="center" width="150"
+				label='刀具类型' >
+				<template slot-scope="scope">
+					<span>{{ scope.row.cuttingToolType.data}}</span>
+					<!-- <span>{{ scope.row.cuttingToolType['data'] ? scope.row.cuttingToolType['data'] : scope.row.cuttingToolType['key'] }}</span> -->
+				</template>
+			  </el-table-column>
+              <el-table-column prop="storgeName" :label='"所在位置"' align="center" width="180px">
                 <template slot-scope="{ row }">
-                  <el-tag :type="(row.deviceId != null) ? 'success' : 'danger'">
-                  {{ (row.deviceId != null) ? $t("common.no") : $t("common.yes") }}
+                  {{ (row.storgeName != null ) ? row.storgeName : (row.deviceName !=null? row.deviceName : "线外")}}
+                </template>
+              </el-table-column>
+
+              <!-- <el-table-column prop="toolLifeSpan" :label='"刀具寿命"' :show-overflow-tooltip="true" ></el-table-column> -->
+              <!-- <el-table-column prop="toolRatedUsageCount" :label='"刀具额定次数"' :show-overflow-tooltip="true" ></el-table-column> -->
+              <!-- <el-table-column prop="toolUsedCount" :label='"刀具使用次数"' :show-overflow-tooltip="true" ></el-table-column> -->
+              <el-table-column prop="checkLock" :label='"刀具状态"' align="center" width="90px">
+                <template slot-scope="{ row }">
+                  <el-tag :type="(row.deviceName == null ) ? (row.storgeName == null ? 'danger' : 'warning') : (row.deviceId == row.needDeviceId? 'success' : 'primary') ">
+                  {{ (row.deviceName == null ) ? (row.storgeName == null ? '待进线' : '待装刀') : (row.deviceId == row.needDeviceId? '已满足' : '需调刀')}}
                   </el-tag>
                 </template>
               </el-table-column>
@@ -399,7 +419,7 @@
 	    },
 	    // 获取列表数据
 	    getTabList(deviceId){
-        console.log("deviceId:"+this.deviceId)
+        console.log("==deviceId==:"+this.deviceId)
         //toolStroge.getDeviceStorge({"deviceId":deviceId}).then(res => {
 	      this.queryParams.size = 100
 		  this.queryParams.model.deviceId = this.deviceId
@@ -409,6 +429,10 @@
 	    		console.log("方块列表:", res)
           		if(res.isSuccess){
             		this.shelvesTreeList = res.data.records;
+					this.shelvesTreeList.map(person => ({
+							...person, // 复制原对象属性
+							needDeviceId : this.deviceId
+						}));
           		}
 	    	})
 	    },

+ 74 - 18
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/index.vue

@@ -1,11 +1,10 @@
 <template>
-  <div class="app-container">
+  <div class="app-container" v-loading="loading">
     <div>
       <el-tag >需要申请刀具/工量具数据</el-tag>
       <el-table
         :key="tableKey"
         ref="table"
-        v-loading="loading"
         :data="cutterApplyData"
         border
         fit
@@ -53,7 +52,6 @@
       <el-table
         :key="tableKey"
         ref="table"
-        v-loading="loading"
         :data="tableData"
         border
         fit
@@ -65,6 +63,7 @@
         <el-table-column prop="name" :label='$t("runCenter.table.checkCuttingTool.partName")' :show-overflow-tooltip="true" width="180px"></el-table-column>
         <el-table-column prop="deviceName" :label='"设备"' :show-overflow-tooltip="true"  width="180px"></el-table-column>
         <el-table-column prop="msg" :label='"校验信息"' :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column prop="number" :label='"缺少数量"' :show-overflow-tooltip="true"  width="120px"></el-table-column>
         <el-table-column prop="isTask" :label='"任务是否已生成"' :show-overflow-tooltip="true"  width="120px"></el-table-column>
         <el-table-column
           :label="$t('runCenter.table.checkCuttingTool.hasCuttingTools')"
@@ -180,7 +179,7 @@
 
       showCheckDetails(data){
         console.log(data)
-	        if(data.hasCuttingToolsFlag === '是' || !data.isFree || data.isTask === ''){
+	        if(data.hasCuttingToolsFlag === '是' || !data.isFree || data.isTask === ''){
             return
           }          
           this.detailPlanId = data.planId
@@ -198,6 +197,7 @@
           this.fetch(this.planId)
       },
       save(){
+        console.log("生成任务")
         let that = this
         orderMgrApi.checkToolTask({planId:this.tableData[0].planId}).then(response=> {
            const res = response.data
@@ -223,6 +223,7 @@
          */
       },
       applySave (){
+        this.loading = true
         let that = this
         mesNoticeApi.applyCutterSave(this.cutterApplyData).then(response=> {
            const res = response.data
@@ -234,41 +235,74 @@
               });
            }
 
-        })
+        }).finally(() => this.loading = false)    
       },
       handlePrint() {
           let data = []
           // list为要打印的数据
           for (let i=0; i < this.cutterApplyData.length; i++) {
-              data.push({
-                  field1: this.cutterApplyData[i].orderNo,
-                  field2: this.cutterApplyData[i].orderName,
-                  field3: this.cutterApplyData[i].name,
-                  field4: this.cutterApplyData[i].applyType==1?"量具<br>":"刀具"
-              })
+              let details = this.cutterApplyData[i].datas
+              for(let j=0; j<details.length; j++){
+                let code ="";
+                let name ="";
+                let mingxi ="";
+                if(this.cutterApplyData[i].applyType==1){// 量具
+                  code = details[j].toolCode
+                  name = details[j].toolName
+                  mingxi= "厂内编号:"+details[j].factoryNumber+";规格:"+details[j].specification
+                }else {// 刀具
+                  code = details[j].cuttingToolNo
+                  name = details[j].cuttingToolName
+                  if(details[j].factoryMaterialCode!=null && details[j].factoryMaterialCode !=undefined){
+                    let bianm1 = details[j].factoryMaterialCode.split(';').map(item => item.trim()).filter(item => item); // 过滤空值
+                    let bianm2 = "";
+                    if(details[j].factoryCode !=null || details[j].factoryCode != undefined){
+                      bianm2 = details[j].factoryCode.split(';').map(item => item.trim()).filter(item => item); // 过滤空值
+                    }
+                    for(let w=0; w<bianm1.length; w++){
+                      mingxi += ("厂内编号:"+bianm1[w]+";厂内物料号:"+(bianm2.length>w?bianm2[w]:"_" )+ "<br>")
+                    }
+                   
+                  }
+                }
+                data.push({
+                    field1: this.cutterApplyData[i].orderNo,
+                    field2: this.cutterApplyData[i].orderName,
+                    field02: this.cutterApplyData[i].processingQuantity,
+                    field3: this.cutterApplyData[i].applyType==1?"量具<br>":"刀具",
+                    field4: code,
+                    field5: name,
+                    field6: mingxi
+                })
+              }
+
           }
+
           printJS({
               type: 'json',
-              header: '打印表格数据',
+              header: '刀具配送单',
               headerStyle: 'text-align: center',
               // 打印的数据
               printable: data,
               // 表头名称(必传),要和json中的键值对的键保持一致
               properties: [
                   {field: 'field1', displayName: '订单编号', columnSize: 1},
-                  {field: 'field2', displayName: '订单名称', columnSize: 1},
-                  {field: 'field3', displayName: '零件名称', columnSize: 1},
-                  {field: 'field4', displayName: '类型', columnSize: 1, 
-                  properties: [{field: 'field1', displayName: '订单编号', columnSize: 1},
-                              {field: 'field2', displayName: '订单名称', columnSize: 1}]}
+                  // {field: 'field2', displayName: '订单名称', columnSize: 1},
+                  {field: 'field3', displayName: '类型', columnSize: 1},
+                  {field: 'field4', displayName: '刀具/量具编号', columnSize: 1},
+                  {field: 'field5', displayName: '刀具/量具名', columnSize: 1},
+                  {field: 'field02', displayName: '需求数量', columnSize: 1},
+                  {field: 'field6', displayName: '明细', columnSize: 1},
               ],
               // 表头的自定义样式设置
               gridHeaderStyle: 'font-weight: 500; border: 1px solid lightgray; font-size: 18px; line-height: 32px;',
               // 表格的自定义样式设置
-              gridStyle: 'text-align: center; border: 1px solid lightgray; font-size: 15px; line-height: 30px;',
+              gridStyle: 'border: 1px solid lightgray; font-size: 15px; line-height: 30px;',
           })
       }
 
+
+
 	  }
 	}
 </script>
@@ -277,4 +311,26 @@
   margin-top: 3%;
   margin-left: 47% !important;
 }
+
+
+@media print {
+    /* 强制打印时的全局居中设置 */
+    .print-wrapper {
+        width: 100% !important;
+        max-width: 1000px !important;
+        margin: 0 auto !important;
+    }
+    /* 标题容器强制居中 */
+    .print-wrapper > div:first-child {
+        text-align: center !important;
+        width: 100% !important;
+        display: block !important;
+    }
+    /* 标题文本强制居中 */
+    .print-wrapper h2 {
+        text-align: center !important;
+        margin: 0 auto !important;
+        float: none !important;
+    }
+}
 </style>