lijiangwei 4 лет назад
Родитель
Сommit
5cb7ed6297
2 измененных файлов с 36 добавлено и 23 удалено
  1. 18 18
      uis/views/customer/edit.html
  2. 18 5
      uis/views/customer/index.html

+ 18 - 18
uis/views/customer/edit.html

@@ -136,24 +136,24 @@
             }
         });
 
-        admin.req({
-            url: '/customer/project/dict/',
-            done: function (res) {
-                var data = res.data;
-                let tempData = [];
-                if(res.data && res.data.length > 0){
-                    tempData =  res.data.map(item=>{
-                        if(id && editdata['project']){
-                           console.log(editdata['project']);
-                        }
-                        return {value: item.id, name: item.name}
-                    });
-                }
-                formSelects.data('tags', 'local', {
-                    arr: tempData
-                });
-            }
-        });
+        // admin.req({
+        //     url: '/customer/project/dict/',
+        //     done: function (res) {
+        //         var data = res.data;
+        //         let tempData = [];
+        //         if(res.data && res.data.length > 0){
+        //             tempData =  res.data.map(item=>{
+        //                 if(id && editdata['project']){
+        //                    console.log(editdata['project']);
+        //                 }
+        //                 return {value: item.id, name: item.name}
+        //             });
+        //         }
+        //         formSelects.data('tags', 'local', {
+        //             arr: tempData
+        //         });
+        //     }
+        // });
 
         //form.render(null, 'component-form-element');
 

+ 18 - 5
uis/views/customer/index.html

@@ -78,11 +78,8 @@
                                 </button>
                             </div>
                             <div class="seach_items">
-                                <select name="origin" style="width: 40px;">
+                                <select name="source" id="id_source" style="width: 40px;">
                                     <option value="">请选择来源</option>
-                                    <option value="1">自然进店</option>
-                                    <option value="2">电话邀约</option>
-                                    <option value="3">来电咨询</option>
                                 </select>
                             </div>
                             <div class="seach_items">
@@ -142,6 +139,22 @@
             , page: true
             , height: 'full-108'
         });
+
+        admin.req({
+            url: '/customer/reportcustomer/dict/',
+            done: function (res) {
+                var data = res.data.source;
+                console.log(res.data, "opoopopop")
+                var source_node = $('#id_source');
+                for (var i in data) {
+                    var pid = data[i].id;
+                    var name = data[i].name;
+                    source_node.append("<option value='" + pid + "'>" + name + "</option>");
+                }
+                form.val("component-form-element", editdata);
+            }
+        });
+
         $('#btn_download').on('click', function () {
             layui.view.download("/static/xls/设备信息导入模板.xlsx");
         });
@@ -170,7 +183,7 @@
                 layer.confirm('确定要删除吗?', function (index) {
                     layer.close(index);
                     admin.req({
-                        url: '/reportcustomer/' + data.id + '/'
+                        url: '/customer/reportcustomer/' + data.id + '/'
                         , type: 'delete'
                         , done: function (res) {
                             table.reload('customer_datagrid', {});