|
|
@ -117,7 +117,6 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' |
|
|
|
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict' |
|
|
|
console.log('CountPlanDetail.allSchemas', CountPlanDetail.allSchemas) |
|
|
|
|
|
|
|
// 盘点计划主 |
|
|
|
defineOptions({ name: 'CountPlanMain' }) |
|
|
@ -296,10 +295,12 @@ const buttonTableClick = async (val, row) => { |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
tableData.value = [ { |
|
|
|
tableData.value = [ |
|
|
|
{ |
|
|
|
type: '', |
|
|
|
value: '' |
|
|
|
}] // 重置明细数据 |
|
|
|
} |
|
|
|
] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
|
|
|
|
getOwnerAllList() |
|
|
@ -315,6 +316,14 @@ const openForm = async (type: string, row?: number) => { |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
getOwnerAllList() |
|
|
|
getSupplierAllList() |
|
|
|
getCustomerAllList() |
|
|
|
getItembasicAllList() |
|
|
|
getWarehouseAllList() |
|
|
|
getAreaAllList() |
|
|
|
getLocationgroupAllList() |
|
|
|
getLocationAllList() |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue) |
|
|
|
} |
|
|
|
|
|
|
@ -354,10 +363,12 @@ let tableFormKeys = {} |
|
|
|
CountPlanDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
}) |
|
|
|
const tableData = ref([{ |
|
|
|
const tableData = ref([ |
|
|
|
{ |
|
|
|
type: '', |
|
|
|
value: '' |
|
|
|
}]) |
|
|
|
} |
|
|
|
]) |
|
|
|
|
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
@ -375,13 +386,12 @@ const handleDeleteTable = (item, index) => { |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value.map(item=>{ |
|
|
|
data.subList = tableData.value.map((item) => { |
|
|
|
return { |
|
|
|
type: item.type, |
|
|
|
value:item.value, |
|
|
|
value: item.value |
|
|
|
} |
|
|
|
}) // 拼接子表数据参数 |
|
|
|
console.log(tableData.value) |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await CountPlanMainApi.createCountPlanMain(data) |
|
|
@ -443,8 +453,6 @@ const selectChange = (field, val) => { |
|
|
|
} |
|
|
|
// 选择盘点范围类型 |
|
|
|
const tableFormChange = async (field, val, row) => { |
|
|
|
console.log(field) |
|
|
|
console.log(val) |
|
|
|
if (field == 'type') { |
|
|
|
row.value = '' |
|
|
|
if ( |
|
|
@ -513,86 +521,94 @@ const allList=ref({ |
|
|
|
locationAllList: [], |
|
|
|
abcList: getStrDictOptions(DICT_TYPE.ABC_CLASS), |
|
|
|
itemTypeList: getStrDictOptions(DICT_TYPE.ITEM_TYPE), |
|
|
|
itemGroupList:getStrDictOptions(DICT_TYPE.ITEM_GROUP), |
|
|
|
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP) |
|
|
|
}) |
|
|
|
// 获取货主列表 |
|
|
|
const getOwnerAllList = async () => { |
|
|
|
await OwnerApi.getOwnerList().then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.ownerAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.ownerAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取供应商列表 |
|
|
|
const getSupplierAllList = async () => { |
|
|
|
await SupplierApi.getSupplierList().then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.supplierAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.supplierAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取供应商列表 |
|
|
|
const getCustomerAllList = async () => { |
|
|
|
await CustomerApi.getCustomerList().then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.customerAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.customerAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取物品代码列表 |
|
|
|
const getItembasicAllList = async () => { |
|
|
|
await ItembasicApi.getItembasicList().then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.itembasicAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.itembasicAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取仓库列表 |
|
|
|
const getWarehouseAllList = async () => { |
|
|
|
await WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.warehouseAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.warehouseAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取库区列表 |
|
|
|
const getAreaAllList = async () => { |
|
|
|
await AreaApi.getAreaList({ available: 'TRUE' }).then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.areaAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.areaAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取库位组列表 |
|
|
|
const getLocationgroupAllList = async () => { |
|
|
|
await LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.locationgroupAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.locationgroupAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取库位列表 |
|
|
|
const getLocationAllList = async () => { |
|
|
|
await LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => { |
|
|
|
res.forEach((element) => { |
|
|
|
element.value = element.code |
|
|
|
element.label = element.name |
|
|
|
allList.value.locationAllList = res.map((element) => { |
|
|
|
return { |
|
|
|
value: element.code, |
|
|
|
label: element.name |
|
|
|
} |
|
|
|
}) |
|
|
|
allList.value.locationAllList = res |
|
|
|
}) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|