| | |
| | | style="width: 100%" |
| | | 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="itemName" label="组货单号" width="240" 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="orderCount" label="组货单数" width="80" 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="createTime" label="日期" min-width="100" align="center" :formatter="formatDateColumn"></el-table-column> |
| | | <el-table-column prop="updateTime" label="更新日期" min-width="100" align="center" :formatter="formatDateColumn"></el-table-column> |
| | | <el-table-column label="操作" width="150" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation-cell"> |
| | |
| | | const status = 2; // 箱号 |
| | | |
| | | this.$confirm( |
| | | `确定将组货单号: <strong style="color: #409EFF;">${groupOrderNo}</strong> 、箱号: <strong style="color: #409EFF;">${batch}</strong> 添加到上报列吗?`, |
| | | `确定将组货单号: <strong style="color: #409EFF;">${groupOrderNo}</strong> 中的箱号: <strong style="color: #409EFF;">${batch}</strong> 添加到上报列吗?`, |
| | | '确认修改', |
| | | { |
| | | confirmButtonText: '确认修改', |
| | |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }); |
| | | |
| | | // 调用后台API提交修改 |
| | | $.ajax({ |
| | | url: baseUrl + "/order/pakout/orderDetl/batch/report/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | duration: 3000 |
| | | }); |
| | | |
| | | // 修改成功后可以刷新子表数据 |
| | | this.getTableDataB(groupOrderNo); |
| | | } else { |
| | | this.$message.error(res.message || '修改失败'); |
| | |
| | | this.getTableDataA(); |
| | | }, |
| | | |
| | | // 显示二次确认对话框 |
| | | showConfirmDialog() { |
| | | if (!this.currentRow) { |
| | | this.$message.error('没有选择要上报的数据'); |
| | |
| | | return '¥0.00'; |
| | | }, |
| | | |
| | | // 格式化日期显示 |
| | | formatDate(dateStr) { |
| | | if (!dateStr) return ''; |
| | | // 简单的日期格式化,可以根据实际格式调整 |
| | | return dateStr; |
| | | }, |
| | | |
| | | // 模拟主表数据 - 实际项目中应删除 |
| | | mockTableAData() { |
| | | this.tableDataA = [ |
| | |
| | | ]; |
| | | this.detailTotal = 1; |
| | | this.detailLoading = false; |
| | | }, |
| | | |
| | | // 为表格列添加格式化方法 |
| | | formatDateColumn(row, column, cellValue) { |
| | | return this.formatDate(cellValue); |
| | | }, |
| | | |
| | | |
| | | |
| | | // // 格式化日期显示 |
| | | // formatDate(dateStr) { |
| | | // if (!dateStr) return ''; |
| | | // // 简单的日期格式化,可以根据实际格式调整 |
| | | // return dateStr; |
| | | // }, |
| | | |
| | | // 在Vue实例的methods中添加或修改formatDate方法 |
| | | formatDate(dateStr) { |
| | | if (!dateStr) return ''; |
| | | |
| | | try { |
| | | // 创建Date对象 |
| | | const date = new Date(dateStr); |
| | | |
| | | // 检查日期是否有效 |
| | | if (isNaN(date.getTime())) { |
| | | return dateStr; // 如果解析失败,返回原字符串 |
| | | } |
| | | |
| | | // 获取各个时间组件 |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| | | |
| | | // 返回格式化后的字符串:YYYY-MM-DD HH:mm:ss |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } catch (error) { |
| | | console.error('日期格式化错误:', error); |
| | | return dateStr; // 如果出错,返回原字符串 |
| | | } |
| | | }, |
| | | |
| | | //本地时区的时间 |
| | | formatDate2(dateStr) { |
| | | if (!dateStr) return ''; |
| | | |
| | | try { |
| | | const date = new Date(dateStr); |
| | | |
| | | if (isNaN(date.getTime())) { |
| | | return dateStr; |
| | | } |
| | | |
| | | // 使用本地时区 |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getDate()).padStart(2, '0'); |
| | | const hours = String(date.getHours()).padStart(2, '0'); |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| | | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } catch (error) { |
| | | console.error('日期格式化错误:', error); |
| | | return dateStr; |
| | | } |
| | | }, |
| | | //保持UTC时间但转换为更易读的格式 |
| | | formatDate3(dateStr) { |
| | | if (!dateStr) return ''; |
| | | |
| | | try { |
| | | // 直接解析字符串,不转换时区 |
| | | const date = new Date(dateStr); |
| | | |
| | | if (isNaN(date.getTime())) { |
| | | return dateStr; |
| | | } |
| | | |
| | | // 使用UTC时间组件 |
| | | const year = date.getUTCFullYear(); |
| | | const month = String(date.getUTCMonth() + 1).padStart(2, '0'); |
| | | const day = String(date.getUTCDate()).padStart(2, '0'); |
| | | const hours = String(date.getUTCHours()).padStart(2, '0'); |
| | | const minutes = String(date.getUTCMinutes()).padStart(2, '0'); |
| | | const seconds = String(date.getUTCSeconds()).padStart(2, '0'); |
| | | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } catch (error) { |
| | | console.error('日期格式化错误:', error); |
| | | return dateStr; |
| | | } |
| | | } |
| | | } |
| | | }); |