Browse Source

修改:销售订单SQL语句修改creatBy对象为createBy 修改:销售订单新增修改,添加物料时改为物料多选

dev
zhangsiqi 3 months ago
parent
commit
7d51ebf054
  1. 4
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  2. 38
      ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html
  3. 38
      ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html

4
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml

@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</where>
order by s.create_time desc
order by s.audit_status,s.create_time desc
</select>
<select id="selectSysSalesOrderById" parameterType="Long" resultMap="SysSalesOrderResult">
<include refid="selectSysSalesOrderVo"/>
@ -269,7 +269,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTime != null">#{applyTime},</if>
<if test="applyTitle != null">#{applyTitle},</if>
<if test="createTime!= null">#{createTime},</if>
<if test="creatBy != null">#{creatBy},</if>
<if test="createBy != null">#{createBy},</if>
now()
</trim>
</insert>

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

@ -846,29 +846,34 @@
$("#form-salesOrder-add").validate({focusCleanup: true});
function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var rows = $("#bootstrap-sub-table-order").bootstrapTable('getData').length;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-sub-table-order").bootstrapTable('getData')[i];
if(data.materialCode==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同料号");
for(var j=0;i<rows;j++){
var data = $("#bootstrap-sub-table-order").bootstrapTable('getData');
for (var i = 0;i<data.length;j++){
if(data[j].materialNo==rowData[j].materialNo){
//如果是物料料号的相同,则从rowData清除相同的料号物料
rowData.splice(j,1);
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo);
return;
}
}
}
for(var i=0;i<rowData.length;i++) {
$("#bootstrap-sub-table-order").bootstrapTable('insertRow', {
index:1,
index: 1,
row: {
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
unit: rowData.unit,
processMethod: rowData.processMethod,
photoUrl: rowData.photoUrl,
warehouseDept: rowData.warehouseDept,
materialId: rowData[i].id,
materialCode: rowData[i].materialNo,
materialName: rowData[i].materialName,
materialType: rowData[i].materialType,
describe: rowData[i].describe,
brand: rowData[i].brand,
unit: rowData[i].unit,
processMethod: rowData[i].processMethod,
photoUrl: rowData[i].photoUrl,
warehouseDept: rowData[i].warehouseDept,
countTax: $("#taxRate_add").val(),
usdTax: $("#usdTax_add").val(),
materialSole: 0,
@ -888,6 +893,7 @@
remark: "",
}
})
}
layer.close(index);
}
function insertRow() {

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

@ -688,39 +688,44 @@
function doSubmit(index, layero,uniqueId){
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
var totalNum = $("#bootstrap-select-table").bootstrapTable('getData').length;
var rmb1 = $("#taxRate_edit").val();
if (rmb1== null){
rmb1 = 0;
}
var rows = $("#bootstrap-table-editOrder").bootstrapTable('getData').length;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-table-editOrder").bootstrapTable('getData')[i];
if(data.materialCode==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同料号");
for(var j=0;i<rows;j++){
var data = $("#bootstrap-table-editOrder").bootstrapTable('getData');
for (var i = 0;i<data.length;j++){
if(data[j].materialNo==rowData[j].materialNo){
//如果是物料料号的相同,则从rowData清除相同的料号物料
rowData.splice(j,1);
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo);
return;
}
}
}
var rmb = parseFloat(rmb1).toFixed(2) / 100;
var usd = $("#usdTax_edit").val()!=null?Number(usd).toFixed(2):0;
for(var i=0;i<rowData.length;i++) {
$("#bootstrap-table-editOrder").bootstrapTable('insertRow', {
index: totalNum,
row: {
id:'',
materialId:rowData.id,
materialCode: rowData.materialNo,
materialName: rowData.materialName,
materialType: rowData.materialType,
describe: rowData.describe,
brand: rowData.brand,
photoUrl: rowData.photoUrl,
warehouseDept:rowData.warehouseDept,
unit: rowData.unit,
processMethod: rowData.processMethod,
materialId:rowData[i].id,
materialCode: rowData[i].materialNo,
materialName: rowData[i].materialName,
materialType: rowData[i].materialType,
describe: rowData[i].describe,
brand: rowData[i].brand,
photoUrl: rowData[i].photoUrl,
warehouseDept:rowData[i].warehouseDept,
unit: rowData[i].unit,
processMethod: rowData[i].processMethod,
countTax:rmb ,
usdTax: usd,
materialSole: rowData.materialSole,
materialSole: rowData[i].materialSole,
materialNum: 0.00,
materialNoRmb: 0.00,
materialNoUsd: 0.00,
@ -733,6 +738,7 @@
remark: "",
}
})
}
layer.close(index);
}
function insertRow() {

Loading…
Cancel
Save