add:备件出库、库存查询、库存变更
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package org.nl.wms.device_manage.ios.controller.iostorInv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/emBiIostorinv/out")
|
||||
public class EmBiIostorinvOutController {
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvOutService emBiIostorinvOutService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询原料出库单")
|
||||
//("查询原料出库单")
|
||||
public ResponseEntity<Object> query(EmIostorInvQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(emBiIostorinvOutService.pageQuery(query,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("创建入库单")
|
||||
//("创建入库单")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvOutService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("修改入库单")
|
||||
//("修改入库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvOutService.updateBill(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除入库单")
|
||||
//("删除入库单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
|
||||
emBiIostorinvOutService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getIODtl")
|
||||
@Log("查询出库分配明细")
|
||||
//("查询出库分配明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(emBiIostorinvOutService.getInvDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认")
|
||||
//("强制确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvOutService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ public class EmBiStructivtController {
|
||||
private EmBiStructivtService emBiStructivtService;
|
||||
|
||||
@GetMapping("/getRawIvt")
|
||||
@Log("查询可用的原料库存")
|
||||
//("查询可用的原料库存")
|
||||
@Log("查询可用的备件库存")
|
||||
//("查询可用的备件库存")
|
||||
public ResponseEntity<Object> getRawIvt(StructIvtEmQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getRawIvt(query, page), HttpStatus.OK);
|
||||
}
|
||||
@@ -57,8 +57,8 @@ public class EmBiStructivtController {
|
||||
}
|
||||
|
||||
@GetMapping("/getAllRawIvt")
|
||||
@Log("查询原料库存")
|
||||
//("查询原料库存")
|
||||
@Log("查询备件库存")
|
||||
//("查询备件库存")
|
||||
public ResponseEntity<Object> getAllRawIvt(StructIvtEmQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getAllRawIvt(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvOutService extends IService<EmBiostorinv> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query,page /
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object pageQuery(EmIostorInvQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param form /
|
||||
*/
|
||||
void create(JSONObject form);
|
||||
|
||||
/**
|
||||
* 修改单据
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateBill(JSONObject form);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* {
|
||||
* 主表id..
|
||||
* }
|
||||
*/
|
||||
void delete(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取分配明细
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<Map> getInvDtl(JSONObject form);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
void confirm(JSONObject form);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvOutMapper extends BaseMapper<EmBiostorinv> {
|
||||
|
||||
List<Map> getMstDetail(@Param("query") EmIostorInvQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvOutMapper">
|
||||
|
||||
<select id="getMstDetail" resultType="java.util.Map">
|
||||
SELECT
|
||||
mst.iostorinv_id,
|
||||
mst.bill_code,
|
||||
mst.io_type,
|
||||
mst.buss_type,
|
||||
mst.bill_type,
|
||||
mst.biz_date,
|
||||
mst.stor_id,
|
||||
mst.stor_code,
|
||||
mst.stor_name,
|
||||
mst.source_id,
|
||||
mst.source_name,
|
||||
mst.source_type,
|
||||
mst.total_qty,
|
||||
mst.dis_name,
|
||||
mst.dis_time,
|
||||
mst.detail_count,
|
||||
mst.bill_status,
|
||||
mst.workshop_id,
|
||||
mst.remark,
|
||||
mst.create_id,
|
||||
mst.create_name,
|
||||
DATE_FORMAT( mst.create_time,'%Y-%m-%d %H:%i:%s') AS create_time,
|
||||
mst.update_id,
|
||||
mst.update_name,
|
||||
DATE_FORMAT( mst.update_time,'%Y-%m-%d %H:%i:%s') AS update_time,
|
||||
mst.confirm_id,
|
||||
mst.confirm_name,
|
||||
DATE_FORMAT( mst.confirm_time,'%Y-%m-%d %H:%i:%s') AS confirm_time
|
||||
FROM
|
||||
em_bi_iostorinv mst
|
||||
<where>
|
||||
mst.is_delete = '0'
|
||||
AND
|
||||
io_type = '1'
|
||||
<if test="query.start_time != null">
|
||||
and mst.create_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null">
|
||||
and #{query.end_time} >= mst.create_time
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and mst.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
<if test="query.bill_status != null and query.bill_status != ''">
|
||||
and mst.bill_status = #{query.bill_status}
|
||||
</if>
|
||||
<if test="query.bill_type != null and query.bill_type != ''">
|
||||
and mst.bill_type = #{query.bill_type}
|
||||
</if>
|
||||
<if test="query.bill_code != null and query.bill_code != ''">
|
||||
and mst.bill_code = #{query.bill_code}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by mst.create_time DESC
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,302 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvOutService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdisService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdtlService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdis;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdtl;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvOutMapper;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtflowService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiIostorinvOutServiceImpl extends ServiceImpl<EmBiIostorinvOutMapper, EmBiostorinv> implements EmBiIostorinvOutService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService stIvtBsrealstorattrService; // 仓库服务
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvdtlService emBiIostorinvdtlService; // 明细服务
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvdisService emBiIostorinvdisService; // 分配服务
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtService emBiStructivtService; // 库存服务
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService; // 物料基本信息服务
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService; // 仓位服务
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtflowService emBiStructivtflowService; // 仓位变动记录服务
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(EmIostorInvQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
public void create(JSONObject form) {
|
||||
JSONArray rows = form.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
|
||||
// 调用主表 插入/更新方法
|
||||
EmBiostorinv stIvtIostorinvYl = packageMstForm(new EmBiostorinv(), form, false);
|
||||
// 插入主表
|
||||
this.save(stIvtIostorinvYl);
|
||||
|
||||
// 调用明细表 插入/更新方法
|
||||
emBiIostorinvdtlService.create(rows, stIvtIostorinvYl.getIostorinv_id(), stIvtIostorinvYl.getIo_type());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
public String updateBill(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||
EmBiostorinv mst = form.toJavaObject(EmBiostorinv.class);
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mst);
|
||||
|
||||
JSONArray rows = form.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
// 调用明细表 插入/更新方法
|
||||
emBiIostorinvdtlService.create(rows, form.getString("iostorinv_id"), mst.getIo_type());
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long[] ids) {
|
||||
|
||||
for (Long id : ids) {
|
||||
EmBiostorinv dao = this.getOne(new QueryWrapper<EmBiostorinv>().eq("iostorinv_id", id));
|
||||
dao.setIs_delete(true);
|
||||
|
||||
this.updateById(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getInvDtl(JSONObject form) {
|
||||
return emBiIostorinvdtlService.getDtlList(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
public void confirm(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||
|
||||
String iostorinv_id = form.getString("iostorinv_id");
|
||||
|
||||
EmBiostorinv mst = this.getById(iostorinv_id);
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
mst.setDis_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setDis_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setDis_time(DateUtil.now());
|
||||
mst.setConfirm_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setConfirm_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setConfirm_time(DateUtil.now());
|
||||
this.updateById(mst);
|
||||
|
||||
List<EmBiIostorinvdtl> dtl_list = emBiIostorinvdtlService.list(new QueryWrapper<EmBiIostorinvdtl>().eq("iostorinv_id", iostorinv_id));
|
||||
|
||||
if (ObjectUtil.isEmpty(dtl_list)) {
|
||||
throw new BadRequestException("该入库单不存在明细!");
|
||||
}
|
||||
|
||||
if (mst == null || mst.getIs_delete() == true) {
|
||||
throw new BadRequestException("单据不存在");
|
||||
}
|
||||
|
||||
dtl_list.forEach(dtl -> {
|
||||
double need_qty = dtl.getPlan_qty().doubleValue();
|
||||
|
||||
List<EmBiStructivt> list = emBiStructivtService.list(new QueryWrapper<EmBiStructivt>()
|
||||
.eq("material_id", dtl.getMaterial_id())
|
||||
.eq("stor_id", mst.getStor_id())
|
||||
.eq("workshop_id", mst.getWorkshop_id()));
|
||||
|
||||
MdMeMaterialbase mater = materialbaseService.getOne(new QueryWrapper<MdMeMaterialbase>().eq("material_id", dtl.getMaterial_id()));
|
||||
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("当前仓库内不存在物料:" + mater.getMaterial_name());
|
||||
}
|
||||
|
||||
for (EmBiStructivt ivt : list) {
|
||||
//判断是否需要继续分配库存,不大于0时跳出循环
|
||||
if (need_qty > 0) {
|
||||
double canuse_qty = ivt.getCanuse_qty().doubleValue();
|
||||
|
||||
//插入分配表
|
||||
String s = JSON.toJSONString(dtl);
|
||||
JSONObject dis = JSONObject.parseObject(s);
|
||||
StIvtStructattr structattr = structattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", ivt.getStruct_id()));
|
||||
dis.put("struct_id", structattr.getStruct_id());
|
||||
dis.put("struct_code", structattr.getStruct_code());
|
||||
dis.put("struct_name", structattr.getStruct_name());
|
||||
dis.put("sect_id", structattr.getSect_id());
|
||||
dis.put("sect_code", structattr.getSect_code());
|
||||
dis.put("sect_name", structattr.getSect_name());
|
||||
if (canuse_qty > need_qty) {
|
||||
dis.put("plan_qty", need_qty);
|
||||
dis.put("real_qty", need_qty);
|
||||
//减去库存
|
||||
double sub = NumberUtil.sub(canuse_qty, need_qty);
|
||||
ivt.setCanuse_qty(BigDecimal.valueOf(sub));
|
||||
ivt.setIvt_qty(BigDecimal.valueOf(sub));
|
||||
emBiStructivtService.updateById(ivt);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivt));
|
||||
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("change_qty",need_qty);
|
||||
param.put("result_qty", sub);
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
emBiStructivtflowService.insetIvtChange(param);
|
||||
|
||||
need_qty = 0;
|
||||
} else {
|
||||
dis.put("plan_qty", canuse_qty);
|
||||
dis.put("real_qty", canuse_qty);
|
||||
emBiStructivtService.remove(new QueryWrapper<EmBiStructivt>().eq("stockrecord_id", ivt.getStockrecord_id()));
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivt));
|
||||
param.put("change_type", ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY);
|
||||
param.put("change_qty",need_qty);
|
||||
param.put("result_qty", 0);
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
emBiStructivtflowService.insetIvtChange(param);
|
||||
|
||||
need_qty = NumberUtil.sub(need_qty - canuse_qty).doubleValue();
|
||||
}
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
mst_jo.put("mst_id", dtl.getIostorinv_id());
|
||||
mst_jo.put("dtl_id", dtl.getIostorinv_id());
|
||||
emBiIostorinvdisService.create(dis, mst_jo);
|
||||
//维护库存
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (need_qty > 0) {
|
||||
throw new BadRequestException("物料:" + mater.getMaterial_name() + "库存不足,缺少:" + need_qty + "个");
|
||||
}
|
||||
});
|
||||
|
||||
List<EmBiIostorinvdis> dis_list = emBiIostorinvdisService.list(new QueryWrapper<EmBiIostorinvdis>().eq("iostorinv_id", iostorinv_id));
|
||||
|
||||
//修改分配状态
|
||||
dis_list.forEach(dis -> {
|
||||
dis.setWork_status(IOSEnum.WORK_STATUS.code("完成"));
|
||||
emBiIostorinvdisService.updateById(dis);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private EmBiostorinv packageMstForm(EmBiostorinv stIvtIostorinvYl, JSONObject whereJson, Boolean isUpdate) {
|
||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
if (!isUpdate) {
|
||||
// 新增
|
||||
stIvtIostorinvYl.setIostorinv_id(IdUtil.getStringId());
|
||||
stIvtIostorinvYl.setBill_code(CodeUtil.getNewCode("IO_CODE"));
|
||||
stIvtIostorinvYl.setIo_type(IOSEnum.IO_TYPE.code("出库"));
|
||||
stIvtIostorinvYl.setBuss_type(whereJson.getString("bill_type"));
|
||||
stIvtIostorinvYl.setBill_type(stIvtIostorinvYl.getBuss_type());
|
||||
stIvtIostorinvYl.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
stIvtIostorinvYl.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setCreate_time(DateUtil.now());
|
||||
stIvtIostorinvYl.setIs_delete(false);
|
||||
stIvtIostorinvYl.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setUpdate_time(DateUtil.now());
|
||||
// TODO 暂时写死
|
||||
stIvtIostorinvYl.setSysdeptid("111");
|
||||
stIvtIostorinvYl.setSyscompanyid("111");
|
||||
|
||||
} else {
|
||||
// 修改
|
||||
stIvtIostorinvYl.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
stIvtIostorinvYl.setBiz_date(whereJson.getString("biz_date").substring(0, 10));
|
||||
// 获取仓库信息
|
||||
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("stor_id", whereJson.getString("stor_id"));
|
||||
wrapper.eq("is_used", true);
|
||||
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
|
||||
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
|
||||
|
||||
stIvtIostorinvYl.setStor_id(bsrealDao.getStor_id());
|
||||
stIvtIostorinvYl.setStor_code(bsrealDao.getStor_code());
|
||||
stIvtIostorinvYl.setStor_name(bsrealDao.getStor_name());
|
||||
stIvtIostorinvYl.setTotal_qty(whereJson.getBigDecimal("total_qty"));
|
||||
stIvtIostorinvYl.setDetail_count(rows.size());
|
||||
stIvtIostorinvYl.setRemark(whereJson.getString("remark"));
|
||||
stIvtIostorinvYl.setWorkshop_id(whereJson.getString("workshop_id"));
|
||||
|
||||
return stIvtIostorinvYl;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,8 @@ import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtflowService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
@@ -67,6 +69,9 @@ public class EmBiIostorinvServiceImpl extends ServiceImpl<EmBiIostorinvMapper, E
|
||||
private EmBiStructivtflowService emBiStructivtflowService; //仓位变动服务
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService; // 物料基本信息服务
|
||||
|
||||
@Override
|
||||
public Object pageQuery(EmIostorInvQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
@@ -148,6 +153,8 @@ public class EmBiIostorinvServiceImpl extends ServiceImpl<EmBiIostorinvMapper, E
|
||||
dis.setWork_status(IOSEnum.WORK_STATUS.code("完成"));
|
||||
emBiIostorinvdisService.updateById(dis);
|
||||
|
||||
MdMeMaterialbase materDao = materialbaseService.getById(dis.getMaterial_id());
|
||||
|
||||
//修改库存
|
||||
|
||||
//判断该货位和物料上是否存在
|
||||
@@ -182,6 +189,7 @@ public class EmBiIostorinvServiceImpl extends ServiceImpl<EmBiIostorinvMapper, E
|
||||
.qty_unit_id(dis.getQty_unit_id())
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.material_code(materDao.getMaterial_code())
|
||||
.workshop_id(mst.getWorkshop_id())
|
||||
.build();
|
||||
emBiStructivtService.save(ivtDao);
|
||||
|
||||
@@ -106,6 +106,11 @@ public class EmBiStructivt implements Serializable {
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mb.material_spec,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
sa.stor_code,
|
||||
sa.stor_name,
|
||||
class.class_name
|
||||
FROM
|
||||
em_bi_structivt ivt
|
||||
@@ -26,13 +25,26 @@
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code like '%${query.material_search}%' OR mb.material_name like '%${query.material_search}%')
|
||||
and (mb.material_code like '%${query.material_search}%' OR
|
||||
mb.material_name like '%${query.material_search}%' OR
|
||||
mb.material_spec like '%${query.material_search}%'
|
||||
)
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and sa.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.struct_id = #{query.struct_id}
|
||||
and (sa.struct_code like '%${query.struct_id}%' OR
|
||||
sa.struct_name like '%${query.struct_id}%')
|
||||
</if>
|
||||
<if test="query.start_time != null and query.start_time != ''">
|
||||
and ivt.instorage_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null and query.end_time != ''">
|
||||
and #{query.end_time} >= ivt.instorage_time
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
40
mes/qd/src/views/wms/device_manage/ios/embiivt/embiivt.js
Normal file
40
mes/qd/src/views/wms/device_manage/ios/embiivt/embiivt.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/emBiStructivt',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/emBiStructivt/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function exportFile(data) {
|
||||
return request({
|
||||
url: '/api/emBiStructivt/exportFile',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/emBiStructivt/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
exportFile
|
||||
}
|
||||
161
mes/qd/src/views/wms/device_manage/ios/embiivt/index.vue
Normal file
161
mes/qd/src/views/wms/device_manage/ios/embiivt/index.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="所属仓库"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓位编码">
|
||||
<el-input
|
||||
v-model="query.struct_id"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="仓位编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备件编码">
|
||||
<el-input
|
||||
v-model="query.material_search"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="备件编码、名称、规格"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" >
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="downloadMethod"
|
||||
>导出</el-button>-->
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库名称" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="库区名称" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="备件规格" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="canuse_qty" label="可用数量" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库时间" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import semiproductivt from '@/views/wms/device_manage/ios/embiivt/embiivt'
|
||||
|
||||
export default {
|
||||
name: 'Embiivt',
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '备件库存',
|
||||
optShow: { add: false, download: false, reset: true },
|
||||
idField: 'struct_id',
|
||||
url: '/api/emBiStructivt/getRawIvt',
|
||||
crudMethod: { ...semiproductivt }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
storlist: [],
|
||||
storId: null
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
downloadMethod() {
|
||||
semiproductivt.exportFile(this.query).then(res => {
|
||||
this.crud.notify('导出成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/EmBiStructivtflow',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/EmBiStructivtflow/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/EmBiStructivtflow/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del
|
||||
}
|
||||
172
mes/qd/src/views/wms/device_manage/ios/embiivtflow/index.vue
Normal file
172
mes/qd/src/views/wms/device_manage/ios/embiivtflow/index.vue
Normal file
@@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="所属仓库"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="变动类型">
|
||||
<el-select
|
||||
v-model="query.change_type_scode"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="变动类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.CHANGE_TYPE_SCODE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓位编码">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="仓位编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备件编码">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="物料编码、名称、规格"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="单据号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="stor_name" label="仓库名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="sect_name" label="库区名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="struct_code" label="仓位编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="struct_name" label="仓位名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="material_spec" label="备件规格" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="change_type_scode" label="变动类型" :formatter="formatType" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="bill_code" label="单据号" />
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="change_person_name" label="变动人" />
|
||||
<el-table-column show-overflow-tooltip min-width="150" prop="change_time" label="变动时间" />
|
||||
<el-table-column show-overflow-tooltip prop="change_qty" label="变动数" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="result_qty" label="结存数" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="unit_name" label="单位" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudStorattr, { getStor } from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import ProductivtFlow from '@/views/wms/device_manage/ios/embiivtflow/embiivtFlow'
|
||||
|
||||
export default {
|
||||
name: 'Embiivtflow',
|
||||
dicts: ['CHANGE_TYPE_SCODE'],
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '备件库存变动查询',
|
||||
optShow: { add: false, reset: true },
|
||||
idField: 'stockrecord_id',
|
||||
url: '/api/EmBiStructivtflow',
|
||||
crudMethod: { ...ProductivtFlow },
|
||||
props: { size: 20 }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
storlist: [],
|
||||
storId: null
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
formatType(row) {
|
||||
return this.dict.label.CHANGE_TYPE_SCODE[row.change_type_scode]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
442
mes/qd/src/views/wms/device_manage/ios/embiout/AddDialog.vue
Normal file
442
mes/qd/src/views/wms/device_manage/ios/embiout/AddDialog.vue
Normal file
@@ -0,0 +1,442 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="crud.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form
|
||||
ref="form"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
size="mini"
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker
|
||||
v-model="form.biz_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
align="center"
|
||||
style="width: 210px"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bill_type">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
@change="billTypeChange"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_OUT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓库</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop_id">
|
||||
<label slot="label">车间</label>
|
||||
<el-select
|
||||
v-model="form.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
style="width: 380px;"
|
||||
rows="2"
|
||||
type="textarea"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent()"
|
||||
>
|
||||
选择库存
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="form.tableData[scope.$index].plan_qty"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
precision="3"
|
||||
:min="0"
|
||||
@change="changeQty"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="form.tableData[scope.$index].remark"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
@change="changeQty"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<StructIvt
|
||||
:dialog-show.sync="ivtShow"
|
||||
@setMaterValue="tableChanged"
|
||||
/>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import crudProductOut from '@/views/wms/device_manage/ios/embiout/embiout'
|
||||
import crudStructattr from '@/api/wms/basedata/st/structattr'
|
||||
import StructIvt from '@/views/wms/device_manage/ios/embiout/StructIvt'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
product_code: '',
|
||||
bill_status: '10',
|
||||
total_qty: '0',
|
||||
detail_count: '0',
|
||||
stor_id: '',
|
||||
struct_id: '',
|
||||
bill_type: '',
|
||||
workshop_id: '',
|
||||
remark: '',
|
||||
biz_date: new Date(),
|
||||
create_mode: '',
|
||||
tableData: [],
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { StructIvt },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['IO_BILL_STATUS', 'EM_BI_OUT_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
ivtShow: false,
|
||||
billShow: false,
|
||||
bill_btn:true,
|
||||
mater_btn:true,
|
||||
struct_id: '',
|
||||
sect_id: '',
|
||||
opendtlParam: null,
|
||||
storlist: [],
|
||||
sects: [],
|
||||
billtypelist: [],
|
||||
rules: {
|
||||
product_code: [
|
||||
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
|
||||
],
|
||||
bill_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取入库单明细
|
||||
crudProductOut.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.form.stor_id) {
|
||||
this.crud.notify('仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
if (!row.plan_qty) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.sect_id = this.sect_id
|
||||
row.struct_id = this.struct_id
|
||||
}
|
||||
},
|
||||
billTypeChange(value){
|
||||
if (value === '21'){
|
||||
this.bill_btn = false
|
||||
this.mater_btn = true
|
||||
}else if (value === '23'){
|
||||
this.bill_btn = true
|
||||
this.mater_btn = false
|
||||
}else {
|
||||
this.bill_btn = true
|
||||
this.mater_btn = true
|
||||
}
|
||||
},
|
||||
storChange(value) {
|
||||
crudStructattr.getSectCascader({ 'stor_id': value }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
debugger
|
||||
this.sectProp = val
|
||||
if (val.length === 1) {
|
||||
this.sect_id = val[0]
|
||||
this.struct_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.sect_id = ''
|
||||
this.struct_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.sect_id = val[0]
|
||||
this.struct_id = val[1]
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
const material_code = rows[index].material_code
|
||||
let len = rows.length
|
||||
while (len--) {
|
||||
const obj = rows[len]
|
||||
if (material_code === obj.material_code) {
|
||||
const index = rows.indexOf(obj)
|
||||
if (index > -1) { // 移除找到的指定元素
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tableChanged(rows) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.material_code === item.material_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
item.quality_scode = '01'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.plan_qty = item.canuse_qty
|
||||
item.qty_unit_id = item.qty_unit_id
|
||||
item.qty_unit_name = item.qty_unit_name
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
insertEvent(row) {
|
||||
this.ivtShow = true
|
||||
},
|
||||
insertBill(row) {
|
||||
this.billShow = true
|
||||
},
|
||||
changeQty() {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
155
mes/qd/src/views/wms/device_manage/ios/embiout/StructIvt.vue
Normal file
155
mes/qd/src/views/wms/device_manage/ios/embiout/StructIvt.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="库存选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1200px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="入库日期">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓位编码">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓位编码、名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备件编码">
|
||||
<el-input
|
||||
v-model="query.material_search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="备件编码、名称、规格"
|
||||
style="width: 230px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation/>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column show-overflow-tooltip width="150" prop="sect_code" label="库区"/>
|
||||
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="备件编号"/>
|
||||
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="备件名称"/>
|
||||
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别"/>
|
||||
<el-table-column show-overflow-tooltip width="150" prop="canuse_qty" label="数量"/>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
|
||||
<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 CRUD, {crud, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'AddDtl',
|
||||
components: {crudOperation, rrOperation, pagination, DateRangePicker},
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '备件可用库存',
|
||||
url: '/api/emBiStructivt/getRawIvt',
|
||||
crudMethod: {},
|
||||
optShow: {
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
rows: [],
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return {
|
||||
rowspan: 2,
|
||||
colspan: 1
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
this.$emit('setMaterValue', this.rows)
|
||||
// this.form = this.$options.data().form
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
251
mes/qd/src/views/wms/device_manage/ios/embiout/ViewDialog.vue
Normal file
251
mes/qd/src/views/wms/device_manage/ios/embiout/ViewDialog.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="出库详情"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true"
|
||||
:model="form" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产车间">
|
||||
<el-select
|
||||
v-model="form.product_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_OUT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="总数量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker v-model="form.biz_date" type="date" placeholder="选择日期" style="width: 210px"
|
||||
value-format="yyyy-MM-dd" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span2">入库明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
size="mini"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center"/>
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="备件编码" align="center"/>
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="备件名称" align="center"/>
|
||||
<el-table-column prop="pcsn" label="批次" width="150" align="center"/>
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center"/>
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center"/>
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center"/>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {crud} from '@crud/crud'
|
||||
import crudProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: {},
|
||||
mixins: [crud()],
|
||||
dicts: ['EM_BI_OUT_TYPE', 'product_area', 'IO_BILL_STATUS'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
tabledis: [],
|
||||
billtypelist: [],
|
||||
storlist: [],
|
||||
currentdtl: null,
|
||||
currentDis: {},
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.queryTableDtl()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.currentDis = {}
|
||||
this.currentdtl = null
|
||||
this.tableDtl = []
|
||||
this.tabledis = []
|
||||
this.$emit('TaskChanged')
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
task_statusFormat(row) {
|
||||
return this.dict.label.task_status[row.task_status]
|
||||
},
|
||||
work_statusFormat(row) {
|
||||
return this.dict.label.work_status[row.work_status]
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.tabledis = []
|
||||
this.currentdtl = current
|
||||
this.queryTableDdis()
|
||||
} else {
|
||||
this.tabledis = []
|
||||
this.currentdtl = {}
|
||||
}
|
||||
},
|
||||
invtypeFormat(row, column) {
|
||||
for (const item of this.billtypelist) {
|
||||
if (item.code === row.source_bill_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
handleDisCurrentChange(current) {
|
||||
this.currentDis = current
|
||||
},
|
||||
queryTableDtl() {
|
||||
crudProductIn.getIODtl({'iostorinv_id': this.form.iostorinv_id}).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
crudProductIn.getDisTask({'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id}).then(res => {
|
||||
this.tabledis = res
|
||||
}).catch(() => {
|
||||
this.tabledis = []
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size: 20px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span2 {
|
||||
padding: 0px 0px 20px 0px;
|
||||
}
|
||||
|
||||
.crud-opts2 {
|
||||
padding: 10px 0px 0px 50px;
|
||||
}
|
||||
|
||||
</style>
|
||||
228
mes/qd/src/views/wms/device_manage/ios/embiout/embiout.js
Normal file
228
mes/qd/src/views/wms/device_manage/ios/embiout/embiout.js
Normal file
@@ -0,0 +1,228 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getIODtl(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getIODtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getIODis(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getIODis',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getOutBillDisDtl(params) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getOutBillDisDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getOutBillTask(params) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getOutBillTask',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getInvTypes() {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getInvTypes',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function insertDtl(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/insertDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function allDiv(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/allDiv',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function allDivOne(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/allDivOne',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function allCancel(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/allCancel',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function oneCancel(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/oneCancel',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function setPoint(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/setPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function oneSetPoint(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/oneSetPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getStructIvt(params) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getStructIvt',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function manualDiv(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/manualDiv',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function issueTask(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/issueTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function finishTask(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/finishTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function cancleTaskfinish(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/cancleTaskfinish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function paramByCodeType(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/paramByCodeType',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function schAreaType(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/schAreaType',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function backConfirm(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/backConfirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getType() {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function moneySubmit(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/moneySubmit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getDisNum(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getDisNum',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function queryBox(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/queryBox',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getOutBillTask2(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/getOutBillTask2',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function cancelTask(data) {
|
||||
return request({
|
||||
url: '/api/out/emBiIostorinv/out/cancelTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function allSetPoint(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/allSetPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function oneSetPoint2(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/out/oneSetPoint2',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, allDiv, allCancel, getIODtl, getIODis, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2 }
|
||||
335
mes/qd/src/views/wms/device_manage/ios/embiout/index.vue
Normal file
335
mes/qd/src/views/wms/device_manage/ios/embiout/index.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
|
||||
<el-form-item label="仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据类型">
|
||||
<el-select
|
||||
v-model="query.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="单据类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_OUT_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生成方式">
|
||||
<el-select
|
||||
v-model="query.create_mode"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="生成方式"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_CREATE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
align="center"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="出库单号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="出库单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="车间">
|
||||
<el-select
|
||||
v-model="query.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="confirm_flag"
|
||||
@click="confirm"
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stor_name" label="生产车间" width="130" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="bill_type"
|
||||
min-width="120"
|
||||
label="业务类型"
|
||||
:formatter="bill_typeFormat"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
||||
<el-table-column label="明细数量" align="center" prop="detail_count" />
|
||||
<el-table-column label="总数量" align="center" prop="total_qty">
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="制单人" align="center" prop="create_name" />
|
||||
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_name" />
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import rawProductOut from '@/views/wms/device_manage/ios/embiout/embiout'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/device_manage/ios/embiout/AddDialog'
|
||||
import ViewDialog from '@/views/wms/device_manage/ios/embiout/ViewDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
|
||||
export default {
|
||||
name: 'Embiout',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '备件出库',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'iostorinv_id',
|
||||
url: '/api/emBiIostorinv/out',
|
||||
sort: ['bill_code,desc'],
|
||||
crudMethod: { ...rawProductOut }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['IO_BILL_STATUS', 'EM_BI_OUT_TYPE', 'product_area', 'ST_INV_CREATE'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
confirm_flag: true,
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
divShow: false,
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user'
|
||||
])
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
canUd(row) {
|
||||
return row.bill_status !== '10'
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(currentRow) {
|
||||
if (currentRow !== null) {
|
||||
this.currentRow = currentRow
|
||||
if (currentRow.bill_status === '10') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.confirm_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
bill_typeFormat(row, column) {
|
||||
return this.dict.label.EM_BI_OUT_TYPE[row.bill_type]
|
||||
},
|
||||
toView(row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
confirm() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
rawProductOut.confirm(this.currentRow).then(res => {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user