guoshilong
2022-11-23 998b75f0d4aaed03001ec4246cd4f3b4b0743b7e
src/views/taskinfo/taskplanUser.vue
@@ -16,12 +16,13 @@
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
               >
      <template slot="menuLeft">
        <el-button
          size="small"
          icon="el-icon-back"
          plain
          type="success"
          @click="handleBack">返 回
        </el-button>
        <el-button type="primary"
@@ -43,6 +44,7 @@
  import {getList, getDetail, add, update, remove} from "@/api/taskinfo/taskplanUser";
  import option from "@/const/taskinfo/taskplanUser";
  import {mapGetters} from "vuex";
  import {getUserList} from "@/api/system/user";
  export default {
    name: "taskplanUser",
@@ -58,7 +60,8 @@
        },
        selectionList: [],
        option: option,
        data: []
        data: [],
        planId:"",
      };
    },
    computed: {
@@ -84,6 +87,7 @@
    },
    methods: {
      rowSave(row, done, loading) {
        row['planId'] = this.planId
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
@@ -157,6 +161,7 @@
            this.form = res.data.data;
          });
        }
        this.getUserList();
        done();
      },
      searchReset() {
@@ -186,6 +191,10 @@
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        if (params.planId){
          this.planId = params.planId
        }
        Object.assign(params,{planId:this.planId})
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
@@ -194,6 +203,21 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      getUserList(){
        getUserList().then(res=>{
          var data = res.data.data;
          var dicData = [];
          var userColumn = this.findObject(this.option.column,"userId");
          if (this.data.length>0){
            dicData = data.filter((chose) => {
              return !this.data.some(ele=>ele.userId ==chose.id)
            })
          }else {
            dicData = data
          }
          userColumn.dicData = dicData
        })
      }
    }
  };