From b5272a50e48ee65f260bee54b70f389c98cc267a Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 25 十二月 2025 16:31:29 +0800
Subject: [PATCH] 1.sop优化

---
 src/views/kanbanManager/zhkb.vue |   19 ++--
 src/views/sopManager/sop.vue     |  203 +++++++++++++++++++-------------------------------
 2 files changed, 87 insertions(+), 135 deletions(-)

diff --git a/src/views/kanbanManager/zhkb.vue b/src/views/kanbanManager/zhkb.vue
index 638b0a0..ba803e3 100644
--- a/src/views/kanbanManager/zhkb.vue
+++ b/src/views/kanbanManager/zhkb.vue
@@ -129,21 +129,15 @@
             <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between">
               <div style="display: flex;justify-content: center;position: relative">
                 <div class="kb_center_block_children all_block05">
-                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.Y) }}</div>
+                  <div style="font-size: 24px;">{{ parseFloat(RightBottom[0].qty) }}</div>
                   <div class="box02" />
-                  <div>鍘熸潗鏂�</div>
+                  <div>{{ RightBottom[0].housename }}</div>
                 </div>
-                <!--                <div class="kb_center_block_children all_block06">-->
-                <!--                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.B) }}</div>-->
-                <!--                  <div class="box02" />-->
-                <!--                  <div>鍗婃垚鍝�</div>-->
-                <!--                </div>-->
                 <div class="kb_center_block_children all_block07">
-                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.C) }}</div>
+                  <div style="font-size: 24px;">{{ parseFloat(RightBottom[1].qty) }}</div>
                   <div class="box02" />
-                  <div>浜ф垚鍝�</div>
+                  <div>{{ RightBottom[1].housename }}</div>
                 </div>
-
               </div>
             </div>
           </div>
@@ -176,7 +170,10 @@
       LeftBottomData01: [],
       LeftBottomData02: [],
 
-      RightBottom: {}
+      RightBottom: [
+        { housename: '', qty: '' },
+        { housename: '', qty: '' }
+      ]
 
     }
   },
diff --git a/src/views/sopManager/sop.vue b/src/views/sopManager/sop.vue
index 284fd4d..393e940 100644
--- a/src/views/sopManager/sop.vue
+++ b/src/views/sopManager/sop.vue
@@ -6,7 +6,7 @@
         娴欐睙浼樻浣撹偛鐢ㄥ搧鑲′唤鏈夐檺鍏徃宸ュ簭SOP
       </div>
 
-      <div class="bodyTopFormGroup" style="margin-top: 0px;">
+      <div class="bodyTopFormGroup">
         <el-form
           ref="form"
           :model="form"
@@ -31,66 +31,24 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item label="宸ュ崟鐘舵��" style=" display: flex;">
-              <el-select
-                v-model="form.mesorderstus"
-                :popper-append-to-body="false"
-                style="width: 200px"
-                placeholder="璇烽�夋嫨"
-                filterable
-              >
-                <el-option
-                  v-for="item in erporderstusArr"
-                  :key="item.code"
-                  :label="item.name"
-                  :value="item.code"
-                />
-              </el-select>
-            </el-form-item>
             <el-form-item label="宸ュ崟缂栧彿" style=" display: flex;">
               <el-input v-model="form.mesordercode" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
             <el-form-item label="婧愬崟鍗曞彿" style="display: flex;">
               <el-input v-model="form.sourceorder" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
-            <el-form-item label="閿�鍞鍗�" style="display: flex;">
+            <el-form-item v-show="isExpandForm" label="閿�鍞鍗�" style="display: flex;">
               <el-input v-model="form.saleordercode" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
-            <!--            <el-form-item v-show="isExpandForm" label="鍗曟嵁绫诲瀷" style=" display: flex;">-->
-            <!--              <el-select-->
-            <!--                v-model="form.ordertype"-->
-            <!--                :popper-append-to-body="false"-->
-            <!--                style="width: 200px"-->
-            <!--                placeholder="璇烽�夋嫨"-->
-            <!--              >-->
-            <!--                <el-option-->
-            <!--                  v-for="item in ordertypeArr"-->
-            <!--                  :key="item.code"-->
-            <!--                  :label="item.name"-->
-            <!--                  :value="item.code"-->
-            <!--                />-->
-            <!--              </el-select>-->
-            <!--            </el-form-item>-->
             <el-form-item v-show="isExpandForm" label="浜у搧缂栫爜" style=" display: flex;">
               <el-input v-model="form.partcode" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
             <el-form-item v-show="isExpandForm" label="浜у搧鍚嶇О" style=" display: flex;">
               <el-input v-model="form.partname" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
-            <el-form-item v-show="isExpandForm" label="浜у搧瑙勬牸" style=" display: flex;">
-              <el-input v-model="form.partspec" style="width: 200px" placeholder="璇疯緭鍏�" />
-            </el-form-item>
-            <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
-              <el-input v-model="form.creatuser" style="width: 200px" placeholder="璇疯緭鍏�" />
-            </el-form-item>
-            <DateType
-              ref="DateTypeRef"
-              :is-expand-form="isExpandForm"
-              style="display:flex;justify-content: center;align-items: center;position: relative"
-              :datatype-list="datatypeList"
-              @DateTypeChange="DateTypeChange"
-              @cycleTimeChange="cycleTimeChange"
-            />
+            <!--            <el-form-item v-show="isExpandForm" label="浜у搧瑙勬牸" style=" display: flex;">-->
+            <!--              <el-input v-model="form.partspec" style="width: 200px" placeholder="璇疯緭鍏�" />-->
+            <!--            </el-form-item>-->
           </div>
 
           <div
@@ -121,7 +79,7 @@
         </div>
       </div>
 
-      <div class="elTableDiv">
+      <div class="elTableDiv" style="margin: 5px 0;">
         <el-table
           ref="tableDataRef"
           class="tableFixed"
@@ -129,7 +87,7 @@
           :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
           border
           :row-class-name="tableRowClassName"
-          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px'}"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px'}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
@@ -143,13 +101,27 @@
             fixed
           />
           <el-table-column
+            prop="wkshp_name"
+            label="鐢熶骇杞﹂棿"
+            width="120"
+            show-tooltip-when-overflow
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
             prop="wo_code"
             label="宸ュ崟缂栧彿"
+            width="160"
             show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
             prop="m_po"
+            width="160"
             label="婧愬崟鍗曞彿"
             sortable="custom"
             show-tooltip-when-overflow
@@ -163,6 +135,7 @@
             prop="saleOrderCode"
             label="閿�鍞鍗�"
             sortable="custom"
+            width="160"
             show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
@@ -178,7 +151,6 @@
           />
           <el-table-column
             prop="partname"
-
             label="浜у搧鍚嶇О"
             show-tooltip-when-overflow
             sortable="custom"
@@ -187,7 +159,6 @@
             prop="partspec"
             label="浜у搧瑙勬牸"
             sortable="custom"
-
             show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
@@ -195,7 +166,6 @@
               <div v-else>/</div>
             </template>
           </el-table-column>
-
           <el-table-column
             prop="route_name"
             label="宸ヨ壓璺嚎"
@@ -207,30 +177,18 @@
               <div v-else>/</div>
             </template>
           </el-table-column>
-
           <el-table-column
             prop="plan_qty"
             label="宸ュ崟鏁�"
+            width="120"
             sortable="custom"
             show-tooltip-when-overflow
           />
-
-          <el-table-column
-            prop="wkshp_name"
-            label="鐢熶骇杞﹂棿"
-            show-tooltip-when-overflow
-            sortable="custom"
-          >
-            <template slot-scope="{row}">
-              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
-              <div v-else>/</div>
-            </template>
-          </el-table-column>
-
         </el-table>
       </div>
       <!--鍒嗛〉-->
       <pagination
+        style="padding: 2px 0 4px 0"
         :total="total"
         :page.sync="form.page"
         :limit.sync="form.rows"
@@ -240,12 +198,12 @@
         @pagination="getMesOrderSearch"
       />
 
-      <div class="elTableDiv">
+      <div class="elTableDiv" style="margin: 5px 0;">
         <el-table
           ref="tableDataRef2"
           :data="tableDataDetail"
           border
-          height="310px"
+          height="190"
           :row-class-name="tableRowClassName"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
@@ -257,20 +215,6 @@
             prop="搴忓彿"
             fixed
           />
-
-          <!--          <el-table-column-->
-          <!--            prop="partcode"-->
-          <!--            label="浜у搧缂栫爜"-->
-          <!--            width="150"-->
-          <!--            show-tooltip-when-overflow-->
-          <!--          />-->
-          <!--          <el-table-column-->
-          <!--            prop="partname"-->
-          <!--            label="浜у搧鍚嶇О"-->
-          <!--            width="200"-->
-          <!--            show-tooltip-when-overflow-->
-          <!--          />-->
-
           <el-table-column
             label="宸ュ簭缂栫爜"
             prop="step_code"
@@ -326,14 +270,7 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP棰勮" placement="top">
-                  <i
-                    class="el-icon-files"
-                    style="cursor: pointer;color:#42b983;margin-right: 15px"
-                    @click="view(row)"
-                  />
-                </el-tooltip>
-
+                <el-button type="text" @click="view(row)">棰勮</el-button>
               </div>
             </template>
           </el-table-column>
@@ -385,11 +322,27 @@
       </el-form>
 
       <div style="border: 5px solid #ccc;">
+        <!--        <vue-office-pdf-->
+        <!--          :src="baseUrl+dialogSopForm.sop"-->
+        <!--          style="width: 100%;height: 80vh"-->
+        <!--          @rendered="renderedHandler"-->
+        <!--          @error="errorHandler"-->
+        <!--        />-->
         <iframe
           :src="baseUrl+dialogSopForm.sop"
           style="width: 100%;height: 80vh"
           frameborder="0"
         />
+
+        <!--        <pdf-->
+        <!--          v-for="item in numPages"-->
+        <!--          :key="item"-->
+        <!--          ref="pdf"-->
+        <!--          :src="baseUrl+dialogSopForm.sop"-->
+        <!--          :page="item"-->
+        <!--          style="display: inline-block;width: 800px;height: 500px;"-->
+        <!--        />-->
+
       </div>
 
       <span slot="footer" class="dialog-footer">
@@ -407,17 +360,20 @@
 import elDragDialog from '@/directive/el-drag-dialog'
 import waves from '@/directive/waves'
 import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
-import DateType from '@/components/DateType'
 import {
   SopSearchMesOrderProcessSopSearch,
   SopSearchMesOrderSearch,
   SopSearchUpdateMesOrderStepSearch
 } from '@/api/SopManager'
+// 寮曞叆VueOfficePdf缁勪欢
+import VueOfficePdf from '@vue-office/pdf'
+import pdf from 'vue-pdf'
 
 export default {
   name: 'WorkOrderList',
   components: {
-    Pagination, DateType
+    VueOfficePdf,
+    Pagination
   },
   directives: { elDragDialog, waves },
   data() {
@@ -446,29 +402,9 @@
         page: 1, // 绗嚑椤�
         rows: 20 // 姣忛〉澶氬皯鏉�
       },
-      erporderstusArr: [
-        { code: 'NEW', name: '鏂板伐鍗�' },
-        // { code: 'CREATING', name: '鎵ц涓�' },
-        // { code: 'CREATED', name: '宸插叧闂�' }
-        { code: 'ALLO', name: '宸叉淳鍙�' },
-        { code: 'START', name: '寮�宸�' },
-        { code: 'CLOSED', name: '瀹屽伐' }
-        // { code: 'NOSCHED', name: '寰呮帓绋�' },
-        // { code: 'SCHED', name: '宸叉帓绋�' }
-      ],
       wkshopcodeArr: [],
       total: 10,
       tableData: [],
-      ordertypeArr: [// 宸ュ崟绫诲瀷
-        { code: 'PO', name: '鏍囧噯宸ュ崟' },
-        { code: 'FO', name: '鎶ュ簾琛ュ崟' }
-      ],
-      datatypeList: [
-        { code: 'PS', name: '棰勮寮�宸ユ棩鏈�' },
-        { code: 'PE', name: '棰勮瀹屽伐鏃ユ湡' },
-        { code: 'ED', name: '棰勮浜や粯鏃ユ湡' },
-        { code: 'CT', name: '宸ュ崟鍒涘缓鏃ユ湡' }
-      ],
       tableDataDetail: [],
       rowData: {}, // 琛岀偣鍑讳簨浠跺瓨鍌ㄥ��
       SopDialogVisible: false,
@@ -477,7 +413,8 @@
         v: ''
       },
       sopArr: [],
-      baseUrl: process.env.VUE_APP_BASE_API_FILE
+      baseUrl: process.env.VUE_APP_BASE_API_FILE,
+      numPages: null// pdf鎬绘暟
 
     }
   },
@@ -495,6 +432,22 @@
     this.getHeight()
   },
   methods: {
+    getNumPages(url) {
+      const loadingTask = pdf.createLoadingTask(url)
+      console.log(loadingTask)
+      loadingTask.promise.then(pdf => {
+        this.numPages = pdf._pdfInfo.numPages// 杩欓噷鏄〉鐮侊紝鍙兘璧嬪�间笉涓�鏍凤紝鍙互鎵撳嵃鐪嬩竴涓�
+        console.log('pdf', pdf, this.numPages)
+      }).catch(err => {
+        console.error('pdf 鍔犺浇澶辫触', err)
+      })
+    },
+    renderedHandler() {
+      console.log('娓叉煋瀹屾垚')
+    },
+    errorHandler() {
+      console.log('娓叉煋澶辫触')
+    },
     // 寮瑰嚭妗嗗叧闂�
     handleSopClose() {
       this.SopDialogVisible = false
@@ -507,6 +460,8 @@
       this.dialogSopForm.v = this.sopArr.find(i => i.filepath === val).version
     },
     async view(row) {
+      // window.open('http://121.196.36.24:8049/APP/Chrome.apk')
+
       const data = {
         materielcode: this.rowData.partcode,
         routecode: this.rowData.route_code,
@@ -520,14 +475,9 @@
       this.sopArr = res
       this.dialogSopForm.sop = res[0].filepath
       this.dialogSopForm.v = res[0].version
-      this.SopDialogVisible = true
-    },
 
-    DateTypeChange(value) {
-      this.form.datatype = value
-    },
-    cycleTimeChange(val) {
-      this.form.timeValue = val
+      this.getNumPages(this.baseUrl + this.dialogSopForm.sop)
+      this.SopDialogVisible = true
     },
     tableRowClassName({ row, rowIndex }) {
       return 'custom-row'
@@ -625,7 +575,7 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight
-        this.tableHeight = this.mainHeight - 600
+        this.tableHeight = this.mainHeight - 450
         this.$refs.tableDataRef.doLayout()
         this.$refs.tableDataRef2.doLayout()
       })
@@ -636,17 +586,17 @@
 </script>
 
 <style scoped lang="scss">
-.footerButton{
+.footerButton {
   position: absolute;
   bottom: 15px;
   margin-left: calc(50% - 50px);
 }
 
-::v-deep .el-dialog__body{
+::v-deep .el-dialog__body {
   padding: 0 20px !important;
 }
 
-.headTitle{
+.headTitle {
   height: 70px;
   display: flex;
   justify-content: center;
@@ -655,6 +605,11 @@
   font-weight: bolder;
   font-family: Arial;
   //font-family: "Avenir", Helvetica, Arial, sans-serif;
+}
 
+.pagination-container {
+  ::v-deep .el-input__inner {
+    height: 26px !important;
+  }
 }
 </style>

--
Gitblit v1.9.3