Merge remote-tracking branch 'origin/master'

yangwl
mengjiao 3 months ago
commit b405d5e1b9

@ -16,7 +16,6 @@ export function getUnitPrice(picId) {
method: 'get' method: 'get'
}); });
} }
// 新增unitPrice // 新增unitPrice
export function addUnitPrice(data) { export function addUnitPrice(data) {
return request({ return request({

@ -8,12 +8,7 @@ export function listUnitPriceReport(query) {
params: query params: query
}); });
} }
// export function getReport(id) {
// return request({
// url: '/mes/unitPriceReport/' + id,
// method: 'get'
// });
// }
// 查询【计件工资】详细 // 查询【计件工资】详细
export function getReport(id) { export function getReport(id) {
return request({ return request({
@ -29,3 +24,20 @@ export function updateUnitPriceReport(data) {
data: data data: data
}); });
} }
// 新增
// 计件工资统计
export function addUnitPriceReport(data) {
return request({
url: '/mes/unitPriceReport',
method: 'post',
data: data
});
}
// 查询生产工单列表--顶级母
export function listWorkorderLevel0(query) {
return request({
url: '/plan/pro/workorder/listLevel0',
method: 'get',
params: query
});
}

@ -181,10 +181,7 @@ export function getProdLineList() {
params: {} params: {}
}); });
} }
export function getIdCardList(workorderCode){ export function getIdCardList(data){
const data={
workorderCode
}
return request({ return request({
url:'/plan/pro/workorder/getIdCardList', url:'/plan/pro/workorder/getIdCardList',
method:'post', method:'post',

@ -17,6 +17,14 @@ export function getUser(userId) {
method: 'get' method: 'get'
}) })
} }
// 查询用户详细-通过工号
export function getUserByUserName(data) {
return request({
url: '/system/user/getInfoByUserName/',
method: 'post',
data: data
})
}
// 新增用户 // 新增用户
export function addUser(data) { export function addUser(data) {

@ -0,0 +1,5 @@
<svg t="1720683721767" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1481" width="200" height="200"><path d="M819.2 364.8h-44.8V128c0-17.066667-14.933333-32-32-32H281.6c-17.066667 0-32 14.933333-32 32v236.8H204.8c-59.733333 0-108.8 49.066667-108.8 108.8v192c0 59.733333 49.066667 108.8 108.8 108.8h44.8V896c0 17.066667 14.933333 32 32 32h460.8c17.066667 0 32-14.933333 32-32v-121.6h44.8c59.733333 0 108.8-49.066667 108.8-108.8v-192c0-59.733333-49.066667-108.8-108.8-108.8zM313.6 160h396.8v204.8H313.6V160z m396.8 704H313.6V620.8h396.8v243.2z m153.6-198.4c0 25.6-19.2 44.8-44.8 44.8h-44.8v-121.6c0-17.066667-14.933333-32-32-32H281.6c-17.066667 0-32 14.933333-32 32v121.6H204.8c-25.6 0-44.8-19.2-44.8-44.8v-192c0-25.6 19.2-44.8 44.8-44.8h614.4c25.6 0 44.8 19.2 44.8 44.8v192z" fill="#1296db" p-id="1482"></path></svg>

After

Width:  |  Height:  |  Size: 866 B

@ -42,10 +42,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="员工姓名" prop="nickName"> <el-form-item label="员工姓名/工号" prop="nickName" label-width="100px">
<el-input <el-input
v-model="queryParams.equipmentName" v-model="queryParams.nickName"
placeholder="请输入员工姓名" placeholder="请输入员工姓名/工号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -69,16 +69,15 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<!-- <el-button--> <el-button
<!-- type="success"--> type="primary"
<!-- plain--> plain
<!-- icon="el-icon-edit"--> icon="el-icon-plus"
<!-- size="mini"--> size="mini"
<!-- :disabled="single"--> @click="openSelectOrder"
<!-- @click="handleUpdate"--> v-hasPermi="['device:item:add']"
<!-- v-hasPermi="['unitPriceReport:report:edit']"--> >补录
<!-- >修改--> </el-button>
<!-- </el-button>-->
<el-button <el-button
type="success" type="success"
plain plain
@ -156,7 +155,7 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改unitPrice对话框 --> <!-- 修改unitPrice对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" label-width="100px"> <el-form ref="form" :model="form" label-width="100px">
@ -281,16 +280,243 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 新增unitPrice对话框 -->
<el-dialog :title="addtitle" :visible.sync="addopen" width="680px" append-to-body>
<el-form ref="addform" :model="addform" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="工单号" prop="workorderCode" >
<el-input v-model="addform.workorderCode" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="SAP订单号" prop="workorderCodeSap" >
<el-input v-model="addform.workorderCodeSap" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工单生产日期" prop="workOrderProductDate" >
<el-date-picker
v-model="addform.workOrderProductDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择生产日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料码" prop="productCode" >
<el-input v-model="addform.productCode" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="产品描述" prop="productName" >
<el-input v-model="addform.productName" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工序" prop="childprocessName" >
<el-select v-model="addform.childprocessName" single placeholder="请选择工序">
<el-option
v-for="item in childprocessNameOptions"
:key="item.picId"
:label="item.childprocessName"
:value="item.childprocessCode"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产线编码" prop="workorderName" >
<el-input v-model="addform.workorderName" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="addform.post" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工号" prop="userName" >
<el-input v-model="addform.userName" @keyup.enter.native="handleQueryUser">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="员工姓名" prop="nickName" >
<el-input v-model="addform.nickName" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产量" prop="attr1" >
<el-input v-model="addform.attr1" >
<template #suffix>PC</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工时" prop="attr2" >
<el-input v-model="addform.attr2" >
<template #suffix>小时</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="扣款" prop="kk" >
<el-input v-model="addform.kk" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保底" prop="bd" >
<el-input v-model="addform.bd" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="转岗" prop="zg" >
<el-input v-model="addform.zg" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="返工费用" prop="fg" >
<el-input v-model="addform.fg" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="试产" prop="sc" >
<el-input v-model="addform.sc" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="试机" prop="sj" >
<el-input v-model="addform.sj" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="特殊费用" prop="tsfy" >
<el-input v-model="addform.tsfy" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="夜班补贴" prop="ybbt" >
<el-input v-model="addform.ybbt" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="协产补贴" prop="xcbt" >
<el-input v-model="addform.xcbt" >
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-col :span="24">
<el-form-item label="备注">
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
<el-select
v-model="addform.remark"
placeholder="备注"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.unit_price"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addsubmitForm"> </el-button>
<el-button @click="addcancel"> </el-button>
</div>
</el-dialog>
<select-order ref="orderselect" :datasourceId="queryParams.datasourceId" @ok="handleQuery" @showAddDialog="showAddDialog" />
</div> </div>
</template> </template>
<script> <script>
// import { ElEditable } from 'element-plus'; import { listUnitPriceReport,getReport,updateUnitPriceReport,addUnitPriceReport } from "@/api/mes/unitPriceReport";
import { getToken } from "@/utils/auth"; import { listUnitPrice } from "@/api/mes/unitPrice";
import { listUnitPriceReport,getReport,updateUnitPriceReport } from "@/api/mes/unitPriceReport"; import { getUserByUserName } from "@/api/system/user";
import selectOrder from "./selectOrder";
export default { export default {
name: "UnitPrice", name: "UnitPriceReport",
dicts: ['unit_price'], dicts: ['unit_price'],
components: { selectOrder }, //
data() { data() {
return { return {
// //
@ -307,10 +533,15 @@ export default {
total: 0, total: 0,
// unitPrice // unitPrice
unitPriceList: [], unitPriceList: [],
//
postOptions: [],
childprocessNameOptions: [],
// //
title: "", title: "",
addtitle: "",
// //
open: false, open: false,
addopen: false,
value: '', value: '',
// //
dateRange: [], dateRange: [],
@ -319,6 +550,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
factoryId: null, factoryId: null,
datasourceId: undefined,
workorderCodeSap: null, workorderCodeSap: null,
productCode: null, productCode: null,
productName: null, productName: null,
@ -333,11 +565,14 @@ export default {
attr4: null, attr4: null,
}, },
productQueryParams:{ productQueryParams:{
pageNum: 1,
pageSize: 10,
productCode: null, productCode: null,
productName: null, productName: null,
}, },
// //
form: {}, form: {},
addform:{},
// //
productCodeList: [], productCodeList: [],
state: '', state: '',
@ -346,58 +581,22 @@ export default {
tableData: [], tableData: [],
MesUnitPriceInfo: [], MesUnitPriceInfo: [],
// //
// rules: { rules: {
// attr2: [ userName: [
// { required: true, message: "", trigger: "blur" }, { required: true, message: "用户名称不能为空", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" } ],
// ], nickName: [
// attr1: [ { required: true, message: "用户昵称不能为空", trigger: "blur" }
// { required: true, message: "", trigger: "blur" }, ],
// { validator: validateNumberOrDecimal, trigger: "blur" } childprocessName: [
// ], { required: true, message: "工序不能为空", trigger: "blur" }
// bd: [ ],
// { required: true, message: "", trigger: "blur" }, }
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// zg: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// fg: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// sc: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// sj: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// tsfy: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// ybbt: [
// { required: true, message: "", trigger: "blur" },
// { validator: validateNumberOrDecimal, trigger: "blur" }
// ],
// }
}; };
//
// const validateNumberOrDecimal = (rule, value, callback) => {
// const regex = /^(\d+(\.\d{1,2})?)?$/;
// if (!regex.test(value)) {
// callback(new Error(''));
// } else {
// callback();
// }
// };
}, },
created() { created() {
this.getList(); this.getList();
// this.fetchProcessOptions();
}, },
methods: { methods: {
handleEdit(index, row) { handleEdit(index, row) {
@ -418,6 +617,14 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
addcancel(){
this.addopen = false;
this.addreset();
},
addreset(){
this.addform = {};
this.resetForm("addform");
},
// //
reset() { reset() {
this.form = { this.form = {
@ -448,6 +655,15 @@ export default {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
handleQueryUser(){
getUserByUserName(this.addform).then(response => {
this.postOptions = response.posts;
this.$set(this.addform, "post", response.postIds);
this.addform.nickName=response.data.nickName;
});
},
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
@ -460,23 +676,31 @@ export default {
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { openSelectOrder() {
this.reset(); this.$refs.orderselect.show();
this.open = true;
this.title = "添加计件薪酬信息";
}, },
/** 修改按钮操作 */ /** 新增按钮操作 */
// handleUpdate(row) { showAddDialog(currentRow) {
// console.log(row) this.reset();
// this.reset(); //
// const picId = row.id || this.ids this.productQueryParams.productCode=currentRow.productCode.slice(7, 18);
// getReport(picId).then(response => { this.productQueryParams.lineCode=currentRow.sapCode;
// this.form = response.data.MesUnitpriceReport; listUnitPrice(this.productQueryParams).then(response => {
// this.open = true;
// this.MesUnitPriceInfo=response.data.MesUnitPriceInfo; this.childprocessNameOptions = response.rows;
// }); // this.$set(this.addform, "post", response.rows);
// },
});
this.addopen = true;
this.addform.workorderCode=currentRow.workorderCode;
this.addform.workorderCodeSap=currentRow.workorderCodeSap;
this.addform.workOrderProductDate=currentRow.productDate;
this.addform.productCode=currentRow.productCode;
this.addform.productName=currentRow.productName;
this.addform.workorderName=currentRow.sapCode;
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
@ -513,6 +737,23 @@ export default {
} }
}); });
}, },
/** 新增提交按钮 */
addsubmitForm() {
this.$refs["addform"].validate(valid => {
if (valid) {
console.log(this.addform)
const post=this.addform.post[0]
this.addform.post=null;
this.addform.post=post;
addUnitPriceReport(this.addform).then(response => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.addform = {};
this.getList();
})
}
})
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/unitPriceReport/export', { this.download('mes/unitPriceReport/export', {

@ -0,0 +1,158 @@
<template>
<!-- 授权用户 -->
<el-dialog title="选择订单" :visible.sync="visible" width="1200px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form-item label="生产日期" prop="productDate">
<el-date-picker
v-model="queryParams.productDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="产线编码" prop="workorderName">
<el-select clearable v-model="queryParams.workorderName">
<el-option
v-for="item in prodLineList"
:key="item.lineCode"
:label="item.lineName"
:value="item.lineCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料编码" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row>
<!-- <el-table-->
<!-- ref="singleTable"-->
<!-- :data="userList"-->
<!-- highlight-current-row-->
<!-- @selection-change="handleSelectionChange">-->
<el-table
ref="table"
:data="userList"
highlight-current-row
@current-change="handleCurrentChange"
height="260px">
<el-table-column label="工单号" prop="workorderCode" :show-overflow-tooltip="true" />
<el-table-column label="SAP订单号" prop="workorderCodeSap" :show-overflow-tooltip="true" />
<el-table-column label="产品编码" width="200" prop="productCode" :show-overflow-tooltip="true" />
<el-table-column label="产品名称" width="200" prop="productName" :show-overflow-tooltip="true" />
<el-table-column label="生产日期" prop="productDate" :show-overflow-tooltip="true" />
<el-table-column label="产线" prop="sapName" :show-overflow-tooltip="true" />
<el-table-column label="产线编码" prop="sapCode" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSelectUser"> </el-button>
<el-button @click="visible = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
listWorkorderLevel0,
getProdLineList
} from '@/api/plan/workorder'
export default {
dicts: ['sys_normal_disable'],
props: {
//
datasourceId: {
type: [Number, String]
}
},
data() {
return {
//
visible: false,
//
orderId: null,
//
total: 0,
//
userList: [],
prodLineList:[],
currentRow: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
datasourceId: undefined,
userName: undefined,
phonenumber: undefined,
}
};
},
created() {
getProdLineList().then(response => {
this.prodLineList = response
})
},
methods: {
//
show() {
this.queryParams.datasourceId = this.datasourceId;
this.getList();
this.visible = true;
},
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
},
//
handleCurrentChange(val) {
this.currentRow = val;
},
//
getList() {
this.queryParams.parentOrder= '0';
listWorkorderLevel0(this.queryParams).then(res => {
console.log(res)
this.userList = res.rows;
this.total = res.total;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 选择授权用户操作 */
handleSelectUser() {
this.visible = false;
this.$emit('showAddDialog',this.currentRow); //
}
}
};
</script>

@ -1838,7 +1838,7 @@ export default {
this.$modal.msgError("还未派发请到工单变更进行调整!"); this.$modal.msgError("还未派发请到工单变更进行调整!");
return; return;
} }
this.batchLoading = true; this.batchLoading = true;
const workOrdercode = this.codes[0]; const workOrdercode = this.codes[0];
@ -1987,8 +1987,17 @@ export default {
/**打印标识卡弹出框**/ /**打印标识卡弹出框**/
printIdCard() { printIdCard() {
//var statusesArray = this.statuses;
//for (var i = 0; i < statusesArray.length; i++) {
// if (statusesArray[i] == 'w0') {//
// this.$modal.msgError("");
// return
// }
//}
this.$refs.printID.init(this.selectWork.workorderCode);
this.$refs.printID.printDialogVisible = true; this.$refs.printID.printDialogVisible = true;
this.$refs.printID.init("20021221552");
}, },
// //
printIdFunc(obj) { printIdFunc(obj) {

@ -1,15 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 打印预览弹出层 --> <el-dialog title="" :visible.sync="printDialogVisible" width="990px">
<el-dialog title="" :visible.sync="printDialogVisible" width="990px">
<div> <div>
<el-input v-model="idCardsNum" placeholder="请输入板次数量" style="width:100px"/> <el-form inline>
<el-button type="primary" icon="el-icon-check" circle @click="showPrint()"/> <el-form-item label="补打版次" prop="factory">
<el-input v-model="idCardsNum" placeholder="请输入补打版次" style="width:100px"/>
</el-form-item>
<el-button type="primary" icon="el-icon-check" circle @click="showPrint()"/>
</el-form>
</div> </div>
<div id="printFrom" class="my-print-box"> <div id="printFrom" class="my-print-box">
<div v-for="(item, index) in printData.idCardList" :key="index"> <div v-for="(item, index) in printData.idCardList" :key="index">
<el-form> <el-form class="print-card">
<!-- 表头-工单信息 -->
<el-row> <el-row>
<el-col :span="7"> <el-col :span="7">
<img src="@/assets/logo/lanjv.png" class="report-logo" /> <img src="@/assets/logo/lanjv.png" class="report-logo" />
@ -17,34 +20,34 @@
<el-col :span="10" class="center-text"> <el-col :span="10" class="center-text">
<span>产品标识卡</span> <span>产品标识卡</span>
</el-col> </el-col>
</el-row>
<el-row class="my-print-head">
<el-col><el-divider/></el-col>
</el-row> </el-row>
<div class="custom-divider"></div>
<el-row class="my-print-foot"> <el-row class="my-print-foot">
<el-col :offset="1" :span="10"> <el-col :offset="1" :span="10">
<div>产品名称:{{ printData.factory }}</div><br/> <div class="card-div1">产品名称: {{ item.productName }}</div><br />
<div>批次号:{{ printData.factory }}</div><br/> <div class="card-div1">批次号: {{ item.batchCode }}</div><br />
<div>生产日期:{{ printData.factory }}</div><br/> <div class="card-div2">生产日期: {{ item.productDateStr }}</div><br />
<div>板次:{{ printData.factory }}</div><br/> <div class="card-div2">板次: {{ item.palletNo }}</div><br />
<div>数量:{{ printData.factory }}</div> <div class="card-div2">数量: {{ item.batchQuantity }}</div>
</el-col> </el-col>
<el-col :offset="1" :span="10"> <el-col :offset="1" :span="10">
<canvas ref="qrCanvas"></canvas> <canvas :id="'qrcode-' + index" class="qrcode"></canvas>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div style="clear: both; margin-bottom: 30px;"></div>
<div v-if="(index + 1) % 2 === 0" class="print-page"></div>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlePrint(printData)"> </el-button> <el-button type="primary" @click="handlePrint(printData)"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
getIdCardList, getIdCardList,
@ -57,7 +60,7 @@ export default {
}, },
data() { data() {
return { return {
idCardsNum: 1, idCardsNum: null,
optType: undefined, optType: undefined,
// //
loading: true, loading: true,
@ -79,7 +82,8 @@ export default {
ignore: ["no-print"], ignore: ["no-print"],
workCenter: "暂无数据", workCenter: "暂无数据",
factory: null, factory: null,
idCardList: [] idCardList: [],
//gridStyle:'border: 1px solid lightgray; margin-bottom: -1px;'
}, },
workorderCode: '', workorderCode: '',
// //
@ -92,50 +96,52 @@ export default {
}; };
}, },
created() { created() {
},
mounted() {
}, },
methods: { methods: {
init(workorderCode){ init(workorderCode){
this.workorderCode = workorderCode; this.workorderCode = workorderCode;
this.showPrint();
}, },
// - // -
handlePrint(params) { handlePrint(params) {
printJS({ printJS({
printable: params.printable, // 'printFrom', // id printable: params.printable,
type: params.type || "html", type: params.type || 'html',
maxWidth: 1500, // maxWidth: 1500,
font_size: "", // font_size: "", //
header: params.header, // '', header: params.header, // '',
targetStyles: ["*"], targetStyles: ['*'],
style: "@page {margin:0 10mm};", // - style: `
ignoreElements: params.ignore || [], // ['no-print'] @page { margin: 30mm 10mm; }
properties: params.properties || null, .print-page { page-break-after: always; }
}); `,
ignoreElements: params.ignore || [],
});
}, },
// - // -
showPrint() { async showPrint() {
// console.log('执行了打印预览');
//this.printData.workCenter = ""; let params = {
getIdCardList(this.workorderCode,this.idCardNum).then((response) => { };
debugger if(this.idCardsNum!=null){
//this.reset(); params.palletNo=this.idCardsNum;
this.printData.idCardList = response.idCards; }
// 使 Vue nextTick DOM let response = await getIdCardList({workorderCode:this.workorderCode,...params});
this.$nextTick(() => { this.printData.idCardList = response;
this.$nextTick(() => {
//for(var i=0;0<response.idCards.length;i++){ this.printData.idCardList.forEach((item, index) => {
let qrCanvasIndex = "qrCanvas"+0; const canvas = document.getElementById('qrcode-' + index);
const canvas = this.$refs.qrCanvas; QRCode.toCanvas(canvas, item.palletCode, { width: 350,margin:1 }, function (error) {
const options = { if (error) console.error(error);
width: 350, // console.log('success!');
height: 350 //
};
QRCode.toCanvas(canvas,response.idCards[0], options, error => {
if (error) console.error(error);
});
//}
}); });
}); });
})
} }
}, },
}; };
@ -150,6 +156,7 @@ export default {
text-align: left; text-align: left;
font-size: 63px; font-size: 63px;
font-weight: 800; font-weight: 800;
color: black;
} }
.report-logo { .report-logo {
@ -178,4 +185,34 @@ export default {
.my-print-box{ .my-print-box{
width:100% width:100%
} }
.custom-divider {
width: 100%;
height: 1px;
background-color: #a5a4a4 !important;
margin: 20px 0 !important;
-webkit-print-color-adjust: exact;
}
.print-page {
page-break-after: always;
}
@media print {
.custom-divider {
width: 100%;
height: 1px;
background-color: #a5a4a4 !important;
margin: 20px 0 !important;
-webkit-print-color-adjust: exact;
}
}
.card-div1{
font-size: 20px;
font-weight: 600;
padding-top: 14px;
}
.card-div2{
font-size: 22px;
font-weight: 700;
padding-top: 14px;
}
</style> </style>

@ -384,6 +384,11 @@
style="width: 320px" style="width: 320px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="标准模板" prop="mvgr5">
<el-input v-model="form.mvgr5" placeholder="请输入建议标准模板" />
</el-form-item>
<el-form-item label="是否启用" prop="activeFlag"> <el-form-item label="是否启用" prop="activeFlag">
<el-select <el-select
v-model="form.activeFlag" v-model="form.activeFlag"
@ -448,22 +453,15 @@
append-to-body append-to-body
> >
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<!-- <el-form-item label="仓库检验周期" prop="warehouseCycle">
<el-form-item label="标准效率" prop="iei">
<el-input-number <el-input-number
v-model="form.iei" v-model="form.warehouseCycle"
style="width: 320px" style="width: 320px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="标准用人" prop="manStandar"> <el-form-item label="每托盘最大箱数" prop="palletNum">
<el-input-number <el-input-number
v-model="form.manStandar" v-model="form.palletNum"
style="width: 320px"
/>
</el-form-item>-->
<el-form-item label="仓库检验周期" prop="warehouseCycle">
<el-input-number
v-model="form.warehouseCycle"
style="width: 320px" style="width: 320px"
/> />
</el-form-item> </el-form-item>

Loading…
Cancel
Save