设备库存,园区设备管理,设备保修信息提交

master
zengchenxi 3 months ago
parent 1546b8e769
commit 6f07402e04

@ -16,14 +16,6 @@ import java.util.Date;
public class ParkEquipmentEntity {
@TableId(value ="ID" )
private String id;
@TableField("CREATE_BY")
private String createBy;
@TableField("CREATION_TIME")
private Date creationTime;
@TableField("UPDATE_BY")
private String updateBy;
@TableField("UPDATE_TIME")
private Date updateTime;
@TableField(value = "EQUIPMENT_CODING" , updateStrategy = FieldStrategy.IGNORED)
private String equipmentCoding;
@TableField(value = "DEVICE_NAME" , updateStrategy = FieldStrategy.IGNORED)
@ -32,8 +24,6 @@ public class ParkEquipmentEntity {
private String equipmentType;
@TableField(value = "EQUIPMENT_BRAND" , updateStrategy = FieldStrategy.IGNORED)
private String equipmentBrand;
@TableField("EQUIPMENT_MODEL")
private String equipmentModel;
@TableField(value = "SUPPLIER" , updateStrategy = FieldStrategy.IGNORED)
private String supplier;
@TableField(value = "SUPPLIER_PHONE" , updateStrategy = FieldStrategy.IGNORED)
@ -66,22 +56,10 @@ public class ParkEquipmentEntity {
private String deviceMacAddress;
@TableField(value = "STATE" , updateStrategy = FieldStrategy.IGNORED)
private String state;
@TableField("EQUIPMENT_WARRANTY_PERIOD")
private String equipmentWarrantyPeriod;
@TableField("EQUIPMENT_CODE")
private String equipmentCode;
@TableField("REMARKS")
private String remarks;
@TableField("OPTIMISTIC_LOCK")
private Integer optimisticLock;
@TableField("CELETE_TAGS")
private Integer celeteTags;
@TableField("COMPANY")
private String company;
@TableField("DEPARTMENT")
private String department;
@TableField("ORGANIZATION")
private String organization;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")

@ -50,7 +50,7 @@ public class ParkEquipmentForm {
/** 状态 **/
@JsonProperty("state")
private Object state;
/** 设备状态(正常、异常) **/
/** 设备状态 **/
@JsonProperty("deviceStatus")
private Object deviceStatus;
/** 设备MAC地址 **/
@ -62,7 +62,25 @@ public class ParkEquipmentForm {
/** 所属区域 **/
@JsonProperty("regionId")
private String regionId;
/** 空间 **/
@JsonProperty("spaceName")
private String spaceName;
/** 所属区域 **/
@JsonProperty("regionName")
private String regionName;
/** 设备描述 **/
@JsonProperty("deviceDescription")
private String deviceDescription;
/** 安装时间 **/
@JsonProperty("installationTime")
private String installationTime;
/** 负责人 **/
@JsonProperty("personInCharge")
private String personInCharge;
/** 负责人联系电话 **/
@JsonProperty("chargePhone")
private String chargePhone;
/** 设备码 **/
@JsonProperty("equipmentCode")
private String equipmentCode;
}

@ -91,9 +91,9 @@
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="所属区域"
prop="regionId" >
<p>{{dataForm.regionId}}</p>
<jnpf-form-tip-item label="区域名称"
prop="regionName" >
<p>{{dataForm.regionName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
@ -102,6 +102,30 @@
<p>{{dataForm.deviceDescription}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="安装时间"
prop="installationTime" >
<p>{{dataForm.installationTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="负责人"
prop="personInCharge" >
<p>{{dataForm.personInCharge}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="负责人联系电话"
prop="chargePhone" >
<p>{{dataForm.chargePhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="设备码"
prop="equipmentCode" >
<p>{{dataForm.equipmentCode}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
@ -139,8 +163,14 @@
deviceStatus : "1",
deviceMacAddress : '',
spaceId : "",
regionName : '',
spaceName : '',
regionId : '',
deviceDescription : '',
installationTime : '',
personInCharge : '',
chargePhone : '',
equipmentCode : '',
},
equipmentTypeOptions:[{"fullName":"类型1","id":"10"},{"fullName":"类型2","id":"20"}],
equipmentTypeProps:{"label":"fullName","value":"id" },

@ -1,12 +1,8 @@
<template>
<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 ? '新建':'编辑'"/>
<el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
@ -15,169 +11,216 @@
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
{{ '上一条' }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
{{ '下一条' }}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> </el-button>
<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" >
<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="8" >
<jnpf-form-tip-item
label="设备编码" prop="equipmentCoding" >
<JnpfInput v-model="dataForm.equipmentCoding" @change="changeData('equipmentCoding',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<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="equipmentCoding">
<JnpfInput v-model="dataForm.equipmentCoding"
@change="changeData('equipmentCoding', -1)" placeholder="请输入" 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="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="设备名称" prop="deviceName">
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="设备类型" prop="equipmentType" >
<JnpfSelect v-model="dataForm.equipmentType" @change="changeData('equipmentType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="equipmentTypeOptions" :props="equipmentTypeProps" >
<el-col :span="8">
<jnpf-form-tip-item label="设备类型" prop="equipmentType">
<JnpfSelect v-model="dataForm.equipmentType" @change="changeData('equipmentType', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }'
:options="equipmentTypeOptions" :props="equipmentTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="设备品牌" prop="equipmentBrand" >
<JnpfInput v-model="dataForm.equipmentBrand" @change="changeData('equipmentBrand',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="设备品牌" prop="equipmentBrand">
<JnpfInput v-model="dataForm.equipmentBrand" @change="changeData('equipmentBrand', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="供应商" prop="supplier" >
<JnpfInput v-model="dataForm.supplier" @change="changeData('supplier',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="供应商" prop="supplier">
<JnpfInput v-model="dataForm.supplier" @change="changeData('supplier', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="供应商联系电话" prop="supplierPhone" >
<JnpfInput v-model="dataForm.supplierPhone" @change="changeData('supplierPhone',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="供应商联系电话" prop="supplierPhone">
<JnpfInput v-model="dataForm.supplierPhone" @change="changeData('supplierPhone', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="设备保修期" prop="equipmentWarranty" >
<JnpfInput v-model="dataForm.equipmentWarranty" @change="changeData('equipmentWarranty',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="设备保修期" prop="equipmentWarranty">
<JnpfInput v-model="dataForm.equipmentWarranty"
@change="changeData('equipmentWarranty', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="保修开始时间" prop="warrantyStartTime" >
<JnpfDatePicker v-model="dataForm.warrantyStartTime" @change="changeData('warrantyStartTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
<el-col :span="8">
<jnpf-form-tip-item label="保修开始时间" prop="warrantyStartTime">
<JnpfDatePicker v-model="dataForm.warrantyStartTime"
@change="changeData('warrantyStartTime', -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="warrantyEndTime" >
<JnpfDatePicker v-model="dataForm.warrantyEndTime" @change="changeData('warrantyEndTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
<el-col :span="8">
<jnpf-form-tip-item label="保修结束时间" prop="warrantyEndTime">
<JnpfDatePicker v-model="dataForm.warrantyEndTime"
@change="changeData('warrantyEndTime', -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="state" >
<JnpfSelect v-model="dataForm.state" @change="changeData('state',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="stateOptions" :props="stateProps" >
<el-col :span="8">
<jnpf-form-tip-item label="状态" prop="state">
<JnpfSelect v-model="dataForm.state" @change="changeData('state', -1)" placeholder="请选择"
clearable :style='{ "width": "100%" }' :options="stateOptions" :props="stateProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="设备状态(正常、异常)" prop="deviceStatus" >
<JnpfSelect v-model="dataForm.deviceStatus" @change="changeData('deviceStatus',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="deviceStatusOptions" :props="deviceStatusProps" >
<el-col :span="8">
<jnpf-form-tip-item label="设备状态(正常、异常)" prop="deviceStatus">
<JnpfSelect v-model="dataForm.deviceStatus" @change="changeData('deviceStatus', -1)"
placeholder="请选择" clearable :style='{ "width": "100%" }'
:options="deviceStatusOptions" :props="deviceStatusProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="设备MAC地址" prop="deviceMacAddress" >
<JnpfInput v-model="dataForm.deviceMacAddress" @change="changeData('deviceMacAddress',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="设备MAC地址" prop="deviceMacAddress">
<JnpfInput v-model="dataForm.deviceMacAddress"
@change="changeData('deviceMacAddress', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="空间" prop="spaceId" >
<JnpfPopupSelect v-model="dataForm.spaceId" @change="changeData('spaceId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.spaceId" placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='spaceId' interfaceId="582825768971670725" :pageSize="20" :columnOptions="spaceIdcolumnOptions" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="空间" prop="spaceId">
<JnpfPopupSelect v-model="dataForm.spaceId" @change="spaceChange" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.spaceId" placeholder="请选择"
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' field='spaceId' interfaceId="582825768971670725" :pageSize="20"
:columnOptions="spaceIdcolumnOptions" clearable :style='{ "width": "100%" }'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="所属区域" prop="regionId" >
<JnpfInput v-model="dataForm.regionId" @change="changeData('regionId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-col :span="8">
<jnpf-form-tip-item label="所属区域" prop="regionName">
<JnpfInput v-model="dataForm.regionName" @change="changeData('regionName', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }' :disabled="true">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="设备描述" prop="deviceDescription" >
<JnpfTextarea v-model="dataForm.deviceDescription" @change="changeData('deviceDescription',-1)"
placeholder="请输入" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}' >
<el-col :span="24">
<jnpf-form-tip-item label="设备描述" prop="deviceDescription">
<JnpfTextarea v-model="dataForm.deviceDescription"
@change="changeData('deviceDescription', -1)" placeholder="请输入"
:style='{ "width": "100%" }' true type="textarea"
:autosize='{ "minRows": 4, "maxRows": 4 }'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<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="installationTime">
<JnpfDatePicker v-model="dataForm.installationTime"
@change="changeData('installationTime', -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="personInCharge">
<JnpfInput v-model="dataForm.personInCharge" @change="changeData('personInCharge', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="负责人联系电话" prop="chargePhone">
<JnpfInput v-model="dataForm.chargePhone" @change="changeData('chargePhone', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="设备码" prop="equipmentCode">
<JnpfInput v-model="dataForm.equipmentCode" @change="changeData('equipmentCode', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
</div>
</transition>
</template>
</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: { },
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 {
@ -191,38 +234,44 @@
loading: false,
btnLoading: false,
formRef: 'formRef',
setting:{},
setting: {},
eventType: '',
userBoxVisible:false,
userBoxVisible: false,
selectDialogVisible: false,
currTableConf:{},
dataValueAll:{},
addTableConf:{
currTableConf: {},
dataValueAll: {},
addTableConf: {
},
//
ableAll:{
ableAll: {
},
tableRows:{
tableRows: {
},
Vmodel:"",
currVmodel:"",
Vmodel: "",
currVmodel: "",
dataForm: {
equipmentCoding : undefined,
deviceName : undefined,
equipmentType : undefined,
equipmentBrand : undefined,
supplier : undefined,
supplierPhone : undefined,
equipmentWarranty : undefined,
warrantyStartTime : undefined,
warrantyEndTime : undefined,
state : "1",
deviceStatus : "1",
deviceMacAddress : undefined,
spaceId : undefined,
regionId : undefined,
deviceDescription : undefined,
equipmentCoding: undefined,
deviceName: undefined,
equipmentType: undefined,
equipmentBrand: undefined,
supplier: undefined,
supplierPhone: undefined,
equipmentWarranty: undefined,
warrantyStartTime: undefined,
warrantyEndTime: undefined,
state: "1",
deviceStatus: "1",
deviceMacAddress: undefined,
spaceId: undefined,
spaceName: undefined,
regionId: undefined,
regionName: undefined,
deviceDescription: undefined,
version: 0,
installationTime: undefined,
personInCharge: undefined,
chargePhone: undefined,
equipmentCode: undefined,
},
tableRequiredData: {},
dataRule:
@ -295,32 +344,69 @@
trigger: 'blur'
},
],
installationTime: [
{
required: true,
message: '请选择',
trigger: 'change'
},
equipmentTypeOptions:[{"fullName":"类型1","id":"10"},{"fullName":"类型2","id":"20"}],
equipmentTypeProps:{"label":"fullName","value":"id" },
stateOptions:[{"fullName":"启用","id":"1"},{"fullName":"禁用","id":"2"}],
stateProps:{"label":"fullName","value":"id" },
deviceStatusOptions:[{"fullName":"正常","id":"1"},{"fullName":"异常","id":"2"}],
deviceStatusProps:{"label":"fullName","value":"id" },
spaceIdcolumnOptions:[ {"label":"园区编码","value":"code"}, {"label":"园区名称","value":"name"}, {"label":"空间面积","value":"space_area"}, {"label":"空间类型","value":"space_type"}, {"label":"租赁开始时间","value":"lease_start_time"}, {"label":"租赁结束时间","value":"lease_end_ime"},],
childIndex:-1,
isEdit:false,
],
personInCharge: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
chargePhone: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
equipmentCode: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
equipmentTypeOptions: [{ "fullName": "类型1", "id": "10" }, { "fullName": "类型2", "id": "20" }],
equipmentTypeProps: { "label": "fullName", "value": "id" },
stateOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
stateProps: { "label": "fullName", "value": "id" },
deviceStatusOptions: [{ "fullName": "正常", "id": "1" }, { "fullName": "异常", "id": "2" }],
deviceStatusProps: { "label": "fullName", "value": "id" },
spaceIdcolumnOptions: [{ "label": "园区编码", "value": "code" }, { "label": "园区名称", "value": "name" }, { "label": "空间面积", "value": "space_area" }, { "label": "空间类型", "value": "space_type" }, { "label": "租赁开始时间", "value": "lease_start_time" }, { "label": "租赁结束时间", "value": "lease_end_ime" },],
childIndex: -1,
isEdit: false,
interfaceRes: {
equipmentCoding:[] ,
deviceName:[] ,
equipmentType:[] ,
equipmentBrand:[] ,
supplier:[] ,
supplierPhone:[] ,
equipmentWarranty:[] ,
warrantyStartTime:[] ,
warrantyEndTime:[] ,
state:[] ,
deviceStatus:[] ,
deviceMacAddress:[] ,
spaceId:[] ,
regionId:[] ,
deviceDescription:[] ,
equipmentCoding: [],
deviceName: [],
equipmentType: [],
equipmentBrand: [],
supplier: [],
supplierPhone: [],
equipmentWarranty: [],
warrantyStartTime: [],
warrantyEndTime: [],
state: [],
deviceStatus: [],
deviceMacAddress: [],
spaceId: [],
regionId: [],
deviceDescription: [],
installationTime: [],
personInCharge: [],
chargePhone: [],
equipmentCode: [],
},
}
},
@ -333,8 +419,13 @@
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
mounted() { },
methods: {
spaceChange(var1, var2) {
this.dataForm.spaceName = var2.name;
this.dataForm.regionId = var2.pid;
this.dataForm.regionName = var2.areaName;
},
prev() {
this.index--
if (this.index === 0) {
@ -363,7 +454,7 @@
},
getInfo(id) {
request({
url: '/api/example/ParkEquipment/'+ id,
url: '/api/example/ParkEquipment/' + id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
@ -387,7 +478,7 @@
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
if (this[options]) {
this[options]()
}
this.changeData(key, index)
@ -396,8 +487,8 @@
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
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) {
@ -411,15 +502,15 @@
}
}
},
dataAll(){
dataAll() {
},
goBack() {
this.$emit('refresh')
},
clearData(){
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id,isDetail,allList) {
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
@ -438,16 +529,16 @@
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/example/ParkEquipment/'+this.dataForm.id,
url: '/api/example/ParkEquipment/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
} else {
this.clearData()
this.initDefaultData()
}
@ -468,7 +559,7 @@
})
},
request() {
let _data =this.dataList()
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
@ -498,13 +589,13 @@
this.$emit('refresh', true)
}
})
}).catch(()=>{
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
} else {
request({
url: '/api/example/ParkEquipment/'+this.dataForm.id,
url: '/api/example/ParkEquipment/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
@ -519,15 +610,15 @@
this.$emit('refresh', true)
}
})
}).catch(()=>{
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
@ -536,8 +627,8 @@
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
@ -604,18 +695,18 @@
}
return timeDataValue;
},
dataList(){
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
this.childIndex = -1
},
},
}
}
</script>

Loading…
Cancel
Save