|
|
|
@ -196,7 +196,7 @@
|
|
|
|
|
<el-table-column label="排产数量" align="center" prop="quantity" width="100"/>
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unit" />
|
|
|
|
|
<el-table-column label="累计报工数量" align="center" prop="quantityFeedback" width="100"/>
|
|
|
|
|
<el-table-column label="用人数" align="center" prop="useMan" width="100"/>
|
|
|
|
|
<!--<el-table-column label="用人数" align="center" prop="useMan" width="100"/>-->
|
|
|
|
|
<el-table-column label="累计工时" align="center" prop="workTime" />
|
|
|
|
|
<el-table-column label="生产时间" align="center" prop="productDate" width="100"/>
|
|
|
|
|
<el-table-column label="SAP报工状态" align="center" prop="uploadStatus" width="150">
|
|
|
|
@ -514,16 +514,18 @@
|
|
|
|
|
:label="item.title"
|
|
|
|
|
:name="item.libId"
|
|
|
|
|
>
|
|
|
|
|
<!--<el-button size="mini" type="primary" @click="addConsumeTableRow(item.libList)">新增物料</el-button>-->
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="item.libList" ref="mypConsumeTable" @selection-change="pConsumeSelection">
|
|
|
|
|
<el-table-column width="50" align="center" type="selection"/>
|
|
|
|
|
<el-table-column label="recordId" align="center" prop="recordId" v-if="false"/>
|
|
|
|
|
<el-table-column label="工单编码" width="140" align="left" prop="workorderCode" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="订单编码" width="150" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true"
|
|
|
|
|
<el-table-column label="订单编码" width="130" align="left" prop="workorderCodeSap" :show-overflow-tooltip="true"
|
|
|
|
|
:formatter="orderCodeFormate"/>
|
|
|
|
|
<el-table-column label="物料编码" width="180" align="left" prop="materialCode" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="物料编码" width="130" align="left" prop="materialCode" :show-overflow-tooltip="true"
|
|
|
|
|
:formatter="productCodeFormate"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="物料名称" width="280" align="left" prop="materialName" :show-overflow-tooltip="true" />
|
|
|
|
|
<el-table-column label="实际用量" width="120" align="left" prop="quantity" :show-overflow-tooltip="true" >
|
|
|
|
|
<el-table-column label="实际用量" width="150" align="left" prop="quantity" :show-overflow-tooltip="true" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input type="number" size="small" v-model="scope.row.quantity" @change="handleEdit(scope.$index,scope.row)"></el-input>
|
|
|
|
|
</template>
|
|
|
|
@ -531,18 +533,38 @@
|
|
|
|
|
<el-table-column label="单位" width="50" align="center" prop="unit"/>
|
|
|
|
|
<el-table-column label="反冲标识" align="center" prop="recoil"/>
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="150"/>
|
|
|
|
|
<!--
|
|
|
|
|
<el-table-column label="仓库" width="150" align="center" prop="warehouseCode">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.warehouseCode" placeholder="请选择仓库" width="50%"
|
|
|
|
|
@change="handleEdit(scope.$index,scope.row)"
|
|
|
|
|
v-if="scope.row.workorderCodeSap == null||scope.row.attr1"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="work in cwarehouseList"
|
|
|
|
|
:key="work.warehouseCode"
|
|
|
|
|
:label="work.warehouseName"
|
|
|
|
|
:value="work.warehouseCode"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="90">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click.native.prevent="deleteBomRow(scope.$index, item.libList)"
|
|
|
|
|
size="small" type="danger" plain>
|
|
|
|
|
size="small" type="danger" plain
|
|
|
|
|
v-if="scope.row.workorderCodeSap == null||scope.row.attr1"
|
|
|
|
|
>
|
|
|
|
|
移除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>-->
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="button-container">
|
|
|
|
|
<el-button size="mini" type="primary" @click="addConsumeTableRow(item.libList)">新增物料</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
<!--工单产品bom参考-->
|
|
|
|
|
<!--工单产品bom参考
|
|
|
|
|
<el-tab-pane label="BOM组成参照" name="pBom">
|
|
|
|
|
<el-table v-loading="loading" :data="pBomTableList" ref="pBomTable"
|
|
|
|
|
row-key="materialCode"
|
|
|
|
@ -562,7 +584,7 @@
|
|
|
|
|
<el-table-column label="成本核算标识相关" align="center" prop="sanka" width="100"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
|
@ -649,10 +671,10 @@
|
|
|
|
|
@onSelected="onSelectEquip"
|
|
|
|
|
></ItemSelectEquip>
|
|
|
|
|
<!--最新领料单选择弹窗-->
|
|
|
|
|
<ItemSelectNewPrepare
|
|
|
|
|
<ItemSelectMaterial
|
|
|
|
|
ref="itemSelectNewPrepare"
|
|
|
|
|
@onSelected="onSelectNewPrepare"
|
|
|
|
|
></ItemSelectNewPrepare>
|
|
|
|
|
></ItemSelectMaterial>
|
|
|
|
|
<!--母工单--《《《《《《《《《《《《《《《-->
|
|
|
|
|
<!-- 打印预览弹出层 -->
|
|
|
|
|
<el-dialog
|
|
|
|
@ -685,29 +707,26 @@
|
|
|
|
|
<el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table"
|
|
|
|
|
:data="printData.workTable" border style="width: 100%">
|
|
|
|
|
<el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
|
|
|
<el-table-column prop="workorderCodeSap" label="订单号" width="100" :formatter="orderCodeFormate"/>
|
|
|
|
|
<el-table-column prop="workorderCode" label="生产工单号" width="130"></el-table-column>
|
|
|
|
|
<el-table-column prop="productCode" label="物料编码" width="120" :formatter="productCodeFormate"/>
|
|
|
|
|
<el-table-column prop="productName" label="物料名称" width="180"></el-table-column>
|
|
|
|
|
<el-table-column prop="unit" label="单位" width="50"></el-table-column>
|
|
|
|
|
<el-table-column prop="workorderCodeSap" label="订单号" width="130" :formatter="orderCodeFormate"/>
|
|
|
|
|
<!--<el-table-column prop="workorderCode" label="生产工单号" width="150"></el-table-column>-->
|
|
|
|
|
<el-table-column prop="productCode" label="物料编码" width="150" :formatter="productCodeFormate"/>
|
|
|
|
|
<el-table-column prop="productName" label="物料名称" width="300"></el-table-column>
|
|
|
|
|
<el-table-column prop="unit" label="单位" width="70"></el-table-column>
|
|
|
|
|
<el-table-column prop="version" label="版本"></el-table-column>
|
|
|
|
|
<el-table-column prop="quantity" label="报工数量"></el-table-column>
|
|
|
|
|
<el-table-column prop="batch" label="批次" width="240"></el-table-column>
|
|
|
|
|
<el-table-column prop="quantityFeedback" label="批次数量" width="100"></el-table-column>
|
|
|
|
|
<el-table-column prop="voucher" label="凭证"></el-table-column>
|
|
|
|
|
<!--<el-table-column prop="quantity" label="报工数量"></el-table-column>-->
|
|
|
|
|
<el-table-column prop="batch" label="批次" width="300"></el-table-column>
|
|
|
|
|
<el-table-column prop="quantityFeedback" label="批次数量" width="90"></el-table-column>
|
|
|
|
|
<!--<el-table-column prop="voucher" label="凭证"></el-table-column>-->
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
<!-- 底部
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-col :offset="1" :span="3">SAP-No:{{ printData.SAPNo }}</el-col>
|
|
|
|
|
<el-col :offset="1" :span="3">Z-PM-F-030-A.1</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-col :offset="1" :span="3">制单人:{{ printData.manufacture }}</el-col>
|
|
|
|
|
<el-col :offset="1" :span="3">审核人:{{ printData.auditor }}</el-col>
|
|
|
|
|
<el-col :offset="1" :span="6">车间负责人:</el-col>
|
|
|
|
|
<el-col :offset="1" :span="6">车间交货人:</el-col>
|
|
|
|
|
<el-col :offset="1" :span="6">仓库验收人:</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -720,9 +739,9 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,
|
|
|
|
|
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,getWarehouseList,
|
|
|
|
|
updateReportWork,reportSap,getBatchList,reportSapCancel,
|
|
|
|
|
getAllLevelReportList,
|
|
|
|
|
getAllLevelReportList,deleteBomRowNow,
|
|
|
|
|
getReportSAPList,submitReportPS,submitReportPSSAP,getCKList,
|
|
|
|
|
getPutInOrderList
|
|
|
|
|
} from "@/api/mes/reportWork";
|
|
|
|
@ -730,14 +749,14 @@ import { getConsumeList,submitConsumePS,submitReportInfo,getBomList,getAllLevelC
|
|
|
|
|
import ReportWorkConsume from "./reportWorkConsume.vue";
|
|
|
|
|
import ItemSelectUser from "./selectUser.vue";
|
|
|
|
|
import ItemSelectWorkOrder from "./selectWorkOrder.vue";
|
|
|
|
|
import ItemSelectNewPrepare from "./selectNewPrepare.vue";
|
|
|
|
|
import ItemSelectMaterial from "./selectMaterial.vue";
|
|
|
|
|
import ItemSelectEquip from "./selectEquip.vue";
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import { getlistCK } from '@/api/wms/outorder'
|
|
|
|
|
export default {
|
|
|
|
|
name: "ReportWork",
|
|
|
|
|
dicts: ['report_type','report_sap_status'],
|
|
|
|
|
components: {ReportWorkConsume,ItemSelectUser,ItemSelectWorkOrder,ItemSelectEquip,ItemSelectNewPrepare},
|
|
|
|
|
components: {ReportWorkConsume,ItemSelectUser,ItemSelectWorkOrder,ItemSelectEquip,ItemSelectMaterial},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
optType: undefined,
|
|
|
|
@ -897,23 +916,33 @@ export default {
|
|
|
|
|
],workCenter: [
|
|
|
|
|
{ required: true, message: "工作中心不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
consumeList : [],
|
|
|
|
|
cwarehouseList:[]
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getDate();
|
|
|
|
|
this.getWorkcenterList();
|
|
|
|
|
this.getWarehouseList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getWorkcenterList(){
|
|
|
|
|
|
|
|
|
|
getWorkcenterList().then(data => {
|
|
|
|
|
this.options1 = data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取报工物料损耗仓库下拉列表
|
|
|
|
|
getWarehouseList(){
|
|
|
|
|
getWarehouseList({}).then(data => {
|
|
|
|
|
this.cwarehouseList = data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//产品编码格式化
|
|
|
|
|
productCodeFormate(row, column, cellValue){
|
|
|
|
|
return cellValue.slice(7,18); //返回值
|
|
|
|
|
if(cellValue !=null){
|
|
|
|
|
return cellValue.slice(7,18); //返回值
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//订单编码格式化
|
|
|
|
|
orderCodeFormate(row, column, cellValue){
|
|
|
|
@ -1057,6 +1086,7 @@ export default {
|
|
|
|
|
this.pConsumeRows = [];
|
|
|
|
|
this.sConsumeRows = [];
|
|
|
|
|
this.consumeRows = [];
|
|
|
|
|
this.consumeList = [];
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
@ -1304,18 +1334,25 @@ export default {
|
|
|
|
|
|
|
|
|
|
this.queryParams.workorderCode = sr.workorderCode;
|
|
|
|
|
//查询母工单BOM记录列表
|
|
|
|
|
this.queryParams.parentOrder = '0';
|
|
|
|
|
getBomList(this.queryParams).then(response => {
|
|
|
|
|
this.pBomTableList = this.handleTree(response, 'materialCode', 'pMaterialCode')
|
|
|
|
|
});
|
|
|
|
|
//this.queryParams.parentOrder = '0';
|
|
|
|
|
//getBomList(this.queryParams).then(response => {
|
|
|
|
|
// this.pBomTableList = this.handleTree(response, 'materialCode', 'pMaterialCode')
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
pConsumeSelection(selection) {
|
|
|
|
|
this.pConsumeRows = this.pConsumeRows.concat(selection)
|
|
|
|
|
const allRows = this.pConsumeRows.concat(selection)
|
|
|
|
|
this.pConsumeRows = allRows.reduce((acc, cur) => {
|
|
|
|
|
const hasDuplicate = acc.some(item => item.materialCode === cur.materialCode);
|
|
|
|
|
if (!hasDuplicate) {
|
|
|
|
|
acc.push(cur);
|
|
|
|
|
}
|
|
|
|
|
return acc;
|
|
|
|
|
}, []);
|
|
|
|
|
},
|
|
|
|
|
sConsumeSelection(selection) {
|
|
|
|
|
this.sConsumeRows = selection
|
|
|
|
|
this.sConsumeRows = selection;
|
|
|
|
|
},
|
|
|
|
|
submitConsume() {
|
|
|
|
|
this.consumeRows = this.pConsumeRows;
|
|
|
|
@ -1327,6 +1364,7 @@ export default {
|
|
|
|
|
submitConsumePS(this.consumeRows).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("报工信息修改成功");
|
|
|
|
|
this.openConsume = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
@ -1391,7 +1429,7 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 打印预览-浏览器打印
|
|
|
|
|
// 打印预览-浏览器打印
|
|
|
|
|
handlePrint(params) {
|
|
|
|
|
printJS({
|
|
|
|
|
printable: params.printable, // 'printFrom', // 标签元素id
|
|
|
|
@ -1429,22 +1467,40 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//物料损耗表格--删除
|
|
|
|
|
deleteBomRow(index, rows) {
|
|
|
|
|
rows.splice(index, 1);
|
|
|
|
|
this.$modal.confirm('是否确认删除?确认后,不需要点击下方确定,立马删除!').then(function() {
|
|
|
|
|
return deleteBomRowNow(rows[index].recordId);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
rows.splice(index, 1);
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//物料损耗表格--新增
|
|
|
|
|
addConsumeTableRow(consumeList){
|
|
|
|
|
|
|
|
|
|
if(consumeList.length==0){
|
|
|
|
|
addConsumeTableRow(rows){
|
|
|
|
|
debugger
|
|
|
|
|
this.consumeList = rows;
|
|
|
|
|
if(rows.length==0){
|
|
|
|
|
this.$modal.msgError(`上位机尚未填写损耗,不允许提前新增`);
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$refs.itemSelectNewPrepare.showFlag = true;
|
|
|
|
|
this.$refs.itemSelectNewPrepare.init(consumeList[0].workorderCode);
|
|
|
|
|
this.$refs.itemSelectNewPrepare.init(rows[0].workorderCode);
|
|
|
|
|
},
|
|
|
|
|
//物料损耗表格--新增确认
|
|
|
|
|
onSelectNewPrepare(obj) {
|
|
|
|
|
console.log(obj)
|
|
|
|
|
debugger
|
|
|
|
|
for(let i=0;i<obj.length;i++){
|
|
|
|
|
const row = {
|
|
|
|
|
workorderCode: obj[i].workorderCode,
|
|
|
|
|
materialCode: obj[i].component,
|
|
|
|
|
materialName: obj[i].componentName,
|
|
|
|
|
quantity: obj[i].quantity,
|
|
|
|
|
unit: obj[i].unit,
|
|
|
|
|
recoil:"X"
|
|
|
|
|
};
|
|
|
|
|
this.consumeList.push(row);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -1462,4 +1518,18 @@ export default {
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
height: 38px;
|
|
|
|
|
}
|
|
|
|
|
.button-container {
|
|
|
|
|
text-align: right;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
.my-print-table {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
}
|
|
|
|
|
.my-print-nav {
|
|
|
|
|
font-size: 19px;
|
|
|
|
|
}
|
|
|
|
|
.my-print-foot {
|
|
|
|
|
font-size: 19px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|