From b46bc2dba51a3885a68e4c58316b41a31ea16bb2 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 14 二月 2023 13:35:03 +0800
Subject: [PATCH] 1.存货档案修改

---
 src/views/scgl/sckbg.vue | 1671 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 1,286 insertions(+), 385 deletions(-)

diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index 252e3c9..027cbb0 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -1,26 +1,28 @@
 <template>
   <div>
-    <div class="body" style="padding: 0;height: 100%" :style="{height:mainHeight+'px'}">
-
+    <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}">
       <el-tabs ref="elTabs" v-model="activeName" type="border-card" @tab-click="tabClick">
         <el-tab-pane label="鐢熶骇鍒楄〃">
           <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
             <div style="display: flex;align-items: center">
               <div style="width: 90px">鎵弿鏉$爜锛�</div>
+              <!--              oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"-->
               <el-input
+                id="keyWords"
                 v-model="form.orderstepqrcode"
-                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                 name="produceCode"
                 style="width: 300px"
                 @keyup.enter.native="val=>enterNative(val,'produceCode')"
               />
+              <!--                @keyup.native="e=>judgeIsScanning(e,'produceCode')"-->
+
             </div>
             <div v-if="false" style="display: flex;padding-right: 10px">
-              <el-button @click="ZZstart">
+              <el-button v-waves @click="ZZstart">
                 <svg-icon icon-class="start_time" style="margin-right: 2px" />
                 寮�濮�
               </el-button>
-              <el-button @click="ZZreport">
+              <el-button v-waves @click="ZZreport">
                 <svg-icon icon-class="report_work" style="margin-right: 2px" />
                 鎶ュ伐
               </el-button>
@@ -29,97 +31,142 @@
           <el-divider />
           <div class="elTableDiv">
             <el-table
+              ref="tableDataRef"
+              class="tableFixed"
               :data="tableData"
-              :height="tableHeight+'px'"
+              :height="isIpad? (tableHeight+50):tableHeight"
               border
-              stripe
+              :row-class-name="tableRowClassName"
               :style="{width: 100+'%',height:tableHeight+'px',}"
               highlight-current-row
               :header-cell-style="this.$headerCellStyle"
               :cell-style="this.$cellStyle"
               @sort-change="sortChange"
             >
-              <!--              <el-table-column-->
-              <!--                width="50"-->
-              <!--                fixed-->
-              <!--              >-->
-              <!--                <template slot-scope="{row}">-->
-              <!--                  <el-radio-->
-              <!--                    v-model="radioSelected"-->
-              <!--                    :label="row.wo"-->
-              <!--                    style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
-              <!--                    @change.native="getCurrentRow(row.wo)"-->
-              <!--                  />-->
-              <!--                </template>-->
-              <!--              </el-table-column>-->
               <el-table-column
                 prop="RowNum"
                 width="50"
                 label="搴忓彿"
+                fixed
               />
               <el-table-column
                 prop="status"
+                show-tooltip-when-overflow
                 label="鐘舵��"
                 sortable="custom"
-                width="110"
+                width="80"
               >
                 <template slot-scope="{row}">
                   <div v-if="row.status==='NEW'">鏂拌鍗�</div>
                   <div v-if="row.status==='ALLO'">宸叉淳鍙�</div>
                   <div v-if="row.status==='START'">寮�宸�</div>
                   <div v-if="row.status==='CLOSED'">瀹屽伐</div>
+                  <div v-if="row.status==='NOSCHED'">寰呮帓绋�</div>
+                  <div v-if="row.status==='SCHED'">宸叉帓绋�</div>
                 </template>
               </el-table-column>
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="partcode"
                 label="浜у搧缂栫爜"
+                min-width="110"
                 sortable="custom"
+                show-tooltip-when-overflow
               />
               <el-table-column
                 prop="partname"
+                width="160"
+                show-tooltip-when-overflow
                 label="浜у搧鍚嶇О"
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
+                show-tooltip-when-overflow
+                width="120"
                 sortable="custom"
               />
-              <el-table-column
-                prop="descr"
-                label="宸ュ簭鎻忚堪"
-                width="150"
-                sortable="custom"
-              />
+              <!--              <el-table-column-->
+              <!--                prop="descr"-->
+              <!--                label="宸ュ簭鎻忚堪"-->
+              <!--                min-width="150"-->
+              <!--                sortable="custom"-->
+              <!--              >-->
+              <!--                <template slot-scope="{row}">-->
+              <!--                  <div v-if="row.descr">{{ row.descr }}</div>-->
+              <!--                  <div v-else>/</div>-->
+              <!--                </template>-->
+              <!--              </el-table-column>-->
               <el-table-column
                 prop="plan_qty"
                 label="浠诲姟鏁伴噺"
+                width="110"
                 sortable="custom"
+                show-tooltip-when-overflow
               />
               <el-table-column
+                label="鏈姤宸ユ暟閲�"
+                width="120"
+                show-tooltip-when-overflow
+              >
+                <!--                sortable="custom"-->
+                <template slot-scope="{row}">
+                  <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
                 prop="good_qty"
-                label="宸叉姤宸ユ暟閲�(鑹搧)"
+                show-tooltip-when-overflow
+                label="宸叉姤宸ユ暟閲�"
                 sortable="custom"
                 width="160"
               />
               <el-table-column
                 prop="ng_qty"
                 label="涓嶈壇鏁伴噺"
+                show-tooltip-when-overflow
                 width="150"
-
+                sortable="custom"
+              />
+              <el-table-column
+                prop="bad_qty"
+                label="宸叉姤搴熸暟閲�"
+                width="120"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="plan_startdate"
                 label="璁″垝寮�宸ユ棩鏈�"
-                width="185"
+                show-tooltip-when-overflow
+                width="150"
                 sortable="custom"
-              />
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="plan_enddate"
+                label="璁″垝瀹屽伐鏃ユ湡"
+                width="150"
+                sortable="custom"
+                show-tooltip-when-overflow
+                fixed="right"
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
               <!--              <el-table-column-->
               <!--                label="鎿嶄綔"-->
               <!--                width="150"-->
@@ -127,8 +174,8 @@
               <!--              >-->
               <!--                <template slot-scope="{row}">-->
               <!--                  <div class="operationClass">-->
-              <!--                    <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
-              <!--                    <el-button type="text" @click="del(row)">鍒犻櫎</el-button>-->
+              <!--                    <el-button v-waves type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
+              <!--                    <el-button v-waves type="text" @click="del(row)">鍒犻櫎</el-button>-->
               <!--                  </div>-->
               <!--                </template>-->
               <!--              </el-table-column>-->
@@ -136,12 +183,11 @@
           </div>
           <!--鍒嗛〉-->
           <pagination
-            v-show="total>0"
             :total="total"
             :page.sync="form.page"
             :limit.sync="form.rows"
             align="right"
-            layout="prev, pager, next,sizes"
+            layout="total,prev, pager, next,sizes"
             popper-class="select_bottom"
             @pagination="getMesOrderStepSearch"
           />
@@ -166,18 +212,19 @@
               <div style="width: 90px;margin-left: 20px">鎵弿鏉$爜锛�</div>
               <el-input
                 v-model="WXform.orderstepqrcode"
-                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
                 name="WXproduceCode"
                 style="width: 300px"
                 @keyup.enter.native="val=>enterNative(val,'WXproduceCode')"
               />
+              <!--              @keyup.native="e=>judgeIsScanning(e,'WXproduceCode')"-->
+
             </div>
             <div v-if="false" style="display: flex;padding-right: 10px">
-              <el-button @click="WXsend">
+              <el-button v-waves @click="WXsend">
                 <svg-icon icon-class="start_time" style="margin-right: 2px" />
                 鍙戞枡
               </el-button>
-              <el-button @click="WXback">
+              <el-button v-waves @click="WXback">
                 <svg-icon icon-class="report_work" style="margin-right: 2px" />
                 鏀舵枡
               </el-button>
@@ -186,39 +233,30 @@
           <el-divider />
           <div class="elTableDiv">
             <el-table
+              ref="tableDataRef"
+              class="tableFixed"
               :data="WXtableData"
-              :height="tableHeight+'px'"
+              :height="isIpad? (tableHeight+50):tableHeight"
               border
-              stripe
+              :row-class-name="tableRowClassName"
               :style="{width: 100+'%',height:tableHeight+'px',}"
               highlight-current-row
               :header-cell-style="this.$headerCellStyle"
               :cell-style="this.$cellStyle"
               @sort-change="WXsortChange"
             >
-              <!--              <el-table-column-->
-              <!--                width="50"-->
-              <!--                fixed-->
-              <!--              >-->
-              <!--                <template slot-scope="{row}">-->
-              <!--                  <el-radio-->
-              <!--                    v-model="radioSelected"-->
-              <!--                    :label="row.wo_code"-->
-              <!--                    style="color: #fff;padding-left: 10px; margin-right: -25px;"-->
-              <!--                    @change.native="getWXCurrentRow(row.wo_code)"-->
-              <!--                  />-->
-              <!--                </template>-->
-              <!--              </el-table-column>-->
               <el-table-column
                 prop="RowNum"
                 width="50"
                 label="搴忓彿"
+                fixed
               />
               <el-table-column
                 prop="status"
                 label="鐘舵��"
+                show-tooltip-when-overflow
                 sortable="custom"
-                width="110"
+                width="80"
               >
                 <template slot-scope="{row}">
                   <div v-if="row.status==='NEW'">鏂拌鍗�</div>
@@ -230,53 +268,105 @@
               <el-table-column
                 prop="wo_code"
                 label="宸ュ崟鍙�"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="partcode"
                 label="浜у搧缂栫爜"
+                show-tooltip-when-overflow
+                width="110"
                 sortable="custom"
               />
               <el-table-column
                 prop="partname"
                 label="浜у搧鍚嶇О"
+                width="160"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
               <el-table-column
                 prop="stepname"
                 label="宸ュ簭"
+                width="120"
+                show-tooltip-when-overflow
                 sortable="custom"
               />
-              <el-table-column
-                prop="descr"
-                label="宸ュ簭鎻忚堪"
-                width="150"
-                sortable="custom"
-              />
+              <!--              <el-table-column-->
+              <!--                prop="descr"-->
+              <!--                label="宸ュ簭鎻忚堪"-->
+              <!--                min-width="150"-->
+              <!--                sortable="custom"-->
+              <!--              >-->
+              <!--                <template slot-scope="{row}">-->
+              <!--                  <div v-if="row.descr">{{ row.descr }}</div>-->
+              <!--                  <div v-else>/</div>-->
+              <!--                </template>-->
+              <!--              </el-table-column>-->
               <el-table-column
                 prop="plan_qty"
                 label="浠诲姟鏁伴噺"
+                show-tooltip-when-overflow
+                width="110"
                 sortable="custom"
               />
               <el-table-column
+                label="鏈敹鏂欐暟閲�"
+                width="120"
+                show-tooltip-when-overflow
+              >
+                <!--                sortable="custom"-->
+                <template slot-scope="{row}">
+                  <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div>
+                </template>
+              </el-table-column>
+              <el-table-column
                 prop="good_qty"
-                label="宸叉敹鏂欐暟閲�(鑹搧)"
+                label="宸叉敹鏂欐暟閲�"
+                show-tooltip-when-overflow
                 sortable="custom"
                 width="160"
               />
               <el-table-column
                 prop="ng_qty"
                 label="涓嶈壇鏁伴噺"
+                show-tooltip-when-overflow
                 width="150"
-
                 sortable="custom"
+              />
+              <el-table-column
+                prop="bad_qty"
+                label="宸叉姤搴熸暟閲�"
+                min-width="120"
+                sortable="custom"
+                show-tooltip-when-overflow
               />
               <el-table-column
                 prop="plan_startdate"
                 label="璁″垝寮�宸ユ棩鏈�"
-                width="185"
+                show-tooltip-when-overflow
+                width="150"
                 sortable="custom"
-              />
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="plan_enddate"
+                label="璁″垝瀹屽伐鏃ユ湡"
+                show-tooltip-when-overflow
+                width="150"
+                sortable="custom"
+                fixed="right"
+              >
+                <template slot-scope="{row}">
+                  <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0, 11) }}</div>
+                  <div v-else>/</div>
+                </template>
+              </el-table-column>
               <!--              <el-table-column-->
               <!--                label="鎿嶄綔"-->
               <!--                width="150"-->
@@ -284,8 +374,8 @@
               <!--              >-->
               <!--                <template slot-scope="{row}">-->
               <!--                  <div class="operationClass">-->
-              <!--                    <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
-              <!--                    <el-button type="text" @click="del(row)">鍒犻櫎</el-button>-->
+              <!--                    <el-button v-waves type="text" @click="edit('edit',row)">缂栬緫</el-button>-->
+              <!--                    <el-button v-waves type="text" @click="del(row)">鍒犻櫎</el-button>-->
               <!--                  </div>-->
               <!--                </template>-->
               <!--              </el-table-column>-->
@@ -293,106 +383,142 @@
           </div>
           <!--鍒嗛〉-->
           <pagination
-            v-show="WXtotal>0"
             :total="WXtotal"
             :page.sync="WXform.page"
             :limit.sync="WXform.rows"
             align="right"
-            layout="prev, pager, next,sizes"
+            layout="total,prev, pager, next,sizes"
             popper-class="select_bottom"
             @pagination="getMesOrderStepSearch"
           />
         </el-tab-pane>
-        <el-tab-pane v-if="false" label="宸ュ簭妫�楠�">
-          <div style="margin-left: 10px;margin-top:10px;display: flex;flex-direction: column">
-            <div style="margin-bottom: 10px;font-size: 14px">
-              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />鎵爜淇℃伅
-            </div>
+        <el-tab-pane label="涓嶈壇寰呭鐞嗗垪琛�">
+          <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between">
             <div style="display: flex;align-items: center">
               <div style="width: 90px">鎵弿鏉$爜锛�</div>
-              <el-input
-                v-model="GXform.orderstepqrcode"
-                oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"
-                name="GXproduceCode"
-                style="width: 300px"
-                @keyup.enter.native="val=>enterNative(val,'GXproduceCode')"
-              />
-            </div>
-            <div style="line-height: 40px; display: flex;margin-top: 20px">
-              <div style="display: flex;margin-right: 50px">
-                <div style="width: 90px">宸ュ崟缂栫爜锛�</div>
-                <div>PX00120012312</div>
-              </div>
-              <div style="display: flex;">
-                <div style="width: 90px">浜у搧缂栫爜锛�</div>
-                <div>123-446-789</div>
-              </div>
-            </div>
-            <div style="line-height: 40px; display: flex;">
-              <div style="display: flex;margin-right: 50px">
-                <div style="width: 90px">浜у搧鍚嶇О锛�</div>
-                <div>PX00120012312</div>
-              </div>
-              <div style="display: flex;">
-                <div style="width: 90px">浜у搧瑙勬牸锛�</div>
-                <div>123-446-789</div>
-              </div>
-            </div>
-            <div style="line-height: 40px; display: flex;">
-              <div style="display: flex;margin-right: 50px">
-                <div style="width: 90px">宸ュ簭缂栫爜锛�</div>
-                <div>PX00120012312</div>
-              </div>
-              <div style="display: flex;">
-                <div style="width: 90px">宸ュ簭鍚嶇О锛�</div>
-                <div>123-446-789</div>
-              </div>
-            </div>
+              <!--              oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"-->
 
-            <div style="margin: 20px 0;font-size: 14px">
-              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />妫�楠屾爣鍑嗕俊鎭�
-            </div>
-            <div style="display: flex;align-items: center">
-              <div style="width: 90px">妫�楠屾爣鍑嗭細</div>
-              <el-select
-                v-model="dialogForm.aaa"
-                style="width: 200px;"
-                placeholder="璇烽�夋嫨"
-              >
-                <el-option
-                  v-for="item in ARR"
-                  :key="item.code"
-                  :label="item.name"
-                  :value="item.code"
-                />
-              </el-select>
-              <div style="width: 90px;margin-left: 50px;">妫�楠屾爣鍑嗭細</div>
-              <el-select
-                v-model="dialogForm.aaa"
-                style="width: 200px;"
-                placeholder="璇烽�夋嫨"
-              >
-                <el-option
-                  v-for="item in ARR"
-                  :key="item.code"
-                  :label="item.name"
-                  :value="item.code"
-                />
-              </el-select>
-            </div>
-            <div style="margin: 20px 0;font-size: 14px">
-              <i class="el-icon-s-operation" style="color:#42b983; margin-right: 5px" />妫�楠岄」淇℃伅
+              <el-input
+                v-model="badForm.orderstepqrcode"
+                name="badProduceCode"
+                style="width: 300px"
+                @keyup.enter.native="val=>enterNative(val,'badProduceCode')"
+              />
+              <!--              @keyup.native="e=>judgeIsScanning(e,'badProduceCode')"-->
+
             </div>
           </div>
+          <el-divider />
+          <div class="elTableDiv">
+            <el-table
+              ref="tableDataRef"
+              class="tableFixed"
+              :data="badTableData"
+              :height="isIpad? (tableHeight+50):tableHeight"
+              border
+              :row-class-name="tableRowClassName"
+              :style="{width: 100+'%',height:tableHeight+'px',}"
+              highlight-current-row
+              :header-cell-style="this.$headerCellStyle"
+              :cell-style="this.$cellStyle"
+              @sort-change="badSortChange"
+            >
+              <el-table-column
+                prop="RowNum"
+                width="50"
+                label="搴忓彿"
+                fixed
+              />
+              <el-table-column
+                show-tooltip-when-overflow
+                prop="wo_code"
+                label="宸ュ崟鍙�"
+                min-width="160"
+                sortable="custom"
+              />
+              <el-table-column
+                show-tooltip-when-overflow
+                prop="partcode"
+                label="浜у搧缂栫爜"
+                min-width="110"
+                sortable="custom"
+              />
+              <el-table-column
+                show-tooltip-when-overflow
+                prop="partname"
+                min-width="160"
+                label="浜у搧鍚嶇О"
+                sortable="custom"
+              />
+              <el-table-column
+                prop="stepname"
+                label="宸ュ簭"
+                show-tooltip-when-overflow
+                min-width="120"
+                sortable="custom"
+              />
+              <el-table-column
+                prop="plan_qty"
+                label="浠诲姟鏁伴噺"
+                width="110"
+                show-tooltip-when-overflow
+                sortable="custom"
+              />
+              <el-table-column
+                prop="good_qty"
+                label="宸叉姤宸ユ暟閲�"
+                sortable="custom"
+                min-width="160"
+                show-tooltip-when-overflow
+              />
+              <el-table-column
+                prop="ng_qty"
+                label="涓嶈壇鏁伴噺"
+                width="150"
+                show-tooltip-when-overflow
+                sortable="custom"
+              />
+              <el-table-column
+                prop="bad_qty"
+                label="宸叉姤搴熸暟閲�"
+                width="120"
+                sortable="custom"
+                show-tooltip-when-overflow
+              />
+              <el-table-column
+                label="鎿嶄綔"
+                width="120"
+                fixed="right"
+              >
+                <template slot-scope="{row}">
+                  <div class="operationClass">
+                    <el-button v-waves type="text" @click="repairHandle(row)">缁翠慨澶勭悊</el-button>
+                  </div>
+                </template>
+              </el-table-column>
+
+            </el-table>
+          </div>
+          <!--鍒嗛〉-->
+          <pagination
+            :total="badTotal"
+            :page.sync="badForm.page"
+            :limit.sync="badForm.rows"
+            align="right"
+            layout="total,prev, pager, next,sizes"
+            popper-class="select_bottom"
+            @pagination="getBadList"
+          />
         </el-tab-pane>
       </el-tabs>
 
     </div>
 
     <el-dialog
+      v-el-drag-dialog
       :title="dialogTitle"
       :visible.sync="dialogVisible"
-      width="800"
+      width="850px"
       class="dialogVisible"
       :top="dialogTitle==='鑷埗鎶ュ伐'?'5vh':'15vh'"
       :close-on-click-modal="false"
@@ -421,7 +547,7 @@
         <el-form-item label="褰撳墠宸ュ簭锛�">
           <div style="width: 200px">{{ dialogForm.stepname }}</div>
         </el-form-item>
-        <el-form-item label="宸ュ簭鎻忚堪锛�">
+        <el-form-item v-if="false" label="宸ュ簭鎻忚堪锛�">
           <!--          <el-tooltip   class="item" effect="dark" content="鍘熸潗鏂欏垏鎸夋潗鏂欏垏鎸夋潗鏂欏垏鎸夋椂鎵撳崱鏁版嵁鐨勫崱" placement="top-start">-->
           <div style="width: 200px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">
             {{ dialogForm.stepdesc }}
@@ -447,6 +573,7 @@
         <!--鑷埗寮�濮�-->
         <el-form-item v-if="dialogTitle==='鑷埗寮�濮�'" label="寮�宸ユ暟閲忥細">
           <div style="width: 200px">{{ dialogForm.startqty }}</div>
+          <!--          <div style="width: 200px">{{  dialogForm.noreportqty }}</div>-->
         </el-form-item>
         <el-form-item v-if="dialogTitle==='鑷埗寮�濮�'" prop="eqpcode" label="鐢熶骇璁惧锛�">
           <el-select
@@ -497,6 +624,7 @@
         </el-form-item>
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐鏁伴噺锛�" prop="startqty">
           <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />
+          <!--          <el-input v-model="dialogForm.noreportqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />-->
         </el-form-item>
         <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="涓嶈壇鏁伴噺锛�">
           <el-input v-model="dialogForm.noputqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />
@@ -508,6 +636,7 @@
             placeholder="璇烽�夋嫨"
             :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
             multiple
+            collapse-tags
           >
             <el-option
               v-for="item in badArr"
@@ -517,13 +646,35 @@
             />
           </el-select>
         </el-form-item>
+        <!--        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜哄憳锛�">-->
+        <!--          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />-->
+        <!--        </el-form-item>-->
+        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="鎶ュ伐浜猴細">
+          <el-select
+            v-model="dialogForm.operation"
+            style="width: 200px;"
+            placeholder="璇烽�夋嫨"
+          >
+            <el-option
+              v-for="item in OperationArr"
+              :key="item.usercode"
+              :label="item.username"
+              :value="item.usercode"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="dialogTitle==='鑷埗鎶ュ伐'" label="澶囨敞锛�">
+          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
+        </el-form-item>
         <div v-if="dialogTitle==='鑷埗鎶ュ伐'">
-          <i class="el-icon-s-operation" style="color:#42b983;" /> 浜哄憳鍒楄〃
-          <el-button type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
+          <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 浜哄憳鍒楄〃
+          <el-button v-waves type="primary" style="margin: 10px 0" @click="userAdd">澧炶</el-button>
           <el-table
+            ref="userTableDataRef"
             :data="userTableData"
             border
-            stripe
+            class="tableFixed"
+            :row-class-name="tableRowClassName"
             :header-cell-style="this.$headerCellStyle"
             :cell-style="this.$cellStyle"
             height="180"
@@ -534,10 +685,12 @@
               width="100"
               label="搴忓彿"
               type="index"
+              fixed
             />
             <el-table-column
               prop="username"
               label="浜哄憳鍚嶇О"
+              show-tooltip-when-overflow
             >
               <template slot-scope="{row}">
                 <div v-if="row.isVisible===0">{{ row.username }}</div>
@@ -560,24 +713,24 @@
             <el-table-column
               prop="RowNum"
               label="鎿嶄綔"
+              fixed="right"
             >
               <template slot-scope="{row}">
                 <div class="operationClass">
-                  <el-button v-if="row.isVisible===0" type="text" @click="userDel(row)">鍒犻櫎</el-button>
-                  <el-button v-if="row.isVisible===1&&!userIsSave" type="text" @click="userSave(row)">淇濆瓨</el-button>
-                  <el-button v-if="row.isVisible===1" type="text" @click="userCancel(row)">鍙栨秷</el-button>
+                  <el-button v-if="row.isVisible===0" v-waves type="text" @click="userDel(row)">鍒犻櫎</el-button>
+                  <el-button v-if="row.isVisible===1&&!userIsSave" v-waves type="text" @click="userSave(row)">淇濆瓨</el-button>
+                  <el-button v-if="row.isVisible===1" v-waves type="text" @click="userCancel(row)">鍙栨秷</el-button>
                 </div>
               </template>
             </el-table-column>
           </el-table>
           <!--鍒嗛〉-->
           <pagination
-            v-show="UserTotal>0"
             :total="UserTotal"
             :page.sync="Userform.page"
             :limit.sync="Userform.rows"
             align="right"
-            layout="prev, pager, next,sizes"
+            layout="total,prev, pager, next,sizes"
             popper-class="select_bottom"
             @pagination="getMesOrderStepSearch"
           />
@@ -696,12 +849,13 @@
         <el-form-item
           v-if="dialogTitle==='澶栧崗鏀舵枡'"
           label="涓嶈壇鍘熷洜锛�"
-          prop="badcode"
         >
+          <!--          prop="badcode"-->
           <el-select
             v-model="dialogForm.badcode"
             style="width: 200px;"
             multiple
+            collapse-tags
             :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''"
             placeholder="璇烽�夋嫨"
           >
@@ -713,18 +867,327 @@
             />
           </el-select>
         </el-form-item>
-
+        <!--        <el-form-item v-if="dialogTitle==='澶栧崗鏀舵枡'" label="鏀舵枡浜猴細">-->
+        <!--          <el-select-->
+        <!--            v-model="dialogForm.operation"-->
+        <!--            style="width: 200px;"-->
+        <!--            placeholder="璇烽�夋嫨"-->
+        <!--          >-->
+        <!--            <el-option-->
+        <!--              v-for="item in OperationArr"-->
+        <!--              :key="item.usercode"-->
+        <!--              :label="item.username"-->
+        <!--              :value="item.usercode"-->
+        <!--            />-->
+        <!--          </el-select>-->
+        <!--        </el-form-item>-->
+        <el-form-item v-if="dialogTitle==='澶栧崗鏀舵枡'" label="澶囨敞锛�">
+          <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />
+        </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
-          <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button v-if="dialogTitle==='鑷埗寮�濮�'" type="primary" @click="dialogVisibleConfirm">寮� 宸�</el-button>
-          <el-button v-if="dialogTitle==='鑷埗鎶ュ伐'" type="primary" @click="dialogVisibleConfirm">鎻愪氦/鎵撳嵃</el-button>
-          <el-button v-if="dialogTitle==='澶栧崗鍙戞枡'" type="primary" @click="dialogVisibleConfirm">鍙戞枡</el-button>
-          <el-button v-if="dialogTitle==='澶栧崗鏀舵枡'" type="primary" @click="dialogVisibleConfirm">鏀舵枡/鎵撳嵃</el-button>
+          <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-if="dialogTitle==='鑷埗寮�濮�'"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >寮� 宸�</el-button>
+          <el-button
+            v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.nextstepname===''"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >鎻愪氦/鎵撳嵃</el-button>
+          <el-button
+            v-if="dialogTitle==='鑷埗鎶ュ伐'&&dialogForm.nextstepname!==''"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >鎻愪氦</el-button>
+          <el-button
+            v-if="dialogTitle==='澶栧崗鍙戞枡'"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >鍙戞枡</el-button>
+          <el-button
+            v-if="dialogTitle==='澶栧崗鏀舵枡'&&dialogForm.nextstepname===''"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >鏀舵枡/鎵撳嵃</el-button>
+          <el-button
+            v-if="dialogTitle==='澶栧崗鏀舵枡'&&dialogForm.nextstepname!==''"
+            v-waves
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            type="primary"
+            @click="dialogVisibleConfirm"
+          >鏀舵枡</el-button>
         </div>
       </span>
     </el-dialog>
+
+    <!--鎵撳嵃棰勮椤甸潰  灏忔爣绛�-->
+    <el-dialog
+      v-el-drag-dialog
+      title="棰勮"
+      :visible.sync="dialogVisible2"
+      width="1140"
+      top="10vh"
+      :close-on-click-modal="false"
+      @close="dialogVisible2Close"
+    >
+      <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
+      <div id="printMe2" style="padding: 30px;">
+        <div
+          style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+        >
+
+          <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
+            <div
+              style="display: flex;height: 90px;border-bottom:1px solid #000;
+              justify-content: center;align-items: center;position: relative"
+            >
+              <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+            </div>
+            <div
+              style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
+            >
+              <div style="margin-left: 5px;width: 28px">鏁伴噺:</div>
+              {{ qrForm.startqty }}
+            </div>
+            <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
+              <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>
+              {{ qrForm.operator }}
+            </div>
+          </div>
+
+          <div style="width:190px;display: flex;flex-direction: column">
+            <div
+              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
+            >
+              <div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>
+              <div>{{ qrForm.wo_code }}</div>
+            </div>
+            <div
+              style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
+            >
+              <div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>
+              <div>{{ qrForm.partcode }}</div>
+            </div>
+            <div
+              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+            >
+              <div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>
+              <div>{{ qrForm.partname }}</div>
+            </div>
+            <div
+              style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+            >
+              <div style="width:60px;margin-left: 5px;">涓嬮亾宸ュ簭:</div>
+              <div>{{ qrForm.nextstepname }}</div>
+            </div>
+            <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
+              <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>
+              <div>{{ qrForm.operatorTime }}</div>
+            </div>
+
+          </div>
+
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="dialogVisible2 = false">鍙� 娑�</el-button>
+          <el-button v-waves v-print="printObj2" type="primary">纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
+    <!--    涓嶈壇澶勭悊鍒楄〃瀵硅瘽妗�-->
+    <el-dialog
+      v-el-drag-dialog
+      title="缁翠慨澶勭悊"
+      :visible.sync="badDialogVisible"
+      width="990px"
+      class="badDialogVisible"
+      top="10vh"
+      :close-on-click-modal="false"
+      @close="handleCloseBad"
+      @closed="handleCloseBad"
+    >
+      <el-form
+        inline
+        :model="badDialogForm"
+        label-width="110px"
+      >
+        <el-form-item label="宸ュ崟缂栧彿锛�">
+          <div style="width: 200px">{{ badDialogForm.wo_code }}</div>
+        </el-form-item>
+        <el-form-item label="浜у搧缂栫爜锛�">
+          <div style="width: 200px">{{ badDialogForm.partcode }}</div>
+        </el-form-item>
+        <el-form-item label="浜у搧鍚嶇О锛�">
+          <div style="width: 200px">{{ badDialogForm.partname }}</div>
+        </el-form-item>
+        <el-form-item label="浜у搧瑙勬牸锛�">
+          <div style="width: 200px">{{ badDialogForm.partspec }}</div>
+        </el-form-item>
+        <el-form-item label="褰撳墠宸ュ簭锛�">
+          <div style="width: 200px">{{ badDialogForm.stepname }}</div>
+        </el-form-item>
+        <el-form-item label="涓嬮亾宸ュ簭锛�">
+          <div style="width: 200px">{{ badDialogForm.nextstepname }}</div>
+        </el-form-item>
+        <el-form-item label="浠诲姟鏁伴噺锛�">
+          <div style="width: 200px">{{ badDialogForm.plan_qty }}</div>
+        </el-form-item>
+        <el-form-item label="鎶ュ伐鏁伴噺锛�">
+          <div style="width: 200px">{{ badDialogForm.good_qty }}</div>
+        </el-form-item>
+        <el-form-item label="涓嶈壇鏁伴噺锛�">
+          <div style="width: 200px">{{ badDialogForm.ng_qty }}</div>
+        </el-form-item>
+
+        <el-form-item label="缁翠慨浜哄憳锛�">
+          <el-select
+            v-model="badDialogForm.operation"
+            style="width: 200px;"
+            placeholder="璇烽�夋嫨"
+          >
+            <el-option
+              v-for="item in OperationArr"
+              :key="item.usercode"
+              :label="item.username"
+              :value="item.usercode"
+            />
+          </el-select>
+        </el-form-item>
+
+      </el-form>
+      <div style="margin-bottom:20px">
+        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 涓嶈壇淇℃伅鏄庣粏锛�
+      </div>
+      <div class="elTableDiv">
+        <el-table
+          :data="badTableDataDialog"
+          :height="isIpad? (tableHeight-350):(tableHeight-400)"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:(tableHeight-400)+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+        >
+          <el-table-column
+            type="index"
+            width="50"
+            label="搴忓彿"
+            fixed
+          />
+          <el-table-column
+            prop="step_code"
+            label="宸ュ簭缂栫爜"
+            min-width="80"
+          />
+          <el-table-column
+            prop="stepname"
+            label="宸ュ簭鍚嶇О"
+            min-width="80"
+          />
+
+          <el-table-column
+            prop="plan_qty"
+            label="浠诲姟鏁伴噺"
+            width="80"
+          />
+          <el-table-column
+            label="鎶ュ伐鏁伴噺"
+            width="80"
+            prop="report_qty"
+          />
+          <el-table-column
+            prop="ng_qty"
+            label="涓嶈壇鏁伴噺"
+            width="80"
+          />
+          <el-table-column
+            prop="badqty"
+            label="宸叉姤搴熸暟閲�"
+            width="100"
+          />
+          <el-table-column
+            prop="defect_name"
+            label="涓嶈壇鍘熷洜"
+            show-tooltip-when-overflow
+            width="80"
+          />
+          <el-table-column
+            prop="repair_qty"
+            label="缁翠慨鍚堟牸鏁伴噺"
+            width="110"
+          >
+            <template slot-scope="{row}">
+              <!--              {{ row.repair_qty }}-->
+              <div v-if="row.isVisible===0">{{ row.repair_qty }}</div>
+              <el-input v-if="row.isVisible===1" v-model="row.repair_qty" oninput="value=value.replace(/[^0-9]/g,'')" />
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="bad_qty"
+            label="鎶ュ簾鏁伴噺"
+            width="90"
+          >
+            <!--            oninput="value=value.replace(/[0-9]/g,'')"-->
+            <template slot-scope="{row}">
+              <div v-if="row.isVisible===0">{{ row.bad_qty }}</div>
+              <el-input v-if="row.isVisible===1" v-model="row.bad_qty" oninput="value=value.replace(/[^0-9]/g,'')" />
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鎿嶄綔"
+            width="100"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-button v-if="row.isVisible===0" v-waves type="text" @click="badEdit(row)">缂栬緫</el-button>
+                <el-button v-if="row.isVisible===0" v-waves type="text" @click="badDel(row)">鍒犻櫎</el-button>
+
+                <el-button v-if="row.isVisible===1" v-waves type="text" @click="badSave(row)">纭</el-button>
+                <el-button v-if="row.isVisible===1" v-waves type="text" @click="badCancel(row)">鍙栨秷</el-button>
+              </div>
+            </template>
+          </el-table-column>
+
+        </el-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="badDialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-waves
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="badDialogVisibleConfirm "
+          >淇� 瀛�/鎵� 鍗�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -744,9 +1207,14 @@
   MesOrderStepSelectCause,
   SavaMesOrderStepIn,
   SavaMesOrderStepStart,
-  SavaMesOrderStepReport
+  SavaMesOrderStepReport, MesOrderNgStepSearch, MesOrderNgSubStepSearch, EditOrderNgStepSeave
 } from '@/api/scgl'
-import { urlAddRandomNo, webapp_urlprotocol_startup, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
+import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp'
+import QRCode from 'qrcodejs2'
+import { getCookie } from '@/utils/auth'
+import { handleDatetime2 } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
@@ -754,6 +1222,7 @@
   components: {
     Pagination
   },
+  directives: { elDragDialog, waves },
   data() {
     const validateName = (rule, value, callback) => {
       if (!value) {
@@ -776,6 +1245,7 @@
     return {
       mainHeight: 0,
       tableHeight: 0,
+      isIpad: false,
       // produceCode: '', // 宸ュ簭鐮�
       // WXproduceCode: '', // 澶栧崗宸ュ簭鐮�
       radioSelected: '', // 宸ュ簭閫変腑
@@ -826,7 +1296,7 @@
         taskqty: '', // 浠诲姟鏁伴噺
         fqty: '', // 鍙戞枡鏁伴噺
 
-        inuser: '', // 鏀舵枡浜哄憳
+        inuser: getCookie('navTabId'), // 鏀舵枡浜哄憳
         sqty: '', // 鏀舵枡鏁伴噺
         ngqty: '', // 涓嶈壇鏁伴噺
         badcode: '', // 涓嶈壇鍘熷洜缂栫爜
@@ -838,7 +1308,10 @@
         usergroupcode: '', // 鐝粍缂栫爜
         reportuser: '', // 鎶ュ伐浜哄憳
 
-        startqtySum: '' // 涓嶈兘瓒呰繃鐨勬暟鍊�
+        startqtySum: '', // 涓嶈兘瓒呰繃鐨勬暟鍊�
+
+        operation: getCookie('navTabId'), // 鎶ュ伐浜猴紙鏀舵枡浜猴級
+        remarks: ''// 澶囨敞
 
       },
       ZZuserArr: [], // 鑷埗鐢ㄦ埛鎵�鏈�
@@ -884,16 +1357,85 @@
         ]
       },
       activeName: '',
-      GXform: { // 宸ュ簭
-        orderstepqrcode: '' // 鎵弿鐨勪簩缁寸爜淇℃伅
-        // prop: 'wo_code', // 鎺掑簭瀛楁z
-        // order: 'asc', // 鎺掑簭瀛楁
-        // page: 1, // 绗嚑椤�
-        // rows: 20 // 姣忛〉澶氬皯鏉�
-      }
-
+      dialogVisible2: false,
+      printObj2: {
+        id: 'printMe2',
+        popTitle: '鎵撳嵃妯℃澘',
+        preview: false,
+        extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
+        closeCallback(vue) { // 鍏抽棴鎵撳嵃鐨勫洖璋冧簨浠讹紙鏃犳硶纭畾鐐瑰嚮鐨勬槸纭杩樻槸鍙栨秷锛�
+          console.log('11212', vue)
+          // vue.dialogVisible = false
+          vue.dialogVisible2 = false
+          vue.dialogVisible = false
+        },
+        beforeOpenCallback(vue) {
+          vue.printLoading = true
+          console.log('鎵撳紑涔嬪墠')
+          console.log()
+        },
+        openCallback(vue) {
+          vue.printLoading = false
+          console.log('鎵ц浜嗘墦鍗�')
+        }
+      },
+      qrForm: { // 鎵撳嵃鍐呭
+        qrvalue: '',
+        startqty: '',
+        wo_code: '',
+        partcode: '',
+        partname: '',
+        nextstepname: '',
+        operator: '', // 鎿嶄綔浜�
+        operatorTime: ''// 鎿嶄綔鏃堕棿
+      },
+      badForm: {
+        orderstepqrcode: '', // 鎵弿鐨勪簩缁寸爜
+        prop: 'wo_code',
+        order: 'asc',
+        page: 1,
+        rows: 20
+      },
+      badTableData: [], // 涓嶈壇澶勭悊鍒楄〃table鏁版嵁
+      badTotal: 0,
+      badDialogVisible: false,
+      badDialogForm: {
+        operation: getCookie('navTabId')
+      },
+      badTableDataDialog: [], // 涓嶈壇瀵硅瘽妗唗able琛ㄦ牸
+      OperationArr: [], // 浜哄憳鏁扮粍
+      sendButtonIsDisabled: false, // 涓嬭揪鎸夐挳鏄惁鍙偣鍑�
+      judgeIsScanningArr: [], // 鍒ゆ柇鏄惁鎵爜鏁扮粍
+      countJudgeIsScanningInput: 0 // 鍒ゆ柇鎵爜妗嗙殑涓暟
     }
   },
+  watch: {
+    // 'form.orderstepqrcode': {
+    //   handler(newValue) {
+    //     this.form.orderstepqrcode = newValue
+    //
+    //     // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+    //     this.fnThrottle(this.enterNative, 500, 2000, 'produceCode')()
+    //   }
+    // },
+    // 'WXform.orderstepqrcode': {
+    //   handler(newValue) {
+    //     this.form.orderstepqrcode = newValue
+    //
+    //     // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+    //     this.fnThrottle(this.enterNative, 500, 2000, 'WXproduceCode')()
+    //   }
+    // },
+    // 'badForm.orderstepqrcode': {
+    //   handler(newValue) {
+    //     this.form.orderstepqrcode = newValue
+    //
+    //     // 鍦ㄨ繖閲岃皟鐢紝骞舵墽琛宼his.fnThrottle(this.search, 500, 2000)();
+    //     this.fnThrottle(this.enterNative, 500, 2000, 'badProduceCode')()
+    //   }
+    // }
+  },
+
   created() {
     this.getMesOrderStepSearch()
     this.tabClick()
@@ -904,11 +1446,18 @@
 
     this.$nextTick(() => {
       $("input[name='produceCode']")[0].focus()
+      // this.bindQRCode('10001;001')
     })
     // webapp_urlprotocol_startup()
-    webapp_ws_autoupdate(true)
+    // webapp_ws_autoupdate(true)
+
+    this.getMesOrderSelectUserAll() // 鑾峰彇鎵�鏈変汉鍛�
   },
   methods: {
+
+    tableRowClassName({ row, rowIndex }) {
+      return 'custom-row'
+    },
     async getMesOrderStepSearch() {
       const res = await MesOrderStepSearch(this.form)
       if (res.code === '200') {
@@ -948,6 +1497,18 @@
       this.WXform.prop = prop
       this.getMesOrderWxStepSearch()
     },
+    badSortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.badForm.order = order
+      this.badForm.prop = prop
+      this.getBadList()
+    },
     // 鑷埗椤电鍘熺偣鐐瑰嚮
     getCurrentRow(val) {
 
@@ -963,25 +1524,126 @@
         this.$nextTick(() => {
           this.getMesOrderStepSearch()
           $("input[name='produceCode']")[0].focus()
-          // this.WXform.orderstepqrcode = ''
+          this.WXform.orderstepqrcode = ''
         })
       }
       if (this.$refs.elTabs.currentName === '1') {
         this.$nextTick(() => {
           this.getMesOrderWxStepSearch()
           $("input[name='WXproduceCode']")[0].focus()
-          // this.form.orderstepqrcode = ''
+          this.form.orderstepqrcode = ''
         })
       }
       if (this.$refs.elTabs.currentName === '2') {
         this.$nextTick(() => {
-          $("input[name='GXproduceCode']")[0].focus()
+          this.getBadList()
+          $("input[name='badProduceCode']")[0].focus()
+          this.badForm.orderstepqrcode = ''
         })
+      }
+    },
+    // 闃叉姈      //鎵爜鐢ㄧ殑鏄槻鎶�
+    fnThrottle(method, delay, duration, belong) {
+      var that = this
+      var timer = this.timer
+      var begin = new Date().getTime()
+      return function() {
+        var current = new Date().getTime()
+        clearTimeout(timer)
+        if (current - begin >= duration) {
+          // method()
+          // that.VALUE()
+          begin = current
+        } else {
+          that.timer = setTimeout(function() {
+            // method()
+            if (belong === 'produceCode') {
+              that.enterNative(that.form.orderstepqrcode, belong)
+            }
+            if (belong === 'WXproduceCode') {
+              that.enterNative(that.WXform.orderstepqrcode, belong)
+            }
+            if (belong === 'badProduceCode') {
+              that.enterNative(that.badForm.orderstepqrcode, belong)
+            }
+          }, delay)
+        }
+      }
+    },
+    // 鍒ゆ柇鏄惁鏄壂鐮佹灙鎵爜
+    judgeIsScanning2(e, belong) {
+      if (belong === 'produceCode' && this.form.orderstepqrcode.toString().length === 0) {
+        this.judgeIsScanningArr = []
+        this.countJudgeIsScanningInput = 0
+      }
+      if (belong === 'WXproduceCode' && this.WXform.orderstepqrcode.toString().length === 0) {
+        this.judgeIsScanningArr = []
+        this.countJudgeIsScanningInput = 0
+      }
+      const timenow = e.timeStamp
+      // console.log(timenow, 1)
+      // let flag = true
+      let flag = false
+      this.judgeIsScanningArr.push(timenow)
+      let i
+
+      for (i in this.judgeIsScanningArr) {
+        console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]))
+        // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+        if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1) {
+          this.countJudgeIsScanningInput++
+        }
+        if (this.countJudgeIsScanningInput >= 3) {
+          flag = true
+        }
+        if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+          if (flag) {
+            console.log(flag, 1)
+            this.fnThrottle(this.enterNative, 500, 2000, belong)()
+            return
+          }
+        }
+      }
+
+      // // for (i in this.judgeIsScanningArr) {
+      // // console.log(i)
+      // // console.log( this.judgeIsScanningArr)
+      // console.log(Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]))
+      // if (Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 10) {
+      //   this.countJudgeIsScanningInput++
+      // }
+      // if (this.countJudgeIsScanningInput > this.judgeIsScanningArr.length / 2) {
+      //   flag = true
+      // }
+      // // flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+      // // if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+      // if (flag) {
+      //   console.log(flag, 2)
+      //   this.fnThrottle(this.enterNative, 500, 2000, belong)()
+      //   return
+      // }
+      // // }
+      // // }
+    },
+    // 鍒ゆ柇鏄惁鏄壂鐮佹灙鎵爜
+    judgeIsScanning(e, belong) {
+      const timenow = e.timeStamp
+      let flag = true
+      this.judgeIsScanningArr.push(timenow)
+      let i
+      for (i in this.judgeIsScanningArr) {
+        flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 0.1
+        if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) {
+          if (flag) {
+            this.fnThrottle(this.enterNative, 500, 2000, belong)()
+            return
+          }
+        }
       }
     },
     // 鎵爜閿洏鍥炶溅浜嬩欢
     async enterNative(val, belong) {
-      console.log(val, belong)
+      console.log(val, belong, 89898989)
       // 寮�宸ワ細code="200"  count=0
       // 鎶ュ伐锛歝ode="200"  count=1
       // 鍙戞枡锛歝ode="200"  count=2
@@ -1018,8 +1680,11 @@
         }
       }
 
-      if (belong === 'GXproduceCode') {
-        console.log('GXproduceCode')
+      if (belong === 'badProduceCode') {
+        // this.badForm.orderstepqrcode=
+        await this.getBadList()
+        await this.repairHandle(this.badForm.orderstepqrcode)
+        this.badDialogVisible = true
       }
     },
     // 鏌ヨ
@@ -1046,7 +1711,8 @@
         this.dialogForm.planqty = obj.planqty
         this.dialogForm.reportqty = obj.reportqty
         this.dialogForm.noreportqty = obj.noreportqty
-        this.dialogForm.startqty = obj.startqty
+        // this.dialogForm.startqty = obj.startqty
+        this.dialogForm.startqty = obj.noreportqty
       })
 
       await this.getMesOrderStepStartSelectEqp()
@@ -1072,15 +1738,13 @@
         this.dialogForm.reportqty = obj.reportqty
         this.dialogForm.noputqty = obj.noputqty
         this.dialogForm.noreportqty = obj.noreportqty
-        this.dialogForm.startqty = obj.startqty
+        // this.dialogForm.startqty = obj.startqty
+        this.dialogForm.startqty = obj.noreportqty
 
-        if (obj.nextstepname === null || obj.nextstepcode === '') {
-          this.dialogForm.nextstepname = obj.stepname
-        } else {
-          this.dialogForm.nextstepname = obj.nextstepname
-        }
+        this.dialogForm.nextstepname = obj.nextstepname
+        this.dialogForm.nextstepcode = obj.nextstepcode
 
-        this.dialogForm.startqtySum = obj.startqty
+        this.dialogForm.startqtySum = obj.noreportqty
       })
 
       await this.getMesOrderStepStartSelectEqp()
@@ -1137,11 +1801,10 @@
         this.dialogForm.reportqty = obj.reportqty
         this.dialogForm.noreportqty = obj.noreportqty
         this.dialogForm.stepcode = obj.stepcode
-        if (obj.nextstepname === null || obj.nextstepcode === '') {
-          this.dialogForm.nextstepname = obj.stepname
-        } else {
-          this.dialogForm.nextstepname = obj.nextstepname
-        }
+
+        this.dialogForm.nextstepname = obj.nextstepname
+        this.dialogForm.nextstepcode = obj.nextstepcode
+
         this.dialogForm.noputqty = obj.noputqty
         this.dialogForm.stepseq = obj.seq
         this.dialogForm.sqty = obj.startqty
@@ -1155,7 +1818,7 @@
     // 鐢熶骇鐝粍涓嬫媺鏀瑰彉
     usergroupChange(val) {
       this.dialogForm.usergroupcode = val
-      this.getUserTableData()
+      this.getMesOrderSelectUserZZ2()
     },
     // 鑾峰彇鑷埗鎶ュ伐鐢熶骇鐝粍涓嬫媺鍒楄〃
     async getMesOrderStepReportSelectUserGroup() {
@@ -1166,6 +1829,11 @@
     async getMesOrderSelectUserZZ() {
       const { data: res } = await MesOrderSelectUser({ usercode: this.dialogForm.usergroupcode })
       this.ZZuserArr = res
+    },
+    async getMesOrderSelectUserZZ2() {
+      const { data: res } = await MesOrderSelectUser({ usercode: '' })
+      this.ZZuserArr = res
+      await this.getUserTableData()
     },
     // 鑾峰彇鑷埗鐢熶骇璁惧涓嬫媺
     async getMesOrderStepStartSelectEqp() {
@@ -1204,9 +1872,16 @@
         item.isVisible = 0
         item.number = number
       })
+
+      this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode))
+
+      this.$refs.tableDataRef.doLayout()
     },
     // 鐢ㄦ埛娣诲姞
     userAdd() {
+      if (this.userTableData.find(i => i.isVisible === 1)) {
+        return this.$message.info('璇峰厛淇濆瓨褰撳墠琛屼俊鎭紒')
+      }
       let number = Math.random() * Math.random()// 浣滀负鍒犻櫎鏃剁殑鏍囪瘑绗�
       number = number === 0 ? (10 + Math.random()) : number
       console.log(this.userTableData, 6)
@@ -1214,6 +1889,11 @@
     },
     // 鐢ㄦ埛鍒楄〃鍒犻櫎
     userDel(row) {
+      this.ZZuserArr.splice(0, 0, {
+        usercode: row.usercode,
+        username: row.username
+      })
+
       this.userTableData.forEach((item, index) => {
         if (item.number === row.number) {
           this.userTableData.splice(index, 1)
@@ -1222,6 +1902,17 @@
     },
     // 鐢ㄦ埛鍒楄〃淇濆瓨
     userSave(row) {
+      console.log(row, 123)
+      if (row.usercode === '') {
+        return this.$message.info('浜哄憳鍚嶇О涓嶈兘涓虹┖锛�')
+      }
+
+      this.ZZuserArr.forEach((item, index) => {
+        if (item.usercode === row.usercode) {
+          this.ZZuserArr.splice(index, 1)
+        }
+      })
+
       this.userTableData.forEach(item => {
         if (item.number === row.number) {
           item.isVisible = 0
@@ -1252,6 +1943,11 @@
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
+      this.judgeIsScanningArr = []
+      this.form.orderstepqrcode = ''
+      this.WXform.orderstepqrcode = ''
+      this.badForm.orderstepqrcode = ''
+
       this.dialogForm.wo_code = '', // 宸ュ崟缂栧彿
       this.dialogForm.partcode = '', // 浜у搧缂栫爜
       this.dialogForm.partname = '', // 浜у搧鍚嶇О
@@ -1271,7 +1967,7 @@
       this.dialogForm.taskqty = '', // 浠诲姟鏁伴噺
       this.dialogForm.fqty = '', // 鍙戞枡鏁伴噺
 
-      this.dialogForm.inuser = '', // 鏀舵枡浜哄憳
+      this.dialogForm.inuser = getCookie('navTabId'), // 鏀舵枡浜哄憳  榛樿鐧诲綍浜哄憳
       this.dialogForm.sqty = '', // 鏀舵枡鏁伴噺
       this.dialogForm.ngqty = '', // 涓嶈壇鏁伴噺
       this.dialogForm.badcode = '', // 涓嶈壇鍘熷洜缂栫爜
@@ -1284,6 +1980,12 @@
       this.dialogForm.reportuser = '', // 鎶ュ伐浜哄憳
 
       this.dialogForm.startqtySum = '' // 涓嶈兘瓒呰繃鐨勬暟鍊�
+
+      this.dialogForm.nextstepcode = '' // 涓嬮亾宸ュ簭缂栫爜
+
+      this.dialogForm.remarks = '' // 澶囨敞
+      this.dialogForm.operation = getCookie('navTabId') // 鎶ュ伐浜猴紙鏀舵枡浜猴級
+      this.userTableData = [] // 浜哄憳鍒楄〃
 
       this.$refs.dialogForm.clearValidate()
     },
@@ -1310,11 +2012,13 @@
               taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
               fqty: this.dialogForm.fqty // 鍙戞枡鏁伴噺
             }
+            this.$store.state.app.buttonIsDisabled = true
             SavaMesOrderStepOut(data).then(res => {
               if (res.code === '200') {
-                this.$message.success('鍙戞枡鎴愬姛锛�')
                 this.dialogVisible = false
+                this.$message.success('鍙戞枡鎴愬姛锛�')
                 this.tabClick()
+                this.$store.state.app.buttonIsDisabled = false
               } else {
                 this.$message.error('鍙戞枡澶辫触!')
               }
@@ -1341,15 +2045,21 @@
               inuser: this.dialogForm.inuser, // 鍙戞枡浜哄憳
               taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
               sqty: this.dialogForm.sqty, // 鏀舵枡鏁伴噺
+              remarks: this.dialogForm.remarks, // 澶囨敞
               ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
               badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
             }
+            this.$store.state.app.buttonIsDisabled = true
             SavaMesOrderStepIn(data).then(res => {
               if (res.code === '200') {
-                this.WXprint()
-                this.$message.success('鏀舵枡鎴愬姛锛�')
                 this.dialogVisible = false
+                this.$message.success('鏀舵枡鎴愬姛锛�')
+                if (this.dialogForm.nextstepcode === '') {
+                  this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username)
+                  this.dialogVisible2 = true
+                }
                 this.tabClick()
+                this.$store.state.app.buttonIsDisabled = false
               } else {
                 this.$message.error('鏀舵枡澶辫触!')
               }
@@ -1366,11 +2076,13 @@
               taskqty: this.dialogForm.planqty, // 浠诲姟鏁伴噺
               startqty: this.dialogForm.startqty// 寮�濮嬫暟閲�
             }
+            this.$store.state.app.buttonIsDisabled = true
             SavaMesOrderStepStart(data).then(res => {
               if (res.code === '200') {
-                this.$message.success('寮�宸ユ垚鍔燂紒')
                 this.dialogVisible = false
+                this.$message.success('寮�宸ユ垚鍔燂紒')
                 this.tabClick()
+                this.$store.state.app.buttonIsDisabled = false
               } else {
                 this.$message.error('寮�宸ュけ璐�!')
               }
@@ -1390,7 +2102,13 @@
                 return this.$message.info('璇烽�夋嫨涓嶈壇鍘熷洜锛�')
               }
             }
-
+            // this.userTableData = [...new Set(this.userTableData)]// 鏁扮粍鍘婚噸
+            this.userTableData = this.userTableData.filter(item => item.usercode !== '')
+            // 鏁扮粍涓璞$浉鍚岀殑鍘婚噸
+            this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => {
+              return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex
+            })
+            // console.log(this.userTableData, 1)
             const reportuser = this.userTableData.map(item => item.usercode).join(';')
             const data = {
               mesordercode: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
@@ -1405,15 +2123,21 @@
               startqty: this.dialogForm.reportqty, // 寮�宸ユ暟閲�
               // reportqty: this.dialogForm.reportqty, // 鎶ュ伐鏁伴噺
               reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
+              remarks: this.dialogForm.remarks, // 澶囨敞
               ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // 涓嶈壇鏁伴噺
               badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// 涓嶈壇鍘熷洜
             }
+            this.$store.state.app.buttonIsDisabled = true
             SavaMesOrderStepReport(data).then(res => {
               if (res.code === '200') {
-                this.ZZprint()
-                this.$message.success('鎶ュ伐鎴愬姛锛�')
                 this.dialogVisible = false
+                this.$message.success('鎶ュ伐鎴愬姛锛�')
+                if (this.dialogForm.nextstepcode === '') {
+                  this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username)
+                  this.dialogVisible2 = true
+                }
                 this.tabClick()
+                this.$store.state.app.buttonIsDisabled = false
               } else {
                 this.$message.error('鎶ュ伐澶辫触!')
               }
@@ -1422,55 +2146,249 @@
         }
       })
     },
-    async ZZprint() {
-      const obj = {
-        recordset: [
-          {
-            wo_code: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
-            partcode: this.dialogForm.partcode, // 浜у搧缂栫爜
-            partname: this.dialogForm.partname, // 浜у搧鍚嶇О
-            next_stepname: this.dialogForm.nextstepname, // 涓嬮亾宸ュ簭
-            qty: this.dialogForm.startqty, // 鏁伴噺
-            qrcode: this.form.orderstepqrcode// 浜岀淮鐮�
-          }
-        ]
-      }
-      const args = {
-        type: 'print', // preview  print
-        showOptionDlg: false, // 濡傛灉涓嶆樉绀烘墦鍗板璇濇鑰岀洿鎺ユ墦鍗帮紝灏嗘琛屾敞閲婂幓鎺夊嵆鍙�
-        report: urlAddRandomNo('./static/grf/鎶ュ伐浜у嚭鏍囩.grf'),
-        data: obj
-      }
-      webapp_ws_ajax_run(args)
+    // 鐢熸垚浜岀淮鐮�
+    bindQRCode(text) {
+      new QRCode(this.$refs.qrCodeDiv2, {
+        text: text,
+        // width: 50,
+        width: 60,
+        // height: 50,
+        height: 60,
+        colorDark: '#000', // 浜岀淮鐮侀鑹�
+        colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+        correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+      })
     },
-    // 澶栧崗鏀舵枡鎵撳嵃
-    WXprint() {
-      // 鍙傛暟鍏蜂綋璇存槑璇峰弬鑰冨府鍔╂枃妗d腑鐨勨�淲EB鎶ヨ〃(B/S鎶ヨ〃)->WEB鎶ヨ〃瀹㈡埛绔�->鍚姩鍙傛暟璇存槑鈥濋儴鍒�
-      const obj = {
-        recordset: [
-          {
-            wo_code: this.dialogForm.wo_code, // 宸ュ崟缂栧彿
-            partcode: this.dialogForm.partcode, // 浜у搧缂栫爜
-            partname: this.dialogForm.partname, // 浜у搧鍚嶇О
-            next_stepname: this.dialogForm.nextstepname, // 涓嬮亾宸ュ簭
-            qty: this.dialogForm.sqty, // 鏁伴噺
-            qrcode: this.WXform.orderstepqrcode// 浜岀淮鐮�
-          }
-        ]
-      }
-      const args = {
-        type: 'print', // preview  print
-        showOptionDlg: false, // 濡傛灉涓嶆樉绀烘墦鍗板璇濇鑰岀洿鎺ユ墦鍗帮紝灏嗘琛屾敞閲婂幓鎺夊嵆鍙�
-        report: urlAddRandomNo('./static/grf/澶栧崗鏀舵枡鏍囩.grf'),
-        data: obj
-      }
-      webapp_ws_ajax_run(args)
+    ZZprint2(username) {
+      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+      this.qrForm.startqty = this.dialogForm.startqty
+      this.qrForm.wo_code = this.dialogForm.wo_code
+      this.qrForm.partcode = this.dialogForm.partcode
+      this.qrForm.partname = this.dialogForm.partname
+      this.qrForm.nextstepname = this.dialogForm.nextstepname
+      this.qrForm.operator = username
+      this.qrForm.operatorTime = handleDatetime2(new Date())
+      this.$nextTick(() => {
+        this.bindQRCode(this.qrForm.qrvalue)
+      })
     },
+    WXprint2(username) {
+      this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+      this.qrForm.startqty = this.dialogForm.sqty
+      this.qrForm.wo_code = this.dialogForm.wo_code
+      this.qrForm.partcode = this.dialogForm.partcode
+      this.qrForm.partname = this.dialogForm.partname
+      this.qrForm.nextstepname = this.dialogForm.nextstepname
+      this.qrForm.operator = username
+      this.qrForm.operatorTime = handleDatetime2(new Date())
+      this.$nextTick(() => {
+        this.bindQRCode(this.qrForm.qrvalue)
+      })
+    },
+    dialogVisible2Close() {
+      this.qrForm.qrvalue = ''
+      this.qrForm.startqty = ''
+      this.qrForm.wo_code = ''
+      this.qrForm.partcode = ''
+      this.qrForm.partname = ''
+      this.qrForm.nextstepname = ''
+      this.qrForm.operator = ''
+      this.qrForm.operatorTime = ''
+      // this.$refs.qrCodeDiv2 = ''
+    },
+
     // 鑾峰彇椤甸潰楂樺害
     getHeight() {
       this.$nextTick(() => {
-        this.mainHeight = window.innerHeight - 250
-        this.tableHeight = this.mainHeight - 80
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 220
+        this.isIpad = window.innerHeight < 769
+        if (window.innerHeight < 769) {
+          this.tableHeight = this.tableHeight - 50
+        }
+        this.$refs.tableDataRef.doLayout()
+      })
+    },
+
+    // 鑾峰彇涓嶈壇澶勭悊鍒楄〃
+    async getBadList() {
+      const res = await MesOrderNgStepSearch(this.badForm)
+      this.badTableData = res.data
+      this.badTotal = res.count
+    },
+    badDialogVisibleCancel() {
+      this.badDialogVisible = false
+    },
+    badDialogVisibleConfirm() {
+      const data = {
+        Data: this.badTableDataDialog
+      }
+      this.$store.state.app.buttonIsDisabled = true
+      EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => {
+        if (res.code === '200' || res.code === '301') {
+          this.getBadList()
+          this.badDialogVisible = false
+          this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username)
+          this.dialogVisible2 = true
+          this.$message.success('淇濆瓨鎴愬姛锛�')
+
+          this.$store.state.app.buttonIsDisabled = false
+        }
+      })
+    },
+    badPrint(username) {
+      this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode
+      this.qrForm.startqty = this.badDialogForm.plan_qty
+      this.qrForm.wo_code = this.badDialogForm.wo_code
+      this.qrForm.partcode = this.badDialogForm.partcode
+      this.qrForm.partname = this.badDialogForm.partname
+      this.qrForm.nextstepname = this.badDialogForm.nextstepname
+      this.qrForm.operator = username
+      this.qrForm.operatorTime = handleDatetime2(new Date())
+
+      this.$nextTick(() => {
+        this.bindQRCode(this.qrForm.qrvalue)
+      })
+    },
+
+    handleCloseBad() {
+      this.badDialogForm = {}
+      this.badDialogForm.operation = getCookie('navTabId')
+      this.badTableDataDialog = []
+      this.judgeIsScanningArr = []
+    },
+    async getMesOrderSelectUserAll() {
+      const { data: res } = await MesOrderSelectUser({ usercode: '' })
+      this.OperationArr = res
+    },
+    // 鐐瑰嚮缁翠慨澶勭悊鎸夐挳  鎴�  鎵弿鏉$爜鐨勬壂鎻忓洖杞︿簨浠�
+    async repairHandle(row) {
+      let data
+      if (row.wo_code) {
+        data = {
+          orderstepqrcode: row.wo_code + ';' + row.stepcode
+        }
+      } else {
+        data = {
+          orderstepqrcode: row
+        }
+      }
+
+      const { data: res } = await MesOrderNgSubStepSearch(data)
+
+      this.$nextTick(() => {
+        this.badDialogForm.wo_code = res.data1.wo_code
+        this.badDialogForm.partcode = res.data1.partnumber
+        this.badDialogForm.partname = res.data1.partname
+        this.badDialogForm.partspec = res.data1.partspec
+        this.badDialogForm.stepname = res.data1.stepname
+        this.badDialogForm.nextstepcode = res.data1.nextstepcode
+        this.badDialogForm.nextstepname = res.data1.nextstepname
+        this.badDialogForm.plan_qty = res.data1.planqty
+        this.badDialogForm.good_qty = res.data1.noreportqty // 鎶ュ伐鏁伴噺
+        this.badDialogForm.ng_qty = res.data1.noputqty // 涓嶈壇鏁伴噺
+
+        this.badTableDataDialog = res.data2
+
+        this.badTableDataDialog.forEach(item => {
+          item.repair_qty = 0
+          item.bad_qty = 0
+          item.isVisible = 0
+          // item.defect_code = [...new Set(item.defect_code.split(','))].join(',')
+          // item.defect_name = [...new Set(item.defect_name.split(','))].join(',')
+        })
+        console.log(this.badTableDataDialog, 321)
+        this.badDialogVisible = true
+      })
+    },
+    badEdit(row) {
+      console.log(row)
+      this.badTableDataDialog.forEach((item, index) => {
+        if (item.id === row.id && item.m_id === row.m_id) {
+          this.badTableDataDialog.splice(index, 1, {
+            bad_qty: row.bad_qty,
+            repair_qty: row.repair_qty,
+            isVisible: 1,
+            defect_code: row.defect_code,
+            defect_name: row.defect_name,
+            badqty: row.badqty,
+            id: row.id,
+            m_id: row.m_id,
+            materiel_code: row.materiel_code,
+            ng_qty: row.ng_qty,
+            plan_qty: row.plan_qty,
+            report_qty: row.report_qty,
+            seq: row.seq,
+            step_code: row.step_code,
+            stepname: row.stepname,
+            style: row.style,
+            wo_code: row.wo_code
+          })
+        }
+      })
+    },
+    badSave(row) {
+      if (parseFloat(row.bad_qty) + parseFloat(row.repair_qty) > parseFloat(row.ng_qty)) {
+        this.badCancel(row)
+        return this.$message.info('缁翠慨鏁伴噺涓庢姤搴熸暟閲忎箣鍜屼笉鑳藉ぇ浜庝笉鑹暟閲忥紒')
+      }
+      this.badTableDataDialog.forEach((item, index) => {
+        if (item.id === row.id && item.m_id === row.m_id) {
+          this.badTableDataDialog.splice(index, 1, {
+            bad_qty: parseFloat(row.bad_qty),
+            repair_qty: parseFloat(row.repair_qty),
+            isVisible: 0,
+            defect_code: row.defect_code,
+            defect_name: row.defect_name,
+            id: row.id,
+            m_id: row.m_id,
+            badqty: row.badqty,
+            materiel_code: row.materiel_code,
+            ng_qty: row.ng_qty,
+            plan_qty: row.plan_qty,
+            report_qty: row.report_qty,
+            seq: row.seq,
+            step_code: row.step_code,
+            stepname: row.stepname,
+            style: row.style,
+            wo_code: row.wo_code
+          })
+        }
+      })
+    },
+    badCancel(row) {
+      this.badTableDataDialog.forEach((item, index) => {
+        if (item.id === row.id && item.m_id === row.m_id) {
+          this.badTableDataDialog.splice(index, 1, {
+            // bad_qty: row.bad_qty,
+            // repair_qty: row.repair_qty,
+            bad_qty: 0,
+            repair_qty: 0,
+            isVisible: 0,
+            defect_code: row.defect_code,
+            defect_name: row.defect_name,
+            id: row.id,
+            m_id: row.m_id,
+            badqty: row.badqty,
+            materiel_code: row.materiel_code,
+            ng_qty: row.ng_qty,
+            plan_qty: row.plan_qty,
+            report_qty: row.report_qty,
+            seq: row.seq,
+            step_code: row.step_code,
+            stepname: row.stepname,
+            style: row.style,
+            wo_code: row.wo_code
+          })
+        }
+      })
+    },
+
+    badDel(row) {
+      this.badTableDataDialog.forEach((item, index) => {
+        if (item.id === row.id && item.m_id === row.m_id) {
+          this.badTableDataDialog.splice(index, 1)
+        }
       })
     }
   }
@@ -1479,92 +2397,7 @@
 
 <style lang="scss" scoped>
 $main_color: #42b983;
-::v-deep .el-button--primary {
-  background-color: $main_color !important;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  //border: 1px solid $main_color;
-  border: none;
-  padding: 0 20px;
-}
-
-::v-deep .el-button--primary:hover {
-  border: none;
-}
-
-::v-deep .el-button--info {
-  height: 30px;
-  display: flex;
-  align-items: center;
-  padding: 0 20px;
-}
-
-::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
-  background-color: $main_color !important;
-}
-
-::v-deep .el-dialog__footer {
-  display: flex;
-  justify-content: flex-end;
-}
-
-.footerButton {
-  display: flex;
-  justify-content: end;
-}
-
-::v-deep .el-button--default {
-  background-color: #ffffff !important;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  padding: 0 20px;
-}
-
-::v-deep .el-button--default:hover {
-  color: #606266;
-}
-
-::v-deep .el-dialog__body {
-  padding: 20px 100px !important;
-}
-
-::v-deep .el-radio__input.is-checked .el-radio__inner {
-  background-color: $main_color;
-  border-color: $main_color;
-}
-
-::v-deep .el-radio__input.is-checked + .el-radio__label {
-  color: $main_color !important;
-}
-
-::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
-  border-color: $main_color;
-  background-color: $main_color;
-}
-
-::v-deep .el-input__inner {
-  height: 30px;
-  line-height: 30px;
-}
-
-::v-deep .el-input__inner:focus {
-  border-color: $main_color;
-}
-
-::v-deep .el-table .caret-wrapper {
-  transform: scale(0.8);
-}
-
-::v-deep .cell {
-  display: flex !important;
-  align-items: center !important;
-  justify-content: space-between !important;
-}
-
-::v-deep .el-button--text {
-  color: $main_color;
+.el-button--text {
   font-size: 14px;
   cursor: pointer;
 }
@@ -1574,29 +2407,6 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
-}
-
-.el-icon-share {
-  color: $main_color;
-  cursor: pointer;
-}
-
-.el-checkbox.is-bordered.is-checked {
-  border-color: $main_color;
-}
-
-::v-deep .el-radio__input.is-checked .el-radio__inner {
-  border-color: $main_color;
-  background: $main_color;
-}
-
-::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
-  border-color: $main_color;
-  background: $main_color;
-}
-
-::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
-  color: $main_color !important;
 }
 
 ::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
@@ -1611,36 +2421,6 @@
   margin: 10px 30px 0px 0;
 }
 
-.body ::v-deep .el-divider {
-  border: 1px solid #eee;
-  width: 99%;
-  margin: 10px auto;
-}
-
-.body ::v-deep .el-form-item {
-  margin-bottom: 0;
-}
-
-::v-deep .el-input__inner:focus {
-  border-color: $main_color;
-}
-
-::v-deep .el-select .el-input__inner:focus {
-  border-color: $main_color;
-}
-
-::v-deep .el-select-dropdown__item.selected {
-  color: $main_color;
-}
-
-::v-deep .el-checkbox__inner:hover {
-  border-color: $main_color;
-}
-
-::v-deep .el-textarea__inner:focus {
-  border-color: $main_color;
-}
-
 //.dialogVisible{
 ::v-deep .el-select .el-input .el-select__caret {
   display: flex;
@@ -1655,3 +2435,124 @@
   }
 }
 </style>
+<style media="print">
+/*@media print {*/
+@page {
+  size: auto;
+  margin: 3mm;
+  font-size: 10px;
+}
+
+</style>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-button--text {
+  font-size: 14px;
+  cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+  color: $main_color;
+  cursor: pointer;
+}
+
+.el-icon-edit-outline {
+  margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+  height: 34px;
+  display: flex;
+  align-items: center;
+  padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+  //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+  background-color: #f8f8fa;
+  border: none;
+}
+
+::v-deep .el-input__inner {
+  height: 34px;
+  line-height: 34px;
+  //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+  padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .badDialogVisible .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+  display: flex;
+  justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+  transform: scale(0.8);
+}
+
+::v-deep .cell {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+  height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+  background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+  background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+  color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+  border: 1px solid #eee;
+  width: 99%;
+  margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
+    height: 100% !important;
+  }
+
+  ::v-deep .el-table__fixed {
+    height: 100% !important;
+  }
+}
+</style>
+<style>
+
+.el-table .custom-row {
+  background: #f8f8fa;
+}
+</style>

--
Gitblit v1.9.3