Browse Source

上线结算库位

hella_zhaoxuebing
王宇飞 2 months ago
parent
commit
3a9c4b6363
  1. 80
      src/api/wms/settlementReport/index.ts
  2. 18
      src/components/SearchTable/src/SearchTable.vue
  3. 279
      src/views/wms/issueManage/onlinesettlement/settlementReport/index.vue
  4. 186
      src/views/wms/issueManage/onlinesettlement/settlementReport/settlementReport.data.ts

80
src/api/wms/settlementReport/index.ts

@ -0,0 +1,80 @@
import request from '@/config/axios'
export interface SettlementConfigurationVO {
id: number
supplierCode: string
itemCode: string
fromWarehouseCode: string
toWarehouseCode: string
remark: string
concurrencyStamp: number
}
// 查询上线结算配置列表
export const getSettlementReportPage = async (params) => {
// if (params.isSearch) {
// delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/wms/onlinesettlement-info/settlementInfoReport/senior', data })
// } else {
return await request.get({ url: `/wms/onlinesettlement-info/settlementInfoReport`, params })
// }
}
// 查询上线结算配置列表
export const getSettlementReportBalance = async (params) => {
// if (params.isSearch) {
// delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/wms/onlinesettlement-info/settlementInfoReport/senior', data })
// } else {
return await request.get({ url: `/wms/onlinesettlement-info/settlementInfoReportBalance`, params })
// }
}
// 批量结算
export const submitSettlementReport = async (data) => {
// if (params.isSearch) {
// delete params.isSearch
// const data = {...params}
// return await request.post({ url: '/wms/onlinesettlement-info/settlementInfoReport/senior', data })
// } else {
return await request.post({ url: `/wms/onlinesettlement-info/settlementInfoSubmit`, data })
// }
}
// // 查询上线结算配置详情
// export const getSettlementConfiguration = async (id: number) => {
// return await request.get({ url: `/wms/settlement-configuration/get?id=` + id })
// }
// export const editSettlementConfiguration = async (id: number) => {
// return await request.get({ url: `/wms/settlement-configuration/editView?id=` + id })
// }
// // 新增上线结算配置
// export const createSettlementConfiguration = async (data: SettlementConfigurationVO) => {
// return await request.post({ url: `/wms/settlement-configuration/create`, data })
// }
// // 修改上线结算配置
// export const updateSettlementConfiguration = async (data: SettlementConfigurationVO) => {
// return await request.put({ url: `/wms/settlement-configuration/update`, data })
// }
// // 删除上线结算配置
// export const deleteSettlementConfiguration = async (id: number) => {
// return await request.delete({ url: `/wms/settlement-configuration/delete?id=` + id })
// }
// // 导出上线结算配置 Excel
// export const exportSettlementConfiguration = async (params) => {
// return await request.download({ url: `/wms/settlement-configuration/export-excel`, params })
// }
// // 下载用户导入模板
// export const importTemplate = () => {
// return request.download({ url: '/wms/settlement-configuration/get-import-template' })
// }

18
src/components/SearchTable/src/SearchTable.vue

@ -37,10 +37,11 @@
/> />
</ContentWrap> </ContentWrap>
<template #footer> <template #footer>
<div class="flex items-center"> <slot name="footerActions"></slot>
<div class="flex items-center" v-if="!hiddenFooterActions">
<slot :name="'selectionsActions'+formFieldRef" :selections="searchTableRef?searchTableRef.selections:[]"></slot> <slot :name="'selectionsActions'+formFieldRef" :selections="searchTableRef?searchTableRef.selections:[]"></slot>
<el-button @click="submitForm" type="primary" :disabled="formLoading">{{ t(`ts.${'确 定'}`) }}</el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading">{{ t(`ts.${'确 定'}`) }}</el-button>
<el-button @click="searchDialogVisible = false">{{ t(`ts.${'取 消'}`) }}</el-button> <el-button @click="cancleClick">{{ t(`ts.${' '}`) }}</el-button>
<slot name="actions"></slot> <slot name="actions"></slot>
</div> </div>
@ -64,7 +65,12 @@ const props = defineProps({
isCheckStrictly:{ isCheckStrictly:{
type:Boolean, type:Boolean,
default:false default:false
} },
//
hiddenFooterActions:{
type:Boolean,
default:false
},
}) })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -248,7 +254,6 @@ const buttonBaseClick = (val, item) => {
} }
defineExpose({ open,openData,updateData,hiddenFilterButton ,changeDialogWidth,searchFormClick}) // open
// Table ref // Table ref
const searchTableRef = ref() const searchTableRef = ref()
@ -307,6 +312,11 @@ const rowClick = (row: any, column: any, event: Event) => {
searchTableRef.value?.elTableRef?.toggleRowSelection(row, false) searchTableRef.value?.elTableRef?.toggleRowSelection(row, false)
} }
} }
const cancleClick = ()=>{
searchDialogVisible.value = false
}
defineExpose({ open,openData,updateData,hiddenFilterButton ,changeDialogWidth,searchFormClick,submitForm,cancleClick,}) // open
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>

279
src/views/wms/issueManage/onlinesettlement/settlementReport/index.vue

@ -0,0 +1,279 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SettlementReport.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SettlementReport.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 结算库位列表 -->
<SearchTable
ref="searchTableRef"
:showSearchTableQueryFields="['itemCode']"
:hiddenFilterBtnFields="[]"
:isCheckStrictly="false"
@searchTableSuccess="searchTableSuccess"
:hiddenFooterActions="true"
>
<template #footerActions>
<div class="flex items-center" style="justify-content: flex-end;">
<el-button type="primary" @click="settlementClick">结算库位</el-button>
<el-button @click="cancleClick">{{ t(`ts.${' '}`) }}</el-button>
</div>
</template>
<template #searchQueryhahaha>
<Form
ref="basicFormRef"
:rules="SettlementReportSelectionFormRules"
:schema="SettlementReportSelectionForm.allSchemas.formSchema"
:is-col="true"
@opensearchTable="opensearchTable"
@onBlur="onBlur"
/>
</template>
</SearchTable>
<!-- 库位 -->
<SearchTable
ref="searchTableRef1"
@searchTableSuccess="searchTableSuccess1"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SettlementReport,SettlementReportRules,SettlementReportSelection,SettlementReportSelectionlRules,SettlementReportSelectionForm,SettlementReportSelectionFormRules } from './settlementReport.data'
import * as SettlementtReportApi from '@/api/wms/settlementReport'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as WarehouseApi from '@/api/wms/warehouse'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import { tableFormBlurVer, FormBlur, getListByBottonInput } from '@/api/wms/business/inputBlur'
// 线
defineOptions({ name: 'SettlementReport' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SettlementReport.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: SettlementtReportApi.getSettlementReportPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) => {
return [{
label: '结算',
name: 'settlement',
// hide: row.settledStatus!=2,
hide: '',
type: 'primary',
icon: '',
color: '',
hasPermi: ''
}]
}
const searchTableRef = ref()
// -
const buttonTableClick = async (val, row) => {
if(val == 'settlement'){
//
searchTableRef.value.open(
"批量结算",
SettlementReportSelection.allSchemas,
SettlementtReportApi.getSettlementReportBalance,
"hahaha",
"hahaha",
true,
'tableForm',
null,
{
supplierCode:row.supplierCode,
itemCode:row.itemCode,
batch:row.batch
},
undefined,
false,
null
)
}
}
//
const settlementClick = ()=>{
if(!basicFormRef.value.formModel['toLocationCode']){
message.warning('请选择结算库位')
return
}else{
searchTableRef.value.submitForm()
}
}
const cancleClick = ()=>{
searchTableRef.value.cancleClick()
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
console.log('formModel',basicFormRef.value.formModel['toLocationCode'])
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row )
nextTick(async () => {
let ids = []
ids = val.map(item=>(item['id']))
ids.join(',')
let res = await SettlementtReportApi.submitSettlementReport({
ids,
toLocationCode:basicFormRef.value.formModel['toLocationCode']||''
})
if(res==1){
message.success('提交成功')
getList()
}
})
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 添加/修改操作 */
const basicFormRef = ref()
//
const opensearchTable = (
formField,
searchField,
searchTitle,
searchAllSchemas,
searchPage,
searchCondition,
multiple,
type,
row,
isConcatDetailSchemas = false,
searchDetailSchemas: any
) => {
searchTableRef1.value.open(
"结算库位",
Location.allSchemas,
LocationApi.getLocationPage,
"toLocationCode",
"code",
false,
'form',
null,
{
// supplierCode:row.supplierCode,
// itemCode:row.itemCode,
// batch:row.batch
},
undefined,
false,
null
)
}
const searchTableRef1 = ref()
const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row )
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
basicFormRef.value.setValues(setV)
})
}
const onBlur = async (field, e) => {
let formSchemaObj = SettlementReportSelectionForm.allSchemas.formSchema.find((item) => item.field == field)?.componentProps
if (formSchemaObj?.enterSearch) {
await FormBlur(
field,
e,
routeName.value,
basicFormRef.value,
null,
formSchemaObj,
(list) => {
searchTableSuccess1(field, formSchemaObj.searchField, list, basicFormRef.value, 'form')
}
)
}
}
/** 初始化 **/
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await SettlementConfigurationApi.importTemplate()
})
</script>

186
src/views/wms/issueManage/onlinesettlement/settlementReport/settlementReport.data.ts

@ -0,0 +1,186 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as SupplierApi from '@/api/wms/supplier'
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem} from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
import * as WarehouseApi from '@/api/wms/warehouse'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
// 表单校验
export const SettlementReportRules = reactive({
})
export const SettlementReport = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '累计收货量',
field: 'totalReceiptQty',
sort: 'custom',
},
{
label: '已结算数量',
field: 'totalSettledQty',
sort: 'custom',
},
{
label: '未结算数量',
field: 'totalOutstandingSettleQty',
sort: 'custom',
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const SettlementReportSelection = useCrudSchemas(reactive<CrudSchema[]>([
{
label: ' ',
field: 'hahaha',
table: {
width: 180
},
isTable:false,
isDetail:false,
form: {
componentProps: {
type: 'slot',
}
},
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '物品名称',
field: 'itemName',
sort: 'custom',
},
{
label: '批次',
field: 'batch',
sort: 'custom',
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
}
]))
//表单校验
export const SettlementReportSelectionRules = reactive({
// fromWarehouseCode: [
// { required: true, message: '请选择来源仓库', trigger: 'change' }
// ],
})
export const SettlementReportSelectionForm = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '结算库位',
field: 'toLocationCode',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择结算库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}], // 失去焦点校验参数
}
}
}
]))
export const SettlementReportSelectionFormRules = reactive({
toLocationCode: [
{ required: true, message: '请选择结算库位', trigger: 'change' }
],
})
Loading…
Cancel
Save