我的任务

master
lion 1 year ago
parent 95375eda81
commit dfaaf51465

@ -22,8 +22,16 @@ export function save(data) {
method: 'post',
data
})
}
export function batchSave(data) {
return request({
url: '/api/admin/inspection/batch-save',
method: 'post',
data
})
}
export function del(id) {
return request({
url: '/api/admin/inspection/destroy',

@ -830,6 +830,8 @@ export default {
top: 0;
left: 0;
right: 0;
display: flex;
justify-content: flex-end;
::v-deep .ivu-page-item,
.ivu-page-options {

@ -58,7 +58,7 @@
</div> -->
<div>
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small"
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
@click="checkUnits(scope.row.id,'show',5)">查看任务</Button>
</div>
</template>
@ -1132,10 +1132,13 @@ export default {
break;
}
},
checkUnits(id, type) {
checkUnits(id, type,url_type) {
if(url_type){
this.$refs.checkUnit.url_type = url_type
}
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.url_type = 5
this.isautoplay = false
this.$refs.checkUnit.isShow = true
},

@ -0,0 +1,632 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '检查问题' : '编辑问题'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:mission_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>任务名称
</div>
<div class="xy-table-item-content">
<el-select v-model="form.mission_id" @change="changeMission" :disabled="hasMissionId" filterable clearable placeholder="请选择任务名称" style="width: 400px;">
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<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>检查日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 400px;" v-model="form.date" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" type="date" placeholder="选择检查日期">
</el-date-picker>
</div>
</div>
</template>
<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>问题类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.ask_id" filterable clearable placeholder="请选择问题类型" style="width: 400px;">
<el-option v-for="item in askList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<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>检查地点
</div>
<div class="xy-table-item-content">
<!-- <el-select @change="changeSite" v-model="form.siteName" filterable clearable placeholder="请选择检查地点" style="width: 400px;">
<el-option label="选择地图位置" :value="-1">
</el-option>
<el-option v-for="item in siteList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select> -->
<el-cascader filterable ref="cascader1" :show-all-levels="false" v-model="form.siteName" v-if="showCasc" clearable :options="siteList" :props="{'label':'name','value':'id'}"
placeholder="请选择检查地点" style="width: 290px;margin-right: 10px;" @change="changeSite"></el-cascader>
<el-input v-model="form.siteName" v-if="!showCasc" type='text' placeholder="请选择检查地点" clearable
style="width: 290px;margin-right: 10px;" @focus="$refs.maps.box = true"></el-input>
<el-button type="primary" v-if="showCasc" @click="$refs.maps.box = true;showCasc=false;form.siteName=''"></el-button>
<el-button type="primary" v-if="!showCasc" @click="showCasc = true;form.siteName=''"></el-button>
</div>
</div>
</template>
<template v-slot:up_admin_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>上报人
</div>
<div class="xy-table-item-content">
<el-select v-model="form.up_admin_id" @change="changeUpAdmin" filterable allow-create clearable placeholder="请选择上报人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<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>建议整改科室
</div>
<div class="xy-table-item-content">
<el-select @change="changeDepartment" v-model="form.ask_department" filterable allow-create clearable placeholder="请选择或输入建议整改科室" style="width: 400px;">
<el-option v-for="item in depList" :key="item.id" :label="item.name" :value="item.name">
</el-option>
</el-select>
<!-- <el-input v-model="form.ask_department" type='text' placeholder="请输入建议科室" clearable
style="width: 400px;"></el-input> -->
</div>
</div>
</template>
<template v-slot:groups v-if="showgroups">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>组别
</div>
<div class="xy-table-item-content">
<div>
{{groupObj.name}}:
<el-tag style="margin-right:5px" v-for="item in groupObj.details">{{item.name}}</el-tag>
</div>
</div>
</div>
</template>
<template v-slot:showgroups v-if="showgroups"></template>
<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>问题描述
</div>
<div class="xy-table-item-content">
<el-input v-model="form.ask_introduce" :rows='5' type='textarea' placeholder="请输入问题描述" clearable
style="width: 400px;"></el-input>
</div>
</div>
</template>
<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>整改建议
</div>
<div class="xy-table-item-content">
<el-input v-model="form.tips" :rows='5' type='textarea' placeholder="请输入整改建议" clearable
style="width: 400px;"></el-input>
</div>
</div>
</template>
<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>附件
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' list-type="picture-card" :file-list="pictureList"
ref="pictureUpload" style="width:600px" :auto-upload="true" :data="uploadOther"
:on-preview="handlePictureCardPreview" :on-success="handlesuccess" :on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
<el-dialog :visible.sync="showPic">
<img width="100%" :src="showPicUrl" alt="">
</el-dialog>
<avue-input-map ref="maps" :params="mapparams" placeholder="请选择地图" v-model="mapform"></avue-input-map>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import {
getparameteritem
} from "@/api/system/dictionary.js";
import {
save,
get
} from "@/api/task/patrol.js";
import {
listunit
} from "@/api/task/unit.js";
import {
listaddress
} from '@/api/address'
import {
listdept
} from "@/api/system/department.js"
import {
listCommonuser
} from "@/api/common.js"
import {
getToken
} from '@/utils/auth'
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
mission_id:'',
hasMissionId:false,
uploadOther: {
token: ""
},
login_id:'',
department_id:'',
groupObj:{},
showgroups:false,
showCasc:true,
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
pictureList: [],
showPic: false,
showPicUrl: '',
unitList: [],
siteList: [],
siteListArr: [],
askList: [],
depList:[],
mapparams: {
zoom: 11,
},
userdata:[],
mapform: [],
form: {
mission_id: '',
date: '',
ask_id: '',
site_id: '',
siteName: '',
address: '',
lat: '',
lon: '',
up_admin_id:"",
ask_department: '',
groups:'',
showgroups:"",
accept_department_ids:[],
ask_introduce: '',
tips: '',
file_ids: [],
},
rules: {
// mission_id: [{
// required: true,
// message: ''
// }],
date: [{
required: true,
message: '请选择检查日期'
}],
siteName: [{
required: true,
message: '请选择检查地点'
}],
ask_id: [{
required: true,
message: '请选择问题类型'
}],
ask_introduce: [{
required: true,
message: '请输入问题描述'
}]
}
}
},
created() {
// document.getElementById('casc').click()
this.uploadOther.token = getToken();
this.loadDeptOptions()
this.getUnit()
this.getAddress()
this.getAsk()
// this.loadDeptOptions()
this.loadUser()
},
methods: {
//
changeMission(e){
console.log("e",e)
if(e){
this.getGroups(e)
}
},
changeUpAdmin(){
},
getGroups(e){
this.groupObj = {}
this.showgroups = false
this.unitList.map(item=>{
if(item.id==e){
if(item.groups&&item.groups.length>0){
let arr = {}
item.groups.map(g=>{
arr['name'] = g.name
if(g.details&&g.details.length>0){
if(g.type==2){
g.details.map(d=>{
if(d.id==this.department_id){
arr['details'] = g.details
}
})
}
if(g.type==1){
g.details.map(d=>{
if(d.id==this.login_id){
arr['details'] = g.details
}
})
}
}
})
console.log("arr",arr)
this.groupObj = arr
this.showgroups = true
}
}
})
},
async getUnit() {
const res = await getparameteritem('unitTypeList')
for(var k of res.detail){
if(k.remark=='检查'){
const res1 = await listunit({
page:1,
page_size:9999,
unit_type:k.id,
audit_status:1
})
this.unitList = res1.data
}
}
},
loadUser() {
listCommonuser({
page_size: 999
}).
then((res) => {
this.userdata = res.data?res.data.reverse():[];
}).catch(error => {
console.log(error)
})
},
loadDeptOptions() {
listdept().
then((res) => {
this.depList = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
changeSite(e) {
if(e){
this.siteListArr.map(item => {
if (item.id == e[1]) {
this.form.site_id = item.id
this.form.address = item.address
this.form.lat = item.lat
this.form.lon = item.lon
// this.form.siteName = item.name
}
})
}
},
changeDepartment(e){
console.log("eeee",e)
this.form.accept_department_ids = []
if(e){
this.depList.map(item=>{
if(e===item.name){
this.form.accept_department_ids.push(item.id)
}
})
}
},
async getAddress() {
const res = await listaddress({
page: 1,
page_size: 9999
})
this.siteListArr = res.data.reverse()
let arr = this.contactSite(res.data)
this.siteList = arr
},
contactSite(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].type) === -1) {
newArr.push({
type: arr[i].type,
name: arr[i]['type_detail']['value'],
children: [arr[i]]
})
tempArr.push(arr[i].type);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].type == arr[i].type) {
newArr[j].children.push(arr[i])
}
}
}
}
return newArr
},
async getAsk(label) {
const res = await getparameteritem('askList')
this.askList = res.detail
},
handleRemove(file, fileList) {
this.pictureList = fileList
},
handlesuccess(response, file, fileList) {
this.pictureList = fileList
},
handlePictureCardPreview(file) {
this.showPicUrl = file.url;
this.showPic = true;
},
async getDetail() {
const res = await get(this.id)
this.form = {
mission_id: res?.mission_id,
date: res?.date,
ask_id: res?.ask_id,
site_id: res?.site_id,
siteName: res.site_id?[undefined,res.site_id]:res.address,
address: res?.address,
lat: res?.lat,
lon: res?.lon,
up_admin_id:res?.up_admin_id,
ask_department: res?.ask_department,
groups:'',
showgroups:"",
ask_introduce: res?.ask_introduce,
tips: res?.tips,
accept_department_ids:res.accept_department_ids?res.accept_department_ids:[],
file_ids: res?.file_ids,
}
res.mission_id?this.getGroups(res.mission_id):''
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]
for (var f of res.files) {
this.pictureList.push({
id: f.id,
url: f.url,
name: f.original_name
})
}
this.$refs.cascader1.computePresentText()
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
submit() {
let _files = []
if (this.pictureList.length > 0) {
for (var h of this.pictureList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.file_ids = _files
} else {
this.form.file_ids = []
}
if (this.type === 'add') {
save({
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增检查成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑检查成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
if (this.type === 'add') {
this.form.up_admin_id = this.login_id
// for (var k of this.unitList) {
// if (k.name == '') {
// this.form.mission_id = k.id
// }
// }
}
} else {
this.id = ''
this.login_id = ''
this.department_id = ''
this.groupObj = {}
this.showgroups = false
this.pictureList = []
this.mission_id = ''
this.mapform = []
this.showCasc = true
this.hasMissionId = false
this.$refs['dialog'].reset()
}
},
mission_id(newval) {
if (newval) {
this.form.mission_id = newval
this.hasMissionId = true
this.getGroups(newval)
}
},
mapform(newVal, oldVal) {
this.form.lon = newVal[0];
this.form.lat = newVal[1];
this.form.address = newVal[2];
this.form.siteName = newVal[2]
this.form.site_id = ''
}
}
}
</script>
<style scoped lang="scss">
// .xy-table-item-label {
// width: 160px;
// }
::v-deep .ask_department {
// flex-basis: 100%;
}
::v-deep .avue-input-map {
display: none;
}
::v-deep .site_id,
::v-deep .address,
::v-deep .lat,
::v-deep .lon,
::v-deep .accept_department_ids
{
display: none;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 146px !important;
height: 146px !important;
line-height: 146px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 146px !important;
height: 146px !important;
line-height: 146px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
// ::v-deep .xy-table-item-label {
// width: 160px !important;
// }
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.el-input {
width: 80%
}
}
</style>

@ -27,57 +27,83 @@
</div>
</div>
</template>
<template v-slot:up_admin_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>上报人
</div>
<div class="xy-table-item-content">
<el-select v-model="form.up_admin_id" @change="changeUpAdmin" filterable allow-create clearable placeholder="请选择上报人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-slot:ask_id>
</template>
<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>检查地点
</div>
<div class="xy-table-item-content">
<el-cascader filterable ref="cascader1" :show-all-levels="false" v-model="form.siteName" v-if="showCasc" clearable :options="siteList" :props="{'label':'name','value':'id'}"
placeholder="请选择检查地点" style="width: 290px;margin-right: 10px;" @change="changeSite"></el-cascader>
<el-input v-model="form.siteName" v-if="!showCasc" type='text' placeholder="请选择检查地点" clearable
style="width: 290px;margin-right: 10px;" @focus="$refs.maps.box = true"></el-input>
<el-button type="primary" v-if="showCasc" @click="$refs.maps.box = true;showCasc=false;form.siteName=''"></el-button>
<el-button type="primary" v-if="!showCasc" @click="showCasc = true;form.siteName=''"></el-button>
</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;">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.ask_id" filterable clearable placeholder="请选择问题类型" style="width: 400px;">
<el-option v-for="item in askList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<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>检查地点
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>问题详情
</div>
<div class="xy-table-item-content">
<!-- <el-select @change="changeSite" v-model="form.siteName" filterable clearable placeholder="请选择检查地点" style="width: 400px;">
<el-option label="选择地图位置" :value="-1">
</el-option>
<el-option v-for="item in siteList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select> -->
<el-cascader ref="cascader1" :show-all-levels="false" v-model="form.siteName" v-if="showCasc" clearable :options="siteList" :props="{'label':'name','value':'id'}"
placeholder="请选择检查地点" style="width: 290px;margin-right: 10px;" @change="changeSite"></el-cascader>
<el-input v-model="form.siteName" v-if="!showCasc" type='text' placeholder="请选择检查地点" clearable
style="width: 290px;margin-right: 10px;" @focus="$refs.maps.box = true"></el-input>
<el-button type="primary" v-if="showCasc" @click="$refs.maps.box = true;showCasc=false;form.siteName=''"></el-button>
<el-button type="primary" v-if="!showCasc" @click="showCasc = true;form.siteName=''"></el-button>
<div class="xy-table-item-content" style="display: flex;flex-wrap: wrap;margin-left: 10px;">
<div style="margin-bottom:10px">
<el-button type="primary" @click="addPatrolList"></el-button>
</div>
<div>
<xy-table
:list="patrol_list"
stripe
:isPage="false"
:table-item="patrol_table">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="80" header-align="center">
<template slot-scope="scope">
<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:up_admin_id>
<template v-slot:ask_id v-if="type=='editor'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>上报人
<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-select v-model="form.up_admin_id" @change="changeUpAdmin" filterable allow-create clearable placeholder="请选择上报人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
<el-select v-model="form.ask_id" filterable clearable placeholder="请选择问题类型" style="width: 400px;">
<el-option v-for="item in askList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:ask_department>
<template v-slot:ask_department v-if="type=='editor'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>建议整改科室
@ -107,7 +133,7 @@
</div>
</template>
<template v-slot:showgroups v-if="showgroups"></template>
<template v-slot:ask_introduce>
<template v-slot:ask_introduce v-if="type=='editor'">
<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>问题描述
@ -118,7 +144,7 @@
</div>
</div>
</template>
<template v-slot:tips>
<template v-slot:tips v-if="type=='editor'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>整改建议
@ -130,10 +156,10 @@
</div>
</template>
<template v-slot:file_ids>
<template v-slot:file_ids v-if="type=='editor'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>附件
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>问题图片
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' list-type="picture-card" :file-list="pictureList"
@ -163,7 +189,8 @@
} from "@/api/system/dictionary.js";
import {
save,
get
get,
batchSave
} from "@/api/task/patrol.js";
import {
listunit
@ -213,16 +240,153 @@
},
userdata:[],
mapform: [],
patrol_table:[
{
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:'siteName',
// width:180,
// customFn:(row,scope)=>{
// return(<div>
// {
// this.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: 290px;margin-right: 10px;"
// on={{
// ["change"]: (e) => (this.changeSite(e)),
// }}></el-cascader> : <el-input v-model={this.patrol_list[scope.$index].siteName}
// type='text' placeholder="" clearable
// style="width: 290px;margin-right: 10px;"
// on={{
// ["focus"]: (e) => (this.$refs.maps.box = true),
// }}></el-input>
// }
// <div>
// {
// this.showCasc? <el-button type="primary"
// on={{
// ["click"]: (e) => (this.$refs.maps.box = true,this.showCasc=false,this.patrol_list[scope.$index].siteName=''),
// }}></el-button>
// :<el-button type="primary"
// on={{
// ["click"]: (e) => (this.showCasc=true,this.patrol_list[scope.$index].siteName=''),
// }}></el-button>
// }
// </div>
// </div>)
// }
// },
{
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>)
}
},
{
label:'问题描述',
prop:'ask_introduce',
width:180,
customFn:(row,scope)=>{
return(<el-input v-model={this.patrol_list[scope.$index].ask_introduce} type='text'
placeholder="请输入问题描述" clearable>
</el-input>)
}
},
{
label:'整改建议',
prop:'tips',
width:180,
customFn:(row,scope)=>{
return(<el-input v-model={this.patrol_list[scope.$index].tips} type='text'
placeholder="请输入整改建议" clearable>
</el-input>)
}
},
{
label:'问题图片',
prop:'files',
minWidth:180,
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>)
}
}
],
patrol_list:[{
ask_id:'',
site_id: '',
siteName: '',
address: '',
lat: '',
lon: '',
ask_department:'',
ask_introduce:'',
tips:'',
pictureList:[]
}],
form: {
mission_id: '',
date: '',
up_admin_id:"",
siteName: '',
patrol_list:[],
ask_id: '',
site_id: '',
siteName: '',
address: '',
lat: '',
lon: '',
up_admin_id:"",
ask_department: '',
groups:'',
showgroups:"",
@ -245,14 +409,14 @@
required: true,
message: '请选择检查地点'
}],
ask_id: [{
required: true,
message: '请选择问题类型'
}],
ask_introduce: [{
required: true,
message: '请输入问题描述'
}]
// ask_id: [{
// required: true,
// message: ''
// }],
// ask_introduce: [{
// required: true,
// message: ''
// }]
}
}
},
@ -275,7 +439,7 @@
}
},
changeUpAdmin(){
alert("123")
},
getGroups(e){
this.groupObj = {}
@ -357,15 +521,21 @@
}
},
changeDepartment(e){
changeDepartment(e,index){
console.log("eeee",e)
let arr = []
this.form.accept_department_ids = []
if(e){
this.depList.map(item=>{
if(e===item.name){
this.form.accept_department_ids.push(item.id)
arr.push(item.id)
}
})
if(this.type==='add'){
this.patrol_list[index].accept_department_ids = arr
}else{
this.form.accept_department_ids = arr
}
}
},
@ -403,11 +573,33 @@
const res = await getparameteritem('askList')
this.askList = res.detail
},
handleRemove(file, fileList) {
this.pictureList = fileList
addPatrolList(){
this.patrol_list.push({
ask_id:'',
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) {
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;
@ -418,13 +610,15 @@
this.form = {
mission_id: res?.mission_id,
date: res?.date,
ask_id: res?.ask_id,
up_admin_id:res?.up_admin_id,
site_id: res?.site_id,
siteName: res.site_id?[undefined,res.site_id]:res.address,
address: res?.address,
lat: res?.lat,
lon: res?.lon,
up_admin_id:res?.up_admin_id,
ask_id: res?.ask_id,
ask_department: res?.ask_department,
groups:'',
showgroups:"",
@ -432,6 +626,7 @@
tips: res?.tips,
accept_department_ids:res.accept_department_ids?res.accept_department_ids:[],
file_ids: res?.file_ids,
patrol_list:[],
}
res.mission_id?this.getGroups(res.mission_id):''
this.showCasc = res.site_id?true:false
@ -440,7 +635,6 @@
// 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]
for (var f of res.files) {
@ -454,6 +648,8 @@
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
submit() {
console.log("this.patrol_list",this.patrol_list)
// return
let _files = []
if (this.pictureList.length > 0) {
for (var h of this.pictureList) {
@ -468,8 +664,27 @@
this.form.file_ids = []
}
if (this.type === 'add') {
save({
...this.form
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
}
console.log("baseForm",baseForm)
// return
batchSave({
...baseForm
}).then(res => {
Message({
type: 'success',
@ -498,6 +713,7 @@
watch: {
isShow(newVal) {
if (newVal) {
console.log("this.type",this.type)
if (this.type === 'editor') {
this.getDetail()
}
@ -511,11 +727,13 @@
}
} else {
this.id = ''
this.type='add'
this.login_id = ''
this.department_id = ''
this.groupObj = {}
this.showgroups = false
this.pictureList = []
this.patrol_list = []
this.mission_id = ''
this.mapform = []
this.showCasc = true
@ -547,8 +765,8 @@
// .xy-table-item-label {
// width: 160px;
// }
::v-deep .ask_department {
// flex-basis: 100%;
::v-deep .patrol_list {
flex-basis: 100%;
}
::v-deep .avue-input-map {

@ -1039,10 +1039,11 @@
type: 'success',
message: '新增任务成功'
})
saveLog({
table_name:"missions_logs",
mission_name:this.form.name,
mission_id:res.id,
mission_id:this.form.pid>0?this.form.pid:res.id,
op_name:this.type === 'add'?'新增任务':(this.type=== 'pid'?'新增子任务':'新增任务'),
remark:''
}).then(res=>{

@ -79,13 +79,16 @@
</template>
{{showform.end_content?showform.end_content:''}}
</el-descriptions-item> -->
<el-descriptions-item span='4'>
<el-descriptions-item span='4' >
<template slot="label">
参与对象
<span v-if="url_type!=5"></span>
<span v-else></span>
</template>
<div v-if="url_type==5">
<div
v-if="showform.accept_department_ids && showform.accept_department_ids.length>0 && stateObj.is_manger && !(showform.audit_status==3||showform.audit_status==5)">
v-if="(showform.accept_department_ids && showform.accept_department_ids.length>0
&& stateObj.is_manger && !(showform.audit_status==3||showform.audit_status==5))
||showform.main_admin_id==stateObj.login_id">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(showform.id,'send')">派发任务</Button>
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@ -168,32 +171,51 @@
</el-descriptions-item>
</el-descriptions>
</div>
<div v-if="type=='show'">
<el-divider>执行情况</el-divider>
<xy-table :list="inspection_log" v-if="is_what_unitType==''" stripe :table-item="inspectionLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="ask_log" v-if="is_what_unitType==''" stripe :table-item="askLogTable" :isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="study_log" v-if="is_what_unitType==''" stripe :table-item="studyLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="uploads_log" v-if="is_what_unitType==''" stripe :table-item="uploadsLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="uploads_log" v-if="is_what_unitType==''" stripe :table-item="uploadsLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="train_log" v-if="is_what_unitType==''" stripe :table-item="trainLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<!-- <el-divider>执行情况</el-divider> -->
<el-tabs v-model="activeName">
<el-tab-pane label="子任务" name="first">
<xy-table :list="showform.pid_details" stripe :table-item="pidTable"
:isPage='false'>
<template v-slot:btns>
<!-- <el-table-column align='center' fixed="right" label="操作" width="100" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
</div>
</template>
</el-table-column> -->
</template>
</xy-table>
</el-tab-pane>
<el-tab-pane label="执行情况" name="second">
<xy-table :list="inspection_log" v-if="is_what_unitType==''" stripe :table-item="inspectionLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="ask_log" v-if="is_what_unitType==''" stripe :table-item="askLogTable" :isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="study_log" v-if="is_what_unitType==''" stripe :table-item="studyLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="uploads_log" v-if="is_what_unitType==''" stripe :table-item="uploadsLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="uploads_log" v-if="is_what_unitType==''" stripe :table-item="uploadsLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
<xy-table :list="train_log" v-if="is_what_unitType==''" stripe :table-item="trainLogTable"
:isPage='false'>
<template v-slot:btns></template>
</xy-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
@ -323,6 +345,7 @@
</template>
</xy-dialog>
<addUnit ref="addUnit"></addUnit>
<!-- <checkUnit ref="checkUnit"></checkUnit> -->
<showLogs ref="showLogs"></showLogs>
<answerQuestion ref='answerQuestion'></answerQuestion>
<viewFile ref='viewFile' @studytime='studytime' :url='studyurl' :title='studytitle'></viewFile>
@ -338,7 +361,8 @@
get,
updatemission
} from "@/api/task/unit.js";
import addUnit from '../components/addUnit.vue'
import addUnit from '../components/addUnit.vue'
// import checkUnit from '../components/checkUnit.vue'
import {
saveuploads,
savetrain,
@ -373,11 +397,13 @@
answerQuestion,
viewFile,
addUnit,
showLogs
showLogs,
// checkUnit
},
data() {
return {
isShow: false,
isShow: false,
activeName:'first',
type: '',
id: '',
login_id: "",
@ -428,7 +454,70 @@
study_log: [],
train_log: [],
uploads_log: [],
inspection_log: [],
inspection_log: [],
unitStatusList: [{
id: 4,
value: '待开展',
type: 'info'
}, {
id: 1,
value: '未完成',
type: ''
}, {
id: 5,
value: '已归档',
type: 'success'
}, {
id: 3,
value: '待归档',
type: 'danger'
}],
pidTable:[
{
label: "任务名称",
prop: 'name',
width: 200,
// fixed:'left',
align: 'left',
}, {
label: "任务内容及要求",
prop: 'content',
minWidth: 200,
align: 'left',
}, {
label: "开始日期",
prop: 'start_date',
width: 120,
align: 'center'
}, {
label: "要求完成日期",
prop: 'end_date',
width: 120,
align: 'center'
}, {
label: "状态",
prop: 'audit_status',
width: 120,
align: 'center',
customFn: (row) => {
return ( <div> {
this.unitStatusList.map(item => {
if (item.id == row.audit_status) {
return ( <el-tag type = {
item.type
}> {
item.value
} </el-tag>)
}
})
} </div>)
}
}, {
label: "责任人(科室)",
prop: 'main_admin.name',
width: 120,
align: 'center',
}],
askLogTable: [{
label: "提交时间",
prop: 'created_at',
@ -437,6 +526,11 @@
formatter: (cell, data, value, index) => {
return value ? value.substring(0, 16) : ''
}
},{
label: "提交科室",
prop: 'department.name',
align: 'center',
width: 120
}, {
label: "提交人",
prop: 'admin.name',
@ -498,7 +592,12 @@
formatter: (cell, data, value, index) => {
return value ? value.substring(0, 16) : ''
}
}, {
}, {
label: "提交科室",
prop: 'department.name',
align: 'center',
width: 120
},{
label: "提交人",
prop: 'admin.name',
align: 'center',
@ -535,7 +634,12 @@
formatter: (cell, data, value, index) => {
return value ? value.substring(0, 16) : ''
}
}, {
}, {
label: "提交科室",
prop: 'department.name',
align: 'center',
width: 120
},{
label: "提交人",
prop: 'admin.name',
align: 'center',
@ -579,7 +683,12 @@
formatter: (cell, data, value, index) => {
return value ? value.substring(0, 16) : ''
}
}, {
}, {
label: "提交科室",
prop: 'department.name',
align: 'center',
width: 120
},{
label: "提交人",
prop: 'admin.name',
align: 'center',
@ -612,7 +721,12 @@
prop: 'up_admin.name',
align: 'center',
width: 100
}, {
}, {
label: "提交科室",
prop: 'department.name',
align: 'center',
width: 120
},{
label: "组别",
prop: '_names',
width: 240,
@ -769,7 +883,14 @@
this.department_id = state.state.department_id
this.getUnitTypeList()
},
methods: {
methods: {
checkUnits(id, type) {
console.log("123")
this.id = id
this.type = type
this.url_type = this.url_type
this.isShow = true
},
print() {
this.$Print('#printunit');
},
@ -1173,7 +1294,8 @@
watch: {
isShow(newVal) {
if (newVal) {
console.log("type", this.type)
console.log("type", this.type)
console.log("url_type",this.url_type)
this.getDetail()
} else {
this.id = ''
@ -1185,7 +1307,8 @@
this.studyForm = {}
this.studytitle = '',
this.studyurl = '',
this.is_what_unitType = ''
this.is_what_unitType = ''
this.url_type = ''
this.mission_groups_list = [{
name: '',
type: 1,

@ -542,7 +542,7 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>审核结果
</div>
<div>
<el-select v-model="form.status" filterable clearable placeholder="请选择审核结果" style="width: 300px;">
<el-select @change="changeConfirmStatus" v-model="confirmStatus" filterable clearable placeholder="请选择审核结果" style="width: 300px;">
<el-option v-for="item in confirmList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -926,12 +926,13 @@ import elSelectTree from '@/components/selectTree'
}, {
id: 6,
name: '否'
}],
}],
confirmStatus:1,
confirmList: [{
id: 5,
id: 1,
name: '通过'
}, {
id: 7,
id: 0,
name: '不通过'
}],
leaderCheckList: [{
@ -1002,11 +1003,7 @@ import elSelectTree from '@/components/selectTree'
this.is_chuzhang = obj.is_chuzhang
this.is_leader = obj.is_leader
this.is_main_leader = obj.is_main_leader
for(var k of obj.role){
if(k.name==='系统管理员'){
this.is_admin = true
}
}
this.is_admin = obj.is_admin
// const res = await leads()
// console.log("this.login_id",this.login_id)
// this.leads_list = res
@ -1062,6 +1059,15 @@ import elSelectTree from '@/components/selectTree'
if(e){
this.form.status = e
}
},
changeConfirmStatus(e){
if(e){
if(e==1){
this.form.status=5
}else if(e===0){
this.form.status=7
}
}
},
//
changeAcceptStatus(e) {
@ -1403,7 +1409,7 @@ loadUser() {
this.type = 'show'
}
this.type_name = this.typeNameList[this.type]
if(res.status>2&&(res.status!=6||res.status!=8)){
if(res.status>2&&!(res.status==6||res.status==8)){
this.acceptStatus = 1
this.showTarget = true
this.showReason = false
@ -1424,6 +1430,14 @@ loadUser() {
}else{
this.checkstatus = ""
}
}
if(res.status==5||res.status==9){
this.confirmStatus = 1
}else if(res.status==7){
this.confirmStatus = 0
}else{
this.confirmStatus = ""
}
this.showform = res
res.mission_id?this.getGroups(res.mission_id,res.up_admin_id,res.department_id):''

@ -7,9 +7,9 @@
<el-steps :active="steps_active" finish-status="success" direction="vertical">
<el-step title="问题"></el-step>
<el-step title="整改意见"></el-step>
<el-step title="整改接收"></el-step>
<!-- <el-step title="整改接收"></el-step> -->
<el-step title="整改反馈"></el-step>
<el-step title="审核"></el-step>
<!-- <el-step title="审核"></el-step> -->
</el-steps>
</template>
<!-- 填报信息 -->
@ -99,7 +99,7 @@
<!-- 整改意见 -->
<div>
<el-divider>整改意见</el-divider>
<div v-if="(showform.status==0||showform.status==8||showform.status==1||showform.status==2)&&(is_guiji||is_chuzhang)||is_admin" style="border: 5px solid #8CC5FF;">
<div v-if="(showform.status==0||showform.status==8||showform.status==1)&&(is_guiji||is_chuzhang)||is_admin" style="border: 5px solid #8CC5FF;">
<el-descriptions class="margin-top" :column="4">
<el-descriptions-item span="2" :labelStyle="{'display':'none'}" contentClassName="wraps" :colon='false'>
<div style="display: flex;width:100%;padding-bottom:12px">
@ -330,7 +330,7 @@
</div>
</div>
<!-- 整改接收 -->
<div>
<!-- <div>
<el-divider>整改接收</el-divider>
<div v-if="(showform.status==2&&is_myself)||is_admin" style="border: 5px solid #8CC5FF;">
<div>
@ -445,7 +445,7 @@
</el-descriptions>
</div>
</div>
<!-- 整改反馈 -->
--><!-- 整改反馈 -->
<div>
<el-divider>整改反馈</el-divider>
<div v-if="((showform.status==3||showform.status==7||showform.status==4)&&is_myself)||is_admin" style="border: 5px solid #8CC5FF;">
@ -531,7 +531,7 @@
</div>
</div>
<!-- 审核 -->
<div>
<!-- <div>
<el-divider>审核</el-divider>
<div v-if="((showform.status==4||showform.status==9)&&(is_guiji||is_chuzhang))||is_admin" style="border: 5px solid #8CC5FF;">
<div>
@ -546,7 +546,6 @@
<el-option v-for="item in confirmList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<!-- <el-input v-if="showform.status==9" placeholder="待领导确认" disabled style="width: 300px;"></el-input> -->
</div>
</div>
<div style="display: flex;width:100%;padding-bottom:12px">
@ -655,9 +654,6 @@
<span v-else-if="showform.status==4">
待审核
</span>
<!-- <span v-else-if="showform.status==-1||showform.status==0||showform.status==6||showform.status==8">
</span> -->
<span v-else>
--
</span>
@ -706,6 +702,7 @@
</el-descriptions>
</div>
</div>
-->
</div>
</template>
@ -793,9 +790,6 @@ import elSelectTree from '@/components/selectTree'
},{
id:1,
value:'整改中'
},{
id:2,
value:'待接收'
},{
id:3,
value:'整改中'
@ -919,9 +913,9 @@ import elSelectTree from '@/components/selectTree'
// id: 6,
// name: ''
// }],
checkstatus:2,
checkstatus:3,
checkList: [{
id: 2,
id: 3,
name: '是'
}, {
id: 6,
@ -1105,7 +1099,7 @@ import elSelectTree from '@/components/selectTree'
reject(error)
})
},
loadUser() {
loadUser() {
listCommonuser({
page_size: 999,
}).
@ -1277,7 +1271,7 @@ loadUser() {
contents:'',
//
status: '',
status: res?.status,
accept_status: '',
check_leader: res.check_leader == 1 ? 1 : 0,
check_main: res.check_main == 1 ? 1 : 0,
@ -1370,16 +1364,12 @@ loadUser() {
console.log("this.is_myself",this.is_myself)
//
if (res.status == 4 || res.status == 9) {
this.steps_active = 4
} else if (res.status == 0 || res.status == 8 || res.status == 1) {
this.steps_active = 1
} else if (res.status == 2) {
this.steps_active = 2
} else if(res.status == 3 || res.status == 7){
if (res.status == 4 || res.status == 3) {
this.steps_active = 3
}else if(res.status == 5 ){
this.steps_active = 5
} else if (res.status == 0 || res.status == 1) {
this.steps_active = 2
}else{
this.steps_active = 3
}
this.statusLabel.map(item => {
if (item.id == res.status) {
@ -1387,43 +1377,22 @@ loadUser() {
}
})
// type status
if (res.status == 0 || res.status == 8) {
if (res.status == 0) {
//
this.type = 'check'
} else if (res.status == 1) {
//
this.type = 'leader'
} else if (res.status == 2) {
//
this.type = 'accept'
} else if (res.status == 3 || res.status == 7) {
} else if (res.status == 3 || res.status == 4) {
//
this.type = 'reform'
} else if (res.status == 4) {
//
this.type = 'confirm'
} else if (res.status == 9) {
//
this.type = 'leaderconfirm'
} else {
this.type = 'show'
}
this.type_name = this.typeNameList[this.type]
if(res.status>2&&!(res.status==6||res.status==8)){
this.acceptStatus = 1
this.showTarget = true
this.showReason = false
}else{
if(res.status==8){
this.acceptStatus = 0
this.showTarget = false
this.showReason = true
}else{
this.acceptStatus = ""
}
}
if(res.status>1&&(res.status!=6)){
this.checkstatus = 2
this.checkstatus = 3
}else{
if(res.status==6){
this.checkstatus = 6
@ -1431,14 +1400,7 @@ loadUser() {
this.checkstatus = ""
}
}
if(res.status==5||res.status==9){
this.confirmStatus = 1
}else if(res.status==7){
this.confirmStatus = 0
}else{
this.confirmStatus = ""
}
this.showform = res
res.mission_id?this.getGroups(res.mission_id,res.up_admin_id,res.department_id):''
this.$forceUpdate()
@ -1458,7 +1420,8 @@ loadUser() {
this.form.fix_file_ids = []
}
// return
//
//
console.log("this.form.status",this.form.status)
if (this.type === 'check') {
this.form.status = this.checkstatus
if (this.form.accept_department_ids || this.form.accept_admin_ids) {
@ -1492,10 +1455,11 @@ loadUser() {
message: `请选择确认结果`
})
return
}
}
//
if (this.form.check_leader == 1 && this.form.check_main == 1) {
if (this.form.leader_status == 1 && this.form.main_status == 1) {
this.form.status = 2
this.form.status = 3
} else if(this.form.leader_status === 0 || this.form.main_status === 0){
this.form.status = 6
}else{
@ -1505,14 +1469,14 @@ loadUser() {
} else {
if (this.form.check_leader == 1) {
if(this.form.leader_status==1){
this.form.status=2
this.form.status = 3
}else if(this.form.leader_status===0){
this.form.status = 6
}
} else if (this.form.check_main == 1) {
if(this.form.main_status==1){
this.form.status=2
this.form.status = 3
}else if(this.form.main_status===0){
this.form.status = 6
}
@ -1520,37 +1484,6 @@ loadUser() {
}
}
//
if (this.type === 'accept') {
// this.form.status = this.checkstatus
if (this.form.status == 3) {
if (!this.form.plan_end_date) {
Message({
type: 'warning',
message: `请选择计划时间`
})
return
}
// if (!this.form.duty_admin_id) {
// Message({
// type: 'warning',
// message: ``
// })
// return
// }
} else if (this.form.status == 8) {
this.form.leader_status = null
this.form.main_status = null
console.log("this.form.reason", this.form.reason)
if (!this.form.reason) {
Message({
type: 'warning',
message: `请输入退回理由`
})
return
}
}
}
//
if (this.type === 'reform') {
this.form.status = 4
@ -1571,59 +1504,6 @@ loadUser() {
}
// status=9
if (this.type === 'confirm') {
if (this.form.re_check_leader == 1 || this.form.re_check_main == 1) {
this.form.status = 9
// this.form.re_leader_status = null
// this.form.re_main_status = null
}
}
//
if (this.type === 'leaderconfirm') {
if(this.is_leader&&this.showform.re_check_leader==1&&this.form.re_leader_status===null){
Message({
type: 'warning',
message: `请选择审核结果`
})
return
}
if(this.is_main_leader&&this.showform.re_check_main==1&&this.form.re_main_status===null){
Message({
type: 'warning',
message: `请选择审核结果`
})
return
}
if (this.form.re_check_leader == 1 && this.form.re_check_main == 1) {
if (this.form.re_leader_status == 1 && this.form.re_main_status == 1) {
this.form.status = 5
} else if(this.form.re_leader_status === 0 || this.form.re_main_status === 0){
this.form.status = 7
}else{
this.form.status = 9
}
} else {
if (this.form.re_check_leader == 1) {
console.log(this.form.re_check_leader)
if(this.form.re_leader_status == 1){
console.log(this.form.re_leader_status)
this.form.status=5
}else if(this.form.re_leader_status === 0){
this.form.status=7
}
console.log("status",this.form.status)
} else if (this.form.re_check_main == 1) {
if(this.form.re_main_status == 1){
this.form.status=5
}else if(this.form.re_main_status === 0){
this.form.status=7
}
}
}
}
console.log("form",this.form)
if (!this.form.status) {
Message({

@ -22,7 +22,7 @@
placeholder="请选择检查地点" style="width: 150px;margin-right: 10px;" @change="changeSite"></el-cascader>
<Input v-model="select.keyword" clearable style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList"></Button>
<Button type="primary" @click="select.page=1,getList()"></Button>
<Button type="primary" style="margin-left: 10px;" @click="editorPatrol('','add')"></Button>
<!-- <Button type="primary" style='margin-left:10px;' @click="chooseEditorPatrol()"></Button> -->
@ -38,11 +38,23 @@
<!-- @cell-click="cellClicks" -->
<div class="tablewrap">
<div class="tablemonth">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="selectMission" @change="changeMonth">
<!-- <el-checkbox-group v-model="selectMission" @change="changeMonth">
<el-checkbox v-for="item in missionList" :label="item.id">{{item.name}}</el-checkbox>
</el-checkbox-group>
</el-checkbox-group> -->
<el-tree
ref="missiontree"
:props="{
label: 'name',
children: 'pid_details'
}"
:data="missionList"
show-checkbox
node-key="id"
:default-checked-keys="selectMission"
@check-change="changeMonth">
</el-tree>
</div>
<div class="tablecontent">
@ -51,14 +63,14 @@
:total="total"
stripe
:showIndex='false'
:isPage="false"
@cell-dblclick='cellClicks'
@selection-change='selectionChange'
@pageSizeChange="e => {select.page_size = e,getList()}"
@pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="80" header-align="center">
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
<template slot-scope="scope">
<div v-if="(is_guiji||is_chuzhang||scope.row.is_myself)&&!(scope.row.status==5||scope.row.status==6)">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button>
@ -138,7 +150,7 @@
select:{
keyword:'',
page:1,
page_size:9999,
page_size:10,
status:'',
myself:0,
mission_id:'',
@ -147,6 +159,7 @@
ask_id:'',
sort_name:'date',
sort_type:"DESC",
// pid:0
// myself_update:0
},
sectionList:[],
@ -219,7 +232,8 @@
table:[{
label:"任务名称",
prop:'missionName',
// width:180
// width:180,
align:'left'
},{
label:"状态",
prop:'status',
@ -547,33 +561,58 @@
// console.log("currentTableList",this.currentTableList)
this.total = res.total
},
handleCheckAllChange(val) {
if(val){
let _sm = []
this.missionList.map(item=>{
_sm.push(item.id)
})
this.selectMission = _sm
this.select.mission_id = this.selectMission.join(',')
this.getList()
}else{
this.selectMission = []
this.select.mission_id = ''
}
this.isIndeterminate = false;
handleCheckAllChange() {
// let _checkAll = this.checkAll ? false : true
// console.log("_checkAll",_checkAll)
// this.checkAll = _checkAll
console.log("this.checkAll",this.checkAll)
this.select.page=1
if(this.checkAll){
let _sm = []
this.missionList.map(item=>{
_sm.push(item.id)
if(item.pid_details_count>0){
item.pid_details.map(p=>{
_sm.push(p.id)
})
}
})
this.selectMission = _sm
this.select.mission_id = ''
this.$refs.missiontree.setCheckedKeys(_sm);
this.getList()
}else{
this.selectMission = []
this.select.mission_id = ''
this.$refs.missiontree.setCheckedKeys([]);
this.getList()
}
this.isIndeterminate = true;
// let _arr = []
// _arr = this.filterBySelectedMonths(this.list,this.selectMission)
// this.currentTableList = _arr
},
changeMonth(e){
let checkedCount = e.length;
this.checkAll = checkedCount === this.missionList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.missionList.length;
this.select.mission_id = this.selectMission.join(',')
this.getList()
// let _arr = []
// _arr = this.filterBySelectedMonths(this.list,this.selectMission)
// this.currentTableList = _arr
changeMonth(data, checked, indeterminate){
console.log(data, checked, indeterminate);
// if(!this.checkAll){
if(checked){
if(this.selectMission.indexOf(data.id)==-1){
this.selectMission.push(data.id)
}
}else{
this.selectMission.map((item,index)=>{
if(item===data.id){
this.selectMission.splice(index,1)
}
})
}
this.select.mission_id = this.selectMission.join(',')
this.select.page=1
this.getList()
console.log("this.selectMission",this.selectMission)
},
filterBySelectedMonths(arr, selectMission) {
if (!selectMission || selectMission.length === 0) {
@ -599,7 +638,8 @@
page:1,
page_size:999,
unit_type:k.id,
year:this.year
year:this.year,
pid:0
})
this.missionList = res1.data
@ -783,23 +823,30 @@
}
},
deleteList(){
deleteList(id){
var that = this;
if (this.sectionList.length>0) {
let arr = []
this.sectionList.map(item=>{
arr.push(item.id)
})
del(arr.join(',')).then(response => {
this.$Message.success('操作成功');
that.getList();
}).catch(error => {
console.log(error)
reject(error)
})
}else{
this.$Message.warning('请选择要删除的数据');
}
del(id).then(response => {
this.$Message.success('操作成功');
that.getList();
}).catch(error => {
console.log(error)
reject(error)
})
// if (this.sectionList.length>0) {
// let arr = []
// this.sectionList.map(item=>{
// arr.push(item.id)
// })
// del(arr.join(',')).then(response => {
// this.$Message.success('');
// that.getList();
// }).catch(error => {
// console.log(error)
// reject(error)
// })
// }else{
// this.$Message.warning('');
// }
}
},
watch:{}
@ -811,16 +858,27 @@
display:flex;
}
.tablemonth{
width:10%;
width:15%;
background: #fff;
padding: 20px;
margin-right:1%;
}
.tablecontent{
width:89%
width:84%
}
/deep/ .el-tree-node{
white-space: normal;
}
/deep/ .el-tree-node__content{
height: auto;
align-items: start;
}
/deep/ .el-table .cell.el-tooltip{
white-space: normal;
}
/deep/ .tablemonth .el-checkbox{
width:100%;
/* width:100%; */
padding: 4px 0;
}
/deep/ .tablemonth .el-checkbox__input{
vertical-align: top!important;
@ -828,8 +886,12 @@
/deep/ .tablemonth .el-checkbox__label {
text-wrap:wrap;
}
/deep/ .v-table .el-table__body .missionName{
vertical-align: top!important;
/deep/ .el-tree-node__label{
/* text-wrap:wrap; */
}
/deep/ .v-table .el-table__body .missionName>div{
/* white */
/* vertical-align: top!important; */
}
/deep/ .el-icon-circle-close{
color:#fff

@ -4,8 +4,18 @@
<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;">
<DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
type="year" @on-change="changeYear"></DatePicker>
<!-- <DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
type="year" @on-change="changeYear"></DatePicker> -->
<el-date-picker
class='height32'
type="month"
v-model="myMonth"
@change="changeMyMonth"
format="yyyy-MM"
value-format="MM"
style="width: 150px;margin-right: 10px;"
placeholder="选择月份">
</el-date-picker>
<el-select class='height32' style="width: 150px;margin-right: 10px;" filterable clearable
v-model="select.unit_type" placeholder="任务类型">
<el-option v-for="item in unitTypeList" :key="item.id" :label="item.value" :value="item.id">
@ -16,10 +26,16 @@
<el-option v-for="item in selectAuditStatusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
<el-date-picker @change="changeDate" v-model="select.dateRange" type="daterange"
<el-date-picker v-if="showSelectMonth" @change="changeDate" v-model="select.dateRange" type="daterange"
:picker-options="pickerOptions" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" align="right">
</el-date-picker>
</el-date-picker>
<el-select class='height32' v-if="showSelectMonth" style="width: 150px;margin-right: 10px;" filterable clearable
v-model="select.main_department_id" placeholder="责任科室">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<Input v-model="select.keyword" style="width: 150px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
@ -45,20 +61,22 @@
<div>
共有<span style="font-size: 24px;color:red;margin:0 5px">{{total}}</span>项任务<span
style="font-size: 24px;color:red;margin:0 5px">{{auditStatus1}}</span>项未完成</div>
<xy-table :list="list" :defaultExpandAll="false" :treeProps="treeProps" :rowKey="id" :total="total" stripe @cell-dblclick='cellClicks'
<xy-table :showIndex="false" :list="list" :defaultExpandAll="false"
:isPage="isMyPage"
: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:btns>
<el-table-column align='center' fixed="right" label="操作" width="100" header-align="center">
<template slot-scope="scope">
<template v-if="path_type!=5">
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="checkUnits(scope.row.id,'show')">查看</Button>
</div>
<div v-if="!(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'editor')">编辑</Button>
@click="editorUnit(scope.row.id,'editor')">编辑任务</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
</div>
<!-- <div>
<Button v-if="scope.row.audit_admin_id==stateObj.login_id&&scope.row.audit_status==0" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')"></Button>
@ -71,20 +89,54 @@
</template>
<template v-else>
<!-- 任务是发给部门的只有指定部门科长能看见需要再次分发人员 -->
<!-- 任务是发给部门的只有指定部门科长能看见需要再次分发人员 -->
<!-- 任务发给部门的科长责任人都能进行创建任务派发任务执行任务的操作 -->
<div
v-if="scope.row.accept_department_ids && scope.row.accept_department_ids.length>0 && stateObj.is_manger && !(scope.row.audit_status==3||scope.row.audit_status==5)">
v-if="(scope.row.accept_department_ids && scope.row.accept_department_ids.length>0 && stateObj.is_manger
&& !(scope.row.audit_status==3||scope.row.audit_status==5)) || scope.row.main_admin_id==stateObj.login_id
">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'send')">派发任务</Button>
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'pid')">创建任务</Button>
@click="editorUnit(scope.row.id,'pid')">创建任务</Button>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
style="margin-right:5px;margin-bottom:5px;"
@click="openMyMission(item.value,scope.row)">执行任务</Button>
</div>
</div>
<!-- 组别的带头人 和小组组长 -->
<div v-else-if="(scope.row.groups && scope.row.groups.length>0 && !(scope.row.audit_status==3||scope.row.audit_status==5))
|| scope.row.main_admin_id==stateObj.login_id">
<div v-for="item in scope.row.grounp_admin_detail">
<div v-if="item.admin.id===stateObj.login_id || stateObj.is_manger">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'send')">派发任务</Button>
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'pid')">创建任务</Button>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
style="margin-right:5px;margin-bottom:5px;"
@click="openMyMission(item.value,scope.row)">执行任务</Button>
</div>
</div>
<div v-else>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
style="margin-right:5px;margin-bottom:5px;"
@click="openMyMission(item.value,scope.row)">执行任务</Button>
</div>
</div>
</div>
</div>
<!-- 直接 执行任务 -->
<div v-else>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
style="margin-right:5px;margin-bottom:5px;"
@click="openMyMission(item.value,scope.row)">{{item.remark}}</Button>
@click="openMyMission(item.value,scope.row)">执行任务</Button>
</div>
</div>
@ -125,7 +177,9 @@
del,
unDoTotal
} from '@/api/task/unit.js'
import {
listdept
} from "@/api/system/department.js"
import {
getparameteritem
} from "@/api/system/dictionary.js";
@ -152,6 +206,7 @@
path_type: 4,
dialogVisible: false,
stateObj: {},
deptOptions:[],
treeProps:{children: 'pid_details', hasChildren: 'hasChildren' },
typeName: [{
type: 1,
@ -162,7 +217,9 @@
}, {
type: 5,
name: '我的任务'
}],
}],
myMonth:'',
isMyPage:true,
select: {
keyword: '',
page: 1,
@ -179,7 +236,8 @@
sort_type: 'DESC',
year: new Date().getFullYear(),
month: '',
pid:0,
pid:0,
main_department_id:''
},
total: 0,
pickerOptions: {
@ -293,12 +351,12 @@
}],
table: [
// {
// label: "id",
// prop: 'id',
// // fixed:'left',
// align: 'left',
// },
{
label: "",
prop: 'pindex',
// fixed:'left',
width:80
},
{
label: "任务名称",
prop: 'name',
@ -311,6 +369,12 @@
minWidth: 200,
align: 'left',
}, {
label: "任务类型",
prop: 'unit_type_detail.value',
width: 120,
align: 'center'
},
{
label: "开始日期",
prop: 'start_date',
width: 120,
@ -349,7 +413,8 @@
computed: {
},
created() {
this.getLeads()
this.getLeads()
this.loadDeptOptions()
this.stateObj = state.state
let currentMonth = (new Date()).getMonth() + 1 < 10 ? "0" + ((new Date()).getMonth() + 1) : (new Date())
.getMonth() + 1
@ -361,19 +426,20 @@
this.select.type = path[1]
this.path_type = path[1]
if (path[1] == 5) {
this.showSelectMonth = true
this.showSelectMonth = false
this.select.type = ''
this.select.myself = 1
// this.select.pid = 0
// if(!this.stateObj.is_manger){
this.isMyPage = false
this.select.page_size = 999
this.select.pid = ''
this.treeProps = {children: 'nochildren', hasChildren: 'hasChildren' }
this.treeProps = {children: 'mychildren', hasChildren: 'hasChildren' }
// }
this.type_name = '我的任务'
this.path_type = path[1]
// this.table = this.table.slice(2)
// this.table.map((item, index) => {
// if (item.prop === '_names') {
// this.table.splice(index, 1)
// }
// })
this.path_type = path[1]
this.select.month = ''
}
if (path[1] == 4) {
this.selectMonth = []
@ -384,6 +450,7 @@
this.select.type = 4
this.type_name = '专项专题任务'
this.path_type = path[1]
this.table.unshift({
label: "任务类别",
prop: 'mission_type',
@ -393,8 +460,10 @@
}
if (path[1] == 1) {
this.showSelectMonth = true
this.select.type = 1
this.type_name = '年度计划任务'
this.select.type = 1
// this.select.pid = ''
// this.treeProps = {children: 'nochildren', hasChildren: 'hasChildren' }
this.type_name = '任务跟踪'
this.path_type = path[1]
}
}
@ -404,11 +473,29 @@
},
watch: {},
methods: {
methods: {
loadDeptOptions() {
listdept().
then((res) => {
this.deptOptions = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
changeYear(e) {
if (e) {
this.select.year = e
}
},
changeMyMonth(e){
console.log(e)
if(e){
this.select.month = e
// this.select.month = e.join(",")
}else{
this.select.month = ''
}
},
async getLeads() {
// await this.$store.dispatch("user/getLeads")
@ -537,36 +624,67 @@
})
// accept_department_ids is_manger = true
//
//
let spliceIndex = []
let _arr = []
res.data.map((r,index)=>{
console.log("r.rowKey",r.rowKey)
let doAdmins = r.do_admin_ids ? r.do_admin_ids : []
if(this.path_type == 5 && r.accept_department_ids.length > 0){
console.log("id",r.id)
let isDepartment = r.accept_department_ids.indexOf(this.stateObj.department_id)!=-1 ? true : false
let isDomains = doAdmins.indexOf(this.stateObj.login_id)!=-1 ? true : false
if(doAdmins.length==0){
if(!(isDepartment && this.stateObj.is_manger)){
spliceIndex.push(index)
}
}else{
if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
spliceIndex.push(index)
let isMainId = r.main_admin_id==this.stateObj.login_id?true:false
if(!isMainId){
if(doAdmins.length==0){
if(!(isDepartment && this.stateObj.is_manger)){
spliceIndex.push(index)
}
}else{
if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
spliceIndex.push(index)
}
}
}
}
})
if(this.path_type == 5){
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
_arr = newArr
this.list = _arr
_arr = this.buildTree(newArr)
}else{
this.list = res.data
_arr = res.data
}
_arr.map((r,index)=>{
r.pindex = index+1
})
this.list = _arr
console.log("spliceIndex",spliceIndex)
this.total = res.total
},
buildTree(items) {
const tree = [];
const map = {};
items.forEach(item => {
map[item.id] = item;
});
items.forEach(item => {
const parent = map[item.pid];
if (parent) {
(parent.mychildren || (parent.mychildren = [])).push(item);
} else {
tree.push(item);
}
});
return tree;
},
handleCheckAllChange(val) {
if (val) {
@ -657,7 +775,12 @@
width: 250px;
margin-right: 10px;
}
/deep/ .height32 .el-input__icon.el-icon-date{
line-height: 32px;
}
/deep/ .height32.el-date-editor--month .el-input__icon{
line-height: 32px;
}
/deep/ .el-date-editor .el-range__icon,
/deep/ .el-date-editor .el-range-separator,
/deep/ .el-date-editor .el-range__close-icon {

Loading…
Cancel
Save