bibi 3 years ago
parent da5102d6e6
commit a63c3369e0

@ -14,6 +14,13 @@ export function planisEnable(params) {
params: params,
})
}
export function routeSelect(params) {
return httpService({
url: `/user/inspectionRoute/allList`,
method: 'get',
params: params,
})
}
export function planInfo(params) {
return httpService({
url: `/user/inspectionPlan/findById`,

@ -258,7 +258,7 @@ export default {
this.positionDisabled(this.treeData)
});
},
// disabled
//
positionDisabled(arr){
arr.forEach((item,index)=>{
if(item.type=== 1 && (item.childList.length===0 || item.childList===null)){

@ -1,73 +1,79 @@
export const formItem = [
{
type: 'select',
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
type: 'input',
label:'编号',
prop:'code',
placeholder:'请输入'
},
{
type: 'input',
label:'标题',
prop:'title',
label:'巡检人手机号',
prop:'inspectorTel',
placeholder:'请输入'
},
{
type: 'select',
label:'巡检状态',
prop:'inspectionStatus',
placeholder: '请选择',
option:[{ id:1,name:'待巡检'},{ id:2,name:'已巡检'},{ id:3,name:'巡检中'},{ id:4,name:'未巡检'}]
},
]
export const columns = [
{
title: "标题",
dataIndex: "title",
width: "10%",
title: "执行巡检编号",
dataIndex: "code",
},
{
title: "分类",
dataIndex: "categoryName",
width: "10%",
title: "执行巡检名称",
dataIndex: "name",
},
{
title: "发布状态",
title: "计划当次巡检开始时间",
dataIndex: "beginDate",
},
{
title: "计划当次巡检结束时间",
dataIndex: "endDate",
},
{
title: "实际当次巡检开始时间",
dataIndex: "actualBeginDate",
},
{
title: "实际当次巡检结束时间",
dataIndex: "actualEndDate",
},
{
title: "状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '未发布'
return "待巡检"
break;
case 2:
return '已发布'
return "已巡检"
break;
case 3:
return "巡检中"
break;
case 4:
return "未巡检"
break;
default:
break;
}
}
},
{
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "12%",
title: "巡检人姓名",
dataIndex: "inspectorName",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
title: "巡检人手机号",
dataIndex: "inspectorTel",
},
]
export const pagination = {

@ -1,111 +0,0 @@
<template>
<div>
<a-drawer
title="资讯-详情"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="detailClose"
>
<div class="drawer-content">
<div class="content-title">
{{ detailData.title }}
<a-tag color="blue">{{
detailData.status === 1 ? "未发布" : "已发布"
}}</a-tag>
</div>
<a-divider></a-divider>
<a-descriptions>
<a-descriptions-item label="资讯类型">
{{ detailData.categoryName }}
</a-descriptions-item>
<a-descriptions-item label="阅读量">
{{ detailData.viewsNum }}
</a-descriptions-item>
<a-descriptions-item label="创建人">
{{ detailData.createName }}
</a-descriptions-item>
<a-descriptions-item label="创建时间">
{{ detailData.createDate }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="1">
<a-descriptions-item label="资讯内容">
{{ detailData.content }}
</a-descriptions-item>
<a-descriptions-item label="公告封面图">
<img
v-for="(item, index) in detailData.imgList"
:key="index"
:src="$ImgUrl(item.url)"
class="content-img"
/>
</a-descriptions-item>
</a-descriptions>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose">
关闭
</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { newsInfo } from "@/api/operation/news/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
detailId: Number,
},
data() {
return {
detailData: {},
};
},
mounted() {},
methods: {
detailClose() {
this.$emit("detailClose");
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
},
watch: {
detailId: {
handler(id) {
if (id !== null && id !== undefined) {
newsInfo({ informationId: id }).then((res) => {
this.detailData = res.data;
});
}
},
immediate: true,
},
},
};
</script>
<style lang="less" scoped>
.content-title {
color: #000000d9;
font-weight: 500;
font-size: 18px;
line-height: 25px;
}
.content-img {
width: 108px;
height: 86px;
}
</style>

@ -1,21 +0,0 @@
export const form = {
id:undefined,
title:undefined,
categoryId:undefined,
status:undefined,
content:undefined,
imgUrls:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
}
export const options = {
status:[
{ id:1, name:'未发布' },
{ id:2, name:'已发布' },
],
categoryId:[]
}

@ -1,201 +0,0 @@
<template>
<div>
<a-drawer
:title="title"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="title" label="标题">
<a-input
v-model="form.title"
placeholder="请输入标题"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="content" label="内容">
<a-textarea
v-model="form.content"
placeholder="请输入内容"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
></commonUpload>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="submit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { form, rules, options } from "./form.js";
import {
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
export default {
props: {
show: {
type: Boolean,
default: false,
},
editId: Number,
},
data() {
return {
title: "新增资讯",
form,
rules,
options,
fileList: [],
};
},
mounted() {
this.getItem();
},
methods: {
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
},
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.form.imgUrls = [];
this.$emit("addClose");
},
success() {
this.$emit("success");
this.addClose();
},
submit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await newsInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
} else {
console.log(this.form);
let res = await newsUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
}
}
});
},
handleChange(data) {
this.fileList = data;
if (data[0].status === "done") {
console.log("-------done-------");
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改资讯";
this.form.id = val;
newsInfo({ informationId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
} else {
this.form.imgUrls = [];
}
});
} else {
this.title = "新增资讯";
}
},
immediate: true,
},
},
};
</script>
<style></style>

@ -1,15 +1,15 @@
<template>
<div>
<div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增资讯</a-button
>
<div class="cardTitle">巡检记录</div>
<searchForm
:formItem="formItem"
@getSearch="getData($event)"
></searchForm>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 2600 }"
:scroll="{ x: 2600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
@ -21,67 +21,27 @@
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="detail(row.id)"></a>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
</a-table>
<div class="action">
<a-dropdown :disabled="!hasSelected">
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="del"> 批量删除 </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<addForm
:show="drawer.show"
@success="success"
@addClose="addClose"
:editId="editId"
></addForm>
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
</div>
</template>
<script>
import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import { inspectionExecute } from "@/api/operation/inspection/plan.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
export default {
components: {
addForm,
detailForm
},
data() {
return {
drawer: {
show: false,
detail:false
detail: false,
},
editId: null,
detailId:null,
detailId: null,
tableData: [],
searchForm: {
activityAddress: undefined,
organizerName: undefined,
activityContact: undefined,
activityTel: undefined,
title: undefined,
status: undefined,
registrationStartTime: undefined,
registrationEndTime: undefined,
activityStartTime: undefined,
activityEndTime: undefined,
code: undefined,
inspectorTel: undefined,
inspectionStatus: undefined,
},
formItem,
columns,
@ -92,7 +52,6 @@ export default {
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
@ -101,56 +60,18 @@ export default {
this.searchForm = data;
console.log(this.searchForm);
}
let res = await newsList({
let res = await inspectionExecute({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
},
edit(id) {
this.editId = id;
this.drawer.show = true;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await newsDel({ informationIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
this.selectedRowKeys = [];
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
handleMenuClick(data) {
console.log(data);
if (data.key === "del") {
this.del(this.selectedRowKeys);
}
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
@ -159,21 +80,6 @@ export default {
this.pagination = pager;
this.getData();
},
addClose() {
this.drawer.show = false;
this.editId = null;
},
success() {
this.getData();
},
detail(id){
this.drawer.detail = true;
this.detailId = id;
},
detailClose(){
this.detailId = null;
this.drawer.detail = false;
}
},
computed: {
hasSelected() {
@ -187,4 +93,7 @@ export default {
width: 40px;
height: 40px;
}
/deep/ #qrCodeUrl > img {
margin: 0 auto;
}
</style>

@ -11,28 +11,66 @@ export const formItem = [
prop:'name',
placeholder:'请输入'
},
{
type: 'select',
label:'状态',
prop:'status',
placeholder: '请选择',
option:[{ id:1,name:'启用'},{ id:2,name:'停用'}]
},
{
type: 'select',
label:'巡检路线',
prop:'inspectionRouteId',
placeholder: '请选择',
option:[]
},
{
type: 'time',
label: '计划时间',
start: 'planBeginDateStart',
end:'planBeginDateEnd'
},
{
type: 'time',
label: '实际时间',
start: 'actualBeginDateStart',
end:'actualBeginDateEnd'
},
]
export const columns = [
{
title: "路线编号",
title: "巡检计划编号",
dataIndex: "code",
},
{
title: "路线名称",
title: "名称",
dataIndex: "name",
},
{
title: "持续时间",
dataIndex: "spaceTime",
title: "巡检路线编号",
dataIndex: "routeCode",
},
{
title: "计划开始时间",
dataIndex: "planBeginDate",
},
{
title: "实际开始时间",
dataIndex: "actualBeginDate",
},
{
title: "部门名称",
dataIndex: "positionName",
},
{
title: "创建时间",
dataIndex: "createDate",
title: "巡检人名称",
dataIndex: "inspectorName",
},
{
title: "状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
@ -46,7 +84,7 @@ export const columns = [
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
width: "280",
fixed: "right",
scopedSlots: { customRender: "action" },
},

@ -1,21 +1,34 @@
export const form = {
id:undefined,
id: undefined,
inspectionRouteId: undefined,
name:undefined,
describes:undefined,
status:undefined,
spaceTime:undefined,
pointRouteList:[]
positionId:undefined,
inspector:undefined,
planBeginDate:undefined,
isSort:undefined,
checkRateType:undefined,
}
export const rules = {
name:[{required:true,message:'请输入路线名称',trigger:'blur'}],
describes:[{required:true,message:'请输入描述',trigger:'blur'}],
status:[{required:true,message:'请选择',trigger:'change'}],
spaceTime:[{required:true,message:'请输入持续时间',trigger:'blur'}],
inspectionRouteId:[{required:true,message:'请选择路线',trigger:'change'}],
name:[{required:true,message:'请输入名称',trigger:'blur'}],
inspector:[{required:true,message:'请选择',trigger:'change'}],
planBeginDate:[{required:true,message:'请选择',trigger:'change'}],
isSort:[{required:true,message:'请选择',trigger:'change'}],
checkRateType:[{required:true,message:'请选择',trigger:'change'}],
}
export const options = {
status:[
{ id:1, name:'启用' },
{ id:2, name:'停用' },
isSort:[
{ id:1, name:'顺序' },
{ id:2, name:'不顺序' },
],
pointList:[]
routeList: [],
checkRateType: [
{ id:1, name:'每天' },
{ id:2, name:'每周' },
{ id:3, name:'每月' },
],
// 岗位选择
positionId: [],
// 人员选择
inspector:[]
}

@ -16,25 +16,90 @@
:rules="rules"
layout="vertical"
>
<a-form-model-item prop='name' label='路线名称'>
<a-input v-model="form.name" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='describes' label='描述'>
<a-input v-model="form.describes" placeholder="请输入" style="width:60%"></a-input>
</a-form-model-item>
<a-form-model-item prop='status' label='状态' v-if="title==='新增巡检路线'">
<a-select v-model="form.status" placeholder="请输入" style="width:60%">
<a-select-option v-for="item in options.status" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item prop='spaceTime' label='持续时间'>
<a-input-number v-model="form.spaceTime" placeholder="请输入" style="width:60%"></a-input-number>
</a-form-model-item>
<a-form-model-item prop='pointRouteList' label='巡检路线'>
<a-select mode="multiple" v-model="selectPoint" placeholder="请选择" style="width:60%">
<a-select-option v-for="item in options.pointList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item prop="inspectionRouteId" label="巡检路线">
<a-select
v-model="form.inspectionRouteId"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.routeList"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item prop="name" label="计划名称">
<a-input
v-model="form.name"
placeholder="请输入"
style="width: 60%"
></a-input>
</a-form-model-item>
<a-form-model-item prop="positionId" label="部门">
<a-cascader
v-model="positionValue"
:options="options.positionId"
:field-names="{
label: 'name',
value: 'id',
children: 'childList',
}"
placeholder="请选择"
style="width: 60%"
@change="changePosition"
></a-cascader>
</a-form-model-item>
<a-form-model-item prop="inspector" label="巡检人">
<a-select
v-model="form.inspector"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.inspector"
:key="item.id"
:value="item.id"
>{{ item.actualName }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item prop="planBeginDate" label="计划开始时间">
<a-date-picker
placeholder="请选择开始时间"
v-model="form.planBeginDate"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
<a-form-model-item prop="isSort" label="是否按照顺序巡检">
<a-select
v-model="form.isSort"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.isSort"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item prop="checkRateType" label="检查频率">
<a-select
v-model="form.checkRateType"
placeholder="请选择"
style="width: 60%"
>
<a-select-option
v-for="item in options.checkRateType"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-form-model>
</div>
<div class="drawer-footer">
@ -50,11 +115,12 @@
<script>
import { form, rules, options } from "./form.js";
import {
routeInsert,
routeUpdate,
routeInfo,
pointSelect
} from "@/api/operation/inspection/route.js";
planInsert,
planUpdate,
planInfo,
routeSelect,
} from "@/api/operation/inspection/plan.js";
import { departmentList, findToUser } from "@/api/basic/department/index.js";
export default {
props: {
show: {
@ -65,25 +131,61 @@ export default {
},
data() {
return {
title: "新增巡检路线",
title: "新增巡检计划",
form,
rules,
options,
selectPoint:[]
positionValue:[]
};
},
mounted() {
this.getPoint();
this.getRoute();
this.getDepartment();
},
methods: {
async getPoint() {
let res = await pointSelect();
this.options.pointList = res.data;
async getRoute() {
let res = await routeSelect();
this.options.routeList = res.data;
},
async getDepartment() {
let res = await departmentList();
this.options.positionId = res.data;
this.positionDisabled(this.options.positionId)
},
// idtype===''disable
positionDisabled(arr){
arr.forEach((item,index)=>{
if(item.type=== 1 && (item.childList.length===0 || item.childList===null)){
arr[index].disabled=true
}else if(item.type === 2){
arr[index].disabled=false
}else{
this.positionDisabled(item.childList)
}
})
},
async getUser(id){
let res = await findToUser({
// 10000
pageNum:1,size:10000,positionId:id
})
this.options.inspector = res.data.rows;
},
getPositionValue(id){
console.log(this.options.positionId);
},
async changePosition(data) {
this.options.inspector = []
this.form.inspector = undefined
let id = data[data.length - 1]
this.form.positionId = id
this.getUser(id)
},
addClose() {
this.$refs.ruleForm.resetFields();
this.form.pointRouteList = [];
this.selectPoint = []
this.positionValue = []
this.form.positionId = undefined;
this.form.inspector = undefined
this.$emit("addClose");
},
success() {
@ -91,14 +193,10 @@ export default {
this.addClose();
},
submit() {
this.form.pointRouteList = []
for(let k in this.selectPoint){
this.form.pointRouteList.push({inspectionPointId:this.selectPoint[k]});
}
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await routeInsert(this.form);
let res = await planInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -107,7 +205,7 @@ export default {
}
} else {
console.log(this.form);
let res = await routeUpdate(this.form);
let res = await planUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -123,19 +221,17 @@ export default {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改巡检路线";
this.selectPoint = []
this.title = "修改巡检计划";
this.form.id = val;
routeInfo({ routeId: val }).then((res) => {
planInfo({ planId: val }).then((res) => {
this.form = res.data;
if(this.form.routePointList.length>0){
for(let item of this.form.routePointList){
this.selectPoint.push(item.id)
}
}
//
this.getUser(this.form.positionId)
//
// this.form.positionId
});
} else {
this.title = "新增巡检路线";
this.title = "新增巡检计划";
}
},
immediate: true,

@ -1,14 +1,15 @@
<template>
<div>
<div class="cardTitle">巡检路线</div>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<div class="cardTitle">巡检计划</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增路线</a-button
>新增计划</a-button
>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1900 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
@ -52,7 +53,7 @@
</template>
<script>
import { routeList, routeDel,routeisEnable } from "@/api/operation/inspection/route.js";
import { planList, planDel,planisEnable,routeSelect } from "@/api/operation/inspection/plan.js";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
export default {
@ -69,6 +70,12 @@ export default {
searchForm: {
code: undefined,
name: undefined,
status: undefined,
inspectionplanId: undefined,
planBeginDateStart: undefined,
planBeginDateEnd: undefined,
actualBeginDateStart: undefined,
actualBeginDateEnd: undefined,
},
formItem,
columns,
@ -79,15 +86,20 @@ export default {
},
mounted() {
this.getData();
this.getRoute()
},
methods: {
async getRoute(){
let res = await routeSelect()
this.formItem[3].option = res.data
},
async getData(data) {
if (data !== undefined) {
console.log(data);
this.searchForm = data;
console.log(this.searchForm);
}
let res = await routeList({
let res = await planList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
@ -96,6 +108,12 @@ export default {
this.pagination.total = res.data.total;
this.selectedRowKeys = []
},
changeTime(data, start, end) {
console.log(start);
this.searchForm[start] = data[0];
this.searchForm[end] = data[1];
console.log(this.searchForm);
},
edit(id) {
this.editId = id;
this.drawer.show = true;
@ -108,7 +126,7 @@ export default {
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await routeDel({ ids: ids });
let res = await planDel({ ids: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
@ -119,7 +137,7 @@ export default {
});
},
async enable(id) {
let res = await routeisEnable({ routeId: id });
let res = await planisEnable({ planId: id });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();

Loading…
Cancel
Save