wushaodong 4 år sedan
förälder
incheckning
643be9b130

+ 5 - 1
apps/customer/filters.py

@@ -25,7 +25,11 @@ class NewCustomerFilter(django_filters.FilterSet):
             queryset = queryset.filter(store_id=param[1])
         elif param[0] == 'user':
             # param=user_1_51 门店id_用户id
-            customer_ids = NewCustomerRemind.objects.filter(remind_user_id=param[2], store_id=param[1] ).values_list('customer_id',flat=True)
+            if len(param) == 2:
+                customer_ids = NewCustomerRemind.objects.filter(remind_user_id=param[1]).values_list('customer_id',flat=True)
+            else:
+                customer_ids = NewCustomerRemind.objects.filter(remind_user_id=param[2], store_id=param[1]).values_list(
+                    'customer_id', flat=True)
             queryset = queryset.filter(id__in=customer_ids)
         elif param[0] == 'agent':
             queryset = queryset.filter(store__agent_id=param[1])

+ 2 - 1
apps/customer/views.py

@@ -98,7 +98,8 @@ class ReportCustomerViewSet(CustomModelViewSet):
                 # 根据分配人所在店面,创建内部跟踪提醒
                 remind_users = request.user.get_remind_users()
                 # 跟踪人和提醒人是同一个人的,不需要在加提醒
-                remind_users.remove(int(user_id))
+                if int(user_id) in remind_users:
+                    remind_users.remove(int(user_id))
                 #  把next_time用当前日期加上5天
                 next_time = (timezone.now() + datetime.timedelta(days=5)).strftime('%Y-%m-%d')
                 for remind_user in remind_users:

+ 2 - 2
apps/order/views.py

@@ -90,12 +90,12 @@ class OrderViewSet(CustomModelViewSet):
     def dispatch_service(self, request, pk):
         # 订单分配服务人员
         check_permission(request, 'order.order_process_dispatch')
-        stage_progress = request.POST.get('next_process')
+        next_process = request.POST.get('next_process')
         service = request.POST.get('service')
 
         try:
             with transaction.atomic():
-                stage_progress = Option.objects.filter(id=stage_progress, enable=True).order_by('sort').first()
+                stage_progress = Option.objects.filter(id=next_process, enable=True).order_by('sort').first()
                 if not stage_progress:
                     raise CustomError('阶段进度有误,请刷新重试!')
                 if not stage_progress.track_day:

+ 25 - 29
uis/views/customer/check_index.html

@@ -73,11 +73,11 @@
                             </div>
                             <div class="seach_items">
                                 <select name="check_status">
-                                     <option value="">请选择审核状态</option>
-                                     <option value="0" selected>未审核</option>
-                                     <option value="1">继续跟踪</option>
-                                     <option value="2">放弃</option>
-                                 </select>
+                                    <option value="">请选择审核状态</option>
+                                    <option value="0" selected>未审核</option>
+                                    <option value="1">继续跟踪</option>
+                                    <option value="2">放弃</option>
+                                </select>
                             </div>
                         </form>
                         <div style="clear: both;"></div>
@@ -135,33 +135,29 @@
         table.on('tool(customer-operate)', function (obj) {
             var data = obj.data;
             if (obj.event === 'customer_check') {
-                if(data.check_status !== 0){
+                if (data.check_status !== 0) {
                     layer.msg("当前记录已审核", {icon: 2});
                     return
                 }
-               table.editdata = data;
-               layer.open({
-                type: 2,
-                title: '审核',
-                area: ['40%', '60%'],
-                btn: ['保存', '取消'],
-                yes: function (index, dom) {
-                    layui.onSubmitChild = function (res) {
-                        if(res.code === 0){
-                            // 刷新父级页面的菜单数量
-                            parent.layui.getData();
-                            layer.msg("审核成功!", {icon: 1})
-                        }
-                        layer.close(index);
-                        table.reload('customer_datagrid', {});
-                    };
-                    layui.submitChild();
-                },
-                btn2: function (index, layero) {
-                    layer.close(index);//关闭当前按钮
-                },
-                content: 'check_customer.html?id=' + data.id
-            });
+                table.editdata = data;
+                layer.open({
+                    type: 2,
+                    title: '审核',
+                    area: ['40%', '60%'],
+                    btn: ['保存', '取消'],
+                    yes: function (index, dom) {
+                        layui.onSubmitChild = function (res) {
+                            parent.layui.getTipsData();
+                            layer.close(index);
+                            table.reload('customer_datagrid', {});
+                        };
+                        layui.submitChild();
+                    },
+                    btn2: function (index, layero) {
+                        layer.close(index);//关闭当前按钮
+                    },
+                    content: 'check_customer.html?id=' + data.id
+                });
             }
         });
 

+ 1 - 1
uis/views/customer/index.html

@@ -316,7 +316,7 @@
                             btn: ['保存', '取消'],
                             yes: function (index, dom) {
                                 layui.onSubmitChild = function (res) {
-                                    parent.layui.getData();
+                                    parent.layui.getTipsData();
                                     layer.close(index);
                                     table.reload('customer_datagrid', {});
                                 };

+ 2 - 2
uis/views/index.html

@@ -178,7 +178,7 @@
             location.href = '/views/account/login.html'; //没有用户,跳转到登录
         }
         //获取菜单的数量
-        layui.getData = function getData() {
+        layui.getTipsData = function getTipsData() {
              admin.req({
                 url: '/customer/list_count/',
                 type: 'get',
@@ -196,7 +196,7 @@
         };
 
         //获取菜单的数量
-        layui.getData();
+        layui.getTipsData();
 
 
         var permissions = layui.data(layui.setter.tableName)['permissions'];

+ 1 - 1
uis/views/order/dispatch_process_index.html

@@ -167,7 +167,7 @@
                     yes: function (index, dom) {
                         layui.onSubmitChild = function (res) {
                             // 刷新父级页面的菜单数量
-                            parent.layui.getData();
+                            parent.layui.getTipsData();
                             layer.close(index);
                             table.reload('dispatch_process_datagrid', {});
                         };

+ 1 - 1
uis/views/order/index.html

@@ -190,7 +190,7 @@
                     btn: ['保存','取消'],
                     yes: function (index, dom) {
                         layui.onSubmitChild = function (res) {
-                            parent.layui.getData();
+                            parent.layui.getTipsData();
                             layer.close(index);
                             table.reload('order_datagrid', {});
                         };

+ 3 - 20
uis/views/report_check/index.html

@@ -139,7 +139,7 @@
                     yes: function (index, dom) {
                         layui.onSubmitChild = function (data) {
                             // 刷新父级页面的菜单数量
-                            parent.layui.getData();
+                            parent.layui.getTipsData();
                             layer.close(index);
                             table.reload('report_check_datagrid', {});
                         };
@@ -161,7 +161,7 @@
                         , done: function (res) {
                             if (res.code === 0) {
                                 // 刷新父级页面的菜单数量
-                                parent.layui.getData();
+                                parent.layui.getTipsData();
                                 layer.msg("标记成功!", {icon: 1});
                             }
                             table.reload('report_check_datagrid', {});
@@ -198,25 +198,8 @@
                 btn: ['保存', '取消'],
                 yes: function (index, dom) {
                     layui.onSubmitChild = function (data) {
-                        let customer = '华北';
+                        parent.layui.getTipsData();
                         layer.close(index);
-                        if (!data) {
-                            layer.open({
-                                type: 1,
-                                title: '操作',
-                                area: ['300px', '220px'],
-                                btn: ['标记为撞单客户', '重新分配'],
-                                yes: function (index, dom) {
-                                    layui.onSubmitChild = function (data) {
-                                        layer.close(index);
-                                    };
-                                },
-                                btn2: function (index, layero) {
-                                    layer.close(index);
-                                },
-                                content: '<p style="text-align: center; padding: 15px 0">和' + customer + '客户撞单,请选择后续操作。<p>'
-                            });
-                        }
                         table.reload('report_check_datagrid', {});
                     };
                     layui.submitChild();

+ 1 - 3
uis/views/report_customer/index.html

@@ -216,9 +216,7 @@
                 btn: ['保存', '取消'],
                 yes: function (index, dom) {
                     layui.onSubmitChild = function (res) {
-                        if(res.code === 0){
-                            layer.msg('添加成功!', {icon: 1})
-                         }
+                        parent.layui.getTipsData();
                         layer.close(index);
                         table.reload('customer_datagrid', {});
                     };