Browse Source

[feat]销售管理:客户资料中取消客户法人必填样式,改为选填项。做报价单时,输入文字改为在行内输入内容信息。客户报价计算合计金额方法更新 ,销售订单的时候,客户联系人、收货人信息取消必填,改为选填,创建订单时,选择客户N12,选择客户收货地址时可以只能选N12的客户收货人,已修复客户收货人查询。

dev
zhangsiqi 6 months ago
parent
commit
6d3f59b968
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  2. 32
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml
  3. 2
      ruoyi-admin/src/main/resources/mapper/system/SysShippingAddressMapper.xml
  4. 4
      ruoyi-admin/src/main/resources/templates/system/customer/edit.html
  5. 142
      ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html
  6. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html
  7. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html
  8. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html
  9. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwgzVerify.html
  10. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html
  11. 20
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html
  12. 1
      ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html
  13. 100
      ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html

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

@ -37,6 +37,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -228,6 +229,7 @@ public class SysSalesOrderController extends BaseController
@Log(title = "销售订单", businessType = BusinessType.DELETE)
@RequestMapping( "/removeSelected")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public String removeSelected(@RequestParam(value = "ids") String ids) {
System.out.println(ids);
String[] idsStr = ids.split(",");

32
ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml

@ -16,7 +16,9 @@
</resultMap>
<sql id="selectSysCustomerOperVo">
select id,purser,enterprise_name,enterprise_code,opertion,create_time,oper_user,oper_status from sys_customer_oper
select id,purser,enterprise_name,enterprise_code,opertion,
create_time,
oper_user,oper_status from sys_customer_oper
</sql>
<select id="selectSysCustomerOperList" parameterType="SysCustomerOper" resultMap="SysCustomerOperResult">
@ -48,22 +50,22 @@
<insert id="insertSysCustomerOper" parameterType="SysCustomerOper" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_oper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purser != null and purser != ''">purser,</if>
<if test="enterpriseCode!= null">enterprise_code,</if>
<if test="enterpriseName!= null">enterprise_name,</if>
<if test="oper != null">opertion,</if>
<if test="operPeople != null">oper_user,</if>
<if test="operStatus != null">oper_status,</if>
<if test="createTime != null">create_time,</if>
<if test="purser != null and purser != ''"> purser,</if>
<if test="enterpriseCode!= null and enterpriseCode != ''">enterpriseCode,</if>
<if test="enterpriseName!= null and enterpriseName != ''">enterpriseName,</if>
<if test="oper != null and oper != ''">opertion,</if>
<if test="operPeople != null and operPeopple != ''">oper_user,</if>
<if test="operStatus != null and operStatus != ''">oper_status,</if>
<if test="createTime != null and createTime != ''">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purser != null">#{purser},</if>
<if test="enterpriseCode!= null">#{enterpriseCode},</if>
<if test="enterpriseName!= null">#{enterpriseName},</if>
<if test="oper != null">#{oper},</if>
<if test="operPeople != null">#{operPeople},</if>
<if test="operStatus != null">#{operStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="purser != null and purser != ''">#{purser},</if>
<if test="enterpriseCode!= null and enterpriseCode != ''">#{enterpriseCode},</if>
<if test="enterpriseName!= null and enterpriseName != ''">#{enterpriseName},</if>
<if test="oper != null and oper != ''">#{oper},</if>
<if test="operPeople != null and operPeopple != ''">#{operPeople},</if>
<if test="operStatus != null and operStatus != ''">#{operStatus},</if>
<if test="createTime != null and createTime != ''">#{createTime},</if>
</trim>
</insert>
</mapper>

2
ruoyi-admin/src/main/resources/mapper/system/SysShippingAddressMapper.xml

@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysShippingAddressList" parameterType="SysShippingAddress" resultMap="SysShippingAddressResult">
<include refid="selectSysShippingAddressVo"/>
<where>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = concat(#{enterpriseCode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="deliveryAddress != null and deliveryAddress != ''"> and delivery_address like concat('%', #{deliveryAddress}, '%')</if>

4
ruoyi-admin/src/main/resources/templates/system/customer/edit.html

@ -75,9 +75,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label is-required" >法人代表:</label>
<label class="col-sm-6 control-label" >法人代表:</label>
<div class="col-sm-6">
<input name="legalRepresentative" class="form-control" type="text" required th:field="*{legalRepresentative}">
<input name="legalRepresentative" class="form-control" type="text" th:field="*{legalRepresentative}">
</div>
</div>
<div class="form-group">

142
ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html

@ -253,29 +253,68 @@
{ title: '美元汇率',field: 'usdTax', align: 'center',editable: true,
},
{field: 'materialNum',align: 'center',title: '物料的数量',editable: true,
{field: 'materialNum',align: 'center',title: '物料的数量',
editable:{
type : 'number',
mode: 'inline',
title : '物料的数量',
validate : function(value) {
if (!value) {
return '用量不能为空';
}
if (isNaN(value)) {
return '用量必须为数字';
}
}
},
},
{ title: '物料的不含税单价(RMB)',
field: 'materialNoRmb',
align: 'center',
editable: function(value, row, index) {
commonCurrency = $("#commonCurrency_add option:selected").val();
if (commonCurrency == 1){
return true;
}else{
return false;
editable:{
type: 'text', // 使用'text'类型,因为我们需自定义验证小数
mode: 'inline',
title: '物料的不含税单价(RMB)',
validate: function(value) {
// 验证是否为空
if (!value) {
return '金额不能为空';
}
// 尝试转换为浮点数并检查是否成功
var num = parseFloat(value);
if (isNaN(num)) {
return '请输入有效的数字';
}
// 检查小数点后是否有超过两位的数字
var decimalPart = num.toString().split('.')[1]; // 获取小数部分
if (decimalPart && decimalPart.length > 2) {
return '请输入精确到小数点后两位的数字';
}
}
}
},
{title: '物料的不含税单价(美元)',
field: 'materialNoUsd',
align: 'center',
editable: function(value, row, index) {
commonCurrency = $("#commonCurrency_add option:selected").val();
if (commonCurrency == 2){
return true;
}else{
return false;
editable: {
type: 'text', // 使用'text'类型,因为我们需自定义验证小数
mode: 'inline',
title: '物料的不含税单价(RMB)',
validate: function(value) {
// 验证是否为空
if (!value) {
return '金额不能为空';
}
// 尝试转换为浮点数并检查是否成功
var num = parseFloat(value);
if (isNaN(num)) {
return '请输入有效的数字';
}
// 检查小数点后是否有超过两位的数字
var decimalPart = num.toString().split('.')[1]; // 获取小数部分
if (decimalPart && decimalPart.length > 2) {
return '请输入精确到小数点后两位的数字';
}
}
}
},
@ -494,7 +533,7 @@
minView: "month",
autoclose: true
});
//计算
//计算金额
function getTotalAmount(){
// $("#addFinishbomTable").bootstrapTable('refresh');
let getData = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData', true);
@ -502,16 +541,16 @@
let rmb = 0;let noRmbSum = 0;let rmbSum = 0;let noUsd = 0;
let usd = 0;let noUsdSum = 0; let usdSum = 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_add").val(enterprise);
$("#enterpriseSum_add").val(Number(enterpriseSum).toFixed(2));
@ -524,8 +563,61 @@
$("#noUsdSum_add").val(Number(noUsdSum).toFixed(2));
$("#usdSum_add").val(Number(usdSum).toFixed(2));
}
// 结算金额
$(document).ready(function() {
// 监听货币选项变化
$("#commonCurrency_add").on("change", function() {
var isEditable = $(this).val() === "1";
var fieldName = "";
if (isEditable) {
fieldName = "materialNoRmb";
$("#rmbTax_add").prop("disabled", false);
$("#usdTax_add").prop("disabled", false);
} else {
fieldName = "materialNoUsd";
$("#rmbTax_add").prop("disabled", true);
$("#usdTax_add").prop("disabled", true);
}
var materialColumnCells = $('#bootstrap-sub-table-quoteChild tbody tr td [field=" '+ fieldName+' "]');
// 根据是否可编辑,添加或移除xEditable
materialColumnCells.each(function() {
var cell = $(this);
var currentValue = cell.text().trim(); // 获取当前单元格的值
if (isEditable) {
// 如果允许编辑且尚未添加xEditable
if (!cell.hasClass('editable')) {
cell.addClass('editable'); // 添加标记类,以便跟踪状态
cell.editable({
type: 'text',
pk: cell.closest('tr').data('id'), // 假设每行有唯一ID
title: '物料的数量',
validate: function(value) {
if (!value) return '金额不能为空';
if (isNaN(value)) return '金额必须为数字';
return true;
},
success: function(response, newValue) {
// 成功后的回调,这里可以根据需要处理服务器响应
}
});
}
} else {
// 如果不允许编辑且已添加了xEditable
if (cell.hasClass('editable')) {
cell.removeClass('editable');
// 这里简化处理,实际中可能需要更复杂的逻辑来销毁xEditable实例
cell.off('.editable'); // 移除xEditable绑定的事件
cell.text(currentValue); // 还原原始文本
}
}
});
});
// 初始化时触发一次,根据默认状态设置可编辑性
$("#commonCurrency_add").trigger("change");
});
</script>
</body>
</html>

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html

@ -288,16 +288,16 @@
let rmb = 0;let noRmbSum = 0;let rmbSum = 0;let noUsd = 0;
let usd = 0;let noUsdSum = 0; let usdSum = 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_detail").val(enterprise);
$("#enterpriseSum_detail").val(enterpriseSum);

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

@ -390,16 +390,16 @@
let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0;
for(var 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum);

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html

@ -428,16 +428,16 @@
let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0;
for(var 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum);

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwgzVerify.html

@ -412,16 +412,16 @@
let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0;
for(var 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum);

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

@ -405,16 +405,16 @@
let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0;
for(var 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum);

20
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

@ -342,16 +342,16 @@
let rmbSum = 0;let noUsd = 0;let usd = 0;
let noUsdSum = 0;let usdSum = 0;
for(var 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 += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += Number(getData[i].materialNum);
noRmb += Number(getData[i].materialNoRmb);
rmb += Number(getData[i].materialRmb) ;
noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += Number(getData[i].materialRmbSum);
noUsd += Number(getData[i].materialNoUsd) ;
usd += Number(getData[i].materialUsd) ;
noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += Number(getData[i].materialUsdSum);
}
$("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum);

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

@ -622,6 +622,7 @@
var query = {
enterpriseCode: data.enterpriseCode,
};
return query;
},
processResults: function (res, params) {
var resultList = res.rows;

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

@ -84,7 +84,9 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户ID:</label>
<div class="col-sm-8">
<input id="enterpriseCode_edit" th:field="*{enterpriseCode}" name="enterpriseCode" class="form-control m-b" required readonly/>
<input id="enterpriseCode_edit" th:field="*{enterpriseCode}" name="enterpriseCode"
class="form-control m-b" required readonly>
</div>
</div>
<div class="form-group">
@ -100,9 +102,12 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户联系人:</label>
<label class="col-sm-3 control-label">客户联系人:</label>
<div class="col-sm-8">
<input id="customerContact_edit" name="customerContact" th:field="*{customerContact}" class="form-control" required readonly />
<select id="customerContact_edit" name="customerContact" th:field="*{customerContact}"
class="form-control">
</select>
</div>
</div>
<div class="form-group">
@ -124,9 +129,11 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">客户收货人:</label>
<label class="col-sm-3 control-label">客户收货人:</label>
<div class="col-sm-8">
<input name="customerDelivery" id="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b" disabled/>
<select name="customerDelivery" id="customerDelivery_edit" th:field="*{customerDelivery}" class="form-control m-b">
<option value=""></option>
</select>
</div>
</div>
<div class="form-group">
@ -471,20 +478,41 @@
$.table.init(options);
});
$(function(){
/*业务员列表*/
$.ajax({
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
//客户信息填写
$.ajax({
type: "post",
url:ctx + "system/customer/customerList",
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;
$("#form-salesOrder-edit select[name='customerContact']").empty();
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='customerContact']").append(
"<option value='" + result[i].customerName + "'>" + result[i].customerName + "</option>");
}
$("#form-salesOrder-edit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change");
} else {
$.modal.msgError(res.msg);
}
@ -502,17 +530,21 @@
success: function (res, params) {
if (res.rows.length > 0) {
var result = res.rows;
$("#form-salesOrder-edit select[name='customerDelivery']").empty();
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()
}
}
});
});
$('#customerContact_edit').on('select2:select', function (e) {
var data = e.params.data;
$.ajax({
type: "post",
url:ctx + "system/contacts/list",
url:ctx + "system/shippingaddress/list",
dataType:"json",
delay:250,
cache:true,
@ -522,56 +554,14 @@
success: function (res, params) {
if (res.rows.length > 0) {
var result = res.rows;
$("#form-salesOrder-edit select[name='customerDelivery']").empty();
for (let i in result) {
$("#form-salesOrder-edit select[name='customerContact']").append(
$("#form-salesOrder-edit select[name='customerDelivery']").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);
}
},
});
/*业务员列表*/
$.ajax({
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
$("#enterprise_edit").val(sysSalesOrder.enterprise);
$("#enterpriseSum_edit").val(Number(sysSalesOrder.enterpriseSum));
$("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2));
$("#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);

Loading…
Cancel
Save