Commit facb8e6f authored by xiaoyan's avatar xiaoyan

fix: 包装类型去掉箱/编织袋显示

parent 7749fd99
......@@ -55,7 +55,7 @@
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(unit, index) in order.units.split(',')" :key="index">
<text v-for="(unit, index) in uniqueArr(order.units)" :key="index">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== order.units.split(',').length-1 ? ',':'' }}
</text>
</view>
......@@ -787,6 +787,12 @@ export default {
this.orderId = row.orderId;
this.$refs.mixOrderList.showDetail(row);
},
/* 过滤包装类型 */
uniqueArr(arr) {
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
// 过滤商品特性
uniqueProductAttrs(arr, field) {
let uniqueValues = [...new Set(arr.map(item => item[field].split(',')).flat())];
......
......@@ -62,7 +62,7 @@
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(unit, index) in order.units.split(',')" :key="index">
<text v-for="(unit, index) in uniqueArr(order.units)" :key="index">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== order.units.split(',').length-1 ? ',':'' }}
</text>
</view>
......@@ -904,6 +904,12 @@ export default {
if (show) this.currRow = row;
this.goodsModal = show;
},
/* 过滤包装类型 */
uniqueArr(arr) {
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
// 过滤商品特性
uniqueProductAttrs(arr, field) {
let uniqueValues = [...new Set(arr.map(item => item[field].split(',')).flat())];
......
......@@ -83,7 +83,7 @@
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="item.customsType" style="color:red;fontWeight:bold;margin: 0 3px;" />
</text>
<!-- 包装类型 -->
<text v-for="(unit, index) in item.units.split(',')" :key="index" style="color:red;fontWeight:bold;margin: 0 3px;">
<text v-for="(unit, index) in uniqueArr(item.units)" :key="index" style="color:red;fontWeight:bold;margin: 0 3px;">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== item.units.split(',').length-1 ? ',':'' }}
</text>
<!-- 关联单 -->
......@@ -480,8 +480,9 @@ export default {
},
/* 过滤包装类型 */
uniqueArr(arr) {
return arr.filter((obj, index, self) =>
index === self.findIndex((t) => t.unit === obj.unit));
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
// 过滤商品特性
uniqueProductAttrs(arr, field) {
......
......@@ -49,7 +49,7 @@
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(unit, index) in order.units.split(',')" :key="index">
<text v-for="(unit, index) in uniqueArr(order.units)" :key="index">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== order.units.split(',').length-1 ? ',':'' }}
</text>
</view>
......@@ -367,6 +367,12 @@ export default {
if (show) this.currRow = row;
this.goodsModal = show;
},
/* 过滤包装类型 */
uniqueArr(arr) {
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
// 过滤商品特性
uniqueProductAttrs(arr, field) {
let uniqueValues = [...new Set(arr.map(item => item[field].split(',')).flat())];
......
......@@ -22,7 +22,7 @@
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(unit, index) in v.units.split(',')" :key="index">
<text v-for="(unit, index) in uniqueArr(v.units)" :key="index">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== v.units.split(',').length-1 ? ',':'' }}
</text>
</view>
......@@ -191,6 +191,12 @@ export default {
});
});
},
/* 过滤包装类型 */
uniqueArr(arr) {
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
/* 跳转到关联单 */
relatedClick(orderId) {
uni.navigateTo({
......
......@@ -61,7 +61,7 @@
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(unit, index) in order.units.split(',')" :key="index">
<text v-for="(unit, index) in uniqueArr(order.units)" :key="index">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="unit" />{{ index!== order.units.split(',').length-1 ? ',':'' }}
</text>
</view>
......@@ -590,6 +590,12 @@ export default {
})
}
},
/* 过滤包装类型 */
uniqueArr(arr) {
if (!arr || !arr.length) return
return arr.split(',').filter((obj) =>
!['1', '2'].includes(obj));
},
// 过滤商品特性
uniqueProductAttrs(arr, field) {
let uniqueValues = [...new Set(arr.map(item => item[field].split(',')).flat())];
......
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