|
|
@ -1,7 +1,11 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="CountJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="CountJobMain.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -16,7 +20,8 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table |
|
|
|
v-clientTable |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -33,7 +38,10 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<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> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -58,7 +66,7 @@ |
|
|
|
ref="detailRef" |
|
|
|
:isBasic="false" |
|
|
|
:allSchemas="CountJobMain.allSchemas" |
|
|
|
:detailAllSchemas="CountJobDetail.allSchemas" |
|
|
|
:detailAllSchemas="countJobDetailTableColumns" |
|
|
|
:detailAllSchemasRules="CountJobDetailRules" |
|
|
|
:searchTableParams="searchTableParams" |
|
|
|
:apiPage="CountJobDetailApi.getCountJobDetailPage" |
|
|
@ -76,17 +84,21 @@ |
|
|
|
:extend="rowMasterIdRef" |
|
|
|
:isShowDownloadBtn="true" |
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
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 CountJobDetailApi from '@/api/wms/countJobDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
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' |
|
|
|
// 盘点任务主 |
|
|
|
defineOptions({ name: 'CountJobMain' }) |
|
|
@ -155,7 +167,7 @@ const HeadButttondata = [ |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-job-main:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -168,9 +180,11 @@ const HeadButttondata = [ |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'export') { // 导出 |
|
|
|
if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0) { |
|
|
|
searchFormClick({ |
|
|
|
filters: tableObject.params.filters |
|
|
@ -178,8 +192,10 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} else { |
|
|
|
getList() |
|
|
|
} |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
@ -195,10 +211,12 @@ const isShowMainButton = (row,val) => { |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row, $index) => { |
|
|
|
|
|
|
|
return [ |
|
|
|
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: '导出', |
|
|
|
name: 'exportCountJob', |
|
|
@ -226,16 +244,18 @@ const butttondata = (row,$index) => { |
|
|
|
color: '', |
|
|
|
link: true, //文本展现按钮 |
|
|
|
hasPermi: '' // wms:count-job-main:importCountJob |
|
|
|
}, |
|
|
|
} |
|
|
|
// defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainJobExe') { // 执行 |
|
|
|
if (val == 'mainJobExe') { |
|
|
|
// 执行 |
|
|
|
console.log('列表-操作按钮事件-执行') |
|
|
|
} else if (val == 'mainJobAba') { // 放弃 |
|
|
|
} else if (val == 'mainJobAba') { |
|
|
|
// 放弃 |
|
|
|
console.log('列表-操作按钮事件-放弃') |
|
|
|
tableObject.loading = true |
|
|
|
try { |
|
|
@ -244,9 +264,11 @@ const buttonTableClick = async (val, row) => { |
|
|
|
} finally { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
} else if (val == 'mainJobClo') { // 关闭 |
|
|
|
} else if (val == 'mainJobClo') { |
|
|
|
// 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
} else if (val == 'mainJobAcc') { // 承接 |
|
|
|
} else if (val == 'mainJobAcc') { |
|
|
|
// 承接 |
|
|
|
tableObject.loading = true |
|
|
|
try { |
|
|
|
await CountJobMainApi.acceptCountJobMain(row.id) |
|
|
@ -255,14 +277,16 @@ const buttonTableClick = async (val, row) => { |
|
|
|
tableObject.loading = false |
|
|
|
} |
|
|
|
console.log('列表-操作按钮事件-承接') |
|
|
|
} else if (val == 'exportCountJob'){// 当前任务导出 |
|
|
|
} else if (val == 'exportCountJob') { |
|
|
|
// 当前任务导出 |
|
|
|
handleExportCountJob(row.id, row.number) |
|
|
|
} else if( val == 'importCountJob'){ // 导入 |
|
|
|
} else if (val == 'importCountJob') { |
|
|
|
// 导入 |
|
|
|
handleImport(row.id) |
|
|
|
} else if( val == 'done'){ // 完成 |
|
|
|
} else if (val == 'done') { |
|
|
|
// 完成 |
|
|
|
handleDone(row.id) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
@ -289,15 +313,31 @@ const handleDone = async (id: number) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
|
const { wsCache } = useCache() |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
const countJobDetailTableColumns = ref({}) |
|
|
|
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)) |
|
|
|
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') |
|
|
|
} |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
@ -336,7 +376,7 @@ const handleExportCountJob = async (id: number,number: string) => { |
|
|
|
const importFormRef = ref() |
|
|
|
const rowMasterIdRef = ref('') |
|
|
|
const handleImport = (id: string) => { |
|
|
|
rowMasterIdRef.value = id; |
|
|
|
rowMasterIdRef.value = id |
|
|
|
importFormRef.value.open() |
|
|
|
} |
|
|
|
|
|
|
|