sunyanqiang 2 năm trước cách đây
mục cha
commit
6599420d22
1 tập tin đã thay đổi với 51 bổ sung38 xóa
  1. 51 38
      src/views/PrintsLog/printlog/index.vue

+ 51 - 38
src/views/PrintsLog/printlog/index.vue

@@ -109,7 +109,8 @@
         <template slot-scope="scope">
           <el-tooltip :content="scope.row.printName" placement="top">
             <div
-              style=" overflow: hidden;
+              style="
+                overflow: hidden;
                 display: -webkit-box;
                 text-overflow: ellipsis;
                 -webkit-line-clamp: 2;
@@ -122,7 +123,12 @@
           </el-tooltip>
         </template>
       </el-table-column>
-      <el-table-column label="单位" align="center" prop="unitId" :formatter="unitFn"/>
+      <el-table-column
+        label="单位"
+        align="center"
+        prop="unitId"
+        :formatter="unitFn"
+      />
       <el-table-column label="打印份数" align="center" prop="printNumber" />
       <!-- <el-table-column
         label="是否需要归还(0否1是)"
@@ -157,7 +163,7 @@
         <template slot-scope="scope">
           <!-- <dict-tag :options="dict.type.sys_statusG" :value="scope.row.statusG" /> -->
           <div style="color: #00ff00" v-if="scope.row.statusG == '1'">
-           已归还
+            已归还
           </div>
           <div style="color: #90da90" v-if="scope.row.statusG == '0'">
             未归还
@@ -325,16 +331,16 @@
     >
       <el-form
         ref="form"
-        :model="queryParams"
+        :model="form3"
         inline
         :rules="rules"
         label-width="120px"
       >
-        <el-form-item label="" prop="unitIds" style="margin-right:500px">
+        <el-form-item label="" prop="unitIds" style="margin-right: 500px">
           <el-select
             multiple
             filterable
-            v-model="queryParams.unitIds"
+            v-model="form3.unitIds"
             id="execute"
             placeholder="请选择单位"
           >
@@ -355,7 +361,7 @@
         </el-form-item>
         <el-form-item prop="levelM">
           <el-select
-            v-model="queryParams.levelM"
+            v-model="form3.levelM"
             clearable
             placeholder="请选择级别"
           >
@@ -369,7 +375,7 @@
         </el-form-item>
         <el-form-item>
           <el-date-picker
-            v-model="queryParams.startt"
+            v-model="form3.startt"
             type="date"
             placeholder="选择开始时间"
             value-format="yyyy-MM-dd"
@@ -378,7 +384,7 @@
         </el-form-item>
         <el-form-item>
           <el-date-picker
-            v-model="queryParams.endt"
+            v-model="form3.endt"
             type="date"
             placeholder="选择结束时间"
             value-format="yyyy-MM-dd"
@@ -481,6 +487,7 @@ export default {
       user: {},
       deptId: null,
       yongHu: "",
+      form3:{}
     };
   },
   created() {
@@ -494,24 +501,24 @@ export default {
     this.getDicts("level").then((response) => {
       this.levelMs = response.data;
     });
-    this.getUser()
-    this.danWeis()
+    this.getUser();
+    this.danWeis();
   },
   methods: {
-    remoer(){
-      this.queryParams.levelM = "";
-      this.queryParams.unitIds = null;
-      this.queryParams.startt = null;
-      this.queryParams.endt = null;
+    remoer() {
+      this.form3.levelM = null;
+      this.form3.unitIds = null;
+      this.form3.startt = null;
+      this.form3.endt = null;
     },
-    unitFn(row){
-      var name =""
-      this.danWeisList.map(item=>{
-        if(item.deptId==row.unitId){
-          name=item.deptName
+    unitFn(row) {
+      var name = "";
+      this.danWeisList.map((item) => {
+        if (item.deptId == row.unitId) {
+          name = item.deptName;
         }
-      })
-      return name
+      });
+      return name;
     },
     // 获取登录信息
     getUser() {
@@ -519,7 +526,7 @@ export default {
         this.user = response.data;
         this.deptId = response.data.deptId;
         this.yongHu = response.data.nickName;
-        console.log( response);
+        console.log(response);
       });
     },
     //获取所有单位
@@ -570,10 +577,10 @@ export default {
       this.flg = null;
     },
     cancels() {
-      this.queryParams.levelM = "";
-      this.queryParams.unitIds = null;
-      this.queryParams.startt = null;
-      this.queryParams.endt = null;
+      this.form3.levelM = null;
+      this.form3.unitIds = [];
+      this.form3.startt = null;
+      this.form3.endt = null;
       this.open1 = false;
     },
     // 表单重置
@@ -739,20 +746,19 @@ export default {
     },
     // 导出操作
     submitForms() {
-      this.queryParams.unitId=this.deptId
-      const queryParams = this.queryParams;
-      if (queryParams.unitIds.length > 0) {
-        queryParams.unitIds = queryParams.unitIds.join(",");
+      if(this.form3.unitIds==null){
+        this.form3.unitIds=[]
       }
-      console.log(queryParams);
-      if (queryParams.startt) {
-        this.daty();
+      if (this.form3.unitIds.length!="") {
+        this.form3.unitIds = this.form3.unitIds.join(",");
       }
+     if(this.form3.startt||this.form3.endt){
+      const queryParamss = this.form3;
       this.$modal
         .confirm("是否确认导出集中文印记录数据项?")
         .then(() => {
           this.exportLoading = true;
-          return exportPrintlog(queryParams);
+          return exportPrintlog(queryParamss);
         })
         .then((response) => {
           this.$download.name(response.msg);
@@ -760,6 +766,13 @@ export default {
           this.cancels();
         })
         .catch(() => {});
+     }else{
+      this.$message.error('开始时间或结束时间不能为空')
+      this.form3.unitIds=[]
+      this.form3.levelM = null;
+      this.form3.startt = null;
+      this.form3.endt = null;
+     }
     },
     //打印编号
     printCodeblur() {
@@ -975,8 +988,8 @@ export default {
   width: 200px;
 }
 /* 执行 */
-  ::v-deep  .el-input--suffix  #execute{
-    width: 620px;
+::v-deep .el-input--suffix #execute {
+  width: 620px;
   /* width: auto; */
 }
 </style>