Browse Source

HL-5312 pda提交后,pc明细的数量是盘点的数量,导致盘平,盲盘的时候不显示数量

hella_online_20240816
zhang_li 3 months ago
parent
commit
f817a189a6
  1. 164
      src/views/wms/countManage/count/countJobMain/index.vue

164
src/views/wms/countManage/count/countJobMain/index.vue

@ -1,22 +1,27 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="CountJobMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountJobMain.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountJobMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -27,13 +32,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,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
<template #action="{ row, $index }">
<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' })
@ -106,16 +118,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') {
//
@ -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 = []
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountJobMainApi.getCountJobMainPage //
@ -152,10 +164,10 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:count-job-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-job-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -168,24 +180,28 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} 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 { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -194,15 +210,17 @@ const isShowMainButton = (row,val) => {
}
// -
const butttondata = (row,$index) => {
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.mainListJobAccBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListJobCloBtn({
hide: isShowMainButton(row, ['1', '2']),
hasPermi: 'wms:count-job-main:close'
}), //
{
label: '导出',
name: 'exportCountJob',
hide: isShowMainButton(row,['1','2']),
hide: isShowMainButton(row, ['1', '2']),
type: 'primary',
color: '',
link: true, //
@ -211,58 +229,64 @@ const butttondata = (row,$index) => {
{
label: '导入',
name: 'importCountJob',
hide: isShowMainButton(row,['2']),
hide: isShowMainButton(row, ['2']),
type: 'success',
color: '',
link: true, //
hasPermi: '' // wms:count-job-main:importCountJob
},
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListJobAbaBtn({ hide: isShowMainButton(row, ['2']) }), //
{
label: '完成',
name: 'done',
hide: isShowMainButton(row,['2']),
hide: isShowMainButton(row, ['2']),
type: 'success',
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 {
await CountJobMainApi.abandonCountJobMain(row.id)
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} 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)
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} finally {
tableObject.loading = false
}
console.log('列表-操作按钮事件-承接')
} else if (val == 'exportCountJob'){//
handleExportCountJob(row.id,row.number)
} else if( val == 'importCountJob'){ //
} else if (val == 'exportCountJob') {
//
handleExportCountJob(row.id, row.number)
} else if (val == 'importCountJob') {
//
handleImport(row.id)
} else if( val == 'done'){ //
} else if (val == 'done') {
//
handleDone(row.id)
}
}
/** 关闭按钮操作 */
@ -272,7 +296,7 @@ const handleClose = async (id: number) => {
tableObject.loading = true
await CountJobMainApi.closeCountJobMain(id)
message.success(t('common.closeSuccess'))
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} finally {
tableObject.loading = false
}
@ -283,21 +307,37 @@ const handleDone = async (id: number) => {
await message.confirm('确认完成吗?')
tableObject.loading = true
await CountJobMainApi.doneCountJobMain(id)
buttonBaseClick('refresh',null)
buttonBaseClick('refresh', null)
} finally {
tableObject.loading = false
}
}
//
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')
}
/** 导出按钮操作 */
@ -318,7 +358,7 @@ const handleExport = async () => {
}
/** 单条任务导出 */
const handleExportCountJob = async (id: number,number: string) => {
const handleExportCountJob = async (id: number, number: string) => {
try {
await message.exportConfirm()
exportLoading.value = true
@ -327,7 +367,7 @@ const handleExportCountJob = async (id: number,number: string) => {
// download.excel(data, ''+number+'.xlsx')
download.excel(data, `${excelTitle.value}${number}】【${formatDate(new Date())}】.xlsx`)
} catch {
}finally {
} finally {
exportLoading.value = false
}
}
@ -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()
}

Loading…
Cancel
Save