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