From 4963aa4888fc1bcfa6de0c392ee26a134a460cfe Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 05 六月 2024 14:55:43 +0800
Subject: [PATCH] 货盘运输移库数量预填写

---
 src/views/plan/manufacturingorder/productorder-form.vue |  291 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 240 insertions(+), 51 deletions(-)

diff --git a/src/views/plan/manufacturingorder/productorder-form.vue b/src/views/plan/manufacturingorder/productorder-form.vue
index d4fcf52..46be539 100644
--- a/src/views/plan/manufacturingorder/productorder-form.vue
+++ b/src/views/plan/manufacturingorder/productorder-form.vue
@@ -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,15 +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"
@@ -150,7 +154,16 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col
+            <el-col :span="10">
+              <el-form-item label="宸ヨ壓鏂囦欢" prop="technologyDocumentName">
+                 <el-tooltip class="item" effect="dark" :content="dataForm.technologyDocumentName">
+                  <el-input v-model="dataForm.technologyDocumentName" placeholder="">
+                </el-input>
+                </el-tooltip>
+              </el-form-item>
+            </el-col>
+          </el-row>
+            <!-- <el-col
               :span="2"
               v-if="permissions.plan_manufacturingorder_bom_sure"
             >
@@ -175,8 +188,8 @@
                 <el-switch v-model="dataForm.standardConfirmStatus">
                 </el-switch>
               </el-form-item>
-            </el-col>
-            <el-col :span="2">
+            </el-col> -->
+            <!-- <el-col :span="2">
               <el-form-item
                 label="IFS杞﹂棿璁㈠崟鎺ユ敹鏃舵姤鍛婂伐搴�"
                 prop="isReportOperation"
@@ -185,7 +198,7 @@
                 <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 >
@@ -204,7 +217,7 @@
                 </el-switch>
               </el-form-item>
             </el-col> -->
-          </el-row>
+
         </div>
         <div class="productorder-detail">
           <el-card class="productorder-list">
@@ -226,15 +239,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>
@@ -260,47 +265,71 @@
                         </el-form-item>
                       </el-col>
                     </el-row>
-
                     <el-row>
                       <el-col :span="24" class="productorder-operates-col">
-                        <el-card class="productorder-operates">
+                        <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
+                            id="operationTable"
                             ref="operationTable"
+                            class="basic-template-table"
                             :data="operations"
-                            style="width: 100%;"
                             height="593px"
+                            border
                             highlight-current-row
                             :default-sort="{ prop: 'operationOrder' }"
                             @row-click="operationRowClick"
                           >
                             <el-table-column
                               prop="operationOrder"
+                              min-width="50"
                               label="搴忓彿"
-                            ></el-table-column>
+                            >
+                            <template slot-scope="scope">
+                                <div style="display:flex">
+                                    <span style="width:20px;">
+                                    <i class="icon aufontAll  h-icon-all-drag"></i
+                                    ></span>
+                                    <span>{{ scope.row.operationOrder }}</span>
+                                </div>
+                            </template>
+                            </el-table-column>
                             <el-table-column
                               prop="operationNo"
                               header-align="center"
                               align="center"
+                              min-width="100"
                               label="宸ュ簭鍙�"
                             ></el-table-column>
                             <el-table-column
                               prop="operationName"
                               header-align="center"
                               align="center"
+                              min-width="100"
                               label="宸ュ簭鎻忚堪"
                             ></el-table-column>
-
                             <el-table-column
                               prop="partName"
                               header-align="center"
-                              align="center"
+                              min-width="100px"
                               label="闆朵欢"
                             ></el-table-column>
-
                             <el-table-column
                               prop="remark"
                               header-align="center"
                               align="center"
+                              min-width="50"
                               label="鎿嶄綔"
                             >
                               <template slot-scope="scope">
@@ -313,6 +342,41 @@
                               </template>
                             </el-table-column>
                           </el-table>
+                          <!-- <zttdraggable
+                            :forceFallback="true"
+                            :list="operations"
+                            :animation="200"
+                            fallbackClass="fallbackStyle"
+                            ghostClass="item_ghost"
+                            @end="dragEnd"
+                            :default-sort="{ prop: 'operationOrder' }"
+                            @choose="operationRowClick"
+                          >
+                            <div
+                              :class="{ dragItem: true, active: x.active }"
+                              v-for="(x, i) in operations"
+                              :key="i"
+                            >
+                              <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>
@@ -484,7 +548,7 @@
                           </el-table>
                         </el-card>
                       </el-tab-pane>
-                      <el-tab-pane
+                     <!--  <el-tab-pane
                         label="妫�娴嬫爣鍑�"
                         key="tb1"
                         id="tb1"
@@ -497,7 +561,7 @@
                           :moRoutingOperationId="moRoutingOperationId"
                           @refreshTestStandardInfo="refreshTestStandardInfo"
                         ></testStandardTable>
-                      </el-tab-pane>
+                      </el-tab-pane> -->
                       <!-- <el-tab-pane
                         label="鎶芥瑙勫垯"
                         key="tb2"
@@ -698,13 +762,13 @@
                       label="鍗曚綅"
                     />
 
-                    <el-table-column
+                    <!-- <el-table-column
                       prop="discNum"
                       width="150"
                       header-align="center"
                       align="center"
                       label="鐩樻暟(鐩�)"
-                    />
+                    /> -->
 
                     <!-- <el-table-column
                       prop="version"
@@ -921,7 +985,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;
@@ -960,6 +1044,7 @@
 .productorder-operates {
   height: 605px;
   border: 1px solid #ddd;
+  overflow: auto;
 }
 
 .productorder-params-template {
@@ -988,12 +1073,40 @@
 .productorder-operates-col {
   margin-bottom: 0px;
 }
+.basic-template-table .el-table__body .el-table__row td:first-child .cell {
+  padding-left: 0px;
+  padding-right: 0px;
+}
+
+.basic-template-table .el-table__body .el-table__row:hover {
+  cursor: move;
+}
+
+.basic-template-table .el-table__body .el-table__row:hover .icon {
+  display: inline-block;
+}
+
+.basic-template-table .el-table__body .el-table__row .icon {
+  color: rgba(0, 0, 0, 0.45);
+  font-size: 12px;
+  line-height: 18px;
+  display: none;
+}
+
+.aufontAll {
+  font-family: aufontAll !important;
+  font-size: 14px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
 </style>
 
 <style scoped>
 /deep/ .el-input-number.is-without-controls .el-input__inner {
   text-align: start;
 }
+
 </style>
 <script>
 import {
@@ -1011,7 +1124,8 @@
   addRoutingTemplateParamLedForOrder,
   updateMoBom,
   delMoBom,
-  bomSelectChange
+  bomSelectChange,
+  changeOrder,
 } from '@/api/plan/manufacturingorder'
 import { qryMoSamplingRule, delMoSamplingRule } from '@/api/plan/mosamplingrule'
 import {
@@ -1041,7 +1155,7 @@
 import spotCheckRule from './orderSpotCheckRule'
 import spotCheckRuleEdit from './orderSpotCheckRuleEdit'
 import { mapGetters } from 'vuex'
-
+import zttdraggable from 'vuedraggable'
 export default {
   components: {
     CustomerOrder,
@@ -1057,7 +1171,8 @@
     operationDialog,
     insertOperationDialog,
     spotCheckRule,
-    spotCheckRuleEdit
+    spotCheckRuleEdit,
+    zttdraggable
   },
 
   data() {
@@ -1116,7 +1231,9 @@
         endDate: null,
         manufactureAttr: 'N',
         isReportOperation: false,
-        outPutBatchList: []
+        outPutBatchList: [],
+        technologyDocumentId: null,
+        technologyDocumentName: null,
       },
       currentRow: [],
       currentRouting: {}, // 褰撳墠閫夋嫨鐨勫伐鑹�
@@ -1127,6 +1244,9 @@
       operationTemplateList: [], // 鍙傛暟闆�
       templateParamList: [], // 鍙傛暟
       dataRule: {
+        technologyDocumentName:[
+          { required: true, message: '宸ヨ壓鏂囦欢涓嶈兘涓虹┖', trigger: 'blur' }
+        ],
         workshopTypeCode: [
           { required: true, message: '杞﹂棿璁㈠崟绫诲瀷涓嶈兘涓虹┖', trigger: 'blur' }
         ],
@@ -1163,6 +1283,7 @@
     }
   },
   mounted() {
+    this.rowDrop()
     window.addEventListener(
       'hashchange',
       () => {
@@ -1224,7 +1345,6 @@
     this.getBomTypeDbOptions()
     this.getManufactureAttrs('manufacture_attr_type')
     this.getSysParam(sysParam.IS_REPORT_OPERATION)
-    // console.log(this.components);
   },
   watch: {
     'dataForm.partId'(newValue, oldValue) {
@@ -1239,9 +1359,6 @@
       }
     },
     components(newVal,oldVal){
-      console.log("鏂�",newVal);
-      console.log("鑰�",oldVal);
-      console.log(this.components);
     },
     currentRouting(newValue, oldValue) {
       if (newValue && newValue.id) {
@@ -1292,7 +1409,6 @@
       if (newValue && newValue.id) {
         // 鏌ヨ浜у搧缁撴瀯瀵瑰簲鐨勭粍浠�
         getBom(newValue.id).then((response) => {
-          console.log("鏌�",this.components);
           // this.components = [response.data.data.tree]
         })
       }
@@ -1327,6 +1443,70 @@
     }
   },
   methods: {
+    rowDrop() {
+      const that = this
+      const tbody = document.querySelector(
+        '#operationTable .el-table__body-wrapper tbody'
+      )
+      Sortable.create(tbody, {
+        // 缁撴潫鎷栨嫿
+        onEnd({ newIndex, oldIndex }) {
+          if (newIndex > oldIndex) {
+            // 涓嬬Щ
+            that.operations
+              .filter((e) => e.operationOrder == oldIndex + 1)
+              .forEach((e) => (e.operationOrder = 'x'))
+            that.operations
+              .filter((e) => e.operationOrder > oldIndex + 1 && e.operationOrder <= newIndex + 1)
+              .forEach((e) => (e.operationOrder = e.operationOrder - 1))
+            that.operations
+              .filter((e) => e.operationOrder == 'x')
+              .forEach((e) => (e.operationOrder = newIndex + 1))
+          } else if (oldIndex > newIndex) {
+            // 涓婄Щ
+            that.operations
+              .filter((e) => e.operationOrder == oldIndex + 1)
+              .forEach((e) => (e.operationOrder = 'x'))
+            that.operations
+              .filter((e) => e.operationOrder < oldIndex + 1 && e.operationOrder >= newIndex + 1)
+              .forEach((e) => (e.operationOrder = e.operationOrder + 1))
+            that.operations
+              .filter((e) => e.operationOrder == 'x')
+              .forEach((e) => (e.operationOrder = newIndex + 1))
+          }
+          // 鎷栨嫿缁撴潫鍚庯紝淇濆瓨鏂扮殑鎺掑簭
+          let data = that.operations.map(el =>{
+            return {
+              id:el.id,
+              operationOrder:el.operationOrder,
+            }
+          })
+          changeOrder(data).then().catch(error => {
+                console.error(error)
+          });
+        }
+      })
+    },
+    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,
+            }
+        })
+        changeOrder(data).then((res) =>{
+        }).catch(error => {
+			console.error(error)
+		});
+    },
     getSysParam(paramKey) {
       getSysParam(paramKey).then((response) => {
         var paramVal = response.data.data
@@ -1428,13 +1608,7 @@
       checkPart(value, this.dataForm.workshopTypeCode)
         .then((response) => {
           const manufacturingOrderDTO = response.data.data
-          /* this.dataForm.routingList = manufacturingOrderDTO.routingList.filter(
-            (e) => e.bomTypeDb === this.dataForm.workshopTypeCode
-          ) */
           this.dataForm.routingList = manufacturingOrderDTO.routingList
-          /* this.dataForm.bomList = manufacturingOrderDTO.bomList.filter(
-            (e) => e.bomTypeDb === this.dataForm.workshopTypeCode
-          ) */
           this.dataForm.bomList = manufacturingOrderDTO.bomList
           this.dataForm.technologyRoutingId =
             manufacturingOrderDTO.technologyRoutingId
@@ -1496,6 +1670,7 @@
           } else {
             this.dataForm.bomRoot = null
           }
+
           if (this.dataForm.id) {
             putManufacturingOrder(this.dataForm)
               .then((response) => {
@@ -1570,10 +1745,13 @@
       this.showRouting = true
     },
     selectRouting(param) {
+      console.log(param);
       if (param) {
         this.dataForm.partNo = param.partNo
         this.dataForm.partName = param.partName
         this.dataForm.partId = param.partId
+        this.dataForm.technologyDocumentId = param.id
+        this.dataForm.technologyDocumentName = param.name
         this.$refs.dataForm.validateField('partId', (valid) => {})
       }
     },
@@ -1593,6 +1771,8 @@
       })
     },
     // 2.tabs-宸ヨ壓璺嚎
+    //宸ヨ壓鏂囦欢閫夋嫨
+
     // 宸ヨ壓璺嚎閫夋嫨
     routingSelectChanged(routingId) {
       this.currentRouting = this.dataForm.routingList.find(
@@ -1666,6 +1846,8 @@
     },
     // 鐐瑰嚮宸ヨ壓宸ュ簭琛岃Е鍙戞牎楠屽伐鑹烘槸鍚︿慨鏀癸紝鑻ヤ慨鏀瑰垯涓嶅彲鎿嶄綔锛岄渶鍏堜繚瀛橈紝鑻ユ湭淇敼锛屽垯鍙煡璇㈠嚭瀵瑰簲鐨勫弬鏁伴泦
     operationRowClick(row) {
+        //   const row = this.operations[event.oldIndex]
+          console.log(row);
       if (this.dataForm.id != null && this.dataForm.id !== 0) {
         this.routingOperationId = row.technologyRoutingOperationId
         this.moRoutingOperationId = row.id
@@ -1919,6 +2101,14 @@
     },
     // 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼
     saveAllParamChange() {
+      this.templateParamList.forEach(e=>{
+        if(e.paramValue!=null){
+          e.paramValue=e.paramValue.replace(',','锛�').replace('(','锛�').replace(')','锛�')
+          if (!isNaN(e.paramValue)) {
+            e.paramValue='='+e.paramValue
+          }
+        }
+      })
       const paramJson = { routingOperationParam: this.templateParamList }
       putRoutingTemplateParamForOrder(paramJson).then((response) => {
         const data = response.data
@@ -2096,7 +2286,6 @@
     },
     // 鏂板宸ュ簭
     addOperation(operation) {
-      console.log('operation', operation)
     },
     insertOperation(operation) {},
     structSelectionChange(val) {

--
Gitblit v1.9.3