master
parent
4eacde84d9
commit
238e96e9b4
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listdaily(data) {
|
||||
return request({
|
||||
url: '/api/admin/daily-inspection/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/daily-inspection/show',
|
||||
method: 'get',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/daily-inspection/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/daily-inspection/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/daily-inspection/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listwade(data) {
|
||||
return request({
|
||||
url: '/api/admin/water-item/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/water-item/show',
|
||||
method: 'get',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/water-item/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/water-item/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/water-item/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listaccount(data) {
|
||||
return request({
|
||||
url: '/api/admin/account/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/account/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/account/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/account/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/account/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listarea(data) {
|
||||
return request({
|
||||
url: '/api/admin/area/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/area/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/area/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/area/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/area/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listsite(data) {
|
||||
return request({
|
||||
url: '/api/admin/site/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/site/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/site/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/site/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/site/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listunit(data) {
|
||||
return request({
|
||||
url: '/api/admin/unit/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/unit/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/unit/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function store(data) {
|
||||
return request({
|
||||
url: '/api/admin/unit/store',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/unit/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listcommon(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/show',
|
||||
method: 'get',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/update-status',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listcommon(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/update-status',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listcommon(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/index',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/show',
|
||||
method: 'post',
|
||||
params: { id }
|
||||
})
|
||||
}
|
||||
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/update-status',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: '/api/admin/common-inspection/destroy',
|
||||
method: 'get',
|
||||
params:{ id }
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,514 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="日常监督考核" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else-if="column.type=='status'">
|
||||
<el-tag v-if="scope.row[column.field]==1">无异常</el-tag>
|
||||
<el-tag v-if="scope.row[column.field]==2" type="success">已处理</el-tag>
|
||||
<el-tag v-if="scope.row[column.field]==3" type="danger">未处理</el-tag>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="考核编辑" :visible.sync="dialogFormVisible" width="60%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查项目" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写巡查项目" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查记录" prop="content">
|
||||
<el-input type="textarea" v-model="form.content" placeholder="请填写巡查记录" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="现场照片" prop="files_list">
|
||||
<el-upload action="/api/admin/upload-file" list-type="picture-card" :file-list="filesList" ref="pictureUpload"
|
||||
:limit="1" :auto-upload="true" :data="uploadOther"
|
||||
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,1)}">
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
</span>
|
||||
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||
<i class="el-icon-delete"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="normalstatus">
|
||||
<el-radio :label="1" >无异常</el-radio>
|
||||
<el-radio :label="2" >有异常</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="normalstatus==2">
|
||||
<el-form-item label="异常情况" prop="status">
|
||||
<el-select v-model="otherstatus" placeholder="请选择异常情况" style="width:100%">
|
||||
<el-option v-for="item in statusoption" :key="item.value" :label="item.value"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="otherstatus==2&&normalstatus==2">
|
||||
<el-form-item label="处理记录" prop="deal_content">
|
||||
<el-input type="textarea" v-model="form.deal_content" placeholder="请填写处理记录" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="otherstatus==2&&normalstatus==2">
|
||||
<el-form-item label="处理后照片" prop="deal_files_list">
|
||||
<el-upload action="/api/admin/upload-file" list-type="picture-card" :file-list="dealFilesList"
|
||||
ref="pictureUploads" :limit="3" :auto-upload="true" :data="uploadOther"
|
||||
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,2)}">
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
</span>
|
||||
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||
<i class="el-icon-delete"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="otherstatus==3&&normalstatus==2">
|
||||
<el-form-item label="定位" prop="address">
|
||||
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform" ></avue-input-map>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="otherstatus==3&&normalstatus==2">
|
||||
<el-form-item label="经度" prop="address">
|
||||
<el-input disabled="" v-model="form.deal_longitude" placeholder="经度" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="otherstatus==3&&normalstatus==2">
|
||||
<el-form-item label="纬度" prop="address">
|
||||
<el-input disabled="" v-model="form.deal_latitude" placeholder="纬度" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
import {
|
||||
listdaily,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/assess/daily.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
import AvueMap from 'avue-plugin-map'
|
||||
export default {
|
||||
components: {
|
||||
LxHeader,
|
||||
AvueMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
mapparams:{
|
||||
zoom: 11,
|
||||
},
|
||||
mapform:[] ,
|
||||
form: {
|
||||
name:"",
|
||||
content:"",
|
||||
status:1,
|
||||
deal_content:"",
|
||||
deal_longitude:"",
|
||||
deal_latitude:"",
|
||||
address:"",
|
||||
files_list:"",
|
||||
deal_files_list:""
|
||||
},
|
||||
normalstatus:1,
|
||||
otherstatus:2,
|
||||
filesList:[],
|
||||
dealFilesList:[],
|
||||
disabled:false,
|
||||
uploadOther:{
|
||||
token:""
|
||||
},
|
||||
|
||||
statusoption:[{
|
||||
id:2,
|
||||
value:"可现场处理",
|
||||
},{
|
||||
id:3,
|
||||
value:"不可现场处理",
|
||||
}],
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写名称',
|
||||
trigger: 'blur',
|
||||
}]
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "名称",
|
||||
type: "string",
|
||||
align: "left"
|
||||
},
|
||||
|
||||
{
|
||||
field: "status",
|
||||
title: "状态",
|
||||
type: "status",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.uploadOther.token = getToken();
|
||||
this.initLoad();
|
||||
this.load();
|
||||
|
||||
},
|
||||
watch:{
|
||||
// 'mapform':(val){
|
||||
// console.log(mapform)
|
||||
// }
|
||||
mapform(newVal, oldVal) {
|
||||
this.form.deal_longitude = newVal[0];
|
||||
this.form.deal_latitude = newVal[1];
|
||||
this.form.address = newVal[2];
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listdaily({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
that.normalstatus = result.status
|
||||
that.otherstatus = result.status
|
||||
if(result.status==3){
|
||||
that.normalstatus = 2
|
||||
that.mapform = [
|
||||
result.deal_longitude,
|
||||
result.deal_latitude,
|
||||
result.address
|
||||
]
|
||||
}
|
||||
|
||||
let _files = [];
|
||||
for (var mod of result.daily_inspection_files) {
|
||||
let m = Object.assign({}, mod);
|
||||
m.url = mod.files.url;
|
||||
m.id = mod.files.id;
|
||||
m.photoType = "before";
|
||||
_files.push(m);
|
||||
}
|
||||
that.filesList = _files;
|
||||
|
||||
let _filesafter = [];
|
||||
for (var mod of result.daily_inspection_deal_files) {
|
||||
let m = Object.assign({}, mod);
|
||||
m.url = mod.files.url;
|
||||
m.id = mod.files.id;
|
||||
m.photoType = "after";
|
||||
_filesafter.push(m);
|
||||
}
|
||||
that.dealFilesList = _filesafter;
|
||||
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var that = this;
|
||||
that.info(obj);
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
that.form.status = that.normalstatus
|
||||
if(this.otherstatus==3){
|
||||
that.form.status = that.otherstatus;
|
||||
}
|
||||
|
||||
var listUrlbefore=[]
|
||||
for (var m of this.filesList) {
|
||||
m.photoType = "before";
|
||||
if (m.response)
|
||||
listUrlbefore.push({
|
||||
"upload_id": m.response.id
|
||||
});
|
||||
else
|
||||
listUrlbefore.push({
|
||||
"upload_id": m.id
|
||||
});
|
||||
}
|
||||
this.form.files_list = listUrlbefore;
|
||||
|
||||
let listUrlafter = [];
|
||||
for (var m of this.dealFilesList) {
|
||||
if (m.response)
|
||||
listUrlafter.push({
|
||||
"upload_id": m.response.id
|
||||
});
|
||||
else
|
||||
listUrlafter.push({
|
||||
"upload_id": m.upload_id
|
||||
});
|
||||
}
|
||||
this.form.deal_files_list = listUrlafter
|
||||
|
||||
|
||||
// console.log(that.form);
|
||||
// return;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
that.dealFilesList = [];
|
||||
that.filesList = [];
|
||||
this.$refs[formName].resetFields();
|
||||
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleRemove(file) {
|
||||
if (file.photoType == "before") {
|
||||
for (var i = 0; i < this.filesList.length; i++) {
|
||||
if (this.filesList[i].url == file.url) {
|
||||
this.filesList.splice(i, 1)
|
||||
}
|
||||
}
|
||||
} else if (file.photoType == "after") {
|
||||
for (var i = 0; i < this.dealFilesList.length; i++) {
|
||||
if (this.dealFilesList[i].url == file.url) {
|
||||
this.dealFilesList.splice(i, 1)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handlesuccess(response, file, fileList, index) {
|
||||
if (index == 1) {
|
||||
// var listUrl=[]
|
||||
// for (var m of fileList) {
|
||||
// m.photoType = "before";
|
||||
// if (m.response)
|
||||
// listUrl.push({
|
||||
// "upload_id": m.response.id
|
||||
// });
|
||||
// else
|
||||
// listUrl.push({
|
||||
// "upload_id": m.id
|
||||
// });
|
||||
// }
|
||||
this.filesList = fileList;
|
||||
// this.form.files_list = listUrl;
|
||||
} else {
|
||||
let listUrl = [];
|
||||
|
||||
// for (var m of fileList) {
|
||||
// m.photoType = "after";
|
||||
// if (m.response)
|
||||
// listUrl.push({
|
||||
// "upload_id": m.response.id
|
||||
// });
|
||||
// else
|
||||
// listUrl.push({
|
||||
// "upload_id": m.id
|
||||
// });
|
||||
// }
|
||||
this.dealFilesList = fileList
|
||||
// this.form.deal_files_list = listUrl
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="巡查养护账号" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="账号编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="账号" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写账号" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="密码" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写密码" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查养护组" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查养护组" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属片区" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写所属片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属养护单位" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写所属养护单位" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listaccount,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/account.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "片区名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "巡查养护单位",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "link_mobile",
|
||||
title: "账号",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "link_mobile",
|
||||
title: "巡查养护组",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "提交人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listaccount({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="片区管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="片区编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="片区名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写片区名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系人" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写联系人" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系号码" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写联系号码" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listarea,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/area.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "片区名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "联系人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "link_mobile",
|
||||
title: "联系号码",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "提交人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listarea({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="在建工地" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="单位编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工地名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写工地名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工地编号" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写工地编号" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工地类型" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写工地类型" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="工地状态" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写工地状态" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系人" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写联系人" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系号码" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写联系号码" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="定位" prop="address">
|
||||
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform" ></avue-input-map>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经度" prop="longitude">
|
||||
<el-input disabled="" v-model="form.longitude" placeholder="经度" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="纬度" prop="address">
|
||||
<el-input disabled="" v-model="form.latitude" placeholder="纬度" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listsite,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/site.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
import AvueMap from 'avue-plugin-map'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader,
|
||||
AvueMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
mapparams:{
|
||||
zoom: 11,
|
||||
},
|
||||
mapform:[] ,
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "工地地址",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "工地编号",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "link_mobile",
|
||||
title: "工地类型",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "联系人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "联系电话",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "状态",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "提交人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
// this.load();
|
||||
|
||||
},
|
||||
watch:{
|
||||
// 'mapform':(val){
|
||||
// console.log(mapform)
|
||||
// }
|
||||
mapform(newVal, oldVal) {
|
||||
this.form.longitude = newVal[0];
|
||||
this.form.latitude = newVal[1];
|
||||
this.form.address = newVal[2];
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listsite({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="巡查养护单位" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="单位编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写单位名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系人" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写联系人" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系号码" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写联系号码" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listunit,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/unit.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "单位名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "联系人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "link_mobile",
|
||||
title: "联系号码",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "person",
|
||||
title: "提交人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listunit({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="养护计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="养护计划编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护计划名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写养护计划名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护项目" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写养护项目" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护片区" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="循环机制" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护周期" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护责任人" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listarea,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/area.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "项目",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "片区",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "频率",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "状态",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "周期",
|
||||
type: "string",
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "责任人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
// this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listarea({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="养护列表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="养护计划编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护计划名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写养护计划名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护项目" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写养护项目" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护片区" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="循环机制" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护周期" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="养护责任人" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写养护片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listarea,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/area.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "项目",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "片区",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "频率",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "状态",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "周期",
|
||||
type: "string",
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "责任人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
// this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listarea({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="巡查计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="巡查计划编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查计划名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写巡查计划名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查项目" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写巡查项目" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查片区" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="循环机制" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查周期" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查责任人" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listarea,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/area.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "项目",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "片区",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "频率",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "状态",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "周期",
|
||||
type: "string",
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "责任人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
// this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listarea({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div style="padding: 0px 20px">
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="巡查列表" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
||||
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
||||
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
<div ref="lxTable">
|
||||
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
||||
<el-table-column type="index" width="50" label="序号" align="center"> </el-table-column>
|
||||
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
||||
:label="column.title" :width="column.width">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="column.type=='opt'">
|
||||
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
||||
style="margin-left: 10px;">编辑</Button>
|
||||
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
||||
</div>
|
||||
<div v-else>{{scope.row[column.field]}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination">
|
||||
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
||||
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="巡查计划编辑" :visible.sync="dialogFormVisible" width="40%">
|
||||
<div class="dialogConcent">
|
||||
<el-scrollbar style="flex: 1">
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查计划名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请填写巡查计划名称" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查项目" prop="link_name">
|
||||
<el-input v-model="form.link_name" placeholder="请填写巡查项目" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查片区" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="循环机制" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查周期" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="巡查责任人" prop="link_mobile">
|
||||
<el-input v-model="form.link_mobile" placeholder="请填写巡查片区" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请填写备注" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('form')">取 消</el-button>
|
||||
<el-button type="primary" v-preventReClick @click="submitForm('form')">保存</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listarea,
|
||||
get,
|
||||
store,
|
||||
save,
|
||||
del
|
||||
} from '../../api/basic/area.js'
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LxHeader
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 0,
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: "120px",
|
||||
tableData: [],
|
||||
tableHeight: 0,
|
||||
searchFields: {
|
||||
KeyWord: ""
|
||||
},
|
||||
paginations: {
|
||||
page: 1,
|
||||
page_size: 15,
|
||||
total: 0
|
||||
},
|
||||
form: {
|
||||
name:"",
|
||||
link_name:"",
|
||||
link_mobile:"",
|
||||
remark:"",
|
||||
department_id:1,
|
||||
admin_id:1
|
||||
},
|
||||
|
||||
rules: {
|
||||
name:[{
|
||||
required: true,
|
||||
message: '请填写片区名称',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_name:[{
|
||||
required: true,
|
||||
message: '请填写联系人',
|
||||
trigger: 'blur',
|
||||
}],
|
||||
link_mobile:[{
|
||||
required: true,
|
||||
message: '请填写联系号码',
|
||||
trigger: 'blur',
|
||||
},{ pattern: /^1[3456789]\d{9}$/,
|
||||
message: '手机号码格式不正确',
|
||||
trigger: 'blur' ,
|
||||
}],
|
||||
|
||||
|
||||
},
|
||||
|
||||
columns: [{
|
||||
field: "name",
|
||||
title: "名称",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "项目",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "片区",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "频率",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "状态",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "周期",
|
||||
type: "string",
|
||||
},
|
||||
|
||||
{
|
||||
field: "link_name",
|
||||
title: "责任人",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "date",
|
||||
title: "提交日期",
|
||||
type: "string",
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
field: "操作",
|
||||
title: "操作",
|
||||
width: 220,
|
||||
type: "opt",
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initLoad();
|
||||
// this.load();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initLoad() {
|
||||
var that = this;
|
||||
var clientHeight = document.documentElement.clientHeight
|
||||
var lxHeader_height = 96.5; //查询 头部
|
||||
var paginationHeight = 37; //分页的高度
|
||||
var topHeight = 50; //页面 头部
|
||||
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
||||
that.tableHeight = tableHeight;
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.paginations.page = page;
|
||||
this.load();
|
||||
},
|
||||
load() {
|
||||
listarea({
|
||||
page: this.paginations.page,
|
||||
page_size: this.paginations.page_size,
|
||||
keyword: this.searchFields.KeyWord
|
||||
}).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.paginations.total = response.total;
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
});
|
||||
|
||||
},
|
||||
show(obj) {
|
||||
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
||||
this.dialogViewVisible = false;
|
||||
this.info(obj);
|
||||
},
|
||||
info(obj) {
|
||||
var that = this;
|
||||
get(obj.id).then(res => {
|
||||
let result = Object.assign(that.form, res);
|
||||
// this.$set(that.form,res);
|
||||
that.form = result;
|
||||
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
this.form = this.$options.data().form
|
||||
if (obj) {
|
||||
var result = Object.assign(this.form, obj)
|
||||
this.form = result;
|
||||
}
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
del(obj) {
|
||||
var that = this;
|
||||
if (obj) {
|
||||
this.$Modal.confirm({
|
||||
title: '确认要删除数据?',
|
||||
onOk: () => {
|
||||
del(obj.id).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
onCancel: () => {
|
||||
//this.$Message.info('Clicked cancel');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submitForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (that.form.id) {
|
||||
save(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
} else {
|
||||
store(that.form).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
that.load();
|
||||
that.dialogFormVisible = false;
|
||||
}).catch(error => {
|
||||
//reject(error)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$Message.error('数据校验失败');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
var that = this;
|
||||
this.$refs[formName].resetFields();
|
||||
that.dialogFormVisible = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dialogConcent {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.width100{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue