|
@@ -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>
|