Browse Source

单据详情

master
zhangli 1 year ago
parent
commit
9da637c36a
  1. 5
      src/components/Descriptions/src/Descriptions.vue
  2. 34
      src/components/Detail/src/Detail.vue
  3. 2
      src/components/Form/src/helper.ts
  4. 1
      src/views/wms/itembasic/ItembasicForm.vue
  5. 4
      src/views/wms/itembasic/index.vue

5
src/components/Descriptions/src/Descriptions.vue

@ -22,6 +22,8 @@ const props = defineProps({
collapse: propTypes.bool.def(true), collapse: propTypes.bool.def(true),
columns: propTypes.number.def(1), columns: propTypes.number.def(1),
width: propTypes.string.def('50px'), width: propTypes.string.def('50px'),
labelAlign: propTypes.string.def('right'),
labelClassName: propTypes.string.def(''),
schema: { schema: {
type: Array as PropType<DescriptionsSchema[]>, type: Array as PropType<DescriptionsSchema[]>,
default: () => [] default: () => []
@ -109,7 +111,8 @@ const toggleClick = () => {
v-for="item in schema" v-for="item in schema"
:key="item.field" :key="item.field"
v-bind="getBindItemValue(item)" v-bind="getBindItemValue(item)"
label-align="right" :label-align="labelAlign"
:label-class-name="labelClassName"
:width="width" :width="width"
> >
<template #label> <template #label>

34
src/components/Detail/src/Detail.vue

@ -1,10 +1,12 @@
<template> <template>
<el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading" > <el-drawer v-model="isShowDrawer" title="详情" direction="rtl" size="80%" v-loading="detailLoading" >
<div class="custom-class"> <template #header>
<ContentWrap>
<div class="font-size-18px"> <div class="font-size-18px">
{{ detailData.code }} <span class="ml-20px font-size-16px">{{ detailData.name }}</span> {{ detailData.code }} <span class="ml-20px font-size-16px">{{ detailData.name }}</span>
</div> </div>
</template>
<ContentWrap>
<Descriptions :data="detailData" labelClassName="label-class-name" label-align="left" direction="vertical" :column="8" :schema="ItemBasic.allSchemas.detailSchema" :columns="2" width="200px"/>
</ContentWrap> </ContentWrap>
<Tabs :tabsList="tabsList" :current="current" @change="change" /> <Tabs :tabsList="tabsList" :current="current" @change="change" />
<div class="flex" v-if="current == 0"> <div class="flex" v-if="current == 0">
@ -24,12 +26,15 @@
<ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" :importTemplateData="importTemplateData" @success="importSuccess" />
</div> </div>
<ContentWrap v-else> <ContentWrap v-else>
<Table :columns="ItemBasic.allSchemas.tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" <Table
:pagination="{ :columns="ItemBasic.allSchemas.tableColumns"
total: tableObject.total :data="tableObject.tableList"
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" /> :loading="tableObject.loading"
:pagination="{total: tableObject.total}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
/>
</ContentWrap> </ContentWrap>
</div>
</el-drawer> </el-drawer>
</template> </template>
@ -42,11 +47,8 @@ import ChangeRecord from '@/components/ChangeRecord/src/ChangeRecord.vue'
import Tabs from '@/components/Tabs/src/Tabs.vue' import Tabs from '@/components/Tabs/src/Tabs.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns.ts' import { ItemBasic } from '@/utils/disposition/tableColumns.ts'
import { ItemBasicTabsList } from '@/utils/disposition/tabsList.ts' import { ItemBasicTabsList } from '@/utils/disposition/tabsList.ts'
import { getItembasic } from '@/api/wms/itembasic'
import * as ItembasicApi from '@/api/wms/itembasic' import * as ItembasicApi from '@/api/wms/itembasic'
import * as UserApi from '@/api/system/user'
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const tabsList = ref(JSON.parse(JSON.stringify(ItemBasicTabsList))) const tabsList = ref(JSON.parse(JSON.stringify(ItemBasicTabsList)))
@ -177,10 +179,14 @@ const openDetail = async (id?: number) => {
} }
defineExpose({ openDetail }) // open defineExpose({ openDetail }) // open
</script> </script>
<style scoped lang="scss"> <style lang="scss">
.custom-class{ .el-drawer__body{
background: #f5f5f5!important; background: #f5f5f5!important;
margin: -20px;
padding: 20px;
} }
::v-deep(.label-class-name){
color: #dedede;
}
</style>
<style scoped lang="scss">
</style> </style>

2
src/components/Form/src/helper.ts

@ -21,8 +21,6 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderModel => {
} }
if (selectMap.includes(schema?.component as string)) { if (selectMap.includes(schema?.component as string)) {
// 一些范围选择器 // 一些范围选择器
console.log('type=' +schema?.componentProps?.type);
const twoTextMap = ['datetimerange', 'daterange', 'monthrange', 'datetimerange', 'daterange'] const twoTextMap = ['datetimerange', 'daterange', 'monthrange', 'datetimerange', 'daterange']
if ( if (
twoTextMap.includes( twoTextMap.includes(

1
src/views/wms/itembasic/ItembasicForm.vue

@ -117,7 +117,6 @@ const Butttondata = [
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
// //
if (val == 'save') { if (val == 'save') {
console.log(417, item)
} }
// //
else if (val == 'close') { else if (val == 'close') {

4
src/views/wms/itembasic/index.vue

@ -44,10 +44,6 @@ import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import { ItemBasic } from '@/utils/disposition/tableColumns' import { ItemBasic } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
const router = useRouter() // const router = useRouter() //
console.log(ItembasicApi.importUrl);
// tableObject // tableObject
// tableMethods // tableMethods
// https://doc.iocoder.cn/vue3/crud-schema/ // https://doc.iocoder.cn/vue3/crud-schema/

Loading…
Cancel
Save