luojun 2 жил өмнө
parent
commit
f4653f0e67

+ 129 - 0
src/views/resumption/plan/distribute.vue

@@ -0,0 +1,129 @@
+<template>
+    <el-dialog
+      title="选择下发机构"
+      :visible.sync="isShow"
+      class="g-dialog-select-safe-check"
+      :close-on-click-modal="false"
+      width="55%"
+      top="10vh"
+      append-to-body
+    >
+      <div class="el-dialog-div">
+        <g-search-table
+          ref="st"
+          url="/core/resumption/ruleItem/pointSelectionPage"
+          method="get"
+          :search-data="search"
+          :manual="true"
+          :pageable="true"
+          :select="true"
+          :select-default="selectList"
+          :drag="false"
+          @select="onSelect"
+        >
+          <!-- 搜索 -->
+          <template slot="searchs">
+            <el-form-item prop="ruleId" label="履职内容库">
+              <el-select v-model="search.ruleId">
+                <el-option
+                  v-for="item in ruleList"
+                  :value="item.id"
+                  :key="item.id"
+                  :label="item.name"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item prop="key" label="关键字">
+              <el-input v-model="search.key"></el-input>
+            </el-form-item>
+          </template>
+  
+          <!-- 表格 -->
+          <template slot="columns">
+            <el-table-column
+              prop="itemName"
+              label="履职项"
+             min-width="40%"
+            ></el-table-column>
+            <el-table-column label="履职内容" prop="pointName" min-width="40%"> </el-table-column>
+            <el-table-column
+              prop="areaName"
+              label="履职区域"
+              min-width="20%"
+            ></el-table-column>
+            <!--          <el-table-column prop="nfcName"
+                             label="采集点"
+                             width="120"></el-table-column>-->
+          </template>
+        </g-search-table>
+      </div>
+  
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onHide">关闭</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </el-dialog>
+  </template>
+  <script>
+  import GSearchTable from "@/components/table/gx.search.table.vue";
+  import { ruleListForOrg } from "@/api/resumption/rule.js";
+  export default {
+    components: { GSearchTable },
+    data() {
+      return {
+        isShow: false,
+        selectList: [],
+        ruleList: [],
+        search: this.emptySearch(),
+      };
+    },
+    computed: {},
+    watch: {},
+    props: {
+      defaultSelect:{
+        type:Array
+      },
+      orgType:{
+        type:String
+      }
+    },
+    methods: {
+      show() {
+        this.search = this.emptySearch();
+        this.isShow = true;
+        this.selectList =this.defaultSelect; 
+        ruleListForOrg({ orgType: this.orgType }).then((r) => {
+          this.ruleList = r.data;
+          if (r.data && r.data.length > 0) {
+            this.search.ruleId = r.data[0].id;
+            // this.$refs.st.search();
+          }
+        });
+      },
+      onHide() {
+        this.isShow = false;
+      },
+      onSelect(item) {      
+        this.selectList = item;
+      },
+      onSubmit() {
+        let s=this.selectList
+        this.$emit("select", this.selectList);
+        this.onHide();
+      },
+      emptySearch() {
+        return {
+          ruleId: null,
+          itemName: null,
+        };
+      },
+    },
+    mounted() {},
+  };
+  </script>
+  <style lang="scss" scoped>
+  .el-dialog-div {
+    overflow: auto;
+  }
+  </style>
+  

+ 79 - 53
src/views/resumption/plan/index.vue

@@ -21,7 +21,7 @@
           v-show="showSearch"
           label-width="100px"
         >
-        <el-form-item prop="planType" label="计划类型">
+          <el-form-item prop="planType" label="计划类型">
             <el-select
               prop="planType"
               label="计划类型"
@@ -39,12 +39,11 @@
           </el-form-item>
           <el-form-item prop="resumptionRole" label="履职角色">
             <el-select
-            @visible-change="getRolesByOrg"
+              @visible-change="getRolesByOrg"
               prop="resumptionRole"
               label="履职角色"
               v-model="queryParams.resumptionRole"
               placeholder="请选择履职角色"
-             
               clearable
             >
               <el-option
@@ -92,13 +91,12 @@
           </el-form-item>
           <el-form-item prop="planName" label="计划名称">
             <el-input
-                  v-model="queryParams.planName"
-                  :maxlength="50"
-                  name="planName"
-                  placeholder="请输入"
-                  clearable
-                />
-             
+              v-model="queryParams.planName"
+              :maxlength="50"
+              name="planName"
+              placeholder="请输入"
+              clearable
+            />
           </el-form-item>
           <el-form-item>
             <el-button
@@ -168,7 +166,7 @@
             type="index"
             label="序号"
             v-if="columns[0].visible"
-            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+            :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
           ></el-table-column>
           <el-table-column
             prop="planName"
@@ -181,7 +179,9 @@
             v-if="columns[2].visible"
           >
             <template slot-scope="r"
-              >{{ getLabel(dict.type.resumption_plan_type, `${r.row.planType}`) }}
+              >{{
+                getLabel(dict.type.resumption_plan_type, `${r.row.planType}`)
+              }}
             </template>
           </el-table-column>
           <el-table-column
@@ -198,16 +198,16 @@
             label="计划所属机构"
             v-if="columns[4].visible"
           ></el-table-column>
-        
+
           <el-table-column
             prop="execOrgType"
             label="履职机构类型"
             v-if="columns[6].visible"
           >
-          <template slot-scope="r"
+            <template slot-scope="r"
               >{{ getLabel(dict.type.sys_org_type, `${r.row.execOrgType}`) }}
             </template>
-        </el-table-column>
+          </el-table-column>
 
           <el-table-column
             prop="roleNames"
@@ -219,12 +219,12 @@
             label="履职周期"
             v-if="columns[6].visible"
           >
-        
-          <template slot-scope="r"
-              >{{ getLabel(dict.type.resumption_plan_cycle, `${r.row.planCycle}`) }}
+            <template slot-scope="r"
+              >{{
+                getLabel(dict.type.resumption_plan_cycle, `${r.row.planCycle}`)
+              }}
             </template>
-        </el-table-column>
-
+          </el-table-column>
 
           <el-table-column
             prop="count"
@@ -237,12 +237,12 @@
             label="履职时间"
             v-if="columns[6].visible"
           >
-          <template slot-scope="r"
-              >{{ getLabel(dict.type.resumption_plan_exec, `${r.row.planExec}`) }}
+            <template slot-scope="r"
+              >{{
+                getLabel(dict.type.resumption_plan_exec, `${r.row.planExec}`)
+              }}
             </template>
-        
-        </el-table-column>
-
+          </el-table-column>
 
           <el-table-column
             prop="modifiedName"
@@ -250,19 +250,20 @@
             v-if="columns[6].visible"
           ></el-table-column>
 
-
           <el-table-column
             prop="planStatus"
             label="计划状态"
             v-if="columns[6].visible"
           >
-        
-          <template slot-scope="r"
-              >{{ getLabel(dict.type.resumption_plan_status, `${r.row.planStatus}`) }}
+            <template slot-scope="r"
+              >{{
+                getLabel(
+                  dict.type.resumption_plan_status,
+                  `${r.row.planStatus}`
+                )
+              }}
             </template>
-        
-        
-        </el-table-column>
+          </el-table-column>
 
           <el-table-column label="操作">
             <template slot-scope="r">
@@ -272,14 +273,23 @@
                 icon="el-icon-edit"
                 @click="onEdit(r.row.id)"
                 v-hasPermi="['system:user:edit']"
-              >修改</el-button>
+                >修改</el-button
+              >
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="onDel(r.row.id, r.row.planName)"
+                v-hasPermi="['system:user:remove']"
+                >删除</el-button
+              >
               <el-button
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
-                @click="onDel(r.row.id,r.row.planName)"
+                @click="showDialogDistribute(r.row.id)"
                 v-hasPermi="['system:user:remove']"
-              >删除</el-button>              
+                >下发</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -299,22 +309,32 @@
       :orgTypeOptions="dict.type.sys_org_type"
       :ruleTypeOptions="dict.type.rule_type"
     ></dialog-edit>
+    <DialogDistribute ref="dialogDistribute"></DialogDistribute>
   </div>
 </template>
 
 <script>
+import DialogDistribute from "@/views/resumption/plan/distribute.vue";
 import OrgTree from "@/components/orgTree";
 import { mapState, mapMutations } from "vuex";
 import DialogEdit from "./dialog.edit";
 import * as api from "@/api/resumption/plan";
 import { statusOptions, getLabel } from "./../../commonOption";
-import {listRole} from "@/api/system/role"
+import { listRole } from "@/api/system/role";
 export default {
   name: "resumptionplan",
-  dicts: ["sys_org_type", "rule_type","resumption_plan_type","resumption_plan_cycle","resumption_plan_status","resumption_plan_exec"],
+  dicts: [
+    "sys_org_type",
+    "rule_type",
+    "resumption_plan_type",
+    "resumption_plan_cycle",
+    "resumption_plan_status",
+    "resumption_plan_exec",
+  ],
   components: {
     DialogEdit,
     OrgTree,
+    DialogDistribute,
   },
   data() {
     const { params, query } = this.$route;
@@ -328,7 +348,7 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      resumptionRoles:[],
+      resumptionRoles: [],
       total: 0,
       queryParams: {
         orgId: null,
@@ -337,8 +357,8 @@ export default {
         planCycle: null,
         planStatus: null,
         planName: null,
-        pageNum:1,
-        pageSize:10,
+        pageNum: 1,
+        pageSize: 10,
         ...query,
       },
       pageData: [],
@@ -367,15 +387,14 @@ export default {
   methods: {
     ...mapMutations([]),
 
-    getRolesByOrg(){
+    getRolesByOrg() {
       let params = {
         // orgId:this.queryParams.orgId
-      }
-      listRole(params).then(res=>{
+      };
+      listRole(params).then((res) => {
         // console.info(res);
-        this.resumptionRoles = res.rows
-      })
-
+        this.resumptionRoles = res.rows;
+      });
     },
     getList() {
       this.loading = true;
@@ -401,13 +420,20 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    async onDel(id,name) {
-      this.$modal.confirm('是否确认删除名称为"' + name + '"的数据项?').then(function() {
-        return  api.delelte(id);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+    showDialogDistribute(id, other = {}){
+      this.$refs.dialogDistribute.show(id, other);
+    },
+    async onDel(id, name) {
+      this.$modal
+        .confirm('是否确认删除名称为"' + name + '"的数据项?')
+        .then(function () {
+          return api.delelte(id);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
       // await api.delelte(id);
       // this.getList();
     },