cailiaobaosong
This commit is contained in:
parent
8d8d6f472d
commit
a175dcb1fc
|
|
@ -34,7 +34,13 @@ export function updateRecord(id, data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function createself(data) {
|
||||||
|
return request({
|
||||||
|
url: `/supervision/record/createself/`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
export function upRecord(id, data) {
|
export function upRecord(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/supervision/record/${id}/up/`,
|
url: `/supervision/record/${id}/up/`,
|
||||||
|
|
|
||||||
|
|
@ -76,15 +76,15 @@
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
|
|
||||||
<el-table-column label="任务标题">
|
<el-table-column label="任务标题">
|
||||||
<template slot-scope="scope">{{ scope.row.task_.name }}</template>
|
<template slot-scope="scope" v-if="scope.row.task">{{ scope.row.task_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="材料名称">
|
<el-table-column label="材料名称">
|
||||||
<template slot-scope="scope">{{ scope.row.content_.name }}</template>
|
<template slot-scope="scope" >{{ scope.row.content_.name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column sortable label="上报时间">
|
<el-table-column sortable label="上报时间">
|
||||||
<template slot-scope="scope">{{ scope.row.up_date }}</template>
|
<template slot-scope="scope" >{{ scope.row.up_date }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="上报人">
|
<el-table-column label="上报人" >
|
||||||
<template slot-scope="scope">{{ scope.row.up_user }}</template>
|
<template slot-scope="scope">{{ scope.row.up_user }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column sortable label="截止时间">
|
<el-table-column sortable label="截止时间">
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="上报单位">
|
<el-table-column label="上报单位">
|
||||||
<template slot-scope="scope">{{ scope.row.belong_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>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,29 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<el-card
|
||||||
|
style="margin-top: 10px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-button type="primary" @click="centerDialogVisible = true" plain>主动上报</el-button>
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="centerDialogVisible"
|
||||||
|
width="50%"
|
||||||
|
center>
|
||||||
|
<el-transfer
|
||||||
|
v-model="contents"
|
||||||
|
:data="contentOptions"
|
||||||
|
:titles="['材料清单', '选择的清单']"
|
||||||
|
:props="{ key : 'id' , label: 'name' }"
|
||||||
|
/>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="contentup()">确认</el-button>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
<el-card
|
<el-card
|
||||||
style="margin-top: 10px"
|
style="margin-top: 10px"
|
||||||
>
|
>
|
||||||
|
|
@ -20,8 +42,9 @@
|
||||||
|
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
|
|
@ -34,7 +57,7 @@
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" type="index" align="center" />
|
<el-table-column label="序号" type="index" align="center" />
|
||||||
<el-table-column label="任务标题">
|
<el-table-column label="任务标题">
|
||||||
<template slot-scope="scope">{{
|
<template slot-scope="scope" v-if="scope.row.task">{{
|
||||||
scope.row.task_.name
|
scope.row.task_.name
|
||||||
}}</template>
|
}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -113,7 +136,9 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getRecordList } from "@/api/record";
|
import { getRecordList,createself } from "@/api/record";
|
||||||
|
|
||||||
|
import { getContentList } from "@/api/content";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
import taskinit from "@/views/supervision/taskinit";
|
import taskinit from "@/views/supervision/taskinit";
|
||||||
import checkPermission from "@/utils/permission";
|
import checkPermission from "@/utils/permission";
|
||||||
|
|
@ -122,9 +147,13 @@ export default {
|
||||||
components: { Pagination, taskinit, recorddo },
|
components: { Pagination, taskinit, recorddo },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
centerDialogVisible: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
activeName: "first",
|
activeName: "first",
|
||||||
state:"待上报",
|
state:"待上报",
|
||||||
|
can_doself:true,
|
||||||
|
contents: [],
|
||||||
|
contentOptions: [],
|
||||||
contents: [],
|
contents: [],
|
||||||
depts: [],
|
depts: [],
|
||||||
listLoading: false,
|
listLoading: false,
|
||||||
|
|
@ -134,6 +163,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.getContentList();
|
||||||
this.getRecordList();
|
this.getRecordList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -145,6 +175,12 @@ export default {
|
||||||
this.recordList = res.data.results;
|
this.recordList = res.data.results;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getContentList() {
|
||||||
|
getContentList({can_doself:this.can_doself}).then(res=>{
|
||||||
|
this.contentOptions = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
switch (tab.name) {
|
switch (tab.name) {
|
||||||
case "first":
|
case "first":
|
||||||
|
|
@ -214,6 +250,19 @@ export default {
|
||||||
};
|
};
|
||||||
this.drawer = true;
|
this.drawer = true;
|
||||||
},
|
},
|
||||||
|
contentup(){
|
||||||
|
console.log(this.contents)
|
||||||
|
if(this.contents.length>0){
|
||||||
|
|
||||||
|
|
||||||
|
createself({contents:this.contents}
|
||||||
|
).then((res) => {
|
||||||
|
alert(1)
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.$message.error('请选择清单!')
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class ContentViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
serializer_class = ContentSerializer
|
serializer_class = ContentSerializer
|
||||||
pagination_class = None
|
pagination_class = None
|
||||||
search_fields = ['name', 'desc']
|
search_fields = ['name', 'desc']
|
||||||
filterset_fields = ['type']
|
filterset_fields = ['type','can_doself']
|
||||||
ordering = ['type__sort', 'create_time']
|
ordering = ['type__sort', 'create_time']
|
||||||
|
|
||||||
class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
||||||
|
|
@ -127,7 +127,7 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
|
||||||
instance.save()
|
instance.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
|
|
||||||
@action(methods=['post'], detail=True, perms_map = {'post':'record_up'})
|
@action(methods=['post'], detail=False, perms_map = {'post':'record_creates'})
|
||||||
def createself(self, request, *args, **kwargs):
|
def createself(self, request, *args, **kwargs):
|
||||||
contents = request.data['contents']
|
contents = request.data['contents']
|
||||||
rlist = []
|
rlist = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue