From 50339cf0c301487f66b9cdfe42265293eab31878 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 20 八月 2024 14:50:43 +0800
Subject: [PATCH] 1.工单列表新增  物料清单参数

---
 src/views/workOrder/workOrderList.vue | 1035 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 797 insertions(+), 238 deletions(-)

diff --git a/src/views/workOrder/workOrderList.vue b/src/views/workOrder/workOrderList.vue
index 1954a3b..4c4b21e 100644
--- a/src/views/workOrder/workOrderList.vue
+++ b/src/views/workOrder/workOrderList.vue
@@ -135,6 +135,8 @@
           :data="tableData"
           :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
           border
+          :summary-method="getSummaries"
+          show-summary
           :row-class-name="tableRowClassName"
           :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px'}"
           highlight-current-row
@@ -351,6 +353,16 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
+
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP棰勮" placement="top">
+                  <i
+                    v-if="mesSetting.workOrder"
+                    class="el-icon-files"
+                    style="cursor: pointer;color:#42b983;margin-right: 15px"
+                    @click.stop="pre(row,1)"
+                  />
+                </el-tooltip>
+
                 <el-tooltip class="item" effect="dark" content="淇敼" placement="top">
                   <i
                     class="el-icon-edit-outline"
@@ -373,7 +385,7 @@
                     :style="{color:$store.state.settings.theme}"
                     class="el-icon-printer"
                     style="cursor: pointer;margin-right: 15px"
-                    @click.stop="handlePrint(row.wo_code)"
+                    @click.stop="handlePrint(row.wo_code,row.saleOrderCod)"
                   />
                 </el-tooltip>
 
@@ -459,7 +471,7 @@
           <el-table-column
             label="宸ュ簭鍗曚环"
             show-tooltip-when-overflow
-            prop="stepprice"
+            prop="unprice"
           />
           <el-table-column
             label="宸茬敓浜ф暟閲�"
@@ -491,34 +503,42 @@
             show-tooltip-when-overflow
             prop="delive_qty"
           />
-          <!--          <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-->
-          <!--                    v-if="tableDataDetail.length!==row.seq"-->
-          <!--                    class="el-icon-printer"-->
-          <!--                    :style="{color:$store.state.settings.theme}"-->
-          <!--                    style="cursor: pointer;margin-right: 15px"-->
-          <!--                    @click="supplementSmallClick(row)"-->
-          <!--                  />-->
-          <!--                </el-tooltip>-->
-          <!--                <el-tooltip class="item" effect="dark" content="琛ユ墦鐢熶骇鍏ュ簱鏉$爜" placement="top">-->
-          <!--                  <i-->
-          <!--                    v-if="tableDataDetail.length===row.seq"-->
-          <!--                    class="  el-icon-camera"-->
-          <!--                    :style="{color:$store.state.settings.theme}"-->
-          <!--                    style="cursor: pointer;margin-right: 15px"-->
-          <!--                    @click="getProductInHouseLabCode(row.wo_code)"-->
-          <!--                  />-->
-          <!--                </el-tooltip>-->
-          <!--              </div>-->
-          <!--            </template>-->
-          <!--          </el-table-column>-->
+          <el-table-column
+            label="鎿嶄綔"
+            width="120"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP棰勮" placement="top">
+                  <i
+                    v-if="mesSetting.tech"
+                    class="el-icon-files"
+                    style="cursor: pointer;color:#42b983;margin-right: 15px"
+                    @click="pre(row,2)"
+                  />
+                </el-tooltip>
+                <!--                          <el-tooltip class="item" effect="dark" content="鎵撳嵃宸ュ簭" placement="top">-->
+                <!--                            <i-->
+                <!--                              v-if="tableDataDetail.length!==row.seq"-->
+                <!--                              class="el-icon-printer"-->
+                <!--                              :style="{color:$store.state.settings.theme}"-->
+                <!--                              style="cursor: pointer;margin-right: 15px"-->
+                <!--                              @click="supplementSmallClick(row)"-->
+                <!--                            />-->
+                <!--                          </el-tooltip>-->
+                <!--                          <el-tooltip class="item" effect="dark" content="琛ユ墦鐢熶骇鍏ュ簱鏉$爜" placement="top">-->
+                <!--                            <i-->
+                <!--                              v-if="tableDataDetail.length===row.seq"-->
+                <!--                              class="  el-icon-camera"-->
+                <!--                              :style="{color:$store.state.settings.theme}"-->
+                <!--                              style="cursor: pointer;margin-right: 15px"-->
+                <!--                              @click="getProductInHouseLabCode(row.wo_code)"-->
+                <!--                            />-->
+                <!--                          </el-tooltip>-->
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
       </div>
     </div>
@@ -660,18 +680,10 @@
             />
           </el-select>
         </el-form-item>
-        <!--        <el-form-item v-if="operation!=='add'" label="浜у搧鍚嶇О" prop="partname">-->
-        <!--          <el-input v-model="dialogForm.partname" disabled style="width: 200px" />-->
-        <!--        </el-form-item>-->
-        <!--        <el-form-item v-if="operation!=='add'" label="浜у搧缂栫爜">-->
-        <!--          <el-input v-model="dialogForm.partcode" disabled style="width: 200px" />-->
-        <!--        </el-form-item>-->
         <el-form-item label="浜у搧瑙勬牸" prop="partspec">
           <el-input v-model="dialogForm.partspec" disabled style="width: 200px" />
         </el-form-item>
-        <!--        :disabled="dialogForm.partcode===''"-->
-
-        <el-form-item v-if="mesSetting.route" label="宸ヨ壓璺嚎" prop="wkshopcode">
+        <el-form-item v-if="mesSetting.route" label="宸ヨ壓璺嚎" prop="routecode">
           <el-select
             v-model="dialogForm.routecode"
             filterable
@@ -693,6 +705,7 @@
           <el-date-picker
             v-model="dialogForm.deliverydate"
             type="date"
+            style="width: 200px;"
             size="mini"
             :clearable="false"
             class="dateMini"
@@ -701,8 +714,23 @@
             value-format="yyyy-MM-dd"
             placeholder="閫夋嫨鏃ユ湡"
           />
-          <!--          :disabled="dialogForm.deliverydate"-->
         </el-form-item>
+
+        <el-form-item label="鐗╂枡娓呭崟" prop="bomid">
+          <el-select
+            v-model="dialogForm.bomid"
+            clearable
+            placeholder="璇烽�夋嫨鐗╂枡娓呭崟"
+          >
+            <el-option
+              v-for="item in BomDataArr"
+              :key="item.id"
+              :label="item.version"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+
         <el-form-item label="宸ュ簭鏉ユ簮" required>
           <el-switch
             v-model="sourceType"
@@ -745,8 +773,95 @@
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
-          row-key="stepcode"
         >
+          <el-table-column type="expand">
+            <template slot-scope="props">
+
+              <el-table
+                :data="props.row.children"
+                style="width: 96%;margin: auto;"
+                border
+                row-key="eqp_code"
+                :row-class-name="tableRowClassName"
+              >
+                <el-table-column
+                  prop="eqp_code"
+                  label="璁惧/寰�鏉ョ紪鐮�"
+                  min-width="120"
+                />
+                <el-table-column
+                  prop="eqp_name"
+                  label="璁惧/寰�鏉ュ悕绉�"
+                  min-width="120"
+                />
+                <!--                <el-table-column-->
+                <!--                  prop="eqp_value"-->
+                <!--                  label="璁惧鑺傛媿"-->
+                <!--                  min-width="150"-->
+                <!--                >-->
+                <!--                  <template slot-scope="{row}">-->
+                <!--                    <div style="display: flex;align-items: center">-->
+                <!--                      <el-input-->
+                <!--                        v-model="row.eqp_value"-->
+                <!--                        placeholder="璇疯緭鍏�"-->
+                <!--                        oninput="value=value.replace(/[^0-9.]/g,'')"-->
+                <!--                        @change="val=>eqpValueChange(val,row)"-->
+                <!--                      />-->
+                <!--                      <div style="margin-left: 5px">绉�</div>-->
+                <!--                    </div>-->
+                <!--                  </template>-->
+                <!--                </el-table-column>-->
+                <!--                <el-table-column-->
+                <!--                  prop="stand_value"-->
+                <!--                  label="鐢熶骇鑺傛媿"-->
+                <!--                  min-width="120"-->
+                <!--                >-->
+                <!--                  <template slot-scope="{row}">-->
+                <!--                    <div>{{ row.stand_value + ' ' + '绉�/娆�' }}</div>-->
+                <!--                  </template>-->
+                <!--                </el-table-column>-->
+                <!--                <el-table-column-->
+                <!--                  prop="cavity_qty"-->
+                <!--                  label="鑵斿瀷鏁�"-->
+                <!--                  min-width="120"-->
+                <!--                >-->
+                <!--                  <template slot-scope="{row}">-->
+                <!--                    <el-input-->
+                <!--                      v-model="row.cavity_qty"-->
+                <!--                      placeholder="璇疯緭鍏�"-->
+                <!--                      oninput="value=value.replace(/[^0-9.]/g,'')"-->
+                <!--                      @change="val=>cavityQtyChange(val,row)"-->
+                <!--                    />-->
+                <!--                  </template>-->
+                <!--                </el-table-column>-->
+                <el-table-column
+                  prop="unprice"
+                  label="璁惧宸ヤ环"
+                  min-width="120"
+                >
+                  <template slot-scope="{row}">
+                    <el-input v-model="row.unprice" oninput="value=value.replace(/[^0-9.]/g,'')" />
+                  </template>
+                </el-table-column>
+                <!--                v-if="!sourceType"-->
+                <el-table-column
+
+                  prop="enable"
+                  label="鏄惁鍚敤"
+                  min-width="150"
+                >
+                  <template slot-scope="{row}">
+                    <el-switch
+                      v-model="row.enable"
+                      inactive-value="N"
+                      active-value="Y"
+                    />
+                  </template>
+                </el-table-column>
+              </el-table>
+            </template>
+          </el-table-column>
+
           <el-table-column
             type="index"
             label="搴忓彿"
@@ -763,17 +878,16 @@
             show-tooltip-when-overflow
           />
           <el-table-column
-            prop="stepprice"
+            prop="unprice"
             label="鐢熶骇鍗曚环"
             show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <el-input
-                v-model="row.stepprice"
+                v-model="row.unprice"
                 placeholder="璇疯緭鍏ュ伐搴忓崟浠�"
                 oninput="value=value.replace(/[^0-9.]/g,'')"
                 style="width: 100%"
-                @click.stop=""
               />
             </template>
           </el-table-column>
@@ -1292,6 +1406,7 @@
     <el-dialog
       v-el-drag-dialog
       title=""
+      top="7vh"
       :visible.sync="dialogVisibleApprove"
       width="812px"
       class="dialogVisibleConfirmClass"
@@ -1301,129 +1416,265 @@
     >
       <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
       <div id="printMe" style="padding: 30px">
-        <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
+        <!--        <div v-for="(item,index) in tableDataPrint" :key="index">-->
+        <div>
+          <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
 
-        <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
-          <div style="width: 78%">
-            <el-form
-              ref="formApprove"
-              :model="formApprove"
-              label-width="80px"
-              inline
-              style="display: flex;justify-content: space-between"
+          <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
+            <div style="width: 78%">
+              <el-form
+                ref="formApprove"
+                :model="formApprove"
+                label-width="80px"
+                inline
+                style="display: flex;justify-content: space-between"
+              >
+                <div class="elForm">
+                  <el-form-item label="閿�鍞崟鍙�:" class="formContent">
+                    {{ formApprove.saleOrderCode ? formApprove.saleOrderCode : '/' }}
+                  </el-form-item>
+                  <el-form-item label="宸ュ崟缂栧彿:" class="formContent">
+                    {{ formApprove.mesordercode }}
+                  </el-form-item>
+                  <el-form-item label="婧愬崟鍗曞彿:" class="formContent">
+                    {{ formApprove.m_po }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧缂栫爜:" class="formContent">
+                    {{ formApprove.partcode }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧鍚嶇О:" class="formContent">
+                    {{ formApprove.partname }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧瑙勬牸:" class="formContent">
+                    {{ formApprove.partspec }}
+                  </el-form-item>
+                  <el-form-item label="宸ュ崟鏁伴噺:" class="formContent">
+                    {{ formApprove.plan_qty }}
+                  </el-form-item>
+                  <!--                <el-form-item label="宸ヨ壓璺嚎:" class="formContent">-->
+                  <!--                  {{ formApprove.routename }}-->
+                  <!--                </el-form-item>-->
+                  <el-form-item label="鎵撳嵃浜哄憳:" class="formContent">
+                    <!--                  {{ localStorage.getItem('username') }}-->
+                    {{ formApprove.routename }}
+                  </el-form-item>
+                  <el-form-item label="鎵撳嵃鏃堕棿:" class="formContent">
+                    {{ formApprove.lm_date }}
+                  </el-form-item>
+                </div>
+              </el-form>
+            </div>
+            <div
+              id="qrCode0"
+              style="width: 22%;height:90px;
+                        margin-top: 20px;
+                        overflow-y: scroll;display: flex;
+                        justify-content: center;
+                        position: relative;"
             >
-              <div class="elForm">
-                <el-form-item label="宸ュ崟缂栧彿:" class="formContent">
-                  {{ formApprove.mesordercode }}
-                </el-form-item>
-                <el-form-item label="婧愬崟鍗曞彿:" class="formContent">
-                  {{ formApprove.m_po }}
-                </el-form-item>
-                <el-form-item label="浜у搧缂栫爜:" class="formContent">
-                  {{ formApprove.partcode }}
-                </el-form-item>
-                <el-form-item label="浜у搧鍚嶇О:" class="formContent">
-                  {{ formApprove.partname }}
-                </el-form-item>
-                <el-form-item label="浜у搧瑙勬牸:" class="formContent">
-                  {{ formApprove.partspec }}
-                </el-form-item>
-                <el-form-item label="宸ュ崟鏁伴噺:" class="formContent">
-                  {{ formApprove.plan_qty }}
-                </el-form-item>
-                <!--                <el-form-item label="宸ヨ壓璺嚎:" class="formContent">-->
-                <!--                  {{ formApprove.routename }}-->
-                <!--                </el-form-item>-->
-                <el-form-item label="鎵撳嵃浜哄憳:" class="formContent">
-                  <!--                  {{ localStorage.getItem('username') }}-->
-                  {{ formApprove.routename }}
-                </el-form-item>
-                <el-form-item label="鎵撳嵃鏃堕棿:" class="formContent">
-                  {{ formApprove.lm_date }}
-                </el-form-item>
-              </div>
-            </el-form>
+              <div id="qrCode00" ref="qrCodeDiv00" />
+            </div>
+            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
+            <div
+              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
+            />
           </div>
-          <div
-            id="qrCode"
-            style="width: 22%;height:90px;
-            margin-top: 20px;
-            overflow-y: scroll;display: flex;
-            justify-content: center;
-            position: relative;"
+
+          <el-table
+            id="table"
+            :data="tableDataPrint[0]"
+            border
+            class="tableDataPrint"
+            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}"
+            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}"
+            style="width: 100%;margin-top: 20px;text-align: center;border-color: #000"
           >
-            <div id="qrCode0" ref="qrCodeDiv0" />
-          </div>
-          <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
-          <div
-            style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
-          />
+            <el-table-column
+              id="column0"
+              prop="seq"
+              label="宸ュ簭鍙�"
+              width="70"
+              align="center"
+            />
+            <el-table-column
+              id="column1"
+              prop="stepqrcode"
+              label="宸ュ簭浜岀淮鐮�"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="{row}">
+
+                <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" />
+              </template>
+            </el-table-column>
+            <el-table-column
+              id="column2"
+              prop="stepname"
+              label="宸ュ簭"
+              width="120"
+              align="center"
+            />
+            <el-table-column
+              id="column3"
+              prop="plan_qty"
+              label="鍔犲伐鏁伴噺"
+              width="100"
+              align="center"
+            />
+            <el-table-column
+              id="column4"
+              prop="good_qty"
+              width="100"
+              align="center"
+              label="鍚堟牸鏁伴噺"
+            />
+            <el-table-column
+              id="column5"
+              width="100"
+              prop="ng_qty"
+              align="center"
+              label="涓嶈壇鏁伴噺"
+            />
+            <el-table-column
+              id="column6"
+              prop="desc"
+              align="center"
+              width="120"
+              label="澶囨敞"
+            />
+          </el-table>
         </div>
 
-        <!--          <div style="width:100%;height: 30px;border-bottom: 1px solid #eee;margin-bottom: 20px" />-->
-        <el-table
-          id="table"
-          :data="tableDataPrint"
-          border
-          class="tableDataPrint"
-          :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}"
-          :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}"
-          style="width: 100%;margin-top: 20px;text-align: center;border-color: #000"
-        >
-          <el-table-column
-            id="column0"
-            prop="seq"
-            label="宸ュ簭鍙�"
-            width="70"
-            align="center"
-          />
-          <el-table-column
-            id="column1"
-            prop="stepqrcode"
-            label="宸ュ簭浜岀淮鐮�"
-            width="100"
-            align="center"
+        <div v-if="tableDataPrint[1]" style="margin-top: 100px;">
+          <div style="font-size: 26px; text-align: center">娴佺▼鍗�</div>
+
+          <div style="display: flex;justify-content: space-around;margin-top: 20px; position: relative;">
+            <div style="width: 78%">
+              <el-form
+                ref="formApprove"
+                :model="formApprove"
+                label-width="80px"
+                inline
+                style="display: flex;justify-content: space-between"
+              >
+                <div class="elForm">
+                  <el-form-item label="閿�鍞崟鍙�:" class="formContent">
+                    {{ formApprove.saleOrderCode ? formApprove.saleOrderCode : '/' }}
+                  </el-form-item>
+                  <el-form-item label="宸ュ崟缂栧彿:" class="formContent">
+                    {{ formApprove.mesordercode }}
+                  </el-form-item>
+                  <el-form-item label="婧愬崟鍗曞彿:" class="formContent">
+                    {{ formApprove.m_po }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧缂栫爜:" class="formContent">
+                    {{ formApprove.partcode }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧鍚嶇О:" class="formContent">
+                    {{ formApprove.partname }}
+                  </el-form-item>
+                  <el-form-item label="浜у搧瑙勬牸:" class="formContent">
+                    {{ formApprove.partspec }}
+                  </el-form-item>
+                  <el-form-item label="宸ュ崟鏁伴噺:" class="formContent">
+                    {{ formApprove.plan_qty }}
+                  </el-form-item>
+                  <!--                <el-form-item label="宸ヨ壓璺嚎:" class="formContent">-->
+                  <!--                  {{ formApprove.routename }}-->
+                  <!--                </el-form-item>-->
+                  <el-form-item label="鎵撳嵃浜哄憳:" class="formContent">
+                    <!--                  {{ localStorage.getItem('username') }}-->
+                    {{ formApprove.routename }}
+                  </el-form-item>
+                  <el-form-item label="鎵撳嵃鏃堕棿:" class="formContent">
+                    {{ formApprove.lm_date }}
+                  </el-form-item>
+                </div>
+              </el-form>
+            </div>
+            <div
+              id="qrCode1"
+              style="width: 22%;height:90px;
+                        margin-top: 20px;
+                        overflow-y: scroll;display: flex;
+                        justify-content: center;
+                        position: relative;"
+            >
+              <div id="qrCode01" ref="qrCodeDiv01" />
+            </div>
+            <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" />
+            <div
+              style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
+            />
+          </div>
+
+          <el-table
+            id="table"
+            :data="tableDataPrint[1]"
+            border
+            class="tableDataPrint"
+            :header-cell-style="{ background: '#c0c0c0',textAlign:'center',color:'#000',borderColor:'#000'}"
+            :cell-style="{textAlign: 'center',color:'#000',borderColor:'#000'}"
+            style="width: 100%;margin-top: 20px;text-align: center;border-color: #000"
           >
-            <template slot-scope="{row}">
-              <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" class="tableColumn" />
-            </template>
-          </el-table-column>
-          <el-table-column
-            id="column2"
-            prop="stepname"
-            label="宸ュ簭"
-            width="120"
-            align="center"
-          />
-          <el-table-column
-            id="column3"
-            prop="plan_qty"
-            label="鍔犲伐鏁伴噺"
-            width="100"
-            align="center"
-          />
-          <el-table-column
-            id="column4"
-            prop="good_qty"
-            width="100"
-            align="center"
-            label="鍚堟牸鏁伴噺"
-          />
-          <el-table-column
-            id="column5"
-            width="100"
-            prop="ng_qty"
-            align="center"
-            label="涓嶈壇鏁伴噺"
-          />
-          <el-table-column
-            id="column6"
-            prop="desc"
-            align="center"
-            width="120"
-            label="澶囨敞"
-          />
-        </el-table>
+            <el-table-column
+              id="column0"
+              prop="seq"
+              label="宸ュ簭鍙�"
+              width="70"
+              align="center"
+            />
+            <el-table-column
+              id="column1"
+              prop="stepqrcode"
+              label="宸ュ簭浜岀淮鐮�"
+              width="100"
+              align="center"
+            >
+              <template slot-scope="{row}">
+
+                <div :id="'qrCode'+row.seq" :ref="'qrCodeDiv'+row.seq" :key="'qrCodeDiv'+row.seq" class="tableColumn" />
+              </template>
+            </el-table-column>
+            <el-table-column
+              id="column2"
+              prop="stepname"
+              label="宸ュ簭"
+              width="120"
+              align="center"
+            />
+            <el-table-column
+              id="column3"
+              prop="plan_qty"
+              label="鍔犲伐鏁伴噺"
+              width="100"
+              align="center"
+            />
+            <el-table-column
+              id="column4"
+              prop="good_qty"
+              width="100"
+              align="center"
+              label="鍚堟牸鏁伴噺"
+            />
+            <el-table-column
+              id="column5"
+              width="100"
+              prop="ng_qty"
+              align="center"
+              label="涓嶈壇鏁伴噺"
+            />
+            <el-table-column
+              id="column6"
+              prop="desc"
+              align="center"
+              width="120"
+              label="澶囨敞"
+            />
+          </el-table>
+        </div>
+
       </div>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
@@ -2024,6 +2275,65 @@
       </span>
     </el-dialog>
 
+    <!--    宸ュ崟sop/宸ュ簭sop-->
+    <el-dialog
+      v-el-drag-dialog
+      class="sop"
+      title="SOP棰勮"
+      :visible.sync="SopDialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleSopClose"
+      @close="handleSopClose"
+    >
+
+      <el-form inline label-width="110px" style="display:flex">
+        <el-form-item label="宸ュ崟SOP">
+          <el-select
+            v-model="dialogSopForm.sop"
+            style="width:200px"
+            placeholder="璇烽�夋嫨"
+            filterable
+            :popper-append-to-body="false"
+            @change="sopChange"
+          >
+            <el-option
+              v-for="item in sopArr"
+              :key="item.filepath"
+              :label="item.filename"
+              :value="item.filepath"
+            />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="Sop鐗堟湰">
+          <el-input v-model="dialogSopForm.v" disabled style="width: 200px" />
+        </el-form-item>
+      </el-form>
+
+      <el-button
+        v-waves
+        type="primary"
+        style="margin-left: 37px"
+        @click="view"
+      >棰� 瑙�/涓� 杞�
+      </el-button>
+
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="handleSopClose">鍙� 娑�</el-button>
+          <!--          <el-button-->
+          <!--            v-waves-->
+          <!--            type="primary"-->
+          <!--            :loading="$store.state.app.buttonIsDisabled"-->
+          <!--            :disabled="$store.state.app.buttonIsDisabled"-->
+          <!--            @click="handleSopConfirm"-->
+          <!--          >纭� 瀹�</el-button>-->
+        </div>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -2038,17 +2348,25 @@
 import {
   AddMesOrderCodeSearch,
   AddUpdateMesOrder, DeleteMesOrder,
-  MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent,
-  MesOrderSearch,
+  MesBadOrderSearch, MesOrderDistribution, MesOrderNewStepContent, MesOrderProcessSopSearch,
+  MesOrderSearch, MesOrderSopSearch,
   UpdateMesOrderStepSearch
 } from '@/api/WorkOrder'
 import { PartSelect } from '@/api/ProductModel'
-import { PrentOrganization, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData'
+import {
+  PartSearchBomDate,
+  PrentOrganization,
+  PrentOrganizationNoCompany,
+  StepData,
+  StepEqpData
+} from '@/api/GeneralBasicData'
 import Sortable from 'sortablejs'
 import ElDragSelect from '@/components/DragSelect'
 import { MesOrderPrintSearch } from '@/api/GridReport' // base on element-ui
 import DateType from '@/components/DateType'
 import { PartSelectRpute, RouteSelectStep } from '@/api/basicSettings'
+import { DeviceSopSearch } from '@/api/DeviceManager'
+
 export default {
   name: 'WorkOrderList',
   components: {
@@ -2118,7 +2436,9 @@
         routecode: '', // 宸ヨ壓璺嚎
 
         mesmaxqty: 0, // 宸ュ崟鐨勬渶澶у��
-        mesqtyinit: 0// 宸ュ崟鏁伴噺鍒濆鍊�
+        mesqtyinit: 0, // 宸ュ崟鏁伴噺鍒濆鍊�
+
+        bomid: ''//
       },
       ordertypeArr: [// 宸ュ崟绫诲瀷
         { code: 'PO', name: '鏍囧噯宸ュ崟' },
@@ -2148,6 +2468,9 @@
         ],
         wkshopcode: [
           { required: true, message: '璇烽�夋嫨鐢熶骇杞﹂棿', trigger: ['blur', 'change'] }
+        ],
+        routecode: [
+          { required: true, message: '璇烽�夋嫨宸ヨ壓璺嚎', trigger: ['blur', 'change'] }
         ],
         deliverydate: [
           { required: true, message: '璇烽�夋嫨棰勮浜や粯鏃ユ湡', trigger: ['blur', 'change'] }
@@ -2316,7 +2639,24 @@
 
       sourceType: false, // 宸ュ簭鐨勬暟鎹潵婧�
 
-      mesSetting: JSON.parse(localStorage.getItem('mesSetting'))
+      mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
+
+      SopDialogVisible: false,
+      dialogSopForm: { // 璁惧SOP琛ㄥ崟
+        sop: '',
+        v: ''
+      },
+      sopArr: [],
+      routeCode: '', // 宸ヨ壓璺嚎code
+      partCode: '',
+
+      StepEqpArr: [],
+
+      editStepEqpArr: [],
+
+      flag1: false,
+
+      BomDataArr: []
 
     }
   },
@@ -2328,13 +2668,43 @@
         console.log(val, 1)
         const arr = JSON.parse(JSON.stringify(this.stepTableData))
         const arrStepcode = arr.map(i => i.stepcode)
+
+        console.log(arr, 3)
         this.stepTableData = []
         val.forEach(i => {
+          let children = []
+
+          if (arrStepcode.includes(i)) { // 瀛愰」淇濇寔涓嶅彉
+            children = arr.find(j => j.stepcode === i).children
+          } else {
+            // 1.鍏堟煡鎵捐嚜宸卞師鏈夊瓙椤规槸鍚︽湁
+            console.log(this.editStepEqpArr.find(j => j.step_code === i), 'this.editStepEqpArr.find(j => j.step_code === i)')
+            if (this.editStepEqpArr.find(j => j.step_code === i)) {
+              children = this.editStepEqpArr.find(j => j.step_code === i).children
+
+              console.log(children, 10)
+            } else {
+              // 鍐嶆煡鎵� 鍘嗗彶鏈�鏂版垨鑰呭熀纭�璧勬枡鏄惁鏈�
+              if (this.sourceType) {
+                children = this.StepEqpArr.find(j => j.step_code === i).children
+                console.log(children, 11)
+              }
+              if (!this.sourceType) {
+                children = this.StepEqpArr.find(j => j.step_code === i).children
+                console.log(children, 12)
+              }
+            }
+          }
+
           this.stepTableData.push(
             {
               stepcode: i,
               stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname,
-              stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0
+              unprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).unprice : 0,
+              // children:arrStepcode.includes(i)? arr.find(j => j.stepcode === i).children:
+
+              children
+
             }
           )
         })
@@ -2353,8 +2723,52 @@
     // })
   },
   methods: {
+    // 宸ュ簭璁惧鍩虹璧勬枡
+    async getStepEqpData() {
+      const { data: res } = await StepEqpData()
+      this.StepEqpArr = res
+    },
+
+    // 寮瑰嚭妗嗗叧闂�
+    handleSopClose() {
+      this.SopDialogVisible = false
+      this.dialogSopForm = { // 璁惧SOP琛ㄥ崟
+        sop: '',
+        v: ''
+      }
+    },
+    // 棰勮
+    view() {
+      window.open(process.env.VUE_APP_BASE_API_FILE + this.dialogSopForm.sop)
+    },
+    sopChange(val) {
+      this.dialogSopForm.v = this.sopArr.find(i => i.filepath === val).version
+    },
+    async pre(row, type) {
+      if (type === 1) {
+        const data = {
+          wocode: row.wo_code,
+          materielcode: row.partcode
+        }
+        const { data: res } = await MesOrderSopSearch(data)
+        this.sopArr = res
+      }
+
+      if (type === 2) {
+        const data = {
+          materielcode: this.partCode,
+          routecode: this.routeCode ? this.routeCode : '',
+          stepcode: row.step_code
+        }
+        const { data: res } = await MesOrderProcessSopSearch(data)
+        this.sopArr = res
+      }
+
+      this.SopDialogVisible = true
+    },
     // 宸ュ簭鏉ユ簮鍒囨崲
     sourceTypeChange(val) {
+      this.flag1 = false
       this.stepTableData = []
       if (val) {
         this.getMesOrderNewStepContent()
@@ -2401,6 +2815,7 @@
         if (res.code === '200') {
           this.getSelect()
           this.getPrentOrganizationNoCompany()
+          this.getStepEqpData()
         }
       })
     },
@@ -2514,7 +2929,7 @@
       this.operation = operation
       this.dialogVisible = true
       this.dialogForm.data_sources = 'MES'
-
+      this.sourceType = true
       this.$nextTick(() => {
         this.setSort()
       })
@@ -2611,6 +3026,9 @@
 
       this.dialogForm.mesqtyinit = row.plan_qty
 
+      this.dialogForm.bomid = row.bom_id
+      await this.getPartSearchBomDate(row.partcode)
+
       const data = {
         sourceid: this.dialogForm.sourceorderid,
         sourcewo: this.dialogForm.sourceorder,
@@ -2619,10 +3037,34 @@
       }
       const { data: res } = await UpdateMesOrderStepSearch(data)
       this.dialogForm.mesmaxqty = res.canupdate_qty
+      this.editStepEqpArr = JSON.parse(JSON.stringify(res.stepdata))
 
+      this.flag1 = res.stepdata.length !== 0
+      // console.log(this.editStepEqpArr.find(i => i.step_code === '102'))
       if (this.mesSetting.route) { // 鎸夊伐鑹鸿矾绾胯蛋妯″紡
-        if (!this.dialogForm.routecode) {
+        if (this.dialogForm.routecode) {
           await this.getPartcodeChangeDialog()
+
+          // this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+          this.stepTableData = []
+          res.stepdata.forEach(i => {
+            this.stepTableData.push(
+              {
+                stepcode: i.step_code,
+                stepname: i.stepname,
+                unprice: i.unprice,
+                children: i.children
+              }
+            )
+          })
+          this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+
+          this.dialogVisible = true
+          this.$nextTick(() => {
+            this.setSort()
+          })
+
+          return
         }
 
         if (res.stepdata.length > 0) {
@@ -2631,11 +3073,13 @@
               {
                 stepcode: i.step_code,
                 stepname: i.stepname,
-                stepprice: i.stepprice
+                unprice: i.unprice,
+                children: i.children
               }
             )
           })
           this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+          this.sourceType = true
         } else {
           const data2 = {
             wkshopcode: this.dialogForm.wkshopcode,
@@ -2648,11 +3092,13 @@
                 {
                   stepcode: i.step_code,
                   // stepname: i.stepname,
-                  stepprice: i.stepprice
+                  unprice: i.unprice,
+                  children: i.children
                 }
               )
             })
             this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+            this.sourceType = false
           }
         }
       } else {
@@ -2662,23 +3108,27 @@
               {
                 stepcode: i.step_code,
                 stepname: i.stepname,
-                stepprice: i.stepprice
+                unprice: i.unprice,
+                children: i.children
               }
             )
           })
           this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+          this.sourceType = true
         } else {
+          this.sourceType = false
           await this.getBasicProcessData()
         }
       }
 
       this.dialogVisible = true
+
       this.$nextTick(() => {
         this.setSort()
       })
     },
     // 鎸夊伐搴忔ā寮忚蛋鐨勬椂鍊�  寮曠敤鍩虹璧勬枡 宸ヨ壓
-    async  getBasicProcessData() {
+    async getBasicProcessData() {
       const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode })
       res.sort((a, b) => a.step_seq - b.step_seq)
       this.stepTableData = []
@@ -2687,7 +3137,8 @@
           {
             stepcode: i.step_code,
             stepname: i.step_name,
-            stepprice: i.unprice
+            unprice: i.unprice,
+            children: i.children
           }
         )
       })
@@ -2711,9 +3162,10 @@
       } else {
         this.getBasicProcessData()
       }
+      this.getPartSearchBomDate(val)
     },
 
-    async  getPartcodeChangeDialog() {
+    async getPartcodeChangeDialog() {
       const { data: res } = await PartSelectRpute({ partcode: this.dialogForm.partcode })
       this.routecodeArr = res
 
@@ -2731,55 +3183,92 @@
     },
     // 宸ヨ壓璺嚎鍊兼敼鍙�
     async routecodeChange() {
-      const data = {
-        partcode: this.dialogForm.partcode,
-        routecode: this.dialogForm.routecode
+      if (!this.flag1) {
+        const data = {
+          partcode: this.dialogForm.partcode,
+          routecode: this.dialogForm.routecode
+        }
+        const { data: res } = await RouteSelectStep(data)
+        console.log(res, 887)
+        this.stepSelectedValue = []
+        this.stepTableData = []
+        if (res.length > 0) {
+          res.sort((a, b) => a.step_seq - b.step_seq)
+          res.forEach(i => {
+            this.stepTableData.push(
+              {
+                stepcode: i.code,
+                // stepname: i.stepname,
+                unprice: i.unprice,
+                children: i.children
+              }
+            )
+          })
+          this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+        }
       }
-      const { data: res } = await RouteSelectStep(data)
 
-      this.stepSelectedValue = []
-      this.stepTableData = []
-      if (res.length > 0) {
-        res.sort((a, b) => a.step_seq - b.step_seq)
-        res.forEach(i => {
-          this.stepTableData.push(
-            {
-              stepcode: i.step_code,
-              // stepname: i.stepname,
-              stepprice: i.unprice
-            }
-          )
-        })
-        this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+      if (this.flag1 && !this.sourceType) {
+        const data = {
+          partcode: this.dialogForm.partcode,
+          routecode: this.dialogForm.routecode
+        }
+        const { data: res } = await RouteSelectStep(data)
+        console.log(res, 887)
+        this.stepSelectedValue = []
+        this.stepTableData = []
+        if (res.length > 0) {
+          res.sort((a, b) => a.step_seq - b.step_seq)
+          res.forEach(i => {
+            this.stepTableData.push(
+              {
+                stepcode: i.code,
+                // stepname: i.stepname,
+                unprice: i.unprice,
+                children: i.children
+              }
+            )
+          })
+          this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+        }
       }
     },
 
-    async  getMesOrderNewStepContent() {
+    async getMesOrderNewStepContent() {
       // if (!this.mesSetting.route && this.operation === 'edit') {
       //   return
       // }
 
-      const data = {
-        routecode: this.dialogForm.routecode,
-        wkshopcode: this.dialogForm.wkshopcode,
-        partcode: this.dialogForm.partcode
+      if (this.sourceType) {
+        const data = {
+          routecode: this.dialogForm.routecode,
+          wkshopcode: this.dialogForm.wkshopcode,
+          partcode: this.dialogForm.partcode
+        }
+        const { data: res } = await MesOrderNewStepContent(data)
+        // console.log(res)
+        this.stepSelectedValue = []
+        this.stepTableData = []
+        if (res.length > 0) {
+          res.forEach(i => {
+            this.stepTableData.push(
+              {
+                stepcode: i.step_code,
+                // stepname: i.stepname,
+                unprice: i.unprice,
+                children: i.children
+              }
+            )
+          })
+          this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+        }
+      } else {
+        await this.routecodeChange()
       }
-      const { data: res } = await MesOrderNewStepContent(data)
-      // console.log(res)
-      this.stepSelectedValue = []
-      this.stepTableData = []
-      if (res.length > 0) {
-        res.forEach(i => {
-          this.stepTableData.push(
-            {
-              stepcode: i.step_code,
-              // stepname: i.stepname,
-              stepprice: i.stepprice
-            }
-          )
-        })
-        this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
-      }
+    },
+    async getPartSearchBomDate(val) {
+      const { data: res } = await PartSearchBomDate({ partnumber: val })
+      this.BomDataArr = res
     },
 
     // 瀵硅瘽妗嗗叧闂簨浠�
@@ -2800,13 +3289,17 @@
         wkshopname: '', // 鐢熶骇杞﹂棿鍚嶇О
 
         deliverydate: '', // 浜や粯鏃堕棿
-        data_sources: '' // 鏁版嵁鏉ユ簮
+        data_sources: '', // 鏁版嵁鏉ユ簮
+
+        bomid: ''
       }
 
       this.sourceType = false
 
       this.stepSelectedValue = []
       this.stepTableData = []
+      this.BomDataArr = []
+      this.flag1 = false
       this.$refs.dialogForm.clearValidate()
     },
     // 瀵硅瘽妗嗗彇娑�
@@ -2829,20 +3322,33 @@
             return this.$message.info('姝ゅ伐鍗曠殑鏈�澶т慨鏀规暟鍊间负锛�' + this.dialogForm.mesmaxqty)
           }
 
-          const workListSub = []
+          const WorkListSub = []
           this.stepTableData.forEach((i, j) => {
-            workListSub.push(
+            const children = []
+            if (i.children.length > 0) {
+              i.children.forEach(k => {
+                if (k.enable === 'Y') {
+                  children.push({
+                    eqpcode: k.eqp_code,
+                    unprice: parseFloat(k.unprice)
+                  })
+                }
+              })
+            }
+
+            WorkListSub.push(
               {
                 stepseq: j + 1,
                 stepcode: i.stepcode,
-                stepprice: i.stepprice,
+                unprice: i.unprice,
                 isbott: j === 0 ? 'Y' : 'N',
-                isend: j === this.stepTableData.length - 1 ? 'Y' : 'N'
+                isend: j === this.stepTableData.length - 1 ? 'Y' : 'N',
+                WorkEqpListSub: children
               }
             )
           })
 
-          if (workListSub.length === 0) {
+          if (WorkListSub.length === 0) {
             return this.$message.info('宸ュ簭涓嶈兘涓虹┖锛�')
           }
 
@@ -2857,10 +3363,11 @@
             woqty: this.dialogForm.mesqty, // 宸ュ崟鏁伴噺
             deliverydate: this.dialogForm.deliverydate, // 浜や粯鏃堕棿
             data_sources: this.dialogForm.data_sources, // 鏁版嵁鏉ユ簮
-            isstep: workListSub.length > 0 ? 'Y' : 'N', //
+            isstep: WorkListSub.length > 0 ? 'Y' : 'N', //
             difference: this.dialogForm.mesqty - this.dialogForm.mesqtyinit, // 鏁版嵁宸��
             routecode: this.dialogForm.routecode,
-            workListSub
+            bomid: this.dialogForm.bomid,
+            WorkListSub
           }
 
           this.$store.state.app.buttonIsDisabled = true
@@ -2868,11 +3375,11 @@
             if (res.code === '200') {
               this.dialogVisible = false
               // this.handlePrint()
-              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '娲惧彂鎴愬姛锛�')
+              this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇濆瓨鎴愬姛锛�')
               this.getMesOrderSearch()
               this.$store.state.app.buttonIsDisabled = false
             } else {
-              this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '娲惧彂澶辫触锛�')
+              this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇濆瓨澶辫触锛�')
             }
           })
         }
@@ -2925,19 +3432,22 @@
       this.dialogVisibleSearch = false
     },
     // 澶勭悊鎵撳嵃
-    handlePrint(wo_code) {
+    handlePrint(wo_code, saleOrderCode) {
       // const number = Math.random() * Math.random()
       // this.number = number === 0 ? (10 + Math.random()) : number
       // console.log(number)
-
+      this.formApprove.saleOrderCode = this.formApprove.saleOrderCode !== '' ? this.formApprove.saleOrderCode : saleOrderCode
       const data2 = {
         mesordercode: wo_code || this.dialogForm.mesordercode
       }
       MesOrderPrintSearch(data2).then(res2 => {
         if (res2.code === '200') {
-          const res3 = res2.data.recordset
+          this.dialogVisibleApprove = true
 
-          this.tableDataPrint = res3
+          const res3 = res2.data.recordset
+          // this.tableDataPrint = res3
+          this.tableDataPrint = this.chunkArray(res3, 8)
+
           this.formApprove.mesordercode = res3[0].wo_code
           this.formApprove.m_po = res3[0].m_po || '/'
           this.formApprove.partcode = res3[0].partcode
@@ -2948,17 +3458,20 @@
           this.formApprove.lm_date = res3[0].lm_date
 
           this.$nextTick(() => {
-            res3.forEach(i => {
-              this.bindQRCode(i.seq, i.stepqrcode, 'small')
+            this.tableDataPrint.forEach((item, index) => {
+              item.forEach(i => {
+                this.bindQRCode(i.seq, i.stepqrcode, 'small')
+              })
+              this.bindQRCode(index, this.formApprove.mesordercode, 'big')
+              const div = document.getElementById('qrCode' + index)
+              div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
             })
-            this.bindQRCode('0', this.formApprove.mesordercode, 'big')
 
-            const div = document.getElementById('qrCode')
+            // const div = document.getElementById('qrCode')
             // 杩欎箞澶氫唬鐮佸彧闇�瑕佽繖涓�鍙ュ疄鐜版垜浠墍闇�瑕佺殑鍔熻兘锛屽畾浣峝iv婊氬姩鏉′綅缃湪搴曢儴锛宻crollHeight璁$畻鍑篸iv鐨勯珮搴︼紝鍐峴crollTop 璁剧疆婊氬姩鏉$殑楂樺害涓哄灏�
-            div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
+            // div.scrollTop = div.scrollHeight // 婊氬姩鏉′綅浜庢渶搴曢儴
             // div.scrollTop = 0 // 婊氬姩鏉′綅浜庢渶椤堕儴
           })
-          this.dialogVisibleApprove = true
         }
       })
     },
@@ -2971,6 +3484,15 @@
     // 杩斿洖鎸夐挳
     dialogVisibleBackPreview() {
       this.dialogVisibleApprove = false
+    },
+    chunkArray(array, size) {
+      const chunked = []
+      let i = 0
+      while (i < array.length) {
+        chunked.push(array.slice(i, i + size))
+        i += size
+      }
+      return chunked
     },
     // dialogVisibleConfirmPreview(param) {
     //   this.$refs.dialogForm.validate(valid => {
@@ -2991,8 +3513,7 @@
     // 鐢熸垚浜岀淮鐮�    宸ュ崟鎶ヨ〃浜岀淮鐮�
     bindQRCode(seq, text, size) {
       if (size === 'big') {
-        console.log(text, 1)
-        new QRCode(this.$refs.qrCodeDiv0, {
+        new QRCode(this.$refs['qrCodeDiv0' + seq], {
           text: text,
           width: size === 'big' ? 90 : 60,
           height: size === 'big' ? 90 : 60,
@@ -3015,6 +3536,7 @@
     },
 
     dialogVisibleConfirmClose() {
+      this.formApprove.saleOrderCode = ''
       // this.dialogForm.mesordercode = ''
       this.formApprove.mesordercode = ''
       this.formApprove.m_po = ''
@@ -3316,6 +3838,9 @@
     },
     //  琛岀偣鍑讳簨浠�
     async rowClick(row, event, column) {
+      this.formApprove.saleOrderCode = row.saleOrderCode
+      this.routeCode = row.route_code ? row.route_code : ''
+      this.partCode = row.partcode ? row.partcode : ''
       const data = {
         sourceid: row.sourceid,
         sourcewo: row.m_po,
@@ -3380,6 +3905,34 @@
     },
     stepSelectedValueChange(val) {
       // console.log(val, 123)
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      const i = 9
+      columns.forEach((column, index) => {
+        if (index === i) {
+          sums[index] = '鎬绘暟'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (column.property === 'plan_qty') {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+              // return Math.round(prev * 100) / 100 + Math.round(curr * 100) / 100
+            }
+          }, 0)
+
+          sums[index] += ''
+        }
+      })
+
+      this.$nextTick(() => {
+        this.$refs.tableDataRef.doLayout()
+      })
+      return sums
     }
   }
 }
@@ -3473,6 +4026,12 @@
 
 ::v-deep .el-dialog__body {
   padding: 20px 100px !important;
+}
+
+.sop {
+  ::v-deep .el-dialog__body {
+    padding: 50px 80px !important;
+  }
 }
 
 .dialogVisibleSearch ::v-deep .el-dialog__body {
@@ -3693,8 +4252,8 @@
 }
 </style>
 <style>
-.sortable-ghost{
+.sortable-ghost {
   opacity: .8;
-  color: #fff!important;
-  background: #42b983!important;
+  color: #fff !important;
+  background: #42b983 !important;
 }

--
Gitblit v1.9.3