From 09211d189468e0901180c4dde8340d5487657ccb Mon Sep 17 00:00:00 2001
From: Administrator <335182714>
Date: 星期四, 31 七月 2025 10:50:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/ghjtasrs' into ghjtasrs
---
src/main/webapp/static/js/order/order.js | 151 ++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 134 insertions(+), 17 deletions(-)
diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index f7e8888..320f168 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -4,18 +4,20 @@
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
notice: 'notice/notice',
-}).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate', 'tableMerge', 'notice'], function () {
+}).use(['layer', 'form', 'table','upload','element', 'util', 'admin', 'xmSelect', 'laydate', 'tableMerge', 'notice'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var form = layui.form;
var table = layui.table;
var util = layui.util;
+ var upload = layui.upload;
var admin = layui.admin;
var xmSelect = layui.xmSelect;
var layDate = layui.laydate;
var laytpl = layui.laytpl;
var tableMerge = layui.tableMerge;
var notice = layui.notice;
+ var element = layui.element;
// 娓叉煋鎼滅储妯℃澘
$.ajax({
@@ -53,7 +55,8 @@
{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160},
{field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 200, width: 200},
{field: 'settle$', align: 'center', title: '鐘舵��', templet: '#settleTpl', minWidth: 160, width: 160},
- {field: 'memo', align: 'center',title: '澶囨敞', hide: true},
+ {field: 'cstmrName', align: 'center',title: '瀹㈡埛鍚嶇О'},
+ {field: 'memo', align: 'center',title: '澶囨敞'},
{align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 240}
]],
request: {
@@ -85,6 +88,74 @@
insTb.reload({where: data.field, page: {curr: 1}});
});
+ //澶氭枃浠跺垪琛�
+ var uploadListIns = upload.render({
+ elem: '#data-btn-file2'
+ ,elemList: $('#data-btn-file3') //鍒楄〃鍏冪礌瀵硅薄
+ ,url: baseUrl+'/order/insert/labelUp/file/auth'
+ ,accept: 'file'
+ ,multiple: true
+ ,number: 10
+ ,auto: false
+ ,bindAction: '#testListAction'
+ ,choose: function(obj){
+ // 璧嬪��
+ this.data.orderId=$('.layui-layer-title').text()
+ var that = this;
+ var files = this.files = obj.pushFile(); //灏嗘瘡娆¢�夋嫨鐨勬枃浠惰拷鍔犲埌鏂囦欢闃熷垪
+ //璇诲彇鏈湴鏂囦欢
+ obj.preview(function(index, file, result){
+ var tr = $(['<tr id="upload-'+ index +'">'
+ ,'<td>'+ file.name +'</td>'
+ ,'<td>'+ (file.size/1014).toFixed(1) +'kb</td>'
+ ,'<td><div class="layui-progress" lay-filter="progress-demo-'+ index +'"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
+ ,'<td>'
+ ,'<button class="layui-btn layui-btn-xs demo-reload layui-hide">閲嶄紶</button>'
+ // ,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">鍒犻櫎</button>'
+ ,'</td>'
+ ,'</tr>'].join(''));
+
+ //鍗曚釜閲嶄紶
+ tr.find('.demo-reload').on('click', function(){
+ obj.upload(index, file);
+ });
+
+ //鍒犻櫎
+ tr.find('.demo-delete').on('click', function(){
+ delete files[index]; //鍒犻櫎瀵瑰簲鐨勬枃浠�
+ tr.remove();
+ uploadListIns.config.elem.next()[0].value = ''; //娓呯┖ input file 鍊硷紝浠ュ厤鍒犻櫎鍚庡嚭鐜板悓鍚嶆枃浠朵笉鍙��
+ });
+
+ that.elemList.append(tr);
+ element.render('progress'); //娓叉煋鏂板姞鐨勮繘搴︽潯缁勪欢
+ });
+ }
+ ,done: function(res, index, upload){ //鎴愬姛鐨勫洖璋�
+ var that = this;
+ //if(res.code == 0){ //涓婁紶鎴愬姛
+ var tr = that.elemList.find('tr#upload-'+ index)
+ ,tds = tr.children();
+ tds.eq(3).html(''); //娓呯┖鎿嶄綔
+ delete this.files[index]; //鍒犻櫎鏂囦欢闃熷垪宸茬粡涓婁紶鎴愬姛鐨勬枃浠�
+ return;
+ //}
+ this.error(index, upload);
+ }
+ ,allDone: function(obj){ //澶氭枃浠朵笂浼犲畬姣曞悗鐨勭姸鎬佸洖璋�
+ console.log(obj)
+ }
+ ,error: function(index, upload){ //閿欒鍥炶皟
+ var that = this;
+ var tr = that.elemList.find('tr#upload-'+ index)
+ ,tds = tr.children();
+ tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //鏄剧ず閲嶄紶
+ }
+ ,progress: function(n, elem, e, index){ //娉ㄦ剰锛歩ndex 鍙傛暟涓� layui 2.6.6 鏂板
+ element.progress('progress-demo-'+ index, n + '%'); //鎵ц杩涘害鏉°�俷 鍗充负杩斿洖鐨勮繘搴︾櫨鍒嗘瘮
+ }
+ });
+
// 娣诲姞
$("#orderAddBtn").click(function () {
showEditModel();
@@ -102,7 +173,48 @@
doDel(data.id);
} else if (layEvent === 'labelUp') {
//涓婁紶鏍囩
- layer.msg('鏈畬鎴�', {icon: 2});
+ // 鎵撳紑寮圭獥
+ // 鏋勫缓甯﹀弬鏁扮殑鍐呭
+ layer.open({
+ area: '1020px',
+ type: 1,
+ title: '涓婁紶鏂囦欢-'+data.id,
+ content: $('#myModal')
+ });
+ // 鑾峰彇璺緞涓嬬殑鏂囦欢鍒楄〃锛屼娇鐢� jQuery 鐨� ajax 鏂规硶
+ $.ajax({
+ url: baseUrl+'/order/view/labelUp/file/auth',
+ data:{
+ orderId:data.id
+ },
+ success: function(response) {
+ if (response.code==200){
+ var targetTable = document.getElementById("data-btn-file3");
+ targetTable.innerHTML = '';
+ // 灏嗚幏鍙栧埌鐨勬枃浠跺垪琛ㄦ坊鍔犲埌鏂囦欢闃熷垪涓繘琛屾樉绀�
+ response.data.forEach(function(file,index) {
+ // 鍒涘缓tr鍏冪礌
+ var tr = document.createElement("tr");
+ tr.id = "upload-"+index;
+ tr.innerHTML = '<td>' + file.name + '</td>'
+ + '<td>' + (file.size / 1024).toFixed(1) + 'kb</td>'
+ + '<td><div class="layui-progress" lay-filter="progress-demo-' + index + '"><div class="layui-progress-bar" lay-percent=""></div></div></td>'
+ + '<td>'
+ + '<button class="layui-btn layui-btn-xs demo-reload layui-hide">閲嶄紶</button>'
+ // + '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">鍒犻櫎</button>'
+ + '</td>';
+
+ // 灏唗r鍏冪礌娣诲姞鍒扮洰鏍噒able涓�
+ targetTable.appendChild(tr);
+ });
+ }else {
+ console.log('Failed to get file list error.');
+ }
+ },
+ error: function() {
+ console.log('Failed to get file list.');
+ }
+ });
} else if (layEvent === 'refundLoc') {
//閫�搴�
pakoutPreview([data.id]);
@@ -134,10 +246,10 @@
cellMinWidth: 100,
cols: [[
{type: 'numbers'},
- {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
- {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
- {field: 'batch', title: '绠卞彿'},
- {field: 'anfme', title: '鏈ㄧ涓摐绠旀暟閲�'},
+ {field: 'brand', title: '鍖呰缁勫彿', width: 160},
+ // {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
+ {field: 'supp', title: '瀹㈡埛鍚嶇О'},
+ {field: 'memo', title: '澶囨敞'},
// {field: 'workQty', title: '浣滀笟鏁伴噺'},
// {field: 'unit', title: '鍗曚綅'},
@@ -148,9 +260,13 @@
// },
// {field: 'inQty', title: '宸插叆搴撻噺'},
// {field: 'color', title: '棰滆壊'},
- {field: 'specs', title: '瑙勬牸'},
- {field: 'qty$', title: '鐘舵��', style: 'font-weight: bold'},
- {field: 'source$', title: '鏄惁纭', style: 'font-weight: bold'}
+ // {field: 'specs', title: '鎺ュご'},
+ {field: 'qty$', title: '鍑哄簱鐘舵��', style: 'font-weight: bold'},
+ {field: 'specs', title: '婧愬簱浣�', style: 'font-weight: bold'},
+ {field: 'model', title: '鐩爣搴撲綅', style: 'font-weight: bold'},
+ {field: 'beBatch', title: '璺ㄥ贩閬�', style: 'font-weight: bold'},
+ {field: 'danger$', title: '绉诲簱鐘舵��', style: 'font-weight: bold'},
+ {field: 'inspect$', title: '澶囪揣鐘舵��', style: 'font-weight: bold'}
]],
request: {
pageName: 'curr',
@@ -248,10 +364,10 @@
cellMinWidth: 100,
cols: [[
{type: 'numbers', title: '#'},
- {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
+ {field: 'matnr', title: '瑙勬牸', width: 160},
{field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 200},
{field: 'batch', title: '绠卞彿', edit: true},
- {field: 'specs', title: '瑙勬牸'},
+ {field: 'specs', title: '鎺ュご'},
{field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
{field: 'workQty', title: '浣滀笟鏁伴噺', minWidth: 100, width: 100},
// {field: 'unit', title: '鍗曚綅', width: 80},
@@ -598,12 +714,13 @@
{field: 'title', title: '鍟嗗搧', align: 'center', width: 350},
// {field: 'title', title: '鍟嗗搧', merge: true, align: 'center', width: 350},
{field: 'batch', title: '绠卞彿', align: 'center'},
- {field: 'model', title: '鎵规', align: 'center'},
- {field: 'specs', title: '瑙勬牸', align: 'center'},
- {field: 'brand', title: '鏈ㄧ绫诲瀷', align: 'center'},
+ {field: 'model', title: '鍗峰彿', align: 'center', hide: false},
+ {field: 'specs', title: '鎺ュご', align: 'center'},
+ // {field: 'brand', title: '鏈ㄧ绫诲瀷', align: 'center'},
+ {field: 'brand$', title: '鏈ㄧ绫诲瀷', align: 'center'},
{field: 'zpallet', title: '鎵樼洏鐮�', align: 'center'},
- {field: 'anfme', title: '鏈ㄧ涓摐绠旀暟閲�', align: 'center', width: 90, style: 'font-weight: bold'},
- {field: 'count', title: '鏈ㄧ涓摐绠旀暟閲�', align: 'center', width: 90, style: 'font-weight: bold'},
+ {field: 'anfme', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'},
+ {field: 'count', title: '鏁伴噺', align: 'center', width: 90, style: 'font-weight: bold'},
{field: 'locNo', title: '璐т綅', align: 'center', width: 100, templet: '#locNoTpl'},
{field: 'tkType$', title: 'TK鏍囪', align: 'center', width: 100},
// {field: 'staNos', align: 'center', title: '鍑哄簱绔�', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
--
Gitblit v1.9.1