Browse Source

roll label

dev
qiezi 2 years ago
parent
commit
bfc1710168
  1. 1
      src/api/category/category.js
  2. 102
      src/views/modules/label/printer.vue
  3. 24
      src/views/modules/part/external.vue
  4. 4
      src/views/modules/sys/user.vue

1
src/api/category/categoty.js → src/api/category/category.js

@ -1,3 +1,4 @@
import {createAPI} from '../../utils/httpRequest'
export const getCategoryList = (data) => createAPI('part/category/list','post', data)
export const getCategory = (data) => createAPI('part/category','post', data)

102
src/views/modules/label/printer.vue

@ -16,7 +16,7 @@ import {printRF_RFIDLabel} from '../../../printFormat/RF_RFID'
import getLodop from '@/utils/LodopFuncs.js'
import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table'
import {getCategoryList} from '../../../api/category/categoty'
import {getCategory, getCategoryList} from '../../../api/category/category'
import QrCode from './QrCode.vue'
import {savePrintRollLabelRecord} from '../../../api/label/printRollLabelRecord'
import {print_roll_label} from '../../../printFormat/roll_label'
@ -53,6 +53,7 @@ export default {
},
data(){
return{
rowSpan: 8,
printerSetupList:[],
currentPrinter: '',
printType: 'alphaHardTag',
@ -548,8 +549,28 @@ export default {
},
handlePrint(status){
this.printCurrentPart = JSON.parse(JSON.stringify(this.currentPart))
let labelList = [];
if (status === 1){
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label')
this.printCurrentPart.rollsPerCarton = 1;
this.$set(this.printCurrentPart,'orderNo','')
}else {
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton')
}
if (labelList.length === 0){
this.$message.warning("There is no maintenance of print label format")
return
}
for (let label of labelList) {
if (!label.defaultPrinterName){
this.$message.warning("The default printer name is not set")
return
}
}
this.status = status;
this.$set(this.printCurrentPart,'cartonCount',1)
this.$set(this.printCurrentPart,'manufacturerNo','')
this.$set(this.printCurrentPart,'totalShipQty',undefined)
this.$set(this.printCurrentPart,'moldCode','')
this.$set(this.printCurrentPart,'serialNumber',undefined)
this.$set(this.printCurrentPart,'manufacturerTime',dayjs().format('YYYY-MM-DD HH:mm:ss'))
@ -562,6 +583,7 @@ export default {
this.printCurrentPart.qtyPerCarton = this.currentPart.qtyPerCarton;
this.printCurrentPart.qtyPerRoll = this.currentPart.qtyPerRoll;
this.printCurrentPart.rollsPerCarton = this.currentPart.rollsPerCarton;
this.printCurrentPart.totalShipQty = this.totalShipQty();
}
if (this.currentPart.manufacturerRequired === 'Y'){
// manufacturer
@ -570,26 +592,44 @@ export default {
if (this.currentPart.moldCodeRequired === 'Y'){
this.printCurrentPart.moldCode = this.currentPart.moldCode;
}
let labelList = [];
if (status === 1){
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Roll Label')
this.printCurrentPart.rollsPerCarton = 1;
this.$set(this.printCurrentPart,'orderNo','')
}else {
labelList = this.labelFormatList.filter((item)=> item.labelType === 'Shipment Carton')
}
if (labelList.length === 0){
this.$message.warning("There is no maintenance of print label format")
return
// category
let params = {
categoryValue: this.currentPart.category,
}
for (let label of labelList) {
if (!label.defaultPrinterName){
this.$message.warning("The default printer name is not set")
return
getCategory(params).then(({data})=>{
if (data && data.code === 0){
this.$set(this.printCurrentPart,'qtyPerRollLabel',data.data.qtyPerRollLabel)
this.$set(this.printCurrentPart,'cartonCountLabel',data.data.cartonCountLabel)
this.$set(this.printCurrentPart,'rollCountLabel',data.data.rollCountLabel)
this.$set(this.printCurrentPart,'showCartonQtyPerRoll',data.data.showCartonQtyPerRoll)
this.$set(this.printCurrentPart,'showCartonRollsPerCarton',data.data.showCartonRollsPerCarton)
this.$set(this.printCurrentPart,'showRollQtyPerRoll',data.data.showRollQtyPerRoll)
this.$set(this.printCurrentPart,'editQtyPerCarton',data.data.editQtyPerCarton)
this.printRules.qtyPerRoll[0].message = `Please input ${data.data.qtyPerRollLabel}`
if (this.status === 0){
if (data.data.showCartonRollsPerCarton === 'N' && data.data.showCartonQtyPerRoll === 'N'){
this.rowSpan = 8
}else if (data.data.showCartonRollsPerCarton === 'N' || data.data.showCartonQtyPerRoll === 'N'){
this.rowSpan = 6
}else {
this.rowSpan = 5
}
this.printRules.cartonCount[0].message = `Please input ${data.data.cartonCountLabel}`
}else {
if (data.data.showRollQtyPerRoll === 'N'){
this.rowSpan = 12
}else {
this.rowSpan = 8
}
this.printRules.cartonCount[0].message = `Please input ${data.data.rollCountLabel}`
}
this.printVisible = true;
}else {
this.$message.warning(data.msg)
}
}
this.status = status;
this.printVisible = true;
}).catch((error)=>{
this.$message.error(error)
})
},
getExternalPartManufacturerList(){
let params = {
@ -988,7 +1028,7 @@ export default {
</el-form-item>
</el-col>
<el-col :span="16" v-if="status !== 0">
<el-form-item label="PO" prop="orderNo" :show-message="false">
<el-form-item label="PO" prop="orderNo" v-if="false" :show-message="false">
<el-input v-model="printCurrentPart.orderNo"></el-input>
</el-form-item>
</el-col>
@ -997,15 +1037,15 @@ export default {
<el-input v-model="printCurrentPart.partDesc" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="status === 0? 5:8">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Qty Per Roll" :show-message="false">
<el-col :span="rowSpan" v-if="(status === 0 && printCurrentPart.showCartonQtyPerRoll === 'Y') || (status === 1 && printCurrentPart.showRollQtyPerRoll === 'Y')">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" :label="printCurrentPart.qtyPerRollLabel" :show-message="false">
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll" disabled></el-input-number>
</el-form-item>
<el-form-item v-else key="qtyPerRoll" label="Qty Per Roll" prop="qtyPerRoll" :show-message="false">
<el-form-item v-else key="qtyPerRoll" :label="printCurrentPart.qtyPerRollLabel" prop="qtyPerRoll" :show-message="false">
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.qtyPerRoll"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="5" v-if="status === 0">
<el-col :span="rowSpan" v-if="status === 0 && printCurrentPart.showCartonRollsPerCarton === 'Y'">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Rolls Per Carton" :show-message="false">
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton" disabled></el-input-number>
</el-form-item>
@ -1013,23 +1053,23 @@ export default {
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.rollsPerCarton"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="5" v-if="status === 0">
<el-col :span="rowSpan" v-if="status === 0">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Qty Per Carton" :show-message="false">
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" disabled></el-input-number>
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number>
</el-form-item>
<el-form-item v-else label="Qty Per Carton" prop="qtyPerCarton" key="qtyPerCarton" :show-message="false">
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" disabled></el-input-number>
<el-input-number :step="0" :controls="false" v-model="printCurrentPart.qtyPerCarton" :disabled="printCurrentPart.editQtyPerCarton === 'N'"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="status === 0? 4:8">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Carton Count" :show-message="false">
<el-col :span="(status === 0 && rowSpan === 5)? rowSpan-1:rowSpan">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" :show-message="false">
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.cartonCount" disabled></el-input-number>
</el-form-item>
<el-form-item v-else key="cartonCount" :label="status === 0 ? 'Carton Count':'Roll Count'" prop="cartonCount" :show-message="false">
<el-form-item v-else key="cartonCount" :label="status === 0 ? printCurrentPart.cartonCountLabel:printCurrentPart.rollCountLabel" prop="cartonCount" :show-message="false">
<el-input-number :step="0" :min="1" :controls="false" v-model="printCurrentPart.cartonCount"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="status === 0? 5:8">
<el-col :span="rowSpan">
<el-form-item v-if="printCurrentPart.serialNumberRequired === 'Y'" label="Total Ship Qty" :show-message="false">
<el-input-number :step="0" :min="0" :controls="false" v-model="printCurrentPart.totalShipQty" disabled></el-input-number>
</el-form-item>

24
src/views/modules/part/external.vue

@ -15,7 +15,7 @@ import LinkedManufacturer from './manufacturer/linkedManufacturer.vue'
import {getExternalPartManufacturerList} from '../../../api/part/externalPartManufacturer'
import {getTableDefaultListLanguage, getTableUserListLanguage} from '../../../api/table'
import {Decimal} from 'decimal.js'
import {getCategoryList} from '../../../api/category/categoty'
import {getCategoryList} from '../../../api/category/category'
let part = {
site:'',
@ -57,6 +57,7 @@ export default {
partCategoryList:[
],
category:{},
partRules:{
partNo: [{ required: true, message: 'Please input Part No', trigger: ['blur','change'] }],
partDesc: [{ required: true, message: 'Please input Part Description', trigger: ['blur','change'] }],
@ -711,8 +712,15 @@ export default {
if (this.savePart.serialNumberRequired === 'Y'){
this.savePart.qtyPerRoll = 1;
this.savePart.rollsPerCarton = 1;
this.savePart.qtyPerCarton = 1;
}
if (category.showCartonQtyPerRoll === 'N'){
this.savePart.qtyPerRoll = 1;
}
if (category.showCartonRollsPerCarton === 'N'){
this.savePart.rollsPerCarton = 1;
}
this.savePart.qtyPerCarton = this.qtyPerCarton();
this.category = JSON.parse(JSON.stringify(category))
}
},
"part.partNo"(newVal,oldVal){
@ -1142,21 +1150,25 @@ export default {
<el-input v-model="savePart.moldCode" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="Qty Per Roll" prop="qtyPerRoll" :show-message="false">
</el-row>
<el-row :gutter="10">
<el-col :span="7" v-if="category.showRollQtyPerRoll === 'Y' || category.showCartonQtyPerRoll === 'Y'">
<el-form-item :label="category.qtyPerRollLabel" prop="qtyPerRoll" :show-message="false">
<el-input-number :step="0" :min="0" :controls="false" :disabled="this.savePart.serialNumberRequired === 'Y'" v-model="savePart.qtyPerRoll"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="7">
<el-col :span="7" v-if="category.showCartonRollsPerCarton === 'Y'">
<el-form-item label="Rolls Per Carton" prop="rollsPerCarton" :show-message="false">
<el-input-number :step="0" :min="0" :controls="false" :disabled="this.savePart.serialNumberRequired === 'Y'" v-model="savePart.rollsPerCarton"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="Qty Per Carton" prop="qtyPerCarton" :show-message="false">
<el-input-number :step="0" :min="0" :controls="false" disabled v-model="savePart.qtyPerCarton"></el-input-number>
<el-input-number :step="0" :min="0" :controls="false" :disabled="category.editQtyPerCarton === 'N'" v-model="savePart.qtyPerCarton"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="7">
<el-form-item label="Rev No" prop="rev" :show-message="false">
<el-input v-model="savePart.rev"></el-input>

4
src/views/modules/sys/user.vue

@ -4,7 +4,7 @@
<el-form-item :label="buttons.username">
<el-input v-model="dataForm.userName" placeholder=" " clearable></el-input>
</el-form-item>
<el-form-item :label="buttons.site" v-if="$store.state.user.userType === 'GlobalAdmin' || $store.state.user.id === 1">
<el-form-item :label="buttons.site" v-if="$store.state.user.userType === 'Global Admin' || $store.state.user.id === 1">
<el-input v-model="dataForm.site" placeholder=" " clearable></el-input>
</el-form-item>
<el-form-item label=" ">
@ -562,7 +562,7 @@ export default {
}
},
created() {
if (this.$store.state.user.userType !== 'GlobalAdmin' && this.$store.state.user.id !== 1){
if (this.$store.state.user.userType !== 'Global Admin' && this.$store.state.user.id !== 1){
this.dataForm.site = this.$store.state.user.site
}
this.getFunctionButtonList()

Loading…
Cancel
Save