初步完成
This commit is contained in:
parent
7d8d0bce18
commit
275d1c96e7
|
|
@ -113,12 +113,24 @@
|
|||
<el-table-column label="上报文件">
|
||||
|
||||
<template slot-scope="scope" v-if="scope.row.files">
|
||||
<el-link v-if="scope.row.files.length>1">有{{scope.row.files.length}}个文件</el-link>
|
||||
<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="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="checkPermission(['record_view'])"
|
||||
size="small"
|
||||
@click="handleRecord({action:'view', record:scope.row})"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="recordList.count > 0"
|
||||
|
|
@ -128,7 +140,14 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<el-drawer title="记录" :visible.sync="drawer" :with-header="false">
|
||||
<recorddo
|
||||
ref="recorddo"
|
||||
:data="data"
|
||||
@handleDo="handleDo"
|
||||
v-if="drawer"
|
||||
></recorddo>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -137,11 +156,12 @@ import {getRecordList} from "@/api/record";
|
|||
import { genTree } from "@/utils";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
import recorddo from "@/views/supervision/recorddo";
|
||||
const defaultrecord = {
|
||||
name: ""
|
||||
};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
components: { Pagination, recorddo },
|
||||
data() {
|
||||
return {
|
||||
record: defaultrecord,
|
||||
|
|
@ -150,6 +170,7 @@ export default {
|
|||
},
|
||||
|
||||
orgData: [],
|
||||
drawer:false,
|
||||
stateOptions: [
|
||||
{ key: "待上报", name: "待上报" },
|
||||
{ key: "已上报", name: "已上报" },
|
||||
|
|
@ -204,6 +225,7 @@ export default {
|
|||
this.getOrgList();
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
getList(){
|
||||
|
||||
getRecordList(this.listQuery).then((response)=>{
|
||||
|
|
@ -238,7 +260,10 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
|
||||
|
||||
handleRecord(data){
|
||||
this.data = data;
|
||||
this.drawer = true;
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,124 +1,142 @@
|
|||
<template>
|
||||
<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="primary" @click="contentup()">确认</el-button>
|
||||
<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="primary" @click="contentup()">确认</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="待上报" name="toup" lazy> </el-tab-pane>
|
||||
<el-tab-pane label="已上报" name="uped" lazy> </el-tab-pane>
|
||||
<el-tab-pane label="待整改" name="tozg" lazy> </el-tab-pane>
|
||||
<el-tab-pane label="已确认" name="confirmed" lazy> </el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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" v-if="scope.row.task">{{
|
||||
scope.row.task_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料">
|
||||
<template slot-scope="scope">{{ scope.row.content_.name }}</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>
|
||||
</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
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="上报文件">
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card
|
||||
style="margin-top: 10px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="待上报" name="toup" lazy>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已上报" name="uped" lazy>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="待整改" name="tozg" lazy>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已确认" name="confirmed" lazy>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<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" v-if="scope.row.task">{{
|
||||
scope.row.task_.name
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="材料">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.content_.name
|
||||
}}</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>
|
||||
</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
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<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="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.state == '待上报' && checkPermission(['record_update'])"
|
||||
v-if="
|
||||
scope.row.state == '待上报' &&
|
||||
checkPermission(['record_update'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleUpdate(scope)"
|
||||
@click="handleRecord({action:'update', record:scope.row})"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.state == '待上报' && checkPermission(['record_up'])"
|
||||
v-if="
|
||||
(scope.row.state == '待上报' || scope.row.state == '待整改')
|
||||
&&
|
||||
checkPermission(['record_up'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleUp(scope)"
|
||||
@click="handleRecord({action:'up', record:scope.row})"
|
||||
>上报</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.state == '已提交' && checkPermission(['record_confirm'])"
|
||||
v-if="
|
||||
scope.row.state == '已上报' &&
|
||||
checkPermission(['record_confirm'])
|
||||
"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleConfirm(scope)"
|
||||
@click="handleRecord({action:'confirm', record:scope.row})"
|
||||
>确认</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.state == '已提交' && checkPermission(['record_reject'])"
|
||||
v-if="
|
||||
scope.row.state == '已上报' &&
|
||||
checkPermission(['record_reject'])
|
||||
"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleReject(scope)"
|
||||
@click="handleRecord({action:'reject', record:scope.row})"
|
||||
>驳回</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="checkPermission(['record_view'])"
|
||||
size="small"
|
||||
@click="handleView(scope)"
|
||||
@click="handleRecord({action:'view', record:scope.row})"
|
||||
>查看</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-drawer title="记录" :visible.sync="drawer" :with-header="false">
|
||||
<recorddo
|
||||
|
|
@ -131,7 +149,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getRecordList,createself } from "@/api/record";
|
||||
import { getRecordList, createself } from "@/api/record";
|
||||
|
||||
import { getContentList } from "@/api/content";
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
|
@ -142,11 +160,11 @@ export default {
|
|||
components: { Pagination, taskinit, recorddo },
|
||||
data() {
|
||||
return {
|
||||
centerDialogVisible: false,
|
||||
centerDialogVisible: false,
|
||||
dialogVisible: false,
|
||||
activeName: "toup",
|
||||
state:"待上报",
|
||||
can_doself:true,
|
||||
state: "待上报",
|
||||
can_doself: true,
|
||||
contents: [],
|
||||
contentOptions: [],
|
||||
contents: [],
|
||||
|
|
@ -163,41 +181,40 @@ export default {
|
|||
this.getRecordList();
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
getTab(){
|
||||
if(this.$route.params.tab){
|
||||
this.activeName = this.$route.params.tab
|
||||
}
|
||||
},
|
||||
getRecordList(){
|
||||
|
||||
getRecordList({state:this.state}).then((res) => {
|
||||
checkPermission,
|
||||
getTab() {
|
||||
if (this.$route.params.tab) {
|
||||
this.activeName = this.$route.params.tab;
|
||||
}
|
||||
},
|
||||
getRecordList() {
|
||||
getRecordList({ state: this.state }).then((res) => {
|
||||
this.listLoading = false;
|
||||
this.recordList = res.data.results;
|
||||
});
|
||||
},
|
||||
getContentList() {
|
||||
getContentList({can_doself:this.can_doself}).then(res=>{
|
||||
this.contentOptions = res.data
|
||||
})
|
||||
getContentList() {
|
||||
getContentList({ can_doself: this.can_doself }).then((res) => {
|
||||
this.contentOptions = res.data;
|
||||
});
|
||||
},
|
||||
|
||||
handleClick(tab, event) {
|
||||
handleClick(tab, event) {
|
||||
switch (tab.name) {
|
||||
case "toup":
|
||||
this.state="待上报";
|
||||
this.state = "待上报";
|
||||
this.getRecordList();
|
||||
break;
|
||||
case "uped":
|
||||
this.state="已上报";
|
||||
this.state = "已上报";
|
||||
this.getRecordList();
|
||||
break;
|
||||
case "tozg":
|
||||
this.state="待整改";
|
||||
this.state = "待整改";
|
||||
this.getRecordList();
|
||||
break;
|
||||
case "confirmed":
|
||||
this.state="已确认";
|
||||
this.state = "已确认";
|
||||
this.getRecordList();
|
||||
break;
|
||||
}
|
||||
|
|
@ -210,7 +227,7 @@ export default {
|
|||
};
|
||||
this.drawer = true;
|
||||
},
|
||||
chooseComplete(data) {
|
||||
chooseComplete(data) {
|
||||
this.dialogVisible = false;
|
||||
const rLoading = this.openLoading("正在初始化任务,请稍等...");
|
||||
inittask(this.task.id, data).then((res) => {
|
||||
|
|
@ -230,38 +247,18 @@ export default {
|
|||
this.drawer = false;
|
||||
this.getRecordList();
|
||||
},
|
||||
handleView(scope) {
|
||||
this.data = {
|
||||
action: "view",
|
||||
record: scope.row,
|
||||
};
|
||||
handleRecord(data){
|
||||
this.data = data;
|
||||
this.drawer = true;
|
||||
},
|
||||
handleReject(scope) {
|
||||
this.data = {
|
||||
action: "reject",
|
||||
record: scope.row,
|
||||
};
|
||||
this.drawer = true;
|
||||
},
|
||||
handleConfirm(scope) {
|
||||
this.data = {
|
||||
action: "reject",
|
||||
record: scope.row,
|
||||
};
|
||||
this.drawer = true;
|
||||
},
|
||||
contentup(){
|
||||
console.log(this.contents)
|
||||
if(this.contents.length>0){
|
||||
|
||||
createself({contents:this.contents}
|
||||
).then((res) => {
|
||||
this.centerDialogVisible = false
|
||||
contentup() {
|
||||
if (this.contents.length > 0) {
|
||||
createself({ contents: this.contents }).then((res) => {
|
||||
this.centerDialogVisible = false;
|
||||
});
|
||||
}else{
|
||||
this.$message.error('请选择清单!')
|
||||
}
|
||||
} else {
|
||||
this.$message.error("请选择清单!");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue