Browse Source

工厂建模修改

master
李胜楠 1 year ago
parent
commit
4509913942
  1. 9
      src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts
  2. 26
      src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue
  3. 21
      src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts
  4. 26
      src/views/wms/basicDataManage/factoryModeling/dock/index.vue
  5. 26
      src/views/wms/basicDataManage/factoryModeling/location/index.vue
  6. 18
      src/views/wms/basicDataManage/factoryModeling/location/location.data.ts
  7. 26
      src/views/wms/basicDataManage/factoryModeling/locationgroup/index.vue
  8. 9
      src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts
  9. 26
      src/views/wms/basicDataManage/factoryModeling/process/index.vue
  10. 9
      src/views/wms/basicDataManage/factoryModeling/process/process.data.ts
  11. 26
      src/views/wms/basicDataManage/factoryModeling/productionline/index.vue
  12. 9
      src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts
  13. 26
      src/views/wms/basicDataManage/factoryModeling/warehouse/index.vue
  14. 12
      src/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data.ts
  15. 26
      src/views/wms/basicDataManage/factoryModeling/workshop/index.vue
  16. 9
      src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts
  17. 26
      src/views/wms/basicDataManage/factoryModeling/workstation/index.vue
  18. 9
      src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts

9
src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts

@ -199,7 +199,14 @@ export const Area = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const AreaRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
warehouseCode: [
{ required: true, message: '请输入仓库代码', trigger: 'change' }

26
src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="AreaRules"
:formAllSchemas="Area.allSchemas"
:apiUpdate="AreaApi.updateArea"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Area.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 AreaApi.createArea(data)
message.success(t('common.createSuccess'))
} else {
await AreaApi.updateArea(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

21
src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts

@ -234,7 +234,23 @@ export const Dock = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const DockRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
city: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
address: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
contactPerson: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
contactPhone: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
type: [
{ required: true, message: '请输入类型', trigger: 'change' }
@ -245,6 +261,9 @@ export const DockRules = reactive({
defaultLocationCode: [
{ required: true, message: '请输入默认库位代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

26
src/views/wms/basicDataManage/factoryModeling/dock/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="DockRules"
:formAllSchemas="Dock.allSchemas"
:apiUpdate="DockApi.updateDock"
@ -160,6 +160,30 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'baiscDock')
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Dock.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 DockApi.createDock(data)
message.success(t('common.createSuccess'))
} else {
await DockApi.updateDock(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

26
src/views/wms/basicDataManage/factoryModeling/location/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="LocationRules"
:formAllSchemas="Location.allSchemas"
:apiUpdate="LocationApi.updateLocation"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Location.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 LocationApi.createLocation(data)
message.success(t('common.createSuccess'))
} else {
await LocationApi.updateLocation(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

18
src/views/wms/basicDataManage/factoryModeling/location/location.data.ts

@ -348,7 +348,20 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const LocationRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
aisle: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
shelf: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
warehouseCode: [
{ required: true, message: '请输入仓库代码', trigger: 'change' }
@ -369,7 +382,8 @@ export const LocationRules = reactive({
{ required: true, message: '请输入拣料优先级', trigger: 'blur' }
],
userGroupCode: [
{ required: true, message: '请输入用户组代码', trigger: 'blur' }
{ required: true, message: '请输入用户组代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

26
src/views/wms/basicDataManage/factoryModeling/locationgroup/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="LocationgroupRules"
:formAllSchemas="Locationgroup.allSchemas"
:apiUpdate="LocationgroupApi.updateLocationgroup"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Locationgroup.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 LocationgroupApi.createLocationgroup(data)
message.success(t('common.createSuccess'))
} else {
await LocationgroupApi.updateLocationgroup(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

9
src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts

@ -191,7 +191,11 @@ export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const LocationgroupRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
warehouseCode: [
{ required: true, message: '请输入仓库代码', trigger: 'change' }
@ -199,6 +203,9 @@ export const LocationgroupRules = reactive({
areaCode: [
{ required: true, message: '请输入库区代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

26
src/views/wms/basicDataManage/factoryModeling/process/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="ProcessRules"
:formAllSchemas="Process.allSchemas"
:apiUpdate="ProcessApi.updateProcess"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Process.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 ProcessApi.createProcess(data)
message.success(t('common.createSuccess'))
} else {
await ProcessApi.updateProcess(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

9
src/views/wms/basicDataManage/factoryModeling/process/process.data.ts

@ -202,7 +202,11 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
//表单检验
export const ProcessRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
workshopCode: [
{ required: true, message: '请输入车间代码', trigger: 'change' }
@ -210,6 +214,9 @@ export const ProcessRules = reactive({
productionLineCode: [
{ required: true, message: '请输入生产线代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

26
src/views/wms/basicDataManage/factoryModeling/productionline/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="ProductionlineRules"
:formAllSchemas="Productionline.allSchemas"
:apiUpdate="ProductionlineApi.updateProductionline"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Productionline.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 ProductionlineApi.createProductionline(data)
message.success(t('common.createSuccess'))
} else {
await ProductionlineApi.updateProductionline(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

9
src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts

@ -221,11 +221,18 @@ export const Productionline = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const ProductionlineRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
workshopCode: [
{ required: true, message: '请输入车间代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

26
src/views/wms/basicDataManage/factoryModeling/warehouse/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="WarehouseRules"
:formAllSchemas="Warehouse.allSchemas"
:apiUpdate="WarehouseApi.updateWarehouse"
@ -144,6 +144,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Warehouse.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 WarehouseApi.createWarehouse(data)
message.success(t('common.createSuccess'))
} else {
await WarehouseApi.updateWarehouse(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {

12
src/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data.ts

@ -165,7 +165,17 @@ export const Warehouse = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const WarehouseRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
description: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

26
src/views/wms/basicDataManage/factoryModeling/workshop/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="WorkshopRules"
:formAllSchemas="Workshop.allSchemas"
:apiUpdate="WorkshopApi.updateWorkshop"
@ -144,6 +144,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Workshop.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 WorkshopApi.createWorkshop(data)
message.success(t('common.createSuccess'))
} else {
await WorkshopApi.updateWorkshop(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {

9
src/views/wms/basicDataManage/factoryModeling/workshop/workshop.data.ts

@ -157,7 +157,14 @@ export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([
//表单校验
export const WorkshopRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

26
src/views/wms/basicDataManage/factoryModeling/workstation/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="WorkstationRules"
:formAllSchemas="Workstation.allSchemas"
:apiUpdate="WorkstationApi.updateWorkstation"
@ -145,6 +145,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Workstation.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 WorkstationApi.createWorkstation(data)
message.success(t('common.createSuccess'))
} else {
await WorkstationApi.updateWorkstation(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

9
src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts

@ -243,7 +243,14 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
//表单检验
export const WorkstationRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
workshopCode: [
{ required: true, message: '请输入车间代码', trigger: 'change' }

Loading…
Cancel
Save