检验节点绑定修改

master
shaoyong 8 months ago
parent 0ad88c98a6
commit d85b14370d

@ -151,16 +151,16 @@
<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="userName" />
<el-table-column fixed="right" align="center" label="操作" width="200">
<el-table-column label="来料类别" align="center" prop="attr1" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
:value="scope.row.attr1"
/>
</template>
</el-table-column>
<el-table-column fixed="right" align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button
v-if="msShowButton"
size="small"
type="primary"
plain
@click="handleEdit(scope.row)"
>
来料类型分配</el-button>
<el-button
size="small"
type="danger"
@ -178,36 +178,18 @@
<el-button type="primary" @click="handleClose" > </el-button>
</div>
</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
ref="itemSelectUser"
@onSelected="onSelectUser"
:materialCode="materialCode"
></ItemSelectUser>
</div>
</template>
<script>
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
import{ getSelectedUsers, addUserBind, getInfoById, updateProduct, deleteByMaterialCode} from "@/api/quality/userbind";
import{ getSelectedUsers, addUserBind, deleteByMaterialCode} from "@/api/quality/userbind";
import ItemSelectUser from "./selectUser.vue";
export default {
name: "CheckType",
@ -229,11 +211,8 @@ export default {
//
showSearch: true,
openUserBind: false,
msOpen: false,
msTitle: "",
materialCode: "",
materialName: "",
msShowButton: false,
attr1: "",
//
total: 0,
@ -266,7 +245,6 @@ export default {
materialName: null,
phonenumber: null,
},
msForm:{},
//
form: {},
//
@ -295,10 +273,6 @@ export default {
this.open = false;
this.reset();
},
msCancel() {
this.msOpen = false;
this.msReset();
},
//
reset() {
this.form = {
@ -317,15 +291,6 @@ export default {
};
this.resetForm("form");
},
msReset() {
this.msForm = {
id: null,
userCode: null,
userName: null,
attr1: null,
};
this.resetForm("msForm");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -407,46 +372,12 @@ export default {
//
getSelectedUsers(this.getUserParams).then(response => {
this.userList = response.rows;
if(this.materialCode ==="checkTypeLL") {
this.msShowButton = true;
}else {
this.msShowButton = false;
}
this.openUserBind = true;
this.titleUserBind = "人员绑定详情";
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() {
this.userloading = true;
//this.getUserParams.materialCode = orderCode;
@ -472,19 +403,21 @@ export default {
//
addUser() {
this.$refs.itemSelectUser.showFlag = true;
this.$refs.itemSelectUser.getList();
},
//
onSelectUser(obj) {
let data = {
materialCode: this.materialCode,
materialName: this.materialName,
attr1: this.attr1,
attr1List: [],
userCodes: [],
userNames: [],
}
obj.forEach((item, index) => {
data.userCodes.push(item.userCode);
data.userNames.push(item.userName);
data.attr1List.push(item.attr1);
});
addUserBind(data).then(response => {
if(response.code === 200) {

@ -64,8 +64,19 @@
<el-table-column label="员工姓名" align="left" key="userName" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="员工部门" align="left" key="deptName" prop="deptName" :show-overflow-tooltip="true" />
<el-table-column label="手机号" align="left" key="phonenumber" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="来料类型分配" v-if="materialCode === 'checkTypeLL'" align="left" prop="attr1" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.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>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -75,7 +86,7 @@
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
@ -87,7 +98,9 @@ import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "itemSelectUser",
dicts: ["order_type_ll"],
components: { Treeselect },
props: { materialCode: { type: String, default: "" }},
data() {
return {
showFlag:false,
@ -125,7 +138,6 @@ export default {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询表格列表*/
@ -150,7 +162,10 @@ export default {
this.resetForm("queryUserForm");
this.handleQuery();
},
cancel() {
this.showFlag = false;
this.itemList = [];
},
//
handleBomSelectionChange(selection) {
@ -167,6 +182,7 @@ export default {
submitBomForm() {
this.$emit('onSelected', this.selectedRows);
this.itemList = [];
this.showFlag = false;
}
}

Loading…
Cancel
Save