生产任务管理初始化
This commit is contained in:
parent
32530c083a
commit
806b3314cd
|
|
@ -0,0 +1,126 @@
|
|||
package com.ruoyi.busi.controller;
|
||||
|
||||
import java.util.List;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.busi.domain.BusiTask;
|
||||
import com.ruoyi.busi.service.IBusiTaskService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产任务Controller
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/busi/task")
|
||||
public class BusiTaskController extends BaseController
|
||||
{
|
||||
private String prefix = "busi/task";
|
||||
|
||||
@Autowired
|
||||
private IBusiTaskService busiTaskService;
|
||||
|
||||
@RequiresPermissions("busi:task:view")
|
||||
@GetMapping()
|
||||
public String task()
|
||||
{
|
||||
return prefix + "/task";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产任务列表
|
||||
*/
|
||||
@RequiresPermissions("busi:task:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BusiTask busiTask)
|
||||
{
|
||||
startPage();
|
||||
List<BusiTask> list = busiTaskService.selectBusiTaskList(busiTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产任务列表
|
||||
*/
|
||||
@RequiresPermissions("busi:task:export")
|
||||
@Log(title = "生产任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BusiTask busiTask)
|
||||
{
|
||||
List<BusiTask> list = busiTaskService.selectBusiTaskList(busiTask);
|
||||
ExcelUtil<BusiTask> util = new ExcelUtil<BusiTask>(BusiTask.class);
|
||||
return util.exportExcel(list, "生产任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产任务
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存生产任务
|
||||
*/
|
||||
@RequiresPermissions("busi:task:add")
|
||||
@Log(title = "生产任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BusiTask busiTask)
|
||||
{
|
||||
return toAjax(busiTaskService.insertBusiTask(busiTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产任务
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
BusiTask busiTask = busiTaskService.selectBusiTaskById(id);
|
||||
mmap.put("busiTask", busiTask);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存生产任务
|
||||
*/
|
||||
@RequiresPermissions("busi:task:edit")
|
||||
@Log(title = "生产任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BusiTask busiTask)
|
||||
{
|
||||
return toAjax(busiTaskService.updateBusiTask(busiTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产任务
|
||||
*/
|
||||
@RequiresPermissions("busi:task:remove")
|
||||
@Log(title = "生产任务", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(busiTaskService.deleteBusiTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.ruoyi.busi.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品子任务对象 busi_sub_task
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
public class BusiSubTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
private String taskId;
|
||||
|
||||
/** 产品需求ID */
|
||||
@Excel(name = "产品需求ID")
|
||||
private String productRequireId;
|
||||
|
||||
/** 目标数量 */
|
||||
@Excel(name = "目标数量")
|
||||
private Long targetAmount;
|
||||
|
||||
/** 完成数量 */
|
||||
@Excel(name = "完成数量")
|
||||
private Long completedAmount;
|
||||
|
||||
/** 完成状态 */
|
||||
@Excel(name = "完成状态")
|
||||
private String status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskId(String taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setProductRequireId(String productRequireId)
|
||||
{
|
||||
this.productRequireId = productRequireId;
|
||||
}
|
||||
|
||||
public String getProductRequireId()
|
||||
{
|
||||
return productRequireId;
|
||||
}
|
||||
public void setTargetAmount(Long targetAmount)
|
||||
{
|
||||
this.targetAmount = targetAmount;
|
||||
}
|
||||
|
||||
public Long getTargetAmount()
|
||||
{
|
||||
return targetAmount;
|
||||
}
|
||||
public void setCompletedAmount(Long completedAmount)
|
||||
{
|
||||
this.completedAmount = completedAmount;
|
||||
}
|
||||
|
||||
public Long getCompletedAmount()
|
||||
{
|
||||
return completedAmount;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("productRequireId", getProductRequireId())
|
||||
.append("targetAmount", getTargetAmount())
|
||||
.append("completedAmount", getCompletedAmount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
package com.ruoyi.busi.domain;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 生产任务对象 busi_task
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
public class BusiTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private String id;
|
||||
|
||||
/** 订单ID */
|
||||
private String orderId;
|
||||
|
||||
/** 订单名称 */
|
||||
@Excel(name = "订单名称")
|
||||
private String orderName;
|
||||
|
||||
/** 产线ID */
|
||||
private String prisonLineId;
|
||||
|
||||
/** 产线名称 */
|
||||
@Excel(name = "产线名称")
|
||||
private String lineName;
|
||||
|
||||
/** 任务名称 */
|
||||
@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
/** 目标值 */
|
||||
@Excel(name = "目标值")
|
||||
private Long targetAmount;
|
||||
|
||||
/** 完成值 */
|
||||
@Excel(name = "完成值")
|
||||
private Long completedAmount;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private String status;
|
||||
|
||||
/** 产品子任务信息 */
|
||||
private List<BusiSubTask> busiSubTaskList;
|
||||
|
||||
public String getOrderName() {
|
||||
return orderName;
|
||||
}
|
||||
|
||||
public void setOrderName(String orderName) {
|
||||
this.orderName = orderName;
|
||||
}
|
||||
|
||||
public String getLineName() {
|
||||
return lineName;
|
||||
}
|
||||
|
||||
public void setLineName(String lineName) {
|
||||
this.lineName = lineName;
|
||||
}
|
||||
|
||||
public Long getTargetAmount() {
|
||||
return targetAmount;
|
||||
}
|
||||
|
||||
public void setTargetAmount(Long targetAmount) {
|
||||
this.targetAmount = targetAmount;
|
||||
}
|
||||
|
||||
public Long getCompletedAmount() {
|
||||
return completedAmount;
|
||||
}
|
||||
|
||||
public void setCompletedAmount(Long completedAmount) {
|
||||
this.completedAmount = completedAmount;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(String orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setPrisonLineId(String prisonLineId)
|
||||
{
|
||||
this.prisonLineId = prisonLineId;
|
||||
}
|
||||
|
||||
public String getPrisonLineId()
|
||||
{
|
||||
return prisonLineId;
|
||||
}
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public List<BusiSubTask> getBusiSubTaskList()
|
||||
{
|
||||
return busiSubTaskList;
|
||||
}
|
||||
|
||||
public void setBusiSubTaskList(List<BusiSubTask> busiSubTaskList)
|
||||
{
|
||||
this.busiSubTaskList = busiSubTaskList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("prisonLineId", getPrisonLineId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("status", getStatus())
|
||||
.append("busiSubTaskList", getBusiSubTaskList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.busi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiTask;
|
||||
import com.ruoyi.busi.domain.BusiSubTask;
|
||||
|
||||
/**
|
||||
* 生产任务Mapper接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
public interface BusiTaskMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产任务
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 生产任务
|
||||
*/
|
||||
public BusiTask selectBusiTaskById(String id);
|
||||
|
||||
/**
|
||||
* 查询生产任务列表
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 生产任务集合
|
||||
*/
|
||||
public List<BusiTask> selectBusiTaskList(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 新增生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiTask(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 修改生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiTask(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 删除生产任务
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiTaskById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除生产任务
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiTaskByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除产品子任务
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskByTaskIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增产品子任务
|
||||
*
|
||||
* @param busiSubTaskList 产品子任务列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchBusiSubTask(List<BusiSubTask> busiSubTaskList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过生产任务主键删除产品子任务信息
|
||||
*
|
||||
* @param id 生产任务ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskByTaskId(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiTask;
|
||||
|
||||
/**
|
||||
* 生产任务Service接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
public interface IBusiTaskService
|
||||
{
|
||||
/**
|
||||
* 查询生产任务
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 生产任务
|
||||
*/
|
||||
public BusiTask selectBusiTaskById(String id);
|
||||
|
||||
/**
|
||||
* 查询生产任务列表
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 生产任务集合
|
||||
*/
|
||||
public List<BusiTask> selectBusiTaskList(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 新增生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiTask(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 修改生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiTask(BusiTask busiTask);
|
||||
|
||||
/**
|
||||
* 批量删除生产任务
|
||||
*
|
||||
* @param ids 需要删除的生产任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiTaskByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除生产任务信息
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiTaskById(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
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.busi.domain.BusiSubTask;
|
||||
import com.ruoyi.busi.mapper.BusiTaskMapper;
|
||||
import com.ruoyi.busi.domain.BusiTask;
|
||||
import com.ruoyi.busi.service.IBusiTaskService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 生产任务Service业务层处理
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
*/
|
||||
@Service
|
||||
public class BusiTaskServiceImpl implements IBusiTaskService
|
||||
{
|
||||
@Autowired
|
||||
private BusiTaskMapper busiTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询生产任务
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 生产任务
|
||||
*/
|
||||
@Override
|
||||
public BusiTask selectBusiTaskById(String id)
|
||||
{
|
||||
return busiTaskMapper.selectBusiTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产任务列表
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 生产任务
|
||||
*/
|
||||
@Override
|
||||
public List<BusiTask> selectBusiTaskList(BusiTask busiTask)
|
||||
{
|
||||
return busiTaskMapper.selectBusiTaskList(busiTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertBusiTask(BusiTask busiTask)
|
||||
{
|
||||
busiTask.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = busiTaskMapper.insertBusiTask(busiTask);
|
||||
insertBusiSubTask(busiTask);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产任务
|
||||
*
|
||||
* @param busiTask 生产任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateBusiTask(BusiTask busiTask)
|
||||
{
|
||||
busiTask.setUpdateTime(DateUtils.getNowDate());
|
||||
busiTaskMapper.deleteBusiSubTaskByTaskId(busiTask.getId());
|
||||
insertBusiSubTask(busiTask);
|
||||
return busiTaskMapper.updateBusiTask(busiTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产任务
|
||||
*
|
||||
* @param ids 需要删除的生产任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteBusiTaskByIds(String ids)
|
||||
{
|
||||
busiTaskMapper.deleteBusiSubTaskByTaskIds(Convert.toStrArray(ids));
|
||||
return busiTaskMapper.deleteBusiTaskByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产任务信息
|
||||
*
|
||||
* @param id 生产任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiTaskById(String id)
|
||||
{
|
||||
busiTaskMapper.deleteBusiSubTaskByTaskId(id);
|
||||
return busiTaskMapper.deleteBusiTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品子任务信息
|
||||
*
|
||||
* @param busiTask 生产任务对象
|
||||
*/
|
||||
public void insertBusiSubTask(BusiTask busiTask)
|
||||
{
|
||||
List<BusiSubTask> busiSubTaskList = busiTask.getBusiSubTaskList();
|
||||
String id = busiTask.getId();
|
||||
if (StringUtils.isNotNull(busiSubTaskList))
|
||||
{
|
||||
List<BusiSubTask> list = new ArrayList<BusiSubTask>();
|
||||
for (BusiSubTask busiSubTask : busiSubTaskList)
|
||||
{
|
||||
busiSubTask.setTaskId(id);
|
||||
list.add(busiSubTask);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
busiTaskMapper.batchBusiSubTask(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<?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.busi.mapper.BusiTaskMapper">
|
||||
|
||||
<resultMap type="BusiTask" id="BusiTaskResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderName" column="order_name" />
|
||||
<result property="prisonLineId" column="prison_line_id" />
|
||||
<result property="lineName" column="line_name" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="targetAmount" column="target_amount" />
|
||||
<result property="completedAmount" column="completed_amount" />
|
||||
<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="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BusiTaskBusiSubTaskResult" type="BusiTask" extends="BusiTaskResult">
|
||||
<collection property="busiSubTaskList" notNullColumn="sub_id" javaType="java.util.List" resultMap="BusiSubTaskResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BusiSubTask" id="BusiSubTaskResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="taskId" column="sub_task_id" />
|
||||
<result property="productRequireId" column="sub_product_require_id" />
|
||||
<result property="targetAmount" column="sub_target_amount" />
|
||||
<result property="completedAmount" column="sub_completed_amount" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="status" column="sub_status" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectBusiTaskList" parameterType="BusiTask" resultMap="BusiTaskResult">
|
||||
SELECT bo.order_name,bpl.disname line_name,bt.task_name,bst.target_amount,bst.completed_amount,bt.status FROM busi_task bt
|
||||
left join busi_order bo on bt.order_id = bo.id
|
||||
left join busi_prison_line bpl on bt.prison_line_id = bpl.id
|
||||
left join
|
||||
(SELECT max(task_id) task_id,sum(target_amount) target_amount,sum(completed_amount) completed_amount from busi_sub_task GROUP BY task_id) bst
|
||||
on bst.task_id = bt.id
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''"> and bt.order_id = #{orderId}</if>
|
||||
<if test="prisonLineId != null and prisonLineId != ''"> and bt.prison_line_id = #{prisonLineId}</if>
|
||||
<if test="taskName != null and taskName != ''"> and bt.task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and bt.status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiTaskById" parameterType="String" resultMap="BusiTaskBusiSubTaskResult">
|
||||
select a.id, a.order_id, a.prison_line_id, a.task_name, a.create_by, a.create_time, a.update_by, a.update_time, a.status,
|
||||
b.id as sub_id, b.task_id as sub_task_id, b.product_require_id as sub_product_require_id, b.target_amount as sub_target_amount, b.completed_amount as sub_completed_amount, b.create_by as sub_create_by, b.create_time as sub_create_time, b.status as sub_status
|
||||
from busi_task a
|
||||
left join busi_sub_task b on b.task_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiTask" parameterType="BusiTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null and orderId != ''">order_id,</if>
|
||||
<if test="prisonLineId != null and prisonLineId != ''">prison_line_id,</if>
|
||||
<if test="taskName != null">task_name,</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="status != null and status != ''">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null and orderId != ''">#{orderId},</if>
|
||||
<if test="prisonLineId != null and prisonLineId != ''">#{prisonLineId},</if>
|
||||
<if test="taskName != null">#{taskName},</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="status != null and status != ''">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiTask" parameterType="BusiTask">
|
||||
update busi_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
|
||||
<if test="prisonLineId != null and prisonLineId != ''">prison_line_id = #{prisonLineId},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</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="status != null and status != ''">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiTaskById" parameterType="String">
|
||||
delete from busi_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiTaskByIds" parameterType="String">
|
||||
delete from busi_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiSubTaskByTaskIds" parameterType="String">
|
||||
delete from busi_sub_task where task_id in
|
||||
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiSubTaskByTaskId" parameterType="String">
|
||||
delete from busi_sub_task where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchBusiSubTask">
|
||||
insert into busi_sub_task( id, task_id, product_require_id, target_amount, completed_amount, create_by, create_time, status) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.taskId}, #{item.productRequireId}, #{item.targetAmount}, #{item.completedAmount}, #{item.createBy}, #{item.createTime}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -73,18 +73,16 @@
|
|||
title: '监区产线选择',
|
||||
width: "380",
|
||||
url: prefix + "/selectPrisonLineTree/" + $("#treeId").val()+ "?JCOnly=yes",
|
||||
callBack: doSubmit
|
||||
callBack: function(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
|
||||
$("input[name='classify']").on('ifChecked', function(event){
|
||||
var menuType = $(event.target).val();
|
||||
if (menuType == "J") { // 监区
|
||||
|
|
|
|||
|
|
@ -0,0 +1,176 @@
|
|||
<!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-task-add">
|
||||
<h4 class="form-header h4">生产任务信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产线选择:</label>
|
||||
<div class="col-sm-8">
|
||||
<!-- <input name="prisonLineId" class="form-control" type="text" required>-->
|
||||
<input id="lineTreeId" name="prisonLineId" type="hidden" />
|
||||
<input class="form-control" type="text" onclick="selectPrisonLineTree()" id="lineTreeName" readonly="true" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单选择:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="treeId" name="orderId" type="hidden">
|
||||
<input id="treeName" name="orderName" readonly="true" onclick="selectOrder(1)" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskName" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="status" class="form-control m-b" th:with="type=${@dict.getType('busi_task_status')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</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="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><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 + "busi/task"
|
||||
$("#form-task-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-task-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: 'productRequireId',
|
||||
align: 'center',
|
||||
title: '产品需求ID',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].productRequireId' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'targetAmount',
|
||||
align: 'center',
|
||||
title: '目标数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].targetAmount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'completedAmount',
|
||||
align: 'center',
|
||||
title: '完成数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].completedAmount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
align: 'center',
|
||||
title: '完成状态',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].status' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
productRequireId: "",
|
||||
targetAmount: "",
|
||||
completedAmount: "",
|
||||
status: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*订单选择*/
|
||||
function selectOrder(status) {
|
||||
var options = {
|
||||
title: '选择订单',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/order/selectOrder/" + status,
|
||||
callBack: function(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
/*监区产线-新增-选择父监区产线树*/
|
||||
function selectPrisonLineTree() {
|
||||
var options = {
|
||||
title: '监区产线选择',
|
||||
width: "380",
|
||||
url: ctx + "busi/prisonLine/selectPrisonLineTree/" + $("#lineTreeId").val(),
|
||||
callBack: function(index, layer){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
console.log(body);
|
||||
$("#lineTreeId").val(body.find('#treeId').val());
|
||||
$("#lineTreeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<!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-task-edit" th:object="${busiTask}">
|
||||
<h4 class="form-header h4">生产任务信息</h4>
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产线ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="prisonLineId" th:field="*{prisonLineId}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskName" th:field="*{taskName}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="status" class="form-control m-b" th:with="type=${@dict.getType('busi_task_status')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
|
||||
</select>
|
||||
</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="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><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 + "busi/task";
|
||||
$("#form-task-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${busiTask.busiSubTaskList}]],
|
||||
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: 'productRequireId',
|
||||
align: 'center',
|
||||
title: '产品需求ID',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].productRequireId' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'targetAmount',
|
||||
align: 'center',
|
||||
title: '目标数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].targetAmount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'completedAmount',
|
||||
align: 'center',
|
||||
title: '完成数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].completedAmount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
align: 'center',
|
||||
title: '创建者',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].createBy' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
align: 'center',
|
||||
title: '创建时间',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].createTime' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
align: 'center',
|
||||
title: '完成状态',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiSubTaskList[%s].status' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
productRequireId: "",
|
||||
targetAmount: "",
|
||||
completedAmount: "",
|
||||
createBy: "",
|
||||
createTime: "",
|
||||
status: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<!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="orderId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>产线选择:</label>
|
||||
<input type="text" name="prisonLineId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>任务名称:</label>
|
||||
<input type="text" name="taskName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>任务状态:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('busi_task_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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="busi:task:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:task:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:task:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:task:export">
|
||||
<i class="fa fa-download"></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('busi:task:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:task:remove')}]];
|
||||
var statusDatas = [[${@dict.getType('busi_task_status')}]];
|
||||
var prefix = ctx + "busi/task";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "生产任务",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'orderName',
|
||||
title: '订单'
|
||||
},
|
||||
{
|
||||
field: 'lineName',
|
||||
title: '产线ID'
|
||||
},
|
||||
{
|
||||
field: 'taskName',
|
||||
title: '任务名称'
|
||||
},
|
||||
{
|
||||
field: 'targetAmount',
|
||||
title: '目标值'
|
||||
},
|
||||
{
|
||||
field: 'completedAmount',
|
||||
title: '完成值'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '任务状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
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.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue