Browse Source

[fix]销售模块,销售订单中审核功能部分添加审核主题,销售订单添加详情页面。

dev
zhangsiqi 8 months ago
parent
commit
f28d00fd21
  1. 34
      ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html
  2. 724
      ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html
  3. 354
      ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html
  4. 21
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html
  5. 12
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html
  6. 474
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html
  7. 430
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html
  8. 535
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

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

@ -480,7 +480,7 @@
row.materialUsdSum = Number(row.materialNum * Number(row.materialUsd)).toFixed(2);
}
else if( commonCurrency1 == 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);
@ -681,16 +681,16 @@
photoUrl: rowData.photoUrl,
countTax: '',
usdTax: '',
materialNum: "",
materialSole: "",
materialRmb: "",
materialNoRmb: "",
materialNoUsd: "",
materialUsd: "",
materialUsdSum: "",
materialNoUsdSum: "",
materialNoRmbSum: "",
materialRmbSum: "",
materialNum: 0,
materialNoRmb: 0.00,
materialNoUsd: 0.00,
materialRmb: 0.00,
materialNoRmbSum: 0.00,
materialRmbSum: 0.00,
materialUsd: 0.00,
materialUsdSum: 0.00,
materialNoUsdSum: 0.00,
createBy: "",
createTime: "",
updateBy: "",
@ -718,18 +718,18 @@
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(id){
function removeRow(index){
$("#bootstrap-sub-table-order").bootstrapTable('remove', {
field: 'id',
values: id
field: 'index',
values: index
})
}
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData', true);
let enterprise = Number(0);let enterpriseSum = Number(0); let noRmb = Number(0);
let rmb = Number(0);let noRmbSum = Number(0);let rmbSum = Number(0);let noUsd = Number(0);
let usd = Number(0);let noUsdSum = Number(0); let usdSum = Number(0);
let getData = $("#bootstrap-sub-table-order").bootstrapTable('getData');
let enterprise = Number(0);let enterpriseSum = Number(0).toFixed(0); let noRmb = Number(0).toFixed(0);
let rmb = Number(0).toFixed(2);let noRmbSum =Number(0).toFixed(2);let rmbSum = Number(0).toFixed(2);let noUsd = Number(0).toFixed(2);
let usd = Number(0).toFixed(2);let noUsdSum = Number(0).toFixed(2); let usdSum = Number(0).toFixed(2);
$("#enterprise_add").val(0);
$("#enterpriseSum_add").val(0);
$("#noRmb_add").val(0);

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

@ -0,0 +1,724 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改销售订单')" />
<th:block th:include="include :: datetimepicker-css" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<th:block th:include="include :: bootstrap-editable-css"/>
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<style>
.division {
width: 90%;
border-bottom: 1px solid #f1ecec;
padding: 10px 0 0;
margin: 0 auto 30px;
}
/*.changeWidth {*/
/* width: 33.3% !important;*/
/*}*/
.col-sm-3 {
width: 30%;
}
.select2-container--open {
z-index: 9999999
}
.other-container {
width: 85%;
height: 400px;
margin: auto;
}
.hiddenDetailInfo {
display: none;
}
.search-collapse, .select-table {
box-shadow: none;
}
.btn-group-sm {
padding: 0 40px;
}
.get-finish-product h4 {
padding: 0 40px;
}
.table-responsive {
overflow-x: inherit;
}
.title {
padding: 10px 30px 0;
margin: 0 0 -10px 0;
font-size: 20px;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m " id="form-salesOrder-edit" th:object="${sysSalesOrder}">
<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 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 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_edit" name="enterpriseCode" class="form-control m-b" required disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户名称:</label>
<div class="col-sm-8">
<input name="enterpriseName" class="form-control" type="text" th:field="*{enterpriseName}" readonly disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">事业部:</label>
<div class="col-sm-8">
<input name="customerPurser" class="form-control" th:field="*{customerPurser}" type="text" readonly 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_edit" name="customerContact" th:field="*{customerContact}" class="form-control m-b" required disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人职务:</label>
<div class="col-sm-8">
<input name="contactPost" th:field="*{contactPost}" class="form-control" type="text" readonly disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">联系人电话:</label>
<div class="col-sm-8">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人邮箱:</label>
<div class="col-sm-8">
<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" id="customerDelivery_edit"
th:field="*{customerDelivery}" class="form-control m-b" disabled>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<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 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" 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"
th:with="dictList=${@dict.getType('sys_order_type')}" th:field="*{salesOrderType}" required disabled>
<option value="">请选择</option>
<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">接单日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="orderReceivingTime" class="form-control" type="text"
th:field="*{orderReceivingTime}" placeholder="yyyy-mm-dd" 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" 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_edit" 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>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<div class="col-sm-8">
<input name="usdTax" id="usdTax_edit" class="form-control" th:field="*{usdTax}" type="number" required />
</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_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>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" id="taxRate_edit" th:field="*{taxRate}" class="form-control" type="number">
</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')}">
<input required type="radio" th:id="${'invoice_' + dict.dictCode}"
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'invoice_' + 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="paymentTerms" th:field="*{paymentTerms}" 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="deliveryMethod" th:field="*{deliveryMethod}" 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="deliveryConditions" th:field="*{deliveryConditions}" class="form-control" type="text">
</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>
</div>
</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="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>
<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>
</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>
</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>
</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/>
</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/>
</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/>
</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/>
</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/>
</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>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
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 = [[${sysSalesOrder}]];
$("#form-salesOrder-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
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-salesOrder-edit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-salesOrder-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));
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2));
$("#rmb_edit").val(Number(sysSalesOrder.rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(sysSalesOrder.noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(sysSalesOrder.rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(sysSalesOrder.noUsd).toFixed(2));
$("#usd_edit").val(Number(sysSalesOrder.usd).toFixed(2));
$("#noUsdSum_edit").val(Number(sysSalesOrder.noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(sysSalesOrder.usdSum).toFixed(2));
});
$('#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 data = e.params.data;
$("input[name='deliveryPhone']").val(data.customerPhone);
$("input[name='deliveryAddress']").val(data.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/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];
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-editOrder").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:rmb1 ,
usdTax: usd,
materialSole: rowData.materialSole,
materialNum: 0.00,
materialNoRmb: 0.00,
materialNoUsd: 0.00,
materialRmb: 0.00,
materialNoRmbSum: 0.00,
materialRmbSum: 0.00,
materialUsd: 0.00,
materialUsdSum: 0.00,
materialNoUsdSum: 0.00,
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-editOrder").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 submitHandler() {
if ($.validate.form()) {
var formData = $("#form-salesOrder-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(){
let getData = $("#bootstrap-sub-table-editOrder").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;
$("#enterprise_edit").val(0);
$("#enterpriseSum_edit").val(0);
$("#noRmb_edit").val(0);
$("#rmb_edit").val(0);
$("#noRmbSum_edit").val(0);
$("#rmbTax_edit").val(0);
$("#noUsd_edit").val(0);
$("#usd_edit").val(0);
$("#noUsdSum_edit").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_edit").val(Number(noRmb).toFixed(2));
$("#rmb_edit").val(Number(rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(noUsd).toFixed(2));
$("#usd_edit").val(Number(usd).toFixed(2));
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(usdSum).toFixed(2));
}
// 结算金额
</script>
</body>
</html>

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

@ -72,7 +72,7 @@
<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="salesOrderId" class="form-control" th:field="*{salesOrderId}" type="number" required >
</div>
</div>
<div class="form-group" hidden="hidden">
@ -97,7 +97,7 @@
<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" readonly>
</div>
</div>
<div class="form-group">
@ -110,13 +110,13 @@
<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" readonly>
</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" readonly >
</div>
</div>
<div class="form-group">
@ -128,14 +128,14 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户收货人:</label>
<div class="col-sm-8">
<select name="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b" >
<select name="customerDelivery" id="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b" >
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" >
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" />
</div>
</div>
<div class="form-group">
@ -177,7 +177,7 @@
<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>
<select class="form-control" id="commonCurrency_edit" 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>
@ -194,7 +194,7 @@
<div class="col-sm-8">
<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}">
name="confirmTax" th:value="${dict.dictValue}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
@ -210,7 +210,7 @@
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<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}">
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
@ -274,24 +274,24 @@
<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="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/>
<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/>
</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" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
<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="*{noRmbTaxSum}" readonly/>
</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" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbTaxSum" id="rmbTax_edit" type="number" readonly/>
<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/>
</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" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" readonly/>
<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="*{noUsdTaxSum}" readonly/>
</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" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdTaxSum" id="usdSum_edit" type="number" readonly/>
<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/>
</div>
</div>
</form>
@ -319,14 +319,12 @@
<script th:inline="javascript">
var prefix = ctx + "system/salesOrder";
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var materialTypeDatas = [[${@category.getType('sys_material_type')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysSalesOrder = [[${sysSalesOrder}]];
$("#form-salesOrder-edit").validate({
focusCleanup: true
});
$("#form-salesOrder-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
@ -369,19 +367,15 @@
}
},
{ 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: '国内税率',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) {
commonCurrency = $("#commonCurrency_edit option:selected").val();
if (commonCurrency == 1){
var commonCurrency3 = $("#commonCurrency_edit option:selected").val();
if (commonCurrency3 == 1){
return true;
}else{
return false;
@ -392,78 +386,33 @@
field: 'materialNoUsd',
align: 'center',
editable: function(value, row, index) {
commonCurrency = $("#commonCurrency_edit option:selected").val();
if (commonCurrency == 2){
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',
},
{
field: 'createBy',
align: 'center',
title: '录入人',
visible: false
},
{
field: 'createTime',
align: 'center',
title: '录入时间',
visible: false
},
{
field: 'updateBy',
align: 'center',
title: '更新人',
visible: false
},
{
field: 'updateTime',
align: 'center',
title: '上次更新时间',
visible: false
},
{
field: 'remark',
align: 'center',
title: '备注',
visible: false
},
{
field: 'auditStatus',
align: 'center',
title: '审核状态',
visible: 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.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
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('');
}
}
@ -483,7 +432,6 @@
}else{
usd = Number(usd).toFixed(2);
}
console.log(commonCurrency1);
if(commonCurrency1 == 1){
row.materialNoRmb = Number(row.materialNoRmb).toFixed(2);
row.materialRmb = Number(row.materialNoRmb * Number(1 + rmb));
@ -493,7 +441,6 @@
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);
@ -509,6 +456,98 @@
},
};
$.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-salesOrder-edit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-salesOrder-edit 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-salesOrder-edit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-salesOrder-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));
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2));
$("#rmb_edit").val(Number(sysSalesOrder.rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(sysSalesOrder.noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(sysSalesOrder.rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(sysSalesOrder.noUsd).toFixed(2));
$("#usd_edit").val(Number(sysSalesOrder.usd).toFixed(2));
$("#noUsdSum_edit").val(Number(sysSalesOrder.noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(sysSalesOrder.usdSum).toFixed(2));
});
$('#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 data = e.params.data;
$("input[name='deliveryPhone']").val(data.customerPhone);
$("input[name='deliveryAddress']").val(data.deliveryAddress);
});
function queryParams(params) {
var curParams = {
@ -525,27 +564,38 @@
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
console.log(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(userName).trigger("change");
$("#form-salesOrder-edit select[name='businessMembers']").val(sysSalesOrder.businessMembers).trigger("change");
} else {
$.modal.msgError(res.msg);
}
}
});
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
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-editOrder").bootstrapTable('insertRow', {
index: totalNum,
index: 1,
row: {
id:'',
materialId:rowData.id,
@ -557,18 +607,18 @@
photoUrl: rowData.photoUrl,
unit: rowData.unit,
processMethod: rowData.processMethod,
countTax: '',
usdTax: '',
materialSole: "",
materialNum: "",
materialNoRmb: "",
materialNoUsd: "",
materialRmb: "",
materialNoRmbSum: "",
materialRmbSum: "",
materialUsd: "",
materialUsdSum: "",
materialNoUsdSum: "",
countTax:rmb1 ,
usdTax: usd,
materialSole: rowData.materialSole,
materialNum: 0.00,
materialNoRmb: 0.00,
materialNoUsd: 0.00,
materialRmb: 0.00,
materialNoRmbSum: 0.00,
materialRmbSum: 0.00,
materialUsd: 0.00,
materialUsdSum: 0.00,
materialNoUsdSum: 0.00,
remark: "",
}
})
@ -584,38 +634,36 @@
$.modal.openOptions(options);
}
/* 删除指定表格行 */
function removeRow(rowData){
function removeRow(index){
$("#bootstrap-sub-table-editOrder").bootstrapTable('remove', {
field: 'id',
values: rowData.index
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
// });
$("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 submitHandler() {
if ($.validate.form()) {
var formData = $("#form-salesOrder-edit").serializeArray();
console.log("formData",formData);
var tableData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData');
console.log("tableData",JSON.stringify(tableData));
var rows = tableData.length;
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
@ -630,29 +678,37 @@
}
//计算
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-editOrder").bootstrapTable('getData', true);
var enterprise = "";let enterpriseSum = 0; let noRmb = 0;
let getData = $("#bootstrap-sub-table-editOrder").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;
$("#enterprise_edit").val(0);
$("#enterpriseSum_edit").val(0);
$("#noRmb_edit").val(0);
$("#rmb_edit").val(0);
$("#noRmbSum_edit").val(0);
$("#rmbTax_edit").val(0);
$("#noUsd_edit").val(0);
$("#usd_edit").val(0);
$("#noUsdSum_edit").val(0);
for(let i=0;i<getData.length;i++){
enterprise += getData[i].materialName + ":" + getData[i].materialNum +",";
enterpriseSum += getData[i].materialNum;
noRmb += getData[i].materialNoRmb;
rmb += getData[i].materialRmb ;
noRmbSum += getData[i].materialNoRmbSum;
rmbSum += getData[i].materialRmbSum;
noUsd += getData[i].materialNoUsd ;
usd += getData[i].materialUsd ;
noUsdSum += getData[i].materialNoUsdSum;
usdSum += getData[i].materialUsdSum;
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_edit").val(Number(noRmb).toFixed(2));
$("#rmb_edit").val(Number(rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2));
$("#rmbSum_edit").val(Number(rmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(noUsd).toFixed(2));
$("#usd_edit").val(Number(usd).toFixed(2));
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2));

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

@ -190,6 +190,9 @@
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<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 th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:salesOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:salesOrder:remove')}]];
@ -237,7 +240,7 @@
{checkbox: true},
{title: '订单id',field: 'salesOrderId',visible: false},
{title: '流程实例ID',field: 'instanceId',visible: false},
{ itle: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false},
{ title:'流程作废实例ID',field: 'cancelInstanceId',visible: false},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false},
{ title: '流程实例类型', field: 'instanceTypeName',visible: false},
@ -277,7 +280,7 @@
},
{title: '业务人员',field: 'businessMembers',visible: false},
{title: '销售单号',field: 'salesOrderCode'},
{title: '订单类型',field: 'salesOrderType',fatter: function(value, row, index) {
{title: '订单类型',field: 'salesOrderType',formatter: function(value, row, index) {
return $.table.selectDictLabel(salesOrderTypeDatas, value);
}
},
@ -286,7 +289,7 @@
{title: '客户订单号',field: 'salesOrderNumber'},
{title: '物料数合计',field: 'materialSum'},
{title: '数量合计',field: 'enterpriseSum'},
{title: '是否含税',field:'confirmTax',function(value, row, index) {
{title: '是否含税',field:'confirmTax',formatter:function(value, row, index) {
$.table.selectDictLabel(confirmTaxDatas, value);
}
},
@ -320,15 +323,19 @@
align: 'center',
formatter: function (value, row, index) {
var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) {
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.salesOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.salesOrderId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废
// 已作废
}else{
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.salesOrderId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
@ -337,7 +344,7 @@
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史

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

@ -8,7 +8,7 @@
<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="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<!--驳回调整允许更新内容-->
<input type="hidden" name="saveEntity" value="true" />
@ -286,8 +286,14 @@
<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">
var prefix = ctx + "system/customer";
<script th:inline="javascript">
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-edit").validate({
onkeyup: false,
rules:{

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

@ -7,8 +7,8 @@
</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">
<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 type="hidden" name="p_COM_comment" />
<div class="form-group">
@ -22,7 +22,7 @@
<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>
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled>
</div>
</div>
</div>
@ -41,13 +41,13 @@
<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>
<select id="enterpriseCode" name="enterpriseCode" class="form-control m-b" th:field="*{enterpriseCode}" required disabled>
<option value="">请选择</option>
</select>
</div>
@ -141,8 +141,8 @@
<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>
<select class="form-control" id="commonCurrency_add" name="commonCurrency" disabled
th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
@ -150,16 +150,16 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<div class="col-sm-8">
<input name="udsTax" class="form-control" th:field="*{udsTax}" type="text" required />
<input name="udsTax" class="form-control" th:field="*{udsTax}" 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>
@ -173,8 +173,8 @@
<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')}">
<input required type="radio" th:id="${'invoice_' + dict.dictCode}"
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}">
<input required type="radio"
name="invoice" th:value="${dict.dictValue}" th:checked="${dict.default}" disabled>
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
@ -182,26 +182,26 @@
<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}" />
<input name="deliveryTime" class="form-control" placeholder="yyyy-mm-dd" type="text" th:field="*{deliveryTime}" disabled/>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
@ -210,7 +210,7 @@
<label class="col-sm-3 control-label">客户验收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="" class="form-control" placeholder="yyyy-mm-dd" type="text">
<input name="" class="form-control" placeholder="yyyy-mm-dd" type="text" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
@ -218,40 +218,44 @@
<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 name="businessMembers" class="form-control m-b" th:field="*{businessMembers}" required disabled>
</select>
</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-2" name="materialSum" id="enterprise_edit" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-2" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/>
<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/>
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbPrice" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" id="rmbTax_edit" type="number" readonly/>
<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/>
</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/>
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsdPrice" id="noUsd_edit" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" id="noUsdSum_edit" type="number"readonly/>
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usdPrice" id="usd_edit" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="usdTaxSum" id="usdSum_edit" type="number"readonly/>
<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/>
</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/>
</div>
</div>
</form>
@ -286,22 +290,412 @@
<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">
var prefix = ctx + "system/customer";
$("#form-edit").validate({
focusCleanup: true
<script th:inline="javascript">
$("#form-ywjl-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-ywjl-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
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-ywjl-audit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-ywjl-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-ywjl-audit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-ywjl-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-ywjl-audit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-ywjl-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/user/list',
type: 'post',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-ywjl-audit 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);
}
}
});
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-editOrder").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: '',
materialNoRmb: '',
materialNoUsd: '',
materialRmb: '',
materialNoRmbSum: '',
materialRmbSum: '',
materialUsd: '',
materialUsdSum: '',
materialNoUsdSum: '',
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-editOrder").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-editOrder").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;
$("#enterprise_edit").val(0);
$("#enterpriseSum_edit").val(0);
$("#noRmb_edit").val(0);
$("#rmb_edit").val(0);
$("#noRmbSum_edit").val(0);
$("#rmbTax_edit").val(0);
$("#noUsd_edit").val(0);
$("#usd_edit").val(0);
$("#noUsdSum_edit").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_edit").val(Number(noRmb).toFixed(2));
$("#rmb_edit").val(Number(rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(noUsd).toFixed(2));
$("#usd_edit").val(Number(usd).toFixed(2));
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(usdSum).toFixed(2));
}
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 taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize());
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.save(prefix + "/complete/" + taskId, jsonData);
}
}
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val());
}
var taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-ywjl-audit').serialize());
}
}
</script>
</body>
</html>

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

@ -8,7 +8,7 @@
<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="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<input name="taskId" th:field="*{taskId}" type="hidden">
<input type="hidden" name="p_COM_comment" />
<div class="form-group">
@ -238,20 +238,24 @@
<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" id="enterprise_edit" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-2" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/>
<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/>
</div>
<div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbPrice" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" id="_edit" type="number" readonly/>
<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/>
</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/>
</div>
<div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-3" name="noUsdPrice" id="noUsd_edit" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" id="noUsdSum_edit" type="number"readonly/>
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usdPrice" id="usd_edit" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="usdTaxSum" id="usdSum_edit" type="number"readonly/>
<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/>
</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/>
</div>
</div>
</form>
@ -266,7 +270,7 @@
</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-editOrder"></table>
</div>
</div>
</div>
@ -292,12 +296,406 @@
<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">
<script th:inline="javascript">
var prefix = ctx + "system/customer";
$("#form-edit").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-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
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-edit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-edit 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-edit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-edit 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-edit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</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));
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2));
$("#rmb_edit").val(Number(sysSalesOrder.rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(sysSalesOrder.noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(sysSalesOrder.rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(sysSalesOrder.noUsd).toFixed(2));
$("#usd_edit").val(Number(sysSalesOrder.usd).toFixed(2));
$("#noUsdSum_edit").val(Number(sysSalesOrder.noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(sysSalesOrder.usdSum).toFixed(2));
});
$('#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/user/list',
type: 'post',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-edit select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-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];
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-editOrder").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:rmb1 ,
usdTax: usd,
materialSole: rowData.materialSole,
materialNum: 0.00,
materialNoRmb: 0.00,
materialNoUsd: 0.00,
materialRmb: 0.00,
materialNoRmbSum: 0.00,
materialRmbSum: 0.00,
materialUsd: 0.00,
materialUsdSum: 0.00,
materialNoUsdSum: 0.00,
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-editOrder").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 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(){
let getData = $("#bootstrap-sub-table-editOrder").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;
$("#enterprise_edit").val(0);
$("#enterpriseSum_edit").val(0);
$("#noRmb_edit").val(0);
$("#rmb_edit").val(0);
$("#noRmbSum_edit").val(0);
$("#rmbTax_edit").val(0);
$("#noUsd_edit").val(0);
$("#usd_edit").val(0);
$("#noUsdSum_edit").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_edit").val(Number(noRmb).toFixed(2));
$("#rmb_edit").val(Number(rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(noUsd).toFixed(2));
$("#usd_edit").val(Number(usd).toFixed(2));
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(usdSum).toFixed(2));
}
function submitHandler() {
if ($.validate.form()) {
if ($('textarea[name="comment"]').val()) {

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

@ -7,8 +7,8 @@
</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">
<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 type="hidden" name="p_COM_comment" />
<div class="form-group">
@ -29,96 +29,90 @@
<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}" readonly 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" readonly 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" readonly 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" readonly 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')}" required disabled th:field="*{salesOrderType}">
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
@ -127,7 +121,8 @@
<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">
<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>
</div>
</div>
@ -135,14 +130,14 @@
<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>
<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>
@ -150,31 +145,31 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">美元汇率:</label>
<div class="col-sm-8">
<input name="udsTax" class="form-control" th:field="*{udsTax}" 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>
@ -182,27 +177,28 @@
<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>
@ -210,48 +206,63 @@
<label class="col-sm-3 control-label">客户验收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="" 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">
<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" id="enterprise_edit" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-2" name="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-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-3" name="noRmbPrice" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-3" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-3" name="rmbPrice" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-3" name="rmbTaxSum" id="_edit" type="number" 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-3" name="noUsdPrice" id="noUsd_edit" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-3" name="noUsdSum" id="noUsdSum_edit" type="number"readonly/>
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-3" name="usdPrice" id="usd_edit" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-3" name="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>
@ -259,14 +270,14 @@
<div class="form-row">
<div class="btn-group-sm" id="toolbars" role="group">
<span>选择报价信息</span>
<a class="btn btn-success" onclick="insertRow()">
<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-quoteChild"></table>
<table id="bootstrap-sub-table-editOrder"></table>
</div>
</div>
</div>
@ -292,19 +303,401 @@
<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">
var prefix = ctx + "system/customer";;
$("#form-edit").validate({
focusCleanup: true
<script th:inline="javascript">
$("#form-zozj-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-zozj-audit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-editOrder',
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-zozj-audit select[name='enterpriseCode']").append(
"<option value='" + result[i].enterpriseCode + "'>" + result[i].enterpriseCode + "</option>");
}
$("#form-zozj-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-zozj-audit select[name='customerDelivery']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-zozj-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-zozj-audit select[name='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-zozj-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/user/list',
type: 'post',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-zozj-audit 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);
}
}
});
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-editOrder").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: '',
materialNoRmb: '',
materialNoUsd: '',
materialRmb: '',
materialNoRmbSum: '',
materialRmbSum: '',
materialUsd: '',
materialUsdSum: '',
materialNoUsdSum: '',
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-editOrder").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-editOrder").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;
$("#enterprise_edit").val(0);
$("#enterpriseSum_edit").val(0);
$("#noRmb_edit").val(0);
$("#rmb_edit").val(0);
$("#noRmbSum_edit").val(0);
$("#rmbTax_edit").val(0);
$("#noUsd_edit").val(0);
$("#usd_edit").val(0);
$("#noUsdSum_edit").val(0);
for(let i=0;i<getData.length;i++){
enterprise += 1;
enterpriseSum = Number(enterprise + getData[i].materialNum).toFixed(0);
noRmb = Number(noRmb + getData[i].materialNoRmb).toFixed(2);
rmb = Number(rmb + getData[i].materialRmb).toFixed(2) ;
noRmbSum = Number(noRmbSum + getData[i].materialNoRmbSum).toFixed(2);
rmbSum = Number(rmbSum + getData[i].materialRmbSum).toFixed(2);
noUsd = Number(noUsd + getData[i].materialNoUsd).toFixed(2) ;
usd = Number(usd + getData[i].materialUsd).toFixed(2) ;
noUsdSum = Number(noUsdSum + getData[i].materialNoUsdSum).toFixed(2);
usdSum = Number(usdSum + getData[i].materialUsdSum).toFixed(2);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(Number(enterpriseSum).toFixed(2));
$("#noRmb_edit").val(Number(noRmb).toFixed(2));
$("#rmb_edit").val(Number(rmb).toFixed(2));
$("#noRmbSum_edit").val(Number(noRmbSum).toFixed(2));
$("#rmbTax_edit").val(Number(rmbSum).toFixed(2));
$("#noUsd_edit").val(Number(noUsd).toFixed(2));
$("#usd_edit").val(Number(usd).toFixed(2));
$("#noUsdSum_edit").val(Number(noUsdSum).toFixed(2));
$("#usdSum_edit").val(Number(usdSum).toFixed(2));
}
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 taskId = [[${taskId}]];
$.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize());
formData.push({"name": "sysSalesOrderChildList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
$.operate.save(prefix + "/complete/" + taskId, $('#form-zozj-audit').serialize());
}
}

Loading…
Cancel
Save