优化管理端代办事项

master
lemon橪 2022-05-19 09:13:16 +08:00
parent 48f3c38fbd
commit 9d7a06e867
3 changed files with 33 additions and 22 deletions

View File

@ -3,7 +3,7 @@
<Dropdown trigger="click">
<a href="javascript:void(0)">
{{ value > 0 ? "有" + value + "条未读消息" : "无未读消息" }}
{{ value > 0 ? "有" + value + "条待办事项" : "无待办事项" }}
<Icon v-if="value!=0" type="ios-arrow-down"></Icon>
</a>
<DropdownMenu v-if="value!=0" slot="list">

View File

@ -196,7 +196,7 @@
display: inline-block;
cursor: pointer;
margin-right: 5px;
width: 200px;
max-width: 200px;
overflow: hidden;
word-wrap: normal;
white-space: nowrap;
@ -208,11 +208,6 @@
text-align: right;
}
}
&-innercon {
height: 100%;
padding-right: 14px;
}
}
.full-screen-btn-con {

View File

@ -1066,13 +1066,13 @@ export default {
this.$set(this.skuInfo, this.skuInfo.length, {
spec_values: [
{
name: "规格项",
value: "规格项值" + this.skuInfo.length,
_id: new Date().getTime() + Math.random(0.1),
name: '规格名'+this.skuInfo.length,
value: '',
['_id'+this.skuInfo.length]: new Date().getTime() + Math.random(0.1),
},
],
name: "规格名",
_id: new Date().getTime(),
name: '规格名'+this.skuInfo.length,
['_id'+this.skuInfo.length]: new Date().getTime(),
});
this.renderTableData();
},
@ -1126,6 +1126,7 @@ export default {
this.$Message.error("规格值不能大于10个");
return;
}
this.$set(item.spec_values, item.spec_values.length, {
name: item.name,
value: "",
@ -1201,7 +1202,6 @@ export default {
this.skuTableColumn = pushData;
//
let cloneTemp = cloneObj(this.skuInfo);
//
if (cloneTemp[0]) {
//
@ -1212,21 +1212,26 @@ export default {
[cloneTemp[0].name]: specItem.value,
images: this.baseInfoForm.goodsGalleryFiles || [],
_name: cloneTemp[0].name,
...specItem,
});
});
cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp);
this.skuTableData = result;
console.log(result)
this.skuTableData.forEach((item, index) => {
this.initSkuTableData.forEach((sku) => {
// id
if (sku._id.length && this.scalarArrayEquals(item._id, sku._id)) {
this.skuTableData[index] = {
...item,
...sku,
};
} else if (item.value == sku[item._name] || item._id == sku._id) {
// if (sku._id.length && this.scalarArrayEquals(item._id, sku._id)) {
// this.skuTableData[index] = {
// ...item,
// ...sku,
// };
// } else
if (item.value == sku[item._name] || item._id == sku._id) {
// // id
this.skuTableData[index] = {
...sku,
@ -1248,12 +1253,14 @@ export default {
if (cloneTemp.length > 0) {
let table = [];
result.forEach((resItem) => {
cloneTemp[0].spec_values.forEach((valItem,i) => {
cloneTemp[0].spec_values.forEach((valItem, i) => {
let obj = cloneObj(resItem);
obj[cloneTemp[0].name] = valItem.value;
obj._name = obj[cloneTemp[0].name];
if (obj._id) {
obj._id = `${obj._id},${obj._id + i}`.split(",");
// obj._id = `${obj._id},${cloneTemp[0].spec_values[i+1]?._id }`.split(",");
}
table.push(obj);
});
@ -1283,6 +1290,15 @@ export default {
});
}
},
//
scalarArrayEquals(array1, array2) {
return (
array1.length === array2.length &&
array1.every(function (v, i) {
return v === array2[i];
})
);
},
/** 自动完成表单所需方法*/
filterMethod(value, option) {
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
@ -1392,7 +1408,7 @@ export default {
delete sku._id;
delete sku.name;
delete sku.value;
delete sku._name
delete sku._name;
return sku;
});