From 4cafc2236338b6eaa0d51962b98495f0043e27c1 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期一, 01 十二月 2025 16:52:41 +0800
Subject: [PATCH] 1.报工调整  新增批量修改工序工价功能

---
 src/api/WorkOrder.js                |   10 +++
 src/views/produce/reportCorrect.vue |  148 +++++++++++++++++++++++++++++++++++++++++++++++--
 src/components/Pagination/index.vue |    2 
 3 files changed, 151 insertions(+), 9 deletions(-)

diff --git a/src/api/WorkOrder.js b/src/api/WorkOrder.js
index ec3e55d..a88397d 100644
--- a/src/api/WorkOrder.js
+++ b/src/api/WorkOrder.js
@@ -79,7 +79,6 @@
   })
 }
 
-
 // MES鎶ュ簾琛ュ崟宸ュ崟鏌ヨ
 export function MesBadOrderSearch(data) {
   return request({
@@ -383,3 +382,12 @@
     method: 'get'
   })
 }
+
+// 鐢熶骇鎵ц,鎶ュ伐璋冩暣鎵归噺鏀逛环鏁版嵁鎻愪氦
+export function MesOrderStepPriceBatchUpdateSeave(data) {
+  return request({
+    url: 'WorkOrder/MesOrderStepPriceBatchUpdateSeave',
+    method: 'post',
+    data
+  })
+}
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index cfbbee5..7c384d7 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -36,7 +36,7 @@
     pageSizes: {
       type: Array,
       default() {
-        return [10, 20, 50, 100]
+        return [10, 20, 50, 100, 500, 2000]
       }
     },
     layout: {
diff --git a/src/views/produce/reportCorrect.vue b/src/views/produce/reportCorrect.vue
index 26c5628..a9126cf 100644
--- a/src/views/produce/reportCorrect.vue
+++ b/src/views/produce/reportCorrect.vue
@@ -2,7 +2,11 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
 
-      <div class="bodyTopFormGroup" style="margin-top: 10px;">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+        <el-button v-waves type="warning" icon="el-icon-edit" @click="batchUpdate">鎵归噺淇敼宸ヤ环</el-button>
+      </div>
+
+      <div class="bodyTopFormGroup">
         <el-form
           ref="form"
           :model="form"
@@ -39,7 +43,22 @@
             <el-form-item v-show="isExpandForm" label="浜у搧瑙勬牸" style=" display: flex;">
               <el-input v-model="form.partspec" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
-
+            <el-form-item v-show="isExpandForm" label="宸ュ簭鍚嶇О" style=" display: flex;">
+              <el-select
+                v-model="form.stepcode"
+                filterable
+                :popper-append-to-body="false"
+                style="width: 200px"
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in stepCodeArr"
+                  :key="item.stepcode"
+                  :label="item.stepname"
+                  :value="item.stepcode"
+                />
+              </el-select>
+            </el-form-item>
             <el-form-item v-show="isExpandForm" label="鎶ュ伐浜哄憳" style=" display: flex;">
               <el-input v-model="form.reportuser" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
@@ -191,6 +210,13 @@
               {{ row.steptype === 'Z' ? '鑷埗' : '澶栧崗' }}
             </template>
           </el-table-column>
+          <el-table-column
+            prop="step_price"
+            label="宸ュ簭宸ヤ环"
+            show-overflow-tooltip
+            sortable="custom"
+            min-width="110"
+          />
           <el-table-column
             prop="wx_name"
             label="渚涘簲鍟�"
@@ -464,6 +490,48 @@
       </span>
     </el-dialog>
 
+    <el-dialog
+      v-el-drag-dialog
+      title="鎵归噺宸ヤ环璋冩暣"
+      :visible.sync="batchUpdateDialogVisible"
+      width="1080px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="batchUpdateHandleClose"
+      @close="batchUpdateHandleClose"
+    >
+      <div style="display: flex;align-items: center">
+        <div>
+          淇敼涓猴細
+        </div>
+        <el-input-number
+          v-model="stepPriceEdit"
+          size="medium"
+          :precision="2"
+          :step="0.1"
+          :max="10"
+          :min="0"
+          style="margin: 0 10px 5px"
+        />
+        <div>
+          鍏� / 浠�
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="batchUpdateDialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button
+            v-waves
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="batchUpdateDialogVisibleConfirm"
+          >纭� 瀹�</el-button>
+        </div>
+      </span>
+
+    </el-dialog>
+
   </div>
 </template>
 
@@ -472,8 +540,12 @@
 import { handleDatetime } from '@/utils/global'
 import elDragDialog from '@/directive/el-drag-dialog'
 import waves from '@/directive/waves'
-import { DefectPermissions, PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
-import { MesOrderStepModelSearch, MesOrderStepUpdateSeave, MesOrderStepVerifySearch } from '@/api/WorkOrder'
+import { DefectPermissions, PrentOrganizationNoCompany, StepData } from '@/api/GeneralBasicData'
+import {
+  MesOrderStepModelSearch, MesOrderStepPriceBatchUpdateSeave,
+  MesOrderStepUpdateSeave,
+  MesOrderStepVerifySearch
+} from '@/api/WorkOrder'
 
 export default {
   name: 'ReportCorrect',
@@ -495,7 +567,7 @@
         partspec: '', // 浜у搧瑙勬牸
         reportuser: '', // 鎶ュ伐浜哄憳
         reportdate: '', // 鎶ュ伐鏃堕棿
-
+        stepcode: '',
         prop: 'report_date', // 鎺掑簭瀛楁
         order: 'desc', // 鎺掑簭瀛楁
         page: 1, // 绗嚑椤�
@@ -541,7 +613,10 @@
         report_qty: [
           { required: true, message: '璇疯緭鍏ュ悎鏍兼暟閲�', trigger: ['blur', 'change'] }
         ]
-      }
+      },
+      stepCodeArr: [], // 涓嬫媺宸ュ簭闆嗗悎
+      batchUpdateDialogVisible: false,
+      stepPriceEdit: 0
 
     }
   },
@@ -552,6 +627,7 @@
     this.getMesOrderStepVerifySearch()
     this.getDefectPermissions()
     this.getPrentOrganizationNoCompany()
+    this.getStepData()
   },
   created() {
   },
@@ -562,8 +638,60 @@
     this.getMesOrderStepVerifySearch()
     this.getDefectPermissions()
     this.getPrentOrganizationNoCompany()
+    this.getStepData()
   },
   methods: {
+    // 鎵归噺淇敼宸ュ簭
+    batchUpdate() {
+      // this.$confirm('鏄惁纭淇敼?', '鎻愮ず', {
+      //   confirmButtonText: '纭畾',
+      //   cancelButtonText: '鍙栨秷',
+      //   type: 'warning'
+      // }).then(() => {
+      //
+      // }).catch(() => {
+      //   this.$notify.info('宸插彇娑堜慨鏀癸紒')
+      // })
+      this.batchUpdateDialogVisible = true
+    },
+    batchUpdateDialogVisibleCancel() {
+      this.batchUpdateDialogVisible = false
+    },
+    batchUpdateDialogVisibleConfirm() {
+      this.$confirm('鏄惁纭淇敼?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        const data = []
+        // "id": "string",
+        //   "price": "string",
+        //   "type": "string"
+        // data = this.tableData.map(i =>  {  id:i.id price:i.step_price, type:i.steptype})
+        this.tableData.forEach(i => {
+          data.push({
+            id: i.id, price: this.stepPriceEdit, type: i.style
+          })
+        })
+        MesOrderStepPriceBatchUpdateSeave(data).then(res => {
+          if (res.code === '200') {
+            this.batchUpdateDialogVisible = false
+            this.$message.success('淇敼鎴愬姛锛�')
+            this.getMesOrderStepVerifySearch()
+          }
+        })
+      }).catch(() => {
+        this.$notify.info('宸插彇娑堜慨鏀癸紒')
+      })
+    },
+    batchUpdateHandleClose() {
+      this.stepPriceEdit = 0
+    },
+    // 鑾峰彇宸ュ簭鍩虹璧勬枡
+    async getStepData() {
+      const { data: res } = await StepData()
+      this.stepCodeArr = res
+    },
     async getPrentOrganizationNoCompany() {
       const { data: res } = await PrentOrganizationNoCompany()
       this.wkshopcodeArr = res
@@ -585,6 +713,7 @@
         partname: this.form.partname,
         partspec: this.form.partspec,
         reportuser: this.form.reportuser,
+        stepcode: this.form.stepcode,
         reportdate: tempDate,
 
         prop: this.form.prop, // 鎺掑簭瀛楁
@@ -618,6 +747,7 @@
       this.form.partspec = ''
       this.form.reportuser = ''
       this.form.reportdate = ''
+      this.form.stepcode = ''
       this.getMesOrderStepVerifySearch()
     },
 
@@ -744,7 +874,7 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 85
-        this.tableHeight = this.mainHeight - 205
+        this.tableHeight = this.mainHeight - 255
         this.$refs.tableDataRef.doLayout()
       })
     }
@@ -789,4 +919,8 @@
   align-items: center;
 }
 
+::v-deep .el-input--medium >input{
+  height: 36px !important;
+}
+
 </style>

--
Gitblit v1.9.3