Browse Source

实现库存盘点功能

lwx_dev
erdanergou 3 years ago
parent
commit
838224af32
  1. 60
      src/main/java/com/dreamchaser/depository_manage/entity/StockTaking.java
  2. 294
      src/main/java/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml
  3. 96
      src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingChildP.java
  4. 93
      src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingP.java
  5. 65
      src/main/resources/templates/pages/post/selectManager.html
  6. 132
      src/main/resources/templates/pages/scanQrCode/ScanBarCodeForTaking.html
  7. 1162
      src/main/resources/templates/pages/stockTaking/stockTaking.html
  8. 0
      target/classes/.restartTriggerFile
  9. BIN
      target/classes/META-INF/depository_manage (2).kotlin_module
  10. 294
      target/classes/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml
  11. 74
      target/classes/templates/pages/material/selectMaterialByCardForTaking.html
  12. 65
      target/classes/templates/pages/post/selectManager.html
  13. 132
      target/classes/templates/pages/scanQrCode/ScanBarCodeForTaking.html
  14. 100
      target/classes/templates/pages/scanQrCode/ScanCodeByTaking.html
  15. 202
      target/classes/templates/pages/scanQrCode/ScanMaterialCodeForTaking.html
  16. 1162
      target/classes/templates/pages/stockTaking/stockTaking.html
  17. 350
      target/classes/templates/pages/stockTaking/stockTakingReview.html
  18. 291
      target/classes/templates/pages/stockTaking/stockTakingView.html
  19. 395
      target/classes/templates/pages/stockTaking/stockTransfer.html

60
src/main/java/com/dreamchaser/depository_manage/entity/StockTaking.java

@ -0,0 +1,60 @@
package com.dreamchaser.depository_manage.entity;
import lombok.Data;
/**
* 用于保存盘点记录
*/
@Data
public class StockTaking {
/**
* id
*/
private Long id;
/**
* 盘点单号
*/
private String code;
/**
* 负责人
*/
private String departmentManager;
/**
* 盘点仓库
*/
private Integer placeId;
/**
* 盘点库位
*/
private Integer depositoryId;
/**
* 1通过2驳回3待处理
*/
private Integer state;
/**
* 盘点发起人
*/
private Integer originator;
/**
* 申请时间
*/
private Long createTime;
/**
* 审核时间
*/
private Long completeTime;
/**
* 审核意见
*/
private String auditOpinion;
}

294
src/main/java/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml

@ -0,0 +1,294 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- notice -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.StockTakingMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="StockTakingMap" type="com.dreamchaser.depository_manage.entity.StockTaking">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" />
<result column="placeId" property="placeId" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="crateTime" property="crateTime" jdbcType="INTEGER" />
<result column="completeTime" property="completeTime" jdbcType="INTEGER" />
<result column="originator" property="originator" jdbcType="INTEGER" />
<result column="departmentManager" property="departmentManager" jdbcType="VARCHAR" />
<result column="auditOpinion" property="auditOpinion" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="StockTakingChildMap" type="com.dreamchaser.depository_manage.pojo.StockTakingChildP">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="oldInventory" property="oldInventory" jdbcType="INTEGER" />
<result column="newInventory" property="newInventory" jdbcType="INTEGER" />
<result column="inventory" property="inventory" jdbcType="INTEGER" />
<result column="mainId" property="mainId" jdbcType="INTEGER" />
<result column="takingResult" property="takingResult" jdbcType="VARCHAR" />
<result column="mtexture" property="mtexture" jdbcType="VARCHAR" />
<result column="mversion" property="mversion" jdbcType="VARCHAR" />
<result column="munit" property="munit" jdbcType="VARCHAR" />
<result column="tname" property="tname" jdbcType="VARCHAR" />
<result column="mcode" property="mcode" jdbcType="VARCHAR" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="mtId" property="mtId" jdbcType="INTEGER" />
</resultMap>
<!-- 表查询字段 -->
<sql id="StockTakingAllColumns">
st.id,st.code,st.depositoryId,st.placeId,st.departmentManager,st.state,st.createTime,st.originator,st.completeTime,st.auditOpinion
</sql>
<sql id="StockTakingChildPAllColumns">
id,mid,oldInventory,newInventory,inventory,mainId,takingResult,mname,mtId,tname,mcode,mversion,munit,mtexture
</sql>
<!-- 插入主表-->
<insert id="insertStockTaking" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktaking (id,code,depositoryId,placeId,departmentManager,state,createTime,originator)
values (
#{id},
#{code},
#{depositoryId},
#{placeId},
#{departmentManager},
#{state},
#{createTime},
#{originator}
)
</insert>
<!-- 插入子表-->
<insert id="insertStockTakingChild" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktakingchild (id,mid,oldInventory,newInventory,takingResult,inventory,mainId)
values (
#{id},#{mid},#{oldInventory},#{newInventory},#{takingResult},#{inventory},#{mainId}
)
</insert>
<delete id="deleteStockTakingChild" parameterType="int">
delete from stocktakingchild where id = #{id}
</delete>
<delete id="deleteStockTakingChilds" parameterType="list">
delete from stocktakingchild
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteStockTaking" parameterType="int">
delete from stocktaking where id = #{id}
</delete>
<delete id="deleteStockTakings" parameterType="list">
delete from stocktaking
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateStockTaking">
update stocktaking
<set>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="depositoryId != null">
depositoryId = #{depositoryId},
</if>
<if test="placeId != null">
placeId = #{placeId},
</if>
<if test="departmentManager != null and departmentManager != ''">
departmentManager = #{departmentManager},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="createTime != null and createTime != ''">
createTime = #{createTime},
</if>
<if test="originator != null and originator!=''">
originator = #{originator},
</if>
<if test="auditOpinion != null">
auditOpinion = #{auditOpinion},
</if>
<if test="completeTime != null and completeTime != ''">
completeTime = #{completeTime}
</if>
</set>
where id = #{id}
</update>
<update id="updateStockTakingChild">
update stocktakingchild
<set>
<if test="mid != null and mid != ''">
mid = #{mid},
</if>
<if test="oldInventory != null">
oldInventory = #{oldInventory},
</if>
<if test="newInventory != null">
newInventory = #{newInventory},
</if>
<if test="takingResult != null and takingResult != ''">
takingResult = #{takingResult},
</if>
<if test="inventory != null">
inventory = #{inventory},
</if>
<if test="mainId != null and mainId != ''">
mainId = #{mainId}
</if>
</set>
where id = #{id}
</update>
<select id="selectStockTakingChildByMainId" parameterType="int" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where mainId = #{mainId}
</select>
<select id="selectStockTakingByCondition" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test="code != null and code != ''">
and st.code LIKE CONCAT('%', #{code}, '%')
</if>
<if test="depositoryId != null and depositoryId != ''">
and st.depositoryId = #{depositoryId}
</if>
<if test="placeId != null">
and st.placeId = #{placeId}
</if>
<if test="departmentManager != null and departmentManager != ''">
and FIND_IN_SET(#{departmentManager},st.departmentManager) != 0
</if>
<if test="originator != null and originator!=''">
and st.originator = #{originator}
</if>
</select>
<select id="selectStockTakingChildPByCondition" parameterType="map" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where 1 = 1
<if test="mid != null and mid != ''">
and mid = #{mid}
</if>
<if test="oldInventory != null">
and oldInventory = #{oldInventory}
</if>
<if test="newInventory != null">
and newInventory = #{newInventory}
</if>
<if test="takingResult != null and takingResult != ''">
and takingResult = #{takingResult}
</if>
<if test="inventory != null">
and inventory = #{inventory}
</if>
<if test="mainId != null and mainId != ''">
and mainId = #{mainId}
</if>
<if test="mname != null and mname != ''">
and mname like CONCAT('%',#{mname},'%')
</if>
<if test="mtId != null">
and mtId = #{mtId}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="mversion != null and mversion != ''">
and mversion = #{mversion}
</if>
<if test="munit != null and munit != ''">
and munit = #{munit}
</if>
<if test="mtexture != null and mtexture != ''">
and mtexture = #{mtexture}
</if>
</select>
<select id="selectStockTakingById" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where st.id = #{id}
</select>
<select id="selectStockTakingChildPById" parameterType="int" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where id = #{id}
</select>
<select id="findMyTask" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test='isDone == "1"'>
and (state != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyTaskCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test='isDone == "1"'>
and (state != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
</select>
<select id="findMyApply" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
and originator = #{userId}
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyApplyCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
and originator = #{userId}
</select>
</mapper>

96
src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingChildP.java

@ -0,0 +1,96 @@
package com.dreamchaser.depository_manage.pojo;
import com.dreamchaser.depository_manage.entity.MaterialAndBarCode;
import com.dreamchaser.depository_manage.entity.StockTakingChild;
import lombok.Data;
import java.util.List;
/**
* 盘点记录
*/
@Data
public class StockTakingChildP {
/**
* id
*/
private Long id;
/**
* 物料id
*/
private Integer mid;
/**
* 库存容量
*/
private Integer oldInventory;
/**
* 盘点数量
*/
private Integer newInventory;
/**
* 盘点结果
*/
private String takingResult;
/**
* 盘点结果展示
*/
private String takingResultShow;
/**
* 盈亏数量
*/
private Integer inventory;
/**
* 盘点单号
*/
private String code;
/**
* 物料名称
*/
private String mname;
/**
* 物料编码
*/
private String mcode;
/**
* 物料与条形码的对应关系
*/
private List<MaterialAndBarCode> materialAndBarCodeList;
/**
* 类型id
*/
private Long mtId;
/**
* 类型名称
*/
private String tname;
/**
* 物料材质
*/
private String mtexture;
/**
* 物料规格型号
*/
private String mversion;
/**
* 物料计量单位
*/
private String munit;
/**
* 主表id
*/
private Long mainId;
}

93
src/main/java/com/dreamchaser/depository_manage/pojo/StockTakingP.java

@ -0,0 +1,93 @@
package com.dreamchaser.depository_manage.pojo;
import com.dreamchaser.depository_manage.entity.StockTaking;
import com.dreamchaser.depository_manage.utils.DateUtil;
import lombok.Data;
@Data
public class StockTakingP {
/**
* id
*/
private Long id;
/**
* 盘点单号
*/
private String code;
/**
* 负责人
*/
private String departmentManager;
/**
* 盘点仓库
*/
private Integer placeId;
/**
* 盘点库位
*/
private Integer depositoryId;
/**
* 库位编码
*/
private String placeCode;
/**
* 仓库名称
*/
private String depositoryName;
/**
* 负责人名称
*/
private String departmentManagerName;
/**
* 1通过2驳回3待处理
*/
private Integer state;
/**
* 申请时间
*/
private String createTime;
/**
* 审核时间
*/
private String completeTime;
/**
* 盘点发起人
*/
private Integer originator;
/**
* 盘点发起人姓名
*/
private String originatorName;
/**
* 审核意见
*
*/
private String auditOpinion;
public StockTakingP(StockTaking st) {
this.id = st.getId();
this.code = st.getCode();
this.departmentManager = st.getDepartmentManager();
this.depositoryId = st.getDepositoryId();
this.placeId = st.getPlaceId();
this.state = st.getState();
this.createTime = DateUtil.TimeStampToDateTime(st.getCreateTime());
this.originator = st.getOriginator();
this.auditOpinion = st.getAuditOpinion();
}
}

65
src/main/resources/templates/pages/post/selectManager.html

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
var data;
layui.use(['form', 'layer','dropdown','tree'], function () {
var $ = layui.jquery,
tree = layui.tree,
test = tree.render({
elem: '#test2'
,data: []
,onlyIconControl: false //是否仅允许节点左侧图标控制展开收缩
,click: function(obj){
var data = obj.data;
if(data.children !== undefined){
return false;
}
var name = $("#departmentManager",window.parent.document).val();
var id = $("#departmentManagerId",window.parent.document).val();
if(name === undefined||name === null||name === ""){
$("#departmentManager",window.parent.document).val(data.title);
}else{
$("#departmentManager",window.parent.document).val(name + ","+data.title);
}
if(id === undefined||id === null||id === ""){
$("#departmentManagerId",window.parent.document).val(data.id);
}else{
$("#departmentManagerId",window.parent.document).val(id + ","+data.id);
}
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
});
$.ajax({
url: "/company/treeMenus",
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend:function () {
this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] });
},
success: function (d) {
layer.close(this.layerIndex);
var data2 = d.data;
test.reload({
data:data2
});
}
});
})
</script>
</body>
</html>

132
src/main/resources/templates/pages/scanQrCode/ScanBarCodeForTaking.html

@ -0,0 +1,132 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>扫码</title>
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/layuimini.css?v=2.0.4.2" media="all">
<link rel="stylesheet" href="/static/css/themes/default.css" media="all">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--[if lt IE 9]>
<script src="/static/js/html5.min.js"></script>
<script src="/static/js/respond.min.js"></script>
<![endif]-->
<!-- vue相关-->
<script src="../static/js/vue/vue.js"></script>
<script src="../static/js/vue/vue-router.js"></script>
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script>
<script src="../static/js/VueQrcodeReader.umd.min.js"></script>
<script src="/static/js/scanBarCode/html5-qrcode.min.js"></script>
</head>
<body>
<div style="width: 500px" id="reader">
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
let barCodeList = [];
let materialList = [];
// 是否扫描二维码标志位
var flag = false;
const html5QrCode = new Html5Qrcode("reader");
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
/* 扫描成功 */
// console.log(regString.test(decodedText));
var formatName = decodedResult.result.format.formatName;
if (formatName.includes("QR_CODE")||formatName.includes("AZTEC")) {
// 如果扫描的位本地二维码
flag = true;
// 先解密
let jmResult = {};
jmResult.result = decodedText;
layui.$.ajax({
url: "/material/decode3Des",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(jmResult),
success:function (d) {
let parse = JSON.parse(d.data);
if (parse.did !== undefined) {
// 如果扫描的是仓库二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}
else if (parse.pid !== undefined) {
// 如果扫描的是库位二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}else{
materialList.push(parse);
}
}
})
}else{
// console.log("条形码",decodedText);
// 如果是条形码
barCodeList.push(decodedText);
}
html5QrCode.stop().then((ignore) => {
// 暂停扫描
layer.confirm("是否继续扫描?",
{
btn: ["继续", "取消"]
},
function () {// 继续
// 弹出选择框
layer.close(layer.index);
html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
},
function () { // 取消当前操作
layer.close(layer.index); // 关闭弹窗
// 将数据暂存到redis
var param = {};
param.barCodeList = barCodeList;
param.flag = flag;
layui.$.ajax({
url:"/material/temporaryBarCodeValueForMaterial",
type:"post",
datatype:"json",
data:JSON.stringify(param),
contentType: "application/json;charset=utf-8",
});
if(flag){
var params = {};
params.materialList = [];
layui.$.ajax({
url: "/material/temporaryValue",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(params)
});
}
// 关闭当前页
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
)
}).catch((err) => {
console.log(err)
// 停止失败,处理它。
});
};
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
// Select back camera or fail with `OverconstrainedError`.
html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
</script>
</body>
</html>

1162
src/main/resources/templates/pages/stockTaking/stockTaking.html

File diff suppressed because it is too large

0
target/classes/.restartTriggerFile

BIN
target/classes/META-INF/depository_manage (2).kotlin_module

Binary file not shown.

294
target/classes/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml

@ -0,0 +1,294 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- notice -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.StockTakingMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="StockTakingMap" type="com.dreamchaser.depository_manage.entity.StockTaking">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" />
<result column="placeId" property="placeId" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="crateTime" property="crateTime" jdbcType="INTEGER" />
<result column="completeTime" property="completeTime" jdbcType="INTEGER" />
<result column="originator" property="originator" jdbcType="INTEGER" />
<result column="departmentManager" property="departmentManager" jdbcType="VARCHAR" />
<result column="auditOpinion" property="auditOpinion" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="StockTakingChildMap" type="com.dreamchaser.depository_manage.pojo.StockTakingChildP">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="oldInventory" property="oldInventory" jdbcType="INTEGER" />
<result column="newInventory" property="newInventory" jdbcType="INTEGER" />
<result column="inventory" property="inventory" jdbcType="INTEGER" />
<result column="mainId" property="mainId" jdbcType="INTEGER" />
<result column="takingResult" property="takingResult" jdbcType="VARCHAR" />
<result column="mtexture" property="mtexture" jdbcType="VARCHAR" />
<result column="mversion" property="mversion" jdbcType="VARCHAR" />
<result column="munit" property="munit" jdbcType="VARCHAR" />
<result column="tname" property="tname" jdbcType="VARCHAR" />
<result column="mcode" property="mcode" jdbcType="VARCHAR" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="mtId" property="mtId" jdbcType="INTEGER" />
</resultMap>
<!-- 表查询字段 -->
<sql id="StockTakingAllColumns">
st.id,st.code,st.depositoryId,st.placeId,st.departmentManager,st.state,st.createTime,st.originator,st.completeTime,st.auditOpinion
</sql>
<sql id="StockTakingChildPAllColumns">
id,mid,oldInventory,newInventory,inventory,mainId,takingResult,mname,mtId,tname,mcode,mversion,munit,mtexture
</sql>
<!-- 插入主表-->
<insert id="insertStockTaking" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktaking (id,code,depositoryId,placeId,departmentManager,state,createTime,originator)
values (
#{id},
#{code},
#{depositoryId},
#{placeId},
#{departmentManager},
#{state},
#{createTime},
#{originator}
)
</insert>
<!-- 插入子表-->
<insert id="insertStockTakingChild" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktakingchild (id,mid,oldInventory,newInventory,takingResult,inventory,mainId)
values (
#{id},#{mid},#{oldInventory},#{newInventory},#{takingResult},#{inventory},#{mainId}
)
</insert>
<delete id="deleteStockTakingChild" parameterType="int">
delete from stocktakingchild where id = #{id}
</delete>
<delete id="deleteStockTakingChilds" parameterType="list">
delete from stocktakingchild
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteStockTaking" parameterType="int">
delete from stocktaking where id = #{id}
</delete>
<delete id="deleteStockTakings" parameterType="list">
delete from stocktaking
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateStockTaking">
update stocktaking
<set>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="depositoryId != null">
depositoryId = #{depositoryId},
</if>
<if test="placeId != null">
placeId = #{placeId},
</if>
<if test="departmentManager != null and departmentManager != ''">
departmentManager = #{departmentManager},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="createTime != null and createTime != ''">
createTime = #{createTime},
</if>
<if test="originator != null and originator!=''">
originator = #{originator},
</if>
<if test="auditOpinion != null">
auditOpinion = #{auditOpinion},
</if>
<if test="completeTime != null and completeTime != ''">
completeTime = #{completeTime}
</if>
</set>
where id = #{id}
</update>
<update id="updateStockTakingChild">
update stocktakingchild
<set>
<if test="mid != null and mid != ''">
mid = #{mid},
</if>
<if test="oldInventory != null">
oldInventory = #{oldInventory},
</if>
<if test="newInventory != null">
newInventory = #{newInventory},
</if>
<if test="takingResult != null and takingResult != ''">
takingResult = #{takingResult},
</if>
<if test="inventory != null">
inventory = #{inventory},
</if>
<if test="mainId != null and mainId != ''">
mainId = #{mainId}
</if>
</set>
where id = #{id}
</update>
<select id="selectStockTakingChildByMainId" parameterType="int" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where mainId = #{mainId}
</select>
<select id="selectStockTakingByCondition" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test="code != null and code != ''">
and st.code LIKE CONCAT('%', #{code}, '%')
</if>
<if test="depositoryId != null and depositoryId != ''">
and st.depositoryId = #{depositoryId}
</if>
<if test="placeId != null">
and st.placeId = #{placeId}
</if>
<if test="departmentManager != null and departmentManager != ''">
and FIND_IN_SET(#{departmentManager},st.departmentManager) != 0
</if>
<if test="originator != null and originator!=''">
and st.originator = #{originator}
</if>
</select>
<select id="selectStockTakingChildPByCondition" parameterType="map" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where 1 = 1
<if test="mid != null and mid != ''">
and mid = #{mid}
</if>
<if test="oldInventory != null">
and oldInventory = #{oldInventory}
</if>
<if test="newInventory != null">
and newInventory = #{newInventory}
</if>
<if test="takingResult != null and takingResult != ''">
and takingResult = #{takingResult}
</if>
<if test="inventory != null">
and inventory = #{inventory}
</if>
<if test="mainId != null and mainId != ''">
and mainId = #{mainId}
</if>
<if test="mname != null and mname != ''">
and mname like CONCAT('%',#{mname},'%')
</if>
<if test="mtId != null">
and mtId = #{mtId}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="mversion != null and mversion != ''">
and mversion = #{mversion}
</if>
<if test="munit != null and munit != ''">
and munit = #{munit}
</if>
<if test="mtexture != null and mtexture != ''">
and mtexture = #{mtexture}
</if>
</select>
<select id="selectStockTakingById" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where st.id = #{id}
</select>
<select id="selectStockTakingChildPById" parameterType="int" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where id = #{id}
</select>
<select id="findMyTask" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test='isDone == "1"'>
and (state != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyTaskCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
<if test='isDone == "1"'>
and (state != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
</if>
</select>
<select id="findMyApply" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
and originator = #{userId}
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyApplyCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
and originator = #{userId}
</select>
</mapper>

74
target/classes/templates/pages/material/selectMaterialByCardForTaking.html

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<input id="mname" name="mname" th:value="${mname}" style="display: none">
<input id="type" name="type" th:value="${type}" style="display: none">
<input id="clickObj" name="clickObj" th:value="${clickObj}" style="display: none">
<input id="placeId" name="clickObj" th:value="${placeId}" style="display: none">
<input id="depositoryId" name="clickObj" th:value="${depositoryId}" style="display: none">
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
var data;
layui.use(['form', 'layer', 'dropdown', 'tree'], function () {
var $ = layui.jquery,
tree = layui.tree;
var mname = $("#mname").val();
var type = $("#type").val();
var clickObj = $("#clickObj").val();
var depositoryId = $("#depositoryId").val();
var placeId = $("#placeId").val();
var req = {};
req.mname = mname;
req.type = type;
req.depositoryId = depositoryId;
req.placeId = placeId;
test = tree.render({
elem: '#test2'
, data: []
, click: function (obj) {
if (obj.data.children !== undefined) {
return false
}
var windowParent = $("#"+clickObj,window.parent.document)[0];
var children = windowParent.childNodes[5];
var materialItem = children.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
materialName.value = obj.data.title;
materialId.value = obj.data.id;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
});
$.ajax({
url: "/material/treeMenus",
data: JSON.stringify(req),
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend:function () {
this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] });
},
success: function (d) {
layer.close(this.layerIndex);
var data2 = d.data;
test.reload({
data: data2
});
}
});
})
</script>
</body>
</html>

65
target/classes/templates/pages/post/selectManager.html

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
var data;
layui.use(['form', 'layer','dropdown','tree'], function () {
var $ = layui.jquery,
tree = layui.tree,
test = tree.render({
elem: '#test2'
,data: []
,onlyIconControl: false //是否仅允许节点左侧图标控制展开收缩
,click: function(obj){
var data = obj.data;
if(data.children !== undefined){
return false;
}
var name = $("#departmentManager",window.parent.document).val();
var id = $("#departmentManagerId",window.parent.document).val();
if(name === undefined||name === null||name === ""){
$("#departmentManager",window.parent.document).val(data.title);
}else{
$("#departmentManager",window.parent.document).val(name + ","+data.title);
}
if(id === undefined||id === null||id === ""){
$("#departmentManagerId",window.parent.document).val(data.id);
}else{
$("#departmentManagerId",window.parent.document).val(id + ","+data.id);
}
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
});
$.ajax({
url: "/company/treeMenus",
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend:function () {
this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] });
},
success: function (d) {
layer.close(this.layerIndex);
var data2 = d.data;
test.reload({
data:data2
});
}
});
})
</script>
</body>
</html>

132
target/classes/templates/pages/scanQrCode/ScanBarCodeForTaking.html

@ -0,0 +1,132 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>扫码</title>
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/layuimini.css?v=2.0.4.2" media="all">
<link rel="stylesheet" href="/static/css/themes/default.css" media="all">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--[if lt IE 9]>
<script src="/static/js/html5.min.js"></script>
<script src="/static/js/respond.min.js"></script>
<![endif]-->
<!-- vue相关-->
<script src="../static/js/vue/vue.js"></script>
<script src="../static/js/vue/vue-router.js"></script>
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script>
<script src="../static/js/VueQrcodeReader.umd.min.js"></script>
<script src="/static/js/scanBarCode/html5-qrcode.min.js"></script>
</head>
<body>
<div style="width: 500px" id="reader">
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
let barCodeList = [];
let materialList = [];
// 是否扫描二维码标志位
var flag = false;
const html5QrCode = new Html5Qrcode("reader");
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
/* 扫描成功 */
// console.log(regString.test(decodedText));
var formatName = decodedResult.result.format.formatName;
if (formatName.includes("QR_CODE")||formatName.includes("AZTEC")) {
// 如果扫描的位本地二维码
flag = true;
// 先解密
let jmResult = {};
jmResult.result = decodedText;
layui.$.ajax({
url: "/material/decode3Des",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(jmResult),
success:function (d) {
let parse = JSON.parse(d.data);
if (parse.did !== undefined) {
// 如果扫描的是仓库二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}
else if (parse.pid !== undefined) {
// 如果扫描的是库位二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}else{
materialList.push(parse);
}
}
})
}else{
// console.log("条形码",decodedText);
// 如果是条形码
barCodeList.push(decodedText);
}
html5QrCode.stop().then((ignore) => {
// 暂停扫描
layer.confirm("是否继续扫描?",
{
btn: ["继续", "取消"]
},
function () {// 继续
// 弹出选择框
layer.close(layer.index);
html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
},
function () { // 取消当前操作
layer.close(layer.index); // 关闭弹窗
// 将数据暂存到redis
var param = {};
param.barCodeList = barCodeList;
param.flag = flag;
layui.$.ajax({
url:"/material/temporaryBarCodeValueForMaterial",
type:"post",
datatype:"json",
data:JSON.stringify(param),
contentType: "application/json;charset=utf-8",
});
if(flag){
var params = {};
params.materialList = [];
layui.$.ajax({
url: "/material/temporaryValue",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(params)
});
}
// 关闭当前页
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
)
}).catch((err) => {
console.log(err)
// 停止失败,处理它。
});
};
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
// Select back camera or fail with `OverconstrainedError`.
html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
</script>
</body>
</html>

100
target/classes/templates/pages/scanQrCode/ScanCodeByTaking.html

@ -0,0 +1,100 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>扫码</title>
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/layuimini.css?v=2.0.4.2" media="all">
<link rel="stylesheet" href="/static/css/themes/default.css" media="all">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--[if lt IE 9]>
<script src="/static/js/html5.min.js"></script>
<script src="/static/js/respond.min.js"></script>
<![endif]-->
<!-- vue相关-->
<script src="../static/js/vue/vue.js"></script>
<script src="../static/js/vue/vue-router.js"></script>
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script>
<script src="../static/js/VueQrcodeReader.umd.min.js"></script>
<script src="/static/js/scanBarCode/html5-qrcode.min.js"></script>
</head>
<body>
<div style="width: 500px" id="reader">
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
// 条形码
let barCode;
var depository;
var place;
// 是否扫描二维码标志位
var flag = false;
const html5QrCode = new Html5Qrcode("reader");
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
/* 扫描成功 */
var formatName = decodedResult.result.format.formatName;
html5QrCode.stop().then((ignore) => {
// 暂停扫描
if (formatName.includes("QR_CODE")||formatName.includes("AZTEC")) {
// 如果扫描的位本地二维码
flag = true;
// 先解密
let jmResult = {};
jmResult.result = decodedText;
layui.$.ajax({
url: "/material/decode3Des",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(jmResult),
success:function (d) {
let parse = JSON.parse(d.data);
if (parse.did !== undefined) {
// 如果扫描的是仓库二维码
depository = parse;
layui.$("#openSonByDepository",window.parent.document).val(depository.dname);
layui.$("#depositoryId",window.parent.document).val(depository.did);
layui.$("#placeId",window.parent.document).val(0);
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
else if (parse.pid !== undefined) {
// 如果扫描的是库位二维码
place = parse;
layui.$("#openSonByDepository",window.parent.document).val(place.dname +"-"+ place.code);
layui.$("#depositoryId",window.parent.document).val(place.depositoryId);
layui.$("#placeId",window.parent.document).val(place.pid);
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
else{
layer.msg("请扫描正确的二维码",{
icon:0,
time:500
},function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
}
}
})
}else{
console.log("条形码",decodedText);
// 如果是条形码
}
}).catch((err) => {
console.log(err)
// 停止失败,处理它。
});
};
const config = { fps: 10, qrbox: { width: 250, height: 250 } };
// Select back camera or fail with `OverconstrainedError`.
html5QrCode.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
</script>
</body>
</html>

202
target/classes/templates/pages/scanQrCode/ScanMaterialCodeForTaking.html

@ -0,0 +1,202 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>扫码</title>
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/layuimini.css?v=2.0.4.2" media="all">
<link rel="stylesheet" href="/static/css/themes/default.css" media="all">
<link rel="stylesheet" href="/static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
<!--[if lt IE 9]>
<script src="/static/js/html5.min.js"></script>
<script src="/static/js/respond.min.js"></script>
<![endif]-->
<!-- vue相关-->
<script src="../static/js/vue/vue.js"></script>
<script src="../static/js/vue/vue-router.js"></script>
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script>
<script src="../static/js/VueQrcodeReader.umd.min.js"></script>
<style>
.validation-success,
.validation-failure,
.validation-pending {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, .8);
text-align: center;
font-weight: bold;
font-size: 1.4rem;
padding: 10px;
display: flex;
flex-flow: column nowrap;
justify-content: center;
}
.validation-success {
color: green;
}
.validation-failure {
color: red;
}
</style>
</head>
<body>
<input type="text" id="depositoryId" th:value="${depositoryId}" style="display: none">
<input type="text" id="placeId" th:value="${placeId}" style="display: none">
<div id="app">
<qrcode-stream :camera="camera" @decode="onDecode" @init="onInit" :track="paintBoundingBox">
<div v-if="validationPending" class="validation-pending">
Long validation in progress...
</div>
</qrcode-stream>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
Vue.use(httpVueLoader);
var depositoryId = layui.$("#depositoryId").val();
var placeId = layui.$("#placeId").val();
var vue = new Vue({
data() {
return {
isValid: undefined,
camera: 'auto',
result: '',
error: '',
materialList: []
}
},
computed: {
validationPending() {
return this.isValid === undefined
&& this.camera === 'off'
},
},
methods: {
onDecode(result) {
let params = {}; // 用于暂存扫描结果
this.result = result;
let jmResult = {};
jmResult.result = result;
layui.$.ajax({
url: "/material/decode3Des",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(jmResult),
success:function (d) {
let parse = JSON.parse(d.data);
vue.turnCameraOff(); // 暂停扫描
if (parse.did !== undefined) {
// 如果扫描的是仓库二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}
else if (parse.pid !== undefined) {
// 如果扫描的是库位二维码
layer.msg("请扫描物料!",{
icon:0,
time:500
},function () {
vue.turnCameraOn(); // 继续扫描
})
}
else if (parse.mid !== undefined) {
// 如果扫描的是物料二维码
vue.materialList.push(parse);
layer.confirm("是否继续扫描",
{
btn: ["继续", "取消"]
},
function () { // 继续扫描物料
vue.turnCameraOn(); // 继续扫描
layer.close(layer.index); // 关闭弹窗
},
function () {
// 不扫描物料
params.materialList = vue.materialList;
vue.temporaryScanValue(params); // 将物料暂存
// 关闭当前页
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
)
}
}
});
},
async onInit(promise) {
try {
await promise.then(this.resetValidationState)
} catch (error) {
if (error.name === 'NotAllowedError') {
this.error = "ERROR: you need to grant camera access permission"
} else if (error.name === 'NotFoundError') {
this.error = "ERROR: no camera on this device"
} else if (error.name === 'NotSupportedError') {
this.error = "ERROR: secure context required (HTTPS, localhost)"
} else if (error.name === 'NotReadableError') {
this.error = "ERROR: is the camera already in use?"
} else if (error.name === 'OverconstrainedError') {
this.error = "ERROR: installed cameras are not suitable"
} else if (error.name === 'StreamApiNotSupportedError') {
this.error = "ERROR: Stream API is not supported in this browser"
} else if (error.name === 'InsecureContextError') {
this.error = 'ERROR: Camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.';
} else {
this.error = `ERROR: Camera error (${error.name})`
}
console.log(this.error)
}
}
,
resetValidationState() {
this.isValid = undefined
}
,
// 绘制二维码跟踪框
paintBoundingBox(detectedCodes, ctx) {
for (const detectedCode of detectedCodes) {
const {boundingBox: {x, y, width, height}} = detectedCode;
ctx.lineWidth = 2;
ctx.strokeStyle = '#007bff';
ctx.strokeRect(x, y, width, height)
}
}
,
// 打开相机
turnCameraOn() {
this.camera = 'auto'
}
,
// 关闭相机
turnCameraOff() {
this.camera = 'off'
},
// 将扫描到的数据暂存到redis
temporaryScanValue(params) {
layui.$.ajax({
url: "/material/temporaryValue",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(params)
});
}
}
}).$mount('#app')
</script>
</body>
</html>

1162
target/classes/templates/pages/stockTaking/stockTaking.html

File diff suppressed because it is too large

350
target/classes/templates/pages/stockTaking/stockTakingReview.html

@ -0,0 +1,350 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>仓库盘点</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all">
<style>
.inputdiv {
display: flex;
background-color: #fff;
height: 38px;
line-height: 38px;
border: 1px solid rgb(238, 238, 238);
}
.layui-form-label {
padding: 9px 0px;
text-align: left;
}
.layui-input-block {
margin-left: 80px;
}
.layui-form-select {
width: 100%;
border-style: none;
}
</style>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; ">
<div carousel-item style="overflow: inherit">
<div>
<fieldset class="table-search-fieldset">
<legend>库存盘点</legend>
<div class="layui-fluid">
<div class="layui-card">
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;padding-top: 100px; padding-bottom: 200px"
lay-filter="form1" id="form1">
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px">
<div class="layui-form-item">
<label class="layui-form-label">盘点位置:</label>
<div class="layui-input-block">
<input type="text" name="mainId" id="mainId" th:value="${mainRecord.getId()}" style="display:none;">
<input type="text" class="layui-input"
th:value="${mainRecord.getDepositoryName()}"
style="border-style: none"
id="openSonByDepository" readonly
lay-verify="required"/>
<input type="text" name="depositoryId" class="layui-input"
id="depositoryId" th:value="${mainRecord.getDepositoryId()}"
style="display: none" lay-verify="required"/>
<input type="text" name="placeId" class="layui-input" id="placeId"
th:value="${mainRecord.getPlaceId()}"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">负责人:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择负责人" class="layui-input"
id="departmentManager" readonly
th:value="${mainRecord.getDepartmentManagerName()}"
lay-verify="required"/>
<input type="text" id="departmentManagerId" name="departmentManagerId"
th:value="${mainRecord.getDepartmentManager()}"
class="layui-input" style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发起人:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择负责人" class="layui-input"
id="originatorName" readonly
th:value="${mainRecord.getOriginatorName()}"
lay-verify="required"/>
<input type="text" id="originator" name="departmentManagerId"
th:value="${mainRecord.getOriginator()}"
class="layui-input" style="display: none" lay-verify="required"/>
</div>
</div>
</div>
<fieldset class="table-search-fieldset">
<legend>盘点明细</legend>
<div class="layui-card-body" id="InventoryDetails" style="padding-right: 0px">
<hr>
<div class="layui-collapse" lay-accordion>
<div class="layui-colla-item"
th:each="recordMin,iterStar:${recordChild}">
<h2 class="layui-colla-title"
th:text="${recordMin.getMname()}"></h2>
<div class="layui-colla-content">
<div class="layui-form-item">
<label class="layui-form-label">物料编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input th:attr="name='code' +${recordMin.getId()},id='code'+${recordMin.getId()}"
type="text" placeholder="请填写入物料编码"
th:value="${recordMin.getMcode()}"
class="layui-input" lay-verify="required"
style="border-style: none">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">条形编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<select
th:attr="id='barCode'+${recordMin.getId()},name='barCode'+${recordMin.getId()}"
style="border-style: none">
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">物料类型:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择物料类型"
class="layui-input"
th:value="${recordMin.getTname()}"
th:attr="id='openSonByMateralType'+${recordMin.getId()}"
readonly
lay-verify="required"/>
<input type="text"
th:value="${recordMin.getMtId()}"
th:attr="id='materialTypeId'+${recordMin.getId()},name='typeId'+${recordMin.getId()}"
placeholder="请选择物料类型" class="layui-input"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">材质:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写材质名称"
class="layui-input"
th:value="${recordMin.getMtexture()}"
th:attr="id='texture'+${recordMin.getId()},name='texture'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">规格型号:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写规格型号"
class="layui-input"
th:value="${recordMin.getMversion()}"
th:attr="id='version'+${recordMin.getId()},name='version'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getMunit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">库存数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input" readonly
th:value="${recordMin.getOldInventory()}"
th:attr="id='oldInventory'+${recordMin.getId()},name='oldInventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
th:value="${recordMin.getNewInventory()}"
th:attr="id='newInventory'+${recordMin.getId()},name='newInventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点结果:</label>
<div class="layui-input-block">
<input type="text" class="layui-input" id="takingResult"
th:value="${recordMin.getTakingResultShow()}"
th:attr="id='takingResult'+${recordMin.getId()},name='takingResult'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盈亏数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input" readonly
th:value="${recordMin.getInventory()}"
th:attr="id='inventory'+${recordMin.getId()},name='inventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<div id="review">
<div class="layui-form" style="margin: 0 auto;max-width: 900px;padding-top: 40px;">
<div class="layui-form-item">
<label class="layui-form-label">审核备注:</label>
<div class="layui-input-block">
<textarea id="auditOpinion" name="auditOpinion" placeholder="请填写相关原因及申请原因" value="" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="button" class="layui-btn" onclick="review(1)">
&emsp;审核通过&emsp;
</button>
<button type="button" class="layui-btn layui-btn-danger" onclick="review(2)">
&emsp;审核不通过&emsp;
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
function review(data){}
layui.use(['form','step','element'], function () {
var $ = layui.$,
step = layui.step,
element = layui.element,
form = layui.form;
var position=0,states={},number = 2;
states = [ {title: "待审核"}];
// 用于分步表单加载
step.render({
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
stepWidth: '750px',
height: '1495px',
position: position,
number:number,
stepItems: states
});
// 用于获取审核结果与审核的单号
review=function (pass) {
let data = {};
data.mainId = $("#mainId").val();
data.auditOpinion = $("#auditOpinion").val();
data.state = pass;
$.ajax({
url:"/stockTaking/review",
type:'post',
dataType:'json',
contentType: "application/json;charset=utf-8",
data:JSON.stringify(data),
beforeSend:function () {
this.layerIndex = layer.load(0, { shade: [0.5, '#393D49'] });
},
success:function(d){
layer.close(this.layerIndex);
if(d.status >= 300){
var errMsg = d.data.errMsg;
// 获取出错的子订单
layer.confirm("当前盘点数量中有溢出情况,需要进行转移", {
btn:["确定"]
},function () { // 继续
layer.open({
type: 2,
title: '转移物料',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['70%', '70%'],
move: '.layui-layer-title',
fixed: false,
content: '/stockTakingTransfer?minIds='+errMsg.errIds,
end: function (res) {
if(res.status >= 300){
layer.msg("提交失败,联系开发人员解决", {
icon: 5,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function(){
window.location = '/StockTakingView?id='+data.mainId;
});
}else{
layer.msg("提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function(){
window.location = '/StockTakingView?id='+data.mainId;
});
}
}
});
});
}
else{
layer.msg("提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function(){
window.location = '/StockTakingView?id='+data.mainId;
});
}
},
})
};
});
</script>
</body>
</html>

291
target/classes/templates/pages/stockTaking/stockTakingView.html

@ -0,0 +1,291 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>仓库盘点</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all">
<style>
.inputdiv {
display: flex;
background-color: #fff;
height: 38px;
line-height: 38px;
border: 1px solid rgb(238, 238, 238);
}
.layui-form-label {
padding: 9px 0px;
text-align: left;
}
.layui-input-block {
margin-left: 80px;
}
.layui-form-select {
width: 100%;
border-style: none;
}
</style>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto; ">
<div carousel-item style="overflow: inherit">
<div>
<fieldset class="table-search-fieldset">
<legend>库存盘点</legend>
<div class="layui-fluid">
<div class="layui-card">
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;padding-top: 100px; padding-bottom: 200px"
lay-filter="form1" id="form1">
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px">
<div class="layui-form-item">
<label class="layui-form-label">盘点位置:</label>
<div class="layui-input-block">
<input type="text" name="mainId" th:value="${mainRecord.getId()}" style="display:none;">
<input type="text" class="layui-input"
th:value="${mainRecord.getDepositoryName()}"
style="border-style: none"
id="openSonByDepository" readonly
lay-verify="required"/>
<input type="text" name="depositoryId" class="layui-input"
id="depositoryId" th:value="${mainRecord.getDepositoryId()}"
style="display: none" lay-verify="required"/>
<input type="text" name="placeId" class="layui-input" id="placeId"
th:value="${mainRecord.getPlaceId()}"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">负责人:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择负责人" class="layui-input"
id="departmentManager" readonly
th:value="${mainRecord.getDepartmentManagerName()}"
lay-verify="required"/>
<input type="text" id="departmentManagerId" name="departmentManagerId"
th:value="${mainRecord.getDepartmentManager()}"
class="layui-input" style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发起人:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择负责人" class="layui-input"
id="originatorName" readonly
th:value="${mainRecord.getOriginatorName()}"
lay-verify="required"/>
<input type="text" id="originator" name="departmentManagerId"
th:value="${mainRecord.getOriginator()}"
class="layui-input" style="display: none" lay-verify="required"/>
</div>
</div>
</div>
<fieldset class="table-search-fieldset">
<legend>盘点明细</legend>
<div class="layui-card-body" id="InventoryDetails" style="padding-right: 0px">
<hr>
<div class="layui-collapse" lay-accordion>
<div class="layui-colla-item"
th:each="recordMin,iterStar:${recordChild}">
<h2 class="layui-colla-title"
th:text="${recordMin.getMname()}"></h2>
<div class="layui-colla-content">
<div class="layui-form-item">
<label class="layui-form-label">物料编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input th:attr="name='code' +${recordMin.getId()},id='code'+${recordMin.getId()}"
type="text" placeholder="请填写入物料编码"
th:value="${recordMin.getMcode()}"
class="layui-input" lay-verify="required"
style="border-style: none">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">条形编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<select
th:attr="id='barCode'+${recordMin.getId()},name='barCode'+${recordMin.getId()}"
style="border-style: none">
</select>
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">物料类型:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择物料类型"
class="layui-input"
th:value="${recordMin.getTname()}"
th:attr="id='openSonByMateralType'+${recordMin.getId()}"
readonly
lay-verify="required"/>
<input type="text"
th:value="${recordMin.getMtId()}"
th:attr="id='materialTypeId'+${recordMin.getId()},name='typeId'+${recordMin.getId()}"
placeholder="请选择物料类型" class="layui-input"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">材质:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写材质名称"
class="layui-input"
th:value="${recordMin.getMtexture()}"
th:attr="id='texture'+${recordMin.getId()},name='texture'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">规格型号:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写规格型号"
class="layui-input"
th:value="${recordMin.getMversion()}"
th:attr="id='version'+${recordMin.getId()},name='version'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getMunit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">库存数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input" readonly
th:value="${recordMin.getOldInventory()}"
th:attr="id='oldInventory'+${recordMin.getId()},name='oldInventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
th:value="${recordMin.getNewInventory()}"
th:attr="id='newInventory'+${recordMin.getId()},name='newInventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点结果:</label>
<div class="layui-input-block">
<input type="text" class="layui-input" id="takingResult"
th:value="${recordMin.getTakingResultShow()}"
th:attr="id='takingResult'+${recordMin.getId()},name='takingResult'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盈亏数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input" readonly
th:value="${recordMin.getInventory()}"
th:attr="id='inventory'+${recordMin.getId()},name='inventory'+${recordMin.getId()}"
lay-verify="required"/>
</div>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<div class="layui-card-body" id="takingFooter" style="padding-right: 0px;display: none">
<div class="layui-form-item">
<label class="layui-form-label">处理时间:</label>
<div class="layui-input-block">
<input type="text" id="completeTime" class="layui-input" th:value="${mainRecord.getCompleteTime()}" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核意见:</label>
<div class="layui-input-block">
<input type="text" placeholder="" class="layui-input"
readonly
th:value="${mainRecord.getAuditOpinion()}"
lay-verify="required"/>
</div>
</div>
</div>
</form>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
layui.use(['form', 'flow','step','element'], function () {
var $ = layui.$,
step = layui.step,
element = layui.element,
form = layui.form;
var position=0,states={},number = 2;
var ifShow = ($("#completeTime").val() === "");
console.log($("#completeTime").val())
console.log(ifShow)
if(ifShow){
// 如果还未处理
states = [ {title: "待审核"}];
}else{
$("#takingFooter").show();
states = [{title: "已处理"}]
}
// 用于分步表单加载
step.render({
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
stepWidth: '750px',
height: '1300px',
position: position,
number:number,
stepItems: states
});
});
</script>
</body>
</html>

395
target/classes/templates/pages/stockTaking/stockTransfer.html

@ -0,0 +1,395 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>仓库盘点</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
<link rel="stylesheet" href="/static/js/lay-module/step-lay/step.css" media="all">
<style>
.inputdiv {
display: flex;
background-color: #fff;
height: 38px;
line-height: 38px;
border: 1px solid rgb(238, 238, 238);
}
.layui-form-label {
padding: 9px 0px;
text-align: left;
}
.layui-input-block {
margin-left: 80px;
}
.layui-form-select {
width: 100%;
border-style: none;
}
</style>
</head>
<body>
<div class="layuimini-container">
<div class="layuimini-main">
<div>
<fieldset class="table-search-fieldset">
<legend>转移盘点</legend>
<div class="layui-fluid">
<div class="layui-card">
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;padding-top: 100px; padding-bottom: 200px"
lay-filter="form1" id="form1">
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px">
<div class="layui-form-item">
<label class="layui-form-label">转移位置:</label>
<div class="layui-input-block">
<input type="text" id="minIds" name="minIds" th:value="${minIds}" style="display:none;">
<input type="text" name="mainId" id="mainId" th:value="${mainRecord.getId()}"
style="display:none;">
<input type="text" class="layui-input"
id="openSonByDepository" readonly
lay-verify="required"/>
<input type="text" name="depositoryId" class="layui-input"
id="depositoryId"
style="display: none" lay-verify="required"/>
<input type="text" name="placeId" class="layui-input" id="placeId"
style="display: none" lay-verify="required"/>
</div>
</div>
</div>
<fieldset class="table-search-fieldset">
<legend>转移明细</legend>
<div class="layui-card-body" id="InventoryDetails" style="padding-right: 0px">
<hr>
<div class="layui-collapse" lay-accordion>
<div class="layui-colla-item"
th:each="recordMin,iterStar:${recordChild}">
<h2 class="layui-colla-title"
th:text="${recordMin.getMname()}"></h2>
<div class="layui-colla-content">
<div class="layui-form-item">
<label class="layui-form-label">物料编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<input th:attr="name='code' +${recordMin.getId()},id='code'+${recordMin.getId()}"
type="text" placeholder="请填写入物料编码"
th:value="${recordMin.getMcode()}"
class="layui-input" lay-verify="required"
style="border-style: none">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">条形编码:</label>
<div class="layui-input-block" style="margin: 0px;">
<div class="inputdiv">
<select
th:attr="id='barCode'+${recordMin.getId()},name='barCode'+${recordMin.getId()}"
style="border-style: none">
</select>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">物料类型:</label>
<div class="layui-input-block">
<input type="text" placeholder="请选择物料类型"
class="layui-input"
th:value="${recordMin.getTname()}"
th:attr="id='openSonByMateralType'+${recordMin.getId()}"
readonly
lay-verify="required"/>
<input type="text"
th:value="${recordMin.getMtId()}"
th:attr="id='materialTypeId'+${recordMin.getId()},name='typeId'+${recordMin.getId()}"
placeholder="请选择物料类型" class="layui-input"
style="display: none" lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">材质:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写材质名称"
class="layui-input"
th:value="${recordMin.getMtexture()}"
th:attr="id='texture'+${recordMin.getId()},name='texture'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">规格型号:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写规格型号"
class="layui-input"
th:value="${recordMin.getMversion()}"
th:attr="id='version'+${recordMin.getId()},name='version'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block">
<input type="text" placeholder="请填写计量单位"
class="layui-input"
th:value="${recordMin.getMunit()}"
th:attr="id='unit'+${recordMin.getId()},name='unit'+${recordMin.getId()}"
/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">盘点数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
th:value="${recordMin.getNewInventory()}"
th:attr="id='newInventory'+${recordMin.getId()},name='newInventory'+${recordMin.getId()}"
readonly
lay-verify="required"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">转移数量:</label>
<div class="layui-input-block">
<input type="number" class="layui-input"
th:value="${recordMin.getInventory()}"
th:attr="id='invnetory'+${recordMin.getId()},name='invnetory'+${recordMin.getId()}"
onblur="checkNumber(this)"
lay-verify="required"/>
</div>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<div class="layui-card-body" id="takingFooter" style="padding-right: 0px">
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formStep">
&emsp;提交&emsp;
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
// 用于扫描条形码或二维码
function scanCode(obj) {
}
// 用于盘点当前转移数量是否合适
function checkNumber(obj) {
}
// 用于暂存卡片个数
let params = [];
// 用于存储当前选择的盘点位置
let depositoryId;
let placeId;
//用于存储当前最小转移量
let minTransferNum = {};
let minIds = [];
layui.use(['form', 'flow'], function () {
var $ = layui.$,
form = layui.form;
var minRecordIds = $("#minIds").val();
let split = minRecordIds.split(",");
for (let i = 0; i < split.length; i++) {
var s = split[i];
if ("" === s) {
continue;
}
minIds.push(Number(s));
minTransferNum["invnetory" + s] = ($("#invnetory" + s).val());
}
// 用于打开仓库树形菜单
$('#openSonByDepository').on('click', function () {
layer.open({
type: 2,
title: '弹窗内容',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['70%', '70%'],
move: '.layui-layer-title',
fixed: false,
content: '/selectDepository?type=2',
end: function () {
var nowDepositoryId = $("#depositoryId").val();
var nowPlaceId = $("#placeId").val();
if (nowDepositoryId !== depositoryId || nowPlaceId !== placeId) {
// 如果重新选择盘点位置
var nowDepositoryName = $("#openSonByDepository").val();
$("#form1")[0].reset();
$("#depositoryId").val(nowDepositoryId);
$("#placeId").val(nowPlaceId);
$("#openSonByDepository").val(nowDepositoryName);
form.render();
}
depositoryId = nowDepositoryId;
placeId = nowPlaceId;
}
});
});
// 用于提交盘点转移情况
form.on('submit(formStep)', function (data) {
if (depositoryId !== null && depositoryId !== undefined && depositoryId !== "") {
data = data.field;
$.ajax({
url: "/stockTaking/stockTransfer",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(data),
beforeSend: function () {
this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']});
},
success: function (data) {
layer.msg("申请提交成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function () {
step.next('#stepForm');
});
},
complete: function () {
layer.close(this.layerIndex);
}
});
} else {
layer.msg("请先选择盘点位置", {
icon: 0,
time: 500
})
}
});
//删除数组中指定元素
function remove(arr, item) {
var result = [];
for (let i = 0; i < arr.length; i++) {
if (arr[i] === item) {
continue;
}
result.push(arr[i]);
}
return result;
}
// 扫码盘点位置
scanCode = function () {
layer.open({
type: 2,
title: '弹窗内容',
skin: 'layui-layer-rim',
maxmin: true,
shadeClose: true, //点击遮罩关闭层
area: ['100%', '100%'],
move: '.layui-layer-title',
fixed: false,
content: '/scanCodeByTaking',
end: function () {
var nowDepositoryId = $("#depositoryId").val();
var nowPlaceId = $("#placeId").val();
if (nowDepositoryId !== depositoryId || nowPlaceId !== placeId) {
// 如果重新选择盘点位置
var nowDepositoryName = $("#openSonByDepository").val();
$("#form1")[0].reset();
$("#depositoryId").val(nowDepositoryId);
$("#placeId").val(nowPlaceId);
$("#openSonByDepository").val(nowDepositoryName);
form.render();
}
depositoryId = nowDepositoryId;
placeId = nowPlaceId;
}
});
};
// 用于判断当前数量是否合适
checkNumber = function (obj) {
var id = obj.id;
var oldNumber = Number(minTransferNum[id]);
if (depositoryId !== null && depositoryId !== undefined && depositoryId !== "") {
var req = {};
req.depositoryId = depositoryId;
req.placeId = placeId;
$.ajax({
url: "/stockTaking/findInventoryByLocation",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(req),
success: function (d) {
var data = d.data;
var placeInventory = data.inventory;
id = id.split("invnetory")[1];
var number = Number(obj.value);
var inventory = Number($("#newInventory" + id).val());
if (number < oldNumber) {
layer.msg("转移数量不能小于" + oldNumber);
obj.value = oldNumber;
}
if (number > inventory) {
layer.msg("转移数量不能大于当前盘点数量:" + inventory);
obj.value = oldNumber;
}
if(number > placeInventory){
layer.msg("当前转移库位只能存放:" + placeInventory+"的物料");
obj.value = oldNumber;
}
}
})
} else {
layer.msg("请先选择盘点位置", {
icon: 0,
time: 500
}, function () {
obj.value = oldNumber;
})
}
}
});
</script>
</body>
</html>
Loading…
Cancel
Save