Quellcode durchsuchen

计划下发时,选择机构

jiawuxian vor 2 Jahren
Ursprung
Commit
ade69fed99

+ 1 - 0
.env.development

@@ -13,6 +13,7 @@ ENV = 'development'
 VUE_APP_BASE_API = 'http://10.87.10.47:8080'
 #高雄
 #VUE_APP_BASE_API = 'http://10.87.11.94:8080'
+VUE_APP_BASE_API = 'http://localhost:8080'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 

+ 9 - 0
src/api/system/org.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function listByTypes (args){  
+    return request({
+      url: '/system/dept/findListByOrgTypes',
+      method: 'post',
+      data: args
+    })
+  }

+ 89 - 123
src/views/resumption/plan/distribute.vue

@@ -1,129 +1,95 @@
 <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>
+  <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">
+      <el-table :data="info.orgAndStatus" height="400px">
+        <el-table-column type="index" label="序号" width="80"></el-table-column>
+        <el-table-column prop="orgName" label="机构名称"></el-table-column>
+        <el-table-column prop="status" label="计划状态">
+          <template slot-scope="r">
+            <el-switch
+              v-model="r.row.status"
+              active-text="启用"
+              inactive-text="禁用"
+              active-value="1"
+              inactive-value="0"
+              active-color="#008CD6"
+              inactive-color="#ff4949"
+            >
+            </el-switch>
           </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(),
-      };
+        </el-table-column>
+      </el-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 { listByTypes } from "@/api/system/org.js";
+
+export default {
+  components: {  },
+  data() {
+    return {
+      isShow: false,
+      info: this.emptyInfo(),
+    };
+  },
+  computed: {},
+  watch: {},
+  props: {
+    defaultSelect: {
+      type: Array,
     },
-    computed: {},
-    watch: {},
-    props: {
-      defaultSelect:{
-        type:Array
-      },
-      orgType:{
-        type:String
-      }
+    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();
-          }
+  },
+  methods: {
+    show(plan) {
+      this.isShow = true;
+      this.info.id = plan.id;
+      listByTypes({
+        orgId: plan.planCreateOrgId,
+        orgTypes: ["2", "3", "4"],
+      }).then((r) => {
+        this.info.orgAndStatus = r.data.map((d) => {
+          return { orgId: d.id, orgName: d.name, status: "1" };
         });
-      },
-      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,
-        };
-      },
+      });
+    },
+    onHide() {
+      this.info=this.emptyInfo();
+      this.isShow = false;
+    },
+    onSubmit() {
+      console.info(this.info)
+      this.$emit("select", this.info);
+      this.onHide();
+    },
+    emptyInfo() {
+      return {
+        id: null, //计划id
+        orgAndStatus: [], //机构及状态
+      };
     },
-    mounted() {},
-  };
-  </script>
-  <style lang="scss" scoped>
-  .el-dialog-div {
-    overflow: auto;
-  }
-  </style>
-  
+  },
+  mounted() {},
+};
+</script>
+<style lang="scss" scoped>
+.el-dialog-div {
+  overflow: auto;
+}
+</style>

+ 3 - 3
src/views/resumption/plan/index.vue

@@ -287,7 +287,7 @@
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
-                @click="showDialogDistribute(r.row.id)"
+                @click="showDialogDistribute(r.row)"
                 v-hasPermi="['system:user:remove']"
                 >下发</el-button>
             </template>
@@ -420,8 +420,8 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    showDialogDistribute(id, other = {}){
-      this.$refs.dialogDistribute.show(id, other);
+    showDialogDistribute(row){
+      this.$refs.dialogDistribute.show(row);
     },
     async onDel(id, name) {
       this.$modal