Browse Source

盘点

master
zhang_li 11 months ago
parent
commit
11a3dfe77c
  1. 5
      src/components/SearchTable/src/SearchTable.vue
  2. 24
      src/utils/disposition/defaultButtons.ts
  3. 293
      src/views/wms/countManage/count/countRequestMain/index.vue
  4. 6
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

5
src/components/SearchTable/src/SearchTable.vue

@ -67,7 +67,7 @@ const typeRef = ref()
const rowRef = ref()
const allSchemasRef = ref()
const multipleBol = ref(false)
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any ) => {
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any,multiple: any, type: any, row: any, searchCondition:any , isCountRequestRe:any ) => {
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
@ -84,7 +84,8 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
getListApi: getPage.value //
})
tableObjectRef.value = tableObject
if (searchCondition) tableObjectRef.value.params = searchCondition
if (searchCondition) tableObjectRef.value.params = searchCondition;
//
const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams

24
src/utils/disposition/defaultButtons.ts

@ -699,6 +699,30 @@ export function mainCountAdjustRequesttBtn(option:any) {
hasPermi: ''
})
}
// 主列表-重盘
export function mainReCountBtn(option:any) {
return __defaultBtnOption(option,{
label: '重盘',
name: 'mainReCount',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-监盘
export function mainSuperviseCountBtn(option:any) {
return __defaultBtnOption(option,{
label: '监盘',
name: 'mainSuperviseCount',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则
function __defaultBtnOption(option:any,specific:any){
return {

293
src/views/wms/countManage/count/countRequestMain/index.vue

@ -1,18 +1,22 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="CountRequestMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountRequestMain.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountRequestMain.allSchemas"
/>
<!-- 列表 -->
<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') {
//
@ -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 = []
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountRequestMainApi.getCountRequestMainPage //
@ -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'}), //
]
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.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(() => {
message.success(t('关闭成功'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainReAdd') { //
CountRequestMainApi.close(row.id)
.then(() => {
message.success(t('关闭成功'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'mainReAdd') {
//
await message.confirm('确认要重新添加吗?')
CountRequestMainApi.reAdd(row.id).then(() => {
message.success(t('添加成功'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainSubmit') { //
CountRequestMainApi.reAdd(row.id)
.then(() => {
message.success(t('添加成功'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'mainSubmit') {
//
await message.confirm('确认要提交审批吗?')
CountRequestMainApi.submit(row.id).then(() => {
message.success(t('提交审批成功'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainTurnDown') { //
CountRequestMainApi.submit(row.id)
.then(() => {
message.success(t('提交审批成功'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'mainTurnDown') {
//
await message.confirm('确认要驳回吗?')
CountRequestMainApi.refused(row.id).then(() => {
message.success(t('驳回成功'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainApprove') { //
CountRequestMainApi.refused(row.id)
.then(() => {
message.success(t('驳回成功'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'mainApprove') {
//
await message.confirm('确认要审批通过吗?')
CountRequestMainApi.agree(row.id).then(() => {
message.success(t('审批已通过'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainHandle') { //
CountRequestMainApi.agree(row.id)
.then(() => {
message.success(t('审批已通过'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'mainHandle') {
//
await message.confirm('确认要处理吗?')
CountRequestMainApi.handle(row.id).then(() => {
message.success(t('处理成功'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
CountRequestMainApi.handle(row.id)
.then(() => {
message.success(t('处理成功'))
getList()
})
.catch((err) => {
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)
} 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)
}
@ -362,10 +477,10 @@ const handleExport = async () => {
}
/**
* tableForm方法
*/
* tableForm方法
*/
const tableFormKeys = {}
CountRequestDetail.allSchemas.tableFormColumns.forEach(item => {
CountRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])

6
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

@ -1100,9 +1100,9 @@ export const PurchasereturnRequestDetailRules = reactive({
// poLine: [
// { required: true, message: '请输入订单行', trigger: 'blur' }
// ],
reason: [
{ required: true, message: '请选择原因', trigger: 'change' }
],
// reason: [
// { required: true, message: '请选择原因', trigger: 'change' }
// ],
itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'blur' }
],

Loading…
Cancel
Save