xiaoyu преди 3 години
родител
ревизия
91935fdcc1

+ 8 - 2
data/model/fetch_order.model.php

@@ -64,10 +64,16 @@ class fetch_orderModel extends Model
     }
 
     //处理完成的单子
-    public function processed($fetch_id,$fetch_result,$official_sn = '')
+    public function processed($fetch_id,$fetch_result,$official_sn = '',$voucher = '')
     {
         return $this->where(['fetch_id' => $fetch_id,'fetch_status' => self::FETCH_ORDER_PROCESSING])
-                    ->update(['fetch_status' => self::FETCH_ORDER_PROCESSED,'finsh_time' => time(),'fetch_result' => $fetch_result,'official_sn' => $official_sn]);
+                    ->update([
+                        'fetch_status' => self::FETCH_ORDER_PROCESSED,
+                        'finsh_time' => time(),
+                        'fetch_result' => $fetch_result,
+                        'official_sn' => $official_sn,
+                        'voucher' => $voucher
+                    ]);
     }
 
     //超时未处理订单,不可以再接单.

+ 14 - 1
shop/control/store_refill_order.php

@@ -104,11 +104,24 @@ class store_refill_ordercontrol extends BaseSellerControl
         $fetch_order = $mod->order_info(['fetch_id' => $fetch_id],'*',true);
 
         if (!empty($fetch_order)) {
+            $voucher = '';
+            if(!empty($_FILES['voucher']['name'])) {
+                $upload = new UploadFile();
+                $upload->set('default_dir',ATTACH_UPFILE.'/shop');
+
+                $result = $upload->upfile('voucher');
+                if ($result){
+                    $voucher = $upload->file_name;
+                }else {
+                    showDialog($upload->error);
+                }
+            }
+
             $params = ['state' => $state_type,
                 'order_sn' => $fetch_order['order_sn'],
                 'official_sn' => $official_sn];
             Log::record("state: {$state_type}, order_sn: {$fetch_order['order_sn']}, official_sn: {$official_sn}", Log::DEBUG);
-            $mod->processed($fetch_id,$state_type,$official_sn);
+            $mod->processed($fetch_id,$state_type,$official_sn,$voucher);
             refill\util::push_notify($fetch_order['channel_name'],$params);
             showDialog("成功", 'reload', 'js');
             exit();

+ 2 - 2
shop/templates/default/layout/seller_layout.php

@@ -149,8 +149,8 @@ catch(e){}
       </div>
     </div>
   </div>
-  <div id="layoutRight" class="ncsc-layout-right">
-    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i><?php echo $output['current_menu']['model_name'];?><i class="icon-angle-right"></i><?php echo $output['current_menu']['name'];?></div>
+  <div id="layoutRight" class="ncsc-layout-right div-right">
+    <div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right "></i><?php echo $output['current_menu']['model_name'];?><i class="icon-angle-right"></i><?php echo $output['current_menu']['name'];?></div>
     <div class="main-content" id="mainContent">
       <?php require_once($tpl_file); ?>
     </div>

+ 49 - 9
shop/templates/default/seller/store_refill_order.index.php

@@ -42,7 +42,18 @@ a:nth-child(3) {
     margin-right: 0px;
 
 }
-
+.wrapper {
+    width: 1855px;
+    margin: auto;
+}
+.ncsc-layout-right {
+    background-color: #FFF;
+    width: 89%;
+    min-height: 640px;
+    float: right;
+    position: relative;
+    z-index: 1;
+}
 </style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
@@ -60,7 +71,7 @@ a:nth-child(3) {
 <div class="tabmenu">
     <div>
     <select name="" id="tabmenuright" class="tabmenuright">
-        <option value="1">卡类型</option>
+        <option value="0">卡类型</option>
         <option value="<?php echo mtopcard\PetroChinaCard;?>" <?php if($_GET['card_type'] == mtopcard\PetroChinaCard){ echo 'selected';}?>>中石油</option>
         <option value="<?php echo mtopcard\SinopecCard;?>" <?php if($_GET['card_type'] == mtopcard\SinopecCard){ echo 'selected';}?>>中石化</option>
         <option value="<?php echo mtopcard\ChinaMobileCard;?>" <?php if($_GET['card_type'] == mtopcard\ChinaMobileCard){ echo 'selected';}?>>中国移动</option>
@@ -93,6 +104,7 @@ a:nth-child(3) {
         <th class="w150">下单时间</th>
         <th class="w150">接单时间</th>
         <th class="w150">第三方单号填写</th>
+<!--        <th class="w150">凭证上传</th>-->
         <th class="w180">交易操作</th>
     </tr>
     </thead>
@@ -107,6 +119,14 @@ a:nth-child(3) {
                 <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['add_time']);?></td>
                 <td class="bdl"><?php echo date('Y-m-d H:i:s', $order['fetch_time']);?></td>
                 <td class="bdl"><input type="text" name="ch_trade_no" style="width: 180px" id="ch_trade_no" /></td>
+<!--                <td class="bdl">-->
+<!--                <form action="" id="imageForm" method="post">-->
+<!---->
+<!--                <input type="hidden" name="voucher" value="提交">               -->
+<!--                </form>-->
+<!---->
+<!---->
+<!--                </td>-->
                 <td class="bdl bdr">
                     <a href="#" class="ncsc-btn-mini" id="order_action_success" data-order="SUCCESS" onclick="change_state(event,<?php echo $order['fetch_id']; ?>)">处理成功</a>
                     <a href="#" class="ncsc-btn-mini" id="order_action_cancel"  data-order="CANCEL" onclick="change_state(event,<?php echo $order['fetch_id']; ?>)">处理失败</a>
@@ -133,10 +153,12 @@ a:nth-child(3) {
  <!-- <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/> -->
 <script>
     $(function () {
-        // let value_rob = $('#tabmenuright').val()
-        // console.log(1111, value_rob);
- $('#tabmenuright').blur(function() {
-    $.get('index.php?act=store_refill_order&op=fetch_count',function(data) {
+        let value_robb = $('.tabmenuright').val()
+        
+
+    $.get('index.php?act=store_refill_order&op=fetch_count',{
+        card_type:value_robb
+    },function(data) {
                data = JSON.parse(data)
                 console.log("默认",data);
                 if (data.code == 200) {
@@ -144,7 +166,7 @@ a:nth-child(3) {
                     $('.rob').text(value_1)
                 } 
                 })
- })
+
                 
             $('#tabmenuright').click(function() {
                     let value_rob = $(this).val()
@@ -160,6 +182,8 @@ a:nth-child(3) {
                 } 
                 })
         })
+
+
         //抢单
         $('#queryrob').click(() => {
             let value_rob = $("#tabmenuright").val()
@@ -218,6 +242,7 @@ a:nth-child(3) {
             let url = "index.php?act=store_refill_order&op=batch_dispose&form_submit=ok&fetch_id="+fetch_id;
             console.log(11111, url);
             let official_sn = e.currentTarget.parentElement.previousElementSibling.firstElementChild.value
+            console.log(official_sn);
             if (state_type == 'SUCCESS') {
                 official_sn = official_sn ? official_sn : ''
             } else {
@@ -230,8 +255,23 @@ a:nth-child(3) {
             }, function () {
 
             });
-
         }
     }
-    
+    // function imgChange(){
+    //         var  file=document.getElementById('files1')
+            
+    //         var imgsurl=URL.createObjectURL(file.files[0]);
+    //         // 开始上传
+    //         var formData = new FormData();
+
+    //         formData.append('file', file.files[0]);
+    //          $.ajax({
+    //         url: "index.php?act=store_refill_order&op=batch_dispose",
+    //         type: "POST",
+    //         voucher: formData,
+      
+    //     })
+
+    //     }
+ 
 </script>