|
|
@ -53,6 +53,7 @@ |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
:basicFormWidth="75" |
|
|
|
@onChange="onChange" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -76,6 +77,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
|
|
|
|
// 业务类型 |
|
|
|
defineOptions({ name: 'Businesstype' }) |
|
|
@ -157,11 +159,44 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
const rowSplit = JSON.parse(JSON.stringify(row)) |
|
|
|
rowSplit.itemTypes = rowSplit.itemTypes.split(',') |
|
|
|
rowSplit.outAreaTypes = rowSplit.outAreaTypes.split(',') |
|
|
|
rowSplit.inAreaTypes = rowSplit.inAreaTypes.split(',') |
|
|
|
rowSplit.outInventoryStatuses = rowSplit.outInventoryStatuses.split(',') |
|
|
|
rowSplit.inInventoryStatuses = rowSplit.inInventoryStatuses.split(',') |
|
|
|
// rowSplit.itemTypes = rowSplit.itemTypes.split(',') |
|
|
|
// 可用物料类型范围 |
|
|
|
const allItemTypesValue = getStrDictOptions(DICT_TYPE.ITEM_TYPE).map(item=>(item.value)) |
|
|
|
if(rowSplit.itemTypes == allItemTypesValue){ |
|
|
|
rowSplit.itemTypes = ['全选'] |
|
|
|
}else{ |
|
|
|
rowSplit.itemTypes = rowSplit.itemTypes.split(',') |
|
|
|
} |
|
|
|
|
|
|
|
// 出库库区类型范围 入库库区类型范围 |
|
|
|
const allValue = getStrDictOptions(DICT_TYPE.AREA_TYPE).map(item=>(item.value)) |
|
|
|
if(rowSplit.outAreaTypes == allValue){ |
|
|
|
rowSplit.outAreaTypes = ['全选'] |
|
|
|
}else{ |
|
|
|
rowSplit.outAreaTypes = rowSplit.outAreaTypes.split(',') |
|
|
|
} |
|
|
|
|
|
|
|
if(rowSplit.inAreaTypes == allValue){ |
|
|
|
rowSplit.inAreaTypes = ['全选'] |
|
|
|
}else{ |
|
|
|
rowSplit.inAreaTypes = rowSplit.inAreaTypes.split(',') |
|
|
|
} |
|
|
|
// rowSplit.outAreaTypes = rowSplit.outAreaTypes.split(',') |
|
|
|
// rowSplit.inAreaTypes = rowSplit.inAreaTypes.split(',') |
|
|
|
|
|
|
|
const allInventoryStatusesValue = getStrDictOptions(DICT_TYPE.INVENTORY_STATUS).map(item=>(item.value)) |
|
|
|
if(rowSplit.outInventoryStatuses == allInventoryStatusesValue){ |
|
|
|
rowSplit.outInventoryStatuses = ['全选'] |
|
|
|
}else{ |
|
|
|
rowSplit.outInventoryStatuses = rowSplit.outInventoryStatuses.split(',') |
|
|
|
} |
|
|
|
if(rowSplit.inInventoryStatuses == allInventoryStatusesValue){ |
|
|
|
rowSplit.inInventoryStatuses = ['全选'] |
|
|
|
}else{ |
|
|
|
rowSplit.inInventoryStatuses = rowSplit.inInventoryStatuses.split(',') |
|
|
|
} |
|
|
|
// rowSplit.outInventoryStatuses = rowSplit.outInventoryStatuses.split(',') |
|
|
|
// rowSplit.inInventoryStatuses = rowSplit.inInventoryStatuses.split(',') |
|
|
|
openForm('update', rowSplit) |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
@ -176,7 +211,8 @@ const openForm = (type: string, row?: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
const formsSuccess = async (formType, submitData) => { |
|
|
|
let data = {...submitData} |
|
|
|
var isHave = Businesstype.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
|
}) |
|
|
@ -188,11 +224,47 @@ const formsSuccess = async (formType, data) => { |
|
|
|
} |
|
|
|
if (data.activeTime == 0) data.activeTime = null |
|
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
|
data.itemTypes = data.itemTypes.join(',') |
|
|
|
data.outAreaTypes = data.outAreaTypes.join(',') |
|
|
|
data.inAreaTypes = data.inAreaTypes.join(',') |
|
|
|
data.outInventoryStatuses = data.outInventoryStatuses.join(',') |
|
|
|
data.inInventoryStatuses = data.inInventoryStatuses.join(',') |
|
|
|
// data.itemTypes = data.itemTypes.join(',') |
|
|
|
const allItemTypesValue = getStrDictOptions(DICT_TYPE.ITEM_TYPE).map(item=>(item.value)) |
|
|
|
if(data.itemTypes[data.itemTypes.length-1]=='全选'){ |
|
|
|
data.itemTypes = allItemTypesValue.join(',') |
|
|
|
}else{ |
|
|
|
data.itemTypes = data.itemTypes.join(',') |
|
|
|
} |
|
|
|
|
|
|
|
// data.outAreaTypes = data.outAreaTypes.join(',') |
|
|
|
// data.inAreaTypes = data.inAreaTypes.join(',') |
|
|
|
//全选的值 |
|
|
|
const allValue = getStrDictOptions(DICT_TYPE.AREA_TYPE).map(item=>(item.value)) |
|
|
|
if(data.outAreaTypes[data.outAreaTypes.length-1]=='全选'){ |
|
|
|
data.outAreaTypes = allValue.join(',') |
|
|
|
}else{ |
|
|
|
data.outAreaTypes = data.outAreaTypes.join(',') |
|
|
|
} |
|
|
|
|
|
|
|
if(data.inAreaTypes[data.inAreaTypes.length-1]=='全选'){ |
|
|
|
data.inAreaTypes = allValue.join(',') |
|
|
|
}else{ |
|
|
|
data.inAreaTypes = data.inAreaTypes.join(',') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 出库库存状态范围 入库库存状态范围 |
|
|
|
// data.outInventoryStatuses = data.outInventoryStatuses.join(',') |
|
|
|
// data.inInventoryStatuses = data.inInventoryStatuses.join(',') |
|
|
|
const allInventoryStatusesValue = getStrDictOptions(DICT_TYPE.INVENTORY_STATUS).map(item=>(item.value)) |
|
|
|
if(data.outInventoryStatuses[data.outInventoryStatuses.length-1]=='全选'){ |
|
|
|
data.outInventoryStatuses = allInventoryStatusesValue.join(',') |
|
|
|
}else{ |
|
|
|
data.outInventoryStatuses = data.outInventoryStatuses.join(',') |
|
|
|
} |
|
|
|
if(data.inInventoryStatuses[data.inInventoryStatuses.length-1]=='全选'){ |
|
|
|
data.inInventoryStatuses = allInventoryStatusesValue.join(',') |
|
|
|
}else{ |
|
|
|
data.inInventoryStatuses = data.inInventoryStatuses.join(',') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (formType === 'create') { |
|
|
|
await BusinesstypeApi.createBusinesstype(data) |
|
|
|
.then(async () => { |
|
|
@ -224,6 +296,24 @@ const formsSuccess = async (formType, data) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const onChange = (field, value)=>{ |
|
|
|
console.log('onChange',field,value) |
|
|
|
if(field=='outAreaTypes'||field=='inAreaTypes'||field=='itemTypes'||field=='outInventoryStatuses'||field=='inInventoryStatuses'){ |
|
|
|
//出库区类型范围 入库区类型范围 可用物料类型范围 出库库存状态范围 入库库存状态范围 |
|
|
|
if(value.length>0){ |
|
|
|
if(value[value.length-1]=='全选'){ |
|
|
|
//全选 |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
[field]:['全选'] |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
basicFormRef.value.formRef.setValues({ |
|
|
|
[field]:value.filter(item=>item!='全选') |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|