13 changed files with 681 additions and 45 deletions
-
9src/api/label/LogisticLabelRecord.js
-
7src/printFormat/RF_RFID.js
-
6src/printFormat/alphaHardTagPrintFormat.js
-
6src/printFormat/antenna.js
-
78src/printFormat/logisticLabel.js
-
2src/printFormat/roll_label.js
-
1src/views/modules/label/QrCode.vue
-
2src/views/modules/label/format.vue
-
418src/views/modules/label/logisticLabelRecord.vue
-
176src/views/modules/label/printer.vue
-
18src/views/modules/label/record.vue
-
2src/views/modules/label/roll.vue
-
1src/views/modules/label/userDefault.vue
@ -0,0 +1,9 @@ |
|||||
|
import {createAPI} from '../../utils/httpRequest' |
||||
|
|
||||
|
export const saveLogisticLabelRecord = (data) => createAPI('/print/logistic/save', 'post', data) |
||||
|
|
||||
|
|
||||
|
export const queryLogisticLabelRecord = (data) => createAPI(`/print/logistic/${data.no}/${data.size}`, 'post', data) |
||||
|
|
||||
|
|
||||
|
export const queryLogisticLabelRecordPrinter = (data) => createAPI('/label/format/user/default/user/logistic', 'post', data) |
||||
78
src/printFormat/logisticLabel.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,418 @@ |
|||||
|
<script> |
||||
|
import CustomerInfo from '../customer/info.vue' |
||||
|
import ExternalPart from '../part/external.vue' |
||||
|
import QrCode from './QrCode.vue' |
||||
|
import {queryLogisticLabelRecord, queryLogisticLabelRecordPrinter} from '../../../api/label/LogisticLabelRecord' |
||||
|
import SelectionTable from '../../common/selectionTable.vue' |
||||
|
import {print_roll_label} from '../../../printFormat/roll_label' |
||||
|
import {printLogisticLabel} from '../../../printFormat/logisticLabel' |
||||
|
|
||||
|
export default { |
||||
|
name: 'logisticLabelRecord', |
||||
|
components: {SelectionTable, QrCode, ExternalPart, CustomerInfo}, |
||||
|
props: { |
||||
|
height: { |
||||
|
type: [Number, String], |
||||
|
default: '74vh', |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
queryLoading: false, |
||||
|
no: 1, |
||||
|
size: 50, |
||||
|
total: 0, |
||||
|
dataList: [], |
||||
|
logisticLabelRecord: { |
||||
|
customerNo: '', |
||||
|
customerName: '', |
||||
|
startDate: '', |
||||
|
endDate: '', |
||||
|
partNo: '', |
||||
|
partDesc: '' |
||||
|
}, |
||||
|
partVisible: false, |
||||
|
customerVisible: false, |
||||
|
columns: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableItemNo', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'itemNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'No', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TablePoNo', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'poNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'PO No', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableCustomerNo', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'customerNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'Customer No', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableCustomerName', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'customerName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'Customer Name', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TablePartNo', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'partNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'Part No', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TablePartDesc', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'partDesc', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'Part Description', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableUnitQtyPerPallet', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'unitQtyPerPallet', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: 'Unit Qty per Pallet', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableCountOfPallets', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'countOfPallets', |
||||
|
headerAlign: 'center', |
||||
|
align: 'right', |
||||
|
columnLabel: 'Count of Pallets', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableCreateBy', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'Created By', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, { |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: 30007, |
||||
|
serialNumber: '30007TableCreateTime', |
||||
|
tableId: '30007Table', |
||||
|
tableName: 'Logistic Label Record', |
||||
|
columnProp: 'createTime', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'CreateTime', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 10, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 140 |
||||
|
} |
||||
|
], |
||||
|
selectionDataList: [], |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
handlePartRowClick (row) { |
||||
|
this.logisticLabelRecord.partNo = row.partNo |
||||
|
this.partVisible = false |
||||
|
}, |
||||
|
handleCustomerRowClick (row) { |
||||
|
this.logisticLabelRecord.customerNo = row.customerNo |
||||
|
this.customerVisible = false |
||||
|
}, |
||||
|
handleQuery () { |
||||
|
let params = { |
||||
|
...this.logisticLabelRecord, |
||||
|
no: this.no, |
||||
|
size: this.size |
||||
|
} |
||||
|
this.queryLoading = true |
||||
|
queryLogisticLabelRecord(params).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.rows |
||||
|
this.total = data.total |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
this.queryLoading = false |
||||
|
}).catch((error) => { |
||||
|
this.$message.error(error) |
||||
|
this.queryLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
handleSizeChange (val) { |
||||
|
this.size = val |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
handleCurrentChange (val) { |
||||
|
this.no = val |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
handleSelectionChange (val) { |
||||
|
this.selectionDataList = val |
||||
|
}, |
||||
|
handlePrint () { |
||||
|
if (this.selectionDataList.length === 0) { |
||||
|
this.$message.warning('Please select at least one record') |
||||
|
return |
||||
|
} |
||||
|
let params = this.selectionDataList.map(item =>{ |
||||
|
item.username = this.$store.state.user.name |
||||
|
return item |
||||
|
}) |
||||
|
queryLogisticLabelRecordPrinter(params).then(({data})=>{ |
||||
|
if (data && data.code === 0){ |
||||
|
let printers = data.rows |
||||
|
for (let i = 0; i < printers.length; i++) { |
||||
|
let printer = printers[i] // 这个是个数组 理论只有一个值 |
||||
|
let row = { |
||||
|
...this.selectionDataList[i], |
||||
|
qty:this.selectionDataList[i].unitQtyPerPallet, |
||||
|
qrCode: `(00)${this.selectionDataList[i].partNo? this.selectionDataList[i].partNo : ''}(01)${this.selectionDataList[i].unitQtyPerPallet? this.selectionDataList[i].unitQtyPerPallet : ''}(02)${this.selectionDataList[i].umName? this.selectionDataList[i].umName : ''}(03)(04)(05)(06)(07)(08)(09)(10)${this.selectionDataList[i].poNo? this.selectionDataList[i].poNo : ''}`, |
||||
|
} |
||||
|
let qrCodeList = this.$refs.qrCode.init([row.qrCode]) |
||||
|
row.qrCode = qrCodeList[0] |
||||
|
|
||||
|
for (let p in printer){ |
||||
|
printLogisticLabel([row],p.defaultPrinterName) |
||||
|
} |
||||
|
} |
||||
|
}else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}).catch((error)=>{ |
||||
|
this.$message.error(error) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
'logisticLabelRecord.customerNo' (newVal, oldVal) { |
||||
|
this.logisticLabelRecord.customerNo = newVal.toUpperCase() |
||||
|
}, |
||||
|
'logisticLabelRecord.partNo' (newVal, oldVal) { |
||||
|
this.logisticLabelRecord.partNo = newVal.toUpperCase() |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
// this.handleQuery() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template> |
||||
|
<div> |
||||
|
<el-form :model="logisticLabelRecord" label-position="top" style="width: 1000px"> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="Customer No"> |
||||
|
<span slot="label" style="cursor:pointer;" @click="customerVisible=true"><a |
||||
|
herf="#">Customer No</a></span> |
||||
|
<el-input v-model="logisticLabelRecord.customerNo" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="7"> |
||||
|
<el-form-item label="Customer Name"> |
||||
|
<el-input v-model="logisticLabelRecord.customerName" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-row> |
||||
|
<el-col :span="11"> |
||||
|
<el-form-item label="Created Time"> |
||||
|
<el-date-picker |
||||
|
v-model="logisticLabelRecord.startDate" |
||||
|
style="width: 100%;" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder=" "> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="2"> |
||||
|
<el-form-item label=" "> |
||||
|
<div style="text-align: center"><i class="el-icon-right"></i></div> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="11"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-date-picker |
||||
|
v-model="logisticLabelRecord.endDate" |
||||
|
style="width: 100%;" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder=" "> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row :gutter="20"> |
||||
|
<el-col :span="4"> |
||||
|
<el-form-item label="Part No"> |
||||
|
<span slot="label" style="cursor:pointer;" @click="partVisible=true"><a herf="#">Part No</a></span> |
||||
|
<el-input v-model="logisticLabelRecord.partNo" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="7"> |
||||
|
<el-form-item label="Part Description"> |
||||
|
<el-input v-model="logisticLabelRecord.partDesc" clearable></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label=" "> |
||||
|
<el-button type="primary" style="width: 60px" @click="handleQuery">Query</el-button> |
||||
|
<el-button type="primary" style="width: 60px" @click="handlePrint">Print</el-button> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<qr-code ref="qrCode"></qr-code> |
||||
|
|
||||
|
<el-table v-loading="queryLoading" :data="dataList" ref="table" @selection-change="handleSelectionChange" |
||||
|
style="width: 100%;margin-top: 10px" border :height="height"> |
||||
|
<el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columns" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed===''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 80px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
<div> |
||||
|
<selection-table :size="selectionDataList.length" :total="total"></selection-table> |
||||
|
<el-pagination |
||||
|
@size-change="handleSizeChange" |
||||
|
@current-change="handleCurrentChange" |
||||
|
:current-page.sync="no" |
||||
|
:page-sizes="[50,100, 200, 300, 400]" |
||||
|
:page-size="size" |
||||
|
layout="sizes, prev, pager, next" |
||||
|
:total="total"> |
||||
|
</el-pagination> |
||||
|
</div> |
||||
|
<el-dialog v-drag title="Select Part" :close-on-click-modal="false" :visible.sync="partVisible"> |
||||
|
<external-part :height="450" :of-components="true" @rowClick="handlePartRowClick"></external-part> |
||||
|
<div slot="footer" style="text-align: center; margin-top: 10px"></div> |
||||
|
</el-dialog> |
||||
|
<el-dialog v-drag title="Select Customer" :close-on-click-modal="false" :visible.sync="customerVisible"> |
||||
|
<customer-info :height="450" :of-components="true" @rowClick="handleCustomerRowClick"></customer-info> |
||||
|
<div slot="footer" style="text-align: center; margin-top: 10px"></div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<style scoped> |
||||
|
|
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue