修改
This commit is contained in:
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.inbill.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -58,6 +59,7 @@ public class RawAssistIStorController {
|
||||
rawAssistIStorService.insertDtl(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改入库单")
|
||||
@ApiOperation("修改入库单")
|
||||
@@ -127,6 +129,24 @@ public class RawAssistIStorController {
|
||||
return new ResponseEntity<>(rawAssistIStorService.queryTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delDis")
|
||||
@Log("删除分配")
|
||||
@ApiOperation("删除分配")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> delDis(@RequestBody JSONObject whereJson) {
|
||||
rawAssistIStorService.delDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryBoxMater")
|
||||
@Log("查询箱内子卷")
|
||||
@ApiOperation("查询箱内子卷")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONArray whereJson) {
|
||||
|
||||
return new ResponseEntity<>(rawAssistIStorService.queryBoxMater(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTask")
|
||||
@Log("变更任务")
|
||||
@ApiOperation("变更任务")
|
||||
|
||||
@@ -22,6 +22,10 @@ public interface RawAssistIStorService {
|
||||
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void delDis(JSONObject whereJson);
|
||||
|
||||
JSONArray queryBoxMater(JSONArray rows);
|
||||
|
||||
void update(Map whereJson);
|
||||
|
||||
void commit(Map whereJson);
|
||||
|
||||
@@ -110,8 +110,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
map.put("material_search", "%" + material_search + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(begin_time)) {
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("begin_time", begin_time.substring(0, 10));
|
||||
map.put("end_time", end_time.substring(0, 10));
|
||||
}
|
||||
JSONObject jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "date_of_FG_inbound,package_box_sn desc");
|
||||
return jo;
|
||||
@@ -165,6 +165,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
row.put("material_id", material.getString("material_id"));
|
||||
row.put("pcsn", row.get("container_name"));
|
||||
row.put("bill_status", "30");
|
||||
row.put("quality_scode", "01");
|
||||
row.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
row.put("qty_unit_name", unit.getString("unit_name"));
|
||||
@@ -245,6 +246,34 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delDis(JSONObject whereJson) {
|
||||
String box_no = whereJson.getString("package_box_sn");
|
||||
//将状态为包装的改为生成
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("status", "0");
|
||||
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + box_no + "' AND status = '1'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryBoxMater(JSONArray rows) {
|
||||
JSONArray total_rows = new JSONArray();
|
||||
HashSet<String> set = new HashSet<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
String package_box_sn = row.getString("package_box_sn");
|
||||
set.add(package_box_sn);
|
||||
}
|
||||
for (String s : set) {
|
||||
JSONArray maters = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "16").addParam("package_box_sn", s).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < maters.size(); i++) {
|
||||
JSONObject mater = maters.getJSONObject(i);
|
||||
total_rows.add(mater);
|
||||
}
|
||||
}
|
||||
return total_rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Map whereJson) {
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
@@ -261,28 +290,79 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||
WQLObject wo_dis = WQLObject.getWQLObject("st_ivt_iostorinvdis");
|
||||
wo.update(whereJson);
|
||||
//先删除该单据下的所有明细
|
||||
String iostorinv_id = (String) whereJson.get("iostorinv_id");
|
||||
wo_dtl.delete("iostorinv_id = '" + iostorinv_id + "'");
|
||||
JSONArray dis_rows = wo_dis.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
String box_no = dis_row.getString("box_no");
|
||||
//将状态为包装的改为生成
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (whereJson.get("bill_type").equals("0003")) {
|
||||
map.put("status", "3");
|
||||
}else {
|
||||
map.put("status", "0");
|
||||
}
|
||||
|
||||
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + box_no + "' AND status = '1'");
|
||||
}
|
||||
wo_dis.delete("iostorinv_id = '" + iostorinv_id + "'");
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
HashMap<String, String> row = rows.get(i);
|
||||
row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
row.put("iostorinv_id", iostorinv_id);
|
||||
row.put("seq_no", (i + 1) + "");
|
||||
row.put("bill_status", "10");
|
||||
row.put("unassign_qty", row.get("plan_qty"));
|
||||
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
|
||||
row.put("material_id", material.getString("material_id"));
|
||||
row.put("pcsn", row.get("container_name"));
|
||||
row.put("bill_status", "30");
|
||||
row.put("quality_scode", "01");
|
||||
row.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
row.put("qty_unit_name", unit.getString("unit_name"));
|
||||
row.put("assign_qty", row.get("net_weight"));
|
||||
row.put("plan_qty", row.get("net_weight"));
|
||||
String net_weight = row.get("net_weight");
|
||||
row.put("box_no", row.get("package_box_sn"));
|
||||
|
||||
/*//如果是退货入库,查询对应的包装关系维护交货单号和交货单行号
|
||||
if (whereJson.get("bill_type").equals("0002")) {
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '" + row.get("container_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到对应的子卷包装关系!");
|
||||
}
|
||||
row.put("vbeln", sub_jo.getString("vbeln"));
|
||||
row.put("posnr", sub_jo.getString("posnr"));
|
||||
}*/
|
||||
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
|
||||
|
||||
//如果生成的入库单为软废采购入库需要将采购订单接口处理表改为采购中
|
||||
if (whereJson.get("bill_type").equals("000202")) {
|
||||
HashMap<String, String> proc_map = new HashMap<>();
|
||||
proc_map.put("proc_status", "02");
|
||||
proc_map.put("update_optid", currentUserId + "");
|
||||
proc_map.put("update_optname", nickName);
|
||||
proc_map.put("update_time", now);
|
||||
WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc").update(proc_map, "id = '" + row.get("base_billdtl_id") + "'");
|
||||
JSONObject dis = new JSONObject();
|
||||
dis.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
dis.put("iostorinv_id", iostorinv_id);
|
||||
dis.put("iostorinvdtl_id", row.get("iostorinvdtl_id"));
|
||||
dis.put("seq_no", 1);
|
||||
dis.put("material_id", row.get("material_id"));
|
||||
dis.put("pcsn", row.get("pcsn"));
|
||||
dis.put("box_no", row.get("box_no"));
|
||||
dis.put("quality_scode", row.get("quality_scode"));
|
||||
dis.put("work_status", "00");
|
||||
dis.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
dis.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dis.put("plan_qty", row.get("plan_qty"));
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").insert(dis);
|
||||
|
||||
//将包装关系中对应的记录状态改为包装
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("status", "1");
|
||||
if (whereJson.get("bill_type").equals("0003")) {
|
||||
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '3'");
|
||||
} else {
|
||||
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis.getString("box_no") + "' AND status = '0'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,8 @@
|
||||
product_description,
|
||||
width,
|
||||
thickness,
|
||||
net_weight
|
||||
net_weight,
|
||||
net_weight AS plan_qty
|
||||
FROM
|
||||
pdm_bi_subpackagerelation sub
|
||||
WHERE
|
||||
@@ -111,7 +112,7 @@
|
||||
sub.date_of_FG_inbound >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
sub.date_of_FG_inbound <= 输入.begin_time
|
||||
sub.date_of_FG_inbound <= 输入.end_time
|
||||
ENDOPTION
|
||||
OPTION 输入.bill_code <> ""
|
||||
sub.sale_order_name = 输入.bill_code
|
||||
@@ -137,6 +138,7 @@
|
||||
QUERY
|
||||
SELECT DISTINCT
|
||||
dtl.*,
|
||||
sub.*,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mst.bill_code
|
||||
@@ -144,6 +146,7 @@
|
||||
st_ivt_iostorinvdtl dtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
LEFT JOIN ST_IVT_IOStorInv mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dtl.pcsn
|
||||
where
|
||||
mst.bill_code = 输入.bill_code
|
||||
OPTION 输入.open_flag = "1"
|
||||
@@ -596,6 +599,32 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "16"
|
||||
QUERY
|
||||
SELECT
|
||||
sale_order_name,
|
||||
customer_name,
|
||||
customer_description,
|
||||
package_box_sn,
|
||||
quanlity_in_box,
|
||||
container_name,
|
||||
product_name,
|
||||
product_description,
|
||||
width,
|
||||
thickness,
|
||||
net_weight,
|
||||
net_weight AS plan_qty
|
||||
FROM
|
||||
pdm_bi_subpackagerelation sub
|
||||
WHERE
|
||||
sub.status = '0'
|
||||
OPTION 输入.package_box_sn <> ""
|
||||
sub.package_box_sn = 输入.package_box_sn
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
package org.nl.wms.statistics.rest;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.statistics.service.IostordailyService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @date 2022-01-17
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "收发存查询管理")
|
||||
@RequestMapping("/api/iostordaily")
|
||||
@Slf4j
|
||||
public class IostordailyController {
|
||||
|
||||
private final IostordailyService iostordailyService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询收发存查询")
|
||||
@ApiOperation("查询收发存查询")
|
||||
//@PreAuthorize("@el.check('iostordaily:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(iostordailyService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getStor")
|
||||
@Log("查询仓库")
|
||||
@ApiOperation("查询仓库")
|
||||
public ResponseEntity<Object> getStor(){
|
||||
return new ResponseEntity<>(iostordailyService.getStor(),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
package org.nl.wms.statistics.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author Liuxy
|
||||
* @date 2022-01-17
|
||||
**/
|
||||
public interface IostordailyService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询仓库
|
||||
*/
|
||||
JSONArray getStor();
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.nl.wms.statistics.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author Liuxy
|
||||
* @date 2022-01-17
|
||||
**/
|
||||
@Data
|
||||
public class IostordailyDto implements Serializable {
|
||||
|
||||
/** 仓库日表标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long stordaily_id;
|
||||
|
||||
/** 仓库标识 */
|
||||
private Long stor_id;
|
||||
|
||||
/** 仓库编码 */
|
||||
private String stor_code;
|
||||
|
||||
/** 仓库名称 */
|
||||
private String stor_name;
|
||||
|
||||
/** 日期 */
|
||||
private String sect_date;
|
||||
|
||||
/** 物料标识 */
|
||||
private Long material_id;
|
||||
|
||||
/** 品质类型 */
|
||||
private String quality_scode;
|
||||
|
||||
/** 批次 */
|
||||
private String pcsn;
|
||||
|
||||
/** 库存等级 */
|
||||
private String ivt_level;
|
||||
|
||||
/** 是否可用 */
|
||||
private String is_active;
|
||||
|
||||
/** 期初数 */
|
||||
private BigDecimal start_num;
|
||||
|
||||
/** 入库数 */
|
||||
private BigDecimal in_num;
|
||||
|
||||
/** 出库数 */
|
||||
private BigDecimal out_num;
|
||||
|
||||
/** 其它加 */
|
||||
private BigDecimal more_num;
|
||||
|
||||
/** 其它减 */
|
||||
private BigDecimal less_num;
|
||||
|
||||
/** 期末数 */
|
||||
private BigDecimal end_num;
|
||||
|
||||
/** 数量计量单位标识 */
|
||||
private Long qty_unit_id;
|
||||
|
||||
/** 数量计量单位名称 */
|
||||
private String qty_unit_name;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
package org.nl.wms.statistics.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
import org.nl.wms.statistics.service.IostordailyService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author Liuxy
|
||||
* @date 2022-01-17
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class IostordailyServiceImpl implements IostordailyService {
|
||||
private final ClassstandardService classstandardService;
|
||||
private final MaterialbaseService materialbaseService;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
//物料限制的时候使用,初始化页面
|
||||
String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
map.put("flag", "1");
|
||||
//处理物料当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(material_type_id)) {
|
||||
map.put("material_type_id", material_type_id);
|
||||
String classIds = classstandardService.getChildIdStr(material_type_id);
|
||||
map.put("classIds", classIds);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr)) {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(material_code)) {
|
||||
//处理转义字符
|
||||
if (material_code.contains("\\"))material_code=material_code.replace("\\","\\\\\\");
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) map.put("pcsn", "%" + pcsn + "%");
|
||||
JSONObject json = WQL.getWO("SendReceiveQuery_query_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "da.sect_date desc");
|
||||
|
||||
/*
|
||||
* 处理所属组织
|
||||
* 1.PG粉所属组织:通过物料编码+批次找工令所属组织来获取
|
||||
* 2.软废所属组织:物料编码去掉后缀 例如:-YZ 找最近完成的工令获取所属组织,若还有其他事业部,页面单元格底色标黄色
|
||||
* 3.除PG粉和软废外其他类型物料所属组织取不到 为空就行
|
||||
*/
|
||||
WQLObject workTab = WQLObject.getWQLObject("PDM_BI_WorkOrder"); // 工令表
|
||||
WQLObject deptTab = WQLObject.getWQLObject("sys_dept"); // 部门表
|
||||
|
||||
JSONArray contentArr = json.getJSONArray("content");
|
||||
for (int i = 0; i < contentArr.size(); i++) {
|
||||
JSONObject jsonObject = contentArr.getJSONObject(i);
|
||||
String material_id = jsonObject.getString("material_id");
|
||||
String pcsn_1 = jsonObject.getString("pcsn");
|
||||
|
||||
/*// 判断物料是PG粉还是软废
|
||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), material_id, null);
|
||||
boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), material_id, null);
|
||||
|
||||
if (is_pgf) {
|
||||
JSONObject jsonWork = workTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn_1 + "' and is_delete ='0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonWork)) continue;
|
||||
|
||||
JSONObject jsonDept = deptTab.query("dept_id = '" + jsonWork.getString("org_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonDept)) jsonObject.put("dept_name", jsonDept.getString("name"));
|
||||
}
|
||||
|
||||
if (is_rf) {
|
||||
// 截取 "-" 最后出现的前面的字符串
|
||||
String material_code_1 = jsonObject.getString("material_code");
|
||||
int lastIndexOf = material_code_1.lastIndexOf('-');
|
||||
String material_code_sub = material_code_1.substring(0, lastIndexOf);
|
||||
|
||||
JSONArray workArr = WQL.getWO("SendReceiveQuery_query_01").addParam("flag", "3").addParam("material_code", material_code_sub).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(workArr)) continue;
|
||||
if (workArr.size() > 1) {
|
||||
jsonObject.put("is_yellow", "1");
|
||||
JSONObject json_1 = workArr.getJSONObject(0);
|
||||
jsonObject.put("dept_name",json_1.getString("dept_name"));
|
||||
} else {
|
||||
JSONObject json_1 = workArr.getJSONObject(0);
|
||||
jsonObject.put("dept_name",json_1.getString("dept_name"));
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getStor() {
|
||||
JSONArray jsonArr = WQL.getWO("SendReceiveQuery_query_01").addParam("flag", "2").process().getResultJSONArray(0);
|
||||
return jsonArr;
|
||||
}
|
||||
}
|
||||
@@ -323,9 +323,20 @@ export default {
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
debugger
|
||||
const package_box_sn = rows[index].package_box_sn
|
||||
let len = rows.length
|
||||
while (len--) {
|
||||
const obj = rows[len]
|
||||
if (package_box_sn === obj.package_box_sn) {
|
||||
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) {
|
||||
debugger
|
||||
@@ -341,7 +352,6 @@ export default {
|
||||
item.quality_scode = '01'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.plan_qty = item.need_qty
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip width="200" prop="sale_order_name" label="订单号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="customer_name" label="客户编号" />
|
||||
<el-table-column prop="customer_name" label="客户名称" />
|
||||
<el-table-column width="200" prop="customer_description" label="客户名称" />
|
||||
<el-table-column show-overflow-tooltip prop="package_box_sn" width="250" label="箱号" />
|
||||
<el-table-column show-overflow-tooltip width="100" prop="quanlity_in_box" label="箱内子卷数" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="container_name" label="子卷号" />
|
||||
@@ -90,6 +90,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
|
||||
const start = new Date()
|
||||
export default {
|
||||
@@ -162,8 +163,11 @@ export default {
|
||||
debugger
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
// this.form = this.$options.data().form
|
||||
crudRawAssist.queryBoxMater(this.rows).then(res => {
|
||||
this.rows = res
|
||||
this.$emit('tableChanged', this.rows)
|
||||
})
|
||||
// this.form = this.$options.data().form
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,14 +136,12 @@
|
||||
<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="批次号" align="center" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
||||
<el-table-column prop="bucket_num" label="桶数" :formatter="crud.formatNum0" align="center" />
|
||||
<el-table-column prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="box_no" label="载具号" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="start_point_code" label="起始位置" align="center" />
|
||||
<el-table-column prop="next_point_code" label="目的位置" align="center" />
|
||||
<el-table-column prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="订单编码">
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
|
||||
@@ -192,6 +192,22 @@ export function backConfirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delDis(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/delDis',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryBoxMater(data) {
|
||||
return request({
|
||||
url: '/api/in/rawAssist/queryBoxMater',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getType, getBillDtl, insertDtl, getIODtl, commit, checkVehicle,
|
||||
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint,
|
||||
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
|
||||
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="出入库详情"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
fullscreen
|
||||
@close="close"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">出入库明细</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"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="assign_qty" label="已分配重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="unassign_qty" label="未分配重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column prop="quality_scode" label="品质类型" align="center" width="110px" :formatter="quality_scodeFormat" />
|
||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
|
||||
<el-table-column prop="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">载具物料明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table2"
|
||||
:data="tabledis"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="real_qty" label="出入库重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="出入库点" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
|
||||
export default {
|
||||
name: 'DivDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'is_usable'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
mstrow: {},
|
||||
tabledis: [],
|
||||
currentRow: {},
|
||||
invtypelist: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableDtl = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.mstrow = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
checkoutbill.getInvTypes().then(res => {
|
||||
this.invtypelist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.currentRow = null
|
||||
this.tableDtl = []
|
||||
this.tabledis = []
|
||||
this.$emit('DivChanged')
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
return this.dict.label.io_bill_status[row.bill_status]
|
||||
},
|
||||
quality_scodeFormat(row) {
|
||||
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
|
||||
},
|
||||
ivt_levelFormat(row) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
is_activeFormat(row) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
invtypeFormat(row) {
|
||||
for (const item of this.invtypelist) {
|
||||
if (item.code === row.source_bill_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
this.tabledis = []
|
||||
this.getOutBillDisDtl(current.iostorinvdtl_id)
|
||||
} else {
|
||||
this.mstrow.iostorinvdtl_id = ''
|
||||
this.currentRow = {}
|
||||
this.tabledis = []
|
||||
}
|
||||
},
|
||||
queryTableDtl() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
getOutBillDisDtl(iostorinvdtl_id) {
|
||||
checkoutbill.getOutBillDisDtl({ 'iostorinvdtl_id': 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>
|
||||
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="出入库单指令"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
fullscreen
|
||||
@close="close"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid #ffffff">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<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"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" label="出库单号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="start_point_code" label="起始位置" align="center" :formatter="start_point_codeFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" label="目的位置" align="center" :formatter="point_codeFormat" />
|
||||
<el-table-column prop="work_status" label="任务状态" align="center" width="110px" :formatter="work_statusFormat" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">作业明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table2"
|
||||
:data="tabledis"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleDisCurrentChange"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="bucket_num" label="桶数" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="total_storage_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="start_point_code" label="起始位置" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="next_point_code" label="目的位置" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column prop="taskdtl_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { crud } from '@crud/crud'
|
||||
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
|
||||
|
||||
export default {
|
||||
name: 'TaskDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['work_status', 'task_status', 'io_bill_status', 'SCH_TASK_TYPE_DTL'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
mstrow: {},
|
||||
tabledis: [],
|
||||
currentdtl: null,
|
||||
currentDis: {},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableDtl = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.mstrow = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.currentDis = {}
|
||||
this.currentdtl = null
|
||||
this.tableDtl = []
|
||||
this.tabledis = []
|
||||
this.$emit('TaskChanged')
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
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]
|
||||
},
|
||||
start_point_codeFormat(row) {
|
||||
if(row.io_type==='1'){
|
||||
return row.start_point_code
|
||||
}else if(row.io_type==='0'){
|
||||
return row.point_code
|
||||
}
|
||||
},
|
||||
point_codeFormat(row) {
|
||||
if(row.io_type==='1'){
|
||||
return row.point_code
|
||||
}else if(row.io_type==='0'){
|
||||
return row.start_point_code
|
||||
}
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.tabledis = []
|
||||
this.currentdtl = current
|
||||
this.queryTableDdis()
|
||||
} else {
|
||||
this.tabledis = []
|
||||
this.currentdtl = {}
|
||||
}
|
||||
},
|
||||
handleDisCurrentChange(current) {
|
||||
this.currentDis = current
|
||||
},
|
||||
queryTableDtl() {
|
||||
this.tableDtl = []
|
||||
checkoutbill.getOutBillDis({ 'iostorinv_id': this.mstrow.iostorinv_id }).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
checkoutbill.getOutBillTask({ '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>
|
||||
386
lms/nladmin-ui/src/views/wms/statistics/ioStorQuery/index.vue
Normal file
386
lms/nladmin-ui/src/views/wms/statistics/ioStorQuery/index.vue
Normal file
@@ -0,0 +1,386 @@
|
||||
<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="90px"
|
||||
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.io_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="出入类型"
|
||||
class="filter-item"
|
||||
@change="ioTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.io_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</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 billtypelist"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</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.is_upload"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="是否回传"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.is_upload"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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.pcsn"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="批次模糊查询"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品质类型">
|
||||
<el-select
|
||||
v-model="query.quality_scode"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_QUALITY_SCODE"
|
||||
: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="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="dis_flag"
|
||||
@click="divOpen"
|
||||
>
|
||||
单据明细
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
:disabled="work_flag"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
@click="taskOpen"
|
||||
>
|
||||
作业明细
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
:max-height="590"
|
||||
style="width: 100%;"
|
||||
:highlight-current-row="true"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="订单编码" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="100" prop="bill_status" label="单据状态" />
|
||||
<el-table-column prop="stor_name" label="仓库" width="100" />
|
||||
<el-table-column prop="io_type" label="出入库类型" :formatter="ioFormat" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" min-width="120" label="业务类型" />
|
||||
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
|
||||
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
|
||||
<el-table-column label="明细数" align="center" prop="detail_count" width="100" />
|
||||
<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="input_optname" />
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_optname" />
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||||
<el-table-column label="回传人" align="center" prop="upload_optname" width="150" />
|
||||
<el-table-column label="回传时间" align="center" prop="upload_time" width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<DivDialog :dialog-show.sync="divShow" :open-array="openParam" :rowmst="mstrow" @DivChanged="querytable" />
|
||||
<TaskDialog :dialog-show.sync="taskShow" :open-array="openParam" :rowmst="mstrow" @TaskChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkoutbill from '@/api/wms/st/core/outbill/checkoutbill'
|
||||
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 DivDialog from '@/views/wms/statistics/ioStorQuery/DivDialog'
|
||||
import TaskDialog from '@/views/wms/statistics/ioStorQuery/TaskDialog'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudRawAssist from '@/api/wms/st/core/inbill/rawassist'
|
||||
|
||||
export default {
|
||||
name: 'IoStorQuery',
|
||||
components: { crudOperation, rrOperation, pagination, TaskDialog, DivDialog },
|
||||
cruds() {
|
||||
return CRUD({ title: '出入库单报表',
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},idField: 'iostorinv_id', url: 'api/checkoutbill', crudMethod: { ...checkoutbill },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['ST_QUALITY_SCODE', 'io_bill_status', 'ST_CREATE_MODE', 'io_type', 'is_upload'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
},
|
||||
divShow: false,
|
||||
taskShow: false,
|
||||
dis_flag: true,
|
||||
work_flag: true,
|
||||
openParam: [],
|
||||
mstrow: {},
|
||||
currentRow: null,
|
||||
checkrows: [],
|
||||
storlist: [],
|
||||
billtypelist: []
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
checkoutbill.getType().then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
ioFormat(row, column) {
|
||||
return this.dict.label.io_type[row.io_type]
|
||||
},
|
||||
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(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
this.dis_flag = false
|
||||
this.work_flag = false
|
||||
}
|
||||
},
|
||||
ioTypeChange(value) {
|
||||
if (value === '1') {
|
||||
crudRawAssist.getType({ 'io_code': '', 'io_flag': '01' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
} else if (value === '0') {
|
||||
crudRawAssist.getType({ 'io_code': '', 'io_flag': '00' }).then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
} else {
|
||||
checkoutbill.getType().then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
stateFormat(row) {
|
||||
return this.dict.label.io_bill_status[row.bill_status]
|
||||
},
|
||||
bill_typeFormat(row) {
|
||||
for (const item of this.billtypelist) {
|
||||
if (item.code === row.bill_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
create_modeFormat(row) {
|
||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current === null) {
|
||||
this.dis_flag = true
|
||||
this.work_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
divOpen() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.divShow = true
|
||||
this.mstrow = this.currentRow
|
||||
})
|
||||
},
|
||||
taskOpen() {
|
||||
checkoutbill.getOutBillDis({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.taskShow = true
|
||||
this.mstrow = this.currentRow
|
||||
})
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/iostordaily/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/iostordaily',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStor() {
|
||||
return request({
|
||||
url: 'api/iostordaily/getStor',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStor }
|
||||
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
|
||||
<el-form-item label="仓库">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
style="width: 220px;"
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in this.storList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
<label slot="label">日 期:</label>
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批次">
|
||||
<label slot="label">批 次:</label>
|
||||
<el-input
|
||||
style="width: 220px"
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
placeholder="请输入批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料类别">
|
||||
<treeselect
|
||||
v-model="query.material_type_id"
|
||||
:load-options="loadClass"
|
||||
:options="classes"
|
||||
style="width: 220px;"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" :cell-style="cellStyleMst" show-summary :summary-method="getSum" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column prop="stor_name" label="仓库"/>
|
||||
<el-table-column prop="class_code" label="物料分类编码" width="100px" />
|
||||
<el-table-column prop="class_name" label="物料分类名称" width="100px" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_model" label="型号/牌号" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="unit_name" label="主单位"/>
|
||||
<el-table-column prop="pcsn" label="批次号" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="dept_name" label="所属组织" min-width="120" show-overflow-tooltip/>
|
||||
<!-- <el-table-column prop="quality_scode" label="品质类型" :formatter="formatQualityName" />-->
|
||||
<el-table-column prop="ivt_level" label="质量等级" :formatter="formatIvtName" />
|
||||
<!-- <el-table-column prop="is_active" label="是否可用" :formatter="formatIsName" />-->
|
||||
<el-table-column prop="start_num" label="期初主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<el-table-column prop="in_num" label="入库主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<el-table-column prop="out_num" label="出库主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
<!-- <el-table-column prop="less_num" label="其他出" :formatter="crud.formatNum3"/>-->
|
||||
<!-- <el-table-column prop="more_num" label="其他入" :formatter="crud.formatNum3"/>-->
|
||||
<el-table-column prop="end_num" label="结存主数量" :formatter="crud.formatNum3" width="100px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudIostordaily from '@/api/wms/statistics/iostordaily'
|
||||
import CRUD, {crud, form, 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'
|
||||
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
||||
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from "@/api/wms/basedata/master/materialbase";
|
||||
import crudBucketrecord from "@/api/wms/basedata/master/bucketrecord";
|
||||
|
||||
const defaultForm = {
|
||||
stordaily_id: null,
|
||||
stor_id: null,
|
||||
stor_code: null,
|
||||
stor_name: null,
|
||||
sect_date: null,
|
||||
material_id: null,
|
||||
quality_scode: null,
|
||||
pcsn: null,
|
||||
ivt_level: null,
|
||||
is_active: null,
|
||||
start_num: null,
|
||||
in_num: null,
|
||||
out_num: null,
|
||||
more_num: null,
|
||||
less_num: null,
|
||||
end_num: null,
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null
|
||||
}
|
||||
export default {
|
||||
name: 'SendReceiveQuery',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, DateRangePicker, Treeselect},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '收发存查询',
|
||||
url: 'api/iostordaily',
|
||||
idField: 'stordaily_id',
|
||||
sort: '',
|
||||
crudMethod: {...crudIostordaily},
|
||||
props: {
|
||||
// 每页数据条数
|
||||
size: 20
|
||||
},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
QualityList: [],
|
||||
IvtList: [],
|
||||
class_idStr: null,
|
||||
storList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudIostordaily.getStor().then(res => {
|
||||
this.storList = res
|
||||
})
|
||||
const param = {
|
||||
'materOpt_code': '00'
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param).then(res => {
|
||||
this.class_idStr = res.class_idStr
|
||||
this.crud.query.class_idStr = res.class_idStr
|
||||
this.queryClassId()
|
||||
})
|
||||
crudBucketrecord.getQualityList().then(res => {
|
||||
this.QualityList = res
|
||||
})
|
||||
crudBucketrecord.getIvtList().then(res => {
|
||||
this.IvtList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
queryClassId() {
|
||||
const param = {
|
||||
'class_idStr': this.class_idStr
|
||||
}
|
||||
crudClassstandard.queryClassById(param).then(res => {
|
||||
this.classes = res.content.map(obj => {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
loadClass({ action, parentNode, callback}) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudClassstandard.getClass({pid: parentNode.id}).then(res => {
|
||||
parentNode.children = res.content.map(function (obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
formatIvtName(row, column) {
|
||||
for (const item of this.IvtList) {
|
||||
if (item.code === row.ivt_level) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
formatQualityName(row, column) {
|
||||
for (const item of this.QualityList) {
|
||||
if (item.code === row.quality_scode) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
formatIsName(row, column) {
|
||||
if (row.is_active === '1') {
|
||||
return '是'
|
||||
} else if (row.is_active === '0') {
|
||||
return '否'
|
||||
}
|
||||
},
|
||||
getSum(param) {
|
||||
// 将所有number的字段合计
|
||||
const {columns, data} = param
|
||||
const sums = []
|
||||
let values = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '合计'
|
||||
return
|
||||
}
|
||||
values = data.map(item => Number(item[column.property]))
|
||||
if (column.property === 'start_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'in_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'out_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'end_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'more_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else if (column.property === 'less_num') {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
sums[index] = sums[index].toFixed(3) + 'kg' // 保留三位小数
|
||||
} else {
|
||||
sums[index] = '--'
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
cellStyleMst({ row, column, rowIndex, columnIndex }) {
|
||||
if (column.property === 'dept_name') {
|
||||
if (row.is_yellow !== undefined) {
|
||||
return 'background: yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user