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

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

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

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

@ -44,6 +44,7 @@
:apiUpdate="ItembasicApi.updateItembasic" :apiUpdate="ItembasicApi.updateItembasic"
:apiCreate="ItembasicApi.createItembasic" :apiCreate="ItembasicApi.createItembasic"
:isBusiness="false" :isBusiness="false"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -190,28 +191,42 @@ const basicFormRef = ref()
const openForm = (type: string, id?: number) => { const openForm = (type: string, id?: number) => {
basicFormRef.value.open(type, id) 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 // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =Itembasic.allSchemas.formSchema.some(function (item) { var isHave =Itembasic.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); })
if(isHave){ if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间') message.error('失效时间要大于生效时间')
return; return
} }
} }
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await ItembasicApi.createItembasic(data) await ItembasicApi.createItembasic(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await ItembasicApi.updateItembasic(data) await ItembasicApi.updateItembasic(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
getList() getList()
} }
const detailRef = ref() const detailRef = ref()

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

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

Loading…
Cancel
Save