Compare commits

...

2 Commits

Author SHA1 Message Date
JIAL 16c372dd67 Merge branch 'main' of http://jialcheerful.club:3000/xd/JNBusiness 2024-06-04 14:36:54 +08:00
JIAL 7e539132c6 海南订单 2024-06-04 14:36:46 +08:00
16 changed files with 1759 additions and 1 deletions

View File

@ -0,0 +1,59 @@
package com.ruoyi.web.controller.hainanOrder;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.service.HaiNanOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.page.TableDataInfo;
import java.util.List;
import static com.ruoyi.common.utils.PageUtils.startPage;
/**
* @ClassName OrderController
* @Description TODO
* @Author JIAL
* @Date 2024/5/21 11:13
* @Version 1.0
*/
@RestController
@RequestMapping("/orderManage_Hn/order")
public class HaiNanOrderController extends BaseController {
@Autowired
private HaiNanOrderService haiNanOrderService;
@PostMapping("list")
public AjaxResult orderList(@RequestBody HNParams HNParams) {
AjaxResult ajax = AjaxResult.success();
if (HNParams.getDateRange().size() != 0) {
HNParams.setBeginDate(HNParams.getDateRange().get(0));
HNParams.setEndDate(HNParams.getDateRange().get(1));
}
ajax.put("orderList", haiNanOrderService.orderList(HNParams));
return ajax;
}
@PostMapping("materialList")
public AjaxResult materialList(@RequestBody HNParams HNParams) {
return null;
}
@PostMapping("customList")
public TableDataInfo customList(@RequestParam("kunnr") String kunnr,
@RequestParam("name1") String name1) {
System.out.println(kunnr + name1);
startPage();
List<HNCustomer> customList = haiNanOrderService.customList(kunnr, name1);
System.out.println(customList);
return getDataTable(customList);
// return null;
}
}

View File

@ -53,6 +53,14 @@ spring:
url: jdbc:sqlserver://192.168.9.99:1433;DatabaseName=jn_storage url: jdbc:sqlserver://192.168.9.99:1433;DatabaseName=jn_storage
username: sa username: sa
password: Itcenter110- password: Itcenter110-
order:
# 从数据源开关/默认关闭
enabled: true
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# 正式数据库
url: jdbc:sqlserver://192.168.9.2:1433;DatabaseName=jn_web
username: sa
password: it12345
# 初始连接数 # 初始连接数
initialSize: 10 initialSize: 10
# 最小连接池数量 # 最小连接池数量

View File

@ -35,6 +35,14 @@ public enum DataSourceType
/** /**
* 车间库位管理数据库 * 车间库位管理数据库
*/ */
STORAGE STORAGE,
/**
* @title ORDER
* @description 订单管理
* @author JIAL
* @updateTime 2024/5/24 15:50
*/
ORDER
} }

View File

@ -85,6 +85,15 @@ public class DruidConfig
return druidProperties.dataSource(dataSource); return druidProperties.dataSource(dataSource);
} }
@Bean
@ConfigurationProperties("spring.datasource.druid.order")
@ConditionalOnProperty(prefix = "spring.datasource.druid.order", name = "enabled", havingValue = "true")
public DataSource orderDataSource(DruidProperties druidProperties)
{
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
@Bean(name = "dynamicDataSource") @Bean(name = "dynamicDataSource")
@Primary @Primary
public DynamicDataSource dataSource(DataSource masterDataSource) public DynamicDataSource dataSource(DataSource masterDataSource)
@ -96,6 +105,7 @@ public class DruidConfig
setDataSource(targetDataSources, DataSourceType.QUOT.name(), "quotDataSource"); setDataSource(targetDataSources, DataSourceType.QUOT.name(), "quotDataSource");
setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource"); setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource");
setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource"); setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource");
setDataSource(targetDataSources, DataSourceType.ORDER.name(), "orderDataSource");
return new DynamicDataSource(masterDataSource, targetDataSources); return new DynamicDataSource(masterDataSource, targetDataSources);
} }

View File

@ -0,0 +1,32 @@
package com.ruoyi.hainanOrder.domain;
public class HNCustomer {
private String kunnr;
private String name1;
public String getKunnr() {
return kunnr;
}
public void setKunnr(String kunnr) {
this.kunnr = kunnr;
}
public String getName1() {
return name1;
}
public void setName1(String name1) {
this.name1 = name1;
}
@Override
public String toString() {
return "Customer{" +
"kunnr='" + kunnr + '\'' +
", name1='" + name1 + '\'' +
'}';
}
// getters and setters
}

View File

@ -0,0 +1,134 @@
package com.ruoyi.hainanOrder.domain;
import java.util.List;
public class HNParams {
private int pageNum; // 页码
private int pageSize; // 每页大小
private String kna1; // 客户名称
private String bstkd; // 合同编号
private String zsdshdz; // 地址
private String orderid; // 订单编号
private String pzh; // SAP凭证号
private String state; // 提交状态
private List<String> dateRange; // 日期范围
private String remarks; // 订单备注
private String beginDate; //开始时间
private String endDate; //结束时间
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public String getKna1() {
return kna1;
}
public void setKna1(String kna1) {
this.kna1 = kna1;
}
public String getBstkd() {
return bstkd;
}
public void setBstkd(String bstkd) {
this.bstkd = bstkd;
}
public String getZsdshdz() {
return zsdshdz;
}
public void setZsdshdz(String zsdshdz) {
this.zsdshdz = zsdshdz;
}
public String getOrderid() {
return orderid;
}
public void setOrderid(String orderid) {
this.orderid = orderid;
}
public String getPzh() {
return pzh;
}
public void setPzh(String pzh) {
this.pzh = pzh;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public List<String> getDateRange() {
return dateRange;
}
public void setDateRange(List<String> dateRange) {
this.dateRange = dateRange;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getBeginDate() {
return beginDate;
}
public void setBeginDate(String beginDate) {
this.beginDate = beginDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
@Override
public String toString() {
return "QueryParams{" +
"pageNum=" + pageNum +
", pageSize=" + pageSize +
", kna1='" + kna1 + '\'' +
", bstkd='" + bstkd + '\'' +
", zsdshdz='" + zsdshdz + '\'' +
", orderid='" + orderid + '\'' +
", pzh='" + pzh + '\'' +
", state='" + state + '\'' +
", dateRange=" + dateRange +
", remarks='" + remarks + '\'' +
", beginDate='" + beginDate + '\'' +
", endDate='" + endDate + '\'' +
'}';
}
}

View File

@ -0,0 +1,153 @@
package com.ruoyi.hainanOrder.domain;
/**
* @ClassName Order
* @Description TODO
* @Author JIAL
* @Date 2024/5/21 13:41
* @Version 1.0
*/
public class HaiNanOrder {
private int index; // 序号
private String kna1; // 客户名称
private String vdatu; // 交货日期
private String orderid; // 订单编号
private String zsdywlxmb; // 业务类型
private String zsdshdz; // 收货地址
private String bstkd; // 合同编号
private String pzh; // SAP凭证号
private double totalPrice3; // 总价
private String remarks; // 备注信息
private String state; // 状态
private String tabindex; // 功能
private String creationDate; // 创建日期
private String ywytjsj; // 提交日期
// Getters and Setters
public String getKna1() {
return kna1;
}
public void setKna1(String kna1) {
this.kna1 = kna1;
}
public String getVdatu() {
return vdatu;
}
public void setVdatu(String vdatu) {
this.vdatu = vdatu;
}
public String getOrderid() {
return orderid;
}
public void setOrderid(String orderid) {
this.orderid = orderid;
}
public String getZsdywlxmb() {
return zsdywlxmb;
}
public void setZsdywlxmb(String zsdywlxmb) {
this.zsdywlxmb = zsdywlxmb;
}
public String getZsdshdz() {
return zsdshdz;
}
public void setZsdshdz(String zsdshdz) {
this.zsdshdz = zsdshdz;
}
public String getBstkd() {
return bstkd;
}
public void setBstkd(String bstkd) {
this.bstkd = bstkd;
}
public String getPzh() {
return pzh;
}
public void setPzh(String pzh) {
this.pzh = pzh;
}
public double getTotalPrice3() {
return totalPrice3;
}
public void setTotalPrice3(double totalPrice3) {
this.totalPrice3 = totalPrice3;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getTabindex() {
return tabindex;
}
public void setTabindex(String tabindex) {
this.tabindex = tabindex;
}
public String getCreationDate() {
return creationDate;
}
public void setCreationDate(String creationDate) {
this.creationDate = creationDate;
}
public String getYwytjsj() {
return ywytjsj;
}
public void setYwytjsj(String ywytjsj) {
this.ywytjsj = ywytjsj;
}
@Override
public String toString() {
return "Order{" +
"index=" + index +
", kna1='" + kna1 + '\'' +
", vdatu='" + vdatu + '\'' +
", orderid='" + orderid + '\'' +
", zsdywlxmb='" + zsdywlxmb + '\'' +
", zsdshdz='" + zsdshdz + '\'' +
", bstkd='" + bstkd + '\'' +
", pzh='" + pzh + '\'' +
", totalPrice3=" + totalPrice3 +
", remarks='" + remarks + '\'' +
", state='" + state + '\'' +
", tabindex='" + tabindex + '\'' +
", creationDate='" + creationDate + '\'' +
", ywytjsj='" + ywytjsj + '\'' +
'}';
}
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.hainanOrder.mapper;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ClassName OrderManageMapper
* @Description TODO
* @Author JIAL
* @Date 2024/5/21 11:19
* @Version 1.0
*/
public interface HaiNanOrderMapper {
List<HaiNanOrder> orderList(HNParams HNParams);
List<HNCustomer> customList(@Param("kunnr") String kunnr,
@Param("name1")String name1);
}

View File

@ -0,0 +1,39 @@
package com.ruoyi.hainanOrder.service;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import java.util.List;
/**
* @ClassName IOrderManageService
* @Description TODO
* @Author JIAL
* @Date 2024/5/21 11:17
* @Version 1.0
*/
public interface HaiNanOrderService {
/**
* @title orderList
* @description 获取订单列表
* @author JIAL
* @param: queryParams
* @updateTime 2024/5/21 15:49
* @return: java.util.List<com.ruoyi.HaiNanOrder.domain.Order>
*/
List<HaiNanOrder> orderList(HNParams HNParams);
/**
* @title customList
* @description 获取客户列表
* @author JIAL
* @param: kunnr
* @param: name1
* @updateTime 2024/6/3 15:33
* @return: java.util.List<java.util.Map<java.lang.String,java.lang.String>>
*/
List<HNCustomer> customList(String kunnr, String name1);
}

View File

@ -0,0 +1,38 @@
package com.ruoyi.hainanOrder.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.mapper.HaiNanOrderMapper;
import com.ruoyi.hainanOrder.service.HaiNanOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName OrderManageServiceImpl
* @Description TODO
* @Author JIAL
* @Date 2024/5/21 11:18
* @Version 1.0
*/
@Service
public class HaiNanOrderServiceImpl implements HaiNanOrderService {
@Autowired
HaiNanOrderMapper haiNanOrderMapper;
@Override
@DataSource(DataSourceType.ORDER)
public List<HaiNanOrder> orderList(HNParams HNParams) {
return haiNanOrderMapper.orderList(HNParams);
}
@Override
@DataSource(DataSourceType.ORDER)
public List<HNCustomer> customList(String kunnr, String name1) {
return haiNanOrderMapper.customList(kunnr, name1);
}
}

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.hainanOrder.mapper.HaiNanOrderMapper">
<sql id="customerOrderColumns">
a.id AS "id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
a.delivery_date AS "deliveryDate",
a.receiving_address AS "receivingAddress",
a.order_type AS "orderType",
a.total_price AS "totalPrice",
a.state AS "state",
a.customer_name AS "customerName",
a.contract_number AS "contractNumber",
a.zvbeln as "zvbeln",
a.kunnr as "kunnr",
a.kna1 as "kna1",
a.auart as "auart",
a.bezei as "bezei",
a.vkorg as "vkorg",
a.vkorgt as "vkorgt",
a.vtweg as "vtweg",
a.vtwegt as "vtwegt",
a.spart as "spart",
a.spartt as "spartt",
a.vdatu as "vdatu",
a.prsdt as "prsdt",
a.bstkd as "bstkd",
a.bstdk as "bstdk",
a.kunnr1 as "kunnr1",
a.kunnrgwds as "kunnrgwds",
a.zsdshdz as "zsdshdz",
a.zsdjdbz as "zsdjdbz",
a.zsdycjz as "zsdycjz",
a.kh_order_0 as "khOrder",
a.xm_name_0 as "xmName",
a.xm_id_0 as "xmId",
a.zsdsfdz as "zsdsfdz",
<!-- tuser.name AS "tuser.name",
tuser.salesapid AS "tuser.salesapid", -->
a.pzh as "pzh",
a.zsdywlxmb as "zsdywlxmb",
tuser2.name as "tjrname",
totalPrice2 as "totalPrice2",
totalPrice3 as "totalPrice3",
totalPrice4 as "totalPrice4",
a.ywydd as "ywydd",
a.ywytjsj as "ywytjsj",
a.orderid as "orderid",
a.randomOrderid as "randomOrderid",
a.sfdz as "sfdz",
s.sapname as "sapname",
<!--s1.sapname as "sapnametp",-->
sb.sapname as "sapnamegwds",
shr as "shr",
shrscb as "shrscb",
shrgdz as "shrgdz",
shrdcz as "shrdcz",
shrbjyx as "shrbjyx",
a.isprint as "isprint",
a.isypkdd as "isypkdd",
a.erpId as "erpId",
a.returnreason as "returnreason",
a.hasHt as "hasHt",
a.istp as "istp",
<!-- customer.name AS "customer.name",
customer.id AS "customer.id",
contract.name AS "contract.name",
contract.number AS "contract.number" -->
a.isMobileCreate as "isMobileCreate",
a.isCreateByHt as "isCreateByHt",
s.pianqu as "pianqu" ,
a.xsdq AS "xsdq",
a.province AS "province",
a.city AS "city",
a.village AS "village",
a.lxr AS "lxr",
a.lxrdh AS "lxrdh",
a.sfdcj AS "sfdcj",
a.sfxsywy AS "sfxsywy"
</sql>
<sql id="customerOrderJoins">
<!-- LEFT JOIN customer ON customer.id = a.customer_id
LEFT JOIN contract ON contract.number = a.contract_number -->
<!-- LEFT JOIN sys_user tuser ON tuser.salesapid = a.kunnr1
-->
LEFT JOIN sapuser s on s.sapid=a.kunnr1
<!--LEFT JOIN sapusertp s1 on s1.sapid=a.kunnr1 -->
LEFT JOIN sapuser sb on sb.sapid=a.kunnrgwds
LEFT JOIN sys_user tuser2 ON tuser2.id =a.create_by
</sql>
<sql id="customerOrderTpJoins">
<!-- LEFT JOIN customer ON customer.id = a.customer_id
LEFT JOIN contract ON contract.number = a.contract_number -->
<!-- LEFT JOIN sys_user tuser ON tuser.salesapid = a.kunnr1
-->
LEFT JOIN sapusertp s on s.sapid=a.kunnr1
LEFT JOIN sapusertp sb on sb.sapid=a.kunnrgwds
LEFT JOIN sys_user tuser2 ON tuser2.id =a.create_by
</sql>
<select id="orderList" resultType="HaiNanOrder" >
SELECT
<include refid="customerOrderColumns"/>
FROM customer_order a
<include refid="customerOrderJoins"/>
<where>
<!-- <if test="istp != null and istp != ''">-->
<!-- AND a.istp = '${istp}'-->
<!-- </if>-->
<if test="state != null and state != ''">
AND state='${state}'
</if>
<if test="orderid != null and orderid != ''">
AND a.orderid='${orderid}'
</if>
<if test="zsdshdz != null and zsdshdz != ''">
AND a.zsdshdz like '%${zsdshdz}%'
</if>
<!-- <if test="pianqu != null and pianqu != ''">
<if test="pianqu == '113' or pianqu == '112'">
AND (s.pianqu='113' or s1.pianqu='113' or s.pianqu='112' or s1.pianqu='112')
</if>
<if test="pianqu != '113' and pianqu != '112'">
AND (s.pianqu='${pianqu}' or s1.pianqu='${pianqu}')
</if>
</if> -->
<if test="pzh != null and pzh != ''">
AND a.pzh='${pzh}'
</if>
<if test="beginDate != null and beginDate!='' and endDate != null and endDate!=''">
AND a.create_date BETWEEN '${beginDate}' AND '${endDate}'
</if>
</where>
ORDER BY a.update_date DESC
</select>
<select id="customList" resultType="HNCustomer">
SELECT kunnr,name1 + isnull(name2,'') AS name1
from sdcus
<where>
kunnr not like '41%'
<if test="kunnr != null and kunnr != ''">
AND kunnr like '%${kunnr}%'
</if>
<if test="name1 != null and name1 != ''">
AND name1 like '%${name1}%'
</if>
</where>
GROUP BY kunnr,name1,name2
</select>
</mapper>

View File

@ -0,0 +1,28 @@
import request from '@/utils/request'
// 查询车间管理列表
export function getOrderList(query) {
return request({
url: '/orderManage_Hn/order/list',
method: 'post',
data: query
})
}
export function getMaterialList(query) {
return request({
url: '/orderManage_Hn/order/materialList',
method: 'post',
data: query
})
}
export function getCustomList(query) {
return request({
url: '/orderManage_Hn/order/customList',
method: 'post',
params: query
})
}

View File

@ -94,6 +94,20 @@ export const constantRoutes = [
meta: { title: '个人中心', icon: 'user' } meta: { title: '个人中心', icon: 'user' }
} }
] ]
},
{
path: '/hainanOrder/index',
component: Layout,
hidden: true,
permissions: ['hainanOrder:operation:list'],
children: [
{
path: '',
component: () => import('@/views/hainanOrder/operation/addOrder'),
name: 'HaiNaiOrder',
meta: { title: '海南订单新建', activeMenu: '/hainanOrder/operation' }
}
]
} }
] ]

View File

@ -0,0 +1,230 @@
<template>
<!------------------------ dialog控件 ------------------------------------>
<el-dialog class="materialDialogTable" :visible.sync="visible" width="1100px" @close="closeDialog">
<div slot="title" style="margin: 0px; padding: 0px">
<el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.matnr" placeholder="物料编码">
</el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.maktx3" placeholder="首字母开头匹配">
</el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.maktx" placeholder="物料描述模糊匹配">
</el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.maktx4" placeholder="颜色匹配">
</el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.diany" placeholder="电压等级">
</el-input>
</el-form-item>
<el-form-item>
<el-select style="width: 180px" v-model="queryParams.maktx5" placeholder="类型" clearable>
<el-option
v-for="dict in type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-input style="width: 180px; margin-right: 2px" v-model="queryParams.maktx2" placeholder="物料描述精准匹配">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="handleQuery">查询物料</el-button>
</el-form-item>
</el-form>
</div>
<div style="display: flex; flex-direction: row;">
<div style="width: 700px">
<el-table
:data="materialDialogData"
@selection-change="handleSelectionChange"
ref="materialDialogData"
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
highlight-selection-row
:row-key="row => row.uid"
:reserve-selection="true"
border>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="序号"
type="index"
width="55">
</el-table-column>
<el-table-column
width="120"
prop="matnr"
label="物料">
</el-table-column>
<el-table-column
width="120"
prop="maktx"
label="物料描述">
</el-table-column>
<el-table-column
width="120"
prop="kbetr"
label="价格">
</el-table-column>
<el-table-column
width="125"
prop="vtext"
label="物料类型">
</el-table-column>
<el-table-column
width="120"
prop="kmein"
label="计量单位">
</el-table-column>
<el-table-column
width="102"
prop="dwjz"
label="单位净重">
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="handleQuery"
/>
</div>
<div style="flex-grow: 1; padding-left: 20px;">
<div
v-for="(selectedItem, index) in selectedMaterialItems"
:key="index"
class="selected-item"
>
{{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }}
<el-button @click="removeSelectedItem(selectedItem)" type="text" class="remove-btn">&#10006;</el-button>
</div>
</div>
</div>
<div style="text-align: center; padding-top: 20px">
<el-button-group>
<el-button type="primary" size="small" style="margin-right: 80px" @click="confirmSelection">确认</el-button>
<el-button type="warning" size="small" @click="closeDialog">取消</el-button>
</el-button-group>
</div>
</el-dialog>
</template>
<script>
export default {
name: "materialDialog",
props: {
visible: Boolean,
materialDialogData: {
type: Array,
default: () => []
},
total: {
type: Number,
default: 0
}
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
matnr: '',
maktx3: '',
maktx: '',
maktx4: '',
diany: '',
maktx5: '',
maktx2: ''
},
selectedMaterialItems: [], //
lastSelectedItems: [], //
selectedIndexToRemove: null, //
visible: false,
type: [
{value: '国标', label: '国标'},
{value: '样品', label: '样品'}
],
}
},
methods: {
/**---------------获取物料列表-------------------**/
handleQuery() {
this.$emit('query', this.queryParams);
},
/**-----------选择物料触发事件----------------**/
handleSelectionChange(selection) {
//
const newSelections = selection.filter(item =>
!this.lastSelectedItems.includes(item)
);
//
this.selectedMaterialItems.push(...newSelections);
//
this.lastSelectedItems = selection.slice();
},
/**-------------------删除物料dialog删除已选---------------------**/
removeSelectedItem(selectedItem) {
//
const indexToRemove = this.selectedMaterialItems.findIndex(item => item === selectedItem);
if (indexToRemove !== -1) {
this.selectedMaterialItems.splice(indexToRemove, 1);
}
},
/**-------------------确认选择-----------------**/
confirmSelection() {
this.$emit('confirm-selection', this.selectedMaterialItems);
},
closeDialog() {
this.$emit('update:visible', false);
},
},
}
</script>
<style >
.materialDialogTable .el-dialog__header {
padding-bottom: 0px !important;
}
.materialDialogTable .el-dialog .el-dialog__body {
padding-top: 0px !important;
}
.selected-item {
background-color: #f0f0f0;
border: 1px solid #ccc;
border-radius: 5px;
padding: 5px;
margin-bottom: 5px;
display: flex;
justify-content: space-between;
}
.remove-btn {
padding: 0px;
color: red;
}
</style>

View File

@ -0,0 +1,280 @@
<template>
<div class="app-container">
<el-form :model="HNParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="客户名称" prop="kna1">
<el-input
v-model="HNParams.kna1"
placeholder="请输入客户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="合同编号" prop="bstkd">
<el-input
v-model="HNParams.bstkd"
placeholder="请输入合同编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="地址" prop="zsdshdz">
<el-input
v-model="HNParams.zsdshdz"
placeholder="请输入地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单编号" prop="orderid">
<el-input
v-model="HNParams.orderid"
placeholder="请输入订单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="SAP凭证号" prop="pzh">
<el-input
v-model="HNParams.pzh"
placeholder="请输入SAP凭证号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="提交状态" prop="state">
<el-select v-model="HNParams.state" placeholder="提交状态" clearable>
<el-option
v-for="dict in dict.type.submit_status_hn"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="订单创建日期" prop="dateRange">
<el-date-picker
v-model="HNParams.dateRange"
style="width: 215px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="订单备注" prop="remarks">
<el-input
v-model="HNParams.remarks"
placeholder="请输入订单备注"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新建</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-view"
size="mini"
:disabled="multiple"
@click="handleDelete"
>查看</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table width="100%" v-loading="loading" :data="orderList" :row-class-name="rowOrderIndex" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="index" width="80"/>
<el-table-column label="客户名称" width="100" align="center" prop="kna1" />
<el-table-column label="交货日期" width="100" align="center" prop="vdatu" />
<el-table-column label="订单编号" width="150" align="center" prop="orderid" />
<el-table-column label="业务类型" width="150" align="center" prop="zsdywlxmb" />
<el-table-column label="收货地址" width="150" align="center" prop="zsdshdz" />
<el-table-column label="合同编号" width="150" align="center" prop="bstkd" />
<el-table-column label="sap凭证号" width="150" align="center" prop="pzh" />
<el-table-column label="总价" width="150" align="center" prop="totalPrice3" />
<el-table-column label="备注信息" width="150" align="center" prop="remarks" />
<el-table-column label="状态" width="150" align="center" prop="state" />
<el-table-column label="功能" width="150" align="center" prop="tabindex" />
<el-table-column label="创建日期" width="150" align="center" prop="tabindex" />
<el-table-column label="提交日期" width="150" align="center" prop="ywytjsj" />
<el-table-column fixed="right" label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['factory:factory:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['factory:factory:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="HNParams.pageNum"
:limit.sync="HNParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<style scoped>
/* 根据需求设置位置上下偏移 */
.offset {
margin-top: 0px; /* 向上偏移5像素 */
margin-bottom: 0px; /* 向下偏移5像素 */
}
</style>
<script>
import { getOrderList} from "@/api/hainanOrder/order";
export default {
name: "OrderManage",
dicts: ['submit_status_hn'],
data() {
return {
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
orderList: [],
//
isDis: false,
HNParams: {
pageNum: 1,
pageSize: 10,
kna1: null,
bstkd: null,
zsdshdz: null,
orderid: null,
pzh: null,
state: null,
dateRange: [],
remarks: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询车间管理列表 */
getList() {
this.loading = true;
getOrderList(this.HNParams).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.HNParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push('/hainanOrder/index');
},
/** 导出按钮操作 */
handleExport() {
this.download('factory/factory/export', {
...this.HNParams
}, `factory_${new Date().getTime()}.xlsx`)
},
/** 序号 */
rowOrderIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
handleDelete() {
},
handleSelectionChange() {
},
handleUpdate() {}
},
};
</script>

View File

@ -0,0 +1,531 @@
<template>
<div class="app-container">
<el-form :model="addOrderParam" ref="addOrderParam" size="small" :inline="true" v-show="showSearch" label-width="160px">
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="售达方" prop="soldToParty">
<div class="flex-container">
<el-input v-model="addOrderParam.kunnr" placeholder="客户编号" :style="{ width: inputWidth_1 }"></el-input>
<el-button type="text" size="small" @click="openCustomDialog" class="flex-button">+选择客户</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="售达方描述" prop="soldPartyDesc">
<el-input
:style="{ width: inputWidth_1 }"
v-model="addOrderParam.kna1"
placeholder="客户描述"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="合同号">
<div class="flex-container">
<el-select :style="{ width: inputWidth_2 }" v-model="addOrderParam.auart" placeholder="销售凭证类型" clearable>
<el-option
v-for="dict in dict.type.sales_voucher_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="合同号" ></el-input>
<el-button type="text" size="small" class="flex-button">+选择合同</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员编码及姓名">
<div class="flex-container">
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="客户编号" ></el-input>
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="客户编号" ></el-input>
</div>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="销售组织描述" prop="vkorg">
<el-input
v-model="addOrderParam.vkorg"
placeholder="销售组织描述"
clearable
/>
</el-form-item>
<el-form-item label="销售凭证类型" prop="zsdshdz">
<el-select v-model="addOrderParam.auart" placeholder="销售凭证类型" clearable>
<el-option
v-for="dict in dict.type.sales_voucher_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="要求交货日期" prop="vdatu">
<el-date-picker
v-model="addOrderParam.vdatu"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="分销渠道" prop="vtweg">
<el-input
v-model="addOrderParam.vtweg"
placeholder="分销渠道"
clearable
/>
</el-form-item>
<el-form-item label="定价日期" prop="prsdt">
<el-input
v-model="addOrderParam.prsdt"
placeholder="定价日期"
clearable
/>
</el-form-item>
<el-form-item label="业务类型" prop="zsdywlxmb">
<el-select v-model="addOrderParam.zsdywlxmb" placeholder="业务类型" clearable>
<el-option
v-for="dict in dict.type.business_type_hn"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否打印" prop="isprint">
<el-select v-model="addOrderParam.isprint" placeholder="业务类型" clearable>
<el-option
v-for="dict in isPrint"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="sfdz">
<span slot="label">
是否定制
<el-tooltip
effect="dark"
placement="top"
>
<template slot="content">
<div style="max-width: 600px; white-space: pre-wrap;">
关于远程下单中是否定制菜单项目下的4种选项说明
1有发无取消只用于现货急发销售凭证类型一般情况下销售部处理时有货直接发无货原单做取消处理交货单开出后无冻结情况的此类订单30分钟内可处理完成
2有发无做用于国内订单处理流程为销售创单财务审核订单生产审核订单此流程闭环需3-5小时左右生产备货审核完成后有货部分销售才能做后续发货处理各类产品有货部分需当日急发的单行备注备货字样
3定做用于国内订单经销商备货订单处理流程为销售创单有特殊工艺的需增加技术审核销售部OA平台发起工艺核价流程财务审核订单生产审核订单此流程闭环需24小时左右
4有货备货无货定做用于国内订单经销商备货订单流程处理时效参照定做类各类产品有货部分近期需分批发货的单行备注备货字样由生产备货
不同选项对应的订单处理流程不同订单流转需跨的部门不同因此时效不一如电线类产品缺货有发无做选项订单流转周期长影响开单时效上述类别当日发货涉及来款关联的需待财务认领款项解冻交货单后方能发出
</div>
</template>
<i class="el-icon-question"></i>
</el-tooltip>
</span>
<el-select v-model="addOrderParam.sfdz" placeholder="是否定制" clearable>
<el-option
v-for="dict in isCustom"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="订单编号" prop="orderNumber">
<el-input
v-model="addOrderParam.orderNumber"
placeholder="订单编号"
clearable
/>
</el-form-item>
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="送货地址">
<div class="flex-container">
<el-input
:style="{ width: inputWidth_1 }"
v-model="addOrderParam.kna1"
placeholder="客户描述"
clearable
/>
<el-button type="text" size="small" class="flex-button">+门店地址</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注信息" prop="orderNumber">
<el-input
type="textarea"
:style="{ width: inputWidth_1 }"
:rows="2"
placeholder="请输入内容"
v-model="addOrderParam.orderNumber">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="openMaterialDialog"
>选择产品</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>文件导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>下载模板</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-view"
size="mini"
:disabled="multiple"
@click="handleDelete"
>导出当前明细物料</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
>现款业务可用发货额度账面余额汇总</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" ></right-toolbar>
</el-row>
<el-table width="100%" :data="orderList" :row-class-name="rowOrderIndex" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="index" width="80"/>
<el-table-column label="物料编号" width="100" align="center" prop="kna1" />
<el-table-column label="物料描述" width="100" align="center" prop="vdatu" />
<el-table-column label="订单数量" width="150" align="center" prop="orderid" />
<el-table-column label="开票价" width="150" align="center" prop="zsdywlxmb" />
<el-table-column label="销售单位" width="150" align="center" prop="zsdshdz" />
<el-table-column label="单位净重(KG/KM)" width="150" align="center" prop="bstkd" />
<el-table-column label="厂价" width="150" align="center" prop="pzh" />
<el-table-column label="开票价/厂价" width="150" align="center" prop="totalPrice3" />
<el-table-column label="分段要求" width="150" align="center" prop="remarks" />
<el-table-column label="备注" width="150" align="center" prop="state" />
<el-table-column label="客户采购订单号" width="150" align="center" prop="tabindex" />
<el-table-column label="客户采购订单行项目" width="150" align="center" prop="tabindex" />
<el-table-column label="是否远程监造" width="150" align="center" prop="tabindex" />
<el-table-column fixed="right" label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['factory:factory:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-form :model="addOrderParam" ref="addOrderParam" size="small" :inline="true" label-width="160px">
</el-form>
<MaterialDialog
:visible.sync="dialogMaterialVisible"
@confirm-selection="handleConfirmSelection"
@query="queryMaterialList"
:materialDialogData="materialDialogData"
:total="materialDialogTotal"
/>
<el-dialog :visible.sync="customVisible" width="800px" @close="closeCustomDialog">
<div slot="title" style="margin: 0px; padding: 0px">
<el-form :model="customDialogParams" ref="customDialogParams" size="small" :inline="true">
<el-input style="width: 180px; margin-right: 10px" v-model="customDialogParams.kunnr" placeholder="客户编号">
</el-input>
<el-input style="width: 180px; margin-right: 10px" v-model="customDialogParams.name1" placeholder="客户名称">
</el-input>
<el-button type="primary" size="small" @click="queryCustom">查询客户</el-button>
</el-form>
</div>
<div>
<el-table
:data="customDialogData"
ref="customDialogData"
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
highlight-selection-row
border>
<el-table-column
label="序号"
type="index"
width="55">
</el-table-column>
<el-table-column
width="175"
prop="kunnr"
label="客户编号">
</el-table-column>
<el-table-column
width="450"
prop="name1"
label="客户名称">
</el-table-column>
<el-table-column
width="75"
prop="operation"
label="操作">
<el-button type="text" size="small">选择</el-button>
</el-table-column>
</el-table>
<pagination
v-show="customDialogTotal>0"
:total="customDialogTotal"
:page.sync="customDialogParams.pageNum"
:limit.sync="customDialogParams.pageSize"
@pagination="queryCustom"
/>
</div>
<div style="text-align: center; padding-top: 20px">
<el-button-group>
<el-button type="primary" size="small" style="margin-right: 80px" @click="confirmCustomSelection">确认</el-button>
<el-button type="warning" size="small" @click="closeCustomDialog">取消</el-button>
</el-button-group>
</div>
</el-dialog>
</div>
</template>
<style scoped>
/* 根据需求设置位置上下偏移 */
.offset {
margin-top: 0px; /* 向上偏移5像素 */
margin-bottom: 0px; /* 向下偏移5像素 */
}
</style>
<script>
import { getOrderList, getMaterialList, getCustomList} from "@/api/hainanOrder/order";
import MaterialDialog from '@/views/components/Tools/MaterialDialog/index.vue';
export default {
name: "AddOrder",
dicts: ['sales_voucher_type', 'business_type_hn'],
components:{
'MaterialDialog' : MaterialDialog
},
data() {
return {
customVisible: false, //dialog
inputWidth_1: '360px', // 560px
inputWidth_2: '180px',
inputWidth_3: '600px',
//
isPrint: [
{value : 1, label: '已打印'},
{value : 0, label: '未打印'}
],
//
isCustom: [
{value: 1, label: '有发无做'},
{value: 3, label: '定做'},
{value: 4, label: '有货备库,无货定做'}
],
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
orderList: [],
//
isDis: false,
customDialogParams: {
pageNum: 1,
pageSize: 10,
kunnr: '',
name1: ''
},
addOrderParam: {
kna1: null,
bstkd: null,
zsdshdz: null,
orderid: null,
pzh: null,
state: null,
dateRange: [],
remarks: null
},
//
form: {},
//
rules: {
},
selectedMaterials: [], //
dialogMaterialVisible: false, //dialog
materialDialogData: [],
materialDialogTotal: 0,
customDialogTotal: 0,
customDialogData: [
],
};
},
created() {
},
mounted() {
window.addEventListener('resize', this.handleResize);
this.handleResize(); //
},
beforeDestroy() {
window.removeEventListener('resize', this.handleResize);
},
methods: {
/**--------------------打开选择无聊dialog-----------------**/
openMaterialDialog() {
this.dialogMaterialVisible = true;
},
/**------------------监听屏幕宽度-----------------------**/
handleResize() {
if (window.innerWidth <= 768) { // 768px
this.inputWidth_1 = '215px'; // 200px
this.inputWidth_2 = '77px';
this.inputWidth_3 = '215px';
} else {
this.inputWidth_1 = '360px'; // 560px
this.inputWidth_2 = '180px';
this.inputWidth_3 = '600px';
}
},
/** 序号 */
rowOrderIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
handleDelete() {
},
handleSelectionChange() {
},
handleUpdate() {
},
/**----------------传递数据-------------**/
handleConfirmSelection(selectedItems) {
this.selectedMaterials = selectedItems;
this.dialogMaterialVisible = false;
console.log(this.selectedMaterials)
},
/**------------dialog中请求物料列表-------------**/
queryMaterialList(queryParams) {
this.materialDialogData = [
{
uid: '1',
prodCategory: '产品1',
model: '型号A',
specification: '规格1',
voltLevel: '110V',
measureUnit: '个'
},
{
uid: '2',
prodCategory: '产品2',
model: '型号B',
specification: '规格2',
voltLevel: '220V',
measureUnit: '台'
},
{
uid: '3',
prodCategory: '产品3',
model: '型号C',
specification: '规格3',
voltLevel: '380V',
measureUnit: '件'
},
//
];
this.materialDialogTotal = 10
},
/**-----------------------选择客户Dialog函数-------------------------**/
closeCustomDialog() {
this.customVisible = false;
},
openCustomDialog() {
this.customVisible = true;
this.queryCustom();
},
confirmCustomSelection() {
this.customVisible = false;
},
queryCustom() {
getCustomList(this.customDialogParams).then(response => {
console.log(this.customDialogParams.pageNum)
this.customDialogData = response.rows;
this.customDialogTotal = response.total;
this.loading = false;
});
},
},
};
</script>
<style>
.flex-container {
display: flex;
align-items: center;
}
.el-dialog .el-dialog__header {
padding-bottom: 10px !important;
}
.el-dialog .el-dialog__body {
padding-top: 10px !important;
}
.flex-input {
flex-grow: 1;
width: 154px;
margin-right: 5px; /* 控制输入框和按钮之间的间距 */
}
.flex-button {
flex-shrink: 0;
}
</style>