Kaynağa Gözat

Merge branch 'qghd' of http://192.168.0.115:3000/bill/fire_control into qghd

jinx 3 yıl önce
ebeveyn
işleme
ad7818d58d

+ 8 - 7
src/components/company-select/index.vue

@@ -6,10 +6,9 @@
       style="width: 100%"
       v-model="threeValue"
       :disabled="disabled"
-      placeholder="承办单位:"
+      placeholder="承办单位:顶顶顶顶"
       :options="threeOptions"
       :props="{ expandTrigger: 'hover', checkStrictly: true }">
-    
       <template v-slot:default="{ data }">
         <span :class="{aaa: notUpdate}">{{data.label}}</span>
       </template>
@@ -19,7 +18,7 @@
 
 <script>
 import selectComponentJs from '../select'
-import { getCompanyList } from '@/request/config'
+import { getTreeselect,getCompanyList } from '@/request/config'
 import axios from 'axios'
 import { computed, ref } from 'vue'
 
@@ -28,8 +27,9 @@ const extObj = selectComponentJs()
 const analyData = (data) => {
   return data.map(citem => {
     let item = {label: citem.name, value: citem.id, level: citem.level}
-    if (citem.childList.length) {
-      item.children = analyData(citem.childList)
+    console.log('citem',citem);
+    if (citem.children.length) {
+      item.children = analyData(citem.children)
     }
     return item
   })
@@ -116,9 +116,10 @@ export default {
     return {...ret, threeOptions, threeValue}
   },
   async mounted() {
-    let res = await axios.post(getCompanyList)
+    let res = await axios.get(getTreeselect)
+    let ress = await axios.post(getCompanyList)
     let coms = Array.isArray(res.data) ? res.data : [res.data]
-
+    console.log('ress',res,ress,this.showAll,this.notUpdate,coms);
     if (this.showAll) {
       this.threeOptions = [{label: '全部', value: ''}].concat(analyData(coms))
     } else if (this.notUpdate){

+ 16 - 71
src/view/organization/list.vue

@@ -155,73 +155,11 @@ export default {
         remark:'test',
       },
       detail: {
-        name: "test",
-        deptType: "1",
+        name: "",
+        deptType: "",
       },
       treeProps: { children: "children", label: "name" },
       superiorValue: [],
-      superiorOptions: [
-        {
-          value: "guide",
-          label: "Guide",
-          children: [
-            {
-              value: "disciplines",
-              label: "Disciplines",
-              children: [
-                {
-                  value: "consistency",
-                  label: "Consistency",
-                },
-                {
-                  value: "feedback",
-                  label: "Feedback",
-                },
-                {
-                  value: "efficiency",
-                  label: "Efficiency",
-                },
-                {
-                  value: "controllability",
-                  label: "Controllability",
-                },
-              ],
-            },
-            {
-              value: "navigation",
-              label: "Navigation",
-              children: [
-                {
-                  value: "side nav",
-                  label: "Side Navigation",
-                },
-                {
-                  value: "top nav",
-                  label: "Top Navigation",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          value: "resource",
-          label: "Resource",
-          children: [
-            {
-              value: "axure",
-              label: "Axure Components",
-            },
-            {
-              value: "sketch",
-              label: "Sketch Templates",
-            },
-            {
-              value: "docs",
-              label: "Design Documentation",
-            },
-          ],
-        },
-      ],
       treedata: [],
     });
     const seeDetail = (val) =>{
@@ -252,10 +190,13 @@ export default {
         requestApi = editTreeitem
       }
       let res = await axios.post(requestApi, apidata)
-      console.log('async',res);
-      data.show = false;
+      getTreedata()
+    data.detail = {}
+    data.show = false
+    data.superiorValue = []
+      console.log('async',res,data);
+      getApp().$ref.form.resetFields()
       getApp().$confirm('组织创建成功', '删除')
-      // data.tipsShow = true;
     };
     const insertProject = (val) => {
      console.log('insertProject',val.id);
@@ -270,7 +211,8 @@ export default {
       data.show = true;
     };
     const handleChange = (val) => {
-      console.log("点击handleChange", val,data.superiorValue);
+      data.detail.parentId = val&&val[val.length-1]
+      console.log("点击handleChange", val.length,data);
 
     };
     const loadNode = (node, resolve) => {
@@ -296,15 +238,18 @@ export default {
     const remove = async (val) => {
       let isOk = await getApp().$confirm('当前组织下尚存在用户或绑定的相机,删除组织将一并删除,确认要删除组织吗?', '删除')
       if(isOk){
-        let res = await axios.post(delTreeitem+val, {})
+        let res = await axios.post(delTreeitem+val)
         console.log("isOk",isOk, val,res);
         getApp().$message({message: '删除成功', type: 'success'});
+        getTreedata()
       }
     };
-    
-    onMounted(async ()=>{
+    const getTreedata = async () =>{
       let res = await axios.get(getTreeselect, {})
       data.treedata = res.data
+    }
+    onMounted(async ()=>{
+        getTreedata()
     })
     return {
       // treedata,