Browse Source

备货记录页面设计

master_hella_20240701
chenfang 6 months ago
parent
commit
93a10ab72e
  1. 117
      src/views/wms/deliversettlementManage/stockup/stockupMainRecord/index.vue
  2. 423
      src/views/wms/deliversettlementManage/stockup/stockupMainRecord/stockupMainRecord.data.ts

117
src/views/wms/deliversettlementManage/stockup/stockupMainRecord/index.vue

@ -27,43 +27,47 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<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" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
ref="formRef"
@success="getList"
:rules="StockupMainRecordRules"
:formAllSchemas="StockupMainRecord.allSchemas"
:apiUpdate="StockupMainRecordApi.updateStockupMainRecord"
:apiCreate="StockupMainRecordApi.createStockupMainRecord"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
:tableAllSchemas="StockupDetailRecord.allSchemas"
:tableFormRules="StockupDetailRecordRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainRecord.allSchemas" />
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="StockupMainRecord.allSchemas"
:detailAllSchemas="StockupDetailRecord.allSchemas"
:detailAllSchemasRules="StockupDetailRecordRules"
:apiPage="StockupDetailRecordApi.getStockupDetailRecordPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { StockupMainRecord,StockupMainRecordRules } from './stockupMainRecord.data'
import { StockupMainRecord,StockupMainRecordRules,StockupDetailRecord,StockupDetailRecordRules } from './stockupMainRecord.data'
import * as StockupMainRecordApi from '@/api/wms/stockupMainRecord'
import * as StockupDetailRecordApi from '@/api/wms/stockupDetailRecord'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'StockupMainRecord' })
const message = useMessage() //
@ -74,15 +78,6 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(StockupMainRecord.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
@ -97,8 +92,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:stockupMainRecord:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:stockupMainRecord:export'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:deliver-record-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -114,12 +108,16 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'export') { //
if (val == 'export') { //
handleExport()
} 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 { //
console.log('其他按钮', item)
@ -127,67 +125,18 @@ const buttonBaseClick = (val, item) => {
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:stockupMainRecord:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:stockupMainRecord:delete'}), //
]
const butttondata = (row) => {
return []
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =StockupMainRecord.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await StockupMainRecordApi.createStockupMainRecord(data)
message.success(t('common.createSuccess'))
} else {
await StockupMainRecordApi.updateStockupMainRecord(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainRecord')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await StockupMainRecordApi.deleteStockupMainRecord(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
detailRef.value.openDetail(row, titleName, titleValue,'recordDeliverMain')
}
/** 导出按钮操作 */
@ -206,7 +155,6 @@ const handleExport = async () => {
}
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
@ -220,5 +168,4 @@ const searchFormClick = (searchData) => {
onMounted(async () => {
getList()
})
</script>

423
src/views/wms/deliversettlementManage/stockup/stockupMainRecord/stockupMainRecord.data.ts

@ -5,65 +5,74 @@ import { dateFormatter } from '@/utils/formatTime'
export const StockupMainRecordRules = reactive({
})
//主表
export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
label: '单据号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180
},
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
},
{
label: '发货计划单号',
field: 'deliverPlanNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
{
label: '明细',
field: 'details',
sort: 'custom',
isSearch: true,
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
table: {
width: 150
},
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
table: {
width: 150
},
},
{
@ -71,7 +80,6 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'executeTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -80,6 +88,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
@ -93,46 +104,33 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'activeDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetime',
valueFormat: 'x'
}
@ -143,7 +141,6 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dueTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
@ -152,6 +149,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
@ -161,39 +161,270 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '部门',
field: 'departmentCode',
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: true,
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '用户组',
field: 'userGroupCode',
label: '部门',
field: 'departmentCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 100
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
table: {
width: 180
},
isForm: false,
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 180
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.LOCATION_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 180
},
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//子表
// 表单校验
export const StockupDetailRecordRules = reactive({
})
export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
},
{
label: '业务类型',
field: 'businessType',
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从器具号',
field: 'fromContainerNumber',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到器具号',
field: 'toContainerNumber',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '金额',
field: 'amount',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
@ -201,6 +432,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'remark',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '创建时间',
@ -208,6 +442,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
table: {
width: 180
},
search: {
component: 'DatePicker',
componentProps: {
@ -219,46 +456,100 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false,
},
{
label: '扩展属性',
field: 'extraProperties',
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '地点ID',
field: 'siteId',
label: '物品名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '代码',
field: 'code',
label: '物品描述1',
field: 'itemDesc1',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',

Loading…
Cancel
Save