From d9493eb7905545e5509689eae73a450c576418e0 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 26 八月 2022 17:16:02 +0800
Subject: [PATCH] 1.修改bug2.新增工序检验记录

---
 src/views/scgl/gd.vue |  601 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 577 insertions(+), 24 deletions(-)

diff --git a/src/views/scgl/gd.vue b/src/views/scgl/gd.vue
index 829dbfb..46c4574 100644
--- a/src/views/scgl/gd.vue
+++ b/src/views/scgl/gd.vue
@@ -2,9 +2,12 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
 
-      <div class="bodyTopButtonGroup">
-        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button type="primary" icon="el-icon-connection" @click="send('send')">娲惧彂</el-button>
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+        <div style="display: flex">
+          <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+          <el-button type="primary" icon="el-icon-connection" @click="send('send')">娲惧彂</el-button>
+        </div>
+
         <el-button icon="el-icon-switch-button" @click="orderClose">宸ュ崟鍏抽棴</el-button>
       </div>
 
@@ -37,6 +40,24 @@
             <el-form-item label="璁㈠崟缂栧彿" style=" display: flex;">
               <el-input v-model="form.mesordercode" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
+            <el-form-item label="婧愬崟鍗曞彿" style="display: flex;">
+              <el-input v-model="form.sourceorder" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item label="鍗曟嵁绫诲瀷" style=" display: flex;">
+              <el-select
+                v-model="form.ordertype"
+                :popper-append-to-body="false"
+                style="width: 200px"
+                placeholder="璇烽�夋嫨"
+              >
+                <!--            @change="mesordertypeChange"-->
+                <el-option
+                  v-for="item in ordertypeArr"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>            </el-form-item>
             <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
               <!--              <el-select v-model="form.partcode" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">-->
               <!--                <el-option-->
@@ -157,6 +178,24 @@
             min-width="160"
           />
           <el-table-column
+            prop="m_po"
+            label="婧愬崟鍗曞彿"
+            sortable="custom"
+            min-width="160"
+          />
+          <el-table-column
+            prop="wotype"
+            label="鍗曟嵁绫诲瀷"
+            sortable="custom"
+            min-width="120"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.wotype==='PO'">鏍囧噯宸ュ崟</div>
+              <div v-else-if="row.wotype==='FO'">鎶ュ簾琛ュ崟</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
             prop="partcode"
             label="浜у搧缂栫爜"
             sortable="custom"
@@ -263,7 +302,11 @@
             <template slot-scope="{row}">
               <div class="operationClass">
                 <el-tooltip class="item" effect="dark" content="宸ュ簭浠诲姟" placement="top">
-                  <i class="el-icon-tickets" style="cursor: pointer;color: #42b983;margin-right: 15px" @click="check(row)" />
+                  <i
+                    class="el-icon-tickets"
+                    style="cursor: pointer;color: #42b983;margin-right: 15px"
+                    @click="check(row)"
+                  />
                 </el-tooltip>
                 <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
                   <i class="el-icon-delete" @click="del(row)" />
@@ -325,6 +368,41 @@
         <el-form-item label="宸ュ崟缂栧彿" prop="mesordercode">
           <el-input v-model="dialogForm.mesordercode" :disabled="operation!=='add'" style="width: 200px" />
         </el-form-item>
+        <div style="display: flex">
+          <el-form-item label="宸ュ崟绫诲瀷" prop="mesorderstus">
+            <el-select
+              v-model="dialogForm.ordertype"
+              :popper-append-to-body="false"
+              style="width: 200px"
+              :disabled="operation!=='add'"
+              placeholder="璇烽�夋嫨"
+            >
+              <!--            @change="mesordertypeChange"-->
+              <el-option
+                v-for="item in ordertypeArr"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              />
+            </el-select>
+          </el-form-item>
+          <div style="display: flex;flex-wrap: nowrap">
+            <el-form-item label="婧愬崟鍗曞彿">
+              <el-input
+                v-model="dialogForm.sourceorder"
+                :disabled="dialogForm.ordertype==='PO'"
+                style="width: 172px"
+              />
+            </el-form-item>
+            <el-button
+              type="primary"
+              style="padding: 0 10px;margin-left: -8px;margin-top: 3px"
+              class="el-icon-search"
+              :disabled="operation!=='add'"
+              @click="mesordertsourcesearchclick"
+            />
+          </div>
+        </div>
         <el-form-item label="宸ュ崟鏁伴噺" prop="mesqty">
           <el-input
             v-model="dialogForm.mesqty"
@@ -386,7 +464,7 @@
             </el-form-item>
             <el-button
               type="primary"
-              style="padding: 0 10px;margin-left: -8px;margin-top: 5px"
+              style="padding: 0 10px;margin-left: -8px;margin-top:3px"
               class="el-icon-search"
               @click="searchClick"
             />
@@ -509,7 +587,7 @@
       </span>
     </el-dialog>
 
-    <!--    宸ュ簭浠诲姟瀵硅瘽妗�-->
+    <!-- 宸ュ簭浠诲姟瀵硅瘽妗�-->
     <el-dialog
       title="宸ュ簭浠诲姟"
       :visible.sync="dialogVisibleTask"
@@ -523,7 +601,8 @@
         style="margin-bottom: 15px"
         type="primary"
         @click="supplementClick"
-      >琛ユ墦</el-button>
+      >琛ユ墦
+      </el-button>
       <el-table
         :data="taskTableData"
         border
@@ -596,6 +675,298 @@
       </span>
     </el-dialog>
 
+    <!-- 婧愬崟鍗曞彿瀵硅瘽妗�-->
+    <el-dialog
+      title="婧愬崟鍗曞彿"
+      :visible.sync="dialogVisibleSource"
+      width="1200px"
+      top="5vh"
+      class="dialogVisibleSearch"
+      :close-on-click-modal="false"
+      @close="dialogVisibleSourceClose"
+    >
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="sourceForm"
+          :model="sourceForm"
+          label-width="100px"
+          inline
+          style="display: flex;justify-content: space-between"
+        >
+          <div class="elForm">
+            <el-form-item label="璁㈠崟鐘舵��" style=" display: flex;">
+              <el-select
+                v-model="sourceForm.erporderstus"
+                filterable
+                :popper-append-to-body="false"
+                style="width: 200px"
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in erporderstusArr"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="璁㈠崟缂栧彿" style=" display: flex;">
+              <el-input v-model="sourceForm.erpordercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
+              <el-input v-model="sourceForm.partcode" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+
+            <el-form-item v-show="isExpand" label="浜у搧鍚嶇О" style=" display: flex;">
+              <el-input v-model="sourceForm.partname" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item v-show="isExpand" label="浜у搧瑙勬牸" style=" display: flex;">
+              <el-input v-model="sourceForm.partspec" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item v-show="isExpand" label="鍒涘缓浜哄憳" style=" display: flex;">
+              <el-input v-model="sourceForm.creatuser" style="width: 200px" placeholder="璇疯緭鍏�" />
+            </el-form-item>
+            <el-form-item
+              v-show="isExpand"
+              label="棰勮寮�宸ユ椂闂�"
+              label-width="100px"
+              style=" display: flex;font-size: 14px;margin-top: 3px"
+            >
+              <el-date-picker
+                v-model="sourceForm.paystartdate"
+                type="daterange"
+                range-separator="~"
+                class="timeMini"
+                size="mini"
+                style="width: 250px;display: flex;line-height: 34px;height: 34px;font-size: 14px!important;"
+                :clearable="false"
+                start-placeholder="寮�濮嬫棩鏈�"
+                end-placeholder="缁撴潫鏃ユ湡"
+              />
+              <!--              :picker-options="expireTimeOption"-->
+
+            </el-form-item>
+            <el-form-item
+              v-show="isExpand"
+              label="棰勮瀹屽伐鏃堕棿"
+              label-width="100px"
+              style=" display: flex;font-size: 14px;margin-top: 3px"
+            >
+              <el-date-picker
+                v-model="sourceForm.payenddate"
+                type="daterange"
+                :clearable="false"
+                class="timeMini"
+                range-separator="~"
+                start-placeholder="寮�濮嬫棩鏈�"
+                style="width: 250px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"
+                end-placeholder="缁撴潫鏃ユ湡"
+                size="mini"
+              />
+            </el-form-item>
+
+          </div>
+          <div>
+            <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2;justify-content: end">
+              <el-button type="primary" icon="el-icon-search" @click="sourceSearch">鏌ヨ</el-button>
+              <el-button type="info" icon="el-icon-refresh" @click="sourceReset">閲嶇疆</el-button>
+            </div>
+          </div>
+        </el-form>
+      </div>
+      <el-tooltip :content="!isExpand?'鐐瑰嚮灞曠ず鏇村':'鏀惰捣'" placement="bottom">
+        <div
+          style="display:flex;justify-content: center;
+          align-items:center;background-color:#eee;cursor: pointer"
+          @click="isExpand=!isExpand"
+        >
+          <i
+            :class="!isExpand?'el-icon-arrow-down':'el-icon-arrow-up'"
+            :style="{color:'#42B983'}"
+          /></div>
+      </el-tooltip>
+      <div class="elTableDiv">
+        <el-table
+          :data="sourceTableData"
+          :height="(tableHeight-100)+'px'"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:(tableHeight-100)+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sourceSortChange"
+        >
+          <!--          <el-table-column-->
+          <!--            type="selection"-->
+          <!--            width="50"-->
+          <!--          />-->
+          <el-table-column
+            width="50"
+            fixed
+          >
+            <template slot-scope="{row}">
+              <el-radio
+                v-model="radioSelectedId"
+                :label="row.id"
+                style="color: transparent;padding-left: 15px; margin-right: -25px;"
+                @change.native="getCurrentRowSource(row.id)"
+              />
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="RowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="status"
+            label="璁㈠崟鐘舵��"
+            sortable="custom"
+            width="110"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.status==='NEW'">鏂拌鍗�</div>
+              <div v-if="row.status==='CREATING'">閮ㄥ垎涓嬭揪</div>
+              <div v-if="row.status==='CREATED'">鍏ㄩ儴涓嬭揪</div>
+              <div v-if="row.status==='CLOSED'">宸插叧闂�</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="wo"
+            label="璁㈠崟缂栧彿"
+            sortable="custom"
+            min-width="150"
+          />
+          <el-table-column
+            prop="partcode"
+            label="浜у搧缂栫爜"
+            sortable="custom"
+            min-width="150"
+          />
+          <el-table-column
+            prop="partname"
+            label="浜у搧鍚嶇О"
+            sortable="custom"
+            min-width="150"
+          />
+          <el-table-column
+            prop="partspec"
+            label="浜у搧瑙勬牸"
+            sortable="custom"
+            min-width="110"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.partspec">{{ row.partspec }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="qty"
+            label="璁㈠崟鏁伴噺"
+            width="150"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="relse_qty"
+            label="宸蹭笅鍗曟暟閲�"
+            width="150"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="wkshp_name"
+            label="鐢熶骇杞﹂棿"
+            sortable="custom"
+            width="150"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="planstartdate"
+            label="棰勮寮�宸ユ椂闂�"
+            sortable="custom"
+            width="130"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="planenddate"
+            label="棰勮瀹屽伐鏃堕棿"
+            sortable="custom"
+            width="130"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.planenddate">{{ row.planenddate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="createuser"
+            label="鍒涘缓浜哄憳"
+            sortable="custom"
+            width="150"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.createuser">{{ row.createuser }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="createdate"
+            label="鍒涘缓鏃堕棿"
+            width="130"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.createdate">{{ row.createdate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <!--          <el-table-column-->
+          <!--            label="鎿嶄綔"-->
+          <!--            fixed="right"-->
+          <!--            width="80"-->
+          <!--          >-->
+          <!--            <template slot-scope="{row}">-->
+          <!--              <div class="operationClass">-->
+          <!--                <el-tooltip class="item" effect="dark" content="涓嬭揪" placement="top">-->
+          <!--                  &lt;!&ndash;                <el-button type="text" @click="edit('edit',row)">涓嬭揪</el-button>&ndash;&gt;-->
+          <!--                  <i-->
+          <!--                    class="el-icon-bottom"-->
+          <!--                    style="color:#42b983;cursor: pointer;margin-left: 5px"-->
+          <!--                    @click="edit('edit',row)"-->
+          <!--                  />-->
+          <!--                </el-tooltip>-->
+          <!--              </div>-->
+          <!--            </template>-->
+          <!--          </el-table-column>-->
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="sourceFormTotal"
+        :page.sync="sourceForm.page"
+        :limit.sync="sourceForm.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes"
+        popper-class="select_bottom"
+        @pagination="getErpOrderSearch"
+      />
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button @click="dialogVisibleSourceBack">杩� 鍥�</el-button>
+          <el-button type="primary" @click="dialogVisibleSourceConfirm">纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
     <!--鎵撳嵃棰勮瀵硅瘽妗�  澶ф爣绛�-->
     <el-dialog
       title=""
@@ -622,6 +993,9 @@
               <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 }}
@@ -658,7 +1032,9 @@
             <!--            <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" />
+          <div
+            style="z-index: 10;background-color:transparent;width: 120px;height:120px; position: absolute;right: 21px"
+          />
         </div>
 
         <!--          <div style="width:100%;height: 30px;border-bottom: 1px solid #eee;margin-bottom: 20px" />-->
@@ -758,7 +1134,9 @@
             >
               <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="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>
@@ -818,7 +1196,7 @@
 import {
   AddUpdateMesOrder,
   ClosedMesOrder,
-  DeleteMesOrder,
+  DeleteMesOrder, ErpOrderSearch,
   MesOrderSearch, PartSelectRoute, RouteSelectWkshop, SearchWorkStep,
   SelectRouteStep
 } from '@/api/scgl'
@@ -856,6 +1234,8 @@
         mesorderstus: '', // 宸ュ崟鐘舵�佺爜
         mesordercode: '', // 宸ュ崟缂栧彿
         partcode: '', // 浜у搧缂栫爜
+        ordertype: '', // ordertype
+        sourceorder: '', // 婧愬崟鍗曞彿
         partname: '', // 浜у搧鍚嶇О
         partspec: '', // 浜у搧瑙勬牸
         creatuser: '', // 鍒涘缓浜哄憳
@@ -886,6 +1266,9 @@
         mesorderstus: 'NEW', // 宸ュ崟鐘舵�佺爜
         mesordercode: '', // 宸ュ崟缂栧彿
         partcode: '', // 浜у搧缂栫爜
+
+        ordertype: 'PO', // 宸ュ崟绫诲瀷
+        sourceorder: '', // 婧愬崟鍗曞彿
         mesqty: '', // 宸ュ崟鏁伴噺
 
         routecode: '', // 宸ヨ壓璺嚎缂栫爜
@@ -896,6 +1279,10 @@
 
         OperType: '' // 鎿嶄綔绫诲瀷
       },
+      ordertypeArr: [// 宸ュ崟绫诲瀷
+        { code: 'PO', name: '鏍囧噯宸ュ崟' },
+        { code: 'FO', name: '鎶ュ簾琛ュ崟' }
+      ],
       partArr: [], // 浜у搧淇℃伅
       wkshopArr: [], // 鐢熶骇杞﹂棿鏁扮粍
       routeArr: [], // 宸ヨ壓璺嚎鏁扮粍
@@ -964,6 +1351,7 @@
       },
 
       formApprove: {
+        m_po: '', // 婧愬崟鍗曞彿
         mesordercode: '',
         partcode: '',
         partname: '',
@@ -1004,7 +1392,28 @@
         nextstepname: '',
         operator: '', // 鎿嶄綔浜�
         operatorTime: ''// 鎿嶄綔鏃堕棿
-      }
+      },
+      dialogVisibleSource: false,
+      sourceTableData: [],
+      sourceForm: {
+        erporderstus: '', // 璁㈠崟鐘舵�佺爜
+        erpordercode: '', // 璁㈠崟缂栧彿
+        partcode: '', // 浜у搧缂栫爜
+        partname: '', // 浜у搧鍚嶇О
+        partspec: '', // 浜у搧瑙勬牸
+        creatuser: '', // 鍒涘缓浜哄憳
+        // paystartdate: '', // 浜や粯鏃堕棿
+        paystartdate: '', // 棰勮寮�宸ユ椂闂�
+        payenddate: '', // 棰勮瀹屽伐鏃堕棿
+        createdate: '', // 鍒涘缓鏃堕棿
+        prop: 'createdate', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      sourceFormTotal: 10,
+      radioSelectedId: '',
+      isExpand: false// 鏄惁寮犲紑锛岄粯璁や笉灞曞紑
     }
   },
   created() {
@@ -1041,6 +1450,8 @@
         partname: this.form.partname, // 浜у搧鍚嶇О
         partspec: this.form.partspec, // 浜у搧瑙勬牸
         creatuser: this.form.creatuser, // 鍒涘缓浜哄憳
+        sourceorder: this.form.sourceorder, // 婧愬崟鍗曞彿
+        ordertype: this.form.ordertype, // 鍗曟嵁绫诲瀷
         createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // 鍒涘缓鏃堕棿
         prop: this.form.prop, // 鎺掑簭瀛楁
         order: this.form.order, // 鎺掑簭瀛楁
@@ -1076,6 +1487,18 @@
       this.form.prop = prop
       this.getMesOrderSearch()
     },
+    sourceSortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.sourceForm.order = order
+      this.sourceForm.prop = prop
+      this.getErpOrderSearch()
+    },
     // 鏌ヨ
     search() {
       this.getMesOrderSearch()
@@ -1090,7 +1513,9 @@
       this.form.partspec = ''
       this.form.paydate = ''
       this.form.creatuser = ''
-      this.form.createdate = ''
+      this.form.sourceorder = ''
+      this.form.creatuser = ''
+      this.form.ordertype = ''
       this.getMesOrderSearch()
     },
     // 鍗曢�夋閫変腑鑾峰彇褰撳墠琛屼俊鎭�
@@ -1139,10 +1564,14 @@
     },
     // 宸ュ簭浠诲姟
     async check(row) {
-      this.dialogVisibleTask = true
       const { data: res } = await SearchWorkStep({ wo_code: row.wo_code })
       this.taskTableData = res
+
+      if (this.taskTableData.length === 0) {
+        return this.$message.info('鏃犵敓浜т换鍔℃暟鎹紒')
+      }
       this.dialogForm.mesordercode = res[0].wo_code
+      this.dialogVisibleTask = true
     },
     dialogVisibleBack() {
       this.dialogVisibleTask = false
@@ -1168,6 +1597,9 @@
         this.dialogForm.partname = row.partname
         this.dialogForm.mesqty = row.plan_qty
         this.dialogForm.partspec = row.partspec
+        this.dialogForm.sourceorder = row.sourceorder
+        this.dialogForm.ordertype = row.ordertype
+
         // this.routecodeChange(this.dialogForm.routecode)
 
         this.dialogForm.planstartdate = row.plan_startdate !== null ? row.plan_startdate : handleDatetime(new Date())
@@ -1262,6 +1694,9 @@
       this.dialogForm.partcode = '' // 浜у搧缂栫爜
       this.dialogForm.mesqty = '' // 宸ュ崟鏁伴噺
 
+      this.dialogForm.ordertype = 'PO' // 宸ュ崟绫诲瀷
+      this.dialogForm.sourceorder = '' // 婧愬崟鍗曞彿
+
       this.dialogForm.routecode = '' // 宸ヨ壓璺嚎缂栫爜
       this.dialogForm.wkshopcode = '' // 鐢熶骇杞﹂棿缂栫爜
       this.dialogForm.planstartdate = '' // 璁″垝寮�濮嬫椂闂�
@@ -1278,6 +1713,9 @@
     dialogVisibleConfirm() {
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
+          if (this.dialogForm.ordertype === 'FO' && this.dialogForm.sourceorder.toString().trim().length <= 0) {
+            return this.$message.info('婧愬崟鍗曞彿涓嶈兘涓虹┖锛�')
+          }
           const data = {
             // partname: this.dialogForm.partname, // 浜у搧鍚嶇О
             // partspec: this.dialogForm.partspec, // 浜у搧瑙勬牸
@@ -1288,7 +1726,8 @@
             mesordercode: this.dialogForm.mesordercode, // 宸ュ崟缂栧彿
             partcode: this.dialogForm.partcode, // 浜у搧缂栫爜
             mesqty: this.dialogForm.mesqty, // 宸ュ崟鏁伴噺
-
+            ordertype: this.dialogForm.ordertype, // 鍗曟嵁绫诲瀷
+            sourceorder: this.dialogForm.sourceorder, // 婧愬崟鍗曞彿
             routecode: this.dialogForm.routecode, // 宸ヨ壓璺嚎缂栫爜
             wkshopcode: this.dialogForm.wkshopcode, // 鐢熶骇杞﹂棿缂栫爜
             planstartdate: this.dialogForm.planstartdate, // 璁″垝寮�濮嬫椂闂�
@@ -1373,6 +1812,7 @@
 
           this.tableDataPrint = res3
           this.formApprove.mesordercode = res3[0].wo_code
+          this.formApprove.m_po = res3[0].m_po
           this.formApprove.partcode = res3[0].partcode
           this.formApprove.partname = res3[0].partname
           this.formApprove.partspec = res3[0].partspec
@@ -1449,6 +1889,7 @@
     dialogVisibleConfirmClose() {
       // this.dialogForm.mesordercode = ''
       this.formApprove.mesordercode = ''
+      this.formApprove.m_po = ''
       this.formApprove.partcode = ''
       this.formApprove.partname = ''
       this.formApprove.partspec = ''
@@ -1514,6 +1955,95 @@
         colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
         correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
       })
+    },
+    // 鎶ュ簾琛ュ崟鎯呭喌涓嬪彲鐐瑰嚮閫夋嫨
+    mesordertsourcesearchclick() {
+      if (this.dialogForm.ordertype === 'PO') {
+        return this.$message.info('宸ュ崟绫诲瀷涓烘姤搴熻ˉ鍗曟儏鍐典笅鍙�夋嫨锛�')
+      }
+
+      this.getErpOrderSearch()
+
+      this.dialogVisibleSource = true
+    },
+    async   getErpOrderSearch() {
+      let tempDate2 = this.sourceForm.paystartdate
+      if (tempDate2.length > 0) {
+        tempDate2 = handleDatetime(tempDate2[0]) + '~' + handleDatetime(tempDate2[1])
+      }
+
+      let tempDate = this.sourceForm.payenddate
+      if (tempDate.length > 0) {
+        tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1])
+      }
+
+      const data = {
+        erporderstus: this.sourceForm.erporderstus, // 璁㈠崟鐘舵�佺爜
+        erpordercode: this.sourceForm.erpordercode, // 璁㈠崟缂栧彿
+        partcode: this.sourceForm.partcode, // 浜у搧缂栫爜
+        partname: this.sourceForm.partname, // 浜у搧鍚嶇О
+        partspec: this.sourceForm.partspec, // 浜у搧瑙勬牸
+        paystartdate: tempDate2, // 浜や粯鏃堕棿
+        payenddate: tempDate, // 浜や粯鏃堕棿
+        creatuser: this.sourceForm.creatuser, // 鍒涘缓浜哄憳
+
+        prop: this.sourceForm.prop, // 鎺掑簭瀛楁
+        order: this.sourceForm.order, // 鎺掑簭瀛楁
+        page: this.sourceForm.page, // 绗嚑椤�
+        rows: this.sourceForm.rows // 姣忛〉澶氬皯鏉�
+
+      }
+
+      const res = await ErpOrderSearch(data)
+      this.sourceTableData = res.data
+      this.sourceFormTotal = res.count
+    },
+    // 鍗曢�夋閫変腑鑾峰彇褰撳墠琛屼俊鎭�
+    getCurrentRowSource(id) {
+      this.radioSelectedId = id
+    },
+    sourceSearch() {
+      this.getErpOrderSearch()
+    },
+    sourceReset() {
+      this.sourceForm.erporderstus = ''
+      this.sourceForm.erpordercode = ''
+      this.sourceForm.partcode = ''
+      this.sourceForm.partname = ''
+      this.sourceForm.partspec = ''
+      this.sourceForm.paystartdate = ''
+      this.sourceForm.payenddate = ''
+      this.sourceForm.creatuser = ''
+      this.sourceForm.createdate = ''
+      this.getErpOrderSearch()
+    },
+    dialogVisibleSourceClose() {
+      this.radioSelectedId = ''
+
+      this.sourceForm.erporderstus = ''
+      this.sourceForm.erpordercode = ''
+      this.sourceForm.partcode = ''
+      this.sourceForm.partname = ''
+      this.sourceForm.partspec = ''
+      this.sourceForm.paystartdate = ''
+      this.sourceForm.payenddate = ''
+      this.sourceForm.creatuser = ''
+      this.sourceForm.createdate = ''
+
+      this.isExpand = false
+      this.sourceTableData = []
+    },
+    dialogVisibleSourceBack() {
+      this.dialogVisibleSource = false
+    },
+    dialogVisibleSourceConfirm() {
+      console.log(this.radioSelectedId)
+      this.sourceTableData.forEach(item => {
+        if (item.id === this.radioSelectedId) {
+          this.dialogForm.sourceorder = item.wo
+        }
+      })
+      this.dialogVisibleSource = false
     }
 
   }
@@ -1523,9 +2053,10 @@
 <style lang="scss" scoped>
 $main_color: #42b983;
 
-.el-date-editor{
+.el-date-editor {
   font-size: 14px;
 }
+
 ::v-deep .el-dialog__body {
   padding: 20px 100px !important;
 }
@@ -1582,12 +2113,13 @@
 //  //outline: #000 solid 2px !important;
 //}
 
-.tableDataPrint ::v-deep div.cell{
+.tableDataPrint ::v-deep div.cell {
   display: flex !important;
   align-items: center !important;
   justify-content: center !important;
 }
-.formContent{
+
+.formContent {
   width: 240px;
 }
 
@@ -1602,18 +2134,37 @@
 
 </style>
 <style>
-.formContent .el-form-item__label{
-color: #000 !important;
+.formContent .el-form-item__label {
+  color: #000 !important;
 }
 </style>
 <!--鍏叡椤甸潰鏍峰紡-->
 <style lang="scss" scoped>
 $main_color: #42b983;
-.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
+::v-deep  .el-range-input{
+  font-size: 14px !important;
+}
+::v-deep .el-range__icon{
+  line-height: 28px !important;
+}
+::v-deep .el-range-separator{
+  line-height: 28px !important;
+}
+::v-deep .el-range-input{
+  font-size: 14px ;
+}
+::v-deep .el-range-separator{
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
   color: $main_color;
   cursor: pointer;
 }
-.el-icon-edit-outline{
+
+.el-icon-edit-outline {
   margin-right: 15px;
 }
 
@@ -1674,8 +2225,8 @@
   background-color: #f8f8fa;
 }
 
-::v-deep .el-table__body .el-table__row.hover-row td{
-  background-color: #eaecef ;
+::v-deep .el-table__body .el-table__row.hover-row td {
+  background-color: #eaecef;
 }
 
 ::v-deep .el-form--inline .el-form-item__label {
@@ -1691,6 +2242,7 @@
 .body ::v-deep .el-form-item {
   margin-bottom: 0;
 }
+
 .userDialogVisible ::v-deep .el-form-item {
   margin-bottom: 0;
 }
@@ -1705,9 +2257,10 @@
     align-items: center !important;
   }
 
-  ::v-deep .el-input__prefix{
+  ::v-deep .el-input__prefix {
     margin-top: -3px;
   }
+
   //::v-deep .el-range__icon{
   //  line-height: 28px;
   //}

--
Gitblit v1.9.3