自动化立体仓库 - WMS系统
*
lsh
4 天以前 2ce9436d64aaee5d9743e34f89e64f2207cc8583
src/main/webapp/views/orderCargoGrouping/orderCargoGroupingOperate.html
@@ -104,7 +104,7 @@
         <div class="search-item">
            <span class="search-label">组货单号:</span>
            <el-input
                  v-model="searchForm.uuid"
                  v-model="searchForm.itemName"
                  placeholder="请输入组货单号"
                  clearable
                  style="width: 150px;"
@@ -121,16 +121,6 @@
                  @keyup.enter.native="handleSearch"
            ></el-input>
         </div>
<!--         <div class="search-item">-->
<!--            <span class="search-label">订单编号:</span>-->
<!--            <el-input-->
<!--                  v-model="searchForm.orderNo"-->
<!--                  placeholder="请输入订单编号"-->
<!--                  clearable-->
<!--                  style="width: 150px;"-->
<!--                  @keyup.enter.native="handleSearch"-->
<!--            ></el-input>-->
<!--         </div>-->
         <div class="search-item">
            <span class="search-label">状态:</span>
            <el-select
@@ -140,19 +130,15 @@
                  style="width: 150px;"
            >
               <el-option label="全部" value=""></el-option>
               <el-option label="待处理" value="1"></el-option>
               <el-option label="作业中" value="2"></el-option>
               <el-option label="已取消" value="3"></el-option>
               <el-option label="已完成" value="4"></el-option>
               <el-option label="准备取消" value="5"></el-option>
               <el-option label="已完成" value="6"></el-option>
               <el-option label="上报完成" value="7"></el-option>
               <el-option label="待判查询中" value="9"></el-option>
               <el-option label="就绪" value="10"></el-option>
               <el-option label="生成实际组货单中。请等待..." value="11"></el-option>
               <el-option label="生成实际组货单成功" value="12"></el-option>
               <el-option label="生成实际组货单失败" value="13"></el-option>
               <el-option label="异常" value="99"></el-option>
               <el-option label="待处理" value="10"></el-option>
               <el-option label="检验中" value="11"></el-option>
               <el-option label="出库中" value="12"></el-option>
               <el-option label="存在不合格" value="13"></el-option>
               <el-option label="待上报" value="15"></el-option>
               <el-option label="上报完成" value="16"></el-option>
               <el-option label="上报失败" value="17"></el-option>
               <el-option label="异常" value="98"></el-option>
               <el-option label="废弃" value="99"></el-option>
            </el-select>
         </div>
         <div class="search-actions">
@@ -172,12 +158,9 @@
            style="width: 100%"
            v-loading="loading"
            @sort-change="handleSortChange">
         <el-table-column prop="uuid" label="组货单号" width="120" align="center" sortable="custom"></el-table-column>
         <el-table-column prop="orderNo" label="订单编号" min-width="140" align="center"></el-table-column>
         <el-table-column prop="itemName" label="组货单号" width="120" align="center" sortable="custom"></el-table-column>
         <el-table-column prop="cstmrName" label="客户名称" min-width="120" align="center"></el-table-column>
         <el-table-column prop="settle" label="状态" min-width="100" align="center" :formatter="formatStatus"></el-table-column>
<!--         <el-table-column prop="totalFee" label="合计金额" min-width="100" align="center" :formatter="formatCurrency"></el-table-column>-->
<!--         <el-table-column prop="createTime" label="创建时间" min-width="140" align="center" sortable="custom"></el-table-column>-->
         <el-table-column label="操作" width="150" align="center" fixed="right">
            <template slot-scope="scope">
               <div class="operation-cell">
@@ -214,12 +197,10 @@
         class="detail-dialog"
         @close="closeDetailDialog">
      <div v-if="currentRow">
         <h3>组货单主表 (组货单号: {{ currentRow.uuid }})</h3>
         <h3>组货单主表 (组货单号: {{ currentRow.itemName }})</h3>
         <el-descriptions :column="2" border>
            <el-descriptions-item label="订单编号">{{ currentRow.orderNo }}</el-descriptions-item>
            <el-descriptions-item label="客户名称">{{ currentRow.cstmrName }}</el-descriptions-item>
            <el-descriptions-item label="状态">{{ currentRow.settle$ }}</el-descriptions-item>
            <el-descriptions-item label="合计金额">{{ formatCurrency(currentRow) }}</el-descriptions-item>
            <el-descriptions-item label="状态">{{ formatStatus(currentRow)}}</el-descriptions-item>
            <el-descriptions-item label="创建时间">{{ formatDate(currentRow.createTime) }}</el-descriptions-item>
            <el-descriptions-item label="备注">{{ currentRow.memo || '无' }}</el-descriptions-item>
         </el-descriptions>
@@ -233,11 +214,29 @@
            <el-table-column prop="matnr" label="规格" min-width="120" align="center"></el-table-column>
            <el-table-column prop="batch" label="箱号" min-width="80" align="center"></el-table-column>
            <el-table-column prop="model" label="卷号" min-width="100" align="center" ></el-table-column>
<!--            <el-table-column prop="totalPrice" label="金额" min-width="100" align="center" :formatter="formatCurrency"></el-table-column>-->
            <el-table-column prop="origin" label="位置" min-width="100" align="center"></el-table-column>
            <el-table-column prop="danger" label="待判" min-width="100" align="center"></el-table-column>
            <el-table-column prop="memo" label="备注" min-width="100" align="center"></el-table-column>
            <!-- 可根据实际需求添加更多子表列 -->
            <el-table-column prop="status" label="状态" min-width="100" align="center" :formatter="formatStatusB"></el-table-column>
            <!-- 新增操作列,根据status值控制显示 -->
            <el-table-column label="是否上报" width="120" align="center" fixed="right">
               <template slot-scope="scope">
                  <div class="operation-cell">
                     <el-button v-if="scope.row.status === 2"
                              type="primary"
                              size="mini"
                              @click="handleModifyN(scope.row)">
                        否
                     </el-button>
                     <el-button v-if="scope.row.status === 1"
                              type="primary"
                              size="mini"
                              @click="handleModifyY(scope.row)">
                        是
                     </el-button>
                  </div>
               </template>
            </el-table-column>
         </el-table>
         <!-- 子表分页 -->
@@ -272,7 +271,7 @@
      data: {
         // 搜索表单
         searchForm: {
            uuid: '',
            item_name: '',
            cstmr_name: '',
            settle: '',
            order_no: ''
@@ -335,10 +334,10 @@
               if (that.searchForm[key] !== '') {
                  if (key === 'orderNo'){
                     params['order_no'] = that.searchForm[key];
                  } else if (key === 'itemName'){
                     params['item_name'] = that.searchForm[key];
                  } else if (key === 'cstmrName'){
                     params['cstmr_name'] = that.searchForm[key];
                  } else if (key === 'settle$'){
                     params['settle'] = that.searchForm[key];
                  } else {
                     params[key] = that.searchForm[key];
                  }
@@ -346,8 +345,7 @@
            });
            $.ajax({
               // url: baseUrl + "/order/pakout/order/cargo/grouping/auth/v1",
               url: baseUrl + "/order/head/page/auth",
               url: baseUrl + "/order/pakout/order/cargo/grouping/auth/v1",
               headers: {
                  'token': localStorage.getItem('token')
               },
@@ -376,21 +374,20 @@
         },
         // 获取子表B数据(根据实际业务调整)
         getTableDataB(orderNo) {
         getTableDataB(itemName) {
            let that = this;
            that.detailLoading = true;
            // 构建请求参数
            let params = {
               order_no: orderNo,
               item_name: itemName,
               curr: that.detailCurrentPage,
               limit: that.detailPageSize
            };
            // 模拟API调用 - 根据实际业务调整API地址
            $.ajax({
               // url: baseUrl + "/order/pakout/orderDetl/cargo/grouping/auth",
               url: baseUrl + "/orderDetl/list/auth",
               url: baseUrl + "/order/pakout/orderDetl/cargo/grouping/auth",
               headers: {
                  'token': localStorage.getItem('token')
               },
@@ -412,7 +409,111 @@
               error: function() {
                  that.detailLoading = false;
                  // 实际项目中应使用真实API,这里使用模拟数据
                  that.mockTableBData(uuid);
                  that.mockTableBData(itemName);
               }
            });
         },
         // 处理修改按钮点击事件
         handleModifyY(row) {
            if (!this.currentRow) {
               this.$message.error('没有选择主表数据');
               return;
            }
            const groupOrderNo = this.currentRow.itemName; // 组货单号
            const batch = row.batch; // 箱号
            const status = 2; // 箱号
            this.$confirm(
                  `确定将组货单号: <strong style="color: #409EFF;">${groupOrderNo}</strong> 、箱号: <strong style="color: #409EFF;">${batch}</strong> 添加到上报列吗?`,
                  '确认修改',
                  {
                     confirmButtonText: '确认修改',
                     cancelButtonText: '取消',
                     type: 'warning',
                     dangerouslyUseHTMLString: true
                  }
            ).then(() => {
               this.submitModify(groupOrderNo, batch, status);
            }).catch(() => {
               this.$message({
                  type: 'info',
                  message: '已取消修改'
               });
            });
         },
         // 处理修改按钮点击事件
         handleModifyN(row) {
            if (!this.currentRow) {
               this.$message.error('没有选择主表数据');
               return;
            }
            const groupOrderNo = this.currentRow.itemName; // 组货单号
            const batch = row.batch; // 箱号
            const status = 1; // 箱号
            this.$confirm(
                  `确定将组货单号: <strong style="color: #409EFF;">${groupOrderNo}</strong> 、箱号: <strong style="color: #409EFF;">${batch}</strong> 添加到上报列吗?`,
                  '确认修改',
                  {
                     confirmButtonText: '确认修改',
                     cancelButtonText: '取消',
                     type: 'warning',
                     dangerouslyUseHTMLString: true
                  }
            ).then(() => {
               this.submitModify(groupOrderNo, batch, status);
            }).catch(() => {
               this.$message({
                  type: 'info',
                  message: '已取消修改'
               });
            });
         },
         // 提交修改到后台
         submitModify(groupOrderNo, batch, status) {
            // 显示加载状态
            const loadingInstance = this.$loading({
               lock: true,
               text: '提交修改中...',
               spinner: 'el-icon-loading',
               background: 'rgba(0, 0, 0, 0.7)'
            });
            // 调用后台API提交修改
            $.ajax({
               url: baseUrl + "/order/pakout/orderDetl/batch/report/auth",
               headers: {'token': localStorage.getItem('token')},
               data: top.reObject({
                  item_name: groupOrderNo, // 组货单号
                  batch: batch, // 箱号
                  status: status // 箱号
               }),
               method: 'POST',
               success: (res) => {
                  loadingInstance.close();
                  if (res.code === 200 || res.success) {
                     this.$message({
                        message: `修改成功!组货单号: ${groupOrderNo}, 箱号: ${batch}`,
                        type: 'success',
                        duration: 3000
                     });
                     // 修改成功后可以刷新子表数据
                     this.getTableDataB(groupOrderNo);
                  } else {
                     this.$message.error(res.message || '修改失败');
                  }
               },
               error: (error) => {
                  loadingInstance.close();
                  console.error('修改失败:', error);
                  this.$message.error('修改失败,请检查网络连接');
               }
            });
         },
@@ -437,7 +538,7 @@
               return;
            }
            const groupOrderNo = this.currentRow.uuid;
            const groupOrderNo = this.currentRow.itemName;
            this.$confirm(
                  `是否确认开始上报组货单号 <strong style="color: #F56C6C; font-size: 16px;">${groupOrderNo}</strong>?<br/><br/>将生成实际组货单,单一组货单号只能操作一次!!!`,
@@ -479,7 +580,7 @@
                  'token': localStorage.getItem('token')
               },
               data: JSON.stringify({
                  uuid: groupOrderNo // 传递组货单号
                  item_name: groupOrderNo // 传递组货单号
               }),
               dataType: 'json',
               contentType: 'application/json;charset=UTF-8',
@@ -527,7 +628,7 @@
         // 重置搜索条件
         handleReset() {
            this.searchForm = {
               uuid: '',
               item_name: '',
               cstmr_name: '',
               settle: '',
               order_no: ''
@@ -543,7 +644,7 @@
            this.currentRow = row;
            this.detailDialogVisible = true;
            this.detailCurrentPage = 1;
            this.getTableDataB(row.orderNo);
            this.getTableDataB(row.itemName);
         },
         // 关闭详情弹窗
@@ -572,7 +673,7 @@
            this.detailPageSize = val;
            this.detailCurrentPage = 1;
            if (this.currentRow) {
               this.getTableDataB(this.currentRow.orderNo);
               this.getTableDataB(this.currentRow.itemName);
            }
         },
@@ -580,24 +681,47 @@
         handleDetailCurrentChange(val) {
            this.detailCurrentPage = val;
            if (this.currentRow) {
               this.getTableDataB(this.currentRow.orderNo);
               this.getTableDataB(this.currentRow.itemName);
            }
         },
         // 格式化状态显示
         formatStatus(row) {
            if (row.settle === 1) {
               return '正常';
            } else if (row.settle === 0) {
               return '禁用';
            } else if (row.settle === 0) {
               return '禁用';
            } else if (row.settle === 0) {
               return '禁用';
            } else if (row.settle === 0) {
               return '禁用';
            if (row.settle === 10) {
               return '待处理';
            } else if (row.settle === 11) {
               return '检验中';
            } else if (row.settle === 12) {
               return '出库中';
            } else if (row.settle === 13) {
               return '存在不合格';
            } else if (row.settle === 15) {
               return '待上报';
            } else if (row.settle === 16) {
               return '上报完成';
            } else if (row.settle === 17) {
               return '上报失败';
            } else if (row.settle === 98) {
               return '异常';
            } else if (row.settle === 99) {
               return '废弃';
            } else {
               return row.settle || '未知';
            }
         },
         // 格式化状态显示
         formatStatusB(row) {
            if (row.status === 0) {
               return '异常';
            } else if (row.status === 1) {
               return '不上报';
            } else if (row.status === 2) {
               return '待上报';
            } else if (row.status === 3) {
               return '已上报';
            } else {
               return row.status || '未知';
            }
         },
@@ -620,35 +744,33 @@
         mockTableAData() {
            this.tableDataA = [
               {
                  uuid: 'ZH1001',
                  itemName: 'zh20251110',
                  orderNo: 'ORDER2024001',
                  cstmrName: '示例客户A',
                  settle: 1,
                  cstmrName: 'zh20251110',
                  settle: 10,
                  totalFee: 1500.00,
                  createTime: '2024-01-15 10:30:00',
                  memo: '测试数据'
               },
               {
                  uuid: 'ZH1002',
                  orderNo: 'ORDER2024002',
                  cstmrName: '示例客户B',
                  settle: 1,
                  totalFee: 2300.50,
                  createTime: '2024-01-16 14:20:00',
                  createTime: '2025-11-10T09:50:16.343+0000',
                  memo: '测试数据'
               }
            ];
            this.total = 2;
            this.total = 1;
            this.loading = false;
         },
         // 模拟子表数据 - 实际项目中应删除
         mockTableBData(uuid) {
         mockTableBData(itemName) {
            this.tableDataB = [
               { productName: `产品A-${uuid}`, quantity: 2, price: 500.00, totalPrice: 1000.00 },
               { productName: `产品B-${uuid}`, quantity: 1, price: 300.50, totalPrice: 300.50 }
               {
                  matnr: '6μm×436mm',
                  batch: 'L241034114',
                  model: '24092501D01A6',
                  origin: '1',
                  danger: '1',
                  memo: '',
                  status: 1 // 状态为1,会显示修改按钮
               }
            ];
            this.detailTotal = 2;
            this.detailTotal = 1;
            this.detailLoading = false;
         }
      }