|
@@ -1,5 +1,4 @@
|
|
|
-//import { getGoodsDataApi,getProductDataApi,getPxClassDataApi } from "@/api/item/index";
|
|
|
|
|
-import { getProductDataApi } from "@/api/item/index";
|
|
|
|
|
|
|
+import { getProductDataApi } from "@/api/item";
|
|
|
import { getItemList } from "@/api/item/index";
|
|
import { getItemList } from "@/api/item/index";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
import { copyObject } from "@/utils/util";
|
|
import { copyObject } from "@/utils/util";
|
|
@@ -19,7 +18,6 @@ export default {
|
|
|
type: "", //库存预警时,固定为waring,其他情况不传或者传空
|
|
type: "", //库存预警时,固定为waring,其他情况不传或者传空
|
|
|
autoLoad: true, //自动获取商品信息
|
|
autoLoad: true, //自动获取商品信息
|
|
|
isLimit: true, //选择数量不能大于库存限制
|
|
isLimit: true, //选择数量不能大于库存限制
|
|
|
-
|
|
|
|
|
//成品开单
|
|
//成品开单
|
|
|
suit_scroll_into_view:"",
|
|
suit_scroll_into_view:"",
|
|
|
suit_top_list:'',
|
|
suit_top_list:'',
|
|
@@ -29,8 +27,7 @@ export default {
|
|
|
scroll_into_view:"",
|
|
scroll_into_view:"",
|
|
|
top_list:'',
|
|
top_list:'',
|
|
|
timeFun:"",
|
|
timeFun:"",
|
|
|
- filterProductInfo:'',
|
|
|
|
|
-
|
|
|
|
|
|
|
+ filterProductInfo:''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
@@ -760,17 +757,15 @@ export default {
|
|
|
addItemEvent(item) {
|
|
addItemEvent(item) {
|
|
|
const list = this.selectList;
|
|
const list = this.selectList;
|
|
|
if(!this.$util.isEmpty(list)){
|
|
if(!this.$util.isEmpty(list)){
|
|
|
|
|
+ let hasItem = false
|
|
|
for (let index = 0; index < list.length; index++) {
|
|
for (let index = 0; index < list.length; index++) {
|
|
|
const element = list[index];
|
|
const element = list[index];
|
|
|
if (element.id == item.id && element.classId == item.classId) {
|
|
if (element.id == item.id && element.classId == item.classId) {
|
|
|
|
|
+ hasItem = true
|
|
|
const { bigCount, smallCount } = list[index];
|
|
const { bigCount, smallCount } = list[index];
|
|
|
- //超过库存时 设置为库存最大值
|
|
|
|
|
const ratio = Number(item.ratio);
|
|
const ratio = Number(item.ratio);
|
|
|
if (this.isLimit) {
|
|
if (this.isLimit) {
|
|
|
- if (
|
|
|
|
|
- Number(bigCount) * ratio + Number(smallCount) >
|
|
|
|
|
- Number(item.bigNum) * ratio + Number(item.smallNum)
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ if ( Number(bigCount) * ratio + Number(smallCount) > Number(item.bigNum) * ratio + Number(item.smallNum) ) {
|
|
|
list[index].bigCount = Number(item.bigNum);
|
|
list[index].bigCount = Number(item.bigNum);
|
|
|
list[index].smallCount = Number(item.smallNum);
|
|
list[index].smallCount = Number(item.smallNum);
|
|
|
list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
|
|
list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
|
|
@@ -785,8 +780,11 @@ export default {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(hasItem == false){
|
|
|
|
|
+ list.push(item)
|
|
|
|
|
+ }
|
|
|
}else{
|
|
}else{
|
|
|
- list[0] = item
|
|
|
|
|
|
|
+ list.push(item)
|
|
|
}
|
|
}
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|