质量手持不良分类逻辑+报工打印1.0

master
zhaoxiaolin 10 months ago
parent 9b7ce9dda5
commit 819378b46f

@ -252,3 +252,15 @@ export function getLineQcData() {
method: 'get'
});
}
//获取批次
export function getPutInOrderList(workorderCode) {
const data = {
workorderCode
}
return request({
url: '/mes/reportWork/getPutInOrderList',
method: 'put',
data: data
});
}

@ -158,6 +158,17 @@
@click="handleAddSAP"
>SAP收货</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
:disabled="single"
icon="el-icon-download"
size="mini"
@click="showPrint"
>打印预览
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -674,13 +685,77 @@
@onSelected="onSelectEquip"
></ItemSelectEquip>
<!--母工单---->
<!-- 打印预览弹出层 -->
<el-dialog
title="生产订单确认入库"
:visible.sync="printDialogVisible"
width="1300px"
>
<div id="printFrom" class="my-print-box">
<el-form :ref="formRef" :model="form">
<!-- 表头-工单信息 -->
<el-row>
<el-col :span="7">
<img src="@/assets/logo/lanjv.png" class="report-logo"/>
</el-col>
<el-col :span="10" class="center-text">
<h1>生产订单确认入库单</h1>
</el-col>
</el-row>
<el-row class="my-print-head">
<el-col :offset="10" :span="4"></el-col><!---->
</el-row>
<!-- 导航栏 -->
<el-row class="my-print-nav">
<el-col :span="4">工厂:{{ printData.factory }}</el-col>
<el-col :span="4">工作中心:{{ printData.workCenter }}</el-col>
<el-col :span="4">打印日期:{{ printData.printDate }}</el-col>
<el-col :span="4">页次: 1/ 1</el-col>
</el-row>
<!-- 主数据 -->
<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="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>
<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-row>
-->
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlePrint(printData)"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { listReportWork, getReportWork, delReportWork, addReportWork, getWorkcenterList,
updateReportWork,reportSap,getBatchList,reportSapCancel,
getReportList,getReportSAPList,submitReportPS,submitReportPSSAP,getCKList} from "@/api/mes/reportWork";
getReportList,getReportSAPList,submitReportPS,submitReportPSSAP,getCKList,
getPutInOrderList
} from "@/api/mes/reportWork";
import { getConsumeList,submitConsumePS,submitReportInfo,getBomList} from "@/api/mes/reportWorkConsume";
import ReportWorkConsume from "./reportWorkConsume.vue";
import ItemSelectUser from "./selectUser.vue";
@ -796,6 +871,27 @@ export default {
],
teamList:[],
batchList:[],
printDialogVisible: false,
//
formRef: 'form',
printData: {
printable: 'printFrom',
ignore: ['no-print'],
workCenter: "暂无数据",
SAPNo: null,
manufacture: null,
auditor: null,
printDate: null,
factory: null,
productDate: null,
workTable: [],
},
refreshNewWorkerTable: true,
//
workerLoading: false,
newWorkerLoading: false,
//
refreshWorkerTable: true,
//
rules: {
workorderCode:[
@ -1332,7 +1428,57 @@ export default {
this.open = false;
this.getList();
});
},
// -
handlePrint(params) {
printJS({
printable: params.printable, // 'printFrom', // id
type: params.type || 'html',
maxWidth: 1500, //
font_size: "",//
header: params.header, // '',
targetStyles: ['*'],
style: '@page {margin:0 10mm};', // -
ignoreElements: params.ignore || [], // ['no-print']
properties: params.properties || null
})
},
// -
showPrint() {
//
this.printData.workCenter = "暂无数据";
this.printData.printDate = null;
this.printData.workTable = [];
this.printData.factory = null;
this.printData.productDate = null;
//
this.printDialogVisible = true;
this.printData.printDate = moment(new Date()).format('YYYY.MM.DD');
this.printData.manufacture = this.$store.state.user.name;
this.newWorkerLoading = true // true
this.refreshNewWorkerTable = false // refreshProTablefalse
getPutInOrderList(this.selectRow[0].workorderCode).then(response => {
this.printData.workTable = response.data;
this.printData.factory = response.data[0].factoryCode;
this.printData.workCenter = response.data[0].workshopName;
this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false
})
}
}
};
</script>
<style scoped>
.print-btn{
margin-bottom: 15px;
margin-left: 10px;
}
.center-text {
text-align: center;
}
.report-logo {
margin-top: 15px;
margin-left: 15px;
height: 38px;
}
</style>

@ -200,6 +200,7 @@ export default {
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 10;
this.getList();
this.getDefect();
},
/** 查询表格列表*/

Loading…
Cancel
Save