Browse Source

Merge remote-tracking branch 'origin/master'

master
zhaoxuebing 10 months ago
parent
commit
38d1137e73
  1. 1
      README.md
  2. 2
      src/components/BasicForm/src/BasicForm.vue
  3. 55
      src/views/wms/basicDataManage/itemManage/itembasic/index.vue
  4. 4
      src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts

1
README.md

@ -12,6 +12,7 @@ form: {
searchCondition: [{
key:'productionLineCode', // 查询列表中字段
value:'prodLine', // 指主表某字段
message: '请选择生产线信息!', // 当前置条件为空时 弹出信息提示
isMainValue: true // 表示查询条件是主表的字段的值
},
{

2
src/components/BasicForm/src/BasicForm.vue

@ -300,7 +300,7 @@ const opensearchTable = (
isNull = true
}
if (isNull) {
message.warning(searchCondition[i].message)
message.warning(searchCondition[i].message?searchCondition[i].message:'前置条件未选择!')
return
}
} else {

55
src/views/wms/basicDataManage/itemManage/itembasic/index.vue

@ -44,6 +44,7 @@
:apiUpdate="ItembasicApi.updateItembasic"
:apiCreate="ItembasicApi.createItembasic"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
@ -190,28 +191,42 @@ const basicFormRef = ref()
const openForm = (type: string, id?: number) => {
basicFormRef.value.open(type, id)
}
/**
* 监听改变事件
* @param field 当前操作字段
* @param cur 改变后值
*/
const onChange = (field, cur) => {
//
if (field == 'validityDays' || field == 'activeTime') {
//
basicFormRef.value.formRef.formModel.expireTime = basicFormRef.value.formRef.formModel.activeTime + basicFormRef.value.formRef.formModel.validityDays * 24 * 60 * 60 * 1000
}
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Itembasic.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 ItembasicApi.createItembasic(data)
message.success(t('common.createSuccess'))
} else {
await ItembasicApi.updateItembasic(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
var isHave =Itembasic.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 ItembasicApi.createItembasic(data)
message.success(t('common.createSuccess'))
} else {
await ItembasicApi.updateItembasic(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
const detailRef = ref()

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

@ -317,7 +317,8 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
componentProps: {
min: 0
min: 0,
precision: 0
}
},
},
@ -386,6 +387,7 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
disabled: true
}
},
},

Loading…
Cancel
Save