优化进销存库存上传下载

This commit is contained in:
gyq 2024-06-20 09:06:35 +08:00
parent 2026193f0f
commit 7605011b63
13 changed files with 372 additions and 191 deletions

View File

@ -1,7 +1,7 @@
ENV = 'development'
# 接口地址
# VUE_APP_BASE_API = 'http://192.168.2.202:8000'
# VUE_APP_BASE_API = 'http://192.168.2.17:8000'
# VUE_APP_BASE_API = 'http://192.168.2.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000'
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'

View File

@ -1,15 +1,15 @@
import request from '@/utils/request'
import request from "@/utils/request";
/**
* 商品列表
* @returns
*/
export function tbProductGet(params) {
return request({
url: '/api/tbProduct',
method: 'get',
params
})
return request({
url: "/api/tbProduct",
method: "get",
params
});
}
/**
@ -17,11 +17,11 @@ export function tbProductGet(params) {
* @returns
*/
export function dictDetail(params) {
return request({
url: `/api/dictDetail`,
method: 'get',
params
})
return request({
url: `/api/dictDetail`,
method: "get",
params
});
}
/**
@ -29,11 +29,11 @@ export function dictDetail(params) {
* @returns
*/
export function tbProductStockDetail(data) {
return request({
url: `/api/tbProductStockDetail/stock`,
method: 'post',
data
})
return request({
url: `/api/tbProductStockDetail/stock`,
method: "post",
data
});
}
/**
@ -41,11 +41,11 @@ export function tbProductStockDetail(data) {
* @returns
*/
export function tbProductStockDetailSum(params) {
return request({
url: `/api/tbProductStockDetail/sum`,
method: 'get',
params
})
return request({
url: `/api/tbProductStockDetail/sum`,
method: "get",
params
});
}
/**
@ -53,23 +53,23 @@ export function tbProductStockDetailSum(params) {
* @returns
*/
export function tbShopPurveyorGet(params) {
return request({
url: `/api/tbShopPurveyor`,
method: 'get',
params
})
return request({
url: `/api/tbShopPurveyor`,
method: "get",
params
});
}
/**
* 增加供应商
* @returns
*/
export function tbShopPurveyor(data, method = 'post') {
return request({
url: `/api/tbShopPurveyor`,
method: method,
data
})
export function tbShopPurveyor(data, method = "post") {
return request({
url: `/api/tbShopPurveyor`,
method: method,
data
});
}
/**
@ -77,11 +77,11 @@ export function tbShopPurveyor(data, method = 'post') {
* @returns
*/
export function tbShopPurveyorTransactGet(params) {
return request({
url: `/api/tbShopPurveyorTransact`,
method: 'get',
params
})
return request({
url: `/api/tbShopPurveyorTransact`,
method: "get",
params
});
}
/**
@ -89,11 +89,11 @@ export function tbShopPurveyorTransactGet(params) {
* @returns
*/
export function tbShopPurveyorTransactInfo(data) {
return request({
url: `/api/tbShopPurveyorTransact/info`,
method: 'post',
data
})
return request({
url: `/api/tbShopPurveyorTransact/info`,
method: "post",
data
});
}
/**
@ -101,11 +101,11 @@ export function tbShopPurveyorTransactInfo(data) {
* @returns
*/
export function tbShopPurveyorTransactSum(params) {
return request({
url: `/api/tbShopPurveyorTransact/sum`,
method: 'get',
params
})
return request({
url: `/api/tbShopPurveyorTransact/sum`,
method: "get",
params
});
}
/**
@ -113,11 +113,11 @@ export function tbShopPurveyorTransactSum(params) {
* @returns
*/
export function tbProductStockOperateList(data) {
return request({
url: `/api/tbProductStockOperate/list`,
method: 'post',
data
})
return request({
url: `/api/tbProductStockOperate/list`,
method: "post",
data
});
}
/**
@ -125,10 +125,10 @@ export function tbProductStockOperateList(data) {
* @returns
*/
export function tbProductStockOperateDetail(id) {
return request({
url: `/api/tbProductStockOperate/${id}`,
method: 'get'
})
return request({
url: `/api/tbProductStockOperate/${id}`,
method: "get"
});
}
/**
@ -136,11 +136,70 @@ export function tbProductStockOperateDetail(id) {
* @returns
*/
export function tbProductStockOperateOutAndOn(data) {
return request({
url: `/api/tbProductStockOperate/outAndOn`,
method: 'post',
data
})
return request({
url: `/api/tbProductStockOperate/outAndOn`,
method: "post",
data
});
}
/**
* 库存列表
* @returns
*/
export function stock(params) {
return request({
url: `/api/stock`,
method: "get",
params
});
}
/**
* 导出数据
* @returns
*/
export function stockdownload(data) {
return request({
url: "/api/stock/download",
method: "post",
data: {
shopId: localStorage.getItem("shopId"),
...data
},
responseType: "blob"
});
}
/**
* 导出数据
* @returns
*/
export function stockdoImport(file) {
const formData = new FormData();
formData.append("file", file);
formData.append("shopId", localStorage.getItem("shopId"));
return request({
url: "/api/stock/doImport",
method: "post",
data: formData,
Headers: {
"Content-Type": "multipart/form-data"
}
});
}
/**
* 库存开关
* @returns
*/
export function stockStateChange(params) {
return request({
url: `/api/stock/isStock`,
method: "get",
params: {
shopId: localStorage.getItem("shopId"),
...params
}
});
}

View File

@ -5,7 +5,17 @@
<el-tab-pane label="销量" name="2"></el-tab-pane>
</el-tabs>
<div class="head-container">
<el-form :model="query" label-position="left">
<el-form :model="query" inline label-position="left">
<template v-if="orderType == 2">
<el-form-item>
<el-input placeholder="商品名称" v-model="query.proName" />
</el-form-item>
<el-form-item>
<el-select v-model="query.cateId" placeholder="商品分类" style="width: 140px;">
<el-option :label="item.name" :value="item.id" v-for="item in categorys" :key="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<el-form-item>
<el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="">全部</el-radio-button>
@ -17,24 +27,15 @@
<el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group>
<el-date-picker
v-model="query.createdAt"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'"
>
</el-date-picker
><el-button type="primary" @click="getTableData">查询</el-button>
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
<el-button
icon="el-icon-download"
v-loading="downloadLoading"
@click="downloadHandle"
>
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
<span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span>
</el-button>
@ -48,54 +49,68 @@
<i class="icon" :class="item.icon"></i>
</div>
<div class="info">
<div class="m">{{ item.payAmount }}</div>
<div class="m">
<template v-if="item.isAmount == 1"></template>
{{ item.payAmount }}
</div>
<div class="t">{{ item.payType }}</div>
</div>
</div>
</div>
</div>
<div class="head-container">
<el-table
:data="tableData.data"
v-loading="tableData.loading"
v-if="orderType == 1"
>
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
<el-table-column label="日期" prop="tradeDay"></el-table-column>
<el-table-column label="总金额" prop="total"></el-table-column>
<el-table-column label="微信小程序支付" prop="wxLite"></el-table-column>
<el-table-column label="扫码支付金额" prop="scanCode"></el-table-column>
<el-table-column label="现金支付金额" prop="cash"></el-table-column>
<el-table-column label="总金额" prop="total">
<template v-slot="scope">
{{ scope.row.total }}
</template>
</el-table-column>
<el-table-column label="微信小程序支付" prop="wxLite">
<template v-slot="scope">
{{ scope.row.wxLite }}
</template>
</el-table-column>
<el-table-column label="扫码支付金额" prop="scanCode">
<template v-slot="scope">
{{ scope.row.scanCode }}
</template>
</el-table-column>
<el-table-column label="现金支付金额" prop="cash">
<template v-slot="scope">
{{ scope.row.cash }}
</template>
</el-table-column>
</el-table>
<el-table
:data="tableData.data"
v-loading="tableData.loading"
v-if="orderType == 2"
>
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
<el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column
label="商品描述"
prop="productSkuName"
></el-table-column>
<el-table-column label="商品分类" prop="cateName"></el-table-column>
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
<el-table-column label="销量" prop="salesNum"></el-table-column>
<el-table-column label="退单量" prop="refNum"></el-table-column>
<el-table-column label="总量" prop="num"></el-table-column>
<el-table-column label="销售金额" prop="salesAmount">
<template v-slot="scope">
{{ scope.row.salesAmount }}
</template>
</el-table-column>
<el-table-column label="退款金额" prop="refAmount">
<template v-slot="scope">
{{ scope.row.refAmount }}
</template>
</el-table-column>
</el-table>
</div>
<div class="head-container">
<el-pagination
:total="tableData.total"
:current-page="tableData.page + 1"
:page-size="tableData.size"
@current-change="paginationChange"
@size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" @size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</div>
</template>
<script>
import { daydownload, daycount, summaryday } from "@/api/home";
import { tbShopCategoryGet } from '@/api/shop'
import dayjs from "dayjs";
import { downloadFile } from "@/utils/index";
@ -105,8 +120,11 @@ export default {
timeValue: "",
resetQuery: null,
orderType: "1",
categorys: [],
query: {
createdAt: []
createdAt: [],
proName: '',
cateId: ''
},
tableData: {
data: [],
@ -128,8 +146,38 @@ export default {
mounted() {
this.resetQuery = { ...this.query };
this.getTableData();
this.tbShopCategoryGet()
},
methods: {
//
async tbShopCategoryGet() {
try {
const res = await tbShopCategoryGet({
page: 0,
size: 200,
sort: 'id,desc',
shopId: localStorage.getItem('shopId')
})
let categorys = []
for (let item of res.content) {
categorys.push({
name: `|----${item.name}`,
id: item.id
})
if (item.childrenList.length) {
for (let val of item.childrenList) {
categorys.push({
name: `|----|----${val.name}`,
id: val.id
})
}
}
}
this.categorys = categorys
} catch (error) {
console.log(error);
}
},
//
async daycount() {
try {
@ -149,7 +197,9 @@ export default {
const file = await daydownload({
type: this.orderType,
startTime: this.query.createdAt[0],
endTime: this.query.createdAt[1]
endTime: this.query.createdAt[1],
cateId: this.query.cateId,
proName: this.query.proName
});
downloadFile(file, "数据", "xlsx");
this.downloadLoading = false;
@ -184,7 +234,9 @@ export default {
size: this.tableData.size,
type: this.orderType,
startTime: this.query.createdAt[0],
endTime: this.query.createdAt[1]
endTime: this.query.createdAt[1],
proName: this.query.proName,
cateId: this.query.cateId
});
this.tableData.loading = false;
this.tableData.data = res.content;

View File

@ -5,7 +5,7 @@
</div>
<div class="head-container">
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px">
<el-table-column :label="`商品名称${tableData.detail.stockSnap.length}`" prop="name"></el-table-column>
<el-table-column :label="`商品名称`" prop="name"></el-table-column>
<el-table-column label="变动数量" prop="number">
<template v-slot="scope">
{{ scope.row.number }}{{ scope.row.unitName }}
@ -16,7 +16,7 @@
<div class="head-container">
<div class="row">备注{{ tableData.detail.remark }}</div>
<div class="row">操作人{{ tableData.detail.operatorSnap.name }}</div>
<div class="row">创建时间{{ tableData.detail.createdAt }}</div>
<div class="row">创建时间{{ dayjs(tableData.detail.createdAt).format('YYYY-MM-DD HH:mm:ss') }}</div>
</div>
</el-dialog>
</template>

View File

@ -1,23 +1,30 @@
<template>
<div class="app-container">
<div class="head-container">
<el-row :gutter="20">
<el-col :span="6">
<el-input v-model="query.name" size="small" clearable placeholder="商品名称" style="width: 100%;"
class="filter-item" @keyup.enter.native="getTableData" />
</el-col>
<el-col :span="6">
<div class="row_wrap">
<div class="row">
<el-input v-model="query.name" size="small" clearable placeholder="商品名称"
@keyup.enter.native="getTableData" />
<el-select v-model="query.isStock" placeholder="库存开关">
<el-option label="开" :value="1"></el-option>
<el-option label="关" :value="0"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</el-col>
</el-row>
</div>
<div class="row">
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出库存</el-button>
<el-button icon="el-icon-upload2" :loading="uploadLoading"
@click="dialogVisible = true">导入库存</el-button>
</div>
</div>
</div>
<div class="head-container">
<el-table :data="tableData.list" v-loading="tableData.loading">
<el-table-column label="商品信息">
<template v-slot="scope">
<div class="shop_info">
<el-image :src="scope.row.coverImg" class="cover">
<el-image :src="scope.row.img" class="cover">
<div class="img_error" slot="error">
<i class="icon el-icon-document-delete"></i>
</div>
@ -25,20 +32,21 @@
<div class="info">
<span>{{ scope.row.name }}</span>
<div>
<el-tag type="primary">{{ scope.row.typeEnum | typeEnum }}</el-tag>
<el-tag type="primary">{{ scope.row.type }}</el-tag>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="库存" prop="stockNumber">
<el-table-column label="库存" prop="number">
<template v-slot="scope">
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
{{ `${scope.row.number} ${scope.row.unitName}` }}
</template>
</el-table-column>
<el-table-column label="库存开关">
<template v-slot="scope">
<el-switch v-model="scope.row.isStock" :active-value="1" :inactive-value="0"></el-switch>
<el-switch v-model="scope.row.isStock" :active-value="1" :inactive-value="0"
@change="showChange($event, scope.row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
@ -54,22 +62,33 @@
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
<invoicingDetail ref="invoicingDetail" />
<!-- 导入库存弹窗 -->
<el-dialog title="导入库存" :visible.sync="dialogVisible">
<UploadExcel :beforeUpload="excelSuccessUpload" />
</el-dialog>
</div>
</template>
<script>
import { tbProductGet } from '@/api/invoicing'
import { stock, stockdownload, stockdoImport, stockStateChange } from '@/api/invoicing'
import settings from '@/settings'
import invoicingDetail from './components/invoicingDetail'
import UploadExcel from '@/components/UploadExcel/'
import { downloadFile } from "@/utils/index";
export default {
components: {
invoicingDetail
invoicingDetail,
UploadExcel
},
data() {
return {
dialogVisible: false,
query: {
name: ''
name: '',
isStock: ''
},
downloadLoading: false,
uploadLoading: false,
tableData: {
page: 0,
size: 10,
@ -89,25 +108,60 @@ export default {
this.getTableData()
},
methods: {
async excelSuccessUpload(file) {
console.log(file);
try {
this.uploadLoading = true
this.dialogVisible = false
const res = await stockdoImport(file)
this.uploadLoading = false
this.$notify.success('导入成功')
this.getTableData()
} catch (error) {
this.dialogVisible = false
this.uploadLoading = false
console.log(error);
}
},
//
async protHandle() {
try {
this.downloadLoading = true;
const file = await stockdownload({
name: this.query.name,
isStock: this.query.isStock
})
downloadFile(file, "商品库存", "xlsx");
this.downloadLoading = false;
} catch (error) {
this.downloadLoading = false;
console.log(error);
}
},
//
async showChange(e, row) {
try {
await stockStateChange({
proId: row.proId,
isStock: row.isStock
})
this.getTableData()
} catch (error) {
console.error(error);
}
},
async getTableData() {
this.tableData.loading = true
try {
const res = await tbProductGet({
const res = await stock({
page: this.tableData.page,
size: this.tableData.size,
sort: this.tableData.sort,
name: this.query.name,
isStock: this.query.isStock,
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false
this.tableData.list = res.content.map(item => {
let stockNumber = 0
for (let i of item.skuList) {
stockNumber += i.stockNumber
}
item.stockNumber = stockNumber
return item
})
this.tableData.list = res.content
this.tableData.total = res.totalElements
} catch (error) {
console.log(error);
@ -120,7 +174,7 @@ export default {
},
//
resetHandle() {
this.query.blurry = ''
this.query.name = ''
this.tableData.page = 0;
this.getTableData()
}
@ -148,4 +202,15 @@ export default {
justify-content: space-between;
}
}
.row_wrap {
display: flex;
justify-content: space-between;
.row {
display: flex;
align-items: center;
gap: 10px;
}
}
</style>

View File

@ -13,7 +13,7 @@
<el-table :data="tableData.list" v-loading="tableData.loading">
<el-table-column label="类型" prop="type">
<template v-slot="scope">
{{ scope.row.type == 'reject' ? '退货出库' : '供应商入库' }}
{{ scope.row.type }}
</template>
</el-table-column>
<el-table-column label="商品数量" prop="totalAmount">

View File

@ -89,8 +89,8 @@
</el-table-column>
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number>
<!-- <el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number> -->
<div class="tips">成本价{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -103,8 +103,9 @@
</el-table-column>
<el-table-column label="小计">
<template v-slot="scope">
<el-input-number v-model="scope.row.totalAmount" :min="0"
controls-position="right"></el-input-number>
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
controls-position="right"></el-input-number> -->
<el-input :value="scope.row.costPrice * scope.row.number" readonly style="width: 100px;" />
</template>
</el-table-column>
<el-table-column label="变动后剩余库存">

View File

@ -39,7 +39,8 @@
</el-col>
<el-col :span="8">
<el-form-item label="实收金额">
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额" style="width: 220px;"></el-input>
<el-input v-model="queryForm.paidAmount" placeholder="请输入实收金额"
style="width: 220px;"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -53,7 +54,8 @@
</el-col>
<el-col :span="8">
<el-form-item label="批号">
<el-input v-model="queryForm.batchNumber" placeholder="请输入批号" style="width: 220px;"></el-input>
<el-input v-model="queryForm.batchNumber" placeholder="请输入批号"
style="width: 220px;"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -87,8 +89,8 @@
</el-table-column>
<el-table-column label="进价">
<template v-slot="scope">
<el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number>
<!-- <el-input-number v-model="scope.row.guidePrice" :min="0" controls-position="right"
@change="e => scope.row.totalAmount = e * scope.row.number"></el-input-number> -->
<div class="tips">成本价{{ scope.row.costPrice }}/{{ scope.row.unitName }}</div>
</template>
</el-table-column>
@ -101,8 +103,9 @@
</el-table-column>
<el-table-column label="小计">
<template v-slot="scope">
<el-input-number v-model="scope.row.totalAmount" :min="0"
controls-position="right"></el-input-number>
<!-- <el-input-number v-model="scope.row.totalAmount" :min="0"
controls-position="right"></el-input-number> -->
<el-input :value="scope.row.costPrice * scope.row.number" readonly style="width: 100px;" />
</template>
</el-table-column>
<el-table-column label="变动后剩余库存">

View File

@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -37,7 +38,7 @@
</el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope">
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
@ -77,7 +78,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
},
methods: {
@ -111,14 +111,6 @@ export default {
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
}
}
}

View File

@ -3,7 +3,7 @@
<div class="head-container">
<el-radio-group v-model="query.time" @change="timeChange">
<el-radio-button :label="item.value" v-for="item in timeList" :key="item.label">{{ item.label
}}</el-radio-button>
}}</el-radio-button>
</el-radio-group>
</div>
<div class="head-container" v-if="query.time == 'custom'">
@ -14,7 +14,8 @@
<div class="head-container">
<div class="filter_wrap">
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -98,7 +99,9 @@
</el-table-column>
<el-table-column label="状态" prop="status">
<template v-slot="scope">
<el-tag type="info">{{ types.find(item => item.value == scope.row.status).label }}</el-tag>
<el-tag type="info">
{{ types.find(item => item.value == scope.row.status).label }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
@ -162,7 +165,20 @@ export default {
value: 'custom'
}
],
types: [],
types: [
{
value: 0,
label: '待付款'
},
{
value: 1,
label: '已付款'
},
{
value: '-1',
label: '作废'
}
],
selectCount: 0,
query: {
type: '',
@ -181,7 +197,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
this.tbShopPurveyorTransactSum()
},
@ -217,14 +232,6 @@ export default {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
},
//
timeChange(e) {
this.query.createdAt = []

View File

@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@ -37,7 +38,7 @@
</el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope">
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
@ -50,13 +51,14 @@
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="paginationChange" @size-change="pagesizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { tbShopPurveyorTransactGet, dictDetail } from '@/api/invoicing'
import { tbShopPurveyorTransactGet } from '@/api/invoicing'
export default {
data() {
return {
@ -77,7 +79,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
},
methods: {
@ -112,13 +113,9 @@ export default {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
pagesizeChange(e) {
this.tableData.size = e
this.getTableData()
}
}
}

View File

@ -2,8 +2,8 @@
<div class="app-container">
<div class="head-container">
<div class="filter_wrap">
<el-input v-model="query.name" size="small" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-input v-model="query.name" size="small" clearable placeholder="供应商"
@keyup.enter.native="getTableData" style="width: 200px;" />
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</div>
@ -32,7 +32,8 @@
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="paginationChange" @size-change="pagesizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<addSupplier ref="addSupplier" @success="getTableData" />
</div>
</template>
@ -100,6 +101,10 @@ export default {
this.tableData.page = 0;
this.getTableData()
},
pagesizeChange(e) {
this.tableData.size = e
this.getTableData()
},
//
paginationChange(e) {
this.tableData.page = e - 1

View File

@ -47,7 +47,7 @@ export default {
return {
tableData: {
page: 0,
size: 10,
size: 30,
total: 0,
loading: false,
list: []