质量检验项目管理修改

yangwl
zhaoxiaolin 12 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

@ -1,8 +1,27 @@
<template>
<div>
<el-input placeholder="请输入内容" clearable > </el-input>
<el-transfer v-model="rightList" :data="leftList" :titles="titles"
:filterable=false
<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-transfer
v-model="rightList"
:data="leftList"
:titles="titles"
:filterable="true"
@change="handleChange"
>
<!-- 左侧栏分页 -->
@ -13,7 +32,8 @@
class="transfer-footer"
slot="left-footer"
size="small"
>{{ Ltotal }}</el-button>
>{{ Ltotal }}</el-button
>
<el-button
v-if="leftLength != 0"
class="transfer-footer"
@ -21,7 +41,8 @@
size="small"
@click="leftPageNumChange"
:disabled="LPageNum - 1 < 1"
>上一页</el-button>
>上一页</el-button
>
<el-input
v-if="leftLength != 0"
v-model="LPageNum"
@ -39,7 +60,8 @@
@click="leftAddPageNumChange"
v-if="leftLength != 0"
:disabled="LNextPage > LPages"
>下一页</el-button>
>下一页</el-button
>
<!-- 右侧栏分页 -->
<el-button
@ -49,7 +71,8 @@
class="transfer-footer"
slot="right-footer"
size="small"
>{{ Rtotal }}</el-button>
>{{ Rtotal }}</el-button
>
<el-button
v-if="rightLength != 0"
class="transfer-footer"
@ -57,7 +80,8 @@
size="small"
@click="rightPageNumChange"
:disabled="RPageNum - 1 < 1"
>上一页</el-button>
>上一页</el-button
>
<el-input
v-if="rightLength != 0"
v-model="RPageNum"
@ -74,17 +98,17 @@
@click="rightAddPageNumChange"
v-if="rightLength != 0"
:disabled="RNextPage > RPages"
>下一页</el-button>
>下一页</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,9 +163,10 @@ export default {
LPages: null,
leftLength: null,
leftQueryParams: {
materialName: null,
userCodes: this.userCodes,
pageNum: 1,
pageSize: 20
pageSize: 20,
},
//
Rtotal: "",
@ -149,26 +176,37 @@ export default {
rightLength: null,
RNextPage: null,
rightQueryParams: {
materialName: null,
userCodes: this.userCodes,
pageNum: 1,
pageSize: 20
pageSize: 20,
},
};
},
props: {
userCodes: undefined,
optType: 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.LPageNum = this.leftQueryParams.pageNum;
@ -194,16 +232,15 @@ export default {
/** 查询已分配产品列表 -------------------------------*/
getRightListFun() {
this.loading = true;
getRightList(this.rightQueryParams).then(response => {
getRightList(this.rightQueryParams).then((response) => {
this.RPages = Math.ceil(response.total / this.RPageSize);
const dataright = [];
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.RPageNum = this.rightQueryParams.pageNum;
this.RNextPage = this.rightQueryParams.pageNum + 1;
@ -223,7 +260,6 @@ export default {
this.getRightListFun();
},
//
cancel() {
this.open = false;
@ -234,8 +270,8 @@ export default {
this.form = {
recordId: null,
userCodes: this. userCodes,
materialId: null,
materialCode: null,
itemId: null,
itemCode: null,
materialName: null,
specification: null,
unitOfMeasure: null,
@ -246,7 +282,7 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
updateTime: null,
};
},
@ -254,16 +290,21 @@ export default {
handleChange(value, direction, movedKeys) {
if (this.queryParams. userCodes != null) {
this.queryParams.selectedValues = value;
addProduct(this.queryParams).then(response => {
addProduct(this.queryParams).then((response) => {
this.$modal.msgSuccess("关联成功");
});
}
}
}
},
},
};
</script>
<style>
.el-transfer-panel {
width: 350px;
};
}
.query{
display: flex;
justify-content: space-between;
padding-right: 4px;
}
</style>

@ -170,7 +170,6 @@
</el-form-item>
</el-col>
</el-row>
<template v-if="form.propertyCode === '1'">
<el-row>
<el-col>
<el-form-item label="检验方式" prop="checkMode">
@ -178,6 +177,7 @@
</el-form-item>
</el-col>
</el-row>
<template v-if="form.propertyCode === '1'">
<el-row>
<el-col>
<el-form-item label="检验工具" prop="checkTool">

Loading…
Cancel
Save