master
lion 3 months ago
parent 3d11e4fd3e
commit ee9cca6780

@ -15,6 +15,16 @@
</div> </div>
</div> </div>
</template> --> </template> -->
<template v-slot:title>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>检查名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.title" type="text" placeholder="请输入检查名称" style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:date> <template v-slot:date>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;"> <div class="xy-table-item-label" style="font-weight: bold;">
@ -211,7 +221,7 @@
sitePlaceholder:'请选择站点', sitePlaceholder:'请选择站点',
mapClickIndex:0, mapClickIndex:0,
form: { form: {
title: '',
date: '', date: '',
siteName: '', siteName: '',
@ -239,6 +249,10 @@ mission_id: '',
// required: true, // required: true,
// message: '' // message: ''
// }], // }],
title: [{
required: true,
message: '请输入检查名称'
}],
date: [{ date: [{
required: true, required: true,
message: '请选择发现时间' message: '请选择发现时间'
@ -441,6 +455,7 @@ mission_id: '',
const res = await get(this.id) const res = await get(this.id)
this.form = { this.form = {
title: res?.title,
date: res?.date, date: res?.date,
site_id: res?.site_id, site_id: res?.site_id,
siteName: res.site_id?[undefined,res.site_id]:res.address, siteName: res.site_id?[undefined,res.site_id]:res.address,

File diff suppressed because it is too large Load Diff

@ -6,6 +6,12 @@
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy' <DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
type="year" @on-change="changeYear"></DatePicker> type="year" @on-change="changeYear"></DatePicker>
<el-date-picker @change="changeDate" v-model="select.dateRange" type="daterange"
value-format="yyyy-MM-dd" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期"
style="width: 280px;margin-right: 10px;height:32px">
</el-date-picker>
<Input v-model="select.title" clearable style="width: 150px;margin-right: 10px;" placeholder="检查名称" />
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.status" placeholder="检查状态"> <Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.status" placeholder="检查状态">
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option> <Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
</Select> </Select>
@ -70,25 +76,26 @@
<template v-slot:btns> <template v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center"> <el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="(is_guiji||is_chuzhang||scope.row.is_myself)&&!(scope.row.status==5||scope.row.status==6)"> <template v-if="!scope.row.children || (scope.row.children && scope.row.children.length === 0)">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button> <div v-if="(is_guiji||is_chuzhang||scope.row.is_myself)&&!(scope.row.status==5||scope.row.status==6)">
</div> <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button>
<div v-else> </div>
<Button size="small" style='margin-right:5px;margin-bottom:5px;' @click="showPatrol(scope.row.id,'show')"></Button> <div v-else>
<Button size="small" style='margin-right:5px;margin-bottom:5px;' @click="showPatrol(scope.row.id,'show')"></Button>
</div>
<!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button> --> </div>
<!-- <Button v-if="scope.row.status==1&&((scope.row.check_leader==1&&is_leader&&scope.row.leader_status===null)||(scope.row.check_main==1&&is_main_leader&&scope.row.main_status===null))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leader')"></Button> --> <!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button> -->
<!-- <Button v-if="scope.row.status==9&&((scope.row.re_check_leader==1&&is_leader&&scope.row.re_leader_status===null)||(scope.row.re_check_main==1&&is_main_leader&&scope.row.re_main_status===null))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button> --> <!-- <Button v-if="scope.row.status==1&&((scope.row.check_leader==1&&is_leader&&scope.row.leader_status===null)||(scope.row.check_main==1&&is_main_leader&&scope.row.main_status===null))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leader')"></Button> -->
<div v-if='is_guiji||is_chuzhang||login_id==scope.row.admin_id'> <!-- <Button v-if="scope.row.status==9&&((scope.row.re_check_leader==1&&is_leader&&scope.row.re_leader_status===null)||(scope.row.re_check_main==1&&is_main_leader&&scope.row.re_main_status===null))" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button> -->
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' @click="editorPatrol(scope.row.id,'editor')"></Button> <div v-if='is_guiji||is_chuzhang||login_id==scope.row.admin_id'>
</div> <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' @click="editorPatrol(scope.row.id,'editor')"></Button>
<div v-if='is_guiji||is_chuzhang'> </div>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteList(scope.row.id)"> <div v-if='is_guiji||is_chuzhang'>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' ghost>删除</Button> <Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteList(scope.row.id)">
</Poptip> <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' ghost>删除</Button>
</div> </Poptip>
</div>
</template>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -157,7 +164,11 @@
ask_id:'', ask_id:'',
sort_name:'date', sort_name:'date',
sort_type:"DESC", sort_type:"DESC",
year:'' year:'',
dateRange:[],
start_date:'',
end_date:'',
title:''
// pid:0 // pid:0
// myself_update:0 // myself_update:0
}, },
@ -232,6 +243,10 @@
label:"问题类型", label:"问题类型",
prop:'ask_value', prop:'ask_value',
width:120, width:120,
},{
label:"检查名称",
prop:'title',
align:'left'
},{ },{
label:"问题描述", label:"问题描述",
prop:'ask_introduce', prop:'ask_introduce',
@ -304,8 +319,8 @@
// is_my_inspection:false // is_my_inspection:false
// //
importtable:[{ importtable:[{
label:"任务名称", label:"检查名称",
prop:'mission_name', prop:'title',
},{ },{
label:"发现时间", label:"发现时间",
prop:'date', prop:'date',
@ -377,6 +392,16 @@
// this.getList() // this.getList()
} }
}, },
changeDate(e){
if(e){
this.select.start_date = e[0];
this.select.end_date = e[1];
}else{
this.select.start_date = "";
this.select.end_date = "";
this.select.dateRange = [];
}
},
selectionChange(e){ selectionChange(e){
console.log(e) console.log(e)
let arr = [] let arr = []
@ -706,20 +731,20 @@
this.$refs.showPatrol.department_id=this.department_id this.$refs.showPatrol.department_id=this.department_id
this.$refs.showPatrol.isShow = true this.$refs.showPatrol.isShow = true
}, },
async importTable(sheetName) { async importTable(sheetName) {
const res = await listpatrol(Object.assign(this.select, { const res = await listpatrol(Object.assign(this.select, {
page: 1, page: 1,
page_size: 99999 page_size: 99999
})) }))
if (res.data) { if (res.data) {
let headers = this.importtable.map(i => { let headers = this.importtable.map(i => {
return { return {
key: i.prop, key: i.prop,
title: i.label title: i.label
} }
}) })
for(var k of res.data){ for(var k of res.data){
k.mission_name = k.mission?k.mission.name:'' {/* k.mission_name = k.mission?k.mission.name:'' */}
k.site_name = k.site?k.site.name:k.address k.site_name = k.site?k.site.name:k.address
k.ask_value = k.ask?k.ask.value:'' k.ask_value = k.ask?k.ask.value:''
k.up_admin_name = k.up_admin?k.up_admin.name:'' k.up_admin_name = k.up_admin?k.up_admin.name:''
@ -753,21 +778,21 @@
k.fix_status_name = k.fix_status==1?'已完成':'已列计划' k.fix_status_name = k.fix_status==1?'已完成':'已列计划'
} }
} }
const data = res.data.map(row => headers.map(header => row[header.key])); const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title)); data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new(); const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data); const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName); XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, { const wbout = XLSX.write(wb, {
bookType: 'xlsx', bookType: 'xlsx',
bookSST: true, bookSST: true,
type: 'array' type: 'array'
}); });
saveAs(new Blob([wbout], { saveAs(new Blob([wbout], {
type: 'application/octet-stream' type: 'application/octet-stream'
}), `检查问题${sheetName}.xlsx`); }), `检查问题${sheetName}.xlsx`);
} }
}, },
deleteList(id){ deleteList(id){

Loading…
Cancel
Save