lion 2 years ago
parent 33ae374cbc
commit ce80500f46

@ -19,7 +19,7 @@
"avue-plugin-map": "^1.0.1",
"axios": "^0.26.1",
"core-js": "3.6.5",
"element-ui": "2.13.2",
"element-ui": "^2.15.14",
"js-cookie": "2.2.0",
"less": "^3.13.1",
"moment": "^2.29.2",

@ -8,7 +8,7 @@ export default {
},
width:{
type:Number,
default:70
default:65
},
// isFullScreen:{
// type:Boolean,
@ -137,13 +137,14 @@ export default {
if(type === "form"){
let formItems = []
Object.keys(form).map((key)=>{
formItems.push(
<el-form-item
class={key}
prop={key}>
{eval(`{$scopedSlots.${key} ? $scopedSlots.${key}() : ''}`)}
</el-form-item>
)
formItems.push(
<el-form-item
class={key}
prop={key}>
{eval(`{$scopedSlots.${key} ? $scopedSlots.${key}() : ''}`)}
</el-form-item>
)
})
return (
<el-form
@ -198,7 +199,10 @@ export default {
<style lang="scss">
.xy-table-item-label{
width: 140px;
// width: 140px;
/* width: 160px; */
min-width: 120px;
padding-right: 0!important;
}
.xy-table-item-price{
position: relative;
@ -285,9 +289,9 @@ font-size: 15px;
.xy-table-item{
display: flex;
align-items: center;
font-size:16px;
padding-right: 80px;
margin-bottom:20px;
margin-bottom:10px;
&-label{
padding: 0 20px;

@ -10,9 +10,15 @@ import {
} from '@/utils/auth'
let loading;
// create an axios instance
// create an axios instance
let baseUrl = ''
if(window.location.origin.indexOf('localhost')>-1){
baseUrl = process.env.VUE_APP_BASE_API
}else{
baseUrl = window.location.origin + '/'
}
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
baseURL: baseUrl, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
timeout: 500000 // request timeout
})

@ -18,11 +18,11 @@
<template v-slot:date>
<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-date-picker style="width: 300px;" v-model="form.date" value-format="yyyy-MM-dd" type="date"
placeholder="选择上报日期">
placeholder="选择巡查日期">
</el-date-picker>
</div>
</div>
@ -53,20 +53,6 @@
</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>
<template v-slot:ask_introduce>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -88,6 +74,20 @@
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">
@ -147,9 +147,9 @@
date: '',
site_id: '',
ask_id: '',
file_ids: [],
ask_introduce: '',
tips: '',
tips: '',
file_ids: [],
},
rules: {
@ -159,7 +159,7 @@
}],
date: [{
required: true,
message: '请选择上报日期'
message: '请选择巡查日期'
}],
site_id: [{
required: true,
@ -221,9 +221,9 @@
date: res?.date,
site_id: res?.site_id,
ask_id: res?.ask_id,
file_ids: res?.file_ids,
ask_introduce: res?.ask_introduce,
tips: res?.tips,
tips: res?.tips,
file_ids: res?.file_ids,
}
for (var f of res.files) {
@ -297,10 +297,9 @@
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 160px;
}
// .xy-table-item-label {
// width: 160px;
// }
.img__delete {
transform: scale(0.8, 0.8);
@ -324,18 +323,18 @@
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
width: 146px !important;
height: 146px !important;
line-height: 146px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
width: 146px !important;
height: 146px !important;
line-height: 146px !important;
text-align: center;
}
@ -345,9 +344,9 @@
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
// ::v-deep .xy-table-item-label {
// width: 160px !important;
// }
::v-deep .el-date-editor .el-range-separator {
width: auto !important;

@ -8,142 +8,142 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>任务名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入任务名称" clearable style="width: 300px;"></el-input>
<el-input v-model="form.name" placeholder="请输入任务名称" clearable style="width: 310px;"></el-input>
</div>
</div>
</template>
<template v-slot:unit_type>
<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.unit_type" filterable clearable placeholder="请选择任务类型" style="width: 300px;">
<el-option v-for="item in unitTypeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:start_date>
<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-date-picker style="width: 300px;" v-model="form.start_date" value-format="yyyy-MM-dd"
type="date" placeholder="选择开始日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_date>
<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-date-picker style="width: 300px;" v-model="form.end_date" value-format="yyyy-MM-dd"
type="date" placeholder="选择结束日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:content>
<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.content" :rows='5' type='textarea' placeholder="请输入说明" clearable style="width: 300px;"></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'
:file-list="pictureList" ref="pictureUpload" style="width:600px" :auto-upload="true"
:data="uploadOther"
:on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:name7>
<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-radio-group v-model="form.name7" @change='changeName7'>
<el-radio :label="1">人员</el-radio>
<el-radio :label="2">部门</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:accept_department_ids v-if='form.name7==2'>
<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" style='min-width:600px'>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.accept_department_ids" @change="handleCheckedDeptChange">
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<template v-slot:accept_admin_ids v-if='form.name7==1'>
<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" style='min-width:600px'>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
</el-transfer>
</div>
</div>
</template>
<template v-slot:end_type>
<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" style='min-width:600px'>
<el-select style="width: 400px;" v-model="form.end_type" filterable clearable placeholder="请选择任务完成要求">
<el-option v-for="item in endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:end_content>
<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.end_content" :rows='5' type='textarea' placeholder="请输入任务完成详情" clearable style="width: 400px;"></el-input>
</div>
</div>
</template>
</template>
<template v-slot:unit_type>
<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.unit_type" filterable clearable placeholder="请选择任务类型" style="width: 310px;">
<el-option v-for="item in unitTypeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:start_date>
<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-date-picker style="width: 310px;" v-model="form.start_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择开始日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_date>
<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-date-picker style="width: 310px;" v-model="form.end_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择结束日期">
</el-date-picker>
</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' :file-list="pictureList" ref="pictureUpload"
style="width:600px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:content>
<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.content" :rows='5' type='textarea' placeholder="请输入说明" clearable
style="width:310px"></el-input>
</div>
</div>
</template>
<template v-slot:end_type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="width:140px">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>任务完成要求
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<el-select style="width: 310px;" v-model="form.end_type" filterable clearable placeholder="请选择任务完成要求">
<el-option v-for="item in endTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:end_content>
<div class="xy-table-item">
<div class="xy-table-item-label" style="width:140px">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>任务完成详情
</div>
<div class="xy-table-item-content">
<el-input v-model="form.end_content" :rows='5' type='textarea' placeholder="请输入任务完成详情" clearable
style="width: 310px;"></el-input>
</div>
</div>
</template>
<template v-slot:name7>
<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" style="width:400px">
<el-radio-group v-model="form.name7" @change='changeName7'>
<el-radio :label="1">人员</el-radio>
<el-radio :label="2">部门</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:accept_department_ids v-if='form.name7==2'>
<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" style='min-width:600px'>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.accept_department_ids" @change="handleCheckedDeptChange">
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<template v-slot:accept_admin_ids v-if='form.name7==1'>
<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" style='min-width:600px'>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
</el-transfer>
</div>
</div>
</template>
@ -158,18 +158,19 @@
} from 'element-ui'
import {
getparameteritem
} from "@/api/system/dictionary.js";
import {
save,get
} from "@/api/task/unit.js";
import {
listdept
} from "@/api/system/department.js"
import {
listCommonuser
} from "@/api/common.js"
import {
getToken
} from "@/api/system/dictionary.js";
import {
save,
get
} from "@/api/task/unit.js";
import {
listdept
} from "@/api/system/department.js"
import {
listCommonuser
} from "@/api/common.js"
import {
getToken
} from '@/utils/auth'
export default {
components: {
@ -179,180 +180,181 @@
return {
isShow: false,
type: 'add',
id: '',
uploadOther: {
token: ""
},
action:`${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
pictureList: [],
deptOptions: [],
checkAll: false,
isIndeterminate: true,
userdata:[],
filterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
unitTypeList:[{
id:1,
value:'专项检查'
},{
id:2,
value:'资料收集'
},{
id:3,
value:'网络安全'
}],
endTypeList:[{
id:1,
name:'提交文字'
},{
id:2,
name:'提交附件'
},{
id:3,
name:'提交文字与附件'
id: '',
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
pictureList: [],
deptOptions: [],
checkAll: false,
isIndeterminate: true,
userdata: [],
filterMethod(query, item) {
return item.name.indexOf(query) > -1;
},
unitTypeList: [{
id: 1,
value: '专项检查'
}, {
id: 2,
value: '资料收集'
}, {
id: 3,
value: '网络安全'
}],
endTypeList: [{
id: 1,
name: '提交文字'
}, {
id: 2,
name: '提交附件'
}, {
id: 3,
name: '提交文字与附件'
}],
form: {
type:'',
name: '',
unit_type: '',
start_date: '',
end_date: '',
content: '',
file_ids: '',
name7: 1,
accept_department_ids: [],
accept_admin_ids:[],
end_type:'',
end_content:'',
type:'',
form: {
type: '',
name: '',
unit_type: '',
start_date: '',
end_date: '',
file_ids: '',
content: '',
end_type: '',
end_content: '',
type: '',
name7: 1,
accept_department_ids: [],
accept_admin_ids: [],
},
rules: {
name:[{
required:true,
message:'请输入任务名称'
}],
start_date:[{
required:true,
message:'请选择开始时间'
}],
end_date:[{
required:true,
message:'请选择结束时间'
}],
unit_type:[{
required:true,
message:'请选择任务类型'
name: [{
required: true,
message: '请输入任务名称'
}],
start_date: [{
required: true,
message: '请选择开始时间'
}],
end_date: [{
required: true,
message: '请选择结束时间'
}],
unit_type: [{
required: true,
message: '请选择任务类型'
}]
}
}
},
created() {
this.uploadOther.token = getToken();
if(this.$route.path){
let path = this.$route.path.split("_")
this.form.type = path[1]
}
this.loadDeptOptions()
this.uploadOther.token = getToken();
if (this.$route.path) {
let path = this.$route.path.split("_")
this.form.type = path[1]
}
this.loadDeptOptions()
this.loadUser()
},
methods: {
changeName7(e){
if(e){
this.form.accept_department_ids = []
this.form.accept_admin_ids = []
}
},
//
loadDeptOptions() {
listdept().
then((res) => {
for (var m of res) {
m.checked = false;
}
this.deptOptions = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
loadUser() {
listCommonuser({
page_size: 999
}).
then((res) => {
this.userdata = res.data;
}).catch(error => {
console.log(error)
})
},
handleCheckAllChange(val) {
let options = [];
for (var m of this.deptOptions) {
options.push(m.id);
}
this.form.accept_department_ids = val ? options : [];
this.isIndeterminate = false;
},
handleCheckedDeptSingleChange(v) {
//
console.log(v);
var that = this;
if (this.form.accept_department_ids)
that.delDeptItem();
},
//
delDeptItem() {
for (var m of this.deptOptions) {
if (this.form.accept_department_ids.indexOf(m.id) == -1) {
var d = this.form.accept_department_ids.filter(function(t) {
return t.department_id == m.id;
})
if (d.length != 0) {
delDep(d[0].id).then(response => {}).catch(error => {
console.log(error)
})
}
}
}
},
handleCheckedDeptChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.deptOptions.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length;
},
methods: {
changeName7(e) {
if (e) {
this.form.accept_department_ids = []
this.form.accept_admin_ids = []
}
},
//
loadDeptOptions() {
listdept().
then((res) => {
for (var m of res) {
m.checked = false;
}
this.deptOptions = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
loadUser() {
listCommonuser({
page_size: 999
}).
then((res) => {
this.userdata = res.data;
}).catch(error => {
console.log(error)
})
},
handleCheckAllChange(val) {
let options = [];
for (var m of this.deptOptions) {
options.push(m.id);
}
this.form.accept_department_ids = val ? options : [];
this.isIndeterminate = false;
},
handleCheckedDeptSingleChange(v) {
//
console.log(v);
var that = this;
if (this.form.accept_department_ids)
that.delDeptItem();
},
//
delDeptItem() {
for (var m of this.deptOptions) {
if (this.form.accept_department_ids.indexOf(m.id) == -1) {
var d = this.form.accept_department_ids.filter(function(t) {
return t.department_id == m.id;
})
if (d.length != 0) {
delDep(d[0].id).then(response => {}).catch(error => {
console.log(error)
})
}
}
}
},
handleCheckedDeptChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.deptOptions.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length;
},
async getDetail() {
const res = await get(this.id)
this.form = {
type:res?.type,
name: res?.name,
unit_type: res?.unit_type,
start_date: res?.start_date,
this.form = {
type: res?.type,
name: res?.name,
unit_type: res?.unit_type,
start_date: res?.start_date,
end_date: res?.end_date,
content: res?.content,
file_ids: res?.file_ids,
name7: res.accept_department_ids.length>0?2:(res.accept_admin_ids>0?1:1),
accept_department_ids: res?.accept_department_ids,
accept_admin_ids:res?.accept_admin_ids,
end_type:res?.end_type,
end_content:res?.end_content,
}
for(var f of res.files){
this.pictureList.push({
id:f.id,
url:f.url,
name:f.original_name
})
file_ids: res?.file_ids,
content: res?.content,
end_type: res?.end_type,
end_content: res?.end_content,
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids > 0 ? 1 : 1),
accept_department_ids: res?.accept_department_ids,
accept_admin_ids: res?.accept_admin_ids,
}
for (var f of res.files) {
this.pictureList.push({
id: f.id,
url: f.url,
name: f.original_name
})
}
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
submit() {
submit() {
let _files = []
if (this.pictureList.length > 0) {
for (var h of this.pictureList) {
@ -361,7 +363,7 @@
} else {
_files.push(h.id)
}
}
}
this.form.file_ids = _files
} else {
this.form.file_ids = []
@ -396,10 +398,10 @@
}
},
handleRemove(file, fileList) {
this.pictureList = fileList
this.pictureList = fileList
},
handlesuccess(response, file, fileList) {
this.pictureList = fileList
this.pictureList = fileList
},
},
watch: {
@ -419,13 +421,13 @@
}
</script>
<style scoped lang="scss">
::v-deep .type{
display: none;
}
<style scoped lang="scss">
::v-deep .type {
display: none;
}
.xy-table-item-label {
width: 160px;
width: 140px;
}
.img__delete {
@ -472,9 +474,9 @@
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
// ::v-deep .xy-table-item-label {
// width: 160px !important;
// }
::v-deep .el-date-editor .el-range-separator {
width: auto !important;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -5,48 +5,54 @@
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" clearable style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Select multiple filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status" placeholder="巡查状态">
<Select filterable clearable style='width:200px;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:200px;margin-right: 10px;' v-model="select.mission_id" placeholder="专项任务">
<Option v-for="item in missionList" :value="item.id">{{item.name}}</Option>
</Select>
<Button type="primary" @click="getList"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;" @click="$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button>
</div>
</slot>
</lx-header>
</div>
<!-- @cell-click="cellClicks" -->
<xy-table
:list="list"
: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 fixed="right" align='left' label="操作" width="260" header-align="center">
<el-table-column fixed="right" align='center' label="操作" min-width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button>
<!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'show')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="editorPatrol(scope.row.id,'editor')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'check')"></Button>
<Button 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,'accept')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'reform')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'confirm')"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button>
<!-- <Button v-if="scope.row.status==0||scope.row.status==8" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'check')"></Button>
<Button 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="showPatrol(scope.row.id,'show')"></Button>
<!-- <Button v-if="scope.row.status==0||scope.row.status==8" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'check')"></Button> -->
<Button v-if="scope.row.status==1" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leader')"></Button>
<Button v-if="scope.row.status==2" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'accept')"></Button>
<Button v-if="scope.row.status==3||scope.row.status==7" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'reform')"></Button>
<Button v-if="scope.row.status==4" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'confirm')"></Button>
<Button v-if="scope.row.status==9" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button> -->
<!-- <Button v-if="scope.row.status==2" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'accept')"></Button> -->
<!-- <Button v-if="scope.row.status==3||scope.row.status==7" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'reform')"></Button> -->
<!-- <Button v-if="scope.row.status==4" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'confirm')"></Button> -->
<Button v-if="scope.row.status==9" type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="showPatrol(scope.row.id,'leaderconfirm')"></Button>
<Poptip
<!-- <Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small" ghost>删除</Button>
</Poptip>
</Poptip> -->
</template>
</el-table-column>
</template>
@ -63,6 +69,7 @@
import {
listpatrol,del,
} from '@/api/task/patrol.js'
import {listunit} from '@/api/task/unit.js'
export default{
components:{
addPatrol,
@ -71,16 +78,21 @@
data(){
return{
my_name:'',
missionList:[],
select:{
keyword:'',
page:1,
page_size:10,
status:'',
myself:0,
mission_id:''
// myself_update:0
},
total:0,
statusList:[{
id:-1,
value:'已撤回'
},{
id:0,
value:'待审核'
},{
@ -118,7 +130,7 @@
fixed:'left',
width:240
},{
label:"上报日期",
label:"巡查日期",
prop:'date',
width:180,
},{
@ -226,9 +238,10 @@
if(this.$route.path){
let path = this.$route.path.split("_")
this.select.myself = path[1]
this.my_name = path[1]==1?'我的任务':'巡查上报'
this.my_name = path[1]==1?'我的任务':'检查问题'
}
this.getList()
this.getMissonList()
},
methods: {
async getList(){
@ -236,6 +249,14 @@
this.list = res.data
this.total = res.total
},
async getMissonList(){
const res = await listunit({
page:1,
page_size:999
})
this.missionList = res.data
},
pageChange(){},
editorPatrol(id,type){
@ -243,6 +264,11 @@
this.$refs.addPatrol.type= type
this.$refs.addPatrol.isShow = true
},
cellClicks(e){
this.$refs.showPatrol.id= e.row.id
this.$refs.showPatrol.isShow = true
},
showPatrol(id,type){
this.$refs.showPatrol.id= id
this.$refs.showPatrol.type= type
@ -278,4 +304,7 @@
/deep/ .el-icon-circle-close{
color:#fff
}
/* /deep/ .el-table__body tr.el-table__row--striped td {
background-color: #C0C4CC!important;
} */
</style>

@ -45,7 +45,8 @@
</template>
</span>
<span v-else>
{{(k.indexOf(".")>-1?item[k.split(".")[0]][k.split(".")[1]]:item[k])}}
<!-- {{k.indexOf(".")>-1?item[k.split(".")[0]][k.split(".")[1]]:item[k]}} -->
{{k.indexOf(".")>-1?(item[k.split(".")[0]]?item[k.split(".")[0]][k.split(".")[1]]:''):item[k]}}
</span>
</div>
</div>
@ -79,11 +80,13 @@
</div>
</div>
<span v-else>
{{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop])}}
<!-- {{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop]}} -->
{{item.prop.indexOf(".")>-1?(scope.row[item.prop.split(".")[0]]?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:''):scope.row[item.prop]}}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="220" header-align="center">
<el-table-column fixed="right" align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorUnit(scope.row.id,'editor')"></Button>
<Poptip
@ -129,7 +132,7 @@
</xy-table> -->
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<showPatrol ref='showPatrol'></showPatrol>
</div>
</template>
@ -241,13 +244,17 @@
}],
inspectionTable:{
'上报日期':'date',
'巡查日期':'date',
'状态':'status',
'问题类型':'ask.value',
'地点':'site.name',
'上报人':'admin.name',
},
statusList:[{
id:-1,
value:'已撤回'
},{
id:0,
value:'待审核'
},{

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/szhedao/app/safety-manage/safety-manage-service/public/admin/',
outputDir: '/Users/mac/Documents/朗业/2023/a-河道安全生产/safety-manage-service/public/admin/',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,

Loading…
Cancel
Save