add:增加物料导入;
This commit is contained in:
@@ -24,10 +24,8 @@ import org.aspectj.lang.annotation.Around;
|
|||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.nl.common.utils.IPUtil;
|
import org.nl.common.utils.IPUtil;
|
||||||
import org.nl.common.utils.IdUtil;
|
|
||||||
import org.nl.common.utils.RequestHolder;
|
import org.nl.common.utils.RequestHolder;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.config.lucene.LuceneAppender;
|
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@@ -108,12 +106,17 @@ public class LogAspect {
|
|||||||
List<Object> argList = new ArrayList<>();
|
List<Object> argList = new ArrayList<>();
|
||||||
Parameter[] parameters = method.getParameters();
|
Parameter[] parameters = method.getParameters();
|
||||||
for (int i = 0; i < parameters.length; i++) {
|
for (int i = 0; i < parameters.length; i++) {
|
||||||
//将RequestBody注解修饰的参数作为请求参数
|
Object value = args[i];
|
||||||
|
// 跳过 MultipartFile 和 Servlet 类型参数
|
||||||
|
if (value instanceof org.springframework.web.multipart.MultipartFile ||
|
||||||
|
value instanceof javax.servlet.http.HttpServletRequest ||
|
||||||
|
value instanceof javax.servlet.http.HttpServletResponse) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);
|
RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class);
|
||||||
if (requestBody != null) {
|
if (requestBody != null) {
|
||||||
argList.add(args[i]);
|
argList.add(value);
|
||||||
}
|
}
|
||||||
//将RequestParam注解修饰的参数作为请求参数
|
|
||||||
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
|
RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class);
|
||||||
if (requestParam != null) {
|
if (requestParam != null) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
@@ -121,15 +124,27 @@ public class LogAspect {
|
|||||||
if (!StrUtil.isEmpty(requestParam.value())) {
|
if (!StrUtil.isEmpty(requestParam.value())) {
|
||||||
key = requestParam.value();
|
key = requestParam.value();
|
||||||
}
|
}
|
||||||
map.put(key, args[i]);
|
// 若是 MultipartFile,则只记录文件名与大小
|
||||||
|
if (value instanceof org.springframework.web.multipart.MultipartFile) {
|
||||||
|
org.springframework.web.multipart.MultipartFile file = (org.springframework.web.multipart.MultipartFile) value;
|
||||||
|
map.put(key, file.getOriginalFilename() + " (" + file.getSize() + " bytes)");
|
||||||
|
} else {
|
||||||
|
map.put(key, value);
|
||||||
|
}
|
||||||
argList.add(map);
|
argList.add(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (argList.size() == 0) {
|
if (argList.isEmpty()) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
return JSON.toJSONString(argList);
|
return JSON.toJSONString(argList);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("请求参数序列化失败:{}", e.getMessage());
|
||||||
|
return "[参数序列化失败]";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.common.utils.RedissonUtils;
|
||||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -14,7 +15,10 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -48,6 +52,14 @@ public class MaterialbaseController {
|
|||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/excelImport")
|
||||||
|
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
RedissonUtils.lock(() -> {
|
||||||
|
iMdMeMaterialbaseService.excelImport(file, request, response);
|
||||||
|
}, "信息导入", null);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Log("修改物料")
|
@Log("修改物料")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody MdMeMaterialbase dto) {
|
public ResponseEntity<Object> update(@Validated @RequestBody MdMeMaterialbase dto) {
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -31,6 +34,13 @@ public interface IMdMeMaterialbaseService extends IService<MdMeMaterialbase> {
|
|||||||
* @param dto 物料实体类
|
* @param dto 物料实体类
|
||||||
*/
|
*/
|
||||||
void create(MdMeMaterialbase dto);
|
void create(MdMeMaterialbase dto);
|
||||||
|
/**
|
||||||
|
* 导入物料
|
||||||
|
* @param file
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改物料
|
* 修改物料
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ package org.nl.wms.basedata_manage.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
@@ -20,7 +23,11 @@ import org.nl.wms.ext.service.WmsToErpService;
|
|||||||
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 org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -84,6 +91,55 @@ public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMap
|
|||||||
this.save(dto);
|
this.save(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
InputStream inputStream = file.getInputStream();
|
||||||
|
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||||
|
List<List<Object>> read = excelReader.read();
|
||||||
|
if (read.size() > 1) {
|
||||||
|
List<MdMeMaterialbase> materialList = new ArrayList<>();
|
||||||
|
for (int i = 1; i < read.size(); i++) {
|
||||||
|
List<Object> list = read.get(i);
|
||||||
|
String m1 = String.valueOf(list.get(0));
|
||||||
|
String m2 = String.valueOf(list.get(1));
|
||||||
|
String m3 = ObjectUtil.isEmpty(list.get(2))?null:String.valueOf(list.get(2));
|
||||||
|
String m4 = ObjectUtil.isEmpty(list.get(3))?null:String.valueOf(list.get(3));
|
||||||
|
String m5 = ObjectUtil.isEmpty(list.get(4))?null:String.valueOf(list.get(4));
|
||||||
|
// 根据物料编码查询是否有相同物料编码的物料
|
||||||
|
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectOne(
|
||||||
|
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||||
|
.eq(MdMeMaterialbase::getMaterial_code, m1)
|
||||||
|
);
|
||||||
|
if (ObjectUtil.isNotEmpty(mdMeMaterialbase)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
MdMeMaterialbase dao = new MdMeMaterialbase();
|
||||||
|
dao.setMaterial_id(IdUtil.getStringId());
|
||||||
|
dao.setMaterial_code(m1);
|
||||||
|
dao.setMaterial_name(m2);
|
||||||
|
dao.setMaterial_spec(m3);
|
||||||
|
dao.setMaterial_model(m4);
|
||||||
|
dao.setBase_unit_id(m5);
|
||||||
|
dao.setIs_used("1");
|
||||||
|
dao.setIs_delete("0");
|
||||||
|
dao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
dao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
dao.setCreate_time(DateUtil.now());
|
||||||
|
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||||
|
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||||
|
dao.setUpdate_time(DateUtil.now());
|
||||||
|
materialList.add(dao);
|
||||||
|
}
|
||||||
|
this.saveBatch(materialList);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new BadRequestException("导入失败" + ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void update(MdMeMaterialbase dto) {
|
public void update(MdMeMaterialbase dto) {
|
||||||
|
|||||||
115
nladmin-ui/src/views/wms/basedata/material/UploadDialog.vue
Normal file
115
nladmin-ui/src/views/wms/basedata/material/UploadDialog.vue
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<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 crudbucketrecord from '@/views/wms/basedata/material/material'
|
||||||
|
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)
|
||||||
|
crudbucketrecord.excelImport(formdata).then((res) => {
|
||||||
|
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.$emit('tableChanged3', '')
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -21,15 +21,25 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
<crudOperation>
|
<crudOperation>
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- slot="right"-->
|
||||||
|
<!-- class="filter-item"-->
|
||||||
|
<!-- type="success"-->
|
||||||
|
<!-- icon="el-icon-refresh"-->
|
||||||
|
<!-- size="mini"-->
|
||||||
|
<!-- @click="materialSync"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- 物料同步-->
|
||||||
|
<!-- </el-button>-->
|
||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-refresh"
|
icon="el-icon-upload2"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="materialSync"
|
@click="uploadShow = true"
|
||||||
>
|
>
|
||||||
物料同步
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表单组件-->
|
<!--表单组件-->
|
||||||
@@ -53,7 +63,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|
||||||
<el-form-item label="规格" prop="material_spec">
|
<el-form-item label="规格" prop="material_spec">
|
||||||
<label slot="label">规 格</label>
|
<label slot="label">规 格</label>
|
||||||
<el-input v-model="form.material_spec" style="width: 200px;"/>
|
<el-input v-model="form.material_spec" style="width: 200px;"/>
|
||||||
@@ -73,25 +82,28 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<!-- <el-row>-->
|
||||||
<el-col :span="8">
|
<!-- <el-col :span="8">-->
|
||||||
<el-form-item label="静置时间" prop="standing_time">
|
<!-- <el-form-item label="静置时间" prop="standing_time">-->
|
||||||
<el-input-number v-model="form.standing_time" :controls="false" :min="0" label="分钟" style="width: 200px;" />
|
<!-- <el-input-number v-model="form.standing_time" :controls="false" :min="0" label="分钟"-->
|
||||||
</el-form-item>
|
<!-- style="width: 200px;"-->
|
||||||
</el-col>
|
<!-- />-->
|
||||||
<el-col :span="8">
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="是否启用" prop="is_used">
|
<!-- </el-col>-->
|
||||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
<!-- <el-col :span="8">-->
|
||||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
<!-- <el-form-item label="是否启用" prop="is_used">-->
|
||||||
</el-form-item>
|
<!-- <el-radio v-model="form.is_used" label="0">否</el-radio>-->
|
||||||
</el-col>
|
<!-- <el-radio v-model="form.is_used" label="1">是</el-radio>-->
|
||||||
</el-row>
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </el-col>-->
|
||||||
|
<!-- </el-row>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<UploadDialog :dialog-show.sync="uploadShow" @tableChanged3="crud.toQuery()"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
ref="table"
|
ref="table"
|
||||||
@@ -103,12 +115,12 @@
|
|||||||
>
|
>
|
||||||
<el-table-column prop="material_code" label="物料编码" width="160"/>
|
<el-table-column prop="material_code" label="物料编码" width="160"/>
|
||||||
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip/>
|
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip/>
|
||||||
<el-table-column prop="material_spec" label="物料规格" width="140" />
|
<el-table-column prop="material_spec" show-overflow-tooltip show-tooltip-when-overflow :min-width="flexWidth('material_spec',crud.data,'物料规格')" label="物料规格"/>
|
||||||
<el-table-column prop="material_model" label="物料型号"/>
|
<el-table-column prop="material_model" label="物料型号"/>
|
||||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
<!-- <el-table-column prop="class_name" label="物料分类" width="140"/>-->
|
||||||
<el-table-column prop="unit_name" label="计量单位"/>
|
<el-table-column prop="unit_name" label="计量单位"/>
|
||||||
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
|
<!-- <el-table-column prop="standing_time" label="静置时间(分钟)" width="130px"/>-->
|
||||||
<el-table-column prop="product_series_name" label="系列" />
|
<!-- <el-table-column prop="product_series_name" label="系列"/>-->
|
||||||
<el-table-column label="启用" align="center" prop="is_used">
|
<el-table-column label="启用" align="center" prop="is_used">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@@ -151,6 +163,7 @@ import rrOperation from '@crud/RR.operation'
|
|||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
|
import UploadDialog from './UploadDialog'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
material_id: null,
|
material_id: null,
|
||||||
@@ -190,7 +203,7 @@ export default {
|
|||||||
name: 'Materia',
|
name: 'Materia',
|
||||||
// 数据字典
|
// 数据字典
|
||||||
dicts: ['is_used'],
|
dicts: ['is_used'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
@@ -207,6 +220,7 @@ export default {
|
|||||||
classes1: [],
|
classes1: [],
|
||||||
classes2: [],
|
classes2: [],
|
||||||
classes3: [],
|
classes3: [],
|
||||||
|
uploadShow: false,
|
||||||
fullscreenLoading: false,
|
fullscreenLoading: false,
|
||||||
measure_unit: [],
|
measure_unit: [],
|
||||||
productSeries: [],
|
productSeries: [],
|
||||||
|
|||||||
@@ -55,4 +55,12 @@ export function materialSync(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries, materialSync }
|
export function excelImport(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/Materia/excelImport',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries, materialSync, excelImport }
|
||||||
|
|||||||
Reference in New Issue
Block a user