|  | @@ -67,6 +67,7 @@
 | 
	
		
			
				|  |  |              <el-col :span="6">
 | 
	
		
			
				|  |  |                <el-form-item prop="execOrgType" label="检查机构类型:">
 | 
	
		
			
				|  |  |                  <el-select
 | 
	
		
			
				|  |  | +                  @change="cleanExecOrgList"
 | 
	
		
			
				|  |  |                    prop="execOrgType"
 | 
	
		
			
				|  |  |                    label="检查机构类型"
 | 
	
		
			
				|  |  |                    v-model="formData.execOrgType"
 | 
	
	
		
			
				|  | @@ -109,12 +110,12 @@
 | 
	
		
			
				|  |  |              <el-col :span="6">
 | 
	
		
			
				|  |  |                <el-form-item prop="checkOrgType" label="受检机构类型:">
 | 
	
		
			
				|  |  |                  <el-select
 | 
	
		
			
				|  |  | +                  @change="cleanCheckOrgList"
 | 
	
		
			
				|  |  |                    prop="checkOrgType"
 | 
	
		
			
				|  |  |                    label="受检机构类型"
 | 
	
		
			
				|  |  |                    v-model="formData.checkOrgType"
 | 
	
		
			
				|  |  |                    placeholder="请选择受检机构类型"
 | 
	
		
			
				|  |  |                    clearable
 | 
	
		
			
				|  |  | -                  
 | 
	
		
			
				|  |  |                  >
 | 
	
		
			
				|  |  |                    <el-option
 | 
	
		
			
				|  |  |                      v-for="item in dict.type.sys_org_type"
 | 
	
	
		
			
				|  | @@ -169,22 +170,27 @@
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="6">
 | 
	
		
			
				|  |  | -              <el-form-item :span="6" prop="execOrg" label="检查机构">
 | 
	
		
			
				|  |  | -                <orgDropDown
 | 
	
		
			
				|  |  | -                  v-model="formData.execOrg"
 | 
	
		
			
				|  |  | -                  placeholder="选择检查机构"
 | 
	
		
			
				|  |  | -                  multiple
 | 
	
		
			
				|  |  | -                  @select="onexecOrgSelect"
 | 
	
		
			
				|  |  | -                />
 | 
	
		
			
				|  |  | +              <el-form-item :span="6" prop="execOrgIds" label="检查机构">
 | 
	
		
			
				|  |  | +                <org-tree-select
 | 
	
		
			
				|  |  | +                  v-model="formData.execOrgList"
 | 
	
		
			
				|  |  | +                  :queryData="parseInt(formData.execOrgType)"
 | 
	
		
			
				|  |  | +                  ref="execorgTreeSelect"
 | 
	
		
			
				|  |  | +                  :enabledCheckOrgTypes="parseInt(formData.execOrgType)"
 | 
	
		
			
				|  |  | +                  :disable="true"
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                </org-tree-select>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="6">
 | 
	
		
			
				|  |  | -              <el-form-item :span="6" prop="checkOrg" label="受检机构">
 | 
	
		
			
				|  |  | -                <orgDropDown
 | 
	
		
			
				|  |  | -                  v-model="formData.checkOrg"
 | 
	
		
			
				|  |  | -                  placeholder="选择受检机构"
 | 
	
		
			
				|  |  | -                  @select="oncheckOrgSelect"
 | 
	
		
			
				|  |  | -                />
 | 
	
		
			
				|  |  | +              <el-form-item :span="6" prop="checkOrgIds" label="受检机构">
 | 
	
		
			
				|  |  | +                <org-tree-select
 | 
	
		
			
				|  |  | +                  v-model="formData.checkOrgList"
 | 
	
		
			
				|  |  | +                  :queryData="parseInt(formData.checkOrgType)"
 | 
	
		
			
				|  |  | +                  ref="checkorgTreeSelect"
 | 
	
		
			
				|  |  | +                  :enabledCheckOrgTypes="parseInt(formData.checkOrgType)"
 | 
	
		
			
				|  |  | +                  :disable="true"
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                </org-tree-select>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |            </el-row>
 | 
	
	
		
			
				|  | @@ -248,6 +254,7 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | +import OrgTreeSelect from "@/components/orgTreeSelect";
 | 
	
		
			
				|  |  |  import { mapGetters } from "vuex";
 | 
	
		
			
				|  |  |  import orgDropDown from "@/components/orgTree/orgDropDown.vue";
 | 
	
		
			
				|  |  |  import OrgTree from "@/components/orgTree";
 | 
	
	
		
			
				|  | @@ -314,6 +321,7 @@ export default {
 | 
	
		
			
				|  |  |        ],
 | 
	
		
			
				|  |  |        row: "",
 | 
	
		
			
				|  |  |        tableData: [],
 | 
	
		
			
				|  |  | +      deptOptions: [],
 | 
	
		
			
				|  |  |        id: null,
 | 
	
		
			
				|  |  |        isShow: false,
 | 
	
		
			
				|  |  |        formData: this.reset(),
 | 
	
	
		
			
				|  | @@ -343,16 +351,34 @@ export default {
 | 
	
		
			
				|  |  |      ...mapGetters(["orgId", "orgName"]),
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    cleanExecOrgList() {
 | 
	
		
			
				|  |  | +      this.execOrgIds = null;
 | 
	
		
			
				|  |  | +      this.formData.execOrgList = [];
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    cleanCheckOrgList() {
 | 
	
		
			
				|  |  | +      this.checkOrgIds = null;
 | 
	
		
			
				|  |  | +      this.formData.checkOrgList = [];
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    tenantIdnormalizer(node, instanceId) {
 | 
	
		
			
				|  |  | +      if (node.children && !node.children.length) {
 | 
	
		
			
				|  |  | +        delete node.children;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      return {
 | 
	
		
			
				|  |  | +        id: node.id,
 | 
	
		
			
				|  |  | +        label: node.name,
 | 
	
		
			
				|  |  | +        children: node.children,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      handleCheckboxChange() {
 | 
	
		
			
				|  |  |        this.formData.buildTaskNow = !this.formData.buildTaskNow;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onexecOrgSelect(node) {
 | 
	
		
			
				|  |  |        this.formData.execOrgIds = node.val;
 | 
	
		
			
				|  |  | -      console.log(node, "onexecOrgSelect");
 | 
	
		
			
				|  |  | +      // console.log(node, "onexecOrgSelect");
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      oncheckOrgSelect(node) {
 | 
	
		
			
				|  |  |        this.formData.checkOrg = node.id;
 | 
	
		
			
				|  |  | -      console.log(node, "oncheckOrgSelect");
 | 
	
		
			
				|  |  | +      // console.log(node, "oncheckOrgSelect");
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      reset() {
 | 
	
		
			
				|  |  |        return {
 | 
	
	
		
			
				|  | @@ -376,12 +402,12 @@ export default {
 | 
	
		
			
				|  |  |          execOrg: null,
 | 
	
		
			
				|  |  |          checkOrg: null,
 | 
	
		
			
				|  |  |          buildTaskNow: false,
 | 
	
		
			
				|  |  | -        checkOrgList:null,
 | 
	
		
			
				|  |  | -        execOrgList:null,
 | 
	
		
			
				|  |  | -        rulePointList:null,
 | 
	
		
			
				|  |  | -        checkOrgIds:null,
 | 
	
		
			
				|  |  | -        execOrgIds:null,
 | 
	
		
			
				|  |  | -        rulePointIds:null,
 | 
	
		
			
				|  |  | +        checkOrgList: [],
 | 
	
		
			
				|  |  | +        execOrgList: [],
 | 
	
		
			
				|  |  | +        rulePointList: null,
 | 
	
		
			
				|  |  | +        checkOrgIds: null,
 | 
	
		
			
				|  |  | +        execOrgIds: null,
 | 
	
		
			
				|  |  | +        rulePointIds: null,
 | 
	
		
			
				|  |  |        };
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      getRolesByOrg() {
 | 
	
	
		
			
				|  | @@ -401,7 +427,13 @@ export default {
 | 
	
		
			
				|  |  |      async refresh(id, other) {
 | 
	
		
			
				|  |  |        this.formData = id ? (await api.get(id)).data : this.reset(other);
 | 
	
		
			
				|  |  |        if (this.formData.execOrgType) {
 | 
	
		
			
				|  |  | -        this.formData.roleIds=this.formData.roleList.map(role => role.id);
 | 
	
		
			
				|  |  | +        this.formData.roleIds = this.formData.roleList.map((role) => role.id);
 | 
	
		
			
				|  |  | +        this.formData.execOrgIds = this.formData.execOrgList.map(
 | 
	
		
			
				|  |  | +          (org) => org.id
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +        this.formData.checkOrgIds = this.formData.checkOrgList.map(
 | 
	
		
			
				|  |  | +          (org) => org.id
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  |          this.getRolesByOrg();
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -436,7 +468,7 @@ export default {
 | 
	
		
			
				|  |  |        if (id !== undefined) {
 | 
	
		
			
				|  |  |          await api.get(id).then((res) => {
 | 
	
		
			
				|  |  |            // console.log(res);
 | 
	
		
			
				|  |  | -          this.tableData = res.data.itemList;
 | 
	
		
			
				|  |  | +          this.tableData = res.data.rulePointList;
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        this.getRolesByOrg();
 | 
	
	
		
			
				|  | @@ -465,21 +497,20 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onSubmit() {
 | 
	
		
			
				|  |  |        this.$refs.form.validate(async (isValidate) => {
 | 
	
		
			
				|  |  | -        // this.formData.note = this.formData.description;
 | 
	
		
			
				|  |  |          this.formData.planCreateOrgId = this.orgId;
 | 
	
		
			
				|  |  |          this.formData.planCreateOrgName = this.orgName;
 | 
	
		
			
				|  |  |          if (!isValidate) return;
 | 
	
		
			
				|  |  | -        this.formData.itemList = this.tableData == null ? [] : this.tableData;
 | 
	
		
			
				|  |  | +        this.formData.rulePointList = this.tableData == null ? [] : this.tableData;
 | 
	
		
			
				|  |  |          this.formData.roleList = null;
 | 
	
		
			
				|  |  |          // console.log(this.selectedValues,"selectedValues");
 | 
	
		
			
				|  |  |          this.formData.roleIds =
 | 
	
		
			
				|  |  |            this.selectedValues.length == 0 ? null : this.selectedValues;
 | 
	
		
			
				|  |  |          this.formData.buildTaskNow = this.formData.buildTaskNow ? 1 : 0;
 | 
	
		
			
				|  |  | -        if (this.id == undefined) {
 | 
	
		
			
				|  |  | -          await api.add(this.formData);
 | 
	
		
			
				|  |  | -        } else {
 | 
	
		
			
				|  |  | -          await api.update(this.formData);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        // if (this.id == undefined) {
 | 
	
		
			
				|  |  | +        await api.add(this.formData);
 | 
	
		
			
				|  |  | +        // } else {
 | 
	
		
			
				|  |  | +        // await api.update(this.formData);
 | 
	
		
			
				|  |  | +        // }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          this.$emit("success");
 | 
	
		
			
				|  |  |          this.onHide();
 | 
	
	
		
			
				|  | @@ -492,7 +523,7 @@ export default {
 | 
	
		
			
				|  |  |      //apimark//
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {},
 | 
	
		
			
				|  |  | -  components: { DialogSelect, orgDropDown,OrgTree,korgTree },
 | 
	
		
			
				|  |  | +  components: { DialogSelect, orgDropDown, OrgTree, korgTree, OrgTreeSelect },
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 |