From fe1e71d624f43a4b79e6712b7d3c242fcd0b19a1 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 23 六月 2025 09:38:19 +0800
Subject: [PATCH] 1

---
 WebTM/views/设备管理/Sb_EquipDotCheckBill_PDA.html |  195 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 190 insertions(+), 5 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBill_PDA.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBill_PDA.html"
index d2c2488..38dd26b 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBill_PDA.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBill_PDA.html"
@@ -287,11 +287,36 @@
                                     </tbody>
                                 </table>
                             </div>
+                            <!--闄勪欢淇℃伅-->
+                            <div class="layui-tab-item">
+                                <div class="layui-form-item" style="padding-top: 10px;min-height:calc(50vh);">
+                                    <div class="layui-upload">
+                                        <button type="button" class="layui-btn" id="testList"><i class="layui-icon">顧�</i>閫夋嫨鏂囦欢</button>
+                                        <!--<input class="layui-upload-file" type="file" accept="" name="file" multiple="">-->
+                                        <!--<button type="button" class="layui-btn" id="camera" capture="user"><i class="layui-icon">顧�</i>鎷嶇収涓婁紶</button>-->
+                                        <div class="layui-upload-list">
+                                            <table class="layui-table">
+                                                <thead>
+                                                    <tr>
+                                                        <th>鏂囦欢鍚�</th>
+                                                        <th>澶у皬</th>
+                                                        <th>鐘舵��</th>
+                                                        <th>鎿嶄綔</th>
+                                                    </tr>
+                                                </thead>
+                                                <tbody id="ProImgByList">
+                                                </tbody>
+                                            </table>
+                                        </div>                                       
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                         <ul class="layui-tab-title">
                             <li class="layui-this">鍩烘湰淇℃伅</li>
                             <li>鏄庣粏淇℃伅</li>
                             <li>鍏朵粬淇℃伅</li>
+                            <li>闄勪欢淇℃伅</li>
                         </ul>
                     </div>
                     <!--闅愯棌瀛楁-->
@@ -321,17 +346,25 @@
         </select>
     </script>-->
     <script>
+        var u = navigator.userAgent, app = navigator.appVersion;
+        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android缁堢鎴栬�卽c娴忚鍣�
+        if (isAndroid) {
+            $(":file").attr('capture', 'camera');
+        }
+    </script>
+    <script>
         layui.config({
             base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+        }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () {
             var $ = layui.$
                 , admin = layui.admin
                 , layer = layui.layer
                 , table = layui.table
                 , form = layui.form
                 , laydate = layui.laydate
+                , upload = layui.upload
                 , element = layui.element;
             var option = [];
 
@@ -375,6 +408,8 @@
                     //console.log(d.data);
                     $("#HInterID").val("0");
                     $("#HBillNo").val(d.data[0].HBillNo);
+                    PicUpload(); //鏂囦欢涓婁紶
+                    PicUploads(); //鎷嶇収涓婁紶
                 }
             });
 
@@ -598,7 +633,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true
-                    , content: ['../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_ShiftsList.html', 'yes']
+                    , content: ['../Baseset/鍩虹璧勬枡/Gy_Shifts.html', 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
                         //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
@@ -821,10 +856,12 @@
                             layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,璐熻矗浜轰唬鐮佷俊鎭负绌�!", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                             return false;
                         }
-                        else {
-                            return true;
-                        }
+                        if (sSubStr[i].HDotCheckResult != true) {
+                            layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,缁撴灉淇℃伅涓哄嬀閫�!", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            return false;
+                        }                       
                     }
+                    return true;
                 }
                 else {
                     return true;
@@ -894,6 +931,9 @@
                             }
                             option.data = rowdata;
                             table.render(option);
+                        }
+                        else {
+                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         }
                     }
                 })
@@ -977,6 +1017,151 @@
 
                 })
             }
+
+            upload.render({
+                elem: '#cameraBtn', // 缁戝畾鍏冪礌
+                url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile",
+                accept: 'images', // 鎸囧畾鍏佽涓婁紶鐨勬枃浠剁被鍨�
+                type: 'camera', // 璁剧疆绫诲瀷涓篶amera锛岃皟鐢ㄧ浉鏈�
+                done: function (res) {
+                    // 涓婁紶瀹屾瘯鍥炶皟
+                    if (res.status === 200) {
+                        // 鍋囪鍚庣杩斿洖鐨勬槸鍥剧墖鍦板潃
+                        $('#cameraImg').append('<img src="' + res.data.src + '" alt=""/>');
+                    }
+                },
+                error: function () {
+                    // 涓婁紶鍑洪敊鐨勫洖璋�
+                    console.log('涓婁紶鍑洪敊');
+                }
+            });
+
+            //鏂囦欢涓婁紶
+            function PicUpload() {
+                //澶氬浘鐗囦笂浼�
+                //澶氭枃浠跺垪琛ㄧず渚�
+                var ProImgByList = $('#ProImgByList')
+                    , uploadListIns = upload.render({
+                        elem: '#testList'
+                        , url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile"
+                        , accept: 'file'
+                        , multiple: true
+                        , auto: false
+                        , acceptMime: 'image/*'
+                        //, bindAction: '#testListAction' //鎸夋壄缁戝畾
+                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
+                        , choose: function (obj) {
+                            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>绛夊緟涓婁紶</td>'
+                                    , '<td>'
+                                    , '<button class="layui-btn layui-btn-xs demo-reload ">涓婁紶</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);
+                                    return false;
+                                });
+
+                                //鍒犻櫎
+                                tr.find('.demo-delete').on('click', function () {
+                                    delete files[index]; //鍒犻櫎瀵瑰簲鐨勬枃浠�
+                                    tr.remove();
+                                    uploadListIns.config.elem.next()[0].value = ''; //娓呯┖ input file 鍊硷紝浠ュ厤鍒犻櫎鍚庡嚭鐜板悓鍚嶆枃浠朵笉鍙��
+                                });
+
+                                ProImgByList.append(tr);
+                            });
+                        }
+                        , done: function (res, index, upload) {
+                            if (res.code == 1) { //涓婁紶鎴愬姛
+                                var tr = ProImgByList.find('tr#upload-' + index)
+                                    , tds = tr.children();
+                                tds.eq(2).html('<span style="color: #5FB878;">涓婁紶鎴愬姛</span>');
+                                tds.eq(3).html(''); //娓呯┖鎿嶄綔
+                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //闅愯棌涓婁紶
+                                return delete this.files[index]; //鍒犻櫎鏂囦欢闃熷垪宸茬粡涓婁紶鎴愬姛鐨勬枃浠�
+                            }
+                            this.error(index, upload);
+                        }
+                        , error: function (index, upload) {
+                            var tr = ProImgByList.find('tr#upload-' + index)
+                                , tds = tr.children();
+                            tds.eq(2).html('<span style="color: #FF5722;">涓婁紶澶辫触[妫�鏌ユ枃浠跺悕鍙婃枃浠舵牸寮廬</span>');
+                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //鏄剧ず涓婁紶
+                        }
+                    });
+            }
+
+            //鎷嶇収涓婁紶
+            function PicUploads() {
+                var ProImgByList = $('#ProImgByList')
+                    , uploadListIns = upload.render({
+                        elem: '#camera'
+                        , url: GetWEBURL() + "/Sb_EquipDotCheckBill/UploadFile"
+                        , accept: 'file'
+                        , multiple: true
+                        , acceptMime: 'image/*'
+                        , auto: false
+                        , data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
+                        , choose: function (obj) {
+                            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>绛夊緟涓婁紶</td>'
+                                    , '<td>'
+                                    , '<button class="layui-btn layui-btn-xs demo-reload ">涓婁紶</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);
+                                    return false;
+                                });
+
+                                //鍒犻櫎
+                                tr.find('.demo-delete').on('click', function () {
+                                    delete files[index]; //鍒犻櫎瀵瑰簲鐨勬枃浠�
+                                    tr.remove();
+                                    uploadListIns.config.elem.next()[0].value = ''; //娓呯┖ input file 鍊硷紝浠ュ厤鍒犻櫎鍚庡嚭鐜板悓鍚嶆枃浠朵笉鍙��
+                                });
+
+                                ProImgByList.append(tr);
+                            });
+                        }
+                        , done: function (res, index, upload) {
+                            if (res.code == 1) { //涓婁紶鎴愬姛
+                                var tr = ProImgByList.find('tr#upload-' + index)
+                                    , tds = tr.children();
+                                tds.eq(2).html('<span style="color: #5FB878;">涓婁紶鎴愬姛</span>');
+                                tds.eq(3).html(''); //娓呯┖鎿嶄綔
+                                //tds.eq(3).find('.demo-reload').addClass('layui-hide'); //闅愯棌涓婁紶
+                                return delete this.files[index]; //鍒犻櫎鏂囦欢闃熷垪宸茬粡涓婁紶鎴愬姛鐨勬枃浠�
+                            }
+                            this.error(index, upload);
+                        }
+                        , error: function (index, upload) {
+                            var tr = ProImgByList.find('tr#upload-' + index)
+                                , tds = tr.children();
+                            tds.eq(2).html('<span style="color: #FF5722;">涓婁紶澶辫触[妫�鏌ユ枃浠跺悕鍙婃枃浠舵牸寮廬</span>');
+                            tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //鏄剧ず涓婁紶
+                        }
+
+                    });
+            }
+
             //浠ヤ笂涓簂ayui妯″潡
         });
     </script>

--
Gitblit v1.9.1