优化进销存库存上传下载

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' 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.42:8000'
# VUE_APP_BASE_API = 'http://192.168.2.133:8000' # VUE_APP_BASE_API = 'http://192.168.2.133:8000'
VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn' 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 * @returns
*/ */
export function tbProductGet(params) { export function tbProductGet(params) {
return request({ return request({
url: '/api/tbProduct', url: "/api/tbProduct",
method: 'get', method: "get",
params params
}) });
} }
/** /**
@ -17,11 +17,11 @@ export function tbProductGet(params) {
* @returns * @returns
*/ */
export function dictDetail(params) { export function dictDetail(params) {
return request({ return request({
url: `/api/dictDetail`, url: `/api/dictDetail`,
method: 'get', method: "get",
params params
}) });
} }
/** /**
@ -29,11 +29,11 @@ export function dictDetail(params) {
* @returns * @returns
*/ */
export function tbProductStockDetail(data) { export function tbProductStockDetail(data) {
return request({ return request({
url: `/api/tbProductStockDetail/stock`, url: `/api/tbProductStockDetail/stock`,
method: 'post', method: "post",
data data
}) });
} }
/** /**
@ -41,11 +41,11 @@ export function tbProductStockDetail(data) {
* @returns * @returns
*/ */
export function tbProductStockDetailSum(params) { export function tbProductStockDetailSum(params) {
return request({ return request({
url: `/api/tbProductStockDetail/sum`, url: `/api/tbProductStockDetail/sum`,
method: 'get', method: "get",
params params
}) });
} }
/** /**
@ -53,23 +53,23 @@ export function tbProductStockDetailSum(params) {
* @returns * @returns
*/ */
export function tbShopPurveyorGet(params) { export function tbShopPurveyorGet(params) {
return request({ return request({
url: `/api/tbShopPurveyor`, url: `/api/tbShopPurveyor`,
method: 'get', method: "get",
params params
}) });
} }
/** /**
* 增加供应商 * 增加供应商
* @returns * @returns
*/ */
export function tbShopPurveyor(data, method = 'post') { export function tbShopPurveyor(data, method = "post") {
return request({ return request({
url: `/api/tbShopPurveyor`, url: `/api/tbShopPurveyor`,
method: method, method: method,
data data
}) });
} }
/** /**
@ -77,11 +77,11 @@ export function tbShopPurveyor(data, method = 'post') {
* @returns * @returns
*/ */
export function tbShopPurveyorTransactGet(params) { export function tbShopPurveyorTransactGet(params) {
return request({ return request({
url: `/api/tbShopPurveyorTransact`, url: `/api/tbShopPurveyorTransact`,
method: 'get', method: "get",
params params
}) });
} }
/** /**
@ -89,11 +89,11 @@ export function tbShopPurveyorTransactGet(params) {
* @returns * @returns
*/ */
export function tbShopPurveyorTransactInfo(data) { export function tbShopPurveyorTransactInfo(data) {
return request({ return request({
url: `/api/tbShopPurveyorTransact/info`, url: `/api/tbShopPurveyorTransact/info`,
method: 'post', method: "post",
data data
}) });
} }
/** /**
@ -101,11 +101,11 @@ export function tbShopPurveyorTransactInfo(data) {
* @returns * @returns
*/ */
export function tbShopPurveyorTransactSum(params) { export function tbShopPurveyorTransactSum(params) {
return request({ return request({
url: `/api/tbShopPurveyorTransact/sum`, url: `/api/tbShopPurveyorTransact/sum`,
method: 'get', method: "get",
params params
}) });
} }
/** /**
@ -113,11 +113,11 @@ export function tbShopPurveyorTransactSum(params) {
* @returns * @returns
*/ */
export function tbProductStockOperateList(data) { export function tbProductStockOperateList(data) {
return request({ return request({
url: `/api/tbProductStockOperate/list`, url: `/api/tbProductStockOperate/list`,
method: 'post', method: "post",
data data
}) });
} }
/** /**
@ -125,10 +125,10 @@ export function tbProductStockOperateList(data) {
* @returns * @returns
*/ */
export function tbProductStockOperateDetail(id) { export function tbProductStockOperateDetail(id) {
return request({ return request({
url: `/api/tbProductStockOperate/${id}`, url: `/api/tbProductStockOperate/${id}`,
method: 'get' method: "get"
}) });
} }
/** /**
@ -136,11 +136,70 @@ export function tbProductStockOperateDetail(id) {
* @returns * @returns
*/ */
export function tbProductStockOperateOutAndOn(data) { export function tbProductStockOperateOutAndOn(data) {
return request({ return request({
url: `/api/tbProductStockOperate/outAndOn`, url: `/api/tbProductStockOperate/outAndOn`,
method: 'post', method: "post",
data 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-tab-pane label="销量" name="2"></el-tab-pane>
</el-tabs> </el-tabs>
<div class="head-container"> <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-form-item>
<el-radio-group v-model="timeValue" @change="timeChange"> <el-radio-group v-model="timeValue" @change="timeChange">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
@ -17,24 +27,15 @@
<el-radio-button label="month">本月</el-radio-button> <el-radio-button label="month">本月</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button> <el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group> </el-radio-group>
<el-date-picker <el-date-picker v-model="query.createdAt" type="daterange" range-separator="" start-placeholder="开始日期"
v-model="query.createdAt" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" v-if="timeValue == 'custom'">
range-separator="至" </el-date-picker>
start-placeholder="开始日期" </el-form-item>
end-placeholder="结束日期" <el-form-item>
:default-time="['00:00:00', '23:59:59']" <el-button type="primary" @click="getTableData">查询</el-button>
value-format="yyyy-MM-dd HH:mm:ss"
v-if="timeValue == 'custom'"
>
</el-date-picker
><el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
<el-button <el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
icon="el-icon-download"
v-loading="downloadLoading"
@click="downloadHandle"
>
<span v-if="!downloadLoading">导出Excel</span> <span v-if="!downloadLoading">导出Excel</span>
<span v-else>下载中...</span> <span v-else>下载中...</span>
</el-button> </el-button>
@ -48,54 +49,68 @@
<i class="icon" :class="item.icon"></i> <i class="icon" :class="item.icon"></i>
</div> </div>
<div class="info"> <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 class="t">{{ item.payType }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-table <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 1">
: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="tradeDay"></el-table-column>
<el-table-column label="总金额" prop="total"></el-table-column> <el-table-column label="总金额" prop="total">
<el-table-column label="微信小程序支付" prop="wxLite"></el-table-column> <template v-slot="scope">
<el-table-column label="扫码支付金额" prop="scanCode"></el-table-column> {{ scope.row.total }}
<el-table-column label="现金支付金额" prop="cash"></el-table-column> </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>
<el-table <el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
: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="productName"></el-table-column>
<el-table-column <el-table-column label="商品分类" prop="cateName"></el-table-column>
label="商品描述" <el-table-column label="商品描述" prop="productSkuName"></el-table-column>
prop="productSkuName"
></el-table-column>
<el-table-column label="销量" prop="salesNum"></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="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> </el-table>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-pagination <el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
:total="tableData.total" @current-change="paginationChange" @size-change="sizeChange"
:current-page="tableData.page + 1" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
:page-size="tableData.size"
@current-change="paginationChange"
@size-change="sizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { daydownload, daycount, summaryday } from "@/api/home"; import { daydownload, daycount, summaryday } from "@/api/home";
import { tbShopCategoryGet } from '@/api/shop'
import dayjs from "dayjs"; import dayjs from "dayjs";
import { downloadFile } from "@/utils/index"; import { downloadFile } from "@/utils/index";
@ -105,8 +120,11 @@ export default {
timeValue: "", timeValue: "",
resetQuery: null, resetQuery: null,
orderType: "1", orderType: "1",
categorys: [],
query: { query: {
createdAt: [] createdAt: [],
proName: '',
cateId: ''
}, },
tableData: { tableData: {
data: [], data: [],
@ -128,8 +146,38 @@ export default {
mounted() { mounted() {
this.resetQuery = { ...this.query }; this.resetQuery = { ...this.query };
this.getTableData(); this.getTableData();
this.tbShopCategoryGet()
}, },
methods: { 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() { async daycount() {
try { try {
@ -149,7 +197,9 @@ export default {
const file = await daydownload({ const file = await daydownload({
type: this.orderType, type: this.orderType,
startTime: this.query.createdAt[0], 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"); downloadFile(file, "数据", "xlsx");
this.downloadLoading = false; this.downloadLoading = false;
@ -184,7 +234,9 @@ export default {
size: this.tableData.size, size: this.tableData.size,
type: this.orderType, type: this.orderType,
startTime: this.query.createdAt[0], 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.loading = false;
this.tableData.data = res.content; this.tableData.data = res.content;

View File

@ -5,7 +5,7 @@
</div> </div>
<div class="head-container"> <div class="head-container">
<el-table :data="tableData.detail.stockSnap" v-loading="tableData.loading" height="400px"> <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"> <el-table-column label="变动数量" prop="number">
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.number }}{{ scope.row.unitName }} {{ scope.row.number }}{{ scope.row.unitName }}
@ -16,7 +16,7 @@
<div class="head-container"> <div class="head-container">
<div class="row">备注{{ tableData.detail.remark }}</div> <div class="row">备注{{ tableData.detail.remark }}</div>
<div class="row">操作人{{ tableData.detail.operatorSnap.name }}</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> </div>
</el-dialog> </el-dialog>
</template> </template>

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData" <el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" /> style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态"> <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-select>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
@ -37,7 +38,7 @@
</el-table-column> </el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt"> <el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
@ -77,7 +78,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.dictDetail()
this.getTableData() this.getTableData()
}, },
methods: { methods: {
@ -111,14 +111,6 @@ export default {
paginationChange(e) { paginationChange(e) {
this.tableData.page = e - 1 this.tableData.page = e - 1
this.getTableData() 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"> <div class="head-container">
<el-radio-group v-model="query.time" @change="timeChange"> <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 :label="item.value" v-for="item in timeList" :key="item.label">{{ item.label
}}</el-radio-button> }}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="head-container" v-if="query.time == 'custom'"> <div class="head-container" v-if="query.time == 'custom'">
@ -14,7 +14,8 @@
<div class="head-container"> <div class="head-container">
<div class="filter_wrap"> <div class="filter_wrap">
<el-select v-model="query.type" placeholder="付款状态"> <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-select>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
@ -98,7 +99,9 @@
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="status"> <el-table-column label="状态" prop="status">
<template v-slot="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column> <el-table-column label="备注" prop="remark"></el-table-column>
@ -162,7 +165,20 @@ export default {
value: 'custom' value: 'custom'
} }
], ],
types: [], types: [
{
value: 0,
label: '待付款'
},
{
value: 1,
label: '已付款'
},
{
value: '-1',
label: '作废'
}
],
selectCount: 0, selectCount: 0,
query: { query: {
type: '', type: '',
@ -181,7 +197,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.dictDetail()
this.getTableData() this.getTableData()
this.tbShopPurveyorTransactSum() this.tbShopPurveyorTransactSum()
}, },
@ -217,14 +232,6 @@ export default {
this.tableData.page = e - 1 this.tableData.page = e - 1
this.getTableData() this.getTableData()
}, },
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
},
// //
timeChange(e) { timeChange(e) {
this.query.createdAt = [] this.query.createdAt = []

View File

@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData" <el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" /> style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态"> <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-select>
<el-button type="primary" @click="getTableData">查询</el-button> <el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button> <el-button @click="resetHandle">重置</el-button>
@ -37,7 +38,7 @@
</el-table-column> </el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt"> <el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="80"> <el-table-column label="操作" width="80">
@ -50,13 +51,14 @@
</el-table> </el-table>
</div> </div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size" <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> </div>
</template> </template>
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tbShopPurveyorTransactGet, dictDetail } from '@/api/invoicing' import { tbShopPurveyorTransactGet } from '@/api/invoicing'
export default { export default {
data() { data() {
return { return {
@ -77,7 +79,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.dictDetail()
this.getTableData() this.getTableData()
}, },
methods: { methods: {
@ -112,13 +113,9 @@ export default {
this.tableData.page = e - 1 this.tableData.page = e - 1
this.getTableData() this.getTableData()
}, },
async dictDetail() { pagesizeChange(e) {
const { content } = await dictDetail({ this.tableData.size = e
dictName: 'purveyor_transact_status', this.getTableData()
size: 100,
page: 0
})
this.types = content
} }
} }
} }

View File

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

View File

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