Browse Source

物料变更创建/打印标签

hella_online_20240829
chenfang 4 months ago
parent
commit
810e1845c2
  1. 4
      src/api/wms/productionlineitem/index.ts
  2. 5
      src/api/wms/relegateRequestMain/index.ts
  3. 9
      src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts
  4. 143
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue
  5. 288
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts

4
src/api/wms/productionlineitem/index.ts

@ -72,3 +72,7 @@ export const importTemplate = () => {
export const getProductionLineCodelistByCodes = async (params) => { export const getProductionLineCodelistByCodes = async (params) => {
return await request.get({ url: `/wms/productionlineitem/listByCodes`, params }) return await request.get({ url: `/wms/productionlineitem/listByCodes`, params })
} }
export const selectItemCodeToProductionLineCode = async (itemCode: String) => {
return await request.get({ url: `/wms/productionlineitem/selectItemCodeToProductionLineCode?itemCode=` + itemCode })
}

5
src/api/wms/relegateRequestMain/index.ts

@ -96,3 +96,8 @@ export const agree = (id) => {
export const handle = (id) => { export const handle = (id) => {
return request.put({ url: '/wms/relegate-request-main/handle?id=' + id }) return request.put({ url: '/wms/relegate-request-main/handle?id=' + id })
} }
// 创建标签
export const relegateCreateLabel = async (data: RelegateRequestMainVO) => {
return await request.post({ url: `/wms/relegate-request-main/relegateCreateLabel`, data })
}

9
src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts

@ -6,6 +6,7 @@ import { Itembasic } from '../itembasic/itembasic.data'
// 表单校验 // 表单校验
export const ProductionitemcodeSpareitemcodeRules = reactive({ export const ProductionitemcodeSpareitemcodeRules = reactive({
productionItemCode: [required], productionItemCode: [required],
spareItemCode: [required],
available: [required], available: [required],
}) })
@ -33,6 +34,10 @@ export const ProductionitemcodeSpareitemcode = useCrudSchemas(reactive<CrudSchem
key: 'category', key: 'category',
value: 'LCJ', value: 'LCJ',
isMainValue: false isMainValue: false
},{
key: 'type',
value: 'CCP',
isMainValue: false
}], }],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',
@ -68,6 +73,10 @@ export const ProductionitemcodeSpareitemcode = useCrudSchemas(reactive<CrudSchem
key: 'category', key: 'category',
value: 'BJ', value: 'BJ',
isMainValue: false isMainValue: false
},{
key: 'type',
value: 'CCP',
isMainValue: false
}], }],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',

143
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

@ -67,7 +67,7 @@
ref="formLabelRef" ref="formLabelRef"
@success="getList" @success="getList"
:tableAllSchemas="detailListTableColumns" :tableAllSchemas="detailListTableColumns"
:tableFormRules="ProductionreturnRequestDetailLabelRules" :tableFormRules="RelegateRequestDetailLabelRules"
:tableData="detatableData.tableList" :tableData="detatableData.tableList"
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="false"
@ -80,11 +80,13 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/relegate-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" /> @success="importSuccess" />
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules } from './relegateRequestMain.data' import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules,RelegateRequestDetailLabel,RelegateRequestDetailLabelRules } from './relegateRequestMain.data'
import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain' import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain'
import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail' import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
@ -92,12 +94,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import { ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from '../../../../productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data'
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode' import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode'
import * as PackageApi from "@/api/wms/package"; import * as PackageApi from "@/api/wms/package";
import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain' import { getAccessToken } from '@/utils/auth'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules, SupplierdeliverRequestPackage } from '@/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts' import { getJmreportBaseUrl } from '@/utils/systemParam'
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail' import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
defineOptions({ name: 'RelegateRequestMain' }) defineOptions({ name: 'RelegateRequestMain' })
@ -111,12 +112,12 @@ routeName.value = route.name
const tableColumns = ref([...RelegateRequestMain.allSchemas.tableColumns, ...RelegateRequestDetail.allSchemas.tableMainColumns]) const tableColumns = ref([...RelegateRequestMain.allSchemas.tableColumns, ...RelegateRequestDetail.allSchemas.tableMainColumns])
const isShowButton = ref(true) const isShowButton = ref(true)
// //
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas const detailListTableColumns = RelegateRequestDetailLabel.allSchemas
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const labelType = ref('') // const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage getListApi: RelegateRequestDetailApi.getRelegateRequestDetailPage
}) })
const { getList:getDetailList } = detatableMethods const { getList:getDetailList } = detatableMethods
// //
@ -126,23 +127,53 @@ const submitFormLabel = async (formType, submitData) => {
data.id = data.masterId data.id = data.masterId
} }
try { try {
alert('做一下接口') // alert('')
// detatableData.tableList.forEach(async (item) => { console.log("aaaaa",data);
// item.toLocationCode = item.fromLocationCode data.subList=detatableData.tableList
// await PackageApi.createPackageLabel(item).then(() => { console.log("bbbbb",data);
// isCreateLabel.value = true // item.toLocationCode = item.fromLocationCode
// message.success('') await RelegateRequestMainApi.relegateCreateLabel(data).then(() => {
// }).catch(err => { isCreateLabel.value = true
// isCreateLabel.value = false message.success('创建标签成功')
// console.log(err) }).catch(err => {
// message.error('') isCreateLabel.value = false
// }) console.log(err)
// }) message.error('创建标签失败')
})
} finally { } finally {
formLabelRef.value.formLoading = false formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false formLabelRef.value.dialogVisible = false
} }
} }
//
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) {
labelPrint(row)
} else {
message.warning('请先创建标签')
}
}
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -159,7 +190,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['fromBatch'] = item['batch'] newRow['fromBatch'] = item['batch']
newRow['fromPackingNumber'] = item['packingNumber'] newRow['fromPackingNumber'] = item['packingNumber']
newRow['toBatch'] = item['batch'] newRow['toBatch'] = item['batch']
newRow['toPackingNumber'] = item['packingNumber']
newRow['fromLocationCode'] = item['locationCode'] newRow['fromLocationCode'] = item['locationCode']
newRow['inventoryStatus'] = item['inventoryStatus'] newRow['inventoryStatus'] = item['inventoryStatus']
tableData.value.push(newRow) tableData.value.push(newRow)
@ -376,7 +406,7 @@ const butttondata = (row,$index) => {
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true, //
} },defaultButtons.mainListPointBtn({hide:isShowMainButton(row,['3','6','8'])}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), // // defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-request-main:delete'}), //
] ]
} }
@ -475,6 +505,8 @@ const buttonTableClick = async (val, row) => {
// dialogVisible.value = true // dialogVisible.value = true
formLabelRef.value.open('create', row) formLabelRef.value.open('create', row)
detatableData.tableList.map((item) => { detatableData.tableList.map((item) => {
console.log(item);
// item.batch = '000000' // item.batch = '000000'
// 线 // 线
ItembasicApi.getItembasicPage({ ItembasicApi.getItembasicPage({
@ -492,27 +524,31 @@ const buttonTableClick = async (val, row) => {
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {
// itemColumns.tableForm.isInpuFocusShow = false // itemColumns.tableForm.isInpuFocusShow = false
// itemColumns.tableForm.disabled = true // itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false RelegateRequestDetailLabelRules.productionLineCodePackage[0].required = false
} }
if(itemColumns.field == 'supplierItemCode') { if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = true itemColumns.tableForm.isInpuFocusShow = true
itemColumns.tableForm.disabled = false itemColumns.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true RelegateRequestDetailLabelRules.supplierItemCode[0].required = true
} }
}) })
} else { } else {
// tableform // tableform
detailListTableColumns.tableFormColumns.map(itemColumns => { detailListTableColumns.tableFormColumns.map(async itemColumns => {
if(itemColumns.field == 'supplierItemCode') { if(itemColumns.field == 'supplierItemCode') {
itemColumns.tableForm.isInpuFocusShow = false itemColumns.tableForm.isInpuFocusShow = false
itemColumns.tableForm.disabled = true itemColumns.tableForm.disabled = true
ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false RelegateRequestDetailLabelRules.supplierItemCode[0].required = false
} }
if(itemColumns.field == 'productionLineCodePackage') { if(itemColumns.field == 'productionLineCodePackage') {
item.productionLineCodePackage = item.productionLineCode let res = await ProductionlineitemApi.selectItemCodeToProductionLineCode(item.itemCode)
// let res = ProductionlineitemApi.selectItemCodeToProductionLineCode(item.itemCode)
console.log(res,999999999999999999999);
console.log(res[0],999999999999999999999);
item.productionLineCodePackage = res[0].productionLineCode
// itemColumns.tableForm.isInpuFocusShow = true // itemColumns.tableForm.isInpuFocusShow = true
// itemColumns.tableForm.disabled = false // itemColumns.tableForm.disabled = false
ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true RelegateRequestDetailLabelRules.productionLineCodePackage[0].required = true
} }
}) })
} }
@ -523,6 +559,8 @@ const buttonTableClick = async (val, row) => {
}) })
}) })
}else if (val == 'point') { //
handlePoint(row)
} }
} }
@ -577,6 +615,34 @@ const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicRelegateRequestMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicRelegateRequestMain')
} }
const BASE_URL = getJmreportBaseUrl()
//
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
// let rows:any = []
// val.forEach(item=>{
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
// })
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(','))
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
@ -649,6 +715,27 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const searchTableRef = ref()
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.number}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList:getListPrint } = tableMethods
getListPrint()
tableObject.loading = false
const tableColumns = RelegateRequestDetailLabel.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

288
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts

@ -16,6 +16,9 @@ import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/l
import * as ItempackageApi from '@/api/wms/itempackage' import * as ItempackageApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode' import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { const queryParams = {
@ -289,7 +292,7 @@ export const RelegateRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 200, width: 250,
fixed: 'right' fixed: 'right'
}, },
isDetail:false isDetail:false
@ -509,17 +512,6 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
}, },
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
tableForm: {
disabled: true
},
table: {
width: 120
},
},
{ {
label: '到批次', label: '到批次',
field: 'toBatch', field: 'toBatch',
@ -726,9 +718,279 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
hiddenInMain:true, hiddenInMain:true,
table: { table: {
width: 200, width: 250,
fixed: 'right' fixed: 'right'
}, },
isTableForm: false isTableForm: false
} }
])) ]))
/**
* @returns {Array}
*/
export const RelegateRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCodePackage',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled: true
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
// searchField: 'productionLineCode', // 查询弹窗赋值字段
// searchTitle: '生产线物料关系信息', // 查询弹窗标题
// searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
// searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
// searchCondition:[{
// key: 'itemCode',
// value: 'itemCode',
// isMainValue: true
// }]
}
},
{
label: '供应商代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'supplierCode', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'itemCode',
value: 'itemCode',
message: '请填写物料代码!',
isMainValue: true
}]
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '包装规格1',
field: 'packUnit',
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packUnit',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItempackageApi.getItempackagingPageByProductreceipt,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
enterSearch:true,
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packUnit',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItempackageApi.getItempackagingPageByProductreceipt,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
},
{
label: '包装数量1',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true,
}
}
]))
//表单校验
export const RelegateRequestDetailLabelRules = reactive({
supplierItemCode: [
{ required: true, message: '请选择供应商', trigger: 'change' }
],
productionLineCodePackage: [
{ required: true, message: '请选择生产线', trigger: 'change' }
]
})
Loading…
Cancel
Save