迁移质量管理检验项目
This commit is contained in:
@@ -78,3 +78,13 @@
|
|||||||
- [ ] 编辑刚新增的数据,确认回显、保存和刷新后的字段值正确。
|
- [ ] 编辑刚新增的数据,确认回显、保存和刷新后的字段值正确。
|
||||||
- [ ] 删除测试数据,确认二次确认弹窗、删除请求和列表刷新正常。
|
- [ ] 删除测试数据,确认二次确认弹窗、删除请求和列表刷新正常。
|
||||||
|
|
||||||
|
## 检验项目 (Inspection Items)
|
||||||
|
|
||||||
|
- [ ] 通过菜单或地址 /quality_control/xqc/inspection_item 打开页面,确认页面标题、查询区和列表区域正常显示。
|
||||||
|
- [ ] 输入主要查询条件后点击查询,确认请求参数和列表刷新符合旧系统字段。
|
||||||
|
- [ ] 点击重置,确认查询条件清空并回到第一页。
|
||||||
|
- [ ] 切换分页大小和页码,确认列表数据、总数和加载状态正常。
|
||||||
|
- [ ] 新增一条测试数据,确认必填校验、提交成功提示和列表刷新正常。
|
||||||
|
- [ ] 编辑刚新增的数据,确认回显、保存和刷新后的字段值正确。
|
||||||
|
- [ ] 删除测试数据,确认二次确认弹窗、删除请求和列表刷新正常。
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
> 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。
|
> 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。
|
||||||
|
|
||||||
- 总功能数:79
|
- 总功能数:79
|
||||||
- 已迁移:56
|
- 已迁移:57
|
||||||
- 未迁移:23
|
- 未迁移:22
|
||||||
|
|
||||||
| 状态 | 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 |
|
| 状态 | 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 |
|
||||||
|:---:|---|---|---|---|---|
|
|:---:|---|---|---|---|---|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验标准 (Inspection Standards) | | `src/views/quality-management/inspection-management/inspection-standards/` |
|
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验标准 (Inspection Standards) | | `src/views/quality-management/inspection-management/inspection-standards/` |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 接收质量限 (AQL Standards) | | `src/views/quality-management/inspection-management/aql-standards/` |
|
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 接收质量限 (AQL Standards) | | `src/views/quality-management/inspection-management/aql-standards/` |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检测方案维护 (Inspection Plans) | | `src/views/quality-management/inspection-management/inspection-plans/` |
|
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检测方案维护 (Inspection Plans) | | `src/views/quality-management/inspection-management/inspection-plans/` |
|
||||||
| ⬜ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验项目 (Inspection Items) | | 待确认 |
|
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验项目 (Inspection Items) | | `src/views/quality-management/inspection-management/inspection-items/` |
|
||||||
| ⬜ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 抽样方案配置 (Sampling Plans) | | 待确认 |
|
| ⬜ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 抽样方案配置 (Sampling Plans) | | 待确认 |
|
||||||
| ⬜ | 质量管理 (Quality Management) | SPC统计过程控制 (SPC Control) | SPC渲染条件配置 (SPC Configuration) | | 待确认 |
|
| ⬜ | 质量管理 (Quality Management) | SPC统计过程控制 (SPC Control) | SPC渲染条件配置 (SPC Configuration) | | 待确认 |
|
||||||
| ⬜ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-R (XBar-R Chart) | | 待确认 |
|
| ⬜ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-R (XBar-R Chart) | | 待确认 |
|
||||||
|
|||||||
39
src/api/quality-management/inspection-items.js
Normal file
39
src/api/quality-management/inspection-items.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { request } from '@/api/_service'
|
||||||
|
|
||||||
|
const BASE = 'quality_control/xqc/inspection_item/'
|
||||||
|
|
||||||
|
function apiParams (data = {}, method = 'get.quality.inspection_item.list', platform = 'api') {
|
||||||
|
return { method, platform, ...data }
|
||||||
|
}
|
||||||
|
export function fetchInspectionItemsList (data = {}) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'list',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams(data, 'get.quality.inspection_item.list', 'api')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createInspectionItems (data = {}) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'add',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams(data, 'add.quality.inspection_item.add', 'api')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editInspectionItems (data = {}) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'set',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams(data, 'set.quality.inspection_item.set', 'api')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteInspectionItems (data = {}) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'del',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams(data, 'del.quality.inspection_item.del', 'api')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -3389,6 +3389,68 @@
|
|||||||
"subgroup_id": "Subgroup",
|
"subgroup_id": "Subgroup",
|
||||||
"sampling_time": "Sampling Time",
|
"sampling_time": "Sampling Time",
|
||||||
"sample_value": "Sample Value"
|
"sample_value": "Sample Value"
|
||||||
|
},
|
||||||
|
"inspection_items": {
|
||||||
|
"search": "Search",
|
||||||
|
"reset": "Reset",
|
||||||
|
"operation_success": "Operation succeeded",
|
||||||
|
"code": "Code",
|
||||||
|
"name": "Name",
|
||||||
|
"remark": "Remark",
|
||||||
|
"note": "Remark",
|
||||||
|
"operation": "Actions",
|
||||||
|
"add": "Add",
|
||||||
|
"edit": "Edit",
|
||||||
|
"delete": "Delete",
|
||||||
|
"add_title": "Add Inspection Items",
|
||||||
|
"edit_title": "Edit Inspection Items",
|
||||||
|
"cancel": "Cancel",
|
||||||
|
"confirm": "Confirm",
|
||||||
|
"tip": "Tip",
|
||||||
|
"confirm_delete": "Are you sure to delete?",
|
||||||
|
"required": "Required",
|
||||||
|
"please_enter": "Please enter",
|
||||||
|
"create_time": "Created At",
|
||||||
|
"created_at": "Created At",
|
||||||
|
"updated_at": "Updated At",
|
||||||
|
"nickname": "Creator",
|
||||||
|
"batch_no": "Batch No.",
|
||||||
|
"product_no": "Product Code",
|
||||||
|
"inspection_item": "Inspection Item",
|
||||||
|
"inspection_result": "Inspection Result",
|
||||||
|
"inspector": "Inspector",
|
||||||
|
"category_name": "Inspection Type",
|
||||||
|
"category": "Category",
|
||||||
|
"category_id": "Inspection Type",
|
||||||
|
"inspection_order_no": "Inspection Order No.",
|
||||||
|
"material_code": "Material Code",
|
||||||
|
"material_name": "Material Name",
|
||||||
|
"inspection_status": "Inspection Status",
|
||||||
|
"result": "Result",
|
||||||
|
"inspection_type": "Inspection Type",
|
||||||
|
"standard_value": "Standard Value",
|
||||||
|
"aql_value": "AQL Value",
|
||||||
|
"sampling_plan_name": "Sampling Plan",
|
||||||
|
"sampling_plan": "Sampling Plan",
|
||||||
|
"sampling_plan_id": "Sampling Plan",
|
||||||
|
"supplier": "Supplier",
|
||||||
|
"inspection_category_name": "Inspection Type",
|
||||||
|
"inspection_category": "Inspection Type",
|
||||||
|
"inspection_category_id": "Inspection Type",
|
||||||
|
"inspection_attribute": "Inspection Attribute",
|
||||||
|
"inspection_unit": "Inspection Unit",
|
||||||
|
"scheme_code": "Scheme Code",
|
||||||
|
"scheme_name": "Scheme Name",
|
||||||
|
"sample_size": "Sample Size",
|
||||||
|
"acceptance_number": "Acceptance No.",
|
||||||
|
"rejection_number": "Rejection No.",
|
||||||
|
"node_data_name": "Node Data Name",
|
||||||
|
"node_data_code": "Node Data Code",
|
||||||
|
"working_subclass": "Shift",
|
||||||
|
"project_name": "Project Name",
|
||||||
|
"subgroup_id": "Subgroup",
|
||||||
|
"sampling_time": "Sampling Time",
|
||||||
|
"sample_value": "Sample Value"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3389,6 +3389,68 @@
|
|||||||
"subgroup_id": "子组",
|
"subgroup_id": "子组",
|
||||||
"sampling_time": "采样时间",
|
"sampling_time": "采样时间",
|
||||||
"sample_value": "样本值"
|
"sample_value": "样本值"
|
||||||
|
},
|
||||||
|
"inspection_items": {
|
||||||
|
"search": "查询",
|
||||||
|
"reset": "重置",
|
||||||
|
"operation_success": "操作成功",
|
||||||
|
"code": "编码",
|
||||||
|
"name": "名称",
|
||||||
|
"remark": "备注",
|
||||||
|
"note": "备注",
|
||||||
|
"operation": "操作",
|
||||||
|
"add": "新增",
|
||||||
|
"edit": "编辑",
|
||||||
|
"delete": "删除",
|
||||||
|
"add_title": "新增检验项目",
|
||||||
|
"edit_title": "编辑检验项目",
|
||||||
|
"cancel": "取消",
|
||||||
|
"confirm": "确定",
|
||||||
|
"tip": "提示",
|
||||||
|
"confirm_delete": "确定要执行该操作吗?",
|
||||||
|
"required": "必填项",
|
||||||
|
"please_enter": "请输入",
|
||||||
|
"create_time": "创建时间",
|
||||||
|
"created_at": "创建时间",
|
||||||
|
"updated_at": "更新时间",
|
||||||
|
"nickname": "创建人",
|
||||||
|
"batch_no": "批次号",
|
||||||
|
"product_no": "产品编码",
|
||||||
|
"inspection_item": "检验项目",
|
||||||
|
"inspection_result": "检验结果",
|
||||||
|
"inspector": "检验员",
|
||||||
|
"category_name": "检验类别",
|
||||||
|
"category": "类别",
|
||||||
|
"category_id": "检验类别",
|
||||||
|
"inspection_order_no": "检验单号",
|
||||||
|
"material_code": "物料编码",
|
||||||
|
"material_name": "物料名称",
|
||||||
|
"inspection_status": "检验状态",
|
||||||
|
"result": "结果",
|
||||||
|
"inspection_type": "检验类型",
|
||||||
|
"standard_value": "标准值",
|
||||||
|
"aql_value": "AQL值",
|
||||||
|
"sampling_plan_name": "抽样方案",
|
||||||
|
"sampling_plan": "抽样方案",
|
||||||
|
"sampling_plan_id": "抽样方案",
|
||||||
|
"supplier": "供应商",
|
||||||
|
"inspection_category_name": "检验类别",
|
||||||
|
"inspection_category": "检验类别",
|
||||||
|
"inspection_category_id": "检验类别",
|
||||||
|
"inspection_attribute": "检验属性",
|
||||||
|
"inspection_unit": "检验单位",
|
||||||
|
"scheme_code": "方案编码",
|
||||||
|
"scheme_name": "方案名称",
|
||||||
|
"sample_size": "样本数",
|
||||||
|
"acceptance_number": "接收数",
|
||||||
|
"rejection_number": "拒收数",
|
||||||
|
"node_data_name": "节点数据名称",
|
||||||
|
"node_data_code": "节点数据编码",
|
||||||
|
"working_subclass": "班次",
|
||||||
|
"project_name": "项目名称",
|
||||||
|
"subgroup_id": "子组",
|
||||||
|
"sampling_time": "采样时间",
|
||||||
|
"sample_value": "样本值"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ export default {
|
|||||||
name: `${pre}inspection-management-inspection-plans`,
|
name: `${pre}inspection-management-inspection-plans`,
|
||||||
meta: { ...meta, cache: true, title: '检测方案维护' },
|
meta: { ...meta, cache: true, title: '检测方案维护' },
|
||||||
component: _import('quality-management/inspection-management/inspection-plans')
|
component: _import('quality-management/inspection-management/inspection-plans')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'xqc/inspection_item',
|
||||||
|
name: `${pre}inspection-management-inspection-items`,
|
||||||
|
meta: { ...meta, cache: true, title: '检验项目' },
|
||||||
|
component: _import('quality-management/inspection-management/inspection-items')
|
||||||
}
|
}
|
||||||
])('quality_control-')
|
])('quality_control-')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,313 @@
|
|||||||
|
<template>
|
||||||
|
<d2-container>
|
||||||
|
<template #header>
|
||||||
|
<div class="search-bar">
|
||||||
|
<el-form :inline="true" size="mini">
|
||||||
|
<el-form-item :label="$t(key('code'))">
|
||||||
|
<el-input
|
||||||
|
v-model="search.code"
|
||||||
|
:placeholder="$t(key('please_enter'))"
|
||||||
|
clearable
|
||||||
|
style="width:200px"
|
||||||
|
@keyup.enter.native="onSearch"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t(key('name'))">
|
||||||
|
<el-input
|
||||||
|
v-model="search.name"
|
||||||
|
:placeholder="$t(key('please_enter'))"
|
||||||
|
clearable
|
||||||
|
style="width:200px"
|
||||||
|
@keyup.enter.native="onSearch"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="onSearch">
|
||||||
|
{{ $t(key('search')) }}
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="onReset">
|
||||||
|
{{ $t(key('reset')) }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<page-table
|
||||||
|
ref="pageTable"
|
||||||
|
:columns="columns"
|
||||||
|
:data="tableData"
|
||||||
|
:loading="loading"
|
||||||
|
:toolbar-buttons="toolbarButtons"
|
||||||
|
:row-buttons="rowButtons"
|
||||||
|
:pagination="pagination"
|
||||||
|
help-url="/help/quality-management/inspection-items"
|
||||||
|
:help-text="$t(ckey('help'))"
|
||||||
|
auto-height
|
||||||
|
@page-change="onPageChange"
|
||||||
|
@selection-change="onSelect"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<page-dialog-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:title="dialogTitle"
|
||||||
|
width="520px"
|
||||||
|
:form-cols="formCols"
|
||||||
|
:form-data="formData"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="120px"
|
||||||
|
:submitting="submitting"
|
||||||
|
:confirm-text="key('confirm')"
|
||||||
|
:cancel-text="key('cancel')"
|
||||||
|
@submit="onDialogSubmit"
|
||||||
|
@close="onDialogClose"
|
||||||
|
/>
|
||||||
|
</d2-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { useTableColumns } from '@/composables/useTableColumns'
|
||||||
|
import { useTableButtons } from '@/composables/useTableButtons'
|
||||||
|
import { i18nMixin } from '@/composables/useI18n'
|
||||||
|
import { confirmMixin } from '@/composables/useConfirmHandle'
|
||||||
|
import {
|
||||||
|
fetchInspectionItemsList,
|
||||||
|
createInspectionItems,
|
||||||
|
editInspectionItems,
|
||||||
|
deleteInspectionItems
|
||||||
|
} from '@/api/quality-management/inspection-items'
|
||||||
|
import PageTable from '@/components/page-table'
|
||||||
|
import PageDialogForm from '@/components/page-dialog-form'
|
||||||
|
|
||||||
|
function readList (res) {
|
||||||
|
if (Array.isArray(res)) return { list: res, total: res.length }
|
||||||
|
const data = res && res.data ? res.data : res
|
||||||
|
if (Array.isArray(data)) return { list: data, total: data.length }
|
||||||
|
const list = (data && (data.list || data.rows || data.records || data.data)) || []
|
||||||
|
const total = data && (data.total || data.count || list.length)
|
||||||
|
return { list: Array.isArray(list) ? list : [], total: Number(total) || 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'quality-management-inspection-items',
|
||||||
|
components: { PageTable, PageDialogForm },
|
||||||
|
mixins: [i18nMixin('page.quality_management.inspection_items'), confirmMixin],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
submitting: false,
|
||||||
|
tableData: [],
|
||||||
|
selectedRows: [],
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogTitle: '',
|
||||||
|
editId: '',
|
||||||
|
handleType: 'create',
|
||||||
|
search: {"code":"","name":""},
|
||||||
|
pagination: { current: 1, size: 10, total: 0 },
|
||||||
|
formData: {"code":"","name":"","inspection_attribute":"","inspection_unit":"","note":""},
|
||||||
|
rules: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: this.key('required'), trigger: 'blur' }
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: true, message: this.key('required'), trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
columns: [],
|
||||||
|
toolbarButtons: [],
|
||||||
|
rowButtons: [],
|
||||||
|
formCols: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
prop: 'code',
|
||||||
|
label: this.key('code'),
|
||||||
|
placeholder: this.key('please_enter'),
|
||||||
|
clearable: true,
|
||||||
|
style: { width: '90%' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
prop: 'name',
|
||||||
|
label: this.key('name'),
|
||||||
|
placeholder: this.key('please_enter'),
|
||||||
|
clearable: true,
|
||||||
|
style: { width: '90%' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
prop: 'inspection_attribute',
|
||||||
|
label: this.key('inspection_attribute'),
|
||||||
|
placeholder: this.key('please_enter'),
|
||||||
|
clearable: true,
|
||||||
|
style: { width: '90%' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
prop: 'inspection_unit',
|
||||||
|
label: this.key('inspection_unit'),
|
||||||
|
placeholder: this.key('please_enter'),
|
||||||
|
clearable: true,
|
||||||
|
style: { width: '90%' }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
prop: 'note',
|
||||||
|
label: this.key('remark'),
|
||||||
|
placeholder: this.key('please_enter'),
|
||||||
|
clearable: true,
|
||||||
|
style: { width: '90%' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.columns = useTableColumns([
|
||||||
|
{ prop: 'code', label: this.key('code'), minWidth: 130 },
|
||||||
|
{ prop: 'name', label: this.key('name'), minWidth: 130 },
|
||||||
|
{ prop: 'inspection_attribute', label: this.key('inspection_attribute'), minWidth: 170 },
|
||||||
|
{ prop: 'inspection_unit', label: this.key('inspection_unit'), minWidth: 170 },
|
||||||
|
{ prop: 'note', label: this.key('remark'), minWidth: 130 },
|
||||||
|
{ prop: 'created_at', label: this.key('created_at'), minWidth: 130 },
|
||||||
|
{ prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }
|
||||||
|
])
|
||||||
|
const btns = useTableButtons({
|
||||||
|
toolbar: [
|
||||||
|
{
|
||||||
|
key: 'add',
|
||||||
|
label: this.key('add'),
|
||||||
|
icon: 'el-icon-plus',
|
||||||
|
type: 'primary',
|
||||||
|
auth: '/quality_control/xqc/inspection_item/create',
|
||||||
|
onClick: this.openAdd
|
||||||
|
}
|
||||||
|
],
|
||||||
|
row: [
|
||||||
|
{
|
||||||
|
key: 'edit',
|
||||||
|
label: this.key('edit'),
|
||||||
|
icon: 'el-icon-edit',
|
||||||
|
auth: '/quality_control/xqc/inspection_item/edit',
|
||||||
|
onClick: this.openEdit
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'delete',
|
||||||
|
label: this.key('delete'),
|
||||||
|
icon: 'el-icon-delete',
|
||||||
|
color: 'danger',
|
||||||
|
auth: '/quality_control/xqc/inspection_item/delete',
|
||||||
|
onClick: this.handleDelete
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, this.$permission)
|
||||||
|
this.toolbarButtons = btns.toolbarButtons
|
||||||
|
this.rowButtons = btns.rowButtons
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async fetchData () {
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
...this.search,
|
||||||
|
page_no: this.pagination.current,
|
||||||
|
page_size: this.pagination.size,
|
||||||
|
page: this.pagination.current,
|
||||||
|
size: this.pagination.size
|
||||||
|
}
|
||||||
|
const res = await fetchInspectionItemsList(params)
|
||||||
|
const { list, total } = readList(res)
|
||||||
|
this.tableData = list
|
||||||
|
this.pagination.total = total
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSearch () {
|
||||||
|
this.pagination.current = 1
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
onReset () {
|
||||||
|
this.search = {"code":"","name":""}
|
||||||
|
this.pagination.current = 1
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
onPageChange (page) {
|
||||||
|
this.pagination.current = page.current
|
||||||
|
this.pagination.size = page.size
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
onSelect (rows) {
|
||||||
|
this.selectedRows = rows
|
||||||
|
},
|
||||||
|
resetForm () {
|
||||||
|
this.formData = {"code":"","name":"","inspection_attribute":"","inspection_unit":"","note":""}
|
||||||
|
this.editId = ''
|
||||||
|
},
|
||||||
|
openAdd () {
|
||||||
|
this.handleType = 'create'
|
||||||
|
this.dialogTitle = this.key('add_title')
|
||||||
|
this.resetForm()
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
openEdit (row) {
|
||||||
|
this.handleType = 'edit'
|
||||||
|
this.dialogTitle = this.key('edit_title')
|
||||||
|
this.editId = row.id
|
||||||
|
this.formData = { ...{"code":"","name":"","inspection_attribute":"","inspection_unit":"","note":""}, ...row }
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
async onDialogSubmit () {
|
||||||
|
this.submitting = true
|
||||||
|
try {
|
||||||
|
if (this.handleType === 'create') {
|
||||||
|
await createInspectionItems(this.formData)
|
||||||
|
} else {
|
||||||
|
await editInspectionItems({ ...this.formData, id: this.editId })
|
||||||
|
}
|
||||||
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.fetchData()
|
||||||
|
} finally {
|
||||||
|
this.submitting = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onDialogClose () {
|
||||||
|
this.resetForm()
|
||||||
|
},
|
||||||
|
async handleDelete (row) {
|
||||||
|
const cancelled = await this.$confirmAction({
|
||||||
|
message: this.key('confirm_delete'),
|
||||||
|
title: this.key('tip')
|
||||||
|
}, () => deleteInspectionItems({ id: [row.id], ids: [row.id], inspection_order_no: row.inspection_order_no }))
|
||||||
|
if (cancelled) return
|
||||||
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
|
this.fetchData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.search-bar {
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
.spc-chart-panel {
|
||||||
|
height: 320px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
}
|
||||||
|
/deep/ .el-form-item--mini.el-form-item {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user