6 changed files with 382 additions and 10 deletions
-
2src/api/production/generateReport.js
-
4src/main.js
-
15src/views/modules/production/generateReport.vue
-
96src/views/modules/production/print_stock_label.js
-
2src/views/modules/production/searchDailyPlan.vue
-
273src/views/modules/production/stockPrint.vue
@ -0,0 +1,96 @@ |
|||||
|
/*调用js打印标签*/ |
||||
|
import getLodop from '@/utils/LodopFuncs.js' |
||||
|
/*打印材料卷标签*/ |
||||
|
export function printMaterialLabel(printList) { |
||||
|
const LODOP = getLodop() |
||||
|
if (LODOP) { |
||||
|
//LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", "");
|
||||
|
LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", ""); |
||||
|
// LODOP.SET_PRINTER_INDEXA("小标签打印机");
|
||||
|
//循环调用打印机
|
||||
|
for(let i = 0; i < printList.length; i++){ |
||||
|
let printData = printList[i]; |
||||
|
LODOP.NewPage(); |
||||
|
LODOP.SET_PRINT_PAGESIZE(0,1000,700,""); |
||||
|
// LODOP.ADD_PRINT_BARCODE(3,31,86,61,"QRCode",printData.seqNo);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"WareHouseId:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.wareHouseId);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"BatchNo:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.batchNo);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"LocationId:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.locationId);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"PartNo:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.partNo);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"OrderNo:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.orderNo);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"Qty:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.qty);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"TransDate:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,printData.transDate);
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"Manufactured by A&M Polymer");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"vender Code:");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"No.188 Taigu Road,Lili lndustrial Park,Wujiang District,Suzhou,China");
|
||||
|
// LODOP.ADD_PRINT_TEXT(52,21,72,35,"Phone: 086-0512-63678826 Email: service@husenrubber.com");
|
||||
|
//
|
||||
|
//
|
||||
|
|
||||
|
LODOP.ADD_PRINT_BARCODE(11,244,208,140,"QRCode","1|RM|batchNo|locationid|80001"); |
||||
|
LODOP.ADD_PRINT_TEXT(58,8,108,25,"WareHouseId:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(58,110,140,25,printData.wareHouseId); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(111,8,77,24,"BatchNo:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(111,110,140,20,printData.batchNo); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(84,8,98,25,"LocationId:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(84,110,139,25,printData.locationId); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(9,8,72,25,"PartNo:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(9,110,136,25,printData.partNo); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(136,8,82,25,"OrderNo:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(136,110,141,25,printData.orderNo); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(34,8,56,25,"Qty:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(34,110,138,24,printData.qty); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(162,8,92,25,"TransDate:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(162,110,170,25,printData.transDate); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"Bold",1); |
||||
|
LODOP.ADD_PRINT_TEXT(192,5,256,24,"Manufactured by A&M Polymer"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.ADD_PRINT_TEXT(192,259,109,25,"vender Code:"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.ADD_PRINT_TEXT(210,5,257,35,"No.188 Taigu Road,Lili lndustrial Park,Wujiang District,Suzhou,China"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.ADD_PRINT_TEXT(246,5,407,35,"Phone: 086-0512-63678826 Email: service@husenrubber.com"); |
||||
|
LODOP.SET_PRINT_STYLEA(0,"FontSize",10); |
||||
|
LODOP.ADD_PRINT_LINE(186,2,187,374,0,1); |
||||
|
} |
||||
|
LODOP.PRINT_DESIGN(); |
||||
|
//LODOP.PREVIEW();
|
||||
|
// LODOP.PRINT();
|
||||
|
console.log("操作成功!") |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,273 @@ |
|||||
|
<template> |
||||
|
<div class="mod-config"> |
||||
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -20px;"> |
||||
|
<el-form-item :label="'入库日期:'"> |
||||
|
<el-date-picker |
||||
|
style="width: 130px" |
||||
|
v-model="searchData.startDate" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'至: '"> |
||||
|
<el-date-picker |
||||
|
style="width: 130px" |
||||
|
v-model="searchData.endDate" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item > |
||||
|
<span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span> |
||||
|
<el-input v-model="searchData.partNo" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'生产订单号 '"> |
||||
|
<el-input v-model="searchData.orderNo" style="width: 120px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="'是否打印:'"> |
||||
|
<el-select filterable v-model="searchData.printFlag" style="width: 120px"> |
||||
|
<el-option label="全部" value=""></el-option> |
||||
|
<el-option label="是" value="Y"></el-option> |
||||
|
<el-option label="否" value="N"></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="tableData" |
||||
|
border |
||||
|
style="width: 100%"> |
||||
|
<el-table-column |
||||
|
prop="" |
||||
|
header-align="center" |
||||
|
align="center" |
||||
|
min-width="60" |
||||
|
label="操作"> |
||||
|
<template slot-scope="scope" class="foo_container"> |
||||
|
<a type="text" size="small" @click="printStock(scope.row)">打印标签</a> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="site" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="70" |
||||
|
label="工厂编码"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="partNo" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="100" |
||||
|
label="物料编码"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="partDesc" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="200" |
||||
|
label="物料名称"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="qty" |
||||
|
header-align="center" |
||||
|
align="right" |
||||
|
min-width="80" |
||||
|
label="数量"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="orderNo" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="100" |
||||
|
label="生产订单号"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="transDate" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="160" |
||||
|
label="入库时间"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="transNo" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="120" |
||||
|
label="入库单号"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="wareHouseId" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="仓库编码"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="locationId" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="库位Id"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="batchNo" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="批号"> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
prop="printFlag" |
||||
|
header-align="center" |
||||
|
align="left" |
||||
|
min-width="80" |
||||
|
label="是否打印"> |
||||
|
</el-table-column> |
||||
|
|
||||
|
</el-table> |
||||
|
|
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getStockPrint |
||||
|
, cancelJob |
||||
|
} from '@/api/production/generateReport.js' |
||||
|
import Chooselist from '@/views/modules/common/Chooselist' |
||||
|
import { |
||||
|
printMaterialLabel, |
||||
|
} from "@/views/modules/production/print_stock_label.js" |
||||
|
export default { |
||||
|
name: 'soscheduleRouting', |
||||
|
components: { |
||||
|
Chooselist |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
|
||||
|
site: this.$store.state.user.site, |
||||
|
operatorType: 0, |
||||
|
|
||||
|
height: 200, |
||||
|
tableData: [], |
||||
|
date1: '', |
||||
|
searchData: { |
||||
|
orderNo: '', |
||||
|
partNo: '', |
||||
|
site: this.$store.state.user.site, |
||||
|
startDate:new Date(), |
||||
|
endDate:'', |
||||
|
printFlag:'N', |
||||
|
}, |
||||
|
photoUrl:'', |
||||
|
sopData:{ |
||||
|
site:'', |
||||
|
partNo:'', |
||||
|
}, |
||||
|
partDescription:'', |
||||
|
fileTitle:'', |
||||
|
fileName:'', |
||||
|
num:1, |
||||
|
currentData:'', |
||||
|
photoDatas:[], |
||||
|
uploadImg:[], |
||||
|
showviewer: false, |
||||
|
url: '', |
||||
|
height2:600, |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 210 |
||||
|
this.height2 = window.innerHeight -100 |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取基础数据列表S |
||||
|
getBaseList (val,type) { |
||||
|
this.tagNo = val |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
if (val === 5) { |
||||
|
strVal = this.searchData.partNo |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal) |
||||
|
}) |
||||
|
}, |
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 5) { |
||||
|
this.searchData.partNo = val.PartNo |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
search () { |
||||
|
getStockPrint(this.searchData).then(({data}) => { |
||||
|
this.tableData = data.rows |
||||
|
}) |
||||
|
}, |
||||
|
createExportData () { |
||||
|
return this.tableData |
||||
|
}, |
||||
|
startDownload () { |
||||
|
// this.exportData = this.dataList |
||||
|
|
||||
|
}, |
||||
|
finishDownload () { |
||||
|
|
||||
|
}, |
||||
|
getStrDate () { |
||||
|
let dd = new Date() |
||||
|
let Y = dd.getFullYear() |
||||
|
let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0 |
||||
|
let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0 |
||||
|
let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours() |
||||
|
let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes() |
||||
|
let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds() |
||||
|
return Y + M + D + H + MM + S |
||||
|
}, |
||||
|
printStock(row){ |
||||
|
let array=[]; |
||||
|
let data={ |
||||
|
seqNo:row.site+'|'+row.wareHouseId+'|'+row.batchNo+'|'+row.locationId+'|'+row.partNo, |
||||
|
site:row.site, |
||||
|
wareHouseId:row.wareHouseId, |
||||
|
batchNo:row.wareHouseId, |
||||
|
locationId:row.locationId, |
||||
|
partNo:row.partNo, |
||||
|
orderNo:row.orderNo, |
||||
|
qty:row.qty, |
||||
|
transDate:row.transDate |
||||
|
} |
||||
|
array.push(data) |
||||
|
printMaterialLabel(array); |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
created () { |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
.input_left{ |
||||
|
text-align: left; |
||||
|
} |
||||
|
.input_reight{ |
||||
|
text-align: right; |
||||
|
} |
||||
|
/deep/ input::-webkit-inner-spin-button { |
||||
|
-webkit-appearance: none !important; |
||||
|
} |
||||
|
input[type='number'] { |
||||
|
-moz-appearance: textfield !important; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue