Browse Source

计划外入库创建标签开发完成

master
zhaoxuebing 12 months ago
parent
commit
3434a56930
  1. 5
      src/api/wms/unplannedreceiptRequestDetail/index.ts
  2. 48
      src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts
  3. 173
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  4. 430
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

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

@ -67,3 +67,8 @@ export const exportUnplannedreceiptRequestDetail = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/unplannedreceipt-request-detail/get-import-template' })
}
// 创建包装信息后更新子表数据packingNumber
export const updateDetailPackingNumber = async (id: number, number) => {
return await request.put({ url: '/wms/unplannedreceipt-request-detail/updateDetailPackingNumber?id=' + id + '&number=' + number })
}

48
src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts

@ -164,7 +164,12 @@ export const TransferissueRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage
searchPage: WarehouseApi.getWarehousePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
form: {
// labelMessage: '信息提示说明!!!',
@ -677,6 +682,21 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
disabled: true,
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
}
},
{
label: '到库位代码',
field: 'toLocationCode',
@ -690,7 +710,16 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.getLocationPage
searchPage: LocationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'warehouseCode',
value: 'toWarehouseCode',
isMainValue: true,
}]
},
form: {
// labelMessage: '信息提示说明!!!',
@ -713,21 +742,6 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
}
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
}
},
{
label: '从货主代码',
field: 'fromOwnerCode',

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

@ -71,6 +71,21 @@
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<!-- 创建标签 -->
<BasicForm
ref="formLabelRef"
@success="getList"
:tableAllSchemas="detailListTableColumns"
:tableFormRules="UnplannedreceiptRequestDetailLabelRules"
:tableData="detatableData.tableList"
:isBusiness="true"
:isShowButton="false"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitFormLabel"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/unplannedreceipt-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
@ -78,10 +93,24 @@
<script setup lang="ts">
import download from '@/utils/download'
import { UnplannedreceiptRequestMain,UnplannedreceiptRequestMainRules,UnplannedreceiptRequestDetail,UnplannedreceiptRequestDetailRules } from './unplannedreceiptRequestMain.data'
import {
UnplannedreceiptRequestMain,
UnplannedreceiptRequestMainRules,
UnplannedreceiptRequestDetail,
UnplannedreceiptRequestDetailRules,
UnplannedreceiptRequestDetailLabelRules, UnplannedreceiptRequestDetailLabel
} from './unplannedreceiptRequestMain.data'
import * as UnplannedreceiptRequestMainApi from '@/api/wms/unplannedreceiptRequestMain'
import * as UnplannedreceiptRequestDetailApi from '@/api/wms/unplannedreceiptRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import {
ProductionreturnRequestDetailLabel, ProductionreturnRequestDetailLabelRules
} from "@/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data";
import * as ProductionreturnRequestDetailApi from "@/api/wms/productionreturnRequestDetail";
import * as ItembasicApi from "@/api/wms/itembasic";
import * as PackageApi from "@/api/wms/package";
import {UnplannedreceiptRequestDetailVO} from "@/api/wms/unplannedreceiptRequestDetail";
import { formatTime } from '@/utils/index'
//
defineOptions({ name: 'UnplannedreceiptRequestMain' })
@ -94,6 +123,15 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnplannedreceiptRequestMain.allSchemas.tableColumns)
//
const detailListTableColumns = UnplannedreceiptRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -104,17 +142,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => {
if (type == 'tableForm') {
//
if(formField == 'toLocationCode'){
row['toLocationCode'] = val[0]['code']
}
if(formField == 'itemCode'){
row['itemCode'] = val[0]['code']
row['uom'] = val[0]['uom']
}
row[formField] = val[0][searchField]
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
row['batch'] = val[0]['batch']
row['altBatch'] = val[0]['altBatch']
row['arriveDate'] = val[0]['arriveDate']
row['produceDate'] = val[0]['produceDate']
row['expireDate'] = val[0]['expireDate']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['toLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode']
} else {
const setV = {}
setV[formField] = val[0][searchField]
@ -127,16 +162,13 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['packingNumber'] = val[0]['packingNumber']
setV['containerNumber'] = val[0]['containerNumber']
setV['batch'] = val[0]['batch']
setV['altBatch'] = val[0]['altBatch']
setV['arriveDate'] = val[0]['arriveDate']
setV['produceDate'] = val[0]['produceDate']
setV['expireDate'] = val[0]['expireDate']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['toLocationCode'] = val[0]['locationCode']
setV['itemCode'] = val[0]['itemCode']
if(formField == 'toLocationCode'){
setV['toLocationCode'] = val[0]['code']
}
if(formField == 'itemCode'){
setV['itemCode'] = val[0]['code']
setV['uom'] = val[0]['uom']
}
formRef.setValues(setV)
})
}
@ -206,11 +238,22 @@ const butttondata = (row) => {
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:unplannedreceipt-request-main:handle'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:unplannedreceipt-request-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:unplannedreceipt-request-main:delete'}), //
{
label: '创建标签',
name: 'cjbq',
hide: isShowMainButton(row,['3']),
type: 'primary',
icon: '',
color: '',
hasPermi: '',
link: true, //
},
]
}
// -
const buttonTableClick = async (val, row) => {
console.log("val",val)
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
handleClose(row.id)
@ -233,6 +276,66 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if( val == 'cjbq'){//
console.log("列表-操作按钮事件-创建标签")
detatableData.params = {
masterId:row.id
}
await getDetailList()
//
if (detatableData.tableList[0].packingNumber) {
message.warning('已创建过标签!!!')
return
}
//
// dialogVisible.value = true
formLabelRef.value.open('create', row)
detatableData.tableList.map((item) => {
// 线
ItembasicApi.getItembasicPage({
pageSize: 10,
pageNo: 1,
code: item.itemCode,
sort: '',
by: 'ASC',
}).then(res => {
if (res.list.length > 0) {
//
if (res.list[0].type == "RAW") {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
UnplannedreceiptRequestDetailLabelRules.productionLineCodePackage[0].required = false
}
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
UnplannedreceiptRequestDetailLabelRules.supplierItemCode[0].required = true
}
})
} else {
// tableform
detailListTableColumns.tableFormColumns.map(item => {
if(item.field == 'supplierItemCode') {
item.tableForm.isInpuFocusShow = false
item.tableForm.disabled = true
UnplannedreceiptRequestDetailLabelRules.supplierItemCode[0].required = false
}
if(item.field == 'productionLineCodePackage') {
item.tableForm.isInpuFocusShow = true
item.tableForm.disabled = false
UnplannedreceiptRequestDetailLabelRules.productionLineCodePackage[0].required = true
}
})
}
} else {
message.warning('没有查询到物品代码:【' + item.itemCode + '】')
return
}
})
})
}
}
@ -349,7 +452,9 @@ const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
let tfk = JSON.parse(JSON.stringify(tableFormKeys))
tfk.batch = formatTime(new Date(), 'yyyyMMdd')
tableData.value.push(tfk)
}
//
const handleDeleteTable = (item, index) => {
@ -401,6 +506,30 @@ const searchFormClick = (searchData) => {
getList() //
}
//
const submitFormLabel = async (formType, data) => {
try {
detatableData.tableList.forEach(async (item) => {
await PackageApi.createPackageLabel(item).then(res => {
console.log("BBBBB",res)
if (res) {
//
UnplannedreceiptRequestDetailApi.updateDetailPackingNumber(res.id,res.number)
}
isCreateLabel.value = true
message.success('创建标签成功')
}).catch(err => {
isCreateLabel.value = false
console.log(err)
message.error('创建标签失败')
})
})
} finally {
formLabelRef.value.formLoading = false
formLabelRef.value.dialogVisible = false
}
}
/** 初始化 **/
onMounted(async () => {
getList()

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

@ -5,6 +5,11 @@ import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -18,6 +23,18 @@ const queryParams = {
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
import {Location} from "@/views/wms/basicDataManage/factoryModeling/location/location.data";
import * as LocationApi from "@/api/wms/location";
import {
Productionlineitem
} from "@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data";
import * as ProductionlineitemApi from "@/api/wms/productionlineitem";
import {
Supplieritem
} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data";
import * as SupplieritemApi from "@/api/wms/supplieritem";
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
@ -104,7 +121,30 @@ export const UnplannedreceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
isForm: false,
tableForm: {
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '到库位类型范围',
@ -376,8 +416,37 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
table: {
width: 150
},
tableForm: {
disabled: true
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码',// 输入框占位文本
searchField: 'code',// 查询弹窗赋值字段
searchTitle: '物品基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
},
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物品代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物品基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
@ -429,23 +498,7 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage
}
disabled: true
}
},
{
@ -501,7 +554,41 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
width: 150
},
tableForm: {
disabled: true
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'warehouseCode',
value: 'toWarehouseCode',
isMainValue: true,
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'warehouseCode',
value: 'toWarehouseCode',
isMainValue: true,
}]
}
}
},
{
@ -515,21 +602,9 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
width: 150
},
tableForm: {
disabled: true,
type: 'Select'
}
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '到货日期',
field: 'arriveDate',
@ -550,7 +625,6 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
}
},
tableForm: {
disabled: true,
type: 'FormDateTime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -576,7 +650,6 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
}
},
tableForm: {
disabled: true,
type: 'FormDateTime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -602,7 +675,6 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
}
},
tableForm: {
disabled: true,
type: 'FormDateTime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
@ -730,12 +802,6 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
//表单校验
export const UnplannedreceiptRequestDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
arriveDate: [
{ required: true, message: '请选择到货日期', trigger: 'change' }
],
@ -755,3 +821,283 @@ export const UnplannedreceiptRequestDetailRules = reactive({
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
})
/**
* @returns {Array} 退
*/
export const UnplannedreceiptRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCodePackage',
sort: 'custom',
table: {
width: 150
},
tableForm:{
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',
isMainValue: true
}]
}
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
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: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源工位代码',
field: 'workStationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '来源库位代码',
field: 'fromLocationCode',
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: 'number',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
}
]))
//表单校验
export const UnplannedreceiptRequestDetailLabelRules = reactive({
supplierItemCode: [
{ required: true, message: '请选择供应商', trigger: 'change' }
],
productionLineCodePackage: [
{ required: true, message: '请选择生产线', trigger: 'change' }
]
})

Loading…
Cancel
Save