Browse Source
feat(inspection): 新增检验排程视图和待检验列表功能
feat(inspection): 新增检验排程视图和待检验列表功能
- 添加 com_inspectionScheduleView.vue 组件实现检验排程可视化界面 - 添加 inspectionPendingList.vue 页面实现待检验申请单列表查询功能 - 修改 com_inspectionRequestDetail.vue 中 formatDate 方法空值返回空字符串 - 在 inspectionRequestHeader.js 中新增排程相关API接口定义 - 实现 QC 人员清单展示和排程任务卡片网格布局 - 添加排程弹窗表单支持 QC 人员选择和日期设置 - 实现待检验列表按当前登录用户和已排程状态过滤数据 - 添加表格行样式高亮显示有数量修改的验货申请master
6 changed files with 1949 additions and 3 deletions
-
9src/api/inspection/inspectionRequestHeader.js
-
2src/views/modules/inspection/com_inspectionRequestDetail.vue
-
573src/views/modules/inspection/com_inspectionScheduleView.vue
-
672src/views/modules/inspection/inspectionPendingList.vue
-
5src/views/modules/inspection/inspectionRequestList.vue
-
691src/views/modules/inspection/inspectionScheduleList.vue
@ -0,0 +1,573 @@ |
|||||
|
<template> |
||||
|
<div class="schedule-container"> |
||||
|
<!-- 左侧:QC人员清单 --> |
||||
|
<div class="left-panel"> |
||||
|
<div class="panel-title">QC人员清单</div> |
||||
|
|
||||
|
<el-table |
||||
|
:data="qcList" |
||||
|
border |
||||
|
size="mini" |
||||
|
highlight-current-row |
||||
|
@current-change="handleQcSelect" |
||||
|
@row-click="handleQcSelect" |
||||
|
style="width: 100%;" |
||||
|
class="qc-table"> |
||||
|
<el-table-column prop="qcName" label="姓名" width="80" align="center" /> |
||||
|
<el-table-column prop="region" label="负责区域" min-width="90" show-overflow-tooltip /> |
||||
|
<el-table-column label="操作" width="80" align="center" fixed="right"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link |
||||
|
type="primary" |
||||
|
style="cursor: pointer; margin-right: 5px;" |
||||
|
@click.stop="openScheduleDialog(null, scope.row)">排程</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 右侧:排程卡片 --> |
||||
|
<div class="right-panel"> |
||||
|
<div class="panel-title"> |
||||
|
<span v-if="selectedQc">{{ selectedQc.qcName }} - 排程视图(未来10天)</span> |
||||
|
<span v-else>查看排程</span> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 日期卡片网格 --> |
||||
|
<div class="schedule-grid" v-loading="loading"> |
||||
|
<div |
||||
|
v-for="day in scheduleDays" |
||||
|
:key="day.date" |
||||
|
class="schedule-card"> |
||||
|
<div class="card-header"> |
||||
|
<span class="date-label">{{ day.dateLabel }}</span> |
||||
|
<span class="date-weekday">{{ day.weekday }}</span> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div |
||||
|
v-for="task in day.tasks" |
||||
|
:key="task.requestNo" |
||||
|
class="task-item" |
||||
|
@click="handleTaskClick(task)"> |
||||
|
<div class="task-no">单号:{{ task.requestNo }}</div> |
||||
|
<div class="task-supplier" :title="task.supplierName">{{ task.supplierName }}</div> |
||||
|
<div v-if="task.inspectAddress" class="task-address" :title="task.inspectAddress"> |
||||
|
<i class="el-icon-location"></i> {{ task.inspectAddress }} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div v-if="day.tasks.length === 0" class="empty-slot"> |
||||
|
<span class="empty-text">暂无排程</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 排程弹窗 --> |
||||
|
<el-dialog |
||||
|
title="验货排程" |
||||
|
:visible.sync="scheduleDialogVisible" |
||||
|
width="500px" |
||||
|
:close-on-click-modal="false" |
||||
|
append-to-body> |
||||
|
<el-form |
||||
|
:model="scheduleForm" |
||||
|
:rules="scheduleRules" |
||||
|
ref="scheduleForm" |
||||
|
label-width="110px" |
||||
|
size="small"> |
||||
|
<el-form-item label="QC人员:" prop="qcOperator"> |
||||
|
<el-select |
||||
|
v-model="scheduleForm.qcOperator" |
||||
|
placeholder="请选择QC人员" |
||||
|
style="width: 100%;"> |
||||
|
<el-option |
||||
|
v-for="qc in qcList" |
||||
|
:key="qc.id" |
||||
|
:label="qc.qcName" |
||||
|
:value="qc.qcName"> |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="计划验货日期:" prop="planStartDate"> |
||||
|
<div style="display: flex; align-items: center; width: 100%;"> |
||||
|
<el-date-picker |
||||
|
v-model="scheduleForm.planStartDate" |
||||
|
type="date" |
||||
|
placeholder="选择开始日期" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
style="flex: 1;"> |
||||
|
</el-date-picker> |
||||
|
<span style="margin: 0 10px;">-</span> |
||||
|
<el-date-picker |
||||
|
v-model="scheduleForm.planEndDate" |
||||
|
type="date" |
||||
|
placeholder="选择结束日期" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
style="flex: 1;"> |
||||
|
</el-date-picker> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="备注:"> |
||||
|
<el-input |
||||
|
v-model="scheduleForm.remark" |
||||
|
type="textarea" |
||||
|
:rows="3" |
||||
|
placeholder="请输入备注"> |
||||
|
</el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
size="small" |
||||
|
@click="submitSchedule" |
||||
|
:loading="loading"> |
||||
|
保存 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
size="small" |
||||
|
@click="cancelSchedule"> |
||||
|
关闭 |
||||
|
</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { getQcPersonList, scheduleInspectionRequest, getScheduleView } from '@/api/inspection/inspectionRequestHeader.js' |
||||
|
|
||||
|
export default { |
||||
|
name: 'InspectionScheduleView', |
||||
|
|
||||
|
props: { |
||||
|
// 待排程的申请单号列表 |
||||
|
requestNos: { |
||||
|
type: Array, |
||||
|
default: () => [] |
||||
|
}, |
||||
|
// 当前选中的行数据 |
||||
|
currentRow: { |
||||
|
type: Object, |
||||
|
default: () => ({}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data () { |
||||
|
return { |
||||
|
qcList: [], // QC人员列表 |
||||
|
selectedQc: null, // 当前选中的QC |
||||
|
scheduleDays: [], // 排程日期数组(未来10天) |
||||
|
loading: false, // 加载状态 |
||||
|
// 排程弹窗 |
||||
|
scheduleDialogVisible: false, |
||||
|
scheduleForm: { |
||||
|
qcOperator: '', |
||||
|
planStartDate: '', |
||||
|
planEndDate: '', |
||||
|
remark: '' |
||||
|
}, |
||||
|
scheduleRules: { |
||||
|
qcOperator: [ |
||||
|
{ required: true, message: '请选择QC人员', trigger: 'change' } |
||||
|
], |
||||
|
planStartDate: [ |
||||
|
{ required: true, message: '请选择开始日期', trigger: 'change' } |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 加载QC人员列表 |
||||
|
loadQcList () { |
||||
|
const params = { |
||||
|
page: 1, |
||||
|
limit: 100 // 获取所有QC人员 |
||||
|
} |
||||
|
|
||||
|
getQcPersonList(params).then(({ data }) => { |
||||
|
if (data.code === 0 && data.page && data.page.list) { |
||||
|
// 将后端返回的数据转换为组件需要的格式 |
||||
|
this.qcList = data.page.list.map(item => ({ |
||||
|
id: item.id || item.userId, |
||||
|
qcName: item.userDisplay || item.userName, // 优先使用userDisplay,其次userName |
||||
|
userName: item.userName, |
||||
|
region: '' // 区域暂时为空 |
||||
|
})) |
||||
|
console.log('加载QC人员列表成功:', this.qcList) |
||||
|
} else { |
||||
|
this.qcList = [] |
||||
|
console.warn('加载QC人员列表失败:', data.msg) |
||||
|
} |
||||
|
}).catch((error) => { |
||||
|
console.error('加载QC人员列表错误:', error) |
||||
|
this.qcList = [] |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 选择QC人员(查看排程) |
||||
|
handleQcSelect (row) { |
||||
|
this.selectedQc = row |
||||
|
this.loadScheduleData(row) |
||||
|
}, |
||||
|
|
||||
|
// 打开排程弹窗 |
||||
|
// task: 任务数据(从排程视图点击) |
||||
|
// qc: QC人员数据(从左侧表格点击排程按钮) |
||||
|
openScheduleDialog (task, qc) { |
||||
|
let requestNos = [] |
||||
|
|
||||
|
// 如果是从左侧QC表格点击排程按钮 |
||||
|
if (qc && !task) { |
||||
|
// 优先使用父组件传入的requestNos(即当前选中行的申请单号) |
||||
|
requestNos = this.requestNos || [] |
||||
|
// 自动选中当前QC |
||||
|
this.scheduleForm.qcOperator = qc.qcName || qc.userName |
||||
|
} else if (task && task.requestNo) { |
||||
|
// 从排程视图点击任务 |
||||
|
requestNos = [task.requestNo] |
||||
|
this.scheduleForm.qcOperator = this.selectedQc ? this.selectedQc.qcName : '' |
||||
|
} else { |
||||
|
// 批量排程 |
||||
|
requestNos = this.requestNos || [] |
||||
|
this.scheduleForm.qcOperator = this.selectedQc ? this.selectedQc.qcName : '' |
||||
|
} |
||||
|
|
||||
|
if (requestNos.length === 0) { |
||||
|
this.$message.warning('请先在主表中选择需要排程的申请单') |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
this.scheduleForm.requestNos = requestNos |
||||
|
|
||||
|
// 重置表单 |
||||
|
this.scheduleForm.planStartDate = '' |
||||
|
this.scheduleForm.planEndDate = '' |
||||
|
this.scheduleForm.remark = '' |
||||
|
|
||||
|
this.scheduleDialogVisible = true |
||||
|
}, |
||||
|
|
||||
|
// 提交排程 |
||||
|
submitSchedule () { |
||||
|
this.$refs.scheduleForm.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.$confirm('确认排程?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const params = { |
||||
|
requestNos: this.scheduleForm.requestNos, |
||||
|
qcOperator: this.scheduleForm.qcOperator, |
||||
|
planStartDate: this.scheduleForm.planStartDate, |
||||
|
planEndDate: this.scheduleForm.planEndDate || this.scheduleForm.planStartDate, |
||||
|
remark: this.scheduleForm.remark |
||||
|
} |
||||
|
|
||||
|
scheduleInspectionRequest(params).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
this.$message.success('排程成功') |
||||
|
this.scheduleDialogVisible = false |
||||
|
// 刷新排程数据 |
||||
|
if (this.selectedQc) { |
||||
|
this.loadScheduleData(this.selectedQc) |
||||
|
} |
||||
|
// 通知父组件刷新列表 |
||||
|
this.$emit('schedule-success') |
||||
|
} else { |
||||
|
this.$message.error(data.msg || '排程失败') |
||||
|
} |
||||
|
}).catch((error) => { |
||||
|
console.error('排程错误:', error) |
||||
|
this.$message.error('排程失败') |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 取消排程 |
||||
|
cancelSchedule () { |
||||
|
this.scheduleDialogVisible = false |
||||
|
}, |
||||
|
|
||||
|
// 加载排程数据 |
||||
|
loadScheduleData (qc) { |
||||
|
if (!qc) return |
||||
|
|
||||
|
this.loading = true |
||||
|
|
||||
|
// 调用后端接口获取该QC未来10天的排程数据 |
||||
|
getScheduleView(qc.qcName || qc.userName).then(({ data }) => { |
||||
|
if (data.code === 0 && data.list) { |
||||
|
// 生成未来10天的日期结构 |
||||
|
const days = this.generateNextDays(10) |
||||
|
|
||||
|
// 将后端返回的数据按日期分组 |
||||
|
const tasksByDate = {} |
||||
|
data.list.forEach(task => { |
||||
|
const dateStr = this.formatDate(new Date(task.planStartDate)) |
||||
|
if (!tasksByDate[dateStr]) { |
||||
|
tasksByDate[dateStr] = [] |
||||
|
} |
||||
|
tasksByDate[dateStr].push({ |
||||
|
requestNo: task.requestNo, |
||||
|
supplierName: task.supplierName, |
||||
|
inspectAddress: task.inspectAddress, |
||||
|
planStartDate: task.planStartDate, |
||||
|
planEndDate: task.planEndDate |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
// 将任务分配到对应的日期卡片中 |
||||
|
this.scheduleDays = days.map(day => ({ |
||||
|
...day, |
||||
|
tasks: tasksByDate[day.date] || [] |
||||
|
})) |
||||
|
|
||||
|
console.log('加载排程数据成功:', this.scheduleDays) |
||||
|
} else { |
||||
|
this.$message.error(data.msg || '加载排程数据失败') |
||||
|
// 即使失败也显示空白的日期卡片 |
||||
|
this.scheduleDays = this.generateNextDays(10) |
||||
|
} |
||||
|
}).catch((error) => { |
||||
|
console.error('加载排程数据错误:', error) |
||||
|
this.$message.error('加载排程数据失败') |
||||
|
// 即使失败也显示空白的日期卡片 |
||||
|
this.scheduleDays = this.generateNextDays(10) |
||||
|
}).finally(() => { |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 生成未来N天的日期数组 |
||||
|
generateNextDays (days) { |
||||
|
const result = [] |
||||
|
const today = new Date() |
||||
|
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'] |
||||
|
|
||||
|
for (let i = 0; i < days; i++) { |
||||
|
const date = new Date(today) |
||||
|
date.setDate(today.getDate() + i) |
||||
|
|
||||
|
const dateStr = this.formatDate(date) |
||||
|
const dateLabel = `${date.getMonth() + 1}/${date.getDate()}` |
||||
|
const weekday = weekdays[date.getDay()] |
||||
|
|
||||
|
result.push({ |
||||
|
date: dateStr, |
||||
|
dateLabel: dateLabel, |
||||
|
weekday: weekday, |
||||
|
tasks: [] // TODO: 后续从后端加载该日期的任务 |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
return result |
||||
|
}, |
||||
|
|
||||
|
// 格式化日期为 yyyy-MM-dd |
||||
|
formatDate (date) { |
||||
|
const year = date.getFullYear() |
||||
|
const month = String(date.getMonth() + 1).padStart(2, '0') |
||||
|
const day = String(date.getDate()).padStart(2, '0') |
||||
|
return `${year}-${month}-${day}` |
||||
|
}, |
||||
|
|
||||
|
// 点击任务卡片 |
||||
|
handleTaskClick (task) { |
||||
|
// 点击已排程的任务,可以查看详情或修改 |
||||
|
console.log('点击任务:', task) |
||||
|
// TODO: 可以显示详情弹窗或跳转到详情页 |
||||
|
this.$emit('task-click', task) |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.schedule-container { |
||||
|
display: flex; |
||||
|
height: 100%; |
||||
|
background: #fff; |
||||
|
} |
||||
|
|
||||
|
// 左侧面板 |
||||
|
.left-panel { |
||||
|
width: 280px; |
||||
|
border-right: 1px solid #dcdfe6; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.panel-title { |
||||
|
padding: 8px 12px; |
||||
|
background: #f5f7fa; |
||||
|
color: #303133; |
||||
|
font-size: 13px; |
||||
|
font-weight: bold; |
||||
|
border-bottom: 1px solid #dcdfe6; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
|
||||
|
.qc-table { |
||||
|
flex: 1; |
||||
|
overflow: hidden; // 取消滚动 |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 右侧面板 |
||||
|
.right-panel { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.panel-title { |
||||
|
padding: 8px 12px; |
||||
|
background: #f5f7fa; |
||||
|
color: #303133; |
||||
|
font-size: 13px; |
||||
|
font-weight: bold; |
||||
|
border-bottom: 1px solid #dcdfe6; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 排程网格 - 取消滚动 |
||||
|
.schedule-grid { |
||||
|
flex: 1; |
||||
|
padding: 10px; |
||||
|
display: grid; |
||||
|
grid-template-columns: repeat(5, 1fr); |
||||
|
grid-template-rows: repeat(2, 1fr); |
||||
|
gap: 10px; |
||||
|
overflow: hidden; // 取消滚动 |
||||
|
} |
||||
|
|
||||
|
// 排程卡片 |
||||
|
.schedule-card { |
||||
|
border: 2px solid #dcdfe6; |
||||
|
border-radius: 4px; |
||||
|
background: #fff; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
min-height: 150px; |
||||
|
|
||||
|
.card-header { |
||||
|
padding: 8px 10px; |
||||
|
background: #f5f7fa; |
||||
|
border-bottom: 2px solid #dcdfe6; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
|
||||
|
.date-label { |
||||
|
font-size: 16px; |
||||
|
font-weight: bold; |
||||
|
color: #303133; |
||||
|
} |
||||
|
|
||||
|
.date-weekday { |
||||
|
font-size: 12px; |
||||
|
color: #909399; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.card-body { |
||||
|
flex: 1; |
||||
|
padding: 8px; |
||||
|
overflow-y: auto; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
gap: 6px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 任务项 |
||||
|
.task-item { |
||||
|
padding: 8px; |
||||
|
background: #f5f7fa; |
||||
|
border: 1px solid #dcdfe6; |
||||
|
border-radius: 3px; |
||||
|
cursor: pointer; |
||||
|
transition: all 0.3s; |
||||
|
|
||||
|
&:hover { |
||||
|
background: #ecf5ff; |
||||
|
border-color: #409eff; |
||||
|
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2); |
||||
|
} |
||||
|
|
||||
|
.task-no { |
||||
|
font-size: 12px; |
||||
|
font-weight: bold; |
||||
|
color: #409eff; |
||||
|
margin-bottom: 4px; |
||||
|
} |
||||
|
|
||||
|
.task-supplier { |
||||
|
font-size: 11px; |
||||
|
color: #606266; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
margin-bottom: 3px; |
||||
|
} |
||||
|
|
||||
|
.task-address { |
||||
|
font-size: 10px; |
||||
|
color: #909399; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
|
||||
|
i { |
||||
|
margin-right: 2px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 空白占位 |
||||
|
.empty-slot { |
||||
|
flex: 1; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
|
||||
|
.empty-text { |
||||
|
color: #c0c4cc; |
||||
|
font-size: 12px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 滚动条样式 |
||||
|
::-webkit-scrollbar { |
||||
|
width: 6px; |
||||
|
height: 6px; |
||||
|
} |
||||
|
|
||||
|
::-webkit-scrollbar-thumb { |
||||
|
background: #c0c4cc; |
||||
|
border-radius: 3px; |
||||
|
|
||||
|
&:hover { |
||||
|
background: #909399; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
::-webkit-scrollbar-track { |
||||
|
background: #f5f7fa; |
||||
|
} |
||||
|
|
||||
|
// 按钮样式(与 inspectionRequestList 保持一致) |
||||
|
.customer-bun-min { |
||||
|
padding: 7px 12px; |
||||
|
font-size: 12px; |
||||
|
border-radius: 3px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,672 @@ |
|||||
|
<template> |
||||
|
<div class="customer-css"> |
||||
|
<!-- 查询条件 --> |
||||
|
<el-form :inline="true" label-width="90px" class="search-form-inline"> |
||||
|
<!-- 第一行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(1100)"><a href="#">供应商编码</a></span> |
||||
|
<el-input v-model="searchData.supplierNo" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="供应商名称"> |
||||
|
<el-input v-model="searchData.supplierName" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="申请日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.requestDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.requestDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="searchData.status" disabled class="input-mini"> |
||||
|
<el-option label="已排程" value="Scheduled" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 第二行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'createBy')"><a href="#">申请人员</a></span> |
||||
|
<el-input v-model="searchData.createBy" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="QC人员"> |
||||
|
<el-input v-model="searchData.qcOperator" disabled class="input-small"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="建议验货日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.needInspectDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.needInspectDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 第三行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item label="申请单号"> |
||||
|
<el-input v-model="searchData.requestNo" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="计划验货日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.planStartDate" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.planEndDate" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 按钮 - 只有查询功能 --> |
||||
|
<div class="search-btn-row"> |
||||
|
<el-button type="primary" class="customer-bun-min" @click="getMainData">查询</el-button> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
|
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
|
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="mainDataList" |
||||
|
border |
||||
|
ref="mainTable" |
||||
|
highlight-current-row |
||||
|
@row-click="changeData" |
||||
|
v-loading="dataListLoading" |
||||
|
:row-class-name="mainTableRowClassName" |
||||
|
style="margin-top: 0px; width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnArray1" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed==''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 100px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" header-align="center" align="center" width="100" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-link style="cursor: pointer; color: #409EFF;" @click="viewDetail(scope.row)">查看</el-link> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 分页插件 --> |
||||
|
<el-pagination style="margin-top: 0px" |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper"> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 详情页签 --> |
||||
|
<el-tabs v-model="activeTab" style="margin-top: 0px; width: 99%;" @tab-click="handleTabClick" class="customer-tab" type="border-card"> |
||||
|
<!-- 基本信息 --> |
||||
|
<el-tab-pane label="基本信息" name="base"> |
||||
|
<inspection-request-detail :detail-data="currentRow" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 验货明细 --> |
||||
|
<el-tab-pane label="验货明细" name="detail"> |
||||
|
<inspection-request-detail-tab ref="inspectionDetailTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 验货关联PO明细 --> |
||||
|
<el-tab-pane label="验货关联PO明细" name="poDetail"> |
||||
|
<inspection-request-po-detail-tab ref="poDetailTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 验货结果 --> |
||||
|
<el-tab-pane label="验货结果" name="result"> |
||||
|
<inspection-result-tab ref="resultTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 附件管理 --> |
||||
|
<el-tab-pane label="附件管理" name="attachment"> |
||||
|
<inspection-request-attachment-tab ref="attachmentTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { searchInspectionRequestHeaderList } from '@/api/inspection/inspectionRequestHeader.js' |
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
import ComInspectionRequestDetail from './com_inspectionRequestDetail.vue' |
||||
|
import ComInspectionRequestDetailTab from './com_inspectionRequestDetailTab.vue' |
||||
|
import ComInspectionRequestPoDetailTab from './com_inspectionRequestPoDetailTab.vue' |
||||
|
import ComInspectionResultTab from './com_inspectionResultTab.vue' |
||||
|
import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachmentTab.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist, |
||||
|
InspectionRequestDetail: ComInspectionRequestDetail, |
||||
|
InspectionRequestDetailTab: ComInspectionRequestDetailTab, |
||||
|
InspectionRequestPoDetailTab: ComInspectionRequestPoDetailTab, |
||||
|
InspectionResultTab: ComInspectionResultTab, |
||||
|
InspectionRequestAttachmentTab: ComInspectionRequestAttachmentTab |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
height: 400, |
||||
|
detailHeight: 400, |
||||
|
currentRow: {}, |
||||
|
tagNo: '', |
||||
|
searchType: '', |
||||
|
activeTab: 'base', |
||||
|
searchData: { |
||||
|
requestNo: '', |
||||
|
supplierNo: '', |
||||
|
supplierName: '', |
||||
|
status: 'Scheduled', // 固定状态为已排程 |
||||
|
qcOperator: this.$store.state.user.name, // 固定为当前登录用户 |
||||
|
createBy: '', |
||||
|
requestDateStart: '', |
||||
|
requestDateEnd: '', |
||||
|
needInspectDateStart: '', |
||||
|
needInspectDateEnd: '', |
||||
|
planStartDate: '', |
||||
|
planEndDate: '', |
||||
|
page: 1, |
||||
|
limit: 50 |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
mainDataList: [], |
||||
|
dataListLoading: false, |
||||
|
columnArray1: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1RequestNo', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'requestNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '申请单号', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1RequestDate', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'requestDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '申请日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1SupplierNo', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'supplierNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '供应商编码', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1SupplierName', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'supplierName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '供应商名称', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1CreateBy', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '申请人员', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1NeedInspectDate', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'needInspectDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '建议验货日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1InspectAddress', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'inspectAddress', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '验货地址', |
||||
|
columnWidth: '200', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1Contact', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'inspectContract', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '联系人', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1Remark', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'remark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '备注', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1Status', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'status', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '状态', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1PlanStartDate', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'planStartDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '计划验货日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'PendingTable1QcOperator', |
||||
|
tableId: 'PendingTable1', |
||||
|
tableName: '待验货申请单', |
||||
|
columnProp: 'qcOperator', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'QC人员', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = (window.innerHeight - 220) / 2 |
||||
|
this.detailHeight = (window.innerHeight - 220) / 2 |
||||
|
this.getMainData() |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取基础数据列表 |
||||
|
getBaseList (val, type) { |
||||
|
this.tagNo = val |
||||
|
this.searchType = type || '' |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
let conSql = '' |
||||
|
if (val === 1100) { |
||||
|
strVal = this.searchData.supplierNo || '' |
||||
|
conSql = " and site = '" + this.$store.state.user.site + "'" |
||||
|
} |
||||
|
if (val === 2016) { |
||||
|
strVal = type === 'createBy' ? (this.searchData.createBy || '') : '' |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal, conSql) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 1100) { |
||||
|
this.searchData.supplierNo = val.supplier_no || '' |
||||
|
this.searchData.supplierName = val.supplier_name || '' |
||||
|
} |
||||
|
if (this.tagNo === 2016) { |
||||
|
if (this.searchType === 'createBy') { |
||||
|
this.searchData.createBy = val.username || val.user_display || val.name |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 查询数据 - 🔑 核心方法:固定状态和QC人员 |
||||
|
getMainData () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
|
||||
|
// 🔑 固定状态为"已排程" |
||||
|
this.searchData.status = 'Scheduled' |
||||
|
|
||||
|
// 🔑 固定QC人员为当前登录用户 |
||||
|
this.searchData.qcOperator = this.$store.state.user.name |
||||
|
|
||||
|
this.dataListLoading = true |
||||
|
|
||||
|
searchInspectionRequestHeaderList(this.searchData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
this.mainDataList = data.page.list |
||||
|
|
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
|
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.mainTable) { |
||||
|
this.$refs.mainTable.clearSelection() |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
// 判断是否有数据 |
||||
|
if (this.mainDataList.length > 0) { |
||||
|
this.$refs.mainTable.setCurrentRow(this.mainDataList[0]) |
||||
|
this.changeData(this.mainDataList[0]) |
||||
|
} else { |
||||
|
this.changeData(null) |
||||
|
} |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}).catch(() => { |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getMainData() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getMainData() |
||||
|
}, |
||||
|
|
||||
|
// 页签点击事件 |
||||
|
handleTabClick (tab) { |
||||
|
if (tab.name === 'detail') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.inspectionDetailTab) { |
||||
|
this.$refs.inspectionDetailTab.loadDetailList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'poDetail') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.poDetailTab) { |
||||
|
this.$refs.poDetailTab.loadDetailList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'result') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.resultTab) { |
||||
|
this.$refs.resultTab.loadDetailList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'attachment') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.attachmentTab) { |
||||
|
this.$refs.attachmentTab.loadAttachmentTypeList() |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 行点击事件 |
||||
|
changeData (row) { |
||||
|
this.currentRow = row ? JSON.parse(JSON.stringify(row)) : {} |
||||
|
}, |
||||
|
|
||||
|
// 查看详情 |
||||
|
viewDetail (row) { |
||||
|
this.changeData(row) |
||||
|
// 可以跳转到详情页面或展开详情 |
||||
|
}, |
||||
|
|
||||
|
// 主表格行样式(验货申请中有数量修改时标红) |
||||
|
mainTableRowClassName ({ row }) { |
||||
|
if (row.hasModifiedQty === true || |
||||
|
row.hasModifiedQty === 'true' || |
||||
|
row.hasModifiedQty === 'Y' || |
||||
|
row.hasModifiedQty === 'y' || |
||||
|
row.hasModifiedQty === 1 || |
||||
|
row.hasModifiedQty === '1') { |
||||
|
return 'modified-request-row' |
||||
|
} |
||||
|
return '' |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
this.getMainData() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.search-form-inline { |
||||
|
padding: 10px 15px 0 0; |
||||
|
background: #fff; |
||||
|
} |
||||
|
|
||||
|
.search-row { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
flex-wrap: nowrap; |
||||
|
margin-bottom: 6px; |
||||
|
} |
||||
|
|
||||
|
.search-btn-row { |
||||
|
margin-top: 10px; |
||||
|
padding-left: 8px; |
||||
|
} |
||||
|
|
||||
|
.input-small { |
||||
|
width: 110px; |
||||
|
} |
||||
|
|
||||
|
.input-mini { |
||||
|
width: 90px; |
||||
|
} |
||||
|
|
||||
|
.date-small { |
||||
|
width: 100px; |
||||
|
} |
||||
|
|
||||
|
.date-range { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.date-small { |
||||
|
width: 130px; |
||||
|
} |
||||
|
|
||||
|
.split { |
||||
|
padding: 0 6px; |
||||
|
color: #606266; |
||||
|
font-size: 13px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item { |
||||
|
margin-right: 18px; |
||||
|
margin-bottom: 6px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item__label { |
||||
|
font-size: 13px; |
||||
|
color: #606266; |
||||
|
padding-right: 8px; |
||||
|
line-height: 32px; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item__content { |
||||
|
line-height: normal; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-input__inner { |
||||
|
height: 32px; |
||||
|
line-height: 32px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__inner { |
||||
|
padding-right: 10px; |
||||
|
padding-left: 10px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__prefix { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__suffix { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
/deep/ .customer-tab .el-tabs__content { |
||||
|
padding: 5px !important; |
||||
|
} |
||||
|
|
||||
|
/* 强制主表红色背景 */ |
||||
|
::v-deep .el-table__body tr.modified-request-row td { |
||||
|
background-color: #ff4d4f !important; |
||||
|
color: #ffffff !important; |
||||
|
} |
||||
|
|
||||
|
/* 当前选中行也强制红色 */ |
||||
|
::v-deep .el-table__body tr.modified-request-row.current-row td { |
||||
|
background-color: #ff4d4f !important; |
||||
|
color: #ffffff !important; |
||||
|
} |
||||
|
|
||||
|
/* hover状态 */ |
||||
|
::v-deep .el-table__body tr.modified-request-row:hover td { |
||||
|
background-color: #ff7875 !important; |
||||
|
color: #ffffff !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<!-- 全局样式 - 仅对有 modified-request-row 类的行生效 --> |
||||
|
<style lang="scss"> |
||||
|
.el-table__body tr.modified-request-row > td { |
||||
|
background-color: #ffe6e6 !important; |
||||
|
color: #333333 !important; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,691 @@ |
|||||
|
<template> |
||||
|
<div class="schedule-page-container"> |
||||
|
<!-- 查询条件 --> |
||||
|
<el-form :inline="true" label-width="90px" class="search-form-inline"> |
||||
|
<!-- 第一行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(1100)"><a href="#">供应商编码</a></span> |
||||
|
<el-input v-model="searchData.supplierNo" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="供应商名称"> |
||||
|
<el-input v-model="searchData.supplierName" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="申请日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.requestDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.requestDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="状态"> |
||||
|
<el-select v-model="searchData.status" class="input-mini"> |
||||
|
<el-option label="已审核" value="AUDITED" /> |
||||
|
<el-option label="已排程" value="SCHEDULED" /> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 第二行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'createBy')"><a href="#">申请人员</a></span> |
||||
|
<el-input v-model="searchData.createBy" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item> |
||||
|
<span style="cursor: pointer" slot="label" @click="getBaseList(2016, 'qcOperator')"><a href="#">QC人员</a></span> |
||||
|
<el-input v-model="searchData.qcOperator" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="建议验货日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.needInspectDateStart" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.needInspectDateEnd" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 第三行 --> |
||||
|
<div class="search-row"> |
||||
|
<el-form-item label="申请单号"> |
||||
|
<el-input v-model="searchData.requestNo" class="input-small" @keyup.enter.native="getMainData"/> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="计划验货日期"> |
||||
|
<div class="date-range"> |
||||
|
<el-date-picker v-model="searchData.planStartDate" type="date" value-format="yyyy-MM-dd" placeholder="开始" class="date-small"/> |
||||
|
<span class="split">-</span> |
||||
|
<el-date-picker v-model="searchData.planEndDate" type="date" value-format="yyyy-MM-dd" placeholder="结束" class="date-small"/> |
||||
|
</div> |
||||
|
</el-form-item> |
||||
|
</div> |
||||
|
|
||||
|
<!-- 按钮 --> |
||||
|
<div class="search-btn-row"> |
||||
|
<el-button type="primary" class="customer-bun-min" @click="getMainData">查询</el-button> |
||||
|
</div> |
||||
|
</el-form> |
||||
|
|
||||
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
||||
|
|
||||
|
<el-table |
||||
|
:height="height" |
||||
|
:data="mainDataList" |
||||
|
border |
||||
|
ref="mainTable" |
||||
|
highlight-current-row |
||||
|
@row-click="changeData" |
||||
|
v-loading="dataListLoading" |
||||
|
style="margin-top: 0px; width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in columnArray1" :key="index" |
||||
|
:sortable="item.columnSortable" |
||||
|
:prop="item.columnProp" |
||||
|
:header-align="item.headerAlign" |
||||
|
:show-overflow-tooltip="item.showOverflowTooltip" |
||||
|
:align="item.align" |
||||
|
:fixed="item.fixed==''?false:item.fixed" |
||||
|
:min-width="item.columnWidth" |
||||
|
:label="item.columnLabel"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
||||
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
||||
|
style="width: 100px; height: 100px"/></span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> |
||||
|
<template slot-scope="scope"> |
||||
|
<!-- 移除单个排程按钮,统一在页签中操作 --> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<!-- 分页插件 --> |
||||
|
<el-pagination style="margin-top: 5px" |
||||
|
@size-change="sizeChangeHandle" |
||||
|
@current-change="currentChangeHandle" |
||||
|
:current-page="pageIndex" |
||||
|
:page-sizes="[20, 50, 100, 200, 500]" |
||||
|
:page-size="pageSize" |
||||
|
:total="totalPage" |
||||
|
layout="total, sizes, prev, pager, next, jumper" |
||||
|
small> |
||||
|
</el-pagination> |
||||
|
|
||||
|
<!-- 详情页签 --> |
||||
|
<el-tabs v-model="activeTab" @tab-click="handleTabClick" class="customer-tab" type="border-card"> |
||||
|
<!-- 排程视图 --> |
||||
|
<el-tab-pane label="排程" name="schedule"> |
||||
|
<inspection-schedule-view |
||||
|
ref="scheduleView" |
||||
|
:request-nos="selectedRequestNos" |
||||
|
:current-row="currentRow" |
||||
|
@schedule-success="getMainData" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 基本信息 --> |
||||
|
<el-tab-pane label="基本信息" name="base"> |
||||
|
<inspection-request-detail :detail-data="currentRow" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 验货明细 --> |
||||
|
<el-tab-pane label="验货明细" name="detail"> |
||||
|
<inspection-request-detail-tab ref="inspectionDetailTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 验货关联PO明细 --> |
||||
|
<el-tab-pane label="验货关联PO明细" name="poDetail"> |
||||
|
<inspection-request-po-detail-tab ref="poDetailTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
<!-- 附件管理 --> |
||||
|
<el-tab-pane label="附件管理" name="attachment"> |
||||
|
<inspection-request-attachment-tab ref="attachmentTab" :detail-data="currentRow" :table-height="detailHeight" /> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { searchInspectionRequestHeaderList } from '@/api/inspection/inspectionRequestHeader.js' |
||||
|
import Chooselist from '@/views/modules/common/Chooselist_eam' |
||||
|
import ComInspectionRequestDetail from './com_inspectionRequestDetail.vue' |
||||
|
import ComInspectionRequestDetailTab from './com_inspectionRequestDetailTab.vue' |
||||
|
import ComInspectionRequestPoDetailTab from './com_inspectionRequestPoDetailTab.vue' |
||||
|
import ComInspectionRequestAttachmentTab from './com_inspectionRequestAttachmentTab.vue' |
||||
|
import ComInspectionScheduleView from './com_inspectionScheduleView.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
Chooselist, |
||||
|
InspectionRequestDetail: ComInspectionRequestDetail, |
||||
|
InspectionRequestDetailTab: ComInspectionRequestDetailTab, |
||||
|
InspectionRequestPoDetailTab: ComInspectionRequestPoDetailTab, |
||||
|
InspectionRequestAttachmentTab: ComInspectionRequestAttachmentTab, |
||||
|
InspectionScheduleView: ComInspectionScheduleView |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
height: 400, |
||||
|
detailHeight: 400, |
||||
|
currentRow: {}, |
||||
|
tagNo: '', |
||||
|
searchType: '', |
||||
|
activeTab: 'schedule', |
||||
|
selectedRequestNos: [], |
||||
|
searchData: { |
||||
|
requestNo: '', |
||||
|
supplierNo: '', |
||||
|
supplierName: '', |
||||
|
status: 'AUDITED', // 默认状态为已审核 |
||||
|
qcOperator: '', |
||||
|
createBy: '', |
||||
|
requestDateStart: '', |
||||
|
requestDateEnd: '', |
||||
|
needInspectDateStart: '', |
||||
|
needInspectDateEnd: '', |
||||
|
planStartDate: '', |
||||
|
planEndDate: '', |
||||
|
page: 1, |
||||
|
limit: 50 |
||||
|
}, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 50, |
||||
|
totalPage: 0, |
||||
|
mainDataList: [], |
||||
|
dataListLoading: false, |
||||
|
columnArray1: [ |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1RequestNo', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'requestNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '申请单号', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1RequestDate', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'requestDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '申请日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1SupplierNo', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'supplierNo', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '供应商编码', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1SupplierName', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'supplierName', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '供应商名称', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1CreateBy', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'createBy', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '申请人员', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1NeedInspectDate', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'needInspectDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '建议验货日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1InspectAddress', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'inspectAddress', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '验货地址', |
||||
|
columnWidth: '200', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1Contact', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'inspectContract', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '联系人', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1Remark', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'remark', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: '备注', |
||||
|
columnWidth: '150', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1Status', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'status', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '状态', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1PlanStartDate', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'planStartDate', |
||||
|
headerAlign: 'center', |
||||
|
align: 'center', |
||||
|
columnLabel: '计划验货日期', |
||||
|
columnWidth: '120', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
}, |
||||
|
{ |
||||
|
userId: this.$store.state.user.name, |
||||
|
functionId: this.functionId, |
||||
|
serialNumber: 'ScheduleTable1QcOperator', |
||||
|
tableId: 'ScheduleTable1', |
||||
|
tableName: '验货排程', |
||||
|
columnProp: 'qcOperator', |
||||
|
headerAlign: 'center', |
||||
|
align: 'left', |
||||
|
columnLabel: 'QC人员', |
||||
|
columnWidth: '100', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: false |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
// 计算表格高度,留出查询表单、分页和页签的空间 |
||||
|
this.height = 250 |
||||
|
this.detailHeight = 300 |
||||
|
this.getMainData() |
||||
|
|
||||
|
// 默认打开排程页签,自动执行查询 |
||||
|
if (this.activeTab === 'schedule' && this.$refs.scheduleView) { |
||||
|
this.$refs.scheduleView.loadQcList() |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 获取基础数据列表 |
||||
|
getBaseList (val, type) { |
||||
|
this.tagNo = val |
||||
|
this.searchType = type || '' |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
let conSql = '' |
||||
|
if (val === 1100) { |
||||
|
strVal = this.searchData.supplierNo || '' |
||||
|
conSql = " and site = '" + this.$store.state.user.site + "'" |
||||
|
} |
||||
|
if (val === 2016) { |
||||
|
strVal = type === 'createBy' ? (this.searchData.createBy || '') : (this.searchData.qcOperator || '') |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal, conSql) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/* 列表方法的回调 */ |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 1100) { |
||||
|
this.searchData.supplierNo = val.supplier_no || '' |
||||
|
this.searchData.supplierName = val.supplier_name || '' |
||||
|
} |
||||
|
if (this.tagNo === 2016) { |
||||
|
if (this.searchType === 'createBy') { |
||||
|
this.searchData.createBy = val.username || val.user_display || val.name |
||||
|
} else if (this.searchType === 'qcOperator') { |
||||
|
this.searchData.qcOperator = val.username || val.user_display || val.name |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 查询数据 |
||||
|
getMainData () { |
||||
|
this.searchData.limit = this.pageSize |
||||
|
this.searchData.page = this.pageIndex |
||||
|
|
||||
|
this.dataListLoading = true |
||||
|
|
||||
|
searchInspectionRequestHeaderList(this.searchData).then(({ data }) => { |
||||
|
if (data.code === 0) { |
||||
|
this.mainDataList = data.page.list |
||||
|
|
||||
|
this.pageIndex = data.page.currPage |
||||
|
this.pageSize = data.page.pageSize |
||||
|
this.totalPage = data.page.totalCount |
||||
|
|
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.mainTable) { |
||||
|
this.$refs.mainTable.clearSelection() |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
// 判断是否有数据 |
||||
|
if (this.mainDataList.length > 0) { |
||||
|
this.$refs.mainTable.setCurrentRow(this.mainDataList[0]) |
||||
|
this.changeData(this.mainDataList[0]) |
||||
|
} else { |
||||
|
this.changeData(null) |
||||
|
} |
||||
|
} |
||||
|
this.dataListLoading = false |
||||
|
}).catch(() => { |
||||
|
this.dataListLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 每页数 |
||||
|
sizeChangeHandle (val) { |
||||
|
this.pageSize = val |
||||
|
this.pageIndex = 1 |
||||
|
this.getMainData() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle (val) { |
||||
|
this.pageIndex = val |
||||
|
this.getMainData() |
||||
|
}, |
||||
|
|
||||
|
// 页签点击事件 |
||||
|
handleTabClick (tab) { |
||||
|
if (tab.name === 'schedule') { |
||||
|
// 排程页签 |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.scheduleView) { |
||||
|
this.$refs.scheduleView.loadQcList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'detail') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.inspectionDetailTab) { |
||||
|
this.$refs.inspectionDetailTab.loadDetailList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'poDetail') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.poDetailTab) { |
||||
|
this.$refs.poDetailTab.loadDetailList() |
||||
|
} |
||||
|
}) |
||||
|
} else if (tab.name === 'attachment') { |
||||
|
this.$nextTick(() => { |
||||
|
if (this.$refs.attachmentTab) { |
||||
|
this.$refs.attachmentTab.loadAttachmentTypeList() |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 行点击事件 |
||||
|
changeData (row) { |
||||
|
this.currentRow = row ? JSON.parse(JSON.stringify(row)) : {} |
||||
|
// 自动更新选中的申请单号,传递给页签 |
||||
|
if (row && row.requestNo) { |
||||
|
this.selectedRequestNos = [row.requestNo] |
||||
|
} else { |
||||
|
this.selectedRequestNos = [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 主表格行样式 |
||||
|
mainTableRowClassName ({ row }) { |
||||
|
return '' |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
created () { |
||||
|
this.getMainData() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
// 主容器 - 固定高度,滚动条 |
||||
|
.schedule-page-container { |
||||
|
height: calc(100vh - 120px); |
||||
|
overflow: hidden; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
padding: 10px; |
||||
|
background: #f5f7fa; |
||||
|
} |
||||
|
|
||||
|
.search-form-inline { |
||||
|
padding: 8px 15px; |
||||
|
background: #fff; |
||||
|
border-radius: 4px; |
||||
|
margin-bottom: 8px; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
|
||||
|
.search-row { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
flex-wrap: nowrap; |
||||
|
margin-bottom: 4px; |
||||
|
} |
||||
|
|
||||
|
.search-btn-row { |
||||
|
margin-top: 6px; |
||||
|
padding-left: 8px; |
||||
|
} |
||||
|
|
||||
|
.input-small { |
||||
|
width: 110px; |
||||
|
} |
||||
|
|
||||
|
.input-mini { |
||||
|
width: 90px; |
||||
|
} |
||||
|
|
||||
|
.date-small { |
||||
|
width: 100px; |
||||
|
} |
||||
|
|
||||
|
.date-range { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.date-small { |
||||
|
width: 130px; |
||||
|
} |
||||
|
|
||||
|
.split { |
||||
|
padding: 0 6px; |
||||
|
color: #606266; |
||||
|
font-size: 13px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item { |
||||
|
margin-right: 15px; |
||||
|
margin-bottom: 4px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item__label { |
||||
|
font-size: 13px; |
||||
|
color: #606266; |
||||
|
padding-right: 8px; |
||||
|
line-height: 28px; |
||||
|
font-weight: 500; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-form-item__content { |
||||
|
line-height: normal; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-input__inner { |
||||
|
height: 28px; |
||||
|
line-height: 28px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__inner { |
||||
|
padding-right: 10px; |
||||
|
padding-left: 10px; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__prefix { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
/deep/ .el-date-editor .el-input__suffix { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
// 表格区域 - 自动高度 |
||||
|
/deep/ .el-table { |
||||
|
margin-bottom: 5px; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
|
||||
|
// 分页 - 自动高度 |
||||
|
/deep/ .el-pagination { |
||||
|
margin-bottom: 8px; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
|
||||
|
// 页签区域 - 占据剩余空间,内部滚动 |
||||
|
/deep/ .customer-tab { |
||||
|
flex: 1; |
||||
|
overflow: hidden; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
|
||||
|
.el-tabs__header { |
||||
|
margin-bottom: 0; |
||||
|
flex-shrink: 0; |
||||
|
} |
||||
|
|
||||
|
.el-tabs__content { |
||||
|
flex: 1; |
||||
|
overflow-y: auto; |
||||
|
overflow-x: hidden; |
||||
|
padding: 10px !important; |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue