检验节点人员绑定修改

master
shaoyong 8 months ago
parent 1964e2213c
commit 0ad88c98a6

@ -17,6 +17,13 @@ export function getProduct(userCode) {
}); });
} }
export function getInfoById(id) {
return request({
url: '/quality/material/getInfoById/' + id,
method: 'get'
});
}
// 新增用户物料关联 // 新增用户物料关联
export function addProduct(data) { export function addProduct(data) {
return request({ return request({

@ -73,14 +73,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="二级类型" align="center" prop="attr1" width="150">
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
:value="scope.row.attr1"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -146,20 +138,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="15">
<el-form-item v-if="form.typeCode=='material'" label="来料类别" prop="attr1">
<el-select v-model="form.attr1" placeholder="请输入来料类别" >
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</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>
@ -173,8 +151,16 @@
<el-table-column label="序号" align="center" type="index" width="50" /> <el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="员工编号" align="center" prop="userCode" /> <el-table-column label="员工编号" align="center" prop="userCode" />
<el-table-column label="姓名" align="center" prop="userName" /> <el-table-column label="姓名" align="center" prop="userName" />
<el-table-column fixed="right" label="操作" width="90"> <el-table-column fixed="right" align="center" label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
v-if="msShowButton"
size="small"
type="primary"
plain
@click="handleEdit(scope.row)"
>
来料类型分配</el-button>
<el-button <el-button
size="small" size="small"
type="danger" type="danger"
@ -192,6 +178,25 @@
<el-button type="primary" @click="handleClose" > </el-button> <el-button type="primary" @click="handleClose" > </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 来料类别分配 -->
<el-dialog :title="msTitle" :visible.sync="msOpen" width="350px">
<el-form ref="msForm" :model="msForm" :rules="rules" label-width="80px">
<el-form-item label="来料类别" prop="attr1">
<el-select v-model="msForm.attr1" placeholder="请输入来料类别" clearable>
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="msSubmitForm"> </el-button>
<el-button @click="msCancel"> </el-button>
</div>
</el-dialog>
<!--人员选择弹窗--> <!--人员选择弹窗-->
<ItemSelectUser <ItemSelectUser
ref="itemSelectUser" ref="itemSelectUser"
@ -202,7 +207,7 @@
<script> <script>
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType"; import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
import{ getSelectedUsers, addUserBind,deleteByMaterialCode} from "@/api/quality/userbind"; import{ getSelectedUsers, addUserBind, getInfoById, updateProduct, deleteByMaterialCode} from "@/api/quality/userbind";
import ItemSelectUser from "./selectUser.vue"; import ItemSelectUser from "./selectUser.vue";
export default { export default {
name: "CheckType", name: "CheckType",
@ -224,8 +229,11 @@ export default {
// //
showSearch: true, showSearch: true,
openUserBind: false, openUserBind: false,
msOpen: false,
msTitle: "",
materialCode: "", materialCode: "",
materialName: "", materialName: "",
msShowButton: false,
attr1: "", attr1: "",
// //
total: 0, total: 0,
@ -258,6 +266,7 @@ export default {
materialName: null, materialName: null,
phonenumber: null, phonenumber: null,
}, },
msForm:{},
// //
form: {}, form: {},
// //
@ -286,6 +295,10 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
msCancel() {
this.msOpen = false;
this.msReset();
},
// //
reset() { reset() {
this.form = { this.form = {
@ -304,6 +317,15 @@ export default {
}; };
this.resetForm("form"); this.resetForm("form");
}, },
msReset() {
this.msForm = {
id: null,
userCode: null,
userName: null,
attr1: null,
};
this.resetForm("msForm");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
@ -376,22 +398,54 @@ export default {
handleBind(row){ handleBind(row){
//this.reset(); //this.reset();
this.userloading = true; this.userloading = true;
let sr = row;
//使 //使
this.materialCode = sr.orderCode; this.materialCode = row.orderCode;
this.materialName = sr.checkName; this.materialName = row.checkName;
this.attr1 = sr.attr1; this.attr1 = row.attr1;
this.getUserParams.materialCode = sr.orderCode; this.getUserParams.materialCode = row.orderCode;
// //
getSelectedUsers(this.getUserParams).then(response => { getSelectedUsers(this.getUserParams).then(response => {
this.userList = response.rows; this.userList = response.rows;
if(this.materialCode ==="checkTypeLL") {
this.msShowButton = true;
}else {
this.msShowButton = false;
}
this.openUserBind = true; this.openUserBind = true;
this.titleUserBind = "人员绑定详情"; this.titleUserBind = "人员绑定详情";
this.userloading = false; this.userloading = false;
}); });
}, },
//
handleEdit(row) {
this.msReset();
const id = row.id;
getInfoById(id).then(response => {
this.msForm = response.data;
this.msOpen = true;
this.msTitle = "来料类型分配";
});
},
//
msSubmitForm() {
this.$refs["msForm"].validate(valid => {
if (valid) {
if (this.msForm.id != null) {
updateProduct(this.msForm).then(response => {
if(response.code === 200){
this.$modal.msgSuccess("分配成功");
}else{
this.$modal.msgError(response.msg);
}
this.msOpen = false;
this.getSelectUserList();
});
}
}
});
},
getSelectUserList() { getSelectUserList() {
this.userloading = true; this.userloading = true;

Loading…
Cancel
Save