+          
             
               
               
@@ -105,7 +106,7 @@
       
         
           
-            
+            
               
             
           
@@ -125,8 +126,7 @@
                 :props="{
                   value: 'id',
                   label: 'displayName',
-                  children: 'treeChildren',
-                  checkStrictly: true,
+                  children: 'treeChildren'
                 }"
               >
               
           
-            
+            
                
             
           
@@ -912,7 +912,7 @@
       
         
           
-            
+            
           
         
       
@@ -933,7 +933,7 @@
       
         
           
-            
+            
           
         
       
@@ -1077,11 +1077,11 @@ export default {
         displayName: "",
         englishShortName: "",
         itemTypeId: "",
-        price: "",
-        priceItemId: "",
-        unitId: "",
-        defaultResult: "",
-        referenceRangeTypeFlag: "",
+        price: "0",
+        priceItemId: null,
+        unitId: null,
+        defaultResult: "未见异常",
+        referenceRangeTypeFlag: "0",
         isProduceSummary: "",
         isNameIntoSummary: "",
         isDiagnosisFunction: "",
@@ -1089,7 +1089,7 @@ export default {
         isCalculationItem: "",
         calculationFunction: "",
         isContinueProcess: "",
-        resultTemplateTypeFlag: "",
+        resultTemplateTypeFlag: null,
         inputCheck: "",
         isActive: ""
       },
@@ -1340,11 +1340,12 @@ export default {
       curRowes:{},
       fssubdexDete:"",
       isshows:true,
-      isshowes:true
+      isshowes:true,
+      initItemTypeId:""
     };
   },
   created() {
-    this.getlist();
+    // this.getlist();
     this.getmedicalconclusionlist();
   },
   mounted() {
@@ -1357,7 +1358,6 @@ export default {
   methods: {
     //启用诊断函数
     enablediagnostics(v) {
-      console.log(v);
       if (v == "N") {
         this.disableddiagnosisFunction = true;
       } else {
@@ -1432,9 +1432,6 @@ export default {
       for (var i = 0; i < this.newssdate.length; i++) {
         if (this.newssdate[i].id == id) {
           isdate = true;
-          console.log("888");
-          console.log(this.newssdate[i][name]);
-
           this.newssdate[i][name] = value;
         }
       }
@@ -1449,17 +1446,29 @@ export default {
       //
     },
     treeclick(data) {
+      this.initItemTypeId=data.id
       getapi(`/api/app/item/in-item-type/${data.id}`).then((res) => {
         this.tableData = res.data;
-        console.log(res.data, "ress");
+        this.initTableData=[...res.data]
         // this.getlist();
       });
     },
     typeid() {
       projectlist().then((res) => {
         this.itemTypeId = res.data;
+        this.itemTypeId=this.formatData(this.itemTypeId)
       });
     },
+    formatData(dataList){
+      for(let i=0;i {
@@ -1611,7 +1620,6 @@ export default {
     },
     //项目模板置顶
     toppingqq() {
-      console.log(this.rusetform.id);
       if (this.rusetform.id == undefined) {
         this.$message.warning("请选择操作的数据");
       } else {
@@ -1654,7 +1662,6 @@ export default {
       getapi(`/api/app/item-result-template/${row.id}`).then((res) => {
         this.curRows = res.data;
       });
-      console.log(row);
     },
     //项目结果模板新增弹框
     resultediting() {
@@ -1779,7 +1786,6 @@ export default {
       });
        Object.assign(this.$data.rusetform, this.$options.data().rusetform)
        this.rusetform.itemId = this.form.id;
-      console.log(this.rusetform)
     },
     quckRusetform(e){
       if(!e){
@@ -1788,10 +1794,10 @@ export default {
     },
     //获取项目类别列表
     getmedicalconclusionlist() {
-      // postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => {
-      //     this.Selectacategory = res.data;
-      //     this.quckDepartment=res.data
-      //   });
+      getporjectlists(this.pages).then((res) => {
+        this.initTableData = [...res.data.items];
+        this.quckDepartment=res.data.items;
+      });
     },
     onchange(id) {
       // this.form.customerOrgId = id;
@@ -1803,7 +1809,6 @@ export default {
         this.form.itemTypeId = item;
       });
       }
-      console.log(this.form.customerOrgId);
     },
     gettypelist(listdata) {
       listdata.forEach((items) => {
@@ -1816,15 +1821,12 @@ export default {
     },
     isselctvalue(v) {
       this.pages.TypeId = v;
-      console.log(v);
-      console.log(this.pages.TypeId);
       this.getlist();
     },
     handleSelect(item) {
       this.pages.Filter = item.displayName;
       this.item = item;
       this.formid = item.id;
-      console.log(this.item);
       //console.log(item);
       //    quersmedicalid(item.id).then((res) => {
       //   console.log(res);
@@ -1833,7 +1835,6 @@ export default {
     },
     getlistM(rowsid) {
       getporjectlists(this.pages).then((res) => {
-        console.log("数据", res);
         this.initTableData = [...res.data.items];
         this.tableData = res.data.items;
         this.quckDepartment=res.data.items;
@@ -1956,6 +1957,7 @@ export default {
       this.quckDepartment.forEach(item=>{
         if(e==item.id){
           currentKey=item.itemTypeId
+          this.initItemTypeId=item.itemTypeId
         }
       })
       this.$refs['itemType'].setCurrentKey(currentKey)
@@ -2026,7 +2028,6 @@ export default {
       let result = [];
       this.tableData.forEach((item, index) => {
         // index 从0开始的, displayOrder从大到小排
-        console.log(item.id);
         // let currentDisplayOrder = this.tableData.length -1
         let currentDisplayOrder = this.initTableData[index].displayOrder;
         if (item.displayOrder != currentDisplayOrder) {
@@ -2051,13 +2052,11 @@ export default {
           handle: ".move",
           animation: 300,
           onChoose({oldIndex}){
-            console.log(oldIndex)
             _this.$refs['tableData'].setCurrentRow(_this.tableData[oldIndex]);
             _this.rowick(_this.tableData[oldIndex])
           },
           onEnd({ newIndex, oldIndex }) {
             _this.isshow = false;
-            console.log(newIndex, oldIndex)
             let currRow = _this.tableData.splice(oldIndex, 1)[0];
             _this.tableData.splice(newIndex, 0, currRow);
             _this.tableData.map((item, index) => {
@@ -2068,6 +2067,7 @@ export default {
               }
             });
             console.log(_this.tableData.map((item) => item.displayOrder));
+            console.log(_this.initTableData.map((item) => item.displayOrder));
           },
         });
       });
@@ -2077,10 +2077,8 @@ export default {
       let result = [];
       this.reusttableData.forEach((item, index) => {
         // index 从0开始的, displayOrder从大到小排
-        console.log(item.id);
         // let currentDisplayOrder = this.tableData.length -1
         let currentDisplayOrder = this.initReusttableData[index].displayOrder;
-        console.log(currentDisplayOrder)
         if (item.displayOrder != currentDisplayOrder) {
           // 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
           result.push({ id: item.id, displayOrder: currentDisplayOrder });
@@ -2117,8 +2115,6 @@ export default {
               } else if (index == newIndex) {
               }
             });
-            console.log(_this.reusttableData.map((item) => item.displayOrder));
-            console.log(_this.initReusttableData.map((item) => item.displayOrder));
           },
         });
       });
@@ -2166,10 +2162,8 @@ export default {
       let result = [];
       this.diagnosticdata.forEach((item, index) => {
         // index 从0开始的, displayOrder从大到小排
-        console.log(item.id);
         // let currentDisplayOrder = this.tableData.length -1
         let currentDisplayOrder = this.initdiagnosticdata[index].displayOrder;
-        console.log(currentDisplayOrder)
         if (item.displayOrder != currentDisplayOrder) {
           // 如果它的displayOrder和它当前所在的位置不同代表挪动过位置
           result.push({ id: item.id, displayOrder: currentDisplayOrder });
@@ -2206,7 +2200,6 @@ export default {
               } else if (index == newIndex) {
               }
             });
-            console.log(_this.diagnosticdata.map((item) => item.displayOrder));
           },
         });
       });
@@ -2258,7 +2251,7 @@ export default {
         projttitem(this.form.id, 2).then((res) => {
           if(res.code!=-1){
             this.$message.success("操作成功");
-            this.getlist();
+            this.getItemTypeIdList();
           }
         });
       }
@@ -2272,7 +2265,7 @@ export default {
         projttitem(this.form.id, 1).then((res) => {
           if(res.code!=-1){
             this.$message.success("操作成功");
-            this.getlist();
+            this.getItemTypeIdList();
           }
         });
       }
@@ -2291,8 +2284,9 @@ export default {
           .then(() => {
             projectdeleft(this.form.id).then((res) => {
               this.$message.success("删除成功");
-              this.getlist();
-              this.form = {};
+              this.getItemTypeIdList();
+              Object.assign(this.$data.form, this.$options.data().form)
+              this.curRow=this.$options.data().curRow
             });
           })
           .catch(() => {});
@@ -2305,11 +2299,11 @@ export default {
         // console.log(res);
         // this.form = res.data;
       });
-      console.log(row);
     },
     //编辑弹框
     editpopup() {
       this.form = { ...this.curRow };
+      console.log(this.form)
       if (this.form.id == undefined) {
         this.$message.warning("请选择操作的数据");
       } else {
@@ -2321,12 +2315,8 @@ export default {
           this.$refs.form.resetFields()
         } 
         posjrctid(this.form.id).then((res) => {
-          this.form = res.data;
-          // this.unitId.forEach((item)=>{
-          //   if(res.data.unitId==item.id){
-          //     this.unitIdName=item.displayName
-          //   }
-          // })
+          if(res.code!=-1){
+            this.form = res.data;
           if (res.data.isProduceSummary == 'Y') {
             this.isProduceSummaryBox = true;
           } else {
@@ -2357,7 +2347,7 @@ export default {
           } else {
             this.isActiveBox = false;
           }
-           console.log(this.form);
+          }
         });
       }
     },
@@ -2405,8 +2395,12 @@ export default {
             addproject(this.form).then((res) => {
               if (res.code == 1) {
                 this.$message.success("新增成功");
-                this.getlist();
+                this.getItemTypeIdList();
                 this.dialogVisible = false;
+                this.$nextTick(()=>{
+                  this.$refs['tableData'].setCurrentRow(res.data);
+                  this.rowick(res.data)
+                })
               }
             });
           } else if (this.title == 2) {
@@ -2427,7 +2421,10 @@ export default {
     },
     //新增弹框
     add() {
-      this.form.price = Number(this.form.price);
+      if(this.initItemTypeId==undefined || this.initItemTypeId==""){
+        this.$message.warning('请选择项目类别')
+      }else{
+        this.form.price = Number(this.form.price);
       // this.form={}
       this.title = 1;
       this.dialogVisible = true;
@@ -2445,12 +2442,17 @@ export default {
       isBox.forEach(item=>{
         this.form[item] = 'Y';
       })
+      let isNotBox=["isDiagnosisFunction","isCalculationItem","isContinueProcess"]
+      isNotBox.forEach(item=>{
+        this.form[item] = 'N';
+      })
+      this.form.itemTypeId=this.initItemTypeId
       // this.unitIdName=""
-      console.log(this.form)
       this.$nextTick(() => {
         this.$refs.refinput.focus();
       });
       this.addorgropdata();
+      }
     },
     //新增或者编辑弹框需要的下拉框接口数据
     addorgropdata() {
@@ -2474,7 +2476,6 @@ export default {
       //结果模板
       getapi("/api/app/item-result-template").then((res) => {
         this.resulttemp = res.data.items;
-        console.log(res, "结果模板");
       });
     },
     getlist() {
@@ -2484,6 +2485,13 @@ export default {
       //   this.tableData = res.data.items;
       // });
     },
+    getItemTypeIdList(){
+      getapi(`/api/app/item/in-item-type/${this.initItemTypeId}`).then((res) => {
+            if(res.code!=-1){
+              this.tableData = res.data;
+            }
+      });
+    },
     tcdate(date) {
       for (var i = 0; i < date.length; i++) {
         if (date[i].treeChildren.length == 0) {