This commit is contained in:
ChenQiuYu 2025-05-17 17:04:49 +08:00
parent 4281c34423
commit a270fd8f67
6 changed files with 54 additions and 38 deletions

View File

@ -30,7 +30,7 @@ const filteredData = computed(() => {
// //
const currentPage = ref(1) const currentPage = ref(1)
const pageSize = ref(10) const pageSize = ref(20)
const total = ref(0) const total = ref(0)
// //
const code = ref('') const code = ref('')
@ -39,12 +39,13 @@ onMounted(() => {
}) })
let init = () => { let init = () => {
const query = { const query = {
page: 1, pageNum: currentPage.value,
pageSize: 20, pageSize: pageSize.value,
code: code.value code: code.value
} }
post("social/upload/get3501List", {query: query}).then((res: any) => { post("social/upload/get3501List", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
total.value = res.total_count
}) })
} }
let changePage = (value: number) => { let changePage = (value: number) => {

View File

@ -135,7 +135,7 @@ const value1 = ref([])
// //
const currentPage = ref(1)// const currentPage = ref(1)//
const pageSize = ref(10)// const pageSize = ref(20)//
const total = ref(0) const total = ref(0)
// type typeName // type typeName
@ -182,8 +182,8 @@ onMounted(() => {
let init = () => { let init = () => {
const query = { const query = {
page: 1, pageNum: currentPage.value,
pageSize: 20, pageSize: pageSize.value,
socialType: Number(searchInfo.value.socialType) || null, socialType: Number(searchInfo.value.socialType) || null,
uploadStatus: searchStatus.value.uploadStatus || null, uploadStatus: searchStatus.value.uploadStatus || null,
createTimeBefore: value1.value ? formatDate(value1.value[0]) : null, createTimeBefore: value1.value ? formatDate(value1.value[0]) : null,
@ -191,6 +191,7 @@ let init = () => {
} }
post("social/upload/get3502List", {query: query}).then((res: any) => { post("social/upload/get3502List", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
total.value = res.total_count
}) })
} }
@ -240,6 +241,7 @@ const formatDate = (isoStr: any) => {
height: 60px; height: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end;
} }
} }

View File

@ -33,11 +33,15 @@
<el-table-column prop="name" label="商品名称"/> <el-table-column prop="name" label="商品名称"/>
<el-table-column prop="number" label="进货,退货数量" show-overflow-tooltip> <el-table-column prop="number" label="进货,退货数量" show-overflow-tooltip>
<template #default="{row}"> <template #default="{row}">
<el-icon v-if="row.number<0" style="font-size: 9px"><Minus /></el-icon> <el-icon v-if="row.number<0" style="font-size: 9px">
<el-icon v-if="row.number>0" style="font-size: 9px"><Plus /></el-icon> <Minus/>
</el-icon>
<el-icon v-if="row.number>0" style="font-size: 9px">
<Plus/>
</el-icon>
<span> <span>
<template v-if="row.number!=0"> <template v-if="row.number!=0">
{{Math.abs(row.number)}}{{row.packagingUnit}} {{ Math.abs(row.number) }}{{ row.packagingUnit }}
</template> </template>
</span> </span>
</template> </template>
@ -74,7 +78,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref, computed, onMounted} from 'vue' import {ref, computed, onMounted} from 'vue'
import { ElInput, ElTable, ElTableColumn, ElPagination } from 'element-plus' import {ElInput, ElTable, ElTableColumn, ElPagination} from 'element-plus'
import {post} from "@/utils/request.ts"; import {post} from "@/utils/request.ts";
import {Minus, Plus} from "@element-plus/icons-vue"; import {Minus, Plus} from "@element-plus/icons-vue";
@ -82,15 +86,15 @@ import {Minus, Plus} from "@element-plus/icons-vue";
const tableData = ref([]) const tableData = ref([])
// //
const searchInfo=ref<any>({ const searchInfo = ref<any>({})
}) const searchStatus = ref<any>({})
const searchStatus=ref<any>({
})
interface TypeMapping { interface TypeMapping {
[key: number]: string; [key: number]: string;
} }
// type typeName // type typeName
const socialTypeMapping: TypeMapping = { const socialTypeMapping: TypeMapping = {
101: '调拨入库', 101: '调拨入库',
102: '调拨出库', 102: '调拨出库',
103: '盘盈', 103: '盘盈',
@ -109,20 +113,21 @@ const uploadStatus = {
// //
const currentPage = ref(1) const currentPage = ref(1)
const pageSize = ref(10) const pageSize = ref(20)
const total= ref(0) const total = ref(0)
onMounted(()=>{ onMounted(() => {
init() init()
}) })
let init = ()=>{ let init = () => {
const query = { const query = {
page: 1, pageNum: currentPage.value,
pageSize: 20, pageSize: pageSize.value,
socialType:searchInfo.value.socialType||null, socialType: searchInfo.value.socialType || null,
uploadStatus:searchStatus.value.uploadStatus ||null, uploadStatus: searchStatus.value.uploadStatus || null,
} }
post("social/upload/get3503List",{query: query}).then((res:any)=>{ post("social/upload/get3503List", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
total.value = res.total_count
}) })
} }
let changePage = (value: number) => { let changePage = (value: number) => {
@ -131,26 +136,27 @@ let changePage = (value: number) => {
pageNum: value, pageNum: value,
pageSize: pageSize.value, pageSize: pageSize.value,
} }
post("social/upload/get3503List",{query: query}).then((res:any)=>{ post("social/upload/get3503List", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
total.value = res.total_count total.value = res.total_count
}) })
} }
let change_search=()=>{ let change_search = () => {
init() init()
} }
// YYYY-MM-DD // YYYY-MM-DD
const formatDate = (isoStr:any) => { const formatDate = (isoStr: any) => {
if (!isoStr){ if (!isoStr) {
return ""; return "";
} }
const date = new Date(isoStr); const date = new Date(isoStr);
return `${date.getFullYear()}-${(date.getMonth()+1).toString().padStart(2,'0')}-${date.getDate().toString().padStart(2,'0')}`; return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@use "@/assets/scss/base.scss"; @use "@/assets/scss/base.scss";
.container { .container {
height: 100%; height: 100%;
display: flex; display: flex;
@ -159,19 +165,22 @@ const formatDate = (isoStr:any) => {
.top { .top {
height: 60px; height: 60px;
} }
.content { .content {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
} }
.bottom { .bottom {
height: 60px; height: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
background: base.$background-color-base; justify-content: flex-end;
} }
} }
:deep(.el-select__wrapper){
:deep(.el-select__wrapper) {
height: 42px; height: 42px;
} }
</style> </style>

View File

@ -8,7 +8,7 @@ import {Search} from "@element-plus/icons-vue";
const tableData = ref([]) const tableData = ref([])
// //
const currentPage = ref(1) const currentPage = ref(1)
const pageSize = ref(10) const pageSize = ref(20)
const total = ref(0) const total = ref(0)
// //
const code = ref('') const code = ref('')
@ -17,12 +17,13 @@ onMounted(() => {
}) })
let init = () => { let init = () => {
const query = { const query = {
page: 1, pageNum: currentPage.value,
pageSize: 20, pageSize: pageSize.value,
code: code.value code: code.value
} }
post("social/upload/get3505List", {query: query}).then((res: any) => { post("social/upload/get3505List", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
total.value = res.total_count
}) })
} }
let changePage = (value: number) => { let changePage = (value: number) => {
@ -129,7 +130,7 @@ const formatDate = (isoStr: any) => {
height: 60px; height: 60px;
display: flex; display: flex;
align-items: center; align-items: center;
background: base.$background-color-base; justify-content: flex-end;
} }
} }

View File

@ -185,7 +185,8 @@
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:page-count="pageNum" :current-page="pageNum"
:page-size="pageSize"
:total="total" :total="total"
@current-change="changePage" @current-change="changePage"
/> />
@ -309,7 +310,7 @@ onMounted(() => {
let init = () => { let init = () => {
const query = { const query = {
pageNum: pageNum.value,// pageNum: pageNum.value,//
pageSize: 1,// pageSize: pageSize.value,//
} }
post("goods/goods/searchDetail", {query: query}).then((res: any) => { post("goods/goods/searchDetail", {query: query}).then((res: any) => {
tableData.value = res.list tableData.value = res.list
@ -327,6 +328,7 @@ let open_edit = (type: number, id: number) => {
// //
let total = ref(0) let total = ref(0)
let pageNum = ref(1) let pageNum = ref(1)
const pageSize= ref(20)
let changePage = (value: number) => { let changePage = (value: number) => {
pageNum.value = value pageNum.value = value
init() init()

View File

@ -141,8 +141,9 @@
<el-pagination <el-pagination
background background
layout="prev, pager, next" layout="prev, pager, next"
:current-page="pageNum"
:page-size="20"
:total="total" :total="total"
:page-count="pageNum"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
> >
</el-pagination> </el-pagination>