Commit 877e3f28 by LJM

fix部分问题

parent 13fca3da
...@@ -16,9 +16,6 @@ ...@@ -16,9 +16,6 @@
height: 92rpx; height: 92rpx;
line-height: 92rpx; line-height: 92rpx;
border-bottom: 1rpx solid #e7e7e7; border-bottom: 1rpx solid #e7e7e7;
&:last-child {
border-bottom: none;
}
} }
.address-box { .address-box {
display: block; display: block;
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<view class="cons"> <view class="cons">
<view class="top-box"> <view class="top-box">
<view class="tit">询价人:{{create_name}}</view> <view class="tit">询价人:{{create_name}}</view>
<view class="tit">公司名称:{{priceInfo.company_name}}</view> <view class="tit row verCenter">
公司名称:<input class="uni-input" v-model="company_name" />
</view>
<!-- <navigator :url="'/pages/user/address?form=confirmQuote&address_id='+address_id+'&coupon_id='+coupon_id" class="address-box"> <!-- <navigator :url="'/pages/user/address?form=confirmQuote&address_id='+address_id+'&coupon_id='+coupon_id" class="address-box">
<view class="addbx row bothSide verCenter"> <view class="addbx row bothSide verCenter">
<view class="l"> <view class="l">
...@@ -135,6 +137,7 @@ ...@@ -135,6 +137,7 @@
coupon_list: [], coupon_list: [],
coupon_id: "", coupon_id: "",
priceInfo: "", priceInfo: "",
company_name: '',
isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false
} }
}, },
...@@ -173,6 +176,7 @@ ...@@ -173,6 +176,7 @@
this.request(Api_Url + '/api/order/calQuotePrice', 'post', { sku_json: JSON.stringify(sku_), user_coupon_id: (this.coupon_id || "") }, true, true).then(res => { this.request(Api_Url + '/api/order/calQuotePrice', 'post', { sku_json: JSON.stringify(sku_), user_coupon_id: (this.coupon_id || "") }, true, true).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.priceInfo = res.data; this.priceInfo = res.data;
this.company_name = res.data.company_name;
this.pdf_email = res.data.recent_quote_email; this.pdf_email = res.data.recent_quote_email;
} }
...@@ -232,7 +236,8 @@ ...@@ -232,7 +236,8 @@
sku_json: JSON.stringify(goods_json_arr), sku_json: JSON.stringify(goods_json_arr),
user_coupon_id: this.coupon_id, user_coupon_id: this.coupon_id,
address_id: this.address_id, address_id: this.address_id,
purchase_sn: this.purchase_sn purchase_sn: this.purchase_sn,
company_name: this.company_name
} }
this.request(Api_Url + '/api/xcx/confirmQuote', 'post', obj_, true).then(res => { this.request(Api_Url + '/api/xcx/confirmQuote', 'post', obj_, true).then(res => {
if (res.code == 0) { if (res.code == 0) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view class="cons"> <view class="cons">
<view class="no-data" v-if="(!isLogin)||(dataInited&&carList.length==0)"> <view class="no-data" v-if="(!isLogin)||(dataInited&&carList.length==0)">
<image src="https://img.ichunt.com/images/ichunt/202502/19/7fdab385a25db187f8e57370875f7546.png"/> <image src="https://img.ichunt.com/images/ichunt/202502/19/7fdab385a25db187f8e57370875f7546.png" />
<text>暂无商品信息!</text> <text>暂无商品信息!</text>
</view> </view>
<view class="nodl" v-if="!isLogin"> <view class="nodl" v-if="!isLogin">
...@@ -26,15 +26,15 @@ ...@@ -26,15 +26,15 @@
<view class="list-box" v-if="carList.length>0"> <view class="list-box" v-if="carList.length>0">
<delSlideLeft v-for="(item,index) in carList" :key="index" @delItem="dels(item.sku_id)"> <delSlideLeft v-for="(item,index) in carList" :key="index" @delItem="dels(item.sku_id)">
<view class="item-group row verCenter bothSide" > <view class="item-group row verCenter bothSide">
<view class="l row verCenter"> <view class="l row verCenter">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" @click.stop="checkboxchange(item.sku_id)"></text> <text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" @click.stop="checkboxchange(item.sku_id)"></text>
<navigator :url="'/pages/goods/detail?goods_id='+item.sku_id" > <navigator :url="'/pages/goods/detail?goods_id='+item.sku_id">
<image :src="item.goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'"/> <image :src="item.goods_info.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
</navigator> </navigator>
</view> </view>
<view class="r"> <view class="r">
<navigator :url="'/pages/goods/detail?goods_id='+item.sku_id" > <navigator :url="'/pages/goods/detail?goods_id='+item.sku_id">
<view class="elep skun">{{item.goods_info.sku_name}}</view> <view class="elep skun">{{item.goods_info.sku_name}}</view>
<view class="txt">型号:{{item.goods_info.goods_name}}</view> <view class="txt">型号:{{item.goods_info.goods_name}}</view>
<view class="txt">品牌:{{item.goods_info.brand_name}}</view> <view class="txt">品牌:{{item.goods_info.brand_name}}</view>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<view class="price">¥{{item.price}}</view> <view class="price">¥{{item.price}}</view>
<view class="hbha row verCenter bothSide"> <view class="hbha row verCenter bothSide">
<text class="icon iconfont icon-jian" @click="addjNum(item.sku_id,1)"></text> <text class="icon iconfont icon-jian" @click="addjNum(item.sku_id,1)"></text>
<input type="number" v-model="item.goods_num" @input="changeNum(item.sku_id)"/> <input type="number" v-model="item.goods_num" @input="changeNum(item.sku_id)" />
<text class="icon iconfont icon-jia" @click="addjNum(item.sku_id,2)"></text> <text class="icon iconfont icon-jia" @click="addjNum(item.sku_id,2)"></text>
</view> </view>
</view> </view>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</view> </view>
<bottomNavFixed actval="3" ref="bottomNav"/> <bottomNavFixed actval="3" ref="bottomNav" />
<!--加入清单--> <!--加入清单-->
<uni-popup ref="popupaddlist" type="bottom" :safe-area="false"> <uni-popup ref="popupaddlist" type="bottom" :safe-area="false">
...@@ -81,14 +81,13 @@ ...@@ -81,14 +81,13 @@
<view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view> <view class="trt"><text class="icon iconfont icon-caca" @click="closeAddList"></text></view>
<view class="ttit elep">加入清单</view> <view class="ttit elep">加入清单</view>
<view class="new-box row"> <view class="new-box row">
<text class="new-btn row verCenter" @click="openNewList">新建清单<text <text class="new-btn row verCenter" @click="openNewList">新建清单<text class="icon iconfont icon-jia"></text></text>
class="icon iconfont icon-jia"></text></text>
</view> </view>
<view class="list-box" v-if="qDList.length>0"> <view class="list-box" v-if="qDList.length>0">
<view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index"> <view class="item row verCenter bothSide" v-for="(item,index) in qDList" :key="index">
<view class="row verCenter" @click.stop="chooseQd(item.list_id)"> <view class="row verCenter" @click.stop="chooseQd(item.list_id)">
<view class="l"> <view class="l">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" ></text> <text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}"></text>
</view> </view>
<view class="c"> <view class="c">
<view class="elep">{{item.list_name}}</view> <view class="elep">{{item.list_name}}</view>
...@@ -120,7 +119,7 @@ ...@@ -120,7 +119,7 @@
<view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view> <view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view>
<view class="ttit elep">新建清单</view> <view class="ttit elep">新建清单</view>
<view class="cons"> <view class="cons">
<input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品编码;" /> <input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品分类;" />
</view> </view>
<view class="add-list" @click="createList()">确认</view> <view class="add-list" @click="createList()">确认</view>
</view> </view>
...@@ -130,7 +129,7 @@ ...@@ -130,7 +129,7 @@
</template> </template>
<script> <script>
import {Api_Url} from '@/util/api.js' import { Api_Url } from '@/util/api.js'
import barX from '@/components/barx.vue'; import barX from '@/components/barx.vue';
import delSlideLeft from '@/components/ay-operate/del_slideLeft.vue' import delSlideLeft from '@/components/ay-operate/del_slideLeft.vue'
import bottomNavFixed from '@/components/bottom_nav.vue'; import bottomNavFixed from '@/components/bottom_nav.vue';
...@@ -138,40 +137,40 @@ ...@@ -138,40 +137,40 @@
export default { export default {
data() { data() {
return { return {
timeout:"",//请求延迟定时器 timeout: "", //请求延迟定时器
dataInited:false,//是否加载过数据 dataInited: false, //是否加载过数据
allcheck:true, allcheck: true,
isEdit:false, isEdit: false,
carList: [], carList: [],
totalprice:0, totalprice: 0,
checkcount:0, checkcount: 0,
isLogin:uni.getStorageSync('token')?true:false, isLogin: uni.getStorageSync('token') ? true : false,
list_name:"",//清单名字 list_name: "", //清单名字
qDList:[] qDList: []
} }
}, },
onLoad: function() { onLoad: function() {
if(this.isLogin){ if (this.isLogin) {
this.getData() this.getData()
} }
this.getQdList() this.getQdList()
}, },
methods: { methods: {
getData(type){ getData(type) {
if(!type){ if (!type) {
this.carList=[] this.carList = []
} }
this.request(Api_Url + '/api/cart/getCartList', 'GET', {}, (type?false:true)).then(res => { this.request(Api_Url + '/api/cart/getCartList', 'GET', {}, (type ? false : true)).then(res => {
this.dataInited = true; this.dataInited = true;
this.allcheck=true this.allcheck = true
this.carList=[] this.carList = []
if (res.code == 0) { if (res.code == 0) {
let arr_ = res.data.delivery_time_data || [] let arr_ = res.data.delivery_time_data || []
let newArr=[] let newArr = []
Object.keys(arr_).forEach(item=>{ Object.keys(arr_).forEach(item => {
arr_[item].forEach(item1=>{ arr_[item].forEach(item1 => {
newArr.push(item1) newArr.push(item1)
}) })
}) })
...@@ -184,28 +183,28 @@ ...@@ -184,28 +183,28 @@
} }
}); });
}, },
listUi(){ listUi() {
this.totalprice=0 this.totalprice = 0
this.checkcount=0 this.checkcount = 0
this.carList.forEach(item=>{ this.carList.forEach(item => {
if(item.checked){ if (item.checked) {
this.checkcount++ this.checkcount++
this.totalprice+=Number(item.price*item.goods_num) this.totalprice += Number(item.price * item.goods_num)
} }
}) })
this.totalprice=this.totalprice.toFixed(2) this.totalprice = this.totalprice.toFixed(2)
}, },
changeNum(sku_id,type){ changeNum(sku_id, type) {
clearTimeout(this.timeout); clearTimeout(this.timeout);
this.timeout = setTimeout(() => { this.timeout = setTimeout(() => {
let result=(this.carList.filter(item=>(item.sku_id==sku_id)))[0] let result = (this.carList.filter(item => (item.sku_id == sku_id)))[0]
let mpl = Number(result.goods_info.multiple||result.goods_info.mpl);//倍数 加减的数量基数 let mpl = Number(result.goods_info.multiple || result.goods_info.mpl); //倍数 加减的数量基数
let stock = Number(result.goods_info.stock);//库存 let stock = Number(result.goods_info.stock); //库存
let moq = Number(result.goods_info.moq);//起订量 let moq = Number(result.goods_info.moq); //起订量
let value_ = Number(result.goods_num);//当前的数量 let value_ = Number(result.goods_num); //当前的数量
value_ = Math.ceil(value_ / mpl) * mpl;//失去焦点数量 value_ = Math.ceil(value_ / mpl) * mpl; //失去焦点数量
result.goods_num = value_;//最终的数量 result.goods_num = value_; //最终的数量
if (value_ < moq) { if (value_ < moq) {
result.goods_num = moq result.goods_num = moq
} }
...@@ -213,41 +212,41 @@ ...@@ -213,41 +212,41 @@
result.goods_num = Math.floor(stock / mpl) * mpl; result.goods_num = Math.floor(stock / mpl) * mpl;
} }
this.request(Api_Url + '/api/cart/updateCartNum', 'POST', { this.request(Api_Url + '/api/cart/updateCartNum', 'POST', {
sku_id:result.sku_id, sku_id: result.sku_id,
goods_num: result.goods_num goods_num: result.goods_num
}, false).then(res => { }, false).then(res => {
this.listUi() this.listUi()
}); });
}, 800); }, 800);
}, },
addjNum(sku_id,type){ addjNum(sku_id, type) {
let result=(this.carList.filter(item=>(item.sku_id==sku_id)))[0] let result = (this.carList.filter(item => (item.sku_id == sku_id)))[0]
let mpl = Number(result.goods_info.multiple||result.goods_info.mpl);//倍数 加减的数量基数 let mpl = Number(result.goods_info.multiple || result.goods_info.mpl); //倍数 加减的数量基数
let stock = Number(result.goods_info.stock);//库存 let stock = Number(result.goods_info.stock); //库存
let moq = Number(result.goods_info.moq);//起订量 let moq = Number(result.goods_info.moq); //起订量
let value_ = Number(result.goods_num);//当前的数量 let value_ = Number(result.goods_num); //当前的数量
if(type==1){ if (type == 1) {
//减法 //减法
var down_value = value_ - mpl;//减过后的值 var down_value = value_ - mpl; //减过后的值
if (down_value < moq) { if (down_value < moq) {
result.goods_num = moq; result.goods_num = moq;
uni.showToast({ uni.showToast({
title: '数量不能小于起订量', title: '数量不能小于起订量',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
} else { } else {
result.goods_num=down_value result.goods_num = down_value
} }
}else{ } else {
//加法 //加法
var up_value = value_ + mpl;//加过后的值 var up_value = value_ + mpl; //加过后的值
if (up_value > stock) { if (up_value > stock) {
uni.showToast({ uni.showToast({
title: '数量不能大于库存', title: '数量不能大于库存',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
result.goods_num = Math.floor(stock / mpl) * mpl; result.goods_num = Math.floor(stock / mpl) * mpl;
} else { } else {
...@@ -255,74 +254,74 @@ ...@@ -255,74 +254,74 @@
} }
} }
this.request(Api_Url + '/api/cart/updateCartNum', 'POST', { this.request(Api_Url + '/api/cart/updateCartNum', 'POST', {
sku_id:result.sku_id, sku_id: result.sku_id,
goods_num: result.goods_num goods_num: result.goods_num
}, false).then(res => { }, false).then(res => {
this.listUi() this.listUi()
}); });
}, },
checkboxchange(sku_id){ checkboxchange(sku_id) {
if(sku_id=='460053411'){ if (sku_id == '460053411') {
this.allcheck=!this.allcheck this.allcheck = !this.allcheck
//全选 //全选
this.carList.forEach(item=>{ this.carList.forEach(item => {
item.checked=this.allcheck item.checked = this.allcheck
}) })
}else{ } else {
var isall=1; var isall = 1;
this.carList.forEach(item=>{ this.carList.forEach(item => {
if(item.sku_id==sku_id){ if (item.sku_id == sku_id) {
item.checked=!item.checked item.checked = !item.checked
} }
if(!item.checked){ if (!item.checked) {
isall=0; isall = 0;
} }
}) })
if(!isall){ if (!isall) {
this.allcheck=false this.allcheck = false
}else{ } else {
this.allcheck=true this.allcheck = true
} }
} }
this.listUi() this.listUi()
return false return false
}, },
dels(sku_id){ dels(sku_id) {
let result=this.carList.filter(item=>item.checked) let result = this.carList.filter(item => item.checked)
let ids=result.map(item=>item.sku_id).join(',') let ids = result.map(item => item.sku_id).join(',')
if(sku_id){ if (sku_id) {
ids=String(sku_id) ids = String(sku_id)
} }
if(!ids){ if (!ids) {
uni.showToast({ uni.showToast({
title: '请选择至少一个商品', title: '请选择至少一个商品',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
return return
} }
uni.showModal({ uni.showModal({
title:"删除", title: "删除",
content:"是否删除当前"+(sku_id?"选中":"")+"商品?", content: "是否删除当前" + (sku_id ? "选中" : "") + "商品?",
success:(resp)=>{ success: (resp) => {
if (resp.confirm) { if (resp.confirm) {
this.request(Api_Url + '/api/cart/delCart', 'POST', {sku_id: ids}, true).then(res => { this.request(Api_Url + '/api/cart/delCart', 'POST', { sku_id: ids }, true).then(res => {
if(res.code==0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
this.$refs.bottomNav.updateCar() this.$refs.bottomNav.updateCar()
let result=this.carList.filter(item=>ids.indexOf(item.sku_id)==-1) let result = this.carList.filter(item => ids.indexOf(item.sku_id) == -1)
this.carList=JSON.parse(JSON.stringify(result)) this.carList = JSON.parse(JSON.stringify(result))
this.listUi() this.listUi()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
} }
}); });
...@@ -330,63 +329,63 @@ ...@@ -330,63 +329,63 @@
} }
}) })
}, },
confirm(type){ confirm(type) {
let result=this.carList.filter(item=>item.checked) let result = this.carList.filter(item => item.checked)
let ids=result.map(item=>item.sku_id).join(',') let ids = result.map(item => item.sku_id).join(',')
if(!ids){ if (!ids) {
uni.showToast({ uni.showToast({
title: '请选择至少一个商品', title: '请选择至少一个商品',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
return return
} }
uni.setStorageSync('car_ids', ids); uni.setStorageSync('car_ids', ids);
uni.setStorageSync('confirmOrderBackUrl',`/pages/car/list`) uni.setStorageSync('confirmOrderBackUrl', `/pages/car/list`)
uni.navigateTo({ uni.navigateTo({
url: type==1?'/pages/car/confirmOrder':'/pages/car/confirmQuote' url: type == 1 ? '/pages/car/confirmOrder' : '/pages/car/confirmQuote'
}); });
}, },
getQdList(){ getQdList() {
if(!uni.getStorageSync('token')){return} if (!uni.getStorageSync('token')) { return }
this.request(Api_Url + '/api/xcx/getGoodsList', 'get', {page:1,limit:100}, false).then(res => { this.request(Api_Url + '/api/xcx/getGoodsList', 'get', { page: 1, limit: 100 }, false).then(res => {
this.qDList=[] this.qDList = []
if(res.code==0){ if (res.code == 0) {
let arr_=res.data.list||[] let arr_ = res.data.list || []
arr_.forEach(item=>{ arr_.forEach(item => {
item.checked=false item.checked = false
}) })
this.qDList=arr_ this.qDList = arr_
} }
}) })
}, },
chooseQd(list_id){ chooseQd(list_id) {
this.qDList.forEach(item=>{ this.qDList.forEach(item => {
if(item.list_id==list_id){ if (item.list_id == list_id) {
item.checked=!item.checked item.checked = !item.checked
}else{ } else {
item.checked=false item.checked = false
} }
}) })
}, },
createList(){ createList() {
if(!this.list_name){ if (!this.list_name) {
uni.showToast({ uni.showToast({
title: "请输入清单名称", title: "请输入清单名称",
icon: 'none' icon: 'none'
}); });
return return
} }
this.request(Api_Url + '/api/xcx/createGoodsList', 'post', {list_name:this.list_name}, true).then(res => { this.request(Api_Url + '/api/xcx/createGoodsList', 'post', { list_name: this.list_name }, true).then(res => {
if(res.code==0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title: "创建清单成功", title: "创建清单成功",
icon: 'success' icon: 'success'
}); });
this.closeNewList() this.closeNewList()
this.getQdList() this.getQdList()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'nonde' icon: 'nonde'
...@@ -395,37 +394,37 @@ ...@@ -395,37 +394,37 @@
}) })
}, },
addQdList(){ addQdList() {
let checkList=this.qDList.filter(item=>item.checked) let checkList = this.qDList.filter(item => item.checked)
if(checkList.length==0){ if (checkList.length == 0) {
uni.showToast({ uni.showToast({
title: "请选择一条清单", title: "请选择一条清单",
icon: 'none' icon: 'none'
}); });
return return
} }
let checkedArr=this.carList.filter(item=>item.checked) let checkedArr = this.carList.filter(item => item.checked)
let sku_json=[] let sku_json = []
checkedArr.forEach(item=>{ checkedArr.forEach(item => {
sku_json.push({ sku_json.push({
sku_id:item.sku_id, sku_id: item.sku_id,
qty:item.goods_num qty: item.goods_num
}) })
}) })
this.request(Api_Url + '/api/xcx/addGoodsList', 'post', { this.request(Api_Url + '/api/xcx/addGoodsList', 'post', {
list_id:checkList[0].list_id, list_id: checkList[0].list_id,
sku_json:JSON.stringify(sku_json) sku_json: JSON.stringify(sku_json)
}, true,true).then(res => { }, true, true).then(res => {
if(res.code==0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title: "加入清单成功", title: "加入清单成功",
icon: 'success' icon: 'success'
}); });
this.closeAddList() this.closeAddList()
this.getQdList() this.getQdList()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'nonde' icon: 'nonde'
...@@ -436,17 +435,17 @@ ...@@ -436,17 +435,17 @@
}, },
openAddList() { openAddList() {
let checkedArr=this.carList.filter(item=>item.checked) let checkedArr = this.carList.filter(item => item.checked)
if(checkedArr.length==0){ if (checkedArr.length == 0) {
uni.showToast({ uni.showToast({
title: "请至少选择一条数据", title: "请至少选择一条数据",
icon: 'none' icon: 'none'
}); });
return return
} }
if(!uni.getStorageSync('token')){ if (!uni.getStorageSync('token')) {
uni.navigateTo({ uni.navigateTo({
url:"/pages/auth/login?referer="+encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`) url: "/pages/auth/login?referer=" + encodeURIComponent(`/pages/goods/detail?goods_id=${this.goods_id_page}`)
}) })
return return
} }
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
<view class="input-box"> <view class="input-box">
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label required">公司名称</text> <text class="label required">公司名称</text>
<input type="text" v-model="formParams.com_name" placeholder="请输入公司名称" placeholder-class="placeholder-class" @blur="tianyancha()" /> <input type="text" v-model="formParams.com_name" placeholder="请输入公司名称" placeholder-class="placeholder-class" @blur="tianyancha()" :disabled="id" />
</view> </view>
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label required ">公司税号</text> <text class="label required ">公司税号</text>
<input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" /> <input type="text" v-model="formParams.tax_no" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" :disabled="id" />
</view> </view>
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label required">公司电话</text> <text class="label required">公司电话</text>
<input type="text" v-model="formParams.com_tel" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" /> <input type="text" v-model="formParams.com_tel" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" :disabled="id" />
</view> </view>
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label required">注册地址</text> <text class="label required">注册地址</text>
<input type="text" v-model="formParams.com_addr" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" /> <input type="text" v-model="formParams.com_addr" placeholder="系统自动查询后补充" placeholder-class="placeholder-class" :disabled="id" />
</view> </view>
<view class="input-group row verCenter"> <view class="input-group row verCenter">
<text class="label required">联系人</text> <text class="label required">联系人</text>
......
...@@ -6,15 +6,15 @@ ...@@ -6,15 +6,15 @@
<text class="icon iconfont icon-arrowleft" @click="$goBack"></text> <text class="icon iconfont icon-arrowleft" @click="$goBack"></text>
<view>清单详情</view> <view>清单详情</view>
</view> </view>
<view class="r row verCenter" > <view class="r row verCenter">
<text @click="dels()">删除</text> <text @click="dels()">删除</text>
</view> </view>
</view> </view>
<view class="name-box row verCenter"><text @click="openNewList">{{list_name}}<text class="icon iconfont icon-edit" ></text></text></view> <view class="name-box row verCenter"><text @click="openNewList">{{list_name}}<text class="icon iconfont icon-edit"></text></text></view>
<view class="cons"> <view class="cons">
<view class="no-data" v-if="dataInited&&carList.length==0"> <view class="no-data" v-if="dataInited&&carList.length==0">
<image src="https://img.ichunt.com/images/ichunt/202502/19/7fdab385a25db187f8e57370875f7546.png"/> <image src="https://img.ichunt.com/images/ichunt/202502/19/7fdab385a25db187f8e57370875f7546.png" />
<text>暂无商品信息!</text> <text>暂无商品信息!</text>
</view> </view>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<view class="item-group row verCenter bothSide" v-for="(item,index) in carList" :key="index"> <view class="item-group row verCenter bothSide" v-for="(item,index) in carList" :key="index">
<view class="l row verCenter"> <view class="l row verCenter">
<text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" @click.stop="checkboxchange(item.sku_id)"></text> <text class="icon iconfont icon-checked1" :class="{'icon-checked':item.checked}" @click.stop="checkboxchange(item.sku_id)"></text>
<image :src="item.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'"/> <image :src="item.goods_images||'https://www.iedge.net/assets/images/common/defaultnew.png'" />
</view> </view>
<view class="r"> <view class="r">
<view class="elep skun">{{item.sku_name}}</view> <view class="elep skun">{{item.sku_name}}</view>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<view class="price">¥{{item.goods_price}}</view> <view class="price">¥{{item.goods_price}}</view>
<view class="hbha row verCenter bothSide"> <view class="hbha row verCenter bothSide">
<text class="icon iconfont icon-jian" @click="addjNum(item.sku_id,1)"></text> <text class="icon iconfont icon-jian" @click="addjNum(item.sku_id,1)"></text>
<input type="number" v-model="item.goods_count" @input="changeNum(item.sku_id)"/> <input type="number" v-model="item.goods_count" @input="changeNum(item.sku_id)" />
<text class="icon iconfont icon-jia" @click="addjNum(item.sku_id,2)"></text> <text class="icon iconfont icon-jia" @click="addjNum(item.sku_id,2)"></text>
</view> </view>
</view> </view>
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
<view class="car-foot car-foot1 row bothSide"> <view class="car-foot car-foot1 row bothSide">
<view class="t row bothSide verCenter"> <view class="t row bothSide verCenter">
<view class="checked-box row verCenter" @click.stop="checkboxchange(460053411)"><text class="icon iconfont icon-checked1" :class="{'icon-checked':allcheck}"></text>全选</view> <view class="checked-box row verCenter" @click.stop="checkboxchange(460053411)"><text class="icon iconfont icon-checked1" :class="{'icon-checked':allcheck}"></text>全选</view>
<view class="pbx">已选{{checkcount}}件,含税总额:<view class="price">¥ {{totalprice}}</view></view> <view class="pbx">已选{{checkcount}}件,含税总额:<view class="price">¥ {{totalprice}}</view>
</view>
</view> </view>
<view class="b row bothSide verCenter"> <view class="b row bothSide verCenter">
<view class="row verCenter bothSide"> <view class="row verCenter bothSide">
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
<view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view> <view class="trt"><text class="icon iconfont icon-caca" @click="closeNewList"></text></view>
<view class="ttit elep">修改清单</view> <view class="ttit elep">修改清单</view>
<view class="cons"> <view class="cons">
<input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品编码;" /> <input type="text" class="inputv" v-model="list_name" placeholder="请输入清单名称,若未输入则显示商品分类;" />
</view> </view>
<view class="add-list" @click="updateList()">确认</view> <view class="add-list" @click="updateList()">确认</view>
</view> </view>
...@@ -81,17 +82,17 @@ ...@@ -81,17 +82,17 @@
export default { export default {
data() { data() {
return { return {
checkcount:0, checkcount: 0,
timeout:"",//请求延迟定时器 timeout: "", //请求延迟定时器
dataInited:false,//是否加载过数据 dataInited: false, //是否加载过数据
allcheck:true, allcheck: true,
isEdit:false, isEdit: false,
carList: [], carList: [],
totalprice:0, totalprice: 0,
list_id:"", list_id: "",
share_uuid:"", share_uuid: "",
list_name:"",//清单名字 list_name: "", //清单名字
isCompany:(uni.getStorageSync('user_info')&&JSON.parse(uni.getStorageSync('user_info')).company_name)?true:false, isCompany: (uni.getStorageSync('user_info') && JSON.parse(uni.getStorageSync('user_info')).company_name) ? true : false,
miniShareOptions: { miniShareOptions: {
title: '给您分享我的清单', title: '给您分享我的清单',
path: '/pages/user/qdDetail', path: '/pages/user/qdDetail',
...@@ -101,8 +102,8 @@ ...@@ -101,8 +102,8 @@
} }
}, },
onLoad: function(options) { onLoad: function(options) {
this.list_id=options.list_id this.list_id = options.list_id
this.share_uuid=options.share_uuid this.share_uuid = options.share_uuid
this.getData() this.getData()
}, },
...@@ -141,55 +142,55 @@ ...@@ -141,55 +142,55 @@
}; };
}, },
methods: { methods: {
getData(type){ getData(type) {
if(!type){ if (!type) {
this.carList=[] this.carList = []
} }
this.request(Api_Url + '/api/xcx/goodsListDetail', 'GET', {list_id:this.list_id,share_uuid:(this.share_uuid||'')}, (type?false:true)).then(res => { this.request(Api_Url + '/api/xcx/goodsListDetail', 'GET', { list_id: this.list_id, share_uuid: (this.share_uuid || '') }, (type ? false : true)).then(res => {
this.dataInited = true; this.dataInited = true;
this.allcheck=true this.allcheck = true
this.carList=[] this.carList = []
if (res.code == 0) { if (res.code == 0) {
this.list_name=res.data.info.list_name this.list_name = res.data.info.list_name
this.list_id=res.data.info.list_id this.list_id = res.data.info.list_id
this.share_uuid=res.data.info.share_uuid this.share_uuid = res.data.info.share_uuid
this.miniShareOptions.path='/pages/user/qdDetail?list_id='+this.list_id+"&share_uuid="+this.share_uuid this.miniShareOptions.path = '/pages/user/qdDetail?list_id=' + this.list_id + "&share_uuid=" + this.share_uuid
let arr_ = res.data.list || [] let arr_ = res.data.list || []
arr_.forEach(item => { arr_.forEach(item => {
item.checked = true item.checked = true
item.buyPrice=item.goods_price item.buyPrice = item.goods_price
if(item.ladder_price&&item.ladder_price.length>0){ if (item.ladder_price && item.ladder_price.length > 0) {
item.buyPrice=this.isCompany?(item['ladder_price'][1]['price_cn']||0):(item['ladder_price'][0]['price_cn']||0) item.buyPrice = this.isCompany ? (item['ladder_price'][1]['price_cn'] || 0) : (item['ladder_price'][0]['price_cn'] || 0)
} }
item.goods_price=item.buyPrice item.goods_price = item.buyPrice
this.carList.push(item) this.carList.push(item)
}) })
this.listUi() this.listUi()
} }
}); });
}, },
listUi(){ listUi() {
this.totalprice=0 this.totalprice = 0
this.checkcount=0 this.checkcount = 0
this.carList.forEach(item=>{ this.carList.forEach(item => {
if(item.checked){ if (item.checked) {
this.checkcount++ this.checkcount++
this.totalprice+=Number(item.goods_price*item.goods_count) this.totalprice += Number(item.goods_price * item.goods_count)
} }
}) })
this.totalprice=this.totalprice.toFixed(2) this.totalprice = this.totalprice.toFixed(2)
}, },
changeNum(sku_id,type){ changeNum(sku_id, type) {
clearTimeout(this.timeout); clearTimeout(this.timeout);
this.timeout = setTimeout(() => { this.timeout = setTimeout(() => {
let result=(this.carList.filter(item=>(item.sku_id==sku_id)))[0] let result = (this.carList.filter(item => (item.sku_id == sku_id)))[0]
let mpl = Number(result.multiple||result.mpl);//倍数 加减的数量基数 let mpl = Number(result.multiple || result.mpl); //倍数 加减的数量基数
let stock = Number(result.stock);//库存 let stock = Number(result.stock); //库存
let moq = Number(result.moq);//起订量 let moq = Number(result.moq); //起订量
let value_ = Number(result.goods_count);//当前的数量 let value_ = Number(result.goods_count); //当前的数量
value_ = Math.ceil(value_ / mpl) * mpl;//失去焦点数量 value_ = Math.ceil(value_ / mpl) * mpl; //失去焦点数量
result.goods_count = value_;//最终的数量 result.goods_count = value_; //最终的数量
if (value_ < moq) { if (value_ < moq) {
result.goods_count = moq result.goods_count = moq
} }
...@@ -197,42 +198,42 @@ ...@@ -197,42 +198,42 @@
result.goods_count = Math.floor(stock / mpl) * mpl; result.goods_count = Math.floor(stock / mpl) * mpl;
} }
this.request(Api_Url + '/api/xcx/updateGoodsNum', 'POST', { this.request(Api_Url + '/api/xcx/updateGoodsNum', 'POST', {
sku_id:result.sku_id, sku_id: result.sku_id,
goods_num: result.goods_count, goods_num: result.goods_count,
list_id:this.list_id list_id: this.list_id
}, false).then(res => { }, false).then(res => {
this.listUi() this.listUi()
}); });
}, 800); }, 800);
}, },
addjNum(sku_id,type){ addjNum(sku_id, type) {
let result=(this.carList.filter(item=>(item.sku_id==sku_id)))[0] let result = (this.carList.filter(item => (item.sku_id == sku_id)))[0]
let mpl = Number(result.multiple||result.mpl);//倍数 加减的数量基数 let mpl = Number(result.multiple || result.mpl); //倍数 加减的数量基数
let stock = Number(result.stock);//库存 let stock = Number(result.stock); //库存
let moq = Number(result.moq);//起订量 let moq = Number(result.moq); //起订量
let value_ = Number(result.goods_count);//当前的数量 let value_ = Number(result.goods_count); //当前的数量
if(type==1){ if (type == 1) {
//减法 //减法
var down_value = value_ - mpl;//减过后的值 var down_value = value_ - mpl; //减过后的值
if (down_value < moq) { if (down_value < moq) {
result.goods_count = moq; result.goods_count = moq;
uni.showToast({ uni.showToast({
title: '数量不能小于起订量', title: '数量不能小于起订量',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
} else { } else {
result.goods_count=down_value result.goods_count = down_value
} }
}else{ } else {
//加法 //加法
var up_value = value_ + mpl;//加过后的值 var up_value = value_ + mpl; //加过后的值
if (up_value > stock) { if (up_value > stock) {
uni.showToast({ uni.showToast({
title: '数量不能大于库存', title: '数量不能大于库存',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
result.goods_count = Math.floor(stock / mpl) * mpl; result.goods_count = Math.floor(stock / mpl) * mpl;
} else { } else {
...@@ -240,71 +241,71 @@ ...@@ -240,71 +241,71 @@
} }
} }
this.request(Api_Url + '/api/xcx/updateGoodsNum', 'POST', { this.request(Api_Url + '/api/xcx/updateGoodsNum', 'POST', {
sku_id:result.sku_id, sku_id: result.sku_id,
goods_num: result.goods_count, goods_num: result.goods_count,
list_id:this.list_id list_id: this.list_id
}, false).then(res => { }, false).then(res => {
this.listUi() this.listUi()
}); });
}, },
checkboxchange(sku_id){ checkboxchange(sku_id) {
if(sku_id=='460053411'){ if (sku_id == '460053411') {
this.allcheck=!this.allcheck this.allcheck = !this.allcheck
//全选 //全选
this.carList.forEach(item=>{ this.carList.forEach(item => {
item.checked=this.allcheck item.checked = this.allcheck
}) })
}else{ } else {
var isall=1; var isall = 1;
this.carList.forEach(item=>{ this.carList.forEach(item => {
if(item.sku_id==sku_id){ if (item.sku_id == sku_id) {
item.checked=!item.checked item.checked = !item.checked
} }
if(!item.checked){ if (!item.checked) {
isall=0; isall = 0;
} }
}) })
if(!isall){ if (!isall) {
this.allcheck=false this.allcheck = false
}else{ } else {
this.allcheck=true this.allcheck = true
} }
} }
this.listUi() this.listUi()
return false return false
}, },
dels(){ dels() {
let result=this.carList.filter(item=>item.checked) let result = this.carList.filter(item => item.checked)
let ids=result.map(item=>item.sku_id).join(',') let ids = result.map(item => item.sku_id).join(',')
if(!ids){ if (!ids) {
uni.showToast({ uni.showToast({
title: '请选择至少一个商品', title: '请选择至少一个商品',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
return return
} }
uni.showModal({ uni.showModal({
title:"删除", title: "删除",
content:"是否删除当前选中商品?", content: "是否删除当前选中商品?",
success:(resp)=>{ success: (resp) => {
if (resp.confirm) { if (resp.confirm) {
this.request(Api_Url + '/api/xcx/delGoods', 'POST', {list_id:this.list_id,sku_ids: ids}, true).then(res => { this.request(Api_Url + '/api/xcx/delGoods', 'POST', { list_id: this.list_id, sku_ids: ids }, true).then(res => {
if(res.code==0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
let result=this.carList.filter(item=>ids.indexOf(item.sku_id)==-1) let result = this.carList.filter(item => ids.indexOf(item.sku_id) == -1)
this.carList=JSON.parse(JSON.stringify(result)) this.carList = JSON.parse(JSON.stringify(result))
this.listUi() this.listUi()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
} }
}); });
...@@ -312,42 +313,42 @@ ...@@ -312,42 +313,42 @@
} }
}) })
}, },
addCar(type){ addCar(type) {
let json_arr=[] let json_arr = []
let ids=[] let ids = []
this.carList.forEach(item=>{ this.carList.forEach(item => {
if(item.checked){ if (item.checked) {
let js_={ let js_ = {
goods_num:item.goods_count, goods_num: item.goods_count,
sku_id:item.sku_id, sku_id: item.sku_id,
price:item.goods_price price: item.goods_price
} }
if(type==1){ if (type == 1) {
js_.is_cover_goods_num=1 js_.is_cover_goods_num = 1
} }
json_arr.push(js_) json_arr.push(js_)
ids.push(item.sku_id) ids.push(item.sku_id)
} }
}) })
if(ids.length==0){ if (ids.length == 0) {
uni.showToast({ uni.showToast({
title:"请勾选商品", title: "请勾选商品",
icon: 'none' icon: 'none'
}); });
return return
} }
this.request(Api_Url + '/api/cart/batchAddCart', 'POST', {sku_json:JSON.stringify(json_arr)}, true).then(res => { this.request(Api_Url + '/api/cart/batchAddCart', 'POST', { sku_json: JSON.stringify(json_arr) }, true).then(res => {
if (res.code == 0) { if (res.code == 0) {
if(type==1){ if (type == 1) {
uni.setStorageSync('car_ids',ids.join(",")); uni.setStorageSync('car_ids', ids.join(","));
uni.setStorageSync('confirmOrderBackUrl',`/pages/user/qdDetail?list_id=${this.list_id}`) uni.setStorageSync('confirmOrderBackUrl', `/pages/user/qdDetail?list_id=${this.list_id}`)
uni.navigateTo({ uni.navigateTo({
url:'/pages/car/confirmOrder' url: '/pages/car/confirmOrder'
}); });
}else{ } else {
uni.showToast({ uni.showToast({
title:"加入购物车成功", title: "加入购物车成功",
icon: 'success' icon: 'success'
}); });
} }
...@@ -360,22 +361,22 @@ ...@@ -360,22 +361,22 @@
} }
}); });
}, },
updateList(){ updateList() {
if(!this.list_name){ if (!this.list_name) {
uni.showToast({ uni.showToast({
title: '请输入清单名字', title: '请输入清单名字',
duration: 2000, duration: 2000,
icon:"none" icon: "none"
}) })
} }
this.request(Api_Url + '/api/xcx/updateGoodsList', 'post', {list_name:this.list_name,list_id:this.list_id}, true).then(res => { this.request(Api_Url + '/api/xcx/updateGoodsList', 'post', { list_name: this.list_name, list_id: this.list_id }, true).then(res => {
if(res.code==0){ if (res.code == 0) {
uni.showToast({ uni.showToast({
title: "修改成功", title: "修改成功",
icon: 'success' icon: 'success'
}); });
this.closeNewList() this.closeNewList()
}else{ } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'nonde' icon: 'nonde'
......
...@@ -17,8 +17,8 @@ if (process.env.UNI_PLATFORM === 'h5') { // 判断是否为 H5 平台 ...@@ -17,8 +17,8 @@ if (process.env.UNI_PLATFORM === 'h5') { // 判断是否为 H5 平台
api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net' //api_url = _env == 'release' ? 'https://www.iedge.net' : 'http://iedge.liexindev.net'
//api_url = 'https://www.iedge.net' api_url = 'https://www.iedge.net'
console.log(api_url, _env) console.log(api_url, _env)
} else { // 其他平台(如 App 等) } else { // 其他平台(如 App 等)
......
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 sign in to comment