wangyi
2026-04-02 74feb99b1b4e2eb3706bbb503d07fb087ca39d4a
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>
@@ -175,7 +176,9 @@
               <el-button size="mini" @click="get_PrintReport">打印</el-button>
               <el-button size="mini" @click="get_Refresh">刷新</el-button>
               <el-button size="mini" @click="get_BarCodeDetail">条码明细</el-button>
               <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_PackStockDetail">包装容器出入库明细</el-button>
            </el-col>
         </el-row>
         <el-table
@@ -184,11 +187,11 @@
            border
            style="width:100%"
            @row-click="onRowClick"
            @selection-change="onSelectionChange"
            @selection-change="onSelectionChange"
            :loading="loading"
            ref="mainTable"
         >
            <el-table-column type="selection" width="55" />
            <el-table-column type="selection" width="55"  />
            <el-table-column v-for="(col, idx) in tableColumns" :key="idx" :prop="col.field" :label="col.title" :width="col.width" :formatter="col.formatter">
               <template v-if="col.field === '单据号'" #default="scope">
                  <span style="color: blue; cursor: pointer;" @click="onBillNoClick(scope.row)">{{ scope.row.单据号 }}</span>
@@ -210,6 +213,8 @@
         :visible.sync="barcodeDetailVisible"
         ref="barcodeDetail"
         />
            <!-- 包装容器出入库明细 -->
      <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail"/>
   </div>
</template>
@@ -218,21 +223,23 @@
//import FbStepFoldinBillEdit from './fbStepFoldinBillEdit'
import FbStepFoldinBillEdit from '@/views/FbStepFoldinBillList/fbStepFoldinBillListEdit'
import BarCodeDetail from '@/views/component/BarCodeDetail'
import PackStockDetail from '@/views/component/PackStockDetail'
export default {
   name: 'FbStepFoldinBillList',
      components: {
         FbStepFoldinBillEdit,
         BarCodeDetail
         BarCodeDetail,
         PackStockDetail
      },
   data() {
      return {
         rowForm: {},
         editDialogVisible:false,
         operationType:'1',
         currentId : '',
            barcodeDetailVisible: false,// 条码明细弹窗显示控制
         packStockDetailShow:false,                            //包装容器出入库明细容器显示标记
         query: {
            HInitTimeCycle: 29,
            HBeginDate: '',
@@ -293,7 +300,7 @@
         this.set_InitGrid();
         this.ColFilter();
         this.get_DefaultModule();
      },
      },
      setSelect_HInitTimeCycle() {
         this.query.HInitTimeCycle = 29;
      },
@@ -430,7 +437,7 @@
            const userName = sessionStorage['HUserName'] || sessionStorage['Czybm'] || 'admin';
            const orgName = sessionStorage['OrganizationName'] || sessionStorage['Organization'] || '浙江智云迈思';
            const url = `${this.baseURL}/Kf_StepFoldinBill/GetStepFoldinBillList`;
            const url = `${this.$baseUrl}/Kf_StepFoldinBill/GetStepFoldinBillList`;
            const params = { 
               sWhere: sWhere || '', 
               user: userName, 
@@ -497,7 +504,7 @@
      },
      async get_DefaultModule() {
         try {
            const url = `${this.baseURL}/Xt_FastICScheme/Chooselist`;
            const url = `${this.$baseUrl}/Xt_FastICScheme/Chooselist`;
            const params = { 
               user: sessionStorage['Czybm'] || sessionStorage['HUserName'] || '', 
               HModuleName: '分步式调入单维护', 
@@ -542,7 +549,7 @@
         
         try {
            await this.$confirm('确认要删除吗,删除后不能恢复', '删除确认');
            const url = `${this.baseURL}/Fb_StepFoldInBill/DeltetFb_StepFoldInBill`;
            const url = `${this.$baseUrl}/Fb_StepFoldInBill/DeltetFb_StepFoldInBill`;
            const params = { HInterID: (row.hmainid || row.HInterID) };
            const resp = await axios.get(url, { params });
            
@@ -571,7 +578,7 @@
         try {
            await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
            
            const url = `${this.baseURL}/Kf_StepFoldInBill/AuditKf_StepFoldInBill`;
            const url = `${this.$baseUrl}/Kf_StepFoldInBill/AuditKf_StepFoldInBill`;
            const params = { 
               HInterID: (row.hmainid || row.HInterID), 
               Type: type, 
@@ -604,7 +611,7 @@
         try {
            await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
            
            const url = `${this.baseURL}/Kf_StepFoldInBill/CloseKf_StepFoldInBill`;
            const url = `${this.$baseUrl}/Kf_StepFoldInBill/CloseKf_StepFoldInBill`;
            const params = { 
               HInterID: (row.hmainid || row.HInterID), 
               Type: type, 
@@ -637,7 +644,7 @@
         try {
            await this.$confirm(`确认要${actionName}此单据吗?`, `${actionName}确认`);
            
            const url = `${this.baseURL}/Kf_StepFoldInBill/CancellKf_StepFoldInBill`;
            const url = `${this.$baseUrl}/Kf_StepFoldInBill/CancellKf_StepFoldInBill`;
            const params = { 
               HInterID: (row.hmainid || row.HInterID), 
               Type: type, 
@@ -657,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;
@@ -666,6 +718,11 @@
      },
      onSelectionChange(selection) {
         this.selectedRows = selection;
         this.ids = selection.map(item => item.hmainid)
         console.log('选择的行:', selection,"选择的ids:",this.ids);
         if (selection.length > 0)
         this.rowForm = selection[0]
      },
      onBillNoClick(row) {
         const table = this.$refs.mainTable;
@@ -708,6 +765,18 @@
         const hmainid = this.selectedRows.map(r => (r.hmainid * (10 ** 8)) + (r.hsubid || 0)).toString();
         window.open('../../BaseSet/SRM_OpenTmpList.html?linterid=' + hmainid + '&MyMsg=' + hmainid + '&Type=HSeOutStockBillList', '_blank');
      },
       //#region 包装容器出入库明细
          get_PackStockDetail() {
      // if (this.selectedRow.length !== 1) {
      //   this.$message.warning('请选择一行数据查看条码明细!')
      //   return
      // }
         this.packStockDetailShow = true
         this.$nextTick(() => {
            this.$refs.packStockDetail.open(this.rowForm)
         })
      },
    //#endregion
      get_Refresh() {
         this.onReset();
      },