|
@@ -88,6 +88,10 @@
|
|
|
class="j-table-force-nowrap"
|
|
|
@change="handleTableChange">
|
|
|
|
|
|
+ <template slot="status" slot-scope="text, record">
|
|
|
+ <a-switch :checked= "record.status == 0 ? true : false" @click="statusChange(record,$event)" />
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot="htmlSlot" slot-scope="text">
|
|
|
<div v-html="text"></div>
|
|
|
</template>
|
|
@@ -139,6 +143,7 @@
|
|
|
import '@/assets/less/TableExpand.less'
|
|
|
import { mixinDevice } from '@/utils/mixin'
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
import UpkeepPlanModal from './modules/UpkeepPlanModal'
|
|
|
|
|
|
export default {
|
|
@@ -172,6 +177,11 @@
|
|
|
align:"center",
|
|
|
dataIndex: 'planname'
|
|
|
},
|
|
|
+ {
|
|
|
+ title:'设备',
|
|
|
+ align:"center",
|
|
|
+ dataIndex: 'equipmentName'
|
|
|
+ },
|
|
|
// {
|
|
|
// title:'保养工作项目ID',
|
|
|
// align:"center",
|
|
@@ -221,62 +231,59 @@
|
|
|
title:'开始时间',
|
|
|
align:"center",
|
|
|
dataIndex: 'begintime',
|
|
|
- customRender:function (text) {
|
|
|
- return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
- }
|
|
|
+ // customRender:function (text) {
|
|
|
+ // return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
- title:'重复',
|
|
|
+ title:'重复间隔',
|
|
|
align:"center",
|
|
|
dataIndex: 'repeatnum'
|
|
|
},
|
|
|
{
|
|
|
- title:'重复类型:年、月、周、日、时、分',
|
|
|
+ title:'间隔单位',
|
|
|
align:"center",
|
|
|
dataIndex: 'repeattype'
|
|
|
},
|
|
|
{
|
|
|
- title:'提前通知时间',
|
|
|
+ title:'提前通知时长',
|
|
|
align:"center",
|
|
|
dataIndex: 'noticenum'
|
|
|
},
|
|
|
{
|
|
|
- title:'提前通知类型:天、时、分',
|
|
|
+ title:'时长单位',
|
|
|
align:"center",
|
|
|
dataIndex: 'noticetype'
|
|
|
},
|
|
|
+ // 状态(0启用 1停用)
|
|
|
{
|
|
|
- title:'状态(0启用 1停用)',
|
|
|
+ title:'状态',
|
|
|
align:"center",
|
|
|
- dataIndex: 'status'
|
|
|
+ dataIndex: 'status',
|
|
|
+ scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
{
|
|
|
title:'下次执行时间',
|
|
|
align:"center",
|
|
|
dataIndex: 'nexttime',
|
|
|
- customRender:function (text) {
|
|
|
- return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
- }
|
|
|
+ // customRender:function (text) {
|
|
|
+ // return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
title:'下次通知时间',
|
|
|
align:"center",
|
|
|
dataIndex: 'noticetime',
|
|
|
- customRender:function (text) {
|
|
|
- return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
- }
|
|
|
+ // customRender:function (text) {
|
|
|
+ // return !text?"":(text.length>10?text.substr(0,10):text)
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
- title:'是否已通知:是/否',
|
|
|
+ title:'通知状态',
|
|
|
align:"center",
|
|
|
dataIndex: 'ifnotice'
|
|
|
},
|
|
|
{
|
|
|
- title:'设备id(根据设备id查找保养项内容)',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'equipmentid'
|
|
|
- },
|
|
|
- {
|
|
|
title:'备注',
|
|
|
align:"center",
|
|
|
dataIndex: 'remark'
|
|
@@ -296,10 +303,11 @@
|
|
|
deleteBatch: "/cmmsUpkeepPlan/cmmsUpkeepPlan/deleteBatch",
|
|
|
exportXlsUrl: "/cmmsUpkeepPlan/cmmsUpkeepPlan/exportXls",
|
|
|
importExcelUrl: "cmmsUpkeepPlan/cmmsUpkeepPlan/importExcel",
|
|
|
-
|
|
|
+ edit: "/cmmsUpkeepPlan/cmmsUpkeepPlan/updateCmmsUpkeepPlanStatusById",
|
|
|
},
|
|
|
dictOptions:{},
|
|
|
superFieldList:[],
|
|
|
+ model: {}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -338,6 +346,39 @@
|
|
|
fieldList.push({type:'string',value:'ifnotice',text:'是否已通知:是/否',dictCode:''})
|
|
|
fieldList.push({type:'string',value:'equipmentid',text:'设备id(根据设备id查找保养项内容)',dictCode:''})
|
|
|
this.superFieldList = fieldList
|
|
|
+ },
|
|
|
+ statusChange(record,$event){
|
|
|
+ console.log(record.status,$event)
|
|
|
+ let text1 = record.status === "0" ? "是否确认停用“" : "是否确认使用“";
|
|
|
+ let text2 = record.status === "0" ? "”,请确保该设备有可使用的保养计划" : "”,若启用当前保养计划则该设备其他保养计划默认禁用";
|
|
|
+ const that = this
|
|
|
+ that.$confirm({
|
|
|
+ title: "提示",
|
|
|
+ content: text1 + record.planname + text2,
|
|
|
+ onOk() {
|
|
|
+ let httpurl = '';
|
|
|
+ let method = 'put';
|
|
|
+ httpurl+=that.url.edit;
|
|
|
+ if (record.status == 1) {
|
|
|
+ that.model.id = record.id
|
|
|
+ that.model.status = 0
|
|
|
+ } else {
|
|
|
+ that.model.id = record.id
|
|
|
+ that.model.status = 1
|
|
|
+ }
|
|
|
+ httpAction(httpurl,that.model,method).then((res)=>{
|
|
|
+ if(res.success){
|
|
|
+ that.$message.success(res.message);
|
|
|
+ that.modalFormOk()
|
|
|
+ }else{
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
+ // that.modalFormOk()
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|