Browse Source

备货记录页面设计

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

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

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

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

@ -5,73 +5,81 @@ import { dateFormatter } from '@/utils/formatTime'
export const StockupMainRecordRules = reactive({ export const StockupMainRecordRules = reactive({
}) })
//主表
export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: '单据号',
field: 'id', field: 'number',
sort: 'custom', sort: 'custom',
isForm: false, isSearch: true,
table: {
width: 180
},
}, },
{ {
label: '申请单号', label: '申请单号',
field: 'requestNumber', field: 'requestNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180
},
}, },
{ {
label: '任务单号', label: '任务单号',
field: 'jobNumber', field: 'jobNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180
},
}, },
{ {
label: '发货计划单号', label: '发货计划单号',
field: 'deliverPlanNumber', field: 'deliverPlanNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180
},
}, },
{ {
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
width: 150
},
}, },
{ {
label: '到仓库代码', label: '到仓库代码',
field: 'toWarehouseCode', field: 'toWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
}, width: 150
{ },
label: '明细',
field: 'details',
sort: 'custom',
isSearch: true,
}, },
{ {
label: '出库事务类型', label: '出库事务类型',
field: 'outTransactionType', field: 'outTransactionType',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
form: { width: 150
component: 'SelectV2' },
},
}, },
{ {
label: '入库事务类型', label: '入库事务类型',
field: 'inTransactionType', field: 'inTransactionType',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
form: { width: 150
component: 'SelectV2' },
},
}, },
{ {
label: '执行时间', label: '执行时间',
field: 'executeTime', field: 'executeTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -80,6 +88,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -93,46 +104,33 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'activeDate', field: 'activeDate',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, detail: {
search: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
component: 'DatePicker', },
componentProps: { table: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', width: 180
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x' valueFormat: 'x'
} }
}, },
}, },
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{ {
label: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, table: {
search: { width: 180
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')]
}
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
dateFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'datetime', type: 'datetime',
valueFormat: 'x' valueFormat: 'x'
} }
@ -143,7 +141,6 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dueTime', field: 'dueTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -152,6 +149,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -161,46 +161,280 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '部门', label: '是否可用',
field: 'departmentCode', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
isSearch: true, table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}, },
{ {
label: '用户组', label: '部门',
field: 'userGroupCode', field: 'departmentCode',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
width: 150
},
}, },
{ {
label: '接口类型', label: '接口类型',
field: 'interfaceType', 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', sort: 'custom',
isSearch: true, 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: '单据号', label: '单据号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180
},
}, },
{ {
label: '业务类型', label: '包装号',
field: 'businessType', field: 'packingNumber',
sort: 'custom',
isSearch: true,
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', sort: 'custom',
isSearch: true, isSearch: true,
form: { table: {
component: 'SelectV2' 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
},
}, },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '创建时间', label: '创建时间',
@ -208,6 +442,9 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: true,
table: {
width: 180
},
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -219,46 +456,100 @@ export const StockupMainRecord = useCrudSchemas(reactive<CrudSchema[]>([
isForm: false, isForm: false,
}, },
{ {
label: '扩展属性', label: '物品代码',
field: 'extraProperties', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '地点ID', label: '物品名称',
field: 'siteId', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '代码', label: '物品描述1',
field: 'code', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '从库区类型范围', label: '物品描述2',
field: 'fromAreaTypes', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '从库区代码范围', label: '项目代码',
field: 'fromAreaCodes', field: 'projectCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '到库区类型范围', label: '数量',
field: 'toAreaTypes', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '到库区代码范围', label: '计量单位',
field: 'toAreaCodes', 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', sort: 'custom',
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}, },
{ {
label: '操作', label: '操作',

Loading…
Cancel
Save