youjianchi
10 months ago
23 changed files with 1957 additions and 149 deletions
@ -0,0 +1,27 @@ |
|||||
|
package com.ruoyi.config; |
||||
|
|
||||
|
import com.ruoyi.common.config.ICustomProcessDiagramGenerator; |
||||
|
import org.activiti.spring.SpringProcessEngineConfiguration; |
||||
|
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
@Configuration |
||||
|
public class ActivitiConfig implements ProcessEngineConfigurationConfigurer { |
||||
|
|
||||
|
@Autowired |
||||
|
private ICustomProcessDiagramGenerator customProcessDiagramGenerator; |
||||
|
|
||||
|
/** |
||||
|
* 解決工作流生成图片乱码问题 |
||||
|
* |
||||
|
* @param processEngineConfiguration |
||||
|
*/ |
||||
|
@Override |
||||
|
public void configure(SpringProcessEngineConfiguration processEngineConfiguration) { |
||||
|
processEngineConfiguration.setActivityFontName("宋体"); |
||||
|
processEngineConfiguration.setAnnotationFontName("宋体"); |
||||
|
processEngineConfiguration.setLabelFontName("宋体"); |
||||
|
processEngineConfiguration.setProcessDiagramGenerator(customProcessDiagramGenerator); |
||||
|
} |
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package com.ruoyi.erp.domain; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description 物料信息Vo |
||||
|
* @Author youjianchi |
||||
|
* @Date 2024/02/10 13:51 |
||||
|
*/ |
||||
|
public class ErpMaterialVo extends ErpMaterial { |
||||
|
/** 申请人姓名 */ |
||||
|
private String applyUserName; |
||||
|
/** 任务ID */ |
||||
|
private String taskId; |
||||
|
/** 任务名称 */ |
||||
|
private String taskName; |
||||
|
/** 办理时间 */ |
||||
|
private Date doneTime; |
||||
|
/** 创建人 */ |
||||
|
private String createUserName; |
||||
|
/** 流程实例状态 1 激活 2 挂起 */ |
||||
|
private String suspendState; |
||||
|
/** 待办用户id */ |
||||
|
private String todoUserId; |
||||
|
|
||||
|
public String getApplyUserName() { |
||||
|
return applyUserName; |
||||
|
} |
||||
|
|
||||
|
public void setApplyUserName(String applyUserName) { |
||||
|
this.applyUserName = applyUserName; |
||||
|
} |
||||
|
|
||||
|
public String getTaskId() { |
||||
|
return taskId; |
||||
|
} |
||||
|
|
||||
|
public void setTaskId(String taskId) { |
||||
|
this.taskId = taskId; |
||||
|
} |
||||
|
|
||||
|
public String getTaskName() { |
||||
|
return taskName; |
||||
|
} |
||||
|
|
||||
|
public void setTaskName(String taskName) { |
||||
|
this.taskName = taskName; |
||||
|
} |
||||
|
|
||||
|
public Date getDoneTime() { |
||||
|
return doneTime; |
||||
|
} |
||||
|
|
||||
|
public void setDoneTime(Date doneTime) { |
||||
|
this.doneTime = doneTime; |
||||
|
} |
||||
|
|
||||
|
public String getCreateUserName() { |
||||
|
return createUserName; |
||||
|
} |
||||
|
|
||||
|
public void setCreateUserName(String createUserName) { |
||||
|
this.createUserName = createUserName; |
||||
|
} |
||||
|
|
||||
|
public String getSuspendState() { |
||||
|
return suspendState; |
||||
|
} |
||||
|
|
||||
|
public void setSuspendState(String suspendState) { |
||||
|
this.suspendState = suspendState; |
||||
|
} |
||||
|
|
||||
|
public String getTodoUserId() { |
||||
|
return todoUserId; |
||||
|
} |
||||
|
|
||||
|
public void setTodoUserId(String todoUserId) { |
||||
|
this.todoUserId = todoUserId; |
||||
|
} |
||||
|
} |
@ -0,0 +1,292 @@ |
|||||
|
<!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" /> |
||||
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
||||
|
<input type="hidden" name="p_COM_comment" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请时间:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否有生产团队:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="haveProductTem" class="form-control m-b" th:with="type=${@dict.getType('havaProductTem')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队id:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="productItem" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.id}" th:text="${product.id}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="itemName" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.productItem}" th:text="${product.productItem}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled> |
||||
|
<optgroup> |
||||
|
<option value="">请选择</option> |
||||
|
</optgroup> |
||||
|
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
||||
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">入库部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">照片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<el-upload |
||||
|
:disabled="true" |
||||
|
:action="fileUploadUrl" |
||||
|
:on-success="uploadSuccess" |
||||
|
:on-remove="uploadRemove" |
||||
|
:file-list="fileList" |
||||
|
list-type="picture" |
||||
|
accept=".jpg,.png" |
||||
|
multiple> |
||||
|
<el-button size="small" type="primary">点击上传</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
||||
|
</el-upload> |
||||
|
</div> |
||||
|
<input id="photoAttachId" name = "photoAttachId" th:field="*{photoAttachId}" hidden readonly> |
||||
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden readonly> |
||||
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> |
||||
|
</div> |
||||
|
<hr /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="gcjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="p_B_gcjlVerifyApproved" id="gcjlVerifyApproved" class="form-control m-b" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
new Vue({ |
||||
|
el: '#app', |
||||
|
data: function() { |
||||
|
return { |
||||
|
fileList: [], |
||||
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
||||
|
fileDeleteUrl: ctx + "common/deleteFile", |
||||
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
||||
|
fileIdList:[], |
||||
|
removeFileIdList:[], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
// 控制下拉框选中 |
||||
|
var materialType = $("#materialType").val(); |
||||
|
$("#selectMaterialType").val(materialType).trigger("change"); |
||||
|
|
||||
|
var that = this; |
||||
|
// 页面渲染完成,可以执行需要的操作 |
||||
|
console.log('页面已渲染完成'); |
||||
|
console.log($("#id").val()); |
||||
|
console.log($("#photoAttachId").val()); |
||||
|
var attachId = $("#photoAttachId").val(); |
||||
|
if(attachId){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: that.getListByAttachIdUrl, |
||||
|
data: {attachId:attachId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
result.data.forEach((item) => { |
||||
|
that.fileIdList.push(item.id); |
||||
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
||||
|
}); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.msgError("获取附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
uploadSuccess(response, file, fileList) { |
||||
|
console.log(response); |
||||
|
if(response.code == web_status.SUCCESS){ |
||||
|
var attachFileId = response.data.id; |
||||
|
file.attachFileId = attachFileId; |
||||
|
file.isBind = false; |
||||
|
this.fileIdList.push(attachFileId); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
$.modal.msgSuccess("上传成功"); |
||||
|
}else{ |
||||
|
$.modal.alertError(response.msg); |
||||
|
} |
||||
|
}, |
||||
|
uploadRemove(file, fileList) { |
||||
|
console.log(file, fileList); |
||||
|
var attachFileId = file.attachFileId; |
||||
|
var isBind = file.isBind; |
||||
|
if(isBind==false){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: this.fileDeleteUrl, |
||||
|
data: {id:attachFileId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
} |
||||
|
$.modal.msgSuccess("删除附件成功。"); |
||||
|
} else { |
||||
|
$.modal.alertError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.alertError("删除附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
// 保存的时候才删除 |
||||
|
this.removeFileIdList.push(attachFileId); |
||||
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
var prefix = ctx + "erp/material"; |
||||
|
$("#form-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var materialType = $('#selectMaterialType').select2('val'); |
||||
|
$('#materialType').val(materialType); |
||||
|
if ($('textarea[name="comment"]').val()) { |
||||
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
||||
|
} |
||||
|
var taskId = [[${taskId}]]; |
||||
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,292 @@ |
|||||
|
<!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" /> |
||||
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
||||
|
<input type="hidden" name="p_COM_comment" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请时间:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否有生产团队:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="haveProductTem" class="form-control m-b" th:with="type=${@dict.getType('havaProductTem')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队id:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="productItem" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.id}" th:text="${product.id}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="itemName" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.productItem}" th:text="${product.productItem}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled> |
||||
|
<optgroup> |
||||
|
<option value="">请选择</option> |
||||
|
</optgroup> |
||||
|
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
||||
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">入库部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">照片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<el-upload |
||||
|
v-if="!isReadOnly" |
||||
|
:action="fileUploadUrl" |
||||
|
:on-success="uploadSuccess" |
||||
|
:on-remove="uploadRemove" |
||||
|
:file-list="fileList" |
||||
|
list-type="picture" |
||||
|
accept=".jpg,.png" |
||||
|
multiple> |
||||
|
<el-button size="small" type="primary">点击上传</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
||||
|
</el-upload> |
||||
|
</div> |
||||
|
<input id="photoAttachId" name = "photoAttachId" th:field="*{photoAttachId}" hidden readonly> |
||||
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden readonly> |
||||
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> |
||||
|
</div> |
||||
|
<hr /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="gczgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="p_B_gczgVerifyApproved" id="gczgVerifyApproved" class="form-control m-b" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
new Vue({ |
||||
|
el: '#app', |
||||
|
data: function() { |
||||
|
return { |
||||
|
fileList: [], |
||||
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
||||
|
fileDeleteUrl: ctx + "common/deleteFile", |
||||
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
||||
|
fileIdList:[], |
||||
|
removeFileIdList:[], |
||||
|
isReadOnly: true // 设置为 true 则隐藏 el-upload |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
// 控制下拉框选中 |
||||
|
var materialType = $("#materialType").val(); |
||||
|
$("#selectMaterialType").val(materialType).trigger("change"); |
||||
|
|
||||
|
var that = this; |
||||
|
// 页面渲染完成,可以执行需要的操作 |
||||
|
console.log('页面已渲染完成'); |
||||
|
console.log($("#id").val()); |
||||
|
console.log($("#photoAttachId").val()); |
||||
|
var attachId = $("#photoAttachId").val(); |
||||
|
if(attachId){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: that.getListByAttachIdUrl, |
||||
|
data: {attachId:attachId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
result.data.forEach((item) => { |
||||
|
that.fileIdList.push(item.id); |
||||
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
||||
|
}); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.msgError("获取附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
uploadSuccess(response, file, fileList) { |
||||
|
console.log(response); |
||||
|
if(response.code == web_status.SUCCESS){ |
||||
|
var attachFileId = response.data.id; |
||||
|
file.attachFileId = attachFileId; |
||||
|
file.isBind = false; |
||||
|
this.fileIdList.push(attachFileId); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
$.modal.msgSuccess("上传成功"); |
||||
|
}else{ |
||||
|
$.modal.alertError(response.msg); |
||||
|
} |
||||
|
}, |
||||
|
uploadRemove(file, fileList) { |
||||
|
console.log(file, fileList); |
||||
|
var attachFileId = file.attachFileId; |
||||
|
var isBind = file.isBind; |
||||
|
if(isBind==false){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: this.fileDeleteUrl, |
||||
|
data: {id:attachFileId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
} |
||||
|
$.modal.msgSuccess("删除附件成功。"); |
||||
|
} else { |
||||
|
$.modal.alertError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.alertError("删除附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
// 保存的时候才删除 |
||||
|
this.removeFileIdList.push(attachFileId); |
||||
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
var prefix = ctx + "erp/material"; |
||||
|
$("#form-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var materialType = $('#selectMaterialType').select2('val'); |
||||
|
$('#materialType').val(materialType); |
||||
|
if ($('textarea[name="comment"]').val()) { |
||||
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
||||
|
} |
||||
|
var taskId = [[${taskId}]]; |
||||
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,311 @@ |
|||||
|
<!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" /> |
||||
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
||||
|
<!--驳回调整允许更新内容--> |
||||
|
<input type="hidden" name="saveEntity" value="true" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请时间:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" > |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" > |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否有生产团队:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="haveProductTem" class="form-control m-b" th:with="type=${@dict.getType('havaProductTem')}" > |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队id:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="productItem" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" > |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.id}" th:text="${product.id}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="itemName" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" > |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.productItem}" th:text="${product.productItem}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" > |
||||
|
<optgroup> |
||||
|
<option value="">请选择</option> |
||||
|
</optgroup> |
||||
|
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
||||
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" > |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" > |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" > |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control" >[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">入库部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" > |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">照片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<el-upload |
||||
|
:action="fileUploadUrl" |
||||
|
:on-success="uploadSuccess" |
||||
|
:on-remove="uploadRemove" |
||||
|
:file-list="fileList" |
||||
|
list-type="picture" |
||||
|
accept=".jpg,.png" |
||||
|
multiple> |
||||
|
<el-button size="small" type="primary">点击上传</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
||||
|
</el-upload> |
||||
|
</div> |
||||
|
<input id="photoAttachId" name = "photoAttachId" th:field="*{photoAttachId}" hidden > |
||||
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden > |
||||
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden > |
||||
|
</div> |
||||
|
<hr /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="reApply">是否继续申请:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="reApply" name="p_B_reApply" class="form-control m-b"> |
||||
|
<option value="true">重新申请</option> |
||||
|
<option value="false">结束流程</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
new Vue({ |
||||
|
el: '#app', |
||||
|
data: function() { |
||||
|
return { |
||||
|
fileList: [], |
||||
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
||||
|
fileDeleteUrl: ctx + "common/deleteFile", |
||||
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
||||
|
fileIdList:[], |
||||
|
removeFileIdList:[], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
// 控制下拉框选中 |
||||
|
var materialType = $("#materialType").val(); |
||||
|
$("#selectMaterialType").val(materialType).trigger("change"); |
||||
|
|
||||
|
var that = this; |
||||
|
// 页面渲染完成,可以执行需要的操作 |
||||
|
console.log('页面已渲染完成'); |
||||
|
console.log($("#id").val()); |
||||
|
console.log($("#photoAttachId").val()); |
||||
|
var attachId = $("#photoAttachId").val(); |
||||
|
if(attachId){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: that.getListByAttachIdUrl, |
||||
|
data: {attachId:attachId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
result.data.forEach((item) => { |
||||
|
that.fileIdList.push(item.id); |
||||
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
||||
|
}); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.msgError("获取附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
uploadSuccess(response, file, fileList) { |
||||
|
console.log(response); |
||||
|
if(response.code == web_status.SUCCESS){ |
||||
|
var attachFileId = response.data.id; |
||||
|
file.attachFileId = attachFileId; |
||||
|
file.isBind = false; |
||||
|
this.fileIdList.push(attachFileId); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
$.modal.msgSuccess("上传成功"); |
||||
|
}else{ |
||||
|
$.modal.alertError(response.msg); |
||||
|
} |
||||
|
}, |
||||
|
uploadRemove(file, fileList) { |
||||
|
console.log(file, fileList); |
||||
|
var attachFileId = file.attachFileId; |
||||
|
var isBind = file.isBind; |
||||
|
if(isBind==false){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: this.fileDeleteUrl, |
||||
|
data: {id:attachFileId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
} |
||||
|
$.modal.msgSuccess("删除附件成功。"); |
||||
|
} else { |
||||
|
$.modal.alertError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.alertError("删除附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
// 保存的时候才删除 |
||||
|
this.removeFileIdList.push(attachFileId); |
||||
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
var prefix = ctx + "erp/material"; |
||||
|
$("#form-edit").validate({ |
||||
|
onkeyup: false, |
||||
|
rules:{ |
||||
|
materialNo:{ |
||||
|
isInteger: true, |
||||
|
minlength: 10, |
||||
|
maxlength: 10, |
||||
|
// remote: { |
||||
|
// url: prefix + "/checkMaterialNoUnique", |
||||
|
// type: "post", |
||||
|
// dataType: "json", |
||||
|
// data: { |
||||
|
// "materialNo": function() { |
||||
|
// console.log($("#materialNo").val()) |
||||
|
// return $.common.trim($("#materialNo").val()); |
||||
|
// } |
||||
|
// }, |
||||
|
// dataFilter: function(data, type) { |
||||
|
// return $.validate.unique(data); |
||||
|
// } |
||||
|
// } |
||||
|
}, |
||||
|
}, |
||||
|
messages: { |
||||
|
"materialNo": { |
||||
|
// remote: "料号已经存在", |
||||
|
minlength: "请输入10位整数", |
||||
|
maxlength: "请输入10位整数", |
||||
|
}, |
||||
|
}, |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var materialType = $('#selectMaterialType').select2('val'); |
||||
|
$('#materialType').val(materialType); |
||||
|
var taskId = [[${taskId}]]; |
||||
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,292 @@ |
|||||
|
<!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" /> |
||||
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
||||
|
<input name="id" th:field="*{id}" type="hidden"> |
||||
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
||||
|
<input type="hidden" name="p_COM_comment" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">申请时间:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="materialNo" name="materialNo" th:field="*{materialNo}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">是否有生产团队:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="haveProductTem" class="form-control m-b" th:with="type=${@dict.getType('havaProductTem')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队id:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="productItem" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.id}" th:text="${product.id}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">生产团队名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="itemName" class="form-control m-b" th:with="productList=${@productItems.selectSysProductItemLists()}" disabled> |
||||
|
<option value="">请选择</option> |
||||
|
<option th:each="product:${productList}" th:value="${product.productItem}" th:text="${product.productItem}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">物料类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled> |
||||
|
<optgroup> |
||||
|
<option value="">请选择</option> |
||||
|
</optgroup> |
||||
|
<optgroup th:each="child: ${childList}" th:label="${child.name}"> |
||||
|
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option> |
||||
|
</optgroup> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">加工方式:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">入库部门:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseDept" class="form-control m-b" th:with="type=${@dict.getType('warehouseDept')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseDept}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">照片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<el-upload |
||||
|
:disabled="true" |
||||
|
:action="fileUploadUrl" |
||||
|
:on-success="uploadSuccess" |
||||
|
:on-remove="uploadRemove" |
||||
|
:file-list="fileList" |
||||
|
list-type="picture" |
||||
|
accept=".jpg,.png" |
||||
|
multiple> |
||||
|
<el-button size="small" type="primary">点击上传</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div> |
||||
|
</el-upload> |
||||
|
</div> |
||||
|
<input id="photoAttachId" name = "photoAttachId" th:field="*{photoAttachId}" hidden readonly> |
||||
|
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden readonly> |
||||
|
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> |
||||
|
</div> |
||||
|
<hr /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="yfzjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="p_B_yfzjVerifyApproved" id="yfzjVerifyApproved" class="form-control m-b" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/vue/vue.js}"></script> |
||||
|
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
new Vue({ |
||||
|
el: '#app', |
||||
|
data: function() { |
||||
|
return { |
||||
|
fileList: [], |
||||
|
fileUploadUrl: ctx + "common/uploadSingleFile", |
||||
|
fileDeleteUrl: ctx + "common/deleteFile", |
||||
|
getListByAttachIdUrl: ctx + "system/attach/file/getListByAttachId", |
||||
|
fileIdList:[], |
||||
|
removeFileIdList:[], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
// 控制下拉框选中 |
||||
|
var materialType = $("#materialType").val(); |
||||
|
$("#selectMaterialType").val(materialType).trigger("change"); |
||||
|
|
||||
|
var that = this; |
||||
|
// 页面渲染完成,可以执行需要的操作 |
||||
|
console.log('页面已渲染完成'); |
||||
|
console.log($("#id").val()); |
||||
|
console.log($("#photoAttachId").val()); |
||||
|
var attachId = $("#photoAttachId").val(); |
||||
|
if(attachId){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: that.getListByAttachIdUrl, |
||||
|
data: {attachId:attachId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
result.data.forEach((item) => { |
||||
|
that.fileIdList.push(item.id); |
||||
|
that.fileList.push({name: item.name, url: item.url, attachFileId: item.id,isBind:true}); |
||||
|
}); |
||||
|
} else { |
||||
|
$.modal.msgError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.msgError("获取附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
uploadSuccess(response, file, fileList) { |
||||
|
console.log(response); |
||||
|
if(response.code == web_status.SUCCESS){ |
||||
|
var attachFileId = response.data.id; |
||||
|
file.attachFileId = attachFileId; |
||||
|
file.isBind = false; |
||||
|
this.fileIdList.push(attachFileId); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
$.modal.msgSuccess("上传成功"); |
||||
|
}else{ |
||||
|
$.modal.alertError(response.msg); |
||||
|
} |
||||
|
}, |
||||
|
uploadRemove(file, fileList) { |
||||
|
console.log(file, fileList); |
||||
|
var attachFileId = file.attachFileId; |
||||
|
var isBind = file.isBind; |
||||
|
if(isBind==false){ |
||||
|
$.ajax({ |
||||
|
type: "get", |
||||
|
url: this.fileDeleteUrl, |
||||
|
data: {id:attachFileId}, |
||||
|
cache: false, |
||||
|
async: false, // 设置成同步 |
||||
|
dataType: 'json', |
||||
|
success: function(result) { |
||||
|
if (result.code == web_status.SUCCESS) { |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
} |
||||
|
$.modal.msgSuccess("删除附件成功。"); |
||||
|
} else { |
||||
|
$.modal.alertError(result.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
$.modal.alertError("删除附件失败。"); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
var index = this.fileIdList.indexOf(attachFileId); |
||||
|
if(index!=-1){ |
||||
|
this.fileIdList.splice(index,1); |
||||
|
$("#fileIdStr").val(this.fileIdList.join(";")); |
||||
|
// 保存的时候才删除 |
||||
|
this.removeFileIdList.push(attachFileId); |
||||
|
$("#removeFileIdStr").val(this.removeFileIdList.join(";")); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
var prefix = ctx + "erp/material"; |
||||
|
$("#form-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var materialType = $('#selectMaterialType').select2('val'); |
||||
|
$('#materialType').val(materialType); |
||||
|
if ($('textarea[name="comment"]').val()) { |
||||
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
||||
|
} |
||||
|
var taskId = [[${taskId}]]; |
||||
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue