|
@ -1,22 +1,27 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="CountJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search |
|
|
|
|
|
:schema="CountJobMain.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="CountJobMain.allSchemas" |
|
|
:allSchemas="CountJobMain.allSchemas" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<Table v-clientTable |
|
|
<Table |
|
|
|
|
|
v-clientTable |
|
|
:columns="tableColumns" |
|
|
:columns="tableColumns" |
|
|
:data="tableObject.tableList" |
|
|
:data="tableObject.tableList" |
|
|
:loading="tableObject.loading" |
|
|
:loading="tableObject.loading" |
|
@ -27,13 +32,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,$index }"> |
|
|
<template #action="{ row, $index }"> |
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<ButtonBase |
|
|
|
|
|
:Butttondata="butttondata(row, $index)" |
|
|
|
|
|
@button-base-click="buttonTableClick($event, row)" |
|
|
|
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</Table> |
|
|
</Table> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
@ -58,7 +66,7 @@ |
|
|
ref="detailRef" |
|
|
ref="detailRef" |
|
|
:isBasic="false" |
|
|
:isBasic="false" |
|
|
:allSchemas="CountJobMain.allSchemas" |
|
|
:allSchemas="CountJobMain.allSchemas" |
|
|
:detailAllSchemas="CountJobDetail.allSchemas" |
|
|
:detailAllSchemas="countJobDetailTableColumns" |
|
|
:detailAllSchemasRules="CountJobDetailRules" |
|
|
:detailAllSchemasRules="CountJobDetailRules" |
|
|
:searchTableParams="searchTableParams" |
|
|
:searchTableParams="searchTableParams" |
|
|
:apiPage="CountJobDetailApi.getCountJobDetailPage" |
|
|
:apiPage="CountJobDetailApi.getCountJobDetailPage" |
|
@ -76,17 +84,21 @@ |
|
|
:extend="rowMasterIdRef" |
|
|
:extend="rowMasterIdRef" |
|
|
:isShowDownloadBtn="true" |
|
|
:isShowDownloadBtn="true" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CountJobMain,CountJobMainRules,CountJobDetail,CountJobDetailRules } from './countJobMain.data' |
|
|
import { |
|
|
|
|
|
CountJobMain, |
|
|
|
|
|
CountJobMainRules, |
|
|
|
|
|
CountJobDetail, |
|
|
|
|
|
CountJobDetailRules |
|
|
|
|
|
} from './countJobMain.data' |
|
|
import * as CountJobMainApi from '@/api/wms/countJobMain' |
|
|
import * as CountJobMainApi from '@/api/wms/countJobMain' |
|
|
import * as CountJobDetailApi from '@/api/wms/countJobDetail' |
|
|
import * as CountJobDetailApi from '@/api/wms/countJobDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import * as PackageunitApi from "@/api/wms/packageunit"; |
|
|
import * as PackageunitApi from '@/api/wms/packageunit' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
// 盘点任务主 |
|
|
// 盘点任务主 |
|
|
defineOptions({ name: 'CountJobMain' }) |
|
|
defineOptions({ name: 'CountJobMain' }) |
|
@ -106,16 +118,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') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
@ -141,7 +153,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: CountJobMainApi.getCountJobMainPage // 分页接口 |
|
|
getListApi: CountJobMainApi.getCountJobMainPage // 分页接口 |
|
@ -152,10 +164,10 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
// 列表头部按钮 |
|
|
const HeadButttondata = [ |
|
|
const HeadButttondata = [ |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:count-job-main:export'}), // 导出 |
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-job-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', |
|
@ -168,24 +180,28 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'export') { // 导出 |
|
|
if (val == 'export') { |
|
|
|
|
|
// 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { |
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
// 刷新 |
|
|
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
searchFormClick({ |
|
|
searchFormClick({ |
|
|
filters: tableObject.params.filters |
|
|
filters: tableObject.params.filters |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
getList() |
|
|
getList() |
|
|
} |
|
|
} |
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
} else if (val == 'filtrate') { |
|
|
} else { // 其他按钮 |
|
|
// 筛选 |
|
|
|
|
|
} 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 { |
|
@ -194,15 +210,17 @@ const isShowMainButton = (row,val) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row,$index) => { |
|
|
const butttondata = (row, $index) => { |
|
|
|
|
|
|
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 |
|
|
defaultButtons.mainListJobAccBtn({ hide: isShowMainButton(row, ['1']) }), // 承接 |
|
|
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1','2']),hasPermi:'wms:count-job-main:close'}), // 关闭 |
|
|
defaultButtons.mainListJobCloBtn({ |
|
|
|
|
|
hide: isShowMainButton(row, ['1', '2']), |
|
|
|
|
|
hasPermi: 'wms:count-job-main:close' |
|
|
|
|
|
}), // 关闭 |
|
|
{ |
|
|
{ |
|
|
label: '导出', |
|
|
label: '导出', |
|
|
name: 'exportCountJob', |
|
|
name: 'exportCountJob', |
|
|
hide: isShowMainButton(row,['1','2']), |
|
|
hide: isShowMainButton(row, ['1', '2']), |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
color: '', |
|
|
color: '', |
|
|
link: true, //文本展现按钮 |
|
|
link: true, //文本展现按钮 |
|
@ -211,58 +229,64 @@ const butttondata = (row,$index) => { |
|
|
{ |
|
|
{ |
|
|
label: '导入', |
|
|
label: '导入', |
|
|
name: 'importCountJob', |
|
|
name: 'importCountJob', |
|
|
hide: isShowMainButton(row,['2']), |
|
|
hide: isShowMainButton(row, ['2']), |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
color: '', |
|
|
color: '', |
|
|
link: true, //文本展现按钮 |
|
|
link: true, //文本展现按钮 |
|
|
hasPermi: '' // wms:count-job-main:importCountJob |
|
|
hasPermi: '' // wms:count-job-main:importCountJob |
|
|
}, |
|
|
}, |
|
|
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 |
|
|
defaultButtons.mainListJobAbaBtn({ hide: isShowMainButton(row, ['2']) }), // 放弃 |
|
|
{ |
|
|
{ |
|
|
label: '完成', |
|
|
label: '完成', |
|
|
name: 'done', |
|
|
name: 'done', |
|
|
hide: isShowMainButton(row,['2']), |
|
|
hide: isShowMainButton(row, ['2']), |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
color: '', |
|
|
color: '', |
|
|
link: true, //文本展现按钮 |
|
|
link: true, //文本展现按钮 |
|
|
hasPermi: '' // wms:count-job-main:importCountJob |
|
|
hasPermi: '' // wms:count-job-main:importCountJob |
|
|
}, |
|
|
} |
|
|
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 |
|
|
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'mainJobExe') { // 执行 |
|
|
if (val == 'mainJobExe') { |
|
|
|
|
|
// 执行 |
|
|
console.log('列表-操作按钮事件-执行') |
|
|
console.log('列表-操作按钮事件-执行') |
|
|
} else if (val == 'mainJobAba') { // 放弃 |
|
|
} else if (val == 'mainJobAba') { |
|
|
|
|
|
// 放弃 |
|
|
console.log('列表-操作按钮事件-放弃') |
|
|
console.log('列表-操作按钮事件-放弃') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
try { |
|
|
try { |
|
|
await CountJobMainApi.abandonCountJobMain(row.id) |
|
|
await CountJobMainApi.abandonCountJobMain(row.id) |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} else if (val == 'mainJobClo') { // 关闭 |
|
|
} else if (val == 'mainJobClo') { |
|
|
|
|
|
// 关闭 |
|
|
handleClose(row.id) |
|
|
handleClose(row.id) |
|
|
} else if (val == 'mainJobAcc') { // 承接 |
|
|
} else if (val == 'mainJobAcc') { |
|
|
|
|
|
// 承接 |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
try { |
|
|
try { |
|
|
await CountJobMainApi.acceptCountJobMain(row.id) |
|
|
await CountJobMainApi.acceptCountJobMain(row.id) |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
console.log('列表-操作按钮事件-承接') |
|
|
console.log('列表-操作按钮事件-承接') |
|
|
} else if (val == 'exportCountJob'){// 当前任务导出 |
|
|
} else if (val == 'exportCountJob') { |
|
|
handleExportCountJob(row.id,row.number) |
|
|
// 当前任务导出 |
|
|
} else if( val == 'importCountJob'){ // 导入 |
|
|
handleExportCountJob(row.id, row.number) |
|
|
|
|
|
} else if (val == 'importCountJob') { |
|
|
|
|
|
// 导入 |
|
|
handleImport(row.id) |
|
|
handleImport(row.id) |
|
|
} else if( val == 'done'){ // 完成 |
|
|
} else if (val == 'done') { |
|
|
|
|
|
// 完成 |
|
|
handleDone(row.id) |
|
|
handleDone(row.id) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
/** 关闭按钮操作 */ |
|
@ -272,7 +296,7 @@ const handleClose = async (id: number) => { |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
await CountJobMainApi.closeCountJobMain(id) |
|
|
await CountJobMainApi.closeCountJobMain(id) |
|
|
message.success(t('common.closeSuccess')) |
|
|
message.success(t('common.closeSuccess')) |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
@ -283,21 +307,37 @@ const handleDone = async (id: number) => { |
|
|
await message.confirm('确认完成吗?') |
|
|
await message.confirm('确认完成吗?') |
|
|
tableObject.loading = true |
|
|
tableObject.loading = true |
|
|
await CountJobMainApi.doneCountJobMain(id) |
|
|
await CountJobMainApi.doneCountJobMain(id) |
|
|
buttonBaseClick('refresh',null) |
|
|
buttonBaseClick('refresh', null) |
|
|
} finally { |
|
|
} finally { |
|
|
tableObject.loading = false |
|
|
tableObject.loading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
// 获取部门 用于详情 部门回显 |
|
|
const { wsCache } = useCache() |
|
|
const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|
const detailRef = ref() |
|
|
const detailRef = ref() |
|
|
|
|
|
const countJobDetailTableColumns = ref({}) |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name |
|
|
const departmentCode = wsCache |
|
|
|
|
|
.get(CACHE_KEY.DEPT) |
|
|
|
|
|
.find((account) => account.id == row.departmentCode)?.name |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) |
|
|
detailRef.value.openDetail(row, titleName, titleValue,"jobCountMain") |
|
|
// 盲盘的时候不显示数量 |
|
|
|
|
|
countJobDetailTableColumns.value.tableColumns = [] |
|
|
|
|
|
if (!row.isShow) { |
|
|
|
|
|
CountJobDetail.allSchemas.tableColumns.forEach((item) => { |
|
|
|
|
|
if (item.field != 'qty') { |
|
|
|
|
|
countJobDetailTableColumns.value.tableColumns.push(item) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
countJobDetailTableColumns.value.tableColumns = JSON.parse( |
|
|
|
|
|
JSON.stringify(CountJobDetail.allSchemas.tableColumns) |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'jobCountMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
@ -318,7 +358,7 @@ const handleExport = async () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 单条任务导出 */ |
|
|
/** 单条任务导出 */ |
|
|
const handleExportCountJob = async (id: number,number: string) => { |
|
|
const handleExportCountJob = async (id: number, number: string) => { |
|
|
try { |
|
|
try { |
|
|
await message.exportConfirm() |
|
|
await message.exportConfirm() |
|
|
exportLoading.value = true |
|
|
exportLoading.value = true |
|
@ -327,7 +367,7 @@ const handleExportCountJob = async (id: number,number: string) => { |
|
|
// download.excel(data, '盘点任务主'+number+'.xlsx') |
|
|
// download.excel(data, '盘点任务主'+number+'.xlsx') |
|
|
download.excel(data, `【${excelTitle.value}${number}】【${formatDate(new Date())}】.xlsx`) |
|
|
download.excel(data, `【${excelTitle.value}${number}】【${formatDate(new Date())}】.xlsx`) |
|
|
} catch { |
|
|
} catch { |
|
|
}finally { |
|
|
} finally { |
|
|
exportLoading.value = false |
|
|
exportLoading.value = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -336,7 +376,7 @@ const handleExportCountJob = async (id: number,number: string) => { |
|
|
const importFormRef = ref() |
|
|
const importFormRef = ref() |
|
|
const rowMasterIdRef = ref('') |
|
|
const rowMasterIdRef = ref('') |
|
|
const handleImport = (id: string) => { |
|
|
const handleImport = (id: string) => { |
|
|
rowMasterIdRef.value = id; |
|
|
rowMasterIdRef.value = id |
|
|
importFormRef.value.open() |
|
|
importFormRef.value.open() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|