人员线体绑定优化

yangwl
shaoyong 8 months ago
parent 985f84a362
commit 9e541ffffe

@ -78,8 +78,8 @@
<!-- 添加或修改人员物料绑定对话框 --> <!-- 添加或修改人员物料绑定对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户编码" prop="userCodes"> <el-form-item label="用户编码" prop="handleCode">
<el-input v-model="form.userCodes" disabled placeholder="请输入用户编码" /> <el-input v-model="handleCode" disabled placeholder="请输入用户编码" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-tabs type="border-card" v-if="form.userCodes != null"> <el-tabs type="border-card" v-if="form.userCodes != null">
@ -212,11 +212,10 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.userCode) this.ids = selection.map(item => item.userCode);
this.names = selection.map(item => item.userName) this.names = selection.map(item => item.userName);
this.handleCode = names.toString(); this.single = selection.length!==1;
this.single = selection.length!==1 this.multiple = !selection.length;
this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
@ -228,8 +227,9 @@ export default {
/** 绑定按钮操作 */ /** 绑定按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const userCodes = row.userCode || this.ids; let userCodes = row.userCode || this.ids;
const userNames = row.userName || this.names; let userNames = row.userName || this.names;
this.handleCode = this.ids.toString();
this.form.userCodes = userCodes; this.form.userCodes = userCodes;
this.form.userNames = userNames; this.form.userNames = userNames;
this.open = true; this.open = true;

@ -136,8 +136,8 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userCodes: this.userCodes, userCodes: null,
userNames: this.userNames, userNames: null,
itemId: null, itemId: null,
itemCode: null, itemCode: null,
materialName: null, materialName: null,
@ -165,8 +165,8 @@ export default {
leftLength: null, leftLength: null,
leftQueryParams: { leftQueryParams: {
materialName: null, materialName: null,
userCodes: this.userCodes, userCodes: null,
userNames: this.userNames, userNames: null,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}, },
@ -179,8 +179,8 @@ export default {
RNextPage: null, RNextPage: null,
rightQueryParams: { rightQueryParams: {
materialName: null, materialName: null,
userCodes: this.userCodes, userCodes: null,
userNames: this.userNames, userNames: null,
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
}, },
@ -226,6 +226,7 @@ export default {
/** 查询未分配产品列表 */ /** 查询未分配产品列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.leftQueryParams.userCodes = this.userCodes;
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;
@ -253,6 +254,7 @@ export default {
/** 查询已分配产品列表 -------------------------------*/ /** 查询已分配产品列表 -------------------------------*/
getRightListFun() { getRightListFun() {
this.loading = true; this.loading = true;
this.rightQueryParams.userCodes = this.userCodes;
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);
@ -290,8 +292,8 @@ export default {
reset() { reset() {
this.form = { this.form = {
recordId: null, recordId: null,
userCode: this.userCodes, userCode: null,
userName: this.userNames, userName: null,
itemId: null, itemId: null,
itemCode: null, itemCode: null,
materialName: null, materialName: null,
@ -310,7 +312,9 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
handleChange(value, direction, movedKeys) { handleChange(value, direction, movedKeys) {
if (this.queryParams.userCodes != null) { this.queryParams.userCodes = this.userCodes;
this.queryParams.userNames = this.userNames;
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("关联成功");

Loading…
Cancel
Save