人员线体绑定优化

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-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户编码" prop="userCodes">
<el-input v-model="form.userCodes" disabled placeholder="请输入用户编码" />
<el-form-item label="用户编码" prop="handleCode">
<el-input v-model="handleCode" disabled placeholder="请输入用户编码" />
</el-form-item>
</el-form>
<el-tabs type="border-card" v-if="form.userCodes != null">
@ -212,11 +212,10 @@ export default {
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userCode)
this.names = selection.map(item => item.userName)
this.handleCode = names.toString();
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map(item => item.userCode);
this.names = selection.map(item => item.userName);
this.single = selection.length!==1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
@ -228,8 +227,9 @@ export default {
/** 绑定按钮操作 */
handleUpdate(row) {
this.reset();
const userCodes = row.userCode || this.ids;
const userNames = row.userName || this.names;
let userCodes = row.userCode || this.ids;
let userNames = row.userName || this.names;
this.handleCode = this.ids.toString();
this.form.userCodes = userCodes;
this.form.userNames = userNames;
this.open = true;

@ -136,8 +136,8 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
userCodes: this.userCodes,
userNames: this.userNames,
userCodes: null,
userNames: null,
itemId: null,
itemCode: null,
materialName: null,
@ -165,8 +165,8 @@ export default {
leftLength: null,
leftQueryParams: {
materialName: null,
userCodes: this.userCodes,
userNames: this.userNames,
userCodes: null,
userNames: null,
pageNum: 1,
pageSize: 20,
},
@ -179,8 +179,8 @@ export default {
RNextPage: null,
rightQueryParams: {
materialName: null,
userCodes: this.userCodes,
userNames: this.userNames,
userCodes: null,
userNames: null,
pageNum: 1,
pageSize: 20,
},
@ -226,6 +226,7 @@ export default {
/** 查询未分配产品列表 */
getList() {
this.loading = true;
this.leftQueryParams.userCodes = this.userCodes;
getListProduct(this.leftQueryParams).then((response) => {
this.LPages = Math.ceil(response.total / this.LPageSize);
this.leftList = response.rows;
@ -253,6 +254,7 @@ export default {
/** 查询已分配产品列表 -------------------------------*/
getRightListFun() {
this.loading = true;
this.rightQueryParams.userCodes = this.userCodes;
getRightList(this.rightQueryParams).then((response) => {
this.RPages = Math.ceil(response.total / this.RPageSize);
@ -290,8 +292,8 @@ export default {
reset() {
this.form = {
recordId: null,
userCode: this.userCodes,
userName: this.userNames,
userCode: null,
userName: null,
itemId: null,
itemCode: null,
materialName: null,
@ -310,7 +312,9 @@ export default {
/** 提交按钮 */
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;
addProduct(this.queryParams).then((response) => {
this.$modal.msgSuccess("关联成功");

Loading…
Cancel
Save