Browse Source

[feat] 委外加工

整合新增委外订单 controller
整合新增委外订单  Service
整合新增委外订单  ServiceImpl
整合新增委外订单  Mapper
整合新增委外订单  Mapper.xml
整合新增委外订单 相关前端页面
dev
liuxiaoxu 4 months ago
parent
commit
3e9a8ef9a4
  1. 173
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java
  2. 111
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java
  3. 69
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java
  4. 165
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java
  5. 248
      ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml
  6. 334
      ruoyi-admin/src/main/resources/templates/system/outsource_order/add.html
  7. 331
      ruoyi-admin/src/main/resources/templates/system/outsource_order/addRequisition.html
  8. 333
      ruoyi-admin/src/main/resources/templates/system/outsource_order/addStorage.html
  9. 62
      ruoyi-admin/src/main/resources/templates/system/outsource_order/closed.html
  10. 10
      ruoyi-admin/src/main/resources/templates/system/outsource_order/detail.html
  11. 349
      ruoyi-admin/src/main/resources/templates/system/outsource_order/edit.html
  12. 276
      ruoyi-admin/src/main/resources/templates/system/outsource_order/outsource_order.html

173
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceOrderController.java

@ -0,0 +1,173 @@
package com.ruoyi.system.controller;
import java.util.List;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.OutsourceOrder;
import com.ruoyi.system.domain.OutsourceOrderDetail;
import com.ruoyi.system.service.IOutsourceOrderService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 委外订单Controller
*
* @author ruoyi
* @date 2024-07-12
*/
@Controller
@RequestMapping("/system/outsource_order")
public class OutsourceOrderController extends BaseController
{
private String prefix = "system/outsource_order";
@Autowired
private IOutsourceOrderService outsourceOrderService;
@RequiresPermissions("system:outsource_order:view")
@GetMapping()
public String outsource_order()
{
return prefix + "/outsource_order";
}
/**
* 查询委外订单列表
*/
@RequiresPermissions("system:outsource_order:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OutsourceOrder outsourceOrder)
{
startPage();
List<OutsourceOrder> list = outsourceOrderService.selectOutsourceOrderList(outsourceOrder);
return getDataTable(list);
}
/**
* 表格细节视图
*/
@RequiresPermissions("system:outsource_order:detail")
@GetMapping("/detail/{outsourceOrderId}")
public String detail(@PathVariable("outsourceOrderId") long outsourceOrderId, ModelMap mmap)
{
mmap.put("outsourceOrder", outsourceOrderService.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId));
return prefix + "/detail";
}
/**
* 查询委外计划详情
*/
@GetMapping("/sublist")
@ResponseBody
public TableDataInfo subList(@RequestParam("outsourceOrderId") Long outsourceOrderId, ModelMap mmap)
{
OutsourceOrder outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId);
List<OutsourceOrderDetail> list = outsourceOrder.getOutsourceOrderDetailList();
return getDataTable(list);
}
/**
* 导出委外订单列表
*/
@RequiresPermissions("system:outsource_order:export")
@Log(title = "委外订单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceOrder outsourceOrder)
{
List<OutsourceOrder> list = outsourceOrderService.selectOutsourceOrderList(outsourceOrder);
ExcelUtil<OutsourceOrder> util = new ExcelUtil<OutsourceOrder>(OutsourceOrder.class);
return util.exportExcel(list, "委外订单数据");
}
/**
* 添加委外领料单
*/
@GetMapping("/addRequisition/{outsourceOrderNos}")
public String addOutsourceOrder(@PathVariable("outsourceOrderNos") String outsourceOrderNos, ModelMap mmap)
{
List<OutsourceOrder> outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderNo(outsourceOrderNos);
// System.out.println(outsourceOrderNos);
mmap.put("outsourceOrderList", outsourceOrder);
// System.out.println(outsourceOrder);
return prefix + "/addRequisition";
}
/**
* 添加委外入库单
*/
@GetMapping("/addStorage/{outsourceOrderNo}")
public String addOutsourceStorage(@PathVariable("outsourceOrderNo") String outsourceOrderNo, ModelMap mmap)
{
List<OutsourceOrder> outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderNo(outsourceOrderNo);
// System.out.println(outsourceOrderNos);
mmap.put("outsourceOrderList", outsourceOrder);
// System.out.println(outsourceOrder);
return prefix + "/addStorage";
}
/**
* 新增委外订单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存委外订单
*/
@RequiresPermissions("system:outsource_order:add")
@Log(title = "委外订单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OutsourceOrder outsourceOrder)
{
return toAjax(outsourceOrderService.insertOutsourceOrder(outsourceOrder));
}
/**
* 修改委外订单
*/
@RequiresPermissions("system:outsource_order:edit")
@GetMapping("/edit/{outsourceOrderId}")
public String edit(@PathVariable("outsourceOrderId") Long outsourceOrderId, ModelMap mmap)
{
OutsourceOrder outsourceOrder = outsourceOrderService.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId);
mmap.put("outsourceOrder", outsourceOrder);
return prefix + "/edit";
}
/**
* 修改保存委外订单
*/
@RequiresPermissions("system:outsource_order:edit")
@Log(title = "委外订单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OutsourceOrder outsourceOrder)
{
return toAjax(outsourceOrderService.updateOutsourceOrder(outsourceOrder));
}
/**
* 删除委外订单
*/
@RequiresPermissions("system:outsource_order:remove")
@Log(title = "委外订单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(outsourceOrderService.deleteOutsourceOrderByOutsourceOrderIds(ids));
}
}

111
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceOrderMapper.java

@ -0,0 +1,111 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.domain.OutsourceOrder;
import com.ruoyi.system.domain.OutsourceOrderDetail;
import java.util.List;
/**
* 委外订单Mapper接口
*
* @author ruoyi
* @date 2024-07-12
*/
public interface OutsourceOrderMapper
{
/**
* 查询委外订单
*
* @param outsourceOrderId 委外订单主键
* @return 委外订单
*/
public OutsourceOrder selectOutsourceOrderByOutsourceOrderId(Long outsourceOrderId);
/**
* 查询委外订单
*
* @param outsourceOrderNo 委外订单编号
* @return 委外订单
*/
public List<OutsourceOrder> selectOutsourceOrderByOutsourceOrderNo(String outsourceOrderNo);
/**
* 查询委外订单列表
*
* @param outsourceOrder 委外订单
* @return 委外订单集合
*/
public List<OutsourceOrder> selectOutsourceOrderList(OutsourceOrder outsourceOrder);
/**
* 查询委外订单详情列表
*
* @param outsourceOrderNo 委外订单
* @return 委外订单集合
*/
public List<OutsourceOrderDetail> selectOutsourceOrderDetailList(String outsourceOrderNo);
/**
* 新增委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
public int insertOutsourceOrder(OutsourceOrder outsourceOrder);
/**
* 修改委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
public int updateOutsourceOrder(OutsourceOrder outsourceOrder);
/**
* 删除委外订单
*
* @param outsourceOrderId 委外订单主键
* @return 结果
*/
public int deleteOutsourceOrderByOutsourceOrderId(Long outsourceOrderId);
/**
* 批量删除委外订单
*
* @param outsourceOrderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourceOrderByOutsourceOrderIds(String[] outsourceOrderIds);
/**
* 批量删除委外订单详情
*
* @param outsourceOrderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourceOrderDetailByOutsourceOrderNos(String[] outsourceOrderIds);
/**
* 批量新增委外订单详情
*
* @param outsourceOrderDetailList 委外订单详情列表
* @return 结果
*/
public int batchOutsourceOrderDetail(List<OutsourceOrderDetail> outsourceOrderDetailList);
/**
* 查询委外物料
*
* @param materialNo 需要查询的数据编码
* @return 结果
*/
public OutsourceMaterial selectMaterialByCode(String materialNo);
/**
* 通过委外订单主键删除委外订单详情信息
*
* @param outsourceOrderId 委外订单ID
* @return 结果
*/
public int deleteOutsourceOrderDetailByOutsourceOrderNo(Long outsourceOrderId);
}

69
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceOrderService.java

@ -0,0 +1,69 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.OutsourceOrder;
import java.util.List;
/**
* 委外订单Service接口
*
* @author ruoyi
* @date 2024-07-12
*/
public interface IOutsourceOrderService
{
/**
* 查询委外订单
*
* @param outsourceOrderId 委外订单主键
* @return 委外订单
*/
public OutsourceOrder selectOutsourceOrderByOutsourceOrderId(Long outsourceOrderId);
/**
* 查询委外订单列表
*
* @param outsourceOrder 委外订单
* @return 委外订单集合
*/
public List<OutsourceOrder> selectOutsourceOrderList(OutsourceOrder outsourceOrder);
/**
* 新增委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
public int insertOutsourceOrder(OutsourceOrder outsourceOrder);
/**
* 修改委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
public int updateOutsourceOrder(OutsourceOrder outsourceOrder);
/**
* 查询委外订单
*
* @param outsourceOrderNo 委外订单编号
* @return 委外订单
*/
public List<OutsourceOrder> selectOutsourceOrderByOutsourceOrderNo(String outsourceOrderNo);
/**
* 批量删除委外订单
*
* @param outsourceOrderIds 需要删除的委外订单主键集合
* @return 结果
*/
public int deleteOutsourceOrderByOutsourceOrderIds(String outsourceOrderIds);
/**
* 删除委外订单信息
*
* @param outsourceOrderId 委外订单主键
* @return 结果
*/
public int deleteOutsourceOrderByOutsourceOrderId(Long outsourceOrderId);
}

165
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceOrderServiceImpl.java

@ -0,0 +1,165 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.domain.OutsourceOrder;
import com.ruoyi.system.domain.OutsourceOrderDetail;
import com.ruoyi.system.mapper.OutsourceOrderMapper;
import com.ruoyi.system.service.IOutsourceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.core.text.Convert;
/**
* 委外订单Service业务层处理
*
* @author ruoyi
* @date 2024-07-12
*/
@Service
public class OutsourceOrderServiceImpl implements IOutsourceOrderService
{
@Autowired
private OutsourceOrderMapper outsourceOrderMapper;
/**
* 查询委外订单
*
* @param outsourceOrderId 委外订单主键
* @return 委外订单
*/
@Override
public OutsourceOrder selectOutsourceOrderByOutsourceOrderId(Long outsourceOrderId)
{
OutsourceOrder outsourceOrder = outsourceOrderMapper.selectOutsourceOrderByOutsourceOrderId(outsourceOrderId);
List<OutsourceOrderDetail> details = outsourceOrderMapper.selectOutsourceOrderDetailList(outsourceOrder.getOutsourceOrderNo());
outsourceOrder.setOutsourceOrderDetailList(details);
return outsourceOrder;
}
/**
* 查询委外订单列表
*
* @param outsourceOrder 委外订单
* @return 委外订单
*/
@Override
public List<OutsourceOrder> selectOutsourceOrderList(OutsourceOrder outsourceOrder)
{
return outsourceOrderMapper.selectOutsourceOrderList(outsourceOrder);
}
/**
* 新增委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
@Transactional
@Override
public int insertOutsourceOrder(OutsourceOrder outsourceOrder)
{
outsourceOrder.setCreateTime(DateUtils.getNowDate());
int rows = outsourceOrderMapper.insertOutsourceOrder(outsourceOrder);
insertOutsourceOrderDetail(outsourceOrder);
return rows;
}
/**
* 修改委外订单
*
* @param outsourceOrder 委外订单
* @return 结果
*/
@Transactional
@Override
public int updateOutsourceOrder(OutsourceOrder outsourceOrder)
{
outsourceOrder.setUpdateTime(DateUtils.getNowDate());
outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(outsourceOrder.getOutsourceOrderId());
insertOutsourceOrderDetail(outsourceOrder);
return outsourceOrderMapper.updateOutsourceOrder(outsourceOrder);
}
@Override
public List<OutsourceOrder> selectOutsourceOrderByOutsourceOrderNo(String outsourceOrderNo) {
List<OutsourceOrder> outsourceOrders = outsourceOrderMapper.selectOutsourceOrderByOutsourceOrderNo(outsourceOrderNo);
for (OutsourceOrder order:outsourceOrders) {
List<OutsourceOrderDetail> details= outsourceOrderMapper.selectOutsourceOrderDetailList(order.getOutsourceOrderNo());
for (OutsourceOrderDetail detail:details
) {
OutsourceMaterial material = outsourceOrderMapper.selectMaterialByCode(detail.getMaterialNo());
// 确保 material 的 OrderDetails 集合已初始化
if (material.getOrderDetails() == null) {
material.setOrderDetails(new ArrayList<>());
}
material.getOrderDetails().add(detail);
// 确保 order 的 Materials 集合已初始化
if (order.getMaterials() == null) {
order.setMaterials(new ArrayList<>());
}
order.getMaterials().add(material);
}
}
return outsourceOrders;
}
/**
* 批量删除委外订单
*
* @param outsourceOrderIds 需要删除的委外订单主键
* @return 结果
*/
@Transactional
@Override
public int deleteOutsourceOrderByOutsourceOrderIds(String outsourceOrderIds)
{
outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNos(Convert.toStrArray(outsourceOrderIds));
return outsourceOrderMapper.deleteOutsourceOrderByOutsourceOrderIds(Convert.toStrArray(outsourceOrderIds));
}
/**
* 删除委外订单信息
*
* @param outsourceOrderId 委外订单主键
* @return 结果
*/
@Transactional
@Override
public int deleteOutsourceOrderByOutsourceOrderId(Long outsourceOrderId)
{
outsourceOrderMapper.deleteOutsourceOrderDetailByOutsourceOrderNo(outsourceOrderId);
return outsourceOrderMapper.deleteOutsourceOrderByOutsourceOrderId(outsourceOrderId);
}
/**
* 新增委外订单详情信息
*
* @param outsourceOrder 委外订单对象
*/
public void insertOutsourceOrderDetail(OutsourceOrder outsourceOrder)
{
List<OutsourceOrderDetail> outsourceOrderDetailList = outsourceOrder.getOutsourceOrderDetailList();
String OutsourceOrderNo = outsourceOrder.getOutsourceOrderNo();
if (StringUtils.isNotNull(outsourceOrderDetailList))
{
List<OutsourceOrderDetail> list = new ArrayList<OutsourceOrderDetail>();
for (OutsourceOrderDetail outsourceOrderDetail : outsourceOrderDetailList)
{
outsourceOrderDetail.setOutsourceOrderNo(OutsourceOrderNo);
list.add(outsourceOrderDetail);
}
if (list.size() > 0)
{
outsourceOrderMapper.batchOutsourceOrderDetail(list);
}
}
}
}

248
ruoyi-admin/src/main/resources/mapper/system/OutsourceOrderMapper.xml

@ -0,0 +1,248 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.OutsourceOrderMapper">
<resultMap type="OutsourceOrder" id="OutsourceOrderResult">
<result property="outsourceOrderId" column="outsource_order_id" />
<result property="outsourceOrderNo" column="outsource_order_no" />
<result property="outsourcePlanCode" column="outsource_plan_code" />
<result property="outsourceStaff" column="outsource_staff" />
<result property="supplierAmount" column="supplier_amount" />
<result property="materialAmount" column="material_amount" />
<result property="outsourceMaterialAmount" column="outsource_material_amount" />
<result property="outsourceProcessType" column="outsource_process_type" />
<result property="outsourceProcessAmount" column="outsource_process_amount" />
<result property="outsourceTotalPrice" column="outsource_total_price" />
<result property="outsourceNoPrice" column="outsource_no_price" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="useStatus" column="use_status" />
<result property="receiveStatus" column="receive_status" />
<result property="warehouseStatus" column="warehouse_status" />
<result property="closedStatus" column="closed_status" />
<result property="remitStatus" column="remit_status" />
<result property="auditStatus" column="audit_status" />
<result property="actualMaterialAmount" column="actual_material_amount" />
<result property="actualProcessAmount" column="actual_process_amount" />
<result property="stockNo" column="stock_no" />
<result property="stockName" column="stock_name" />
<result property="receivePerson" column="receive_person" />
<result property="receiveTelephone" column="receive_telephone" />
<result property="receiveAddress" column="receive_address" />
</resultMap>
<resultMap id="OutsourceOrderOutsourceOrderDetailResult" type="OutsourceOrder" extends="OutsourceOrderResult">
<collection property="outsourceOrderDetailList" ofType="OutsourceOrderDetail" column="outsource_order_id" select="selectOutsourceOrderDetailList" />
</resultMap>
<resultMap type="OutsourceOrderDetail" id="OutsourceOrderDetailResult">
<result property="outsourceOrderDetailId" column="outsource_order_detail_id" />
<result property="outsourceOrderNo" column="outsource_order_no" />
<result property="materialNo" column="material_no" />
<result property="outsourceProcessNo" column="outsource_process_no" />
<result property="outsourceProcessName" column="outsource_process_name" />
<result property="chargeUnit" column="charge_unit" />
<result property="singleMaterial" column="single_material" />
<result property="deliveryTime" column="delivery_time" />
<result property="actualOutsourceAmount" column="actual_outsource_amount" />
<result property="materialRmb" column="material_rmb" />
<result property="materialNoRmb" column="material_no_rmb" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="closedStatus" column="closed_status" />
<result property="remitStatus" column="remit_status" />
</resultMap>
<!-- 委外物料-->
<resultMap type="OutsourceMaterial" id="OutsourceMaterialResult">
<result property="outsourceMaterialId" column="outsource_material_id" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="outsourceProcessNo" column="outsource_process_no" />
<result property="outsourceProcessName" column="outsource_process_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="unit" column="unit" />
<result property="description" column="description" />
<result property="brand" column="brand" />
<result property="processMethod" column="process_method" />
<result property="plannedOutsourceAmount" column="planned_outsource_amount" />
</resultMap>
<sql id="selectOutsourceOrderVo">
select outsource_order_id, outsource_order_no, outsource_plan_code, outsource_staff, supplier_amount, material_amount, outsource_material_amount, outsource_process_type, outsource_process_amount, outsource_total_price, outsource_no_price, create_by, create_time, update_by, update_time, use_status, receive_status, warehouse_status, closed_status, remit_status, audit_status, actual_material_amount, actual_process_amount, stock_no, stock_name, receive_person, receive_telephone, receive_address from outsource_order
</sql>
<select id="selectOutsourceOrderList" parameterType="OutsourceOrder" resultMap="OutsourceOrderResult">
<include refid="selectOutsourceOrderVo"/>
<where>
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsource_order_no = #{outsourceOrderNo}</if>
<if test="outsourceStaff != null and outsourceStaff != ''"> and outsource_staff = #{outsourceStaff}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="receiveStatus != null and receiveStatus != ''"> and receive_status = #{receiveStatus}</if>
<if test="warehouseStatus != null and warehouseStatus != ''"> and warehouse_status = #{warehouseStatus}</if>
<if test="closedStatus != null and closedStatus != ''"> and closed_status = #{closedStatus}</if>
<if test="remitStatus != null and remitStatus != ''"> and remit_status = #{remitStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="actualMaterialAmount != null "> and actual_material_amount = #{actualMaterialAmount}</if>
</where>
</select>
<select id="selectOutsourceOrderByOutsourceOrderId" parameterType="Long" resultMap="OutsourceOrderOutsourceOrderDetailResult">
select outsource_order_id, outsource_order_no, outsource_plan_code, outsource_staff, supplier_amount, material_amount, outsource_material_amount, outsource_process_type, outsource_process_amount, outsource_total_price, outsource_no_price, create_by, create_time, update_by, update_time, use_status, receive_status, warehouse_status, closed_status, remit_status, audit_status, actual_material_amount, actual_process_amount, stock_no, stock_name, receive_person, receive_telephone, receive_address
from outsource_order
where outsource_order_id = #{outsourceOrderId}
</select>
<select id="selectOutsourceOrderByOutsourceOrderNo" parameterType="String" resultMap="OutsourceOrderOutsourceOrderDetailResult">
select outsource_order_id, outsource_order_no, outsource_plan_code, outsource_staff, supplier_amount, material_amount, outsource_material_amount, outsource_process_type, outsource_process_amount, outsource_total_price, outsource_no_price, create_by, create_time, update_by, update_time, use_status, receive_status, warehouse_status, closed_status, remit_status, audit_status, actual_material_amount, actual_process_amount, stock_no, stock_name, receive_person, receive_telephone, receive_address
from outsource_order
where outsource_order_no = #{outsourceOrderNo}
</select>
<!-- 按料号查询委外物料-->
<select id="selectMaterialByCode" parameterType="String" resultMap="OutsourceMaterialResult">
select material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name
from outsource_material
where material_no =#{materialNo}
</select>
<select id="selectOutsourceOrderDetailList" resultType="OutsourceOrderDetail" resultMap="OutsourceOrderDetailResult">
select outsource_order_detail_id, outsource_order_no, material_no, outsource_process_no, outsource_process_name, charge_unit, single_material, delivery_time, actual_outsource_amount, material_rmb, material_no_rmb, supplier_code, supplier_name, closed_status, remit_status
from outsource_order_detail
where outsource_order_no = #{outsource_order_no}
</select>
<insert id="insertOutsourceOrder" parameterType="OutsourceOrder" useGeneratedKeys="true" keyProperty="outsourceOrderId">
insert into outsource_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">outsource_order_no,</if>
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code,</if>
<if test="outsourceStaff != null">outsource_staff,</if>
<if test="supplierAmount != null">supplier_amount,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="outsourceMaterialAmount != null">outsource_material_amount,</if>
<if test="outsourceProcessType != null">outsource_process_type,</if>
<if test="outsourceProcessAmount != null">outsource_process_amount,</if>
<if test="outsourceTotalPrice != null">outsource_total_price,</if>
<if test="outsourceNoPrice != null">outsource_no_price,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="useStatus != null">use_status,</if>
<if test="receiveStatus != null">receive_status,</if>
<if test="warehouseStatus != null">warehouse_status,</if>
<if test="closedStatus != null">closed_status,</if>
<if test="remitStatus != null">remit_status,</if>
<if test="auditStatus != null">audit_status,</if>
<if test="actualMaterialAmount != null">actual_material_amount,</if>
<if test="actualProcessAmount != null">actual_process_amount,</if>
<if test="stockNo != null">stock_no,</if>
<if test="stockName != null">stock_name,</if>
<if test="receivePerson != null">receive_person,</if>
<if test="receiveTelephone != null">receive_telephone,</if>
<if test="receiveAddress != null">receive_address,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">#{outsourceOrderNo},</if>
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">#{outsourcePlanCode},</if>
<if test="outsourceStaff != null">#{outsourceStaff},</if>
<if test="supplierAmount != null">#{supplierAmount},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="outsourceMaterialAmount != null">#{outsourceMaterialAmount},</if>
<if test="outsourceProcessType != null">#{outsourceProcessType},</if>
<if test="outsourceProcessAmount != null">#{outsourceProcessAmount},</if>
<if test="outsourceTotalPrice != null">#{outsourceTotalPrice},</if>
<if test="outsourceNoPrice != null">#{outsourceNoPrice},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="receiveStatus != null">#{receiveStatus},</if>
<if test="warehouseStatus != null">#{warehouseStatus},</if>
<if test="closedStatus != null">#{closedStatus},</if>
<if test="remitStatus != null">#{remitStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="actualMaterialAmount != null">#{actualMaterialAmount},</if>
<if test="actualProcessAmount != null">#{actualProcessAmount},</if>
<if test="stockNo != null">#{stockNo},</if>
<if test="stockName != null">#{stockName},</if>
<if test="receivePerson != null">#{receivePerson},</if>
<if test="receiveTelephone != null">#{receiveTelephone},</if>
<if test="receiveAddress != null">#{receiveAddress},</if>
</trim>
</insert>
<update id="updateOutsourceOrder" parameterType="OutsourceOrder">
update outsource_order
<trim prefix="SET" suffixOverrides=",">
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">outsource_order_no = #{outsourceOrderNo},</if>
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code = #{outsourcePlanCode},</if>
<if test="outsourceStaff != null">outsource_staff = #{outsourceStaff},</if>
<if test="supplierAmount != null">supplier_amount = #{supplierAmount},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="outsourceMaterialAmount != null">outsource_material_amount = #{outsourceMaterialAmount},</if>
<if test="outsourceProcessType != null">outsource_process_type = #{outsourceProcessType},</if>
<if test="outsourceProcessAmount != null">outsource_process_amount = #{outsourceProcessAmount},</if>
<if test="outsourceTotalPrice != null">outsource_total_price = #{outsourceTotalPrice},</if>
<if test="outsourceNoPrice != null">outsource_no_price = #{outsourceNoPrice},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="receiveStatus != null">receive_status = #{receiveStatus},</if>
<if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
<if test="closedStatus != null">closed_status = #{closedStatus},</if>
<if test="remitStatus != null">remit_status = #{remitStatus},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="actualMaterialAmount != null">actual_material_amount = #{actualMaterialAmount},</if>
<if test="actualProcessAmount != null">actual_process_amount = #{actualProcessAmount},</if>
<if test="stockNo != null">stock_no = #{stockNo},</if>
<if test="stockName != null">stock_name = #{stockName},</if>
<if test="receivePerson != null">receive_person = #{receivePerson},</if>
<if test="receiveTelephone != null">receive_telephone = #{receiveTelephone},</if>
<if test="receiveAddress != null">receive_address = #{receiveAddress},</if>
</trim>
where outsource_order_id = #{outsourceOrderId}
</update>
<delete id="deleteOutsourceOrderByOutsourceOrderId" parameterType="Long">
delete from outsource_order where outsource_order_id = #{outsourceOrderId}
</delete>
<delete id="deleteOutsourceOrderByOutsourceOrderIds" parameterType="String">
delete from outsource_order where outsource_order_id in
<foreach item="outsourceOrderId" collection="array" open="(" separator="," close=")">
#{outsourceOrderId}
</foreach>
</delete>
<delete id="deleteOutsourceOrderDetailByOutsourceOrderNos" parameterType="String">
delete from outsource_order_detail where outsource_order_no in
<foreach item="outsourceOrderNo" collection="array" open="(" separator="," close=")">
#{outsourceOrderNo}
</foreach>
</delete>
<delete id="deleteOutsourceOrderDetailByOutsourceOrderNo" parameterType="Long">
delete from outsource_order_detail where outsource_order_no = #{outsourceOrderNo}
</delete>
<insert id="batchOutsourceOrderDetail">
insert into outsource_order_detail( outsource_order_detail_id, outsource_order_no, material_no, outsource_process_no, outsource_process_name, charge_unit, single_material, delivery_time, actual_outsource_amount, material_rmb, material_no_rmb, supplier_code, supplier_name, closed_status, remit_status) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.outsourceOrderDetailId}, #{item.outsourceOrderNo}, #{item.materialNo}, #{item.outsourceProcessNo}, #{item.outsourceProcessName}, #{item.chargeUnit}, #{item.singleMaterial}, #{item.deliveryTime}, #{item.actualOutsourceAmount}, #{item.materialRmb}, #{item.materialNoRmb}, #{item.supplierCode}, #{item.supplierName}, #{item.closedStatus}, #{item.remitStatus})
</foreach>
</insert>
</mapper>

334
ruoyi-admin/src/main/resources/templates/system/outsource_order/add.html

@ -0,0 +1,334 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增委外订单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_order-add">
<h4 class="form-header h4">委外订单信息</h4>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外订单编号:</label>
<div class="col-sm-8">
<input name="outsourceOrderNo" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外计划单号:</label>
<div class="col-sm-8">
<input name="outsourcePlanCode" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外员:</label>
<div class="col-sm-8">
<input name="outsourceStaff" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">供应商数:</label>
<div class="col-sm-8">
<input name="supplierAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">物料合计:</label>
<div class="col-sm-8">
<input name="materialAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外物料数量合计:</label>
<div class="col-sm-8">
<input name="outsourceMaterialAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序合计:</label>
<div class="col-sm-8">
<input name="outsourceProcessAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">含税委外总价:</label>
<div class="col-sm-8">
<input name="outsourceTotalPrice" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">不含税委外总价:</label>
<div class="col-sm-8">
<input name="outsourceNoPrice" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">实际委外物料合计:</label>
<div class="col-sm-8">
<input name="actualMaterialAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">实际委外工序合计:</label>
<div class="col-sm-8">
<input name="actualProcessAmount" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">仓库ID:</label>
<div class="col-sm-8">
<input name="stockNo" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">仓库名称:</label>
<div class="col-sm-8">
<input name="stockName" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">收货人:</label>
<div class="col-sm-8">
<input name="receivePerson" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="receiveTelephone" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">详细地址:</label>
<div class="col-sm-8">
<input name="receiveAddress" class="form-control" type="text">
</div>
</div>
</div>
<h4 class="form-header h4">委外订单详情信息</h4>
<div class="row">
<div class="col-xs-12">
<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-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_order"
$("#form-outsource_order-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-outsource_order-add').serialize());
}
}
$(function() {
var options = {
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
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);
}
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialNo' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].outsourceProcessNo' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].outsourceProcessName' value='%s'>", index, value);
return html;
}
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].chargeUnit' value='%s'>", index, value);
return html;
}
},
{
field: 'singleMaterial',
align: 'center',
title: '每个物料规格',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].singleMaterial' value='%s'>", index, value);
return html;
}
},
{
field: 'deliveryTime',
align: 'center',
title: '交付时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].deliveryTime' value='%s'>", index, value);
return html;
}
},
{
field: 'actualOutsourceAmount',
align: 'center',
title: '实际委外数',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].actualOutsourceAmount' value='%s'>", index, value);
return html;
}
},
{
field: 'materialRmb',
align: 'center',
title: '含税委外总价(RMB) ',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialRmb' value='%s'>", index, value);
return html;
}
},
{
field: 'materialNoRmb',
align: 'center',
title: '不含税委外总价(RMB)',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialNoRmb' value='%s'>", index, value);
return html;
}
},
{
field: 'supplierCode',
align: 'center',
title: '供应商编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].supplierCode' value='%s'>", index, value);
return html;
}
},
{
field: 'supplierName',
align: 'center',
title: '供应商名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].supplierName' value='%s'>", index, value);
return html;
}
},
{
field: 'closedStatus',
align: 'center',
title: '结案状态',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].closedStatus' value='%s'>", index, value);
return html;
}
},
{
field: 'remitStatus',
align: 'center',
title: '打款状态',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].remitStatus' value='%s'>", index, value);
return html;
}
},
{
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>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
materialNo: "",
outsourceProcessNo: "",
outsourceProcessName: "",
chargeUnit: "",
singleMaterial: "",
deliveryTime: "",
actualOutsourceAmount: "",
materialRmb: "",
materialNoRmb: "",
supplierCode: "",
supplierName: "",
closedStatus: "",
remitStatus: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

331
ruoyi-admin/src/main/resources/templates/system/outsource_order/addRequisition.html

@ -0,0 +1,331 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('添加委外领料单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-outsourceRequisition-add" >
<div class="container" id="material">
</div>
</form>
<!-- 订单合计-->
<div class="container">
<div class="row"><h4 class="card-header">订单合计:</h4></div>
<div class="form-group">
<label for="materialAmount" class="col-sm-2 col-form-label">物料合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="materialAmount">
</div>
</div>
<div class="form-group">
<label for="outsourceMaterialAmount" class="col-sm-2 col-form-label">委外数量合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceMaterialAmount">
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_requisition";
$("#form-order-outsourceRequisition-add").validate({focusCleanup: true});
var outsourcePlanDetailList = [];
// var chargeUnitDatas = [[${@dict.getType("charge_unit")}]]
// var formId = "form-plan-outsourceOrder-add";
var outsourcePlanCode = '';
var materialList = [];
var tableIdList = [];
var supplierList = [];
var $processContent;
var $supplierheaderContent;
var materials;
var outsourceProcessAmount = 0;
var actualOutsourceAmount = 0;
var outsourceOrderList = [[${outsourceOrderList}]];
var originMaterial = []
$(function() {
// console.log(outsourceOrderList);
originMaterial = outsourceOrderList[0].materials;
// console.log(originMaterial);
// 根据料号去重
materials = mergeRecords(originMaterial);
// console.log(materials);
// 遍历委外计划详情信息
materials.forEach(function (material, index) {
var tableId = 'materialNo-' + (index+1);
// console.log("料号:"+index);
// console.log(tableId);
var materialTable = "bootstrap-table_" + tableId;
tableIdList.push(materialTable);
// 创建物料信息的容器
var $tableWrapper = $('<div id="material-' + tableId + '"></div>');
// 将整个物料信息容器添加到页面
$('#material').append($tableWrapper);
// 添加关联销售订单号信息
var $headerDiv =
$('<div class="row">' +
'<div class="col-xs-12" >' +
'<h3>' +
'<span><strong>物料 ' + (index+1) + ': </strong> ' + '<strong>关联订单号: </strong></span>' + '<span class="correlationCodes" style="color: blue" id="correlationCodes-' + tableId + '"></span>' +
'</h3>' +
'<div class="col-sm-12">' +
'<table class="table-materialNo" id="' + materialTable + '">' + '</table>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($headerDiv);
$(".correlationCodes").text(outsourceOrderList[0].outsourceOrderNo);
$("#materialAmount").val(materials.length);
// console.log(outsourceOrderList[0].outsourceOrderNo);
var materialObj = {
materialNo: material.materialNo,
materialPhotourl: material.materialPhotourl,
materialName: material.materialName,
materialType: material.materialType,
description: material.description,
unit: material.unit,
brand: material.brand,
processMethod: material.processMethod,
correlationCodes: material.correlationCodes,
actualOutsourceAmount: material.orderDetails[0].actualOutsourceAmount,
alreadyRequisitionAmount: 0,
plannedOutsourceAmount: material.plannedOutsourceAmount,
};
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源
materialList.push(material);
tables(materialTable, materialData);
var $MaterialNumDiv =
$('<div class="row">' +
'<div class="form-group">' +
'<div class="col-xs-12">' +
'<h3>' +
'<span><strong>供应商</strong></span>' +
'</h3>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($MaterialNumDiv);
var $processInfo = $('<div class="process-card" style="height: 60px;" id="processInfo-' + tableId + '"></div>');
if(material.orderDetails.length <= 0){
var $noProcessDiv = $('<div class="no-process">暂无委外工序信息,请先添加委外工序信息。</div>');
$tableWrapper.append($noProcessDiv);
}else{
material.orderDetails.forEach(function(detail, detailsIndex) {
// console.log(processIndex);
var processSelectId = 'process-select-' + tableId + '_' + (detailsIndex+1);
var processTableId = 'process-' + tableId + '_' + (detailsIndex+1);
switch (detail.chargeUnit) {
case "0":
detail.unitInfo = "按重量计";
break;
case "1":
detail.unitInfo = "按数量计";
break;
case "2":
detail.unitInfo = "按面积计";
break;
default:;
}
// console.log(detail);
// console.log(processSelectId);
// console.log(process);
$processContent =
$('<div class="card-header process_card" id="process-' + tableId + '_' + (detailsIndex+1) + '">' +
'<div class="row">' +
'<div class="card-text">' +
'<h5>委外工序 ' + (detailsIndex+1) + ':' +
'<span class="processNo">' + detail.outsourceProcessNo + '</span>' + '-' +
'<span class="processName">' + detail.outsourceProcessName + '</span>' +
'</h5>' +
'</div>' +
'<div class="col-sm-2" id="chargeUnit-'+processSelectId+'">' +
'<span class="chargeUnit">*计价单位:</span>' + '-' +
'<span class="">' + detail.unitInfo + '</span>' +
'<span class="singleMaterial">每个物料:</span>' +
'<span class="singleMaterialInfo">' + detail.singleMaterial + '</span>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($processContent);
$supplierheaderContent =
$('<div class="card-header suppplier_card" id = "supplier-' + processTableId + '_' + ' ">' +
'<div class="row">' +
'<div class="card-text">' +
'<input type="radio" id="supplier-' + processTableId + '_' + '" name="supplier-' + processTableId + '" value="">' +
'<span class="supplierCode">' + detail.supplierCode + '</span>' + '-' +
'<span class="supplierName">' + detail.supplierName + '</span>' +
'-最新不含税采购价: ' + '<span id="materialNormb-' + processTableId + '" class="materialNormb">' + detail.materialNoRmb + '</span>' +
' RMB 最新含税采购价: ' + '<span id="materialRmb-' + processTableId + '" class="materialRmb">' + detail.materialRmb + '</span> RMB ' +
// '<span class="supplierPurchasePlanCode" hidden="hidden" >' + material.planCodes + '</span>' +
// '<span class="supplierCorrelationCode" hidden="hidden" >' + material.correlationCodes + '</span>' +
// '<span class="supplierPurchaseQuoteCode" hidden="hidden" >' + supplier.purchaseQuoteCode + '</span>' +
'<div class="form-row deliveryTime-'+processTableId+'" >' +
'<label class="col-sm-2">计划交付时间: </label>' +
'<div class ="col-sm-4">' +
'<div class="input-group date"> ' +
'<input type="text" name="deliveryTime" value="' + detail.deliveryTime + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + processTableId + '">' +
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' +
'<hr style="border: none; height: 1px; background-color: #ccc;">' +
'</div>' +
'</div>' +
'</div>'+
'</div>' +
'</div>' +
'</div>');
$("#"+processTableId).append($supplierheaderContent);
});
}
// tableSetup($processInfo, tableId);
});
});
function tables(tableId, data) {
$('#' + tableId).bootstrapTable({
showExport: false,
showFooter: false,
showSearch: false,
showRefresh: false,
showColumns: false,
showToggle: false,
data: data,
columns: [
{checkbox: false},
{title: '料号', field: 'materialNo'},
{title: '图片', field: 'materialPhotourl', formatter: function (value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料名称', field: 'materialName'},
{title: '物料描述', field: 'description'},
{title: '品牌', field: 'brand'},
{title: '单位', field: 'unit', align: 'center', },
{title: '加工方式', field: 'processMethod', align: 'center',},
{title: '计划委外数', field: 'plannedOutsourceAmount'},
{title: '实际委外数', field: 'actualOutsourceAmount'},
{title: '已委外领料数', field: 'alreadyOutsourceAmount'},
{title: '本次领料数', field: 'nowRequisitionAmount',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='number' name='nowRequisitionAmount' id = 'nowRequisitionAmount_"+tableId+"'>", index, value);
return html;
}
},
],
});
}
// 函数用于合并重复的material的记录
function mergeRecords(items) {
return items.reduce((merged, current) => {
const existingRecord = merged.find(record => record.materialNo === current.materialNo);
if (existingRecord) {
// console.log(existingRecord);
// 合并字段及委外订单详情列表
if (!existingRecord.orderDetails) {
existingRecord.orderDetails = [];
}
existingRecord.orderDetails = current.orderDetails;
} else {
// console.log(current);
// 如果是第一次遇到这个materialNo,创建一个新的记录
merged.push({
materialNo: current.materialNo,
materialPhotourl: current.materialPhotourl,
materialName: current.materialName,
materialType: current.materialType,
description: current.description,
unit: current.unit,
brand: current.brand,
processMethod: current.processMethod,
// correlationCodes: current.correlationCodes,
plannedOutsourceAmount: current.plannedOutsourceAmount,
orderDetails: current.orderDetails
});
}
return merged;
}, []);
};
// 保存信息 刷新表格
function saveJson(url, data, callback) {
var config = {
url: url,
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: data,
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
$.operate.successCallback(result);
}
};
$.ajax(config)
};
function submitHandler() {
var outsourceRequisition = {
outsourceOrderNo: outsourceOrderList[0].outsourceOrderNo,
materialAmount: materials.length,
totalAmount: 0,
outsourceRequisitionDetailList:[]
};
if ($.validate.form()) {
let requisitionSum = 0;
var requisitionDetail;
$('.table-materialNo').each(function(index, tableElement) {
var tableId = tableIdList[index];
let materialObj = materialList[index];
if (typeof materialObj === 'undefined') return;
var rows = $("#" + tableId).bootstrapTable('getData').length;
for(var i = 0;i < rows;i++){
var data = $("#" + tableId).bootstrapTable('getData')[i];
// console.log(data.nowRequisitionAmount);
// console.log($('[id^="nowRequisitionAmount_' + tableId + '"]').val());
let value = Number($('[id^="nowRequisitionAmount_' + tableId + '"]').val());
if (!isNaN(value)) {
requisitionSum += value;
}
requisitionDetail = {
materialNo: data.materialNo,
// takenMaterial: (data.alreadyOutsourceAmount==='undefined'?0:data.alreadyOutsourceAmount),
takenMaterial:0,
takingMaterial: $('[id^="nowRequisitionAmount_' + tableId + '"]').val(),
};
}
outsourceRequisition.totalAmount += requisitionSum;
outsourceRequisition.outsourceRequisitionDetailList.push(requisitionDetail);
console.log(outsourceRequisition)
});
};
// 发送数据到后端API
saveJson(prefix + "/addRequisition",JSON.stringify(outsourceRequisition));
}
</script>
</body>
</html>

333
ruoyi-admin/src/main/resources/templates/system/outsource_order/addStorage.html

@ -0,0 +1,333 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('添加委外入库单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-outsourceStorage-add" >
<div class="container" id="material">
</div>
</form>
<!-- 订单合计-->
<div class="container">
<div class="row"><h4 class="card-header">订单合计:</h4></div>
<div class="form-group">
<label for="materialAmount" class="col-sm-2 col-form-label">物料合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="materialAmount">
</div>
</div>
<div class="form-group">
<label for="outsourceMaterialAmount" class="col-sm-2 col-form-label">委外数量合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceMaterialAmount">
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "system/storage";
$("#form-order-outsourceStorage-add").validate({focusCleanup: true});
var outsourcePlanDetailList = [];
// var chargeUnitDatas = [[${@dict.getType("charge_unit")}]]
var formId = "form-plan-outsourceOrder-add";
var outsourcePlanCode = '';
var materialList = [];
var tableIdList = [];
var supplierList = [];
var $processContent;
var $supplierheaderContent;
var materials;
var outsourceProcessAmount = 0;
var actualOutsourceAmount = 0;
var outsourceOrderList = [[${outsourceOrderList}]];
var originMaterial = []
$(function() {
originMaterial = outsourceOrderList[0].materials;
// 根据料号去重
materials = mergeRecords(originMaterial);
// 遍历委外计划详情信息
materials.forEach(function (material, index) {
var tableId = 'materialNo-' + (index+1);
var materialTable = "bootstrap-table_" + tableId;
tableIdList.push(materialTable);
// 创建物料信息的容器
var $tableWrapper = $('<div id="material-' + tableId + '"></div>');
// 将整个物料信息容器添加到页面
$('#material').append($tableWrapper);
// 添加关联销售订单号信息
var $headerDiv =
$('<div class="row">' +
'<div class="col-xs-12" >' +
'<h3>' +
'<span><strong>物料 ' + (index+1) + ': </strong> ' + '<strong>关联订单号: </strong></span>' + '<span class="correlationCodes" style="color: blue" id="correlationCodes-' + tableId + '"></span>' +
'</h3>' +
'<div class="col-sm-12">' +
'<table class="table-materialNo" id="' + materialTable + '">' + '</table>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($headerDiv);
$(".correlationCodes").text(outsourceOrderList[0].outsourceOrderNo);
$("#materialAmount").val(materials.length);
var materialObj = {
materialNo: material.materialNo,
materialPhotourl: material.materialPhotourl,
materialName: material.materialName,
materialType: material.materialType,
description: material.description,
unit: material.unit,
brand: material.brand,
processMethod: material.processMethod,
correlationCodes: material.correlationCodes,
plannedOutsourceAmount: material.plannedOutsourceAmount,
actualOutsourceAmount: material.orderDetails[0].actualOutsourceAmount,
alreadyStorageAmount: 0,
nowStorageAmount: 0,
};
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源
materialList.push(material);
tables(materialTable, materialData);
var $MaterialNumDiv =
$('<div class="row">' +
'<div class="form-group">' +
'<div class="col-xs-12">' +
'<h3>' +
'<span><strong>供应商</strong></span>' +
'</h3>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($MaterialNumDiv);
var $processInfo = $('<div class="process-card" style="height: 60px;" id="processInfo-' + tableId + '"></div>');
if(material.orderDetails.length <= 0){
var $noProcessDiv = $('<div class="no-process">暂无委外工序信息,请先添加委外工序信息。</div>');
$tableWrapper.append($noProcessDiv);
}else{
material.orderDetails.forEach(function(detail, detailsIndex) {
// console.log(processIndex);
var processSelectId = 'process-select-' + tableId + '_' + (detailsIndex+1);
var processTableId = 'process-' + tableId + '_' + (detailsIndex+1);
switch (detail.chargeUnit) {
case "0":
detail.unitInfo = "按重量计";
break;
case "1":
detail.unitInfo = "按数量计";
break;
case "2":
detail.unitInfo = "按面积计";
break;
default:;
}
$processContent =
$('<div class="card-header process_card" id="process-' + tableId + '_' + (detailsIndex+1) + '">' +
'<div class="row">' +
'<div class="card-text">' +
'<h5>委外工序 ' + (detailsIndex+1) + ':' +
'<span class="processNo">' + detail.outsourceProcessNo + '</span>' + '-' +
'<span class="processName">' + detail.outsourceProcessName + '</span>' +
'</h5>' +
'</div>' +
'<div class="col-sm-2" id="chargeUnit-'+processSelectId+'">' +
'<span class="chargeUnit">*计价单位:</span>' + '-' +
'<span class="">' + detail.unitInfo + '</span>' +
'<span class="singleMaterial">每个物料:</span>' +
'<span class="singleMaterialInfo">' + detail.singleMaterial + '</span>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($processContent);
$supplierheaderContent =
$('<div class="card-header suppplier_card" id = "supplier-' + processTableId + '_' + ' ">' +
'<div class="row">' +
'<div class="card-text">' +
'<input type="radio" id="supplier-' + processTableId + '_' + '" name="supplier-' + processTableId + '" value="">' +
'<span class="supplierCode">' + detail.supplierCode + '</span>' + '-' +
'<span class="supplierName">' + detail.supplierName + '</span>' +
'-最新不含税采购价: ' + '<span id="materialNormb-' + processTableId + '" class="materialNormb">' + detail.materialNoRmb + '</span>' +
' RMB 最新含税采购价: ' + '<span id="materialRmb-' + processTableId + '" class="materialRmb">' + detail.materialRmb + '</span> RMB ' +
// '<span class="supplierPurchasePlanCode" hidden="hidden" >' + material.planCodes + '</span>' +
// '<span class="supplierCorrelationCode" hidden="hidden" >' + material.correlationCodes + '</span>' +
// '<span class="supplierPurchaseQuoteCode" hidden="hidden" >' + supplier.purchaseQuoteCode + '</span>' +
'<div class="form-row deliveryTime-'+processTableId+'" >' +
'<label class="col-sm-2">计划交付时间: </label>' +
'<div class ="col-sm-4">' +
'<div class="input-group date"> ' +
'<input type="text" name="deliveryTime" value="' + detail.deliveryTime + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + processTableId + '">' +
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' +
'<hr style="border: none; height: 1px; background-color: #ccc;">' +
'</div>' +
'</div>' +
'</div>'+
'</div>' +
'</div>' +
'</div>');
$("#"+processTableId).append($supplierheaderContent);
});
}
// tableSetup($processInfo, tableId);
});
});
function tables(tableId, data) {
$('#' + tableId).bootstrapTable({
showExport: false,
showFooter: false,
showSearch: false,
showRefresh: false,
showColumns: false,
showToggle: false,
data: data,
columns: [
{checkbox: false},
{title: '料号', field: 'materialNo'},
{title: '图片', field: 'materialPhotourl', formatter: function (value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料名称', field: 'materialName'},
{title: '物料描述', field: 'description'},
{title: '品牌', field: 'brand'},
{title: '单位', field: 'unit', align: 'center', },
{title: '加工方式', field: 'processMethod', align: 'center',},
{title: '计划委外数', field: 'plannedOutsourceAmount'},
{title: '已入库数', field: 'alreadyStorageAmount'},
{title: '本次入库数', field: 'nowStorageAmount',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='nowStorageAmount' value='' id='nowStorageAmount_"+tableId+"'>", index, value);
return html;
}
},
],
});
}
// 函数用于合并重复的material的记录
function mergeRecords(items) {
return items.reduce((merged, current) => {
const existingRecord = merged.find(record => record.materialNo === current.materialNo);
if (existingRecord) {
// console.log(existingRecord);
// 合并字段及委外订单详情列表
if (!existingRecord.orderDetails) {
existingRecord.orderDetails = [];
}
existingRecord.orderDetails = current.orderDetails;
} else {
console.log(current);
// 如果是第一次遇到这个materialNo,创建一个新的记录
merged.push({
materialNo: current.materialNo,
materialPhotourl: current.materialPhotourl,
materialName: current.materialName,
materialType: current.materialType,
description: current.description,
unit: current.unit,
brand: current.brand,
processMethod: current.processMethod,
// correlationCodes: current.correlationCodes,
plannedOutsourceAmount: current.plannedOutsourceAmount,
orderDetails: current.orderDetails
});
}
return merged;
}, []);
};
// 保存信息 刷新表格
function saveJson(url, data, callback) {
var config = {
url: url,
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: data,
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
$.operate.successCallback(result);
}
};
$.ajax(config)
};
function submitHandler() {
var outsourceStorage = {
relatedOrderCode: outsourceOrderList[0].outsourceOrderNo,
materialAmount: materials.length,
storageNum: 0,
warehouseStorageOrderDetailList:[]
};
if ($.validate.form()) {
let storageSum = 0;
var storageDetail;
$('.table-materialNo').each(function(index, tableElement) {
var tableId = tableIdList[index];
let materialObj = materialList[index];
if (typeof materialObj === 'undefined') return;
var rows = $("#" + tableId).bootstrapTable('getData').length;
console.log(rows);
for(var i = 0;i < rows;i++){
var data = $("#" + tableId).bootstrapTable('getData')[i];
// console.log(data.nowRequisitionAmount);
// console.log($('[id^="nowRequisitionAmount_' + tableId + '"]').val());
let value = Number($('[id^="nowStorageAmount_' + tableId + '"]').val());
if (!isNaN(value)) {
storageSum += value;
}
storageDetail = {
relatedOrderCode: outsourceOrderList[0].outsourceOrderNo,
materialNo: data.materialNo,
materialName: data.materialName,
materialPhotourl: data.materialPhotoUrl,
materialBrand: data.brand,
materialUnit: data.unit,
materialDescribe: data.description,
materialProcessMethod: data.processMethod,
// takenMaterial: (data.alreadyOutsourceAmount==='undefined'?0:data.alreadyOutsourceAmount),
takenMaterial:0,
takingMaterial: $('[id^="nowStorageAmount_' + tableId + '"]').val(),
};
console.log(storageDetail);
}
outsourceStorage.storageNum += storageSum;
outsourceStorage.warehouseStorageOrderDetailList.push(storageDetail);
});
console.log(outsourceStorage);
};
// 发送数据到后端API
saveJson(prefix + "/addStorage",JSON.stringify(outsourceStorage));
}
</script>
</body>
</html>

62
ruoyi-admin/src/main/resources/templates/system/outsource_order/closed.html

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('结案')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_order_closed" th:object="${outsourceOrder}">
<input name="outsourceOrderId" th:field="*{outsourceOrderId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外单号:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceOrder.outsourceOrderCode}"></div>
</div>
</div>
</div>
<h5>已选择供应商:</h5>
<div class="col-sm-12 table-striped">
<table id="bootstrap-table"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_order";
$("#form-outsource_process-edit").validate({
focusCleanup: true,
});
$(function() {
var options = {
data: [[${outsourceOrder.outsourceOrderDetailList}]],
columns: [
{
field: 'supplierCode',
title: '供应商编码',
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'remitStatus',
title: '打款状态'
}
]
};
$.table.init(options);
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/closed", $('#form-outsource_order_closed').serialize());
}
}
</script>
</body>
</html>

10
ruoyi-admin/src/main/resources/templates/system/outsource_order/detail.html

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

349
ruoyi-admin/src/main/resources/templates/system/outsource_order/edit.html

@ -0,0 +1,349 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改委外订单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-outsource_order-edit" th:object="${outsourceOrder}">
<h4 class="form-header h4">委外订单信息</h4>
<input name="outsourceOrderId" th:field="*{outsourceOrderId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外订单编号:</label>
<div class="col-sm-8">
<input name="outsourceOrderNo" th:field="*{outsourceOrderNo}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外计划单号:</label>
<div class="col-sm-8">
<input name="outsourcePlanCode" th:field="*{outsourcePlanCode}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外员:</label>
<div class="col-sm-8">
<input name="outsourceStaff" th:field="*{outsourceStaff}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">供应商数:</label>
<div class="col-sm-8">
<input name="supplierAmount" th:field="*{supplierAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">物料合计:</label>
<div class="col-sm-8">
<input name="materialAmount" th:field="*{materialAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外物料数量合计:</label>
<div class="col-sm-8">
<input name="outsourceMaterialAmount" th:field="*{outsourceMaterialAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序合计:</label>
<div class="col-sm-8">
<input name="outsourceProcessAmount" th:field="*{outsourceProcessAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">含税委外总价:</label>
<div class="col-sm-8">
<input name="outsourceTotalPrice" th:field="*{outsourceTotalPrice}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">不含税委外总价:</label>
<div class="col-sm-8">
<input name="outsourceNoPrice" th:field="*{outsourceNoPrice}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">实际委外物料合计:</label>
<div class="col-sm-8">
<input name="actualMaterialAmount" th:field="*{actualMaterialAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">实际委外工序合计:</label>
<div class="col-sm-8">
<input name="actualProcessAmount" th:field="*{actualProcessAmount}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">仓库ID:</label>
<div class="col-sm-8">
<input name="stockNo" th:field="*{stockNo}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">仓库名称:</label>
<div class="col-sm-8">
<input name="stockName" th:field="*{stockName}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">收货人:</label>
<div class="col-sm-8">
<input name="receivePerson" th:field="*{receivePerson}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="receiveTelephone" th:field="*{receiveTelephone}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">详细地址:</label>
<div class="col-sm-8">
<input name="receiveAddress" th:field="*{receiveAddress}" class="form-control" type="text">
</div>
</div>
</div>
<h4 class="form-header h4">委外订单详情信息</h4>
<div class="row">
<div class="col-sm-12">
<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-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_order";
$("#form-outsource_order-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-outsource_order-edit').serialize());
}
}
$(function() {
var options = {
data: [[${outsourceOrder.outsourceOrderDetailList}]],
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
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);
}
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialNo' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessNo',
align: 'center',
title: '委外工序编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].outsourceProcessNo' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessName',
align: 'center',
title: '委外工序名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].outsourceProcessName' value='%s'>", index, value);
return html;
}
},
{
field: 'chargeUnit',
align: 'center',
title: '计价单位',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].chargeUnit' value='%s'>", index, value);
return html;
}
},
{
field: 'singleMaterial',
align: 'center',
title: '每个物料规格',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].singleMaterial' value='%s'>", index, value);
return html;
}
},
{
field: 'deliveryTime',
align: 'center',
title: '交付时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].deliveryTime' value='%s'>", index, value);
return html;
}
},
{
field: 'actualOutsourceAmount',
align: 'center',
title: '实际委外数',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].actualOutsourceAmount' value='%s'>", index, value);
return html;
}
},
{
field: 'materialRmb',
align: 'center',
title: '含税委外总价(RMB) ',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialRmb' value='%s'>", index, value);
return html;
}
},
{
field: 'materialNoRmb',
align: 'center',
title: '不含税委外总价(RMB)',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].materialNoRmb' value='%s'>", index, value);
return html;
}
},
{
field: 'supplierCode',
align: 'center',
title: '供应商编号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].supplierCode' value='%s'>", index, value);
return html;
}
},
{
field: 'supplierName',
align: 'center',
title: '供应商名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].supplierName' value='%s'>", index, value);
return html;
}
},
{
field: 'closedStatus',
align: 'center',
title: '结案状态',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].closedStatus' value='%s'>", index, value);
return html;
}
},
{
field: 'remitStatus',
align: 'center',
title: '打款状态',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourceOrderDetailList[%s].remitStatus' value='%s'>", index, value);
return html;
}
},
{
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>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
materialNo: "",
outsourceProcessNo: "",
outsourceProcessName: "",
chargeUnit: "",
singleMaterial: "",
deliveryTime: "",
actualOutsourceAmount: "",
materialRmb: "",
materialNoRmb: "",
supplierCode: "",
supplierName: "",
closedStatus: "",
remitStatus: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

276
ruoyi-admin/src/main/resources/templates/system/outsource_order/outsource_order.html

@ -0,0 +1,276 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('委外订单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>委外订单编号:</label>
<input type="text" name="outsourceOrderNo"/>
</li>
<li>
<label>委外员:</label>
<input type="text" name="outsourceStaff"/>
</li>
<li>
<label>录入人:</label>
<input type="text" name="createBy"/>
</li>
<li>
<label>录入时间:</label>
<input type="text" class="time-input" placeholder="请选择录入时间" name="createTime"/>
</li>
<li>
<label>实际委外物料合计:</label>
<input type="text" name="actualMaterialAmount"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:outsource_order:add">
<i class="fa fa-plus"></i> 导入合同
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:outsource_order:export">
<i class="fa fa-download"></i> 导出合同
</a>
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:outsource_order:add">
<i class="fa fa-plus"></i> 结案
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:outsource_order:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:outsource_order:remove')}]];
var detailFlag = [[${@permission.hasPermi('system:outsource_order:detail')}]];
var auditStatusDatas = [[${@dict.getType('audit_status')}]];
var useStatusDatas = [[${@dict.getType('use_status')}]];
var receiveStatusDatas = [[${@dict.getType('receive_status')}]];
var remitStatusDatas = [[${@dict.getType('remit_status')}]];
var closedStatusDatas = [[${@dict.getType('closed_status')}]];
var prefix = ctx + "system/outsource_order";
function addRequisition(outsourceOrderNo) {
// var selections = $("#bootstrap-table").bootstrapTable("getSelections");
// if(selections.length === 0){
// $.modal.alertWarning("请选择委外订单");
// return;
// }else{
// outsourceOrderNos=selections[0].outsourceOrderNo;
// if(selections.length > 1 ){
// //·拼接采购计划单号
// for(let i=0;i<selections.length;i++){
// if(i === selections.length - 1){
// outsourcePlanCodes += selections[i].outsourceOrderNo ;
// }else{
// outsourcePlanCodes += selections[i].outsourceOrderNo + ",";
// }
// }
// }else if(selections.length === 1){
// outsourcePlanCodes = selections[0].outsourceOrderNo;
// }
// }
console.log(outsourceOrderNo);
$.modal.open("新增委外领料单", prefix + "/addRequisition/" + outsourceOrderNo);
}
function addStorage(outsourceOrderNo){
$.modal.open("新增委外入库单", prefix + "/addStorage/" + outsourceOrderNo)
}
$(function() {
function addRequisition(outsourceOrderNo) {
$.modal.open("新增委外领料单", prefix + "/addRequisition/" + outsourceOrderNo);
}
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "委外订单",
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
columns: [{
checkbox: true
},
{
field: 'outsourceOrderId',
title: '委外订单表id',
visible: false
},
{
field: 'auditStatus',
title: '审核状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
field: 'useStatus',
title: '使用状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
field: 'receiveStatus',
title: '收货状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(receiveStatusDatas, value);
}
},
{
field: 'remitStatus',
title: '打款状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(remitStatusDatas, value);
}
},
{
field: 'closedStatus',
title: '结案状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(closedStatusDatas, value);
}
},
{
field: 'outsourceOrderNo',
title: '委外订单编号'
},
{
field: 'outsourceStaff',
title: '委外员'
},
{
field: 'materialAmount',
title: '物料合计'
},
{
field: 'outsourceMaterialAmount',
title: '委外物料数量合计'
},
{
field: 'outsourceProcessType',
title: '委外工序种类'
},
{
field: 'outsourceProcessAmount',
title: '委外工序合计'
},
{
field: 'actualMaterialAmount',
title: '物料合计'
},
{
field: 'actualProcessAmount',
title: '委外工序合计'
},
{
field: 'outsourceTotalPrice',
title: '含税委外总价'
},
{
field: 'outsourceNoPrice',
title: '不含税委外总价'
},
{
field: 'createTime',
title: '录入时间'
},
{
field: 'updateTime',
title: '上次更新时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outsourceOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs" onclick="addRequisition(\''+row.outsourceOrderNo+'\')"><i class="fa fa-edit"></i>委外领料</a> ');
actions.push('<a class="btn btn-warning btn-xs" onclick="addStorage(\''+row.outsourceOrderNo+'\')"><i class="fa fa-edit"></i>入库通知</a> ');
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.outsourceOrderId + '\')"><i class="fa fa-detail"></i>详情</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
initChildTable = function(index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childTable).bootstrapTable({
url: prefix + "/sublist?outsourceOrderId="+row.outsourceOrderId,
method: 'get',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
// userName: '测试8'
},
columns: [
{
field : 'supplierCode',
title : '供应商ID',
align: 'center',
},
{
field : 'supplierName',
title : '供应商名称',
align: 'center',
},
{
field : 'materialAmount',
title : '数量合计'
},
{
field : 'outsourceProcessType',
title : '委外工序种类'
},
{
field : 'outsourceProcessAmount',
title : '委外工序合计'
},
{
field : 'materialNoRmb',
title : '不含税委外总价'
},
{
field : 'materialRmb',
title : '含税委外总价'
},
{
field: 'remitStatus',
title: '打款状态'
},
{
field: 'closedStatus',
title: '结案状态'
},
]
});
};
</script>
</body>
</html>
Loading…
Cancel
Save