Browse Source

20241114

dev
qiezi 1 year ago
parent
commit
3ae9a5c9c7
  1. 6
      src/api/part/externalLabelTemplate.js
  2. 2
      src/api/part/externalPartPicture.js
  3. 4
      src/assets/scss/global.scss
  4. 48
      src/views/modules/label/printer.vue
  5. 1
      src/views/modules/label/record.vue
  6. 7
      src/views/modules/part/external.vue
  7. 3
      src/views/modules/part/picture/picture.vue
  8. 254
      src/views/modules/part/template/labelTemplate.vue

6
src/api/part/externalLabelTemplate.js

@ -0,0 +1,6 @@
import {createAPI} from '../../utils/httpRequest'
export const queryExternalLabelTemplate = (data) => createAPI('/part/template', 'post', data)
export const queryExternalLabelTemplateByPosition = (data) => createAPI('/part/template/position', 'post', data)

2
src/api/part/externalPartPicture.js

@ -11,3 +11,5 @@ export const updateExternalPartPicture = (data)=>createAPI(`/part/picture/update
export const removeExternalPartPicture = (data)=>createAPI(`/part/picture/remove`,'post',data) export const removeExternalPartPicture = (data)=>createAPI(`/part/picture/remove`,'post',data)
export const removeBatchExternalPartPicture = (data)=>createAPI(`/part/picture/remove/batch`,'post',data) export const removeBatchExternalPartPicture = (data)=>createAPI(`/part/picture/remove/batch`,'post',data)
export const saveProductExternalPartPicturePart = (data)=>createAPI(`/part/picture/save/product`,'post',data)

4
src/assets/scss/global.scss

@ -455,3 +455,7 @@ a:hover{
height: 100% !important; height: 100% !important;
} }
.auto .el-form-item__content{
height: auto;
line-height: 1.5;
}

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

@ -22,6 +22,7 @@ import {savePrintRollLabelRecord} from '../../../api/label/printRollLabelRecord'
import {print_roll_label} from '../../../printFormat/roll_label' import {print_roll_label} from '../../../printFormat/roll_label'
import {saveLogisticLabelRecord} from '../../../api/label/LogisticLabelRecord' import {saveLogisticLabelRecord} from '../../../api/label/LogisticLabelRecord'
import {printLogisticLabel} from '../../../printFormat/logisticLabel' import {printLogisticLabel} from '../../../printFormat/logisticLabel'
import {queryExternalLabelTemplate} from '../../../api/part/externalLabelTemplate'
const printer = { const printer = {
customerNo: '', customerNo: '',
@ -43,6 +44,8 @@ const printer = {
qtyPerRoll: 0, qtyPerRoll: 0,
rollsPerCarton: 0, rollsPerCarton: 0,
orderNo: '', orderNo: '',
templateNo:'',
printLabelType:'',
} }
export default { export default {
name: 'printer', name: 'printer',
@ -548,6 +551,7 @@ export default {
customerNo:'', customerNo:'',
}, },
logisticVisible:false, logisticVisible:false,
templateList:[],
} }
}, },
watch:{ watch:{
@ -685,6 +689,31 @@ export default {
if (this.currentPart.moldCodeRequired === 'Y'){ if (this.currentPart.moldCodeRequired === 'Y'){
this.printCurrentPart.moldCode = this.currentPart.moldCode; this.printCurrentPart.moldCode = this.currentPart.moldCode;
} }
if (this.printCurrentPart.category === 'Alpha/Hard Tag-Serials'){
this.$set(this.printCurrentPart,'printLabelType','Carton Label')
this.handleQueryTemplate();
}
this.handleQueryCategory();
},
handleQueryTemplate(){
let params = {
}
this.templateList = [];
queryExternalLabelTemplate(params).then(({data})=>{
if (data && data.code === 0){
this.templateList = data.rows;
if (this.templateList.length > 0){
this.$set(this.printCurrentPart,'templateNo',this.templateList[0].templateNo)
}
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
handleQueryCategory(){
// category // category
let params = { let params = {
categoryValue: this.currentPart.category, categoryValue: this.currentPart.category,
@ -1180,7 +1209,7 @@ export default {
<el-col :span="12" > <el-col :span="12" >
<el-form-item label=" "> <el-form-item label=" ">
<el-button type="primary" @click="handlePrint(0)">Print-Carton Label</el-button> <el-button type="primary" @click="handlePrint(0)">Print-Carton Label</el-button>
<el-button type="primary" @click="handlePrint(1)" >Print-Roll Label</el-button>
<el-button type="primary" v-if="$store.state.user.autoSerialNumber !== 'Y'" @click="handlePrint(1)" >Print-Roll Label</el-button>
<el-button type="primary" @click="handlePrintLogisticLabel">Print Logistic Label</el-button> <el-button type="primary" @click="handlePrintLogisticLabel">Print Logistic Label</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -1322,6 +1351,23 @@ export default {
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" v-if="$store.state.user.autoSerialNumber === 'Y' && printCurrentPart.category === 'Alpha/Hard Tag-Serials'">
<el-col :span="8">
<el-form-item label="Template">
<el-select v-model="printCurrentPart.templateNo" style="width: 100%">
<el-option v-for="item in templateList" :key="item.templateNo" :label="item.templateName" :value="item.templateNo"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="Label Type">
<el-select v-model="printCurrentPart.printLabelType" style="width: 100%">
<el-option label="Carton Label" value="Carton Label"></el-option>
<el-option label="Product Label" value="Product Label"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" style="text-align: center; margin-top: 10px"> <div slot="footer" style="text-align: center; margin-top: 10px">
<el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button> <el-button type="primary" :loading="printLoading" style="width: 60px" @click="handlePrintOrSave">Print</el-button>

1
src/views/modules/label/record.vue

@ -369,6 +369,7 @@ export default {
username:this.$store.state.user.name, username:this.$store.state.user.name,
boxNo:item.boxNo, boxNo:item.boxNo,
category:item.category, category:item.category,
pictureClassIfy:'BoxPicture'
} }
}) })
let {data} = await selectLabelFormatUserDefaultPrintListByUserId(params) let {data} = await selectLabelFormatUserDefaultPrintListByUserId(params)

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

@ -18,6 +18,7 @@ import {Decimal} from 'decimal.js'
import {getCategoryList} from '../../../api/category/category' import {getCategoryList} from '../../../api/category/category'
import {countryList} from '../../../api/dict/country' import {countryList} from '../../../api/dict/country'
import {getSiteDetail} from '../../../api/factory/site' import {getSiteDetail} from '../../../api/factory/site'
import LabelTemplate from './template/labelTemplate.vue'
let part = { let part = {
site:'', site:'',
@ -39,7 +40,7 @@ let part = {
} }
export default { export default {
name: "ExternalPart", name: "ExternalPart",
components: {LinkedManufacturer, LinkedCustomer, PictureModule},
components: {LabelTemplate, LinkedManufacturer, LinkedCustomer, PictureModule},
props:{ props:{
height:{ height:{
type:Number, type:Number,
@ -801,6 +802,7 @@ export default {
let params = { let params = {
partNo: this.currentPart.partNo, partNo: this.currentPart.partNo,
site: this.currentPart.site, site: this.currentPart.site,
pictureClassify:'BoxPicture',
} }
getExternalPartPictureList(params).then(({data})=>{ getExternalPartPictureList(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
@ -1286,6 +1288,9 @@ export default {
<el-tab-pane label="Linked Manufacturer" name="linkedManufacturer"> <el-tab-pane label="Linked Manufacturer" name="linkedManufacturer">
<linked-manufacturer :column-list="manufacturerColumnList" :part="currentPart" :data-list="externalPartManufacturerList" @refresh="getExternalPartManufacturerList"></linked-manufacturer> <linked-manufacturer :column-list="manufacturerColumnList" :part="currentPart" :data-list="externalPartManufacturerList" @refresh="getExternalPartManufacturerList"></linked-manufacturer>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Product Label" name="productLabel" v-if="this.$store.state.user.autoSerialNumber === 'Y'">
<label-template :part="currentPart"></label-template>
</el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog v-drag :title="`Part`" :close-on-click-modal="false" @close="closeSavePart" width="550px" :visible.sync="savePartVisible"> <el-dialog v-drag :title="`Part`" :close-on-click-modal="false" @close="closeSavePart" width="550px" :visible.sync="savePartVisible">

3
src/views/modules/part/picture/picture.vue

@ -108,6 +108,7 @@ export default {
item.partNo = this.part.partNo item.partNo = this.part.partNo
item.site = this.part.site item.site = this.part.site
item.createBy = this.$store.state.user.name item.createBy = this.$store.state.user.name
item.pictureClassify = 'BoxPicture'
return item return item
}) })
saveBatchExternalPartPicture(pictureList).then(({data})=>{ saveBatchExternalPartPicture(pictureList).then(({data})=>{
@ -323,7 +324,7 @@ export default {
<el-form :model="basePicture" label-position="top"> <el-form :model="basePicture" label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="Certification Code Description">
<el-form-item label="Certification Description">
<el-input v-model="basePicture.pictureDesc"></el-input> <el-input v-model="basePicture.pictureDesc"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>

254
src/views/modules/part/template/labelTemplate.vue

@ -0,0 +1,254 @@
<script>
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
import {
queryExternalLabelTemplate,
queryExternalLabelTemplateByPosition
} from '../../../../api/part/externalLabelTemplate'
import {basePictureList} from '../../../../api/basics/basePicture'
import {removeExternalPartPicture, saveProductExternalPartPicturePart} from '../../../../api/part/externalPartPicture'
export default {
components:{
ElImageViewer
},
name: 'labelTemplate',
props: {
part: {
type: Object,
required: true
},
height: {
type: Number,
default: 370,
},
},
data () {
return {
queryLoading: false,
dataList: [],
saveVisible: false,
currentTemplate: {},
srcList: [],
dataPositionList: [],
currentPosition: {},
savePositionVisible: false,
queryPicture: {
pictureDesc: '',
pictureFileName: '',
},
basePictureList: [],
previewVisible: false,
urlList: [],
}
},
methods: {
handleQueryExternalLabelTemplate () {
let params = {}
this.queryLoading = true
this.dataPositionList = []
queryExternalLabelTemplate(params).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.rows
} else {
this.$message.error(data.msg)
}
this.queryLoading = false
}).catch((error) => {
this.$message.error(error)
this.queryLoading = false
})
},
handleEdit (row) {
this.currentTemplate = {...row}
this.srcList = []
this.srcList.push(row.templateUrl)
this.handleQueryPosition();
},
handleQueryPosition () {
let params = {
site: this.part.site,
partNo: this.part.partNo,
templateNo: this.currentTemplate.templateNo
}
queryExternalLabelTemplateByPosition(params).then(({data}) => {
if (data && data.code === 0) {
this.saveVisible = true
this.dataPositionList = data.rows
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
handleEditPosition (row) {
this.currentPosition = {...row}
this.handleQueryBasePicture();
this.savePositionVisible = true
},
handleQueryBasePicture () {
let params = {
pictureNos: this.currentPosition.pictureNo?[this.currentPosition.pictureNo]:[],
pictureDesc: this.queryPicture.pictureDesc,
pictureFileName: this.queryPicture.pictureFileName,
}
basePictureList(params).then(({data}) => {
if (data && data.code === 0) {
this.basePictureList = data.rows
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
handlePreviewImg(row){
this.urlList = [];
this.urlList.push(row.pictureUrl);
this.previewVisible = true;
},
handleDblClick(row){
let params = {
site:this.part.site,
partNo:this.part.partNo,
templateNo:this.currentPosition.templateNo,
pictureClassify:'ProPicture',
picturePosition:this.currentPosition.picturePosition,
pictureNo:this.currentPosition.pictureNo,
pictureDesc:row.pictureDesc,
pictureFileName:row.pictureFileName,
pictureNewFileName:row.pictureNewFileName,
pictureUrl:row.pictureUrl,
basePictureNo:row.pictureNo,
createBy:this.$store.state.user.name,
}
this.savePositionVisible = false
saveProductExternalPartPicturePart(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQueryPosition();
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
handleClearPosition(row){
let params = {
site:this.part.site,
partNo:this.part.partNo,
pictureNo:row.pictureNo,
pictureUrl:row.pictureUrl,
}
removeExternalPartPicture(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQueryPosition();
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}
},
watch: {
part (newVal, oldVal) {
if (newVal) {
this.handleQueryExternalLabelTemplate()
}
},
savePositionVisible (newVal, oldVal) {
if (newVal === false) {
this.queryPicture = {
pictureDesc: '',
pictureFileName: '',
}
}
}
}
}
</script>
<template>
<div>
<el-table :data="dataList" border v-loading="queryLoading" :height="height">
<el-table-column label="Actions" width="80" align="center">
<template slot-scope="scope">
<el-link @click="handleEdit(scope.row)">Edit</el-link>
</template>
</el-table-column>
<el-table-column label="Template No" prop="sortNo" width="100" align="center"></el-table-column>
<el-table-column label="Template Name" prop="templateName" min-width="130" header-align="center"
align="left"></el-table-column>
</el-table>
<el-dialog title="Template Preview" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="900px">
<div style="display: flex; justify-content: center;margin-bottom: 10px">
<el-image
style="width: 700px; height: 300px"
:src="currentTemplate.templateUrl"
:preview-src-list="srcList">
</el-image>
</div>
<el-table :data="dataPositionList" border height="300">
<el-table-column label="Actions" align="center" width="140">
<template slot-scope="scope">
<el-link @click="handleEditPosition(scope.row)">Edit</el-link>
<el-link v-if="scope.row.pictureNo" @click="handleClearPosition(scope.row)">Clear</el-link>
<el-link v-if="scope.row.pictureNo" @click="handlePreviewImg(scope.row)">View</el-link>
</template>
</el-table-column>
<el-table-column label="Template Name" prop="templateName" width="100" header-align="center"
align="left"></el-table-column>
<el-table-column label="Position" prop="picturePosition" width="100" header-align="center"
align="left"></el-table-column>
<el-table-column label="Certification Code" prop="certificationNo" min-width="120" header-align="center"
align="left"></el-table-column>
<el-table-column label="Certification Desc" prop="pictureDesc" min-width="160" header-align="center"
align="left"></el-table-column>
<el-table-column label="Created By" prop="createBy" min-width="100" header-align="center"
align="left"></el-table-column>
<el-table-column label="Created Time" prop="createTime" min-width="140" header-align="center"
align="center"></el-table-column>
</el-table>
<div slot="footer">
<el-button type="primary" @click="saveVisible = false">Cancel</el-button>
</div>
</el-dialog>
<el-dialog title="Certification" v-drag :close-on-click-modal="false" :visible.sync="savePositionVisible" width="500px">
<el-form label-position="top" :model="queryPicture">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="Certification Description" class="auto">
<el-input v-model="queryPicture.pictureDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label=" ">
<el-button type="primary" @click="handleQueryBasePicture">Query</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="basePictureList" @row-dblclick="handleDblClick" border :height="400" :style="`width: 100%;margin-top: 5px`">
<el-table-column prop="certificationNo" label="Certification Code" min-width="60"/>
<el-table-column prop="pictureDesc" label="Certification Description" min-width="120"/>
<el-table-column label="Actions" width="60" align="center">
<template slot-scope="scope">
<el-link @click="handlePreviewImg(scope.row)">View</el-link>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-image-viewer v-if="previewVisible" :z-index="9999" :on-close="()=>{this.previewVisible = false}" :url-list="urlList"></el-image-viewer>
</div>
</template>
<style scoped>
</style>
Loading…
Cancel
Save