Compare commits

..

6 Commits
v1.0.0 ... main

@ -1,8 +1,10 @@
package com.currency.appengine.controller;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.service.common.CommonServices;
import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.utils.Result;
import java.util.Map;
import java.util.Objects;
@ -23,7 +25,8 @@ public class OpenController {
@Autowired
private CustomerService customerService;
@Autowired
private CommonServices commonServices;
private SupplierService supplierService;
@PostMapping("/add")
public Result add(@RequestBody Map<String, Object> obj) {
@ -46,4 +49,23 @@ public class OpenController {
customerReq.setCreateBy("超级管理员");
return Result.suc(customerService.AsynCustomer(customerReq));
}
@PostMapping("/add/supplier")
public Result addSupplier(@RequestBody Map<String, Object> obj) {
SupplierReq supplierReq = new SupplierReq();
supplierReq.setSupplierName(obj.get("name").toString());
if (Objects.nonNull(obj.get("phone"))) {
supplierReq.setContactPhone(obj.get("phone").toString());
}
if (Objects.nonNull(obj.get("address"))) {
supplierReq.setAddress(obj.get("address").toString());
}
supplierReq.setStatus(1);
supplierReq.setIsAuto(true);
supplierReq.setSettlementCurrency("CNY");
supplierReq.setTax("text2");
supplierReq.setIsTaxIncluded(1);
supplierReq.setCreateBy("超级管理员");
return Result.suc(supplierService.AsynSupplier(supplierReq));
}
}

@ -4,8 +4,10 @@ import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha;
import com.currency.appengine.annotation.CheckToken;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.domain.system.SysParam;
import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.service.system.SysMenuService;
import com.currency.appengine.service.system.SysParamService;
import com.currency.appengine.service.system.SysRoleService;
@ -46,6 +48,8 @@ public class SystemController {
SysParamService sysParamService;
@Autowired
CustomerService customerService;
@Autowired
SupplierService supplierService;
/*
*
@ -333,7 +337,9 @@ public class SystemController {
return sysParamService.cacheUpdate();
}
/**
*
*/
@PostMapping("/customer/add")
@CheckToken
public Result addCustomer(HttpServletRequest request, @RequestBody CustomerReq customerReq) {
@ -341,4 +347,14 @@ public class SystemController {
customerReq.setUserId(userId);
return Result.suc(customerService.addCustomer(customerReq));
}
/**
*
*/
@PostMapping("/supplier/add")
@CheckToken
public Result addSupplier(HttpServletRequest request, @RequestBody SupplierReq supplierReq) {
String userId = StringUtil.objectToString(request.getAttribute("openid"));
supplierReq.setUserId(userId);
return Result.suc(supplierService.addSupplier(supplierReq));
}
}

@ -0,0 +1,40 @@
package com.currency.appengine.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* VO
* @author zk
* @date 2024/9/30
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Builder
public class AysnSupplier {
/**
*
*/
private String name;
/**
*
*/
private String phone;
/**
*
*/
private String email;
/**
*
*/
private String creditCode;
/**
*
*/
private String address;
}

@ -0,0 +1,75 @@
package com.currency.appengine.domain;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
*
*
* @author zk
* @date 2024/10/23
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
public class SupplierReq {
private Long id;
/**
*
*/
private String contactPerson;
/**
*
*/
private String contactPhone;
/**
*
*/
private String supplierCode;
/**
*
*/
private String supplierName;
/**
*
*/
private Boolean isAuto;
/**
*
*/
private Integer isTaxIncluded;
/**
*
*/
private String remarks;
/**
*
*/
private String settlementCurrency;
/**
*
*/
private Integer status;
/**
*
*/
private String tax;
/**
*
*/
private String createBy;
/**
* id
*/
private String userId;
/**
*
*/
private String address;
}

@ -0,0 +1,31 @@
package com.currency.appengine.mapper.system;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
* @author zk
* @date 2024/10/23
*/
public interface SupplierMapper {
@Insert(
"insert into mini_supplier_info(address,create_by, contact_person, contact_phone, supplier_name, is_tax_included, remarks, settlement_currency, status, tax) values(#{address},#{createBy}, #{contactPerson}, #{contactPhone}, #{supplierName}, #{isTaxIncluded}, #{remarks}, #{settlementCurrency}, #{status}, #{tax});"
)
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
int insertSupplier(SupplierReq supplierReq);
@Select(
"SELECT user_name FROM sys_user WHERE user_id = #{userId}"
)
String selectUserById(String userId);
@Update(
"update mini_supplier_info set supplier_code = #{supplierCode} where id = #{id}"
)
void updateCodeById(SupplierReq supplierReq);
}

@ -38,7 +38,7 @@ public class CommonServices {
grantTypeMap.put("OrderNumber", params -> orderNumber(params)); // 订单编号
grantTypeMap.put("ProductionPlan", params -> productionPlan(params)); // 生产计划
grantTypeMap.put("ProductionSchedulingNumber", params -> productionSchedulingNumber(params)); // 排产编号
grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 排产单号
grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 报工单号
grantTypeMap.put("PurchaseNumber", params -> purchaseNumber(params)); // 采购编号
Function<Map<String, Object>,String> result = grantTypeMap.get(type);

@ -1,6 +1,7 @@
package com.currency.appengine.service.system;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
/**
* @author zk

@ -0,0 +1,19 @@
package com.currency.appengine.service.system;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
/**
* @author zk
* @date 2024/10/25
*/
public interface SupplierService {
/**
*
*/
int addSupplier(SupplierReq supplierReq);
/**
*
*/
int AsynSupplier(SupplierReq supplierReq);
}

@ -1,6 +1,7 @@
package com.currency.appengine.service.system.imp;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
@ -47,6 +48,7 @@ public class CustomerServiceImpl implements CustomerService {
customerMapper.updateCodeById(customerReq);
try {
aysnO2(customerReq);
aysnO1(customerReq);
} catch (Exception e) {
log.warn("同步客户信息异常", e);
}
@ -107,4 +109,46 @@ public class CustomerServiceImpl implements CustomerService {
}
}
}
/**
* O1
*/
private static void aysnO1(CustomerReq req) {
String property = SpringUtil.getProperty("o1.sync.enabled");
Boolean res = Boolean.valueOf(property);
if (Boolean.TRUE.equals(res)) {
String accessKey = SpringUtil.getProperty("o1.sync.access-key");
String secretKey = SpringUtil.getProperty("o1.sync.secret-key");
String url = SpringUtil.getProperty("o1.sync.create-url.customer");
Map<String, String> map = new HashMap<>();
AysnCustomer customer = new AysnCustomer();
customer.setName(req.getCustomerName());
customer.setPhone(req.getContactPhone());
customer.setRemark(req.getRemarks());
customer.setAddress(req.getAddress());
// customer.setCreateTime(crmCustomer.getCreateTime().getTime());
Map<String, Object> toMap = BeanUtil.beanToMap(customer, false, true);
long timestamp = System.currentTimeMillis();
map.put("time-stamp", String.valueOf(timestamp));
map.put("access-key", accessKey);
map.put("tenant-id", "1");
toMap.put("time-stamp", String.valueOf(timestamp));
toMap.put("access-key", accessKey);
String sign = SignUtil.getSign(toMap, secretKey);
map.put("sign", sign);
HttpResponse response = null;
try {
response = HttpRequest.post(url)
.addHeaders(map)
.body(JSONUtil.toJsonStr(customer))
.execute();
} catch (IORuntimeException e) {
log.warn("同步失败", e);
return;
}
String body = response.body();
if (response.isOk()) {
log.info("同步成功");
}
}
}
}

@ -0,0 +1,113 @@
package com.currency.appengine.service.system.imp;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import com.currency.appengine.domain.AysnCustomer;
import com.currency.appengine.domain.AysnSupplier;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.mapper.system.SupplierMapper;
import com.currency.appengine.service.common.CommonServices;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.utils.SignUtil;
import java.util.HashMap;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zk
* @date 2024/10/23
*/
@Slf4j
@Service
public class SupplierServiceImpl implements SupplierService {
@Autowired
private SupplierMapper supplierMapper;
@Autowired
private CommonServices commonServices;
/**
*
*
*/
@Override
public int addSupplier(SupplierReq supplierReq) {
if (Boolean.TRUE.equals(supplierReq.getIsAuto())){
supplierReq.setSupplierCode(commonServices.getCode("SupplierCode", null));
}
String user = supplierMapper.selectUserById(supplierReq.getUserId());
supplierReq.setCreateBy(user);
int i = supplierMapper.insertSupplier(supplierReq);
supplierReq.setSupplierCode(String.valueOf(supplierReq.getId()));
supplierMapper.updateCodeById(supplierReq);
try {
aysnO1(supplierReq);
} catch (Exception e) {
log.warn("同步客户信息异常", e);
}
return i;
}
/**
*
*
* @param customerReq
*/
@Override
public int AsynSupplier(SupplierReq supplierReq) {
int i = supplierMapper.insertSupplier(supplierReq);
supplierReq.setSupplierCode(String.valueOf(supplierReq.getId()));
supplierMapper.updateCodeById(supplierReq);
return i;
}
/**
*
*
* @param supplierCompany
*/
private void aysnO1(SupplierReq supplierCompany) {
String property = SpringUtil.getProperty("o1.sync.enabled");
Boolean res = Boolean.valueOf(property);
if (Boolean.TRUE.equals(res)) {
String accessKey = SpringUtil.getProperty("o1.sync.access-key");
String secretKey = SpringUtil.getProperty("o1.sync.secret-key");
String url = SpringUtil.getProperty("o1.sync.create-url.supplier");
Map<String, String> map = new HashMap<>();
AysnSupplier supplier = AysnSupplier.builder().address(supplierCompany.getAddress())
.name(supplierCompany.getSupplierName())
.phone(supplierCompany.getContactPhone())
.build();
// customer.setCreateTime(crmCustomer.getCreateTime().getTime());
Map<String, Object> toMap = BeanUtil.beanToMap(supplier,false,true);
long timestamp = System.currentTimeMillis();
map.put("time-stamp", String.valueOf(timestamp));
map.put("access-key", accessKey);
map.put("tenant-id", "1");
toMap.put("time-stamp", String.valueOf(timestamp));
toMap.put("access-key", accessKey);
String sign = SignUtil.getSign(toMap, secretKey);
map.put("sign", sign);
HttpResponse response = null;
try {
response = HttpRequest.post(url)
.addHeaders(map)
.body(JSONUtil.toJsonStr(supplier))
.execute();
} catch (Exception e) {
log.warn("同步失败", e);
return;
}
String body = response.body();
if (response.isOk()){
log.info("请求成功");
}
}
}
}

@ -66,7 +66,7 @@ public class SwaggerProvider {
String groupName = this.magicResourceService.getGroupName(info.getGroupId())
.replace("/", "-").replace("小程序端API-", "");
String requestPath = PathUtils.replaceSlash(this.prefix + this.magicResourceService.getGroupPath(info.getGroupId()) + "/" + info.getPath());
Pattern p = Pattern.compile("^/api/(?!test).*");
Pattern p = Pattern.compile("^/web/(?!test).*");
Matcher m = p.matcher(requestPath);
if (!m.find()) continue;
SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId());

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "列表",
"createTime" : null,
"updateTime" : 1726815371252,
"updateTime" : 1730109402968,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -46,31 +46,54 @@
"responseBodyDefinition" : null
}
================================
// 销售订单编号,挤压编号,报工单号,型材型号,当前工序,报工日期
sales_order_code
schedule_number
report_number
current_process
report_date
String salesOrderCode = body.salesOrderCode;
String scheduleNumber = body.scheduleNumber;
String reportNumber = body.reportNumber;
String currentProcess = body.currentProcess;
String reportDate = body.reportDate;
String profileModel = body.profileModel;
var sql = """
select
id,
report_number,
machine,
operator,
workshop,
date_format(report_date, '%Y-%m-%d') as report_date,
current_process,
next_process,
production_number,
production_weight,
scrap_number,
scrap_reason,
frame_number,
is_completed
from mini_process_report
mpr.id,
mpr.report_number,
mpr.machine,
mpr.operator,
mpr.workshop,
date_format(mpr.report_date, '%Y-%m-%d') as report_date,
mpr.current_process,
mpr.next_process,
mpr.production_number,
mpr.production_weight,
mpr.scrap_number,
mpr.scrap_reason,
mpr.frame_number,
mpr.is_completed,
mpr.sales_order_code,
mpr.schedule_number,
msm.profile_model
from mini_process_report mpr
left join mini_sales_order_materials msm
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code
where 1 = 1
-- and next_process is null
?{reportNumber != null and reportNumber != '', and report_number like concat('%', #{reportNumber}, '%')}
?{reportDate != null and reportDate != '', and date_format(report_date, '%Y-%m-%d') = #{reportDate}}
?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')}
?{scheduleNumber != null and scheduleNumber != '', and mpr.schedule_number like concat('%', #{scheduleNumber}, '%')}
?{reportNumber != null and reportNumber != '', and mpr.report_number like concat('%', #{reportNumber}, '%')}
?{currentProcess != null and currentProcess != '', and mpr.current_process = #{currentProcess}}
?{reportDate != null and reportDate != '', and date_format(mpr.report_date, '%Y-%m-%d') = #{reportDate}}
?{profileModel != null and profileModel != '', and msm.profile_model like concat('%', #{profileModel}, '%')}
-- group by report_number
"""
return db.page(sql);
// profileModel

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "列表",
"createTime" : null,
"updateTime" : 1728726289833,
"updateTime" : 1730451538439,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -160,6 +160,10 @@ import '@/common/sql' as sql
String documentNumber = body["documentNumber"];
String salesOrderCode = body["salesOrderCode"];
String materialName = body["materialName"];
String materialCode = body["materialCode"];
String deliveryDate = body["deliveryDate"];
String customerName = body["customerName"];
String orderNo = body["orderNo"];
String salesOrdeSelect = sql("salesOrder")
String sql = """
@ -187,6 +191,10 @@ String sql = """
?{salesOrderCode != null and salesOrderCode != "", and mps.sales_order_code = #{salesOrderCode}}
?{documentNumber != null and documentNumber != "", and mps.document_number = #{documentNumber}}
?{materialName != null and materialName != "", and msm.material_name like concat('%', #{materialName}, '%')}
?{materialCode != null and materialCode != "", and mps.material_code like concat('%', #{materialCode}, '%')}
?{customerName != null and customerName != "", and mci.customer_name like concat('%', #{customerName}, '%')}
?{orderNo != null and orderNo != "", and msm.order_no like concat('%', #{orderNo}, '%')}
?{deliveryDate != null and deliveryDate != '', and mso.delivery_date = #{deliveryDate}}
""";
return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "新增",
"createTime" : null,
"updateTime" : 1729160792624,
"updateTime" : 1729825162357,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null,
"children" : null
} ],
"requestBody" : "",
"requestBody" : "{\r\n \"materials\": [\r\n {\r\n \"salesOrderCode\": \"20241020001C\",\r\n \"materialCode\": \"A03H-001\",\r\n \"materialName\": \"两头料已加图2\",\r\n \"profileModel\": \"A03H\",\r\n \"weight\": 0.499,\r\n \"specification\": \"47*29.5\",\r\n \"thickness\": 1,\r\n \"piecesBundle\": 140,\r\n \"materialCategory\": \"004\",\r\n \"defaultLength\": null,\r\n \"packagingMethod\": null,\r\n \"source\": \"source1\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1.97,\r\n \"orderTotalQuantity\": 100,\r\n \"surfaceMethod\": \"Y00007\",\r\n \"theoreticalWeightPerPiece\": 0.983,\r\n \"theoreticalWeight\": 0,\r\n \"packingQuantity\": null,\r\n \"deliveryDate\": \"2024-11-21 00:00:00\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": null,\r\n \"amountWithTax\": null,\r\n \"remark\": null,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"unitPrice\": 0,\r\n \"orderNo\": \"33012\",\r\n \"existingInventory\": 1,\r\n \"actualWeight\": 239,\r\n \"customerId\": null,\r\n \"warehouse\": null,\r\n \"customerName\": null,\r\n \"shipmentQuantity\": 1,\r\n \"pieces\": 140,\r\n \"undeliveredQuantity\": 100\r\n }\r\n ],\r\n \"orderInfo\": {\r\n \"documentNumber\": \"ces\",\r\n \"shipmentDate\": \"2024-10-25\",\r\n \"customerId\": \"C00002\",\r\n \"shipmentInspectionReport\": \"cs\",\r\n \"remarks\": \"测试\"\r\n }\r\n}",
"headers" : [ {
"name" : "authorization",
"value" : null,
"value" : "5E34C0D7EA601026B93C26119C7E1AD50FF4301C7ED4F6D71B9389266C4D0154EA305F5647F993754318DA0ED39E8450",
"description" : "登录token",
"required" : false,
"dataType" : "String",

@ -5,7 +5,7 @@
"groupId" : "447d969bf99243f188b84289aff1ba91",
"name" : "测试token",
"createTime" : null,
"updateTime" : 1722826729086,
"updateTime" : 1729650958697,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -28,7 +28,7 @@
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"responseBody" : "{\n \"code\": 0,\n \"data\": {\n \"token\": \"5E34C0D7EA601026B93C26119C7E1AD5BFD0EE445CC2CCC8BCF8F8565A8AF9D250A9A70E3579385B6FCD1148027C97D7\",\n \"userId\": \"1\"\n },\n \"message\": \"success\"\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null

@ -1,8 +1,8 @@
spring:
profiles:
# active: local # test 本地
active: local # test 本地
# active: dev # test 测试
active: pro # pro 生产
# active: pro # pro 生产
# 通用配置
servlet:
@ -69,3 +69,16 @@ o2:
enabled: true
# 同步新增o2的客户api地址
create-url: http://127.0.0.1:8182/open/api/add
# o1 同步配置
# o1 同步配置
o1:
sync:
access-key: 8ceeH0H6w4ZIR5nHSDB7
# 密钥
secret-key: alLv8CPzZjM6EAgvKqvVjf4kOuTPSmoQTbgK25jz
# 是否启用同步
enabled: true
# 同步新增o1的客户api地址
create-url:
customer: http://127.0.0.1:48080/admin-api/open/api/customerCompany/create
supplier: http://127.0.0.1:48080/admin-api/open/api/customerCompany/create/supplier

@ -32,6 +32,18 @@
clearable
>
</el-input>
<el-input
v-model="search.orderNo"
placeholder="订单号"
clearable
>
</el-input>
<el-input
v-model="search.customerName"
placeholder="客户名称"
clearable
>
</el-input>
<el-button
type="primary"

@ -1,60 +1,129 @@
<template>
<el-container style="position: relative;">
<el-container style="position: relative">
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="page_add"
></el-button>
</div>
<div class="right-panel-search">
<!-- 销售订单编号挤压编号报工单号型材型号当前工序报工日期 -->
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable
>
</el-input>
<el-input
v-model="search.scheduleNumber"
placeholder="挤压编号"
clearable
>
</el-input>
<el-input
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<el-input
v-model="search.reportNumber"
placeholder="报工单号"
clearable>
clearable
>
</el-input>
<dicselect v-model="search.currentProcess" :item="currentProcessItem">
</dicselect>
<el-date-picker
v-model="search.date"
v-model="search.reportDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="日期"
placeholder="报工日期"
style="width: 600px"
></el-date-picker>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" :column="column" :remoteFilter="config.remoteFilter" row-key="" @selection-change="selectionChange">
<scTable
ref="table"
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
row-key=""
@selection-change="selectionChange"
>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<el-table-column
label="操作"
fixed="right"
align="center"
width="120"
v-if="config.option"
>
<template #default="scope">
<el-button type="text" size="medium" @click="show_info(scope.row, scope.$index)" v-if="config.option.edit"></el-button>
<el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit && scope.row.isCompleted != '1'"></el-button>
<el-button
type="text"
size="medium"
@click="show_info(scope.row, scope.$index)"
v-if="config.option.edit"
>查看</el-button
>
<el-button
type="text"
size="medium"
@click="table_edit(scope.row, scope.$index)"
v-if="config.option.edit && scope.row.isCompleted != '1'"
>完成</el-button
>
</template>
</el-table-column>
</scTable>
</el-main>
<save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
<save-page
ref="savePage"
v-if="dialog.savePage"
@closed="dialog.savePage = false"
@success="handleSuccess"
></save-page>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
<info-dialog v-if="dialog.info" ref="infoDialog" @closed="dialog.info=false"></info-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
<info-dialog
v-if="dialog.info"
ref="infoDialog"
@closed="dialog.info = false"
></info-dialog>
</template>
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import savePage from './savePage'
import infoDialog from './info'
import saveDialog from "./save";
import module from "./module";
import config from "@/config";
import savePage from "./savePage";
import infoDialog from "./info";
import dicselect from "@/components/scForm/items/dicselect";
export default {
components: {
saveDialog,
savePage,
infoDialog
infoDialog,
dicselect,
},
data() {
return {
@ -63,40 +132,41 @@ export default {
info: false,
product: false,
finish: false,
savePage: false
savePage: false,
},
loading: false,
file: "",
search: {
reportNumber: "",
date:""
date: "",
},
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column
column: module.column,
currentProcessItem: {
options: { group: "working", placeholder: "当前工序" },
}
};
},
mounted(){
},
mounted() {},
methods: {
//
importExcel() {
this.dialog.importExcel = true
this.dialog.importExcel = true;
this.$nextTick(() => {
this.$refs.importExcelDialog.open()
})
this.$refs.importExcelDialog.open();
});
},
//
handleReset() {
console.log('handleReset method called');
console.log("handleReset method called");
// 1.
this.search = {};
var search = {
email: ""
email: "",
}; // {}
// 2.
@ -107,75 +177,77 @@ export default {
},
//
add() {
this.dialog.save = true
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('add', this.list)
})
this.$refs.saveDialog.open("add", this.list);
});
},
page_add() {
this.dialog.savePage = true
this.dialog.savePage = true;
this.$nextTick(() => {
this.$refs.savePage.open('add')
})
this.$refs.savePage.open("add");
});
},
//
finish(row) {
this.dialog.finish = true
this.dialog.finish = true;
this.$nextTick(() => {
this.$refs.finishDialog.open('add', this.list).setData(row)
})
this.$refs.finishDialog.open("add", this.list).setData(row);
});
},
//
table_edit(row) {
this.dialog.save = true
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('edit', this.list).setData(row)
this.$refs.saveDialog.open("edit", this.list).setData(row);
// this.$refs.saveDialog.open('edit', this.list).setData(row)
})
});
},
show_info(row) {
this.dialog.info = true
this.dialog.info = true;
this.$nextTick(() => {
this.$refs.infoDialog.open().setData(row)
})
this.$refs.infoDialog.open().setData(row);
});
},
//
async table_del(row, index) {
var reqData = {id: row[this.config.preId?this.config.preId:"id"]}
var reqData = { id: row[this.config.preId ? this.config.preId : "id"] };
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
// OR /
this.$refs.table.upData();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", {type: 'error'})
this.$alert(res.message, "提示", { type: "error" });
}
},
//
async batch_del() {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection)
console.log(this.selection);
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.preId?this.config.preId:"id"])
})
this.selection.forEach((item) => {
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
});
var reqData = {ids: idArr.join(",")}
var reqData = { ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", {type: 'error'})
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
})
.catch(() => {
this.$message.success("操作失败");
});
},
//
selectionChange(selection) {
@ -191,15 +263,15 @@ export default {
},
//
handleSuccess(data, mode) {
this.$refs.table.upData()
this.$refs.table.upData();
},
}
}
},
};
</script>
<style>
.upload {
color: #409EFF;
color: #409eff;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;
@ -211,5 +283,4 @@ export default {
.sc-upload-uploader {
border: none !important;
}
</style>

@ -9,29 +9,48 @@
<el-container>
<el-header>
<div class="right-panel-search">
<thirdselect
<!-- <thirdselect
v-model="search.materialCategory"
:item="materialCategoryItem"
>
</thirdselect>
</thirdselect> -->
<!-- 物料名称输入框 -->
<el-input
v-model="search.scheduleNumber"
placeholder="挤压编码"
clearable
>
</el-input>
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable
>
</el-input>
<el-input
v-model="search.orderNo"
placeholder="订单号"
clearable
>
</el-input>
<el-input
v-model="search.materialCode"
placeholder="物料编码"
clearable
>
</el-input>
<el-input
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button
type="primary"
plain
@click="add"
>添加</el-button>
<el-button type="primary" plain @click="add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -79,14 +98,15 @@ export default {
params: module.tableSelect.params,
selection: [],
materialCategoryItem: {
options: { tb: 'product_material_categories', placeholder: '物料/产品分类' }
options: {
tb: "product_material_categories",
placeholder: "物料/产品分类",
},
listData: []
};
},
mounted() {
listData: [],
};
},
mounted() {},
methods: {
//
open() {
@ -98,7 +118,9 @@ export default {
this.listData = listData;
},
selectable(row, index) {
return !this.listData.some(item => row.materialCode == item.materialCode)
return !this.listData.some(
(item) => row.materialCode == item.materialCode
);
},
currentChange(row) {
this.selection = [row];
@ -108,7 +130,7 @@ export default {
this.selection = selection;
},
add() {
this.$emit("success", this.selection)
this.$emit("success", this.selection);
this.visible = false;
},
//

@ -30,6 +30,9 @@ export default {
{ label: "", prop: "id", width: "200", hide: true },
{ label: "报工单号", prop: "reportNumber", width: "200" },
{ label: "机台", prop: "machine", width: "200" },
{ label: "销售订单编码", prop: "salesOrderCode", width: "200" },
{ label: "挤压排产编码", prop: "scheduleNumber", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "操作员", prop: "operator", width: "200" },
{ label: "车间", prop: "workshop", width: "200" },
{

@ -7,25 +7,20 @@
<div class="right-panel-search">
<el-input
v-model="search.orderNumber"
placeholder="排产单号"
v-model="search.documentNumber"
placeholder="计划单号"
clearable>
</el-input>
<el-input
v-model="search.salesOrderNumber"
placeholder="单号"
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable>
</el-input>
<el-input
v-model="search.productCode"
v-model="search.materialCode"
placeholder="产品编码"
clearable>
</el-input>
<el-input
v-model="search.customerPartNumber"
placeholder="客方料号"
clearable>
</el-input>
<el-date-picker
v-model="search.deliveryDate"
type="date"

Loading…
Cancel
Save