修改库存显示
This commit is contained in:
@@ -89,37 +89,7 @@
|
|||||||
{title: '品名', field: 'name', width: 150},
|
{title: '品名', field: 'name', width: 150},
|
||||||
{title: '型号', field: 'model', width: 100},
|
{title: '型号', field: 'model', width: 100},
|
||||||
{title: '类别', field: 'categoryName', width: 130},
|
{title: '类别', field: 'categoryName', width: 130},
|
||||||
{title: '单位', field: 'unit', width: 60},
|
{title: '单位', field: 'unit', width: 60}
|
||||||
{
|
|
||||||
title: '库存', field: 'abc', width: 70, formatter: function (value, rec) {
|
|
||||||
var monthTime = getNowFormatMonth();
|
|
||||||
var mId = rec.id; //商品id
|
|
||||||
var thisStock = 0;
|
|
||||||
//查询库存
|
|
||||||
$.ajax({
|
|
||||||
type: "get",
|
|
||||||
url: '/depotItem/findStockNumByMaterialId',
|
|
||||||
data: {
|
|
||||||
materialId: mId
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (res) {
|
|
||||||
if(res && res.code === 200) {
|
|
||||||
if (res.data && res.data.page && res.data.page[0]) {
|
|
||||||
thisStock = res.data.page[0].thisSum - 0;
|
|
||||||
if (thisStock > 0) {
|
|
||||||
$("#tableForSelectPanel .class-" + rec.id).text(thisStock); //延迟加载库存数据
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function () {
|
|
||||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return "<span class='class-" + rec.id + "'>" + thisStock + "</span>";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]],
|
]],
|
||||||
toolbar: [
|
toolbar: [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -46,21 +46,8 @@
|
|||||||
|
|
||||||
function forSelectMaterialCategory(node) {
|
function forSelectMaterialCategory(node) {
|
||||||
console.log(node);
|
console.log(node);
|
||||||
if(clickType) {
|
$("#parentName").val(node.text);
|
||||||
if(clickType == "selectBtn") {
|
$("#parentid").val(node.id);
|
||||||
$("#searchParentName").val(node.text);
|
|
||||||
$("#searchParentId").val(node.id);
|
|
||||||
types = "";
|
|
||||||
initMCData(node.id);
|
|
||||||
} else if(clickType == "editBtn") {
|
|
||||||
$("#parentName").val(node.text);
|
|
||||||
$("#parentid").val(node.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$("#parentName").val(node.text);
|
|
||||||
$("#parentid").val(node.id);
|
|
||||||
}
|
|
||||||
$('#forSelectMaterialCategoryDlg').dialog('close');
|
$('#forSelectMaterialCategoryDlg').dialog('close');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
and ifnull(delete_Flag,'0') !='1'
|
and ifnull(delete_Flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findByTypeAndMaterialIdIn" resultType="java.lang.Integer">
|
<select id="findByTypeAndMaterialIdIn" resultType="java.lang.Long">
|
||||||
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
||||||
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
||||||
where dh.type='入库'
|
where dh.type='入库'
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
and ifnull(dh.delete_Flag,'0') !='1'
|
and ifnull(dh.delete_Flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findByTypeAndMaterialIdOut" resultType="java.lang.Integer">
|
<select id="findByTypeAndMaterialIdOut" resultType="java.lang.Long">
|
||||||
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh
|
||||||
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
INNER JOIN jsh_depotitem di on dh.id=di.HeaderId and ifnull(di.delete_Flag,'0') !='1'
|
||||||
where dh.type='出库'
|
where dh.type='出库'
|
||||||
|
|||||||
@@ -24,8 +24,11 @@
|
|||||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||||
and m.model like #{model}
|
and m.model like #{model}
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryId != 1">
|
<if test="categoryIds != null and categoryIds != ''">
|
||||||
and m.CategoryId in (#{categoryIds})
|
and m.CategoryId in
|
||||||
|
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
|
||||||
|
#{did}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and ifnull(m.delete_Flag,'0') !='1'
|
and ifnull(m.delete_Flag,'0') !='1'
|
||||||
order by m.id asc
|
order by m.id asc
|
||||||
@@ -49,8 +52,11 @@
|
|||||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||||
and m.model like #{model}
|
and m.model like #{model}
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryId != 1">
|
<if test="categoryIds != null and categoryIds != ''">
|
||||||
and m.CategoryId in (#{categoryIds})
|
and m.CategoryId in
|
||||||
|
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
|
||||||
|
#{did}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and ifnull(m.delete_Flag,'0') !='1'
|
and ifnull(m.delete_Flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
@@ -108,8 +114,11 @@
|
|||||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||||
and m.model like #{model}
|
and m.model like #{model}
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryId != 1">
|
<if test="categoryIds != null and categoryIds != ''">
|
||||||
and m.CategoryId in (#{categoryIds})
|
and m.CategoryId in
|
||||||
|
<foreach item="did" index="index" collection="categoryIds.split(',')" open="(" separator="," close=")">
|
||||||
|
#{did}
|
||||||
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and ifnull(m.delete_Flag,'0') !='1'
|
and ifnull(m.delete_Flag,'0') !='1'
|
||||||
order by m.id asc
|
order by m.id asc
|
||||||
|
|||||||
Reference in New Issue
Block a user