陈薪名
9 months ago
14 changed files with 5270 additions and 19 deletions
@ -0,0 +1,241 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PurchasereceiptJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PurchasereceiptJobMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
: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 }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="getList" |
|||
:rules="PurchasereceiptJobMainRules" |
|||
:formAllSchemas="PurchasereceiptJobMain.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:tableAllSchemas="PurchasereceiptJobDetail.allSchemas" |
|||
:tableFormRules="PurchasereceiptJobDetailRules" |
|||
:apiUpdate="PurchasereceiptJobMainApi.updatePurchasereceiptJobMain" |
|||
:apiCreate="PurchasereceiptJobMainApi.createPurchasereceiptJobMain" |
|||
:isBusiness="true" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="PurchasereceiptJobMain.allSchemas" |
|||
:detailAllSchemas="PurchasereceiptJobDetail.allSchemas" |
|||
:detailAllSchemasRules="PurchasereceiptJobDetailRules" |
|||
:searchTableParams="searchTableParams" |
|||
:apiPage="PurchasereceiptJobDetailApi.getPurchasereceiptJobDetailPage" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PurchasereceiptJobMain,PurchasereceiptJobMainRules,PurchasereceiptJobDetail,PurchasereceiptJobDetailRules } from './sparereceiptJobMain.data' |
|||
import * as PurchasereceiptJobMainApi from '@/api/wms/purchasereceiptJobMain' |
|||
import * as PurchasereceiptJobDetailApi from '@/api/wms/purchasereceiptJobDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
// 采购收货任务主 |
|||
defineOptions({ name: 'PurchasereceiptJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PurchasereceiptJobMain.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, 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: PurchasereceiptJobMainApi.getPurchasereceiptJobMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-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) => { |
|||
return [ |
|||
// defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 |
|||
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // 关闭 |
|||
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 |
|||
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainJobExe') { // 执行 |
|||
console.log('列表-操作按钮事件-执行') |
|||
} else if (val == 'mainJobAba') { // 放弃 |
|||
console.log('列表-操作按钮事件-放弃') |
|||
} else if (val == 'mainJobClo') { // 关闭 |
|||
handleClose(row.id) |
|||
} else if (val == 'mainJobAcc') { // 承接 |
|||
console.log('列表-操作按钮事件-承接') |
|||
} |
|||
} |
|||
|
|||
/** 关闭按钮操作 */ |
|||
const handleClose = async (id: number) => { |
|||
try { |
|||
await message.confirm(t('common.confirmColse')) |
|||
await PurchasereceiptJobMainApi.closePurchasereceiptJobMain(id) |
|||
message.success(t('common.closeSuccess')) |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue,'jobPurchasereceiptMain') |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await PurchasereceiptJobMainApi.exportPurchasereceiptJobMain(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> |
|||
./sparereceiptJobMain.data |
@ -0,0 +1,992 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
/** |
|||
* @returns {Array} 采购收货任务主表 |
|||
*/ |
|||
export const PurchasereceiptJobMain = 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: 'asnNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '要货计划单号', |
|||
field: 'ppNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到月台代码', |
|||
field: 'toDockCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '承运商', |
|||
field: 'carrierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '运输方式', |
|||
field: 'transferMode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '车牌号', |
|||
field: 'vehiclePlateNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '申请时间', |
|||
field: 'requestTime', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '要求截止时间', |
|||
field: 'requestDueTime', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
formatter: dateFormatter, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '状态', |
|||
field: 'status', |
|||
dictType: DICT_TYPE.JOB_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
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: 'jobStageStatus',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
{ |
|||
label: '优先级', |
|||
field: 'priority', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '优先级增量', |
|||
field: 'priorityIncrement', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '部门', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '岗位', |
|||
field: 'userPositionCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '承接人', |
|||
field: 'acceptUserName', |
|||
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: 'completeUserName', |
|||
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.LOCATION_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
dictType: DICT_TYPE.LOCATION_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区代码范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '业务类型', |
|||
field: 'businessType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
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: 'autoComplete', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改库位', |
|||
field: 'allowModifyLocation', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改数量', |
|||
field: 'allowModifyQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许大于推荐数量', |
|||
field: 'allowBiggerQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许小于推荐数量', |
|||
field: 'allowSmallerQty', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改库存状态', |
|||
field: 'allowModifyInventoryStatus', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许连续扫描', |
|||
field: 'allowContinuousScanning', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许部分完成', |
|||
field: 'allowPartialComplete', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改批次', |
|||
field: 'allowModifyBatch', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '允许修改箱码', |
|||
field: 'allowModifyPackingNumber', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isDetail: false, |
|||
isForm: false, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
} |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const PurchasereceiptJobMainRules = reactive({ |
|||
requestNumber: [ |
|||
{ required: true, message: '请选择申请单号', trigger: 'change' } |
|||
], |
|||
supplierCode: [ |
|||
{ 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 PurchasereceiptJobDetail = 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: 'altBatch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到货日期', |
|||
field: 'arriveDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '生产日期', |
|||
field: 'produceDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '过期日期', |
|||
field: 'expireDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '库存状态', |
|||
field: 'inventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库位代码', |
|||
field: 'fromLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库位代码', |
|||
field: 'toLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '包装数量', |
|||
field: 'packQty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装规格', |
|||
field: 'packUnit', |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '供应商计量数量', |
|||
field: 'supplierQty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商计量单位', |
|||
field: 'supplierUom', |
|||
dictType: DICT_TYPE.UOM, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '转换率', |
|||
field: 'convertRate', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '从货主代码', |
|||
field: 'fromOwnerCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到货主代码', |
|||
field: 'toOwnerCode', |
|||
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: '备注', |
|||
fiield: 'remark', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '创建者', |
|||
field: 'creator', |
|||
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', |
|||
} |
|||
}, |
|||
}, |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const PurchasereceiptJobDetailRules = reactive({ |
|||
packingNumber: [ |
|||
{ required: true, message: '请选择包装号', trigger: 'change' } |
|||
], |
|||
batch: [ |
|||
{ required: true, message: '请输入批次', trigger: 'blur' } |
|||
], |
|||
arriveDate: [ |
|||
{ required: true, message: '请输入到货日期', trigger: 'change' } |
|||
], |
|||
produceDate: [ |
|||
{ required: true, message: '请输入生产日期', trigger: 'change' } |
|||
], |
|||
expireDate: [ |
|||
{ required: true, message: '请输入过期日期', trigger: 'change' } |
|||
], |
|||
inventoryStatus: [ |
|||
{ required: true, message: '请选择库存状态', trigger: 'change' } |
|||
], |
|||
poNumber: [ |
|||
{ required: true, message: '请选择订单号', trigger: 'change' } |
|||
], |
|||
poLine: [ |
|||
{ required: true, message: '请输入订单行', trigger: 'blur' } |
|||
], |
|||
packQty: [ |
|||
{ required: true, message: '请输入包装数量', trigger: 'blur' } |
|||
], |
|||
packUnit: [ |
|||
{ required: true, message: '请选择包装规格', trigger: 'change' } |
|||
], |
|||
convertRate: [ |
|||
{ required: true, message: '请输入转换率', trigger: 'blur' } |
|||
], |
|||
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,216 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PurchasereceiptRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PurchasereceiptRecordMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
: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 }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="getList" |
|||
:rules="PurchasereceiptRecordMainRules" |
|||
:formAllSchemas="PurchasereceiptRecordMain.allSchemas" |
|||
:tableAllSchemas="PurchasereceiptRecordDetail.allSchemas" |
|||
:tableFormRules="PurchasereceiptRecordDetailRules" |
|||
:isBusiness="true" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="PurchasereceiptRecordMain.allSchemas" |
|||
:detailAllSchemas="detailAllSchemas" |
|||
:detailAllSchemasRules="PurchasereceiptRecordDetailRules" |
|||
:apiPage="apiPage" |
|||
:tabs="PurchasereceiptRequestTabsList" |
|||
@changeTabs="changeTabs" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PurchasereceiptRecordMain,PurchasereceiptRecordMainRules,PurchasereceiptRecordDetail,PurchasereceiptRecordDetailRules } from './sparereceiptRecordMain.data' |
|||
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain' |
|||
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList' |
|||
|
|||
// 采购收货记录主 |
|||
defineOptions({ name: 'PurchasereceiptRecordMain' }) |
|||
|
|||
const apiPage = ref(PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PurchasereceiptRecordMain.allSchemas.tableColumns) |
|||
const detailAllSchemas = ref(PurchasereceiptRecordDetail.allSchemas) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PurchasereceiptRecordMainApi.getPurchasereceiptRecordMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-record-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 butttondata = (row) => { |
|||
return [ |
|||
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:!row.inspectRequestFlag}),// 生成到货检验申请 |
|||
defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:!row.putawayRequestFlag}),// 生成采购上架申请 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'putawayRequest') { // 生成采购上架申请 |
|||
handleCreatePutawayRequest(row.number) |
|||
}else if(val == 'inspectRequest'){//生成到货检验申请 |
|||
handleCreateInspectRequest(row.number) |
|||
} |
|||
} |
|||
|
|||
|
|||
/** 生成采购上架申请按钮操作 */ |
|||
const handleCreatePutawayRequest = async (number:string) => { |
|||
try{ |
|||
await message.confirm(t('确认生成上架申请吗?')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRecordMainApi.createPutawayRequest(number) |
|||
message.success(t('上架申请生成成功')) |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 生成到货检验申请按钮操作 */ |
|||
const handleCreateInspectRequest = async (number:string) => { |
|||
try{ |
|||
await message.confirm(t('确认生成到货检验申请吗?')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRecordMainApi.createPutawayRequest(number) |
|||
message.success(t('到货检验申请生成成功')) |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue,'recordPurchasereceiptMain') |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await PurchasereceiptRecordMainApi.exportPurchasereceiptRecordMain(tableObject.params) |
|||
download.excel(data, '采购收货记录主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
// tabs 切换事件 |
|||
const changeTabs = (data) =>{ |
|||
if(data.prop == 'receiptDetail'){ |
|||
console.log(data) |
|||
apiPage.value = PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage |
|||
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas |
|||
}else if(data.prop == 'scarceGoodsDetail'){ |
|||
apiPage.value = PurchasereceiptRecordDetailApi.getScarceGoodsDetailPage |
|||
detailAllSchemas.value = PurchasereceiptRecordDetail.allSchemas |
|||
} |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
</script> |
|||
./sparereceiptRecordMain.data |
@ -0,0 +1,914 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
|
|||
|
|||
/** |
|||
* @returns {Array} 采购收货记录主表 |
|||
*/ |
|||
export const PurchasereceiptRecordMain = 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: 'jobNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '发货单号', |
|||
field: 'asnNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '要货计划单号', |
|||
field: 'ppNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '供应商代码', |
|||
field: 'supplierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '到月台代码', |
|||
field: 'toDockCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '承运商', |
|||
field: 'carrierCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '运输方式', |
|||
field: 'transferMode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '车牌号', |
|||
field: 'vehiclePlateNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从仓库代码', |
|||
field: 'fromWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到仓库代码', |
|||
field: 'toWarehouseCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区类型范围', |
|||
field: 'fromAreaTypes', |
|||
dictType: DICT_TYPE.LOCATION_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区类型范围', |
|||
field: 'toAreaTypes', |
|||
dictType: DICT_TYPE.LOCATION_TYPE, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区代码范围', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区代码范围', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '出库事务类型', |
|||
field: 'outTransaction', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '入库事务类型', |
|||
field: 'inTransaction', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '执行时间', |
|||
field: 'executeTime', |
|||
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: 'activeDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
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: 'dueTime', |
|||
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: 'departmentCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
// {
|
|||
// label: '代码',
|
|||
// field: 'code',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
{ |
|||
label: '接口类型', |
|||
field: 'interfaceType', |
|||
dictType: DICT_TYPE.INTERFACE_TYPE, |
|||
dictClass: 'string', |
|||
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: 'creator', |
|||
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: 'available', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
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: 300, |
|||
fixed: 'right' |
|||
}, |
|||
} |
|||
])) |
|||
|
|||
// 表单校验
|
|||
export const PurchasereceiptRecordMainRules = reactive({ |
|||
requestNumber: [ |
|||
{ required: true, message: '请选择申请单号', trigger: 'change' } |
|||
], |
|||
supplierCode: [ |
|||
{ required: true, message: '请选择供应商代码', trigger: 'change' } |
|||
], |
|||
toWarehouseCode: [ |
|||
{ required: true, message: '请选择到仓库代码', trigger: 'change' } |
|||
], |
|||
toAreaTypes: [ |
|||
{ required: true, message: '请选择到库位类型服务', trigger: 'change' } |
|||
], |
|||
outTransaction: [ |
|||
{ required: true, message: '请输入出库事务类型', trigger: 'blur' } |
|||
], |
|||
inTransaction: [ |
|||
{ required: true, message: '请输入入库事务类型', trigger: 'blur' } |
|||
], |
|||
executeTime: [ |
|||
{ required: true, message: '请输入执行时间', trigger: 'change' } |
|||
], |
|||
activeDate: [ |
|||
{ required: true, message: '请输入生效日期', trigger: 'change' } |
|||
], |
|||
available: [ |
|||
{ required: true, message: '请输入是否可用', trigger: 'blur' } |
|||
], |
|||
departmentCode: [ |
|||
{ required: true, message: '请输入部门', trigger: 'blur' } |
|||
], |
|||
interfaceType: [ |
|||
{ required: true, message: '请选择接口类型', trigger: 'change' } |
|||
], |
|||
number: [ |
|||
{ required: true, message: '请输入单据号', trigger: 'blur' } |
|||
], |
|||
businessType: [ |
|||
{ required: true, message: '请输入业务类型', trigger: 'blur' } |
|||
], |
|||
createTime: [ |
|||
{ required: true, message: '请选择创建时间', trigger: 'change' } |
|||
], |
|||
creator: [ |
|||
{ required: true, message: '请输入创建者', trigger: 'blur' } |
|||
], |
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 采购收货记录子表 |
|||
*/ |
|||
export const PurchasereceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '单据号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180, |
|||
fixed: 'left' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单号', |
|||
field: 'poNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '订单行', |
|||
field: 'poLine', |
|||
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: 'fromBatch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到批次', |
|||
field: 'toBatch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '替代批次', |
|||
field: 'altBatch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从包装号', |
|||
field: 'fromPackingNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到包装号', |
|||
field: 'toPackingNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从器具号', |
|||
field: 'fromContainerNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到器具号', |
|||
field: 'toContainerNumber', |
|||
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', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
label: '包装数量', |
|||
field: 'packQty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '包装规格', |
|||
field: 'packUnit', |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
label: '供应商计量数量', |
|||
field: 'supplierQty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商计量单位', |
|||
field: 'supplierUom', |
|||
dictType: DICT_TYPE.UOM, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
|
|||
{ |
|||
label: '库存状态', |
|||
field: 'inventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库位代码', |
|||
field: 'fromLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库位代码', |
|||
field: 'toLocationCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库位组代码', |
|||
field: 'fromLocationGroupCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库位组代码', |
|||
field: 'toLocationGroupCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从库区代码', |
|||
field: 'fromAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到库区代码', |
|||
field: 'toAreaCodes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '从货主代码', |
|||
field: 'fromOwnerCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到货主代码', |
|||
field: 'toOwnerCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '到货日期', |
|||
field: 'arriveDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '生产日期', |
|||
field: 'produceDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '过期日期', |
|||
field: 'expireDate', |
|||
formatter: dateFormatter2, |
|||
detail: { |
|||
dateFormat: 'YYYY-MM-DD' |
|||
}, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 180 |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
style: {width: '100%'}, |
|||
type: 'date', |
|||
dateFormat: 'YYYY-MM-DD', |
|||
valueFormat: 'x', |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '转换率', |
|||
field: 'convertRate', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '目检结果', |
|||
field: 'visualInspectResult', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '目检照片', |
|||
field: 'visualInspectPhotos', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '不合格原因', |
|||
field: 'failedReason', |
|||
dictType: DICT_TYPE.PURCHASE_RETURN_REASON, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '单价', |
|||
field: 'singlePrice', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
{ |
|||
label: '金额', |
|||
field: 'amount', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '任务明细ID',
|
|||
// field: 'jobDetailId',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
|
|||
{ |
|||
label: '项目代码', |
|||
field: 'projectCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
}, |
|||
// {
|
|||
// label: '代码',
|
|||
// field: 'code',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: 150
|
|||
// },
|
|||
// },
|
|||
{ |
|||
label: '接口类型', |
|||
field: 'interfaceType', |
|||
dictType: DICT_TYPE.INTERFACE_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
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 |
|||
}, |
|||
} |
|||
])) |
|||
|
|||
// 表单校验
|
|||
export const PurchasereceiptRecordDetailRules = reactive({ |
|||
fromPackingNumber: [ |
|||
{ required: true, message: '请选择从包装号', trigger: 'change' } |
|||
], |
|||
toPackingNumber: [ |
|||
{ required: true, message: '请选择到包装号', trigger: 'change' } |
|||
], |
|||
fromBatch: [ |
|||
{ required: true, message: '请输入从批次', trigger: 'blur' } |
|||
], |
|||
toBatch: [ |
|||
{ required: true, message: '请输入到批次', trigger: 'blur' } |
|||
], |
|||
arriveDate: [ |
|||
{ required: true, message: '请选择到货日期', trigger: 'change' } |
|||
], |
|||
produceDate: [ |
|||
{ required: true, message: '请选择生产日期', trigger: 'change' } |
|||
], |
|||
expireDate: [ |
|||
{ required: true, message: '请选择过期日期', trigger: 'change' } |
|||
], |
|||
inventoryStatus: [ |
|||
{ required: true, message: '请选择库存状态', trigger: 'change' } |
|||
], |
|||
toLocationCode: [ |
|||
{ required: true, message: '请选择到库位代码', trigger: 'change' } |
|||
], |
|||
toLocationGroupCode: [ |
|||
{ required: true, message: '请选择到库位组代码', trigger: 'change' } |
|||
], |
|||
toAreaCodes: [ |
|||
{ required: true, message: '请选择到库区代码', trigger: 'change' } |
|||
], |
|||
poNumber: [ |
|||
{ required: true, message: '请选择订单号', trigger: 'change' } |
|||
], |
|||
poLine: [ |
|||
{ required: true, message: '请选择订单行', trigger: 'change' } |
|||
], |
|||
packQty: [ |
|||
{ required: true, message: '请输入包装数量', trigger: 'blur' } |
|||
], |
|||
packUnit: [ |
|||
{ required: true, message: '请选择包装规格', trigger: 'change' } |
|||
], |
|||
convertRate: [ |
|||
{ required: true, message: '请输入转换率', trigger: 'blur' } |
|||
], |
|||
visualInspectResult: [ |
|||
{ required: true, message: '请选择目检结果', trigger: 'change' } |
|||
], |
|||
}) |
@ -0,0 +1,536 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PurchasereceiptRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PurchasereceiptRequestMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
: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 }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="formRef" |
|||
@success="getList" |
|||
:rules="PurchasereceiptRequestMainRules" |
|||
:formAllSchemas="PurchasereceiptRequestMain.allSchemas" |
|||
:tableAllSchemas="PurchasereceiptRequestDetail.allSchemas" |
|||
:tableFormRules="PurchasereceiptRequestDetailRules" |
|||
:tableData="tableData" |
|||
:apiUpdate="PurchasereceiptRequestMainApi.updatePurchasereceiptRequestMain" |
|||
:apiCreate="PurchasereceiptRequestMainApi.createPurchasereceiptRequestMain" |
|||
:isBusiness="true" |
|||
@handleAddTable="handleAddTable" |
|||
@handleDeleteTable="handleDeleteTable" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
@submitForm="submitForm" |
|||
@formFormDateChange="formFormDateChange" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail |
|||
ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="PurchasereceiptRequestMain.allSchemas" |
|||
:detailAllSchemas="detailAllSchemas" |
|||
:detailAllSchemasRules="PurchasereceiptRequestDetailRules" |
|||
:apiCreate="PurchasereceiptRequestDetailApi.createPurchasereceiptRequestDetail" |
|||
:apiUpdate="PurchasereceiptRequestDetailApi.updatePurchasereceiptRequestDetail" |
|||
:apiPage="apiPage" |
|||
:apiDelete="PurchasereceiptRequestDetailApi.deletePurchasereceiptRequestDetail" |
|||
fromeWhere="purchasereceipt" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" |
|||
:detailButtonIsShowAdd="false" |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm |
|||
ref="importFormRef" |
|||
url="/wms/purchasereceipt-request-main/import" |
|||
:importTemplateData="importTemplateData" |
|||
@success="importSuccess" |
|||
:updateIsDisable="true" |
|||
:coverIsDisable="true" |
|||
:mode="2" |
|||
/> |
|||
|
|||
<!-- 创建标签 --> |
|||
<BasicForm |
|||
ref="formLabelRef" |
|||
@success="getList" |
|||
:tableAllSchemas="PurchasereceiptRequestDetailLabel.allSchemas" |
|||
:tableFormRules="PurchasereceiptRequestDetailRules" |
|||
:tableData="detatableData.tableList" |
|||
:isBusiness="true" |
|||
:isShowButton="false" |
|||
@submitForm="submitFormLabel" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|||
import { |
|||
PurchasereceiptRequestMain, |
|||
PurchasereceiptRequestMainRules, |
|||
PurchasereceiptRequestDetail, |
|||
PurchasereceiptRequestDetailRules, |
|||
PurchasereceiptRequestDetailLabel, |
|||
} from './sparereceiptRequestMain.data' |
|||
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' |
|||
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import { formatDate } from '@/utils/formatTime' |
|||
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|||
import { getAccessToken } from '@/utils/auth' |
|||
|
|||
// 采购收货申请 |
|||
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const genLabelId = ref(); //主表ID |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PurchasereceiptRequestMain.allSchemas.tableColumns) |
|||
|
|||
const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage) |
|||
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas) |
|||
|
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|||
//console.log("formRef",formRef) |
|||
//console.log("supplierCode",formRef.value.formRef.formModel.supplierCode) |
|||
nextTick(() => { |
|||
if (type == 'tableForm') { |
|||
// 明细查询页赋值 |
|||
//row[formField] = val[0][searchField] |
|||
if(formField == 'itemCode') { |
|||
row['itemCode'] = val[0]['code'] |
|||
} else if(formField == 'poNumber') { |
|||
row['poNumber'] = val[0]['number'] |
|||
} else if(formField == 'poLine'){ |
|||
row['poLine'] = val[0]['lineNumber'] |
|||
row['itemCode'] = val[0]['itemCode'] |
|||
row['uom'] = val[0]['uom'] |
|||
let supplierCode = formRef.formModel.supplierCode; |
|||
let itemCode = val[0]['itemCode'] |
|||
let queryData = { |
|||
supplierCode:supplierCode, |
|||
itemCode:itemCode |
|||
} |
|||
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ |
|||
row['defaultToLocationCode'] = res |
|||
}) |
|||
}else if (formField == 'packQty'){ |
|||
row['packQty'] = val[0]['packQty'] |
|||
row['packUnit'] = val[0]['packUnit'] |
|||
} |
|||
} else { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
setV['supplierCode'] = val[0]['code'] |
|||
formRef.setValues(setV) |
|||
} |
|||
}) |
|||
} |
|||
// 查询页面返回——详情 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
if(formField == 'itemCode') { |
|||
setV['itemCode'] = val[0]['code'] |
|||
} else { |
|||
setV['poNumber'] = val[0]['number'] |
|||
setV['poLine'] = val[0]['lineNumber'] |
|||
} |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PurchasereceiptRequestMainApi.getPurchasereceiptRequestMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultImportBtn(null), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') {// 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') {// 导入 |
|||
handleImport() |
|||
}else 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 isASNShowMainButton = (row,val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
if(row.sourceType == 'ASN_ExternalReceipt'){ |
|||
return false |
|||
} |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), //重新添加 |
|||
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), // 提交审批 |
|||
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), // 驳回 |
|||
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), // 审批通过 |
|||
// defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), // 编辑 |
|||
{ |
|||
label: '生成标签', |
|||
name: 'ssbq', |
|||
hide: isASNShowMainButton(row, ['3']), |
|||
type: 'primary', |
|||
icon: '', |
|||
color: '', |
|||
hasPermi: '', |
|||
link: true // 文本展现按钮 |
|||
}, |
|||
defaultButtons.mainListPointBtn({ hide: isASNShowMainButton(row, ['3','8']) }), // 标签打印 |
|||
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), // 处理 |
|||
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), // 关闭 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'mainClose') { // 关闭 |
|||
handleClose(row.id) |
|||
} else if (val == 'mainReAdd') { // 重新添加 |
|||
handleReAdd(row.id) |
|||
} else if (val == 'mainSubmit') { // 提交审批 |
|||
handleSubmit(row.id) |
|||
} else if (val == 'mainTurnDown') { // 驳回 |
|||
handleRefused(row.id) |
|||
} else if (val == 'mainApprove') { // 审批通过 |
|||
handleAgree(row.id) |
|||
} else if (val == 'mainHandle') { // 处理 |
|||
handleHandle(row.id) |
|||
} else if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if(val == 'ssbq'){ // 生成标签 |
|||
// 生成标签 |
|||
detatableData.params = { |
|||
masterId:row.id |
|||
} |
|||
genLabelId.value = row.id |
|||
await getDetailList() |
|||
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|||
}else if (val == 'point') { |
|||
// 标签打印 |
|||
labelPrint(row) |
|||
} |
|||
} |
|||
|
|||
|
|||
// 生成标签 |
|||
const isCreateLabel = ref(false) |
|||
const formLabelRef = ref() |
|||
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|||
getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage |
|||
}) |
|||
const { getList:getDetailList } = detatableMethods |
|||
|
|||
// 生成标签按钮操作 |
|||
const submitFormLabel = async (formType, data) => { |
|||
try { |
|||
await message.confirm('是否为此数据生成标签?') |
|||
await PurchasereceiptRequestMainApi.genLabel(genLabelId.value) |
|||
isCreateLabel.value = true |
|||
message.success('创建标签成功') |
|||
} finally { |
|||
formLabelRef.value.formLoading = false |
|||
formLabelRef.value.dialogVisible = false |
|||
} |
|||
} |
|||
|
|||
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|||
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|||
|
|||
// 标签打印 |
|||
const labelPrint = async (row) => { |
|||
window.open(src.value + '&asn_number=' + row.asnNumber) |
|||
} |
|||
|
|||
|
|||
/** 添加/修改操作 */ |
|||
const formRef = ref() |
|||
const openForm =async (type: string, row?: number) => { |
|||
tableData.value = [] // 重置明细数据 |
|||
formRef.value.open(type, 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,'requestPurchasereceiptMain') |
|||
} |
|||
|
|||
/** 关闭按钮操作 */ |
|||
const handleClose = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmColse')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.closePurchasereceiptRequestMain(id) |
|||
message.success(t('common.closeSuccess')) |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 重新添加按钮操作 */ |
|||
const handleReAdd = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmReAdd')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.reAddPurchasereceiptRequestMain(id) |
|||
message.success(t('common.reAddSuccess')) |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 审批通过按钮操作 */ |
|||
const handleAgree = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmAgree')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.agreePurchasereceiptRequestMain(id) |
|||
message.success(t('common.agreeSuccess')) |
|||
tableObject.loading = false |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 审批驳回按钮操作 */ |
|||
const handleRefused = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmRefused')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.refusedPurchasereceiptRequestMain(id) |
|||
message.success(t('common.refusedSuccess')) |
|||
tableObject.loading = false |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 处理按钮操作 */ |
|||
const handleHandle = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmHandle')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.handlePurchasereceiptRequestMain(id) |
|||
message.success(t('common.handleSuccess')) |
|||
tableObject.loading = false |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 提交按钮操作 */ |
|||
const handleSubmit = async (id: number) => { |
|||
try{ |
|||
await message.confirm(t('common.confirmSubmit')) |
|||
tableObject.loading = true |
|||
await PurchasereceiptRequestMainApi.submitPurchasereceiptRequestMain(id) |
|||
message.success(t('common.submitSuccess')) |
|||
tableObject.loading = false |
|||
await getList() |
|||
}catch{}finally{ |
|||
tableObject.loading = false |
|||
} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await PurchasereceiptRequestMainApi.exportPurchasereceiptRequestMain(tableObject.params) |
|||
download.excel(data, '采购收货申请主.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* tableForm方法 |
|||
*/ |
|||
const tableFormKeys = {} |
|||
PurchasereceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|||
tableFormKeys[item.field] = item.default ? item.default : '' |
|||
}) |
|||
const tableData = ref([]) |
|||
|
|||
// 添加明细 |
|||
const handleAddTable = () => { |
|||
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|||
} |
|||
// 删除明细 |
|||
const handleDeleteTable = (item, index) => { |
|||
tableData.value.splice(index, 1) |
|||
} |
|||
|
|||
// 主子数据 提交 |
|||
const submitForm = async (formType, data) => { |
|||
data.subList = tableData.value // 拼接子表数据参数 |
|||
try { |
|||
if (formType === 'create') { |
|||
await PurchasereceiptRequestMainApi.createPurchasereceiptRequestMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await PurchasereceiptRequestMainApi.updatePurchasereceiptRequestMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
formRef.value.dialogVisible = false |
|||
// 刷新当前列表 |
|||
getList() |
|||
} finally { |
|||
formRef.value.formLoading = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
|
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '采购收货申请主导入模版.xlsx' |
|||
}) |
|||
|
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
// tabs 切换事件 |
|||
// const changeTabs = (data) =>{ |
|||
// if(data.prop == 'receiptDetail'){ |
|||
// apiPage.value = PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage |
|||
// detailAllSchemas.value = PurchasereceiptRequestDetail.allSchemas |
|||
// }else if(data.prop == 'scarceGoodsDetail'){ |
|||
// apiPage.value = PurchasereceiptRequestDetailApi.getScarceGoodsDetailPage |
|||
// detailAllSchemas.value = PurchasereceiptRequestDetail.allSchemas |
|||
// } |
|||
// } |
|||
|
|||
const formFormDateChange = (field, val,row, index) => { |
|||
if(field == 'produceDate'){ |
|||
let produceDateStr = formatDate(val,'YYYYMMDD'); |
|||
row.batch = produceDateStr |
|||
} |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await PurchasereceiptRequestMainApi.importTemplate() |
|||
}) |
|||
</script> |
|||
./sparereceiptRequestMain.data |
File diff suppressed because it is too large
Loading…
Reference in new issue