首页 查询

master
lion 3 years ago
parent 0d11941e65
commit a961eabe27

@ -1,6 +1,6 @@
import request from '@/utils/request'
export function listall(data) {
export function listmain(data) {
return request({
url: '/api/admin/rain-maintains/index',
method: 'get',

@ -7,6 +7,14 @@
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
<el-select class="vm10" v-model="searchFields.type" placeholder="请选择来源">
<el-option
v-for="item in selects.fromListType"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
<!-- <Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button> -->
</div>
@ -14,7 +22,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">
@ -103,7 +111,7 @@
</el-select>
</el-form-item>
</el-col>
<div v-if="form.jurisdiction_question==2">
<div v-if="form.jurisdiction_question==2 && jurisdictionStatus==2">
<el-col :span="24">
<el-form-item label="审核记录" prop="approve_content">
<el-input type="textarea" v-model="form.approve_content" placeholder="请填写审核记录" autocomplete="off"></el-input>
@ -119,7 +127,7 @@
</el-form-item>
</el-col>
</div>
<div v-if="form.jurisdiction_question==3">
<div v-if="form.jurisdiction_question==3 && jurisdictionStatus==2">
<el-col :span="24">
<el-form-item label="问题类型" prop="question_type">
<el-select style="width:100%" v-model="form.question_type" placeholder="">
@ -247,7 +255,8 @@
tableData: [],
tableHeight: 0,
searchFields: {
KeyWord: ""
KeyWord: "",
type:""
},
paginations: {
page: 1,
@ -257,6 +266,35 @@
selects:{
areaList:[],
questionList:[],
fromListType:[{
id:'',
value:"所有"
},{
id:1,
value:"通用巡查"
},{
id:2,
value:"工单"
},{
id:3,
value:"日常巡查"
},{
id:4,
value:"其他线索"
}],
jurisdictionList:[{
id:0,
value:"未确认"
},{
id:1,
value:"非管辖"
},{
id:2,
value:"管辖无问题"
},{
id:3,
value:"管辖有问题"
}],
fromList:[{
id:1,
value:"通用巡查"
@ -392,7 +430,8 @@
listclue({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.KeyWord
keyword: this.searchFields.KeyWord,
type:this.searchFields.type,
}).then(response => {
for(var m of response.data){
for(var k of this.selects.fromList){
@ -568,5 +607,11 @@
}
.width100{
width:100%;
}
.vm10 input{
height:32px;vertical-align: middle;
}
.vm10 .el-select__caret.el-input__icon.el-icon-arrow-up{
line-height: 30px;
}
</style>

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -13,7 +13,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -41,9 +41,7 @@
</div>
</div>
<div v-else-if="column.type=='ask_type_id'">
<div v-for="item in selects.ask_types" v-if="scope.row[column.field] == item.id">
{{item.value}}
</div>
{{scope.row[column.field]}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
@ -386,14 +384,14 @@
width:140
},
{
field: "ask_type_id",
field: "ask_type_name",
title: "类型",
type: "ask_type_id",
align: "center",
width:140
},
{
field: "ask_content_id",
field: "ask_content_name",
title: "内容",
type: "string",
align: "center",
@ -508,11 +506,10 @@
keyword: this.searchFields.KeyWord
}).then(response => {
for(var m of response.data){
if(m.user){
m.username = m.user.name
}
}
m.username = m.user?m.user.name:""
m.ask_type_name = m.ask_type_detail?m.ask_type_detail.value:""
m.ask_content_name = m.ask_content_detail?m.ask_content_detail.value:""
}
this.tableData = response.data;
this.paginations.total = response.total;
}).catch(error => {

@ -1,21 +1,401 @@
<template>
<div class="dashboard-container">
<div class="dashboard-text">name: {{ name }}</div>
<div class="dashboard-text">roles: <span v-for="role in roles" :key="role">{{ role }}</span></div>
<el-row :gutter="20">
<el-col :span="12" style="margin-bottom:15px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>雨管巡查</span>
<el-button @click='gowhere(1)' style="float: right; padding: 3px 0" type="text">更多>></el-button>
</div>
<div class="text item">
<el-table :data="tableData" class="v-table" :height="300" style="width: 100%">
<el-table-column type="index" width="50" fixed label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsinspection"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div v-if="column.type=='typeName'">
<el-tag>{{scope.row[column.field]}}</el-tag>
</div>
<div v-else-if="column.type=='statusName'">
<el-tag :type="(scope.row[column.field]==0?'':(scope.row[column.field]==1?'success':(scope.row[column.field]==2?'warning':'info')))">
{{insStatus[scope.row[column.field]]}}
</el-tag>
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="12" style="margin-bottom:15px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>雨管养护</span>
<el-button @click='gowhere(2)' style="float: right; padding: 3px 0" type="text">更多>></el-button>
</div>
<div class="text item">
<el-table :data="mainData" class="v-table" :height="300" style="width: 100%">
<el-table-column type="index" width="50" fixed label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsmain"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div v-if="column.type=='type'">
<el-tag>{{scope.row[column.field]}}</el-tag>
</div>
<div v-else-if="column.type=='status'">
<el-tag :type="(scope.row[column.field]==0?'':(scope.row[column.field]==1?'success':(scope.row[column.field]==2?'warning':(scope.row[column.field]==3?'info':'danger'))))">
{{insStatus[scope.row[column.field]]}}
</el-tag>
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>通用巡查</span>
<el-button @click='gowhere(3)' style="float: right; padding: 3px 0" type="text">更多>></el-button>
</div>
<div class="text item">
<el-table :data="comData" class="v-table" :height="300" style="width: 100%">
<el-table-column type="index" width="50" fixed label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnscom"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div v-if="column.type=='status'">
<el-tag :type="(scope.row[column.field]==1?'':(scope.row[column.field]==2?'success':'warning'))">
{{comStatus[scope.row[column.field]]}}
</el-tag>
</div>
<div v-else-if="column.type=='feedback_department_id'">
<div v-for="item in departments" v-if="scope.row[column.field] == item.id">
{{item.name}}
</div>
</div>
<div v-else-if="column.type=='ask_type_id'">
{{scope.row[column.field]}}
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>日常监督考核</span>
<el-button @click='gowhere(4)' style="float: right; padding: 3px 0" type="text">更多>></el-button>
</div>
<div class="text item">
<el-table :data="dailyData" class="v-table" :height="300" style="width: 100%">
<el-table-column type="index" width="50" fixed label="序号" align="center"> </el-table-column>
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columnsdaily"
:label="column.title" :width="column.width" :fixed="column.fixed">
<template slot-scope="scope">
<div v-if="column.type=='status'">
<el-tag :type="(scope.row[column.field]==1?'':(scope.row[column.field]==2?'success':'danger'))">
{{dailyStatus[scope.row[column.field]]}}
</el-tag>
</div>
<div v-else>{{scope.row[column.field]}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import {
listdept
} from "../../api/system/department.js"
import {
listall
} from '../../api/rain/inspection.js'
import {
listmain
} from '../../api/rain/maintain.js'
import {
listcommon
} from '../../api/commonInspection/index.js'
import {
listdaily
} from '../../api/assess/daily.js'
export default {
name: 'Dashboard',
data(){
return {
tableData:[],
mainData:[],
comData:[],
dailyData:[],
departments:[],
paginations:{
page:1,
page_size:10
},
insStatus:["待审核","已审核","已办结","已退回","缺陷办结"],
comStatus:['',"已提交","已审核","已办结"],
dailyStatus:['',"无异常","已处理","未处理"],
columnsinspection: [{
field: "address",
title: "地址",
type: "string",
align: "left",
width: 400
},
{
field: "typeName",
title: "类型",
type: "typeName",
align: "left",
width: 160
},
{
field: "status",
title: "状态",
type: "statusName",
align: "center",
width: 160
},
{
field: "admin_id",
title: "提交人",
type: "string",
align: "center",
width: 160
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center",
width: 200
}
],
columnsmain:[
{
field: "address",
title: "地址/排放点",
type: "string",
align: "left",
width:400
},
{
field: "typeName",
title: "类型",
type: "type",
align: "left",
width:160
},
{
field: "status",
title: "状态",
type: "status",
align: "center",
width:160
},
{
field: "admin_id",
title: "提交人",
type: "string",
align: "center",
width:160
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center",
width:200
}
],
columnscom:[{
field: "feedback_department_id",
title: "反馈科室",
type: "feedback_department_id",
width:140
},
{
field: "ask_type_name",
title: "类型",
type: "ask_type_id",
align: "center",
width:140
},
{
field: "ask_content_name",
title: "内容",
type: "string",
align: "center",
width:140
},
{
field: "address",
title: "地址",
type: "string",
align: "lefft",
width:400
},
{
field: "status",
title: "状态",
type: "status",
align: "center",
width:140
},
{
field: "username",
title: "提交人",
type: "user",
align: "center",
width:140
},
{
field: "department_id",
title: "提交科室",
type: "string",
align: "center",
width:140
},
{
field: "created_at",
title: "提交日期",
type: "string",
align: "center",
width:200
}],
columnsdaily:[{
field: "name",
title: "名称",
type: "string",
align: "left"
},
{
field: "status",
title: "状态",
type: "status",
align: "center"
}]
}
},
computed: {
...mapGetters([
'name',
'roles'
])
},
created() {
this.initload()
this.load()
},
methods:{
initload(){
listdept().then(res => {
this.departments = res
})
},
gowhere(type){
let url ="/admin/#/rain/inspection"
if(type==1){
url ="/admin/#/rain/inspection"
}
if(type==2){
url ="/admin/#/rain/maintain"
}
if(type==3){
url ="/admin/#/common/index"
}
if(type==4){
url ="/admin/#/assess/daily"
}
window.location.href = url
},
load() {
listall({
page: this.paginations.page,
page_size: this.paginations.page_size
}).then(response => {
for(var m of response.data){
m.typeName = m.type==1?"日常雨水设施":"在建工地巡查"
}
this.tableData = response.data;
}).catch(error => {
console.log(error)
reject(error)
});
listmain({
page: this.paginations.page,
page_size: this.paginations.page_size
}).then(response => {
for(var m of response.data){
m.typeName = (m.type==1?"雨水管道疏挖":(m.type==2?"雨水管道疏通":(m.type==3?"汛期助排":"污泥外运")))
}
this.mainData = response.data;
}).catch(error => {
console.log(error)
reject(error)
});
listcommon({
page: this.paginations.page,
page_size: this.paginations.page_size
}).then(response => {
for(var m of response.data){
m.username = m.user?m.user.name:""
m.ask_type_name = m.ask_type_detail?m.ask_type_detail.value:""
m.ask_content_name = m.ask_content_detail?m.ask_content_detail.value:""
}
this.comData = response.data;
}).catch(error => {
console.log(error)
reject(error)
});
listdaily({
page: this.paginations.page,
page_size: this.paginations.page_size
}).then(response => {
this.dailyData = response.data;
}).catch(error => {
console.log(error)
reject(error)
});
},
}
}
</script>
@ -23,10 +403,11 @@ export default {
.dashboard {
&-container {
margin: 30px;
margin-top:0
}
&-text {
font-size: 30px;
line-height: 46px;
font-size: 22px;
line-height: 30px;
}
}
</style>

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" fixed="left" 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" :fixed="column.fixed">

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :height="tableHeight" style="width: 100%">
<el-table-column type="index" width="50" fixed="left" 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" :fixed="column.fixed">

@ -5,8 +5,16 @@
<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="关键字搜索" />
<div>
<el-select class="vm10" filterable v-model="searchFields.area_id" placeholder="请选择所属片区">
<el-option
v-for="item in selects.areasList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!-- <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>
@ -625,7 +633,8 @@
} from '@/utils/auth'
import {
getparameteritem
} from '../../api/system/dictionary.js'
} from '../../api/system/dictionary.js'
import { listarea } from '../../api/basic/area.js'
import LxHeader from "@/components/LxHeader/index.vue";
import AvueMap from 'avue-plugin-map'
@ -652,7 +661,13 @@
mapform: [],
tableHeight: 0,
searchFields: {
KeyWord: ""
area_id: ""
},
selects:{
areasList:[{
id:"",
name:"所有"
}]
},
paginations: {
page: 1,
@ -823,6 +838,18 @@
getbuilding().then(res => {
this.buildList = res
})
listarea({
page: 1,
page_size: 99
}).then(res => {
for(var m of res.data){
that.selects.areasList.push({
id:m.id,
name:m.name
})
}
})
@ -835,7 +862,7 @@
listall({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.KeyWord
area_id: this.searchFields.area_id
}).then(response => {
this.tableData = response.data;
this.paginations.total = response.total;
@ -1163,5 +1190,11 @@
.files_check .el-upload.el-upload--picture-card {
display: none;
}
.vm10 input{
height:32px;vertical-align: middle;
}
.vm10 .el-select__caret.el-input__icon.el-icon-arrow-up{
line-height: 30px;
}
</style>

@ -5,8 +5,16 @@
<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="关键字搜索" />
<div>
<el-select class="vm10" filterable v-model="searchFields.area_id" placeholder="请选择所属片区">
<el-option
v-for="item in selects.areasList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<!-- <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>
@ -715,7 +723,7 @@
<script>
import {
listall,
listmain,
get,
del,
update,
@ -728,7 +736,8 @@
} from '../../api/rain/maintain.js'
import {
getToken
} from '@/utils/auth'
} from '@/utils/auth'
import { listarea } from '../../api/basic/area.js'
import LxHeader from "@/components/LxHeader/index.vue";
import AvueMap from 'avue-plugin-map'
@ -754,8 +763,14 @@
},
mapform:[],
tableHeight: 0,
searchFields: {
KeyWord: ""
searchFields: {
area_id: ""
},
selects:{
areasList:[{
id:"",
name:"所有"
}]
},
paginations: {
page: 1,
@ -877,17 +892,31 @@
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
this.uploadOther.token = getToken();
this.uploadOther.token = getToken();
listarea({
page: 1,
page_size: 99
}).then(res => {
for(var m of res.data){
that.selects.areasList.push({
id:m.id,
name:m.name
})
}
})
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
listall({
listmain({
page: this.paginations.page,
page_size: this.paginations.page_size,
keyword: this.searchFields.KeyWord
area_id: this.searchFields.area_id
}).then(response => {
this.tableData = response.data;
this.paginations.total = response.total;
@ -1255,5 +1284,11 @@
}
.files_check .el-upload.el-upload--picture-card{
display: none;
}
.vm10 input{
height:32px;vertical-align: middle;
}
.vm10 .el-select__caret.el-input__icon.el-icon-arrow-up{
line-height: 30px;
}
</style>

@ -14,7 +14,7 @@
</LxHeader>
</div>
<div ref="lxTable">
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table :data="tableData" class="v-table" :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">

@ -0,0 +1,331 @@
<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" class="v-table" :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="area_id">
<el-select style="width:100%" v-model="form.area_id" placeholder="请选择所属片区">
<el-option
v-for="item in areaList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="处理人" prop="level_id">
<el-select style="width:100%" v-model="form.level_id" placeholder="请选择处理人">
<el-option
v-for="item in personList"
:key="item.id"
:label="item.value"
:value="item.id">
</el-option>
</el-select>
</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 {
listorder,
get,
store,
save,
del
} from '../../api/rain/order.js'
import LxHeader from "@/components/LxHeader/index.vue";
export default {
components: {
LxHeader
},
data() {
return {
tableHeight: 0,
dialogFormVisible: false,
formLabelWidth: "120px",
tableData: [],
areaList:[],
personList:[],
tableHeight: 0,
searchFields: {
KeyWord: ""
},
paginations: {
page: 1,
page_size: 15,
total: 0
},
form: {
},
rules: {
},
columns: [{
field: "accept_date",
title: "来源",
type: "string",
align: "center"
},
{
field: "fromName",
title: "来源编号",
type: "string",
align: "center"
},
{
field: "areaName",
title: "工作内容",
type: "string",
align: "center"
},
{
field: "levelName",
title: "片区",
type: "string",
align: "center"
},
{
field: "areaName",
title: "位置地址",
type: "string",
align: "center"
},
{
field: "levelName",
title: "要求完成时间",
type: "string",
align: "center"
},
{
field: "admin_id",
title: "提交人",
type: "string",
align: "center"
},
{
field: "created_at",
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;
// listarea({
// page: 1,
// page_size: 999,
// }).then(response => {
// that.areaList = response.data;
// }).catch(error => {
// console.log(error)
// reject(error)
// });
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
},
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;
let _files = [];
for (var mod of result.worksheet_files) {
let m = Object.assign({}, mod);
m.url = mod.files.url;
m.id = mod.files.id;
_files.push(m);
}
that.filesList = _files;
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form
if (obj) {
this.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;
console.log(that.form);
var listUrlbefore=[]
for (var m of this.filesList) {
if (m.response)
listUrlbefore.push({
"upload_id": m.response.id
});
else
listUrlbefore.push({
"upload_id": m.id
});
}
this.form.files_list = listUrlbefore;
// 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;
this.filesList = [];
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
}
}
}
</script>
<style>
.dialogConcent {
overflow-y: auto;
}
.width100{
width:100%;
}
</style>
Loading…
Cancel
Save