Browse Source

打印文字时居中居右相反

lwx_dev
erdanergou 3 years ago
parent
commit
70f5121297
  1. 42
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  2. 6
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  3. 177
      src/main/resources/templates/pages/depository/Inventory-view.html
  4. 39
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  5. 39
      target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

42
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -526,7 +526,7 @@ public class PageController {
} else {
mv.addObject("display", "none");
}
mv.addObject("number",userToken.getNumber());
mv.addObject("number", userToken.getNumber());
return mv;
}
@ -764,7 +764,7 @@ public class PageController {
} else {
mv.addObject("display", "none");
}
mv.addObject("number",userToken.getNumber());
mv.addObject("number", userToken.getNumber());
return mv;
}
@ -962,7 +962,7 @@ public class PageController {
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/depository/table-stock");
mv.addObject("number",userToken.getNumber());
mv.addObject("number", userToken.getNumber());
return mv;
}
@ -1005,6 +1005,24 @@ public class PageController {
return mv;
}
@GetMapping("/InventoryView")
public ModelAndView InventoryView(Integer id, HttpServletRequest request) {
if (id != null) {
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/depository/Inventory-view");
Inventory inventoryById = materialService.findInventoryById(id);
if (inventoryById != null) {
mv.addObject("record",inventoryById);
return mv;
} else {
throw new MyException("缺少必要参数");
}
} else {
throw new MyException("缺少必要参数");
}
}
/**
* 跳转到组合添加页面
*
@ -1915,18 +1933,17 @@ public class PageController {
ApplicationOutRecordP recordP = depositoryRecordService.findApplicationOutRecordPById(recordMinP.getParentId());
boolean b = DateUtil.IsMonthStartAndEnd(recordP.getApplicantTime());
Integer role = userToken.getIsadmin();
if(role == null){
if (role == null) {
role = 1;
}
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0 && b) {
mv.addObject("edisplay", "inline-block");
}else{
} else {
mv.addObject("edisplay", "none");
}
mv.addObject("recordMinP", recordMinP);
} else {
throw new MyException("缺少必要参数!");
@ -2071,17 +2088,18 @@ public class PageController {
Integer adminorgId = applicationOutRecordPById.getAdminorgId();
Integer constructionUnitId = applicationOutRecordPById.getConstructionUnitId();
if(adminorgId != null){
if (adminorgId != null) {
Administration company = LinkInterfaceUtil.getCompany(adminorgId, userToken);
applicationOutRecordPById.setAdminorgName(company.getName()); mv.addObject("adisplay", "table-row");
}else {
applicationOutRecordPById.setAdminorgName(company.getName());
mv.addObject("adisplay", "table-row");
} else {
mv.addObject("adisplay", "none");
}
if(constructionUnitId != null){
if (constructionUnitId != null) {
ConstructionUnit constructionUnitById = constructionUnitService.findConstructionUnitById(constructionUnitId);
applicationOutRecordPById.setConstructionUnitName(constructionUnitById.getName());
mv.addObject("cdisplay", "table-row");
}else {
} else {
mv.addObject("cdisplay", "none");
}
@ -2092,7 +2110,7 @@ public class PageController {
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0) {
mv.addObject("display", "inline-block");
}else{
} else {
mv.addObject("display", "none");
}

6
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -616,7 +616,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid());
double quantity = (double) recordMin.getQuantity() / 100.0;
double price_out = 0.0;
if (recordMin.getUnit().equals(materialById.getUnit())) {
if (recordMin.getUnit().equals(materialById.getUnit()) || "-1".equals(recordMin.getUnit())) {
if (materialById.getPrice() != null) {
price_out = materialById.getPrice() * quantity;
}
@ -643,7 +643,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid());
double quantity = (double) recordMin.getQuantity() / 100.0;
double price_out = 0.0;
if (recordMin.getUnit().equals(materialById.getUnit())) {
if (recordMin.getUnit().equals(materialById.getUnit()) || "-1".equals(recordMin.getUnit())) {
if (materialById.getPrice() != null) {
price_out = materialById.getPrice() * quantity;
}
@ -5188,7 +5188,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid());
// 计算当前出库金额
double price_out = 0.0;
if (recordMin.getUnit().equals(materialById.getUnit())) {
if (recordMin.getUnit().equals(materialById.getUnit()) || "-1".equals(recordMin.getUnit())) {
if (materialById.getPrice() != null) {
price_out = materialById.getPrice() * quantity;
}

177
src/main/resources/templates/pages/depository/Inventory-view.html

@ -0,0 +1,177 @@
<!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;
}
.inputdiv .layui-unselect {
border-style: none;
}
</style>
</head>
<body>
<form class="layui-form layui-form-pane" action="">
<input type="text" id="id" th:value="${record.getId()}" name="id">
<div class="layui-form-item">
<label class="layui-form-label">物料名称</label>
<div class="layui-input-inline">
<input type="text" th:value="${record.getMname()}" name="mname"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">存货编码</label>
<div class="layui-input-inline">
<input type="text" th:value="${record.getCode()}" name="code"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">规格型号</label>
<div class="layui-input-inline">
<input type="text" th:value="${record.getVersion()}" name="version" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">品牌:</label>
<div class="layui-input-inline">
<input type="text" placeholder="请填写物料品牌" class="layui-input" th:value="${record.getBrand()}"
name="brand"/>
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">物料类型</label>
<div class="layui-input-inline">
<input type="text" placeholder="请选择物料类型" class="layui-input" id="openSonByMateralType" readonly
th:value="${record.getMaterialType().getTname()}"
lay-verify="required"/>
<input type="text" id="materialTypeId" th:value="${record.getMaterialTypeId()}" placeholder="请选择物料类型"
name="materialTypeId" 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-inline">
<input type="text" th:value="${record.getTexture()}" name="texture" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计量单位</label>
<div class="layui-input-inline">
<input type="text" th:value="${record.getUnit()}" name="unit" required autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">单价</label>
<div class="layui-input-inline">
<input type="text" th:value="${record.getPrice()}" name="price" required autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
function changeQrCodeState() {
}
function createQrCode() {
}
function checkBarCode() {
}
function print_code() {
}
// 用于标志是否为第一次提交
let flagForForm = false;
var barCode = [];
var flag = false;
layui.use(['form', 'laydate'], function () {
var form = layui.form, laydate = layui.laydate, $ = layui.$;
//提交
form.on('submit(formDemo)', function (data) {
if (!flagForForm) {
flagForForm = true;
data = data.field;
if (flag) {
data.barCodeList = barCode;
}
$.ajax({
url: "/material/material_edit",
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.close(this.layerIndex);
if (data.status >= 300) {
layer.msg(data.statusInfo.message);//失败的表情
return;
} else {
layer.msg("修改成功", {
icon: 6,//成功的表情
time: 500 //1秒关闭(如果不配置,默认是3秒)
}, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);//关闭当前页
window.location = '/material_out'
})
}
}
});
}
return false;
});
});
</script>
</body>
</html>

39
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -63,32 +63,27 @@
} else {
wxScan = wxScan.parent.wx;
}
// wxScan.scanQRCode({
// desc: 'scanQRCode desc',
// needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
// scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
// success: function (res) {
// // 回调
// var result = res.resultStr;//当needResult为1时返回处理结果
// var req = {};
// req.qrCode = result;
// outboundLogic(req);
//
// },
// error: function (res) {
// if (res.errMsg.indexOf('function_not_exist') > 0) {
// alert('版本过低请升级')
// }
//
// }
//
// });
var result = "1638361349087338496";//当needResult为1时返回处理结果
wxScan.scanQRCode({
desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
success: function (res) {
// 回调
var result = res.resultStr;//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);
},
error: function (res) {
if (res.errMsg.indexOf('function_not_exist') > 0) {
alert('版本过低请升级')
}
}
});
});

39
target/classes/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -63,32 +63,27 @@
} else {
wxScan = wxScan.parent.wx;
}
// wxScan.scanQRCode({
// desc: 'scanQRCode desc',
// needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
// scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
// success: function (res) {
// // 回调
// var result = res.resultStr;//当needResult为1时返回处理结果
// var req = {};
// req.qrCode = result;
// outboundLogic(req);
//
// },
// error: function (res) {
// if (res.errMsg.indexOf('function_not_exist') > 0) {
// alert('版本过低请升级')
// }
//
// }
//
// });
var result = "1638361349087338496";//当needResult为1时返回处理结果
wxScan.scanQRCode({
desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
scanType: ["barCode", "qrCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
success: function (res) {
// 回调
var result = res.resultStr;//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
outboundLogic(req);
},
error: function (res) {
if (res.errMsg.indexOf('function_not_exist') > 0) {
alert('版本过低请升级')
}
}
});
});

Loading…
Cancel
Save