From bd88f87c7a26242017ec7ec1124f76a6f3dae3e0 Mon Sep 17 00:00:00 2001
From: mrzhssss <pro6@qq.com>
Date: 星期五, 17 二月 2023 09:27:31 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/entity/Pakout.java | 9 +
src/main/java/com/zy/asrs/controller/MatController.java | 11 ++
src/main/webapp/views/pakout/pakout.html | 25 +++++-
src/main/webapp/static/js/pakout/pakout.js | 161 +++++++++++++++++++++++++++++++++-------
4 files changed, 171 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MatController.java b/src/main/java/com/zy/asrs/controller/MatController.java
index 3e12304..1206105 100644
--- a/src/main/java/com/zy/asrs/controller/MatController.java
+++ b/src/main/java/com/zy/asrs/controller/MatController.java
@@ -13,8 +13,10 @@
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.MatPrint;
import com.zy.asrs.entity.OrderDetl;
+import com.zy.asrs.entity.Pakout;
import com.zy.asrs.entity.result.KeyValueVo;
import com.zy.asrs.service.MatService;
+import com.zy.asrs.service.PakoutService;
import com.zy.asrs.utils.MatExcelListener;
import com.zy.common.CodeRes;
import com.zy.common.config.AdminInterceptor;
@@ -41,6 +43,8 @@
private MatService matService;
@Autowired
private SnowflakeIdWorker snowflakeIdWorker;
+ @Autowired
+ private PakoutService pakoutService;
@RequestMapping(value = "/mat/auto/matnr/auth")
public R autoMatnr(){
@@ -208,6 +212,13 @@
return R.ok().add(orderDetl);
}
+ @RequestMapping(value = "/pakOut/show")
+ public R showQR(){
+ List<Pakout> manPakOuts = pakoutService.selectList(null);
+ return R.ok(manPakOuts);
+ }
+
+
/*************************************** 鎵撳嵃鐩稿叧 ***********************************************/
@RequestMapping(value = "/mac/code/auth")
diff --git a/src/main/java/com/zy/asrs/entity/Pakout.java b/src/main/java/com/zy/asrs/entity/Pakout.java
index 5ad3c81..9c9d3b8 100644
--- a/src/main/java/com/zy/asrs/entity/Pakout.java
+++ b/src/main/java/com/zy/asrs/entity/Pakout.java
@@ -264,14 +264,19 @@
if (null == this.status){ return null; }
switch (this.status){
case 1:
- return "姝e父";
+ return "宸插嚭搴�";
case 0:
- return "绂佺敤";
+ return "鏈嚭搴�";
+ case 8:
+ return "鏈畬鍏ㄥ嚭搴�";
+ case 9:
+ return "鍏ㄩ儴瀹屾垚鍑哄簱";
default:
return String.valueOf(this.status);
}
}
+
public String getCreateBy$(){
UserService service = SpringUtils.getBean(UserService.class);
User user = service.selectById(this.createBy);
diff --git a/src/main/webapp/static/js/pakout/pakout.js b/src/main/webapp/static/js/pakout/pakout.js
index 4f8deef..cea086e 100644
--- a/src/main/webapp/static/js/pakout/pakout.js
+++ b/src/main/webapp/static/js/pakout/pakout.js
@@ -1,13 +1,15 @@
var pageCurr;
+var printMatCodeNos = [];
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin'], function(){
+}).use(['table','laydate', 'form', 'admin' , 'layer'], function(){
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
var layDate = layui.laydate;
var form = layui.form;
var admin = layui.admin;
+
// 鏁版嵁娓叉煋
tableIns = table.render({
@@ -21,35 +23,13 @@
cellMinWidth: 50,
height: 'full-120',
cols: [[
- {type: 'checkbox'}
- ,{field: 'wrkNo', align: 'center',title: '浠诲姟鍙�'}
- ,{field: 'wrkSts$', align: 'center',title: '宸ヤ綔鐘舵��'}
- ,{field: 'zpallet', align: 'center',title: '鎵樼洏鍙�'}
- ,{field: 'anfme', align: 'center',title: '鍑哄簱鏁伴噺'}
- ,{field: 'nodeId', align: 'center',title: '鍏宠仈璐т綅'}
- ,{field: 'locNo', align: 'center',title: '璐т綅'}
- ,{field: 'matnr', align: 'center',title: '鍟嗗搧缂栫爜'}
- ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'}
- ,{field: 'name', align: 'center',title: '鍚嶇О'}
- ,{field: 'specs', align: 'center',title: '瑙勬牸'}
- ,{field: 'model', align: 'center',title: '鍨嬪彿'}
- ,{field: 'batch', align: 'center',title: '鎵瑰彿'}
- ,{field: 'unit', align: 'center',title: '鍗曚綅'}
- ,{field: 'barcode', align: 'center',title: '璐х墿鏉$爜'}
- ,{field: 'docId', align: 'center',title: '鍗曟嵁绫诲瀷'}
- ,{field: 'docNum', align: 'center',title: '鍗曟嵁缂栧彿'}
- ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О'}
- ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�'}
- ,{field: 'count', align: 'center',title: '鏁伴噺'}
- ,{field: 'weight', align: 'center',title: '閲嶉噺'}
+ // {type: 'checkbox'}
+ ,{field: 'wrkNo', align: 'center',title: 'id', hide:true}
+ ,{field: 'docNum',title: '鎷h揣鍗曞彿' , templet: '#orderNoTpl'}
+ ,{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160}
,{field: 'status$', align: 'center',title: '鐘舵��'}
- ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
- ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
- ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
- ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
- ,{field: 'memo', align: 'center',title: '澶囨敞'}
-
- ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+ // ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160}
+ ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
]],
request: {
pageName: 'curr',
@@ -89,6 +69,65 @@
});
});
+ function btnPrint(orderId, orderNo, settle) {
+ printMatCodeNos.push(orderNo)
+ var templateNo = 3;
+ $.ajax({
+ // url: baseUrl+"/pakOut/print/auth",
+ url: baseUrl+"/pakOut/show",
+ headers: {'token': localStorage.getItem('token')},
+ // data: {param: printMatCodeNos},
+ method: 'POST',
+ async: false,
+ success: function (res) {
+ if (res.code === 200){
+ layer.closeAll();
+ for (let i=0;i<res.data.length;i++){
+ var templateDom = $("#templatePreview"+templateNo);
+ var className = templateDom.attr("class");
+ if (className === 'template-barcode') {
+ res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+res.data[i].docNum;
+ } else {
+ res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].docNum;
+ }
+ }
+
+
+ // var tpl = templateDom.html();
+ // var template = Handlebars.compile(tpl);
+ // var html = template(res);
+ // var box = $("#box");
+ // box.html(html);
+ // box.show();
+ var imgUrl;
+ // console.log(res.data[0]);
+ for (let i=0;i<res.data.length;i++){
+ if (res.data[i].docNum === orderNo){
+ imgUrl = res.data[i]["barcodeUrl"];
+ }
+
+ }
+
+ var img = '<img className="template-code template-qrcode" src='+imgUrl+' height="80%">'
+ layer.open({
+ type: 1,
+ title: "鎷h揣鍗�",
+ area: '150px',
+ content: img
+ })
+
+ // box.print({mediaPrint:true});
+ // box.hide();
+
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg)
+ }
+ }
+ })
+ }
+
// 鐩戝惉澶村伐鍏锋爮浜嬩欢
table.on('toolbar(pakout)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id).data;
@@ -105,6 +144,7 @@
return d.matnr;
}));
break;
+
case 'exportData':
admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
var titles=[];
@@ -156,6 +196,68 @@
case "del":
del([data.matnr]);
break;
+ case "wrkTrace":
+ btnPrint(data.wrkNo, data.docNum, 4);
+ break
+ case "look":
+ var $a = $(obj.tr).find('a[lay-event="look"]');
+ var offset = $a.offset();
+ var top = offset.top;
+ var left = offset.left;
+ layer.open({
+ type: 1,
+ title: false,
+ area: '1200px',
+ offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
+ shade: .01,
+ shadeClose: true,
+ fixed: false,
+ content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
+ success: function (layero) {
+ table.render({
+ elem: '#lookSSXMTable',
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/pakout/list/auth',
+ where: {
+ doc_num: data.docNum
+ },
+ page: true,
+ cellMinWidth: 100,
+ cols: [[
+ {type: 'numbers'},
+ ,{field: 'id', align: 'center',title: 'id', hide:true}
+ ,{field: 'docNum', align: 'center',title: '鎷h揣鍗曞彿'}
+ ,{field: 'locNo', align: 'center',title: '搴撲綅'}
+ ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'}
+ ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'}
+ ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
+ ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
+ ,{field: 'status$', align: 'center',title: '鐘舵��'}
+ ,{field: 'memo', align: 'center',title: '澶囨敞'}
+ ,{field: 'createBy', align: 'center',title: '', hide:true}
+ ]],
+ request: {
+ pageName: 'curr',
+ pageSize: 'limit'
+ },
+ parseData: function (res) {
+ return {
+ 'code': res.code,
+ 'msg': res.msg,
+ 'count': res.data.total,
+ 'data': res.data.records
+ }
+ },
+ response: {
+ statusCode: 200
+ },
+ done: function () {
+ $(layero).find('.layui-table-view').css('margin', '0');
+ },
+ size: ''
+ });
+ }
+ });
}
});
@@ -258,6 +360,7 @@
});
+
// 鍏抽棴鍔ㄤ綔
$(document).on('click','#data-detail-close', function () {
parent.layer.closeAll();
diff --git a/src/main/webapp/views/pakout/pakout.html b/src/main/webapp/views/pakout/pakout.html
index 1814880..d648adb 100644
--- a/src/main/webapp/views/pakout/pakout.html
+++ b/src/main/webapp/views/pakout/pakout.html
@@ -18,9 +18,9 @@
<div class="layui-form toolbar" id="search-box">
<div class="layui-form-item">
<div class="layui-inline">
- <label class="layui-form-label">缂栧彿:</label>
+ <label class="layui-form-label">鎷h揣鍗曞彿:</label>
<div class="layui-input-inline">
- <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
+ <input class="layui-input" type="text" name="doc_num" placeholder="鎷h揣鍗曞彿" autocomplete="off">
</div>
</div>
<div class="layui-inline"> 
@@ -40,10 +40,25 @@
<script type="text/html" id="toolbar">
<div class="layui-btn-container">
- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
+<!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!-- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
<button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button>
</div>
+</script>
+
+<script type="text/html" id="orderNoTpl">
+ {{d.docNum}}
+ <!-- {{# if(d.settle > 1 && d.settle !== 3){ }}-->
+
+ <!-- {{# } }}-->
+ <i class="layui-icon layui-icon-about wrk-trace" lay-tips="鏌ョ湅浜岀淮鐮�" lay-direction="2" lay-offset="-10px,0px" lay-event="wrkTrace"></i>
+</script>
+<script type="text/html" id="tbLook">
+ <span class="layui-text">
+ <a href="javascript:;" lay-event="look">
+ <i class="layui-icon" style="font-size: 12px;"></i> 鏌ョ湅鍗曟嵁鏄庣粏
+ </a>
+ </span>
</script>
<script type="text/html" id="operate">
@@ -57,6 +72,8 @@
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/pakout/pakout.js" charset="utf-8"></script>
</body>
+
+
<!-- 琛ㄥ崟寮圭獥 -->
<script type="text/html" id="editDialog">
<form id="detail" lay-filter="detail" class="layui-form admin-form model-form">
--
Gitblit v1.9.1