From 8527b19d2b64db40db7b152ac9dcb207784a1b64 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期四, 11 一月 2024 16:07:05 +0800
Subject: [PATCH] 	modified:   src/api/plan/manufacturingorder.js 	new file:   src/views/common/processinspect-part.vue 	modified:   src/views/plan/manufacturingorder/productorder-form.vue 	modified:   src/views/quality/processInspect/processInspect-form.vue 	modified:   src/views/technology/routing/routing-form.vue 	modified:   vue.config.js

---
 src/views/plan/manufacturingorder/productorder-form.vue |  302 ++++++++++++++++++++++++++++++++-----------------
 1 files changed, 197 insertions(+), 105 deletions(-)

diff --git a/src/views/plan/manufacturingorder/productorder-form.vue b/src/views/plan/manufacturingorder/productorder-form.vue
index 212ad12..e825e10 100644
--- a/src/views/plan/manufacturingorder/productorder-form.vue
+++ b/src/views/plan/manufacturingorder/productorder-form.vue
@@ -8,7 +8,7 @@
       </div>
       <div class="btn-group header-right" v-if="editable">
         <el-button :disabled="isSubmit" v-thinclick="`dataFormSubmit`"
-          >淇濆瓨</el-button
+          type="primary">淇濆瓨</el-button
         >
       </div>
     </div>
@@ -65,6 +65,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="闆朵欢" prop="partId">
+                <el-tooltip class="item" effect="dark" :content="partStr" >
                 <el-input v-model="partStr" placeholder="" readonly>
                   <el-button
                     v-if="!this.dataForm.id"
@@ -73,11 +74,12 @@
                     @click="openRoutingDialog()"
                   ></el-button>
                 </el-input>
+                </el-tooltip>
               </el-form-item>
             </el-col>
           </el-row>
           <el-row :gutter="10">
-            <el-col :span="3">
+            <el-col :span="4">
               <el-form-item label="闇�姹傛暟閲�" prop="qtyRequired">
                 <el-input
                   v-model="dataForm.qtyRequired"
@@ -86,9 +88,10 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="3">
+            <el-col :span="4">
               <el-form-item label="瀹屾垚鏁伴噺" prop="qtyFinished">
                 <el-input-number
+                  style= "width: 90%"
                   v-model="dataForm.qtyFinished"
                   placeholder=""
                   :controls="false"
@@ -107,7 +110,7 @@
                 </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <!-- <el-col :span="6">
               <el-form-item label="澶栨姢棰滆壊" prop="outerColor">
                 <el-input
                   readonly
@@ -124,16 +127,16 @@
                   placeholder=""
                 ></el-input>
               </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row :gutter="10">
-            <el-col :span="6">
+            </el-col> -->
+             <el-col :span="5">
               <el-form-item label="澶囨敞" prop="remark">
-                <el-input v-model="dataForm.remark" placeholder=""></el-input>
+                <el-tooltip class="item" effect="dark" :content="dataForm.remark">
+                <el-input v-model="dataForm.remark" placeholder="">
+                </el-input>
+                </el-tooltip>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="5">
               <el-form-item label="鍒堕�犲睘鎬�" prop="manufactureAttr">
                 <el-select
                   v-model="dataForm.manufactureAttr"
@@ -151,44 +154,43 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
-              <el-col
-                :span="8"
-                v-if="permissions.plan_manufacturingorder_bom_sure"
-              >
-                <el-form-item label="BOM纭">
-                  <el-switch v-model="dataForm.bomConfirmStatus"> </el-switch>
-                </el-form-item>
-              </el-col>
-              <el-col
-                :span="8"
-                v-if="permissions.plan_manufacturingorder_process_sure"
-              >
-                <el-form-item label="宸ヨ壓纭">
-                  <el-switch v-model="dataForm.processConfirmStatus">
-                  </el-switch>
-                </el-form-item>
-              </el-col>
-              <el-col
-                :span="8"
-                v-if="permissions.plan_manufacturingorder_test_sure"
-              >
-                <el-form-item label="妫�娴嬫爣鍑嗙‘璁�">
-                  <el-switch v-model="dataForm.standardConfirmStatus">
-                  </el-switch>
-                </el-form-item>
-              </el-col>
+          </el-row>
+            <!-- <el-col
+              :span="2"
+              v-if="permissions.plan_manufacturingorder_bom_sure"
+            >
+              <el-form-item label="BOM纭" label-width="110px">
+                <el-switch v-model="dataForm.bomConfirmStatus"> </el-switch>
+              </el-form-item>
             </el-col>
-            <el-col :span="4">
+            <el-col
+              :span="2"
+              v-if="permissions.plan_manufacturingorder_process_sure"
+            >
+              <el-form-item label="宸ヨ壓纭" label-width="110px">
+                <el-switch v-model="dataForm.processConfirmStatus">
+                </el-switch>
+              </el-form-item>
+            </el-col>
+            <el-col
+              :span="2"
+              v-if="permissions.plan_manufacturingorder_test_sure"
+            >
+              <el-form-item label="妫�娴嬫爣鍑嗙‘璁�" label-width="140px">
+                <el-switch v-model="dataForm.standardConfirmStatus">
+                </el-switch>
+              </el-form-item>
+            </el-col> -->
+            <!-- <el-col :span="2">
               <el-form-item
                 label="IFS杞﹂棿璁㈠崟鎺ユ敹鏃舵姤鍛婂伐搴�"
                 prop="isReportOperation"
-                label-width="200px"
+                label-width="250px"
               >
                 <el-switch v-model="dataForm.isReportOperation" disabled>
                 </el-switch>
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <!-- <el-col :span="2">
               <el-form-item label="BOM纭">
                 <el-switch >
@@ -207,7 +209,7 @@
                 </el-switch>
               </el-form-item>
             </el-col> -->
-          </el-row>
+
         </div>
         <div class="productorder-detail">
           <el-card class="productorder-list">
@@ -229,15 +231,7 @@
                             <el-option
                               v-for="item in dataForm.routingList"
                               :key="item.id"
-                              :label="
-                                item.routingNo +
-                                  '-' +
-                                  item.bomTypeDb +
-                                  '-' +
-                                  item.alternativeNo +
-                                  '-' +
-                                  item.alternativeDesc
-                              "
+                              :label="item.routingNo "
                               :value="item.id"
                             >
                             </el-option>
@@ -263,11 +257,22 @@
                         </el-form-item>
                       </el-col>
                     </el-row>
-
                     <el-row>
                       <el-col :span="24" class="productorder-operates-col">
-                        <el-card class="productorder-operates">
-                          <el-table
+                        <el-card class="productorder-operates" >
+                          <el-row>
+                            <el-col :span="2" class="frame1">搴忓彿
+                            </el-col>
+                            <el-col :span="4" class="frame1">宸ュ簭鍙�
+                            </el-col>
+                            <el-col :span="5" class="frame1">宸ュ簭鎻忚堪
+                            </el-col>
+                            <el-col :span="9" class="frame1">闆朵欢
+                            </el-col>
+                            <el-col :span="3" class="frame1">鎿嶄綔
+                            </el-col>
+                          </el-row>
+                          <!-- <el-table
                             ref="operationTable"
                             :data="operations"
                             style="width: 100%;"
@@ -315,10 +320,56 @@
                                 </el-button>
                               </template>
                             </el-table-column>
-                          </el-table>
+                          </el-table> -->
+                          <zttdraggable
+                            :forceFallback="true"
+                            :list="operations"
+                            :animation="200"
+                            fallbackClass="fallbackStyle"
+                            ghostClass="item_ghost"
+                            @end="dragEnd"
+                          >
+                            <div
+                              :class="{ dragItem: true, active: x.active }"
+                              v-for="(x, i) in operations"
+                              :key="i"
+                            >
+                              <!-- <div class="dragBody">
+                                <div class="info">{{ x.operationNo }}</div>
+                                <div class="info">{{ x.operationName }}</div>
+                                <div class="info">{{ x.partName }}</div>
+                              </div> -->
+                              <el-row>
+                                <el-col :span="2" class="frame">{{ i+1 }}
+                                </el-col>
+                                <el-col :span="4" class="frame">{{ x.operationNo  }}
+                                </el-col>
+                                <el-col :span="5" class="frame">{{ x.operationName }}
+                                </el-col>
+                                <el-col :span="9" class="frame">{{ x.partName }}
+                                </el-col>
+                                <el-col :span="3" class="frame">
+                                    <el-button
+                                      type="text"
+                                      size="mini"
+                                      @click="openOrderOperation(x)"
+                                      >缂栬緫
+                                    </el-button>
+                                </el-col>
+                              </el-row>
+                            </div>
+                          </zttdraggable>
                         </el-card>
                       </el-col>
                     </el-row>
+                  
+                  
+                  
+                  
+                  
+                  
+                  
+                  
                   </el-col>
                   <el-col :span="16">
                     <el-tabs type="card" ref="paramTabs">
@@ -487,7 +538,7 @@
                           </el-table>
                         </el-card>
                       </el-tab-pane>
-                      <el-tab-pane
+                     <!--  <el-tab-pane
                         label="妫�娴嬫爣鍑�"
                         key="tb1"
                         id="tb1"
@@ -500,8 +551,8 @@
                           :moRoutingOperationId="moRoutingOperationId"
                           @refreshTestStandardInfo="refreshTestStandardInfo"
                         ></testStandardTable>
-                      </el-tab-pane>
-                      <el-tab-pane
+                      </el-tab-pane> -->
+                      <!-- <el-tab-pane
                         label="鎶芥瑙勫垯"
                         key="tb2"
                         id="tb2"
@@ -587,7 +638,7 @@
                             </el-table>
                           </div>
                         </div>
-                      </el-tab-pane>
+                      </el-tab-pane> -->
                     </el-tabs>
                   </el-col>
                 </el-row>
@@ -595,8 +646,19 @@
 
               <el-tab-pane label="浜у搧缁撴瀯" id="ta1" key="ta1" name="ta1">
                 <el-row>
-                  <el-col :span="11">
-                    <el-form-item label="瀹屾暣BOM">
+                  <el-col :span="2" style="text-align: center">
+                    <el-button
+                      type="text"
+                      size="small"
+                      icon="el-icon-circle-plus-outline"
+                      style="color:#f56c6c;"
+                      :disabled="!dataForm.id"
+                      @click="addStruct()"
+                      >娣诲姞鍏冪礌
+                    </el-button>
+                  </el-col>
+                  <el-col :offset="11" :span="11">
+                    <!-- <el-form-item label="瀹屾暣BOM">
                       <el-select
                         @change="bomSelectChanged"
                         disabled
@@ -622,35 +684,18 @@
                         >
                         </el-option>
                       </el-select>
-                    </el-form-item>
-                  </el-col>
-                  <el-col :offset="11" :span="2" style="text-align: center">
-                    <el-button
-                      type="text"
-                      size="small"
-                      icon="el-icon-circle-plus-outline"
-                      style="color:#f56c6c;"
-                      :disabled="!dataForm.id"
-                      @click="addStruct()"
-                      >娣诲姞鍏冪礌
-                    </el-button>
+                    </el-form-item> -->
                   </el-col>
                 </el-row>
                 <el-row>
                   <el-table
-                    default-expand-all
-                    :data="components"
+                    :data="components[0]"
                     @selection-change="structSelectionChange"
-                    row-key="id"
                     border
-                    :tree-props="{
-                      children: 'children'
-                    }"
                     style="width: 100%"
                     height="400px"
-                    :default-sort="{ prop: 'index' }"
                   >
-                    <el-table-column type="selection" width="40" fixed="left" />
+                    <!-- <el-table-column type="selection" width="40" fixed="left" /> -->
                     <el-table-column
                       type="index"
                       width="50"
@@ -668,7 +713,7 @@
                     />
                     <el-table-column
                       prop="partName"
-                      width=""
+                      width="200"
                       header-align="center"
                       align="left"
                       label="闆朵欢"
@@ -707,13 +752,13 @@
                       label="鍗曚綅"
                     />
 
-                    <el-table-column
+                    <!-- <el-table-column
                       prop="discNum"
                       width="150"
                       header-align="center"
                       align="center"
                       label="鐩樻暟(鐩�)"
-                    />
+                    /> -->
 
                     <!-- <el-table-column
                       prop="version"
@@ -759,7 +804,7 @@
                     </el-table-column>
                   </el-table>
                 </el-row>
-                <el-row>
+                <!-- <el-row>
                   <el-col :span="24"
                     ><div style="margin-top:5px;">
                       <span style="font-size:12px;">澶栧崗鍙戞枡琛�</span>
@@ -851,7 +896,7 @@
                       </el-table-column>
                     </el-table>
                   </el-col>
-                </el-row>
+                </el-row> -->
               </el-tab-pane>
               <el-tab-pane label="瀹㈡埛璁㈠崟" id="ta3" key="ta3" name="ta3">
                 <CustomerOrder :orderId="dataForm.id" />
@@ -930,7 +975,27 @@
     />
   </div>
 </template>
-<style>
+<style lang="scss">
+.frame{
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 100px;
+    // border-width: 1px;
+    // border-color: rgb(129, 129, 129);
+    // border-style: solid;
+    font-size: 15px;
+}
+.frame1{
+  display: flex;
+    justify-content: center;
+    align-items: center;
+    height: 50px;
+    // border-width: 1px;
+    // border-color: rgb(129, 129, 129);
+    // border-style: solid;
+    font-size: 15px;
+}
 .productorder-basic {
   background-color: #fff;
   height: 150px;
@@ -969,6 +1034,7 @@
 .productorder-operates {
   height: 605px;
   border: 1px solid #ddd;
+  overflow: auto;
 }
 
 .productorder-params-template {
@@ -1020,7 +1086,8 @@
   addRoutingTemplateParamLedForOrder,
   updateMoBom,
   delMoBom,
-  bomSelectChange
+  bomSelectChange,
+  changeOrder,
 } from '@/api/plan/manufacturingorder'
 import { qryMoSamplingRule, delMoSamplingRule } from '@/api/plan/mosamplingrule'
 import {
@@ -1050,7 +1117,7 @@
 import spotCheckRule from './orderSpotCheckRule'
 import spotCheckRuleEdit from './orderSpotCheckRuleEdit'
 import { mapGetters } from 'vuex'
-
+import zttdraggable from 'vuedraggable'
 export default {
   components: {
     CustomerOrder,
@@ -1066,11 +1133,13 @@
     operationDialog,
     insertOperationDialog,
     spotCheckRule,
-    spotCheckRuleEdit
+    spotCheckRuleEdit,
+    zttdraggable
   },
 
   data() {
     return {
+      componentsTable:[],
       typeOptions: [],
       paramTemplateSelArr: [],
       paramTemplateSelCol: 'operationTemplateNo',
@@ -1245,7 +1314,8 @@
         }
       }
     },
-
+    components(newVal,oldVal){
+    },
     currentRouting(newValue, oldValue) {
       if (newValue && newValue.id) {
         if (this.dataForm.id != null && this.dataForm.id !== 0) {
@@ -1295,7 +1365,7 @@
       if (newValue && newValue.id) {
         // 鏌ヨ浜у搧缁撴瀯瀵瑰簲鐨勭粍浠�
         getBom(newValue.id).then((response) => {
-          this.components = [response.data.data.tree]
+          // this.components = [response.data.data.tree]
         })
       }
     },
@@ -1329,6 +1399,28 @@
     }
   },
   methods: {
+    dragEnd(e){
+      this.operations.forEach((e, i) => {
+        e.index = i + 1
+        e.operationOrder = i+1
+      })
+      console.log(this.operations,"鎷栨嫿缁撴潫kk");
+      this.dragEndstart()
+    },
+    dragEndstart(){
+        let data = this.operations.map(el =>{
+            return {
+              id:el.id,
+              operationOrder:el.operationOrder,
+            }
+        })
+      console.log(data,"id");
+        changeOrder(data).then((res) =>{
+            console.log(res,"鍥炶皟");
+        }).catch(error => {
+					console.error(error)
+				});
+    },
     getSysParam(paramKey) {
       getSysParam(paramKey).then((response) => {
         var paramVal = response.data.data
@@ -1397,6 +1489,7 @@
     },
     // 鏌ヨ褰撳墠杞﹂棿璁㈠崟淇℃伅
     getOrderInfo() {
+      let that=this
       getManufacturingOrder(this.dataForm.id).then((response) => {
         this.dataForm = response.data.data
         // 鎶婂伐鑹烘寕涓婂幓
@@ -1416,7 +1509,7 @@
         }
         // 鎶婁骇鍝佺粨鏋勭粍浠舵寕涓婂幓
         if (this.dataForm.bomRoot) {
-          this.components = [this.dataForm.bomRoot]
+          that.components = [this.dataForm.bomRoot]
         }
       })
     },
@@ -2097,7 +2190,6 @@
     },
     // 鏂板宸ュ簭
     addOperation(operation) {
-      console.log('operation', operation)
     },
     insertOperation(operation) {},
     structSelectionChange(val) {
@@ -2105,17 +2197,17 @@
     },
     // 鎵撳紑bom鑺傜偣
     addStruct() {
-      if (this.structSelection.length <= 0) {
-        this.$message.error('璇烽�夋嫨闇�瑕佹坊鍔犲厓绱犵殑鑺傜偣')
-      } else {
-        if (this.structSelection.length === 1) {
-          this.selectedStruct = this.structSelection[0]
-          this.moId = this.dataForm.id
-          this.showStructForm = true
-        } else {
-          this.$message.error('鍙兘涓哄崟涓妭鐐规坊鍔犲厓绱�')
-        }
-      }
+      this.selectedStruct = this.structSelection[0]
+      this.moId = this.dataForm.id
+      this.showStructForm = true
+      // if (this.structSelection.length <= 0) {
+      //   this.$message.error('璇烽�夋嫨闇�瑕佹坊鍔犲厓绱犵殑鑺傜偣')
+      // } else {
+      //   if (this.structSelection.length === 1) {
+      //   } else {
+      //     this.$message.error('鍙兘涓哄崟涓妭鐐规坊鍔犲厓绱�')
+      //   }
+      // }
     },
     refreshBom(node) {
       if (this.selectedStruct.children != null) {

--
Gitblit v1.9.3