Browse Source

物料管理校验修改

master
李胜楠 1 year ago
parent
commit
3d1646f9a2
  1. 12
      src/views/wms/basicDataManage/itemManage/bom/bom.data.ts
  2. 26
      src/views/wms/basicDataManage/itemManage/bom/index.vue
  3. 26
      src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue
  4. 3
      src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts
  5. 26
      src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue
  6. 12
      src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts

12
src/views/wms/basicDataManage/itemManage/bom/bom.data.ts

@ -222,7 +222,17 @@ export const BomRules = reactive({
{ required: true, message: '请输入子物料数量', trigger: 'blur' }
],
processCode: [
{ required: true, message: '请输入工序代码', trigger: 'blur' }
{ required: true, message: '请输入工序代码', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
version: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
layer: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

26
src/views/wms/basicDataManage/itemManage/bom/index.vue

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

26
src/views/wms/basicDataManage/itemManage/productionlineitem/index.vue

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

3
src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts

@ -211,6 +211,9 @@ export const ProductionlineitemRules = reactive({
itemCode: [
{ required: true, message: '请输入物品代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

26
src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue

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

12
src/views/wms/basicDataManage/itemManage/stdcostprice/stdcostprice.data.ts

@ -67,7 +67,14 @@ export const Stdcostprice = useCrudSchemas(reactive<CrudSchema[]>([
label: '价格',
field: 'price',
sort: 'custom',
isSearch: true
isSearch: true,
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
}
},
{
label: '是否可用',
@ -188,6 +195,9 @@ export const StdcostpriceRules = reactive({
price: [
{ required: true, message: '请输入价格', trigger: 'blur' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

Loading…
Cancel
Save