Browse Source

制品收货申请 退料申请 添加打印标签功能

master
陈薪名 11 months ago
parent
commit
4fe947d6e5
  1. 94
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  2. 86
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  3. 40
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

94
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -94,6 +94,7 @@ import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnReq
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package' import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
// 退 // 退
defineOptions({ name: 'ProductionreturnRequestMain' }) defineOptions({ name: 'ProductionreturnRequestMain' })
@ -110,6 +111,7 @@ const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
}) })
@ -120,25 +122,57 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const isItemType = async (itemCode, labelTypeParams) => {
let isType = false
await ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].type == "RAW") {
labelType.value = 'cg'
if (labelTypeParams == 'cg') {
isType = true
}
} else {
labelType.value = 'zz'
if (labelTypeParams == 'zz') {
isType = true
}
}
if(labelTypeParams == '') isType = true
}
})
return isType
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if(formField == 'itemCode') { if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber'] const isType = await isItemType(val[0]['itemCode'], labelType.value)
// row['containerNumber'] = val[0]['containerNumber'] if(!isType){
// row['batch'] = val[0]['batch'] message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus'] row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty'] row['qty'] = val[0]['qty']
// tableform // tableform
// TODO: tableFormColumns 10 20 20
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) { if(item.field == 'qty' && val[0]['qty'] > 0) {
item.tableForm.max = val[0]['qty'] item.tableForm.max = val[0]['qty']
} }
}) })
}
} else if(formField == 'workStationCode') { } else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code'] row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode'] row['fromLocationCode'] = val[0]['rawLocationCode']
@ -155,10 +189,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(async () => {
const setV = {} const setV = {}
if(formField == 'itemCode') { if(formField == 'itemCode') {
setV['batch'] = val[0]['batch'] const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus'] setV['inventoryStatus'] = val[0]['inventoryStatus']
@ -169,6 +206,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
item.tableForm.max = val[0]['qty'] item.tableForm.max = val[0]['qty']
} }
}) })
}
} else if(formField == 'workStationCode') { } else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code'] setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode'] setV['fromLocationCode'] = val[0]['rawLocationCode']
@ -241,6 +279,7 @@ const butttondata = (row) => {
hasPermi: '', hasPermi: '',
link: true, // link: true, //
}, },
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
] ]
} }
@ -380,6 +419,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} }
} }
@ -470,11 +511,7 @@ const submitForm = async (formType, data) => {
const submitFormLabel = async (formType, data) => { const submitFormLabel = async (formType, data) => {
try { try {
detatableData.tableList.forEach(async (item) => { detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => { await PackageApi.createPackageLabel(item).then(() => {
if (res) {
//
ProductionreturnRequestDetailApi.updateDetailPackingNumber(res.id,res.number)
}
isCreateLabel.value = true isCreateLabel.value = true
message.success('创建标签成功') message.success('创建标签成功')
}).catch(err => { }).catch(err => {
@ -489,6 +526,41 @@ const submitFormLabel = async (formType, data) => {
} }
} }
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
//
await PackageApi.getPackagePage({
requestNumber: row.number
}).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
} else {
isCreateLabel.value = false
}
}).catch(err => {
isCreateLabel.value = false
console.log(err)
})
//
if (isCreateLabel.value) {
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/904910575183290368?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
} else {
const src = ref(BASE_URL + '/jmreport/view/904911200226861056?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
}
} else {
message.warning('请先创建标签')
}
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {

86
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -97,6 +97,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package' import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index' import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
// 退 // 退
defineOptions({ name: 'ProductionreturnRequestMainNo' }) defineOptions({ name: 'ProductionreturnRequestMainNo' })
@ -113,6 +114,7 @@ const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const detailListTableColumns = ProductionreturnRequestDetailNoLabel.allSchemas const detailListTableColumns = ProductionreturnRequestDetailNoLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage
}) })
@ -123,16 +125,46 @@ const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const isItemType = async (itemCode, labelTypeParams) => {
let isType = false
await ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].type == "RAW") {
labelType.value = 'cg'
if (labelTypeParams == 'cg') {
isType = true
}
} else {
labelType.value = 'zz'
if (labelTypeParams == 'zz') {
isType = true
}
}
if(labelTypeParams == '') isType = true
}
})
return isType
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
if(formField == 'itemCode') { if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber'] const isType = await isItemType(val[0]['itemCode'], labelType.value)
// row['containerNumber'] = val[0]['containerNumber'] if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch'] row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus'] row['inventoryStatus'] = val[0]['inventoryStatus']
@ -146,6 +178,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item.tableForm.disabled = false item.tableForm.disabled = false
} }
}) })
}
} else if(formField == 'workStationCode') { } else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code'] row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode'] row['fromLocationCode'] = val[0]['rawLocationCode']
@ -162,9 +195,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => { nextTick(async () => {
const setV = {} const setV = {}
if(formField == 'itemCode') { if(formField == 'itemCode') {
const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
setV['batch'] = val[0]['batch'] setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
@ -176,6 +213,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
item.tableForm.max = val[0]['qty'] item.tableForm.max = val[0]['qty']
} }
}) })
}
} else if(formField == 'workStationCode') { } else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code'] setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode'] setV['fromLocationCode'] = val[0]['rawLocationCode']
@ -248,6 +286,7 @@ const butttondata = (row) => {
hasPermi: '', hasPermi: '',
link: true, // link: true, //
}, },
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
] ]
} }
@ -387,6 +426,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} }
} }
@ -490,6 +531,41 @@ const submitFormLabel = async (formType, data) => {
} }
} }
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
//
await PackageApi.getPackagePage({
requestNumber: row.number
}).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
} else {
isCreateLabel.value = false
}
}).catch(err => {
isCreateLabel.value = false
console.log(err)
})
//
if (isCreateLabel.value) {
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/904910575183290368?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
} else {
const src = ref(BASE_URL + '/jmreport/view/904911200226861056?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
}
} else {
message.warning('请先创建标签')
}
}
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {

40
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue

@ -125,6 +125,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package' import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index' import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
// //
defineOptions({ name: 'ProductreceiptRequestMain' }) defineOptions({ name: 'ProductreceiptRequestMain' })
@ -152,6 +153,7 @@ const buttondataTable = ref([{
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductreceiptRequestDetailApi.getProductreceiptRequestDetailPage getListApi: ProductreceiptRequestDetailApi.getProductreceiptRequestDetailPage
}) })
@ -263,6 +265,7 @@ const butttondata = (row) => {
hasPermi: '', hasPermi: '',
link: true, // link: true, //
}, },
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), //
] ]
} }
@ -405,6 +408,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} }
} }
@ -564,6 +569,41 @@ const detailValidate = (data) => {
} }
} }
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
//
await PackageApi.getPackagePage({
requestNumber: row.number
}).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
} else {
isCreateLabel.value = false
}
}).catch(err => {
isCreateLabel.value = false
console.log(err)
})
//
if (isCreateLabel.value) {
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/904910575183290368?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
} else {
const src = ref(BASE_URL + '/jmreport/view/904911200226861056?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
}
} else {
message.warning('请先创建标签')
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save