更新财务:余额明细

This commit is contained in:
weipengfei 2023-08-29 10:52:38 +08:00
parent ac9da403d7
commit ce81a9e4ca
2 changed files with 285 additions and 2 deletions

View File

@ -80,12 +80,21 @@
/> />
<el-table-column label="变动金额" prop="change_amount" min-width="100"> <el-table-column label="变动金额" prop="change_amount" min-width="100">
<template #default="{ row }"> <template #default="{ row }">
<span :class="{ 'text-error': row.action == 2 }"> <span
class="text-warning"
:class="{ 'text-error': row.action == 2 }"
>
{{ row.change_amount }} {{ row.change_amount }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="剩余金额" prop="left_amount" min-width="100" /> <el-table-column label="剩余金额" prop="left_amount" min-width="100">
<template #default="{ row }">
<span class="text-success">
{{ row.left_amount }}
</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="变动类型" label="变动类型"
prop="change_type_desc" prop="change_type_desc"
@ -105,12 +114,19 @@
import { getUmChangeType, accountLog } from "@/api/finance"; import { getUmChangeType, accountLog } from "@/api/finance";
import { useDictOptions } from "@/hooks/useDictOptions"; import { useDictOptions } from "@/hooks/useDictOptions";
import { usePaging } from "@/hooks/usePaging"; import { usePaging } from "@/hooks/usePaging";
import { useRoute } from "vue-router";
const route = useRoute();
console.log("company_id", route.query?.company_id);
const queryParams = reactive({ const queryParams = reactive({
user_info: "", user_info: "",
change_type: "", change_type: "",
start_time: "", start_time: "",
end_time: "", end_time: "",
company_id: "",
}); });
if (route.query?.company_id) queryParams.company_id = route.query?.company_id;
const { pager, getLists, resetPage, resetParams } = usePaging({ const { pager, getLists, resetPage, resetParams } = usePaging({
fetchFun: accountLog, fetchFun: accountLog,
@ -127,3 +143,5 @@ const { optionsData } = useDictOptions<{
getLists(); getLists();
</script> </script>

View File

@ -0,0 +1,265 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px] formdata" :model="queryParams" inline>
<el-form-item label="公司名称" prop="company_name">
<el-input
class="w-[280px]"
v-model="queryParams.company_name"
clearable
placeholder="请输入公司名称"
/>
</el-form-item>
<el-form-item label="区" prop="area" v-show="company_type_show">
<el-input
class="w-[280px]"
v-model="queryParams.area"
clearable
placeholder="请输入区"
/>
</el-form-item>
<el-form-item label="镇" prop="street" v-show="company_type_show">
<el-input
class="w-[280px]"
v-model="queryParams.street"
clearable
placeholder="请输入镇"
/>
</el-form-item>
<el-form-item
label="公司类型"
prop="company_type"
v-show="company_type_show"
>
<el-select
v-model="queryParams.company_type"
placeholder="请选择公司类型"
clearable
class="w-[280px]"
>
<el-option
v-for="(item, index) in datas.dictTypeLists"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="片区经理" prop="area_manager">
<el-input
class="w-[280px]"
v-model="queryParams.area_manager"
clearable
placeholder="请输入片区经理"
/>
</el-form-item>
<el-form-item label="是否签约" prop="is_contract">
<el-select
v-model="queryParams.is_contract"
placeholder="是否签约"
clearable
class="w-[240px]"
>
<el-option label="已签约" value="1"></el-option>
<el-option label="未签约" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column
label="ID"
prop="id"
show-overflow-tooltip
width="80"
/>
<el-table-column
label="公司名称"
prop="company_name"
width="300"
show-overflow-tooltip
/>
<el-table-column
label="公司类型"
prop="company_type"
show-overflow-tooltip
/>
<el-table-column
label="公司收益"
prop="deposit"
show-overflow-tooltip
>
<template #default="{ row }">
<span class="text-success">{{ row.deposit }}</span>
</template>
</el-table-column>
<el-table-column label="区县" prop="area" show-overflow-tooltip />
<el-table-column label="乡镇" prop="street" show-overflow-tooltip />
<el-table-column
label="主联系人"
prop="master_name"
show-overflow-tooltip
/>
<el-table-column
label="联系方式"
prop="master_phone"
show-overflow-tooltip
/>
<el-table-column
label="片区经理"
prop="area_manager"
show-overflow-tooltip
/>
<el-table-column
label="操作"
align="center"
width="150"
fixed="right"
>
<template #default="{ row }">
<div style="display: flex">
<el-button type="primary" link>
<router-link
:to="{
path: getRoutePath('finance.account_log/lists'),
query: {
company_id: row.id,
},
}"
>查看成员</router-link
>
</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="companyLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import useUserStore from "@/stores/modules/user";
import {
apiCompanyLists,
apiCompanyDelete,
authentication,
} from "@/api/company";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import { dictDataLists } from "@/api/setting/dict";
import { getRoutePath } from "@/router";
import { dictContractTypeList } from "@/utils/dict.ts";
const userStore = useUserStore();
console.log(userStore.userInfo.company_id);
const route = useRoute();
const company_type_show = ref(true);
//
//
const queryParams = reactive({
company_name: "",
area: "",
street: "",
company_type: "",
area_manager: "",
//
is_contract: "",
});
if (route.query.company_type) {
company_type_show.value = false;
queryParams["company_type"] = route.query.company_type?.toString() || "";
}
const datas = reactive({
dictTypeLists: [],
});
const getdictTypeLists = async () => {
const data = await dictDataLists({ type_id: 6 });
datas["dictTypeLists"] = data["lists"];
};
getdictTypeLists();
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData("");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCompanyLists,
params: queryParams,
});
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?");
await apiCompanyDelete({ id });
getLists();
};
const handleAuthentication = async (id: number | any[]) => {
await feedback.confirm("确定要认证?");
await authentication({ id });
getLists();
};
//
const auditing = () => {
ElMessage.warning("请等待合同审核完成!");
};
getLists();
</script>
<style lang="scss">
.btn {
position: absolute;
}
h1 {
text-align: center;
font-weight: bold;
font-size: 30px;
color: red;
margin-bottom: 10px;
}
.content {
font-size: 20px;
}
.info {
color: red;
font-weight: bold;
font-size: 18px;
display: inline-block;
margin: 0 5px;
}
.btn_menu {
margin-top: 10vh;
display: flex;
justify-content: space-around;
}
.formdata {
.el-form-item {
width: 20%;
}
}
</style>