|
@ -27,43 +27,53 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #code="{row}"> |
|
|
<template #number="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="formRef" |
|
|
@success="formsSuccess" |
|
|
@success="getList" |
|
|
:rules="StockupMainJobRules" |
|
|
:rules="StockupMainJobRules" |
|
|
:formAllSchemas="StockupMainJob.allSchemas" |
|
|
:formAllSchemas="StockupMainJob.allSchemas" |
|
|
:apiUpdate="StockupMainJobApi.updateStockupMainJob" |
|
|
:searchTableParams="searchTableParams" |
|
|
:apiCreate="StockupMainJobApi.createStockupMainJob" |
|
|
:tableAllSchemas="StockupDetailJob.allSchemas" |
|
|
|
|
|
:tableFormRules="StockupDetailJobRules" |
|
|
|
|
|
:apiUpdate="StockupJobMainApi.updateStockupMainJob" |
|
|
|
|
|
:apiCreate="StockupJobMainApi.createStockupMainJob" |
|
|
|
|
|
:isBusiness="true" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@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> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { StockupMainJob,StockupMainJobRules } from './stockupMainJob.data' |
|
|
import { StockupMainJob,StockupMainJobRules,StockupDetailJob,StockupDetailJobRules } from './stockupMainJob.data' |
|
|
import * as StockupMainJobApi from '@/api/wms/stockupMainJob' |
|
|
import * as StockupJobMainApi from '@/api/wms/stockupMainJob' |
|
|
|
|
|
import * as StockupJobDetailApi from '@/api/wms/stockupDetailJob' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
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 message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
@ -73,22 +83,52 @@ const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(StockupMainJob.allSchemas.tableColumns) |
|
|
const tableColumns = ref(StockupMainJob.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
|
|
const updataTableColumns = (val) => { |
|
|
|
|
|
tableColumns.value = val |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询列表页面参数设置 |
|
|
|
|
|
const searchTableParams = ref([ |
|
|
|
|
|
//{ |
|
|
|
|
|
// formField: 'productItemCode', |
|
|
|
|
|
// searchTableTitle: '物料信息', |
|
|
|
|
|
// searchTableAllSchemas: Itembasic.allSchemas, |
|
|
|
|
|
// searchTablePage: ItembasicApi.getItembasicPage |
|
|
|
|
|
//} |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
nextTick(() => { |
|
|
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 = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
//setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
|
|
//setV['supplierCode'] = val[0]['supplierCode'] |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
// 字段设置 更新主列表字段 |
|
|
|
|
|
const updataTableColumns = (val) => { |
|
|
|
|
|
tableColumns.value = val |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
// 子表新增的时候选择表格之后需要会显得字段 |
|
|
|
|
|
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
|
|
|
|
|
const Echo = [] |
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: StockupMainJobApi.getStockupMainJobPage // 分页接口 |
|
|
getListApi: StockupJobMainApi.getStockupMainJobPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
@ -96,9 +136,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainJob:create'}), // 新增 |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:stockup-job-main:export'}), // 导出 |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:stockupMainJob:import'}), // 导入 |
|
|
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainJob:export'}), // 导出 |
|
|
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
@ -114,78 +152,158 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'export') { // 导出 |
|
|
openForm('create') |
|
|
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
|
|
|
searchFormClick({ |
|
|
|
|
|
filters: tableObject.params.filters |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
|
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else { // 其他按钮 |
|
|
} else { // 其他按钮 |
|
|
console.log('其他按钮', item) |
|
|
console.log('其他按钮', item) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 根据状态返回该按钮是否显示 |
|
|
const butttondata = [ |
|
|
const isShowMainButton = (row,val) => { |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainJob:update'}), // 编辑 |
|
|
if (val.indexOf(row.status) > -1) { |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainJob:delete'}), // 删除 |
|
|
return false |
|
|
] |
|
|
} else { |
|
|
|
|
|
return true |
|
|
// 列表-操作按钮事件 |
|
|
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
|
|
openForm('update', row) |
|
|
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
|
|
handleDelete(row.id) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
// 列表-操作按钮 |
|
|
const basicFormRef = ref() |
|
|
const butttondata = (row) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
return [ |
|
|
basicFormRef.value.open(type, row) |
|
|
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) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
var isHave =StockupMainJob.allSchemas.formSchema.some(function (item) { |
|
|
if (val == 'mainJobExe') { // 执行 |
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
let aaa = { |
|
|
}); |
|
|
"id": 6, |
|
|
if(isHave){ |
|
|
"requestNumber": "REQ4520240313-0003", |
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
"deliverPlanNumber": null, |
|
|
message.error('失效时间要大于生效时间') |
|
|
"fromWarehouseCode": "CKV", |
|
|
return; |
|
|
"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', |
|
|
|
|
|
}] |
|
|
|
|
|
}] |
|
|
} |
|
|
} |
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
handleHandle(aaa) |
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
console.log('列表-操作按钮事件-执行') |
|
|
if (formType === 'create') { |
|
|
} else if (val == 'mainJobAba') { // 放弃 |
|
|
await StockupMainJobApi.createStockupMainJob(data) |
|
|
StockupJobMainApi.abandonStockupMainJob(row.id) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else if (val == 'mainJobClo') { // 关闭 |
|
|
} else { |
|
|
StockupJobMainApi.closeStockupMainJob(row.id) |
|
|
await StockupMainJobApi.updateStockupMainJob(data) |
|
|
} else if (val == 'mainJobAcc') { // 承接 |
|
|
message.success(t('common.updateSuccess')) |
|
|
StockupJobMainApi.acceptStockupMainJob(row.id) |
|
|
} |
|
|
} |
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
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, 'basicStockupMainJob') |
|
|
detailRef.value.openDetail(row, titleName, titleValue,'jobStockupMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
const handleHandle = async (data) => { |
|
|
const handleDelete = async (id: number) => { |
|
|
|
|
|
try { |
|
|
try { |
|
|
// 删除的二次确认 |
|
|
await message.confirm(t('common.confirmHandle')) |
|
|
await message.delConfirm() |
|
|
await StockupJobMainApi.executeStockupMainJob(data) |
|
|
// 发起删除 |
|
|
message.success(t('common.handleSuccess')) |
|
|
await StockupMainJobApi.deleteStockupMainJob(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
await getList() |
|
|
} catch {} |
|
|
} catch {} |
|
|
} |
|
|
} |
|
@ -198,7 +316,7 @@ const handleExport = async () => { |
|
|
await message.exportConfirm() |
|
|
await message.exportConfirm() |
|
|
// 发起导出 |
|
|
// 发起导出 |
|
|
exportLoading.value = true |
|
|
exportLoading.value = true |
|
|
const data = await StockupMainJobApi.exportStockupMainJob(tableObject.params) |
|
|
const data = await StockupJobMainApi.exportStockupMainJob(tableObject.params) |
|
|
download.excel(data, '备货任务主.xlsx') |
|
|
download.excel(data, '备货任务主.xlsx') |
|
|
} catch { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
|