设备模块添加表单校验

1.2.6
zhouhy 10 months ago
parent ce1773f640
commit 6544f3b74d

@ -100,4 +100,12 @@ public class DmsBaseDeviceTypeController extends BaseController
{ {
return toAjax(dmsBaseDeviceTypeService.deleteDmsBaseDeviceTypeByDeviceTypeIds(deviceTypeIds)); return toAjax(dmsBaseDeviceTypeService.deleteDmsBaseDeviceTypeByDeviceTypeIds(deviceTypeIds));
} }
@RequiresPermissions("dms:devicetype:list")
@GetMapping("/selectDevicetypeByDeviceId")
public AjaxResult selectDevicetypeByDeviceId(Long deviceId)
{
List<DmsBaseDeviceType> list = dmsBaseDeviceTypeService.selectDevicetypeByDeviceId(deviceId);
return success(list);
}
} }

@ -49,6 +49,15 @@ public class DmsBaseDeviceDepreciation extends BaseEntity
/** 是否标识1-是2-否 */ /** 是否标识1-是2-否 */
@Excel(name = "是否标识1-是2-否") @Excel(name = "是否标识1-是2-否")
private Long isFlag; private Long isFlag;
private String deviceName;
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public void setDeviceDepreciationId(Long deviceDepreciationId) public void setDeviceDepreciationId(Long deviceDepreciationId)
{ {

@ -58,4 +58,6 @@ public interface DmsBaseDeviceTypeMapper
* @return * @return
*/ */
public int deleteDmsBaseDeviceTypeByDeviceTypeIds(Long[] deviceTypeIds); public int deleteDmsBaseDeviceTypeByDeviceTypeIds(Long[] deviceTypeIds);
public List<DmsBaseDeviceType> selectDevicetypeByDeviceId(Long deviceId);
} }

@ -58,4 +58,6 @@ public interface IDmsBaseDeviceTypeService
* @return * @return
*/ */
public int deleteDmsBaseDeviceTypeByDeviceTypeId(Long deviceTypeId); public int deleteDmsBaseDeviceTypeByDeviceTypeId(Long deviceTypeId);
public List<DmsBaseDeviceType> selectDevicetypeByDeviceId(Long deviceId);
} }

@ -2,6 +2,7 @@ package com.hw.dms.service.impl;
import java.util.List; import java.util.List;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDeviceDepreciationMapper; import com.hw.dms.mapper.DmsBaseDeviceDepreciationMapper;
@ -53,6 +54,9 @@ public class DmsBaseDeviceDepreciationServiceImpl implements IDmsBaseDeviceDepre
@Override @Override
public int insertDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation) public int insertDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation)
{ {
LoginUser user = new LoginUser();
dmsBaseDeviceDepreciation.setCreateBy(user.getUsername());
dmsBaseDeviceDepreciation.setIsFlag(1l);
dmsBaseDeviceDepreciation.setCreateTime(DateUtils.getNowDate()); dmsBaseDeviceDepreciation.setCreateTime(DateUtils.getNowDate());
return dmsBaseDeviceDepreciationMapper.insertDmsBaseDeviceDepreciation(dmsBaseDeviceDepreciation); return dmsBaseDeviceDepreciationMapper.insertDmsBaseDeviceDepreciation(dmsBaseDeviceDepreciation);
} }
@ -66,6 +70,8 @@ public class DmsBaseDeviceDepreciationServiceImpl implements IDmsBaseDeviceDepre
@Override @Override
public int updateDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation) public int updateDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation)
{ {
LoginUser user = new LoginUser();
dmsBaseDeviceDepreciation.setUpdateBy(user.getUsername());
dmsBaseDeviceDepreciation.setUpdateTime(DateUtils.getNowDate()); dmsBaseDeviceDepreciation.setUpdateTime(DateUtils.getNowDate());
return dmsBaseDeviceDepreciationMapper.updateDmsBaseDeviceDepreciation(dmsBaseDeviceDepreciation); return dmsBaseDeviceDepreciationMapper.updateDmsBaseDeviceDepreciation(dmsBaseDeviceDepreciation);
} }

@ -2,6 +2,8 @@ package com.hw.dms.service.impl;
import java.util.List; import java.util.List;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.dms.domain.DmsBaseDeviceBom;
import com.hw.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDeviceTypeMapper; import com.hw.dms.mapper.DmsBaseDeviceTypeMapper;
@ -53,7 +55,20 @@ public class DmsBaseDeviceTypeServiceImpl implements IDmsBaseDeviceTypeService
@Override @Override
public int insertDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType) public int insertDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType)
{ {
LoginUser user = new LoginUser();
dmsBaseDeviceType.setCreateBy(user.getUsername());
dmsBaseDeviceType.setIsFlag(1l);
dmsBaseDeviceType.setCreateTime(DateUtils.getNowDate()); dmsBaseDeviceType.setCreateTime(DateUtils.getNowDate());
//如果有父级 则查询父级祖籍列表 +父级编号
if (dmsBaseDeviceType.getParentId()==0){
dmsBaseDeviceType.setAncestors("0");
}
else{
DmsBaseDeviceType dmsBaseDeviceType1 = new DmsBaseDeviceType();
dmsBaseDeviceType1.setParentId(dmsBaseDeviceType.getParentId());
String ancestors = dmsBaseDeviceTypeMapper.selectDmsBaseDeviceTypeList(dmsBaseDeviceType1).get(0).getAncestors();
dmsBaseDeviceType.setAncestors(ancestors+","+dmsBaseDeviceType.getParentId());
}
return dmsBaseDeviceTypeMapper.insertDmsBaseDeviceType(dmsBaseDeviceType); return dmsBaseDeviceTypeMapper.insertDmsBaseDeviceType(dmsBaseDeviceType);
} }
@ -66,7 +81,19 @@ public class DmsBaseDeviceTypeServiceImpl implements IDmsBaseDeviceTypeService
@Override @Override
public int updateDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType) public int updateDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType)
{ {
LoginUser user = new LoginUser();
dmsBaseDeviceType.setUpdateBy(user.getUsername());
dmsBaseDeviceType.setUpdateTime(DateUtils.getNowDate()); dmsBaseDeviceType.setUpdateTime(DateUtils.getNowDate());
//如果有父级 则查询父级祖籍列表 +父级编号
if (dmsBaseDeviceType.getParentId()==0){
dmsBaseDeviceType.setAncestors("0");
}
else{
DmsBaseDeviceType dmsBaseDeviceType1 = new DmsBaseDeviceType();
dmsBaseDeviceType1.setParentId(dmsBaseDeviceType.getParentId());
String ancestors = dmsBaseDeviceTypeMapper.selectDmsBaseDeviceTypeList(dmsBaseDeviceType1).get(0).getAncestors();
dmsBaseDeviceType.setAncestors(ancestors+","+dmsBaseDeviceType.getParentId());
}
return dmsBaseDeviceTypeMapper.updateDmsBaseDeviceType(dmsBaseDeviceType); return dmsBaseDeviceTypeMapper.updateDmsBaseDeviceType(dmsBaseDeviceType);
} }
@ -93,4 +120,9 @@ public class DmsBaseDeviceTypeServiceImpl implements IDmsBaseDeviceTypeService
{ {
return dmsBaseDeviceTypeMapper.deleteDmsBaseDeviceTypeByDeviceTypeId(deviceTypeId); return dmsBaseDeviceTypeMapper.deleteDmsBaseDeviceTypeByDeviceTypeId(deviceTypeId);
} }
@Override
public List<DmsBaseDeviceType> selectDevicetypeByDeviceId(Long deviceId) {
return dmsBaseDeviceTypeMapper.selectDevicetypeByDeviceId(deviceId);
}
} }

@ -54,6 +54,9 @@ public class DmsBaseInspectProjectServiceImpl implements IDmsBaseInspectProjectS
@Override @Override
public int insertDmsBaseInspectProject(DmsBaseInspectProject dmsBaseInspectProject) public int insertDmsBaseInspectProject(DmsBaseInspectProject dmsBaseInspectProject)
{ {
if (dmsBaseInspectProject.getInspectType()==null){
dmsBaseInspectProject.setInspectType("1");
}
LoginUser user = new LoginUser(); LoginUser user = new LoginUser();
dmsBaseInspectProject.setIsFlag("1"); dmsBaseInspectProject.setIsFlag("1");
dmsBaseInspectProject.setCreateBy(user.getUsername()); dmsBaseInspectProject.setCreateBy(user.getUsername());

@ -55,6 +55,9 @@ public class DmsBaseInspectRouteServiceImpl implements IDmsBaseInspectRouteServi
@Override @Override
public int insertDmsBaseInspectRoute(DmsBaseInspectRoute dmsBaseInspectRoute) public int insertDmsBaseInspectRoute(DmsBaseInspectRoute dmsBaseInspectRoute)
{ {
if (dmsBaseInspectRoute.getInspectType()==null){
dmsBaseInspectRoute.setInspectType("1");
}
LoginUser user = new LoginUser(); LoginUser user = new LoginUser();
dmsBaseInspectRoute.setCreateBy(user.getUsername()); dmsBaseInspectRoute.setCreateBy(user.getUsername());
dmsBaseInspectRoute.setIsFlag("1"); dmsBaseInspectRoute.setIsFlag("1");

@ -59,9 +59,11 @@ public class DmsFlowCheckplanServiceImpl implements IDmsFlowCheckplanService
@Override @Override
public int insertDmsFlowCheckplan(DmsFlowCheckplan dmsFlowCheckplan) public int insertDmsFlowCheckplan(DmsFlowCheckplan dmsFlowCheckplan)
{ {
LoginUser loginUser = new LoginUser(); LoginUser loginUser = new LoginUser();
dmsFlowCheckplan.setCreateBy(loginUser.getUsername()); dmsFlowCheckplan.setCreateBy(loginUser.getUsername());
dmsFlowCheckplan.setCreateTime(DateUtils.getNowDate()); dmsFlowCheckplan.setCreateTime(DateUtils.getNowDate());
dmsFlowCheckplan.setCheckBy(loginUser.getUsername());
int rows = dmsFlowCheckplanMapper.insertDmsFlowCheckplan(dmsFlowCheckplan); int rows = dmsFlowCheckplanMapper.insertDmsFlowCheckplan(dmsFlowCheckplan);
insertDmsFlowCheckplanDetail(dmsFlowCheckplan); insertDmsFlowCheckplanDetail(dmsFlowCheckplan);
return rows; return rows;

@ -25,15 +25,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectDmsBaseDeviceDepreciationList" parameterType="DmsBaseDeviceDepreciation" resultMap="DmsBaseDeviceDepreciationResult"> <select id="selectDmsBaseDeviceDepreciationList" parameterType="DmsBaseDeviceDepreciation" resultMap="DmsBaseDeviceDepreciationResult">
<include refid="selectDmsBaseDeviceDepreciationVo"/> select a.device_depreciation_id, a.device_id, a.repair_frequency, a.repair_costs, a.depreciation_cost, a.putinto_time, a.use_life, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time
from dms_base_device_depreciation a
left join dms_base_device_ledger b on a.device_id = b.device_id
<where> <where>
<if test="deviceId != null "> and device_id = #{deviceId}</if> <if test="deviceId != null "> and a.device_id = #{deviceId}</if>
<if test="repairFrequency != null "> and repair_frequency = #{repairFrequency}</if> <if test="repairFrequency != null "> and a.repair_frequency = #{repairFrequency}</if>
<if test="repairCosts != null "> and repair_costs = #{repairCosts}</if> <if test="repairCosts != null "> and a.repair_costs = #{repairCosts}</if>
<if test="depreciationCost != null "> and depreciation_cost = #{depreciationCost}</if> <if test="depreciationCost != null "> and a.depreciation_cost = #{depreciationCost}</if>
<if test="putintoTime != null "> and putinto_time = #{putintoTime}</if> <if test="params.beginTime != null and params.endTime != null">and a.putinto_time between #{params.beginTime} and #{params.endTime}</if>
<if test="useLife != null "> and use_life = #{useLife}</if> <if test="useLife != null "> and a.use_life = #{useLife}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if> <if test="isFlag != null "> and a.is_flag = #{isFlag}</if>
<if test="deviceName != null "> and b.device_name like concat('%', #{deviceName},'%')</if>
</where> </where>
</select> </select>

@ -93,4 +93,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceTypeId} #{deviceTypeId}
</foreach> </foreach>
</delete> </delete>
<select id="selectDevicetypeByDeviceId" parameterType="Long" resultMap="DmsBaseDeviceTypeResult">
select a.device_type_id, a.parent_id, a.type_code, a.type_name, a.is_flag, a.ancestors, a.remark, a.create_by, a.create_time, a.update_by, a.update_time
from dms_base_device_type a
left join dms_base_device_ledger b on a.device_type_id = b.device_type_id
<where>
<if test="deviceId != null and deviceId != ''"> and b.device_id = #{deviceId}</if>
</where>
</select>
</mapper> </mapper>

@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDmsFlowCheckplanList" parameterType="DmsFlowCheckplan" resultMap="DmsFlowCheckplanResult"> <select id="selectDmsFlowCheckplanList" parameterType="DmsFlowCheckplan" resultMap="DmsFlowCheckplanResult">
<include refid="selectDmsFlowCheckplanVo"/> <include refid="selectDmsFlowCheckplanVo"/>
<where> <where>
<if test="flowCheckplanId!=null and flowCheckplanId!=''">and flow_checkplan_id = #{flowCheckplanId}</if>
<if test="checkCode != null and checkCode != ''"> and check_code like concat( '%',#{checkCode},'%')</if> <if test="checkCode != null and checkCode != ''"> and check_code like concat( '%',#{checkCode},'%')</if>
<if test="planTime != null "> and plan_time = #{planTime}</if> <if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="checkBy != null and checkBy != ''"> and check_by = #{checkBy}</if> <if test="checkBy != null and checkBy != ''"> and check_by = #{checkBy}</if>

@ -36,8 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if> <if test="inspectRouteId != null "> and inspect_route_id = #{inspectRouteId}</if>
<if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if> <if test="deviceAmount != null "> and device_amount = #{deviceAmount}</if>
<if test="planTime != null "> and plan_time = #{planTime}</if> <if test="planTime != null "> and plan_time = #{planTime}</if>
<if test="realBeginTime != null "> and real_begin_time >=#{realBeginTime}</if> <if test="realBeginTime != null "> and #{realBeginTime}>=real_begin_time</if>
<if test="realEndTime != null "> and #{realEndTime} >= real_end_time</if> <if test="realEndTime != null "> and real_end_time >= #{realEndTime}</if>
<if test="performer != null and performer != ''"> and performer = #{performer}</if> <if test="performer != null and performer != ''"> and performer = #{performer}</if>
<if test="inspectStatus != null "> and inspect_status = #{inspectStatus}</if> <if test="inspectStatus != null "> and inspect_status = #{inspectStatus}</if>
<if test="inspectDuration != null "> and inspect_duration = #{inspectDuration}</if> <if test="inspectDuration != null "> and inspect_duration = #{inspectDuration}</if>

@ -74,6 +74,8 @@
"connect": "3.6.6", "connect": "3.6.6",
"eslint": "7.15.0", "eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0", "eslint-plugin-vue": "7.2.0",
"less": "^4.2.0",
"less-loader": "^12.1.0",
"lint-staged": "10.5.3", "lint-staged": "10.5.3",
"runjs": "4.4.2", "runjs": "4.4.2",
"sass": "1.32.13", "sass": "1.32.13",

@ -42,3 +42,13 @@ export function delDevicetype(deviceTypeId) {
method: 'delete' method: 'delete'
}) })
} }
//根据设备id查询设备类型信息
export function selectDevicetypeByDeviceId(query) {
return request({
url: '/dms/devicetype/selectDevicetypeByDeviceId',
method: 'get',
params: query
})
}

@ -1,14 +1,14 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="父级标识" prop="parentId"> <!-- <el-form-item label="父级标识" prop="parentId">-->
<el-input <!-- <el-input-->
v-model="queryParams.parentId" <!-- v-model="queryParams.parentId"-->
placeholder="请输入父级标识" <!-- placeholder="请输入父级标识"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="类型编号" prop="typeCode"> <el-form-item label="类型编号" prop="typeCode">
<el-input <el-input
v-model="queryParams.typeCode" v-model="queryParams.typeCode"
@ -25,22 +25,22 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否标识1-是2-否" prop="isFlag"> <!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<el-input <!-- <el-input-->
v-model="queryParams.isFlag" <!-- v-model="queryParams.isFlag"-->
placeholder="请输入是否标识1-是2-否" <!-- placeholder="请输入是否标识1-是2-否"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="祖级列表" prop="ancestors"> <!-- <el-form-item label="祖级列表" prop="ancestors">-->
<el-input <!-- <el-input-->
v-model="queryParams.ancestors" <!-- v-model="queryParams.ancestors"-->
placeholder="请输入祖级列表" <!-- placeholder="请输入祖级列表"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -78,11 +78,11 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column label="父级标识" prop="parentId" /> <!-- <el-table-column label="父级标识" prop="parentId" />-->
<el-table-column label="类型编号" align="center" prop="typeCode" /> <el-table-column label="类型编号" align="center" prop="typeCode" />
<el-table-column label="类型名称" align="center" prop="typeName" /> <el-table-column label="类型名称" align="center" prop="typeName" />
<el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" /> <!-- <el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" />-->
<el-table-column label="祖级列表" align="center" prop="ancestors" /> <!-- <el-table-column label="祖级列表" align="center" prop="ancestors" />-->
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -123,9 +123,9 @@
<el-form-item label="类型名称" prop="typeName"> <el-form-item label="类型名称" prop="typeName">
<el-input v-model="form.typeName" placeholder="请输入类型名称" /> <el-input v-model="form.typeName" placeholder="请输入类型名称" />
</el-form-item> </el-form-item>
<el-form-item label="是否标识1-是2-否" prop="isFlag"> <!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" /> <!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>

@ -268,7 +268,8 @@ export default {
{ required: true, message: "设备ID关联dms_base_device_ledger的device_id不能为空", trigger: "blur" } { required: true, message: "设备ID关联dms_base_device_ledger的device_id不能为空", trigger: "blur" }
], ],
bomAmount: [ bomAmount: [
{ required: true, message: "bom数量不能为空", trigger: "blur" } { required: true, message: "bom数量不能为空", trigger: "blur" },
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字', trigger: 'blur'}
], ],
} }
}; };

@ -242,66 +242,66 @@
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
<el-divider content-position="center">设备盘点明细信息</el-divider> <!-- <el-divider content-position="center">设备盘点明细信息</el-divider>-->
<el-row :gutter="10" class="mb8"> <!-- <el-row :gutter="10" class="mb8">-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDmsFlowCheckplanDetail"></el-button> <!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDmsFlowCheckplanDetail"></el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDmsFlowCheckplanDetail"></el-button> <!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDmsFlowCheckplanDetail"></el-button>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
<el-table :data="dmsFlowCheckplanDetailList" :row-class-name="rowDmsFlowCheckplanDetailIndex" @selection-change="handleDmsFlowCheckplanDetailSelectionChange" ref="dmsFlowCheckplanDetail"> <!-- <el-table :data="dmsFlowCheckplanDetailList" :row-class-name="rowDmsFlowCheckplanDetailIndex" @selection-change="handleDmsFlowCheckplanDetailSelectionChange" ref="dmsFlowCheckplanDetail">-->
<el-table-column type="selection" width="50" align="center" /> <!-- <el-table-column type="selection" width="50" align="center" />-->
<el-table-column label="序号" align="center" prop="index" width="50"/> <!-- <el-table-column label="序号" align="center" prop="index" width="50"/>-->
<el-table-column label="设备编号" prop="deviceId" width="150"> <!-- <el-table-column label="设备编号" prop="deviceId" width="150">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.deviceId" placeholder="请输入设备ID。关联dms_base_device_ledger的device_id" />--> <!--&lt;!&ndash; <el-input v-model="scope.row.deviceId" placeholder="请输入设备ID。关联dms_base_device_ledger的device_id" />&ndash;&gt;-->
<el-select v-model="scope.row.deviceId" placeholder="请选择设备"> <!-- <el-select v-model="scope.row.deviceId" placeholder="请选择设备">-->
<el-option <!-- <el-option-->
v-for="item in ledgerList" <!-- v-for="item in ledgerList"-->
:key="item.deviceId" <!-- :key="item.deviceId"-->
:label="item.deviceName" <!-- :label="item.deviceName"-->
:value="item.deviceId"> <!-- :value="item.deviceId">-->
</el-option> <!-- </el-option>-->
</el-select> <!-- </el-select>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="盘点时间" prop="checkTime" width="240"> <!-- <el-table-column label="盘点时间" prop="checkTime" width="240">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-date-picker clearable v-model="scope.row.checkTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择盘点时间" /> <!-- <el-date-picker clearable v-model="scope.row.checkTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择盘点时间" />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="盘点结果" prop="variationFlag" width="150"> <!-- <el-table-column label="盘点结果" prop="variationFlag" width="150">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.variationFlag" placeholder="请输入盘点结果(0:默认未盘点,1:已盘点)" />--> <!--&lt;!&ndash; <el-input v-model="scope.row.variationFlag" placeholder="请输入盘点结果(0:默认未盘点,1:已盘点)" />&ndash;&gt;-->
<el-select v-model="scope.row.variationFlag" placeholder="请选择性别"> <!-- <el-select v-model="scope.row.variationFlag" placeholder="请选择性别">-->
<el-option <!-- <el-option-->
v-for="dict in dict.type.dms_variation_flag" <!-- v-for="dict in dict.type.dms_variation_flag"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="Number(dict.value)" <!-- :value="Number(dict.value)"-->
></el-option> <!-- ></el-option>-->
</el-select> <!-- </el-select>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="跳过原因" prop="skipCause" width="150"> <!-- <el-table-column label="跳过原因" prop="skipCause" width="150">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-input v-model="scope.row.skipCause" placeholder="请输入跳过原因" /> <!-- <el-input v-model="scope.row.skipCause" placeholder="请输入跳过原因" />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="盘点人" prop="checkPerson" width="150"> <!-- <el-table-column label="盘点人" prop="checkPerson" width="150">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-input v-model="scope.row.checkPerson" placeholder="请输入盘点人" /> <!-- <el-input v-model="scope.row.checkPerson" placeholder="请输入盘点人" />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="上次盘点时间" prop="lastCheckTime" width="240"> <!-- <el-table-column label="上次盘点时间" prop="lastCheckTime" width="240">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<el-date-picker clearable v-model="scope.row.lastCheckTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上次盘点时间" /> <!-- <el-date-picker clearable v-model="scope.row.lastCheckTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上次盘点时间" />-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> <!-- </el-table>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -369,6 +369,9 @@ export default {
checkState: [ checkState: [
{ required: true, message: "盘点状态(0未盘点1已盘点2盘点中)不能为空", trigger: "blur" } { required: true, message: "盘点状态(0未盘点1已盘点2盘点中)不能为空", trigger: "blur" }
], ],
checkAmount:[{pattern:/^[1-9]\d*$/,message: "盘点数量必须为数字",trigger: "blur" }],
surplusCheckAmount:[{pattern:/^[1-9]\d*$/,message: "剩余数量必须为数字",trigger: "blur" }],
} }
}; };
}, },

@ -168,13 +168,13 @@
<el-form-item label="项目编号" prop="inspectProjectCode"> <el-form-item label="项目编号" prop="inspectProjectCode">
<el-input v-model="form.inspectProjectCode" placeholder="请输入项目编号" /> <el-input v-model="form.inspectProjectCode" placeholder="请输入项目编号" />
</el-form-item> </el-form-item>
<el-form-item label="巡检项目" prop="inspectProject"> <el-form-item label="项目名称" prop="inspectProject">
<el-input v-model="form.inspectProject" placeholder="请输入巡检项目" /> <el-input v-model="form.inspectProject" placeholder="请输入巡检项目" />
</el-form-item> </el-form-item>
<el-form-item label="记录方式" prop="recordMethod"> <el-form-item label="记录方式" prop="recordMethod">
<el-input v-model="form.recordMethod" placeholder="请输入记录方式" /> <el-input v-model="form.recordMethod" placeholder="请输入记录方式" />
</el-form-item> </el-form-item>
<el-form-item label="检查类型" prop="checkState"> <el-form-item label="检查类型" prop="inspectType">
<el-radio-group v-model="form.inspectType"> <el-radio-group v-model="form.inspectType">
<el-radio <el-radio
v-for="dict in dict.type.dms_inspect_type" v-for="dict in dict.type.dms_inspect_type"
@ -251,14 +251,19 @@ export default {
// //
rules: { rules: {
inspectProject: [ inspectProject: [
{ required: true, message: "巡检项目不能为空", trigger: "blur" } { required: true, message: "项目名称不能为空", trigger: "blur" }
],
inspectProjectCode: [
{ required: true, message: "项目编号不能为空", trigger: "blur" }
], ],
inspectType: [ inspectType: [
{ required: true, message: "检查类型(1巡检,2点检)不能为空", trigger: "change" } { required: true, message: "检查类型(1巡检,2点检)不能为空", trigger: "change" }
], ],
isFlag: [ upLimit:[{pattern:/^[1-9]\d*$/,message: "上限必须为数字",trigger: "blur" }],
{ required: true, message: "是否标识1-是0-否不能为空", trigger: "blur" } lowLimit:[{pattern:/^[1-9]\d*$/,message: "下限必须为数字",trigger: "blur" }],
], defValue:[{pattern:/^[1-9]\d*$/,message: "默认值必须为数字",trigger: "blur" }],
} }
}; };
}, },

@ -281,14 +281,14 @@ export default {
{ required: true, message: "线路名称不能为空", trigger: "blur" } { required: true, message: "线路名称不能为空", trigger: "blur" }
], ],
inspectType: [ inspectType: [
{ required: true, message: "线路类型(1巡检,2点检)不能为空", trigger: "change" } { required: true, message: "线路类型", trigger: "blur" }
], ],
deviceTypeId: [ deviceTypeId: [
{ required: true, message: "设备类型ID关联dms_base_device_type的device_type_id不能为空", trigger: "blur" } { required: true, message: "设备类型ID关联dms_base_device_type的device_type_id不能为空", trigger: "blur" }
], ],
isFlag: [ // isFlag: [
{ required: true, message: "是否标识1-是0-否不能为空", trigger: "blur" } // { required: true, message: "1-0-", trigger: "blur" }
], // ],
} }
}; };
}, },

@ -162,7 +162,12 @@
<span>{{ parseTime(scope.row.repairEndTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.repairEndTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="循环周期" align="center" prop="cyclePeriod" /> <!-- <el-table-column label="循环周期" align="center" prop="cyclePeriod" />-->
<el-table-column label="循环周期" align="center" prop="cyclePeriod">
<template slot-scope="scope">
<dict-tag :options="dict.type.dms_cycle_period" :value="scope.row.cyclePeriod"/>
</template>
</el-table-column>
<!-- <el-table-column label="检修状态1-待检修2-检修中3-已完成" align="center" prop="repairStatus" />--> <!-- <el-table-column label="检修状态1-待检修2-检修中3-已完成" align="center" prop="repairStatus" />-->
<el-table-column label="检修状态" align="center" prop="repairStatus"> <el-table-column label="检修状态" align="center" prop="repairStatus">
<template slot-scope="scope"> <template slot-scope="scope">
@ -242,8 +247,17 @@
>{{dict.label}}</el-radio> >{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- <el-form-item label="循环周期" prop="cyclePeriod">-->
<!-- <el-input v-model="form.cyclePeriod" placeholder="请输入循环周期" />-->
<!-- </el-form-item>-->
<el-form-item label="循环周期" prop="cyclePeriod"> <el-form-item label="循环周期" prop="cyclePeriod">
<el-input v-model="form.cyclePeriod" placeholder="请输入循环周期" /> <el-radio-group v-model="form.cyclePeriod">
<el-radio
v-for="dict in dict.type.dms_cycle_period"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<!-- <el-form-item label="创建方式1-人工创建2-自动创建" prop="createMethod">--> <!-- <el-form-item label="创建方式1-人工创建2-自动创建" prop="createMethod">-->
<!-- <el-input v-model="form.createMethod" placeholder="请输入创建方式1-人工创建2-自动创建" />--> <!-- <el-input v-model="form.createMethod" placeholder="请输入创建方式1-人工创建2-自动创建" />-->
@ -286,7 +300,7 @@ import { listDmsRepair, getDmsRepair, delDmsRepair, addDmsRepair, updateDmsRepai
export default { export default {
name: "DmsRepair", name: "DmsRepair",
dicts:['dms_create_method','dms_repair_status','dms_repair_type'], dicts:['dms_create_method','dms_repair_status','dms_repair_type','dms_cycle_period'],
data() { data() {
return { return {
// //

@ -284,16 +284,16 @@
v-hasPermi="['dms:ledger:add']" v-hasPermi="['dms:ledger:add']"
>设备折旧</el-button> >设备折旧</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="getDeviceCheckplans" <!-- @click="getDeviceCheckplans"-->
v-hasPermi="['dms:ledger:add']" <!-- v-hasPermi="['dms:ledger:add']"-->
>设备盘点</el-button> <!-- >设备盘点</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"

@ -1,46 +1,46 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备ID,关联dms_base_device_ledger的device_id" prop="deviceId"> <el-form-item label="设备ID" prop="deviceId">
<el-input <el-input
v-model="queryParams.deviceId" v-model="queryParams.deviceId"
placeholder="请输入设备ID,关联dms_base_device_ledger的device_id" placeholder="请输入设备ID"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="维修次数" prop="repairFrequency"> <el-form-item label="设备名称" prop="deviceName">
<el-input <el-input
v-model="queryParams.repairFrequency" v-model="queryParams.deviceName"
placeholder="请输入维修次数" placeholder="请输入设备名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="维修费用" prop="repairCosts"> <!-- <el-form-item label="维修次数" prop="repairFrequency">-->
<el-input <!-- <el-input-->
v-model="queryParams.repairCosts" <!-- v-model="queryParams.repairFrequency"-->
placeholder="请输入维修费用" <!-- placeholder="请输入维修次数"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="折旧费用" prop="depreciationCost"> <!-- <el-form-item label="维修费用" prop="repairCosts">-->
<el-input <!-- <el-input-->
v-model="queryParams.depreciationCost" <!-- v-model="queryParams.repairCosts"-->
placeholder="请输入折旧费用" <!-- placeholder="请输入维修费用"-->
clearable <!-- clearable-->
@keyup.enter.native="handleQuery" <!-- @keyup.enter.native="handleQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="投入时间" prop="putintoTime"> <!-- <el-form-item label="折旧费用" prop="depreciationCost">-->
<el-date-picker clearable <!-- <el-input-->
v-model="queryParams.putintoTime" <!-- v-model="queryParams.depreciationCost"-->
type="date" <!-- placeholder="请输入折旧费用"-->
value-format="yyyy-MM-dd" <!-- clearable-->
placeholder="请选择投入时间"> <!-- @keyup.enter.native="handleQuery"-->
</el-date-picker> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="使用年限" prop="useLife"> <el-form-item label="使用年限" prop="useLife">
<el-input <el-input
v-model="queryParams.useLife" v-model="queryParams.useLife"
@ -49,14 +49,34 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否标识1-是2-否" prop="isFlag"> <el-form-item label="投入时间">
<el-input <el-date-picker
v-model="queryParams.isFlag" v-model="queryParams.params.beginTime"
placeholder="请输入是否标识1-是2-否" style="width: 240px"
clearable type="date"
@keyup.enter.native="handleQuery" placeholder="选择日期时间"
/> value-format="yyyy-MM-dd "
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item><div>-</div></el-form-item>
<el-form-item
><el-date-picker
v-model="queryParams.params.endTime"
value-format="yyyy-MM-dd "
style="width: 240px"
type="date"
placeholder="选择日期时间"
></el-date-picker
></el-form-item>
<!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.isFlag"-->
<!-- placeholder="请输入是否标识1-是2-否"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -111,8 +131,20 @@
<el-table v-loading="loading" :data="devicedepreciationList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="devicedepreciationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="deviceDepreciationId" /> <!-- <el-table-column label="主键标识" align="center" prop="deviceDepreciationId" />-->
<el-table-column label="设备ID,关联dms_base_device_ledger的device_id" align="center" prop="deviceId" /> <el-table-column label="设备ID" align="center" prop="deviceId" />
<el-table-column label="设备名称" align="center" prop="deviceId" >
<template slot-scope="scope">
<span
v-for="(item, index) in ledgerList"
:key="index"
:value="item.ledgerList"
v-if="scope.row.deviceId == item.deviceId"
>
{{ item.deviceName }}
</span>
</template>
</el-table-column>
<el-table-column label="维修次数" align="center" prop="repairFrequency" /> <el-table-column label="维修次数" align="center" prop="repairFrequency" />
<el-table-column label="维修费用" align="center" prop="repairCosts" /> <el-table-column label="维修费用" align="center" prop="repairCosts" />
<el-table-column label="折旧费用" align="center" prop="depreciationCost" /> <el-table-column label="折旧费用" align="center" prop="depreciationCost" />
@ -122,7 +154,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用年限" align="center" prop="useLife" /> <el-table-column label="使用年限" align="center" prop="useLife" />
<el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" /> <!-- <el-table-column label="是否标识1-是2-否" align="center" prop="isFlag" />-->
<!-- <el-table-column label="标识" align="center" prop="isFlag">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -155,8 +192,18 @@
<!-- 添加或修改设备折旧信息对话框 --> <!-- 添加或修改设备折旧信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备ID,关联dms_base_device_ledger的device_id" prop="deviceId"> <!-- <el-form-item label="设备ID" prop="deviceId" >-->
<el-input v-model="form.deviceId" placeholder="请输入设备ID,关联dms_base_device_ledger的device_id" /> <!-- <el-input v-model="form.deviceId" placeholder="请输入设备ID":disabled=isDis />-->
<!-- </el-form-item>-->
<el-form-item label="设备名称" prop="deviceId" >
<el-select v-model="form.deviceId" placeholder="请选择设备" :disabled=isDis>
<el-option
v-for="item in ledgerList"
:key="item.deviceId"
:label="item.deviceName"
:value="item.deviceId">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="维修次数" prop="repairFrequency"> <el-form-item label="维修次数" prop="repairFrequency">
<el-input v-model="form.repairFrequency" placeholder="请输入维修次数" /> <el-input v-model="form.repairFrequency" placeholder="请输入维修次数" />
@ -178,9 +225,18 @@
<el-form-item label="使用年限" prop="useLife"> <el-form-item label="使用年限" prop="useLife">
<el-input v-model="form.useLife" placeholder="请输入使用年限" /> <el-input v-model="form.useLife" placeholder="请输入使用年限" />
</el-form-item> </el-form-item>
<el-form-item label="是否标识1-是2-否" prop="isFlag"> <!-- <el-form-item label="是否标识1-是2-否" prop="isFlag">-->
<el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" /> <!-- <el-input v-model="form.isFlag" placeholder="请输入是否标识1-是2-否" />-->
</el-form-item> <!-- </el-form-item>-->
<!-- <el-form-item label="标识" prop="isFlag">-->
<!-- <el-radio-group v-model="form.isFlag">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.is_flag"-->
<!-- :key="dict.value"-->
<!-- :label="parseInt(dict.value)"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
@ -195,9 +251,11 @@
<script> <script>
import { listDevicedepreciation, getDevicedepreciation, delDevicedepreciation, addDevicedepreciation, updateDevicedepreciation } from "@/api/dms/devicedepreciation"; import { listDevicedepreciation, getDevicedepreciation, delDevicedepreciation, addDevicedepreciation, updateDevicedepreciation } from "@/api/dms/devicedepreciation";
import { listLedger } from '@/api/dms/ledger'
export default { export default {
name: "Devicedepreciation", name: "Devicedepreciation",
dicts: ['is_flag'],
data() { data() {
return { return {
// //
@ -214,10 +272,14 @@ export default {
total: 0, total: 0,
// //
devicedepreciationList: [], devicedepreciationList: [],
//
ledgerList:[],
// //
title: "", title: "",
// //
open: false, open: false,
//
isDis:false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -229,24 +291,43 @@ export default {
putintoTime: null, putintoTime: null,
useLife: null, useLife: null,
isFlag: null, isFlag: null,
deviceName: null,
params:{
beginTime: null,
endTime: null,
},
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
deviceId: [ deviceId: [
{ required: true, message: "设备ID,关联dms_base_device_ledger的device_id不能为空", trigger: "blur" } { required: true, message: "设备ID不能为空", trigger: "blur" }
], ],
isFlag: [ repairFrequency:[
{ required: true, message: "是否标识1-是2-否不能为空", trigger: "blur" } // { type: 'number', message: "",trigger: "blur" }
{pattern:/^[1-9]\d*$/,message: "维修次数必须为数字",trigger: "blur" }
], ],
} repairCosts:[{pattern:/^[1-9]\d*$/,message: "维修费用必须为数字",trigger: "blur" }],
depreciationCost:[{pattern:/^[1-9]\d*$/,message: "折旧费用必须为数字",trigger: "blur" }],
useLife:[{pattern:/^[1-9]\d*$/,message: "使用年限必须为",trigger: "blur" }],
},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDeviceLedger();
}, },
methods: { methods: {
/** 查询设备台账信息列表 */
getDeviceLedger() {
this.loading = true;
listLedger(this.queryParams).then(response => {
this.ledgerList = response.rows;
});
},
/** 查询设备折旧信息列表 */ /** 查询设备折旧信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -276,7 +357,8 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
deviceName: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -287,6 +369,8 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.params.beginTime = null;
this.queryParams.params.endTime = null;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
@ -299,12 +383,14 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.isDis = false;
this.open = true; this.open = true;
this.title = "添加设备折旧信息"; this.title = "添加设备折旧信息";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.isDis = true;
const deviceDepreciationId = row.deviceDepreciationId || this.ids const deviceDepreciationId = row.deviceDepreciationId || this.ids
getDevicedepreciation(deviceDepreciationId).then(response => { getDevicedepreciation(deviceDepreciationId).then(response => {
this.form = response.data; this.form = response.data;

@ -35,8 +35,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://175.27.215.92:7080`, // target: `http://175.27.215.92:7080`,
// target: `http://localhost:7080`, target: `http://localhost:7080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save