fix:供应商账单测试
This commit is contained in:
@@ -12,28 +12,30 @@
|
||||
|
||||
<el-col :span="16">
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button type="primary" @click="getTableData" plain>批量付款</el-button>
|
||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:供应商名称</el-text>
|
||||
<el-button type="primary" @click="handlePayment('all')" plain>批量付款</el-button>
|
||||
<el-text tag="b" size="large" style="margin-left: 15px;">供应商:{{ state.supplierName }}</el-text>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-card shadow="never">
|
||||
<el-table v-loading="state.tableData.loading" :data="state.tableData.list">
|
||||
<el-table @selection-change="handleSelectionChange" v-loading="state.tableData.loading"
|
||||
:data="state.tableData.list">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column label="耗材信息">
|
||||
<template v-slot="scope">
|
||||
<div>{{ scope.row.shopName }}({{ scope.row.shopName }})</div>
|
||||
<div>账号:{{ scope.row.shopName }}</div>
|
||||
<div>联系电话:{{ scope.row.phone }}</div>
|
||||
<div>{{ scope.row.conName }}</div>
|
||||
<div>单价:{{ scope.row.purchasePrice }}</div>
|
||||
<div>入库数量:{{ scope.row.inOutNumber }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="账单金额" width="120" />
|
||||
<el-table-column prop="status" label="已付款金额" width="120" />
|
||||
<el-table-column prop="status" label="未付款金额" width="120" />
|
||||
<el-table-column prop="status" label="创建时间" width="120" />
|
||||
<el-table-column prop="createdAt" label="备注" />
|
||||
<el-table-column prop="amountPayable" label="账单金额" width="120" />
|
||||
<el-table-column prop="actualPaymentAmount" label="已付款金额" width="120" />
|
||||
<el-table-column prop="unPaidAmount" label="未付款金额" width="120" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="120" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="small" link @click="handlePayment(scope.row)">
|
||||
@@ -58,9 +60,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ShopApi from "@/api/account/shop";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import AuthAPI from "@/api/supplier/index";
|
||||
import payment from "./components/payment.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -68,6 +70,7 @@ const router = useRouter();
|
||||
const state = reactive({
|
||||
query: {
|
||||
name: "",
|
||||
vendorId: null,
|
||||
},
|
||||
tableData: {
|
||||
list: [],
|
||||
@@ -76,23 +79,28 @@ const state = reactive({
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
supplierName: '',
|
||||
flowIdList: [],
|
||||
allAmount: 0
|
||||
});
|
||||
onMounted(() => {
|
||||
console.log(route.query);
|
||||
if (route.query.id) {
|
||||
if (route.query.vendorId) {
|
||||
state.query.vendorId = route.query.vendorId
|
||||
}
|
||||
if (route.query.supplierName) {
|
||||
state.supplierName = route.query.supplierName
|
||||
}
|
||||
getTableData();
|
||||
});
|
||||
// 获取商家列表
|
||||
// 获取账单记录列表
|
||||
async function getTableData() {
|
||||
state.tableData.loading = true;
|
||||
try {
|
||||
const res = await ShopApi.getList({
|
||||
const res = await AuthAPI.getRecordList({
|
||||
page: state.tableData.page,
|
||||
size: state.tableData.size,
|
||||
shopName: state.query.name,
|
||||
account: state.query.account,
|
||||
status: state.query.status,
|
||||
key: state.query.name,
|
||||
vendorId: state.query.vendorId,
|
||||
});
|
||||
state.tableData.loading = false;
|
||||
state.tableData.list = res.records;
|
||||
@@ -103,11 +111,28 @@ async function getTableData() {
|
||||
}
|
||||
const refPayment = ref();
|
||||
function handlePayment(item) {
|
||||
refPayment.value.open(item);
|
||||
if (item != 'all') {
|
||||
state.flowIdList = [item.id]
|
||||
} else {
|
||||
if( state.flowIdList.length <= 0 ){
|
||||
ElMessage({ type: "error", message: "请选择付款耗材" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
refPayment.value.open({ flowIdList: state.flowIdList, supplierName: state.supplierName,allAmount:state.allAmount });
|
||||
}
|
||||
function handleSelectionChange(e) {
|
||||
state.flowIdList = []
|
||||
state.allAmount = 0
|
||||
e.map(item => {
|
||||
state.flowIdList.push(item.id)
|
||||
state.allAmount += item.unPaidAmount
|
||||
})
|
||||
}
|
||||
// 付款记录
|
||||
function handleRecord(id) {
|
||||
router.push({ name: "financePaymentRecord", query: { id: id } });
|
||||
router.push({ name: "financePaymentRecord", query: { id: id, supplierName: state.supplierName } });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user