From 51123d5ad145745f855280783c01cc2906b693d0 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期三, 24 一月 2024 18:00:20 +0800
Subject: [PATCH] su

---
 src/views/hosp/print/index.vue |  422 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 243 insertions(+), 179 deletions(-)

diff --git a/src/views/hosp/print/index.vue b/src/views/hosp/print/index.vue
index ac6f8db..f9429bc 100644
--- a/src/views/hosp/print/index.vue
+++ b/src/views/hosp/print/index.vue
@@ -1,206 +1,270 @@
 <template>
-    <div class="app-container">
-        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="浣撴鍙�" prop="tjNumber">
-                <el-input v-model="queryParams.tjNumber" placeholder="璇疯緭鍏ヤ綋妫�鍙�" style="width: 170px;"  clearable @keyup.enter.native="handleQuery" ref="inputName" @blur="handleQuery" />
-            </el-form-item>
-            <el-form-item label="瀹㈡埛鍚嶇О" prop="printBy">
-                <el-input v-model="queryParams.printBy" placeholder="瀹㈡埛鍚嶇О" clearable style="width: 100px;"
-                    @keyup.enter.native="handleQuery" />
-            </el-form-item>
-            <el-form-item label="鎵撳嵃鏃堕棿" prop="printTime">
-                <el-date-picker clearable v-model="queryParams.printTime" type="date" value-format="yyyy-MM-dd"
-                    placeholder="璇烽�夋嫨鎵撳嵃鏃堕棿" style="width: 140px;">
-                </el-date-picker>
-            </el-form-item>
-            <el-form-item label="鎵撳嵃鐘舵��" prop="printStatus">
-        <el-select v-model="queryParams.printStatus" placeholder="鎵撳嵃鐘舵��" clearable style="width:110px">
-          <el-option v-for="dict in dict.type.print_success_fail" :key="dict.value" :label="dict.label" :value="dict.value" />
+  <div class="app-container">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="浣撴鍙�" prop="tjNumber">
+        <el-input
+          v-model="queryParams.tjNumber"
+          placeholder="璇疯緭鍏ヤ綋妫�鍙�"
+          style="width: 170px"
+          clearable
+          @keyup.enter.native="handleQuery"
+          ref="inputName"
+          @blur="hb"
+        />
+      </el-form-item>
+      <el-form-item label="瀹㈡埛鍚嶇О" prop="printBy">
+        <el-input
+          v-model="queryParams.printBy"
+          placeholder="瀹㈡埛鍚嶇О"
+          clearable
+          style="width: 100px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="鎵撳嵃鏃堕棿" prop="printTime">
+        <el-date-picker
+          clearable
+          v-model="queryParams.printTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="璇烽�夋嫨鎵撳嵃鏃堕棿"
+          style="width: 140px"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="鎵撳嵃鐘舵��" prop="printStatus">
+        <el-select
+          v-model="queryParams.printStatus"
+          placeholder="鎵撳嵃鐘舵��"
+          clearable
+          style="width: 110px"
+        >
+          <el-option
+            v-for="dict in dict.type.print_success_fail"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
         </el-select>
       </el-form-item>
-            <el-form-item>
-                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
-                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
-            </el-form-item>
-        </el-form>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >鎼滅储</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >閲嶇疆</el-button
+        >
+      </el-form-item>
+    </el-form>
 
-        <el-table v-loading="loading" :data="printList" @selection-change="handleSelectionChange" border style="width: 80%;">
-            <el-table-column label="瀹㈡埛鍚嶇О" align="center" prop="printBy" />
-            <el-table-column label="浣撴鍙�" align="center" prop="tjNumber" />
-            <el-table-column label="鎵撳嵃鎿嶄綔鍛�" align="center" prop="createBy" />
-            <el-table-column label="鎵撳嵃鏃堕棿" align="center" prop="printTime" width="180">
-                <template slot-scope="scope">
-                    <span>{{ parseTime(scope.row.printTime) }}</span>
-                </template>
-            </el-table-column>
-            <el-table-column label="鎵撳嵃鐘舵��" align="center" prop="printStatus">
-                <template slot-scope="scope">
-                    <dict-tag :options="dict.type.print_success_fail" :value="scope.row.printStatus" />
-                </template>
-            </el-table-column>
-        </el-table>
+    <el-table
+      v-loading="loading"
+      :data="printList"
+      @selection-change="handleSelectionChange"
+      border
+      style="width: 80%"
+    >
+      <el-table-column label="瀹㈡埛鍚嶇О" align="center" prop="printBy" />
+      <el-table-column label="浣撴鍙�" align="center" prop="tjNumber" />
+      <el-table-column label="鎵撳嵃鎿嶄綔鍛�" align="center" prop="createBy" />
+      <el-table-column
+        label="鎵撳嵃鏃堕棿"
+        align="center"
+        prop="printTime"
+        width="180"
+      >
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.printTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="鎵撳嵃鐘舵��" align="center" prop="printStatus">
+        <template slot-scope="scope">
+          <dict-tag
+            :options="dict.type.print_success_fail"
+            :value="scope.row.printStatus"
+          />
+        </template>
+      </el-table-column>
+    </el-table>
 
-        <div class="pag">
+    <div class="pag">
       <div class="pag1">
-        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-            @pagination="getList" />
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
       </div>
     </div>
-
-      
-
-    </div>
+  </div>
 </template>
 
 <script>
 import {
-    listPrint,
-    getPrint,
-    delPrint,
-    addPrint,
-    updatePrint
+  listPrint,
+  getPrint,
+  delPrint,
+  addPrint,
+  updatePrint,
 } from "@/api/hosp/print";
 import { getInfo } from "@/api/login";
 export default {
-    name: "Print",
-    dicts: ["print_success_fail",],
-    data() {
-        let checkPhoneNum = (rule, value, callback) => {
-         console.log( value)
+  name: "Print",
+  dicts: ["print_success_fail"],
+  data() {
+    let checkPhoneNum = (rule, value, callback) => {
+      console.log(value);
       let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
       if (value == "" && value == undefined && !value) {
-        return callback('');
-      }  else if(value != undefined && value != ""){
+        return callback("");
+      } else if (value != undefined && value != "") {
         return callback();
-      }else if (!patter.test(value)) {
-        return callback('');
+      } else if (!patter.test(value)) {
+        return callback("");
       }
     };
-        return {
-            // 閬僵灞�
-            loading: true,
-            // 閫変腑鏁扮粍
-            ids: [],
-            // 闈炲崟涓鐢�
-            single: true,
-            // 闈炲涓鐢�
-            multiple: true,
-            // 鏄剧ず鎼滅储鏉′欢
-            showSearch: true,
-            // 鎬绘潯鏁�
-            total: 0,
-            // 鎵撳嵃璁板綍琛ㄦ牸鏁版嵁
-            printList: [],
-            // 寮瑰嚭灞傛爣棰�
-            title: "",
-            // 鏄惁鏄剧ず寮瑰嚭灞�
-            open: false,
-            user: {},
-            // 鏌ヨ鍙傛暟
-            queryParams: {
-                pageNum: 1,
-                pageSize: 10,
-                tjNumber: null,
-                printBy: null,
-                printTime: null,
-                printStatus: null,
-                createBy:null
-            },
-            // 琛ㄥ崟鍙傛暟
-            form: {},
-            // 琛ㄥ崟鏍¢獙
-            rules: {
-                deleted: [
-                    {
-                        required: true, validator: checkPhoneNum,  trigger: "blur"
-                    }
-                ]
-            }
-        };
-    },
-    created() {
-        this.getList();
-    },
-    mounted() {
+    return {
+      // 閬僵灞�
+      loading: true,
+      // 閫変腑鏁扮粍
+      ids: [],
+      // 闈炲崟涓鐢�
+      single: true,
+      // 闈炲涓鐢�
+      multiple: true,
+      // 鏄剧ず鎼滅储鏉′欢
+      showSearch: true,
+      // 鎬绘潯鏁�
+      total: 0,
+      // 鎵撳嵃璁板綍琛ㄦ牸鏁版嵁
+      printList: [],
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 鏄惁鏄剧ず寮瑰嚭灞�
+      open: false,
+      user: {},
+      // 鏌ヨ鍙傛暟
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        tjNumber: null,
+        printBy: null,
+        printTime: null,
+        printStatus: null,
+        createBy: null,
+      },
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      // 琛ㄥ崟鏍¢獙
+      rules: {
+        deleted: [
+          {
+            required: true,
+            validator: checkPhoneNum,
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  mounted() {
     this.$nextTick(() => {
       this.$refs.inputName.focus();
     });
   },
-    methods: {
-        /** 鏌ヨ鎵撳嵃璁板綍鍒楄〃 */
-        getList() {
-            this.loading = true;
-            getInfo().then((response) => {
-                this.user = response.user
-            });
-            listPrint(this.queryParams).then(response => {
-                this.printList = response.rows;
-                this.printList.forEach(item => {
-                    if (item.createBy === this.user.userId) {
-                        item.createBy = this.user.nickName
-                    }
-                })
-                this.total = response.total;
-                this.loading = false;
-            });
-        },
-        // 鍙栨秷鎸夐挳
-        cancel() {
-            this.open = false;
-            this.reset();
-        },
-        // 琛ㄥ崟閲嶇疆
-        reset() {
-            this.form = {
-                id: null,
-                tjNumber: null,
-                printBy: null,
-                printTime: null,
-                printStatus: null,
-                createTime: null,
-                createBy: null,
-                updateTime: null,
-                updateBy: null,
-                deleted: null
-            };
-            this.resetForm("form");
-        },
-        /** 鎼滅储鎸夐挳鎿嶄綔 */
-        handleQuery() {
-            this.queryParams.pageNum = 1;
-            this.getList();
-        },
-        /** 閲嶇疆鎸夐挳鎿嶄綔 */
-        resetQuery() {
-            this.resetForm("queryForm");
-            this.handleQuery();
-        },
-        // 澶氶�夋閫変腑鏁版嵁
-        handleSelectionChange(selection) {
-            this.ids = selection.map(item => item.id)
-            this.single = selection.length !== 1
-            this.multiple = !selection.length
-        },
-        /** 鏂板鎸夐挳鎿嶄綔 */
-        handleAdd() {
-            this.reset();
-            this.open = true;
-            this.title = "娣诲姞鎵撳嵃璁板綍";
-        },
-        /** 淇敼鎸夐挳鎿嶄綔 */
-        handleUpdate(row) {
-            this.reset();
-            const id = row.id || this.ids
-            getPrint(id).then(response => {
-                this.form = response.data;
-                this.open = true;
-                this.title = "淇敼鎵撳嵃璁板綍";
-            });
-        },
-
-
-    }
-
+  methods: {
+    /** 鏌ヨ鎵撳嵃璁板綍鍒楄〃 */
+    getList() {
+      this.loading = true;
+      getInfo().then((response) => {
+        this.user = response.user;
+      });
+      listPrint(this.queryParams).then((response) => {
+        this.printList = response.rows;
+        this.printList.forEach((item) => {
+          if (item.createBy === this.user.userId) {
+            item.createBy = this.user.nickName;
+          }
+        });
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 鍙栨秷鎸夐挳
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 琛ㄥ崟閲嶇疆
+    reset() {
+      this.form = {
+        id: null,
+        tjNumber: null,
+        printBy: null,
+        printTime: null,
+        printStatus: null,
+        createTime: null,
+        createBy: null,
+        updateTime: null,
+        updateBy: null,
+        deleted: null,
+      };
+      this.resetForm("form");
+    },
+    hb() {
+      if (this.queryParams.tjNumber != null) {
+        this.handleQuery();
+      }
+    },
+    /** 鎼滅储鎸夐挳鎿嶄綔 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 鏂板鎸夐挳鎿嶄綔 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "娣诲姞鎵撳嵃璁板綍";
+    },
+    /** 淇敼鎸夐挳鎿嶄綔 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getPrint(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "淇敼鎵撳嵃璁板綍";
+      });
+    },
+  },
 };
 </script>
 

--
Gitblit v1.8.0