Commit 61de956e authored by 黄辉勇's avatar 黄辉勇

''

parent b8cd9f92
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="5c5955e8-a367-4538-8b22-1de6f1006fed" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/jeethink/jeethink-admin/src/main/resources/application-druid.yml" beforeDir="false" afterPath="$PROJECT_DIR$/jeethink/jeethink-admin/src/main/resources/application-druid.yml" afterDir="false" />
</list>
<list default="true" id="5c5955e8-a367-4538-8b22-1de6f1006fed" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
......@@ -53,6 +51,7 @@
<workItem from="1616574462972" duration="29000" />
<workItem from="1616632945811" duration="940000" />
<workItem from="1622697665026" duration="399000" />
<workItem from="1622766545211" duration="14000" />
</task>
<servers />
</component>
......@@ -64,9 +63,9 @@
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="96" y="0" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1280.680@0.0.1280.680" timestamp="1615181359695" />
<state x="421" y="99" key="FileChooserDialogImpl" timestamp="1622697674680">
<state x="421" y="99" key="FileChooserDialogImpl" timestamp="1622766552117">
<screen x="0" y="0" width="1280" height="680" />
</state>
<state x="421" y="99" key="FileChooserDialogImpl/0.0.1280.680@0.0.1280.680" timestamp="1622697674680" />
<state x="421" y="99" key="FileChooserDialogImpl/0.0.1280.680@0.0.1280.680" timestamp="1622766552117" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改产品')" />
</head>
<body class="white-bg">
......
......@@ -7,9 +7,19 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="form-header h4 panel-title">
<a data-toggle="collapse"
href="#collapseOne">
基本信息
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<form class="form-horizontal m" id="form-order-edit"
th:object="${crmOrder}">
<h4 class="form-header h4">基本信息</h4>
<input name="orderId" th:field="*{orderId}" type="hidden">
<input name="customerId" type="hidden" id="customerId" />
<div class="row">
......@@ -39,22 +49,23 @@
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">成交总额:</label>
<div class="col-sm-6">
<input name="totalPrice" th:field="*{totalPrice}" class="form-control" type="text" required>
<div class="col-sm-8">
<div style="display: flex;border: 1px solid #e5e6e7;border-radius: 4px;width: 100%;">
<input name="totalPrice" th:field="*{totalPrice}" class="form-control" type="text" required style="border: none;width: 70%;">
<i class="fa fa fa-cny" style="width: 30%;display: inline-block;line-height: 30px;text-align: center"><a href="javascript:autoCaculate();">自动计算</a></i>
</div>
<div class="col-sm-2">
<i class="fa fa fa-cny"><a href="javascript:autoCaculate();">自动计算</a></i>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">总成本:</label>
<div class="col-sm-6">
<input name="costPrice" th:field="*{costPrice}" class="form-control" type="text" required>
<div class="col-sm-8">
<div style="display: flex;border: 1px solid #e5e6e7;border-radius: 4px;width: 100%;">
<input name="costPrice" th:field="*{costPrice}" class="form-control" type="text" required style="border: none;width: 70%;">
<i class="fa fa fa-cny" style="width: 30%;display: inline-block;line-height: 30px;text-align: center"><a href="javascript:autoCaculate();">自动计算</a></i>
</div>
<div class="col-sm-2">
<i class="fa fa fa-cny"><a href="javascript:autoCaculate();">自动计算</a></i>
</div>
</div>
</div>
......@@ -141,7 +152,20 @@
</div>
</div>
</form>
<h4 class="form-header h4">产品信息</h4>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="form-header h4 panel-title">
<a data-toggle="collapse"
href="#collapseTwo">
产品信息
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="container-div">
<div class="row">
<div class="btn-group-sm" id="toolbarProduct" role="group">
......@@ -155,6 +179,9 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改产品')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-product-edit" th:object="${wmsProduct}">
<input name="productId" th:field="*{productId}" type="hidden">
......@@ -95,6 +98,53 @@
<textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
</div>
</div>
<div>
<p onclick="tableChange()"><a href="javascript:;">添加</a></p>
<!-- <button onclick="tableChange()">Copy Text</button>-->
<table class="table table-bordered" id="tables">
<thead>
<tr>
<th>名称</th>
<th></th>
<th>操作</th>
</tr>
</thead>
<tbody id="tbody">
<tr>
<td align="center">
<input type="text" name="NO[]" size="2" />
</td>
<td align="center">
<input type="text" name="serial_number[]" />
</td>
<td>
<input type="button" id="Button2" onClick="deltr(this)" value="删行">
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
//添加表格
function tableChange() {
var tableHtml ="";
tableHtml += '<tr>'
+'<td align="center"><input type="text" name="NO[]" size="2" /> </td>'
+'<td align="center"><input type="text" name="serial_number[]"/></td>'
+'<td><input type="button" onClick="deltr(this)" value="删行"></td>'
+'</tr>';
$("#tbody").append(tableHtml) ; //在表格后面添加一行
}
function deltr(opp) {
var length = $("#tbody tr").length;
if (length <= 1) {
alert("至少保留一行");
} else {
$(opp).parent().parent().remove();//移除当前行
}
}
</script>
</div>
</form>
</div>
<div class="row">
......@@ -104,7 +154,9 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var argsList = []
var prefix = ctx + "crm/product";
$("#form-product-edit").validate({
focusCleanup: true
......@@ -161,5 +213,6 @@
}
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -6,6 +6,8 @@ import com.jeethink.common.annotation.Excel;
import com.jeethink.common.annotation.Excel.Type;
import com.jeethink.common.core.domain.BaseEntity;
import java.util.List;
/**
* 产品对象 wms_product
*
......@@ -69,6 +71,9 @@ public class WmsProduct extends BaseEntity
/** 产品图片 */
private String productImage;
/***产品属性**/
private List<WmsProductAttribute> wmsProductAttributes;
public void setProductId(Long productId)
{
this.productId = productId;
......@@ -205,6 +210,14 @@ public class WmsProduct extends BaseEntity
}
public List<WmsProductAttribute> getWmsProductAttributes() {
return wmsProductAttributes;
}
public void setWmsProductAttributes(List<WmsProductAttribute> wmsProductAttributes) {
this.wmsProductAttributes = wmsProductAttributes;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.jeethink.crm.domain;
import com.jeethink.common.annotation.Excel;
import com.jeethink.common.annotation.Excel.Type;
import com.jeethink.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 产品对象 wms_product_attribute
*
* @author jeethink
* @date 2020-03-12
*/
public class WmsProductAttribute extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**属性ID**/
private Long attributeId;
/** 产品ID */
private Long productId;
/***属性名**/
private String name;
/**属性值**/
private String attrVal;
/** 删除标识 */
private String delFlag;
public Long getAttributeId() {
return attributeId;
}
public void setAttributeId(Long attributeId) {
this.attributeId = attributeId;
}
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAttrVal() {
return attrVal;
}
public void setAttrVal(String attrVal) {
this.attrVal = attrVal;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
package com.jeethink.crm.mapper;
import com.jeethink.crm.domain.WmsProduct;
import com.jeethink.crm.domain.WmsProductAttribute;
import java.util.List;
/***
* 产品属性
*/
public interface WmsProductAttributeMapper {
/***
* 新增产品属性
* @param productAttribute
* @return
*/
public int insertWmsProductAttribute(WmsProductAttribute productAttribute);
/***
* 删除产品属性
* @param attributeId
* @return
*/
public int deleteWmsProductAttributeById(Long attributeId);
/***
* 批量删除属性
* @param attributeIds
* @return
*/
public int deleteWmsProductAttributeByIds(String[] attributeIds);
/***
* 删除产品属性
* @param prodId
* @return
*/
public int deleteWmsProductAttributeByProdId(Long prodId);
}
<?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.jeethink.crm.mapper.WmsProductAttributeMapper">
<resultMap type="WmsProductAttribute" id="WmsProductAttributeResult">
<id property="attributeId" column="attribute_id" />
<result property="productId" column="product_id" />
<result property="name" column="name" />
<result property="attrVal" column="attr_val" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<insert id="insertWmsProductAttribute" parameterType="WmsProductAttribute" useGeneratedKeys="true" keyProperty="attributeId">
insert into wms_product_attribute
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="productId != null ">product_id,</if>
<if test="name != null ">name,</if>
<if test="attrVal != null and productName != ''">attr_val,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null ">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null ">#{productId},</if>
<if test="name != null ">#{name},</if>
<if test="attrVal != null and attrVal != ''">#{attrVal},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null ">#{updateTime},</if>
</trim>
</insert>
<delete id="deleteWmsProductAttributeById" parameterType="Long">
delete from wms_product_attribute where attribute_id = #{attributeId}
</delete>
<delete id="deleteWmsProductAttributeByIds" parameterType="String">
delete from wms_product_attribute where attribute_id in
<foreach item="attributeId" collection="array" open="(" separator="," close=")">
#{attributeId}
</foreach>
</delete>
<delete id="deleteWmsProductAttributeByProdId" parameterType="Long">
delete from wms_product_attribute where product_id = #{prodId}
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment