| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 | <template>  <div class="app-container">    <el-row :gutter="10">      <!-- <el-col :span="4" :xs="24">        <org-tree          v-model="queryParams.orgId"          @defaultKey="getDefaultKey"          @checkChange="checkChange"          @click="clickTreeNode"        ></org-tree>      </el-col> -->      <el-col :span="24" :xs="24">        <!--用户数据-->        <div class="main-right-box">          <!--    搜索条件    -->          <div class="main-search-box">            <!--    搜索条件    -->            <el-form              :model="queryParams"              ref="queryForm"              size="small"              :inline="true"              v-show="showSearch"            >              <el-form-item label="创建机构">                <org-tree                  v-model="queryParams.orgId"                  @defaultKey="getDefaultKey"                  @checkChange="checkChange"                  @click="clickTreeNode"                  ref="orgTree"                ></org-tree>              </el-form-item>              <el-form-item label="外包评价名称" prop="evaluateName">                <el-input                  :maxlength="20"                  v-model="queryParams.evaluateName"                  placeholder="请输入外包评价名称"                  clearable                  @keyup.enter.native="handleQuery"                />              </el-form-item>              <el-form-item label="状态" prop="status">                <el-select                  v-model="queryParams.status"                  placeholder="请选择状态"                  clearable                >                  <el-option                    v-for="dict in dict.type.plan_status"                    :key="dict.value"                    :label="dict.label"                    :value="dict.value"                  />                </el-select>              </el-form-item>              <el-form-item label="评价机构类型">                <el-select                  @change="cleanExecOrgList"                  prop="orgType"                  label="评价机构类型"                  v-model="queryParams.orgType"                  placeholder="请选择评价机构类型"                  clearable                >                  <el-option                    v-for="item in dict.type.sys_org_type"                    :key="item.value"                    :label="item.label"                    :value="item.value"                  >                  </el-option>                </el-select>              </el-form-item>              <el-form-item label="评价角色" prop="roleId">                <el-select                  @visible-change="getRolesByOrg"                  label="评价角色"                  v-model="queryParams.roleId"                  placeholder="请选择评价角色"                  filterable                  @change="handleRolesChange"                >                  <el-option                    v-for="item in planRoles"                    :key="item.id"                    :label="item.name"                    :value="item.id"                  >                  </el-option>                </el-select>              </el-form-item>            </el-form>            <!--    按纽    -->            <el-row :gutter="10">              <el-col :span="1.5">                <el-button                  type="primary"                  icon="el-icon-search"                  size="mini"                  @click="handleQuery"                  >搜索</el-button                >                <el-button                  type="primary"                  icon="el-icon-refresh"                  size="mini"                  @click="resetQuery"                  >重置</el-button                >                <el-button                  type="primary"                  icon="el-icon-plus"                  size="mini"                  @click="handleAdd"                  v-hasPermi="['core:evaluatePlan:add']"                  >新增</el-button                >              </el-col>              <right-toolbar                :showSearch.sync="showSearch"                @queryTable="getList"              >              </right-toolbar>            </el-row>          </div>          <el-table            border            height="644"            size="small"            v-loading="loading"            :data="dataList"            align="center"            fixed            @selection-change="handleSelectionChange"          >            <el-table-column              label="序号"              type="index"              width="60"            ></el-table-column>            <el-table-column label="创建机构" prop="orgName" />            <el-table-column              label="外包评价名称"              prop="evaluateName"              width="300"            />            <el-table-column label="评价机构类型" prop="orgType" />            <el-table-column label="评价角色" prop="roleName" />            <el-table-column label="评价周期" prop="evaluateCycle" />            <el-table-column label="创建人" prop="createBy" />            <el-table-column label="创建时间" prop="createTime" width="180" />            <el-table-column label="状态" width="150">              <template slot-scope="{ row }">                <el-switch                  v-model="row.status"                  active-text="启用"                  active-value="0"                  inactive-text="停用"                  inactive-value="1"                  active-color="#3bbca9"                  inactive-color="#d7000f"                  @change="swtichChangeHandler(row)"                >                </el-switch>              </template>            </el-table-column>            <el-table-column              label="操作"              width="260"              class-name="small-padding fixed-width"            >              <template slot-scope="{ row }">                <!-- publishEvaluate -->                <el-button                  size="mini"                  @click="publishHandler(row)"                  v-hasPermi="['core:evaluatePlan:distribute']"                  type="text"                  v-if="row.orgId == isEdit && row.status == 0"                  :class="                    row.isDistribute == 0                      ? 'el-icon-arrow-down'                      : 'el-icon-top-left'                  "                  >{{ row.isDistribute == "0" ? "" : "取消" }}发布</el-button                >                <el-button                  size="mini"                  @click="editHandler(row)"                  type="text"                  v-if="row.orgId == isEdit"                  class="el-icon-edit-outline"                  >编辑</el-button                ><el-button                  size="mini"                  @click="deleteHandler(row)"                  type="text"                  v-if="row.orgId == isEdit"                  class="el-icon-delete"                  >删除</el-button                >              </template>            </el-table-column>          </el-table>          <pagination            v-show="total > 0"            :total="total"            :page.sync="queryParams.pageNum"            :limit.sync="queryParams.pageSize"            @pagination="getList"          />        </div>      </el-col>    </el-row>    <editEvaluate ref="Evaluate" @success="getList()"></editEvaluate>  </div></template><script>import { mapGetters } from "vuex";import { findAllRole } from "@/api/system/role";import {  list,  swtichHandler,  delelteEvaluate,  publishEvaluate,  withdraw,} from "@/api/resumption/outsourcing.js";import OrgTree from "@/components/orgTree/orgQuerySelector.vue";import editEvaluate from "./editDialog.vue";export default {  name: "SocWebIndex",  dicts: ["sys_org_type", "plan_status"],  components: {    OrgTree,    editEvaluate,  },  data() {    const { params, query } = this.$route;    return {      loading: false,      selectedValues: [],      planRoles: [],      queryParams: this.reset(),      queryParams: {        orgId: null,        evaluateName: null,        status: null,        orgType: null,        checkSub: true,        roleId: "",        pageNum: 1,        pageSize: 10,        ...query,      },      isEdit: null,      // 显示搜索条件      showSearch: true,      total: 0,      dataList: [],    };  },  created() {},  mounted() {},  computed: {    ...mapGetters(["orgId"]),  },  methods: {    //开关启用停用    swtichChangeHandler(row) {      swtichHandler({        id: row.id,        status: row.status,      }).then((res) => {        let { code, msg } = res;        if (code == 200) {          this.$message.success(msg);          this.getList();        } else {          this.$message.error(msg);        }      });    },    //获取列表    getList() {      this.loading = true;      // this.queryParams.orgId=this.orgId      list(this.queryParams).then((res) => {        this.dataList = res?.data.rows || [];        this.isEdit = res?.isEdit;        this.total = res.data.total || [];        this.loading = false;      });    },    // 多选框选中数据    handleSelectionChange(selection) {},    /** 新增按钮操作 */    handleAdd() {      this.$refs.Evaluate.show();    },    editHandler(row) {      this.$refs.Evaluate.show(row.id, row.isDistribute);    },    //发布    publishHandler(row) {      //0未 //1已      if (row.isDistribute == "1") {        this.$modal          .confirm("是否取消发布?")          .then(function () {})          .then(() => {            withdraw(row.id).then((res) => {              let { code, msg } = res;              if (code == 200) {                this.getList();                this.$modal.msgSuccess("取消发布成功");              } else {                this.$modal.msgSuccess(msg);              }            });          });      } else {        this.$modal          .confirm("是否确认发布?")          .then(function () {})          .then(() => {            publishEvaluate(row.id).then((res) => {              let { code, msg } = res;              if (code == 200) {                this.getList();                this.$modal.msgSuccess("发布成功");              } else {                this.$modal.msgSuccess(msg);              }            });          });      }    },    deleteHandler(row) {      this.$modal        .confirm("是否确认删除?")        .then(function () {})        .then(() => {          delelteEvaluate(row.id).then((res) => {            let { code, msg } = res;            if (code == 200) {              this.getList();              this.$modal.msgSuccess("删除成功");            } else {              this.$modal.msgSuccess(msg);            }          });        });    },    //单选框状态改变    checkChange(state) {      this.queryParams.checkSub = state;      this.getList();    },    // 节点单击事件    clickTreeNode(data) {      this.queryParams.orgId = data.id;      this.getList();    },    getRolesByOrg() {      let params = {        orgType: this.queryParams.orgType || null,      };      findAllRole(params).then((res) => {        this.planRoles = res.data;        if (!this.queryParams.orgType) {          this.planRoles = [];          this.queryParams.roleId = [];        }      });    },    cleanExecOrgList() {      this.execOrgIds = null;      this.queryParams.roleId = [];      this.queryParams.execOrgList = [];      this.getRolesByOrg();    },    handleRolesChange(val) {      this.selectedValues = val.toString().split(",");    },    getDefaultKey(key) {      this.queryParams.orgId = key;      this.getList();    },    /** 搜索按钮操作 */    handleQuery() {      this.queryParams.pageNum = 1;      this.getList();    },    /** 重置按钮操作 */    resetQuery() {      this.resetForm("queryForm");      this.queryParams.orgId = this.orgId;      this.queryParams.checkSub = true;      this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)      this.queryParams.onlyManager = false;      this.queryParams.orgType = null;      this.handleQuery();    },    reset() {      return {        planName: null,        planType: null,        planCycle: null,        planStatus: null,        orgType: null,        roleNames: null,        count: null,        description: null,        tableData: null,        itemList: null,        planExec: null,        count: 0,        note: null,        planCreateOrgId: null,        planCreateOrgName: null,        roleList: null,        roleId: null,        execOrg: null,        checkOrg: null,        buildTaskNow: false,        checkOrgList: [],        execOrgList: [],        rulePointList: null,        checkOrgIds: null,        execOrgIds: null,        rulePointIds: null,        checkOrgType: null,        checkType: null,      };    },  },};</script><style lang="scss" scoped></style>
 |