cailiaobaosong

This commit is contained in:
shilixia 2021-03-17 09:25:16 +08:00
parent ec2499a147
commit 507a09de1c
3 changed files with 111 additions and 45 deletions

View File

@ -100,7 +100,7 @@
</el-table-column> </el-table-column>
<el-table-column label="上报单位"> <el-table-column label="上报单位">
<template slot-scope="scope">{{ scope.row.dept_.name }}</template> <template slot-scope="scope">{{ scope.row.belong_dept_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="记录状态"> <el-table-column label="记录状态">
<template slot-scope="scope">{{ scope.row.state }}</template> <template slot-scope="scope">{{ scope.row.state }}</template>

View File

@ -2,46 +2,79 @@
<div class="app-container"> <div class="app-container">
<div>
<el-input
placeholder="材料名称"
style="width: 200px"
class="filter-item"
/>
<el-input
placeholder="上报时间"
style="width: 200px"
class="filter-item"
/>
<el-input
placeholder="记录状态"
style="width: 200px"
class="filter-item"
/>
<el-input
placeholder="所属部门"
style="width: 200px"
class="filter-item"
/>
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
>搜索</el-button
>
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-refresh-left"
>刷新重置</el-button
>
</div>
<el-card <el-card
style="margin-top: 10px" style="margin-top: 10px"
> >
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName">
<el-tab-pane label="待上报" name="first" lazy> <el-tab-pane label="待上报" name="first" lazy>
<el-table
v-loading="listLoading"
:data="recordList"
border
fit
stripe
highlight-current-row
max-height="600px"
>
<el-table-column label="序号" type="index" align="center" />
<el-table-column label="单位">
<template slot-scope="scope">{{
scope.row.belong_dept_.name
}}</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">{{
scope.row.state
}}</template>
</el-table-column>
<el-table-column label="上报情况">
<template slot-scope="scope"
>{{ scope.row.up_user }}/{{ scope.row.up_date }}</template
>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
v-if="scope.row.state == '待上报'"
type="primary"
:disabled="!checkPermission(['record_update'])"
size="small"
@click="handleUpdate(scope)"
>编辑</el-button
>
<el-button
v-if="scope.row.state == '已提交'"
type="primary"
:disabled="!checkPermission(['record_confirm'])"
size="small"
@click="handleConfirm(scope)"
>确认</el-button
>
<el-button
v-if="scope.state == '已提交'"
:disabled="!checkPermission(['record_reject'])"
type="danger"
size="small"
@click="handleReject(scope)"
>驳回</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
:visible.sync="dialogVisible"
title="初始化任务"
:close-on-click-modal="false"
>
<taskinit ref="taskinit" @handleChose="chooseComplete"></taskinit>
</el-dialog>
<el-drawer title="记录" :visible.sync="drawer" :with-header="false">
<recorddo ref="recorddo" :data="data" @handleDo="handleDo" v-if="drawer"></recorddo>
</el-drawer>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已上报" name="three" lazy> <el-tab-pane label="已上报" name="three" lazy>
</el-tab-pane> </el-tab-pane>
@ -55,21 +88,54 @@
</el-tabs> </el-tabs>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import Recorddo from "@/views/supervision/recorddo"
import { getRecordList } from "@/api/record";
import Pagination from "@/components/Pagination";
import taskinit from "@/views/supervision/taskinit";
import checkPermission from "@/utils/permission";
import recorddo from "@/views/supervision/recorddo";
export default { export default {
components: { Recorddo }, components: { Pagination, taskinit, recorddo },
data() { data() {
return { return {
dialogVisible: false,
activeName: "first",
contents: [],
depts: [],
listLoading: false,
recordList: [],
now: {},
drawer: false,
}; };
}, },
computed: {}, created() {
this.getRecordList();
},
methods: { methods: {
checkPermission,
getRecordList(){
getRecordList().then((res) => {
this.listLoading = false;
this.recordList = res.data.results;
});
},
handleUpdate(scope) {
this.data = {
action: "update",
record: scope.row,
};
this.drawer = true;
},
handleDo(data){
this.drawer = false
this.getRecordList()
}
}, },
}; };
</script> </script>

View File

@ -6,8 +6,8 @@ class RecordFilter(filters.FilterSet):
date_lt = filters.DateFilter(field_name='up_date',lookup_expr="lt") date_lt = filters.DateFilter(field_name='up_date',lookup_expr="lt")
date_gt = filters.DateFilter(field_name='up_date',lookup_expr="gt") date_gt = filters.DateFilter(field_name='up_date',lookup_expr="gt")
belong_dept=filters.NumberFilter(field_name='belong_dept') belong_dept=filters.NumberFilter(field_name='belong_dept')
content_name = filters.CharFilter(field_name='content',lookup_expr='icontains') content_name = filters.CharFilter(field_name='content__name')
state = filters.CharFilter(field_name='state',lookup_expr='icontains') state = filters.CharFilter(field_name='state',lookup_expr='icontains')
class Meta: class Meta:
model = Record model = Record
fields = ['up_date','content','belong_dept','state', 'task'] fields = ['up_date','content__name','belong_dept','state', 'task']