From 0b88bff9c283553707d493360b68c7752509602e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 12 四月 2021 17:06:34 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/ioWorks/matQuery.js |   92 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/src/main/webapp/static/js/ioWorks/matQuery.js b/src/main/webapp/static/js/ioWorks/matQuery.js
index 9644c00..c5b84d4 100644
--- a/src/main/webapp/static/js/ioWorks/matQuery.js
+++ b/src/main/webapp/static/js/ioWorks/matQuery.js
@@ -13,12 +13,14 @@
     base: baseUrl + "/static/layui/lay/modules/"
 }).extend({
     notice: 'notice/notice',
-}).use(['table','laydate', 'form',  'notice'], function() {
+}).use(['table','laydate', 'form', 'admin', 'notice'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var form = layui.form;
     var notice = layui.notice;
+    var layDate = layui.laydate;
+    var admin = layui.admin;
 
     tableIns = table.render({
         elem: '#chooseData',
@@ -61,16 +63,80 @@
                             return false;
                         }
                     }
+                    var index = layer.load(1, {shade: [0.1,'#000']});
+                    // 鍗曟嵁绫诲瀷
+                    var docTypeData;
+                    $.ajax({
+                        url: baseUrl+"/work/docType/all/get",
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'POST',
+                        async: false,
+                        success: function (res) {
+                            if (res.code === 200){
+                                docTypeData = res;
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                    var tpl1 = $('#docTypeSelectTpl').html();
+                    var template1 = Handlebars.compile(tpl1);
+                    var html1 = template1(docTypeData);
+                    $("#docType").html(html1);
+
+                    // 瀹㈡埛
+                    var cstmrData;
+                    $.ajax({
+                        url: baseUrl+"/work/cstmr/all/get",
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'POST',
+                        async: false,
+                        success: function (res) {
+                            if (res.code === 200){
+                                cstmrData = res;
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                    var tpl2 = $('#cstmrSelectTpl').html();
+                    var template2 = Handlebars.compile(tpl2);
+                    var html2 = template2(cstmrData);
+                    $("#cstmr").html(html2);
+
+                    // 椤圭洰
+                    var itemData;
+                    $.ajax({
+                        url: baseUrl+"/work/item/all/get",
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'POST',
+                        async: false,
+                        success: function (res) {
+                            if (res.code === 200){
+                                itemData = res;
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                    var tpl3 = $('#itemSelectTpl').html();
+                    var template3 = Handlebars.compile(tpl3);
+                    var html3 = template3(itemData);
+                    $("#item").html(html3);
+
+                    layer.close(index);
                     if (success) {
-                        layer.open({
+                        admin.open({
                             type: 1,
-                            title: '瀹氫箟閿�鍞崟缂栧彿',
+                            title: '鍗曟嵁濉厖',
                             offset: '100px',
                             area: ['360px'],
-                            shade: 0.1,
+                            shade: 0.3,
                             content: $('#getOrderNo'),
                             success: function(layero, index){
-                                layer.iframeAuto(index)
+                                layer.iframeAuto(index);
+                                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                                layui.form.render('select');
                             },
                             cancel: function () {
                                 $('#orderNo').val('');
@@ -108,8 +174,16 @@
 
             });
         });
+        var number = data.field.orderNo; // 鍗曞彿
+        if (number.substring(0, 3) !== 'PR-') {
+            notice.error({
+                title: '娑堟伅閫氱煡',
+                message: '鍗曞彿涓嶇鍚堣鍒欙紝璇蜂互 PR- 寮�澶�'
+            });
+            return false;
+        }
         var req = JSON.stringify({
-            number: data.field.orderNo
+            number: number
             , customerTypeId: data.field.customerTypeId
             , list: matDetls
         })
@@ -164,6 +238,12 @@
         }});
     }
 
+    layDate.render({
+        elem: '#orderTime',
+        trigger: 'click',
+        type: 'date'
+    });
+
 })
 
 // 鎻愬彇鐗╂枡

--
Gitblit v1.9.1