wupengfei 2 年之前
父节点
当前提交
dd3d1eae7c

+ 7 - 3
application/admin/controller/shopro/order/OrderShift.php

@@ -45,7 +45,10 @@ class OrderShift extends Base
             }
             $limit = $this->request->param('limit',10);
             $off_set = $this->request->param('offset',0);
-            $search_time = $this->request->param('search_time',0);
+            $search_time = $this->request->param('createtime',0);
+
+
+
             if($search_time) {
                 $search_time = explode(' - ',$search_time);
                 $total =  $this->model
@@ -103,12 +106,13 @@ class OrderShift extends Base
         foreach ($applyList as $apply) {
             Db::startTrans();
             try {
-                if($operate == 1 && $integral> 0)User::score($integral, $apply->user_id, 'order_shift',$apply->id);
+                if($operate == 1 && $integral> 0 && $apply->sh_status !=1 )User::score($integral, $apply->user_id, 'order_shift',$apply->id);
                 $apply->sh_status = $operate;
                 $apply->remark = $this->request->post('remark');
-                $apply->sh_time = date("Y-m-d H:i:s");
+                $apply->ck_time = date("Y-m-d H:i:s");
                 if($integral> 0 && $operate == 1)  $apply->integral = $integral;
                 $apply->save();
+                $successCount++;
                 Db::commit();
             } catch (\Exception $e) {
                 Db::rollback();

+ 18 - 19
application/admin/view/shopro/order/order_shift/index.html

@@ -177,13 +177,11 @@
                 <div class="order-refresh display-flex" @click="goOrderRefresh">
                     <i class="el-icon-refresh" :class="focusi?'focusi':''"></i>
                 </div>
-                <el-radio-group v-model="searchForm.status" fill="#7536D0" @change="getData(0,10)">
+                <el-radio-group v-model="searchForm.sh_status" fill="#7536D0" @change="getData(0,10)">
                     <el-radio-button label="all">全部</el-radio-button>
-                    <el-radio-button label="cancel">已取消</el-radio-button>
-                    <el-radio-button label="invalid">交易关闭</el-radio-button>
-                    <el-radio-button label="nopay">待付款</el-radio-button>
-                    <el-radio-button label="payed">已支付</el-radio-button>
-                    <el-radio-button label="finish">已完成</el-radio-button>
+                    <el-radio-button label="0">待审核</el-radio-button>
+                    <el-radio-button label="1">审核通过</el-radio-button>
+                    <el-radio-button label="2">审核拒绝</el-radio-button>
                 </el-radio-group>
             </div>
             <div class="screen-container-right display-flex">
@@ -200,19 +198,20 @@
                     </div>
                 </div>
             </div>
-        </div>
-        <el-collapse-transition>
-            <div class="screen-con" v-if="screenType">
-                <div class="display-flex header-select-item">
-                    <el-input placeholder="请输入内容" v-model="searchForm.form_2_value" class="input-with-select" size="small">
-                        <el-select v-model="searchForm.form_2_key" slot="prepend" placeholder="请选择">
-                            <el-option label="会员ID" value="user_id"></el-option>
-                            <el-option label="会员昵称" value="nickname"></el-option>
-                            <el-option label="手机号" value="user_phone"></el-option>
+            <div class="screen-container-right display-flex">
+                <div class="custom-filter-content">
+                    <el-input placeholder="请输入内容" v-model="searchForm.form_1_value" class="input-with-select" size="small">
+                        <el-select v-model="searchForm.form_1_key" slot="prepend" placeholder="请选择">
+                            <el-option label="用户ID" value="user_id"></el-option>
+                            <el-option label="用户昵称" value="nickname"></el-option>
+                            <el-option label="用户手机号" value="user_phone"></el-option>
                         </el-select>
                     </el-input>
                 </div>
-
+            </div>
+        </div>
+        <el-collapse-transition>
+            <div class="screen-con" v-if="screenType">
                 <div class="header-button-item display-flex">
                     <el-button size="small" @click="screenEmpty">重置</el-button>
                     <el-button type="primary" size="small" @click="getData(0,10)">筛选</el-button>
@@ -275,7 +274,7 @@
             <el-table-column min-width="140" fixed="right" label="操作" align="left">
                 <template slot-scope="scope">
                     <span v-if="scope.row.sh_status==0" class="custom-table-operation-text custom-table-color-primary"  @click="openAgreeDialog(scope.row)">审核</span>
-                    <span v-if="scope.row.sh_status!=0" class="custom-table-operation-text custom-table-color-primary">已审核</span>
+                    <span v-if="scope.row.sh_status!=0" class="custom-table-operation-text custom-table-color-primary" @click="openAgreeDialog(scope.row)">已审核</span>
                 </template>
             </el-table-column>
 
@@ -296,8 +295,8 @@
             <div><el-input v-model="auditForm.integral" placeholder="请输入兑换积分数量"></el-input></div>
             <br>
             <el-button @click="closeAgreeDialog" size="small">取消</el-button>
-            <el-button v-if="agreeRow.sh_status==0" type="primary" @click="audit()" size="small" plain>同意</el-button>
-            <el-button v-if="agreeRow.sh_status==0" type="danger"  @click="audit()" size="small">拒绝</el-button>
+            <el-button v-if="agreeRow.sh_status >=0" type="primary" @click="auditAgree()" size="small" plain>同意</el-button>
+            <el-button v-if="agreeRow.sh_status >=0" type="danger"  @click="auditRefused()" size="small">拒绝</el-button>
         </span>
     </el-dialog>
 </div>

+ 33 - 41
public/assets/js/backend/shopro/order/order_shift.js

@@ -26,46 +26,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         limit: 10,
                         // form搜索
                         searchForm: {
-                            status: "all",
+                            sh_status: "all",
                             createtime: [moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')],
-                            form_1_key: "order_sn",
+                            form_1_key: "user_id",
                             form_1_value: "",
-                            platform: "",
-                            dispatch_type: "",
-                            type: "",
-                            pay_type: "",
-                            form_2_key: "user_id",
-                            form_2_value: "",
                         },
                         searchFormInit: {
-                            status: "all",
+                            sh_status: "all",
                             createtime: [moment().startOf('day').format('YYYY-MM-DD HH:mm:ss'), moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')],
-                            form_1_key: "order_sn",
+                            form_1_key: "user_id",
                             form_1_value: "",
-                            platform: "",
-                            dispatch_type: "",
-                            type: "",
-                            pay_type: "",
-                            form_2_key: "user_id",
-                            form_2_value: "",
                         },
                         searchOp: {
-                            status: "=",
-                            createtime: "range",
-                            order_sn: "like",
-                            id: "=",
-                            aftersale_sn: "=",
-                            transaction_id: "=",
-                            platform: "=",
-                            dispatch_type: "=",
-                            type: "=",
-                            pay_type: "=",
+                            sh_status: "=",
+                            create_at: "range",
                             user_id: "=",
                             nickname: "like",
                             user_phone: "like",
-                            consignee: "like",
-                            phone: "like",
-
                         },
                         focusi: false,
                         //审核
@@ -79,18 +56,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 },
                 mounted() {
                     this.getData()
-                    this.getType()
                 },
                 methods: {
-                    getType() {
-                        var that = this;
-                        Fast.api.ajax({
-                            url: 'shopro/order/order/getType',
-                        }, function (ret, res) {
-                            that.typeList = res.data
-                            return false;
-                        })
-                    },
                     //请求
                     getData(offset, limit) {
                         var that = this;
@@ -99,6 +66,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         that.currentPage = that.offset / that.limit + 1;
                         let filter = {}
                         let op = {}
+                        for (key in that.searchForm) {
+                            if (key == 'sh_status') {
+                                if (that.searchForm[key] != '' && that.searchForm[key] != 'all') {
+                                    filter[key] = that.searchForm[key];
+                                }
+                            } else if (key == 'form_1_value') {
+                                if (that.searchForm[key] != '') {
+                                    filter[that.searchForm.form_1_key] = that.searchForm[key];
+                                }
+                            } else if (key == 'createtime') {
+                                if (that.searchForm[key]) {
+                                    if (that.searchForm[key].length > 0) {
+                                        filter[key] = that.searchForm[key].join(' - ');
+                                    }
+                                }
+                            }
+                        }
+                        for (key in filter) {
+                            op[key] = that.searchOp[key] ;
+                        }
+
                         Fast.api.ajax({
                             url: 'shopro/order/order_shift/index',
                             loading: true,
@@ -174,12 +162,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             that.agreeDialogVisible = false
                             that.refuseDialogVisible = false;
                             that.auditForm.remark = "";
+                            that.auditForm.integral = "";
                             return false;
                         })
                     },
-                    audit() {
-                        this.reqApplyOper(this.agreeRow, this.auditForm.sh_status, this.auditForm.remark,this.auditForm.integral)
+                    auditAgree() {
+                        this.reqApplyOper(this.agreeRow,1, this.auditForm.remark,this.auditForm.integral)
                     },
+                    auditRefused(){
+                        this.reqApplyOper(this.agreeRow,2, this.auditForm.remark,this.auditForm.integral)
+                    }
 
                 },
             })