master
lion 2 years ago
parent be4180d1e7
commit 9072baff6c

@ -33,6 +33,7 @@
"tinymce": "^5.10.7",
"view-design": "^4.7.0",
"vue": "2.6.10",
"vue-amap": "^0.5.10",
"vue-count-to": "^1.0.13",
"vue-matomo": "^4.2.0",
"vue-print-nb-jeecg": "^1.0.12",

@ -9,11 +9,12 @@
<script>
window._AMapSecurityConfig = {
securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec',
securityJsCode: 'ea31617664cd44f32434869f2d61e73f',
}
</script>
<script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=795a757114c371f42cee1f8efa527684&plugin=AMap.PlaceSearch'></script>
<script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=141565d3a276007d32febb533a2c8ad2&plugin=AMap.PlaceSearch'></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="https://cdn.staticfile.org/jsPlumb/2.11.1/js/jsplumb.min.js"></script>
</head>
<body>
<noscript>

@ -187,9 +187,12 @@ export default {
display: flex;
align-items: center;
margin-right: 80px;
&-label{
padding: 0 20px;
min-width: 120px;
text-align: right;
}
&-content{

@ -90,6 +90,29 @@ Vue.prototype.$integrateData = (target,value) => {
}
}
}
// 高德地图
import AMap from 'vue-amap';
Vue.use(AMap);
// 初始化vue-amap
AMap.initAMapApiLoader({
// 高德的key
key: '141565d3a276007d32febb533a2c8ad2',
// 插件集合 (插件按需引入)
plugin: ['AMap.Autocomplete','AMap.Geocoder','AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType',
'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.DistrictSearch','AMap.CircleMarker','AMap.Polyline'
// 'AMap.Object3DLayer', 'AMap.Object3D'
]
});
//高德的安全密钥
window._AMapSecurityConfig = {
securityJsCode: 'ea31617664cd44f32434869f2d61e73f',
}
// 解决地图刷新显示不出来
const amapKeys = Object.keys(localStorage).filter(key => key.match(/^_AMap_/))
amapKeys.forEach(key => {
// console.log(key)
localStorage.removeItem(key)
})
import VueMatomo from 'vue-matomo'

@ -0,0 +1,152 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="基础信息" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="搜索姓名" />
<Select v-model="select.team_id" style="width: 200px;margin-left: 10px;" placeholder="搜索队伍" clearable>
<Option v-for="item in listTeam" :key="item.id" :value="item.id">{{ item.mingcheng }}</Option>
</Select>
<Button type="primary" style="margin-left: 10px;" @click="getList"></Button>
<Button type="primary" style="margin-left: 10px;" @click="$refs['addBook'].type='add',$refs['addBook'].setlistTeam(listTeam),
$refs['addBook'].isShow=true">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" @page_sizeChange="e => select.page_size = e" @pageChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" @click="$refs['addBook'].type='editor',
$refs['addBook'].id=scope.row.id,
$refs['addBook'].setlistTeam(listTeam),
$refs['addBook'].isShow=true">编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addBook ref="addBook" @refresh="getList"></addBook>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import addBook from './components/addBook.vue'
export default {
components: {
addBook,
},
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: '',
table_name: 'books',
team_id:'',
},
total: 0,
list: [],
listTeam:[],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
}, {
label: '所在队伍',
prop: 'suozaiduiwu',
align: 'left',
}, {
label: '姓名',
prop: 'xingming',
align: 'left',
width: 120
}, {
label: '联系电话',
prop: 'lianxidianhua',
width: 120,
}, {
label: '创建日期',
prop: 'created_at',
width: 120,
formatter: (cell, data, value) => {
return value ? value.substring(0, 10) : ''
}
}],
}
},
created() {
this.getTeamList()
this.getList()
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [{
key:'team_id',
op:'eq',
value:this.select.team_id
},{
key:'xingming',
op:'eq',
value:this.select.keyword
}],
})
this.list = res.data
this.total = res.total
},
async getTeamList(){
const res = await index({
page: 1,
page_size: 10,
table_name: 'teams'
})
this.listTeam = res.data
},
pageChange(e) {
this.select.page = e
this.getList()
},
delRow(id) {
if (id) {
destroy({
id: id,
table_name: this.select.table_name,
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
}
}
</script>
<style >
</style>

@ -0,0 +1,174 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增巡查计划':'编辑巡查计划'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:suozaiduiwu>
<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.suozaiduiwu" style="width:300px" @change="changeTeam" placeholder="请选择">
<el-option
v-for="item in listTeam"
:key="item.id"
:label="item.mingcheng"
:value="item.mingcheng">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:xingming>
<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 style="width:300px" v-model="form.xingming"></el-input>
</div>
</div>
</template>
<template v-slot:lianxidianhua>
<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 style="width:300px" v-model="form.lianxidianhua"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show,
index
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'books',
listTeam:[],
form: {
team_id:'',
suozaiduiwu:'',
xingming:'',
lianxidianhua:'',
},
rules: {
suozaiduiwu:[{
required:true,
message:'请选择队伍'
}]
},
}
},
created() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
},
setlistTeam(e){
this.listTeam = e
},
async getTeamList(){
if(this.listTeam.length>0){
return
}
const res = await index({
page: 1,
page_size: 10,
table_name: 'teams'
})
this.listTeam = res.data
},
changeTeam(e){
console.log(e)
if(e){
this.listTeam.map(item=>{
if(item.mingcheng===e){
this.form.team_id = item.id
}
})
}else{
this.form.team_id = ''
}
},
submit() {
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.$emit('refresh')
this.isShow = false
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.$emit('refresh')
this.isShow = false
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label{
min-width:160px!important
}
</style>

@ -0,0 +1,151 @@
<template>
<div>
<div class="map" id="map" :style="{'height':mapHeight+'px'}"></div>
<div ref='infoWindow' id="infoWindow">
<i @click='closeWin' class="el-icon-close"></i>
<div v-for="item in openData">
<p>名称<span>{{item.mingcheng}}</span></p>
<p>队长<span>{{item.duizhang?item.duizhang:''}}</span></p>
<p>联系电话<span>{{item.lianxidianhua?item.lianxidianhua:''}}</span></p>
<p>人数<span>{{item.renshu?item.renshu:''}}</span></p>
</div>
</div>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
export default {
data() {
return {
zoom: 10,
center: [120.585294, 31.299758],
mapHeight: 0,
map: null,
makerList: [],
infoWindow: null,
openData: [],
mapList:[]
}
},
created() {
this.initHeight()
this.$nextTick(function() {
this.mapInit()
})
},
methods: {
initHeight() {
let winHeight = document.body.clientHeight
this.mapHeight = winHeight - 50 - 20
},
mapInit() {
this.map = new AMap.Map("map", {
center: this.center,
mapStyle: "amap://styles/bfb1bb3feb0db7082367abca96b8d214", //
zoom: this.zoom
});
this.infoWindow = new AMap.InfoWindow({
isCustom: true,
autoMove: true,
avoid: [20, 20, 20, 20],
content: this.$refs.infoWindow,
closeWhenClickMap: true,
offset: new AMap.Pixel(-10, -10)
})
this.getTeams()
console.log("map", this.map)
},
getTeams() {
index({
page: 1,
page_size: 9999,
table_name: 'teams'
}).then(res => {
let markers = []
if(res.data.length<1){
return
}
this.mapList = res.data
this.setMapMarker()
})
// this.list = res.data
},
//
setMapMarker() {
var that = this
// console.log("123",m.jingdu, m.weidu)
// console.log('456',gcj02towgs84(m.jingdu, m.weidu))
that.map.remove(that.makerList)
that.makerList = []
// this.map.clearMap();
let list = this.mapList.map((m) => {
return {
id: m.id, //id
name: m.mingcheng, //
// reside: m.reside,
// lnglat: [m.lon, m.lat],//
lnglat: [m.jingdu, m.weidu], //84
style: 0, //
};
});
this.mapList.forEach((item, index) => {
//
if (!item.jingdu || !item.weidu) {
return
}
let marker = new AMap.Text({
map: this.map,
text: item.mingcheng,
zIndex: 9999999,
offset: new AMap.Pixel(-13, -30),
position: [item.jingdu, item.weidu],
clickable: true,
extData: item.id,
style: {
'border': '1px solid red',
'padding': '0px 5px'
}
})
marker.on('click', (e) => {
this.openData = []
if (e.target.w.extData === item.id) {
this.openData.push(item)
}
this.infoWindow.open(this.map, e.target.getPosition())
}),
this.makerList.push(marker)
});
this.map.add(this.makerList)
},
closeWin() {
this.infoWindow.close()
},
},
}
</script>
<style>
#infoWindow {
position: relative;
}
#infoWindow>div {
background: #fff;
border: 1px solid red;
padding: 10px;
width: 180px;
}
/deep/ #infoWindow .el-icon-close {
position: absolute;
top: 5px;
right: 5px;
cursor: pointer;
}
</style>

@ -0,0 +1,268 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增巡查计划':'编辑巡查计划'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:wentileixing>
<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.wentileixing">
<el-radio :label="item.value" v-for="item in listQuestion">{{item.value}}</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:jianchariqi>
<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.jianchariqi" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jianchadidian>
<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 style="width:300px" v-model="form.jianchadidian"></el-input>
</div>
</div>
</template>
<template v-slot:shangbaoren>
<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 style="width:300px" v-model="form.shangbaoren"></el-input>
</div>
</div>
</template>
<template v-slot:jianyizhenggaikeshi>
<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.jianyizhenggaikeshi" filterable style="width: 300px;" placeholder="请选择建议整改科室">
<el-option v-for="item in listDep" :key="item.id" :label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:wentimiaoshu>
<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 type="textarea" style="width: 300px;" v-model="form.wentimiaoshu" ></el-input>
</div>
</div>
</template>
<template v-slot:zhenggaijianyi>
<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 type="textarea" style="width: 300px;" v-model="form.zhenggaijianyi" ></el-input>
</div>
</div>
</template>
<template v-slot:wentizhaopian>
<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" multiple list-type="picture-card" class='upload-demo' :file-list="fileList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {getparameteritem} from "@/api/system/dictionary.js"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
import {
listdept
} from "@/api/system/department.js"
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'flood_infos',
listQuestion:[],
listDep:[],
fileList:[],
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
form: {
wentileixing:'',
jianchariqi:'',
jianchadidian:'',
shangbaoren:'',
jianyizhenggaikeshi:'',
wentimiaoshu:'',
zhenggaijianyi:'',
wentizhaopian:[],
zhuangtai:''
},
rules: {
},
}
},
created() {
this.uploadOther.token = getToken();
this.loadQuestion()
this.loadDeptOptions()
this.form.nianfen = this.$moment().format('yyyy')
},
methods: {
loadQuestion(){
getparameteritem("questionType").then(res=>{
this.listQuestion = res.detail
})
},
loadDeptOptions() {
listdept().
then((res) => {
this.listDep = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
handleRemove(file, fileList) {
this.fileList = fileList
},
handlesuccess(response, file, fileList) {
this.fileList = fileList
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
if(res.wentizhaopian_upload_details&&res.wentizhaopian_upload_details.length>0){
res.wentizhaopian_upload_details.map(item=>{
this.fileList.push({
url:item.url,
id:item.id,
name:item.original_name
})
})
}
},
submit() {
let _files = []
if (this.fileList.length > 0) {
for (var h of this.fileList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.wentizhaopian = _files
} else {
this.form.wentizhaopian = []
}
console.log("form",this.form)
// return
if (this.type === 'add') {
this.form.zhuangtai = '待确认'
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.$emit('refresh')
this.isShow = false
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.$emit('refresh')
this.isShow = false
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.fileList=[]
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label{
min-width:160px!important
}
</style>

@ -0,0 +1,225 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增巡查计划':'编辑巡查计划'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:nianfen>
<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.nianfen" type="year" placeholder="选择日期"
value-format="yyyy">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jianchaleixing>
<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.jianchaleixing">
<el-radio :label="item.value" v-for="item in listCheck">{{item.value}}</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:kaishiriqi>
<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.kaishiriqi" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jieshuriqi>
<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.jieshuriqi" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jihuashuoming>
<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 type="textarea" style="width: 300px;" v-model="form.jihuashuoming" ></el-input>
</div>
</div>
</template>
<template v-slot:fujian>
<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" multiple class='upload-demo' :file-list="fileList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {getparameteritem} from "@/api/system/dictionary.js"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'flood_checks',
listCheck:[],
fileList:[],
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
form: {
nianfen:'',
jianchaleixing:'',
kaishiriqi:'',
jieshuriqi:'',
jihuashuoming:'',
fujian:''
},
rules: {
},
}
},
created() {
this.uploadOther.token = getToken();
this.loadCheck()
this.form.nianfen = this.$moment().format('yyyy')
},
methods: {
loadCheck(){
getparameteritem("checkType").then(res=>{
this.listCheck = res.detail
})
},
handleRemove(file, fileList) {
this.fileList = fileList
},
handlesuccess(response, file, fileList) {
this.fileList = fileList
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
if(res.fujian_upload_details.length>0){
res.fujian_upload_details.map(item=>{
this.fileList.push({
url:item.url,
id:item.id,
name:item.original_name
})
})
}
},
submit() {
let _files = []
if (this.fileList.length > 0) {
for (var h of this.fileList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.fujian = _files
} else {
this.form.fujian = []
}
console.log("form",this.form)
// return
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.$emit('refresh')
this.isShow = false
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.$emit('refresh')
this.isShow = false
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.fileList=[]
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,224 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'新增巡查计划':'编辑巡查计划'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:nianfen>
<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.nianfen" type="year" placeholder="选择日期"
value-format="yyyy">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jianchaleixing>
<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.jianchaleixing">
<el-radio :label="item.value" v-for="item in listCheck">{{item.value}}</el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:kaishiriqi>
<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.kaishiriqi" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jieshuriqi>
<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.jieshuriqi" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:jihuashuoming>
<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 type="textarea" style="width: 300px;" v-model="form.jihuashuoming" ></el-input>
</div>
</div>
</template>
<template v-slot:fujian>
<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" multiple class='upload-demo' :file-list="fileList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {getparameteritem} from "@/api/system/dictionary.js"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'flood_checks',
listCheck:[],
fileList:[],
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
form: {
flood_check_id:'',
zuming:'',
lingdui:'',
zuyuan:'',
jianchaneirong:'',
},
rules: {
},
}
},
created() {
this.uploadOther.token = getToken();
this.loadCheck()
this.form.nianfen = this.$moment().format('yyyy')
},
methods: {
loadCheck(){
getparameteritem("checkType").then(res=>{
this.listCheck = res.detail
})
},
handleRemove(file, fileList) {
this.fileList = fileList
},
handlesuccess(response, file, fileList) {
this.fileList = fileList
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
if(res.fujian_upload_details.length>0){
res.fujian_upload_details.map(item=>{
this.fileList.push({
url:item.url,
id:item.id,
name:item.original_name
})
})
}
},
submit() {
let _files = []
if (this.fileList.length > 0) {
for (var h of this.fileList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.fujian = _files
} else {
this.form.fujian = []
}
console.log("form",this.form)
// return
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.$emit('refresh')
this.isShow = false
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.$emit('refresh')
this.isShow = false
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.fileList=[]
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,405 @@
<template>
<div>
<xy-dialog ref="dialog" :width='40' :is-show.sync="isShow" type="form" :title="type==='add'?'巡查计划':'巡查计划'"
:form="form" :rules="rules">
<template v-slot:wentileixing>
<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 style="width:300px">{{form.wentileixing}}</div>
</div>
</div>
</template>
<template v-slot:jianchariqi>
<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 style="width:300px">{{form.jianchariqi}}</div>
</div>
</div>
</template>
<template v-slot:jianchadidian>
<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 style="width:300px">{{form.jianchadidian}}</div>
</div>
</div>
</template>
<template v-slot:shangbaoren>
<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 style="width:300px">{{form.shangbaoren}}</div>
</div>
</div>
</template>
<template v-slot:jianyizhenggaikeshi>
<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 v-for="item in listDep">
<div style="width:300px" v-if="form.jianyizhenggaikeshi===item.id">
{{item.name}}
</div>
</div>
</div>
</div>
</template>
<template v-slot:wentimiaoshu>
<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 style="width:300px">{{form.wentimiaoshu}}</div>
</div>
</div>
</template>
<template v-slot:zhenggaijianyi>
<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 style="width:300px">{{form.zhenggaijianyi}}</div>
</div>
</div>
</template>
<template v-slot:wentizhaopian>
<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-image v-for="url in fileList"
style="width: 146px; height: 146px;display:inline-block;margin-right:5px;margin-bottom:5px"
:src="url.url">
</el-image>
</div>
</div>
</template>
<template v-slot:shifouxuyaozhenggai>
<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.shifouxuyaozhenggai" v-if="type==='check'">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
<div v-else style="width:300px">{{form.shifouxuyaozhenggai||'-'}}</div>
</div>
</div>
</template>
<template v-slot:shijizhenggaikeshi>
<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-if="type==='check'" v-model="form.shijizhenggaikeshi" filterable style="width: 300px;"
placeholder="请选择整改科室">
<el-option v-for="item in listDep" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<div v-else v-for="item in listDep">
<div style="width:300px" v-if="form.shijizhenggaikeshi===item.id">
{{item.name}}
</div>
</div>
</div>
</div>
</template>
<template v-slot:wanchengriqi>
<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-if="type==='need'" v-model="form.wanchengriqi" type="date"
placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker>
<div v-else style="width:300px">{{form.wanchengriqi||'-'}}</div>
</div>
</div>
</template>
<template v-slot:wanchengqingkuang>
<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 type="textarea" v-if="type==='need'" style="width: 300px;"
v-model="form.wanchengqingkuang"></el-input>
<div v-else style="width:300px">{{form.wanchengqingkuang||'-'}}</div>
</div>
</div>
</template>
<template v-slot:wanchengzhaopian>
<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" v-if="type==='need'" multiple list-type="picture-card" class='upload-demo'
:file-list="fileNeedList" ref="pictureUpload" style="width:400px" :auto-upload="true" :data="uploadOther"
:on-success="handleNeedsuccess" :on-remove="handleNeedRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<el-image v-else v-for="url in fileNeedList"
style="width: 146px; height: 146px;display:inline-block;margin-right:5px;margin-bottom:5px"
:src="url.url">
</el-image>
</div>
</div>
</template>
<template v-slot:shenhe>
<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-if="type==='complete'" v-model="form.shenhe">
<el-radio label="整改完成">整改完成</el-radio>
<el-radio label="重新整改">重新整改</el-radio>
</el-radio-group>
<div v-else style="width:300px">{{form.shenhe||'-'}}</div>
</div>
</div>
</template>
<template v-slot:footerContent>
<Button type="primary" v-if="type!='end'"
style='margin-left:5px;margin-bottom:5px;' @click="submit">确认</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {
getparameteritem
} from "@/api/system/dictionary.js"
import {
Message
} from 'element-ui'
import {
getToken
} from '@/utils/auth'
import {
listdept
} from "@/api/system/department.js"
export default {
data() {
// check end need complete need end
return {
isShow: false,
type: 'add',
id: '',
tableName: 'flood_infos',
listQuestion: [],
listDep: [],
fileList: [],
fileNeedList: [],
uploadOther: {
token: ""
},
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
form: {
wentileixing: '',
jianchariqi: '',
jianchadidian: '',
shangbaoren: '',
jianyizhenggaikeshi: '',
wentimiaoshu: '',
zhenggaijianyi: '',
wentizhaopian: [],
//
shifouxuyaozhenggai: '',
shijizhenggaikeshi: '',
// /
wanchengriqi: '',
wanchengqingkuang: '',
wanchengzhaopian: [],
//
shenhe: '',
zhuangtai: ''
},
rules: {
},
}
},
created() {
this.uploadOther.token = getToken();
this.loadQuestion()
this.loadDeptOptions()
this.form.nianfen = this.$moment().format('yyyy')
},
methods: {
loadQuestion() {
getparameteritem("questionType").then(res => {
this.listQuestion = res.detail
})
},
loadDeptOptions() {
listdept().
then((res) => {
this.listDep = res;
}).catch(error => {
console.log(error)
reject(error)
})
},
handleRemove(file, fileList) {
this.fileList = fileList
},
handlesuccess(response, file, fileList) {
this.fileList = fileList
},
handleNeedRemove(file, fileList) {
this.fileNeedList = fileList
},
handleNeedsuccess(response, file, fileList) {
this.fileNeedList = fileList
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form, res)
if (res.wentizhaopian_upload_details && res.wentizhaopian_upload_details.length > 0) {
res.wentizhaopian_upload_details.map(item => {
this.fileList.push({
url: item.url,
id: item.id,
name: item.original_name
})
})
}
if (res.wanchengzhaopian_upload_details && res.wanchengzhaopian_upload_details.length > 0) {
res.wanchengzhaopian_upload_details.map(item => {
this.fileNeedList.push({
url: item.url,
id: item.id,
name: item.original_name
})
})
}
},
submit() {
let _files = []
let need_files = []
if (this.fileList.length > 0) {
for (var h of this.fileList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.wentizhaopian = _files
} else {
this.form.wentizhaopian = []
}
if (this.fileNeedList.length > 0) {
for (var h of this.fileNeedList) {
if (h.response) {
need_files.push(h.response.id)
} else {
need_files.push(h.id)
}
}
this.form.wanchengzhaopian = need_files
} else {
this.form.wanchengzhaopian = []
}
// check end need complete need end
switch (this.type) {
case 'check':
if(this.form.shifouxuyaozhenggai==='是'){
this.form.zhuangtai = '待整改'
}else{
this.form.zhuangtai = '无需整改'
}
break;
case 'need':
this.form.zhuangtai = '已整改'
break;
case 'complete':
if(this.form.shenhe==='整改完成'){
this.form.zhuangtai = '已完成'
}else{
this.form.zhuangtai = '重新整改'
}
break;
}
console.log("this.form",this.form)
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '操作成功'
})
this.$emit('refresh')
this.isShow = false
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.type = ''
this.fileList = []
this.fileNeedList = []
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label {
min-width: 160px !important
}
</style>

@ -0,0 +1,187 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="检查整改" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" /> -->
<Button type="primary" @click="getList"></Button>
<Button type="primary" style="margin-left: 10px;"
@click="$refs['addFlood'].type='add',
$refs['addFlood'].isShow=true">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" @page_sizeChange="e => select.page_size = e" @pageChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small"
@click="$refs['addFlood'].type='editor',
$refs['addFlood'].id=scope.row.id,
$refs['addFlood'].isShow=true">编辑</Button>
<template v-for="(item,key) of statusLabel">
<span v-if="key===scope.row.zhuangtai">
<Button type="primary" size="small" style="margin-left: 10px;"
@click="$refs['showFlood'].type=item['type'],
$refs['showFlood'].id=scope.row.id,
$refs['showFlood'].isShow=true">{{item['name']}}</Button>
</span>
</template>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addFlood ref="addFlood" @refresh="getList"></addFlood>
<showFlood ref="showFlood" @refresh="getList"></showFlood>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import addFlood from './components/addFlood.vue'
import showFlood from './components/showFlood.vue'
export default {
components:{
addFlood,
showFlood
},
data() {
// check end need complete need end
return {
select: {
page: 1,
page_size: 10,
keyword: '',
table_name:'flood_infos'
},
total: 0,
list: [],
statusLabel:{
"待确认":{
type:"check",
name:'确认'
},
"无需整改":{
type:"end",
name:'查看'
},
"待整改":{
type:"need",
name:'提交'
},
"已整改":{
type:"complete",
name:'审核'
},
"重新整改":{
type:'need',
name:'提交'
},
"已完成":{
type:"end",
name:'查看'
}
},
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},{
label: '状态',
prop: 'zhuangtai',
width: 120,
},{
label: '问题类型',
prop: 'wentileixing'
},{
label: '检查日期',
prop: 'jianchariqi',
width: 120,
},{
label: '上报人',
prop: 'shangbaoren',
width: 120,
},{
label: '建议整改科室',
prop: 'jianyizhenggaikeshi',
width: 120,
},{
label: '检查地点',
prop: 'jianchadidian',
width: 120,
},{
label: '问题照片',
prop: 'wentizhaopian',
width: 120,
},{
label: '整改建议',
prop: 'wentimiaoshu',
width: 120,
},{
label: '问题描述',
prop: 'zhenggaijianyi',
width: 120,
},{
label: '创建日期',
prop: 'created_at',
width: 120,
formatter:(cell,data,value)=>{
return value?value.substring(0,10):''
}
}],
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [],
})
this.list = res.data
this.total = res.total
},
pageChange(e) {
this.select.page = e
this.getList()
},
delRow(id){
if(id){
destroy({
id: id,
table_name: this.select.table_name,
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
}
}
</script>
<style>
</style>

@ -0,0 +1,139 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="防汛计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" /> -->
<Button type="primary" @click="getList"></Button>
<Button type="primary" style="margin-left: 10px;" @click="$refs['addPlan'].type='add',$refs['addPlan'].isShow=true"></Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" @page_sizeChange="e => select.page_size = e" @pageChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small"
@click="$refs['addPlan'].type='editor',
$refs['addPlan'].id=scope.row.id,
$refs['addPlan'].isShow=true">编辑</Button>
<Button type="primary" size="small"
@click="$refs['addTeam'].type='editor',
$refs['addTeam'].id=scope.row.id,
$refs['addTeam'].isShow=true">小组</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addPlan ref="addPlan" @refresh="getList"></addPlan>
<addTeam ref="addTeam"></addTeam>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import addPlan from './components/addPlan.vue'
import addTeam from './components/addTeam.vue'
export default {
components:{
addPlan,
addTeam
},
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: '',
table_name:'flood_checks'
},
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},{
label: '年份',
prop: 'nianfen',
width: 120,
},{
label: '检查类型',
prop: 'jianchaleixing'
},{
label: '开始日期',
prop: 'kaishiriqi',
width: 120,
},{
label: '结束日期',
prop: 'jieshuriqi',
width: 120,
},{
label: '创建人',
prop: 'admin.name',
width: 120,
},{
label: '创建日期',
prop: 'created_at',
width: 120,
formatter:(cell,data,value)=>{
return value?value.substring(0,10):''
}
}],
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [],
})
this.list = res.data
console.log("this.list",this.list)
this.total = res.total
},
pageChange(e) {
this.select.page = e
this.getList()
},
delRow(id){
if(id){
destroy({
id: id,
table_name: this.select.table_name,
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
}
}
</script>
<style>
</style>

@ -0,0 +1,229 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增防汛队伍':'编辑防汛队伍'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:mingcheng>
<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 style="width:300px" v-model="form.mingcheng"></el-input>
</div>
</div>
</template>
<template v-slot:gongsi>
<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 style="width:300px" v-model="form.gongsi"></el-input>
</div>
</div>
</template>
<template v-slot:fuzeren>
<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 style="width:300px" v-model="form.fuzeren"></el-input>
</div>
</div>
</template>
<template v-slot:duizhang>
<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 style="width:300px" v-model="form.duizhang"></el-input>
</div>
</div>
</template>
<template v-slot:lianxidianhua>
<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 style="width:300px" v-model="form.lianxidianhua"></el-input>
</div>
</div>
</template>
<template v-slot:renshu>
<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 style="width:300px" v-model="form.renshu"></el-input>
</div>
</div>
</template>
<template v-slot:quyu>
<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 style="width: 300px;" v-model="form.quyu" ></el-input>
</div>
</div>
</template>
<template v-slot:dizhi>
<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">
<avue-input-map v-model="mapform" :params="mapparams" style="width:300px" placeholder="请选择地图"></avue-input-map>
</div>
</div>
</template>
<template v-slot:jingdu>
<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 style="width: 300px;" disabled v-model="form.jingdu" ></el-input>
</div>
</div>
</template>
<template v-slot:weidu>
<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 style="width: 300px;" disabled v-model="form.weidu" ></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'teams',
mapparams:{
zoom: 11,
},
mapform:[] ,
form: {
mingcheng:'',
gongsi:'',
fuzeren:'',
duizhang:'',
lianxidianhua:'',
renshu:'',
quyu:'',
dizhi:'',
jingdu:'',
weidu:'',
duiyuan:[]
},
rules: {
mingcheng:[{
required:true,
message:'请填写队伍名称'
}]
},
}
},
created() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form,res)
this.mapform = [res.jingdu,res.weidu,res.dizhi]
},
submit() {
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.$emit('refresh')
this.isShow = false
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.$emit('refresh')
this.isShow = false
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.type = ''
this.mapform = []
this.$refs['dialog'].reset()
}
},
mapform(newVal, oldVal) {
console.log(newVal)
this.form.jingdu = newVal[0];
this.form.weidu = newVal[1];
this.form.dizhi = newVal[2];
},
}
}
</script>
<style scoped lang="scss">
::v-deep .xy-table-item-label{
min-width:160px!important
}
</style>

@ -0,0 +1,147 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="基础信息" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<!-- <Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" /> -->
<Button type="primary" @click="getList"></Button>
<Button type="primary" style="margin-left: 10px;" @click="$refs['addTeam'].type='add',
$refs['addTeam'].isShow=true">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" @page_sizeChange="e => select.page_size = e" @pageChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" @click="$refs['addTeam'].type='editor',
$refs['addTeam'].id=scope.row.id,
$refs['addTeam'].isShow=true">编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addTeam ref="addTeam" @refresh="getList"></addTeam>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import addTeam from './components/addTeam.vue'
export default {
components: {
addTeam,
},
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: '',
table_name: 'teams'
},
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
}, {
label: '队伍名称',
prop: 'mingcheng',
width: 240,
align: 'left',
fixed: 'left'
}, {
label: '公司',
prop: 'gongsi',
align: 'left',
width: 240
}, {
label: '负责人',
prop: 'fuzeren',
width: 120,
}, {
label: '队长',
prop: 'duizhang',
width: 120,
}, {
label: '联系电话',
prop: 'lianxidianhua',
width: 120,
}, {
label: '人数',
prop: 'renshu',
width: 120,
}, {
label: '区域',
prop: 'quyu',
width: 120,
}, {
label: '地址',
prop: 'dizhi',
width: 120,
}, {
label: '创建日期',
prop: 'created_at',
width: 120,
formatter: (cell, data, value) => {
return value ? value.substring(0, 10) : ''
}
}],
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [],
})
this.list = res.data
this.total = res.total
},
pageChange(e) {
this.select.page = e
this.getList()
},
delRow(id) {
if (id) {
destroy({
id: id,
table_name: this.select.table_name,
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
}
}
</script>
<style>
</style>
Loading…
Cancel
Save