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. 219
      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 rowRef = ref()
const allSchemasRef = ref() const allSchemasRef = ref()
const multipleBol = ref(false) 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 searchDialogVisible.value = true
formFieldRef.value = formField formFieldRef.value = formField
searchFieldRef.value = searchField searchFieldRef.value = searchField
@ -84,7 +84,8 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
getListApi: getPage.value // getListApi: getPage.value //
}) })
tableObjectRef.value = tableObject tableObjectRef.value = tableObject
if (searchCondition) tableObjectRef.value.params = searchCondition if (searchCondition) tableObjectRef.value.params = searchCondition;
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams setSearchParamsRef.value = setSearchParams

24
src/utils/disposition/defaultButtons.ts

@ -699,6 +699,30 @@ export function mainCountAdjustRequesttBtn(option:any) {
hasPermi: '' 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){ function __defaultBtnOption(option:any,specific:any){
return { return {

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

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="CountRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="CountRequestMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</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') {
// //
@ -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)
.then(() => {
message.success(t('关闭成功')) message.success(t('关闭成功'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainReAdd') { // } else if (val == 'mainReAdd') {
//
await message.confirm('确认要重新添加吗?') await message.confirm('确认要重新添加吗?')
CountRequestMainApi.reAdd(row.id).then(() => { CountRequestMainApi.reAdd(row.id)
.then(() => {
message.success(t('添加成功')) message.success(t('添加成功'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainSubmit') { // } else if (val == 'mainSubmit') {
//
await message.confirm('确认要提交审批吗?') await message.confirm('确认要提交审批吗?')
CountRequestMainApi.submit(row.id).then(() => { CountRequestMainApi.submit(row.id)
.then(() => {
message.success(t('提交审批成功')) message.success(t('提交审批成功'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainTurnDown') { // } else if (val == 'mainTurnDown') {
//
await message.confirm('确认要驳回吗?') await message.confirm('确认要驳回吗?')
CountRequestMainApi.refused(row.id).then(() => { CountRequestMainApi.refused(row.id)
.then(() => {
message.success(t('驳回成功')) message.success(t('驳回成功'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainApprove') { // } else if (val == 'mainApprove') {
//
await message.confirm('确认要审批通过吗?') await message.confirm('确认要审批通过吗?')
CountRequestMainApi.agree(row.id).then(() => { CountRequestMainApi.agree(row.id)
.then(() => {
message.success(t('审批已通过')) message.success(t('审批已通过'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'mainHandle') { // } else if (val == 'mainHandle') {
//
await message.confirm('确认要处理吗?') await message.confirm('确认要处理吗?')
CountRequestMainApi.handle(row.id).then(() => { CountRequestMainApi.handle(row.id)
.then(() => {
message.success(t('处理成功')) message.success(t('处理成功'))
getList() getList()
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
}) })
} else if (val == 'edit') { // } 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)
} }
@ -363,9 +478,9 @@ 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([])

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

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

Loading…
Cancel
Save