Compare commits

...

2 Commits

6 changed files with 45 additions and 34 deletions

View File

@ -173,27 +173,26 @@
// //
producrprice(e, i, item) { producrprice(e, i, item) {
this.bought[i].price = e.detail.value this.bought[i].price = e.detail.value
this.$set(item, 'check', false); // , ,
for (let i in this.checkedArr) { let obj = this.checkedArr.find((item)=>item.product_id==this.bought[i].product_id);
if (this.checkedArr[i].product_id == item.product_id) { obj ? obj.price = e.detail.value:null;
this.checkedArr.splice(i, 1) // this.$set(item, 'check', false);
} // for (let i in this.checkedArr) {
} // if (this.checkedArr[i].product_id == item.product_id) {
// this.checkedArr.splice(i, 1)
// }
// }
}, },
incrementTotal(e, i, item) { incrementTotal(e, i, item) {
this.$set(item, 'check', false); // this.$set(item, 'check', false);
for (let i in this.checkedArr) { // for (let i in this.checkedArr) {
if (this.checkedArr[i].product_id == item.product_id) { // if (this.checkedArr[i].product_id == item.product_id) {
this.checkedArr.splice(i, 1) // this.checkedArr.splice(i, 1)
} // }
} // }
}, },
// picker // picker
@ -216,8 +215,10 @@
}, },
numberChange(data, i) { numberChange(data, i) {
this.peicenumber = data.number; this.peicenumber = data.number;
this.bought[i].number = data.number this.bought[i].number = data.number;
// , ,
let obj = this.checkedArr.find((item)=>item.product_id==this.bought[i].product_id);
obj ? obj.number = data.number:null;
}, },
tabs(index) { tabs(index) {
@ -300,7 +301,6 @@
this.checkedArr.forEach((item, index) => { this.checkedArr.forEach((item, index) => {
this.checkedArr.push(item) this.checkedArr.push(item)
}) })
}, },
/*点击选中与否*/ /*点击选中与否*/
@ -330,7 +330,7 @@
} }
acc.push(cru) acc.push(cru)
} else { } else {
console.log(acc, hash[cru[name]]) // console.log(acc, hash[cru[name]])
acc.splice(hash[cru[name]]['index'], 1, cru) acc.splice(hash[cru[name]]['index'], 1, cru)
} }
@ -344,7 +344,7 @@
}, },
/*确定提交*/ /*确定提交*/
submit() { submit() {
console.log(this.checkedArr);
this.$emit('getProduct', this.checkedArr); this.$emit('getProduct', this.checkedArr);
}, },

View File

@ -173,6 +173,9 @@
// //
producrprice(e, i, item) { producrprice(e, i, item) {
this.bought[i].price = e.detail.value this.bought[i].price = e.detail.value
// , ,
let obj = this.checkedArr.find((item)=>item.product_id==this.bought[i].product_id);
obj ? obj.price = e.detail.value:null;
// this.$set(item, 'check', false); // this.$set(item, 'check', false);
// for (let i in this.checkedArr) { // for (let i in this.checkedArr) {
// if (this.checkedArr[i].product_id == item.product_id) { // if (this.checkedArr[i].product_id == item.product_id) {
@ -209,7 +212,9 @@
numberChange(data, i) { numberChange(data, i) {
this.peicenumber = data.number; this.peicenumber = data.number;
this.bought[i].number = data.number this.bought[i].number = data.number
// , ,
let obj = this.checkedArr.find((item)=>item.product_id==this.bought[i].product_id);
obj ? obj.number = data.number:null;
}, },
tabs(index) { tabs(index) {

View File

@ -72,7 +72,6 @@
<script> <script>
import associated from '@/components/realselist/realselist.vue'; import associated from '@/components/realselist/realselist.vue';
import eselect from '@/components/e-select/e-select.vue';
import { import {
supplychain, supplychain,
entrustchain, entrustchain,
@ -81,8 +80,7 @@
} from '@/api/sale.js' } from '@/api/sale.js'
export default { export default {
components: { components: {
associated, associated
eselect
}, },
data() { data() {
return { return {
@ -172,11 +170,15 @@
}, },
// //
getProduct(data) { getProduct(data) {
this.formData.product_info=[] console.log('选择商品', data);
this.productList = [];
this.formData.product_info = [];
this.formData.content = '';
if (data.length > 0) { if (data.length > 0) {
this.productList = data;
for (let i in data) { for (let i in data) {
this.formData.content += data[i].store_name + ',' this.formData.content += data[i].store_name + ',';
console.log(data[i].number);
this.formData.product_info.push({ this.formData.product_info.push({
product_attr_unique: data[i].product_attr_unique, product_attr_unique: data[i].product_attr_unique,
number: Number(data[i].number), number: Number(data[i].number),
@ -184,6 +186,8 @@
}) })
} }
} }
this.formData.content = this.formData.content.slice(0,-1);
console.log('选择商品', this.formData);
this.$refs.associated.close() this.$refs.associated.close()
}, },
// //
@ -522,7 +526,7 @@
.release_btn { .release_btn {
position: absolute; position: fixed;
bottom: 150rpx; bottom: 150rpx;
left: 50%; left: 50%;
margin-left: -347rpx; margin-left: -347rpx;

View File

@ -110,7 +110,7 @@
</view> </view>
<view class="content_bootm"> <view class="content_bootm">
<view class="content_bootm_txt"> <view class="content_bootm_txt">
查看TA提到的宝贝(2) 查看TA提到的宝贝({{objinfo.product_list.length||0}})
</view> </view>

View File

@ -52,9 +52,9 @@
编辑 编辑
</view> </view>
<span></span> <span></span>
<view class="contentgn_a" style="margin-left: 10rpx;" @click="deleteOrder(item)"> <!-- <view class="contentgn_a" style="margin-left: 10rpx;" @click="deleteOrder(item)">
删除 删除
</view> </view> -->
<span></span> <span></span>
<view class="contentgn_b" @click="detail(item)"> <view class="contentgn_b" @click="detail(item)">
详情 详情

View File

@ -62,7 +62,7 @@
<text class="text">规格模板</text> <text class="text">规格模板</text>
</navigator> </navigator>
<navigator class="item" <navigator class="item"
:url="`/pages/users/online_warehousing/index?mer_id=${mer_id}&product_id=${data.product_id}&unique=${data.unique}`" :url="`/pages/users/online_warehousing/index?mer_id=${mer_id}&product_id=${data.product_id}&unique=${data.unique}&type=${mer_info.type_code}`"
hover-class='none'> hover-class='none'>
<image mode='widthFix' class="image" src="@/static/images/daoru.png"></image> <image mode='widthFix' class="image" src="@/static/images/daoru.png"></image>
<text class="text">商品导入</text> <text class="text">商品导入</text>
@ -231,6 +231,7 @@
loaded: false, loaded: false,
loading: false, loading: false,
mer_id: '', mer_id: '',
mer_info: {},
productList: [], productList: [],
swiperCur: 0, swiperCur: 0,
circular: true, circular: true,
@ -285,6 +286,7 @@
this.mer_id = res.data.service.mer_id; this.mer_id = res.data.service.mer_id;
this.mer_info = res.data.mer_info;
this.getList(res.data.service.mer_id, true); this.getList(res.data.service.mer_id, true);