From c93c13d1cfe288d431109ae1eafd7a9fc6d58746 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 13 六月 2023 10:23:17 +0800
Subject: [PATCH] 1.递交

---
 src/views/reportManager/logisticsCheck.vue |  426 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 256 insertions(+), 170 deletions(-)

diff --git a/src/views/reportManager/logisticsCheck.vue b/src/views/reportManager/logisticsCheck.vue
index 8855b95..d733d02 100644
--- a/src/views/reportManager/logisticsCheck.vue
+++ b/src/views/reportManager/logisticsCheck.vue
@@ -17,7 +17,7 @@
             <el-form-item label="妫�楠岀被鍨�" style=" display: flex;">
               <!--              <el-input v-model="form.checktypecode" placeholder="璇疯緭鍏�" style="width: 200px" />-->
 
-              <el-select v-model="form.style" style="width: 200px" placeholder="璇烽�夋嫨">
+              <el-select v-model="form.checktypecode" style="width: 200px" placeholder="璇烽�夋嫨">
                 <el-option
                   v-for="item in checktypeArr"
                   :key="item.code"
@@ -120,16 +120,37 @@
             fixed
             label="搴忓彿"
           />
+          <!--          <el-table-column-->
+          <!--            prop="check_type"-->
+          <!--            label="妫�楠岀被鍨�"-->
+          <!--            width="160"-->
+          <!--            sortable="custom"-->
+          <!--          >-->
+          <!--            <template slot-scope="{row}">-->
+          <!--              <div>{{ checktypeArr.find(i=>i.code===row.check_type).name }}</div>-->
+          <!--            </template>-->
+          <!--          </el-table-column> -->
           <el-table-column
-            prop="wo_code"
+            prop="check_typename"
             label="妫�楠岀被鍨�"
-            width="160"
+            width="110"
             sortable="custom"
           />
           <el-table-column
+            prop="sampmethod"
+            label="鎶芥牱鏂瑰紡"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.sampmethod==='FIXED'">鍥烘椂鎶芥</div>
+              <div v-if="row.sampmethod==='SCARE'">姣斾緥鎶芥</div>
+            </template>
+          </el-table-column>
+          <el-table-column
             prop="partcode"
             label="鐗╂枡缂栫爜"
-            width="160"
+            width="110"
             show-tooltip-when-overflow
             sortable="custom"
           />
@@ -142,7 +163,7 @@
           />
           <el-table-column
             prop="partspec"
-            label="浜у搧瑙勬牸"
+            label="瑙勬牸鍨嬪彿"
             width="120"
             show-tooltip-when-overflow
             sortable="custom"
@@ -158,67 +179,74 @@
             width="110"
             show-tooltip-when-overflow
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.hbatchno">{{ row.hbatchno }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="hbarcode"
             label="鏉$爜缂栧彿"
-            width="110"
+            width="160"
             show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
             prop="customer_name"
             label="寰�鏉ュ崟浣�"
-            width="160"
+            min-width="160"
             show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
-            prop="plan_qty"
-            label="浠诲姟鏁伴噺"
-            width="110"
-            show-tooltip-when-overflow
-            sortable="custom"
-          />
-          <el-table-column
-            prop="repair_qty"
-            label="缁翠慨鏁伴噺"
-            width="110"
-            show-tooltip-when-overflow
-            sortable="custom"
-          />
-          <el-table-column
-            prop="bad_qty"
-            label="鎶ュ簾鏁伴噺"
-            width="110"
-            sortable="custom"
-          />
-          <el-table-column
-            prop="defect_code"
-            label="缂洪櫡浠g爜"
-            width="110"
-            show-tooltip-when-overflow
-            sortable="custom"
-          />
-          <el-table-column
-            prop="defect_name"
-            label="鎵规鏉$爜"
-            width="110"
-            show-tooltip-when-overflow
-            sortable="custom"
-          />
-          <el-table-column
-            prop="lm_user"
-            label="妫�楠屼汉鍛�"
+            prop="username"
+            label="璐ㄦ浜哄憳"
             width="110"
             sortable="custom"
           />
           <el-table-column
             prop="lm_date"
-            label="妫�楠屾椂闂�"
+            label="璐ㄦ鏃堕棿"
             width="160"
             sortable="custom"
           />
+          <el-table-column
+            prop="check_result"
+            label="妫�楠岀粨鏋�"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.check_result==='OK'" style="display: flex;align-items: center">
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+                鍚堟牸
+              </div>
+              <div v-if="row.check_result==='NG'" style="display: flex;align-items: center">
+                <i class="el-icon-error" style="color: red;margin-right: 2px" />
+                涓嶅悎鏍�
+              </div>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            label="妫�楠屾槑缁�"
+            width="120"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip class="item" effect="dark" content="鏌ョ湅" placement="top">
+                  <i
+                    class="el-icon-view"
+                    :style="{color:$store.state.settings.theme}"
+                    style="margin-right:15px;cursor: pointer;"
+                    @click="edit('edit',row)"
+                  />
+                </el-tooltip>
+              </div>
+            </template>
+          </el-table-column>
 
         </el-table>
       </div>
@@ -236,24 +264,157 @@
 
     <el-dialog
       v-el-drag-dialog
-      :title="operation==='add'?'鏂板':'浜哄憳鏄庣粏'"
+      :title="operation==='add'?'鏂板':'妫�楠屾槑缁�'"
       :visible.sync="dialogVisible"
-      width="800px"
+      width="1100px"
       :close-on-click-modal="false"
       top="15vh"
       @closed="handleClose"
       @close="handleClose"
     >
-      <div style="height: 300px;width: 100%;background-color: aliceblue;padding:20px">
-        <el-tag
-          v-for="tag in tagArr"
-          :key="tag.name"
-          type="success"
-          style="margin-right: 15px;min-width: 80px;text-align: center"
+
+      <el-table
+        ref="tableDataRef2"
+        class="tableFixed"
+        :data="dialogTableData"
+        height="500"
+        style="height:500px"
+        border
+        :row-class-name="tableRowClassName"
+        highlight-current-row
+        :header-cell-style="this.$headerCellStyle"
+        :cell-style="this.$cellStyle"
+      >
+        <el-table-column
+          prop="checkitem_seq"
+          width="50"
+          fixed
+          label="搴忓彿"
+        />
+
+        <el-table-column
+          prop="checkitem_name"
+          min-width="120"
+          fixed
+          show-tooltip-when-overflow
+          label="妫�楠岄」鐩�"
+        />
+
+        <el-table-column
+          prop="standvalue"
+          label="鏍囧噯瑕佹眰"
+          fixed
+          min-width="120"
+          show-tooltip-when-overflow
         >
-          {{ tag }}
-        </el-tag>
-      </div>
+          <template slot-scope="{row}">
+            <!--        ~褰撲笁涓�奸兘鏈�    -->
+            <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>
+
+        <el-table-column
+          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 style="display: flex;align-items: center">
+              <i
+                :class="row.check_result==='OK'?'el-icon-success':'el-icon-error'"
+                :style="{color:row.check_result==='OK'?$store.state.settings.theme:'red'}"
+                style="margin-right: 2px"
+              />
+              {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
+            </div>
+
+            <!--            &lt;!&ndash;        ~褰撲笁涓�奸兘鏈�    &ndash;&gt;-->
+            <!--            <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)">-->
+            <!--              &lt;!&ndash;            <div v-if="row[(index + 1) + '/' + dialogTableNumberCol]>=row.lowervalue&&row[(index + 1) + '/' + dialogTableNumberCol]<=row.uppervalue">&ndash;&gt;-->
+            <!--              <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>-->
+
+            <!--            &lt;!&ndash;            ~褰撳彧鏈夋爣鍑嗗�煎拰涓婇檺鍊兼椂  &ndash;&gt;-->
+            <!--            <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>-->
+            <!--            &lt;!&ndash;            ~褰撳彧鏈夋爣鍑嗗�煎拰涓嬮檺鍊兼椂&ndash;&gt;-->
+            <!--            <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>-->
+
+            <!--            &lt;!&ndash;            ~褰撳彧鏈変笂闄愬�煎拰涓嬮檺鍊兼椂&ndash;&gt;-->
+            <!--            <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>-->
+            <!--            &lt;!&ndash;            ~褰撳彧鏈夋爣鍑嗗�兼椂     &ndash;&gt;-->
+            <!--            <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>-->
+            <!--            &lt;!&ndash;            ~褰撳彧鏈変笂闄愬�兼椂       &ndash;&gt;-->
+            <!--            <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>-->
+
+            <!--            &lt;!&ndash;            ~褰撳彧鏈変笅闄愬�兼椂      &ndash;&gt;-->
+            <!--            <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">
         <div class="footerButton">
           <el-button v-waves @click="dialogVisible=false">杩� 鍥�</el-button>
@@ -263,30 +424,20 @@
       </span>
     </el-dialog>
 
-    <!--瀵煎叆缁勪欢-->
-    <import-picker
-      ref="importPickerFunc"
-      class="importPickerClass"
-      :shows.sync="shows"
-      :title="title_value"
-      :colos="colos"
-      :code="code"
-    />
-
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Pagination'
-import { getCookie } from '@/utils/auth'
+
 import ImportPicker from '@/components/ImportPicker'
-import { handleDatetime, validateCode } from '@/utils/global'
+import { handleDatetime } from '@/utils/global'
 import {
-  GroupSalaryReportSearchUser, MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch
+  MaintenanceDetailsReportExcelSearch, LogisticsCheckSearch, LogisticsCheckSubSearch
 } from '@/api/reportManager'
 import elDragDialog from '@/directive/el-drag-dialog'
 import waves from '@/directive/waves'
-import { MesOrderStepReportSelectUserGroup } from '@/api/produceManager'
+import { PurchSupplierSelect } from '@/api/basicInfo'
 
 export default {
   name: 'Zzjg',
@@ -327,40 +478,15 @@
       total: 10,
       tableData: [],
       dialogVisible: false,
-      tagArr: [], //
-      dialogForm: {
-        OrgType: '',
-        OrgCode: '',
-        OrgName: '',
-        SupUnit: ''// 涓婄骇鍗曚綅
-      },
+
       operation: '',
-      dialogFormRules: {
-        OrgType: [
-          { required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
-        ],
-        OrgCode: [
-          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
-        ],
-        OrgName: [
-          { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
-        ]
-
-      },
-
-      title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
-      code: '4',
-      shows: false
+      dialogTableData: [],
+      dialogTableNumberCol: 0, // 瀵硅瘽妗嗗姩鎬佺殑鍒楁暟
+      dialogTableArrayCol: []// 瀵硅瘽妗嗗姩鎬佺殑鏁扮粍
 
     }
   },
-  watch: {
-    shows() {
-      if (!this.shows) {
-        this.getLogisticsCheckSearch()
-      }
-    }
-  },
+
   created() {
     this.handleRequest()
   },
@@ -446,14 +572,7 @@
     search() {
       this.getLogisticsCheckSearch()
     },
-    // 瀵煎叆鎸夐挳
-    upload() {
-      this.shows = true
-      this.$refs.importPickerFunc.newDataFunc()
-    },
-    colos() {
-      this.shows = false
-    },
+
     // 閲嶇疆
     reset() {
       this.form.checktypecode = ''
@@ -469,77 +588,42 @@
     },
 
     // 鏂板鎸夐挳
-    add(operation) {
-      this.operation = operation
-      this.dialogVisible = true
-    },
+    // add(operation) {
+    //   this.operation = operation
+    //   this.dialogVisible = true
+    // },
     // 淇敼鎸夐挳
     async edit(operation, row) {
       this.operation = operation
       this.dialogVisible = true
+      const { data: res } = await LogisticsCheckSubSearch({ checkid: row.id })
+      this.dialogTableData = res
 
-      const res = await GroupSalaryReportSearchUser({ id: row.id })
-      this.tagArr = res.data.map(r => r.checkuser)
-      // this.tagArr = ['妤兼潕淇�', '寮犱笁', '鏉庡洓']
-      // this.$nextTick(() => {
-      //   this.dialogForm.OrgCode = row.org_code
-      //   this.dialogForm.OrgName = row.org_name
-      //   this.dialogForm.SupUnit = row.parent_id
-      // })
-    },
-    // 鍒犻櫎鎸夐挳
-    async del(row) {
-      // this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
-      //   confirmButtonText: '纭畾',
-      //   cancelButtonText: '鍙栨秷',
-      //   type: 'warning'
-      // }).then(() => {
-      //   DeleteOrganization({ orgid: row.code }).then(res => {
-      //     if (res.code === '200') {
-      //       this.$message.success('鍒犻櫎鎴愬姛!')
-      //       if (this.form.page > 1 && this.tableData.length === 1) {
-      //         this.form.page--
-      //       }
-      //       this.getLogisticsCheckSearch()
-      //     }
-      //   })
-      // }).catch(() => {
-      //   this.$message.info('宸插彇娑堝垹闄�')
-      // })
+      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.dialogForm.OrgType = ''
-      this.dialogForm.OrgCode = ''
-      this.dialogForm.OrgName = ''
-      this.dialogForm.SupUnit = ''
-      this.$refs.dialogForm.clearValidate()
+      this.dialogTableData = []
     },
     // 瀵硅瘽妗嗗彇娑�
     dialogVisibleCancel() {
       this.dialogVisible = false
-    },
-    // 瀵硅瘽妗嗙‘璁�
-    dialogVisibleConfirm() {
-      this.$refs.dialogForm.validate(valid => {
-        if (valid) {
-          const data = {
-            OrganCode: this.dialogForm.OrgCode,
-            OrganName: this.dialogForm.OrgName,
-            OperType: this.operation === 'add' ? 'Add' : 'Update',
-            Operator: getCookie('admin')
-          }
-          // AddUpdateOrganization(data).then(res => {
-          //   if (res.code === '200') {
-          //     this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
-          //     this.dialogVisible = false
-          //     this.getLogisticsCheckSearch()
-          //   } else {
-          //     this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
-          //   }
-          // })
-        }
-      })
     },
     // 鑾峰彇椤甸潰楂樺害
     getHeight() {
@@ -647,6 +731,7 @@
 
 ::v-deep .el-table__body-wrapper {
   background-color: #f8f8fa;
+  z-index:2
 }
 
 ::v-deep .el-table__body .el-table__row.hover-row td {
@@ -677,11 +762,12 @@
   justify-content: center;
 }
 
-.tableFixed{
-  ::v-deep .el-table__fixed-right{
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
     height: 100% !important;
   }
-  ::v-deep .el-table__fixed{
+
+  ::v-deep .el-table__fixed {
     height: 100% !important;
   }
 }

--
Gitblit v1.9.3