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.

141 lines
3.8 KiB

2 years ago
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
:text="$route.meta.title"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content"></div>
<slot>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
></Input>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click=""
>重置</Button
>
2 years ago
<Button type="primary" style="margin-left: 10px" @click="getList"></Button>
2 years ago
<Button
2 years ago
v-if="role === 0"
2 years ago
type="primary"
style="margin-left: 10px"
@click="
$refs['addPropertyPlan'].setType('add'),
$refs['addPropertyPlan'].show()
"
>新增</Button
>
</slot>
</lx-header>
2 years ago
<xy-table :list="list" :table-item="table">
<template v-if="role !== 0" #btns> </template>
<template v-else #btns>
<el-table-column label="操作" header-align="center" align="left">
<template #default="{ row }">
<Button size="small" type="primary" @click="$refs['file'].setId(row.id),$refs['file'].show()">
</Button>
<Button size="small" type="primary" @click="$refs['remark'].setId(row.id),$refs['remark'].show()">
</Button>
<Button ghost size="small" type="primary" @click="$refs['addPropertyPlan'].setType('editor'),$refs['addPropertyPlan'].setId(row.id),$refs['addPropertyPlan'].show()">
</Button>
<Poptip transfer confirm placement="bottom" title="确认要删除吗"
@on-ok="destroy({ id: row.id }).then(_ => { $message({ type: 'success',message: '删除成功' });getList(); })">
<Button style="margin-left: 4px;" ghost size="small" type="error">删除
</Button>
</Poptip>
</template>
</el-table-column>
</template>
2 years ago
</xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<Page
:total="total"
show-elevator
@on-change="
(e) => {
select.page = e;
getList();
}
"
/>
</div>
2 years ago
<addPropertyPlan ref="addPropertyPlan" :role="role" @refresh="getList"></addPropertyPlan>
<remark ref="remark"></remark>
<file ref="file"></file>
2 years ago
</div>
</template>
<script>
import { index, destroy } from "@/api/propertyPlan";
import addPropertyPlan from "@/views/finance/components/addPropertyPlan.vue";
2 years ago
import remark from "./components/remark.vue";
import file from "./components/file.vue";
2 years ago
export default {
components: {
2 years ago
file,
remark,
2 years ago
addPropertyPlan,
},
data() {
return {
2 years ago
role: 0,//0业务1财务
2 years ago
select: {
page: 1,
page_size: 10,
},
list: [],
table: [
{
label: "项目名称",
width: 220,
align: "left",
2 years ago
prop: 'contract.name'
2 years ago
},
{
2 years ago
prop: "plan_date",
2 years ago
label: "计划评审时间",
width: 200,
},
{
2 years ago
prop: "actually_date",
2 years ago
label: "实际评审时间",
width: 200,
},
],
total: 0,
};
},
methods: {
2 years ago
destroy,
2 years ago
async getList() {
const res = await index(this.select);
this.total = res.total;
this.list = res.data;
},
},
computed: {},
2 years ago
created() {
this.getList();
},
2 years ago
beforeRouteEnter(to, from, next) {
next((vm) => {
2 years ago
vm.role = to.path.split("_")[1] ? Number(to.path.split("_")[1]) : '';
2 years ago
});
},
};
</script>
2 years ago
<style scoped lang="scss">
Button + Button {
margin-left: 4px;
}
</style>