dedsudiyu 1 year ago
parent
commit
a6692557c0

+ 22 - 37
src/views/studentViews/chemicalManagement/studentChemicalInfo/addPage.vue

@@ -223,7 +223,7 @@
 </template>
 
 <script>
-  import { getNoAdminSubjectListNopage,getCabinetBySubId,hxpChemicalJoinCabinet,getRestStockByManyCabinet,classifyList } from "@/api/medicUniversity-3_1/index";
+  import { filterDept,getSubList,getCabinetBySubId,hxpChemicalJoinCabinet,getRestStockByManyCabinet,classifyList } from "@/api/medicUniversity-3_1/index";
   import { getHxpQueryByUser } from "@/api/studentApi/chemicalManagement/index";
   import { getLogoInfo } from "@/api/system/publicConfig";
   export default {
@@ -243,21 +243,6 @@
           callback(new Error("超出该机柜可存放量"));
         }else if(value<tare){
           callback(new Error("容器容量规格不能小于容器重量规格"));
-<<<<<<< HEAD
-        }else{
-          callback();
-        }
-      };
-      const computingTare = (rule, value, callback) => {
-        console.log('rule',rule)
-        const list = rule.field.split('.');
-        let index = parseFloat(list[1]);
-        let index2 = parseFloat(list[3]);
-        let chemicalAmount = parseFloat(this.dialogData.maxList[index].list[index2].chemicalAmount);
-        if(value>chemicalAmount){
-          callback(new Error("容器重量规格不能大于容器容量规格"));
-=======
->>>>>>> 3.3.3-AnQuanJianCha
         }else{
           callback();
         }
@@ -562,27 +547,26 @@
       //化学品存放
       handleAdd(){
         //查询当前院系
-        // filterDept().then(response => {
-        //   if(!this.selectioned.id){
-        //     this.msgError('请勾选化学品')
-        //     return
-        //   }
-        //   let text = "";
-        //   let idText = "";
-        //   for(let i=0;i<response.data.length;i++){
-        //     if(i==0){
-        //       text = text + response.data[i].deptName;
-        //       idText = idText + response.data[i].deptId;
-        //     }else{
-        //       text = text +'-'+ response.data[i].deptName;
-        //       idText = idText +','+ response.data[i].deptId;
-        //     }
-        //   }
-        //   this.$set(this,'dialogDeptName',text);
-        //   this.$set(this,'dialogDeptId',idText);
-        //   this.getSubList();
-        // });
+        filterDept().then(response => {
+          if(!this.selectioned.id){
+            this.msgError('请勾选化学品')
+            return
+          }
+          let text = "";
+          let idText = "";
+          for(let i=0;i<response.data.length;i++){
+            if(i==0){
+              text = text + response.data[i].deptName;
+              idText = idText + response.data[i].deptId;
+            }else{
+              text = text +'-'+ response.data[i].deptName;
+              idText = idText +','+ response.data[i].deptId;
+            }
+          }
+          this.$set(this,'dialogDeptName',text);
+          this.$set(this,'dialogDeptId',idText);
           this.getSubList();
+        });
       },
       backPage(){
         this.$parent.pageToggle(0);
@@ -623,7 +607,8 @@
       },
       //根据所属院系或多个院系获取实验室列表
       getSubList(){
-        getNoAdminSubjectListNopage().then(response => {
+        let ids = this.dialogDeptId+'';
+        getSubList(ids).then(response => {
           this.$set(this,'dialogData',{
             subId:"",
             chemicalId:"",