From 51b05b093fa15dd477981372f67ae7b3b2747733 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期一, 23 九月 2024 08:49:29 +0800
Subject: [PATCH] change-3

---
 jcdm-ui/src/views/main/om/productionOrde/detail.vue |   93 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 90 insertions(+), 3 deletions(-)

diff --git a/jcdm-ui/src/views/main/om/productionOrde/detail.vue b/jcdm-ui/src/views/main/om/productionOrde/detail.vue
index da62750..096bd8a 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/detail.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/detail.vue
@@ -70,7 +70,14 @@
                     <span>{{ parseTime(scope.row.operateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                   </template>
                 </el-table-column>
-
+                <el-table-column
+                  fixed="right"
+                  label="鎿嶄綔"
+                  width="100">
+                  <template slot-scope="scope">
+                    <el-button @click="handleClick(scope.row)" type="text" size="small">鏇存崲绠变綋涓婄嚎</el-button>
+                  </template>
+                </el-table-column>
               </el-table>
               <pagination
                 v-show="total>0"
@@ -84,18 +91,51 @@
         </el-col>
       </el-row>
     </div>
+    <el-dialog v-dialogpop-up :title="title" :visible.sync="changeBoxFlag" width="500px" append-to-body>
+       <span slot="title">
+        <i class="el-icon-s-order"></i>
+        {{titleName}}
+      </span>
+      <el-form ref="changeFrom" inline  :model="changeFrom" label-width="80px">
+        <el-form-item   label="鍙戝姩鏈哄彿" prop="sfcCode">
+          <el-input disabled v-model="changeFrom.sfcCode" style="width: 370px"/>
+        </el-form-item>
+        <el-form-item   label="鍘熺浣撶爜" prop="boxCode">
+          <el-input disabled v-model="changeFrom.boxCode" style="width: 370px"/>
+        </el-form-item>
+        <el-form-item  label="鐜扮浣撶爜" v-model="changeFrom.newBoxCode" prop="newBoxCode">
+          <input v-model="changeFrom.newBoxCode"
+                 ref="changeBoxInput"
+                 style="height: 39px; width: 370px"
+                 placeholder="璇锋壂鎻忕浣撶爜"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormForBoxCode">纭� 瀹�</el-button>
+        <el-button @click="cancel">鍙� 娑�</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 
-import { engineNoIsInModel, getSumDataMethod, listOrderScheduling3 } from "../../../../api/main/bs/orderScheduling/orderScheduling";
+import { engineNoIsInModel, changeBoxCode, getSumDataMethod, listOrderScheduling3 } from "../../../../api/main/bs/orderScheduling/orderScheduling";
 export default {
   name: 'Detail',
   props: ['singleSelect'],
   dicts: ['order_scheduling_produce_status','quality_status','print_status','material_type'],
   data(){
     return{
+      title: '鏇存崲绠变綋',
+      changeBoxFlag: false,
+      titleName: '鏇存崲绠变綋',
+      changeFrom: {
+        boxCode: '',
+        newBoxCode: '',
+        sfcCode: ''
+      },
       // 鎬绘潯鏁�
       total: 0,
       repairFlag:false,
@@ -115,8 +155,53 @@
     handleQuery(){
 
     },
+    submitFormForBoxCode(){
+      if (this.changeFrom.newBoxCode === '' || this.changeFrom.newBoxCode === null){
+        this.$message.info("鏂扮浣撶爜涓嶈兘涓虹┖")
+      } else {
+        changeBoxCode({sfcCode:this.changeFrom.sfcCode,newBoxCode:this.changeFrom.newBoxCode}).then(res => {
+          console.log('res',res)
+          if (res.code===200){
+            this.$message({
+              message:'鎿嶄綔鎴愬姛',
+              type:'success'
+            })
+            this.changeBoxFlag = false
+            this.getListData()
+            this.$refs.inputdata.focus()
+          }else {
+            this.$message({
+              message:res.msg,
+              type:'warning'
+            })
+
+          }
+        })
+      }
+
+    },
+    handleClick(row){
+      console.log('row',row)
+      this.changeBoxFlag = true
+      this.changeFrom.sfcCode = row.engineNo
+      this.changeFrom.boxCode = row.boxCode
+      this.changeFrom.newBoxCode = ''
+      this.$nextTick(()=>{
+        this.$refs.changeBoxInput.focus()
+      })
+    },
+    cancel(){
+      this.changeBoxFlag = false
+      this.$refs.inputdata.focus()
+    },
+    handleChangeBoxInput(event){
+      const input = event.target
+      const inputValue = input.value
+      this.changeFrom.newBoxCode =  inputValue
+
+    },
     refresh() {
-      location.reload();
+      this.$emit("reserveChild",null)
     },
     setFocus(){
       this.$nextTick(()=>{
@@ -173,9 +258,11 @@
     this.getListData()
     this.setFocus()
     this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput)
+    this.$refs.changeBoxInput.addEventListener('keydown',this.handleChangeBoxInput)
   },
   beforeDestroy() {
     this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput)
+    this.$refs.changeBoxInput.removeEventListener('keydown',this.handleChangeBoxInput)
   }
 }
 </script>

--
Gitblit v1.9.3