ソースを参照

装集客项目更新

lijiangwei 4 年 前
コミット
98cadadeab
2 ファイル変更19 行追加8 行削除
  1. 18 6
      uis/views/customer/edit.html
  2. 1 2
      uis/views/customer/index.html

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

@@ -122,16 +122,28 @@
         }
 
         admin.req({
-            url: '/customer/reportcustomer/dict/',
+            url: '/customer/dict/',
             done: function (res) {
-                var data = res.data.source;
-                console.log(res.data, "opoopopop")
+                var data_source = res.data.source;
                 var source_node = $('#id_source');
-                for (var i in data) {
-                    var pid = data[i].id;
-                    var name = data[i].name;
+                for (var i in data_source) {
+                    var pid = data_source[i].id;
+                    var name = data_source[i].name;
                     source_node.append("<option value='" + pid + "'>" + name + "</option>");
                 }
+                var data_project = res.data.project;
+                let tempData = [];
+                if(data_project && data_project.length > 0){
+                    tempData =  data_project.map(item=>{
+                        if(id && editdata['project']){
+                           console.log(editdata['project']);
+                        }
+                        return {value: item.id, name: item.name}
+                    });
+                }
+                formSelects.data('tags', 'local', {
+                    arr: tempData
+                });
                 form.val("component-form-element", editdata);
             }
         });

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

@@ -144,14 +144,13 @@
             url: '/customer/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.render('select', 'id_source');
+                form.render('select');
             }
         });