add:添加档案导入/故障分类;rev:分类分类显示异常
This commit is contained in:
@@ -75,6 +75,7 @@ public interface ClassstandardService {
|
||||
JSONObject loadClass(Map whereJson);
|
||||
|
||||
JSONArray getSuperior(JSONObject jo, JSONArray ja);
|
||||
JSONArray getSuperiorLimit(JSONObject jo, JSONArray ja,String parent_id);
|
||||
|
||||
JSONObject buildTree(JSONArray ja);
|
||||
|
||||
|
||||
@@ -255,6 +255,33 @@ public class ClassstandardServiceImpl implements ClassstandardService {
|
||||
return getSuperior(id_row, ja);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONArray getSuperiorLimit(JSONObject jo, JSONArray ja, String parent_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("MD_PB_ClassStandard");
|
||||
if (StrUtil.isEmpty(jo.getString("parent_class_id")) || jo.getString("parent_class_id").equals("0")) {
|
||||
JSONArray null_pids = new JSONArray();
|
||||
null_pids = wo.query("(parent_class_id = '0' OR parent_class_id is null) and is_delete = '0'").getResultJSONArray(0);
|
||||
|
||||
for (int m = 0; m < null_pids.size(); m++) {
|
||||
JSONObject null_pid = null_pids.getJSONObject(m);
|
||||
ja.add(null_pid);
|
||||
}
|
||||
return ja;
|
||||
}
|
||||
JSONArray pid_rows = wo.query("parent_class_id = '" + jo.getString("parent_class_id") + "'").getResultJSONArray(0);
|
||||
for (int n = 0; n < pid_rows.size(); n++) {
|
||||
JSONObject pid_row = pid_rows.getJSONObject(n);
|
||||
ja.add(pid_row);
|
||||
}
|
||||
JSONObject id_row = wo.query("class_id = '" + jo.getString("parent_class_id") + "'").uniqueResult(0);
|
||||
if (id_row.getString("class_id").equals(parent_id)){
|
||||
ja.add(id_row);
|
||||
return ja;
|
||||
}
|
||||
return getSuperiorLimit(id_row, ja,parent_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject buildTree(JSONArray ja) {
|
||||
Set<JSONObject> trees = new LinkedHashSet<>();
|
||||
|
||||
@@ -12,7 +12,9 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -50,12 +52,17 @@ public class DevicefaultclassController {
|
||||
devicefaultclassService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@ApiOperation("删除设备故障分类维护")
|
||||
//@PreAuthorize("@el.check('devicefaultclass:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
devicefaultclassService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/excelImport")
|
||||
@ApiOperation("故障分类导入")
|
||||
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||
devicefaultclassService.excelImport(file,request);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ package org.nl.wms.masterdata_manage.em.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.masterdata_manage.em.service.dto.DevicefaultclassDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -69,4 +71,11 @@ public interface DevicefaultclassService {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 导入
|
||||
* @param file
|
||||
* @param request
|
||||
*/
|
||||
void excelImport(MultipartFile file, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -7,11 +7,14 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -19,13 +22,19 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.masterdata_manage.em.service.DevicefaultclassService;
|
||||
import org.nl.wms.masterdata_manage.em.service.dto.DevicefaultclassDto;
|
||||
import org.nl.wms.masterdata_manage.bfmaster.service.ClassstandardService;
|
||||
import org.nl.wms.system_manage.service.tableData.ColumnInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
@@ -33,10 +42,13 @@ import java.util.Map;
|
||||
* @date 2022-06-16
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class DevicefaultclassServiceImpl implements DevicefaultclassService {
|
||||
private final ClassstandardService classstandardService;
|
||||
|
||||
@Autowired
|
||||
private ClassstandardService classstandardService;
|
||||
@Autowired
|
||||
private ColumnInfoService columnInfoService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
@@ -148,4 +160,48 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void excelImport(MultipartFile file, HttpServletRequest request) {
|
||||
try {
|
||||
// 调用用 hutool 方法读取数据 调用第一个sheet白班数据
|
||||
ExcelReader excelReader = ExcelUtil.getReader(file.getInputStream(), 0);
|
||||
// 从第1行开始获取数据 excelReader.read的结果是一个2纬的list,外层是行,内层是行对应的所有列
|
||||
Map<String, String> tableColumn = columnInfoService.TableColumn2("em_bi_devicefaultclass");
|
||||
List<List<Object>> read = excelReader.read(0, excelReader.getRowCount());
|
||||
Map<Integer, String> IndexValue = new HashMap<>();
|
||||
for (int i = 0; i < read.get(0).size(); i++) {
|
||||
String label = String.valueOf(read.get(0).get(i));String value = tableColumn.get(label);
|
||||
if (value!=null){ IndexValue.put(i,value); }
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
JSONArray array = new JSONArray();
|
||||
List<String> ids = new ArrayList<>();
|
||||
for (int i = 1; i < read.size(); i++) {
|
||||
List<Object> list = read.get(i);
|
||||
JSONObject item = new JSONObject();
|
||||
for (int i1 = 0; i1 < list.size(); i1++) {
|
||||
String s = IndexValue.get(i1);
|
||||
if (s!=null){
|
||||
item.put(s,list.get(i1));
|
||||
|
||||
}
|
||||
}
|
||||
item.put("create_id",currentUserId);
|
||||
item.put("create_name",currentUsername);
|
||||
item.put("create_time",now);
|
||||
array.add(item);
|
||||
ids.add(item.getString("device_faultclass_id"));
|
||||
}
|
||||
System.out.println(array.size());
|
||||
WQLObject mstTab = WQLObject.getWQLObject("em_bi_devicefaultclass"); // 工艺路线主表
|
||||
mstTab.delete("device_faultclass_id in "+"('" + ids.stream().collect(Collectors.joining("','")) + "')");
|
||||
for (Object o : array) {
|
||||
mstTab.insert((JSONObject)o);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
throw new BadRequestException(ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +116,21 @@ public class ClassstandardController {
|
||||
//("查询类别:根据ID获取同级与上级数据")
|
||||
@PostMapping("/superior")
|
||||
//@PreAuthorize("@el.check('user:list','dept:list')")
|
||||
public ResponseEntity<Object> getSuperior(@RequestBody Long id) {
|
||||
public ResponseEntity<Object> getSuperior(@RequestBody String id) {
|
||||
JSONObject jo = WQLObject.getWQLObject("MD_PB_ClassStandard").query("class_id = '" + id + "'").uniqueResult(0);
|
||||
JSONArray maters = ClassstandardService.getSuperior(jo, new JSONArray());
|
||||
return new ResponseEntity<>(ClassstandardService.buildTree(maters), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/superior2")
|
||||
public ResponseEntity<Object> getSuperior2(@RequestBody String param) {
|
||||
JSONArray arr = JSONArray.parseArray(param);
|
||||
JSONObject parse = arr.getJSONObject(0);
|
||||
JSONObject jo = WQLObject.getWQLObject("MD_PB_ClassStandard").query("class_id = '" + parse.getString("id") + "'").uniqueResult(0);
|
||||
JSONArray maters = ClassstandardService.getSuperiorLimit(jo, new JSONArray(),parse.getString("parent_id"));
|
||||
return new ResponseEntity<>(ClassstandardService.buildTree(maters), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getType")
|
||||
@Log("获取分类类型")
|
||||
//("获取分类类型")
|
||||
|
||||
@@ -40,6 +40,14 @@ export function getClassSuperior(ids) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getClassSuperior2(ids) {
|
||||
const data = ids.length || ids.length === 0 ? ids : Array.of(ids)
|
||||
return request({
|
||||
url: 'api/Classstandard/superior2',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getClassType(params) {
|
||||
return request({
|
||||
@@ -87,4 +95,4 @@ export function excelImport(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName, excelImport }
|
||||
export default { add, edit, del, getClass, getClassSuperior,getClassSuperior2, getClassType, getClassTable, getType, queryClassById, getClassName, excelImport }
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
style="width: 210px"
|
||||
:clearable="false"
|
||||
placeholder="设备类别"
|
||||
@select="typeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产用途" prop="is_produceuse">
|
||||
@@ -359,18 +358,41 @@ export default {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.parent_id = '2'
|
||||
this.getSubTypes(data)
|
||||
|
||||
if (!form.devicerecord_code) {
|
||||
this.getDepts()
|
||||
// const param = {
|
||||
// 'materOpt_code': '23'
|
||||
// }
|
||||
// crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
// this.class_idStr = res.class_idStr
|
||||
// this.queryClassId()
|
||||
// })
|
||||
|
||||
const param = {
|
||||
'materOpt_code': '23'
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
}
|
||||
},
|
||||
getSubTypes(id) {
|
||||
console.log(id)
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
})
|
||||
},
|
||||
buildClass(classes) {
|
||||
classes.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildClass(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': '2'
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
<label slot="label">制造国别:</label>
|
||||
<el-input v-model.trim="form.country_manufactur" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="PCL型号" prop="plc_model">
|
||||
<el-form-item label="PCL型号" disabled prop="plc_model">
|
||||
<label slot="label">PCL型号:</label>
|
||||
<el-input v-model.trim="form.plc_model" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="功率" prop="manufacturer">
|
||||
<el-form-item label="功率" disabled prop="manufacturer">
|
||||
<label slot="label">功率:</label>
|
||||
<el-input v-model.trim="form.power" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
@@ -267,7 +267,9 @@ export default {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.form = {}
|
||||
this.$emit('AddChanged')
|
||||
}
|
||||
},
|
||||
open() {
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -98,12 +98,12 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报修单号:" prop="request_code">
|
||||
<el-input v-model.trim="form.request_code" style="width: 200px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备" prop="devicerecord_id">
|
||||
<el-input v-model.trim="form.device_code" :disabled="true" style="width: 200px;">
|
||||
<el-button slot="append" icon="el-icon-plus" :disabled="crud.status.view > 0" @click="putDevice" />
|
||||
@@ -113,14 +113,14 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障类型" prop="device_faultclass_id">
|
||||
<el-input v-model.trim="form.device_faultclass_name" :disabled="true" style="width: 200px;">
|
||||
<el-button slot="append" icon="el-icon-plus" :disabled="crud.status.view > 0" @click="putFault" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障等级:" prop="fault_level">
|
||||
<el-select
|
||||
v-model="form.fault_level"
|
||||
@@ -141,7 +141,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班组配合人:" prop="product_person_name">
|
||||
<el-input v-model.trim="form.product_person_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
@@ -149,7 +149,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="故障描述:" prop="fault_desc">
|
||||
<el-input v-model.trim="form.fault_desc" style="width: 650px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -157,7 +157,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model.trim="form.remark" style="width: 650px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDevicefaultclass from '@/views/wms/masterdata_manage/em/devicefaultclass/devicefaultclass'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
crudDevicefaultclass.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged3', '')
|
||||
this.$emit('update:dialogShow', false)
|
||||
}).catch(err => {
|
||||
// const list = err.response.data.message
|
||||
// download2('/api/produceWorkorder/download', list).then(result => {
|
||||
// downloadFile(result, '错误信息汇总', 'xlsx')
|
||||
// crud.downloadLoading = false
|
||||
// })
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -23,5 +23,12 @@ export function edit(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/devicefaultclass/excelImport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del, excelImport }
|
||||
|
||||
@@ -34,17 +34,28 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障编码:" prop="device_faultclass_code">
|
||||
<el-input v-model.trim="form.device_faultclass_code" style="width: 280px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障名称:" prop="device_faultclass_name">
|
||||
<el-input v-model.trim="form.device_faultclass_name" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
@@ -52,7 +63,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备分类:" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
@@ -66,7 +77,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="解决措施:" prop="solutions">
|
||||
<el-input v-model.trim="form.solutions" style="width: 650px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -75,7 +86,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model.trim="form.remark" style="width: 650px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -108,6 +119,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="tableChanged3"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -122,12 +134,14 @@ import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
// import crudDevicebom from '@/api/wms/basedata/em/devicebom'
|
||||
import UploadDialog from '@/views/wms/masterdata_manage/em/devicefaultclass/UploadDialog'
|
||||
import {getClassSuperior, queryClassById} from "../../../../../api/wms/basedata/master/classstandard";
|
||||
|
||||
|
||||
const defaultForm = { device_faultclass_id: null, device_faultclass_code: null, device_faultclass_name: null, material_type_id: null, solutions: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Devicefaultclass',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
components: { UploadDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -146,6 +160,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadShow: false,
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
materOpt_code: '23',
|
||||
@@ -178,9 +193,9 @@ export default {
|
||||
const data = {
|
||||
'materOpt_code': this.materOpt_code_2
|
||||
}
|
||||
crudDevicebom.getBjId(data).then(res => {
|
||||
this.classBj_id = res.class_idStr
|
||||
})
|
||||
// crudDevicebom.getBjId(data).then(res => {
|
||||
// this.classBj_id = res.class_idStr
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -194,10 +209,13 @@ export default {
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
data.parent_id = "2"
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
tableChanged3() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
loadClass({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||
@@ -227,9 +245,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getSubTypes(id) {
|
||||
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
|
||||
@@ -65,12 +65,12 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="850px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="润滑项目编码:">
|
||||
<el-input v-model.trim="form.maint_item_code" style="width: 230px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="润滑项目名称:" prop="maint_item_name">
|
||||
<el-input v-model.trim="form.maint_item_name" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -78,7 +78,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="润滑等级:" prop="item_level">
|
||||
<el-select v-model="form.item_level" clearable placeholder="请选择" style="width: 230px">
|
||||
<el-option
|
||||
@@ -89,7 +89,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="润滑实施人:">
|
||||
<el-input v-model.trim="form.remark" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -97,7 +97,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类别:" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
@@ -111,7 +111,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="润滑内容:" prop="contents">
|
||||
<el-input v-model.trim="form.contents" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -119,7 +119,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="润滑要求:" prop="requirement">
|
||||
<el-input v-model.trim="form.requirement" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -127,7 +127,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="验收标准:" prop="acceptancecriteria">
|
||||
<el-input v-model.trim="form.acceptancecriteria" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
data.parent_id = '2'
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -65,12 +65,12 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="850px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养项目编码:">
|
||||
<el-input v-model.trim="form.maint_item_code" style="width: 230px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养项目名称:" prop="maint_item_name">
|
||||
<el-input v-model.trim="form.maint_item_name" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -78,7 +78,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养等级:" prop="item_level">
|
||||
<el-select v-model="form.item_level" clearable placeholder="请选择" style="width: 230px">
|
||||
<el-option
|
||||
@@ -89,7 +89,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养实施人:">
|
||||
<el-input v-model.trim="form.remark" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -97,7 +97,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类别:" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
@@ -111,7 +111,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="保养内容:" prop="contents">
|
||||
<el-input v-model.trim="form.contents" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -119,7 +119,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="保养要求:" prop="requirement">
|
||||
<el-input v-model.trim="form.requirement" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -127,7 +127,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="验收标准:" prop="acceptancecriteria">
|
||||
<el-input v-model.trim="form.acceptancecriteria" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
data.parent_id = '2'
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="750px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="维修项目编码:">
|
||||
<el-input v-model.trim="form.repair_item_code" style="width: 200px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="维修项目名称:" prop="repair_item_name">
|
||||
<el-input v-model.trim="form.repair_item_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
@@ -60,7 +60,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类别:" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
@@ -74,7 +74,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修要求:" prop="requirement">
|
||||
<el-input v-model.trim="form.requirement" style="width: 555px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -82,7 +82,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注:">
|
||||
<el-input v-model.trim="form.remark" style="width: 555px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -193,7 +193,7 @@ export default {
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
data.parent_id = '2'
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
@@ -226,9 +226,8 @@ export default {
|
||||
})
|
||||
},
|
||||
getSubTypes(id) {
|
||||
|
||||
console.log(id)
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
|
||||
@@ -65,12 +65,12 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="850px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="点检项目编码:">
|
||||
<el-input v-model.trim="form.maint_item_code" style="width: 230px;" disabled placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="点检项目名称:" prop="maint_item_name">
|
||||
<el-input v-model.trim="form.maint_item_name" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -78,7 +78,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="点检等级:" prop="item_level">
|
||||
<el-select v-model="form.item_level" clearable placeholder="请选择" style="width: 230px">
|
||||
<el-option
|
||||
@@ -89,7 +89,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="点检实施人:">
|
||||
<el-input v-model.trim="form.remark" style="width: 230px;" />
|
||||
</el-form-item>
|
||||
@@ -97,7 +97,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类别:" prop="material_type_id">
|
||||
<treeselect
|
||||
v-model="form.material_type_id"
|
||||
@@ -111,7 +111,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="点检内容:" prop="contents">
|
||||
<el-input v-model.trim="form.contents" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -119,7 +119,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="点检要求:" prop="requirement">
|
||||
<el-input v-model.trim="form.requirement" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -127,7 +127,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="验收标准:" prop="acceptancecriteria">
|
||||
<el-input v-model.trim="form.acceptancecriteria" style="width: 600px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
@@ -256,7 +256,7 @@ export default {
|
||||
} else {
|
||||
const data = {}
|
||||
data.id = form.material_type_id
|
||||
data.goal_id = this.classBj_id
|
||||
data.parent_id = '2'
|
||||
this.getSubTypes(data)
|
||||
}
|
||||
},
|
||||
@@ -302,7 +302,6 @@ export default {
|
||||
},
|
||||
getSubTypes(id) {
|
||||
crudClassstandard.getClassSuperior2(id).then(res => {
|
||||
|
||||
const date = res.content
|
||||
this.buildClass(date)
|
||||
this.classes = date
|
||||
|
||||
Reference in New Issue
Block a user