质量检验项目管理修改

yangwl
zhaoxiaolin 12 months ago
parent 6e58ab4272
commit 09ff616804

@ -42,3 +42,16 @@ export function delCheckTypeProject(id) {
method: 'delete' method: 'delete'
}); });
} }
//更改状态
export function changeStatus(id,status) {
const data = {
id,
status
}
return request({
url: '/quality/checkTypeProject/changeStatus',
method: 'put',
data: data
});
}

@ -106,17 +106,26 @@
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="检验规则名称" align="center" prop="ruleName" /> <el-table-column label="检验规则名称" align="center" prop="ruleName" />
<el-table-column label="标准值" align="center" prop="standardValue" /> <el-table-column label="标准值" align="left" prop="standardValue" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="上差值" align="center" prop="upperDiff" /> <el-table-column label="上差值" align="left" prop="upperDiff" />
<el-table-column label="下差值" align="center" prop="downDiff" /> <el-table-column label="下差值" align="left" prop="downDiff" />
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="抽样比例" align="center" prop="sample" /> <el-table-column label="抽样比例" align="left" prop="sample" />
<el-table-column label="抽样数量" align="center" prop="sampleNum" /> <el-table-column label="抽样数量" align="left" prop="sampleNum" />
<el-table-column <el-table-column
label="是否启用" label="是否启用"
align="center" align="center"
prop="status" prop="status"
/> >
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
@ -192,8 +201,20 @@
<el-form-item label="下差值" prop="downDiff"> <el-form-item label="下差值" prop="downDiff">
<el-input v-model="form.downDiff" placeholder="请输入下差值" /> <el-input v-model="form.downDiff" placeholder="请输入下差值" />
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="unit">
<el-select v-model="form.unit" placeholder="请选择单位" >
<el-option
v-for="dict in dict.type.unit"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</div> </div>
<el-form-item label="排序" prop="sort">
<el-input type="number" v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -210,6 +231,7 @@ import {
delCheckTypeProject, delCheckTypeProject,
addCheckTypeProject, addCheckTypeProject,
updateCheckTypeProject, updateCheckTypeProject,
changeStatus
} from "@/api/quality/checkTypeProject"; } from "@/api/quality/checkTypeProject";
import MaterialGroupAdd from "./MaterialGroupAdd.vue"; import MaterialGroupAdd from "./MaterialGroupAdd.vue";
import {listCheckType} from "@/api/quality/checkType"; import {listCheckType} from "@/api/quality/checkType";
@ -217,7 +239,7 @@ import {listProject} from "@/api/quality/project";
export default { export default {
name: "CheckTypeProject", name: "CheckTypeProject",
dicts: ["qc_rule_prop"], dicts: ["qc_rule_prop",'unit'],
components: {MaterialGroupAdd,}, components: {MaterialGroupAdd,},
data() { data() {
return { return {
@ -283,9 +305,15 @@ export default {
}; };
}, },
created() { created() {
//this.getList(); this.getProjectList();
}, },
methods: { methods: {
/**获取检测项目列表**/
getProjectList(){
listProject().then((response) => {
this.checkRuleList = response.rows;
});
},
/** 查询物料检验项目维护列表 */ /** 查询物料检验项目维护列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -376,6 +404,7 @@ export default {
this.form.propertyCode = obj.propertyCode; this.form.propertyCode = obj.propertyCode;
this.form.standardValue = obj.checkStandard; this.form.standardValue = obj.checkStandard;
this.form.projectNo = obj.orderNum; this.form.projectNo = obj.orderNum;
this.form.unit = obj.unitCode;
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -391,13 +420,11 @@ export default {
this.form.groupId = this.groupId; this.form.groupId = this.groupId;
this.form.materialCode = this.materialCode; this.form.materialCode = this.materialCode;
this.form.typeId = this.editableTabsValue; this.form.typeId = this.editableTabsValue;
listProject().then((response) => {
this.checkRuleList = response.rows;
});
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids; const id = row.id || this.ids;
getCheckTypeProject(id).then((response) => { getCheckTypeProject(id).then((response) => {
this.form = response.data; this.form = response.data;
@ -483,6 +510,21 @@ export default {
this.queryParams.typeId = tab.name; this.queryParams.typeId = tab.name;
this.handleQuery(); this.handleQuery();
}, },
//
handleStatusChange(row) {
let text = row.status === "1" ? "启用" : "停用";
this.$modal
.confirm('确认要"' + text + '""' + row.id + '"检测项吗?')
.then(function () {
return changeStatus(row.id, row.status);
})
.then(() => {
this.$modal.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
},
}, },
}; };
</script> </script>

@ -44,7 +44,6 @@
<el-table-column label="姓名" align="center" prop="userName" /> <el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="联系方式" align="center" prop="phonenumber" /> <el-table-column label="联系方式" align="center" prop="phonenumber" />
<el-table-column label="邮箱" align="center" prop="email" /> <el-table-column label="邮箱" align="center" prop="email" />
<el-table-column label="绑定的检验物料" align="center" prop="materialNames" width="400" />
<el-table-column label="状态" align="center" prop="status" > <el-table-column label="状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
@ -85,7 +84,7 @@
</el-form> </el-form>
<el-tabs type="border-card" v-if="form.userCodes != null"> <el-tabs type="border-card" v-if="form.userCodes != null">
<el-tab-pane label="关联物料"> <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-tab-pane>
</el-tabs> </el-tabs>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">

@ -1,90 +1,114 @@
<template> <template>
<div> <div>
<el-input placeholder="请输入内容" clearable > </el-input> <div class="query">
<el-transfer v-model="rightList" :data="leftList" :titles="titles" <el-input
:filterable=false style="width: 351px; margin-bottom: 10px"
@change="handleChange" v-model="leftQueryParams.materialName"
> placeholder="请输入内容"
<!-- 左侧栏分页 --> clearable
<el-button @keyup.enter.native="handleQuery"
type="text" />
style="color:#606266" <el-input
v-if="leftLength != 0" style="width: 351px; margin-bottom: 10px"
class="transfer-footer" v-model="rightQueryParams.materialName"
slot="left-footer" placeholder="请输入内容"
size="small" clearable
>{{ Ltotal }}</el-button> @keyup.enter.native="handleQuery"
<el-button />
v-if="leftLength != 0" </div>
class="transfer-footer"
slot="left-footer"
size="small"
@click="leftPageNumChange"
:disabled="LPageNum - 1 < 1"
>上一页</el-button>
<el-input
v-if="leftLength != 0"
v-model="LPageNum"
size="mini"
class="transfer-footer"
slot="left-footer"
:placeholder="LPageNum"
style="width: 67px;padding: 1px 3px"
disabled
></el-input>
<el-button
class="transfer-footer"
slot="left-footer"
size="small"
@click="leftAddPageNumChange"
v-if="leftLength != 0"
:disabled="LNextPage>LPages"
>下一页</el-button>
<!-- 右侧栏分页 --> <el-transfer
<el-button v-model="rightList"
type="text" :data="leftList"
style="color:#606266" :titles="titles"
v-if="rightLength != 0" :filterable="true"
class="transfer-footer" @change="handleChange"
slot="right-footer" >
size="small" <!-- 左侧栏分页 -->
>{{ Rtotal }}</el-button> <el-button
<el-button type="text"
v-if="rightLength != 0" style="color: #606266"
class="transfer-footer" v-if="leftLength != 0"
slot="right-footer" class="transfer-footer"
size="small" slot="left-footer"
@click="rightPageNumChange" size="small"
:disabled="RPageNum - 1 < 1" >{{ Ltotal }}</el-button
>上一页</el-button> >
<el-input <el-button
v-if="rightLength != 0" v-if="leftLength != 0"
v-model="RPageNum" class="transfer-footer"
size="mini" slot="left-footer"
class="transfer-footer" size="small"
slot="right-footer" @click="leftPageNumChange"
:placeholder="RPageNum" :disabled="LPageNum - 1 < 1"
style="width: 43px" >上一页</el-button
></el-input> >
<el-button <el-input
class="transfer-footer" v-if="leftLength != 0"
slot="right-footer" v-model="LPageNum"
size="small" size="mini"
@click="rightAddPageNumChange" class="transfer-footer"
v-if="rightLength != 0" slot="left-footer"
:disabled="RNextPage>RPages" :placeholder="LPageNum"
>下一页</el-button> style="width: 67px; padding: 1px 3px"
disabled
></el-input>
<el-button
class="transfer-footer"
slot="left-footer"
size="small"
@click="leftAddPageNumChange"
v-if="leftLength != 0"
:disabled="LNextPage > LPages"
>下一页</el-button
>
</el-transfer> <!-- 右侧栏分页 -->
<el-button
type="text"
style="color: #606266"
v-if="rightLength != 0"
class="transfer-footer"
slot="right-footer"
size="small"
>{{ Rtotal }}</el-button
>
<el-button
v-if="rightLength != 0"
class="transfer-footer"
slot="right-footer"
size="small"
@click="rightPageNumChange"
:disabled="RPageNum - 1 < 1"
>上一页</el-button
>
<el-input
v-if="rightLength != 0"
v-model="RPageNum"
size="mini"
class="transfer-footer"
slot="right-footer"
:placeholder="RPageNum"
style="width: 43px"
></el-input>
<el-button
class="transfer-footer"
slot="right-footer"
size="small"
@click="rightAddPageNumChange"
v-if="rightLength != 0"
:disabled="RNextPage > RPages"
>下一页</el-button
>
</el-transfer>
</div> </div>
</template> </template>
<script> <script>
import { getListProduct,getRightList ,addProduct, updateProduct, getProduct, delProduct} from "@/api/quality/userbind"; import { getListProduct,getRightList ,addProduct} from "@/api/quality/userbind";
export default { export default {
name: "UserBind", name: "Routeprodproduct",
data() { data() {
return { return {
@ -113,8 +137,8 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userCodes: this.userCodes, userCodes: this.userCodes,
materialId: null, itemId: null,
materialCode: null, itemCode: null,
materialName: null, materialName: null,
specification: null, specification: null,
unitOfMeasure: null, unitOfMeasure: null,
@ -124,11 +148,13 @@ export default {
}, },
// //
form: {}, form: {},
//
page: { pageNo: 1, pageSize: 20, total: 0 },
//---------------------> //--------------------->
leftList: [], leftList: [],
rightList: [], rightList: [],
titles:['未关联物料','已关联物料'], titles: ["未关联产品", "已关联产品"],
// //
Ltotal: "", Ltotal: "",
LPageNum: "1", LPageNum: "1",
@ -137,10 +163,11 @@ export default {
LPages: null, LPages: null,
leftLength: null, leftLength: null,
leftQueryParams: { leftQueryParams: {
userCodes: this.userCodes, materialName: null,
userCodes: this.userCodes,
pageNum: 1, pageNum: 1,
pageSize: 20 pageSize: 20,
}, },
// //
Rtotal: "", Rtotal: "",
RPageNum: "1", RPageNum: "1",
@ -149,42 +176,53 @@ export default {
rightLength: null, rightLength: null,
RNextPage: null, RNextPage: null,
rightQueryParams: { rightQueryParams: {
userCodes: this.userCodes, materialName: null,
userCodes: this.userCodes,
pageNum: 1, pageNum: 1,
pageSize: 20 pageSize: 20,
}, },
}; };
}, },
props :{ props: {
userCodes: undefined, userCodes: undefined,
optType: undefined optType: undefined,
}, },
created() { created() {
this.getList(); this.getList();
this.getRightListFun(); this.getRightListFun();
}, },
methods: { methods: {
// // 穿
// filterMethod(keyword, row) {
// console.log(keyword, row);
// return row.label.indexOf(keyword) > -1;
// },
//
handleQuery() {
this.getList();
this.getRightListFun();
},
/** 查询未分配产品列表 */ /** 查询未分配产品列表 */
getList() { getList() {
this.loading = true; this.loading = true;
getListProduct(this.leftQueryParams).then(response => { getListProduct(this.leftQueryParams).then((response) => {
this.LPages = Math.ceil(response.total/this.LPageSize) this.LPages = Math.ceil(response.total / this.LPageSize);
this.leftList = response.rows; this.leftList = response.rows;
this.Ltotal = response.total; this.Ltotal = response.total;
this.LPageNum = this.leftQueryParams.pageNum; this.LPageNum = this.leftQueryParams.pageNum;
this.LNextPage = this.leftQueryParams.pageNum+1; this.LNextPage = this.leftQueryParams.pageNum + 1;
this.loading = false; this.loading = false;
}); });
}, },
/**左边上一页**/ /**左边上一页**/
leftPageNumChange(){ leftPageNumChange() {
this.leftQueryParams.pageNum = this.LPageNum-1; this.leftQueryParams.pageNum = this.LPageNum - 1;
this.loading = true; this.loading = true;
this.getList(); this.getList();
this.getRightListFun(); this.getRightListFun();
}, },
/**左边下一页**/ /**左边下一页**/
leftAddPageNumChange(){ leftAddPageNumChange() {
this.leftQueryParams.pageNum = this.LNextPage; this.leftQueryParams.pageNum = this.LNextPage;
this.loading = true; this.loading = true;
this.getList(); this.getList();
@ -194,35 +232,33 @@ export default {
/** 查询已分配产品列表 -------------------------------*/ /** 查询已分配产品列表 -------------------------------*/
getRightListFun() { getRightListFun() {
this.loading = true; this.loading = true;
getRightList(this.rightQueryParams).then(response => { getRightList(this.rightQueryParams).then((response) => {
this.RPages = Math.ceil(response.total/this.RPageSize); this.RPages = Math.ceil(response.total / this.RPageSize);
const dataright = []; const dataright = [];
for(let i in response.rows){ for (let i in response.rows) {
// 穿 // 穿
dataright.push(response.rows[i].key) dataright.push(response.rows[i].key);
} }
this.rightList = dataright; this.rightList = dataright;
this.Rtotal = response.total;
this.Rtotal = response.total;
this.RPageNum = this.rightQueryParams.pageNum; this.RPageNum = this.rightQueryParams.pageNum;
this.RNextPage = this.rightQueryParams.pageNum+1; this.RNextPage = this.rightQueryParams.pageNum + 1;
this.loading = false; this.loading = false;
}); });
}, },
/**右边上一页**/ /**右边上一页**/
rightPageNumChange(){ rightPageNumChange() {
this.rightQueryParams.pageNum = this.RPageNum-1; this.rightQueryParams.pageNum = this.RPageNum - 1;
this.loading = true; this.loading = true;
this.getRightListFun(); this.getRightListFun();
}, },
/**右边下一页**/ /**右边下一页**/
rightAddPageNumChange(){ rightAddPageNumChange() {
this.rightQueryParams.pageNum = this.RNextPage; this.rightQueryParams.pageNum = this.RNextPage;
this.loading = true; this.loading = true;
this.getRightListFun(); this.getRightListFun();
}, },
// //
cancel() { cancel() {
@ -233,9 +269,9 @@ export default {
reset() { reset() {
this.form = { this.form = {
recordId: null, recordId: null,
userCodes: this.userCodes, userCodes: this. userCodes,
materialId: null, itemId: null,
materialCode: null, itemCode: null,
materialName: null, materialName: null,
specification: null, specification: null,
unitOfMeasure: null, unitOfMeasure: null,
@ -246,24 +282,29 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
}, },
/** 提交按钮 */ /** 提交按钮 */
handleChange(value, direction, movedKeys) { handleChange(value, direction, movedKeys) {
if (this.queryParams.userCodes != null) { if (this.queryParams. userCodes != null) {
this.queryParams.selectedValues = value; this.queryParams.selectedValues = value;
addProduct(this.queryParams).then(response => { addProduct(this.queryParams).then((response) => {
this.$modal.msgSuccess("关联成功"); this.$modal.msgSuccess("关联成功");
}); });
} }
} },
} },
}; };
</script> </script>
<style> <style>
.el-transfer-panel { .el-transfer-panel {
width: 350px; width: 350px;
}; }
.query{
display: flex;
justify-content: space-between;
padding-right: 4px;
}
</style> </style>

@ -170,14 +170,14 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col>
<el-form-item label="检验方式" prop="checkMode">
<el-input type='textarea' v-model="form.checkMode" placeholder="请输入检验方式" />
</el-form-item>
</el-col>
</el-row>
<template v-if="form.propertyCode === '1'"> <template v-if="form.propertyCode === '1'">
<el-row>
<el-col>
<el-form-item label="检验方式" prop="checkMode">
<el-input type='textarea' v-model="form.checkMode" placeholder="请输入检验方式" />
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col> <el-col>
<el-form-item label="检验工具" prop="checkTool"> <el-form-item label="检验工具" prop="checkTool">

Loading…
Cancel
Save