领料单明细批量打印

master
FCD 5 days ago
parent 5886bc93e1
commit 22beddb26f

@ -133,6 +133,17 @@
v-hasPermi="['mes:prepare:export']"
>打印反冲物料</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
@click="showBatchPrint"
v-hasPermi="['mes:prepare:export']"
>批量打印生产物料</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -303,7 +314,7 @@
<script>
import { listPrepare, getPrepare, delPrepare, addPrepare, updatePrepare } from "@/api/mes/prepare";
import {printPrepareByCode,printPrepareXByCode} from "@/api/mes/prepareDetail";
import {printBatchPrepare, printPrepareByCode, printPrepareXByCode} from "@/api/mes/prepareDetail";
import moment from "moment/moment";
import JsBarcode from 'jsbarcode';
// import { listPrepareDetail, getPrepareDetail, delPrepareDetail, addPrepareDetail, updatePrepareDetail } from "@/api/mes/prepareDetail";
@ -663,7 +674,53 @@ export default {
this.download('mes/prepare/export', {
...this.queryParams
}, `prepare_${new Date().getTime()}.xlsx`)
}
},
// ()
showBatchPrint() {
if(this.queryParams.productDate == null){
this.$modal.msgError("请选择工单生产日期");
return;
}
this.shengchan = true;
//
this.printData.workCenter = "暂无数据";
this.printData.pageNo =0 ;
this.printData.printDate = null;
this.printData.workTable = [];
this.printData.factory = null;
this.printData.productDate = null;
this.printData.prodLineCode = null;
//
this.printDialogVisible = true;
this.newWorkerLoading = true // true
this.refreshNewWorkerTable = false // refreshProTablefalse
printBatchPrepare({
productDate:this.queryParams.productDate
}).then(response => {
this.printData.printTitle = '订单物料';
this.printData.factory = response.data[0].factoryCode
this.printData.productDate = moment(this.queryParams.productDate).format('YYYY-MM-DD')
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
this.printData.workTable = response.data
this.printData.pageNo = response.data.length;
let chunkedArray = [];
// this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray
chunkedArray.push(chunk);
}
this.printData.workTable = chunkedArray;
this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false
this.generateBarcode(this.printData.productDate); //
})
},
}
};
</script>

Loading…
Cancel
Save