Browse Source

[fix] 销售管理

修改销售发起出货前端列表页面:新增收货联系人为下拉选择,收货电话和收货地址为自动赋值;新增收货联系人下拉选择前端js方法
dev
liuxiaoxu 3 months ago
parent
commit
1acb4040dd
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  2. 75
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html

6
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java

@ -90,7 +90,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单1模板 * 导出出货单1模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingOrderOne") @RequiresPermissions("system:salesShippingInform:exportShippingOrderOne")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingOrderOne/{outOrderCode}") @GetMapping("/exportShippingOrderOne/{outOrderCode}")
public void exportShippingOrderOne(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingOrderOne(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {
@ -103,7 +103,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单2模板 * 导出出货单2模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingOrderTwo") @RequiresPermissions("system:salesShippingInform:exportShippingOrderTwo")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingOrderTwo/{outOrderCode}") @GetMapping("/exportShippingOrderTwo/{outOrderCode}")
public void exportShippingOrderTwo(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingOrderTwo(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {
@ -116,7 +116,7 @@ public class SysSalesShippingInformController extends BaseController
* 导出出货单通知单模板 * 导出出货单通知单模板
* */ * */
@RequiresPermissions("system:salesShippingInform:exportShippingInformOrder") @RequiresPermissions("system:salesShippingInform:exportShippingInformOrder")
@Log(title = "采购订单", businessType = BusinessType.EXPORT) @Log(title = "销售出货单", businessType = BusinessType.EXPORT)
@GetMapping("/exportShippingInformOrder/{outOrderCode}") @GetMapping("/exportShippingInformOrder/{outOrderCode}")
public void exportShippingInformOrder(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) { public void exportShippingInformOrder(@PathVariable("outOrderCode") String outOrderCode,HttpServletResponse response) {

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

@ -50,19 +50,22 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label> <label class="col-sm-3 control-label">收货联系人(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerDelivery" th:field="*{customerDelivery}" class="form-control" type="text" disabled> <select class="form-control" name="customerDelivery" th:field="*{customerDelivery}" id="customerDelivery" required>
<!-- 这里动态生成生产单号选项 -->
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label> <label class="col-sm-3 control-label">收货电话(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled> <input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label> <label class="col-sm-3 control-label">收货地址(Ship To)</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled> <input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled>
</div> </div>
@ -138,6 +141,70 @@
$.operate.saveJson(prefix + "/salesDeliverGoods", jsonData); $.operate.saveJson(prefix + "/salesDeliverGoods", jsonData);
} }
loadCustomerDelivery();
//获取已经选择客户Id相关的生产单号
function loadCustomerDelivery() {
const url = ctx + 'system/customer/shippingList';
const data = {
enterpriseCode: sysSalesOrder.enterpriseCode,
};
// 使用 $.ajax 发送请求
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: data,
success: function(response) {
console.log("response:", response);
if (response.code === 0 && Array.isArray(response.rows) && response.rows.length > 0) {
const selectElement = $('#customerDelivery');
selectElement.empty();
// 存储每个客户名称对应的信息
const customerDataMap = {};
// 遍历返回的数据,添加为下拉框的选项并存储数据
$.each(response.rows, function(index, item) {
const customerName = item.customerName;
customerDataMap[customerName] = item; // 存储数据
// 添加选项到下拉框
selectElement.append($('<option>', {value: customerName}).text(customerName));
});
// 监听下拉框的选择变化
selectElement.on('change', function() {
const selectedCustomerName = $(this).val();
if (selectedCustomerName in customerDataMap) {
const selectedCustomer = customerDataMap[selectedCustomerName];
$('#deliveryPhone').val(selectedCustomer.customerPhone);
$('#deliveryAddress').val(selectedCustomer.deliveryAddress);
}
});
// 如果已经有了默认选项,则设置默认值
if (selectElement.children('option').length > 0) {
selectElement.trigger('change');
}
} else {
// 显示错误消息
$.modal.alertWarning("数据为空");
}
},
error: function(xhr, status, error) {
// 处理错误情况
console.error('AJAX Error:', error);
$.modal.alertWarning("请求失败,请稍后再试。");
},
});
}
//物料信息展示列表 //物料信息展示列表
$(function() { $(function() {
var options = { var options = {

Loading…
Cancel
Save