Browse Source

预案演练新增本网点预案

xujie 1 year ago
parent
commit
f50f6ba66a

+ 15 - 2
src/views/core/drill/task/dialog.newtask.vue

@@ -62,6 +62,7 @@
               <el-form-item prop="presetCase" label="预设案由">
                 <div style="display: flex;justify-content: flex-end; margin-bottom: 10px">
                   <el-button type="primary" @click="selectMaterials">参考演练范本库</el-button>
+                  <el-button type="primary" @click="rehearsalBranchHandler">本网点预案</el-button>
                 </div>
                 <k-textarea v-model="formData.presetCase" :row="10" placeholder="请输入预设案由" :length="2000"/>
               </el-form-item>
@@ -122,6 +123,13 @@
       @select="drillDictionarySelect"
       :orgId="this.$store.getters.orgId">
     </dialog-drill-dictionary-select>
+
+    <dialog-drill-dictionary-branch-select
+      ref="DialogDrillDictionaryBranchSelect"
+      :defaultSelect=defaultSelect
+      @select="drillDictionarySelect"
+      :orgId="this.$store.getters.orgId">
+    </dialog-drill-dictionary-branch-select>
   </div>
 </template>
 
@@ -134,8 +142,9 @@ import KSelect from "@/components/common/userselect.vue";
 import imgUpload from "@/components/ImageUpload/index.vue";
 import KFileUpload from "@/components/K-FileUpload/index.vue";
 import DialogDrillDictionarySelect from "@/views/core/drill/task/dialog.select.drillDictionary.vue";
+import DialogDrillDictionaryBranchSelect from "@/views/core/drill/task/dialog.select.drillDictionary.branch.vue";
 export default {
-  components: {KTextarea, KSelect, imgUpload,KFileUpload,DialogDrillDictionarySelect},
+  components: {KTextarea, KSelect, imgUpload,KFileUpload,DialogDrillDictionarySelect,DialogDrillDictionaryBranchSelect},
   data() {
     const params = this.$route.params;
     return {
@@ -418,6 +427,10 @@ export default {
       console.log("selectMaterials",this.formData)
       this.$refs["DialogDrillDictionarySelect"].show(this.formData.type);
     },
+    rehearsalBranchHandler() {
+      console.log("selectMaterials",this.formData)
+      this.$refs["DialogDrillDictionaryBranchSelect"].show(this.formData.type);
+    },
     drillDictionarySelect(data){
       // console.log("selectMaterials",this.formData)
       /*if(this.formData.type==null)
@@ -440,6 +453,6 @@ export default {
     .el-textarea__inner  {
       font-size: 15px !important;
     }
-  } 
+  }
 }
 </style> -->

+ 14 - 1
src/views/core/drill/task/dialog.perform.vue

@@ -65,6 +65,7 @@
               <el-form-item prop="presetCase" label="预设案由">
                 <div style="display: flex;justify-content: flex-end; margin-bottom: 10px">
                   <el-button type="primary" @click="selectMaterials">参考演练范本库</el-button>
+                  <el-button type="primary" @click="rehearsalBranchHandler">本网点预案</el-button>
                 </div>
                 <k-textarea v-model="formData.presetCase" :row="10" placeholder="请输入预设案由" :length="2000"/>
               </el-form-item>
@@ -127,6 +128,13 @@
       @select="drillDictionarySelect"
       :orgId="this.$store.getters.orgId"
     ></dialog-drill-dictionary-select>
+
+    <dialog-drill-dictionary-branch-select
+      ref="DialogDrillDictionaryBranchSelect"
+      :defaultSelect=defaultSelect
+      @select="drillDictionarySelect"
+      :orgId="this.$store.getters.orgId">
+    </dialog-drill-dictionary-branch-select>
   </div>
 </template>
 
@@ -139,9 +147,10 @@ import KSelect from "@/components/common/userselect.vue";
 import imgUpload from "@/components/ImageUpload/index.vue";
 import KFileUpload from "@/components/K-FileUpload/index.vue";
 import DialogDrillDictionarySelect from "@/views/core/drill/task/dialog.select.drillDictionary.vue";
+import DialogDrillDictionaryBranchSelect from "@/views/core/drill/task/dialog.select.drillDictionary.branch.vue";
 
 export default {
-  components: {KTextarea, KSelect, imgUpload, KFileUpload, DialogDrillDictionarySelect},
+  components: {KTextarea, KSelect, imgUpload, KFileUpload, DialogDrillDictionarySelect,DialogDrillDictionaryBranchSelect},
   dicts: ['core_drill_type'],
   data() {
     const params = this.$route.params;
@@ -407,6 +416,10 @@ export default {
       console.log("selectMaterials", this.formData)
       this.$refs["DialogDrillDictionarySelect"].show(this.formData.type);
     },
+    rehearsalBranchHandler() {
+      console.log("selectMaterials",this.formData)
+      this.$refs["DialogDrillDictionaryBranchSelect"].show(this.formData.type);
+    },
     drillDictionarySelect(data) {
       // console.log("drillDictionarySelect",data);
       /*if(this.formData.type==null)

+ 177 - 0
src/views/core/drill/task/dialog.select.drillDictionary.branch.vue

@@ -0,0 +1,177 @@
+<template>
+  <DialogCom
+    title="选取演练范本"
+    :visible.sync="isShow"
+    class="g-dialog-select-safe-check"
+    :close-on-click-modal="false"
+    width="75%"
+    top="10vh"
+    append-to-body
+  >
+    <div class="el-dialog-div" style="margin-bottom:20px">
+      <g-search-table
+        ref="st"
+        url="/core/drillDictionaryBranch/list"
+        method="GET"
+        type="multiple"
+        :search-data="search"
+        :pageable="true"
+        :select="true"
+        :selectLimit="1"
+        :select-default="selectList"
+        :drag="false"
+        @select="onSelect"
+      >
+        <!-- 搜索 -->
+        <template slot="searchs">
+          <el-form-item label="演练场景" prop="drillProjects">
+            <el-input
+              v-model="search.drillProjects"
+              placeholder="请输入关键字"
+              clearable
+            />
+          </el-form-item>
+          <!-- <el-form-item prop="title" label="编号">
+            <el-input v-model="search.id" placeholder="请输入编号"></el-input>
+          </el-form-item> -->
+                    <el-form-item label="演练项目" prop="drillType">
+                      <el-select v-model="search.drillType" placeholder="请选择演练项目" clearable>
+                        <el-option
+                          v-for="dict in dict.type.core_drill_type"
+                          :key="dict.value"
+                          :label="dict.label"
+                          :value="dict.value"
+                        />
+                      </el-select>
+                    </el-form-item>
+          <!--         <el-form-item label="演练项目" prop="drillCategory">
+                     <el-select v-model="search.drillCategory" placeholder="请选择演练项目" clearable>
+                       <el-option
+                         v-for="dict in dict.type.core_drill_category"
+                         :key="dict.value"
+                         :label="dict.label"
+                         :value="dict.value"
+                       />
+                     </el-select>
+                   </el-form-item>-->
+        </template>
+
+        <!-- 表格 -->
+        <template slot="columns">
+          <!-- <el-table-column label="编号" align="center" prop="id"/> -->
+          <el-table-column prop="orgName" align="center" label="机构名称" width="180"></el-table-column>
+          <el-table-column label="演练项目" align="center" width="180" prop="drillType">
+            <template slot-scope="scope">
+              <dict-tag :options="dict.type.core_drill_type" :value="scope.row.drillType"/>
+            </template>
+          </el-table-column>
+          <!--     <el-table-column label="演练类型" scoped-slot="drillCategory" align="center" prop="drillCategory">
+                 <template slot-scope="scope">
+                   <dict-tag :options="dict.type.core_drill_category" :value="scope.row.drillCategory"/>
+                 </template>
+               </el-table-column>-->
+          <el-table-column label="演练场景"  align="center" width="180" :show-overflow-tooltip="true"
+                           prop="drillProjects">
+            <!-- <template slot-scope="scope">
+              <div class="ellipsis" :title="scope.row.drillProjects">{{ scope.row.drillProjects }}</div>
+            </template> -->
+          </el-table-column>
+          <el-table-column
+            label="预设案由"
+            scoped-slot="defaultCause"
+            align="center"
+            :show-overflow-tooltip="true"
+            prop="defaultCause"
+          >
+          </el-table-column>
+        </template>
+      </g-search-table>
+    </div>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="onSubmit">确定</el-button>
+      <el-button @click="onHide">关闭</el-button>
+    </div>
+  </DialogCom>
+</template>
+<script>
+import GSearchTable from "@/components/table/gx.search.table.vue";
+// import { ruleListForOrg } from "@/api/resumption/rule.js";
+export default {
+  components: {GSearchTable},
+  dicts: ['core_drill_type', 'core_drill_category'],
+  data() {
+    return {
+      isShow: false,
+      selectList: [],
+      // ruleList: [],
+      search: {
+        id: null,
+        drillProjects: null,
+        drillType: null,
+        orgId: this.$store.getters.orgId,
+      },
+    };
+  },
+  computed: {},
+  watch: {
+    orgId(newval) {
+      console.log("orgId", newval);
+      this.search.orgId = newval;
+    },
+  },
+  props: {
+    defaultSelect: {
+      type: Array
+    },
+    orgId: {},
+  },
+  methods: {
+    show(type) {
+      console.log("show", type)
+      this.search = this.emptySearch();
+      if (type) {
+        this.search.drillType = type.toString();
+      }
+      this.isShow = true;
+      this.selectList = this.defaultSelect;
+      console.log("this.selectList", this.selectList)
+      /*if (type){
+        this.search.drillType = parseInt(type);
+        this.onSelect( this.search)
+      }*/
+    },
+    onHide() {
+      this.isShow = false;
+      this.search = this.emptySearch();
+    },
+    onSelect(item) {
+      this.selectList = item;
+    },
+    onSubmit() {
+      let s = this.selectList
+      this.$emit("select", this.selectList);
+      this.onHide();
+    },
+    emptySearch() {
+      return {
+        id: null,
+        drillType: null,
+        orgId: this.$store.getters.orgId,
+      };
+    },
+    getOne(type) {
+
+    },
+
+  },
+  mounted() {
+
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-dialog-div {
+  overflow: auto;
+}
+</style>

+ 10 - 0
src/views/core/drill/task/index.vue

@@ -325,6 +325,7 @@
 
 <script>
 import { listDrillTask, delDrillTask } from "@/api/core/drill/drillTask";
+import { listDrillDictionaryBranch} from "@/api/core/drill/drillDictionaryBranch";
 import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
 import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
 import DialogInfo from "./dialog.info";
@@ -392,6 +393,15 @@ export default {
   created() {
     this.getList();
     this.getTaskStatus();
+    listDrillDictionaryBranch({orgId: this.$store.getters.orgId}).then(res => {
+      let { code, rows, msg } = res
+      if (code == 200) {
+        console.log("res:"+res)
+        if (rows.length === 0){
+          this.$modal.alert("本网点还未编制预案,请及时到网页端网点预案管理菜单维护");
+        }
+      }
+    })
   },
   beforeRouteEnter(to,from,next){
     console.log(from,'to')