Browse Source

分组

master
mch 2 years ago
parent
commit
b0662ad30b
  1. 38
      src/components/unitGrouping/unitGroupCategory.vue
  2. 9
      src/views/common-settings/SampleGroup.vue

38
src/components/unitGrouping/unitGroupCategory.vue

@ -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,

9
src/views/common-settings/SampleGroup.vue

@ -99,11 +99,16 @@
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="6">
<el-col :span="6">
<el-form-item label="创建者">
<el-input v-model="form.creatorName" disabled></el-input>
</el-form-item>
</el-col> -->
</el-col>
<el-col :span="6">
<el-form-item label="创建时间">
<el-input :value="form.creationTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">

Loading…
Cancel
Save