You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

476 lines
13 KiB

3 years ago
<!--我的报销,报销列表,其他支出-->
3 years ago
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content"></div>
<slot>
3 years ago
<div class="select-bar">
<div>
<span style="padding: 0 6px">创建日期</span>
<span>
3 years ago
<DatePicker
:value="select.year"
placeholder="选择开始日期"
placement="bottom"
style="width: 114px"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
<DatePicker
:value="select.year"
placeholder="选择结束日期"
placement="bottom"
style="width: 114px; margin-left: 6px"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
</span>
3 years ago
</div>
3 years ago
<!-- <div>-->
<!-- <span style="padding: 0 6px"> 项目类型 </span>-->
<!-- <span>-->
<!-- <Select-->
<!-- v-model="select.type"-->
<!-- clearable-->
<!-- placeholder="选择项目类型"-->
<!-- style="width: 130px"-->
<!-- >-->
<!-- <Option v-for="item in types" :key="item.id" :value="item.id">{{-->
<!-- item.value }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </span>-->
<!-- </div>-->
3 years ago
<div>
3 years ago
<span style="padding: 0 6px"> 科室 </span>
3 years ago
<span>
<Select
3 years ago
placeholder="科室选择"
clearable
v-model="select.department"
style="width: 130px"
3 years ago
>
3 years ago
<Option
v-for="item in departments"
:key="item.id"
:value="item.id"
>{{ item.name }}</Option
>
</Select>
3 years ago
</span>
</div>
3 years ago
<div v-if="this.$route.path.split('_')[1] == 2">
<span style="padding: 0 6px"> 报销类型 </span>
3 years ago
<span>
3 years ago
<Select
v-model="select.type"
clearable
placeholder="选择报销类型"
style="width: 130px"
>
<Option
v-for="item in [
{
value: '医药报销支出',
id: 1,
},
{
value: '出差报销支出',
id: 2,
},
]"
:key="item.id"
:value="item.id"
>{{ item.value }}</Option
>
</Select>
</span>
3 years ago
</div>
3 years ago
3 years ago
<div v-if="$route.path.split('_')[1] == 3">
<span style="padding: 0 6px"> 其他支出类型 </span>
3 years ago
<span>
3 years ago
<Select
v-model="select.type"
clearable
placeholder="选择其他支出类型"
style="width: 130px"
>
<Option
v-for="item in otherType"
:key="item.id"
:value="item.id"
3 years ago
>{{ item.value }}</Option
3 years ago
>
</Select>
</span>
3 years ago
</div>
3 years ago
3 years ago
<div>
3 years ago
<span style="padding: 0 6px">
{{ $route.path.split("_")[1] == 2 ? "报销金额" : "其他支出金额" }}
</span>
3 years ago
<span>
3 years ago
<InputNumber
style="width: 110px"
placeholder="最低价"
v-model="select.start_plan_price"
:formatter="
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
"
:parser="(value) => value.replace(/\s?|(,*)/g, '')"
></InputNumber>
<InputNumber
style="width: 110px; margin-left: 6px"
placeholder="最高价"
v-model="select.end_plan_price"
:formatter="
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
"
:parser="(value) => value.replace(/\s?|(,*)/g, '')"
></InputNumber>
</span>
3 years ago
</div>
<div>
<span style="padding: 0 6px"> 状态 </span>
<span>
3 years ago
<Select
v-model="select.type"
clearable
placeholder="选择状态"
style="width: 110px"
>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
3 years ago
item.value
}}</Option>
3 years ago
</Select>
</span>
3 years ago
</div>
3 years ago
<Button
style="margin-left: 10px"
type="primary"
@click="
3 years ago
($refs['addExpenseAccount'].type = 'add'),
$refs['addExpenseAccount'].show()
3 years ago
"
3 years ago
>新增</Button
>
<Button style="margin-left: 10px" type="primary" @click="getList"
>查询</Button
>
<Button style="margin-left: 10px" type="primary" @click="init"
>重置
3 years ago
</Button>
</div>
</slot>
</lx-header>
3 years ago
<xy-table
row-key="id"
:list="list"
:table-item="table"
@delete="(row) => destroy(row.id)"
@editor="
(row) => {
$refs['addExpenseAccount'].setType('editor');
$refs['addExpenseAccount'].setId(row.id);
$refs['addExpenseAccount'].show();
}
"
3 years ago
>
<template #btns>
<el-table-column label="操作" width="220" fixed="right">
<template #default="scope">
<Button
class="slot-btns-item"
size="small"
type="primary"
@click="
$refs['paymentRegistration'].getContract(scope.row),
($refs[
'paymentRegistration'
].isShowPaymentRegistration = true)
"
>
付款登记
</Button>
<template v-if="!scope.row.status === 2">
<Poptip
:transfer="true"
confirm
placement="bottom"
title="确认要删除吗"
@on-ok="() => destroy(scope.row.id)"
>
<i-button style="margin-left: 4px" ghost size="small" type="error"
>删除
</i-button>
</Poptip>
</template>
<Button
style="margin-left: 4px"
size="small"
type="primary"
@click="
$refs['detailContract'].getDetail(scope.row.id),
($refs['detailContract'].isShowDetail = true)
"
>
查看
</Button>
<template v-if="scope.row.status != 2">
<Button
style="margin-left: 4px"
size="small"
type="primary"
@click="
() => {
$refs['addExpenseAccount'].setType('editor');
$refs['addExpenseAccount'].setId(scope.row.id);
$refs['addExpenseAccount'].show();
}
"
>编辑
</Button>
</template>
</template>
</el-table-column>
</template>
</xy-table>
3 years ago
3 years ago
<div style="display: flex; justify-content: flex-end; padding: 10px 0">
<Page
:total="total"
@on-change="
(e) => {
select.page = e;
getList();
}
"
show-elevator
show-sizer
@on-page-size-change="
(e) => {
select.page_size = e;
select.page = 1;
getList();
}
"
/>
3 years ago
</div>
3 years ago
3 years ago
<addExpenseAccount
:other_types="otherType"
:departments="departments"
ref="addExpenseAccount"
@refresh="getList"
></addExpenseAccount>
3 years ago
<detailContract ref="detailContract"></detailContract>
<paymentRegistration ref="paymentRegistration" @refresh="getList"></paymentRegistration>
3 years ago
</div>
</template>
<script>
3 years ago
import { getContract, delContract } from "@/api/contract/contract";
import { getparameter } from "@/api/system/dictionary";
import { listdeptNoAuth } from "@/api/system/department";
3 years ago
3 years ago
import addExpenseAccount from "@/views/inOut/component/addExpenseAccount.vue";
3 years ago
import detailContract from '@/views/contract/components/detailContract.vue';
import paymentRegistration from '@/views/contract/components/paymentRegistration.vue'
3 years ago
export default {
3 years ago
components: {
3 years ago
addExpenseAccount,detailContract,paymentRegistration
3 years ago
},
3 years ago
data() {
return {
3 years ago
otherType: [],
3 years ago
total: 0,
select: {
3 years ago
page: 1,
3 years ago
page_size: 10,
start_created_at: "",
3 years ago
end_created_at: undefined,
3 years ago
start_plan_price: "",
end_plan_price: "",
3 years ago
department_id: "",
report_type: "",
other_type: "",
is_myself: "",
outcome_type: "",
3 years ago
},
types: [],
departments: [],
3 years ago
list: [],
3 years ago
table: [
{
3 years ago
prop: "name",
label: "项目名称",
3 years ago
width: 190,
3 years ago
fixed: "left",
3 years ago
},
{
3 years ago
label: this.$route.path.split("_")[1] == 2 ? "报销类型" : "支出类型",
3 years ago
width: 160,
3 years ago
customFn: (row) => {
3 years ago
let map = new Map([
3 years ago
[1, "医药报销支出"],
[2, "出差报销支出"],
]);
return this.$route.path.split("_")[1] == 2 ? (
<span>{map.get(row.report_type)}</span>
3 years ago
) : (
3 years ago
<span>{row.other_type?.value}</span>
);
},
3 years ago
},
{
3 years ago
prop: "from",
label: "资金来源",
3 years ago
width: 160,
},
{
3 years ago
prop: "money",
3 years ago
label:
this.$route.path.split("_")[1] == 2
? "报销金额(元)"
: "支出金额(元)",
3 years ago
width: 140,
3 years ago
align: "right",
3 years ago
formatter: (cell, data, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
}
3 years ago
},
{
3 years ago
prop: "apply_money_total",
3 years ago
label:
this.$route.path.split("_")[1] == 2
? "实际报销金额(元)"
: "实际支出金额(元)",
3 years ago
width: 140,
3 years ago
align: "right",
3 years ago
formatter: (cell, data, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
}
3 years ago
},
{
3 years ago
prop: "fund_log_total",
3 years ago
label: "已付金额",
3 years ago
width: 140,
3 years ago
align: "right",
3 years ago
formatter: (cell, data, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
3 years ago
},
3 years ago
},
{
3 years ago
prop: "department.name",
label: "业务科室",
width: 140,
3 years ago
},
{
3 years ago
prop: "",
label: "状态",
width: 140,
3 years ago
},
{
3 years ago
prop: "admin.name",
label: "经办人",
width: 140,
3 years ago
},
{
3 years ago
prop: "created_at",
label: "创建日期",
width: 180,
},
],
};
3 years ago
},
methods: {
3 years ago
init() {
for (let key in this.select) {
if (this.select[key] instanceof Array) {
this.select[key] = [];
} else {
this.select[key] = "";
}
}
3 years ago
this.select.page = 1;
this.select.page_size = 10;
3 years ago
},
3 years ago
async getList() {
const res = await getContract(this.select);
this.list = res.list.data;
this.total = res.list.total;
3 years ago
},
3 years ago
async getDepartment() {
3 years ago
this.departments = await listdeptNoAuth();
3 years ago
},
3 years ago
3 years ago
async getOtherType() {
3 years ago
const res = await getparameter({
3 years ago
number: "other_type",
});
this.otherType = res.detail;
3 years ago
},
3 years ago
destroy(id) {
3 years ago
delContract({
3 years ago
id,
}).then((res) => {
this.getList();
});
},
3 years ago
},
computed: {
3 years ago
typeText() {
3 years ago
return function (type) {
if (type == 2) {
3 years ago
return "报销";
3 years ago
}
if (type == 3) {
3 years ago
return "其他支出";
3 years ago
}
3 years ago
};
},
3 years ago
},
created() {
3 years ago
this.select.outcome_type = this.$route.path.split("_")[1];
this.select.is_myself = this.$route.path.split("_")[2];
this.getDepartment();
this.getOtherType();
this.getList();
3 years ago
},
3 years ago
};
3 years ago
</script>
<style scoped lang="scss">
3 years ago
.select-bar {
display: flex;
flex-wrap: wrap;
align-items: center;
& > div {
margin: 4px;
}
}
3 years ago
</style>