|
@@ -1,86 +1,92 @@
|
|
|
<template>
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
- <j-form-container :disabled="formDisabled">
|
|
|
+ <!-- <j-form-container :disabled="formDisabled">
|
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
|
- <a-row>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
|
|
|
- <a-input v-model="model.remark" placeholder="请输入备注" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="巡检计划编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="plancode">
|
|
|
- <a-input v-model="model.plancode" placeholder="请输入巡检计划编号" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="巡检计划名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planname">
|
|
|
- <a-input v-model="model.planname" placeholder="请输入巡检计划名称" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="是否开启时间设置:Y是、N否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iftimeset">
|
|
|
- <a-input v-model="model.iftimeset" placeholder="请输入是否开启时间设置:Y是、N否" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
|
|
|
- <j-date placeholder="请选择开始时间" v-model="model.begintime" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="重复" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeatnum">
|
|
|
- <a-input-number v-model="model.repeatnum" placeholder="请输入重复" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="重复类型:年、月、周、日、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeattype">
|
|
|
- <a-input v-model="model.repeattype" placeholder="请输入重复类型:年、月、周、日、时、分" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="提前通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticenum">
|
|
|
- <a-input-number v-model="model.noticenum" placeholder="请输入提前通知时间" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="提前通知类型:天、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetype">
|
|
|
- <a-input v-model="model.noticetype" placeholder="请输入提前通知类型:天、时、分" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="状态(0启用 1停用)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
|
|
|
- <a-input v-model="model.status" placeholder="请输入状态(0启用 1停用)" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="待办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
|
|
|
- <a-input v-model="model.chargeruser" placeholder="请输入待办人" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="下次执行时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nexttime">
|
|
|
- <j-date placeholder="请选择下次执行时间" v-model="model.nexttime" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="任务数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tasknum">
|
|
|
- <a-input-number v-model="model.tasknum" placeholder="请输入任务数量" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="下次通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetime">
|
|
|
- <j-date placeholder="请选择下次通知时间" v-model="model.noticetime" style="width: 100%" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-model-item label="是否已通知:是/否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ifnotice">
|
|
|
- <a-input v-model="model.ifnotice" placeholder="请输入是否已通知:是/否" ></a-input>
|
|
|
- </a-form-model-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
</a-form-model>
|
|
|
- </j-form-container>
|
|
|
+ </j-form-container> -->
|
|
|
+ <div class="table-operator">
|
|
|
+ <a-button @click="handleAddLine" type="primary" icon="plus">维护巡检路线</a-button>
|
|
|
+ <a-button @click="handleAddSpot" type="primary" icon="plus">维护巡检点</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="inspect-plan-form-list">
|
|
|
+ <a-table
|
|
|
+ ref="table"
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="tableData"
|
|
|
+ :pagination="false"
|
|
|
+ :rowClassName="setRowClassName"
|
|
|
+ class="plan-table">
|
|
|
+ <!-- :loading="loading" -->
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div v-if="record.type === '巡检路线'" class="line-spot-container">
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="columns"
|
|
|
+ :dataSource="record.sonList"
|
|
|
+ :pagination="false"
|
|
|
+ :showHeader="false"
|
|
|
+ class="line-spot-table">
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div class="spot-content-container">
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="contentColumns"
|
|
|
+ :dataSource="record.sonList"
|
|
|
+ :pagination="false"
|
|
|
+ class="spot-content-table">
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div class="item-container">
|
|
|
+ <!-- bordered -->
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="itemColumns"
|
|
|
+ :dataSource="record.cmmsInspectContentItemList"
|
|
|
+ :pagination="false"
|
|
|
+ class="item-table">
|
|
|
+ <!-- :showHeader="false" -->
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ <div v-if="record.type === '巡检点'" class="spot-content-container">
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="contentColumns"
|
|
|
+ :dataSource="record.sonList"
|
|
|
+ :pagination="false"
|
|
|
+ class="spot-content-table">
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div class="item-container">
|
|
|
+ <!-- bordered -->
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="itemColumns"
|
|
|
+ :dataSource="record.cmmsInspectContentItemList"
|
|
|
+ :pagination="false"
|
|
|
+ class="item-table">
|
|
|
+ <!-- :showHeader="false" -->
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+
|
|
|
+ <inspect-plan-modal-add-line ref="addLineRef" :selectData="inspectLineList" @ok="handleOk"></inspect-plan-modal-add-line>
|
|
|
+ <inspect-plan-modal-add-spot ref="addSpotRef" :selectData="inspectSpotList" @ok="handleOk"></inspect-plan-modal-add-spot>
|
|
|
+ </div>
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
|
|
@@ -88,10 +94,14 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
+ import InspectPlanModalAddLine from './InspectPlanModalAddLine.vue'
|
|
|
+ import InspectPlanModalAddSpot from './InspectPlanModalAddSpot.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'InspectPlanForm',
|
|
|
components: {
|
|
|
+ InspectPlanModalAddLine,
|
|
|
+ InspectPlanModalAddSpot
|
|
|
},
|
|
|
props: {
|
|
|
//表单禁用
|
|
@@ -103,8 +113,11 @@
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- model:{
|
|
|
- },
|
|
|
+ inspectLineList: [],
|
|
|
+ inspectSpotList: [],
|
|
|
+ addType: '巡检点',
|
|
|
+ // model:{
|
|
|
+ // },
|
|
|
labelCol: {
|
|
|
xs: { span: 24 },
|
|
|
sm: { span: 5 },
|
|
@@ -119,8 +132,130 @@
|
|
|
url: {
|
|
|
add: "/cmmsInspectPlan/cmmsInspectPlan/add",
|
|
|
edit: "/cmmsInspectPlan/cmmsInspectPlan/edit",
|
|
|
- queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById"
|
|
|
- }
|
|
|
+ queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById",
|
|
|
+ queryTreeById: "/cmmsInspectPlan/cmmsInspectPlan/queryTreeById"
|
|
|
+ },
|
|
|
+ tableData: [],
|
|
|
+ columns: [
|
|
|
+ // {
|
|
|
+ // title: '序号',
|
|
|
+ // dataIndex: '',
|
|
|
+ // key:'rowIndex',
|
|
|
+ // width:60,
|
|
|
+ // align:"center",
|
|
|
+ // customRender:function (t,r,index) {
|
|
|
+ // return parseInt(index)+1;
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title:'巡检类型',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'type'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'名称',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'title',
|
|
|
+ // dataIndex: 'inspectLineVo',
|
|
|
+ // customRender:function (scope) {
|
|
|
+ // return scope.linename
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'编号',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: ''
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title:'是否必须执行',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'equipmentname'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title:'备注',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'remark'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ contentColumns: [
|
|
|
+ {
|
|
|
+ title:'巡检内容编号',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'contentcode',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 4}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'巡检内容名称',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'contentname',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'设备名称',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'equipmentname',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'备注',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'remark',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ itemColumns: [
|
|
|
+ {
|
|
|
+ title:'巡检项编号',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'itemcode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'名称',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'itemname'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title:'设备类型',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'equipdefname'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title:'巡检标准',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'inspectionstandards'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'巡检项类型',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'classification_dictText'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'备注',
|
|
|
+ align:"left",
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'remark',
|
|
|
+ },
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -133,42 +268,96 @@
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
},
|
|
|
methods: {
|
|
|
+ setRowClassName(record){
|
|
|
+ if(record.type === '巡检路线'){
|
|
|
+ return 'line-bg'
|
|
|
+ }
|
|
|
+ if(record.type === '巡检点'){
|
|
|
+ return 'spot-bg'
|
|
|
+ }
|
|
|
+ },
|
|
|
add () {
|
|
|
- this.edit(this.modelDefault);
|
|
|
+ // this.edit(this.modelDefault);
|
|
|
},
|
|
|
edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
- },
|
|
|
- submitForm () {
|
|
|
- const that = this;
|
|
|
- // 触发表单验证
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- that.confirmLoading = true;
|
|
|
- let httpurl = '';
|
|
|
- let method = '';
|
|
|
- if(!this.model.id){
|
|
|
- httpurl+=this.url.add;
|
|
|
- method = 'post';
|
|
|
- }else{
|
|
|
- httpurl+=this.url.edit;
|
|
|
- method = 'put';
|
|
|
- }
|
|
|
- httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
- if(res.success){
|
|
|
- that.$message.success(res.message);
|
|
|
- that.$emit('ok');
|
|
|
- }else{
|
|
|
- that.$message.warning(res.message);
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- that.confirmLoading = false;
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ this.confirmLoading = true
|
|
|
+ // this.model = Object.assign({}, record);
|
|
|
+ getAction(this.url.queryById, {id: record.id}).then((res) => {
|
|
|
+ this.tableData = res.result.sonList
|
|
|
+ console.log(res)
|
|
|
+ this.confirmLoading = false
|
|
|
})
|
|
|
},
|
|
|
+ // 维护巡检路线
|
|
|
+ handleAddLine(){
|
|
|
+ },
|
|
|
+ // 维护巡检点
|
|
|
+ handleAddSpot(){
|
|
|
+ this.addType = '巡检点'
|
|
|
+ this.$refs.addSpotRef.add();
|
|
|
+ this.$refs.addSpotRef.title = "选择巡检点";
|
|
|
+ },
|
|
|
+ handleOk(data){
|
|
|
+ console.log(data)
|
|
|
+ if(this.addType === '巡检点'){
|
|
|
+ this.inspectSpotList = data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .inspect-plan-form-list{
|
|
|
+ .plan-table{
|
|
|
+ /deep/ .line-bg{
|
|
|
+ background-color: #f5f2eb; // 黄色
|
|
|
+ }
|
|
|
+ /deep/ .spot-bg{
|
|
|
+ background-color: #ecf3ef; // 绿色
|
|
|
+ // background-color: #e6f7ff; // 蓝色
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 巡检路线下的巡检点
|
|
|
+ /deep/ .line-spot-container{
|
|
|
+ // background-color: #fff;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ // padding: 20px;
|
|
|
+ .line-spot-table{
|
|
|
+ background-color: #ecf3ef;
|
|
|
+ // tr > td{
|
|
|
+ // border: none;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .line-spot-container:hover{
|
|
|
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
|
|
+ }
|
|
|
+ // 巡检点下的巡检内容
|
|
|
+ /deep/ .spot-content-container{
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ padding: 20px;
|
|
|
+ .spot-content-table{
|
|
|
+ background-color: #e6f7ff;
|
|
|
+ // tr > td{
|
|
|
+ // border: none;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ .item-container{
|
|
|
+ background: #fff;
|
|
|
+ padding: 20px;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ .item-table{
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .spot-content-container:hover{
|
|
|
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
|
|
+ }
|
|
|
+ // 表格悬浮颜色
|
|
|
+ /deep/ tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td{
|
|
|
+ background-color: rgba(255,255,255,.4);
|
|
|
}
|
|
|
}
|
|
|
-</script>
|
|
|
+</style>
|