|
|
|
@ -163,6 +163,8 @@ |
|
|
|
<script> |
|
|
|
import { getapi, postapi } from "@/api/api"; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { arrayExistObj } from "../../utlis/proFunc"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -252,6 +254,7 @@ export default { |
|
|
|
}, |
|
|
|
//移除按钮 |
|
|
|
addselecteditems() { |
|
|
|
let lfind = -1; |
|
|
|
console.log(this.personnelUnit.id); |
|
|
|
if (this.personnelUnit.form.id == "") { |
|
|
|
alert("请先选择单位类别"); |
|
|
|
@ -265,14 +268,21 @@ export default { |
|
|
|
// this.title = 2; |
|
|
|
let count = this.rightselctedata.length - 1; |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
[...new Set(this.rightselctedata)]; |
|
|
|
this.tabledata.push(this.rightselctedata[i]); |
|
|
|
this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
if ([...new Set(this.rightselctedata)]) { |
|
|
|
this.tabledata.push(this.rightselctedata[i]); |
|
|
|
this.personnelUnit.nogroupselected.splice(i, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(this.personnelUnit.customerOrgGroupId); |
|
|
|
|
|
|
|
// this. |
|
|
|
this.rightselctedata.forEach((item) => { |
|
|
|
lfind = arrayExistObj( |
|
|
|
this.personnelUnit.nogroupselected, |
|
|
|
"id", |
|
|
|
item.id |
|
|
|
); |
|
|
|
|
|
|
|
if (lfind > -1) this.personnelUnit.nogroupselected.splice(lfind, 1); |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: item.id, |
|
|
|
price: item.price, |
|
|
|
@ -286,11 +296,11 @@ export default { |
|
|
|
//右侧勾选按钮 |
|
|
|
selecteditems(val) { |
|
|
|
this.rightselctedata = val; |
|
|
|
// this.personnelUnit.nogroupselected = val; |
|
|
|
console.log(this.rightselctedata); |
|
|
|
}, |
|
|
|
// 添加按钮 |
|
|
|
removedata() { |
|
|
|
let lfind = -1; |
|
|
|
if (this.personnelUnit.form.id == "") { |
|
|
|
alert("请先选择单位分组"); |
|
|
|
} else { |
|
|
|
@ -301,7 +311,7 @@ export default { |
|
|
|
let count = this.unselecteddata.length - 1; |
|
|
|
for (var i = count; i >= 0; i--) { |
|
|
|
// this.tabledata.splice(i, 1); |
|
|
|
if ([...new Set(this.unselecteddata)]) { |
|
|
|
if ([...new Set(this.personnelUnit.nogroupselected)]) { |
|
|
|
// this.unselecteddata.push(this.unselecteddata[i]); |
|
|
|
this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); |
|
|
|
this.tabledata.splice(this.tabledata[i], 1); |
|
|
|
@ -309,21 +319,13 @@ export default { |
|
|
|
// this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); |
|
|
|
} |
|
|
|
console.log(this.personnelUnit.customerOrgGroupId); |
|
|
|
this.unselecteddata.forEach((item) => { |
|
|
|
// var price = ""; |
|
|
|
// if (this.price == "") { |
|
|
|
// price = item.price; |
|
|
|
// } else { |
|
|
|
// price = this.price; |
|
|
|
// } |
|
|
|
//获取最新价格 |
|
|
|
}); |
|
|
|
// let prices = ""; |
|
|
|
this.personnelUnit.nogroupselected.forEach((items) => { |
|
|
|
// prices = items.price; |
|
|
|
|
|
|
|
// this.price = item.price; |
|
|
|
// console.log(items, "items"); |
|
|
|
//this.tabledata |
|
|
|
console.log(items); |
|
|
|
lfind = arrayExistObj(this.tabledata, "id", items.id); |
|
|
|
if (lfind > -1) this.tabledata.splice(lfind, 1); |
|
|
|
this.addrulst.push({ |
|
|
|
asbitemId: items.id, // "3a0b2f0c-f884-bec4-a350-79b46b455a2d" |
|
|
|
price: items.price, |
|
|
|
|