Browse Source

生产外入库申请:创建标签后,选择单据添加物料号,保存后再次创建标签 失败

intex_online20250327
叶佳兴 2 weeks ago
parent
commit
3791d4d6f8
  1. 133
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  2. 24
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts
  3. 1770
      src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts
  4. 2
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue

133
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue

@ -92,6 +92,9 @@
<Detail <Detail
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
:allSchemas="UnplannedreceiptRequestMain.allSchemas" :allSchemas="UnplannedreceiptRequestMain.allSchemas"
:detailAllSchemas="UnplannedreceiptRequestDetail.allSchemas" :detailAllSchemas="UnplannedreceiptRequestDetail.allSchemas"
:detailAllSchemasRules="UnplannedreceiptRequestDetailRules" :detailAllSchemasRules="UnplannedreceiptRequestDetailRules"
@ -281,7 +284,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
tfk['itemCode'] = item['code'] tfk['itemCode'] = item['code']
tfk['uom'] = item['uom'] tfk['uom'] = item['uom']
tfk['validityDays'] = item['validityDays'] tfk['validityDays'] = item['validityDays']
tfk['isEnableBuy'] = val[0]['enableBuy'] tfk['isEnableBuy'] = val[0]['enableBuy']
tableData.value.push(tfk) tableData.value.push(tfk)
}) })
} else if (formField === 'costcentreCode') { } else if (formField === 'costcentreCode') {
@ -554,7 +557,7 @@ const buttonTableClick = async (val, row) => {
// //
tableObject.loading = true tableObject.loading = true
try { try {
let isCreateLabel = false let isCreateLabel = false
await PackageApi.getPackagePage({ await PackageApi.getPackagePage({
requestNumber: row.number requestNumber: row.number
}).then((res) => { }).then((res) => {
@ -564,7 +567,7 @@ const buttonTableClick = async (val, row) => {
}) })
if (isCreateLabel) { if (isCreateLabel) {
message.warning('已创建过标签!!!') message.warning('已创建过标签!!!')
tableObject.loading = false tableObject.loading = false
return return
} }
console.log('列表-操作按钮事件-创建标签') console.log('列表-操作按钮事件-创建标签')
@ -579,7 +582,7 @@ const buttonTableClick = async (val, row) => {
} }
// //
// dialogVisible.value = true // dialogVisible.value = true
tableObject.loading = false tableObject.loading = false
formLabelRef.value.open('create', row) formLabelRef.value.open('create', row)
console.log(detailListTableColumns.tableFormColumns) console.log(detailListTableColumns.tableFormColumns)
detatableData.tableList.map((item) => { detatableData.tableList.map((item) => {
@ -631,11 +634,10 @@ const buttonTableClick = async (val, row) => {
} }
}) })
}) })
}finally { } finally {
tableObject.loading = false tableObject.loading = false
} }
} }
} }
/** 关闭按钮操作 */ /** 关闭按钮操作 */
@ -866,7 +868,7 @@ const submitForm = async (formType, submitData) => {
try { try {
let newVal = data.subList.some((item) => item.isEnableBuy == 'TRUE') let newVal = data.subList.some((item) => item.isEnableBuy == 'TRUE')
let newVal1 = data.subList.some((item) => item.isEnableBuy == 'FALSE') let newVal1 = data.subList.some((item) => item.isEnableBuy == 'FALSE')
console.log(newVal,newVal1) console.log(newVal, newVal1)
if (newVal && newVal1) { if (newVal && newVal1) {
message.warning('不能同时选择可制造和可采购的物料') message.warning('不能同时选择可制造和可采购的物料')
return return
@ -955,25 +957,29 @@ const submitFormLabel = async (formType, data) => {
try { try {
formLabelRef.value.formLoading = true formLabelRef.value.formLoading = true
detatableData.tableList.forEach(async (item) => { detatableData.tableList.forEach(async (item) => {
const unitConversion = await UnitConversionApi.getUnitConversionByCode(item.itemCode); const unitConversion = await UnitConversionApi.getUnitConversionByCode(item.itemCode)
let convertRate = 1// let convertRate = 1 //
let purchaseUom = item.uom// let purchaseUom = item.uom //
let purchaseStdQty// let purchaseStdQty //
if(unitConversion!=null){ if (unitConversion != null) {
if(unitConversion.convertRate!=null&&unitConversion.convertRate!='' && unitConversion.convertRate!=0){ if (
convertRate = unitConversion.convertRate; unitConversion.convertRate != null &&
unitConversion.convertRate != '' &&
unitConversion.convertRate != 0
) {
convertRate = unitConversion.convertRate
} }
if(unitConversion.purchaseUom!=null&&unitConversion.purchaseUom!='' ){ if (unitConversion.purchaseUom != null && unitConversion.purchaseUom != '') {
purchaseUom = unitConversion.purchaseUom; purchaseUom = unitConversion.purchaseUom
} }
} }
let purchaseQty = (item.qty / convertRate).toFixed(5);// let purchaseQty = (item.qty / convertRate).toFixed(5) //
purchaseStdQty = (item.packQty / convertRate).toFixed(5);// purchaseStdQty = (item.packQty / convertRate).toFixed(5) //
item.purchaseQty = purchaseQty;// item.purchaseQty = purchaseQty //
item.convertRate = convertRate;// item.convertRate = convertRate //
item.purchaseStdQty = purchaseStdQty;// item.purchaseStdQty = purchaseStdQty //
item.purchaseUom = purchaseUom;// item.purchaseUom = purchaseUom //
console.log('item======================',item) console.log('item======================', item)
await PackageApi.createPackageLabel(item) await PackageApi.createPackageLabel(item)
.then((res) => { .then((res) => {
isCreateLabel.value = true isCreateLabel.value = true
@ -1067,49 +1073,68 @@ const labelPrint = async (row) => {
try { try {
await PackageApi.getPackagePage({ await PackageApi.getPackagePage({
requestNumber: row.number requestNumber: row.number
}).then((res) => {
if (res.list.length > 0) {
isCreateLabel.value = true
} else {
isCreateLabel.value = false
}
}).catch((err) => {
isCreateLabel.value = false
console.log(err)
}) })
.then((res) => {
if (res.list.length > 0) {
isCreateLabel.value = true
} else {
isCreateLabel.value = false
}
})
.catch((err) => {
isCreateLabel.value = false
console.log(err)
})
// //
if (isCreateLabel.value) { if (isCreateLabel.value) {
// labelPrint(row) // labelPrint(row)
await UnplannedreceiptRequestDetailApi.getDetailList(row.masterId).then(async (res) => { await UnplannedreceiptRequestDetailApi.getDetailList(row.masterId).then(async (res) => {
if (res.length > 0) { if (res.length > 0) {
const itemType = res.some((item) => item.itemType == '可采购' && item.itemBasicType =='TOOL')// const itemType = res.some(
const itemType2 = res.some((item) => item.itemType == '可采购' && item.itemBasicType !='TOOL') (item) => item.itemType == '可采购' && item.itemBasicType == 'TOOL'
) //
const itemType2 = res.some(
(item) => item.itemType == '可采购' && item.itemBasicType != 'TOOL'
)
const itemType1 = res.some((item) => item.itemType == '可制造') const itemType1 = res.some((item) => item.itemType == '可制造')
if (itemType) { if (itemType) {
window.open( BASE_URL + '/jmreport/view/1028102732077142016?token=' + getAccessToken() + '&request_number=' + row.number ) window.open(
BASE_URL +
'/jmreport/view/1028102732077142016?token=' +
getAccessToken() +
'&request_number=' +
row.number
)
} }
if (itemType2) { if (itemType2) {
window.open( BASE_URL + '/jmreport/view/1016234988731322368?token=' + getAccessToken() + '&request_number=' + row.number ) window.open(
BASE_URL +
'/jmreport/view/1016234988731322368?token=' +
getAccessToken() +
'&request_number=' +
row.number
)
}
if (itemType1) {
// window.open(src.value + '&request_number=' + row.number)
await PackageApi.batchPrintingLableForYT(row.number)
.then((res) => {
console.log(res)
const src = ref(
BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()
)
window.open(src.value + '&asn_number=' + res)
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
} }
if (itemType1) {
// window.open(src.value + '&request_number=' + row.number)
await PackageApi.batchPrintingLableForYT(row.number).then((res) => {
console.log(res)
const src = ref(
BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()
)
window.open(src.value + '&asn_number=' + res)
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
} }
} })
}) } else {
} else { message.warning('请先创建标签')
message.warning('请先创建标签') }
}
} finally { } finally {
tableObject.loading = false tableObject.loading = false
} }

24
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

@ -1423,18 +1423,18 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, },
{ // {
label: '操作', // label: '操作',
field: 'action', // field: 'action',
isDetail: false, // isDetail: false,
hiddenInMain:true, // hiddenInMain:true,
isForm: false , // isForm: false ,
table: { // table: {
width: 150, // width: 150,
fixed: 'right' // fixed: 'right'
}, // },
isTableForm:false, // isTableForm:false,
} // }
])) ]))
function validateQty(rule, value, callback) { function validateQty(rule, value, callback) {
if (value>0) { if (value>0) {

1770
src/views/wms/issueManage/repleinsh/repleinshRequestMain/repleinshRequestMain.data.ts

File diff suppressed because it is too large

2
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/index.vue

@ -212,7 +212,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierinvoice-record-main:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:supplierinvoice-record-main:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), // // defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //

Loading…
Cancel
Save