Browse Source

基础信息bug修改

master
zhang_li 1 year ago
parent
commit
5731f0d1b8
  1. 10
      src/components/BasicForm/src/BasicForm.vue
  2. 3
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue
  3. 6
      src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts

10
src/components/BasicForm/src/BasicForm.vue

@ -238,6 +238,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'))

3
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 = [

6
src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts

@ -419,7 +419,8 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
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' }
],
})
})
console.log(Itembasic)
Loading…
Cancel
Save