Browse Source

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

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

134
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 ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
// 退
defineOptions({ name: 'ProductionreturnRequestMain' })
@ -110,6 +111,7 @@ const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
})
@ -120,25 +122,57 @@ const updataTableColumns = (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 ) => {
nextTick(() => {
nextTick(async () => {
if (type == 'tableForm') {
//
if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber']
// row['containerNumber'] = val[0]['containerNumber']
// row['batch'] = val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) {
item.tableForm.max = val[0]['qty']
}
})
const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
// TODO: tableFormColumns 10 20 20
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) {
item.tableForm.max = val[0]['qty']
}
})
}
} else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode']
@ -155,20 +189,24 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
nextTick(async () => {
const setV = {}
if(formField == 'itemCode') {
setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) {
item.tableForm.max = val[0]['qty']
}
})
const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) {
item.tableForm.max = val[0]['qty']
}
})
}
} else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode']
@ -241,6 +279,7 @@ const butttondata = (row) => {
hasPermi: '',
link: true, //
},
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
]
}
@ -380,6 +419,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
}
}
@ -470,11 +511,7 @@ const submitForm = async (formType, data) => {
const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
if (res) {
//
ProductionreturnRequestDetailApi.updateDetailPackingNumber(res.id,res.number)
}
await PackageApi.createPackageLabel(item).then(() => {
isCreateLabel.value = true
message.success('创建标签成功')
}).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) => {
tableObject.params = {

136
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 PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
// 退
defineOptions({ name: 'ProductionreturnRequestMainNo' })
@ -113,6 +114,7 @@ const tableColumns = ref(ProductionreturnRequestMain.allSchemas.tableColumns)
const detailListTableColumns = ProductionreturnRequestDetailNoLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage
})
@ -123,29 +125,60 @@ const updataTableColumns = (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 ) => {
nextTick(() => {
nextTick(async () => {
if (type == 'tableForm') {
//
if(formField == 'itemCode') {
// row['packingNumber'] = val[0]['packingNumber']
// row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
if(item.field == 'batch') {
item.tableForm.disabled = false
}
})
const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
if(item.field == 'batch') {
item.tableForm.disabled = false
}
})
}
} else if(formField == 'workStationCode') {
row['workStationCode'] = val[0]['code']
row['fromLocationCode'] = val[0]['rawLocationCode']
@ -162,20 +195,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
nextTick(async () => {
const setV = {}
if(formField == 'itemCode') {
setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
const isType = await isItemType(val[0]['itemCode'], labelType.value)
if(!isType){
message.warning('当前物品类型与其他数据不一致,请重新选择!')
} else {
setV['batch'] = val[0]['batch']
setV['itemCode'] = val[0]['itemCode']
setV['uom'] = val[0]['uom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
// tableform
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty') {
item.tableForm.max = val[0]['qty']
}
})
}
} else if(formField == 'workStationCode') {
setV['workStationCode'] = val[0]['code']
setV['fromLocationCode'] = val[0]['rawLocationCode']
@ -248,6 +286,7 @@ const butttondata = (row) => {
hasPermi: '',
link: true, //
},
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
]
}
@ -387,6 +426,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
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) => {
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 PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
//
defineOptions({ name: 'ProductreceiptRequestMain' })
@ -152,6 +153,7 @@ const buttondataTable = ref([{
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductreceiptRequestDetailApi.getProductreceiptRequestDetailPage
})
@ -263,6 +265,7 @@ const butttondata = (row) => {
hasPermi: '',
link: true, //
},
defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:productreceipt-request-main:delete'}), //
]
}
@ -405,6 +408,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
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 () => {
getList()

Loading…
Cancel
Save