From 7ea2a2cfe922c9b2d5c09c737d10a7f1ab5b50d1 Mon Sep 17 00:00:00 2001
From: zhaoxiaohao <279049017@qq.com>
Date: Mon, 01 Mar 2021 14:14:35 +0800
Subject: [PATCH] Merge branch 'dev1.1' into dev

---
 kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/productdetail.html |   51 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/productdetail.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/productdetail.html
index 0c99e3b..98ac489 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/productdetail.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/productdetail.html
@@ -1,23 +1,24 @@
 <div class="layui-card">
     <div class="layui-card-header">
-        <h2 class="header-title">产品消费记录</h2>
+        <h2 class="header-title">产品充值记录</h2>
         <span class="layui-breadcrumb pull-right">
             <a href="#!console">首页</a>
-            <a><cite>产品消费记录</cite></a>
+            <a><cite>产品充值记录</cite></a>
         </span>
     </div>
     <div class="layui-card-body">
         <div class="layui-form toolbar">&emsp;
             <div  class="layui-col-sm10">
                 <div class="layui-col-sm4">
-                    <input type="text" class="layui-input search-input" id="startTime" placeholder="yyyy-MM-dd"> 至 <input type="text"
-                    class="layui-input search-input" id="endTime" placeholder="yyyy-MM-dd"> &emsp;
+                    <input type="text" class="layui-input search-input" id="startTime" placeholder="开始时间"> 至 <input type="text"
+                    class="layui-input search-input" id="endTime" placeholder="结束时间"> &emsp;
                 </div>
                 <div class="layui-col-sm2">
                     <input id="product-search-value" class="layui-input search-input" type="text" placeholder="按产品名" />&emsp;
                 </div>
                 <div class="layui-col-sm2">
                     <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名" style="width: 100%;" />
+                    <input type="hidden" id="hospitalId" value="">
                 </div>
                 <div class="layui-col-sm2">
                     &emsp;<button id="product-btn-search" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
@@ -59,14 +60,15 @@
         var renderTable = function () {
             table.render({
                 elem: '#product-table',
-                url: config.base_server + 'api-opration/productorderdetail/all',
+                url: config.base_server + 'api-opration/productorderrecord/all',
                 method: 'GET',
                 headers: { 'Authorization': 'Bearer ' + config.getToken().access_token },
                 page: true,
                 cols: [[
-                    { field: 'hospitalName', width: 300, title: '医院名称' },
+                    { field: 'hospitalId', width: 180, title: '医院编号' },
+                    { field: 'hospitalName', width: 200, title: '医院名称' },
                     { field: 'departmentName', width: 100, title: '科室名称' },
-                    { field: 'proName', width: 250, title: '产品名称' },
+                    { field: 'proName', width: 200, title: '产品名称' },
                     {
                     field: 'proType', sort: true, align: 'center', width: 80, templet: function (d) {
                         if (d.proType === 0)
@@ -91,11 +93,9 @@
                     { field: 'proEndtime', width: 120, title: '结束时间',templet:function(d){
                         return new Date(d.proEndtime).dateFormat("yyyy/MM/dd");
                     } },
-                    // { field: 'createTime', width: 160, sort: true, title: '创建时间',templet:function(d){
-                    //     return new Date(d.createTime).dateFormat("yyyy/MM/dd hh:mm:ss");
-                    // } },
-                    { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" },
-                    { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作' }
+                    { field: 'createTime', width: 200, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" },
+                    { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作',
+                        fixed: 'right' }
                 ]]
             });
         }
@@ -103,15 +103,19 @@
         // 工具条点击事件
         table.on('tool(product-table)', function (obj) {
             if (obj.event === 'del') { // 删除
-                layer.confirm('确定要删除吗?', function (i) {
+                layer.confirm('您确定要删除这次充值吗?删除后不可恢复!', function (i) {
                     layer.close(i);
                     layer.load(2);
-                    admin.req('api-opration/productorderdetail/' + obj.data.id, {}, function (data) {
+                    admin.req('api-opration/productorderrecord/' + obj.data.id, {}, function (data) {
                         layer.closeAll('loading');
-                        layer.msg(data.msg, { icon: 1, time: 500 }, function () {
-                            renderTable();
-                        });
-                        obj.del();
+                        if(data.code==200)
+                        {
+                            layer.msg("指定充值记录删除成功!", { icon: 1, time: 2000 });
+                            obj.del();
+                        }
+                        else{
+                        layer.msg(data.msg, { icon: 3, time: 2000 });
+                    }
                     }, 'DELETE');
                 });
             }
@@ -129,8 +133,12 @@
                 }
             }
             var proName = $('#product-search-value').val();
-            var hospitalName = $('#hospital-search-value').val();
-            table.reload('product-table', { where: { proName: proName,hospitalName: hospitalName,startTime: startTime, endTime: endTime } });
+                var hospitalId = $('#hospitalId').val();
+            table.reload('product-table', { 
+                where: { proName: proName,hospitalId: hospitalId,startTime: startTime, endTime: endTime },
+                page: {
+                        curr: 1 
+                    }  });
         });
        
         //比较日期大小
@@ -157,6 +165,9 @@
             url: config.base_server + 'api-user/syshospital/findByName',
             template_val: '{{d.hospitalName}}',//选择后文本框显示的数据字段
             template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>",//下拉列表模板
+            onselect: function (resp) {
+                $("#hospitalId").val(resp.id);
+            }
         });
     });
 </script>
\ No newline at end of file

--
Gitblit v1.8.0