Browse Source

备货任务前端页面按钮展示

master_hella_20240701
chenfang 8 months ago
parent
commit
cf5a8ed18c
  1. 2
      .env.development
  2. 20
      src/api/wms/stockupMainJob/index.ts
  3. 278
      src/views/wms/deliversettlementManage/stockup/stockupMainJob/index.vue
  4. 318
      src/views/wms/deliversettlementManage/stockup/stockupMainJob/stockupMainJob.data.ts
  5. 2
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

2
.env.development

@ -4,7 +4,7 @@ NODE_ENV=development
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://localhost:12080'
VITE_BASE_URL='http://192.168.0.113:12080'
# 上传路径
VITE_UPLOAD_URL='http://localhost:12080/admin-api/infra/file/upload'

20
src/api/wms/stockupMainJob/index.ts

@ -87,4 +87,24 @@ export const exportStockupMainJob = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/stockup-main-job/get-import-template' })
}
// 承接发货任务 Excel
export const acceptStockupMainJob = async (id) => {
return await request.put({ url: `/wms/stockup-main-job/accept?id=` + id })
}
// 取消承接发货任务 Excel
export const abandonStockupMainJob = async (id) => {
return await request.put({ url: `/wms/stockup-main-job/abandon?id=` + id })
}
// 关闭发货任务主 Excel
export const closeStockupMainJob = async (id) => {
return await request.put({ url: `/wms/stockup-main-job/close?id=` + id })
}
// 执行发货任务主
export const executeStockupMainJob = async (data: StockupMainJobVO) => {
return await request.put({ url: `/wms/stockup-main-job/execute`, data })
}

278
src/views/wms/deliversettlementManage/stockup/stockupMainJob/index.vue

@ -27,43 +27,53 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
ref="formRef"
@success="getList"
:rules="StockupMainJobRules"
:formAllSchemas="StockupMainJob.allSchemas"
:apiUpdate="StockupMainJobApi.updateStockupMainJob"
:apiCreate="StockupMainJobApi.createStockupMainJob"
:searchTableParams="searchTableParams"
:tableAllSchemas="StockupDetailJob.allSchemas"
:tableFormRules="StockupDetailJobRules"
:apiUpdate="StockupJobMainApi.updateStockupMainJob"
:apiCreate="StockupJobMainApi.createStockupMainJob"
:isBusiness="true"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainJob.allSchemas" />
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="StockupMainJob.allSchemas"
:detailAllSchemas="StockupDetailJob.allSchemas"
:detailAllSchemasRules="StockupDetailJobRules"
:searchTableParams="searchTableParams"
:apiPage="StockupJobDetailApi.getStockupDetailJobPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { StockupMainJob,StockupMainJobRules } from './stockupMainJob.data'
import * as StockupMainJobApi from '@/api/wms/stockupMainJob'
import { StockupMainJob,StockupMainJobRules,StockupDetailJob,StockupDetailJobRules } from './stockupMainJob.data'
import * as StockupJobMainApi from '@/api/wms/stockupMainJob'
import * as StockupJobDetailApi from '@/api/wms/stockupDetailJob'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'StockupMainJob' })
//
defineOptions({ name: 'StockupJobMain' })
const message = useMessage() //
const { t } = useI18n() //
@ -73,22 +83,52 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(StockupMainJob.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
//row[formField] = val[0][searchField]
//row['poLine'] = val[0]['poLine']
//row['batch'] = val[0]['toBatch']
//row['altBatch'] = val[0]['altBatch']
//row['itemCode'] = val[0]['itemCode']
//row['itemName'] = val[0]['itemName']
//row['itemDesc1'] = val[0]['itemDesc1']
//row['itemDesc2'] = val[0]['itemDesc2']
//row['projectCode'] = val[0]['projectCode']
//row['qty'] = val[0]['qty']
//row['uom'] = val[0]['uom']
} else {
const setV = {}
setV[formField] = val[0][searchField]
//setV['ppNumber'] = val[0]['ppNumber']
//setV['supplierCode'] = val[0]['supplierCode']
formRef.setValues(setV)
}
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: StockupMainJobApi.getStockupMainJobPage //
getListApi: StockupJobMainApi.getStockupMainJobPage //
})
//
@ -96,9 +136,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainJob:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainJob:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainJob:export'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockup-job-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -114,78 +152,158 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'export') { //
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainJob:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainJob:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
// -
const butttondata = (row) => {
return [
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), //
]
}
// form
const formsSuccess = async (formType,data) => {
var isHave =StockupMainJob.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await StockupMainJobApi.createStockupMainJob(data)
message.success(t('common.createSuccess'))
} else {
await StockupMainJobApi.updateStockupMainJob(data)
message.success(t('common.updateSuccess'))
// -
const buttonTableClick = async (val, row) => {
 if (val == 'mainJobExe') { //
    let aaa = {
"id": 6,
"requestNumber": "REQ4520240313-0003",
"deliverPlanNumber": null,
"fromWarehouseCode": "CKV",
"toWarehouseCode": "CKV",
"details": null,
"requestTime": null,
"requestDueTime": null,
"status": "1",
"expiredTime": null,
"concurrencyStamp": "1",
"jobStageStatus": null,
"priority": null,
"priorityincrement": null,
"departmentCode": null,
"userGroupCode": null,
"acceptUserId": null,
"acceptUserName": null,
"acceptTime": null,
"completeUserId": null,
"completeUserName": null,
"completeTime": null,
"fromAreaTypes": "FG",
"toAreaTypes": "CUST",
"number": "JOB3220240314-0006",
"businessType": "Stockup",
"remark": null,
"extraProperties": null,
"siteId": null,
"autoComplete": "FALSE",
"allowModifyLocation": "FALSE",
"allowModifyQty": "TRUE",
"allowBiggerQty": "TRUE",
"allowSmallerQty": "TRUE",
"allowModifyInventoryStatus": "TRUE",
"allowContinuousScanning": "TRUE",
"allowPartialComplete": "TRUE",
"ruleUserId": null,
"allowModifyBatch": "FALSE",
"allowModifyPackingNumber": "FALSE",
"fromAreaCodes": "KQV2",
"toAreaCodes": "CUST",
"serialNumber": "0",
"inInventoryStatuses": "OK",
"outInventoryStatuses": "OK",
"createTime": null,
"subList": [{
"id": 1,
"packingNumber": null,
"batch": "2024021801",
"inventoryStatus": "OK",
"ownerCode": null,
"containerNumber": null,
"fromLocationCode": "FG",
"toLocationCode": "RAW",
"itemCode": "FOG-LAMP-RIGHT",
"itemName": "HL后雾灯(新)-右\r\n",
"itemDesc1": "HL后雾灯(新)-右\r\n",
"itemDesc2": "HL后雾灯(新)-右\r\n",
"projectCode": "PJ001",
"qty": 1,
"uom": "EA",
"masterId": 6,
"number": "JOB3220240314-0006",
"remark": null,
"siteId": "",
"createTime": null,
"toPackingNumber": null,
"toContainerNumber": null,
"toBatch": null,
"handleQty": null,
"toInventoryStatus": null,
recordList: [{
handleQty: 10,
toPackingNumber: '12',
toContainerNumber: '001',
toBatch: '21',
toInventoryStatus: 'OK',
toLocationCode: 'WIP',
supplierCode: '31213',
},{
handleQty: 22,
toPackingNumber: 'M20230421000005',
toContainerNumber: '001',
toBatch: '20230808',
toInventoryStatus: 'OK',
toLocationCode: 'FG',
supplierCode: '31213',
}]
}]
}
handleHandle(aaa)
console.log('列表-操作按钮事件-执行')
} else if (val == 'mainJobAba') { //
StockupJobMainApi.abandonStockupMainJob(row.id)
} else if (val == 'mainJobClo') { //
StockupJobMainApi.closeStockupMainJob(row.id)
} else if (val == 'mainJobAcc') { //
StockupJobMainApi.acceptStockupMainJob(row.id)
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainJob')
detailRef.value.openDetail(row, titleName, titleValue,'jobStockupMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
const handleHandle = async (data) => {
try {
//
await message.delConfirm()
//
await StockupMainJobApi.deleteStockupMainJob(id)
message.success(t('common.delSuccess'))
//
await message.confirm(t('common.confirmHandle'))
await StockupJobMainApi.executeStockupMainJob(data)
message.success(t('common.handleSuccess'))
await getList()
} catch {}
}
@ -198,7 +316,7 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await StockupMainJobApi.exportStockupMainJob(tableObject.params)
const data = await StockupJobMainApi.exportStockupMainJob(tableObject.params)
download.excel(data, '备货任务主.xlsx')
} catch {
} finally {

318
src/views/wms/deliversettlementManage/stockup/stockupMainJob/stockupMainJob.data.ts

@ -7,47 +7,53 @@ export const StockupMainJobRules = reactive({
export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '发货计划单号',
field: 'deliverPlanNumber',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '明细',
field: 'details',
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -69,7 +75,6 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
field: 'requestDueTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -86,21 +91,13 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '过期时间',
field: 'expiredTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -117,71 +114,24 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
},
{
label: '状态',
field: 'jobStageStatus',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '优先级',
field: 'priority',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '优先级增量',
field: 'priorityincrement',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true,
},
{
label: '用户组',
field: 'userGroupCode',
sort: 'custom',
isSearch: true,
},
{
label: '承接人用户ID',
field: 'acceptUserId',
sort: 'custom',
isSearch: true,
},
{
label: '承接人用户名',
field: 'acceptUserName',
sort: 'custom',
isSearch: true,
},
{
label: '承接时间',
field: 'acceptTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -198,24 +148,16 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
}
},
},
{
label: '完成人用户ID',
field: 'completeUserId',
sort: 'custom',
isSearch: true,
},
{
label: '完成人用户名',
field: 'completeUserName',
sort: 'custom',
isSearch: true,
},
{
label: '完成时间',
field: 'completeTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -236,25 +178,16 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '从库区类型范围',
field: 'fromAreaTypes',
sort: 'custom',
isSearch: true,
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
isSearch: true,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
@ -263,14 +196,106 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '自动完成',
field: 'autoComplete',
sort: 'custom',
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
sort: 'custom',
},
{
label: '允许修改数量',
field: 'allowModifyQty',
sort: 'custom',
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
sort: 'custom',
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
sort: 'custom',
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
sort: 'custom',
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
sort: 'custom',
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
sort: 'custom',
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
sort: 'custom',
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
},
{
label: '工作流流水号',
field: 'serialNumber',
sort: 'custom',
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -282,119 +307,145 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const StockupDetailJobRules = reactive({
})
export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '地点ID',
field: 'siteId',
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true,
},
{
label: '自动完成',
field: 'autoComplete',
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '允许修改数量',
field: 'allowModifyQty',
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
isSearch: true,
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
label: '器具号',
field: 'containerNumber',
sort: 'custom',
isSearch: true,
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isSearch: true,
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
label: '物品名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
},
{
label: '权限所属人员id',
field: 'ruleUserId',
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
isSearch: true,
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: true,
},
{
label: '工作流流水号',
field: 'serialNumber',
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
@ -406,3 +457,4 @@ export const StockupMainJob = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))

2
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

@ -434,7 +434,7 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isForm: false,
table: {
width: 150,
width: 300,
fixed: 'right'
}
}

Loading…
Cancel
Save