Browse Source

盘点详情新增

master
zhang_li 12 months ago
parent
commit
905dc07073
  1. 19
      src/components/Detail/src/Detail.vue
  2. 12
      src/components/DetailTable/src/DetailTable.vue
  3. 91
      src/views/wms/countManage/count/countPlanMain/index.vue

19
src/components/Detail/src/Detail.vue

@ -67,6 +67,7 @@
:data="tableObjectRef.tableList"
:allList="allList"
:countScopeType="countScopeType"
:key="updateKey"
>
<template #action="{ row }">
<ButtonBase
@ -138,7 +139,7 @@ const route = useRoute() // 路由信息
const routeName = ref()
routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
const updateKey = ref(0);
const props = defineProps({
//
@ -447,6 +448,7 @@ const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
emit('detailOpenForm', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
@ -455,6 +457,10 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type: string, row?: number) => {
console.log(row)
if(props.fromeWhere=='countPlan'){
}
formRef.value.open(type, row, masterParmas.value)
}
// form
@ -472,7 +478,8 @@ const submitForm = async (formType, data) => {
}
formRef.value.dialogVisible = false
//
getList()
await getList()
updateKey.value += 1;
} finally {
formRef.value.formLoading = false
}
@ -483,7 +490,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail'])
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail','detailOpenForm'])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
@ -494,10 +501,11 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
updateKey.value += 1;
} catch {}
}
//
const searchFormClick = (searchData) => {
const searchFormClick =async (searchData) => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
@ -512,7 +520,8 @@ const searchFormClick = (searchData) => {
tableMethodsRef.value = tableMethods
tableObjectRef.value.tableList = []
const { getList } = tableMethods
getList()
await getList()
updateKey.value += 1;
// tableObjectRef.value.params = {
// isSearch: true,
// filters: searchData.filters

12
src/components/DetailTable/src/DetailTable.vue

@ -14,7 +14,10 @@
</template>
</el-table-column>
<el-table-column prop="" label="操作" align="center">
<slot name="action" v-if="columns[2].field == 'action'"></slot>
<template #default="scope">
<slot name="action" :row="scope.row" v-if="columns[2].field == 'action'"></slot>
</template>
</el-table-column>
</el-table>
</div>
@ -23,6 +26,11 @@
<script lang="ts" setup>
defineOptions({ name: 'DetailTable' })
const props = defineProps({
row: {
type: Object,
required: true,
default: null
},
columns: {
type: Array,
required: true,
@ -33,7 +41,7 @@ const props = defineProps({
required: true,
default: null
},
//
//
allList: {
type: Object,
required: true,

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

@ -87,6 +87,7 @@
fromeWhere="countPlan"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
@detailOpenForm="detailOpenForm"
/>
<!-- 导入 -->
@ -329,6 +330,63 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
getLocationAllList()
detailRef.value.openDetail(row, titleName, titleValue)
}
//
const detailOpenForm = (row) => {
console.log(row)
if (
row.type == 'OWNER' ||
row.type == 'SUPPLIER' ||
row.type == 'CUSTOMER' ||
row.type == 'ABC' ||
row.type == 'ITEMS_TYPE' ||
row.type == 'ITEMS_GROUP' ||
row.type == 'ITEMS_CODE' ||
row.type == 'WAREHOUSE_CODE' ||
row.type == 'AREABASIC_CODE' ||
row.type == 'LOCATIONGROUP_CODE' ||
row.type == 'LOCATION_CODE'
) {
formTypeDetail.value = 'Select'
switch (row.type) {
case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList
break
case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList
break
case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList
break
case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break
case 'ITEMS_TYPE':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break
case 'ITEMS_GROUP':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList
break
case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList
break
case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList
break
case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList
break
case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList
break
}
} else if (val == 'PROJECT') {
formTypeDetail.value = 'InputString'
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
@ -454,11 +512,10 @@ const selectChange = (field, val) => {
}
}
}
const formTypeDetail = ref('InputString')//
const countPlanAllList = ref([])//
const formTypeDetail = ref('InputString') //
const countPlanAllList = ref([]) //
//
const selectChangeDetail= (field, val) => {
console.log('888',CountPlanDetail.allSchemas.formSchema)
const selectChangeDetail = (field, val) => {
if (field == 'type') {
// CountPlanDetail.allSchemas.formSchema[1].value = ''
if (
@ -472,42 +529,42 @@ const selectChangeDetail= (field, val) => {
val == 'WAREHOUSE_CODE' ||
val == 'AREABASIC_CODE' ||
val == 'LOCATIONGROUP_CODE' ||
val== 'LOCATION_CODE'
val == 'LOCATION_CODE'
) {
formTypeDetail.value = 'Select'
switch (val) {
case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList
countPlanAllList.value = allList.value.ownerAllList
break
case 'SUPPLIER':
countPlanAllList.value= allList.value.supplierAllList
countPlanAllList.value = allList.value.supplierAllList
break
case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList
countPlanAllList.value = allList.value.customerAllList
break
case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break
case 'ITEMS_TYPE':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break
case 'ITEMS_GROUP':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList
countPlanAllList.value = allList.value.itembasicAllList
break
case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList
countPlanAllList.value = allList.value.warehouseAllList
break
case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList
countPlanAllList.value = allList.value.areaAllList
break
case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList
countPlanAllList.value = allList.value.locationgroupAllList
break
case 'LOCATION_CODE':
countPlanAllList.value= allList.value.locationAllList
countPlanAllList.value = allList.value.locationAllList
break
}
} else if (val == 'PROJECT') {
@ -634,7 +691,7 @@ const getItembasicAllList = async () => {
//
const getWarehouseAllList = async () => {
await WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => {
allList.value.warehouseAllList = res.map((element) => {
allList.value.warehouseAllList = res.map((element) => {
return {
value: element.code,
label: element.name

Loading…
Cancel
Save