|
|
@ -1,7 +1,11 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="CountRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="CountRequestMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -27,13 +31,16 @@ |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #number="{row}"> |
|
|
|
<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)" /> |
|
|
|
<ButtonBase |
|
|
|
:Butttondata="butttondata(row)" |
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -73,16 +80,34 @@ |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/count-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/wms/count-request-main/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
:updateIsDisable="true" |
|
|
|
:coverIsDisable="true" |
|
|
|
:mode="2" |
|
|
|
/> |
|
|
|
|
|
|
|
<SearchTable |
|
|
|
ref="searchTableRef" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CountRequestMain,CountRequestMainRules,CountRequestDetail,CountRequestDetailRules } from './countRequestMain.data' |
|
|
|
import { |
|
|
|
CountRequestMain, |
|
|
|
CountRequestMainRules, |
|
|
|
CountRequestDetail, |
|
|
|
CountRequestDetailRules |
|
|
|
} from './countRequestMain.data' |
|
|
|
import * as CountRequestMainApi from '@/api/wms/countRequestMain' |
|
|
|
import * as CountRequestDetailApi from '@/api/wms/countRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { SearchTable } from '@/components/SearchTable' |
|
|
|
|
|
|
|
// 盘点申请 |
|
|
|
defineOptions({ name: 'CountRequestMain' }) |
|
|
@ -102,16 +127,16 @@ const updataTableColumns = (val) => { |
|
|
|
|
|
|
|
// 查询列表页面参数设置 |
|
|
|
const searchTableParams = ref([ |
|
|
|
//{ |
|
|
|
// formField: 'productItemCode', |
|
|
|
// searchTableTitle: '物料信息', |
|
|
|
// searchTableAllSchemas: Itembasic.allSchemas, |
|
|
|
// searchTablePage: ItembasicApi.getItembasicPage |
|
|
|
//} |
|
|
|
//{ |
|
|
|
// formField: 'productItemCode', |
|
|
|
// searchTableTitle: '物料信息', |
|
|
|
// searchTableAllSchemas: Itembasic.allSchemas, |
|
|
|
// searchTablePage: ItembasicApi.getItembasicPage |
|
|
|
//} |
|
|
|
]) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
nextTick(() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
@ -150,10 +175,10 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
const HeadButttondata = [ |
|
|
|
// defaultButtons.defaultAddBtn({hasPermi:'wms:count-request-main:create'}), // 新增——需要手动修改下权限 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:count-request-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:count-request-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-request-main:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -166,102 +191,192 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
} else if (val == 'import') { |
|
|
|
// 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
} else if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else if (val == 'mainReCount') { |
|
|
|
// 重盘 |
|
|
|
} else if (val == 'mainSuperviseCount') { |
|
|
|
// 监盘 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowReCountMainButton = (row, val) => { |
|
|
|
if (row.jobStatus1 == 3 && (row.jobStatus2 == null || row.jobStatus2 == 3)) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:count-request-main:close'}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-request-main:reAdd'}), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-request-main:submit'}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-request-main:refused'}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-request-main:agree'}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-request-main:handle'}), // 处理 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-request-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListCloseBtn({ |
|
|
|
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']), |
|
|
|
hasPermi: 'wms:count-request-main:close' |
|
|
|
}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({ |
|
|
|
hide: isShowMainButton(row, ['5']), |
|
|
|
hasPermi: 'wms:count-request-main:reAdd' |
|
|
|
}), //重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:count-request-main:submit' |
|
|
|
}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hasPermi: 'wms:count-request-main:refused' |
|
|
|
}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({ |
|
|
|
hide: isShowMainButton(row, ['2']), |
|
|
|
hasPermi: 'wms:count-request-main:agree' |
|
|
|
}), // 审批通过 |
|
|
|
defaultButtons.mainListHandleBtn({ |
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
hasPermi: 'wms:count-request-main:handle' |
|
|
|
}), // 处理 |
|
|
|
defaultButtons.mainListEditBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:count-request-main:update' |
|
|
|
}), // 编辑 |
|
|
|
defaultButtons.mainReCountBtn({ |
|
|
|
hide: isShowReCountMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:count-request-main:reCount' |
|
|
|
}), // 重盘 |
|
|
|
defaultButtons.mainSuperviseCountBtn({ |
|
|
|
hide: isShowReCountMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:count-request-main:supervise' |
|
|
|
}) // 监盘 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
console.log(val) |
|
|
|
if (val == 'mainClose') { |
|
|
|
// 关闭 |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
CountRequestMainApi.close(row.id).then(() => { |
|
|
|
CountRequestMainApi.close(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('关闭成功')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
} else if (val == 'mainReAdd') { |
|
|
|
// 重新添加 |
|
|
|
await message.confirm('确认要重新添加吗?') |
|
|
|
CountRequestMainApi.reAdd(row.id).then(() => { |
|
|
|
CountRequestMainApi.reAdd(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('添加成功')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
} else if (val == 'mainSubmit') { |
|
|
|
// 提交审批 |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
CountRequestMainApi.submit(row.id).then(() => { |
|
|
|
CountRequestMainApi.submit(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('提交审批成功')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
} else if (val == 'mainTurnDown') { |
|
|
|
// 驳回 |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
CountRequestMainApi.refused(row.id).then(() => { |
|
|
|
CountRequestMainApi.refused(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('驳回成功')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
} else if (val == 'mainApprove') { |
|
|
|
// 审批通过 |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
CountRequestMainApi.agree(row.id).then(() => { |
|
|
|
CountRequestMainApi.agree(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('审批已通过')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
} else if (val == 'mainHandle') { |
|
|
|
// 处理 |
|
|
|
await message.confirm('确认要处理吗?') |
|
|
|
CountRequestMainApi.handle(row.id).then(() => { |
|
|
|
CountRequestMainApi.handle(row.id) |
|
|
|
.then(() => { |
|
|
|
message.success(t('处理成功')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
} else if (val == 'mainReCount') { |
|
|
|
// 重盘 |
|
|
|
// CountRequestMainApi.handle(row.id).then(() => { |
|
|
|
// message.success(t('处理成功')) |
|
|
|
// getList() |
|
|
|
// }).catch(err => { |
|
|
|
// console.log(err) |
|
|
|
// }) |
|
|
|
console.log(CountRequestDetail.allSchemas) |
|
|
|
console.log(CountRequestDetailApi.getCountRequestDetailPage) |
|
|
|
console.log('formField','') |
|
|
|
console.log('formField','') |
|
|
|
searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'','','','',row,{masterId:row.id}) |
|
|
|
} else if (val == 'mainSuperviseCount') { |
|
|
|
// 监盘 |
|
|
|
// CountRequestMainApi.handle(row.id).then(() => { |
|
|
|
// message.success(t('处理成功')) |
|
|
|
// getList() |
|
|
|
// }).catch(err => { |
|
|
|
// console.log(err) |
|
|
|
// }) |
|
|
|
} else if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm =async (type: string, row?: number) => { |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
@ -363,9 +478,9 @@ const handleExport = async () => { |
|
|
|
|
|
|
|
/** |
|
|
|
* tableForm方法 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
const tableFormKeys = {} |
|
|
|
CountRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
CountRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
const tableData = ref([]) |
|
|
|