1
lkk
7 天以前 01cba233a6d28b820c9e9ca9b4a60a0bd9f6a682
src/components/proposal/index.vue
@@ -35,10 +35,22 @@
        <el-button type="primary" @click="search" v-show="tjproposal == 0"
          >搜索</el-button
        >
        <el-form-item v-show="tjproposal == 1">
          <el-input
            v-model="searchCyjy"
            style="width: 180px"
            placeholder="请输入搜索内容"
            clearable
            @clear="search1"
          ></el-input>
        </el-form-item>
        <el-button type="primary" @click="search1" v-show="tjproposal == 1"
          >搜索</el-button>
      </el-form>
      <el-table
        :data="dataList"
        v-if="tjproposal == 1"
        ref="elTable"
        v-loading="loading"
        @selection-change="handleSelectionChange"
@@ -46,7 +58,7 @@
        height="500px"
      >
        <el-table-column type="selection" width="40" align="center" />
        <el-table-column label="编码" width="70" align="center" prop="id" />
        <!-- <el-table-column label="编码" width="70" align="center" prop="id" /> -->
        <el-table-column label="标题" width="120" align="center" prop="title" />
        <el-table-column label="建议内容" align="left" prop="advice" />
        <!-- <el-table-column
@@ -62,13 +74,50 @@
          prop="createTime"
        /> -->
      </el-table>
      <div class="pag">
      <el-table
        :data="dataList"
        v-else
        ref="elTable"
        v-loading="loading"
        @selection-change="handleSelectionChange"
        border
        height="500px"
      >
        <el-table-column type="selection" width="40" align="center" />
        <el-table-column label="科室" prop="ks" width="100" align="center" />
        <el-table-column label="建议名称" prop="jymc" align="center" />
        <el-table-column label="建议内容" prop="jynr" align="center" />
        <!-- <el-table-column
          label="创建人"
          align="center"
          prop="createBy"
          width="110px"
        />
        <el-table-column
          label="创建时间"
          width="160px"
          align="center"
          prop="createTime"
        /> -->
      </el-table>
      <div class="pag" v-if="tjproposal == 1">
        <div class="pag1">
          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="queryParams.page"
            :limit.sync="queryParams.pageSize"
            @pagination="radiotjproposalChange1"
          />
        </div>
      </div>
      <div class="pag" v-else>
        <div class="pag1">
          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="queryParams1.pageNum"
            :limit.sync="queryParams1.pageSize"
            @pagination="radiotjproposalChange"
          />
        </div>
@@ -86,6 +135,7 @@
  getKjTjAdviceKjbqBySex,
  getCyTjAdviceKjbqBySex,
} from "@/api/hosp/project";
import { listAdvicerules } from "@/api/hosp/advicerules";
import { getInfo } from "@/api/login";
export default {
  name: "Packagese",
@@ -97,6 +147,7 @@
      tjproposal: "0",
      open: false,
      openone: false,
      prevOpen: false,
      // 弹出层标题
      title: "",
      total: 0,
@@ -105,6 +156,12 @@
      // 遮罩层
      loading: false,
      searchAdv: "",
      searchCyjy:"",
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
        zyzd: "",
      },
      queryParams: {
        sex: "",
        isZj: "",
@@ -112,7 +169,7 @@
        page: 1,
        pageSize: 10,
        jynr: "",
        jybt:""
        jybt: "",
      },
      list: [],
      fList: {},
@@ -127,17 +184,30 @@
      this.tjproposal = "0";
      this.getList();
    },
     mrjy(val) {
     const mode = val === "Y" ? "1" : "0";
     this.setTjProposal(mode);
    },
  },
  mounted() {
    // this.getList()
  },
  created() {
    // if( this.queryParams){
    //     this.getList()
    // }
  },
  methods: {
    clearSearchFields() {
      this.searchAdv = ''
      this.searchCyjy = ''
    },
    setTjProposal(mode) {
      if (this.tjproposal !== mode) {
        this.tjproposal = mode;
        this.radiotjproposalChange(mode); // 执行切换逻辑
      }
    },
    getAllList() {
      this.loading = true;
      this.openone = true;
@@ -148,9 +218,9 @@
    },
    getList() {
      this.loading = true;
      getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
        this.dataList = res.data.records;
        this.total = res.data.total;
      listAdvicerules(this.queryParams1).then((res) => {
        this.dataList = res.rows;
        this.total = res.total;
        this.loading = false;
      });
    },
@@ -166,18 +236,58 @@
      console.log(this.list);
    },
    search() {
      this.queryParams.jybt = this.searchAdv;
      this.queryParams1.zyzd = this.searchAdv;
      this.queryParams.pageNum = 1;
      this.loading = true;
      listAdvicerules(this.queryParams1).then((res) => {
        this.dataList = res.rows;
        this.total = res.total;
        this.loading = false;
      });
    },
    search1() {
      this.queryParams.nr = this.searchCyjy;
      this.queryParams.page = 1;
      this.loading = true;
      getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
        this.dataList = res.data.records;
        this.total = res.data.total;
        this.loading = false;
      getInfo().then((res) => {
        this.queryParams.userId = res.user.userId;
        this.queryParams.isZj = null;
        getCyTjAdviceKjbqBySex(this.queryParams).then((res) => {
          this.dataList = res.data.records;
          this.total = res.data.total;
          this.loading = false;
        });
      });
    },
    radiotjproposalChange() {
      if (this.tjproposal == "0") {
        this.searchAdv = "";
        // this.searchAdv = "";
        // this.queryParams.isZj = this.fList.isZj;
        // this.queryParams.userId = null;
        this.getList();
      } else {
        this.loading = true;
        getInfo().then((res) => {
          this.queryParams.userId = res.user.userId;
          this.queryParams.isZj = null;
          getCyTjAdviceKjbqBySex(this.queryParams).then((res) => {
            if (res.data) {
              this.dataList = res.data.records;
              this.total = res.data.total;
            } else {
              this.dataList = [];
              this.total = 0;
              this.$modal.msgError(res.msg);
            }
            this.loading = false;
          });
        });
      }
    },
     radiotjproposalChange1() {
      if (this.tjproposal == "0") {
        // this.searchCyjy = "";
        this.queryParams.isZj = this.fList.isZj;
        this.queryParams.userId = null;
        this.getList();
@@ -200,6 +310,7 @@
        });
      }
    },
    handleOk() {
      this.open = false;
      if (this.list.length != 0) {
@@ -220,7 +331,7 @@
.pag1 {
  width: 30%;
}
::v-deep .el-dialog__body{
::v-deep .el-dialog__body {
  padding: 7px 20px;
}
</style>