Procházet zdrojové kódy

履职内容库增加点位ID

jiawuxian před 2 roky
rodič
revize
b0ddd222c0

+ 6 - 0
src/api/system/check.js

@@ -64,3 +64,9 @@ export function delCheck(id) {
   })
 }
 
+export function allCheckByOrgType(orgType){
+  return request({
+    url: '/system/check/orgtype/' + orgType,
+    method: 'get'
+  })
+}

+ 2 - 0
src/views/resumption/ruleManager/dialog.editItem.vue

@@ -23,6 +23,8 @@
             <el-table-column prop="name" label="履职内容"> </el-table-column>
             <el-table-column prop="areaName" label="履职区域">
             </el-table-column>
+            <el-table-column prop="checkName" label="履职点位">
+            </el-table-column>
             <el-table-column label="操作" width="140">
               <template slot-scope="scope">
                 <el-button type="text" size="small" @click="onEdit(scope.$index, scope.row)">编辑</el-button>

+ 45 - 62
src/views/resumption/ruleManager/dialog.editPoint.vue

@@ -1,25 +1,12 @@
 <template>
   <div class="rule-type">
-    <DialogCom
-      width="600px"
-      :title="index >= 0 ? '编辑履职内容' : '新增履职内容'"
-      :visible.sync="dataVisible"
-      :show-close="false"
-      @close="
-        () => {
+    <DialogCom width="600px" :title="index >= 0 ? '编辑履职内容' : '新增履职内容'" :visible.sync="dataVisible" :show-close="false"
+      @close="() => {
           this.$refs.form.resetFields();
         }
-      "
-      append-to-body
-    >
+        " append-to-body>
       <div>
-        <el-form
-          ref="form"
-          :model="formData"
-          :rules="formDataRules"
-          label-width="110px"
-          class="formbox"
-        >
+        <el-form ref="form" :model="formData" :rules="formDataRules" label-width="110px" class="formbox">
           <!-- <el-form-item label="检查要点编号" prop="pointNum">
             <el-input
               v-model="formData.pointNum"
@@ -30,52 +17,30 @@
             ></el-input>
           </el-form-item> -->
           <el-form-item label="履职内容" prop="name">
-            <el-input
-              v-model.trim="formData.name"
-              placeholder="请输入履职内容"
-              maxlength="255"
-            ></el-input>
+            <el-input v-model.trim="formData.name" placeholder="请输入履职内容" maxlength="255"></el-input>
           </el-form-item>
           <el-form-item label="履职区域" prop="areaId">
-            <el-select
-              style="width: 100%;"
-              v-model="formData.areaId"
-              placeholder="请选择履职区域"
-              @change="onAreaChanged"
-              clearable
-            >
-              <el-option
-                v-for="item in areas"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
+            <el-select style="width: 100%;" v-model="formData.areaId" placeholder="请选择履职区域" @change="onAreaChanged"
+              clearable>
+              <el-option v-for="item in areas" :key="item.id" :label="item.name" :value="item.id"></el-option>
+            </el-select>            
+          </el-form-item>
+          <el-form-item label="履职点位" prop="checkId">
+            <el-select style="width: 100%;" v-model="formData.checkId" placeholder="请选择履职点位" @change="onCheckChanged"
+              clearable>
+              <el-option v-for="item in checks" :key="item.id" :label="item.name" :value="item.id"></el-option>
             </el-select>
+            <span style="color:rgb(184,189,192)"><i class="el-icon-info"></i>履职区域、履职点位至少选择一个</span>
           </el-form-item>
           <el-form-item label="数据来源" prop="businessType">
-            <el-select
-              style="width: 100%;"
-              v-model="formData.businessType"
-              placeholder="请选择数据来源"
-              clearable
-            >
-              <el-option
-                v-for="item in pointDataSource"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              ></el-option>
+            <el-select style="width: 100%;" v-model="formData.businessType" placeholder="请选择数据来源" clearable>
+              <el-option v-for="item in pointDataSource" :key="item.value" :label="item.label"
+                :value="item.value"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="备注" prop="remark">
-            <el-input
-              type="textarea"
-              v-model="formData.remark"
-              placeholder="请输入备注"
-              maxlength="255"
-              :rows="3"
-              clearable
-            ></el-input>
+            <el-input type="textarea" v-model="formData.remark" placeholder="请输入备注" maxlength="255" :rows="3"
+              clearable></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -92,6 +57,7 @@
 <script>
 import { mapState, mapMutations } from "vuex";
 import { allAreaByOrgtype } from "@/api/system/area";
+import { allCheckByOrgType } from "@/api/system/check";
 export default {
   data() {
     return {
@@ -100,10 +66,11 @@ export default {
       formData: this.reset(),
       formDataRules: {
         name: [{ required: true, message: "请输入履职内容" }],
-        areaId: [{ required: true, message: "请选择履职区域" }],
+        // areaId: [{ required: true, message: "请选择履职区域" }],
       },
       currentOrgType: null,
       areas: [],
+      checks:[]
     };
   },
   props: {
@@ -127,6 +94,8 @@ export default {
         name: null,
         areaId: null,
         areaName: null,
+        checkId:null,
+        checkName:null,
         businessType: null,
         remark: null,
       };
@@ -140,18 +109,26 @@ export default {
         this.formData = this.reset();
       }
 
-      // if (this.currentOrgType != this.rule.orgType) {
-      allAreaByOrgtype(this.rule.orgType).then((d) => {
+      if (this.currentOrgType != this.rule.orgType) {
         this.currentOrgType = this.rule.orgType;
-        this.areas = d.data;
-      });
-      // }
+        allAreaByOrgtype(this.rule.orgType).then((d) => {         
+          this.areas = d.data;
+        });
+
+        allCheckByOrgType(this.rule.orgType).then((d) => {
+          this.checks = d.data;
+        });
+      }
 
       this.dataVisible = true;
     },
     onSubmit() {
       this.$refs.form.validate((isValidate) => {
         if (!isValidate) return;
+        if(!this.formData.checkId && !this.formData.areaId){
+          this.$message.warning("履职区域、履职点位至少选择一个");
+          return;
+        }
         let obj = {};
         obj = { ...this.formData };
         if (obj.businessType == "") {
@@ -172,8 +149,14 @@ export default {
         this.formData.areaName = area.name;
       }
     },
+    onCheckChanged(val) {
+      let check = this.checks.find((a) => a.id === val);
+      if (check) {
+        this.formData.checkName = check.name;
+      }
+    },
   },
-  mounted() {},
+  mounted() { },
   components: {},
 };
 </script>

+ 33 - 135
src/views/resumption/ruleManager/index.vue

@@ -2,85 +2,38 @@
   <div class="app-container">
     <el-row :gutter="20">
       <el-col :span="4" :xs="24">
-        <org-tree
-          v-model="queryParams.orgId"
-          @click="clicktreenode"
-          :customRequest="treeData"
-          searchPlaceHolder="输入关键字进行过滤"
-          :expand-on-click-node="true"
-          node-key="id"
-          :default-expanded-keys="topItemKeys"
-          accordion
-          :defaultProps="defaultProps"
-          :showLowerCheck="false"
-          :renderContent="renderContent"
-        >
+        <org-tree v-model="queryParams.orgId" @click="clicktreenode" :customRequest="treeData"
+          searchPlaceHolder="输入关键字进行过滤" :expand-on-click-node="true" node-key="id" :default-expanded-keys="topItemKeys"
+          accordion :defaultProps="defaultProps" :showLowerCheck="false" :renderContent="renderContent">
         </org-tree>
       </el-col>
       <el-col :span="20" :xs="24">
-        <el-form
-          :model="queryParams"
-          ref="search"
-          size="small"
-          :inline="true"
-          v-show="showSearch"
-          label-width="100px"
-        >
+        <el-form :model="queryParams" ref="search" size="small" :inline="true" v-show="showSearch" label-width="100px">
           <el-form-item prop="itemName" label="履职项" class="search_itemname">
-            <el-input
-              v-model="queryParams.itemName"
-              placeholder="请输入履职项"
-              maxlength="50"
-              clearable
-            ></el-input>
+            <el-input v-model="queryParams.itemName" placeholder="请输入履职项" maxlength="50" clearable></el-input>
           </el-form-item>
           <el-form-item prop="pointName" label="履职内容">
-            <el-input
-              v-model="queryParams.pointName"
-              placeholder="请输入履职内容"
-              maxlength="50"
-              clearable
-            ></el-input>
+            <el-input v-model="queryParams.pointName" placeholder="请输入履职内容" maxlength="50" clearable></el-input>
           </el-form-item>
           <el-form-item>
-            <el-button
-              type="primary"
-              icon="el-icon-search"
-              size="mini"
-              @click="refresh"
-              v-hasPermi="['resumption:ruleManager']"
-              >搜索</el-button
-            >
-            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-              >重置</el-button
-            >
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="refresh"
+              v-hasPermi="['resumption:ruleManager']">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
           </el-form-item>
         </el-form>
         <!--    按纽    -->
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
-            <el-button
-              type="primary"
-              size="mini"
-              icon="el-icon-plus"
-              @click="onAddItem()"
-              :disabled="rule ? false : true"
+            <el-button type="primary" size="mini" icon="el-icon-plus" @click="onAddItem()" :disabled="rule ? false : true"
               v-hasPermi="['resumption:ruleManager:add']"
-              v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0"
-              >新增</el-button
-            >
+              v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0">新增</el-button>
             <!-- <el-button
               type="primary"
               @click="onSelect()"
               >选择</el-button
             > -->
-            <el-button
-              type="warning"
-              @click="dakai"
-              size="mini"
-              :disabled="rule ? false : true"
-              >{{ expandAll ? "收起所有行" : "展开所有行" }}</el-button
-            >
+            <el-button type="warning" @click="dakai" size="mini" :disabled="rule ? false : true">{{ expandAll ? "收起所有行" :
+              "展开所有行" }}</el-button>
           </el-col>
           <!-- <el-col :span="1.5">
             <el-button
@@ -107,38 +60,18 @@
             >
           </el-col>-->
 
-          <right-toolbar
-            :showSearch.sync="showSearch"
-            @queryTable="getList"
-            :columns="columns"
-          ></right-toolbar>
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
-        <el-table
-          :data="tableData"
-          border
-          :default-expand-all="expandAll"
-          v-if="fresh"
-          style="width: 100%"
-          v-loading="loading"
-        >
+        <el-table :data="tableData" border :default-expand-all="expandAll" v-if="fresh" style="width: 100%"
+          v-loading="loading">
           <el-table-column type="expand">
             <template slot-scope="props">
-              <el-table
-                :data="props.row.pointDtoList"
-                border
-                style="width: 100%"
-              >
-                <el-table-column
-                  prop="name"
-                  label="履职内容"
-                  v-if="columns[3].visible"
-                >
+              <el-table :data="props.row.pointDtoList" border style="width: 100%">
+                <el-table-column prop="name" label="履职内容" v-if="columns[3].visible">
+                </el-table-column>
+                <el-table-column prop="areaName" label="履职区域" v-if="columns[4].visible">
                 </el-table-column>
-                <el-table-column
-                  prop="areaName"
-                  label="履职区域"
-                  v-if="columns[4].visible"
-                >
+                <el-table-column prop="checkName" label="履职点位">
                 </el-table-column>
                 <!-- <el-table-column prop="dataTypeName" label="数据类型">
                 </el-table-column>
@@ -147,64 +80,29 @@
               </el-table>
             </template>
           </el-table-column>
-          <el-table-column
-            type="index"
-            label="序号"
-            width="80"
-            v-if="columns[0].visible"
-          >
+          <el-table-column type="index" label="序号" width="80" v-if="columns[0].visible">
           </el-table-column>
           <el-table-column prop="name" label="履职项" v-if="columns[1].visible">
           </el-table-column>
           <!-- <el-table-column prop="itemDesc" label="标准及要求">
           </el-table-column> -->
-          <el-table-column
-            prop="pointNums"
-            label="履职内容数量"
-            v-if="columns[2].visible"
-          >
+          <el-table-column prop="pointNums" label="履职内容数量" v-if="columns[2].visible">
           </el-table-column>
-          <el-table-column
-            label="操作"
-            width="140"
-            v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0"
-          >
+          <el-table-column label="操作" width="140" v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0">
             <template slot-scope="scope">
-              <el-button
-                type="text"
-                size="small"
-                icon="el-icon-edit-outline"
-                @click="onEditItem(scope.row.id)"
-                v-hasPermi="['resumption:ruleManager:edit']"
-                >编辑</el-button
-              >
-              <el-button
-                type="text"
-                size="small"
-                slot="reference"
-                icon="el-icon-delete"
-                @click="deldata(scope.row.id)"
-                v-hasPermi="['resumption:ruleManager:remove']"
-                >删除</el-button
-              >
+              <el-button type="text" size="small" icon="el-icon-edit-outline" @click="onEditItem(scope.row.id)"
+                v-hasPermi="['resumption:ruleManager:edit']">编辑</el-button>
+              <el-button type="text" size="small" slot="reference" icon="el-icon-delete" @click="deldata(scope.row.id)"
+                v-hasPermi="['resumption:ruleManager:remove']">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
-        <pagination
-          v-show="total > 0"
-          :total="total"
-          :page.sync="queryParams.pageNum"
-          :limit.sync="queryParams.pageSize"
-          @pagination="getList"
-        />
+        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+          @pagination="getList" />
       </el-col>
     </el-row>
-    <dialog-edit
-      ref="dialogEdit"
-      :rule="rule"
-      :pointDataSource="dict.type.point_data_source"
-      @success="onSuccess"
-    ></dialog-edit>
+    <dialog-edit ref="dialogEdit" :rule="rule" :pointDataSource="dict.type.point_data_source"
+      @success="onSuccess"></dialog-edit>
   </div>
 </template>
 
@@ -284,7 +182,7 @@ export default {
     // await this.getassetlist();
   },
 
-  mounted() {},
+  mounted() { },
 
   methods: {
     treeData,