Bladeren bron

巡检点和设备保养列表添加预览打印

huang_an 1 jaar geleden
bovenliggende
commit
fe5e2a500d

+ 19 - 11
src/views/maintenance/components/redeployOther2.vue

@@ -65,7 +65,7 @@
 
       <div class="data-tab">
         <ele-pro-table
-          ref="tableRef"
+          ref="tableRef2"
           row-key="id"
           :columns="columns"
           :datasource="datasource"
@@ -199,15 +199,20 @@
         this.selectedRow = {};
         this.selectedRowData = [];
         this.tabValue = tab.name;
-        this.$refs.tableRef.clearSelection();
+        this.$refs.tableRef2.clearSelection();
       },
       open(row, val) {
+        console.log(row, val);
         this.entranceValue = val;
         if (val == 'noFinishSubmit') {
           this.tabValue = '1';
         }
         if (val == 'transfer') {
-          this.tabValue = '2';
+          if (row.assistsName == '') {
+            this.tabValue = '2';
+          } else {
+            this.tabValue = '1';
+          }
           if (row.assists) {
             this.arry = row.assists.split(',');
           }
@@ -217,7 +222,7 @@
         this.groupId = '';
         this.executorDeptName = '';
         this.visible = true;
-        this.$refs.tableRef.clearSelection();
+        this.$refs.tableRef2.clearSelection();
       },
       handleDone() {
         console.log('handDone');
@@ -226,7 +231,7 @@
         //     this.tableData.find((item2) => {
         //       if (item == item2.id) {
         //         console.log(item2, 'item2');
-        //         this.$refs.tableRef.toggleRowSelection(item2, true);
+        //         this.$refs.tableRef2.toggleRowSelection(item2, true);
         //       }
         //     });
         //   });
@@ -239,12 +244,12 @@
       },
       // 搜索
       search() {
-        this.$refs.tableRef.reload();
+        this.$refs.tableRef2.reload();
       },
 
       deptClick(data) {
         if (data) {
-          this.$refs.tableRef.reload();
+          this.$refs.tableRef2.reload();
         }
       },
 
@@ -261,13 +266,13 @@
         });
       },
       handleSelectAll(selection) {
-        this.$refs.tableRef.clearSelection();
+        this.$refs.tableRef2.clearSelection();
       },
       handleSelectionChange(row) {
         if (this.tabValue == '1') {
           if (row.length > 1) {
-            this.$refs.tableRef.clearSelection();
-            this.$refs.tableRef.toggleRowSelection(row.pop());
+            this.$refs.tableRef2.clearSelection();
+            this.$refs.tableRef2.toggleRowSelection(row.pop());
           }
           this.selectedRow = row[0];
         } else {
@@ -317,7 +322,10 @@
       },
       confirm() {
         this.visible = false;
-        this.$emit('confirm', this.selectedRow.id);
+        this.$emit('confirm', {
+          id: this.selectedRow.id,
+          name: this.selectedRow.name
+        });
       },
       cancel() {
         this.tabValue = '1';

+ 21 - 5
src/views/maintenance/equipment/workOrder/index.vue

@@ -11,16 +11,16 @@
         cache-key="systemRoleTable"
       >
         <!-- 表头工具栏 -->
-        <!-- <template v-slot:toolbar>
-          <el-button
+        <template v-slot:toolbar>
+          <!-- <el-button
             size="small"
             type="primary"
             class="ele-btn-icon"
             @click="goDetail()"
           >
             详情
-          </el-button>
-        </template> -->
+          </el-button> -->
+        </template>
         <template v-slot:code="{ row }">
           <el-link type="primary" :underline="false" @click="goDetail(row)">
             {{ row.code }}
@@ -28,6 +28,14 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            v-if="row.orderStatus === 3"
+            type="primary"
+            :underline="false"
+            @click="handleExport(row)"
+          >
+            预览打印
+          </el-link>
           <el-link
             v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
@@ -88,6 +96,8 @@
 
   import printWorkOrder from './components/printWorkOrder.vue';
 
+  import { getToken } from '@/utils/token-util';
+
   export default {
     components: {
       WorkSearch,
@@ -215,7 +225,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 240,
+            width: 300,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -278,6 +288,12 @@
       },
       handlePrint(row, val) {
         this.$refs.printRef11.open(row.id, val);
+      },
+      handleExport(row) {
+        const url = `http://192.168.1.251:8085/jmreport/view/1057242475693346816?token=${getToken()}&id=${
+          row.id
+        }`;
+        window.open(url, '_blank');
       }
     }
   };

+ 16 - 0
src/views/maintenance/patrol/workOrder/index.vue

@@ -17,6 +17,14 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
+          <el-link
+            v-if="row.orderStatus === 3"
+            type="primary"
+            :underline="false"
+            @click="handleExport(row)"
+          >
+            预览打印
+          </el-link>
           <el-link
             v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
@@ -68,6 +76,8 @@
   } from '@/api/maintenance/patrol_maintenance';
 
   import dictMixins from '@/mixins/dictMixins';
+
+  import { getToken } from '@/utils/token-util';
   export default {
     components: {
       WorkSearch,
@@ -262,6 +272,12 @@
       // 报工
       toSigningUpWork(row) {
         this.$refs.signingUpWorkRef.open(row);
+      },
+      handleExport(row) {
+        const url = `http://192.168.1.251:8085/jmreport/view/1058892076053696512?token=${getToken()}&id=${
+          row.id
+        }`;
+        window.open(url, '_blank');
       }
     }
   };

+ 30 - 13
src/views/maintenance/repair/components/repairReportingWork.vue

@@ -152,12 +152,17 @@
           </div>
         </div>
       </div>
+      <el-row v-if="acceptUserName">
+        <el-form-item label="执行人:" prop="attachments">
+          {{ acceptUserName }}
+        </el-form-item></el-row
+      >
       <el-row>
-        <el-form-item label="附件:" prop="attachments">
-          <fileMain v-model="formData.attachments"></fileMain>
-        </el-form-item>
-      </el-row>
-      <el-row>
+        <el-row>
+          <el-form-item label="附件:" prop="attachments">
+            <fileMain v-model="formData.attachments"></fileMain>
+          </el-form-item>
+        </el-row>
         <el-form-item label="处理说明:" prop="reason">
           <el-input
             type="textarea"
@@ -231,6 +236,7 @@
         },
         rowData: {},
         acceptUserId: '',
+        acceptUserName: '',
         hasClickOnce: false
       };
     },
@@ -254,19 +260,30 @@
         this.getInfo(this.rowData);
       },
       onConfirm(val) {
-        this.acceptUserId = val;
+        console.log(val, 'val');
+        this.acceptUserId = val.id;
+        this.acceptUserName = val.name;
       },
       async submit(val) {
+        console.log(val, 'val');
         if (val == '1') {
-          if (
-            !this.hasClickOnce ||
-            this.formData.time.length < 1 ||
-            this.formData.reason == ''
-          ) {
-            this.$refs.redeployOtherRef.open(this.rowData, 'noFinishSubmit');
+          console.log(
+            '非完成报工',
+            this.hasClickOnce,
+            this.formData.time.length,
+            this.formData.reason
+          );
+
+          if (!this.hasClickOnce) {
+            if (this.formData.time.length < 1 || this.formData.reason == '') {
+              this.$message.error('请选择实际起始时间或处理说明');
+              return;
+            }
             this.hasClickOnce = true;
+            this.$refs.redeployOtherRef.open(this.rowData, 'noFinishSubmit');
           } else {
-            this.submitForm(val);
+            console.log('非完成报工确认', this.hasClickOnce);
+            // this.submitForm(val);
           }
         } else {
           this.submitForm(val);