Browse Source

表格高度,变更记录和备注列表接口

master
zhangli 1 year ago
parent
commit
7d8e0d66e3
  1. 1
      src/components/Detail/src/Detail.vue
  2. 28
      src/components/Search/src/Search.vue
  3. 5
      src/components/Table/src/Table.vue
  4. 7
      src/views/wms/itembasic/index.vue
  5. 375
      src/views/wms/purchaseclaimRequestMain/index.vue

1
src/components/Detail/src/Detail.vue

@ -203,6 +203,7 @@ const remarksSubmitScuess = async (remark) => {
} }
// //
const getChangeRecordList = async () => { const getChangeRecordList = async () => {
remarksData.data.tableId = '1679654720693248010'
remarksData.remarksList = await DetailApi.getChangeRecordPage(remarksData.data) remarksData.remarksList = await DetailApi.getChangeRecordPage(remarksData.data)
} }
</script> </script>

28
src/components/Search/src/Search.vue

@ -7,6 +7,9 @@ import { findIndex } from '@/utils'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import { FormSchema } from '@/types/form' import { FormSchema } from '@/types/form'
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
defineOptions({ name: 'Search' }) defineOptions({ name: 'Search' })
const { t } = useI18n() const { t } = useI18n()
@ -97,20 +100,23 @@ const setVisible = () => {
unref(elFormRef)?.resetFields() unref(elFormRef)?.resetFields()
visible.value = !unref(visible) visible.value = !unref(visible)
} }
const Search = ref()
onMounted(() => {
nextTick(() => {
console.log(4)
console.log(Search.value.offsetHeight)
wsCache.set('SearchoffsetHeight', Search.value.offsetHeight)
console.log(wsCache.get('SearchoffsetHeight'))
console.log(4)
})
})
</script> </script>
<template> <template>
<!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 --> <!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 -->
<Form <div ref="Search">
:inline="inline" <Form :inline="inline" :is-col="isCol" :is-custom="false" :label-width="labelWidth" :schema="newSchema"
:is-col="isCol" class="-mb-15px" hide-required-asterisk @register="register">
:is-custom="false"
:label-width="labelWidth"
:schema="newSchema"
class="-mb-15px"
hide-required-asterisk
@register="register"
>
<template #action> <template #action>
<div v-if="layout === 'inline'"> <div v-if="layout === 'inline'">
<!-- update by 芋艿去除搜索的 type="primary"颜色变淡一点 --> <!-- update by 芋艿去除搜索的 type="primary"颜色变淡一点 -->
@ -135,6 +141,8 @@ const setVisible = () => {
<slot :name="name"></slot> <slot :name="name"></slot>
</template> </template>
</Form> </Form>
</div>
<template v-if="layout === 'bottom'"> <template v-if="layout === 'bottom'">
<div :style="bottonButtonStyle"> <div :style="bottonButtonStyle">

5
src/components/Table/src/Table.vue

@ -7,6 +7,9 @@ import { getSlot } from '@/utils/tsxHelper'
import type { TableProps } from './types' import type { TableProps } from './types'
import { set } from 'lodash-es' import { set } from 'lodash-es'
import { Pagination, TableColumn, TableSetPropsType, TableSlotDefault } from '@/types/table' import { Pagination, TableColumn, TableSetPropsType, TableSlotDefault } from '@/types/table'
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
let SearchoffsetHeight =(wsCache.get('SearchoffsetHeight') + 310 )+'px'
export default defineComponent({ export default defineComponent({
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
@ -14,6 +17,7 @@ export default defineComponent({
props: { props: {
pageSize: propTypes.number.def(10), pageSize: propTypes.number.def(10),
currentPage: propTypes.number.def(1), currentPage: propTypes.number.def(1),
height: propTypes.string.def('calc(100vh - '+SearchoffsetHeight+')'),
// //
selection: propTypes.bool.def(false), selection: propTypes.bool.def(false),
// schemashowOverflowTooltip, // schemashowOverflowTooltip,
@ -289,6 +293,7 @@ export default defineComponent({
// @ts-ignore // @ts-ignore
ref={elTableRef} ref={elTableRef}
data={unref(getProps).data} data={unref(getProps).data}
height={unref(getProps).height}
onSelection-change={selectionChange} onSelection-change={selectionChange}
onSort-change={sortChange} onSort-change={sortChange}
{...unref(getBindValue)} {...unref(getBindValue)}

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

@ -14,7 +14,7 @@
total: tableObject.total total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"> }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage">
<template #code="{row}"> <template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code,route.name)"> <el-button type="primary" link @click="openDetail(row, '代码', row.code,'basicItembasic')">
<span>{{ row.code }}</span> <span>{{ row.code }}</span>
</el-button> </el-button>
</template> </template>
@ -53,10 +53,7 @@ import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import { ItemBasic, ItemBasicRules } from '@/utils/disposition/tableColumns' import { ItemBasic, ItemBasicRules } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { ItemBasicTabsList } from '@/utils/disposition/tabsList' import { ItemBasicTabsList } from '@/utils/disposition/tabsList'
defineOptions({ name: 'Itembasic' }) defineOptions({ name: 'Itembasic' })
const route = useRoute(); //
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ItembasicApi.getItembasicPage // getListApi: ItembasicApi.getItembasicPage //
@ -114,7 +111,7 @@ const butttondata = [
// - // -
const buttonTableClick = (val, row) => { const buttonTableClick = (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row.id) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }

375
src/views/wms/purchaseclaimRequestMain/index.vue

@ -1,304 +1,56 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <Search :schema="PurchaseclaimRequestMain.allSchemas.searchSchema" @search="setSearchParams"
class="-mb-15px" @reset="setSearchParams" />
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="发货单号" prop="asnNumber">
<el-input
v-model="queryParams.asnNumber"
placeholder="请输入发货单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="要货计划单号" prop="ppNumber">
<el-input
v-model="queryParams.ppNumber"
placeholder="请输入要货计划单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="供应商代码" prop="supplierCode">
<el-input
v-model="queryParams.supplierCode"
placeholder="请输入供应商代码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="单据号" prop="number">
<el-input
v-model="queryParams.number"
placeholder="请输入单据号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="业务类型" prop="businessType">
<el-input
v-model="queryParams.businessType"
placeholder="请输入业务类型"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="queryParams.remark"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建者用户名" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建者用户名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="申请时间" prop="requestTime">
<el-date-picker
v-model="queryParams.requestTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="截止时间" prop="dueTime">
<el-date-picker
v-model="queryParams.dueTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="部门" prop="departmentCode">
<el-input
v-model="queryParams.departmentCode"
placeholder="请输入部门"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.REQUEST_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateTime">
<el-date-picker
v-model="queryParams.updateTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="最后更新者用户名" prop="updater">
<el-input
v-model="queryParams.updater"
placeholder="请输入最后更新者用户名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="自动提交" prop="autoCommit">
<el-input
v-model="queryParams.autoCommit"
placeholder="请输入自动提交"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="自动通过" prop="autoAgree">
<el-input
v-model="queryParams.autoAgree"
placeholder="请输入自动通过"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="自动执行" prop="autoExecute">
<el-input
v-model="queryParams.autoExecute"
placeholder="请输入自动执行"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="直接生成记录" prop="directCreateRecord">
<el-input
v-model="queryParams.directCreateRecord"
placeholder="请输入直接生成记录"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
@click="openForm('create')"
v-hasPermi="['wms:purchaseclaim-request-main:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['wms:purchaseclaim-request-main:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap> </ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :tableColumns="PurchaseclaimRequestMain.allSchemas.tableColumns"/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <Table :columns="PurchaseclaimRequestMain.allSchemas.tableColumns" :data="tableObject.tableList"
<el-table-column label="发货单号" align="center" prop="asnNumber" width="150px" /> :loading="tableObject.loading" :pagination="{
<el-table-column label="要货计划单号" align="center" prop="ppNumber" width="150px" /> total: tableObject.total
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="150px" /> }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
<el-table-column label="单据号" align="center" prop="number" width="150px" /> v-model:sort="tableObject.sort">
<el-table-column label="业务类型" align="center" prop="businessType" width="150px" /> <template #itemCode="{ row }">
<el-table-column label="备注" align="center" prop="remark" width="150px" /> <el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)">
<el-table-column <span>{{ row.itemCode }}</span>
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="创建者用户名" align="center" prop="creator" width="150px" />
<el-table-column
label="申请时间"
align="center"
prop="requestTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column
label="截止时间"
align="center"
prop="dueTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="部门" align="center" prop="departmentCode" width="150px" />
<el-table-column label="状态" align="center" prop="status" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.REQUEST_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="最后更新时间"
align="center"
prop="updateTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="最后更新者用户名" align="center" prop="updater" width="150px" />
<el-table-column label="自动提交" align="center" prop="autoCommit" width="150px" />
<el-table-column label="自动通过" align="center" prop="autoAgree" width="150px" />
<el-table-column label="自动执行" align="center" prop="autoExecute" width="150px" />
<el-table-column label="直接生成记录" align="center" prop="directCreateRecord" width="150px" />
<el-table-column label="操作" align="center" width="150px" fixed="right">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['wms:purchaseclaim-request-main:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['wms:purchaseclaim-request-main:delete']"
>
删除
</el-button> </el-button>
</template> </template>
</el-table-column> <template #action="{ row }">
</el-table> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" />
<!-- 分页 --> </template>
<Pagination </Table>
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<PurchaseclaimRequestMainForm ref="formRef" @success="getList" /> <BasicForm
ref="formRef"
@success="getList"
:rules="PurchaseclaimRequestMainRules"
:formAllSchemas="PurchaseclaimRequestMain.allSchemas"
:apiUpdate="PurchaseclaimRequestMain.updateItempackaging"
:apiCreate="PurchaseclaimRequestMain.createItempackaging"
:isBusiness="false"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain/index.ts' import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain'
import PurchaseclaimRequestMainForm from './PurchaseclaimRequestMainForm.vue' import PurchaseclaimRequestMainForm from './PurchaseclaimRequestMainForm.vue'
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules } from '@/utils/disposition/tableColumns'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'PurchaseclaimRequestMain' }) defineOptions({ name: 'PurchaseclaimRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -325,17 +77,72 @@ const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // const exportLoading = ref(false) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { // const getList = async () => {
loading.value = true // loading.value = true
try { // try {
const data = await PurchaseclaimRequestMainApi.getPurchaseclaimRequestMainPage(queryParams) // const data = await PurchaseclaimRequestMainApi.getPurchaseclaimRequestMainPage(queryParams)
list.value = data.list // list.value = data.list
total.value = data.total // total.value = data.total
} finally { // } finally {
loading.value = false // loading.value = false
// }
// }
const { tableObject, tableMethods } = useTable({
getListApi: PurchaseclaimRequestMainApi.getPurchaseclaimRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:itempackaging:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:itempackaging:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:itempackaging:export' }), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
console.log(104, val)
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
} }
} }
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'wms:itempackaging:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:itempackaging:delete' }), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
// const res = await ItempackagingApi.getItempackaging(row.id)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1

Loading…
Cancel
Save