From 105242d9df9bda200da395b04972b65cb22a4496 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 30 十二月 2024 18:08:15 +0800
Subject: [PATCH] 拼音码页面

---
 src/views/hosp/pinyin/index.vue |  558 +++++++++++++++++++++----------------------------------
 1 files changed, 214 insertions(+), 344 deletions(-)

diff --git a/src/views/hosp/pinyin/index.vue b/src/views/hosp/pinyin/index.vue
index 2ce0ec6..dbc90f6 100644
--- a/src/views/hosp/pinyin/index.vue
+++ b/src/views/hosp/pinyin/index.vue
@@ -1,146 +1,103 @@
 <template>
-    <div class="app-container">
-      <el-form
-        :model="queryParams"
-        ref="queryForm"
-        size="small"
-        :inline="true"
-        label-width="68px"
-      >
-        <el-form-item label="琛ㄥ悕" prop="reportDoctorCode">
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      label-width="68px"
+    >
+      <el-form-item label="琛ㄥ悕" prop="tbname">
+        <el-input
+          ref="inputName"
+          v-model="queryParams.tbname"
+          placeholder="璇疯緭鍏ヨ〃鍚�"
+          clearable
+          @keyup.enter.native="handleQuery"
+          style="width: 170px"
+        />
+      </el-form-item>
+      <el-form-item label="瀛楁鍚�" prop="zd">
+        <el-input
+          v-model="queryParams.zd"
+          placeholder="璇疯緭鍏ュ瓧娈靛悕"
+          clearable
+          @keyup.enter.native="handleQuery"
+          style="width: 170px"
+        />
+      </el-form-item>
+      <el-form-item label="鎷奸煶鍚�" prop="pymzd">
+        <el-input
+          v-model="queryParams.pymzd"
+          placeholder="璇疯緭鍏ユ嫾闊冲悕"
+          clearable
+          @keyup.enter.native="handleQuery"
+          style="width: 170px"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button :loading="loading" type="primary" @click="handleSubmit"
+          >鎻愪氦</el-button
+        >
+        <el-button @click="handleCancel">鍙栨秷</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="title">蹇呴』鍜屾暟鎹簱琛ㄥ悕銆佸瓧娈靛悕涓ユ牸淇濇寔涓�鑷�!</div>
+    <el-table
+      id="ta"
+      ref="tb"
+      :data="pyList"
+      v-loading="loading"
+      border
+      @current-change="handleCurrentChange"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column label="琛ㄥ悕" align="center" prop="tj_project_copy"  />
+      <el-table-column label="琛ㄥ悕" align="center" prop="pro_name" />
+      <el-table-column label="琛ㄥ悕" align="center" prop="pro_eng_name" />
+    </el-table>
+
+    <!-- <div>
+        <div class="title">蹇呴』鍜屾暟鎹簱琛ㄥ悕銆佸瓧娈靛悕涓ユ牸淇濇寔涓�鑷�</div>
+
+    </div> -->
+    <!-- <div>
+      <el-form :model="queryParams">
+        <el-form-item label="琛ㄥ悕" prop="tbname">
           <el-input
-            ref="inputName"
-            v-model="queryParams.tjNum"
+            v-model="queryParams.tbname"
             placeholder="璇疯緭鍏ヨ〃鍚�"
-            clearable
-            @keyup.enter.native="handleQuery"
-            style="width: 170px"
-          />
+          ></el-input>
         </el-form-item>
-        <el-form-item label="瀛楁鍚�" prop="name">
+
+        <el-form-item label="瀛楁" prop="zd">
           <el-input
-            v-model="queryParams.name"
-            placeholder="璇疯緭鍏ュ瓧娈靛悕"
-            clearable
-            @keyup.enter.native="handleQuery"
-            style="width: 110px"
-          />
+            v-model="queryParams.zd"
+            placeholder="璇疯緭鍏ュ瓧娈�"
+          ></el-input>
         </el-form-item>
-        <el-form-item label="鎷奸煶鍚�" prop="name">
+
+        <el-form-item label="鎷奸煶瀛楁" prop="pymzd">
           <el-input
-            v-model="queryParams.name"
-            placeholder="璇疯緭鍏ユ嫾闊冲悕"
-            clearable
-            @keyup.enter.native="handleQuery"
-            style="width: 110px"
-          />
+            v-model="queryParams.pymzd"
+            placeholder="璇疯緭鍏ユ嫾闊冲瓧娈�"
+          ></el-input>
         </el-form-item>
-       <!--  <el-form-item label="鐧昏鏃堕棿" prop="createTimeList">
-          <el-date-picker
-            v-model="createTimeList"
-            type="datetimerange"
-            align="right"
-            :picker-options="pickerOptions"
-            style="width: 310px"
-            start-placeholder="寮�濮嬫棩鏈�"
-            end-placeholder="缁撴潫鏃ユ湡"
-            format="yyyy.MM.dd"
-            value-format="yyyy.MM.dd "
-            @change="handleDateChange"
-          >
-          </el-date-picker>
-        </el-form-item> -->
+
         <el-form-item>
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            size="mini"
-            @click="handleQuery"
-            style="margin-right: 15px"
-            >鏌ヨ</el-button
+          <el-button :loading="loading" type="primary" @click="handleSubmit"
+            >鎻愪氦</el-button
           >
-          <el-button
-            icon="el-icon-refresh"
-            type="primary"
-            size="mini"
-            @click="resetQuery"
-            >閲嶇疆</el-button
-          >
+          <el-button @click="handleCancel">鍙栨秷</el-button>
         </el-form-item>
       </el-form>
-      <el-table
-        id="ta"
-        ref="tb"
-        style="width: 100%"
-        :data="exaLists"
-        v-loading="loading"
-        border
-        @current-change="handleCurrentChange"
-        @selection-change="handleSelectionChange"
-        :row-class-name="tableRowClassName"
-      >
-        <!-- <el-table-column
-          fixed
-          type="selection"
-          align="center"
-          label="閫夋嫨"
-          width="40"
-          :selectable="isSelectable"
-        >
-        </el-table-column> -->
-  
-        <!-- <el-table-column label="濮撳悕" align="center" prop="name" width="80px" />
-        <el-table-column label="鎬у埆" align="center" prop="gender" width="80px" />
-        <el-table-column
-          label="骞撮緞"
-          align="center"
-          prop="patientAge"
-          width="80px"
-        >
-        </el-table-column>
-        <el-table-column
-          label="閫佹绉戝"
-          align="center"
-          prop="deptName"
-          width="100px"
-        />
-  
-        <el-table-column
-          label="妫�鏌ラ」鐩�"
-          align="center"
-          prop="checkParts"
-          width="150px"
-        />
-        <el-table-column
-          label="鎶ュ憡鏃堕棿"
-          align="center"
-          prop="examinationDate"
-          width="150px"
-        />
-  
-        <el-table-column label="闂ㄨ瘖鍙�" align="center" prop="mzh" width="140px" />
-        <el-table-column
-          label="鐢宠鍗曞彿"
-          align="center"
-          prop="brid"
-          width="145px"
-        />
-        <el-table-column
-          label="缁撴灉鐘舵��"
-          align="center"
-          prop="diagnosis"
-          width="150"
-          :show-overflow-tooltip="true"
-        /> -->
-     
-      </el-table>
-  
-      <div class="pag">
-        <div class="pag1">
-          <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
+    </div> -->
+    <div class="pag">
+      <div class="pag1">
+        <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page"
                     :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total">
                 </el-pagination> -->
-          <!-- <pagination
+        <!-- <pagination
             v-show="total > 0"
             :total="total"
             :pager-count="5"
@@ -148,233 +105,146 @@
             :limit.sync="queryParams.pageSize"
             @pagination="getList"
           /> -->
-        </div>
       </div>
     </div>
-  </template>
+  </div>
+</template>
     
     <script>
-  import { getLeftList, getRightList, asyncPacs } from "@/api/doctor/pacsCheck";
+import { getPinyin } from "@/api/hosp/project";
 
-  
-  export default {
-    dicts: ["dict_tj_status"],
-    data() {
-      return {
-        dis: false,
-        code: null,
-        createTimeList: "",
-        total: 0,
-        loading: false,
-        isSyncing: false,
-        // 鏌ヨ鍙傛暟
-        queryParams: {
-          // page: 1,
-          // pageSize: 20,
-          name: null,
-          start: null,
-          end: null,
-          tjNum: null,
-        },
-        // 缁戝畾鍗曢�夋寜閽�
-        checkStatus: "0",
-        exaLists: [],
-        selectedFirstTable: null, // 绗竴涓〃鏍奸�変腑琛�
-        selectedSecondTable: [], // 绗簩涓〃鏍奸�変腑琛�
-        // 琛ㄥ崟鍙傛暟
-        form: {},
-        clearTimeSet: null,
-        tjNumbers: "",
-        multipleSelection: "",
-        tjnum: "",
-        xiangmuList: [],
-        checkList: [],
-        tg: true,
-        bh: true,
-        pickerOptions: {
-          shortcuts: [
-            {
-              text: "鏈�杩戜竴鍛�",
-              onClick(picker) {
-                const end = new Date();
-                const start = new Date();
-                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-                picker.$emit("pick", [start, end]);
-              },
-            },
-            {
-              text: "鏈�杩戜竴涓湀",
-              onClick(picker) {
-                const end = new Date();
-                const start = new Date();
-                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-                picker.$emit("pick", [start, end]);
-              },
-            },
-            {
-              text: "鏈�杩戜笁涓湀",
-              onClick(picker) {
-                const end = new Date();
-                const start = new Date();
-                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-                picker.$emit("pick", [start, end]);
-              },
-            },
-          ],
-        },
-      };
+export default {
+  dicts: ["dict_tj_status"],
+  data() {
+    return {
+      loading: false,
+      pyList:[],
+      // 鏌ヨ鍙傛暟
+      queryParams: {
+        tbname: "",
+        zd: "",
+        pymzd: "",
+      },
+    };
+  },
+
+  created() {
+    
+  },
+  methods: {
+    handleSelectionChange(val) {
+      console.log(val);
+      if (val.length > 1) {
+        let del_row = val.shift();
+        this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+      }
+      console.log(val, 999);
+
+      if (val.length > 0) {
+        const selectedRow = val[0];
+        this.selectedFirstTable = selectedRow;
+        console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable);
+        this.fetchRightTableData(selectedRow);
+      } else {
+        this.selectedFirstTable = null;
+        this.checkList = [];
+      }
     },
-  
-    mounted() {
-      this.$nextTick(() => {
-        this.$refs.inputName.focus();
+    // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁
+    fetchRightTableData(selectedRow) {
+      const code = selectedRow.mzh;
+      if (!code) return;
+      this.loading = true;
+      getRightList(code).then((response) => {
+        this.checkList = response.data;
+        this.loading = false;
       });
     },
-    methods: {
-     
-      handleDateChange(val){
-        if (val && val.length === 2) {
-          this.queryParams.start = val[0]; // 璁剧疆寮�濮嬫椂闂�
-          this.queryParams.end = val[1];   // 璁剧疆缁撴潫鏃堕棿
-        } else {
-          this.queryParams.start = null;
-          this.queryParams.end = null;
-        }
-        console.log('Query Params:', this.queryParams);
-  
-      },
-      isSelectable(row) {
-        return !!row.mzh;
-      },
-      tableRowClassName({ row }) {
-        return !row.mzh ? "row-disabled" : "";
-      },
-  
-      handleSelectionChange(val) {
-        console.log(val);
-        if (val.length > 1) {
-          let del_row = val.shift();
-          this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
-        }
-        console.log(val, 999);
-  
-        if (val.length > 0) {
-          const selectedRow = val[0];
-          this.selectedFirstTable = selectedRow;
-          console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable);
-          this.fetchRightTableData(selectedRow);
-        } else {
-          this.selectedFirstTable = null;
-          this.checkList = [];
-        }
-      },
-      // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁
-      fetchRightTableData(selectedRow) {
-        const code = selectedRow.mzh;
-        if (!code) return;
-        this.loading = true;
-        getRightList(code).then((response) => {
-          this.checkList = response.data;
+
+    handleSubmit() {
+      this.loading = true;
+      const { tbname, zd, pymzd } = this.queryParams;
+
+      // 璋冪敤 API 鑾峰彇鎷奸煶
+      getPinyin(tbname, zd, pymzd)
+        .then((res) => {
+          console.log(res, "杩斿洖鐨勬暟鎹�");
+          if (res.code === 200) {
+            this.pyList = res.data;
+            console.log(this.pyList,9988);
+            
+            this.$message.success("鎻愪氦鎴愬姛");
+          } else {
+            this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯");
+          }
+        })
+        .catch((error) => {
+          this.$message.error(error.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯");
+        })
+        .finally(() => {
           this.loading = false;
         });
-      },
-  
-      handleSelectionChangeSecond(selectedRows) {
-        this.selectedSecondTable = selectedRows;
-        console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable);
-      },
-      getList() {
-        if (this.createTimeList) {
-          this.queryParams.start = this.createTimeList[0];
-          this.queryParams.end = this.createTimeList[1];
-        } else if (this.createTimeList == null) {
-          this.queryParams.start = null;
-          this.queryParams.end = null;
-        }
-      },
-  
-      /** 鎼滅储鎸夐挳鎿嶄綔 */
-      handleQuery() {
-        this.loading = true;
-        getLeftList(this.queryParams)
-          .then((res) => {
-            console.log(res, 1111);
-            if (res.code == 200) {
-              this.loading = false;
-              this.exaLists = res.data;
-              this.code = this.exaLists.mzh;
-            }
-          })
-          .catch((error) => {
-            this.loading = false;
-            this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯");
-          });
-        this.getList();
-      },
-  
-      /** 閲嶇疆鎸夐挳鎿嶄綔 */
-      resetQuery() {
-        this.createTimeList = [];
-        this.resetForm("queryForm");
-        this.queryParams = {
-          name: null,
-          start: null,
-          end: null,
-          tjNum: null,
-        };
-  
-        // 娓呯┖鍏朵粬渚濊禆鏁版嵁
-        this.checkList = [];
-        this.exaLists = [];
-      },
-  
-      handleCurrentChange(row) {
-        this.currentRow = row;
-      },
-  
-      setTime() {
-        //璁剧疆瀹氭椂鍣�
-        this.clearTimeSet = setInterval(() => {
-          this.$modal.closeLoading();
-        }, 300000);
-      },
-      tongbu(row) {
-        this.$modal.loading("姝e湪鍚屾锛岃绋嶅��...");
-        this.setTime();
-        const requestData = {
-          pacs: this.selectedFirstTable, // 宸︿晶琛ㄦ牸閫変腑鏁版嵁
-          tj: this.selectedSecondTable[0], // 鍙充晶琛ㄦ牸閫変腑鏁版嵁
-        };
-  
-        if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
-          this.$message.error("鑷冲皯閫変竴鏉℃暟鎹紒");
-          return;
-        }
-  
-        asyncPacs(requestData)
-          .then((res) => {
-            if (res.code == 200) {
-              this.fetchRightTableData(this.selectedFirstTable);
-              clearInterval(this.clearTimeSet);
-              this.clearTimeSet = null;
-              this.$modal.closeLoading();
-              this.$modal.msgSuccess("鍚屾鎴愬姛锛�");
-            } else {
-              this.$message.error(res.message || "鍚屾澶辫触锛岃绋嶅悗閲嶈瘯");
-            }
-          })
-          .catch((error) => {
-            clearInterval(this.clearTimeSet);
-            this.clearTimeSet = null;
-            this.$modal.closeLoading();
-          })
-      },
     },
-  };
-  </script>
+    // 鍙栨秷鎿嶄綔
+    handleCancel() {
+      this.queryParams.tbname = '';
+      this.queryParams.zd = '';
+      this.queryParams.pymzd = '';
+      this.$message.info('宸插彇娑�');
+    },
+
+    handleSelectionChangeSecond(selectedRows) {
+      this.selectedSecondTable = selectedRows;
+      console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable);
+    },
+
+    /** 鎼滅储鎸夐挳鎿嶄綔 */
+    handleQuery() {
+      this.loading = true;
+      getPinyin(this.queryParams)
+        .then((res) => {
+          console.log(res, 1111);
+          if (res.code == 200) {
+            // this.loading = false;
+            // this.exaLists = res.data;
+            // this.code = this.exaLists.mzh;
+          }
+        })
+        .catch((error) => {
+          //   this.loading = false;
+          //   this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯");
+        });
+    },
+
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuery() {
+      this.createTimeList = [];
+      this.resetForm("queryForm");
+      this.queryParams = {
+        name: null,
+        start: null,
+        end: null,
+        tjNum: null,
+      };
+
+      // 娓呯┖鍏朵粬渚濊禆鏁版嵁
+      this.checkList = [];
+      this.exaLists = [];
+    },
+
+    handleCurrentChange(row) {
+      this.currentRow = row;
+    },
+  },
+};
+</script>
     
     <style lang="scss" scoped>
-  /* #ta .el-table__header-wrapper .el-checkbox {
+    .title{
+        margin-bottom: 20px;
+        color: red;
+    }
+/* #ta .el-table__header-wrapper .el-checkbox {
     display: none;
   }
   
@@ -404,4 +274,4 @@
   .pag1 {
     width: 30%;
   } */
-  </style>
\ No newline at end of file
+</style>
\ No newline at end of file

--
Gitblit v1.8.0