Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 5 months ago
parent
commit
8a45a28491
  1. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  2. 8
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java
  3. 22
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java
  4. 37
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  5. 27
      ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipDetailDto.java
  6. 3
      ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipMaterialDto.java
  7. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java
  8. 57
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java
  9. 10
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  10. 150
      ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html
  11. 93
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html
  12. 2
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java

@ -97,4 +97,9 @@ public interface AfterSalesShippingDeviceMapper
* 销售单-出库 物料信息关联设备信息
*/
List<AfterSalesShippingDevice> selectShippingDeviceList(AfterSalesShippingDevice afterSalesShippingDevice);
/*
* 根据生产单号和关联销售单号查询出货设备履历信息
* */
List<AfterSalesShippingDevice> selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice);
}

8
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java

@ -7,6 +7,7 @@ import com.ruoyi.aftersales.domain.dto.AfterSalesMakeOrderDto;
import com.ruoyi.aftersales.domain.dto.AfterSalesShippingDeviceEditDto;
import com.ruoyi.aftersales.domain.dto.WarehouseAndAfterSalesDto;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.system.dto.SysEquipDetailDto;
/**
* 出货设备Service接口
@ -111,4 +112,11 @@ public interface IAfterSalesShippingDeviceService
* @return
*/
List<SelectDeviceVO> selectOptionDevices(String makeNo);
/*
* 根据生产单号和关联销售单号查询出货设备履历信息
* */
List<SysEquipDetailDto> selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice);
}

22
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java

@ -13,6 +13,7 @@ import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.dto.SysEquipDetailDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
@ -20,6 +21,7 @@ import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/**
* 出货设备Service业务层处理
@ -241,4 +243,24 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD
selectDeviceVos.add(selectDeviceVo);
return selectDeviceVos;
}
/*
* 根据生产单号和关联销售单号查询出货设备履历信息
* */
@Override
public List<SysEquipDetailDto> selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice) {
List<SysEquipDetailDto> sysEquipDetailDtos = new ArrayList<>();
List<AfterSalesShippingDevice> afterSalesShippingDeviceList = afterSalesShippingDeviceMapper.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice);
if (!CollectionUtils.isEmpty(afterSalesShippingDeviceList)){
for (AfterSalesShippingDevice salesShippingDevice : afterSalesShippingDeviceList) {
SysEquipDetailDto sysEquipDetailDto = new SysEquipDetailDto();
sysEquipDetailDto.setEquipmentId(salesShippingDevice.getShippingDeviceId());
sysEquipDetailDto.setSerialNo(salesShippingDevice.getDeviceRunningNumber());
sysEquipDetailDto.setEquipmentModel(salesShippingDevice.getDeviceModelCode());
sysEquipDetailDtos.add(sysEquipDetailDto);
}
}
return sysEquipDetailDtos;
}
}

37
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -2,6 +2,8 @@ package com.ruoyi.system.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -12,10 +14,13 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.financial.domain.FinancialReceivables;
import com.ruoyi.financial.domain.FinancialReceivablesRecords;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.dto.SysEquipDetailDto;
import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.dto.SysMakeorderDeptDto;
import com.ruoyi.system.dto.SysMakeorderMaterialDto;
@ -57,6 +62,10 @@ public class SysMakeOrderController extends BaseController
@Autowired
private ISysSalesOrderService salesOrderService;
@Autowired
private IAfterSalesShippingDeviceService salesShippingDeviceService;
@GetMapping("/test")
public AjaxResult test(){
sysMakeOrderService.generateMakeOrderBySalesOrderCode("XS20240411007");
@ -209,6 +218,34 @@ public class SysMakeOrderController extends BaseController
}
/**
* 添加保存设备履历
*/
@ResponseBody
@PostMapping("/addEquipmentResumeSave")
public AjaxResult addEquipmentResumeSave(@RequestBody SysEquipMaterialDto equipMaterialDto)
{
return toAjax(sysMakeOrderService.addEquipmentResumeSave(equipMaterialDto));
}
/**
* 查找已经添加的设备履历
*/
@PostMapping("/getEquipMaterialDetails")
@ResponseBody
public TableDataInfo getEquipMaterialDetails(SysEquipMaterialDto equipMaterialDto){
startPage();
String makeNo = equipMaterialDto.getMakeNo();
String salesOrderCode = equipMaterialDto.getQuoteId();
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMakeNo(makeNo);
afterSalesShippingDevice.setSalesOrderCode(salesOrderCode);
List<SysEquipDetailDto> equipDetailDtos = salesShippingDeviceService.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice);
return getDataTable(equipDetailDtos);
}
/**
* 部门评审
* @param makeorderDeptDto

27
ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipDetailDto.java

@ -0,0 +1,27 @@
package com.ruoyi.system.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author 刘晓旭
* @description 设备履历详情
*/
@Data
public class SysEquipDetailDto implements Serializable {
private static final long serialVersionUID = -3491668293466029506L;
//出货设备id
private String equipmentId;
//设备型号
private String equipmentModel;
//流水号
private String serialNo;
//生产图片
private String producePic;
}

3
ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysEquipMaterialDto.java

@ -26,4 +26,7 @@ public class SysEquipMaterialDto implements Serializable {
private String makeNo;
private Integer curIndex;
private String inboundOrderNo;
//出货设备详情集合
private List<SysEquipDetailDto> sysEquipDetailDtos;
}

7
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java

@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.dto.SysMakeorderMaterialDto;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
@ -112,4 +113,10 @@ public interface ISysMakeOrderService
* 仓库采购入库单进行入库的时候更新生产订单数据
* */
int updateSysMakeOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList);
/**
* 添加保存设备履历
*/
int addEquipmentResumeSave(SysEquipMaterialDto equipMaterialDto);
}

57
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java

@ -1,8 +1,11 @@
package com.ruoyi.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
@ -13,6 +16,8 @@ import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.dto.SysEquipDetailDto;
import com.ruoyi.system.dto.SysEquipMaterialDto;
import com.ruoyi.system.dto.SysMakeorderMaterialDto;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.service.*;
@ -23,6 +28,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
@ -62,6 +68,10 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
@Autowired
private IPurchasePlanService purchasePlanService;
@Autowired
private AfterSalesShippingDeviceMapper afterSalesShippingDeviceMapper;
/**
* 查询生产订单
*
@ -324,4 +334,51 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
return updateResult;
}
/**
* 添加保存设备履历
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int addEquipmentResumeSave(SysEquipMaterialDto equipMaterialDto) {
if (CollectionUtils.isEmpty(equipMaterialDto.getSysEquipDetailDtos())) {
log.warn("设备履历详情数据为空");
throw new BusinessException("设备履历详情数据为空");
}
int result = 0;
for (SysEquipDetailDto sysEquipDetailDto : equipMaterialDto.getSysEquipDetailDtos()) {
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
// 设置通用信息,这些信息对于插入和更新都是共通的
afterSalesShippingDevice.setMakeNo(equipMaterialDto.getMakeNo());
afterSalesShippingDevice.setSalesOrderCode(equipMaterialDto.getQuoteId());
afterSalesShippingDevice.setMaterialNo(equipMaterialDto.getMaterialCode());
afterSalesShippingDevice.setMaterialName(equipMaterialDto.getMaterialName());
afterSalesShippingDevice.setMaterialType(equipMaterialDto.getMaterialType());
afterSalesShippingDevice.setMaterialBrand(equipMaterialDto.getBrand());
afterSalesShippingDevice.setMaterialUnit(equipMaterialDto.getUnit());
afterSalesShippingDevice.setMaterialDescribe(equipMaterialDto.getDescribe());
afterSalesShippingDevice.setDeviceModelCode(sysEquipDetailDto.getEquipmentModel());
afterSalesShippingDevice.setDeviceRunningNumber(sysEquipDetailDto.getSerialNo());
if (StringUtils.isEmpty(sysEquipDetailDto.getEquipmentId())) {
// 如果设备ID为空,说明是新记录,需要插入
afterSalesShippingDevice.setShippingDeviceId(redisCache.generateBillNo("CHSB"));
afterSalesShippingDevice.setCreateBy(ShiroUtils.getLoginName());
afterSalesShippingDevice.setCreateTime(new Date());
result += afterSalesShippingDeviceMapper.insertAfterSalesShippingDevice(afterSalesShippingDevice);
} else {
// 设备ID不为空,假设需要更新逻辑(根据业务需求确定是否需要此分支)
afterSalesShippingDevice.setShippingDeviceId(sysEquipDetailDto.getEquipmentId()); // 确保ID设置正确
afterSalesShippingDevice.setUpdateBy(ShiroUtils.getLoginName());
afterSalesShippingDevice.setUpdateTime(new Date());
// 注意:这里假设了updateAfterSalesShippingDevice方法是存在的且逻辑正确,根据实际情况调整
result += afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice);
}
}
return result;
}
}

10
ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -94,11 +94,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectAfterSalesShippingDeviceByNoAndCode" parameterType="AfterSalesShippingDevice" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}
and sales_order_code = #{salesOrderCode}
</select>
<insert id="insertAfterSalesShippingDevice" parameterType="AfterSalesShippingDevice" useGeneratedKeys="true" keyProperty="shippingDeviceCode">
insert into aftersales_shipping_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id,</if>
<if test="salesOrderCode != null">sales_order_code,</if>
<if test="makeNo != null">make_no,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialPhotourl != null">material_photoUrl,</if>
@ -136,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">#{shippingDeviceId},</if>
<if test="salesOrderCode != null">#{salesOrderCode},</if>
<if test="makeNo != null">#{makeNo},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialPhotourl != null">#{materialPhotourl},</if>
@ -177,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update aftersales_shipping_device
<trim prefix="SET" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">shipping_device_id = #{shippingDeviceId},</if>
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="makeNo != null">make_no = #{makeNo},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if>

150
ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html

@ -102,114 +102,186 @@
</div>
</div>
</div>
<!-- <div class="row">-->
<!-- <button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>-->
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <table id="bootstrap-sub-table-1"></table>-->
<!-- </div>-->
<!-- </div>-->
</form>
<div class="container">
<!-- 增加设备履历 -->
<div class="row">
<div class="col-sm-12 d-flex align-items-center">
<a class="btn btn-success ml-auto" onclick="addEquipMaterialDetail()">
<i class="fa fa-plus"></i> 增加
</a>
</div>
</div>
<div class="row">
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
<table id="form-equipMaterialDetail-add"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/equipmentResume";
var equipMaterial = [[${equipMaterial}]];
var prefix = ctx + "system/makeorder";
// var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
$(function(){
var options = {
id: 'bootstrap-sub-table-1',
id: "form-equipMaterialDetail-add",
url: prefix + "/getEquipMaterialDetails",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
queryParams:queryParams,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
field: 'equipmentIndex',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='equipResumes[%s].index' value='%s'>", index,$.table.serialNumber(index));
var columnId = $.common.sprintf("<input type='hidden' name='equipResumes[%s].id' value='%s'>", index, row.id);
return columnIndex + $.table.serialNumber(index) + columnId;
// 使用bootstrap-table的内置序号生成
return index + 1;
}
},
{
field: 'equipmentId',
align: 'center',
title: '出货设备id',
formatter: function(value, row, index) {
return '添加后系统自动生成';
}
// formatter: function(value, row, index) {
// return '添加后系统自动生成';
// }
},
{
field: 'equipmentModel',
align: 'center',
title: '设备型号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control equipmentModel' type='text' name='equipResumes[%s].equipmentModel' value='%s'>", index, value);
return html;
}
editable:true
},
{
field: 'serialNo',
align: 'center',
title: '流水号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='equipResumes[%s].serialNo' value='%s'>", index, value);
return html;
}
editable:true
},
{
field: 'producePic',
align: 'center',
title: '生产图片',
formatter: function(value, row, index) {
}
editable:true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
formatter: function (value, row, index) {
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(' + index + ')"><i class="fa fa-remove"></i>删除</a>';
}
}]
}
]
};
$.table.init(options);
})
function addRow() {
var count = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
function queryParams(params) {
var curParams = {
// 传递参数查询参数
makeNo: equipMaterial.makeNo,
quoteId: equipMaterial.quoteId
};
return curParams;
}
//添加设备履历
function addEquipMaterialDetail() {
var newRow = {
equipmentId: "",
equipmentModel: "",
serialNo: "",
producePic: "",
}
sub.addRow(row);
// 假设每个新增的行都有一个唯一的标识符或者索引,这里为了演示直接使用时间戳
equipmentIndex: new Date().getTime(),
};
$('#form-equipMaterialDetail-add').bootstrapTable('append', newRow);
}
function removeRow(index) {
var data = $('#form-equipMaterialDetail-add').bootstrapTable('getData');
var row = data[index]; // 获取要删除的行数据
if (row) {
$('#form-equipMaterialDetail-add').bootstrapTable('remove', {
field: 'equipmentIndex',
values: [row.equipmentIndex]
});
}
}
$("#form-equipMaterial-add").validate({
focusCleanup: true
});
/*function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-equipMaterial-add').serialize());
/*
* 提交设备履历信息
* */
function submitHandler() {
// 获取表单数据
const equipMaterialData = $("#form-equipMaterial-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
// var table = $('#form-equipMaterialDetail-add').bootstrapTable('getData');
//获取选中复选框行的数据
const selectedRows = $("#form-equipMaterialDetail-add").bootstrapTable('getSelections');
// 检查表格数据是否为空
if (selectedRows.length===0){
$.modal.alertWarning("请至少添加一条数据后再保存!");
return;
}
// 将表数据转换成与complaintNoticeData格式一致的数组
var equipDetailDataList = selectedRows.map(function(item) {
// 根据实际字段名调整
return {
"equipmentId": item.equipmentId,
"equipmentModel": item.equipmentModel,
"serialNo": item.serialNo,
"producePic": item.producePic
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, equipMaterialData, { sysEquipDetailDtos: equipDetailDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/addEquipmentResumeSave", jsonData);
}
}*/
</script>
</body>
</html>

93
ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html

@ -46,6 +46,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/makeorder";
@ -142,7 +143,7 @@
{
field: 'processMethod',
align: 'center',
title: '半成品类型',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
@ -162,18 +163,23 @@
align: 'center',
title: '已完成数'
},
// {
// field: 'currentNum',
// title: '本次完成数',
// formatter: function (value,row,index){
// var curIndex = index;
// // 物料类型是成品,通过添加设备履历表计算数量
// if(row.materialType == 'chcpsb'){
// return '<input readonly class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">' +
// '<input class = "form-control hidden" data-id = "equipResumeArrayStr_'+curIndex+'" name="inboundDetails['+curIndex+'].equipResumeArrayStr">';
// }
// return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">';
// }
// },
{
field: 'currentNum',
title: '本次完成数',
formatter: function (value,row,index){
var curIndex = index;
// 物料类型是成品,通过添加设备履历表计算数量
if(row.materialType == 'chcpsb'){
return '<input readonly class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">' +
'<input class = "form-control hidden" data-id = "equipResumeArrayStr_'+curIndex+'" name="inboundDetails['+curIndex+'].equipResumeArrayStr">';
}
return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">';
}
editable:true
},
{
title: '操作',
@ -377,41 +383,42 @@
function addEquipmentResume(curIndex,materialCode){
var url = prefix + "/addEquipmentResume?makeNo="+$("#makeNo").val()+"&saleNo="+$("#saleNo").val()+"&materialNo="+materialCode+"&curIndex="+curIndex;
var options = {
title: '设备履历表',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
// var options = {
// title: '设备履历表',
// url: url,
// // callBack: doSubmit
// };
// $.modal.openOptions(options);
$.modal.open("设备履历表",url);
}
function doSubmit(index, layero,uniqueId) {
debugger
var iframeWin = window[layero.find('iframe')[0]['name']];
// 行取不到
// var data = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getData');
// alert(JSON.stringify(data));
// 取不到
// var options = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getOptions');
// var data = options.data;
// alert(JSON.stringify(data));
var formData = iframeWin.$("#form-equipMaterial-add").serializeArray();
var formObj = serializeObject(formData);
var formObjStr = JSON.stringify(formObj);
alert(formObjStr);
// 关闭弹出框
layer.close(index);
var curIndex = formObj.curIndex;
if(formObj.equipResumes){
var currentNum = formObj.equipResumes.length;
var equipResumeArrayStr = JSON.stringify(formObj.equipResumes);
$('[data-id="currentNum_'+curIndex+'"]').val(currentNum);
$('[data-id="equipResumeArrayStr_'+curIndex+'"]').val(equipResumeArrayStr);
}
}
// function doSubmit(index, layero,uniqueId) {
// // debugger
// var iframeWin = window[layero.find('iframe')[0]['name']];
// // 行取不到
// // var data = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getData');
// // alert(JSON.stringify(data));
//
// // 取不到
// // var options = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getOptions');
// // var data = options.data;
// // alert(JSON.stringify(data));
//
// var formData = iframeWin.$("#form-equipMaterial-add").serializeArray();
// var formObj = serializeObject(formData);
// var formObjStr = JSON.stringify(formObj);
// // alert(formObjStr);
// // 关闭弹出框
// layer.close(index);
// var curIndex = formObj.curIndex;
// if(formObj.equipResumes){
// var currentNum = formObj.equipResumes.length;
// var equipResumeArrayStr = JSON.stringify(formObj.equipResumes);
// $('[data-id="currentNum_'+curIndex+'"]').val(currentNum);
// $('[data-id="equipResumeArrayStr_'+curIndex+'"]').val(equipResumeArrayStr);
// }
//
// }
function serializeObject(formData) {
var obj = {};

2
ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

@ -249,7 +249,7 @@
(row.eceiptStatus == '7' || row.eceiptStatus == '8')){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> ');
}
// 委内入库
// 委内入库 对应生产中
if(row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建委内入库单\',\'' + prefix+"/addProcessInbound/"+row.id + '\')">委内入库</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建生产入库和设备履历设置\',\'' + prefix+"/addProduceInbound/"+row.id + '\')">生产入库</a> ');

Loading…
Cancel
Save