From 4ee759bd3226bb2f686c99b3d93e26b4128f07a4 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 10 五月 2023 09:49:32 +0800
Subject: [PATCH] 1.物流检验报表提交

---
 src/views/reportManager/logisticsCheck.vue |  179 +++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 124 insertions(+), 55 deletions(-)

diff --git a/src/views/reportManager/logisticsCheck.vue b/src/views/reportManager/logisticsCheck.vue
index 8898259..52f5174 100644
--- a/src/views/reportManager/logisticsCheck.vue
+++ b/src/views/reportManager/logisticsCheck.vue
@@ -244,12 +244,6 @@
                     @click="edit('edit',row)"
                   />
                 </el-tooltip>
-                <!--                <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">-->
-                <!--                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />-->
-                <!--                </el-tooltip>-->
-                <!--                <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">-->
-                <!--                  <i class="el-icon-delete" @click="del(row)" />-->
-                <!--                </el-tooltip>-->
               </div>
             </template>
           </el-table-column>
@@ -272,7 +266,7 @@
       v-el-drag-dialog
       :title="operation==='add'?'鏂板':'妫�楠屾槑缁�'"
       :visible.sync="dialogVisible"
-      width="800px"
+      width="1100px"
       :close-on-click-modal="false"
       top="15vh"
       @closed="handleClose"
@@ -292,73 +286,125 @@
         :cell-style="this.$cellStyle"
       >
         <el-table-column
-          type="index"
+          prop="checkitem_seq"
           width="50"
           fixed
           label="搴忓彿"
         />
 
         <el-table-column
-          prop="stepcheckitem_code"
-          width="150"
+          prop="checkitem_name"
+          min-width="120"
+          fixed
+          show-tooltip-when-overflow
           label="妫�楠岄」鐩�"
-        >
-          <template slot-scope="{row}">
-            <el-select
-              v-if="row.isVisible===1"
-              v-model="row.stepcheckitem_code"
-              filterable
-              placeholder="璇烽�夋嫨"
-              style="width: 100%;"
-            >
-              <!--              @change="val=>tableChange(val,row)"-->
-              <el-option
-                v-for="item in CheckItemSelectArr"
-                :key="item.code"
-                :label="item.name"
-                :value="item.code"
-              />
-            </el-select>
-            <div v-else>{{
-              CheckItemSelectAllArr.find(i => i.code === row.stepcheckitem_code).name
-            }}
-            </div>
-          </template>
-        </el-table-column>
+        />
 
         <el-table-column
-          prop="stepcheckitem_desc"
+          prop="standvalue"
           label="鏍囧噯瑕佹眰"
+          fixed
+          min-width="120"
           show-tooltip-when-overflow
         >
           <template slot-scope="{row}">
-            <el-input
-              v-if="row.isVisible===1"
-              v-model="row.stepcheckitem_desc"
-              placeholder="璇疯緭鍏�"
-            />
-            <div v-else>{{ row.stepcheckitem_desc ? row.stepcheckitem_desc : '/' }}</div>
+            <!--        ~褰撲笁涓�奸兘鏈�    -->
+            <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue">{{ row.standvalue }}({{
+              row.lowervalue
+            }}~{{ row.uppervalue }})
+            </div>
+            <!--            ~褰撳彧鏈夋爣鍑嗗�煎拰涓婇檺鍊兼椂  -->
+            <div v-else-if="row.standvalue&&row.uppervalue">{{ row.standvalue }}(~{{ row.uppervalue }})</div>
+            <!--            ~褰撳彧鏈夋爣鍑嗗�煎拰涓嬮檺鍊兼椂-->
+            <div v-else-if="row.standvalue&&row.lowervalue">{{ row.standvalue }}({{ row.lowervalue }}~)</div>
+
+            <!--            ~褰撳彧鏈変笂闄愬�煎拰涓嬮檺鍊兼椂-->
+            <div v-else-if="row.uppervalue&&row.lowervalue">({{ row.lowervalue }}~{{ row.uppervalue }})</div>
+            <!--            ~褰撳彧鏈夋爣鍑嗗�兼椂     -->
+            <div v-else-if="row.standvalue">{{ row.standvalue }}</div>
+            <!--            ~褰撳彧鏈変笂闄愬�兼椂       -->
+            <div v-else-if="row.uppervalue">(~{{ row.uppervalue }})</div>
+            <!--            ~褰撳彧鏈変笅闄愬�兼椂      -->
+            <div v-else-if="row.lowervalue">({{ row.lowervalue }}~)</div>
+
+            <div v-else>/</div>
+
           </template>
         </el-table-column>
-
-        <!--        杩欓噷鍐檉or寰幆閬嶅巻璇彞-->
 
         <el-table-column
-          v-if="operation!=='check'"
-          label="鎿嶄綔"
-          width="120"
-          fixed="right"
+          v-for="(item,index) in dialogTableArrayCol"
+          :key="index+dialogTableData"
+          :prop="(index+1)+'/'+ dialogTableNumberCol"
+          :label="'绗�'+(index+1)+'浠�'"
+          show-tooltip-when-overflow
+          min-width="100"
         >
           <template slot-scope="{row}">
-            <div class="operationClass">
-              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveZjlbRow(row)">纭</el-button>
-              <el-button v-if="row.isVisible===1&&isCancel" v-waves type="text" @click="cancelZjlbRow(row)">鍙栨秷
-              </el-button>
-              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="editZjlbRow(row)">缂栬緫</el-button>
-              <el-button v-if="row.isVisible!==1" v-waves type="text" @click="delZjlbRow(row)">鍒犻櫎</el-button>
+
+            <!--        ~褰撲笁涓�奸兘鏈�    -->
+            <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">
+              <!--            <div v-if="row[(index + 1) + '/' + dialogTableNumberCol]>=row.lowervalue&&row[(index + 1) + '/' + dialogTableNumberCol]<=row.uppervalue">-->
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
             </div>
+
+            <!--            ~褰撳彧鏈夋爣鍑嗗�煎拰涓婇檺鍊兼椂  -->
+            <div v-else-if="row.standvalue&&row.uppervalue&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+            <!--            ~褰撳彧鏈夋爣鍑嗗�煎拰涓嬮檺鍊兼椂-->
+            <div v-else-if="row.standvalue&&row.lowervalue&&row.uppervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+
+            <!--            ~褰撳彧鏈変笂闄愬�煎拰涓嬮檺鍊兼椂-->
+            <div v-else-if="row.uppervalue&&row.lowervalue&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+            <!--            ~褰撳彧鏈夋爣鍑嗗�兼椂     -->
+            <div v-else-if="row.standvalue&&row.uppervalue===''&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])===parseFloat(row.standvalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+            <!--            ~褰撳彧鏈変笂闄愬�兼椂       -->
+            <div v-else-if="row.uppervalue&&row.lowervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+
+            <!--            ~褰撳彧鏈変笅闄愬�兼椂      -->
+            <div v-else-if="row.lowervalue&& row.uppervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div></div>
+
+            <div v-else>
+              <div style="display: flex;align-items: center">
+                <i class="el-icon-error" style="color: red;margin-right: 2px" />
+                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+              </div>
+            </div>
+
           </template>
         </el-table-column>
+
       </el-table>
 
       <span slot="footer" class="dialog-footer">
@@ -379,7 +425,7 @@
 import ImportPicker from '@/components/ImportPicker'
 import { handleDatetime } from '@/utils/global'
 import {
-  MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch
+  MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch, LogisticsCheckSubSearch
 } from '@/api/reportManager'
 import elDragDialog from '@/directive/el-drag-dialog'
 import waves from '@/directive/waves'
@@ -426,7 +472,9 @@
       dialogVisible: false,
 
       operation: '',
-      dialogTableData: []
+      dialogTableData: [],
+      dialogTableNumberCol: 0, // 瀵硅瘽妗嗗姩鎬佺殑鍒楁暟
+      dialogTableArrayCol: []// 瀵硅瘽妗嗗姩鎬佺殑鏁扮粍
 
     }
   },
@@ -540,10 +588,30 @@
     async edit(operation, row) {
       this.operation = operation
       this.dialogVisible = true
+      const { data: res } = await LogisticsCheckSubSearch({ checkid: row.id })
+      this.dialogTableData = res
+
+      this.dialogTableData.forEach((item, index) => {
+        for (const it in item) {
+          if (it.indexOf('/') !== -1) {
+            const i = it.split('/')[1]
+            this.dialogTableNumberCol = i
+          }
+        }
+      })
+
+      this.dialogTableArrayCol = []
+      for (let i = 0; i < this.dialogTableNumberCol; i++) {
+        this.dialogTableArrayCol.push(i)
+      }
+
+      this.$nextTick(() => {
+        this.$refs.tableDataRef2.doLayout()
+      })
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
-
+      this.dialogTableData = []
     },
     // 瀵硅瘽妗嗗彇娑�
     dialogVisibleCancel() {
@@ -655,6 +723,7 @@
 
 ::v-deep .el-table__body-wrapper {
   background-color: #f8f8fa;
+  z-index:2
 }
 
 ::v-deep .el-table__body .el-table__row.hover-row td {

--
Gitblit v1.9.3