界面调整
This commit is contained in:
parent
cc340095db
commit
13303b884b
|
@ -121,8 +121,48 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-table-column align="center" label="操作" width="220px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="
|
||||
scope.row.state == '待上报' &&
|
||||
checkPermission(['record_update'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'update', record:scope.row})"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
(scope.row.state == '待上报' || scope.row.state == '待整改')&&
|
||||
checkPermission(['record_up'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'up', record:scope.row})"
|
||||
>上报</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
scope.row.state == '已上报' &&
|
||||
checkPermission(['record_confirm'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'confirm', record:scope.row})"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
scope.row.state == '已上报' &&
|
||||
checkPermission(['record_reject'])
|
||||
"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleRecord({action:'reject', record:scope.row})"
|
||||
>驳回</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="checkPermission(['record_view'])"
|
||||
size="small"
|
||||
|
@ -130,7 +170,7 @@
|
|||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="recordList.count > 0"
|
||||
|
|
|
@ -33,16 +33,22 @@
|
|||
<div style="margin-bottom: 6px">
|
||||
<span class="term">任务状态</span>
|
||||
<span class="desc">
|
||||
<el-tag v-if="task.state=='创建中'" type="warning">{{task.state}}</el-tag>
|
||||
<el-tag v-else-if="task.state=='执行中'" type="primary">{{task.state}}</el-tag>
|
||||
<el-tag v-else type="success">{{task.state}}</el-tag>
|
||||
<el-tag v-if="task.state == '创建中'" type="warning">{{
|
||||
task.state
|
||||
}}</el-tag>
|
||||
<el-tag v-else-if="task.state == '执行中'" type="primary">{{
|
||||
task.state
|
||||
}}</el-tag>
|
||||
<el-tag v-else type="success">{{ task.state }}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div style="margin-bottom: 6px">
|
||||
<span class="term">上报/确认率</span>
|
||||
<span class="desc"> {{ task.up_rate }}% -- {{task.confirm_rate}}%</span>
|
||||
<span class="desc">
|
||||
{{ task.up_rate }}% -- {{ task.confirm_rate }}%</span
|
||||
>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -81,7 +87,9 @@
|
|||
v-bind:key="item.id"
|
||||
@click="chosecontent(item)"
|
||||
>
|
||||
<el-link type="primary">{{index+1}}-{{ item.name }}</el-link>
|
||||
<el-link type="primary"
|
||||
>{{ index + 1 }}-{{ item.name }}</el-link
|
||||
>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
@ -90,10 +98,10 @@
|
|||
shadow="never"
|
||||
style="height: 600px; overflow-y: auto; overflow-x: auto"
|
||||
>
|
||||
<div style="margin-bottom:6px">
|
||||
当前选择
|
||||
<span style="color:red">{{nowcontent.name}}</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 6px">
|
||||
当前选择
|
||||
<span style="color: red">{{ nowcontent.name }}</span>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="recordList1"
|
||||
|
@ -110,20 +118,67 @@
|
|||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope"><el-tag type="danger" v-if="scope.row.state == '待上报'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag type="warning" v-else-if="scope.row.state == '待整改'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag v-else-if="scope.row.state == '已上报'">{{ scope.row.state }}</el-tag></template>
|
||||
<template slot-scope="scope"
|
||||
><el-tag
|
||||
type="danger"
|
||||
v-if="scope.row.state == '待上报'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="warning"
|
||||
v-else-if="scope.row.state == '待整改'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="success"
|
||||
v-else-if="scope.row.state == '已确认'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.state == '已上报'">{{
|
||||
scope.row.state
|
||||
}}</el-tag></template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="上报情况">
|
||||
<template slot-scope="scope"
|
||||
v-if="scope.row.up_user_">{{ scope.row.up_user_.name }}/{{ scope.row.up_date }}</template
|
||||
<template slot-scope="scope" v-if="scope.row.up_user_"
|
||||
>{{ scope.row.up_user_.name }}/{{
|
||||
scope.row.up_date
|
||||
}}</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件">
|
||||
<template slot-scope="scope"> </template>
|
||||
<template slot-scope="scope" v-if="scope.row.files">
|
||||
<el-link
|
||||
v-if="scope.row.files.length > 1"
|
||||
@click="
|
||||
handleRecord({ action: 'view', record: scope.row })
|
||||
"
|
||||
>有
|
||||
<span style="color: red">{{
|
||||
scope.row.files.length
|
||||
}}</span>
|
||||
个文件</el-link
|
||||
>
|
||||
<div
|
||||
v-else
|
||||
v-for="item in scope.row.files_"
|
||||
v-bind:key="item.id"
|
||||
>
|
||||
<el-link
|
||||
:href="item.path"
|
||||
target="_blank"
|
||||
type="primary"
|
||||
>{{ item.name }}</el-link
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="220px" fixed="right">
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="
|
||||
|
@ -132,17 +187,22 @@
|
|||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'update', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'update', record: scope.row })
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
(scope.row.state == '待上报' || scope.row.state == '待整改')&&
|
||||
(scope.row.state == '待上报' ||
|
||||
scope.row.state == '待整改') &&
|
||||
checkPermission(['record_up'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'up', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'up', record: scope.row })
|
||||
"
|
||||
>上报</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -152,7 +212,9 @@
|
|||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'confirm', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'confirm', record: scope.row })
|
||||
"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -162,13 +224,17 @@
|
|||
"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleRecord({action:'reject', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'reject', record: scope.row })
|
||||
"
|
||||
>驳回</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="checkPermission(['record_view'])"
|
||||
size="small"
|
||||
@click="handleRecord({action:'view', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'view', record: scope.row })
|
||||
"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
|
@ -190,7 +256,9 @@
|
|||
v-bind:key="item.id"
|
||||
@click="chosedept(item)"
|
||||
>
|
||||
<el-link type="primary">{{index+1}}-{{ item.name }}</el-link>
|
||||
<el-link type="primary"
|
||||
>{{ index + 1 }}-{{ item.name }}</el-link
|
||||
>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
@ -199,10 +267,10 @@
|
|||
shadow="never"
|
||||
style="height: 600px; overflow-y: auto; overflow-x: auto"
|
||||
>
|
||||
<div style="margin-bottom:6px">
|
||||
当前选择
|
||||
<span style="color:red">{{nowdept.name}}</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 6px">
|
||||
当前选择
|
||||
<span style="color: red">{{ nowdept.name }}</span>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="recordList2"
|
||||
|
@ -220,23 +288,40 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="danger" v-if="scope.row.state == '待上报'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag type="warning" v-else-if="scope.row.state == '待整改'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag v-else-if="scope.row.state == '已上报'">{{ scope.row.state }}</el-tag>
|
||||
<el-tag
|
||||
type="danger"
|
||||
v-if="scope.row.state == '待上报'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="warning"
|
||||
v-else-if="scope.row.state == '待整改'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="success"
|
||||
v-else-if="scope.row.state == '已确认'"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.state == '已上报'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上报情况">
|
||||
<template slot-scope="scope"
|
||||
v-if="scope.row.up_user_">{{ scope.row.up_user }}/{{ scope.row.up_date }}</template
|
||||
<template slot-scope="scope" v-if="scope.row.up_user_"
|
||||
>{{ scope.row.up_user }}/{{ scope.row.up_date }}</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件">
|
||||
<template slot-scope="scope">
|
||||
|
||||
</template>
|
||||
<template slot-scope="scope"> </template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="220px" fixed="right">
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="220px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="
|
||||
|
@ -245,18 +330,22 @@
|
|||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'update', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'update', record: scope.row })
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="
|
||||
(scope.row.state == '待上报' || scope.row.state == '待整改')
|
||||
&&
|
||||
(scope.row.state == '待上报' ||
|
||||
scope.row.state == '待整改') &&
|
||||
checkPermission(['record_up'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'up', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'up', record: scope.row })
|
||||
"
|
||||
>上报</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -266,7 +355,9 @@
|
|||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleRecord({action:'confirm', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'confirm', record: scope.row })
|
||||
"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -276,13 +367,17 @@
|
|||
"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleRecord({action:'reject', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'reject', record: scope.row })
|
||||
"
|
||||
>驳回</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="checkPermission(['record_view'])"
|
||||
size="small"
|
||||
@click="handleRecord({action:'view', record:scope.row})"
|
||||
@click="
|
||||
handleRecord({ action: 'view', record: scope.row })
|
||||
"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
|
@ -302,7 +397,12 @@
|
|||
>
|
||||
<taskinit ref="taskinit" @handleChose="chooseComplete"></taskinit>
|
||||
</el-dialog>
|
||||
<el-drawer title="记录" :visible.sync="drawer" :with-header="false" size="40%">
|
||||
<el-drawer
|
||||
title="记录"
|
||||
:visible.sync="drawer"
|
||||
:with-header="false"
|
||||
size="40%"
|
||||
>
|
||||
<recorddo
|
||||
ref="recorddo"
|
||||
:data="data"
|
||||
|
@ -349,8 +449,8 @@ export default {
|
|||
listLoading: false,
|
||||
recordList1: [],
|
||||
recordList2: [],
|
||||
nowcontent:{},
|
||||
nowdept:{},
|
||||
nowcontent: {},
|
||||
nowdept: {},
|
||||
drawer: false,
|
||||
data: {},
|
||||
};
|
||||
|
@ -387,7 +487,10 @@ export default {
|
|||
gettaskcontents(this.task.id).then((res) => {
|
||||
this.contents = res.data;
|
||||
this.listLoading = true;
|
||||
this.nowcontent = {id:this.contents[0].id, name:this.contents[0].name}
|
||||
this.nowcontent = {
|
||||
id: this.contents[0].id,
|
||||
name: this.contents[0].name,
|
||||
};
|
||||
getRecordList({
|
||||
pageoff: true,
|
||||
content: this.contents[0].id,
|
||||
|
@ -404,11 +507,11 @@ export default {
|
|||
});
|
||||
},
|
||||
chosecontent(item) {
|
||||
this.nowcontent = item
|
||||
this.nowcontent = item;
|
||||
var data = {
|
||||
pageoff: true,
|
||||
task: this.task.id,
|
||||
content:item.id
|
||||
content: item.id,
|
||||
};
|
||||
this.listLoading = true;
|
||||
getRecordList(data).then((res) => {
|
||||
|
@ -417,11 +520,11 @@ export default {
|
|||
});
|
||||
},
|
||||
chosedept(item) {
|
||||
this.nowdept = item
|
||||
this.nowdept = item;
|
||||
var data = {
|
||||
pageoff: true,
|
||||
task: this.task.id,
|
||||
belong_dept:item.id
|
||||
belong_dept: item.id,
|
||||
};
|
||||
this.listLoading = true;
|
||||
getRecordList(data).then((res) => {
|
||||
|
@ -429,17 +532,17 @@ export default {
|
|||
this.recordList2 = res.data;
|
||||
});
|
||||
},
|
||||
handleRecord(data){
|
||||
handleRecord(data) {
|
||||
this.data = data;
|
||||
this.drawer = true;
|
||||
},
|
||||
handleDo(data) {
|
||||
this.drawer = false;
|
||||
this.gettask()
|
||||
if(this.activeName == 'contenttab'){
|
||||
this.chosecontent(this.nowcontent)
|
||||
}else if(this.activeName == 'depttab'){
|
||||
this.chosedept(this.nowdept)
|
||||
this.gettask();
|
||||
if (this.activeName == "contenttab") {
|
||||
this.chosecontent(this.nowcontent);
|
||||
} else if (this.activeName == "depttab") {
|
||||
this.chosedept(this.nowdept);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -154,11 +154,10 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView
|
|||
obj = self.get_object()
|
||||
if obj.state in ['待整改','待上报']:
|
||||
if 'files' in request.data and len(request.data['files'])==0:
|
||||
if request.data.get('noteb', None):
|
||||
if request.data.get('is_yes', True):
|
||||
return Response('请选择不适用', status=status.HTTP_400_BAD_REQUEST)
|
||||
if request.data.get('noteb', None) and request.data.get('is_yes', True):
|
||||
pass
|
||||
else:
|
||||
return Response('请上传文件或填写备注', status=status.HTTP_400_BAD_REQUEST)
|
||||
return Response('请上传文件或选择不适用并填写上报说明', status=status.HTTP_400_BAD_REQUEST)
|
||||
obj.is_yes = request.data.get('is_yes')
|
||||
obj.files.clear()
|
||||
obj.files.add(*request.data['files'])
|
||||
|
|
Loading…
Reference in New Issue