| | |
| | | @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 |
| | |
| | | v-loading="loading" |
| | | @sort-change="handleSortChange"> |
| | | <el-table-column prop="itemName" 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="memo" label="备注" min-width="120" align="center"></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"> |
| | |
| | | <div v-if="currentRow"> |
| | | <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="状态">{{ formatStatus(currentRow)}}</el-descriptions-item> |
| | | <el-descriptions-item label="创建时间">{{ formatDate(currentRow.createTime) }}</el-descriptions-item> |
| | |
| | | <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> |
| | | <!-- 可根据实际需求添加更多子表列 --> |
| | | <!-- 新增操作列 --> |
| | | <el-table-column label="操作" width="120" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation-cell"> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | @click="handleModify(scope.row)"> |
| | | 添加至上报项 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- 子表分页 --> |
| | |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/order/pakout/order/cargo/grouping/auth/v1", |
| | | // url: baseUrl + "/order/head/page/auth", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | |
| | | // 模拟API调用 - 根据实际业务调整API地址 |
| | | $.ajax({ |
| | | url: baseUrl + "/order/pakout/orderDetl/cargo/grouping/auth", |
| | | // url: baseUrl + "/orderDetl/list/auth", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | |
| | | that.detailLoading = false; |
| | | // 实际项目中应使用真实API,这里使用模拟数据 |
| | | that.mockTableBData(itemName); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 新增:处理修改按钮点击事件 |
| | | handleModify(row) { |
| | | if (!this.currentRow) { |
| | | this.$message.error('没有选择主表数据'); |
| | | return; |
| | | } |
| | | |
| | | const groupOrderNo = this.currentRow.itemName; // 组货单号 |
| | | const batch = row.batch; // 箱号 |
| | | |
| | | 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); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消修改' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 新增:提交修改到后台 |
| | | submitModify(groupOrderNo, batch) { |
| | | // 显示加载状态 |
| | | const loadingInstance = this.$loading({ |
| | | lock: true, |
| | | text: '提交修改中...', |
| | | spinner: 'el-icon-loading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }); |
| | | |
| | | // 调用后台API提交修改 |
| | | $.ajax({ |
| | | url: baseUrl + "/api/modify/detail", // 请根据实际API地址修改 |
| | | headers: { |
| | | 'token': localStorage.getItem('token'), |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | data: JSON.stringify({ |
| | | item_name: groupOrderNo, // 组货单号 |
| | | batch: batch // 箱号 |
| | | }), |
| | | dataType: 'json', |
| | | 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('修改失败,请检查网络连接'); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | // 模拟子表数据 - 实际项目中应删除 |
| | | mockTableBData(itemName) { |
| | | this.tableDataB = [ |
| | | { productName: `产品A-${itemName}`, quantity: 2, price: 500.00, totalPrice: 1000.00 }, |
| | | { productName: `产品B-${itemName}`, quantity: 1, price: 300.50, totalPrice: 300.50 } |
| | | { |
| | | matnr: '6μm×436mm', |
| | | batch: 'L241034114', |
| | | model: '24092501D01A6', |
| | | origin: '1', |
| | | danger: '1', |
| | | memo: '', |
| | | status: 1 |
| | | } |
| | | ]; |
| | | this.detailTotal = 2; |
| | | this.detailTotal = 1; |
| | | this.detailLoading = false; |
| | | } |
| | | } |