Browse Source

为物料导入添加单价修改功能

lwx_dev
erdanergou 2 years ago
parent
commit
aeb24a33ff
  1. 13
      src/main/resources/templates/pages/material/material-out.html
  2. 55
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  3. 44
      target/classes/templates/pages/material/material-out.html

13
src/main/resources/templates/pages/material/material-out.html

@ -416,6 +416,15 @@
} }
, btn3: function (index, layero) { , btn3: function (index, layero) {
// 按钮【按钮三】的回调 // 按钮【按钮三】的回调
if (flagForImport) {
flagForImport = false;
let loading2 = layer.open({
type: 3,
shade: [0.25, '#000'],
icon: 2,
speed: 0,
shadeClose: true
});
$.ajax({ $.ajax({
url: "/excel/overwriteExcelByMaterial", url: "/excel/overwriteExcelByMaterial",
type: "post", type: "post",
@ -428,6 +437,7 @@
} else { } else {
layer.close(index); layer.close(index);
} }
flagForImport = true;
layer.alert("数据修改完成", { layer.alert("数据修改完成", {
icon: 0 icon: 0
}, function (indexForMsg, layero) { }, function (indexForMsg, layero) {
@ -442,7 +452,8 @@
}, 'data'); }, 'data');
}) })
} }
}) });
}
return false; return false;
} }
}); });

55
target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -1154,6 +1154,61 @@
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateMaterialForImport">
UPDATE material
<set>
<if test="uid != '' and uid != null">
uid = #{uid},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="updateTime != '' and updateTime != null">
updateTime = #{updateTime},
</if>
<if test="unit != null and unit != ''">
unit = #{unit},
</if>
<if test="texture != null and texture != ''">
texture = #{texture},
</if>
<if test="shelfLife != null">
shelfLife = #{shelfLife},
</if>
<if test="producedDate != null">
producedDate = #{producedDate},
</if>
<if test="productionPlace != null and productionPlace !=''">
productionPlace = #{productionPlace},
</if>
<if test="brand != '' and brand != null">
brand = #{brand},
</if>
<if test="remark != '' and remark != null">
remark = #{remark}
</if>
</set>
WHERE
1 = 1
<if test="mname != null and mname != ''">
and mname = #{mname}
</if>
<if test="version != null and version != ''">
and version = #{version}
</if>
<if test="version == null or version == ''">
and version is null
</if>
<if test="mcode != null and mcode != ''">
and `code` = #{mcode}
</if>
</update>
<!-- 修改数据 --> <!-- 修改数据 -->
<update id="updateInventory"> <update id="updateInventory">
UPDATE inventory UPDATE inventory

44
target/classes/templates/pages/material/material-out.html

@ -352,7 +352,7 @@
, shade: 0.8 , shade: 0.8
, id: 'LAY_layuipro' //设定一个id,防止重复弹出 , id: 'LAY_layuipro' //设定一个id,防止重复弹出
, resize: false , resize: false
, btn: ['导入', '取消'] , btn: ['导入', '取消', '覆盖']
, btnAlign: 'c' , btnAlign: 'c'
, moveType: 1 //拖拽模式,0或者1 , moveType: 1 //拖拽模式,0或者1
, content: re , content: re
@ -414,6 +414,48 @@
} }
}) })
} }
, btn3: function (index, layero) {
// 按钮【按钮三】的回调
if (flagForImport) {
flagForImport = false;
let loading2 = layer.open({
type: 3,
shade: [0.25, '#000'],
icon: 2,
speed: 0,
shadeClose: true
});
$.ajax({
url: "/excel/overwriteExcelByMaterial",
type: "post",
data: JSON.stringify({"result": "yes"}),
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function () {
if (socket !== null) {
socket.close();
} else {
layer.close(index);
}
flagForImport = true;
layer.alert("数据修改完成", {
icon: 0
}, function (indexForMsg, layero) {
layer.close(indexForMsg);
layer.close(loading2);
closeShowDataMessage();
table.reload('currentTableId', {
url: '/material/material',
page: {
curr: 1
},
}, 'data');
})
}
});
}
return false;
}
}); });

Loading…
Cancel
Save