diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 1f4242f60..deb4d1d86 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -244,6 +244,16 @@ const submitForm = async () => { // data.masterId = props.masterParmas.masterId // data.number = props.masterParmas.number // } + console.log(props.formAllSchemas.formSchema) + var isHave = props.formAllSchemas.formSchema.some(function (item) { + return item.field === 'activeTime' || item.field === 'expireTime'; + }); + if(isHave){ + if(data.activeTime >=data.expireTime){ + message.error('失效时间要大于生效时间') + return; + } + } if (formType.value === 'create') { await props.apiCreate(data) message.success(t('common.createSuccess')) diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue index 957ed549a..16ec0bd8c 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue @@ -62,11 +62,10 @@ import { Itembasic, rules } from './itembasic.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { ItemBasicTabsList } from '@/utils/disposition/tabsList' defineOptions({ name: 'Itembasic' }) - const { tableObject, tableMethods } = useTable({ getListApi: ItembasicApi.getItembasicPage // 分页接口 }) - +console.log(tableObject) const importFormRef = ref() // 列表头部按钮 const HeadButttondata = [ diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts index 7b35f53ec..d9d207741 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts @@ -419,7 +419,8 @@ export const Itembasic = useCrudSchemas(reactive([ // 表单校验 export const rules = reactive({ code: [ - { required: true, message: '请输入代码', trigger: 'blur' } + { required: true, message: '请输入代码', trigger: 'blur' }, + { max: 30, message: '不得超过30个字符', trigger: 'blur' }, ], name: [ { required: true, message: '请输入名称', trigger: 'blur' } @@ -487,4 +488,5 @@ export const rules = reactive({ expireTime: [ { required: true, message: '请输入失效时间', trigger: 'change' } ], -}) \ No newline at end of file +}) +console.log(Itembasic) \ No newline at end of file diff --git a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts index 6e078dc49..a751fb818 100644 --- a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts +++ b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts @@ -243,6 +243,7 @@ export const CountPlanMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -264,6 +265,7 @@ export const CountPlanMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -284,6 +286,7 @@ export const CountPlanMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -322,6 +325,7 @@ export const CountPlanMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -414,6 +418,9 @@ export const CountPlanDetail = useCrudSchemas(([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '盘点范围值', @@ -477,6 +484,7 @@ export const CountPlanDetail = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -499,6 +507,7 @@ export const CountPlanDetail = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -526,6 +535,15 @@ export const CountPlanDetail = useCrudSchemas(([ }, form: { component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -538,6 +556,9 @@ export const CountPlanDetail = useCrudSchemas(([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '是否可用', @@ -557,6 +578,9 @@ export const CountPlanDetail = useCrudSchemas(([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '操作', diff --git a/src/views/wms/countManage/count/countRequestMain/countRequestMain.data.ts b/src/views/wms/countManage/count/countRequestMain/countRequestMain.data.ts index 7790d1873..b1478cefc 100644 --- a/src/views/wms/countManage/count/countRequestMain/countRequestMain.data.ts +++ b/src/views/wms/countManage/count/countRequestMain/countRequestMain.data.ts @@ -1,8 +1,12 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -const { t } = useI18n() // 国际化 import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +import * as CountPlanMainApi from '@/api/wms/countPlanMain' +import { CountPlanMain } from '../countPlanMain/countPlanMain.data' + +const { t } = useI18n() // 国际化 + // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 const queryParams = { pageSize:10, @@ -28,6 +32,7 @@ export const CountRequestMain = useCrudSchemas(([ table: { width: 150 }, + isForm: false, }, { label: '计划单号', @@ -36,6 +41,17 @@ export const CountRequestMain = useCrudSchemas(([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择计划单号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '盘点计划', // 查询弹窗标题 + searchAllSchemas: CountPlanMain.allSchemas, // 查询弹窗所需类 + searchPage: CountPlanMainApi.getCountPlanMainPage // 查询弹窗所需分页方法 + } + } }, { label: '阶段', @@ -81,7 +97,8 @@ export const CountRequestMain = useCrudSchemas(([ componentProps: { disabled: true } - } + }, + isForm: false, }, { label: '备注', @@ -106,6 +123,7 @@ export const CountRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -136,11 +154,13 @@ export const CountRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, + isForm: false, }, { label: '截止时间', @@ -156,6 +176,7 @@ export const CountRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -208,6 +229,7 @@ export const CountRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -318,9 +340,9 @@ export const CountRequestMain = useCrudSchemas(([ //表单校验 export const CountRequestMainRules = reactive({ - requestNumber: [ - { required: true, message: '请选择申请单号', trigger: 'change' } - ], + // requestNumber: [ + // { required: true, message: '请选择申请单号', trigger: 'change' } + // ], stage: [ { required: true, message: '请选择阶段', trigger: 'change' } ], @@ -345,9 +367,9 @@ export const CountRequestMainRules = reactive({ directCreateRecord: [ { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } ], - businessType: [ - { required: true, message: '请输入业务类型', trigger: 'blur' } - ], + // businessType: [ + // { required: true, message: '请输入业务类型', trigger: 'blur' } + // ], }) @@ -364,32 +386,16 @@ export const CountRequestDetail = useCrudSchemas(reactive([ }, }, { - label: '从包装号', - field: 'fromPackingNumber', - sort: 'custom', - table: { - width: 150 - }, - }, - { - label: '从器具号', - field: 'fromContainerNumber', - sort: 'custom', - table: { - width: 150 - }, - }, - { - label: '到包装号', - field: 'toPackingNumber', + label: '包装号', + field: 'packingNumber', sort: 'custom', table: { width: 150 }, }, { - label: '到器具号', - field: 'toContainerNumber', + label: '器具号', + field: 'containerNumber', sort: 'custom', table: { width: 150 @@ -421,6 +427,9 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '盘点明细号', @@ -437,6 +446,8 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '物品描述1', @@ -445,6 +456,8 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '物品描述2', @@ -453,6 +466,8 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '数量', @@ -463,6 +478,16 @@ export const CountRequestDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', + componentProps: { + disabled: true, + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -472,6 +497,8 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '计量单位', @@ -483,6 +510,9 @@ export const CountRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '最后更新时间', @@ -498,6 +528,7 @@ export const CountRequestDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -560,6 +591,7 @@ export const CountRequestDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -596,8 +628,8 @@ export const CountRequestDetailRules = reactive({ countDetailNumber: [ { required: true, message: '请输入盘点明细号', trigger: 'blur' } ], - fromPackingNumber: [ - { required: true, message: '请选择从包装号', trigger: 'change' } + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } ], batch: [ { required: true, message: '请输入批次', trigger: 'blur' } diff --git a/src/views/wms/countManage/countadjust/countadjustRequestMain/countadjustRequestMain.data.ts b/src/views/wms/countManage/countadjust/countadjustRequestMain/countadjustRequestMain.data.ts index f568128ff..b4a016da7 100644 --- a/src/views/wms/countManage/countadjust/countadjustRequestMain/countadjustRequestMain.data.ts +++ b/src/views/wms/countManage/countadjust/countadjustRequestMain/countadjustRequestMain.data.ts @@ -1,8 +1,12 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -const { t } = useI18n() // 国际化 import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +import * as CountRecordMainApi from '@/api/wms/countRecordMain' +import { CountRecordMain } from '../../count/countRecordMain/countRecordMain.data' + +const { t } = useI18n() // 国际化 + // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 const queryParams = { pageSize:10, @@ -29,6 +33,7 @@ export const CountadjustRequestMain = useCrudSchemas(([ width: 150 }, isSearch: true, + isForm: false, }, { label: '盘点记录单号', @@ -37,6 +42,17 @@ export const CountadjustRequestMain = useCrudSchemas(([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择盘点记录单号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '盘点记录', // 查询弹窗标题 + searchAllSchemas: CountRecordMain.allSchemas, // 查询弹窗所需类 + searchPage: CountRecordMainApi.getCountRecordMainPage // 查询弹窗所需分页方法 + } + } }, { label: '仓库代码', @@ -68,6 +84,7 @@ export const CountadjustRequestMain = useCrudSchemas(([ disabled: true } }, + isForm: false, }, { label: '备注', @@ -92,6 +109,7 @@ export const CountadjustRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -122,11 +140,13 @@ export const CountadjustRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, + isForm: false, }, { label: '截止时间', @@ -142,6 +162,7 @@ export const CountadjustRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -194,6 +215,7 @@ export const CountadjustRequestMain = useCrudSchemas(([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -304,9 +326,9 @@ export const CountadjustRequestMain = useCrudSchemas(([ //表单校验 export const CountadjustRequestMainRules = reactive({ - requestNumber: [ - { required: true, message: '请选择申请单号', trigger: 'change' } - ], + // requestNumber: [ + // { required: true, message: '请选择申请单号', trigger: 'change' } + // ], warehouseCode: [ { required: true, message: '请选择仓库代码', trigger: 'change' } ], @@ -325,9 +347,9 @@ export const CountadjustRequestMainRules = reactive({ directCreateRecord: [ { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } ], - businessType: [ - { required: true, message: '请输入业务类型', trigger: 'blur' } - ], + // businessType: [ + // { required: true, message: '请输入业务类型', trigger: 'blur' } + // ], }) /** @@ -392,6 +414,9 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '库存数量', @@ -402,6 +427,15 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -413,6 +447,15 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -424,6 +467,15 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -433,6 +485,8 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '物品描述1', @@ -441,6 +495,8 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '物品描述2', @@ -449,6 +505,8 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '数量', @@ -459,6 +517,15 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 } }, { @@ -468,6 +535,8 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + isTableForm: false, + isForm: false, }, { label: '计量单位', @@ -479,6 +548,9 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm: { + type: 'Select' + } }, { label: '最后更新时间', @@ -494,6 +566,7 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -556,6 +629,7 @@ export const CountadjustRequestDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -613,9 +687,9 @@ export const CountadjustRequestDetailRules = reactive({ adjustQty: [ { required: true, message: '请输入调整数量', trigger: 'blur' } ], - number: [ - { required: true, message: '请输入单据号', trigger: 'blur' } - ], + // number: [ + // { required: true, message: '请输入单据号', trigger: 'blur' } + // ], itemCode: [ { required: true, message: '请选择物品代码', trigger: 'change' } ], diff --git a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue index 8d57b4613..104a2c519 100644 --- a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue +++ b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue @@ -44,7 +44,6 @@ @success="getList" :rules="CountadjustRequestMainRules" :formAllSchemas="CountadjustRequestMain.allSchemas" - :searchTableParams="searchTableParams" :tableAllSchemas="CountadjustRequestDetail.allSchemas" :tableFormRules="CountadjustRequestDetailRules" :tableData="tableData" @@ -64,12 +63,12 @@ :allSchemas="CountadjustRequestMain.allSchemas" :detailAllSchemas="CountadjustRequestDetail.allSchemas" :detailAllSchemasRules="CountadjustRequestDetailRules" - :searchTableParams="searchTableParams" :apiCreate="CountadjustRequestDetailApi.createCountadjustRequestDetail" :apiUpdate="CountadjustRequestDetailApi.updateCountadjustRequestDetail" :apiPage="CountadjustRequestDetailApi.getCountadjustRequestDetailPage" :apiDelete="CountadjustRequestDetailApi.deleteCountadjustRequestDetail" :Echo="Echo" + @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -99,41 +98,28 @@ const updataTableColumns = (val) => { tableColumns.value = val } -// 查询列表页面参数设置 -const searchTableParams = ref([ -//{ -// formField: 'productItemCode', -// searchTableTitle: '物料信息', -// searchTableAllSchemas: Itembasic.allSchemas, -// searchTablePage: ItembasicApi.getItembasicPage -//} -]) - // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { // 明细查询页赋值 - //row[formField] = val[0][searchField] - //row['poLine'] = val[0]['poLine'] - //row['batch'] = val[0]['toBatch'] - //row['altBatch'] = val[0]['altBatch'] - //row['itemCode'] = val[0]['itemCode'] - //row['itemName'] = val[0]['itemName'] - //row['itemDesc1'] = val[0]['itemDesc1'] - //row['itemDesc2'] = val[0]['itemDesc2'] - //row['projectCode'] = val[0]['projectCode'] - //row['qty'] = val[0]['qty'] - //row['uom'] = val[0]['uom'] + row[formField] = val[0][searchField] } else { const setV = {} setV[formField] = val[0][searchField] - //setV['ppNumber'] = val[0]['ppNumber'] - //setV['supplierCode'] = val[0]['supplierCode'] formRef.setValues(setV) } }) } +// 查询页面返回——详情 +const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { + nextTick(() => { + const setV = {} + setV[formField] = val[0][searchField] + formRef.setValues(setV) + }) +} + // 子表新增的时候选择表格之后需要会显得字段 // const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] const Echo = []