parent
0c91924906
commit
ade21d0537
File diff suppressed because one or more lines are too long
@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack"
|
||||
content="详情"/>
|
||||
<div class="options">
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="设备编码"
|
||||
prop="deviceCode" >
|
||||
<p>{{dataForm.deviceCode}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="设备名称"
|
||||
prop="deviceName" >
|
||||
<p>{{dataForm.deviceName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="购入日期"
|
||||
prop="buyTime" >
|
||||
<p>{{dataForm.buyTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="所属部门"
|
||||
prop="deviceDept" >
|
||||
<p>{{dataForm.deviceDept}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="维修次数"
|
||||
prop="repairsNum" >
|
||||
<JnpfNumber v-model="dataForm.repairsNum"
|
||||
placeholder="数字文本" disabled
|
||||
:step="1" >
|
||||
</JnpfNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="保养次数"
|
||||
prop="unkeepNum" >
|
||||
<JnpfNumber v-model="dataForm.unkeepNum"
|
||||
placeholder="数字文本" disabled
|
||||
:step="1" >
|
||||
</JnpfNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>检修记录</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.tableField108" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="unkeepType" label="维保类型" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.unkeepType}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startTime" label="维保开始时间" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.startTime}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endTime" label="维保结束时间" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.endTime}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hours" label="总耗时" >
|
||||
<template slot-scope="scope">
|
||||
<JnpfNumber v-model="scope.row.hours"
|
||||
placeholder="总耗时" disabled
|
||||
:step="1" >
|
||||
</JnpfNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unkeepDetails" label="维保详细内容" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.unkeepDetails}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="solution" label="解决办法" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.solution}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unkeepMember" label="维保人员" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.unkeepMember}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="changePartName" label="更换零配件名称" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.changePartName}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="models" label="规格型号" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.models}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="changNum" label="更换数量" >
|
||||
<template slot-scope="scope">
|
||||
<JnpfNumber v-model="scope.row.changNum"
|
||||
placeholder="更换数量" disabled
|
||||
:step="1" >
|
||||
</JnpfNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unkeepDeviceStatus" label="维保后设备状态" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{ scope.row.unkeepDeviceStatus}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="leader" label="操作组长" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.leader}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="estimatedTime" label="预估下次维保时间" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.estimatedTime}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remarks" label="备注" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.remarks}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="创建人"
|
||||
prop="creatorUserId" >
|
||||
<p>{{dataForm.creatorUserId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="创建时间"
|
||||
prop="creatorTime" >
|
||||
<p>{{dataForm.creatorTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="修改人"
|
||||
prop="lastModifyUserId" >
|
||||
<p>{{dataForm.lastModifyUserId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="修改时间"
|
||||
prop="lastModifyTime" >
|
||||
<p>{{dataForm.lastModifyTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: { Detail},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
dataForm: {
|
||||
id :'',
|
||||
deviceCode : '',
|
||||
deviceName : '',
|
||||
buyTime : '',
|
||||
deviceDept : '',
|
||||
repairsNum : 0,
|
||||
unkeepNum : 0,
|
||||
creatorUserId : '',
|
||||
creatorTime : '',
|
||||
lastModifyUserId : '',
|
||||
lastModifyTime : '',
|
||||
enabledStatus : "",
|
||||
yysdeviceunkeeplogsList:[],
|
||||
},
|
||||
enabledStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"未启用","id":"2"}],
|
||||
enabledStatusProps:{"label":"fullName","value":"id" },
|
||||
|
||||
unkeepTypeOptions:[{"fullName":"维修","id":"1"},{"fullName":"保养","id":"2"}],
|
||||
unkeepTypeProps:{"label":"fullName","value":"id" },
|
||||
unkeepDeviceStatusOptions:[{"fullName":"运行正常","id":"1"},{"fullName":"运行异常","id":"2"}],
|
||||
unkeepDeviceStatusProps:{"label":"fullName","value":"id" },
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/YysDeviceUpkeep/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,840 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
|
||||
<div class="options">
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
|
||||
:disabled='continueBtnLoading'> 保
|
||||
存</el-button>
|
||||
<el-button @click="goBack"> 取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="24">
|
||||
<div style="padding:15px 0px">
|
||||
<span style="color: #409EFF;">▋</span>
|
||||
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">基础信息</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="设备编码" prop="deviceCode">
|
||||
<JnpfInput v-model="dataForm.deviceCode" @change="changeData('deviceCode', -1)"
|
||||
placeholder="设备编码" disabled clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="设备名称" prop="deviceName">
|
||||
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)"
|
||||
placeholder="设备名称" disabled clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="购入日期" prop="buyTime">
|
||||
<JnpfDatePicker v-model="dataForm.buyTime" @change="changeData('buyTime', -1)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||
placeholder="可选择购入日期" clearable :style='{ "width": "100%" }' type="date"
|
||||
format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="所属部门" prop="deviceDept">
|
||||
<JnpfDepSelect v-model="dataForm.deviceDept" @change="changeData('deviceDept', -1)"
|
||||
placeholder="请选择" selectType="all" :ableIds="ableAll.deviceDeptableIds" disabled
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfDepSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="维修次数" prop="repairsNum">
|
||||
<JnpfInputNumber v-model="dataForm.repairsNum" @change="changeData('repairsNum', -1)"
|
||||
placeholder="自动统计" disabled :step="1">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="保养次数" prop="unkeepNum">
|
||||
<JnpfInputNumber v-model="dataForm.unkeepNum" @change="changeData('unkeepNum', -1)"
|
||||
placeholder="自动统计" disabled :step="1">
|
||||
</JnpfInputNumber>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<el-col :span="24">
|
||||
<div style="padding:15px 0px">
|
||||
<span style="color: #409EFF;">▋</span>
|
||||
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">检修记录</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-table :data="dataForm.yysdeviceunkeeplogsList" size='small'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column label="维保类型" prop="unkeepType" fixed="left" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>维保类型
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfSelect v-model="scope.row.unkeepType"
|
||||
@change="changeData('yysdeviceunkeeplogs-unkeepType', scope.$index)"
|
||||
placeholder="请选择维保类型" clearable :style='{ "width": "100%" }'
|
||||
:options="yysdeviceunkeeplogsunkeepTypeOptions"
|
||||
:props="yysdeviceunkeeplogsunkeepTypeProps">
|
||||
</JnpfSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="维保开始时间" prop="startTime" fixed="left" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>维保开始时间
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfDatePicker v-model="scope.row.startTime"
|
||||
@change="changeData('yysdeviceunkeeplogs-startTime', scope.$index)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择维保开始时间"
|
||||
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="维保结束时间" prop="endTime" fixed="left" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>维保结束时间
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfDatePicker v-model="scope.row.endTime"
|
||||
@change="changeData('yysdeviceunkeeplogs-endTime', scope.$index)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择维保结束时间"
|
||||
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总耗时" prop="hours" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>总耗时
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInputNumber v-model="scope.row.hours"
|
||||
@change="changeData('yysdeviceunkeeplogs-hours', scope.$index)"
|
||||
placeholder="总耗时" :precision="1" :step="1">
|
||||
</JnpfInputNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维保详细内容" prop="unkeepDetails" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>维保详细内容
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfTextarea v-model="scope.row.unkeepDetails"
|
||||
@change="changeData('yysdeviceunkeeplogs-unkeepDetails', scope.$index)"
|
||||
placeholder="请输入维保详细内容" :style='{ "width": "100%" }' true
|
||||
type="textarea" :autosize='{ "minRows": 2, "maxRows": 2 }'>
|
||||
</JnpfTextarea>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="解决办法" prop="solution" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>解决办法
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfTextarea v-model="scope.row.solution"
|
||||
@change="changeData('yysdeviceunkeeplogs-solution', scope.$index)"
|
||||
placeholder="请输入解决办法" :style='{ "width": "100%" }' true type="textarea"
|
||||
:autosize='{ "minRows": 2, "maxRows": 2 }'>
|
||||
</JnpfTextarea>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维保人员" prop="unkeepMember" width="200">
|
||||
<template slot="header" v-if="true">
|
||||
<span class="required-sign">*</span>维保人员
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfUserSelect v-model="scope.row.unkeepMember"
|
||||
@change="changeData('yysdeviceunkeeplogs-unkeepMember', scope.$index)"
|
||||
placeholder="请选择维保人员" selectType="all"
|
||||
:ableIds="ableAll.yysdeviceunkeeplogsunkeepMemberableIds" clearable
|
||||
:style='{ "width": "100%" }' :multiple="true">
|
||||
</JnpfUserSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更换零配件名称" prop="changePartName" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>更换零配件名称
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.changePartName"
|
||||
@change="changeData('yysdeviceunkeeplogs-changePartName', scope.$index)"
|
||||
placeholder="请输入更换零配件名称" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" prop="models" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>规格型号
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.models"
|
||||
@change="changeData('yysdeviceunkeeplogs-models', scope.$index)"
|
||||
placeholder="请输入规格型号" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更换数量" prop="changNum" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>更换数量
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInputNumber v-model="scope.row.changNum"
|
||||
@change="changeData('yysdeviceunkeeplogs-changNum', scope.$index)"
|
||||
placeholder="更换数量" :step="1">
|
||||
</JnpfInputNumber>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维保后设备状态" prop="unkeepDeviceStatus" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>维保后设备状态
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfSelect v-model="scope.row.unkeepDeviceStatus"
|
||||
@change="changeData('yysdeviceunkeeplogs-unkeepDeviceStatus', scope.$index)"
|
||||
placeholder="请选择维保后设备状态" clearable :style='{ "width": "100%" }'
|
||||
:options="yysdeviceunkeeplogsunkeepDeviceStatusOptions"
|
||||
:props="yysdeviceunkeeplogsunkeepDeviceStatusProps">
|
||||
</JnpfSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作组长" prop="leader" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>操作组长
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfUserSelect v-model="scope.row.leader"
|
||||
@change="changeData('yysdeviceunkeeplogs-leader', scope.$index)"
|
||||
placeholder="请选择操作组长" selectType="all"
|
||||
:ableIds="ableAll.yysdeviceunkeeplogsleaderableIds" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfUserSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="预估下次维保时间" prop="estimatedTime" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>预估下次维保时间
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfDatePicker v-model="scope.row.estimatedTime"
|
||||
@change="changeData('yysdeviceunkeeplogs-estimatedTime', scope.$index)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="预估下次维保时间"
|
||||
clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remarks" width="200">
|
||||
<template slot="header" v-if="false">
|
||||
<span class="required-sign">*</span>备注
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfTextarea v-model="scope.row.remarks"
|
||||
@change="changeData('yysdeviceunkeeplogs-remarks', scope.$index)"
|
||||
placeholder="请输入备注" :style='{ "width": "100%" }' true type="textarea"
|
||||
:autosize='{ "minRows": 4, "maxRows": 4 }'>
|
||||
</JnpfTextarea>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delyysdeviceunkeeplogsList(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addyysdeviceunkeeplogsList()">
|
||||
<el-button type="text" icon="el-icon-plus">新增</el-button>
|
||||
</div>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="创建人" prop="creatorUserId">
|
||||
<JnpfInput v-model="dataForm.creatorUserId" @change="changeData('creatorUserId', -1)"
|
||||
placeholder="自动生成" disabled clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="创建时间" prop="creatorTime">
|
||||
<JnpfDatePicker v-model="dataForm.creatorTime" @change="changeData('creatorTime', -1)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||
placeholder="自动生成" disabled clearable :style='{ "width": "100%" }' type="date"
|
||||
format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="修改人" prop="lastModifyUserId">
|
||||
<JnpfInput v-model="dataForm.lastModifyUserId"
|
||||
@change="changeData('lastModifyUserId', -1)" placeholder="修改时记录" disabled clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item label="修改时间" prop="lastModifyTime">
|
||||
<JnpfDatePicker v-model="dataForm.lastModifyTime"
|
||||
@change="changeData('lastModifyTime', -1)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||
placeholder="修改时记录" disabled clearable :style='{ "width": "100%" }' type="date"
|
||||
format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||
@select="addForSelect" @close="selectDialogVisible = false" />
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from "vuex";
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
yysdeviceunkeeplogsList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
yysdeviceunkeeplogsList: {
|
||||
unkeepTypeOptions: [],
|
||||
startTime: '',
|
||||
startTimeOptions: [],
|
||||
endTime: '',
|
||||
endTimeOptions: [],
|
||||
hours: undefined,
|
||||
hoursOptions: [],
|
||||
unkeepDetails: '',
|
||||
unkeepDetailsOptions: [],
|
||||
solution: '',
|
||||
solutionOptions: [],
|
||||
unkeepMember: [],
|
||||
unkeepMemberOptions: [],
|
||||
changePartName: '',
|
||||
changePartNameOptions: [],
|
||||
models: '',
|
||||
modelsOptions: [],
|
||||
changNum: undefined,
|
||||
changNumOptions: [],
|
||||
unkeepDeviceStatusOptions: [],
|
||||
leaderOptions: [],
|
||||
estimatedTime: '',
|
||||
estimatedTimeOptions: [],
|
||||
remarks: '',
|
||||
remarksOptions: [],
|
||||
enabledmark: undefined
|
||||
},
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
deviceCode: undefined,
|
||||
deviceName: undefined,
|
||||
buyTime: undefined,
|
||||
deviceDept: undefined,
|
||||
repairsNum: 0,
|
||||
unkeepNum: 0,
|
||||
creatorUserId: undefined,
|
||||
creatorTime: undefined,
|
||||
lastModifyUserId: undefined,
|
||||
lastModifyTime: undefined,
|
||||
enabledStatus: undefined,
|
||||
yysdeviceunkeeplogsList: [],
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
},
|
||||
enabledStatusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "未启用", "id": "2" }],
|
||||
enabledStatusProps: { "label": "fullName", "value": "id" },
|
||||
yysdeviceunkeeplogsunkeepTypeOptions: [{ "fullName": "维修", "id": "1" }, { "fullName": "保养", "id": "2" }],
|
||||
yysdeviceunkeeplogsunkeepTypeProps: { "label": "fullName", "value": "id" },
|
||||
yysdeviceunkeeplogsunkeepDeviceStatusOptions: [{ "fullName": "运行正常", "id": "1" }, { "fullName": "运行异常", "id": "2" }],
|
||||
yysdeviceunkeeplogsunkeepDeviceStatusProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
deviceCode: [],
|
||||
deviceName: [],
|
||||
buyTime: [],
|
||||
deviceDept: [],
|
||||
repairsNum: [],
|
||||
unkeepNum: [],
|
||||
creatorUserId: [],
|
||||
creatorTime: [],
|
||||
lastModifyUserId: [],
|
||||
lastModifyTime: [],
|
||||
enabledStatus: [],
|
||||
yysdeviceunkeeplogsunkeepType: [],
|
||||
yysdeviceunkeeplogsstartTime: [],
|
||||
yysdeviceunkeeplogsendTime: [],
|
||||
yysdeviceunkeeplogshours: [],
|
||||
yysdeviceunkeeplogsunkeepDetails: [],
|
||||
yysdeviceunkeeplogssolution: [],
|
||||
yysdeviceunkeeplogsunkeepMember: [],
|
||||
yysdeviceunkeeplogschangePartName: [],
|
||||
yysdeviceunkeeplogsmodels: [],
|
||||
yysdeviceunkeeplogschangNum: [],
|
||||
yysdeviceunkeeplogsunkeepDeviceStatus: [],
|
||||
yysdeviceunkeeplogsleader: [],
|
||||
yysdeviceunkeeplogsestimatedTime: [],
|
||||
yysdeviceunkeeplogsremarks: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/example/YysDeviceUpkeep/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
},
|
||||
yysdeviceunkeeplogsExist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.yysdeviceunkeeplogsList.length; i++) {
|
||||
const e = this.dataForm.yysdeviceunkeeplogsList[i];
|
||||
if (!e.unkeepType) {
|
||||
this.$message({
|
||||
message: '维保类型不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.startTime) {
|
||||
this.$message({
|
||||
message: '维保开始时间不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.endTime) {
|
||||
this.$message({
|
||||
message: '维保结束时间不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.hours) {
|
||||
this.$message({
|
||||
message: '总耗时不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.unkeepDetails) {
|
||||
this.$message({
|
||||
message: '维保详细内容不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.solution) {
|
||||
this.$message({
|
||||
message: '解决办法不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.unkeepMember.length) {
|
||||
this.$message({
|
||||
message: '维保人员不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/YysDeviceUpkeep/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.yysdeviceunkeeplogsExist()) return
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/YysDeviceUpkeep',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/YysDeviceUpkeep/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
addyysdeviceunkeeplogsList() {
|
||||
let item = {
|
||||
unkeepType: '',
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
hours: undefined,
|
||||
unkeepDetails: '',
|
||||
solution: undefined,
|
||||
unkeepMember: [],
|
||||
changePartName: undefined,
|
||||
models: undefined,
|
||||
changNum: undefined,
|
||||
unkeepDeviceStatus: '',
|
||||
leader: undefined,
|
||||
estimatedTime: undefined,
|
||||
remarks: undefined,
|
||||
}
|
||||
this.getyysdeviceunkeeplogsList(item)
|
||||
},
|
||||
delyysdeviceunkeeplogsList(index) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dataForm.yysdeviceunkeeplogsList.splice(index, 1);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
getyysdeviceunkeeplogsList(value) {
|
||||
let item = { ...this.tableRows.yysdeviceunkeeplogsList, ...value }
|
||||
this.dataForm.yysdeviceunkeeplogsList.push(item)
|
||||
this.childIndex = this.dataForm.yysdeviceunkeeplogsList.length - 1
|
||||
this.isEdit = true
|
||||
this.isEdit = false
|
||||
this.childIndex = -1
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
for (let i = 0; i < _dataAll.yysdeviceunkeeplogsList.length; i++) {
|
||||
this.childIndex = i
|
||||
}
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue