Browse Source

调阅计划联调

luowei 2 years ago
parent
commit
8180bb30ff
2 changed files with 42 additions and 13 deletions
  1. 7 0
      src/api/system/plan.js
  2. 35 13
      src/views/system/plan/index.vue

+ 7 - 0
src/api/system/plan.js

@@ -17,6 +17,13 @@ export function getPlan(id) {
   })
 }
 
+// 下发
+export function distribute(id) {
+  return request({
+    url: '/system/plan/distribute/' + id,
+    method: 'get'
+  })
+}
 // 新增监控调阅计划
 export function addPlan(data) {
   return request({

+ 35 - 13
src/views/system/plan/index.vue

@@ -4,14 +4,14 @@
 
       <el-form-item label="机构类型" prop="orgType">
         <el-select style="width: 100%;" v-model="queryParams.orgType" placeholder="请选择">
-          <el-option v-for="dict in dict.type.org_type_number" :key="dict.value" :label="dict.label"
+          <el-option v-for="dict in dict.type.sys_org_type" :key="dict.value" :label="dict.label"
             :value="`${dict.value}`"></el-option>
         </el-select>
       </el-form-item>
 
 
       <el-form-item label="调阅角色" prop="roleId">
-        <el-select v-model="queryParams.hostId" placeholder="请选择">
+        <el-select v-model="queryParams.roleId" placeholder="请选择">
           <el-option v-for="item in roleList" :key="item.id" :label="item.roleName" :value="item.id"></el-option>
         </el-select>
       </el-form-item>
@@ -42,9 +42,9 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
-          v-hasPermi="['system:plan:add']">新增</el-button>
+          v-hasPermi="['system:plan:add']">新增计划</el-button>
       </el-col>
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
           v-hasPermi="['system:plan:edit']">修改</el-button>
       </el-col>
@@ -55,7 +55,7 @@
       <el-col :span="1.5">
         <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
           v-hasPermi="['system:plan:export']">导出</el-button>
-      </el-col>
+      </el-col> -->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -63,9 +63,19 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="计划所属机构" align="center" prop="orgName" />
       <el-table-column label="计划名称" align="center" prop="planName" />
-      <el-table-column label="机构类型" align="center" prop="orgType" />
+  
+      <el-table-column label="机构类型" align="center" key="orgType" prop="orgType"  width="80">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.sys_org_type" :value="scope.row.orgType" />
+            </template>
+          </el-table-column>
       <el-table-column label="调阅角色" align="center" prop="roleName" />
-      <el-table-column label="调阅周期" align="center" prop="planCycle" />
+   
+      <el-table-column label="调阅周期" align="center" key="planCycle" prop="planCycle"  width="80">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.sys_access_cycle" :value="scope.row.planCycle" />
+            </template>
+          </el-table-column>
       <el-table-column label="调阅频次" align="center" prop="planFrequency" />
     
       <el-table-column label="计划状态" align="center" key="planStatus" prop="planStatus"  width="80">
@@ -80,8 +90,8 @@
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
             v-hasPermi="['system:plan:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-hasPermi="['system:plan:remove']">删除</el-button>
+          <el-button size="mini" type="text" icon="el-icon-add" @click="handDistribute(scope.row)"
+            v-hasPermi="['system:plan:add']">下发</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -98,7 +108,7 @@
        
         <el-form-item label="调阅机构类型" prop="orgType">
         <el-select style="width: 100%;" v-model="form.orgType" placeholder="请选择">
-          <el-option v-for="dict in dict.type.org_type_number" :key="dict.value" :label="dict.label"
+          <el-option v-for="dict in dict.type.sys_org_type" :key="dict.value" :label="dict.label"
             :value="`${dict.value}`"></el-option>
         </el-select>
       </el-form-item>
@@ -129,17 +139,18 @@
 </template>
 
 <script>
-import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/system/plan";
+import { listPlan, getPlan, delPlan, addPlan, updatePlan,distribute } from "@/api/system/plan";
 import { listRole } from "@/api/system/role";
 export default {
   name: "Plan",
-  dicts: ['org_type_number','sys_access_cycle','sys_normal_disable'],
+  dicts: ['sys_org_type','sys_access_cycle','sys_normal_disable'],
   data() {
     return {
       // 遮罩层
       loading: true,
       // 选中数组
       ids: [],
+      names:[],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -236,6 +247,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.names=selection.map(item => item.planName)
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
@@ -278,13 +290,23 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除监控调阅计划编号为"' + ids + '"的数据项?').then(function () {
+      const names=row.planName || this.names;
+      this.$modal.confirm('是否确认删除监控调阅计划"' + names + '"的数据项?').then(function () {
         return delPlan(ids);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => { });
     },
+    handDistribute(row){
+      this.$modal.confirm('是否确认下发监控调阅计划"' + row.planName + '"的数据项?').then(function () {
+        return distribute(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("下发成功");
+      }).catch(() => { });
+
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download('system/plan/export', {