zhousq
7 months ago
146 changed files with 6325 additions and 1021 deletions
@ -0,0 +1,13 @@ |
|||
import request from '@/config/axios' |
|||
export interface InspectionRequestPackageVO { |
|||
number: string |
|||
packageCode: string |
|||
packageSpecificationCode: string |
|||
amount: string |
|||
measuringUnit: string |
|||
} |
|||
|
|||
//查询包装列表
|
|||
export const getInspectionJobPackageList = async (id: number) => { |
|||
return await request.get({ url: `/qms/inspection-job-package/list?masterId=` + id }) |
|||
} |
@ -0,0 +1,13 @@ |
|||
import request from '@/config/axios' |
|||
export interface InspectionRequestPackageVO { |
|||
number: string |
|||
packageCode: string |
|||
packageSpecificationCode: string |
|||
amount: string |
|||
measuringUnit: string |
|||
} |
|||
|
|||
//查询包装列表
|
|||
export const getInspectionRecordPackageList = async (id: number) => { |
|||
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id }) |
|||
} |
@ -0,0 +1,285 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="[...ProductputawayJobMain.allSchemas.searchSchema,...ProductputawayJobDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="ProductputawayJobMain.allSchemas" |
|||
:detailAllSchemas="ProductputawayJobDetail.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table v-clientTable |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row,$index }"> |
|||
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="getList" |
|||
:rules="ProductputawayJobMainRules" |
|||
:formAllSchemas="ProductputawayJobMain.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:tableAllSchemas="ProductputawayJobDetail.allSchemas" |
|||
:tableFormRules="ProductputawayJobDetailRules" |
|||
:apiUpdate="ProductputawayJobMainApi.updateProductputawayJobMain" |
|||
:apiCreate="ProductputawayJobMainApi.createProductputawayJobMain" |
|||
:isBusiness="true" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="ProductputawayJobMain.allSchemas" |
|||
:detailAllSchemas="ProductputawayJobDetail.allSchemas" |
|||
:detailAllSchemasRules="ProductputawayJobDetailRules" |
|||
:searchTableParams="searchTableParams" |
|||
:apiPage="ProductputawayJobDetailApi.getProductputawayJobDetailPage" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { ProductputawayJobMain,ProductputawayJobMainRules,ProductputawayJobDetail,ProductputawayJobDetailRules } from './productputawayAssembleJobMain.data' |
|||
import * as ProductputawayJobMainApi from '@/api/wms/productputawayJobMain' |
|||
import * as ProductputawayJobDetailApi from '@/api/wms/productputawayJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
// 制品上架任务主 |
|||
defineOptions({ name: 'ProductputawayJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref([...ProductputawayJobMain.allSchemas.tableColumns,...ProductputawayJobDetail.allSchemas.tableMainColumns]) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
]) |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|||
nextTick(() => { |
|||
if (type == 'tableForm') { |
|||
// 明细查询页赋值 |
|||
row[formField] = val[0][searchField] |
|||
} else { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: ProductputawayJobMainApi.getProductputawayJobMainAssemblePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:productputaway-job-main:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
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 isShowMainButton = (row,val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row,$index) => { |
|||
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|||
if(findIndex>0&&findIndex<$index){ |
|||
return [] |
|||
} |
|||
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'])}), // 执行 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainJobExe') { // 执行 |
|||
let aaa = { |
|||
"id": "1809190000111838147", |
|||
"requestNumber": "REC4620231214-0004", |
|||
"supplierCode": null, |
|||
"fromWarehouseCode": "W1", |
|||
"toWarehouseCode": null, |
|||
"fromAreaCodes": "", |
|||
"toAreaCodes": "", |
|||
"fromAreaTypes": "WIP,RAW", |
|||
"toAreaTypes": "SEMI,FG", |
|||
"completetime": 1702545291000, |
|||
"requestTime": 1702524283000, |
|||
"requestDueTime": 1689562428000, |
|||
"status": "2", |
|||
"expiredTime": null, |
|||
"updateTime": 1702545291000, |
|||
"updater": "1", |
|||
"jobStageStatus": null, |
|||
"priority": null, |
|||
"priorityIncrement": null, |
|||
"departmentCode": "103", |
|||
"acceptUserId": "1", |
|||
"acceptTime": 1702552206000, |
|||
"completeUserId": null, |
|||
"number": "JOB2220231214-0007", |
|||
"businessType": "ProductPutaway", |
|||
"remark": "111100", |
|||
"createTime": 1702545291000, |
|||
"creator": "1", |
|||
"autoComplete": "FALSE", |
|||
"allowModifyLocation": "FALSE", |
|||
"allowModifyQty": "TRUE", |
|||
"allowBiggerQty": "TRUE", |
|||
"allowSmallerQty": "TRUE", |
|||
"allowModifyInventoryStatus": "TRUE", |
|||
"allowContinuousScanning": "TRUE", |
|||
"allowPartialComplete": "TRUE", |
|||
"allowModifyBatch": "FALSE", |
|||
"allowModifyPackingNumber": "FALSE", |
|||
"inInventoryStatuses": "OK", |
|||
"outInventoryStatuses": "OK", |
|||
subList: [ |
|||
{ |
|||
"id": "1809190001814017359", |
|||
"packingNumber": "12", |
|||
"containerNumber": "001", |
|||
"batch": "21", |
|||
"inventoryStatus": "OK", |
|||
"poNumber": null, |
|||
"poLine": "item01", |
|||
"fromLocationCode": "H03", |
|||
"toLocationCode": "L-R-001-002-1-02", |
|||
"itemCode": "item01", |
|||
"itemName": "物料01", |
|||
"itemDesc1": "", |
|||
"itemDesc2": "", |
|||
"projectCode": "xm01", |
|||
"qty": 3, |
|||
"uom": "EA", |
|||
"number": "JOB2220231214-0007", |
|||
"remark": "00", |
|||
"createTime": 1702545291000, |
|||
"creator": "1", |
|||
"fromOwnerCode": null, |
|||
"toOwnerCode": null |
|||
} |
|||
] |
|||
} |
|||
ProductputawayJobMainApi.executeProductputawayMain(aaa) |
|||
} else if (val == 'mainJobAba') { // 放弃 |
|||
ProductputawayJobMainApi.abandonProductputawayMain(row.masterId) |
|||
} else if (val == 'mainJobClo') { // 关闭 |
|||
ProductputawayJobMainApi.closeProductputawayMain(row.masterId) |
|||
} else if (val == 'mainJobAcc') { // 承接 |
|||
ProductputawayJobMainApi.acceptProductputawayMain(row.masterId) |
|||
} |
|||
} |
|||
// 获取部门 用于详情 部门回显 |
|||
const { wsCache } = useCache() |
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|||
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|||
detailRef.value.openDetail(row, titleName, titleValue,'jobProductputawayMain') |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ProductputawayJobMainApi.exportProductputawayJobMain(tableObject.params) |
|||
download.excel(data, '制品上架任务主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
</script> |
@ -0,0 +1,809 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
/** |
|||
* @returns {Array} 制品上架任务主表 |
|||
*/ |
|||
export const ProductputawayJobMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180, |
|||
fixed: 'left' |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '申请单号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
// {
|
|||
// label: '供应商代码',
|
|||
// field: 'supplierCode',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '要求截止时间', |
|||
field: 'requestDueTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
// {
|
|||
// label: '状态',
|
|||
// field: 'jobStageStatus',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
{ |
|||
label: '过期时间', |
|||
field: 'expiredTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '最后更新时间', |
|||
field: 'updateTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '最后更新者', |
|||
field: 'update', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.JOB_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '优先级', |
|||
field: 'priority', |
|||
form: { |
|||
component: 'InputNumber', |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '优先级增量', |
|||
field: 'priorityIncrement', |
|||
form: { |
|||
component: 'InputNumber', |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '部门', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '承接人用户名', |
|||
field: 'acceptUserId', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '承接时间', |
|||
field: 'acceptTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '完成人用户名', |
|||
field: 'completeUserId', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completeTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区类型范围', |
|||
field: 'fromAreaTypes', |
|||
dictType: DICT_TYPE.AREA_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
dictType: DICT_TYPE.AREA_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区代码范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '自动完成', |
|||
field: 'autoComplete', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许修改库位', |
|||
field: 'allowModifyLocation', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许修改数量', |
|||
field: 'allowModifyQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许大于推荐数量', |
|||
field: 'allowBiggerQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许小于推荐数量', |
|||
field: 'allowSmallerQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许修改库存状态', |
|||
field: 'allowModifyInventoryStatus', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许连续扫描', |
|||
field: 'allowContinuousScanning', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许部分完成', |
|||
field: 'allowPartialComplete', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许修改批次', |
|||
field: 'allowModifyBatch', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '允许修改箱码', |
|||
field: 'allowModifyPackingNumber', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '操作',
|
|||
// field: 'action',
|
|||
// isDetail: false,
|
|||
// isForm: false,
|
|||
// table: {
|
|||
// width: 120,
|
|||
// fixed: 'right'
|
|||
// },
|
|||
// }
|
|||
])) |
|||
|
|||
//表单校验
|
|||
export const ProductputawayJobMainRules = reactive({ |
|||
requestNumber: [ |
|||
{ required: true, message: '请选择申请单号', trigger: 'change' } |
|||
], |
|||
fromWarehouseCode: [ |
|||
{ required: true, message: '请选择从仓库代码', trigger: 'change' } |
|||
], |
|||
fromAreaTypes: [ |
|||
{ required: true, message: '请选择从库区类型范围', trigger: 'change' } |
|||
], |
|||
toWarehouseCode: [ |
|||
{ required: true, message: '请选择到仓库代码', trigger: 'change' } |
|||
], |
|||
toAreaTypes: [ |
|||
{ required: true, message: '请选择到库区类型范围', trigger: 'change' } |
|||
], |
|||
requestTime: [ |
|||
{ required: true, message: '请输入申请时间', trigger: 'change' } |
|||
], |
|||
requestDueTime: [ |
|||
{ required: true, message: '请输入要求截止时间', trigger: 'change' } |
|||
], |
|||
status: [ |
|||
{ required: true, message: '请选择状态', trigger: 'change' } |
|||
], |
|||
// jobStageStatus: [
|
|||
// { required: true, message: '请选择阶段状态', trigger: 'change' }
|
|||
// ],
|
|||
priority: [ |
|||
{ required: true, message: '请输入优先级', trigger: 'blur' } |
|||
], |
|||
priorityIncrement: [ |
|||
{ required: true, message: '请输入优先级增量', trigger: 'blur' } |
|||
], |
|||
departmentCode: [ |
|||
{ required: true, message: '请输入部门', trigger: 'blur' } |
|||
], |
|||
userPositionCode: [ |
|||
{ required: true, message: '请输入岗位', trigger: 'blur' } |
|||
], |
|||
number: [ |
|||
{ required: true, message: '请输入单据号', trigger: 'blur' } |
|||
], |
|||
businessType: [ |
|||
{ required: true, message: '请输入业务类型', trigger: 'blur' } |
|||
], |
|||
createTime: [ |
|||
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
|||
], |
|||
creator: [ |
|||
{ required: true, message: '请输入创建者', trigger: 'blur' } |
|||
], |
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 制品上架任务子表 |
|||
*/ |
|||
export const ProductputawayJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '包装号', |
|||
field: 'packingNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '器具号', |
|||
field: 'containerNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'batch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '库存状态', |
|||
field: 'inventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库位代码', |
|||
field: 'fromLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库位代码', |
|||
field: 'toLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '物料代码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '物料名称', |
|||
field: 'itemName', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '物料描述1', |
|||
field: 'itemDesc1', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '物料描述2', |
|||
field: 'itemdesc2', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '项目代码', |
|||
field: 'projectCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '计量单位', |
|||
field: 'uom', |
|||
dictType: DICT_TYPE.UOM, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从货主代码', |
|||
field: 'fromOwnerCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到货主代码', |
|||
field: 'toOwnerCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const ProductputawayJobDetailRules = reactive({ |
|||
packingNumber: [ |
|||
{ required: true, message: '请选择包装号', trigger: 'change' } |
|||
], |
|||
batch: [ |
|||
{ required: true, message: '请输入批次', trigger: 'blur' } |
|||
], |
|||
inventoryStatus: [ |
|||
{ required: true, message: '请选择库存状态', trigger: 'change' } |
|||
], |
|||
fromLocationCode: [ |
|||
{ required: true, message: '请选择从库位代码', trigger: 'change' } |
|||
], |
|||
toLocationCode: [ |
|||
{ required: true, message: '请选择到库位代码', trigger: 'change' } |
|||
], |
|||
number: [ |
|||
{ required: true, message: '请输入单据号', trigger: 'blur' } |
|||
], |
|||
itemCode: [ |
|||
{ required: true, message: '请选择物料代码', trigger: 'change' } |
|||
], |
|||
createTime: [ |
|||
{ required: true, message: '请输入创建时间', trigger: 'blur' } |
|||
], |
|||
creator: [ |
|||
{ required: true, message: '请输入创建者', trigger: 'blur' } |
|||
], |
|||
}) |
@ -0,0 +1,179 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="[...ProductputawayRecordMain.allSchemas.searchSchema,...ProductputawayRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="ProductputawayRecordMain.allSchemas" |
|||
:detailAllSchemas="ProductputawayRecordDetail.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table v-clientTable |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row,$index }"> |
|||
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="getList" |
|||
:rules="ProductputawayRecordMainRules" |
|||
:formAllSchemas="ProductputawayRecordMain.allSchemas" |
|||
:tableAllSchemas="ProductputawayRecordDetail.allSchemas" |
|||
:tableFormRules="ProductputawayRecordDetailRules" |
|||
:isBusiness="true" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="ProductputawayRecordMain.allSchemas" |
|||
:detailAllSchemas="ProductputawayRecordDetail.allSchemas" |
|||
:detailAllSchemasRules="ProductputawayRecordDetailRules" |
|||
:apiPage="ProductputawayRecordDetailApi.getProductputawayRecordDetailPage" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { ProductputawayRecordMain,ProductputawayRecordMainRules,ProductputawayRecordDetail,ProductputawayRecordDetailRules } from './productputawayAssembleRecordMain.data' |
|||
import * as ProductputawayRecordMainApi from '@/api/wms/productputawayRecordMain' |
|||
import * as ProductputawayRecordDetailApi from '@/api/wms/productputawayRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
// 制品上架记录主 |
|||
defineOptions({ name: 'ProductputawayRecordMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref([...ProductputawayRecordMain.allSchemas.tableColumns,...ProductputawayRecordDetail.allSchemas.tableMainColumns]) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: ProductputawayRecordMainApi.getProductputawayRecordMainAssemblePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:productputaway-record-main:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
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 = (row,$index) => { |
|||
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|||
if(findIndex>0&&findIndex<$index){ |
|||
return [] |
|||
} |
|||
return [] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
} |
|||
// 获取部门 用于详情 部门回显 |
|||
const { wsCache } = useCache() |
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|||
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|||
detailRef.value.openDetail(row, titleName, titleValue,'recordProductputawayMain') |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ProductputawayRecordMainApi.exportProductputawayRecordMain(tableObject.params) |
|||
download.excel(data, '制品上架记录主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
</script> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue