Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 1 year ago
commit 4d2d100e68

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询物料检验项目维护列表
export function listCheckTypeProject(query) {
return request({
url: '/quality/checkTypeProject/list',
method: 'get',
params: query
});
}
// 查询物料检验项目维护详细
export function getCheckTypeProject(id) {
return request({
url: '/quality/checkTypeProject/' + id,
method: 'get'
});
}
// 新增物料检验项目维护
export function addCheckTypeProject(data) {
return request({
url: '/quality/checkTypeProject',
method: 'post',
data: data
});
}
// 修改物料检验项目维护
export function updateCheckTypeProject(data) {
return request({
url: '/quality/checkTypeProject',
method: 'put',
data: data
});
}
// 删除物料检验项目维护
export function delCheckTypeProject(id) {
return request({
url: '/quality/checkTypeProject/' + id,
method: 'delete'
});
}

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询物料组列表
export function listMaterialGroup(query) {
return request({
url: '/quality/materialGroup/list',
method: 'get',
params: query
});
}
// 查询物料树
export function materialTreeSelect() {
return request({
url: '/quality/materialGroup/materialTree',
method: 'get'
});
}
// 查询物料组详细
export function getMaterialGroup(id) {
return request({
url: '/quality/materialGroup/' + id,
method: 'get'
});
}
// 新增物料组
export function addMaterialGroup(data) {
return request({
url: '/quality/materialGroup',
method: 'post',
data: data
});
}
// 修改物料组
export function updateMaterialGroup(data) {
return request({
url: '/quality/materialGroup',
method: 'put',
data: data
});
}
// 删除物料组
export function delMaterialGroup(id) {
return request({
url: '/quality/materialGroup/' + id,
method: 'delete'
});
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询物料组成员列表
export function listMaterialGroupDetail(query) {
return request({
url: '/quality/materialGroupDetail/list',
method: 'get',
params: query
});
}
// 查询物料组成员详细
export function getMaterialGroupDetail(id) {
return request({
url: '/quality/materialGroupDetail/' + id,
method: 'get'
});
}
// 新增物料组成员
export function addMaterialGroupDetail(data) {
return request({
url: '/quality/materialGroupDetail',
method: 'post',
data: data
});
}
// 修改物料组成员
export function updateMaterialGroupDetail(data) {
return request({
url: '/quality/materialGroupDetail',
method: 'put',
data: data
});
}
// 删除物料组成员
export function delMaterialGroupDetail(id) {
return request({
url: '/quality/materialGroupDetail/' + id,
method: 'delete'
});
}

@ -312,7 +312,7 @@
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<el-table-column width="180" label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -348,72 +348,76 @@
<el-tabs type="border-card">
<el-tab-pane label="基础信息">
<el-descriptions title="">
<el-descriptions-item label="计划编码">{{this.form.planCode}}</el-descriptions-item>
<el-descriptions-item label="计划名称">{{this.form.planName}}</el-descriptions-item>
<el-descriptions-item label="循环周期">{{this.form.planLoop}}{{this.form.planLoopType}}</el-descriptions-item>
<el-descriptions-item label="工单编码">{{this.form.orderCode}}</el-descriptions-item>
<el-descriptions-item label="车间编码">{{this.form.planWorkshop}}</el-descriptions-item>
<el-descriptions-item label="工作中心">{{this.form.workCenterName}}</el-descriptions-item>
<el-descriptions-item label="计划编码">{{ this.form.planCode }}</el-descriptions-item>
<el-descriptions-item label="计划名称">{{ this.form.planName }}</el-descriptions-item>
<el-descriptions-item label="循环周期">{{ this.form.planLoop }}{{ this.form.planLoopType }}
</el-descriptions-item>
<el-descriptions-item label="工单编码">{{ this.form.orderCode }}</el-descriptions-item>
<el-descriptions-item label="车间编码">{{ this.form.planWorkshop }}</el-descriptions-item>
<el-descriptions-item label="工作中心">{{ this.form.workCenterName }}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="记录">
<!-- 设备 -->
<div v-for="(equ , equIndex) in this.form.equList" :key="equIndex">
<el-row>
<el-col :offset="9" :span="6">
<el-form-item label="设备名称:">
{{ this.form.equ.equipmentName }}
</el-form-item>
</el-col>
</el-row>
<div v-for="(detail,detailIndex) in form.equ.detailList" :key="detailIndex">
<!-- 检查项 -->
<el-row>
<el-col :offset="9" :span="6">
<el-form-item label="设备名称">
{{equ.equipmentName}}
<el-col :span="6">
<el-form-item label="检查项:">
{{ detail.itemName }}
</el-form-item>
</el-col>
</el-row>
<!-- 检查项 -->
<div v-for="(detail,detailIndex) in equ.detailList" :key="detailIndex">
<el-row>
<el-col :span="6">
<el-form-item label="检查项:">
{{detail.itemName}}
</el-form-item>
</el-col>
</el-row>
<!-- 标准 -->
<div v-for="(standard,standardIndex) in detail.standardList" :key="standardIndex">
<el-row v-if="standard.standardType == 'qualitative' ">
<div v-for="(standard,standardIndex) in detail.standardList" :key="standardIndex">
<div v-if="standard.standardType == 'qualitative' ">
<!-- 标准 -->
<el-row>
<el-col :span="6">
<el-form-item label="标准:">
{{standard.standardName}}
{{ standard.standardName }}
</el-form-item>
</el-col>
<el-row>
<el-form-item label="是否达标">
<el-col :span="9">
<el-form-item label="是否达标:">
<el-radio v-model="standard.detailReach" label="0"></el-radio>
<el-radio v-model="standard.detailReach" label="1"></el-radio>
</el-form-item>
</el-row>
</el-col>
</el-row>
<el-row v-else>
<el-col :span="6">
</div>
<div v-else>
<!-- 标准 -->
<el-row>
<el-col :span="5">
<el-form-item label="标准:">
{{standard.standardName}}
{{ standard.standardName }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="50px" label="上限:">
{{standard.detailUpLimit}}
<el-form-item label="上限:">
{{ standard.detailUpLimit }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="50px" label="下限:">
{{standard.detailDownLimit}}
<el-form-item label="下限:">
{{ standard.detailDownLimit }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="50px" label="单位:">
{{standard.detailUnit}}
<el-form-item label="单位:">
{{ standard.detailUnit }}
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="50px" label="实际值:">
<el-input v-model="standard.actualValue" placeholder="请输入值"></el-input>
<el-col :span="6">
<el-form-item label="实际值:">
<el-input v-model="standard.actualValue" placeholder="请输入实际值"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -470,7 +474,7 @@ import {
export default {
name: "DeviceOrder",
dicts: ['device_order_status','device_loop_type'],
dicts: ['device_order_status', 'device_loop_type'],
data() {
return {
//
@ -524,7 +528,9 @@ export default {
updateTime: null
},
//
form: {},
form: {
equ: {equipmentName: null},
},
//
rules: {}
};
@ -577,7 +583,8 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
equ: {equipmentName: null},
};
this.resetForm("form");
},

@ -449,6 +449,7 @@
clearable
v-model="form.workPlanTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划维修时间"
>
</el-date-picker>
@ -460,6 +461,7 @@
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间"
>
</el-date-picker>

@ -42,20 +42,26 @@
/>
</el-form-item>
<el-form-item label="是否委外" prop="workOutsource">
<el-input
v-model="queryParams.workOutsource"
placeholder="请输入是否委外"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select
v-model="queryParams.workOutsource"
placeholder="请选择是否委外"
@change="$forceUpdate()"
clearable
style="width:220px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workOutsourceOption" :key="item.workOutsource" :label="item.label" :value="item.workOutsource"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-input
v-model="queryParams.workDownMachine"
placeholder="请输入是否停机维修"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select
v-model="queryParams.workDownMachine"
placeholder="请选择是否停机"
@change="$forceUpdate()"
clearable
style="width:220px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workDownMachineOption" :key="item.workDownMachine" :label="item.label" :value="item.workDownMachine"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
@ -78,6 +84,7 @@
v-model="queryParams.factoryCode"
placeholder="请输入工厂编码"
clearable
style="width:220px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -142,7 +149,11 @@
<span>{{ parseTime(scope.row.workPlanTime) }}</span>
</template>
</el-table-column>
<el-table-column label="是否停机维修" align="center" prop="workDownMachine" width="180"/>
<el-table-column label="是否停机维修" align="center" prop="workDownMachine" width="180">
<template slot-scope="scope">
{{ scope.row.workDownMachine == "1" ? "停机" : "不停机" }}
</template>
</el-table-column>
<el-table-column label="计划停机时间" align="center" prop="workPlanDownTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workPlanDownTime) }}</span>
@ -150,9 +161,12 @@
</el-table-column>
<el-table-column label="维修人员" align="center" prop="workPerson" />
<el-table-column label="维修组" align="center" prop="workTeam" />
<el-table-column label="是否委外" align="center" prop="workOutsource" />
<el-table-column label="是否委外" align="center" prop="workOutsource" >
<template slot-scope="scope">
{{ scope.row.workOutsource == "1" ? "委外" : "不委外" }}
</template>
</el-table-column>
<el-table-column label="委外工单编码" align="center" prop="outWorkCode" width="180"/>
<el-table-column label="原因分析" align="center" prop="workReason" />
<el-table-column label="故障描述" align="center" prop="workFaultDesc" />
<el-table-column label="维修用时" align="center" prop="workCostTime" width="180">
@ -162,7 +176,7 @@
</el-table-column>
<el-table-column label="维修费用" align="center" prop="workCost" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope">
<el-button
size="mini"
@ -334,6 +348,20 @@ export default {
attr3: null,
factoryCode: null
},
workOutsourceOption: [{
workOutsource: "1",
label: '委外'
}, {
workOutsource: "0",
label: '不委外'
}],
workDownMachineOption: [{
workDownMachine: "1",
label: '停机'
}, {
workDownMachine: "0",
label: '不停机'
}],
//
form: {},
//

@ -0,0 +1,344 @@
<template>
<div>
<el-col :span="4" :xs="24">
<!-- 新增按钮 -->
<el-button class="groupAdd" type="primary" @click="handleAdd"
>新增物料组</el-button>
<div class="head-container">
<el-input
v-model="groupName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="materialOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span>
<el-button
class="btn-tree"
type="text"
size="medium"
@click="() => remove(node, data)">
</el-button>
<el-button
v-if="node.level == 1"
class="btn-tree"
type="text"
size="medium"
@click="() => append(data)">
</el-button>
</span>
</span>
</el-tree>
</div>
</el-col>
<!-- 新增物料组窗口 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="物料组名称" prop="groupName">
<el-input v-model="form.groupName" placeholder="请输入物料组名称" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 新增物料窗口 -->
<!--产品物料选择弹窗-->
<ItemSelectMaterial
ref="itemSelectMaterial"
@onSelected="onSelectMaterial"
></ItemSelectMaterial>
</div>
</template>
<script>
import {
addMaterialGroup,
delMaterialGroup,
updateMaterialGroup,
materialTreeSelect,
} from "@/api/quality/materialGroup";
import {
addMaterialGroupDetail,
listMaterialGroupDetail,
delMaterialGroupDetail,
} from "@/api/quality/materialGroupDetail";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import ItemSelectMaterial from "../qcIncome/selectMaterial.vue";
export default {
name: "MaterialGroupAdd",
comments: { Treeselect},
components: {ItemSelectMaterial},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
materialOptions: undefined,
//
groupName: undefined,
//
materialGroupList: [],
//
nodeData: {},
//
title: "",
materialTitle: "",
//
open: false,
materialOpen: false,
defaultProps: {
children: "children",
label: "label",
isLeaf: "isLeaf",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
groupName: null,
attr1: null,
factoryCode: null,
},
//
form: {},
//
rules: {},
};
},
watch: {
//
groupName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getMaterialTree();
},
methods: {
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
groupName: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
groupId: null,
materialCode: null,
materialName: null,
};
this.resetForm("form");
},
/** 查询部门下拉树结构 */
getMaterialTree() {
materialTreeSelect().then((response) => {
this.materialOptions = response.data;
this.treeInit();
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
treeInit() {
const firstTreeNode = this.materialOptions[0];
firstTreeNode.level = 1;
this.$emit('child-event', firstTreeNode); //
},
//
handleNodeClick(data,node) {
this.nodeData.id = data.id;
this.nodeData.name = data.label;
this.nodeData.level = node.level;
if(node.level == 2) {
listMaterialGroupDetail(this.queryParams).then((response) => {
this.materialGroupList = response.rows;
const temp = this.materialGroupList.find(obj => obj.id === data.id);
console.log(temp.materialCode);
this.nodeData.materialCode = temp.materialCode;
this.$emit('onNodeClick', this.nodeData);
});
}else{
this.$emit('onNodeClick', this.nodeData);
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加物料组";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getMaterialGroup(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改物料组";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateMaterialGroup(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getMaterialTree();
});
} else {
addMaterialGroup(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getMaterialTree();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除物料组编号为"' + ids + '"的数据项?')
.then(function () {
return delMaterialGroup(ids);
})
.then(() => {
this.getMaterialTree();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"quality/materialGroup/export",
{
...this.queryParams,
},
`materialGroup_${new Date().getTime()}.xlsx`
);
},
/**添加树节点 */
append(data) {
this.reset();
this.form.groupId = data.id;
this.$refs.itemSelectMaterial.showFlag = true;
},
/**删除树节点 */
remove(node, data) {
const id = data.id;
console.log(node);
if(node.level == 1) {
this.$modal
.confirm('是否确认删除物料组名称为"' + data.label + '"的数据项?')
.then(function () {
//
return delMaterialGroup(id);
})
.then(() => {
this.getMaterialTree();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}else{
this.$modal
.confirm('是否确认删除物料名称为"' + data.label + '"的数据项?')
.then(function () {
//
return delMaterialGroupDetail(id);
})
.then(() => {
this.getMaterialTree();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
},
//
onSelectMaterial(obj) {
this.form.materialCode = obj.code[0];
this.form.materialName = obj.name[0];
console.log(this.form.groupId);
if(this.form.materialCode != null) {
addMaterialGroupDetail(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getMaterialTree();
});
}
}
},
};
</script>
<style>
.groupAdd {
margin: 10px auto;
width: 100%;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 16px;
font: bolder;
padding-right: 8px;
}
.custom-tree-node .btn-tree {
margin: 0 8px;
font-size: 20px;
font: bolder;
}
</style>

@ -0,0 +1,498 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<MaterialGroupAdd ref="MaterialGroupAdd" @onNodeClick="onNodeClick" @child-event="getCheckTypeList"></MaterialGroupAdd>
<el-col :span="20" :xs="24">
<el-row :gutter="10" class="mb8">
<el-col :span="23" :xs="24">
<el-tabs v-model="editableTabsValue" type="card" @tab-click="handleClick">
<el-tab-pane
:key="item.id"
v-for="(item) in editableTabs"
:label="item.checkName"
:name="item.id"
>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="预留字段1" prop="attr1">
<el-input
v-model="queryParams.attr1"
placeholder="请输入预留字段1"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工厂编码" prop="factoryCode">
<el-input
v-model="queryParams.factoryCode"
placeholder="请输入工厂编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['quality:checkTypeProject:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['quality:checkTypeProject:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">·
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['quality:checkTypeProject:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['quality:checkTypeProject:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="checkTypeProjectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检验规则名称" align="center" prop="ruleName" />
<el-table-column label="标准值" align="center" prop="standardValue" />
<el-table-column label="上差值" align="center" prop="upperDiff" />
<el-table-column label="下差值" align="center" prop="downDiff" />
<el-table-column label="抽样比例" align="center" prop="sample" />
<el-table-column label="抽样数量" align="center" prop="sampleNum" />
<el-table-column
label="是否启用,0是1否"
align="center"
prop="status"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['quality:checkTypeProject:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['quality:checkTypeProject:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改物料检验项目维护对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="规则名称" prop="projectId">
<el-select v-model="form.projectId" @change="handleChange" placeholder="请选择检验规则属性" >
<el-option
v-for="item in checkRuleList"
:key="item.id"
:label="item.ruleName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="抽样比例" prop="sample">
<el-input v-model="form.sample" placeholder="请输入抽样比例" />
</el-form-item>
<el-form-item label="抽样数量" prop="sampleNum">
<el-input v-model="form.sampleNum" placeholder="请输入抽样数量" />
</el-form-item>
<el-form-item label="规则方式" prop="propertyCode">
<el-select v-model="form.propertyCode" disabled placeholder="请选择检验规则属性" >
<el-option
v-for="dict in dict.type.qc_rule_prop"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<div v-if="form.propertyCode === '1'">
<el-form-item label="标准值" prop="standardValue">
<el-input v-model="form.standardValue" placeholder="请输入标准值" />
</el-form-item>
<el-form-item label="上差值" prop="upperDiff">
<el-input v-model="form.upperDiff" placeholder="请输入上差值" />
</el-form-item>
<el-form-item label="下差值" prop="downDiff">
<el-input v-model="form.downDiff" placeholder="请输入下差值" />
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listCheckTypeProject,
getCheckTypeProject,
delCheckTypeProject,
addCheckTypeProject,
updateCheckTypeProject,
} from "@/api/quality/checkTypeProject";
import MaterialGroupAdd from "./MaterialGroupAdd.vue";
import {listCheckType} from "@/api/quality/checkType";
import {listProject} from "@/api/quality/project";
export default {
name: "CheckTypeProject",
dicts: ["qc_rule_prop"],
components: {MaterialGroupAdd,},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
groupId: null,
materialCode: null,
//
total: 0,
//
checkTypeProjectList: [],
checkRuleList: [],
//
title: "",
//
open: false,
editableTabsValue: '',
editableTabs: [/* {
title: 'Tab 1',
name: '1',
content: 'Tab 1 content'
}, {
title: 'Tab 2',
name: '2',
content: 'Tab 2 content'
} */],
tabIndex: null,
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: null,
ruleName: null,
typeId: null,
standardValue: null,
upperDiff: null,
downDiff: null,
sample: null,
sampleNum: null,
status: null,
attr1: null,
factoryCode: null,
groupName: null,
groupId: null,
materialCode: null,
},
//
form: {},
//
rules: {
projectId: [
{ required: true, message: "检验项目id不能为空", trigger: "blur" },
],
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" },
],
},
};
},
created() {
//this.getList();
},
methods: {
/** 查询物料检验项目维护列表 */
getList() {
this.loading = true;
console.log(this.queryParams);
listCheckTypeProject(this.queryParams).then((response) => {
this.checkTypeProjectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/**初始化表格信息 */
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
projectId: null,
ruleName: null,
propertyCode: null,
typeId: null,
standardValue: null,
upperDiff: null,
downDiff: null,
sample: null,
sampleNum: null,
status: null,
attr1: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null,
delFlag: null,
groupId: null,
materialCode: null,
projectNo: null,
};
this.resetForm("form");
},
/**物料树点击 */
onNodeClick(obj) {
if(obj.level == 1) {
this.queryParams.groupId = obj.id;
this.groupId = obj.id;
this.queryParams.materialCode = null;
this.materialCode = null;
}else{
this.queryParams.materialCode = obj.materialCode;
this.materialCode = obj.materialCode;
this.queryParams.groupId = null;
this.groupId = null;
}
this.queryParams.typeId = this.editableTabsValue;
this.handleQuery();
},
/**获取检测节点*/
getCheckTypeList(obj) {
listCheckType().then((response) => {
this.editableTabs = response.rows;
this.editableTabsValue = response.rows[0].id;
this.tabIndex = response.rows.length;
this.queryParams.groupId = obj.id;
this.queryParams.typeId = this.editableTabsValue;
this.getList();
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/**检验规则改变事件 */
handleChange() {
const obj = this.checkRuleList.find(obj => obj.id === this.form.projectId);
console.log(obj);
this.form.propertyCode = obj.propertyCode;
this.form.standardValue = obj.checkStandard;
this.form.projectNo = obj.orderNum;
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加物料检验项目维护";
this.form.groupId = this.groupId;
this.form.materialCode = this.materialCode;
this.form.typeId = this.editableTabsValue;
listProject().then((response) => {
this.checkRuleList = response.rows;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getCheckTypeProject(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改物料检验项目维护";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateCheckTypeProject(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCheckTypeProject(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除物料检验项目维护编码为"' + ids + '"的数据项?')
.then(function () {
return delCheckTypeProject(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"quality/checkTypeProject/export",
{
...this.queryParams,
},
`checkTypeProject_${new Date().getTime()}.xlsx`
);
},
/**标签编辑事件 */
handleTabsEdit(targetName, action) {
if (action === 'add') {
let newTabName = ++this.tabIndex + '';
this.editableTabs.push({
title: 'New Tab',
name: newTabName,
content: 'New Tab content'
});
this.editableTabsValue = newTabName;
}
if (action === 'remove') {
let tabs = this.editableTabs;
let activeName = this.editableTabsValue;
if (activeName === targetName) {
tabs.forEach((tab, index) => {
if (tab.name === targetName) {
let nextTab = tabs[index + 1] || tabs[index - 1];
if (nextTab) {
activeName = nextTab.name;
}
}
});
}
this.editableTabsValue = activeName;
this.editableTabs = tabs.filter(tab => tab.name !== targetName);
}
},
/**标签点击事件 */
handleClick(tab, event) {
this.queryParams.typeId = tab.name;
this.handleQuery();
},
},
};
</script>

@ -88,7 +88,7 @@
</el-form>
<el-tabs type="border-card" v-if="form.userCodes != null">
<el-tab-pane label="关联物料">
<Userbind v-if="form.userCodes !=null" :optType="optType" :userCodes="form.userCodes"></Userbind>
<UserBind v-if="form.userCodes !=null" :optType="optType" :userCodes="form.userCodes"></UserBind>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
@ -101,7 +101,7 @@
<script>
import { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/quality/material";
import Userbind from "./userbind.vue";
import Userbind from "./UserBind.vue";
export default {
name: "Material",

@ -92,7 +92,7 @@
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检验规则编号" align="center" type="index" width="100"/>
<el-table-column label="检验规则编号" align="center" prop="orderNum" width="100"/>
<el-table-column label="检验规则名称" align="center" prop="ruleName" />
<el-table-column label="检验规则属性" align="center" prop="propertyCode" >
<template slot-scope="scope">

Loading…
Cancel
Save