huang_an 1 ano atrás
pai
commit
7dcc415e2c

+ 1 - 0
src/views/maintenance/components/redeployOther2.vue

@@ -217,6 +217,7 @@
         this.groupId = '';
         this.executorDeptName = '';
         this.visible = true;
+        this.$refs.tableRef.clearSelection();
       },
       handleDone() {
         console.log('handDone');

+ 166 - 0
src/views/maintenance/equipment/workOrder/components/printWorkOrder.vue

@@ -0,0 +1,166 @@
+<template>
+  <ele-modal title="出库单" :visible.sync="visible" v-if="visible" width="60%">
+    <div id="printSection" v-if="numValue == 1">
+      <table border cellspacing="0">
+        <tbody>
+          <tr>
+            <td style="padding: 20px" colspan="13" align="center">
+              <div class="title1">长沙鼓风机厂有限责任公司</div> <br />
+              <div class="title2">设备一级保养记录表</div>
+            </td></tr
+          >
+          <tr>
+            <td colspan="1" class="tex_center">部门</td>
+            <td colspan="12">{{ formData.executeGroupName }}</td>
+          </tr>
+          <tr>
+            <td colspan="1" class="tex_center">设备编号</td>
+            <td colspan="3">{{ formData.deviceList[0].substance.code }} </td>
+            <td colspan="1" class="tex_center">设备名称</td>
+            <td colspan="4">{{ formData.deviceList[0].substance.name }} </td>
+            <td colspan="1" class="tex_center">型号</td>
+            <td colspan="3"> {{ formData.deviceList[0].substance.model }} </td>
+          </tr>
+          <tr>
+            <td colspan="1" class="tex_center">生产厂家</td>
+            <td colspan="8"></td>
+            <td colspan="1" class="tex_center">操作保养人</td>
+            <td colspan="3"> {{ formData.executeUserName }} </td>
+          </tr>
+          <tr align="center">
+            <td colspan="1" class="tex_center">序号</td>
+            <td colspan="8" class="tex_center">保养内容</td>
+            <td colspan="1" class="tex_center">项目结果</td>
+            <td colspan="3" class="tex_center">备注</td>
+          </tr>
+          <tr
+            align="center"
+            v-for="(item, index) in formData.deviceList[0].workItems"
+          >
+            <td colspan="1" class="tex_center">{{ index + 1 }}</td>
+            <td colspan="8">{{ item.content }}</td>
+            <td colspan="1">{{ options[item.status] }}</td>
+            <td colspan="3"></td>
+          </tr>
+          <tr align="center">
+            <td colspan="1" class="tex_center">保养验收</td>
+            <td colspan="8"></td>
+            <td colspan="1" class="tex_center">日期</td>
+            <td colspan="3">{{ formatDate(formData.createTime) }}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+
+  export default {
+    name: 'print',
+
+    data() {
+      return {
+        visible: false,
+        formData: {},
+        options: {
+          0: '正常',
+          '-1': '缺陷'
+        },
+        numValue: 0
+      };
+    },
+
+    methods: {
+      open(id, num) {
+        this.numValue = num;
+        console.log(num, 'num');
+        getWordOrderDetail(id).then((res) => {
+          this.formData = res;
+          this.visible = true;
+        });
+      },
+      close() {
+        this.visible = false;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      },
+      formatDate(dateString) {
+        // 创建Date对象
+        const date = new Date(dateString);
+
+        // 获取年、月、日
+        const year = date.getFullYear();
+        const month = date.getMonth() + 1; // 月份是从0开始的,所以需要+1
+        const day = date.getDate();
+
+        // 格式化输出
+        return `${year}年${month.toString().padStart(2, '0')}月${day
+          .toString()
+          .padStart(2, '0')}日`;
+      },
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+
+        return `${obj.year}年${obj.month}月${obj.strDate}日`;
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    th,
+    td {
+      padding: 10px;
+    }
+    .title1 {
+      font-size: 28px;
+      font-weight: 600;
+    }
+    .title2 {
+      font-size: 22px;
+      text-align: center;
+    }
+    .tex_center {
+      text-align: center;
+      font-weight: bold;
+    }
+  }
+</style>

+ 16 - 1
src/views/maintenance/equipment/workOrder/index.vue

@@ -57,6 +57,14 @@
           >
             转派
           </el-link>
+          <!-- <el-link
+            type="primary"
+            :underline="false"
+            @click="handlePrint(row, 1)"
+            v-if="row.orderStatus == 3"
+          >
+            一级表
+          </el-link> -->
         </template>
       </ele-pro-table>
     </el-card>
@@ -65,6 +73,7 @@
     <!-- 报工弹框 -->
     <signingUpWork ref="signingUpWorkRef" @refresh="reload" />
     <edit @refresh="reload" ref="edit" />
+    <printWorkOrder ref="printRef11"></printWorkOrder>
   </div>
 </template>
 
@@ -77,12 +86,15 @@
   import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
   import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
 
+  import printWorkOrder from './components/printWorkOrder.vue';
+
   export default {
     components: {
       WorkSearch,
       redeployOther,
       signingUpWork,
-      edit
+      edit,
+      printWorkOrder
     },
     data() {
       return {
@@ -263,6 +275,9 @@
       // 报工
       toSigningUpWork(row) {
         this.$refs.signingUpWorkRef.open(row);
+      },
+      handlePrint(row, val) {
+        this.$refs.printRef11.open(row.id, val);
       }
     }
   };

+ 3 - 4
src/views/maintenance/repair/components/RepairDetailsDialog.vue

@@ -160,7 +160,7 @@
         </el-row>
       </el-tab-pane>
       <el-tab-pane label="备品备件申请单" name="sparePartsApply">
-       <editd :id="workOrderInfo.id" />
+        <editd :id="workOrderInfo.id" />
       </el-tab-pane>
     </el-tabs>
 
@@ -308,7 +308,6 @@
           :repairInfoLogList="repairInfoLogs"
           v-if="tabLabel === '维修信息'"
         />
-        
       </el-tab-pane>
     </el-tabs>
     <div class="btnbox" v-if="row.isshow">
@@ -363,7 +362,7 @@
   export default {
     mixins: [dictMixins],
     props: {},
-    components: { RepairNotesTab, WorkOrderTab,editd },
+    components: { RepairNotesTab, WorkOrderTab, editd },
     data() {
       return {
         errorLoading: false,
@@ -451,7 +450,7 @@
           console.log(row);
 
           const res = await getWorkOrderDetail(row.code);
-          console.log(res);
+          console.log(res, 'resresresresres');
           this.workOrderInfo = res.ticketsInfoResponse;
           this.infoData = res.repairRequestResponse;
           this.getSbinfo(res.ticketsInfoResponse.deviceId);

+ 2 - 2
src/views/maintenance/repair/components/WorkOrderTab.vue

@@ -142,10 +142,10 @@
           <span>{{ logs[item.id].createTime }}</span>
         </div>
         <div slot="description" class="work_report_desc">
-          <div> 报工人:{{ logs[item.id].content.rawUserName }} </div>
+          <div> 报工人:{{ logs[item.id].content?.rawUserName }} </div>
           <div>
             辅助人:{{
-              logs[item.id].content.assists.length > 0
+              logs[item.id].content.assists?.length > 0
                 ? logs[item.id].content.assists
                     .map((item) => item.name)
                     .toString()

+ 1 - 1
vue.config.js

@@ -31,7 +31,7 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        // target: 'http://192.168.3.51:18086', // 测试环境
+        // target: 'http://192.168.3.51:  18086', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.139:18086', // 粟
         // target: 'http://192.168.1.132:18086', // 徐