chenhaozhe
6 天以前 723793a0aa8d69cbbb463830a3344dbd6655cee5
src/views/FbStepFoldinBillList/fbStepFoldinBillList.vue
@@ -163,6 +163,7 @@
         <el-row style="margin-bottom:8px">
            <el-col>
               <el-button size="mini" type="primary" @click="handleAdd">新增</el-button>
               <el-button size="mini" @click="set_PalletChange">托数变更</el-button>
               <el-button size="mini" @click="handleEdit">编辑</el-button>
               <el-button size="mini" type="danger" @click="set_DeleteBill">删除</el-button>
               <el-button size="mini" @click="set_CheckBill(1)">审核</el-button>
@@ -663,6 +664,51 @@
            }
         }
      },
      set_PalletChange() {
      if (!this.rowForm || !this.rowForm.hmainid) {
         this.$modal.msgError('请先选择一条记录!')
         return
      }
      const rowData = this.rowForm // 使用 rowForm 而不是 rowList
      const currentPallet = rowData.托数 || 0
      // 将"请输入新托数"作为输入框的placeholder
      this.$prompt(`当前托数:${currentPallet}`, {
         confirmButtonText: '保存',
         cancelButtonText: '取消',
         inputValue: currentPallet,
         inputType: 'number',
         inputValidator: (value) => {
         if (!value) return '请输入托数!'
         const num = parseInt(value)
         if (isNaN(num)) return '请输入有效的数字!'
         if (num.toString() !== value) return '托数不能为小数!'
         if (num < 0) return '托数必须大于0!'
         return true
         }
      }).then(({ value }) => {
         const newPallet = parseInt(value)
         return axios.post(this.$baseUrl + '/Kf_POStockInBill/UpdatePallet', {
         hmainid: rowData.hmainid,
         newPallet: newPallet,
         operator: sessionStorage["HUserName"]
         })
      }).then(response => {
         if (response.data && response.data.count == 1) {
         this.$modal.msgSuccess('托数变更成功!')
         this.onSearch()
         this.rowForm = null
         } else {
         this.$modal.msgError('错误:' + (response.data.Message || '保存失败'))
         }
      }).catch(error => {
         if (error !== 'cancel') {
         this.$modal.msgError('操作失败:' + error.message)
         }
      })
      },
      onRowClick(row) {
         this.$nextTick(() => {
            const table = this.$refs.mainTable;