소스 검색

网管课配置

1
mo 3 년 전
부모
커밋
c9d8fdc5e4
1개의 변경된 파일42개의 추가작업 그리고 3개의 파일을 삭제
  1. 42 3
      src/views/categroyManager/accompanyBaseConfig.vue

+ 42 - 3
src/views/categroyManager/accompanyBaseConfig.vue

@@ -16,7 +16,7 @@
       <el-row class="row">
         网管课可选声部
         <select-all
-        class="chioseOragn"
+          class="chioseOragn"
           multiple
           collapse-tags
           v-model="organIdList"
@@ -33,25 +33,64 @@
           ></el-option>
         </select-all>
         老师
-        <el-button type="primary" size="mini" class="submitBtn">保存</el-button>
+        <el-button type="primary" size="mini" class="submitBtn" @click="submit"
+          >保存</el-button
+        >
       </el-row>
     </div>
   </div>
 </template>
 <script>
+import { sysConfigList, sysConfigUpdate } from "@/api/generalSettings";
 export default {
   data() {
     return {
       organIdList: [],
+      activeItem: null,
     };
   },
   mounted() {
     this.$store.dispatch("setBranchs");
+    sysConfigList({ group: "PRACTICE" }).then((res) => {
+      if (res.code == 200 && res.data.length > 0) {
+        res.data.forEach((item, index) => {
+          if (item.paramName == "practice_teacher_organ_range") {
+            this.activeItem = item;
+            this.organIdList = item.paranValue?item.paranValue.split(",").map((oragn) => {
+              return Number(oragn);
+            }):[]
+          }
+        });
+      }
+    });
+  },
+  methods: {
+    submit() {
+      if (this.organIdList.length < 0) {
+        this.$message.error("请至少选择一个分部");
+        return;
+      }
+      let params = { ...this.activeItem };
+      params.paranValue = this.organIdList.join(",");
+      sysConfigUpdate(params).then((res) => {
+        if (res.code == 200) {
+          this.$message.success("修改成功");
+        }
+      });
+      /**
+      *  let params = {
+        id: row.id,
+        paranValue: this.input[index],
+        paramName: row.paramName,
+        description: row.description.join('{}')
+      }
+      */
+      // submit
+    },
   },
 };
 </script>
 <style lang="scss" scoped>
-
 .chioseOragn {
   width: 400px;
   margin: 0 5px;