master
lion 8 months ago
parent f5f3386d31
commit 6b30bda447

@ -19,7 +19,7 @@ export function save(data) {
export function listarticle(page,
menu_id,
keyword,
page_size, type) {
page_size, type,year) {
return request({
url: '/api/admin/regulation/article-index',
method: 'get',
@ -28,7 +28,8 @@ export function listarticle(page,
menu_id,
keyword,
page_size,
type
type,
year
}
})
}

@ -226,17 +226,21 @@
<div style="display: flex;justify-content: space-between;">
<el-link icon="el-icon-s-marketing" type="primary" style="font-size:18px">检查整改</el-link>
<el-radio-group v-model="showAskData" size="small">
<el-radio-button :label="false">责任科室</el-radio-button>
<el-radio-button :label="true">问题类型</el-radio-button>
<el-radio-button :label="1">责任科室</el-radio-button>
<el-radio-button :label="2">问题类型</el-radio-button>
<el-radio-button :label="3">检查站点</el-radio-button>
</el-radio-group>
</div>
<div>
</div>
</div>
<div style="display: flex;">
<myecharts v-if="!showAskData" :width="'60%'" :height="'345px'" :data="inspection_dep_data"></myecharts>
<myecharts v-if="showAskData" :width="'60%'" :height="'345px'" :data="inspection_ask_data"></myecharts>
<myecharts :width="'40%'" :height="'345px'" :data="inspection_all_data"></myecharts>
<div style="display: flex;" v-if="showAskData==1||showAskData==2">
<myecharts v-if="showAskData==1" :width="'60%'" :height="'345px'" :data="inspection_dep_data"></myecharts>
<myecharts v-if="showAskData==2" :width="'60%'" :height="'345px'" :data="inspection_ask_data"></myecharts>
<myecharts :width="'40%'" :height="'345px'" :data="inspection_all_data"></myecharts>
</div>
<div v-if="showAskData==3">
<myecharts v-if="showAskData==3" :width="'100%'" :height="'345px'" :data="inspection_site_data"></myecharts>
</div>
</div>
@ -881,9 +885,10 @@ export default {
overall_month_data: {},
overall_dep_data: {},
overall_type_data: {},
showAskData: false,
showAskData: 1,
inspection_dep_data: {},
inspection_ask_data: {},
inspection_site_data:{},
inspection_all_data: {},
}
@ -1473,6 +1478,26 @@ export default {
barGap:'0%',
}]
}
//
let s_dep = []
let s_total = []
for(var s of res.sites){
s_dep.push(s.name)
s_total.push(s.total)
}
this.inspection_site_data = {
xShow: true,
yShow: true,
rotate: 70,
x: s_dep,
list: [{
name: "数量",
data: s_total,
type: 'bar',
unit: "件",
barGap:'0%',
}]
}
//
let ask_arr = []
for(var ask of res.type){

@ -7,7 +7,11 @@
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<!-- <Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" /> -->
<el-input style="width: 150px;margin-right: 10px;" v-model="searchFields.KeyWord" placeholder="关键字搜索"></el-input>
<el-date-picker class='height32' type="year" v-model="searchFields.year" format="yyyy" value-format="yyyy"
style="width: 150px;margin-right: 10px;" placeholder="选择年份">
</el-date-picker>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
</div>
</slot>
@ -25,8 +29,14 @@
{{scope.row.title}}
</template>
</el-table-column>
<el-table-column prop="" align="center" label="所属年份" width="180">
<template slot-scope="scope">
{{scope.row.mission?scope.row.mission.start_date.substring(0,4):''}}
</template>
</el-table-column>
<el-table-column prop="created_at" align="center" label="创建日期" width="180">
</el-table-column>
<el-table-column prop="" align="center" label="归档人" width="180">
<template slot-scope="scope">
{{scope.row.admin?scope.row.admin.name:''}}
@ -82,7 +92,8 @@
//
searchFields: {
KeyWord: "",
menu_id: ""
menu_id: "",
year: ''
},
tableData: [],
pagination: {
@ -107,7 +118,7 @@
this.pagination.page = val;
this.load();
},
showBack(id, mission_id,type) {
showBack(id, mission_id, type) {
this.$refs.showBackPlan.id = id
this.$refs.showBackPlan.mission_id = mission_id
this.$refs.showBackPlan.type = type
@ -119,7 +130,7 @@
let type1 = parseInt(this.$route.path.split("_")[2]);
that.searchFields.menu_id = type1
listarticle(that.pagination.page, that.searchFields.menu_id, that.searchFields.KeyWord, that.pagination
.page_size, type).then(response => {
.page_size, type,that.searchFields.year).then(response => {
that.tableData = response.data;
that.pagination.total = response.total;
}).catch(error => {
@ -134,10 +145,12 @@
.dialogConcent {
overflow-y: auto;
}
.el-tree-node__label{
text-wrap:wrap;
.el-tree-node__label {
text-wrap: wrap;
}
.el-tree-node__content{
height:auto;
.el-tree-node__content {
height: auto;
}
</style>

File diff suppressed because it is too large Load Diff

@ -15,7 +15,7 @@
</div>
</div>
</template> -->
<template v-slot:date v-if="type=='editor'">
<template v-slot:date>
<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>发现时间
@ -41,7 +41,7 @@
</div>
</template> -->
<template v-slot:siteName v-if="type=='editor'">
<template v-slot:siteName>
<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>检查地点
@ -69,43 +69,7 @@
</div>
</div>
</template>
<template v-slot:patrol_list v-if="type=='add'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;min-width:0">
<!-- <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题详情 -->
</div>
<div class="xy-table-item-content" style="display: flex;flex-wrap: wrap;margin-left: 10px; width: 90%;">
<div style="margin-bottom:10px">
<el-button type="primary" @click="addPatrolList"></el-button>
</div>
<div style="width:100%">
<xy-table
:list="patrol_list"
stripe
:isPage="false"
:table-item="patrol_table">
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' @click="copyAsk(scope.$index)" size='small' ghost>复制</Button>
</div>
<div>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delPatrolList(scope.$index)">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size='small' ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</div>
</template>
<template v-slot:ask_id v-if="type=='editor'">
<template v-slot:ask_id>
<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>问题类型
@ -119,7 +83,7 @@
</div>
</template>
<template v-slot:ask_department v-if="type=='editor'">
<template v-slot:ask_department>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>建议整改科室
@ -137,7 +101,7 @@
</template>
<template v-slot:showgroups v-if="showgroups"></template>
<template v-slot:ask_introduce v-if="type=='editor'">
<template v-slot:ask_introduce>
<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>问题描述
@ -148,7 +112,7 @@
</div>
</div>
</template>
<template v-slot:tips v-if="type=='editor'">
<template v-slot:tips>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>整改建议
@ -160,7 +124,7 @@
</div>
</template>
<template v-slot:file_ids v-if="type=='editor'">
<template v-slot:file_ids>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>问题图片
@ -244,154 +208,8 @@
},
userdata:[],
mapform: [],
patrol_table:[
{
label:'*发现时间',
prop:'date',
width:180,
customFn:(row,scope)=>{
return( <el-date-picker style="width: 90%" v-model={this.patrol_list[scope.$index].date} format="yyyy-MM-dd"
value-format="yyyy-MM-dd" type="date" placeholder="选择发现时间">
</el-date-picker>)
}
},
{
label:'*问题描述',
prop:'ask_introduce',
width:180,
customFn:(row,scope)=>{
return(<el-input v-model={this.patrol_list[scope.$index].ask_introduce} type='textarea'
placeholder="请输入问题描述" clearable>
</el-input>)
}
},{
label:'*问题类型',
prop:'ask_id',
width:180,
customFn:(row,scope)=>{
return(<el-select v-model={this.patrol_list[scope.$index].ask_id} filterable clearable placeholder="请选择问题类型">
{
this.askList.map(item=>{
return(
<el-option key={item.id} label={item.value} value={item.id}>
</el-option>
)
})
}
</el-select>)
}
},
{
label:'整改建议',
prop:'tips',
width:180,
customFn:(row,scope)=>{
return(<el-input v-model={this.patrol_list[scope.$index].tips} type='textarea'
placeholder="请输入整改建议" clearable>
</el-input>)
}
},
{
label:'*检查地点',
prop:'siteName',
width:240,
customFn:(row,scope)=>{
return(<div style="display:flex"><div>
{
this.patrol_list[scope.$index].showCasc? <el-cascader filterable ref="cascader1"
show-all-levels={false} v-model={this.patrol_list[scope.$index].siteName}
clearable options={this.siteList} props={{
'props':{'label':'name','value':'id'}
}}
placeholder="请选择检查地点" style="width: 120px;margin-right: 10px;"
on={{
["change"]: (e) => (this.changeSite(e,'add',scope.$index)),
}}></el-cascader> : <el-input v-model={this.patrol_list[scope.$index].siteName}
type='text' placeholder="请选择地图" clearable
style="width: 120px;margin-right: 10px;"
on={{
["focus"]: (e) => (this.$refs.maps.box = true),
}}></el-input>
}
</div><div>
{
this.patrol_list[scope.$index].showCasc? <el-button type="primary"
on={{
["click"]: (e) => (this.$refs.maps.box = true,this.mapClickIndex = scope.$index,this.patrol_list[scope.$index].showCasc=false,this.patrol_list[scope.$index].siteName=''),
}}>选择地图</el-button>
:<el-button type="primary"
on={{
["click"]: (e) => (this.patrol_list[scope.$index].showCasc=true,this.patrol_list[scope.$index].siteName=''),
}}>选择站点</el-button>
}
</div>
</div>)
}
},
{
label:'问题图片',
prop:'files',
minWidth:220,
customFn:(row,scope)=>{
let _this = this
return(<el-upload action={this.action} style={{'overflow-x':'scroll','overflow-y':'hidden'}} class='upload-demo' list-type="picture-card"
file-list={this.patrol_list[scope.$index].pictureList}
ref="pictureUpload" auto-upload={true} data={this.uploadOther}
props={
{
"on-success": (response, file, fileList) => this.handlesuccess(response, file, fileList,scope.$index),
["on-preview"]: (file) => this.handlePictureCardPreview(file),
["on-remove"]: (file, fileList) => this.handleRemove(file, fileList,scope.$index),
}
}>
<i class="el-icon-plus"></i>
</el-upload>)
}
},
{
label:'建议整改科室',
prop:'ask_department',
width:180,
customFn:(row,scope)=>{
return(<el-select
on={{
["change"]: (e) => (this.changeDepartment(e,scope.$index)),
}}
v-model={this.patrol_list[scope.$index].ask_department} filterable allow-create clearable placeholder="请选择或输入建议整改科室">
{
this.depList.map(item=>{
return(
<el-option key={item.id} label={item.name} value={item.name}>
</el-option>
)
})
}
</el-select>)
}
},
],
sitePlaceholder:'请选择站点',
mapClickIndex:0,
patrol_list:[{
showCasc:true,
date:'',
ask_id:'',
site_id: '',
siteName: '',
address: '',
lat: '',
lon: '',
ask_department:'',
ask_introduce:'',
tips:'',
pictureList:[]
}],
form: {
date: '',
@ -399,7 +217,6 @@
siteName: '',
groups:'',
showgroups:"",
patrol_list:[],
ask_introduce: '',
ask_id: '',
site_id: '',
@ -413,7 +230,7 @@
tips: '',
file_ids: [],
mission_id: '',
mission_id: '',
up_admin_id:"",
},
@ -531,16 +348,6 @@
changeSite(e,type,index) {
if(e){
console.log("e",e)
if(type=='add'){
this.siteListArr.map(item => {
if (item.id == e[1]) {
this.patrol_list[index].site_id = item.id
this.patrol_list[index].address = item.address
this.patrol_list[index].lat = item.lat
this.patrol_list[index].lon = item.lon
}
})
}else{
this.siteListArr.map(item => {
if (item.id == e[1]) {
this.form.site_id = item.id
@ -550,7 +357,7 @@
// this.form.siteName = item.name
}
})
}
}
@ -565,11 +372,9 @@
arr.push(item.id)
}
})
if(this.type==='add'){
this.patrol_list[index].accept_department_ids = arr
}else{
this.form.accept_department_ids = arr
}
}
},
@ -609,40 +414,15 @@
const res = await getparameteritem('askList')
this.askList = res.detail
},
addPatrolList(){
this.patrol_list.push({
showCasc:true,
date:'',
ask_id:'',
site_id: '',
siteName: '',
address: '',
lat: '',
lon: '',
ask_department:'',
ask_introduce:'',
tips:'',
pictureList:[]
})
},
delPatrolList(index){
this.patrol_list.splice(index,1)
},
handleRemove(file, fileList,index) {
if(this.type=='add'){
this.patrol_list[index].pictureList = fileList
}else{
this.pictureList = fileList
}
},
handlesuccess(response, file, fileList,index) {
console.log(response, file, fileList,index)
if(this.type=='add'){
this.patrol_list[index].pictureList = fileList
console.log("this.patrol_list",this.patrol_list)
}else{
this.pictureList = fileList
}
},
handlePictureCardPreview(file) {
this.showPicUrl = file.url;
@ -670,43 +450,18 @@
lat: res?.lat,
lon: res?.lon,
ask_id: res?.ask_id,
ask_department: res?.ask_department,
ask_introduce: res?.ask_introduce,
tips: res?.tips,
accept_department_ids:res.accept_department_ids?res.accept_department_ids:[],
file_ids: res?.file_ids,
patrol_list:[],
mission_id: res?.mission_id,
up_admin_id:res?.up_admin_id,
}
res.mission_id?this.getGroups(res.mission_id):''
this.sitePlaceholder = res.site_id?res.site.name:res.address
// if(res.site_id){
// this.showCasc = false
// let pArr = this.findParentElement(this.siteList,res.site_id)
// if(pArr){
// this.form.siteName = []
// this.form.siteName.push(pArr.id)
// this.form.siteName.push()
// this.$forceUpdate()
// }else{
// this.form.siteName = [undefined,res.site_id]
// }
// console.log("this.form.siteName",this.form.siteName)
// }else{
// this.form.siteName = res.address
// }
this.showCasc = res.site_id?true:false
// this.$refs.cascader.placeholder = res.site.name
// this.$forceUpdate()
// if(this.showCasc){
// console.log("this.form.siteName",this.form.siteName)
// // this.$refs['cascader'].checkedValue = this.form.siteName
// }
this.mapform = [res.lon, res.lat, res.address]
this.mapform = res.site_id?[]:[res.lon, res.lat, res.address]
for (var f of res.files) {
this.pictureList.push({
id: f.id,
@ -714,133 +469,17 @@
name: f.original_name
})
}
console.log("address",this.form)
this.$refs.cascader1.computePresentText()
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
deepCopy(data){
//string,number,bool,null,undefined,symbol
//object,array,date
if (data && typeof data === "object") {
//
if (typeof data === "function") {
let tempFunc = data.bind(null);
tempFunc.prototype = this.deepCopy(data.prototype);
return tempFunc;
}
switch (Object.prototype.toString.call(data)) {
case "[object String]":
return data.toString();
case "[object Number]":
return Number(data.toString());
case "[object Boolean]":
return new Boolean(data.toString());
case "[object Date]":
return new Date(data.getTime());
case "[object Array]":
let arr = [];
for (let i = 0; i < data.length; i++) {
arr[i] = this.deepCopy(data[i]);
}
return arr;
//js
case "[object Object]":
let obj = {};
for (let key in data) {
//hasOwnProperty obj.hasOwnProperty(prop)
obj[key] = this.deepCopy(data[key]);
}
return obj;
}
} else {
//string,number,bool,null,undefined,symbol
return data;
}
},
copyAsk(index){
console.log(index)
let obj = this.deepCopy(this.patrol_list[index])
obj.pictureList=[]
obj.file_ids=[]
this.patrol_list.push(obj)
},
submit() {
console.log("this.patrol_list",this.patrol_list)
if (this.type === 'add') {
if(this.patrol_list.length<1){
Message({
type: 'warning',
message: '请填写问题'
})
return
}
let nullCount = 0
this.patrol_list.map(item=>{
if(!item.date){
nullCount++
return
}
if(!item.ask_introduce){
nullCount++
return
}
if(!item.ask_id){
nullCount++
return
}
if(!item.siteName){
nullCount++
return
}
})
if( nullCount>0){
Message({
type: 'warning',
message: '请填写完整信息'
})
return
if(this.type=='editor'){
this.form.id = this.id
}else{
this.form.id = ''
}
this.patrol_list.map(item=>{
let _files = []
item.pictureList.map(p=>{
if (p.response) {
_files.push(p.response.id)
} else {
_files.push(p.id)
}
})
item.file_ids = _files
})
let baseForm = {
mission_id:this.form.mission_id,
// date:this.form.date,
up_admin_id:this.form.up_admin_id,
batch:this.patrol_list,
// site_id: this.form.site_id,
// address: this.form.address,
// lat: this.form.lat,
// lon: this.form.lon,
}
console.log("baseForm",baseForm)
// return
batchSave({
...baseForm
}).then(res => {
Message({
type: 'success',
message: '新增检查成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
// return
let _files = []
if (this.pictureList.length > 0) {
for (var h of this.pictureList) {
@ -854,18 +493,24 @@
} else {
this.form.file_ids = []
}
// if(this.form.site_id){
// this.form.address = ''
// this.form.lat = ''
// this.form.lon = ''
// }
console.log("form",this.form)
// return
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑检查成功'
message: '更改成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
},
watch: {
@ -891,11 +536,10 @@
this.groupObj = {}
this.showgroups = false
this.pictureList = []
this.patrol_list = []
this.mission_id = ''
this.mapform = []
this.showCasc = true
this.mapClickIndex = 0
this.mapClickIndex = 0
this.hasMissionId = false
this.$refs['dialog'].reset()
}
@ -914,20 +558,14 @@
mapform(newVal, oldVal) {
console.log("点击地图了z",this.mapClickIndex)
if(this.showCasc && this.type==='add'){
console.log("点击地图了",this.mapClickIndex)
this.patrol_list[this.mapClickIndex].lon = newVal[0];
this.patrol_list[this.mapClickIndex].lat = newVal[1];
this.patrol_list[this.mapClickIndex].address = newVal[2];
this.patrol_list[this.mapClickIndex].siteName = newVal[2]
this.patrol_list[this.mapClickIndex].site_id = ''
return
if(!this.showCasc){
this.form.lon = newVal[0];
this.form.lat = newVal[1];
this.form.address = newVal[2];
this.form.siteName = newVal[2]
this.form.site_id = ''
}
this.form.lon = newVal[0];
this.form.lat = newVal[1];
this.form.address = newVal[2];
this.form.siteName = newVal[2]
this.form.site_id = ''
}
}

@ -9,9 +9,9 @@
<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>
</Select>
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.mission_id" placeholder="问题来源">
<!-- <Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.mission_id" placeholder="问题来源">
<Option v-for="item in missionList" :value="item.id">{{item.name}}</Option>
</Select>
</Select> -->
<Select filterable clearable style='width:150px;margin-right: 10px;' v-model="select.ask_id" placeholder="问题类型">
<Option v-for="item in askList" :value="item.id">{{item.value}}</Option>
</Select>
@ -59,7 +59,6 @@
:list="list"
:total="total"
stripe
:showIndex='false'
@cell-dblclick='cellClicks'
@selection-change='selectionChange'
@ -156,6 +155,7 @@
ask_id:'',
sort_name:'date',
sort_type:"DESC",
year:''
// pid:0
// myself_update:0
},
@ -234,13 +234,18 @@
label:"问题类型",
prop:'ask.value',
width:80,
},{
label:"问题来源",
prop:'missionName',
},
{
label:"检查地点",
prop:'site_id',
// width:180,
align:'left',
width:240,
},{
formatter: (cell, data, value, index) => {
return value?cell.site.name:cell.address
}
},
{
label:"发现日期",
prop:'date',
width:110,
@ -360,7 +365,9 @@
changeYear(e){
if(e){
this.year = e
this.getMissonList()
this.select.year = e
// this.getMissonList()
// this.getList()
}
},
selectionChange(e){

@ -4,6 +4,15 @@
<lx-header icon="md-apps" :text="type_name" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<el-date-picker
class='height32'
type="year"
v-model="select.year"
format="yyyy"
value-format="yyyy"
style="width: 150px;margin-right: 10px;"
placeholder="选择年份">
</el-date-picker>
<el-date-picker
class='height32'
type="month"
@ -57,6 +66,15 @@
:treeProps="treeProps" :total="total" stripe @cell-dblclick='cellClicks'
@pageSizeChange="e => {select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:year>
<el-table-column align='center' label="所属年份" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.start_date">
{{scope.row.start_date.substring(0,4)}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="100" header-align="center">
<template slot-scope="scope">
@ -217,6 +235,13 @@
prop: 'pindex',
width:80
},
{
label: "所属年份",
prop: 'year',
width: 120,
// fixed:'left',
align: 'left',
},
{
label: "任务名称",
prop: 'name',
@ -293,7 +318,7 @@
this.select.type = 4
this.type_name = '专项专题任务'
this.path_type = path[1]
this.table.splice(1,0,{
this.table.splice(2,0,{
label: "任务类别",
prop: 'mission_type',
width: 120,

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin_test',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,

Loading…
Cancel
Save