Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -179,7 +179,7 @@ public class HandReturnOutIvtServiceImpl implements HandReturnOutIvtService {
|
|||||||
|
|
||||||
int seq_no = 1;
|
int seq_no = 1;
|
||||||
//所有桶的总数
|
//所有桶的总数
|
||||||
BigDecimal sum_qty = new BigDecimal(0);
|
BigDecimal sum_qty = BigDecimal.valueOf(disObj.getDoubleValue("real_qty"));
|
||||||
for (int i = 0; i < dtl.size(); i++) {
|
for (int i = 0; i < dtl.size(); i++) {
|
||||||
JSONObject dtljo = dtl.getJSONObject(i);
|
JSONObject dtljo = dtl.getJSONObject(i);
|
||||||
String bucketunique = dtljo.getString("bucketunique");
|
String bucketunique = dtljo.getString("bucketunique");
|
||||||
@@ -289,6 +289,11 @@ public class HandReturnOutIvtServiceImpl implements HandReturnOutIvtService {
|
|||||||
}
|
}
|
||||||
// 10更新【出入库分配表】
|
// 10更新【出入库分配表】
|
||||||
disObj.put("real_qty", sum_qty);
|
disObj.put("real_qty", sum_qty);
|
||||||
|
|
||||||
|
BigDecimal qty_flag_dis = NumberUtil.sub(sum_qty, disObj.getDoubleValue("plan_qty"));
|
||||||
|
if(qty_flag_dis.doubleValue() > 0){
|
||||||
|
throw new PdaRequestException("总出库数大于计划出库数!");
|
||||||
|
}
|
||||||
dis_table.update(disObj);
|
dis_table.update(disObj);
|
||||||
//11 更新【出入库明细表】
|
//11 更新【出入库明细表】
|
||||||
WQLObject iosdlt_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
WQLObject iosdlt_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.ext.lk.service.WmsToLkService;
|
import org.nl.ext.lk.service.WmsToLkService;
|
||||||
import org.nl.wms.lk.service.LibraryqueryService;
|
import org.nl.wms.lk.service.LibraryqueryService;
|
||||||
import org.nl.wql.WQL;
|
import org.nl.wql.WQL;
|
||||||
@@ -72,6 +73,9 @@ public class LibraryqueryServiceImpl implements LibraryqueryService {
|
|||||||
JSONArray resultJSONArray = WQL.getWO("QLK01").addParam("flag", "2").addParam("pallet_code",pallet_code).setDbname("dataSource2").process().getResultJSONArray(0);
|
JSONArray resultJSONArray = WQL.getWO("QLK01").addParam("flag", "2").addParam("pallet_code",pallet_code).setDbname("dataSource2").process().getResultJSONArray(0);
|
||||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||||
JSONObject jsonResultDtl = resultJSONArray.getJSONObject(i);
|
JSONObject jsonResultDtl = resultJSONArray.getJSONObject(i);
|
||||||
|
if (ObjectUtil.isEmpty(jsonResultDtl.getString("barrelcode"))) {
|
||||||
|
throw new BadRequestException("该托盘存在没有桶码情况,请在立库系统进行出库操作,出库后重新打印标签粘贴!");
|
||||||
|
}
|
||||||
JSONObject jsonData = new JSONObject();
|
JSONObject jsonData = new JSONObject();
|
||||||
jsonData.put("material_uuid", jsonResultDtl.getString("material_uuid"));
|
jsonData.put("material_uuid", jsonResultDtl.getString("material_uuid"));
|
||||||
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("ext_id = '" + jsonResultDtl.getString("material_uuid") + "'").uniqueResult(0);
|
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("ext_id = '" + jsonResultDtl.getString("material_uuid") + "'").uniqueResult(0);
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@@ -99,4 +101,9 @@ public class WorkOrderController {
|
|||||||
public ResponseEntity<Object> getDepts(@RequestParam Map whereJson) {
|
public ResponseEntity<Object> getDepts(@RequestParam Map whereJson) {
|
||||||
return new ResponseEntity<>(workOrdereService.getDepts(whereJson),HttpStatus.OK);
|
return new ResponseEntity<>(workOrdereService.getDepts(whereJson),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("导出数据")
|
||||||
|
@GetMapping(value = "/download")
|
||||||
|
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||||
|
workOrdereService.download(whereJson, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import org.nl.wms.pdm.service.dto.ProcessrouteDto;
|
import org.nl.wms.pdm.service.dto.ProcessrouteDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -69,4 +71,10 @@ public interface WorkOrdereService {
|
|||||||
* @param whereJson /
|
* @param whereJson /
|
||||||
*/
|
*/
|
||||||
JSONArray getDepts(Map whereJson);
|
JSONArray getDepts(Map whereJson);
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
*
|
||||||
|
* @param whereJson /
|
||||||
|
*/
|
||||||
|
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
|||||||
map.put("task_code", "%" + task_code + "%");
|
map.put("task_code", "%" + task_code + "%");
|
||||||
}
|
}
|
||||||
map.put("flag", "2");
|
map.put("flag", "2");
|
||||||
JSONObject json = WQL.getWO("QPDM_PRODUCTPLANPROC").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "deviceinfo.device_code,pp.plan_finish_date,ext.old_mark,pp.material_code");
|
JSONObject json = WQL.getWO("QPDM_PRODUCTPLANPROC").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.plan_finish_date,pp.material_code,pp.plan_org_code");
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.utils.FileUtil;
|
||||||
import org.nl.utils.SecurityUtils;
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wms.pdm.service.ProcessrouteService;
|
import org.nl.wms.pdm.service.ProcessrouteService;
|
||||||
import org.nl.wms.pdm.service.WorkOrdereService;
|
import org.nl.wms.pdm.service.WorkOrdereService;
|
||||||
@@ -28,10 +29,9 @@ import org.springframework.data.domain.Pageable;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.HashMap;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -163,7 +163,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
|||||||
JSONObject old2 = mstTab.query("workorder_id='"+workorder_id+"'").uniqueResult(0);
|
JSONObject old2 = mstTab.query("workorder_id='"+workorder_id+"'").uniqueResult(0);
|
||||||
if(old2!=null){
|
if(old2!=null){
|
||||||
String pcsn_old = old2.getString("pcsn");
|
String pcsn_old = old2.getString("pcsn");
|
||||||
if(!pcsn_old.equals("pcsn")){
|
if(!pcsn_old.equals(pcsn)){
|
||||||
this.updatePcsn(whereJson);
|
this.updatePcsn(whereJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,4 +814,107 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||||
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
|
|
||||||
|
map.put("flag", "15");
|
||||||
|
String workorder_code = map.get("workorder_code");
|
||||||
|
if (StrUtil.isNotEmpty(workorder_code)) {
|
||||||
|
map.put("workorder_code", "%" + workorder_code + "%");
|
||||||
|
}
|
||||||
|
String pcsn = map.get("pcsn");
|
||||||
|
if (StrUtil.isNotEmpty(pcsn)) {
|
||||||
|
map.put("pcsn", "%" + pcsn + "%");
|
||||||
|
}
|
||||||
|
String material_id = map.get("material_id");
|
||||||
|
if (StrUtil.isNotEmpty(material_id)) {
|
||||||
|
map.put("material_id", "%" + material_id + "%");
|
||||||
|
}
|
||||||
|
String begin_time = map.get("begin_time");
|
||||||
|
if (StrUtil.isNotEmpty(begin_time)) {
|
||||||
|
map.put("begin_time", begin_time.substring(0,10)+" 00:00:00");
|
||||||
|
}
|
||||||
|
String end_time = map.get("end_time");
|
||||||
|
if (StrUtil.isNotEmpty(end_time)) {
|
||||||
|
map.put("end_time", end_time.substring(0,10)+" 23:59:59");
|
||||||
|
}
|
||||||
|
String device_code = map.get("device_code");
|
||||||
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
|
map.put("device_code", "%" + device_code + "%");
|
||||||
|
}
|
||||||
|
JSONArray jsonArr = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).process().getResultJSONArray(0);
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
|
||||||
|
WQLObject md_pb_classstandard = WQLObject.getWQLObject("md_pb_classstandard");
|
||||||
|
WQLObject pdm_bi_workprocedure = WQLObject.getWQLObject("pdm_bi_workprocedure");
|
||||||
|
for (int i = 0; i < jsonArr.size(); i++) {
|
||||||
|
JSONObject json = jsonArr.getJSONObject(i);
|
||||||
|
Map<String, Object> paramMap = new LinkedHashMap<>();
|
||||||
|
paramMap.put("工令日期", json.getString("planstart_time").substring(0,10));
|
||||||
|
paramMap.put("工令号", json.getString("workorder_code"));
|
||||||
|
paramMap.put("所属组织", json.getString("org_name"));
|
||||||
|
String workorder_type = json.getString("workorder_type");
|
||||||
|
paramMap.put("工令类型", "科研工令");
|
||||||
|
if(workorder_type.equals("01")){
|
||||||
|
paramMap.put("工令类型", "生产工令");
|
||||||
|
}
|
||||||
|
//10生成、20提交、30开单中、40已开单、50开工、60暂停、99完工
|
||||||
|
String status = json.getString("status");
|
||||||
|
paramMap.put("工令状态", "生成");
|
||||||
|
if(status.equals("20")){
|
||||||
|
paramMap.put("工令状态", "提交");
|
||||||
|
}else if(status.equals("30")){
|
||||||
|
paramMap.put("工令状态", "开单中");
|
||||||
|
}else if(status.equals("40")){
|
||||||
|
paramMap.put("工令状态", "已开单");
|
||||||
|
}else if(status.equals("50")){
|
||||||
|
paramMap.put("工令状态", "开工");
|
||||||
|
}else if(status.equals("60")){
|
||||||
|
paramMap.put("工令状态", "暂停");
|
||||||
|
}else if(status.equals("99")){
|
||||||
|
paramMap.put("工令状态", "完工");
|
||||||
|
}
|
||||||
|
paramMap.put("设备", json.getString("device_name"));
|
||||||
|
paramMap.put("物料编码", json.getString("material_code"));
|
||||||
|
paramMap.put("牌号", json.getString("old_mark"));
|
||||||
|
|
||||||
|
String product_series_id = json.getString("product_series_id");
|
||||||
|
JSONObject product_series = md_pb_classstandard.query("class_id='"+product_series_id+"'").uniqueResult(0);
|
||||||
|
paramMap.put("系列", product_series_id);
|
||||||
|
if(product_series!=null){
|
||||||
|
paramMap.put("系列", product_series.getString("class_name"));
|
||||||
|
}
|
||||||
|
paramMap.put("批次", json.getString("pcsn"));
|
||||||
|
paramMap.put("重量", json.getString("workorder_qty"));
|
||||||
|
paramMap.put("开单总重量", json.getString("bill_qty"));
|
||||||
|
paramMap.put("实际生产重量", json.getString("productin_qty"));
|
||||||
|
paramMap.put("单位", json.getString("qty_unit_name"));
|
||||||
|
paramMap.put("计划开始时间", json.getString("planstart_time"));
|
||||||
|
paramMap.put("计划结束时间", json.getString("planend_time"));
|
||||||
|
paramMap.put("实际开始时间", json.getString("realstart_time"));
|
||||||
|
paramMap.put("实际结束时间", json.getString("realend_time"));
|
||||||
|
String source_bill_type = json.getString("source_bill_type");
|
||||||
|
paramMap.put("源类型", "生产计划");
|
||||||
|
if(source_bill_type.equals("02")){
|
||||||
|
paramMap.put("源类型", "临时计划");
|
||||||
|
}
|
||||||
|
paramMap.put("来源单据编号", json.getString("source_bill_code"));
|
||||||
|
String workprocedure_id = json.getString("workprocedure_id");
|
||||||
|
paramMap.put("当前工序", workprocedure_id);
|
||||||
|
JSONObject workprocedure = pdm_bi_workprocedure.query("workprocedure_id='"+workprocedure_id+"'").uniqueResult(0);
|
||||||
|
if(workprocedure!=null){
|
||||||
|
paramMap.put("当前工序", workprocedure.getString("workprocedure_name"));
|
||||||
|
}
|
||||||
|
paramMap.put("开工人", json.getString("startwork_name"));
|
||||||
|
paramMap.put("完工人", json.getString("endwork_name"));
|
||||||
|
paramMap.put("创建人", json.getString("create_name"));
|
||||||
|
paramMap.put("修改人", json.getString("update_optname"));
|
||||||
|
paramMap.put("备注", json.getString("remark"));
|
||||||
|
|
||||||
|
list.add(paramMap);
|
||||||
|
}
|
||||||
|
FileUtil.downloadExcel(list, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,60 @@
|
|||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "15"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
WorkOrder.*, mb.material_code,
|
||||||
|
mb.material_name,
|
||||||
|
mb.ext_id,
|
||||||
|
device.device_code,
|
||||||
|
producmaterialext.old_mark,
|
||||||
|
device.device_name,
|
||||||
|
Formula.create_name AS formula_name,
|
||||||
|
Formula.create_time AS formula_time,
|
||||||
|
productdeptpcsn.org_name
|
||||||
|
FROM
|
||||||
|
PDM_BI_WorkOrder WorkOrder
|
||||||
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = WorkOrder.material_id
|
||||||
|
LEFT JOIN md_me_producmaterialext producmaterialext ON mb.material_id = producmaterialext.material_id
|
||||||
|
LEFT JOIN em_bi_deviceinfo device ON device.device_id = WorkOrder.device_id
|
||||||
|
LEFT JOIN PDM_BI_Formula Formula ON (Formula.workorder_id = WorkOrder.workorder_id and Formula.bucket_type='01' AND Formula.is_delete = '0')
|
||||||
|
LEFT JOIN pdm_bi_productdeptpcsn productdeptpcsn ON productdeptpcsn.org_id = WorkOrder.org_id
|
||||||
|
WHERE
|
||||||
|
WorkOrder.is_delete = '0'
|
||||||
|
OPTION 输入.workorder_code <> ""
|
||||||
|
WorkOrder.workorder_code like 输入.workorder_code
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.device_code <> ""
|
||||||
|
(device.device_code like 输入.device_code or
|
||||||
|
device.device_name like 输入.device_code)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.pcsn <> ""
|
||||||
|
WorkOrder.pcsn like 输入.pcsn
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.status <> ""
|
||||||
|
WorkOrder.status = 输入.status
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.workorder_type <> ""
|
||||||
|
WorkOrder.workorder_type = 输入.workorder_type
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.material_id <> ""
|
||||||
|
(mb.material_code like 输入.material_id or mb.material_name like 输入.material_id)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
WorkOrder.planstart_time >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
WorkOrder.planstart_time <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.org_id <> ""
|
||||||
|
WorkOrder.org_id = 输入.org_id
|
||||||
|
ENDOPTION
|
||||||
|
order by WorkOrder.planstart_time,mb.material_code,WorkOrder.pcsn
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
String material_id = json.getString("material_id");
|
String material_id = json.getString("material_id");
|
||||||
//成品物料编码
|
//成品物料编码
|
||||||
String material_code = json.getString("material_code");
|
String material_code = json.getString("material_code");
|
||||||
//成品纯粉系数
|
|
||||||
double material_net_rate = json.getDouble("net_rate");
|
|
||||||
//需配软废集合
|
//需配软废集合
|
||||||
JSONArray rf_list = new JSONArray();
|
JSONArray rf_list = new JSONArray();
|
||||||
//需配新料集合
|
//需配新料集合
|
||||||
@@ -496,8 +494,6 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
String material_id = json.getString("material_id");
|
String material_id = json.getString("material_id");
|
||||||
//成品物料编码
|
//成品物料编码
|
||||||
String material_code = json.getString("material_code");
|
String material_code = json.getString("material_code");
|
||||||
//成品纯粉系数
|
|
||||||
double material_net_rate = json.getDouble("net_rate");
|
|
||||||
//需配软废集合
|
//需配软废集合
|
||||||
JSONArray rf_list = new JSONArray();
|
JSONArray rf_list = new JSONArray();
|
||||||
//需配新料集合
|
//需配新料集合
|
||||||
@@ -1423,8 +1419,6 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
String material_id = json.getString("material_id");
|
String material_id = json.getString("material_id");
|
||||||
//成品物料编码
|
//成品物料编码
|
||||||
String material_code = json.getString("material_code");
|
String material_code = json.getString("material_code");
|
||||||
//成品纯粉系数
|
|
||||||
double material_net_rate = json.getDouble("net_rate");
|
|
||||||
//需配软废集合
|
//需配软废集合
|
||||||
JSONArray rf_list = new JSONArray();
|
JSONArray rf_list = new JSONArray();
|
||||||
//需配新料集合
|
//需配新料集合
|
||||||
@@ -1515,15 +1509,15 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
for(int i=0;i<ivts_new.size();i++){
|
for(int i=0;i<ivts_new.size();i++){
|
||||||
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
JSONObject ivt_new = ivts_new.getJSONObject(i);
|
||||||
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
double ivt_qty = ivt_new.getDouble("sum_ivt_qty");
|
||||||
|
double net_rate = ivt_new.getDouble("net_rate");
|
||||||
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
ivt_qty = NumberUtil.roundDown(ivt_qty,3).doubleValue();
|
||||||
double formula_qty = 0;
|
double formula_qty = 0;
|
||||||
double rf_up = rf_left_weight.doubleValue()/(material_net_rate/100.0);
|
double rf_up = rf_left_weight.doubleValue()/(net_rate/100.0);
|
||||||
if(ivt_qty<rf_up){
|
if(ivt_qty<rf_up){
|
||||||
formula_qty = ivt_qty;
|
formula_qty = ivt_qty;
|
||||||
}else{
|
}else{
|
||||||
formula_qty = rf_up;
|
formula_qty = rf_up;
|
||||||
}
|
}
|
||||||
double net_rate = ivt_new.getDouble("net_rate");
|
|
||||||
double now_ivt_qty = formula_qty * net_rate / 100.0;
|
double now_ivt_qty = formula_qty * net_rate / 100.0;
|
||||||
|
|
||||||
//已分配软废总量
|
//已分配软废总量
|
||||||
@@ -2506,8 +2500,6 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
String material_id = json.getString("material_id");
|
String material_id = json.getString("material_id");
|
||||||
//成品物料编码
|
//成品物料编码
|
||||||
String material_code = json.getString("material_code");
|
String material_code = json.getString("material_code");
|
||||||
//成品纯粉系数
|
|
||||||
double material_net_rate = json.getDouble("net_rate");
|
|
||||||
//需配软废集合
|
//需配软废集合
|
||||||
JSONArray rf_list = new JSONArray();
|
JSONArray rf_list = new JSONArray();
|
||||||
//需配新料集合
|
//需配新料集合
|
||||||
@@ -2807,8 +2799,6 @@ public class AutoformulaServiceImpl implements AutoformulaService {
|
|||||||
String material_id = json.getString("material_id");
|
String material_id = json.getString("material_id");
|
||||||
//成品物料编码
|
//成品物料编码
|
||||||
String material_code = json.getString("material_code");
|
String material_code = json.getString("material_code");
|
||||||
//成品纯粉系数
|
|
||||||
double material_net_rate = json.getDouble("net_rate");
|
|
||||||
//需配软废集合
|
//需配软废集合
|
||||||
JSONArray rf_list = new JSONArray();
|
JSONArray rf_list = new JSONArray();
|
||||||
//需配新料集合
|
//需配新料集合
|
||||||
|
|||||||
@@ -211,7 +211,9 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
JSONObject jo = tableDtl.getJSONObject(i);
|
JSONObject jo = tableDtl.getJSONObject(i);
|
||||||
String formuladtl_id = jo.getString("formuladtl_id");
|
String formuladtl_id = jo.getString("formuladtl_id");
|
||||||
jo.put("seq_no",(i+1)+"");
|
jo.put("seq_no",(i+1)+"");
|
||||||
if(StrUtil.isEmpty(formuladtl_id)){//新增
|
//新增
|
||||||
|
if(StrUtil.isEmpty(formuladtl_id)){
|
||||||
|
jo.put("put_qty","0");
|
||||||
jo.put("formula_id",formula_id);
|
jo.put("formula_id",formula_id);
|
||||||
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
|
jo.put("formuladtl_id",IdUtil.getSnowflake(1, 1).nextId());
|
||||||
jo.put("formula_code",Formula.getString("formula_code"));
|
jo.put("formula_code",Formula.getString("formula_code"));
|
||||||
@@ -228,6 +230,27 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
if(StrUtil.isEmpty(jo.getString("qty_unit_name"))){
|
if(StrUtil.isEmpty(jo.getString("qty_unit_name"))){
|
||||||
jo.put("qty_unit_name","千克\\公斤");
|
jo.put("qty_unit_name","千克\\公斤");
|
||||||
}
|
}
|
||||||
|
//判断库存
|
||||||
|
if("1".equals(jo.getString("is_need_move"))){
|
||||||
|
//校验库存是否够
|
||||||
|
JSONObject jo_ivt = WQL.getWO("QPF_INITFORMULA01")
|
||||||
|
.addParam("material_id",jo.getString("material_id"))
|
||||||
|
.addParam("pcsn",jo.getString("pcsn"))
|
||||||
|
.addParam("quality_scode",jo.getString("quality_scode"))
|
||||||
|
.addParam("ivt_level",jo.getString("ivt_level"))
|
||||||
|
.addParam("is_active",jo.getString("is_active"))
|
||||||
|
.addParam("flag","3")
|
||||||
|
.process().uniqueResult(0);
|
||||||
|
if(jo_ivt!=null){
|
||||||
|
double sum_ivt_qty = jo_ivt.getDouble("sum_ivt_qty");
|
||||||
|
if(sum_ivt_qty<jo.getDouble("formula_qty")){
|
||||||
|
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"库存不足!");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
throw new BadRequestException("物料"+jo.getString("material_code")+" "+jo.getString("material_name")+"库存不足!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -691,6 +714,7 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
|
|
||||||
HashMap<String, Object> oneMap = new HashMap<>();
|
HashMap<String, Object> oneMap = new HashMap<>();
|
||||||
// 工令相关
|
// 工令相关
|
||||||
|
oneMap.put("workorder_code", jsonWork.getString("workorder_code"));
|
||||||
oneMap.put("material_code", jsonMater.getString("material_code"));
|
oneMap.put("material_code", jsonMater.getString("material_code"));
|
||||||
if (ObjectUtil.isNotEmpty(jsonDept)) oneMap.put("dept_name", jsonDept.getString("name"));
|
if (ObjectUtil.isNotEmpty(jsonDept)) oneMap.put("dept_name", jsonDept.getString("name"));
|
||||||
if (ObjectUtil.isNotEmpty(jsonMaterExt)) oneMap.put("old_mark", jsonMaterExt.getString("old_mark"));
|
if (ObjectUtil.isNotEmpty(jsonMaterExt)) oneMap.put("old_mark", jsonMaterExt.getString("old_mark"));
|
||||||
@@ -765,8 +789,7 @@ public class FormulaServiceImpl implements FormulaService {
|
|||||||
|
|
||||||
// 球磨
|
// 球磨
|
||||||
oneMap.put("ball_speed", jsonMaterExt.getString("ball_speed"));
|
oneMap.put("ball_speed", jsonMaterExt.getString("ball_speed"));
|
||||||
JSONObject jsonQM08 = paraTab.query("material_id = '" + material_id + "' and para_code = 'QM008'").uniqueResult(0);
|
oneMap.put("number_3", jsonMst.getString("ball_time"));
|
||||||
if (ObjectUtil.isNotEmpty(jsonQM08)) oneMap.put("number_3", jsonQM08.getString("value"));
|
|
||||||
oneMap.put("create_name", jsonMst.getString("create_name"));
|
oneMap.put("create_name", jsonMst.getString("create_name"));
|
||||||
|
|
||||||
// 查询配方明细-辅料
|
// 查询配方明细-辅料
|
||||||
|
|||||||
@@ -333,9 +333,9 @@
|
|||||||
classstandard.class_code
|
classstandard.class_code
|
||||||
FROM
|
FROM
|
||||||
MD_PD_ProductMaterialSet ProductMaterialSet
|
MD_PD_ProductMaterialSet ProductMaterialSet
|
||||||
LEFT JOIN md_me_producmaterialext producmaterialext ON producmaterialext.material_id = ProductMaterialSet.material_id
|
|
||||||
left join md_me_materialbase materialbase on materialbase.material_id = ProductMaterialSet.set_material_id
|
left join md_me_materialbase materialbase on materialbase.material_id = ProductMaterialSet.set_material_id
|
||||||
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = materialbase.material_type_id
|
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = materialbase.material_type_id
|
||||||
|
LEFT JOIN md_me_producmaterialext producmaterialext ON producmaterialext.material_id = materialbase.material_id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
and producmaterialext.net_rate>0
|
and producmaterialext.net_rate>0
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
@change="crud.toQuery"
|
@change="mytoQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工令类型">
|
<el-form-item label="工令类型">
|
||||||
@@ -182,6 +182,16 @@
|
|||||||
>
|
>
|
||||||
打印工令指令卡
|
打印工令指令卡
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
@click="downdData"
|
||||||
|
>
|
||||||
|
导出Excel
|
||||||
|
</el-button>
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table
|
<el-table
|
||||||
@@ -264,6 +274,8 @@ import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
|
|||||||
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
|
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
|
||||||
import Date from "@/utils/datetime";
|
import Date from "@/utils/datetime";
|
||||||
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
|
||||||
|
import { download } from '@/api/data'
|
||||||
|
import { downloadFile } from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'workorder',
|
name: 'workorder',
|
||||||
@@ -302,6 +314,7 @@ export default {
|
|||||||
viewShow: false,
|
viewShow: false,
|
||||||
changeShow: false,
|
changeShow: false,
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
|
query_flag: true,
|
||||||
checkrows: []
|
checkrows: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -322,13 +335,18 @@ export default {
|
|||||||
this.Depts = res
|
this.Depts = res
|
||||||
})
|
})
|
||||||
this.crud.query.createTime = [new Date(), new Date().daysLater(2)]
|
this.crud.query.createTime = [new Date(), new Date().daysLater(2)]
|
||||||
this.crud.toQuery()
|
//this.crud.toQuery()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
canUd(row) {
|
canUd(row) {
|
||||||
return row.status !== '10'
|
return row.status !== '10'
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
if(this.query_flag){
|
||||||
|
this.crud.query.begin_time = (new Date()).toISOString()
|
||||||
|
this.crud.query.end_time = (new Date().daysLater(2)).toISOString()
|
||||||
|
this.query_flag = false
|
||||||
|
}
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
},
|
},
|
||||||
toView(index, row) {
|
toView(index, row) {
|
||||||
@@ -436,6 +454,15 @@ export default {
|
|||||||
this.querytable()
|
this.querytable()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
downdData() {
|
||||||
|
crud.downloadLoading = true
|
||||||
|
download('/api/workorder/download', this.crud.getQueryParams()).then(result => {
|
||||||
|
downloadFile(result, this.crud.title + '数据', 'xlsx')
|
||||||
|
crud.downloadLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
crud.downloadLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
openWork() {
|
openWork() {
|
||||||
this.checkrows = this.$refs.table.selection
|
this.checkrows = this.$refs.table.selection
|
||||||
if(this.checkrows.length === 0 ){
|
if(this.checkrows.length === 0 ){
|
||||||
@@ -458,6 +485,16 @@ export default {
|
|||||||
this.querytable()
|
this.querytable()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
mytoQuery(array1){
|
||||||
|
if(array1 === null){
|
||||||
|
this.crud.query.begin_time = ''
|
||||||
|
this.crud.query.end_time = ''
|
||||||
|
}else{
|
||||||
|
this.crud.query.begin_time = array1[0]
|
||||||
|
this.crud.query.end_time = array1[1]
|
||||||
|
}
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.handleCurrentChange()
|
this.handleCurrentChange()
|
||||||
|
|||||||
@@ -294,6 +294,8 @@
|
|||||||
<el-table-column prop="is_add" label="是否补料" align="center" width="70px" :formatter="is_addFormat" />
|
<el-table-column prop="is_add" label="是否补料" align="center" width="70px" :formatter="is_addFormat" />
|
||||||
<el-table-column prop="is_tan" label="碳%" align="center" width="80px" :formatter="crud.formatQlNum4" />
|
<el-table-column prop="is_tan" label="碳%" align="center" width="80px" :formatter="crud.formatQlNum4" />
|
||||||
<el-table-column prop="is_09030102" label="钴%" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_09030102" label="钴%" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
@@ -302,8 +304,6 @@
|
|||||||
<el-table-column prop="is_CXJ006" label="白油" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ006" label="白油" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="80px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
<el-table-column align="center" label="操作" width="270" fixed="right">
|
<el-table-column align="center" label="操作" width="270" fixed="right">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-button :disabled="scope.row.edit || scope.row.status!='10'" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
|
<el-button :disabled="scope.row.edit || scope.row.status!='10'" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
|
||||||
|
|||||||
@@ -191,10 +191,13 @@
|
|||||||
<el-table-column prop="ivt_level" label="库存等级" align="center" width="100px" :formatter="ivt_levelFormat" />
|
<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="is_active" label="是否可用" align="center" width="110px" :formatter="is_activeFormat" />
|
||||||
<el-table-column prop="formula_qty" label="重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
<el-table-column prop="formula_qty" label="重量(KG)" :formatter="crud.formatNum3" width="150" align="center" />
|
||||||
|
<el-table-column prop="fact_qty" label="实际重量(KG)" :formatter="crud.formatNum3" align="center" width="150" />
|
||||||
<el-table-column prop="is_need_manage" label="是否配粉" align="center" width="100px" :formatter="is_need_manageFormat" />
|
<el-table-column prop="is_need_manage" label="是否配粉" align="center" width="100px" :formatter="is_need_manageFormat" />
|
||||||
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
||||||
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4" />
|
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4" />
|
||||||
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
@@ -203,8 +206,6 @@
|
|||||||
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="crud-opts2" v-if="form.bucket_type==='02'">
|
<div class="crud-opts2" v-if="form.bucket_type==='02'">
|
||||||
@@ -258,6 +259,8 @@
|
|||||||
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
||||||
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4" />
|
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4" />
|
||||||
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
@@ -266,8 +269,6 @@
|
|||||||
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|||||||
448
mes/qd/src/views/wms/pf/formula2/index.vue
Normal file
448
mes/qd/src/views/wms/pf/formula2/index.vue
Normal file
@@ -0,0 +1,448 @@
|
|||||||
|
<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-input
|
||||||
|
v-model="query.workorder_code"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="工令号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material_id"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="物料编码或物料编码"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</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.formula_code"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="配方编号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="配方状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="配方状态"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.formula_status"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否审核">
|
||||||
|
<el-select
|
||||||
|
v-model="query.is_audit"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="是否审核"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.is_again_put"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</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>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
size="mini"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
:highlight-current-row="true"
|
||||||
|
@selection-change="mySelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="formula_code" width="130" label="配方编号">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.formula_code }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="workorder_code" width="130" label="工令号" />
|
||||||
|
<el-table-column prop="bucket_type" :formatter="bucket_typeFormat" min-width="80" label="桶类型" />
|
||||||
|
<el-table-column prop="material_code" min-width="130" label="物料编码"/>
|
||||||
|
<el-table-column :formatter="seriesFormat" min-width="130" prop="product_series_id" label="系列" />
|
||||||
|
<el-table-column prop="pcsn" min-width="130" label="批次"/>
|
||||||
|
<el-table-column prop="detail_count" min-width="100" label="明细数"/>
|
||||||
|
<el-table-column prop="masterbucket_qty" min-width="100" label="重量" :formatter="crud.formatNum3"/>
|
||||||
|
<el-table-column prop="status" :formatter="stateFormat" min-width="80" label="状态" />
|
||||||
|
<el-table-column prop="is_audit" :formatter="stateFormat2" min-width="80" label="是否审核" />
|
||||||
|
<el-table-column prop="audit_time" min-width="140" label="审核时间"/>
|
||||||
|
<el-table-column prop="audit_name" min-width="80" label="审核人"/>
|
||||||
|
<el-table-column prop="create_time" min-width="140" label="开单时间"/>
|
||||||
|
<el-table-column prop="create_name" min-width="80" label="开单人"/>
|
||||||
|
<el-table-column prop="update_time" min-width="140" label="修改时间"/>
|
||||||
|
<el-table-column prop="update_optname" min-width="80" label="修改人"/>
|
||||||
|
<el-table-column prop="start_time" min-width="140" label="开始时间"/>
|
||||||
|
<el-table-column prop="start_name" min-width="80" label="开始人"/>
|
||||||
|
<el-table-column prop="end_time" min-width="140" label="结束时间"/>
|
||||||
|
<el-table-column prop="end_name" min-width="80" label="结束人"/>
|
||||||
|
<el-table-column prop="add_time" min-width="140" label="补料时间"/>
|
||||||
|
<el-table-column prop="add_name" min-width="80" label="补料人"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||||
|
<DivDialog :dialog-show.sync="changeShow" :rowmst="mstrow" @DivChanged="querytable" />
|
||||||
|
|
||||||
|
<!-- Excel模板上传弹出框-->
|
||||||
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="dialogUpload"
|
||||||
|
append-to-body
|
||||||
|
width="30%"
|
||||||
|
@close="handleClose"
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
:headers="headers"
|
||||||
|
class="upload-demo"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
:action="baseApi +'/api/formula/pictures/'+formula_id"
|
||||||
|
multiple
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:on-error="handleError"
|
||||||
|
:on-success="handleSuccess"
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload" />
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div slot="tip" class="el-upload__tip">只能上传不超过50MB的文件!</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="info" @click="dialogUpload = false">取消</el-button>
|
||||||
|
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<PicDialog ref="child" :dialog-show.sync="PicDialog" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import formula from '@/api/wms/pf/formula'
|
||||||
|
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 DivDialog from '@/views/wms/pf/formula/DivDialog'
|
||||||
|
import ViewDialog from '@/views/wms/pf/formula/ViewDialog'
|
||||||
|
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
|
||||||
|
import {download} from "@/api/data";
|
||||||
|
import {downloadFile} from "@/utils";
|
||||||
|
import {getToken} from "@/utils/auth";
|
||||||
|
import {mapGetters} from "vuex";
|
||||||
|
import PicDialog from '@/views/wms/pf/formula/PicDialog'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'formula2',
|
||||||
|
components: { ViewDialog, DivDialog, crudOperation, rrOperation, udOperation, pagination, PicDialog },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '工令', idField: 'formula_id', url: 'api/formula', crudMethod: { ...formula },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
reset: true,
|
||||||
|
download: false
|
||||||
|
}})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: ['formula_status', 'workorder_type', 'product_series', 'bucket_type', 'is_again_put'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogUpload: false,
|
||||||
|
PicDialog: false,
|
||||||
|
formula_id: null,
|
||||||
|
headers: { 'Authorization': getToken() },
|
||||||
|
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
divShow: false,
|
||||||
|
dissub_flag: true,
|
||||||
|
audit_flag: true,
|
||||||
|
change_flag: true,
|
||||||
|
Export_flag: true,
|
||||||
|
show_flag: true,
|
||||||
|
mstrow: {},
|
||||||
|
viewShow: false,
|
||||||
|
changeShow: false,
|
||||||
|
currentRow: null,
|
||||||
|
checkrows: [],
|
||||||
|
XLList:[]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'baseApi',
|
||||||
|
'fileUploadApi'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
const that = this
|
||||||
|
window.onresize = function temp() {
|
||||||
|
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||||
|
this.XLList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
canUd(row) {
|
||||||
|
return row.status !== '10'
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
this.handleCurrentChange()
|
||||||
|
},
|
||||||
|
toView(index, row) {
|
||||||
|
this.mstrow = row
|
||||||
|
this.viewShow = true
|
||||||
|
},
|
||||||
|
mySelectionChange(rows) {
|
||||||
|
this.buttonChange(rows)
|
||||||
|
},
|
||||||
|
buttonChange(rows) {
|
||||||
|
if (rows.length !== 0) {
|
||||||
|
this.dissub_flag = false
|
||||||
|
this.audit_flag = false
|
||||||
|
this.change_flag = false
|
||||||
|
this.Export_flag = false
|
||||||
|
this.show_flag = false
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
if (rows[i].status !== '20') {
|
||||||
|
this.dissub_flag = true
|
||||||
|
}
|
||||||
|
if (rows[i].status !== '20' || rows[i].is_audit !== '0') {
|
||||||
|
this.audit_flag = true
|
||||||
|
}
|
||||||
|
if (rows[i].status === '99') {
|
||||||
|
this.Export_flag = true
|
||||||
|
}
|
||||||
|
if (!'30,20'.includes(rows[i].status) || rows.length !== 1) {
|
||||||
|
this.change_flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.handleCurrentChange()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stateFormat(row) {
|
||||||
|
return this.dict.label.formula_status[row.status]
|
||||||
|
},
|
||||||
|
stateFormat2(row) {
|
||||||
|
return this.dict.label.is_again_put[row.is_audit]
|
||||||
|
},
|
||||||
|
bill_typeFormat(row) {
|
||||||
|
return this.dict.label.workorder_type[row.workorder_type]
|
||||||
|
},
|
||||||
|
seriesFormat(row) {
|
||||||
|
for (const item of this.XLList) {
|
||||||
|
if (item.id === row.product_series_id) {
|
||||||
|
return item.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bucket_typeFormat(row) {
|
||||||
|
return this.dict.label.bucket_type[row.bucket_type]
|
||||||
|
},
|
||||||
|
handleCurrentChange() {
|
||||||
|
this.checkrows = []
|
||||||
|
this.mstrow = {}
|
||||||
|
this.dissub_flag = true
|
||||||
|
this.audit_flag = true
|
||||||
|
this.change_flag = true
|
||||||
|
this.Export_flag = true
|
||||||
|
this.show_flag = true
|
||||||
|
},
|
||||||
|
checkboxT(row) {
|
||||||
|
return row.status !== '99'
|
||||||
|
},
|
||||||
|
typeChange() {
|
||||||
|
this.checkrows = this.$refs.table.selection
|
||||||
|
if(this.checkrows.length !== 1 ){
|
||||||
|
this.crud.notify('只能勾选一条记录开单!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.mstrow = this.checkrows.pop()
|
||||||
|
this.changeShow = true
|
||||||
|
},
|
||||||
|
cancel(){
|
||||||
|
this.checkrows = this.$refs.table.selection
|
||||||
|
if(this.checkrows.length === 0){
|
||||||
|
this.crud.notify('请先选择需要作废的配方记录!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
formula.cancel({'rows':this.checkrows}).then(res => {
|
||||||
|
this.crud.notify('作废配方成功!')
|
||||||
|
this.querytable()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
audit(){
|
||||||
|
this.checkrows = this.$refs.table.selection
|
||||||
|
if(this.checkrows.length === 0){
|
||||||
|
this.crud.notify('请先选择需要审核的配方记录!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
formula.audit({'rows':this.checkrows}).then(res => {
|
||||||
|
this.crud.notify('审核配方成功!')
|
||||||
|
this.querytable()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
querytable() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.handleCurrentChange()
|
||||||
|
},
|
||||||
|
pointCard() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||||
|
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const data = _selectData[0]
|
||||||
|
formula.pointCard(data).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
Export() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||||
|
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const data = _selectData[0]
|
||||||
|
download('/api/formula/preview', { 'formula_id': data.formula_id }).then(result => {
|
||||||
|
debugger
|
||||||
|
const name = data.material_code + data.pcsn
|
||||||
|
downloadFile(result, name, 'xlsx')
|
||||||
|
crud.downloadLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
crud.downloadLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||||
|
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const data = _selectData[0]
|
||||||
|
this.formula_id = data.formula_id
|
||||||
|
this.dialogUpload = true
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
let isLt2M = true
|
||||||
|
isLt2M = file.size / 1024 / 1024 < 50
|
||||||
|
if (!isLt2M) {
|
||||||
|
this.loading = false
|
||||||
|
this.$message.error('上传文件大小不能超过 50MB!')
|
||||||
|
}
|
||||||
|
return isLt2M
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
this.crud.notify('当前限制最多能选择 1 个文件', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||||
|
},
|
||||||
|
handleError(e, file, fileList) {
|
||||||
|
const msg = JSON.parse(e.message)
|
||||||
|
this.$notify({
|
||||||
|
title: msg.message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2500
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
handleSuccess(files, fileList) {
|
||||||
|
this.file_name = files.name
|
||||||
|
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
this.dialogUpload = false
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
submitUpload() {
|
||||||
|
const flag = this.$refs.upload.submit()
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.dialogUpload = false
|
||||||
|
},
|
||||||
|
showCard() {
|
||||||
|
const _selectData = this.$refs.table.selection
|
||||||
|
if (_selectData.length === 0 || _selectData.length > 1) {
|
||||||
|
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const data = _selectData[0]
|
||||||
|
// 给子组件传值
|
||||||
|
this.$refs.child.setForm(data.formula_id)
|
||||||
|
this.PicDialog = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -251,6 +251,8 @@
|
|||||||
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
<el-table-column prop="is_need_move" label="是否需移库" align="center" width="100px" :formatter="is_need_moveFormat" />
|
||||||
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_tan" label="碳%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_09030102" label="钴%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
|
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ001" label="石蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ002" label="G3蜡" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ003" label="PEG2000" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
@@ -259,13 +261,25 @@
|
|||||||
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
||||||
<el-table-column prop="is_CJZB00021" label="碳化铬%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
<el-table-column align="center" label="操作" width="270" fixed="right">
|
||||||
<el-table-column prop="is_CJZB00020" label="碳化钒%" align="center" width="100px" :formatter="crud.formatQlNum4"/>
|
|
||||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<el-button :disabled="!button2" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
|
<el-button :disabled="!button2" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
|
||||||
<el-button v-show="!scope.row.edit" :disabled="!button2" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
<el-button v-show="!scope.row.edit" :disabled="!button2" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||||
<el-button v-show="scope.row.edit" :disabled="!button2" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
<el-button v-show="scope.row.edit" :disabled="!button2" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary" class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-top"
|
||||||
|
@click="moveUp(scope.$index, scope.row)"
|
||||||
|
>
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary" class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-bottom"
|
||||||
|
@click="moveDown(scope.$index, scope.row)"
|
||||||
|
>
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -474,6 +488,25 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
moveUp(index, item) {
|
||||||
|
if (index > 0) {
|
||||||
|
const upDate = this.tableDtl[index - 1]
|
||||||
|
this.tableDtl.splice(index - 1, 1)
|
||||||
|
this.tableDtl.splice(index, 0, upDate)
|
||||||
|
} else {
|
||||||
|
this.$message.error('已经是第一条,不可上移')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
moveDown(index, item) {
|
||||||
|
if ((index + 1) === this.tableDtl.length) {
|
||||||
|
this.$message.error('已经是最后一条,不可下移')
|
||||||
|
} else {
|
||||||
|
console.log(index)
|
||||||
|
const downDate = this.tableDtl[index + 1]
|
||||||
|
this.tableDtl.splice(index + 1, 1)
|
||||||
|
this.tableDtl.splice(index, 0, downDate)
|
||||||
|
}
|
||||||
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$refs['form2'].resetFields()
|
this.$refs['form2'].resetFields()
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
@select-all="onSelectAll"
|
@select-all="onSelectAll"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<!-- <el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
width="115"
|
width="115"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
:disabled-dle="canUd(scope.row)"
|
:disabled-dle="canUd(scope.row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>-->
|
</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">
|
<template slot-scope="scope">
|
||||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||||
|
|||||||
Reference in New Issue
Block a user