供应商管理

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

@@ -13,9 +13,13 @@
</div>
<div class="head-container">
<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="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-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@@ -83,7 +87,7 @@
</el-table-column>
<el-table-column label="类型" prop="type">
<template v-slot="scope">
进货单
{{ scope.row.type == 'purveyor' ? '进货单' : '退货单' }}
</template>
</el-table-column>
<el-table-column label="总金额" prop="totalAmount">
@@ -91,6 +95,13 @@
{{ scope.row.totalAmount }}
</template>
</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">
<template v-slot="scope">
<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') }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="80">
<el-table-column label="操作" width="80" align="center">
<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>
</router-link>
</router-link> -->
<el-button type="text" size="mini" round @click="Uppop(scope.row.id)">付款</el-button>
</template>
</el-table-column> -->
</el-table-column>
</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>
<!-- 付款弹窗组件 -->
<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>
</template>
<script>
import dayjs from 'dayjs'
import { tbShopPurveyorTransactInfo, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing'
import { tbShopPurveyorTransactInfo, paidAmount, dictDetail, tbShopPurveyorTransactSum } from '@/api/invoicing'
export default {
data() {
return {
// 付款当前的id
idinfo: "",
dayjs,
dialogTableVisible: false,
timeList: [
{
label: '全部',
@@ -179,9 +206,11 @@ export default {
label: '作废'
}
],
montey: null,
selectCount: 0,
query: {
type: '',
status: '',
time: 'all',
createdAt: []
},
@@ -198,9 +227,29 @@ export default {
},
mounted() {
this.getTableData()
this.tbShopPurveyorTransactSum()
},
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() {
this.tableData.loading = true
try {
@@ -209,13 +258,14 @@ export default {
size: this.tableData.size,
sort: this.tableData.sort,
purveyorId: this.$route.query.purveyorId,
status: this.query.type,
type: 'purveyor',
createdAt: this.query.createdAt
status: this.query.status,
type: this.query.type,
createdAt: this.query.createdAt,
})
this.tableData.loading = false
this.tableData.list = res.content
this.tableData.total = res.totalElements
this.tbShopPurveyorTransactSum()
} catch (error) {
console.log(error);
}
@@ -225,6 +275,8 @@ export default {
this.query.time = 'all'
this.query.createdAt = []
this.tableData.page = 0;
this.query.type = ''
this.query.status = ''
this.getTableData()
},
// 分页回调
@@ -266,7 +318,7 @@ export default {
this.selectCount = selection.length
},
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 })
}
}
}
@@ -354,4 +406,9 @@ export default {
}
}
}
</style>
</style>
<!-- <style>
/deep/ .el-dialog__body{
padding-right: 20px!important;
}
</style> -->