Browse Source

[feat]工程管理:修改bom信息用量设置为必填项,损耗率默认显示%,添加BOM物料是可选项丢失的错误。工程员默认为本人,修复审核显示时丢失半成品类型信息的错误。

dev
zhangsiqi 5 months ago
parent
commit
f44def8f4e
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java
  2. 11
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java
  3. 3
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java
  5. 5
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  6. 4
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  7. 93
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html
  8. 16
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  9. 43
      ruoyi-admin/src/main/resources/templates/erp/bom/detail.html
  10. 29
      ruoyi-admin/src/main/resources/templates/erp/bom/edit.html
  11. 31
      ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html
  12. 34
      ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html
  13. 35
      ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html
  14. 29
      ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html
  15. 209
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  16. 29
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  17. 87
      ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html
  18. 43
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html

4
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java

@ -237,6 +237,10 @@ public class ErpBom extends BaseEntity
} }
public void setLossRate(String lossRate) public void setLossRate(String lossRate)
{ {
String[] lossRateArr = lossRate.split("\\%");
if(lossRateArr.length>0){
this.lossRate = lossRateArr[0];
}
this.lossRate = lossRate; this.lossRate = lossRate;
} }

11
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java

@ -117,6 +117,17 @@ public class ErpMaterial extends BaseEntity
/** 供应商名称*/ /** 供应商名称*/
private String supplierName; private String supplierName;
private String[] cateParentId;
public List<SysTechnicalTeam> getTechnicalTeams() {
return technicalTeams;
}
public void setTechnicalTeams(List<SysTechnicalTeam> technicalTeams) {
this.technicalTeams = technicalTeams;
}
private List<SysTechnicalTeam> technicalTeams; private List<SysTechnicalTeam> technicalTeams;
public void setId(Long id) public void setId(Long id)
{ {

3
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -217,6 +217,7 @@ private ISysAttachService attachService;
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
//获取创建人 //获取创建人
erpBom.setCreateBy(loginName); erpBom.setCreateBy(loginName);
erpBom.setEngineer(loginName);
//创建时间 //创建时间
erpBom.setCreateTime(DateUtils.getNowDate()); erpBom.setCreateTime(DateUtils.getNowDate());
//初始化BOM编号父类 //初始化BOM编号父类
@ -230,7 +231,6 @@ private ISysAttachService attachService;
//todo 使用useGeneratedKeys="true" keyProperty="id"关键子,插入后完成后需要获取新的id就需要重新getId() //todo 使用useGeneratedKeys="true" keyProperty="id"关键子,插入后完成后需要获取新的id就需要重新getId()
Long id = erpBom.getId(); Long id = erpBom.getId();
insertErpBomSub(erpBom); insertErpBomSub(erpBom);
ErpMaterial erpMaterial = materialMapper.selectErpMaterialByMaterialNo(erpBom.getMaterialNo()); ErpMaterial erpMaterial = materialMapper.selectErpMaterialByMaterialNo(erpBom.getMaterialNo());
if (!Objects.isNull(erpMaterial)) { if (!Objects.isNull(erpMaterial)) {
ErpMaterial erpMaterial1 = new ErpMaterial(); ErpMaterial erpMaterial1 = new ErpMaterial();
@ -253,6 +253,7 @@ private ISysAttachService attachService;
{ {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
erpBomVo.setUpdateBy(loginName); erpBomVo.setUpdateBy(loginName);
erpBomVo.setEngineer(loginName);
erpBomVo.setUpdateTime(DateUtils.getNowDate()); erpBomVo.setUpdateTime(DateUtils.getNowDate());
int editFlag = erpBomMapper.updateErpBom(erpBomVo); int editFlag = erpBomMapper.updateErpBom(erpBomVo);
Long id = erpBomVo.getId(); Long id = erpBomVo.getId();

2
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java

@ -38,7 +38,7 @@ public class FinancialCompantFixedAssetsController extends BaseController
@GetMapping() @GetMapping()
public String CompantFixedAssets() public String CompantFixedAssets()
{ {
return prefix + "/CompantFixedAssets"; return prefix + "/compantFixedAssets";
} }
/** /**

5
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="keyword != null and keyword != ''"> and (erp.material_no like concat('%',#{keyword},'%') or erp.material_name like concat('%',#{keyword},'%'))</if> <if test="keyword != null and keyword != ''"> and (erp.material_no like concat('%',#{keyword},'%') or erp.material_name like concat('%',#{keyword},'%'))</if>
and erp.bom_no != '' and erp.bom_no != ''
</where> </where>
order by erp.update_time desc order by erp.create_time desc
</select> </select>
<select id="selectErpBomList1" resultMap="ErpBomResult"> <select id="selectErpBomList1" resultMap="ErpBomResult">
select bom_no, id, create_by, create_time, update_by, update_time, remark, select bom_no, id, create_by, create_time, update_by, update_time, remark,
@ -239,6 +239,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null and unit != '' ">#{unit},</if> <if test="unit != null and unit != '' ">#{unit},</if>
<if test="brand != null and brand != '' ">#{brand},</if> <if test="brand != null and brand != '' ">#{brand},</if>
<if test="describe != null and describe != '' ">#{describe},</if> <if test="describe != null and describe != '' ">#{describe},</if>
<if test="engineer != null and engineer != '' ">#{engineer},</if>
<if test="useNum != null">#{useNum},</if> <if test="useNum != null">#{useNum},</if>
<if test="lossRate != null">#{lossRate},</if> <if test="lossRate != null">#{lossRate},</if>
<if test="parentId != null">#{parentId},</if> <if test="parentId != null">#{parentId},</if>
@ -272,11 +273,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null and unit != '' ">unit = #{unit},</if> <if test="unit != null and unit != '' ">unit = #{unit},</if>
<if test="brand != null and brand != '' ">brand = #{brand},</if> <if test="brand != null and brand != '' ">brand = #{brand},</if>
<if test="describe != null and describe != '' ">`describe` = #{describe},</if> <if test="describe != null and describe != '' ">`describe` = #{describe},</if>
<if test="engineer != null and engineer != '' ">engineer = #{engineer},</if>
<if test="useNum != null">use_num = #{useNum},</if> <if test="useNum != null">use_num = #{useNum},</if>
<if test="lossRate != null">loss_rate = #{lossRate},</if> <if test="lossRate != null">loss_rate = #{lossRate},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null">parent_id = #{parentId},</if>
<if test="level != null">`level` = #{level},</if> <if test="level != null">`level` = #{level},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if> <if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if> <if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if> <if test="useStatus != null">use_status = #{useStatus},</if>
<if test="instanceId != null and instanceId != ''">instance_id = #{instanceId},</if> <if test="instanceId != null and instanceId != ''">instance_id = #{instanceId},</if>

4
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
, erp.unit, erp.brand, erp.`describe`, erp.warehouse_dept,erp.business_members , erp.unit, erp.brand, erp.`describe`, erp.warehouse_dept,erp.business_members
,erp.instance_id,erp.instance_type,process_type_dict.dict_label as instance_type_name, ,erp.instance_id,erp.instance_type,process_type_dict.dict_label as instance_type_name,
erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time, erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time,
ss.supplier_name ss.supplier_name,cate.parent_id
,file.url as photo_url,cate.name as material_type_name ,file.url as photo_url,cate.name as material_type_name
from erp_material erp from erp_material erp
left join( left join(
@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)process_type_dict )process_type_dict
on erp.instance_type = process_type_dict.dict_value on erp.instance_type = process_type_dict.dict_value
left join ( left join (
select code,name from sys_category select code,name,parent_id from sys_category
where parent_id in( where parent_id in(
select id from sys_category select id from sys_category
where parent_id = (select id from sys_category where code = 'materialType') ) where parent_id = (select id from sys_category where code = 'materialType') )

93
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -23,37 +23,43 @@
<div class="col-sm-8"> <div class="col-sm-8">
<!-- <select class="form-control" id="materialName" name="materialName" required>--> <!-- <select class="form-control" id="materialName" name="materialName" required>-->
<!-- </select>--> <!-- </select>-->
<input name="materialName" class="form-control" type="text" required disabled> <input name="materialName" class="form-control" type="text" required readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required> <select id="selectMaterialType" name="materialType"
class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" disabled readonly>
<optgroup th:each="child: ${childList}" th:label="${child.name}"> <optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> <option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup> </optgroup>
</select> </select>
</div> </div>
<input type="text" id="materialType" name="materialType" readonly hidden /> <input type="text" name="materialType" id="materialType" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required> <select id="selectProcessMethod" name="processMethod"
class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled required>
<option value="" ></option> <option value="" ></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
<input type="text" name="processMethod" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select disabled id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> <select id="selectUnit" class="form-control m-b"
th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option value=""></option> <option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
<input type="text" name="unit" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品牌:</label> <label class="col-sm-3 control-label">品牌:</label>
@ -72,9 +78,12 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label> <label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="engineer" class="form-control " required disabled/> <select class="form-control" id="selectEngineer" disabled readonly>
</select>
</div> </div>
<input type="text" name="engineer" readonly hidden />
</div> </div>
</form> </form>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="insertRow()"> <a class="btn btn-success" onclick="insertRow()">
@ -101,6 +110,7 @@
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]]; var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-bom-add").validate({ $("#form-bom-add").validate({
onkeyup: false, onkeyup: false,
rules:{ rules:{
@ -142,8 +152,24 @@
}, },
focusCleanup: true focusCleanup: true
}); });
$(function() { $(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#selectEngineer").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
}
$("#selectEngineer").val(loginName);
} else {
$.modal.msgError(res.msg);
}
}
});
$("#form-bom-add input[name='engineer']").val(loginName);
//todo 物料编号下拉框 //todo 物料编号下拉框
$("#materialNo").select2({ $("#materialNo").select2({
theme: "bootstrap", theme: "bootstrap",
@ -319,12 +345,14 @@
if (!value) { if (!value) {
return '损耗率不能为空'; return '损耗率不能为空';
} }
if (isNaN(value)) { const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
return '损耗率必须为数字'; const match = value.match(regex); // 使用match方法查找所有匹配
} else if (value > 100) { if (!match) {
return "输入数值不能大100" return '损耗率必须以百分比结尾';
} else if (value < 0) { }
return "输入数值不能小于0"; var num = value.replace('%', '');
if (num < 0 || num > 100) {
return '损耗率必须大于等于0小于等于100';
} }
} }
}, },
@ -360,41 +388,38 @@
}] }]
}; };
$.table.init(options); $.table.init(options);
// $.ajax({
// url: ctx + 'erp/material/getEngineerList',
// type: 'get',
// success: function (res) {
// if (res.rows.length > 0) {
// var usertData = res.rows;
// for (let i in usertData) {
// $("#form-bom-add select[name='engineer']").append(
// "<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
// }
// } else {
// $.modal.msgError(res.msg);
// }
// }
// });
$("form-bom-add input[name='engineer']").val(loginName);
$("form-bom-add input[name='engineer']").text(userName);
}); });
function materilalSelect(data) { function materilalSelect(data) {
var materialType1 = data.materialType.indexOf('yl'); var materialType1 = data.materialType.indexOf('yl');
var materialType2 = data.materialType.indexOf('fl'); var materialType2 = data.materialType.indexOf('fl');
if(materialType1 != -1 && materialType2 != -1){ if(materialType1 !== -1 ){
$.modal.msgError("原料、辅料不能作为BOM主体"); $.modal.msgError("原料不能作为BOM主体");
$("#materialNo").val(''); $("#materialNo").val('');
$("input[materialName]").val(''); $("input[materialName]").val('');
return; return;
}; }
console.log("materialType" + data.materialType);
if(materialType2 !== -1 ){
$.modal.msgError("辅料不能作为BOM主体");
$("#materialNo").val('');
$("input[materialName]").val('');
return;
}
$("input[name='brand']").val(data.brand); $("input[name='brand']").val(data.brand);
$("textarea[name='describe']").val(data.describe); $("textarea[name='describe']").val(data.describe);
$("#selectMaterialType").val([data.materialType]).trigger("change"); $("#selectMaterialType").val([data.materialType]).trigger("change");
$("input[name='materialType']").val(data.materialType);
$("#selectProcessMethod").val([data.processMethod]).trigger("change"); $("#selectProcessMethod").val([data.processMethod]).trigger("change");
$("input[name='processMethod']").val(data.processMethod);
$("#selectUnit").val([data.unit]).trigger("change"); $("#selectUnit").val([data.unit]).trigger("change");
$("input[name='unit']").val(data.unit);
} }
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled"); $("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled"); $("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled"); $("#selectUnit").removeAttr("disabled");

16
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -251,16 +251,6 @@
}, },
{ title: '品牌',field: 'brand', sortable: true,}, { title: '品牌',field: 'brand', sortable: true,},
{title: '描述',field: 'describe', sortable: true,}, {title: '描述',field: 'describe', sortable: true,},
{title: '用量',field: 'useNum', sortable: true,},
{title: '损耗率',field: 'lossRate', sortable: true,
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{ {
field: 'parentId', field: 'parentId',
title: '父级id', title: '父级id',
@ -440,8 +430,14 @@
if (value == null || value == ''){ if (value == null || value == ''){
return "%"; return "%";
} }
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (match) {
return value;
}else{
return value + "%"; return value + "%";
} }
}
}, },
{ {
field: 'processMethod', field: 'processMethod',

43
ruoyi-admin/src/main/resources/templates/erp/bom/detail.html

@ -13,13 +13,13 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">料号:</label> <label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly /> <input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" disabled />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label> <label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> <input name="materialName" th:field="*{materialName}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -55,13 +55,13 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品牌:</label> <label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly> <input name="brand" th:field="*{brand}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">描述:</label> <label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> <textarea name="describe" class="form-control" disabled>[[*{describe}]]</textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -90,13 +90,14 @@
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "erp/bom"; var prefix = ctx + "erp/bom";
var materilaType1 = [[${erpBom.materialType}]] + ; var materilaType1 = [[${erpBom.materialType}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-bom-detail").validate({focusCleanup: true}); $("#form-bom-detail").validate({focusCleanup: true});
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
var formData = $("#form-bom-detail").serializeArray(); var formData = $("#form-bom-detail").serializeArray();
@ -227,8 +228,38 @@
field: 'lossRate', field: 'lossRate',
align: 'center', align: 'center',
title: '损耗率(%)', title: '损耗率(%)',
editable : {
editor: {
defaultValue: '%',
title: '损耗率(%)',
mode: 'inline',
type: 'text',
// 编辑时同样附带百分比符号
formatter: function (value) {
return value + '%';
},
// 编辑后去除百分比符号
custom_getter: function (value) {
return value.replace('%', '');
}
},
validate : function (value) {
if (!value) {
return '损耗率不能为空';
}
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (!match) {
return '损耗率必须以百分比结尾';
}
var num = value.replace('%', '');
if (num < 0 || num > 100) {
return '损耗率必须大于等于0小于等于100';
}
}
},
formatter: function (value,row,index){ formatter: function (value,row,index){
if(value == null || value == ''){ if(value == null){
return "%"; return "%";
} }
return value + "%"; return value + "%";

29
ruoyi-admin/src/main/resources/templates/erp/bom/edit.html

@ -20,13 +20,15 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">物料名称:</label> <label class="col-sm-3 control-label is-required">物料名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required> <input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select required id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}"> <select id="selectMaterialType" name="materialType"
class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" required disabled>
<optgroup th:each="child: ${childList}" th:label="${child.name}"> <optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}" th:field="*{materialType}"></option> <option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}" th:field="*{materialType}"></option>
</optgroup> </optgroup>
@ -37,38 +39,37 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select required id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> <select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled>
<option value=""></option> <option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}"> <select id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option value=""></option> <option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}" ></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}" ></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品牌:</label> <label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="brand" th:field="*{brand}" class="form-control" type="text" > <input name="brand" th:field="*{brand}" class="form-control" type="text" readonly />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">描述:</label> <label class="col-sm-3 control-label is-required">描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="describe" class="form-control" required>[[*{describe}]]</textarea> <textarea name="describe" class="form-control" disabled required>[[*{describe}]]</textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" >工程员:</label> <label class="col-sm-3 control-label" >工程员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="engineer" class="form-control"> <select name="engineer" class="form-control" disabled>
</select> </select>
</div> </div>
</div> </div>
@ -116,6 +117,10 @@
} }
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled");
$("#selectEngineer").removeAttr("disabled");
var formData = $("#form-bom-edit").serializeArray(); var formData = $("#form-bom-edit").serializeArray();
console.log("formData",formData); console.log("formData",formData);
var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData'); var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData');
@ -287,7 +292,13 @@
if (value == null || value == ''){ if (value == null || value == ''){
return "%"; return "%";
} }
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (match) {
return value;
}else{
return value + "%"; return value + "%";
}
}, },
}, },
{ {

31
ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html

@ -25,7 +25,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> <input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -36,21 +36,22 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">料号:</label> <label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly required> <input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">物料名称:</label> <label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required> <input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required disabled> <select id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" disabled required>
<optgroup> <optgroup>
<option value="">请选择</option> <option value="">请选择</option>
</optgroup> </optgroup>
@ -64,15 +65,15 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled> <select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> <select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select> </select>
</div> </div>
@ -84,9 +85,9 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">描述:</label> <label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="describe" class="form-control" readonly required>[[*{describe}]]</textarea> <textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -132,11 +133,6 @@
<textarea name="comment" class="form-control"></textarea> <textarea name="comment" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
@ -255,6 +251,9 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled");
var materialType = $('#selectMaterialType').select2('val'); var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType); $('#materialType').val(materialType);
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

34
ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html

@ -25,7 +25,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> <input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -48,9 +48,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled> <select id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" disabled required>
<optgroup> <optgroup>
<option value="">请选择</option> <option value="">请选择</option>
</optgroup> </optgroup>
@ -62,17 +63,17 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled> <select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> <select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select> </select>
</div> </div>
@ -89,18 +90,11 @@
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> <textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">入库部门:</label>
<div class="col-sm-8">
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option>
</select>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label> <label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/> <input name="engineer" th:field="*{engineer}" class="form-control" readonly required/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -140,11 +134,6 @@
<textarea name="comment" class="form-control"></textarea> <textarea name="comment" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
@ -262,6 +251,9 @@
$("#form-edit").validate({focusCleanup: true}); $("#form-edit").validate({focusCleanup: true});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled");
var materialType = $('#selectMaterialType').select2('val'); var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType); $('#materialType').val(materialType);
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {

35
ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html

@ -26,7 +26,7 @@
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> <input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -39,19 +39,20 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">料号:</label> <label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" > <input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label> <label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" > <input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" > <select id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" disabled required>
<optgroup> <optgroup>
<option value="">请选择</option> <option value="">请选择</option>
</optgroup> </optgroup>
@ -60,20 +61,20 @@
</optgroup> </optgroup>
</select> </select>
</div> </div>
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" > <select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" > <select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select> </select>
</div> </div>
@ -81,19 +82,19 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品牌:</label> <label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="brand" th:field="*{brand}" class="form-control" type="text" > <input name="brand" th:field="*{brand}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">描述:</label> <label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="describe" class="form-control" >[[*{describe}]]</textarea> <textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label> <label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="engineer" th:field="*{engineer}" class="form-control" disabled required/> <input name="engineer" th:field="*{engineer}" class="form-control" readonly required/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -125,11 +126,6 @@
</select> </select>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
@ -263,6 +259,9 @@
}); });
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled");
var materialType = $('#selectMaterialType').select2('val'); var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(materialType); $('#materialType').val(materialType);
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];

29
ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html

@ -48,9 +48,13 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label> <label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled> <select id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple"
th:with="childList=${@category.getChildByCode('materialType')}" disabled required>
<optgroup>
<option value="">请选择</option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}"> <optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> <option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup> </optgroup>
@ -59,17 +63,17 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">半成品类型:</label> <label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled> <select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">单位:</label> <label class="col-sm-3 control-label is-required">单位:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> <select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select> </select>
</div> </div>
@ -89,7 +93,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">工程员:</label> <label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="engineer" th:field="*{engineer}" class="form-control" disabled/> <input name="engineer" th:field="*{engineer}" class="form-control" readonly required/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -129,12 +133,6 @@
<textarea name="comment" class="form-control"></textarea> <textarea name="comment" class="form-control"></textarea>
</div> </div>
</div> </div>
<br/>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
@ -251,8 +249,11 @@
$("#form-edit").validate({focusCleanup: true}); $("#form-edit").validate({focusCleanup: true});
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$("#selectMaterialType").removeAttr("disabled");
$("#selectProcessMethod").removeAttr("disabled");
$("#selectUnit").removeAttr("disabled");
var materialType = $('#selectMaterialType').select2('val'); var materialType = $('#selectMaterialType').select2('val');
$('#materialType').val(formData.materialType); $('#materialType').val(materialType);
if ($('textarea[name="comment"]').val()) { if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); $('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
} }

209
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -12,114 +12,44 @@
<input name="developOderCode" class="form-control" type="text"> <input name="developOderCode" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="container">
<label class="col-sm-3 control-label">料号:</label> <div class="form-row">
<div class="col-sm-8"> <div class="btn-group-sm" role="group">
<input name="materialNo" class="form-control" type="text"> <header>修改开发修改单:</header>
</div> </div>
</div> </div>
<div class="form-group"> <div class="row">
<label class="col-sm-3 control-label">采购入库状态:</label> <div class="form-group is-required">
<label class="col-sm-3 control-label">生产单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="purchaseStorageStatus" class="form-control m-b" th:with="type=${@dict.getType('eceiptStatus')}"> <select id="add_developOderCode" name="developOderCode" class="form-control" type="text" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option value="">请选择</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品质状态:</label> <label class="col-sm-3 control-label">修改完成时间:</label>
<div class="col-sm-8"> <div class="input-group date">
<select name="qualityStatus" class="form-control m-b" th:with="type=${@dict.getType('qualityStatus')}"> <input name="updateInfoTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">审核状态:</label>
<div class="col-sm-8">
<select name="auditStatus" class="form-control m-b" th:with="type=${@dict.getType('auditStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">确认状态:</label> <div class="container">
<div class="col-sm-8"> <div class="form-row">
<select name="completeStatus" class="form-control m-b" th:with="type=${@dict.getType('completeStatus')}"> <div class="btn-group-sm" id="toolbar" role="group">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <span>选择开发修改单物料</span>
</select> <a class="btn btn-success" onclick="insertRow()">
</div> <i class="fa fa-plus"></i> 添加修改物料
</div> </a>
<div class="form-group">
<label class="col-sm-3 control-label">完成状态:</label>
<div class="col-sm-8">
<select name="finshStatus" class="form-control m-b" th:with="type=${@dict.getType('finshStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用状态:</label>
<div class="col-sm-8">
<select name="useStatus" class="form-control m-b" th:with="type=${@dict.getType('useStatus')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-8">
<input name="materialName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<input name="materialType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">图片:</label>
<div class="col-sm-8">
<input name="materialPhotoUrl" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8">
<input name="materialUnit" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8">
<input name="materialBrand" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<div class="col-sm-8">
<input name="materialDescribe" class="form-control" type="text">
</div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">半成品类型:</label>
<div class="col-sm-8">
<input name="materialProcessMode" class="form-control" type="text">
</div> </div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-developModify"></table>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<select id="userId_add" name="userId" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注信息:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div> </div>
</div> </div>
</form> </form>
@ -127,12 +57,8 @@
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "erp/developModifyOrder" var prefix = ctx + "erp/developModifyOrder"
$("#form-developModifyOrder-add").validate({ var userName = [[${@permission.getPrincipalProperty('userName')}]];
focusCleanup: true $("#form-developModifyOrder-add").validate({ focusCleanup: true});
});
$(function () { $(function () {
$.ajax({ $.ajax({
url: ctx + 'erp/developModifyOrder/getEngineerList', url: ctx + 'erp/developModifyOrder/getEngineerList',
@ -146,14 +72,93 @@
"<option value='" + userData[i].userId + "'>" + userData[i].userName + "</option>" // 显示用户姓名 "<option value='" + userData[i].userId + "'>" + userData[i].userName + "</option>" // 显示用户姓名
); );
} }
$("userId_add").val(userData[i].userId).trigger("change"); $("#userId_add").val(userData[i].userId).trigger("change");
} else { } else {
$.modal.msgError(res.msg); $.modal.msgError(res.msg);
} }
} }
}); });
var options = {
id: "bootstrap-sub-table-developModify",
url: prefix + "/getDevelopModifyOrderList",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
if(value == null || value == ""){
value = "";
return "<img src='' herf='' />";
}
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '半成品类型',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',},
{title: '国内税率',field: 'countTax',align: 'center',},
{ title: '美元汇率',field: 'usdTax', align: 'center',},
{field: 'materialNum',align: 'center',title: '物料的数量',},
{ title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',},
{title: '修改详情',align: 'center',
formatter:function formatterForm(value, row, index) {
// 这里的代码会为每行生成一个表单
var form = $('<form></form>').append(
$('<input/>', { type: 'text', value: row.name, name: 'name', placeholder: 'Name' }),
$('<input/>', { type: 'email', value: row.email, name: 'email', placeholder: 'Email' }),
$('<button/>', { type: 'submit' }).text('Submit')
);
form.on('submit', function(e) {
e.preventDefault(); // 阻止表单默认提交行为
var formData = form.serializeArray(); // 序列化表单数据为数组
console.log(formData); // 在控制台输出表单数据
// 这里可以添加代码处理表单提交,例如发送到服务器等
});
return form; // 返回生成的表单HTML
}},
]
}
$("bootstrap-sub-table-developModify").init(options);
}) })
function insertRow() {
var table = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData');
var row = table.length + 1;
$("#bootstrap-sub-table-developModify").bootstrapTable('insertRow', {
index: row,
row: {
id: row,
developOderCode: $("#add_developOderCode").val(),
}
});
}
function submitHandler() { function submitHandler() {

29
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html

@ -12,40 +12,45 @@
<input name="purchasePlanCode" class="form-control" type="text"> <input name="purchasePlanCode" class="form-control" type="text">
</div> </div>
</div> </div>
<!-- 公司收货地址 --> <div class="container">
<div class="form-row"> <div class="form-row">
<header class="form-header">公司收获地址:</header> <span class="form-header-4">公司收获地址:</span>
</div> </div>
<div class="row">
<div class="form-group"> <div class="form-group">
<label for="inputWarehouseID" class="col-sm-2 col-form-label">仓库ID:</label> <label for="inputWarehouseID" class="col-sm-3 col-form-label">仓库ID:</label>
<div class="col-sm-7"> <div class="col-sm-5">
<input type="text" class="form-control" id="inputWarehouseID" placeholder="请输入仓库ID"> <input type="text" class="form-control" id="inputWarehouseID" placeholder="请输入仓库ID">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputWarehouseName" class="col-sm-2 col-form-label">仓库名称:</label> <label for="inputWarehouseName" class="col-sm-3 col-form-label">仓库名称:</label>
<div class="col-sm-7"> <div class="col-sm-5">
<input type="text" class="form-control" id="inputWarehouseName" placeholder="请输入仓库名称"> <input type="text" class="form-control" id="inputWarehouseName" placeholder="请输入仓库名称">
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="form-group"> <div class="form-group">
<label for="inputReceiver" class="col-sm-2 col-form-label">收货人:</label> <label for="inputReceiver" class="col-sm-3 col-form-label">收货人:</label>
<div class="col-sm-7"> <div class="col-sm-5">
<input type="text" class="form-control" id="inputReceiver" placeholder="请输入收货人"> <input type="text" class="form-control" id="inputReceiver" placeholder="请输入收货人">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputPhone" class="col-sm-2 col-form-label">收货电话:</label> <label for="inputPhone" class="col-sm-3 col-form-label">收货电话:</label>
<div class="col-sm-7"> <div class="col-sm-5">
<input type="tel" class="form-control" id="inputPhone" placeholder="请输入收货电话"> <input type="tel" class="form-control" id="inputPhone" placeholder="请输入收货电话">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputAddressDetails" class="col-sm-2 col-form-label">详细地址:</label> <label for="inputAddressDetails" class="col-sm-3 col-form-label">详细地址:</label>
<div class="col-sm-7"> <div class="col-sm-5">
<textarea class="form-control" id="inputAddressDetails" rows="3"></textarea> <textarea class="form-control" id="inputAddressDetails" rows="3"></textarea>
</div> </div>
</div> </div>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />

87
ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html

@ -25,7 +25,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">客户编号:</label> <label class="col-sm-4 control-label">客户编号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" onclick="selMaterialTb()" id="customerCode" name="customerCode" required> <select class="form-control" id="customerCode" name="customerCode" required>
</select> </select>
</div> </div>
@ -33,7 +33,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">客户名称:</label> <label class="col-sm-4 control-label">客户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerName" class="form-control m-b" type="text" readonly /> <select id="customerName" name="customerName" class="form-control m-b">
<option value="">请选择</option>
</select>
</div> </div>
</div> </div>
@ -84,30 +86,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">备注说明:</label> <label class="col-sm-4 control-label">备注说明:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea readonly name="remark" class="form-control"></textarea> <textarea name="remark" class="form-control" readonly></textarea>
</div>
</div>
<div class="container">
<h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-3" name="enterprise" id="enterprise_add" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-3" name="enterpriseSum" id="enterpriseSum_add" type="number" readonly/>
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmb" id="noRmb_add" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" id="noRmbSum_add" type="number" readonly/>
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmb" id="rmb_add" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbSum" id="rmbSum_add" type="number" readonly/>
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsd" id="noUsd_add" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" id="noUsdSum_add" type="number" readonly/>
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usd" id="usd_add" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="usdSum" id="usdSum_add" type="number" readonly/>
</div> </div>
</div> </div>
</form> </form>
@ -182,6 +161,7 @@
var option = resultList[i]; var option = resultList[i];
option.id = resultList[i]["enterpriseCode"]; option.id = resultList[i]["enterpriseCode"];
option.text = resultList[i]["enterpriseCode"]; option.text = resultList[i]["enterpriseCode"];
option.title = resultList[i]["enterpriseName"];
options.push(option); options.push(option);
} }
return { return {
@ -195,9 +175,38 @@
// minimumInputLength: 1 // minimumInputLength: 1
} }
}); });
$("#customerName").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择客户",
ajax: {
type: "post",
url: ctx + "system/customer/customerList",
dataType: "json",
delay: 250,
cache: true,
processResults: function (res, params) {
var resultList = res.rows;
console.log("传输的数值");
console.log(resultList);
var options = [];
for (let i in resultList) {
var option = resultList[i];
option.id = resultList[i]["enterpriseName"];
option.text = resultList[i]["enterpriseName"];
option.title = resultList[i]["enterpriseCode"];
options.push(option);
}
return {results: options,}
},
escapeMarkup: function (markup) {return markup;},
}
});
}) })
$('#customerCode').on('select2:select', function (e) { $('#customerCode').on('select2:select', function (e) {
console.log("e",e);
var data = e.params.data; var data = e.params.data;
console.log("data",data);
$("input[name='customerName']").val(data.enterpriseName); $("input[name='customerName']").val(data.enterpriseName);
$("select[name='commonCurrency']").val(data.commonCurrency).trigger('change'); $("select[name='commonCurrency']").val(data.commonCurrency).trigger('change');
$("input[name='customerFax']").val(data.customerFax); $("input[name='customerFax']").val(data.customerFax);
@ -207,6 +216,18 @@
commonCurrency = $("#commonCurrency_add option:selected").val(); commonCurrency = $("#commonCurrency_add option:selected").val();
console.log("commonCurrency",commonCurrency); console.log("commonCurrency",commonCurrency);
}); });
$('#customerName').on('select2:select', function (e) {
var data = e.params.data;
console.log("data",data);
$("input[name='customerCode']").val(data.enterpriseName);
$("select[name='commonCurrency']").val(data.commonCurrency).trigger('change');
$("input[name='customerFax']").val(data.customerFax);
$("input[name='rmbTax']").val(data.taxRate);
$("input[name='confirmFax']").val(data.confirmTax);
$("#commonCurrency_add").val(data.commonCurrency).trigger('change');
commonCurrency = $("#commonCurrency_add option:selected").val();
console.log("commonCurrency",commonCurrency);
});
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-quoteChild', id:'bootstrap-sub-table-quoteChild',
@ -227,6 +248,10 @@
{title: '物料名称',field: 'materialName',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl', {title: '图片',field: 'photoUrl',
formatter: function(value, row, index) { formatter: function(value, row, index) {
if(value == null || value == ""){
value = "";
return "<img src='' herf='' />";
}
return $.table.imageView(value); return $.table.imageView(value);
} }
}, },
@ -556,16 +581,6 @@
$("#commonCurrency_add").on("change", function() { $("#commonCurrency_add").on("change", function() {
var isEditable = $(this).val() === "1"; var isEditable = $(this).val() === "1";
var fieldName = ""; var fieldName = "";
// if (isEditable) {
// fieldName = "materialNoRmb";
// $("#rmbTax_add").prop("disabled", false);
// $("#usdTax_add").prop("disabled", false);
// } else {
// fieldName = "materialNoUsd";
// $("#rmbTax_add").prop("disabled", true);
// $("#usdTax_add").prop("disabled", true);
// }
var materialColumnCells = $('#bootstrap-sub-table-quoteChild tbody tr td [field=" '+ fieldName+' "]'); var materialColumnCells = $('#bootstrap-sub-table-quoteChild tbody tr td [field=" '+ fieldName+' "]');
// 根据是否可编辑,添加或移除xEditable // 根据是否可编辑,添加或移除xEditable
materialColumnCells.each(function() { materialColumnCells.each(function() {

43
ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/add.html

@ -9,13 +9,15 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">领料单编号:</label> <label class="col-sm-3 control-label">领料单编号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="requisitieCode" class="form-control" type="text"> <input name="requisitieCode" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label> <label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="correlationCode" class="form-control" type="text"> <select name="correlationCode" class="form-control" >
<option value="">请选择</option>
</select>
</div> </div>
</div> </div>
@ -49,12 +51,12 @@
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]];
var prefix = ctx + "system/empRequisiteOrder" var prefix = ctx + "system/empRequisiteOrder"
$("#form-empRequisiteOrder-add").validate({ $("#form-empRequisiteOrder-add").validate({focusCleanup: true});
focusCleanup: true
});
//获取子表信息 //获取子表信息
$(function() { $(function() {
getRequisitieCode();
selectSaleOrder();
getSelections();
var options = { var options = {
id:'bootstrap-sub-table-empRequisitionChild', id:'bootstrap-sub-table-empRequisitionChild',
pagination: false, pagination: false,
@ -179,12 +181,35 @@
$("select[name='dept']").append($('<option></option>').val(data.deptName).html(data.deptName)); $("select[name='dept']").append($('<option></option>').val(data.deptName).html(data.deptName));
$("select[name='userName']").append($('<option></option>').val(data.userName).html(data.userName)); $("select[name='userName']").append($('<option></option>').val(data.userName).html(data.userName));
$("select[name='post']").append($('<option></option>').val(data.postName).html(data.postName)); $("select[name='post']").append($('<option></option>').val(data.postName).html(data.postName));
// $select.trigger('change'); // $select.trigger('change');
} }
}); });
}
//获取销售订单编号
function selectSaleOrder(){
$.ajax({
url: ctx + "system/salesOrder/list",
type: "post",
dataType: "json",
success: function (result) {
console.log(result.rows);
var rows = result.rows;
for(var i=0;i<rows.length;i++){
$("#form-empRequisiteOrder-add select[name='correlationCode']").append($('<option></option>').val(rows[i].salesOrderCode).html(rows[i].salesOrderCode));
}
}
});
}
function getRequisitieCode(){
$.ajax({
url: ctx + "system/empRequisiteOrder/getId",
type: "get",
dataType: "json",
success: function (result) {
console.log(result.data);
$("#form-empRequisiteOrder-add input[name='requisitieCode']").val(result.data);
}
});
} }
</script> </script>
</body> </body>

Loading…
Cancel
Save