add:新增质检基础模块
This commit is contained in:
@@ -101,9 +101,9 @@
|
||||
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" label="路由地址" prop="path">
|
||||
<el-input v-model="form.path" placeholder="路由地址" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序" prop="menuSort">
|
||||
<el-form-item label="菜单排序" prop="menu_sort">
|
||||
<el-input-number
|
||||
v-model.number="form.menuSort"
|
||||
v-model.number="form.menu_sort"
|
||||
:min="0"
|
||||
:max="999"
|
||||
controls-position="right"
|
||||
@@ -160,9 +160,9 @@
|
||||
<svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="menuSort" align="center" label="排序" :min-width="flexWidth('menuSort',crud.data,'排序')">
|
||||
<el-table-column prop="menu_sort" align="center" label="排序" :min-width="flexWidth('menu_sort',crud.data,'排序')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.menuSort }}
|
||||
{{ scope.row.menu_sort }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="permission" label="权限标识" :min-width="flexWidth('permission',crud.data,'权限标识')" />
|
||||
@@ -221,7 +221,7 @@ import Dict from '../../../components/Dict/Dict'
|
||||
const defaultForm = {
|
||||
menu_id: null,
|
||||
title: null,
|
||||
menuSort: 999,
|
||||
menu_sort: 999,
|
||||
path: null,
|
||||
systemType: null,
|
||||
category: null,
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
placeholder="项点编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项点类别">
|
||||
<el-select
|
||||
v-model="query.inspection_item_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="项点类别"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QL_TEST_POINTTYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="检测方式">
|
||||
<el-select
|
||||
v-model="query.inspection_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="检测方式"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view"
|
||||
:title="crud.status.title"
|
||||
width="800px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点编码" prop="inspection_item_code">
|
||||
<el-input v-model.trim="form.inspection_item_code" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点名称" prop="inspection_item_name">
|
||||
<el-input v-model.trim="form.inspection_item_name" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项点类别" prop="inspection_item_type">
|
||||
<el-select
|
||||
v-model="form.inspection_item_type"
|
||||
size="mini"
|
||||
placeholder="项点类别"
|
||||
class="filter-item"
|
||||
style="width: 280px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QL_TEST_POINTTYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检验方式" prop="inspection_type">
|
||||
<el-radio-group v-model="form.inspection_type">
|
||||
<el-radio v-for="item in dict.QC_INSPECTION_TYPE" :label="item.value">{{ item.label }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属工序" prop="workprocedure_uuid">
|
||||
<el-select
|
||||
v-model="form.workprocedure_uuid"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
style="width: 280px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in workProcedureList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
style="width: 280px;"
|
||||
clearable
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_uuid=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_uuid">
|
||||
<el-input v-model.trim="form.material_uuid" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="临界值备注显示" prop="is_limit_remark" label-width="auto">
|
||||
<el-switch v-model="form.is_limit_remark" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model.trim="form.remark" style="width: 380px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_item_id" label="项点标识" />
|
||||
<el-table-column v-if="false" prop="material_uuid" label="物料标识" />
|
||||
<el-table-column v-if="false" prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="inspection_item_code" label="项点编码" />
|
||||
<el-table-column prop="inspection_item_name" label="项点名称" />
|
||||
<el-table-column prop="inspection_item_type_name" label="项点类别" />
|
||||
<el-table-column prop="workprocedure_name" label="工序名称" />
|
||||
<el-table-column prop="inspection_type_name" label="检验方式" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column v-if="false" prop="is_limit_remark" label="是否临界值填充备注" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaterDtl :dialog-show.sync="materShow" :dialog-matertype="materType" @tableChanged2="tableChanged2" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspectionItemPoint from '@/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_item_id: null,
|
||||
inspection_item_code: null,
|
||||
inspection_item_name: null,
|
||||
inspection_item_type: null,
|
||||
workprocedure_uuid: null,
|
||||
workprocedure_code: null,
|
||||
workprocedure_name: null,
|
||||
inspection_type: '02',
|
||||
material_uuid: null,
|
||||
material_name: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
is_limit_remark: null
|
||||
}
|
||||
export default {
|
||||
name: 'InspectionItemPoint',
|
||||
dicts: ['QL_TEST_POINTTYPE', 'QC_INSPECTION_TYPE'],
|
||||
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDtl },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '检验项点',
|
||||
url: 'api/inspectionItemPoint',
|
||||
idField: 'inspection_item_id',
|
||||
sort: 'inspection_item_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudInspectionItemPoint }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
workProcedureList: [],
|
||||
materShow: false,
|
||||
materType: '',
|
||||
permission: {},
|
||||
rules: {
|
||||
inspection_item_id: [
|
||||
{ required: true, message: '项点标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_code: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_type: [
|
||||
{ required: true, message: '项点类别不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_type: [
|
||||
{ required: true, message: '检验方式不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudWorkProcedure.downSelect().then(res => {
|
||||
this.workProcedureList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
tableChanged2(row) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_uuid = row.material_id
|
||||
this.form.material_name = row.material_name
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/inspectionItemPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inspectionItemPoint',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inspectionItemPoint',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="添加检测项"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="输入项点编、名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-select
|
||||
v-model="query.inspection_item_type"
|
||||
disabled
|
||||
size="mini"
|
||||
placeholder="项点类别"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QL_TEST_POINTTYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_item_id" label="项点标识" />
|
||||
<el-table-column prop="inspection_item_code" label="项点编码" />
|
||||
<el-table-column prop="inspection_item_name" label="项点名称" />
|
||||
<el-table-column prop="inspection_item_type_name" label="项点类别" />
|
||||
<el-table-column prop="workprocedure_name" label="工序" />
|
||||
<el-table-column prop="inspection_type_name" label="检测方式" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
import crudInspectionItemPoint from '@/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint'
|
||||
|
||||
export default {
|
||||
name: 'ItemDialog',
|
||||
dicts: ['QL_TEST_POINTTYPE'],
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/inspectionItemPoint', crudMethod: { ...crudInspectionItemPoint }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
inspectionItemType: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
checkrow: [],
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
inspectionItemType: {
|
||||
handler(newValue, oldValue) {
|
||||
this.crud.query.inspection_item_type = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
open() {
|
||||
this.crud.query.inspection_item_type = this.$parent.inspectionItemType
|
||||
this.crud.toQuery()
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
/* if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}*/
|
||||
this.checkrow = val
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('至少选择一项1')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged2', this.checkrow)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="新增检测项"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="openParam" class="demo-form-inline">
|
||||
<el-form-item label="方案编码">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_name" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="明细项数">
|
||||
<el-input v-model.trim="tableData.length" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-plus" type="primary" @click="itemDialogVisible=true">添加项点</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-check" type="success" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="'02'===$parent.inspection_item_type"
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
<el-table-column prop="order_index" label="顺序号">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="tableData[scope.$index].order_index"
|
||||
size="mini"
|
||||
type="number"
|
||||
class="edit-input"
|
||||
style="width: 100px"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>-->
|
||||
</el-dialog>
|
||||
<ItemDialog
|
||||
:dialog-show.sync="itemDialogVisible"
|
||||
:inspection-item-type="inspectionItemType"
|
||||
:open-param="openParam"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import ItemDialog from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog'
|
||||
import crudInspectionSchemeMst from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/inspectionSchemeMst'
|
||||
|
||||
export default {
|
||||
name: 'SetDialog',
|
||||
mixins: [crud()],
|
||||
components: { ItemDialog },
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object,
|
||||
default: () => { return {} }
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemDialogVisible: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null,
|
||||
cols: [],
|
||||
tableData: [],
|
||||
formData: {
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableData = newValue
|
||||
}
|
||||
},
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
if (newValue) {
|
||||
this.inspectionItemType = this.$parent.inspection_item_type
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
/* const param = {
|
||||
inspection_item_type: this.$parent.inspection_item_type,
|
||||
inspection_scheme_id: this.openParam.inspection_scheme_id
|
||||
}
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl(param).then(res => {
|
||||
this.tableData = res
|
||||
})*/
|
||||
},
|
||||
tableChanged2: function(rows) {
|
||||
// 判断项点是否已存在
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.tableData.forEach((row) => {
|
||||
// 对新增的行进行校验不能存在相同项点
|
||||
if (row.inspection_item_id === item.inspection_item_id) {
|
||||
same_mater = false
|
||||
return false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
this.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.tableData.splice(index, 1)
|
||||
},
|
||||
onSubmit: function() {
|
||||
this.openParam.inspection_item_type = this.$parent.inspection_item_type
|
||||
const param = {
|
||||
formData: this.openParam,
|
||||
tableData: this.tableData
|
||||
}
|
||||
crudInspectionSchemeMst.saveInspectionSchemeDtl(param).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.$parent.hand()
|
||||
this.close()
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="新增检测项"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="openParam" class="demo-form-inline">
|
||||
<el-form-item label="方案编码">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称">
|
||||
<el-input v-model.trim="openParam.inspection_scheme_name" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案类别">
|
||||
<el-select
|
||||
v-model="openParam.inspection_scheme_type"
|
||||
disabled
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
visiable1: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
},
|
||||
openArray: {
|
||||
type: Array,
|
||||
default: () => { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemDialogVisible: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null,
|
||||
cols: [],
|
||||
tableData: [],
|
||||
formData: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openArray: {
|
||||
handler(newValue) {
|
||||
this.tableData = newValue
|
||||
}
|
||||
},
|
||||
visiable1: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
if (newValue) {
|
||||
// this.inspectionItemType = this.$parent.inspection_item_type
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// const param = {
|
||||
// inspection_scheme_id: this.openParam.inspection_scheme_id
|
||||
// }
|
||||
// crudInspectionSchemeMst.getInspectionSchemeDtl(param).then(res => {
|
||||
// this.tableData = res
|
||||
// })
|
||||
},
|
||||
close() {
|
||||
this.tableData = []
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
clearable
|
||||
placeholder="方案编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="方案类别">
|
||||
<el-select
|
||||
v-model="query.inspection_scheme_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="maintenance('01',crud.selections[0])"
|
||||
>
|
||||
质保项维护
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="info"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="maintenance('02',crud.selections[0])"
|
||||
>
|
||||
工序自检项
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
size="mini"
|
||||
@click="maintenance('03',crud.selections[0])"
|
||||
>
|
||||
理化项维护
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="方案编码" prop="inspection_scheme_code">
|
||||
<el-input v-model.trim="form.inspection_scheme_code" style="width: 370px;" :disabled="true" placeholder="系统生成" />
|
||||
</el-form-item>
|
||||
<el-form-item label="方案名称" prop="inspection_scheme_name">
|
||||
<el-input v-model.trim="form.inspection_scheme_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案类别" prop="inspection_scheme_type">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_type"
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
style="width: 370px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model.trim="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_scheme_id" label="检验方案标识" />
|
||||
<el-table-column prop="inspection_scheme_code" label="方案编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="view(scope.row)">{{ scope.row.inspection_scheme_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspection_scheme_name" label="方案名称" />
|
||||
<el-table-column prop="inspection_scheme_type" label="方案类别" :formatter="format_inspection_scheme_type" />
|
||||
<el-table-column prop="factory_qty" label="质保项数" />
|
||||
<el-table-column prop="workprocedure_qty" label="自检项数" />
|
||||
<el-table-column prop="physical_qty" label="理化项数" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-if="false" prop="is_used" label="是否启用" />
|
||||
<el-table-column prop="update_optname" label="修改人" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<MaintenanceDialog :dialog-show.sync="maintenanceShow" :open-param="openParam" :open-array="openArray" />
|
||||
<ViewDialog :visiable1.sync="visiable1" :open-param="openParam" :open-array="openArray" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudInspectionSchemeMst from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/inspectionSchemeMst'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import MaintenanceDialog from './MaintenanceDialog'
|
||||
import ViewDialog from './ViewDialog'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_scheme_id: null,
|
||||
inspection_scheme_code: '',
|
||||
inspection_scheme_name: null,
|
||||
inspection_scheme_type: null,
|
||||
factory_qty: null,
|
||||
workprocedure_qty: null,
|
||||
physical_qty: null,
|
||||
remark: null,
|
||||
is_used: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null
|
||||
}
|
||||
export default {
|
||||
name: 'InspectionSchemeMst',
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaintenanceDialog, ViewDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '检测方案',
|
||||
url: 'api/inspectionSchemeMst',
|
||||
idField: 'inspection_scheme_id',
|
||||
sort: 'inspection_scheme_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudInspectionSchemeMst }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
openParam: {},
|
||||
maintenanceShow: false,
|
||||
visiable1: false,
|
||||
openArray: [],
|
||||
inspection_item_type: null,
|
||||
permission: {},
|
||||
rules: {
|
||||
inspection_scheme_name: [
|
||||
{ required: true, message: '检验方案名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_scheme_type: [
|
||||
{ required: true, message: '检验方案类别不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
view(row) {
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl({ inspection_scheme_id: row.inspection_scheme_id }).then(res => {
|
||||
this.openArray = res
|
||||
this.visiable1 = true
|
||||
this.openParam = row
|
||||
})
|
||||
},
|
||||
format_inspection_scheme_type(row, column) {
|
||||
return this.dict.label.QC_INSPECTION_SCHEME_TYPE[row.inspection_scheme_type]
|
||||
},
|
||||
maintenance(type, data) {
|
||||
crudInspectionSchemeMst.getInspectionSchemeDtl({ inspection_scheme_id: data.inspection_scheme_id, inspection_item_type: type }).then(res => {
|
||||
this.openArray = res
|
||||
this.inspection_item_type = type
|
||||
this.openParam = data
|
||||
this.maintenanceShow = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveInspectionSchemeDtl(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/saveInspectionSchemeDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionSchemeDtl(data) {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/getInspectionSchemeDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function selectList() {
|
||||
return request({
|
||||
url: 'api/inspectionSchemeMst/selectList'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, saveInspectionSchemeDtl, getInspectionSchemeDtl, selectList }
|
||||
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="物料检测方案设置"
|
||||
append-to-body
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
fullscreen
|
||||
destroy-on-close
|
||||
:before-close="crud.cancelCU"
|
||||
@open="open"
|
||||
>
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
|
||||
<el-form-item label="物料" prop="material_name">
|
||||
<el-input
|
||||
v-model="form.material_name"
|
||||
style="width: 280px;"
|
||||
placeholder="请选择物料"
|
||||
clearable
|
||||
prefix-icon="el-icon-search"
|
||||
@focus="materShow=true"
|
||||
@clear="form.material_id=''"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料" prop="material_id">
|
||||
<el-input v-model.trim="form.material_id" style="width: 280px;" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="方案名称">
|
||||
<el-select
|
||||
v-model="form.inspection_scheme_id"
|
||||
filterable
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案名称"
|
||||
class="filter-item"
|
||||
@change="handDtl"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in selectList"
|
||||
:label="item.inspection_scheme_name"
|
||||
:value="item.inspection_scheme_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-check" type="success" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-error" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
:data="form.tableData"
|
||||
border
|
||||
size="mini"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="false"
|
||||
prop="inspection_item_id"
|
||||
label="项点标识"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="order_index"
|
||||
width="60"
|
||||
label="序号"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inspection_item_code"
|
||||
label="项点编码"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_name"
|
||||
show-overflow-tooltip
|
||||
label="项点名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_item_type_name"
|
||||
label="项点类别"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="workprocedure_name"
|
||||
label="工序名称"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="inspection_type_name"
|
||||
label="检测方式"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="down_limit"
|
||||
label="合格下限(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit"
|
||||
label="合格上限(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="down_limit_value"
|
||||
label="下限临界值(≤)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].down_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="up_limit_value"
|
||||
label="上限临界值(≥)"
|
||||
width="155"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="form.tableData[scope.$index].inspection_type==='02'"
|
||||
v-model="form.tableData[scope.$index].up_limit_value"
|
||||
:precision="4"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model.trim="form.tableData[scope.$index].remark" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>-->
|
||||
</el-dialog>
|
||||
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="true"
|
||||
:mater-opt-code="'00'"
|
||||
@tableChanged2="tableChanged2"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import crudInspectionSchemeMst from '@/views/wms/masterdata_manage/ql/inspectionSchemeMst/inspectionSchemeMst'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudProductStandard from '@/views/wms/masterdata_manage/ql/productStandard/productStandard'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: '',
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
inspection_scheme_id: '',
|
||||
tableData: []
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectList: [],
|
||||
materShow: false,
|
||||
dialogVisible: false,
|
||||
inspectionItemType: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudInspectionSchemeMst.selectList().then(res => {
|
||||
this.selectList = res
|
||||
})
|
||||
this.handDtl2()
|
||||
},
|
||||
handDtl2() { // 修改的时候有物料标识
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id,
|
||||
material_id: this.form.material_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
handDtl() {
|
||||
const param = {
|
||||
inspection_scheme_id: this.form.inspection_scheme_id
|
||||
}
|
||||
crudProductStandard.getInspectionSchemeDtl(param).then(res => {
|
||||
const map1 = res.map(function(item) {
|
||||
if (!item.down_limit_value) item.down_limit_value = undefined
|
||||
if (!item.up_limit_value) item.up_limit_value = undefined
|
||||
if (!item.down_limit) item.down_limit = undefined
|
||||
if (!item.up_limit) item.up_limit = undefined
|
||||
return item
|
||||
})
|
||||
this.form.tableData = map1
|
||||
})
|
||||
},
|
||||
hand() {
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
let optType = null
|
||||
|
||||
const isCopyAdd = this.$parent.isCopyAdd
|
||||
debugger
|
||||
if (isCopyAdd === '1') {
|
||||
optType = '01' // 复制新增
|
||||
} else if (this.crud.status.add === 1) {
|
||||
optType = '02' // 新增
|
||||
} else {
|
||||
this.crud.status.add
|
||||
optType = '03' // 修改
|
||||
}
|
||||
// 判断是新增还是修改还是复制新增
|
||||
this.form.optType = optType
|
||||
const arr = this.form.tableData
|
||||
const that = this
|
||||
const errMsgList = []
|
||||
const data = arr.map(function(item) {
|
||||
debugger
|
||||
// 合格上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit) && !isNaN(item.down_limit)) || (isNaN(item.up_limit) && isNaN(item.down_limit))) {
|
||||
// 临界上下限同时为填入的数字或同时为空
|
||||
if ((!isNaN(item.up_limit_value) && !isNaN(item.down_limit_value)) || (isNaN(item.up_limit_value) && isNaN(item.down_limit_value))) {
|
||||
if (isNaN(item.up_limit) && !isNaN(item.up_limit_value)) {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
return item
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
}
|
||||
} else {
|
||||
errMsgList.push(item.order_index)
|
||||
return item
|
||||
}
|
||||
})
|
||||
if (errMsgList.length > 0) {
|
||||
that.crud.notify(errMsgList.toString() + '行格式错误,请检查!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
|
||||
this.form.tableData = data
|
||||
crudProductStandard.saveData(this.form).then(res => {
|
||||
this.crud.cancelCU()
|
||||
this.$parent.isCopyAdd = null
|
||||
this.crud.toQuery()
|
||||
this.notify('操作成功', 'success')
|
||||
})
|
||||
},
|
||||
notify(title, type) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
type: type,
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
tableChanged2(data) {
|
||||
// 新增一行物料时,给行进行赋值
|
||||
this.form.material_id = data.material_id
|
||||
this.form.material_code = data.material_code
|
||||
this.form.material_name = data.material_name + '##' + data.material_code
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:visiable1', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: 1px solid #e5e6e7;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="方案">
|
||||
<el-input
|
||||
v-model="query.inspection_scheme_name"
|
||||
clearable
|
||||
placeholder="方案编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_name"
|
||||
clearable
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="方案类别">
|
||||
<el-select
|
||||
v-model="query.inspection_scheme_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="方案类别"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INSPECTION_SCHEME_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="copyAdd(crud.selections[0])"
|
||||
>
|
||||
复制新增
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_standard_dtl_id" label="检验方案明细标准标识" />
|
||||
<el-table-column v-if="false" prop="material_uuid" label="物料标识" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="200" show-tooltip-when-overflow />
|
||||
<el-table-column prop="material_name" label="物料名称" width="200" show-tooltip-when-overflow />
|
||||
<el-table-column prop="inspection_scheme_code" label="方案编码" />
|
||||
<el-table-column prop="inspection_scheme_name" label="方案名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="inspection_scheme_type_name" label="方案类别" />
|
||||
<el-table-column prop="zb_num" label="质保项数" />
|
||||
<el-table-column prop="zj_num" label="质检项数" />
|
||||
<el-table-column prop="lh_num" label="理化项数" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<AddDialog :visiable1.sync="visiable1" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudProductStandard from '@/views/wms/masterdata_manage/ql/productStandard/productStandard'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import AddDialog from './AddDialog'
|
||||
|
||||
const defaultForm = {
|
||||
inspection_standard_dtl_id: null,
|
||||
material_uuid: null,
|
||||
inspection_scheme_id: null,
|
||||
inspection_scheme_code: null,
|
||||
inspection_scheme_name: null,
|
||||
inspection_item_id: null,
|
||||
inspection_item_code: null,
|
||||
inspection_item_name: null,
|
||||
up_limit: null,
|
||||
down_limit: null,
|
||||
up_limit_value: null,
|
||||
down_limit_value: null,
|
||||
remark: null
|
||||
}
|
||||
export default {
|
||||
name: 'ProductStandard',
|
||||
dicts: ['QC_INSPECTION_SCHEME_TYPE'],
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '产品方案标准',
|
||||
url: 'api/productStandard',
|
||||
idField: 'inspection_standard_dtl_id',
|
||||
sort: 'inspection_standard_dtl_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudProductStandard }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isCopyAdd: null,
|
||||
visiable1: false,
|
||||
permission: {},
|
||||
rules: {
|
||||
inspection_standard_dtl_id: [
|
||||
{ required: true, message: '检验方案明细标准标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_scheme_id: [
|
||||
{ required: true, message: '检验方案标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_scheme_code: [
|
||||
{ required: true, message: '检验方案编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_scheme_name: [
|
||||
{ required: true, message: '检验方案名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_id: [
|
||||
{ required: true, message: '项点标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_code: [
|
||||
{ required: true, message: '项点编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
inspection_item_name: [
|
||||
{ required: true, message: '项点名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
up_limit: [
|
||||
{ required: true, message: '合格上限不能为空', trigger: 'blur' }
|
||||
],
|
||||
down_limit: [
|
||||
{ required: true, message: '合格下限不能为空', trigger: 'blur' }
|
||||
],
|
||||
up_limit_value: [
|
||||
{ required: true, message: '上限临界值不能为空', trigger: 'blur' }
|
||||
],
|
||||
down_limit_value: [
|
||||
{ required: true, message: '下限临界值不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
copyAdd(data) {
|
||||
this.isCopyAdd = '1'
|
||||
this.crud.toEdit(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/productStandard',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/productStandard/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/productStandard',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function saveData(data) {
|
||||
return request({
|
||||
url: 'api/productStandard/saveData',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function copyAdd(data) {
|
||||
return request({
|
||||
url: 'api/productStandard/copyAdd',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getInspectionSchemeDtl(data) {
|
||||
return request({
|
||||
url: 'api/productStandard/getInspectionSchemeDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, saveData, copyAdd,getInspectionSchemeDtl }
|
||||
Reference in New Issue
Block a user