chenfang 10 months ago
parent
commit
612057a5ce
  1. 6
      src/components/Detail/src/Detail.vue
  2. 62
      src/components/DetailTable/src/DetailTable.vue
  3. 132
      src/views/wms/countManage/count/countPlanMain/index.vue

6
src/components/Detail/src/Detail.vue

@ -62,11 +62,11 @@
</template>
</Table>
<DetailTable
v-if="!isBasic && fromeWhere == 'countPlan'"
v-if="!isBasic && fromeWhere == 'countPlan' && isShowDrawer"
:columns="detailAllSchemasRef.tableColumns"
:data="tableObjectRef.tableList"
:allList="allList"
:countScopeType="countScopeType"
:countScopeType="countScopeType"
>
<template #action="{ row }">
<ButtonBase
@ -313,7 +313,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
tableObjectRef.value.params = {
masterId: row.id
}
getList()
await getList()
}
isShowDrawer.value = true
if (row) {

62
src/components/DetailTable/src/DetailTable.vue

@ -1,14 +1,17 @@
<template>
<div>
<el-table :data="data" style="width: 100%">
<el-table-column
:prop="item.field"
:label="item.label"
v-for="(item, index) in columns"
:key="index"
align="center"
>
<slot name="action" v-if="item.field == 'action'"></slot>
<el-table-column :prop="columns[0].field" :label="columns[0].label" align="center">
<template #default="scope">
{{ forrmatter(scope.row.type) }}
</template>
<!-- <slot name="action" v-if="item.field == 'action'"></slot> -->
</el-table-column>
<el-table-column :prop="columns[1].field" :label="columns[1].label" align="center">
<template #default="scope">
<div v-if=" scope.row.type == 'PROJECT'"> {{ scope.row.value }}</div>
<div v-else> {{ forrmatter1(scope.row) }}</div>
</template>
</el-table-column>
</el-table>
</div>
@ -39,8 +42,47 @@ const props = defineProps({
default: null
}
})
//
const data = ref(props.data)
const countScopeType = ref(props.countScopeType)
const allList = ref(props.allList)
const forrmatter = (val) => {
if(val){
return countScopeType.value.find((cur) => cur.value == val).label
}else{
return ''
}
}
const forrmatter1 = (item) => {
if(item?.type == 'OWNER'){
return allList.value.ownerAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'SUPPLIER'){
return allList.value.supplierAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'CUSTOMER'){
return allList.value.customerAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'ABC'){
return allList.value.abcList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'ITEMS_TYPE'){
return allList.value.itemTypeList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'ITEMS_GROUP'){
return allList.value.itemGroupList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'ITEMS_CODE'){
return allList.value.itembasicAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'WAREHOUSE_CODE'){
return allList.value.warehouseAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'AREABASIC_CODE'){
return allList.value.areaAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'LOCATIONGROUP_CODE'){
return allList.value.locationgroupAllList.find((cur) => cur.value == item.value).label
}else if(item?.type == 'LOCATION_CODE'){
return allList.value.locationAllList.find((cur) => cur.value == item.value).label
}else{
return ''
}
}
onMounted(async () => {
console.log('props.data',props.data)
})
</script>
<style lang="scss">
</style>

132
src/views/wms/countManage/count/countPlanMain/index.vue

@ -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 = [ {
type: '',
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=>{
return{
type:item.type,
value:item.value,
data.subList = tableData.value.map((item) => {
return {
type: item.type,
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 (
@ -502,97 +510,105 @@ const tableFormChange = async (field, val, row) => {
}
}
const allList=ref({
ownerAllList:[],
supplierAllList:[],
customerAllList:[],
itembasicAllList:[],
warehouseAllList:[],
areaAllList:[],
locationgroupAllList:[],
locationAllList:[],
abcList:getStrDictOptions(DICT_TYPE.ABC_CLASS),
itemTypeList:getStrDictOptions(DICT_TYPE.ITEM_TYPE),
itemGroupList:getStrDictOptions(DICT_TYPE.ITEM_GROUP),
const allList = ref({
ownerAllList: [],
supplierAllList: [],
customerAllList: [],
itembasicAllList: [],
warehouseAllList: [],
areaAllList: [],
locationgroupAllList: [],
locationAllList: [],
abcList: getStrDictOptions(DICT_TYPE.ABC_CLASS),
itemTypeList: getStrDictOptions(DICT_TYPE.ITEM_TYPE),
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
})
}
/** 初始化 **/

Loading…
Cancel
Save