Browse Source

[update]修复销售订单审核功能,添加获取工程员功能

dev
zhangsiqi 7 months ago
parent
commit
0950e15656
  1. 102
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  3. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  4. 9
      ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html
  5. 42
      ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html
  6. 12
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html
  7. 472
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html
  8. 142
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html
  9. 271
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html
  10. 37
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

102
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -5,6 +5,8 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
@ -20,10 +22,7 @@ import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.SysCustomerQuoteVo;
import com.ruoyi.system.domain.SysSalesFinish;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.exportDto.SysSalesFinishDto;
import com.ruoyi.system.domain.exportDto.SysSalesOrderDto;
import com.ruoyi.system.service.*;
@ -82,6 +81,9 @@ public class SysSalesOrderController extends BaseController
@Autowired
private ISysUserService sysUserService;
@Autowired
private ISysMakeOrderService sysMakeOrderService;
@RequiresPermissions("system:salesOrder:view")
@GetMapping()
public String salesOrder(ModelMap mmap)
@ -100,33 +102,14 @@ public class SysSalesOrderController extends BaseController
{
SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId();
List<SysSalesOrderVo> list1 = new ArrayList<>();
Set<String> roleKeys = roleService.selectRoleKeys(userId);
SysUser sysUser = new SysUser();
List<SysUser> sysUserList = sysUserService.selectUserList(sysUser);
// 业务员角色只能看到自己创建的数据
if(roleKeys.contains("ywyRole")){
sysSalesOrderVo.setApplyUser(curUser.getLoginName());startPage();
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
return getDataTable(list);
}
if (roleKeys.contains("ywjlRole")){
startPage();
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
list.stream().filter(item -> !Objects.equals(item.getCreateBy(), "admin")
&& !Objects.equals(item.getCreateBy(), "yfzj") && Objects.equals(item.getCreateBy(), "ywzg"));
return getDataTable(list);
}
if (roleKeys.contains("ywgzRole")){
startPage();
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
list.stream().filter(item -> !Objects.equals(item.getCreateBy(), "admin") && !Objects.equals(item.getCreateBy(), "yfzj")
&& Objects.equals(item.getCreateBy(), "ywjl"));
return getDataTable(list);
sysSalesOrderVo.setApplyUser(curUser.getLoginName());
}
startPage();
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
return getDataTable(list);
}
@ -194,9 +177,12 @@ public class SysSalesOrderController extends BaseController
@Log(title = "销售订单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysSalesOrder sysSalesOrder)
public AjaxResult editSave(@RequestBody SysSalesOrder sysSalesOrder)
{
return toAjax(sysSalesOrderService.updateSysSalesOrder(sysSalesOrder));
sysSalesOrder.setUseStatus("0");
sysSalesOrder.setAuditStatus("0");
sysSalesOrderService.submitApply(sysSalesOrder);
return AjaxResult.success();
}
@ -392,7 +378,16 @@ public class SysSalesOrderController extends BaseController
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
return prefix + "/task" + verifyName;
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("/preloadObj")
public SysSalesOrderVo getObj(@RequestParam(value = "salesOrderId", required = false) Long salesOrderId, HttpSession session) {
if (salesOrderId != null) {
return sysSalesOrderService.selectSysSalesOrderById(salesOrderId);
}
return new SysSalesOrderVo();
}
/**
* 完成任务
*
@ -400,58 +395,56 @@ public class SysSalesOrderController extends BaseController
*/
@RequestMapping(value = "/complete/{taskId}", method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public AjaxResult complete(@PathVariable("taskId") String taskId, @RequestParam(value = "saveEntity", required = false) String saveEntity,
@ModelAttribute("preloadObj") SysSalesOrderVo salesOrderVo, HttpServletRequest request) {
public AjaxResult complete(@PathVariable("taskId") String taskId,@RequestParam(value = "saveEntity", required = false) String saveEntity,
@RequestParam(value = "salesOrderChildList", required = false) String salesOrderChildList,
@ModelAttribute("preloadObj") SysSalesOrderVo sysSalesOrderVo,HttpServletRequest request){
System.out.println("taskId = " + taskId + ", saveEntity = " + saveEntity + ", salesOrderChildList = " + salesOrderChildList + ", sysSalesOrderVo = " + sysSalesOrderVo + ", request = " + request);
sysSalesOrderVo.setSysSalesOrderChildList(JSON.parseArray(salesOrderChildList, SysSalesOrderChild.class));
boolean saveEntityBoolean = BooleanUtils.toBoolean(saveEntity);
String instanceId = salesOrderVo.getInstanceId();
String instanceType = salesOrderVo.getInstanceType();
if (saveEntityBoolean) {
sysSalesOrderService.updateSysSalesOrder(sysSalesOrderVo);
}
String instanceId = sysSalesOrderVo.getInstanceId();
String instanceType = sysSalesOrderVo.getInstanceType();
boolean approvedFlag = processService.complete(taskId, instanceId,
salesOrderVo.getApplyTitle(), salesOrderVo.getSalesOrderCode(),
sysSalesOrderVo.getApplyTitle(), sysSalesOrderVo.getSalesOrderCode(),
"salesorder", new HashMap<String, Object>(), request);
if(!approvedFlag){
// 审核状态-审核拒绝
salesOrderVo.setAuditStatus("2");
sysSalesOrderVo.setAuditStatus("2");
}
// 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
if (processIsFinish) {
// 审核通过
salesOrderVo.setAuditStatus("1");
sysSalesOrderVo.setAuditStatus("1");
//生产订单生成
sysMakeOrderService.generateMakeOrderBySalesOrderCode(sysSalesOrderVo.getSalesOrderCode());
// 提交
if("submit".equals(instanceType)){
// 使用状态-是
salesOrderVo.setUseStatus("1");
sysSalesOrderVo.setUseStatus("1");
}
// 作废
else if("cancel".equals(instanceType)){
// 使用状态-已作废
salesOrderVo.setUseStatus("2");
sysSalesOrderVo.setUseStatus("2");
}
// 恢复
else if("restore".equals(instanceType)){
// 使用状态-是
salesOrderVo.setUseStatus("1");
sysSalesOrderVo.setUseStatus("1");
}
}
sysSalesOrderService.updateSysSalesOrder(salesOrderVo);
sysSalesOrderService.updateSysSalesOrder(sysSalesOrderVo);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
sysSalesOrderService.updateSysSalesOrder(salesOrderVo);
sysSalesOrderService.updateSysSalesOrder(sysSalesOrderVo);
}
return success("任务已完成");
}
/**
* 自动绑定页面字段
*/
@ModelAttribute("/preloadObj")
public SysSalesOrderVo getObj(@RequestParam(value = "id", required = false) Long id, HttpSession session) {
if (id != null) {
return sysSalesOrderService.selectSysSalesOrderById(id);
}
return new SysSalesOrderVo();
}
/**
* 作废客户销售订单信息信息
@ -480,4 +473,11 @@ public class SysSalesOrderController extends BaseController
sysSalesOrderVo.setKeyword(keyword);
return success(sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo));
}
@GetMapping("/getBinessMembers")
@ResponseBody
public TableDataInfo getBinessMembers(){
startPage();
List<SysUser> list = sysUserService.selectRoleToUserList("ywyRole");
return getDataTable(list);
}
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -47,10 +47,10 @@ public interface ISysSalesOrderService
/**
* 修改销售订单
*
* @param sysSalesOrder 销售订单
* @param sysSalesOrderVo 销售订单
* @return 结果
*/
public int updateSysSalesOrder(SysSalesOrder sysSalesOrder);
public int updateSysSalesOrder(SysSalesOrderVo sysSalesOrderVo);
/**
* 批量删除销售订单
@ -76,8 +76,10 @@ public interface ISysSalesOrderService
ProcessInstance cancelSysCustomerById(Long id);
/**
* 恢复申请 */
@Transactional(rollbackFor = Exception.class)
ProcessInstance restoreSysCustomerById(Long id);
/**
* 提交申请*/
public ProcessInstance submitApply(SysSalesOrder sysSalesOrder);
}

13
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -171,7 +171,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
String loginName = ShiroUtils.getLoginName();
sysSalesOrder.setCreateBy(loginName);
sysSalesOrder.setCreateTime(new Date());
sysSalesOrder.setApplyUser(loginName);
int result = sysSalesOrderMapper.insertSysSalesOrder(sysSalesOrder);
sysSalesOrder.getSalesOrderId();
int s = sysSalesOrder.getSysSalesOrderChildList().size();
@ -195,17 +194,15 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
* @return 结果
*/
@Override
public int updateSysSalesOrder(SysSalesOrder sysSalesOrder)
public int updateSysSalesOrder(SysSalesOrderVo sysSalesOrder)
{
SysUser user = userMapper.selectUserByLoginName(sysSalesOrder.getApplyUser());
String loginName = ShiroUtils.getLoginName();
sysSalesOrder.setUpdateBy(loginName);
sysSalesOrder.setUpdateTime(new Date());
// 存在提交完就流程结束的情况
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
if (sysSalesOrderChildList.isEmpty()){
return 0;
}else{
if(sysSalesOrder.getSysSalesOrderChildList() != null){
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
for (SysSalesOrderChild sysSalesOrderChild:sysSalesOrderChildList) {
if (sysSalesOrderChild.getId() != null && sysSalesOrderChild.getId() != 0){
sysSalesOrderChildService.updateSysSalesOrderChild(sysSalesOrderChild);
@ -263,7 +260,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
sysSalesOrder.setCancelInstanceId(processInstanceId);
sysSalesOrder.setInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
@ -292,7 +288,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
String processInstanceId = processInstance.getProcessInstanceId();
// 恢复实例id
sysSalesOrder.setRestoreInstanceId(processInstanceId);
sysSalesOrder.setInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
@ -326,7 +321,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
sysSalesOrder.setSubmitInstanceId(processInstanceId);
sysSalesOrder.setInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
@ -336,7 +330,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
sysSalesOrder.setUseStatus("1");
}
sysSalesOrderMapper.updateSysSalesOrder(sysSalesOrder);
return processInstance;
}

9
ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html

@ -241,7 +241,7 @@
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryTime" class="form-control" placeholder="yyyy-mm-dd" type="text" disabled/>
<span class="input-group-addon" th:value="${#dates.format(sysSalesOrder.deliveryTime, 'yyyy-MM-dd HH:mm')}" disabled><i class="fa fa-calendar"></i></span>
<span class="input-group-addon" th:value="*{deliveryTime}" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
@ -564,16 +564,15 @@
}
/*业务员列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-salesOrder-edit select[name='businessMembers']").append(
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-salesOrder-edit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}

42
ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html

@ -237,8 +237,8 @@
<label class="col-sm-3 control-label">计划交付时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryTime" class="form-control" placeholder="yyyy-mm-dd" type="text" />
<span class="input-group-addon" th:value="${#dates.format(sysSalesOrder.deliveryTime, 'yyyy-MM-dd HH:mm')}><i class="fa fa-calendar"></i></span>
<input name="deliveryTime" th:field="*{deliveryTime}" class="form-control" placeholder="yyyy-mm-dd" type="text" />
<span class="input-group-addon" ><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
@ -246,8 +246,8 @@
<label class="col-sm-3 control-label">客户验收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="modificationTime" class="form-control" placeholder="yyyy-mm-dd" type="text" />
<span class="input-group-addon" th:value="${#dates.format(sysSalesOrder.modedification, 'yyyy-MM-dd HH:mm')}"><i class="fa fa-calendar"></i></span>
<input name="modificationTime" th:field="*{modificationTime}" class="form-control" placeholder="yyyy-mm-dd" type="text" />
<span class="input-group-addon" ><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
@ -517,6 +517,22 @@
}
},
});
/*业务员列表*/
$.ajax({
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
$("#enterprise_edit").val(sysSalesOrder.enterprise);
$("#enterpriseSum_edit").val(Number(sysSalesOrder.enterpriseSum));
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2));
@ -559,23 +575,7 @@
curParams.quoteId = sysSalesOrder.salesOrderCode;
return curParams;
}
/*业务员列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-salesOrder-edit select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-salesOrder-edit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}
}
});
function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];

12
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

@ -114,7 +114,7 @@
</li>
<li>
<label>客户公司单号:</label>
<input type="text" name="supplierCode"/>
<input type="text" name="salesOrderNumber"/>
</li>
<li>
<label>料号:</label>
@ -209,16 +209,14 @@
var prefix = ctx + "system/salesOrder";
$(function () {
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);

472
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html

@ -12,9 +12,12 @@
</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}">
<form class="form-horizontal m" id="form-modfify-audit" th:object="${formData}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<!--驳回调整允许更新内容-->
<input type="hidden" name="saveEntity" value="true" />
<div class="form-group">
@ -241,46 +244,58 @@
<div class="container">
<h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-2" name="materialSum" th:field="*{materialSum}" id="enterprise_edit" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-2" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" readonly/>
<label class=" col-sm-2">物料合计:</label>
<input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" disabled />
<label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" th:field="*{noRmbTaxSum}" id="noRmbSum_edit" type="number" readonly/>
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" disabled />
<label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" disabled />
<label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" disabled />
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" th:field="*{noUsdTaxSum}" id="noUsdSum_edit" type="number"readonly/>
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number"readonly/>
<label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" disabled />
<label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" disabled />
<label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" disabled />
</div>
</div>
</form>
<div class="container">
<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 class="container">
<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>
</div>
</div>
</form>
<div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-quoteChild"></table>
<table id="bootstrap-sub-table-editOrder4"></table>
</div>
</div>
</div>
@ -299,7 +314,7 @@
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysSalesOrder = [[${formData}]];
$("#form-edit").validate({
$("#form-modfify-audit").validate({
onkeyup: false,
rules:{
},
@ -311,10 +326,411 @@
function submitHandler() {
if ($.validate.form()) {
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize());
$.operate.save(prefix + "/complete/" + taskId, $('#form-modfify-audit').serialize());
}
}
$("#form-modfify-audit").validate({focusCleanup: true});
var prefix = ctx + "system/salesOrder";
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysSalesOrder = [[${formData}]];
$("#form-modfify-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder4',
url: ctx + "system/orderChild/list",
pagination: false,
queryParams: queryParams,
sidePagination: "client",
model: "物料报价信息",
columns: [
{checkbox: true},
{field: 'index',align: 'center', title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{title: '物料索引id',field: 'materialId',align: 'center',visible: false},
{title: '料号',field: 'materialCode',align: 'center'},
{title: '物料名称',field: 'materialName',align: 'center'},
{title: '图片',field: 'photoUrl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料类型',field: 'materialType',align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{ title: '描述',field: 'describe',align: 'center'},
{title: '品牌',field: 'brand',align: 'center'},
{ title: '单位',field: 'unit',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{title: '加工方式',field: 'processMethod',align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{ title: '对外售价',field: 'materialSole',editable: true},
{title: '国内税率',field: 'countTax',align: 'center',editable: true},
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: true},
{field: 'materialNum',align: 'center',title: '物料的数量',editable: true},
{ title: '物料的不含税单价(RMB)',
field: 'materialNoRmb',
align: 'center',
editable: function(value, row, index) {
var commonCurrency3 = $("#commonCurrency_edit option:selected").val();
if (commonCurrency3 == 1){
return true;
}else{
return false;
}
}
},
{title: '物料的不含税单价(美元)',
field: 'materialNoUsd',
align: 'center',
editable: function(value, row, index) {
var commonCurrency2= $("#commonCurrency_edit option:selected").val();
if (commonCurrency2 == 2){
return true;
}else{
return false;
}
}
},
{ title: '物料的含税单价(美元)',field: 'materialUsd',align: 'center'},
{ title: '物料的含税总价(美元)',field: 'materialUsdSum',align: 'center'},
{ title: '物料的不含税总价(美元)',field: 'materialNoUsdSum',align: 'center'},
{ title: '物料的含税总价(RMB)',field: 'materialNoRmbSum', align: 'center'},
{ title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'},
{ title: '录入人',field: 'createBy',align: 'center',visible: false},
{ title: '录入时间',field: 'createTime',align: 'center',visible: false},
{ title: '更新人',field: 'updateBy',align: 'center',visible: false},
{ title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{ title: '备注',field: 'remark',align: 'center', visible: false },
{ title: '审核状态',field: 'auditStatus',align: 'center',visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{title: '操作', align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
],
onEditableSave:function(field, row, oldValue, $el){
var commonCurrency1 = $("#commonCurrency_edit option:selected").val();
var rmb1 = $("#taxRate_edit").val();
if (rmb1 =='' || rmb1== null){
rmb1 = 0;
}else{
rmb1 = $("#taxRate_edit").val();
}
var rmb = Number(rmb1).toFixed(2) / 100;
var usd = $("#usdTax_edit").val();
if (usd =='' || usd== null){
usd = 0;
}else{
usd = Number(usd).toFixed(2);
}
if(commonCurrency1 == 1){
row.materialNoRmb = Number(row.materialNoRmb).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * Number(1 + rmb));
row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
row.materialNoUsd = Number(row.materialNoRmb / usd).toFixed(2);
row.materialNoUsdSum = Number(row.materialNum * row.materialNoUsd).toFixed(2);
row.materialUsd = Number(row.materialNoUsd).toFixed(2)
row.materialUsdSum = Number(row.materialNum * Number(row.materialUsd)).toFixed(2);
}
else if( commonCurrency1 == 2){
row.materialNoUsd = Number(row.materialNoUsd).toFixed(2);
row.materialUsd = Number(row.materialNoUsd).toFixed(2);
row.materialUsdSum = Number(row.materialNum * row.materialUsd).toFixed(2);
row.materialNoUsdSum = Number(row.materialNoUsd * row.materialNum).toFixed(2);
row.materialNoRmb = Number(row.materialNoUsd * usd).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * (1 + rmb)).toFixed(2);
row.materialNoRmbSum = Number(row.materialNoRmb * row.materialNum).toFixed(2);
row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2);
}
getTotalAmount()
},
};
$.table.init(options);
$.ajax({
type: "post",
url:ctx + "system/customer/customerList",
dataType:"json",
delay:250,
cache:true,
success: function (res, params) {
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-modfify-audit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-modfify-audit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change");
} else {
$.modal.msgError(res.msg);
}
},
});
$.ajax({
type: "post",
url:ctx + "system/shippingaddress/list",
dataType:"json",
delay:250,
cache:true,
data:{
enterpriseCode:sysSalesOrder.enterpriseCode,
},
success: function (res, params) {
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-modfify-audit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-modfify-audit select[name='customerDelivery']").val(sysSalesOrder.customerDelivery).trigger()
}
}
});
$.ajax({
type: "post",
url:ctx + "system/contacts/list",
dataType:"json",
delay:250,
cache:true,
data:{
enterpriseCode:sysSalesOrder.enterpriseCode,
},
success: function (res, params) {
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-modfify-audit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-modfify-audit select[name='customerContact']").val(sysSalesOrder.customerContact).trigger("change");
} else {
$.modal.msgError(res.msg);
}
},
});
$("#enterprise_edit").val(sysSalesOrder.enterprise);
$("#enterpriseSum_edit").val(sysSalesOrder.enterpriseSum);
$("#noRmb_edit").val(sysSalesOrder.noRmb);
$("#rmb_edit").val(sysSalesOrder.rmb);
$("#noRmbSum_edit").val(sysSalesOrder.noRmbSum);
$("#rmbTax_edit").val(sysSalesOrder.rmbSum);
$("#noUsd_edit").val(sysSalesOrder.noUsd);
$("#usd_edit").val(sysSalesOrder.usd);
$("#noUsdSum_edit").val(sysSalesOrder.noUsdSum);
$("#usdSum_edit").val(sysSalesOrder.usdSum);
});
$('#enterpriseCode_edit').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='enterpriseName']").val(data.enterpriseName);
$("input[name='customerPurser']").val(data.customerPurser);
$("input[name='taxRate']").val(data.taxRate);
$("input[name='confirmFax']").val(data.confirmTax);
$("#commonCurrency_add").val(data.commonCurrency).trigger('change');
commonCurrency = $("#commonCurrency_edit option:selected").val();
console.log("commonCurrency",commonCurrency);
});
$('#customerContact_edit').on('select2:select', function (e) {
var data = e.params.data;
$("input[name='contactPost']").val(data.customerPosition);
$("input[name='contactNumber']").val(data.cellPhone);
$("input[name='contactEmail']").val(data.commonEmail);
});
$('#customerDelivery_edit').on('select2:select', function (e) {
var data1 = e.params.data;
$("input[name='deliveryPhone']").val(data1.customerPhone);
$("input[name='deliveryAddress']").val(data1.deliveryAddress);
});
function queryParams(params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
quoteId: sysSalesOrder.salesOrderCode,
};
curParams.quoteId = sysSalesOrder.salesOrderCode;
return curParams;
}
/*业务员列表*/
$.ajax({
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData:"+rowData);
var totalNum = $("#bootstrap-select-table").bootstrapTable('getData').length;
var rmb1 = $("#taxRate_edit").val();
if (rmb1 =='' || rmb1== null){
rmb1 = 0;
}else{
rmb1 = $("#taxRate_edit").val();
}
var rmb = Number(rmb1).toFixed(2) / 100;
var usd = $("#usdTax_edit").val();
if (usd =='' || usd== null){
usd = 0;
}else{
usd = Number(usd).toFixed(2);
}
$("#bootstrap-sub-table-editOrder4").bootstrapTable('insertRow', {
index: 1,
row: {
id:'',
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
photoUrl: rowData.photoUrl,
unit: rowData.unit,
processMethod: rowData.processMethod,
countTax:rmb,
usdTax: usd,
materialSole: rowData.materialSole,
materialNum: 0,
materialNoRmb: 0.0,
materialNoUsd: 0.0,
materialRmb: 0.0,
materialNoRmbSum: 0.0,
materialRmbSum: 0,
materialUsd: 0.0,
materialUsdSum: 0.0,
materialNoUsdSum: 0.0,
remark: "",
}
})
layer.close(index);
}
function insertRow() {
var url = ctx + "erp/material/select";
var options = {
title: '选择料号',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(index){
$("#bootstrap-sub-table-editOrder4").bootstrapTable('remove', {
field: 'index',
value: index
})
}
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='deliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='orderReceivingTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='modificationTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//计算
function getTotalAmount(){
let getData = $("#bootstrap-sub-table-editOrder4").bootstrapTable('getData');
let enterprise = 0;let enterpriseSum = 0; let noRmb = 0;
let rmb = 0;let noRmbSum =0;let rmbSum = 0;
let noUsd = 0;let usd = 0;let noUsdSum =0; let usdSum = 0;
$("input[name='materialSum']").val(0);
$("input[name='enterpriseSum']").val(0);
$("input[name='noRmbPrice']").val(0);
$("input[name='noRmbSum']").val(0);
$("input[name='rmbPrice']").val(0);
$("input[name='rmbTaxSum']").val(0);
$("input[name='noUsdPrice']").val(0);
$("input[name='noUsdSum']").val(0);
$("input[name='usdPrice']").val(0);
$("input[name='usdTaxSum']").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = parseInt(enterprise + getData[i].materialNum);
noRmb = parseFloat(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = parseFloat(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = parseFloat(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = parseFloat(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = parseFloat(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = parseFloat(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = parseFloat(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = parseFloat(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("input[name='materialSum']").val(enterprise);
$("input[name='enterpriseSum']").val(enterpriseSum);
$("input[name='noRmbPrice']").val(noRmb);
$("input[name='noRmbSum']").val(noRmbSum);
$("input[name='rmbPrice']").val(rmb);
$("input[name='rmbTaxSum']").val(rmbSum);
$("input[name='noUsdPrice']").val(noUsd);
$("input[name='noUsdSum']").val(noUsdSum);
$("input[name='usdPrice']").val(usd);
$("input[name='usdTaxSum']").val(usdSum);
}
$("input[name='pricingDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='deliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='orderReceivingTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='modificationTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

142
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

@ -15,6 +15,9 @@
<form class="form-horizontal m" id="form-ywjl-audit" th:object="${formData}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
@ -112,7 +115,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text" required>
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -150,7 +153,7 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" class="form-control" th:field="*{usdTax}" type="number" required disabled/>
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required disabled/>
</div>
</div>
<div class="form-group">
@ -166,7 +169,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text">
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
@ -235,60 +238,72 @@
</select>
</div>
</div>
<div class="container">
<div class="form-group">
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_ywjlVerifyApproved" id="ywjlVerifyApproved" class="form-control m-b" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</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>
</div>
</div>
<div class="container">
<h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="materialSum" id="enterprise_edit" type="number" th:field="*{materialSum}" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" th:field="*{enterpriseSum}" readonly/>
<label class=" col-sm-2">物料合计:</label>
<input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" disabled />
<label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbPrice" id="noRmb_edit" type="number" th:field="*{noRmbPrice}" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" th:field="*{noRmbSum}" readonly/>
<label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" disabled />
<label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmbPrice" id="rmb_edit" type="number" th:field="*{rmbPrice}" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" id="rmbTax_edit" type="number" th:field="*{rmbTaxSum}" readonly/>
<label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" disabled />
<label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" disabled />
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsdPrice" id="noUsd_edit" type="number" th:field="*{noUsdPrice}" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" th:field="*{noUsdSum}" readonly/>
<label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" disabled />
<label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usdPrice" id="usd_edit" type="number" th:field="*{usdPrice}" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdTaxSum" id="usdSum_edit" type="number" th:field="*{usdTaxSum}" readonly/>
<label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" disabled />
<label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" disabled />
</div>
</div>
</form>
<div class="container">
<div class="form-group">
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_ywjlVerifyApproved" id="ywjlVerifyApproved" class="form-control m-b" required>
<option value=""></option>
<option value="true">同意</option>
<option value="false">拒绝</option>
</select>
</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>
<div class="container">
<input type="hidden" name="salesOrderChildList" >
</div>
</div>
</form>
<div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder"></table>
<table id="bootstrap-sub-table-editOrder1"></table>
</div>
</div>
</div>
@ -312,7 +327,7 @@
$("#form-ywjl-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
id:'bootstrap-sub-table-editOrder1',
url: ctx + "system/orderChild/list",
pagination: false,
queryParams: queryParams,
@ -502,16 +517,6 @@
}
},
});
$("#enterprise_edit").val(sysSalesOrder.enterprise);
$("#enterpriseSum_edit").val(sysSalesOrder.enterpriseSum);
$("#noRmb_edit").val(sysSalesOrder.noRmb);
$("#rmb_edit").val(sysSalesOrder.rmb);
$("#noRmbSum_edit").val(sysSalesOrder.noRmbSum);
$("#rmbTax_edit").val(sysSalesOrder.rmbSum);
$("#noUsd_edit").val(sysSalesOrder.noUsd);
$("#usd_edit").val(sysSalesOrder.usd);
$("#noUsdSum_edit").val(sysSalesOrder.noUsdSum);
$("#usdSum_edit").val(sysSalesOrder.usdSum);
});
$('#enterpriseCode_edit').on('select2:select', function (e) {
var data = e.params.data;
@ -539,23 +544,21 @@
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
quoteId: sysSalesOrder.salesOrderCode,
quoteId: sysSalesOrder.salesOrderCode
};
curParams.quoteId = sysSalesOrder.salesOrderCode;
return curParams;
}
/*业务员列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-ywjl-audit select[name='businessMembers']").append(
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-ywjl-audit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -579,7 +582,7 @@
}else{
usd = Number(usd).toFixed(2);
}
$("#bootstrap-sub-table-editOrder").bootstrapTable('insertRow', {
$("#bootstrap-sub-table-editOrder1").bootstrapTable('insertRow', {
index: 1,
row: {
id:'',
@ -595,15 +598,15 @@
countTax:rmb,
usdTax: usd,
materialSole: rowData.materialSole,
materialNum: '',
materialNoRmb: '',
materialNoUsd: '',
materialRmb: '',
materialNoRmbSum: '',
materialRmbSum: '',
materialUsd: '',
materialUsdSum: '',
materialNoUsdSum: '',
materialNum: 0,
materialNoRmb: 0.0,
materialNoUsd: 0.0,
materialRmb: 0.0,
materialNoRmbSum: 0.0,
materialRmbSum: 0,
materialUsd: 0.0,
materialUsdSum: 0.0,
materialNoUsdSum: 0.0,
remark: "",
}
})
@ -620,7 +623,7 @@
}
/* 删除指定表格行 */
function removeRow(index){
$("#bootstrap-sub-table-editOrder").bootstrapTable('remove', {
$("#bootstrap-sub-table-editOrder1").bootstrapTable('remove', {
field: 'index',
value: index
})
@ -648,7 +651,7 @@
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
let getData = $("#bootstrap-sub-table-editOrder1").bootstrapTable('getData');
let enterprise = 0;let enterpriseSum = 0; let noRmb = 0;
let rmb = 0;let noRmbSum =0;let rmbSum = 0;
let noUsd = 0;let usd = 0;let noUsdSum =0; let usdSum = 0;
@ -707,16 +710,15 @@
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-ywjl-audit").serializeArray();
var tableData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData');
var rows = tableData.length;
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var tableData = $("#bootstrap-sub-table-editOrder1").bootstrapTable('getData');
$("input[name= 'salesOrderChildList']").val(JSON.stringify(tableData));
var formData = $("#form-ywjl-audit").serialize();
console.log("$(\"#form-ywjl-audit\").serialize()",formData);
var taskId = [[${taskId}]];
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.save(prefix + "/complete/" + taskId, $('#form-ywjl-audit').serialize());
$.operate.save(prefix + "/complete/" + taskId,formData);
}
}
</script>

271
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html

@ -12,14 +12,17 @@
</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}">
<form class="form-horizontal m" id="form-ywzg-audit" th:object="${formData}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" 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>
<input name="applyUser" th:field="*{applyUser}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
@ -34,96 +37,98 @@
<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" hidden="hidden">
<label class="col-sm-3 control-label is-required">订单索引号:</label>
<div class="col-sm-8">
<input name="salesOrderID" class="form-control" th:field="*{salesOrderId}" type="number" required >
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group" hidden="hidden">
<label class="col-sm-3 control-label is-required">销售订单编号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" class="form-control" th:field="*{salesOrderCode}" type="text" required >
<input name="salesOrderCode" class="form-control" th:field="*{salesOrderCode}" type="text" required disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户ID:</label>
<div class="col-sm-8">
<select id="enterpriseCode" name="enterpriseCode" class="form-control m-b" th:field="*{enterpriseCode}" required>
<option value="">请选择</option>
</select>
<input id="enterpriseCode_edit" name="enterpriseCode"
class="form-control m-b" required disabled th:field="*{enterpriseCode}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户名称:</label>
<div class="col-sm-8">
<input required name="enterpriseName" class="form-control" type="text" th:field="*{enterpriseName}" readonly>
<input name="enterpriseName" class="form-control" type="text"
th:field="*{enterpriseName}" required disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">事业部:</label>
<div class="col-sm-8">
<input readonly name="customerPurser" class="form-control" th:field="*{customerPurser}" type="text" disabled>
<input name="customerPurser" class="form-control"
th:field="*{customerPurser}" type="text" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户联系人:</label>
<div class="col-sm-8">
<select id="customerContact" name="customerContact" th:field="*{customerContact}" class="form-control m-b" required>
</select>
<input id="customerContact_edit" name="customerContact"
th:field="*{customerContact}" class="form-control m-b" required disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人职务:</label>
<div class="col-sm-8">
<input readonly name="contactPost" th:field="*{contactPost}" class="form-control" type="text" >
<input name="contactPost" th:field="*{contactPost}" class="form-control"
type="text" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">联系人电话:</label>
<div class="col-sm-8">
<input readonly name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" >
<input name="contactNumber" th:field="*{contactNumber}"
class="form-control" type="text" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人邮箱:</label>
<div class="col-sm-8">
<input readonly name="contactEmail" th:field="*{contactEmail}" class="form-control" type="text" required>
<input name="contactEmail" th:field="*{contactEmail}" class="form-control"
type="text" required disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户收货人:</label>
<div class="col-sm-8">
<select name="customerDelivery" th:field="*{customerDelivery}" class="form-control m-b" required>
</select>
<input name="customerDelivery" id="customerDelivery_edit"
th:field="*{customerDelivery}" class="form-control m-b" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input readonly name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" required>
<input name="deliveryPhone" th:field="*{deliveryPhone}"
class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货地址:</label>
<div class="col-sm-8">
<input readonly name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" required>
<input name="deliveryAddress" th:field="*{deliveryAddress}"
class="form-control" type="text" required disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text" required>
<input name="salesOrderNumber" th:field="*{salesOrderNumber}"
class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单类型:</label>
<div class="col-sm-8">
<select name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required>
<option value="">请选择</option>
<select name="salesOrderType" class="form-control" type="text"
th:with="dictList=${@dict.getType('sys_order_type')}"
th:field="*{salesOrderType}" required disabled>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
@ -132,54 +137,62 @@
<label class="col-sm-3 control-label">接单日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="orderReceivingTime" class="form-control" th:field="*{orderReceivingTime}" placeholder="yyyy-mm-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="orderReceivingTime" class="form-control"
th:field="*{orderReceivingTime}" placeholder="yyyy-mm-dd" type="text" disabled>
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">接单方式:</label>
<div class="col-sm-8">
<input name="orderReceivingMode" class="form-control" th:field="*{orderReceivingMode}" type="text">
<input name="orderReceivingMode" class="form-control"
th:field="*{orderReceivingMode}" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">报价币种:</label>
<div class="col-sm-8">
<select class="form-control" id="commonCurrency_add" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required>
<option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
<select class="form-control" id="commonCurrency_edit" name="commonCurrency"
th:with="dictList=${@dict.getType('sys_common_currency')}"
th:field="*{commonCurrency}" required disabled>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}"
th:text="${dict.dictLabel}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" class="form-control" th:field="*{usdTax}" type="text" required />
<input name="usdTax" id="usdTax_edit" class="form-control"
th:field="*{usdTax}" type="number" required disabled/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否含税:</label>
<div class="col-sm-8">
<label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input required type="radio" th:id="${'confirmTax_' + dict.dictCode}"
name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
<input required type="radio" th:id="${'confirmFax_' + dict.dictCode}"
name="confirmFax" th:value="${dict.dictValue}"
th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text">
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}"
class="form-control" type="number" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">是否开票:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<label class="col-sm-6 control-label is-required">是否开票:</label>
<div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input required type="radio" th:id="${'invoice_' + dict.dictCode}"
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}">
name="invoice" th:value="${dict.dictValue}"
th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
@ -187,27 +200,31 @@
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text">
<input name="paymentTerms" th:field="*{paymentTerms}"
class="form-control" type="text" disabled/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货方式:</label>
<div class="col-sm-8">
<input name="deliveryMethod" th:field="*{deliveryMethod}" class="form-control" type="text">
<input name="deliveryMethod" th:field="*{deliveryMethod}"
class="form-control" type="text" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交货条件:</label>
<div class="col-sm-8">
<input name="deliveryConditions" th:field="*{deliveryConditions}" class="form-control" type="text">
<input name="deliveryConditions" th:field="*{deliveryConditions}"
class="form-control" type="text" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">计划交付时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryTime" class="form-control" placeholder="yyyy-mm-dd" type="text" th:field="*{deliveryTime}" />
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="deliveryTime" class="form-control"
placeholder="yyyy-mm-dd" type="text" th:field="*{deliveryTime}" disabled/>
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
@ -215,85 +232,97 @@
<label class="col-sm-3 control-label">客户验收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="modificationTime" class="form-control" placeholder="yyyy-mm-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input name="modificationTime" th:field="*{modificationTime}"
class="form-control" placeholder="yyyy-mm-dd" type="text" disabled/>
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}"></textarea>
<textarea name="tradeClause" class="form-control"
th:field="*{tradeClause}" disabled></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea>
<textarea name="remark" class="form-control"
th:field="*{remark}" disabled></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" required>
</select>
<input name="businessMembers" class="form-control m-b"
th:field="*{businessMembers}" required disabled />
</div>
</div>
<div class="container">
<div class="form-group">
<label class="col-sm-3 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_ywzgVerifyApproved" id="ywzgVerifyApproved" 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>
</div>
<div class="container">
<h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="materialSum" id="enterprise_edit" type="number" th:field="*{materialSum}" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" th:field="*{enterpriseSum}" readonly/>
<label class=" col-sm-2">物料合计:</label>
<input class="col-sm-4" name="materialSum"
th:field="*{materialSum}" id="enterprise_edit" type="number" disabled />
<label class=" col-sm-2">数量合计:</label>
<input class="col-sm-4" name="enterpriseSum" th:field="*{enterpriseSum}" id="enterpriseSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbPrice" id="noRmb_edit" type="number" th:field="*{noRmbPrice}" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" th:field="*{noRmbSum}" readonly/>
<label class="col-sm-2"> 不含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbPrice" th:field="*{noRmbPrice}" id="noRmb_edit" type="number" disabled />
<label class="col-sm-2"> 不含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="noRmbSum" th:field="*{noRmbSum}" id="noRmbSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmbPrice" id="rmb_edit" type="number" th:field="*{rmbPrice}" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" id="rmbTax_edit" type="number" th:field="*{rmbTaxSum}" readonly/>
<label class="col-sm-2"> 含税单价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbPrice" th:field="*{rmbPrice}" id="rmb_edit" type="number" disabled />
<label class="col-sm-2"> 含税总价:</label>
<input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" th:field="*{rmbTaxSum}" id="rmbTax_edit" type="number" disabled />
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsdPrice" id="noUsd_edit" type="number" th:field="*{noUsdPrice}" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" th:field="*{noUsdSum}" readonly/>
<label class="col-sm-2">不含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdPrice" th:field="*{noUsdPrice}" id="noUsd_edit" type="number" disabled />
<label class="col-sm-2">不含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="noUsdSum" th:field="*{noUsdSum}" id="noUsdSum_edit" type="number" disabled />
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usdPrice" id="usd_edit" type="number" th:field="*{usdPrice}" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdTaxSum" id="usdSum_edit" type="number" th:field="*{usdTaxSum}" readonly/>
<label class="col-sm-2">含税单价:</label>
<input placeholder="美元" class="col-sm-4" name="usdPrice" th:field="*{usdPrice}" id="usd_edit" type="number" disabled />
<label class="col-sm-2">含税总价:</label>
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" disabled />
</div>
</div>
<input type="hidden" name="salesOrderChildList" >
</form>
<div class="container">
<div class="form-group">
<label class="col-sm-3 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
<select name="p_B_ywzgVerifyApproved" id="ywzgVerifyApproved" 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>
</div>
<div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder"></table>
<table id="bootstrap-sub-table-editOrder2"></table>
</div>
</div>
</div>
@ -305,7 +334,6 @@
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/customer";
var prefix = ctx + "system/salesOrder";
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
@ -313,10 +341,10 @@
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysSalesOrder = [[${formData}]];
$("#form-edit").validate({focusCleanup: true});
$("#form-ywzg-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
id:'bootstrap-sub-table-editOrder2',
url: ctx + "system/orderChild/list",
pagination: false,
queryParams: queryParams,
@ -455,10 +483,10 @@
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-edit select[name='enterpriseCode']").append(
$("#form-ywzg-audit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-edit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change");
$("#form-ywzg-audit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -477,34 +505,27 @@
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-edit select[name='customerDelivery']").append(
$("#form-ywzg-audit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-edit select[name='customerDelivery']").val(sysSalesOrder.customerDelivery).trigger()
$("#form-ywzg-audit select[name='customerDelivery']").val(sysSalesOrder.customerDelivery).trigger()
}
}
});
$.ajax({
type: "post",
url:ctx + "system/contacts/list",
dataType:"json",
delay:250,
cache:true,
data:{
enterpriseCode:sysSalesOrder.enterpriseCode,
},
success: function (res, params) {
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var result = res.rows;
for (let i in result) {
$("#form-edit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
var usertData = res.rows;
for (let i in usertData) {
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-edit select[name='customerContact']").val(sysSalesOrder.customerContact).trigger("change");
} else {
$.modal.msgError(res.msg);
}
},
}
});
$("#enterprise_edit").val(sysSalesOrder.enterprise);
$("#enterpriseSum_edit").val(Number(sysSalesOrder.enterpriseSum));
@ -557,10 +578,10 @@
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-edit select[name='businessMembers']").append(
$("#form-ywzg-audit select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-edit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
$("#form-ywzg-audit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -584,7 +605,7 @@
}else{
usd = Number(usd).toFixed(2);
}
$("#bootstrap-sub-table-editOrder").bootstrapTable('insertRow', {
$("#bootstrap-sub-table-editOrder2").bootstrapTable('insertRow', {
index: 1,
row: {
id:'',
@ -625,7 +646,7 @@
}
/* 删除指定表格行 */
function removeRow(index){
$("#bootstrap-sub-table-editOrder").bootstrapTable('remove', {
$("#bootstrap-sub-table-editOrder2").bootstrapTable('remove', {
field: 'index',
value: index
})
@ -650,26 +671,10 @@
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-edit").serializeArray();
var tableData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData');
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
console.log("jsonData");
console.log(jsonData);
$.operate.saveJson(prefix + "/edit", jsonData);
}
}
}
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
let getData = $("#bootstrap-sub-table-editOrder2").bootstrapTable('getData');
let enterprise = 0;let enterpriseSum = 0; let noRmb = 0;
let rmb = 0;let noRmbSum =0;let rmbSum = 0;
let noUsd = 0;let usd = 0;let noUsdSum =0; let usdSum = 0;
@ -731,8 +736,12 @@
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var tableData = $("#bootstrap-sub-table-editOrder2").bootstrapTable('getData');
$("input[name= 'salesOrderChildList']").val(JSON.stringify(tableData));
var formData = $("#form-ywzg-audit").serialize();
console.log("$(\"#form-ywzg-audit\").serialize()",formData);
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize());
$.operate.save(prefix + "/complete/" + taskId,formData);
}
}

37
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

@ -15,6 +15,9 @@
<form class="form-horizontal m" id="form-zozj-audit" th:object="${formData}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input name="taskName" th:field="*{taskName}" type="hidden">
<input name="instanceId" th:field="*{instanceId}" type="hidden">
<input name="instanceType" th:field="*{instanceType}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
@ -128,7 +131,7 @@
<div class="input-group date">
<input name="orderReceivingTime" class="form-control"
th:field="*{orderReceivingTime}" placeholder="yyyy-mm-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
@ -288,19 +291,17 @@
<input placeholder="美元" class="col-sm-4" name="usdTaxSum" th:field="*{usdTaxSum}" id="usdSum_edit" type="number" disabled />
</div>
</div>
</form>
<div class="other-container">
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()" disabled>
<i class="fa fa-plus"></i> 添加物料
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-editOrder"></table>
<table id="bootstrap-sub-table-editOrder3"></table>
</div>
</div>
</div>
@ -324,7 +325,7 @@
$("#form-zozj-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
id:'bootstrap-sub-table-editOrder3',
url: ctx + "system/orderChild/list",
pagination: false,
queryParams: queryParams,
@ -558,16 +559,15 @@
}
/*业务员列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-zozj-audit select[name='businessMembers']").append(
$("#select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-zozj-audit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -591,7 +591,7 @@
}else{
usd = Number(usd).toFixed(2);
}
$("#bootstrap-sub-table-editOrder").bootstrapTable('insertRow', {
$("#bootstrap-sub-table-editOrder3").bootstrapTable('insertRow', {
index: 1,
row: {
id:'',
@ -632,7 +632,7 @@
}
/* 删除指定表格行 */
function removeRow(index){
$("#bootstrap-sub-table-editOrder").bootstrapTable('remove', {
$("#bootstrap-sub-table-editOrder3").bootstrapTable('remove', {
field: 'index',
value: index
})
@ -660,7 +660,7 @@
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
let getData = $("#bootstrap-sub-table-editOrder3").bootstrapTable('getData');
let enterprise = 0;let enterpriseSum = 0; let noRmb = 0;
let rmb = 0;let noRmbSum =0;let rmbSum = 0;
let noUsd = 0;let usd = 0;let noUsdSum =0; let usdSum = 0;
@ -719,16 +719,15 @@
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-zozj-audit").serializeArray();
var tableData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData');
var rows = tableData.length;
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var tableData = $("#bootstrap-sub-table-editOrder3").bootstrapTable('getData');
$("input[name= 'salesOrderChildList']").val(JSON.stringify(tableData));
var formData = $("#form-zozj-audit").serialize();
console.log("$(\"#form-zozj-audit\").serialize()",formData);
var taskId = [[${taskId}]];
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.save(prefix + "/complete/" + taskId, $('#form-zozj-audit').serialize());
$.operate.save(prefix + "/complete/" + taskId, formData);
}
}

Loading…
Cancel
Save