供应商管理

This commit is contained in:
duan 2024-06-22 18:25:48 +08:00
parent 72ed4be931
commit e571869422
5 changed files with 255 additions and 22 deletions

View File

@ -59,7 +59,14 @@ export function tbShopPurveyorGet(params) {
params params
}); });
} }
// 供应商列表1
export function tbShopPurveyorGets(params) {
return request({
url: `/api/tbShopPurveyorTransact`,
method: "get",
params
});
}
/** /**
* 增加供应商 * 增加供应商
* @returns * @returns
@ -95,7 +102,14 @@ export function tbShopPurveyorTransactInfo(data) {
data data
}); });
} }
// 付款
export function paidAmount(data) {
return request({
url: `/api/tbShopPurveyorTransact/payTransact`,
method: "post",
data
});
}
/** /**
* 进货账目汇总单一供应商 * 进货账目汇总单一供应商
* @returns * @returns

View File

@ -10,9 +10,9 @@
<el-form-item label="地址"> <el-form-item label="地址">
<el-input type="textarea" v-model="form.address" placeholder="请输入地址"></el-input> <el-input type="textarea" v-model="form.address" placeholder="请输入地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="标签"> <!-- <el-form-item label="标签">
<el-input v-model="form.tip" placeholder="请输入标签"></el-input> <el-input v-model="form.tip" placeholder="请输入标签"></el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="备注"> <el-form-item label="备注">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注"></el-input> <el-input type="textarea" v-model="form.remark" placeholder="请输入备注"></el-input>
</el-form-item> </el-form-item>
@ -35,7 +35,7 @@ export default {
purveyorName: '', purveyorName: '',
purveyorTelephone: '', purveyorTelephone: '',
address: '', address: '',
tip: '', // tip: '',
remark: '', remark: '',
}, },
rules: { rules: {
@ -85,7 +85,7 @@ export default {
this.form.purveyorName = '' this.form.purveyorName = ''
this.form.purveyorTelephone = '' this.form.purveyorTelephone = ''
this.form.address = '' this.form.address = ''
this.form.tip = '' // this.form.tip = ''
this.form.remark = '' this.form.remark = ''
} }
} }

View File

@ -0,0 +1,162 @@
<template>
<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-select v-model="query.type" placeholder="选择类型">
<el-option label="进货" value="purveyor"></el-option>
<el-option label="退货" value="reject"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</div>
</div>
<div class="head-container">
<el-button type="primary" icon="el-icon-plus" @click="$refs.addSupplier.show()">添加供应商</el-button>
</div>
<div class="head-container">
<el-table :data="tableData.list" v-loading="tableData.loading">
<el-table-column label="供应商" prop="purveyorName"></el-table-column>
<el-table-column label="联系电话" prop="purveyorTelephone"></el-table-column>
<el-table-column label="地址" prop="address"></el-table-column>
<!-- <el-table-column label="标签" prop="tip"></el-table-column> -->
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="剩余付款金额" prop="waitAmount">
<template v-slot="scope">
<span class="num" v-if="scope.row.waitAmount > 0">{{ scope.row.waitAmount }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="待付款笔数" prop="waitCount">
<template v-slot="scope">
<template v-if="scope.row.waitCount > 0">
<span class="count">{{ scope.row.waitCount }}</span>未付
</template>
<template v-else>-</template>
</template>
</el-table-column>
<el-table-column label="状态" prop="type">
<template v-slot="scope">
<el-tag :type="scope.row.type == 0 ? 'warning' : 'success'">
{{ scope.row.type == 0 ? '待支付' : '已完结' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope">
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="250">
<template v-slot="scope">
<el-button type="text" size="mini" round icon="el-icon-edit"
@click="$refs.addSupplier.show(scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
删除
</el-button>
</el-popconfirm>
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.id } }">
<el-button type="text" size="mini">查看详情</el-button>
</router-link>
</template>
</el-table-column>
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" @size-change="pagesizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<addSupplier ref="addSupplier" @success="getTableData" />
</div>
</template>
<script>
import dayjs from 'dayjs'
import { tbShopPurveyorGets, tbShopPurveyor } from '@/api/invoicing'
import addSupplier from './components/addSupplier'
export default {
components: {
addSupplier
},
data() {
return {
dayjs,
query: {
name: '',
type:""
},
tableData: {
page: 0,
size: 10,
total: 0,
sort: 'id',
loading: false,
list: []
}
}
},
mounted() {
this.getTableData()
},
methods: {
//
async delHandle(ids) {
try {
await tbShopPurveyor(ids, 'delete')
this.$notify({
title: '成功',
message: `删除成功`,
type: 'success'
});
this.getTableData()
} catch (error) {
console.log(error)
}
},
async getTableData() {
this.tableData.loading = true
try {
const res = await tbShopPurveyorGets({
page: this.tableData.page,
size: this.tableData.size,
sort: this.tableData.sort,
purveyorName: this.query.name,
type: this.query.type,
shopId: localStorage.getItem('shopId')
})
this.tableData.loading = false
this.tableData.list = res.content
this.tableData.total = res.totalElements
} catch (error) {
console.log(error);
}
},
//
resetHandle() {
this.query.name = ''
this.tableData.page = 0;
this.getTableData()
},
pagesizeChange(e) {
this.tableData.size = e
this.getTableData()
},
//
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
}
}
}
</script>
<style scoped lang="scss">
.num {
color: #F56C6C;
font-weight: bold;
}
.count {
color: #409EFF;
}
</style>

View File

@ -13,9 +13,13 @@
</div> </div>
<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.status" placeholder="付款状态">
<el-option label="待支付" value="0"></el-option> <el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option> <el-option label="已付款" value="1"></el-option>
</el-select>
<el-select v-model="query.type" placeholder="选择类型">
<el-option label="进货" value="purveyor"></el-option>
<el-option label="退货" value="reject"></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>
@ -83,7 +87,7 @@
</el-table-column> </el-table-column>
<el-table-column label="类型" prop="type"> <el-table-column label="类型" prop="type">
<template v-slot="scope"> <template v-slot="scope">
进货单 {{ scope.row.type == 'purveyor' ? '进货单' : '退货单' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="总金额" prop="totalAmount"> <el-table-column label="总金额" prop="totalAmount">
@ -91,6 +95,13 @@
{{ scope.row.totalAmount }} {{ scope.row.totalAmount }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="已付款金额" prop="totalAmount">
<template v-slot="scope">
<span style="color: #47B505;">
{{ scope.row.paidAmount }}
</span>
</template>
</el-table-column>
<el-table-column label="待付款金额" prop="waitAmount"> <el-table-column label="待付款金额" prop="waitAmount">
<template v-slot="scope"> <template v-slot="scope">
<span class="num" v-if="scope.row.waitAmount > 0">{{ scope.row.waitAmount }}</span> <span class="num" v-if="scope.row.waitAmount > 0">{{ scope.row.waitAmount }}</span>
@ -110,27 +121,43 @@
{{ scope.row.paidAt && dayjs(scope.row.paidAt).format('YYYY-MM-DD HH:mm:ss') }} {{ scope.row.paidAt && dayjs(scope.row.paidAt).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" align="center">
<template v-slot="scope"> <template v-slot="scope">
<router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.purveyorId } }"> <!-- <router-link :to="{ name: 'purchase_detail', query: { purveyorId: scope.row.purveyorId } }">
<el-button type="text" size="mini">查看详情</el-button> <el-button type="text" size="mini">查看详情</el-button>
</router-link> </router-link> -->
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</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" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<!-- 付款弹窗组件 -->
<el-dialog title="" :visible.sync="dialogTableVisible" width="350px">
<el-form>
<el-form-item label="付款金额" label-width="80px">
<el-input v-model="montey" type="number" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false"> </el-button>
<el-button type="primary" @click="sumbit()"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tbShopPurveyorTransactInfo, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing' import { tbShopPurveyorTransactInfo, paidAmount, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing'
export default { export default {
data() { data() {
return { return {
// id
idinfo: "",
dayjs, dayjs,
dialogTableVisible: false,
timeList: [ timeList: [
{ {
label: '全部', label: '全部',
@ -179,9 +206,11 @@ export default {
label: '作废' label: '作废'
} }
], ],
montey: null,
selectCount: 0, selectCount: 0,
query: { query: {
type: '', type: '',
status: '',
time: 'all', time: 'all',
createdAt: [] createdAt: []
}, },
@ -198,9 +227,29 @@ export default {
}, },
mounted() { mounted() {
this.getTableData() this.getTableData()
this.tbShopPurveyorTransactSum()
}, },
methods: { methods: {
Uppop(id) {
this.dialogTableVisible = true
this.idinfo = id
},
async sumbit() {
try {
const res = await paidAmount({
id: this.idinfo,
paidAmount: this.montey,
})
this.$message({ type: 'success', message: '付款成功!' });
setTimeout(() => {
this.dialogTableVisible = false
this.getTableData()
}, 1500);
} catch (error) {
console.log(error);
}
},
async getTableData() { async getTableData() {
this.tableData.loading = true this.tableData.loading = true
try { try {
@ -209,13 +258,14 @@ export default {
size: this.tableData.size, size: this.tableData.size,
sort: this.tableData.sort, sort: this.tableData.sort,
purveyorId: this.$route.query.purveyorId, purveyorId: this.$route.query.purveyorId,
status: this.query.type, status: this.query.status,
type: 'purveyor', type: this.query.type,
createdAt: this.query.createdAt createdAt: this.query.createdAt,
}) })
this.tableData.loading = false this.tableData.loading = false
this.tableData.list = res.content this.tableData.list = res.content
this.tableData.total = res.totalElements this.tableData.total = res.totalElements
this.tbShopPurveyorTransactSum()
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
@ -225,6 +275,8 @@ export default {
this.query.time = 'all' this.query.time = 'all'
this.query.createdAt = [] this.query.createdAt = []
this.tableData.page = 0; this.tableData.page = 0;
this.query.type = ''
this.query.status = ''
this.getTableData() this.getTableData()
}, },
// //
@ -266,7 +318,7 @@ export default {
this.selectCount = selection.length this.selectCount = selection.length
}, },
async tbShopPurveyorTransactSum() { async tbShopPurveyorTransactSum() {
this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: 'purveyor' }) this.info = await tbShopPurveyorTransactSum({ purveyorId: this.$route.query.purveyorId, type: this.query.type })
} }
} }
} }
@ -355,3 +407,8 @@ export default {
} }
} }
</style> </style>
<!-- <style>
/deep/ .el-dialog__body{
padding-right: 20px!important;
}
</style> -->

View File

@ -75,7 +75,7 @@
</div> </div>
<div class="head-container"> <div class="head-container">
<div class="collect_wrap"> <div class="collect_wrap">
<div class="item"> <!-- <div class="item">
<div class="icon_wrap" style="--bg-color:#C978EE"> <div class="icon_wrap" style="--bg-color:#C978EE">
<i class="icon el-icon-s-goods"></i> <i class="icon el-icon-s-goods"></i>
</div> </div>
@ -83,7 +83,7 @@
<div class="m">{{ payCountTotal }}</div> <div class="m">{{ payCountTotal }}</div>
<div class="t">总金额</div> <div class="t">总金额</div>
</div> </div>
</div> </div> -->
<div class="item" v-for="item in payCountList" :key="item.payType"> <div class="item" v-for="item in payCountList" :key="item.payType">
<div class="icon_wrap" style="--bg-color:#fff"> <div class="icon_wrap" style="--bg-color:#fff">
<el-image class="img" :src="item.icon"></el-image> <el-image class="img" :src="item.icon"></el-image>