Browse Source

包装规格 新增字段父包装代码

master_hella_20240701
chenfang 9 months ago
parent
commit
97d75c41a0
  1. 296
      src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts
  2. 61
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue
  3. 232
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

296
src/views/wms/basicDataManage/itemManage/packageunit/packageunit.data.ts

@ -1,6 +1,274 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { fa } from 'element-plus/es/locale' import { fa } from 'element-plus/es/locale'
import * as PackageunitApi from '@/api/wms/packageunit'
export const PackageunitCopy = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '父包装代码',
field: 'parentCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '包装名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装类型',
field: 'type',
dictType: DICT_TYPE.PACK_UNIT_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '长',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '宽',
field: 'width',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '高',
field: 'height',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单位',
field: 'unit',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '包装描述',
field: 'desc',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '是否重复使用',
field: 'reuse',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '是否管理包装库存',
field: 'manageBalance',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 180
},
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者',
field: 'deleterId',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -12,6 +280,33 @@ export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
}, },
{
label: '父包装代码',
field: 'parentCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择父包装代码',
searchField: 'code',
searchTitle: '包装规格信息',
searchAllSchemas: PackageunitCopy.allSchemas,
searchPage: PackageunitApi.getCustomeritemPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'customerCode',
value: 'customerCode',
isMainValue: true
}]
}
}
},
{ {
label: '包装名称', label: '包装名称',
field: 'name', field: 'name',
@ -277,3 +572,4 @@ export const PackageunitRules = reactive({
{ required: true, message: '请输入包装描述', trigger: 'change' } { required: true, message: '请输入包装描述', trigger: 'change' }
], ],
}) })

61
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue

@ -28,7 +28,7 @@
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #code="{row}"> <template #code="{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.code }}</span>
</el-button> </el-button>
</template> </template>
@ -44,14 +44,37 @@
@success="formsSuccess" @success="formsSuccess"
:rules="StockupMainRequestRules" :rules="StockupMainRequestRules"
:formAllSchemas="StockupMainRequest.allSchemas" :formAllSchemas="StockupMainRequest.allSchemas"
:tableAllSchemas="StockupDetailRequest.allSchemas"
:tableFormRules="StockupDetailRequestRules"
:tableData="tableData"
:apiUpdate="StockupMainRequestApi.updateStockupMainRequest" :apiUpdate="StockupMainRequestApi.updateStockupMainRequest"
:apiCreate="StockupMainRequestApi.createStockupMainRequest" :apiCreate="StockupMainRequestApi.createStockupMainRequest"
:isBusiness="true"
fromeWhere="StockupMainRequest"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" @submitForm="formsSuccess"
:isShowButton = isShowButton
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="StockupMainRequest.allSchemas" /> <Detail
ref="detailRef"
:isBasic="false"
:allSchemas="StockupDetailRequest.allSchemas"
:detailAllSchemas="StockupDetailRequest.allSchemas"
:detailAllSchemasRules="StockupDetailRequestRules"
:apiCreate="StockupDetailRequestApi.createStockupDetailRequest"
:apiUpdate="StockupDetailRequestApi.updateStockupDetailRequest"
:apiPage="StockupDetailRequestApi.getStockupDetailRequestPage"
:apiDelete="StockupDetailRequestApi.deleteStockupDetailRequest"
fromeWhere="StockupDetailRequest"
@searchTableSuccessDetail="searchTableSuccessDetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowDelete="true"
@detailOpenForm="detailOpenForm"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/request/stockup-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/request/stockup-main-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -59,8 +82,9 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { StockupMainRequest,StockupMainRequestRules } from './stockupMainRequest.data' import { StockupMainRequest,StockupMainRequestRules,StockupDetailRequest,StockupDetailRequestRules } from './stockupMainRequest.data'
import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest/' import * as StockupMainRequestApi from '@/api/wms/stockupMainRequest/'
import * as StockupDetailRequestApi from '@/api/wms/stockupDetailRequest/'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -76,6 +100,8 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(StockupMainRequest.allSchemas.tableColumns) const tableColumns = ref(StockupMainRequest.allSchemas.tableColumns)
const isShowButton = ref(true)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
@ -85,6 +111,15 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
//
const searchTableSuccessDetail = (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
@ -182,6 +217,14 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainRequest') detailRef.value.openDetail(row, titleName, titleValue, 'basicStockupMainRequest')
} }
/**
* 详情 编辑页面打开
* @param row
*/
const detailOpenForm = (type) => {
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
@ -210,6 +253,16 @@ const handleExport = async () => {
exportLoading.value = false exportLoading.value = false
} }
} }
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()

232
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

@ -7,10 +7,10 @@ export const StockupMainRequestRules = reactive({
export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: '单据号',
field: 'id', field: 'number',
sort: 'custom', sort: 'custom',
isForm: false, isSearch: true,
}, },
{ {
label: '发货计划单号', label: '发货计划单号',
@ -22,43 +22,31 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '到仓库代码', label: '到仓库代码',
field: 'toWarehouseCode', field: 'toWarehouseCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '从库区类型范围', label: '从库区类型范围',
field: 'fromAreaTypes', field: 'fromAreaTypes',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '从库区代码范围', label: '从库区代码范围',
field: 'fromAreaCodes', field: 'fromAreaCodes',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
},
{
label: 'details',
field: 'details',
sort: 'custom',
isSearch: true,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
}, },
{ {
label: '业务类型', label: '业务类型',
field: 'businessType', field: 'businessType',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'SelectV2' component: 'SelectV2'
}, },
@ -67,14 +55,14 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -85,28 +73,12 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{ {
label: '申请时间', label: '申请时间',
field: 'requestTime', field: 'requestTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -128,7 +100,7 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'dueTime', field: 'dueTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: false,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
@ -149,13 +121,13 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '部门', label: '部门',
field: 'departmentCode', field: 'departmentCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Radio' component: 'Radio'
}, },
@ -164,63 +136,154 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '自动提交', label: '自动提交',
field: 'autoCommit', field: 'autoCommit',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '自动通过', label: '自动通过',
field: 'autoAgree', field: 'autoAgree',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '自动执行', label: '自动执行',
field: 'autoExecute', field: 'autoExecute',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
}, },
{ {
label: '直接生成记录', label: '直接生成记录',
field: 'directCreateRecord', field: 'directCreateRecord',
sort: 'custom', sort: 'custom',
isSearch: false,
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
sort: 'custom',
isSearch: false,
},
{
label: '到库区范围',
field: 'toAreaCodes',
sort: 'custom',
isSearch: false,
},
{
label: '发货日期',
field: 'deliverDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
sort: 'custom',
isSearch: false,
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const StockupDetailRequestRules = reactive({
itemCode: [required],
})
//子表
export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '并发乐观锁', label: '器具号',
field: 'concurrencyStamp', field: 'containerNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '权限所属人员id', label: '批次',
field: 'ruleUserId', field: 'batch',
sort: 'custom',
isSearch: true,
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { form: {
component: 'InputNumber', component: 'Radio'
value: 0
}, },
}, },
{ {
label: '到库区类型范围', label: '到货主代码',
field: 'toAreaTypes', field: 'toOwnerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '到库区范围', label: '到库位代码',
field: 'toAreaCodes', field: 'toLocationCode',
sort: 'custom',
isSearch: true,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
}, },
{ {
label: '工作流流水号', label: '单据号',
field: 'serialNumber', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '发货日期', label: '备注',
field: 'deliverDate', field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true, isSearch: true,
@ -232,23 +295,53 @@ export const StockupMainRequest = 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')]
} }
}, },
form: { isForm: false,
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}, },
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
}, },
{ {
label: '入库库存状态范围', label: '物品名称',
field: 'inInventoryStatuses', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ {
label: '出库库存状态范围', label: '物品描述1',
field: 'outInventoryStatuses', field: 'itemDesc1',
sort: 'custom',
isSearch: true,
},
{
label: '物品描述2',
field: 'itemDesc2',
sort: 'custom',
isSearch: true,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
isSearch: true,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: true,
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
isSearch: true,
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
@ -262,3 +355,4 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))

Loading…
Cancel
Save