Browse Source

盘点详情新增

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

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

@ -14,7 +14,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" label="操作" align="center"> <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-column>
</el-table> </el-table>
</div> </div>
@ -23,6 +26,11 @@
<script lang="ts" setup> <script lang="ts" setup>
defineOptions({ name: 'DetailTable' }) defineOptions({ name: 'DetailTable' })
const props = defineProps({ const props = defineProps({
row: {
type: Object,
required: true,
default: null
},
columns: { columns: {
type: Array, type: Array,
required: true, required: true,
@ -33,7 +41,7 @@ const props = defineProps({
required: true, required: true,
default: null default: null
}, },
// //
allList: { allList: {
type: Object, type: Object,
required: true, required: true,

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

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

Loading…
Cancel
Save