质量检验项目管理修改

yangwl
zhaoxiaolin 10 months ago
parent 6e58ab4272
commit 09ff616804

@ -42,3 +42,16 @@ export function delCheckTypeProject(id) {
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 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="left" prop="standardValue" :show-overflow-tooltip="true" width="200"/>
<el-table-column label="上差值" align="left" prop="upperDiff" />
<el-table-column label="下差值" align="left" prop="downDiff" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="抽样比例" align="center" prop="sample" />
<el-table-column label="抽样数量" align="center" prop="sampleNum" />
<el-table-column label="抽样比例" align="left" prop="sample" />
<el-table-column label="抽样数量" align="left" prop="sampleNum" />
<el-table-column
label="是否启用"
align="center"
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
label="操作"
align="center"
@ -192,8 +201,20 @@
<el-form-item label="下差值" prop="downDiff">
<el-input v-model="form.downDiff" placeholder="请输入下差值" />
</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>
<el-form-item label="排序" prop="sort">
<el-input type="number" v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -210,6 +231,7 @@ import {
delCheckTypeProject,
addCheckTypeProject,
updateCheckTypeProject,
changeStatus
} from "@/api/quality/checkTypeProject";
import MaterialGroupAdd from "./MaterialGroupAdd.vue";
import {listCheckType} from "@/api/quality/checkType";
@ -217,7 +239,7 @@ import {listProject} from "@/api/quality/project";
export default {
name: "CheckTypeProject",
dicts: ["qc_rule_prop"],
dicts: ["qc_rule_prop",'unit'],
components: {MaterialGroupAdd,},
data() {
return {
@ -283,9 +305,15 @@ export default {
};
},
created() {
//this.getList();
this.getProjectList();
},
methods: {
/**获取检测项目列表**/
getProjectList(){
listProject().then((response) => {
this.checkRuleList = response.rows;
});
},
/** 查询物料检验项目维护列表 */
getList() {
this.loading = true;
@ -376,6 +404,7 @@ export default {
this.form.propertyCode = obj.propertyCode;
this.form.standardValue = obj.checkStandard;
this.form.projectNo = obj.orderNum;
this.form.unit = obj.unitCode;
},
//
handleSelectionChange(selection) {
@ -391,13 +420,11 @@ export default {
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;
@ -483,6 +510,21 @@ export default {
this.queryParams.typeId = tab.name;
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>

@ -44,7 +44,6 @@
<el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="联系方式" align="center" prop="phonenumber" />
<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" >
<template slot-scope="scope">
<span
@ -85,7 +84,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">

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

@ -170,14 +170,14 @@
</el-form-item>
</el-col>
</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'">
<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-col>
<el-form-item label="检验工具" prop="checkTool">

Loading…
Cancel
Save