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. 59
      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,

59
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) => {
@ -458,7 +516,6 @@ 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 (

Loading…
Cancel
Save