diff --git a/klp-ui/src/components/KLPService/CheckItemSelect/index.vue b/klp-ui/src/components/KLPService/CheckItemSelect/index.vue index c0dd608c..6e8701b5 100644 --- a/klp-ui/src/components/KLPService/CheckItemSelect/index.vue +++ b/klp-ui/src/components/KLPService/CheckItemSelect/index.vue @@ -5,6 +5,7 @@ filterable placeholder="请选择检查项" @change="handleChange" + size="mini" style="width: 100%;" > +
+ 头像 +
+
{{ greeting }},{{ name }}
+
愿你天黑有灯,下雨有伞
+
+
+ + + + + \ No newline at end of file diff --git a/klp-ui/src/views/index.vue b/klp-ui/src/views/index.vue index 9f2b3cc1..645e88bc 100644 --- a/klp-ui/src/views/index.vue +++ b/klp-ui/src/views/index.vue @@ -3,13 +3,7 @@ @@ -91,9 +123,6 @@ export default { data() { return { loading: true, - ids: [], - single: true, - multiple: true, showSearch: true, total: 0, checkTaskList: [], @@ -102,11 +131,12 @@ export default { pageSize: 20, taskName: undefined, }, - detailOpen: false, detailData: {}, + // 当前选中的任务(单选) + selectedTask: null, } }, - created() { + mounted() { this.getList() }, methods: { @@ -126,28 +156,65 @@ export default { this.resetForm('queryForm') this.handleQuery() }, - handleSelectionChange(selection) { - this.ids = selection.map(item => item.taskId) - this.single = selection.length!==1 - this.multiple = !selection.length + + // 点击行选中任务 + handleRowClick(row) { + if (this.selectedTask && this.selectedTask.taskId === row.taskId) { + // 点击当前选中行,取消选中 + this.selectedTask = null + this.detailData = {} + } else { + // 选中新行 + this.selectedTask = row + this.loadTaskDetail(row.taskId) + } + }, + + // 表格行样式 + tableRowClassName({row, rowIndex}) { + return this.selectedTask && this.selectedTask.taskId === row.taskId ? 'current-row' : '' + }, + + // 加载任务详情 + loadTaskDetail(taskId) { + this.loading = true + getCheckTask(taskId).then(response => { + this.detailData = response.data + }).finally(() => { + this.loading = false + }) }, handleExport() { this.download('qc/checkTask/export', { ...this.queryParams }, `checkTask_${new Date().getTime()}.xlsx`) - }, - handleDetail(row) { - this.loading = true - getCheckTask(row.taskId).then(response => { - this.detailData = response.data - this.detailOpen = true - }).finally(() => { - this.loading = false - }) - }, - handleDetailClose() { - this.detailOpen = false - this.getList() + } + }, + + // 添加样式 + computed: { + styles() { + return { + mb10: { marginBottom: '10px' }, + detailSection: { + marginTop: '20px', + border: '1px solid #e6e6e6', + borderRadius: '4px', + padding: '10px' + }, + tableTitle: { + fontSize: '16px', + fontWeight: 'bold', + marginBottom: '10px', + color: '#333' + }, + emptyTip: { + textAlign: 'center', + padding: '40px 0', + backgroundColor: '#fafafa', + borderRadius: '4px' + } + } } } } diff --git a/klp-ui/src/views/mes/qc/item/index.vue b/klp-ui/src/views/mes/qc/item/index.vue index 453550eb..c3e31462 100644 --- a/klp-ui/src/views/mes/qc/item/index.vue +++ b/klp-ui/src/views/mes/qc/item/index.vue @@ -61,6 +61,15 @@ + + + + + + + @@ -154,12 +182,6 @@ export default { buttonLoading: false, // 遮罩层 loading: true, - // 选中数组 - ids: [], - // 非单个禁用 - single: true, - // 非多个禁用 - multiple: true, // 显示搜索条件 showSearch: true, // 总条数 @@ -177,15 +199,24 @@ export default { taskName: undefined, }, // 表单参数 - form: {}, + form: { + verifyTarget: undefined, + workshopSection: undefined, + process: undefined, + unitGroup: undefined, + inspectionResult: 0, + inspectionType: undefined + }, // 表单校验 rules: { }, - detailOpen: false, - detailData: {} + detailData: {}, + // 选中的任务(当前选择的行) + selectedTask: null }; }, - mounted() { + created() { + console.log(this.$refs.checkTaskTable, '初始化表格数据') this.getList(); }, components: { @@ -217,7 +248,13 @@ export default { updateBy: undefined, updateTime: undefined, delFlag: undefined, - remark: undefined + remark: undefined, + verifyTarget: undefined, + workshopSection: undefined, + process: undefined, + unitGroup: undefined, + inspectionResult: 0, + inspectionType: undefined }; this.resetForm("form"); }, @@ -231,11 +268,22 @@ export default { this.resetForm("queryForm"); this.handleQuery(); }, - // 多选框选中数据 - handleSelectionChange(selection) { - this.ids = selection.map(item => item.taskId) - this.single = selection.length!==1 - this.multiple = !selection.length + /** 点击行选中任务 */ + handleRowClick(row) { + // 否则选中当前行 + this.selectedTask = row + this.loadTaskDetail(row.taskId) + }, + + // 加载任务详情 + loadTaskDetail(taskId) { + this.detailLoading = true + console.log(taskId, '加载任务详情') + getCheckTask(taskId) + .then(response => { + this.detailData = response.data + this.detailLoading = false + }) }, /** 新增按钮操作 */ handleAdd() { @@ -244,11 +292,10 @@ export default { this.title = "添加检查任务"; }, /** 修改按钮操作 */ - handleUpdate(row) { + handleUpdate() { this.loading = true; this.reset(); - const taskId = row.taskId || this.ids - getCheckTask(taskId).then(response => { + getCheckTask(this.selectedTask.taskId).then(response => { this.loading = false; this.form = response.data; this.open = true; @@ -260,7 +307,6 @@ export default { this.loading = true getCheckTask(row.taskId).then(response => { this.detailData = response.data - this.detailOpen = true }).finally(() => { this.loading = false }) @@ -292,13 +338,16 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const taskIds = row.taskId || this.ids; - this.$modal.confirm('是否确认删除检查任务编号为"' + taskIds + '"的数据项?').then(() => { + const taskId = row ? row.taskId : this.selectedTask.taskId; + this.$modal.confirm('是否确认删除检查任务编号为"' + taskId + '"的数据项?').then(() => { this.loading = true; - return delCheckTask(taskIds); + return delCheckTask(taskId); }).then(() => { this.loading = false; this.getList(); + // 重置选中状态和详情数据 + this.selectedTask = null; + this.detailData = {}; this.$modal.msgSuccess("删除成功"); }).catch(() => { }).finally(() => { @@ -324,10 +373,33 @@ export default { }) }) }, - handleDetailClose() { - this.detailOpen = false - this.getList() + }, + + // 添加样式 + computed: { + styles() { + return { + mb10: { marginBottom: '10px' }, + detailSection: { + marginTop: '20px', + border: '1px solid #e6e6e6', + borderRadius: '4px', + padding: '10px' + }, + tableTitle: { + fontSize: '16px', + fontWeight: 'bold', + marginBottom: '10px', + color: '#333' + }, + emptyTip: { + textAlign: 'center', + padding: '40px 0', + backgroundColor: '#fafafa', + borderRadius: '4px' + } + } } - } + }, }; diff --git a/klp-ui/src/views/mes/qc/task/pages/auxiliary.vue b/klp-ui/src/views/mes/qc/task/pages/auxiliary.vue new file mode 100644 index 00000000..aba12ead --- /dev/null +++ b/klp-ui/src/views/mes/qc/task/pages/auxiliary.vue @@ -0,0 +1,468 @@ + + + diff --git a/klp-ui/src/views/mes/qc/task/pages/lab.vue b/klp-ui/src/views/mes/qc/task/pages/lab.vue new file mode 100644 index 00000000..bb920a5c --- /dev/null +++ b/klp-ui/src/views/mes/qc/task/pages/lab.vue @@ -0,0 +1,444 @@ + + + diff --git a/klp-ui/src/views/mes/qc/task/pages/raw.vue b/klp-ui/src/views/mes/qc/task/pages/raw.vue new file mode 100644 index 00000000..18d7dda6 --- /dev/null +++ b/klp-ui/src/views/mes/qc/task/pages/raw.vue @@ -0,0 +1,475 @@ + + + diff --git a/klp-ui/src/views/mes/qc/task/pages/section.vue b/klp-ui/src/views/mes/qc/task/pages/section.vue new file mode 100644 index 00000000..87b91248 --- /dev/null +++ b/klp-ui/src/views/mes/qc/task/pages/section.vue @@ -0,0 +1,444 @@ + + +