Commit 0001facf by member

修改商品选择器的问题

parent 32a6079b
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>GIC-会员标签</title><link href=./static/css/app.f367b89d3beb21b6cc766beab8e7ae2f.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.cos.ap-shanghai.myqcloud.com/components/selector.1.1.66.js></script><script type=text/javascript src=./static/js/manifest.e5972d014cd475dc57a9.js></script><script type=text/javascript src=./static/js/vendor.83081d6a93a866b5b8f1.js></script><script type=text/javascript src=./static/js/app.74abcb1641987b233d64.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>GIC-会员标签</title><link href=./static/css/app.55bd57caec07606868241ea5c30cdb77.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.12.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.js></script><script src=//web-1251519181.cos.ap-shanghai.myqcloud.com/components/selector.1.1.71.js></script><script type=text/javascript src=./static/js/manifest.5a81733f745e0468d66a.js></script><script type=text/javascript src=./static/js/vendor.83081d6a93a866b5b8f1.js></script><script type=text/javascript src=./static/js/app.74abcb1641987b233d64.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(n,a,f){for(var o,d,b,i=0,u=[];i<n.length;i++)d=n[i],r[d]&&u.push(r[d][0]),r[d]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(c&&c(n,a,f);u.length;)u.shift()();if(f)for(i=0;i<f.length;i++)b=t(t.s=f[i]);return b};var n={},r={33:0};function t(c){if(n[c])return n[c].exports;var r=n[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.e=function(e){var c=r[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var n=new Promise(function(n,t){c=r[e]=[n,t]});c[2]=n;var a=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,t.nc&&f.setAttribute("nonce",t.nc),f.src=t.p+"static/js/"+e+"."+{0:"5f46637d46e2a7604af5",1:"1a66f3452cb905b67755",2:"3f2364554aa552a47411",3:"9209f0041f7da282c7ef",4:"fe10700a0dc4396d6fb6",5:"8756e3a39cb4cea7cbab",6:"31eb51419dea97959645",7:"f169140cbd6ad9f5611c",8:"fe61efcd1ccfc3412252",9:"ea583eedf0e8e01807bd",10:"49dc4ce10dca172e66e9",11:"97c54692f1a8adbe99aa",12:"543f6c991cec8c913a41",13:"4cbb12cbf7a9b8c30ba8",14:"012b850d5f8cb0572383",15:"c0b9b2e643a3d7f2e4a1",16:"07a972b413b1bb61c0ea",17:"874e4520e26cc90eb0a8",18:"643011894ba40b8da49b",19:"308e228686726571bdcf",20:"0fef167461d750bfe493",21:"9552d108595ed6cf8df5",22:"61bb63c1296b6c9972a5",23:"c24a9f56d0040598512c",24:"590887b93345814f00ef",25:"fbc9d87dd52c837c39be",26:"c5f9e5a4bc2c63938b70",27:"2c48b10d124016d57c0b",28:"f5fc73b651e29d17f74d",29:"ed4b43f3d8456f7bd36e",30:"5d1cb1b10c82fdeede4d"}[e]+".js";var o=setTimeout(d,12e4);function d(){f.onerror=f.onload=null,clearTimeout(o);var c=r[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}return f.onerror=f.onload=d,a.appendChild(f),n},t.m=e,t.c=n,t.d=function(e,c,n){t.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(c,"a",c),c},t.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},t.p="./",t.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(n,a,f){for(var o,d,b,i=0,u=[];i<n.length;i++)d=n[i],r[d]&&u.push(r[d][0]),r[d]=0;for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);for(c&&c(n,a,f);u.length;)u.shift()();if(f)for(i=0;i<f.length;i++)b=t(t.s=f[i]);return b};var n={},r={33:0};function t(c){if(n[c])return n[c].exports;var r=n[c]={i:c,l:!1,exports:{}};return e[c].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.e=function(e){var c=r[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var n=new Promise(function(n,t){c=r[e]=[n,t]});c[2]=n;var a=document.getElementsByTagName("head")[0],f=document.createElement("script");f.type="text/javascript",f.charset="utf-8",f.async=!0,f.timeout=12e4,t.nc&&f.setAttribute("nonce",t.nc),f.src=t.p+"static/js/"+e+"."+{0:"e29ce92ed3cace2ef6e2",1:"1a66f3452cb905b67755",2:"3f2364554aa552a47411",3:"9209f0041f7da282c7ef",4:"fe10700a0dc4396d6fb6",5:"8756e3a39cb4cea7cbab",6:"31eb51419dea97959645",7:"f169140cbd6ad9f5611c",8:"fe61efcd1ccfc3412252",9:"ea583eedf0e8e01807bd",10:"49dc4ce10dca172e66e9",11:"97c54692f1a8adbe99aa",12:"543f6c991cec8c913a41",13:"4cbb12cbf7a9b8c30ba8",14:"012b850d5f8cb0572383",15:"c0b9b2e643a3d7f2e4a1",16:"07a972b413b1bb61c0ea",17:"874e4520e26cc90eb0a8",18:"643011894ba40b8da49b",19:"308e228686726571bdcf",20:"0fef167461d750bfe493",21:"9552d108595ed6cf8df5",22:"61bb63c1296b6c9972a5",23:"c24a9f56d0040598512c",24:"590887b93345814f00ef",25:"fbc9d87dd52c837c39be",26:"c5f9e5a4bc2c63938b70",27:"2c48b10d124016d57c0b",28:"f5fc73b651e29d17f74d",29:"ed4b43f3d8456f7bd36e",30:"5d1cb1b10c82fdeede4d"}[e]+".js";var o=setTimeout(d,12e4);function d(){f.onerror=f.onload=null,clearTimeout(o);var c=r[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),r[e]=void 0)}return f.onerror=f.onload=d,a.appendChild(f),n},t.m=e,t.c=n,t.d=function(e,c,n){t.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(c,"a",c),c},t.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},t.p="./",t.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -21,6 +21,6 @@
<script src="//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.02.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/area-ab.2.0.00.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.02.js"></script>
<script src="//web-1251519181.cos.ap-shanghai.myqcloud.com/components/selector.1.1.66.js"></script>
<script src="//web-1251519181.cos.ap-shanghai.myqcloud.com/components/selector.1.1.71.js"></script>
</body>
</html>
......@@ -40,6 +40,10 @@ export default {
handleCheckAllChange(val) {
this.checkedBrandes = val ? this.brandes : [];
this.isIndeterminate = false;
this.dispatch('vue-gic-goods-selector', 'pass-checkbox', {
index: this.goodsIndex,
items: this.checkedBrandes
});
},
// 复选框多选
......@@ -103,13 +107,19 @@ export default {
listReback: {
immediate: true,
handler(newval) {
console.log(newval);
newval.brands.forEach(el => {
let index = this.brandes.findIndex(item => item.brandId === el.brandId);
if (index> -1) {
this.checkedBrandes.push(this.brandes[index]);
}
})
if (newval.status === 'delete') {
this.checkedBrandes = [];
let checkCount = newval.brands.length;
this.checkAll = checkCount === this.brandes.length;
this.isIndeterminate = checkCount > 0 && checkCount < this.brandes.length;
newval.brands.forEach(el => {
let index = this.brandes.findIndex(item => item.brandId === el.brandId);
if (index > -1) {
this.checkedBrandes.push(this.brandes[index]);
}
});
this.dispatch('vue-gic-goods-selector', 'delete-status', this.goodsIndex);
}
}
}
}
......
......@@ -57,7 +57,10 @@ export default {
methods: {
deleteCondition() {
// 触发selector 组件去删除
this.dispatch('vue-gic-goods-selector', 'delete-gooditem', this.goodIndex);
this.dispatch('vue-gic-goods-selector', 'delete-gooditem', {
index: this.goodIndex,
status: 'delete'
});
},
handleChange(val) {
this.dispatch('vue-gic-goods-selector', 'pass-radioGroup', { index: this.goodIndex, val: this.bindCondition });
......
......@@ -195,7 +195,7 @@ export default {
if (this.propType == 'TYP_SINGLE' || this.propType == 'TYP_CHECK') {
const param = {
currentPage: 1,
pageSize: 20,
pageSize: 1000,
propertyId: item.propertyId
};
this.axios
......
......@@ -102,6 +102,11 @@ export default {
// 把左边的筛选的sku移到右边
addSkuToLeft() {
this.filterData = this.skuCheched.filter(el => el.hasSku);
this.filterData = this.filterData.map(el => ({
...el,
check: false
}));
this.filterBox = false;
this.rightData = JSON.parse(JSON.stringify(this.filterData));
},
handleCheckAllChange(val) {
......@@ -313,8 +318,41 @@ export default {
this.$message.warning('请先勾选商品!');
return;
}
this.rightData = this.rightData.filter(el => !el.check);
this.filterRightData = this.filterRightData.filter(el => !el.check);
let middle = JSON.parse(JSON.stringify(this.tableData));
let filterList = JSON.parse(JSON.stringify(this.filterData));
this.rightData = this.rightData.filter((el, i) => {
if (el.check) {
let index = this.filterRightData.findIndex(item => item.goodsId == el.goodsId);
if (index > -1) {
this.filterRightData.splice(index, 1);
}
// 没删除一个左边对应的状态也要修改sku的值 否则无法保持一致
// 如果找到之后就把sku给重置
let resetIndex = middle.findIndex(ele => ele.goodsId == el.goodsId);
// 重置左边的sku
middle[resetIndex].skus = middle[resetIndex].skus.map(sku => ({
...sku,
check: false
}));
let filterIndex = filterList.findIndex(fl => fl.goodsId == el.goodsId);
if (filterIndex > -1) {
filterList[filterIndex].skus = filterList[filterIndex].skus.map(sku => ({
...sku,
check: false,
hasSku: false
}));
}
return false;
}
return true;
});
this.tableData = JSON.parse(JSON.stringify(middle));
this.filterData = JSON.parse(JSON.stringify(filterList));
this.filterBox = false;
this.rightChecked = [];
this.isIndeterminate = false;
......@@ -324,7 +362,7 @@ export default {
if (!this.filterRightData.length) {
this.filterRightData = JSON.parse(JSON.stringify(this.rightData));
}
this.rightData = this.filterRightData.filter(el => el.goodsName.indexOf(this.chooseGood) > -1);
this.rightData = this.filterRightData.filter(el => el.goodsName.indexOf(this.chooseGood) > -1 || el.goodsCode.indexOf(this.chooseGood) > -1);
}
},
......
......@@ -127,8 +127,11 @@ export default {
* 这里商品属性有个问题就是如果有多个(最少两个)商品属性 删除的时候
* 由于商品属性没有从父组件传进来的值 所以自组件无法知道怎么去渲染
*/
this.conditions[arr[0]].goodsList.splice(arr[1], 1);
this.conditions[arr.index[0]].goodsList.splice(arr.index[1], 1);
// 因为涉及到可以删除的问题 所以要保留一个status来知道是不是删除的选项
if (this.conditions.length && this.conditions[arr.index[0]].goodsList.length && this.conditions[arr.index[0]].goodsList[arr.index[1]]) {
this.conditions[arr.index[0]].goodsList[arr.index[1]].status = arr.status;
}
// 如果是最后一行 就删除整个大行
// if (this.conditions.length > 1) {
// if (!this.conditions[arr[0]].goodsList.length) {
......@@ -406,9 +409,12 @@ export default {
},
receivestandardId(property) {
const index = property.index;
console.log(property, index);
console.log(this.conditions[index[0]].goodsList[index[1]].ids);
this.conditions[index[0]].goodsList[index[1]].parentId = property.items.parentId;
},
deleteStatus(index) {
if ('status' in this.conditions[index[0]].goodsList[index[1]]) {
this.conditions[index[0]].goodsList[index[1]].status = '';
}
}
},
......@@ -425,6 +431,7 @@ export default {
this.$on('pass-spes', this.passSpes);
this.$on('pass-goodslist', this.passGoodslist);
this.$on('pass-spe-group-list', this.passSpeGroupList);
this.$on('delete-status', this.deleteStatus); // 删除要删除的状态
}
};
</script>
......
......@@ -84,7 +84,7 @@ export default {
// 找到存在的sku 然后切换状态
currentGoods.skus.forEach(sku => {
for (let i = 0; i < this.skuItem.skus.length; i++) {
if (this.skuItem.skus[i].skuId === sku.skuId) {
if (this.skuItem.skus[i].check) {
this.skuItem.skus[i].check = true;
break;
}
......@@ -126,7 +126,6 @@ export default {
goods: {
immediate: true,
handler(newval) {
console.log(newval);
this.skuItem = newval;
}
},
......
......@@ -99,6 +99,7 @@ export default {
immediate: true,
handler(newval) {
this.skus = newval;
this.handleSkuStatus();
}
}
}
......
......@@ -655,9 +655,6 @@
<div v-if="parent.templateCode == 'com022'">
<vue-gic-goods-selector ref="selector" @changelist="changelist"></vue-gic-goods-selector>
<!-- <vue-gic-selector ref="selector" @changelist="changelist"></vue-gic-selector> -->
<div class="gic-button" v-show="select.expends">
<el-button type="primary" @click="confirmSelector">确认</el-button>
</div>
</div>
</div>
</div>
......@@ -925,18 +922,18 @@ export default {
},
// 获取商品选择器的缩略信息
async confirmSelector() {
let flag = this.$refs.selector[0].collectConditions();
let flag = await this.$refs.selector[0].collectConditions();
if (flag == false) {
this.$message.warning('商品选择器条件不能为空!');
return false;
} else {
flag.then(res => {
this.select.expends = !res.filterAbbrInfo.length;
this.com022.selectList = res.conditions;
this.com022.abbrInfo = res.filterAbbrInfo;
this.com022.conditionsList = res.conditionList;
this.com022.finalId = res.id;
});
// this.select.expends = !flag.filterAbbrInfo.length;
this.com022.selectList = flag.conditions;
this.com022.abbrInfo = flag.filterAbbrInfo;
this.com022.conditionsList = flag.conditionList;
this.com022.finalId = flag.id;
}
return true;
},
// 格式化输入的字符
handleNumRangeStart(eve) {
......
......@@ -430,7 +430,7 @@ export default {
for (let i = 0; i < this.templateData.length; i++) {
// 商品选择器
if (this.templateData[i].templateCode == 'com022') {
await this.confirmSelector();
let ret = await this.confirmSelector();
if (!this.com022.selectList || !this.com022.selectList.length) {
this.$message.warning('商品选择器未选择条件!')
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment