Browse Source

Merge remote-tracking branch 'origin/master'

master
zhaoxuebing 11 months ago
parent
commit
a439097924
  1. 14
      src/api/wms/countRequestMain/index.ts
  2. 3
      src/components/SearchTableCount/index.ts
  3. 222
      src/components/SearchTableCount/src/SearchTableCount.vue
  4. 1
      src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts
  5. 156
      src/views/wms/countManage/count/countRequestMain/index.vue

14
src/api/wms/countRequestMain/index.ts

@ -92,3 +92,17 @@ export const refused = async (id) => {
export const handle = async (id) => {
return await request.put({ url: `/wms/count-request-main/handle?id=` + id })
}
//重盘
export const reCount = async (data) => {
return await request.put({ url: `/wms/count-request-main/reCount`,data})
}
//监盘
export const superviseCount = async (data) => {
return await request.put({ url: `/wms/count-request-main/supervise`,data})
}
//生成盘点调整申请
export const generateCountadjustRequest = async (id) => {
return await request.put({ url: `/wms/count-request-main/generateCountadjustRequest?id=` + id })
}

3
src/components/SearchTableCount/index.ts

@ -0,0 +1,3 @@
import SearchTableCount from './src/SearchTableCount.vue'
export { SearchTableCount }

222
src/components/SearchTableCount/src/SearchTableCount.vue

@ -0,0 +1,222 @@
<template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="'80%'">
<ContentWrap>
<el-radio-group v-model="radioListType">
<el-radio :label="item.label" v-for="(item, index) in radioListRef" :key="index">{{
item.title
}}</el-radio>
</el-radio-group>
</ContentWrap>
<!-- 搜索工作栏 -->
<!-- <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> -->
<el-form
ref="formRef"
:model="ruleForm"
:rules="rules"
label-width="120px"
class="demo-ruleForm"
status-icon
v-if="radioListRef.length == 2 && radioListType == 1"
>
<el-form-item label="数量" prop="count">
<el-input v-model.number="ruleForm.count" />
</el-form-item>
</el-form>
<!-- 列表头部 -->
<div
v-if="
(radioListRef.length == 3 && radioListType == 3) ||
(radioListRef.length == 2 && radioListType == 2)
"
>
<TableHead
:HeadButttondata="HeadButttondata"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="allSchemasRef"
/>
</div>
<ContentWrap
v-if="
(radioListRef.length == 3 && radioListType == 3) ||
(radioListRef.length == 2 && radioListType == 2)
"
>
<Table
ref="searchTableRef"
:columns="tableColumns"
:data="tableObjectRef.tableList"
:loading="tableObjectRef.loading"
:pagination="{
total: tableObjectRef.total
}"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
:selection="true"
:reserveSelection="true"
row-key="id"
/>
</ContentWrap>
<template #footer>
<div class="flex items-center">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="searchDialogVisible = false"> </el-button>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// const { t } = useI18n() //
const message = useMessage() //
const radioListType = ref(1)
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const searchDialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
//
const HeadButttondata = [
defaultButtons.defaultFilterBtn(null) //
]
const formRef = ref()
const ruleForm = ref({
count: ''
})
const rules = ref({
count: [
{required: true, message: '请输入数量' , trigger: 'blur' },
{ type: 'number', message: '必须是数字', trigger: 'blur' },
]
})
/** 打开弹窗 */
const getListRef = ref()
const setSearchParamsRef = ref()
const tableObjectRef = ref()
const getPage: any = ref()
const searchSchema = ref()
const tableColumns = ref()
const formFieldRef = ref()
const searchFieldRef = ref()
const typeRef = ref()
const rowRef = ref()
const allSchemasRef = ref()
const multipleBol = ref(false)
const radioListRef = ref() //
const open = (
titleName: any,
allSchemas: any,
getApiPage: any,
formField: any,
searchField: any,
multiple: any,
type: any,
row: any,
searchCondition: any,
isCountRequestRe: any,
radioList: any
) => {
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns.filter((item) => item.field !== 'action')
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row
multipleBol.value = multiple
radioListRef.value = radioList
radioListType.value = 1
ruleForm.value.count = ''
// dialogTitle.value = t('action.' + type)
dialogTitle.value = titleName
const { tableObject, tableMethods } = useTable({
getListApi: getPage.value //
})
tableObjectRef.value = tableObject
if (searchCondition) tableObjectRef.value.params = searchCondition
//
const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams
getListRef.value = getList
getList()
}
//
const searchFormClick = (searchData) => {
tableObjectRef.value.params = {
isSearch: true,
filters: searchData.filters
}
getListRef.value() //
}
defineExpose({ open }) // open
// Table ref
const searchTableRef = ref()
/** 提交表单 */
const emit = defineEmits(['searchTableSuccess']) // searchTableSuccess
const submitForm = async () => {
//
let selections = ''
if(radioListRef.value.length == 2 && radioListType.value == 1){
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
}
if (
(radioListRef.value.length == 3 && radioListType.value == 3) ||
(radioListRef.value.length == 2 && radioListType.value == 2)
) {
selections = searchTableRef.value.selections
//
if (!multipleBol.value) {
if (selections.length > 1 || selections.length == 0) {
message.warning('请选择一条数据!')
formLoading.value = false
return
}
//
} else {
if (selections.length == 0) {
message.warning('至少选择一条数据!')
formLoading.value = false
return
}
}
}
formLoading.value = true
try {
searchDialogVisible.value = false
//
emit(
'searchTableSuccess',
formFieldRef.value,
searchFieldRef.value,
selections,
radioListType.value,
rowRef.value,
ruleForm.value.count,
)
} finally {
formLoading.value = false
}
}
</script>
<style scoped lang="scss">
</style>

1
src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts

@ -252,6 +252,7 @@ export const CountRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action',
isDetail: false,
isForm: false,
isTable: false,
table: {
width: 180,
fixed: 'right'

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

@ -90,9 +90,9 @@
:mode="2"
/>
<SearchTable
<SearchTableCount
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
@searchTableSuccess="searchTableSuccessCount"
/>
</template>
@ -107,7 +107,7 @@ import {
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'
import { SearchTableCount } from '@/components/SearchTableCount'
//
defineOptions({ name: 'CountRequestMain' })
@ -160,6 +160,34 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}
})
}
//
const searchTableSuccessCount = (formField, searchField, val, type,row,count) => {
nextTick(() => {
if (formField == 'reCount') {
//
if(type == 3){
row.subList = val
}
row.type = type
CountRequestMainApi.reCount(row).then((res)=>{
message.success('重盘成功')
getList()
})
} else {
//
if(type == 2){
row.subList = val
}else if(type == 1){
row.count = count
}
row.type = type
CountRequestMainApi.superviseCount(row).then((res)=>{
message.success('监盘成功')
getList()
})
}
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
@ -231,6 +259,15 @@ const isShowReCountMainButton = (row, val) => {
return true
}
}
//
const isShowGenerateMainButton = (row, val) => {
if (row.countAdjustStatus == 2) {
return false
} else {
return true
}
}
const searchTableRef = ref()
// -
@ -271,7 +308,11 @@ const butttondata = (row) => {
defaultButtons.mainSuperviseCountBtn({
hide: isShowReCountMainButton(row, ['1']),
hasPermi: 'wms:count-request-main:supervise'
}) //
}), //
defaultButtons.mainCountAdjustRequesttBtn({
hide: isShowGenerateMainButton(row, ['1']),
hasPermi: 'wms:count-request-main:generate'
}) //
]
}
@ -346,25 +387,38 @@ const buttonTableClick = async (val, row) => {
})
} 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})
const radioList = ref([{
label:1,
title:'全部'
},{
label:2,
title:'差异'
},{
label:3,
title:'选择'
}])
searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'reCount','',true,'',row,{masterId:row.id},'',radioList.value)
} else if (val == 'mainSuperviseCount') {
//
// CountRequestMainApi.handle(row.id).then(() => {
// message.success(t(''))
// getList()
// }).catch(err => {
// console.log(err)
// })
const radioList = ref([{
label:1,
title:'数量'
},{
label:2,
title:'选择'
}])
searchTableRef.value.open('盘点申请明细',CountRequestDetail.allSchemas,CountRequestDetailApi.getCountRequestDetailPage,'superviseCount','',true,'',row,{masterId:row.id},'',radioList.value)
} else if (val == 'countAdjustRequest') {
//
await message.confirm('确认要生成盘点调整申请吗?')
CountRequestMainApi.generateCountadjustRequest(row.id)
.then(() => {
message.success(t('已生成盘点调整申请'))
getList()
})
.catch((err) => {
console.log(err)
})
} else if (val == 'edit') {
//
openForm('update', row)
@ -381,66 +435,6 @@ const openForm = async (type: string, row?: number) => {
formRef.value.open(type, row)
}
/** 关闭按钮操作 */
const handleClose = async (id: number) => {
try {
await message.confirm(t('common.confirmColse'))
await CountRequestMainApi.closeCountRequestMain(id)
message.success(t('common.closeSuccess'))
await getList()
} catch {}
}
/** 重新添加按钮操作 */
const handleReAdd = async (id: number) => {
try {
await message.confirm(t('common.confirmReAdd'))
await CountRequestMainApi.reAddCountRequestMain(id)
message.success(t('common.reAddSuccess'))
await getList()
} catch {}
}
/** 审批通过按钮操作 */
const handleAgree = async (id: number) => {
try {
await message.confirm(t('common.confirmAgree'))
await CountRequestMainApi.agreeCountRequestMain(id)
message.success(t('common.agreeSuccess'))
await getList()
} catch {}
}
/** 审批驳回按钮操作 */
const handleRefused = async (id: number) => {
try {
await message.confirm(t('common.confirmRefused'))
await CountRequestMainApi.refusedCountRequestMain(id)
message.success(t('common.refusedSuccess'))
await getList()
} catch {}
}
/** 处理按钮操作 */
const handleHandle = async (id: number) => {
try {
await message.confirm(t('common.confirmHandle'))
await CountRequestMainApi.handleCountRequestMain(id)
message.success(t('common.handleSuccess'))
await getList()
} catch {}
}
/** 提交按钮操作 */
const handleSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
await CountRequestMainApi.submitCountRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
} catch {}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {

Loading…
Cancel
Save