|
@@ -7,10 +7,7 @@
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
<div class="flex align-center">
|
|
<div class="flex align-center">
|
|
- <div class="carTits ellipsis-two">{{modelLabel}}</div>
|
|
|
|
- <!-- <div class="qhbtns flex align-center" v-if="carList.length>1" @click="openSelCarModel">
|
|
|
|
- <u-image width="32" height="32" :src="`/static/${theme}/qiehuan.png`"></u-image> 切换车型
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ <div class="carTits ellipsis-two">{{modelLabel||''}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex align-center">
|
|
<div class="flex align-center">
|
|
<div>VIN码:{{vinNumber}}</div>
|
|
<div>VIN码:{{vinNumber}}</div>
|
|
@@ -50,7 +47,7 @@
|
|
<view class="item-detail-info">
|
|
<view class="item-detail-info">
|
|
<view class="flex justify_between">
|
|
<view class="flex justify_between">
|
|
<text class="item-detail-text flex_1">{{item.code}}</text>
|
|
<text class="item-detail-text flex_1">{{item.code}}</text>
|
|
- <text class="item-detail-text" v-if="item.affiliation=='SHELF'">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
|
|
|
|
|
|
+ <text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="flex justify_between">
|
|
<view class="flex justify_between">
|
|
<view class="item-detail-text flex_1">
|
|
<view class="item-detail-text flex_1">
|
|
@@ -60,10 +57,11 @@
|
|
<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
|
|
<u-button shape="circle" @click="addPart(item)" v-if="!item.checked" :custom-style="{width:'48upx',height:'48upx'}" type="primary" size="mini">
|
|
<u-icon name="plus" color="#fff" size="28"></u-icon>
|
|
<u-icon name="plus" color="#fff" size="28"></u-icon>
|
|
</u-button>
|
|
</u-button>
|
|
- <u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
|
|
|
|
|
|
+ <u-number-box v-else @change="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
|
|
</view>
|
|
</view>
|
|
<view class="item-detail-text" v-if="item.affiliation=='SUPER_CATALOGUE'||!item.currentInven">
|
|
<view class="item-detail-text" v-if="item.affiliation=='SUPER_CATALOGUE'||!item.currentInven">
|
|
- <text @click="toRuku(item)" class="phtxt">我要临配</text>
|
|
|
|
|
|
+ <text v-if="!item.checked" @click="addPart(item)" class="phtxt">我要临配</text>
|
|
|
|
+ <u-number-box v-else @change="updateVinNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -75,7 +73,10 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-if="vinPartList&&vinPartList.length==0">
|
|
<view v-if="vinPartList&&vinPartList.length==0">
|
|
- <u-empty v-if="status!='loading'" :src="`/static/nodata.png`" icon-size="180" text="暂无适配推荐" mode="list" :margin-top="30"></u-empty>
|
|
|
|
|
|
+ <u-empty v-if="vinStatus!='loading'" :src="`/static/nodata.png`" icon-size="180" text="暂无适配推荐" mode="list" :margin-top="30"></u-empty>
|
|
|
|
+ </view>
|
|
|
|
+ <view style="padding: 20upx;">
|
|
|
|
+ <u-loadmore v-if="vinStatus=='loading'" :status="vinStatus" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 其它配件 -->
|
|
<!-- 其它配件 -->
|
|
@@ -105,7 +106,8 @@
|
|
<u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
|
|
<u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0" :max="item.currentInven"></u-number-box>
|
|
</view>
|
|
</view>
|
|
<view class="item-detail-text" v-else>
|
|
<view class="item-detail-text" v-else>
|
|
- <text @click="toRuku(item)" class="phtxt">我要临配</text>
|
|
|
|
|
|
+ <text @click="addPart(item)" v-if="!item.checked" class="phtxt">我要临配</text>
|
|
|
|
+ <u-number-box v-else @change="updateNums" v-model="item.qty" :index="item.productSn" :min="0"></u-number-box>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -117,7 +119,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view v-if="partList&&partList.length==0">
|
|
<view v-if="partList&&partList.length==0">
|
|
- <u-empty v-if="status!='loading'" :src="`/static/nodata.png`" icon-size="240" :text="noDataText" mode="list" :margin-top="150"></u-empty>
|
|
|
|
|
|
+ <u-empty v-if="status!='loading'" :src="`/static/nodata.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="150"></u-empty>
|
|
</view>
|
|
</view>
|
|
<view style="padding: 20upx;">
|
|
<view style="padding: 20upx;">
|
|
<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
|
|
<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
|
|
@@ -130,11 +132,11 @@
|
|
<div>
|
|
<div>
|
|
<div class="cpb_cart" :style="{background: partListData.length==0?'#eee':''}" @click="openCart">
|
|
<div class="cpb_cart" :style="{background: partListData.length==0?'#eee':''}" @click="openCart">
|
|
<u-badge type="error" :count="cartNums" :offset="[-4,-4]" bgColor="#FF5200"></u-badge>
|
|
<u-badge type="error" :count="cartNums" :offset="[-4,-4]" bgColor="#FF5200"></u-badge>
|
|
- <u-image width="44" height="44" :src="`/static/${theme}/icon_shopping@3x.png`"></u-image>
|
|
|
|
|
|
+ <u-image width="44" height="44" :src="`/static/icon_shopping@3x.png`"></u-image>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <u-button type="primary" @click="submitForm" :custom-style="{background:'#1283d4',fontSize:'32rpx'}" shape="circle">立即提交</u-button>
|
|
|
|
|
|
+ <u-button type="primary" :loading="saveLoading" @click="submitForm" :custom-style="{background:'#1283d4',fontSize:'32rpx'}" shape="circle">立即提交</u-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 已选配件 购物车 -->
|
|
<!-- 已选配件 购物车 -->
|
|
@@ -151,20 +153,21 @@
|
|
</view>
|
|
</view>
|
|
<view class="item-info uni-col-10">
|
|
<view class="item-info uni-col-10">
|
|
<view class="item-name">
|
|
<view class="item-name">
|
|
|
|
+ <text class="item-tempPart" v-if="!item.currentInven">临配</text>
|
|
<text>{{item.name}}</text>
|
|
<text>{{item.name}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-detail">
|
|
<view class="item-detail">
|
|
<view class="item-detail-info">
|
|
<view class="item-detail-info">
|
|
<view class="flex justify_between">
|
|
<view class="flex justify_between">
|
|
<text class="item-detail-text flex_1">{{item.code}}</text>
|
|
<text class="item-detail-text flex_1">{{item.code}}</text>
|
|
- <text class="item-detail-text">库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
|
|
|
|
|
|
+ <text class="item-detail-text" >库存:{{item.currentInven?item.currentInven:0}} {{item.unit}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="flex justify_between">
|
|
<view class="flex justify_between">
|
|
<view class="item-detail-text flex_1">
|
|
<view class="item-detail-text flex_1">
|
|
<text class="item-price">¥{{item.price||0}}</text>
|
|
<text class="item-price">¥{{item.price||0}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-detail-text">
|
|
<view class="item-detail-text">
|
|
- <u-number-box @change="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven"></u-number-box>
|
|
|
|
|
|
+ <u-number-box @change="updateCartNums" v-model="item.qty" :index="'cart_'+item.productSn" :min="0" :max="item.currentInven||999999"></u-number-box>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -189,6 +192,7 @@
|
|
curLeve2: '', // 当前所选二级菜单
|
|
curLeve2: '', // 当前所选二级菜单
|
|
carInfo: null,
|
|
carInfo: null,
|
|
status: 'loading',
|
|
status: 'loading',
|
|
|
|
+ vinStatus: 'loading',
|
|
noDataText: '暂无配件',
|
|
noDataText: '暂无配件',
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -201,17 +205,13 @@
|
|
partListData: [], // 已选配件
|
|
partListData: [], // 已选配件
|
|
vinPartList: [],
|
|
vinPartList: [],
|
|
isIphoneXup: false,
|
|
isIphoneXup: false,
|
|
- dealerPhone: ''
|
|
|
|
|
|
+ dealerPhone: '',
|
|
|
|
+ saveLoading: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed:{
|
|
computed:{
|
|
modelLabel(){
|
|
modelLabel(){
|
|
- // const data = this.carInfo
|
|
|
|
- // const carModelLabel = [data.carBrand, data.vehicleSeriesNameCn, data.capacity, data.vehicleOfYear, data.vehicleNameCn +
|
|
|
|
- // '(' + data.salesVersion + ')'
|
|
|
|
- // ]
|
|
|
|
- // return carModelLabel.join(' ')
|
|
|
|
- return this.carInfo.text
|
|
|
|
|
|
+ return this.carInfo&&this.carInfo.text||''
|
|
},
|
|
},
|
|
cartNums(){
|
|
cartNums(){
|
|
let ret = 0
|
|
let ret = 0
|
|
@@ -234,7 +234,6 @@
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
var webView = this.$mp.page.$getAppWebview();
|
|
var webView = this.$mp.page.$getAppWebview();
|
|
if(this.dealerPhone==''){
|
|
if(this.dealerPhone==''){
|
|
- console.log(11)
|
|
|
|
webView.setTitleNViewButtonStyle(0,{text:"",color:"#FFFFFF"});
|
|
webView.setTitleNViewButtonStyle(0,{text:"",color:"#FFFFFF"});
|
|
}
|
|
}
|
|
// #endif
|
|
// #endif
|
|
@@ -354,9 +353,10 @@
|
|
productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2,
|
|
productTypeSn: this.curLeve2 == 'all' ? '' : this.curLeve2,
|
|
codeList: this.vinCode
|
|
codeList: this.vinCode
|
|
}
|
|
}
|
|
|
|
+ this.vinStatus = 'loading'
|
|
getShelfQueryList(params).then(res => {
|
|
getShelfQueryList(params).then(res => {
|
|
this.vinPartList = this.fiterChecked(res.data || [])
|
|
this.vinPartList = this.fiterChecked(res.data || [])
|
|
- console.log(this.vinPartList)
|
|
|
|
|
|
+ this.vinStatus = 'nomore'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 过滤已选择的
|
|
// 过滤已选择的
|
|
@@ -389,13 +389,6 @@
|
|
this.showSelCarModel = false
|
|
this.showSelCarModel = false
|
|
this.carInfo = item
|
|
this.carInfo = item
|
|
},
|
|
},
|
|
- // 补货
|
|
|
|
- toRuku(data){
|
|
|
|
- this.$store.state.vuex_shelfChoosePart.push(data)
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/digitalShelf/temproaryStockIn/temproaryStockIn?vinNumber='+this.vinNumber
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 添加到购物车
|
|
// 添加到购物车
|
|
addPart(item){
|
|
addPart(item){
|
|
item.checked = true
|
|
item.checked = true
|
|
@@ -406,6 +399,7 @@
|
|
name: item.name,
|
|
name: item.name,
|
|
unit: item.unit,
|
|
unit: item.unit,
|
|
price: item.price,
|
|
price: item.price,
|
|
|
|
+ cost: item.cost,
|
|
currentInven: item.currentInven,
|
|
currentInven: item.currentInven,
|
|
code: item.code,
|
|
code: item.code,
|
|
qty: item.qty,
|
|
qty: item.qty,
|
|
@@ -413,14 +407,13 @@
|
|
checked: true
|
|
checked: true
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 修改列表上数量
|
|
|
|
- updateNums(data){
|
|
|
|
- const prow = this.partList.find(item => item.productSn == data.index)
|
|
|
|
|
|
+ // 更新配件列表数量
|
|
|
|
+ updatePartList(data,type){
|
|
|
|
+ const prow = this[type].find(item => item.productSn == data.index)
|
|
const index = this.partListData.findIndex(item => item.productSn == data.index)
|
|
const index = this.partListData.findIndex(item => item.productSn == data.index)
|
|
// 删除
|
|
// 删除
|
|
if(data.value == 0){
|
|
if(data.value == 0){
|
|
prow.checked = false
|
|
prow.checked = false
|
|
- console.log(index,'+++')
|
|
|
|
if(index>=0){
|
|
if(index>=0){
|
|
this.partListData.splice(index,1)
|
|
this.partListData.splice(index,1)
|
|
}
|
|
}
|
|
@@ -432,8 +425,17 @@
|
|
this.partListData.splice()
|
|
this.partListData.splice()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 修改适配配件上数量
|
|
|
|
+ updateVinNums(data){
|
|
|
|
+ this.updatePartList(data,'vinPartList')
|
|
|
|
+ },
|
|
|
|
+ // 修改其它配件上的数量
|
|
|
|
+ updateNums(data){
|
|
|
|
+ this.updatePartList(data,'partList')
|
|
|
|
+ },
|
|
// 点击购物车修改数量
|
|
// 点击购物车修改数量
|
|
updateCartNums(data){
|
|
updateCartNums(data){
|
|
|
|
+ console.log(data)
|
|
if(data.value == 0){
|
|
if(data.value == 0){
|
|
const index = this.partListData.findIndex(item => 'cart_'+item.productSn == data.index)
|
|
const index = this.partListData.findIndex(item => 'cart_'+item.productSn == data.index)
|
|
if(index>=0){
|
|
if(index>=0){
|
|
@@ -443,10 +445,20 @@
|
|
this.showCart = false
|
|
this.showCart = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 同步更新配件列表上的
|
|
|
|
|
|
+ // 同步更新Vin适配配件列表上的
|
|
|
|
+ const vinprow = this.vinPartList.find(item => 'cart_'+item.productSn == data.index)
|
|
|
|
+ if(vinprow){
|
|
|
|
+ vinprow.qty = data.value
|
|
|
|
+ vinprow.checked = !!data.value
|
|
|
|
+ this.vinPartList.splice()
|
|
|
|
+ }
|
|
|
|
+ // 同步更新其它配件列表上的
|
|
const prow = this.partList.find(item => 'cart_'+item.productSn == data.index)
|
|
const prow = this.partList.find(item => 'cart_'+item.productSn == data.index)
|
|
- prow.qty = data.value
|
|
|
|
- prow.checked = !!data.value
|
|
|
|
|
|
+ if(prow){
|
|
|
|
+ prow.qty = data.value
|
|
|
|
+ prow.checked = !!data.value
|
|
|
|
+ this.partList.splice()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 打开购物车
|
|
// 打开购物车
|
|
openCart(){
|
|
openCart(){
|
|
@@ -462,13 +474,22 @@
|
|
// 格式化数据
|
|
// 格式化数据
|
|
formatData(){
|
|
formatData(){
|
|
const partList = []
|
|
const partList = []
|
|
|
|
+ const tempList = []
|
|
this.partListData.map(item => {
|
|
this.partListData.map(item => {
|
|
- partList.push({
|
|
|
|
- "productSn": item.productSn,
|
|
|
|
- "totalQty": item.qty
|
|
|
|
- })
|
|
|
|
|
|
+ if(item.currentInven){
|
|
|
|
+ partList.push({
|
|
|
|
+ "productSn": item.productSn,
|
|
|
|
+ "totalQty": item.qty
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ tempList.push({
|
|
|
|
+ "productSn": item.productSn,
|
|
|
|
+ "qty": item.qty,
|
|
|
|
+ "price": item.cost
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- return partList
|
|
|
|
|
|
+ return [partList,tempList]
|
|
},
|
|
},
|
|
// 立即提交
|
|
// 立即提交
|
|
submitForm(){
|
|
submitForm(){
|
|
@@ -482,12 +503,14 @@
|
|
|
|
|
|
// 开始提交
|
|
// 开始提交
|
|
const params = {
|
|
const params = {
|
|
- shelfOrderDetailList: this.formatData(),
|
|
|
|
|
|
+ shelfOrderDetailList: this.formatData()[0],
|
|
|
|
+ tempBillDetailList: this.formatData()[1],
|
|
vin: this.vinNumber,
|
|
vin: this.vinNumber,
|
|
- vehicleModel: this.modelLabel,
|
|
|
|
|
|
+ vehicleModel: this.modelLabel || '',
|
|
vehicleLogo: this.carInfo.icon||'',
|
|
vehicleLogo: this.carInfo.icon||'',
|
|
}
|
|
}
|
|
console.log(params,'立即提交')
|
|
console.log(params,'立即提交')
|
|
|
|
+ this.saveLoading = true
|
|
saveShelfOrder(params).then(res => {
|
|
saveShelfOrder(params).then(res => {
|
|
console.log(res,'saveShelfOrder')
|
|
console.log(res,'saveShelfOrder')
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
@@ -501,6 +524,7 @@
|
|
url:"/pages/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify({remindMessage:res.message}))+"&state=0"
|
|
url:"/pages/digitalShelf/choosePartResult?data="+encodeURIComponent(JSON.stringify({remindMessage:res.message}))+"&state=0"
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ this.saveLoading = false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -601,6 +625,7 @@
|
|
border-bottom: 2rpx solid #f5f5f5;
|
|
border-bottom: 2rpx solid #f5f5f5;
|
|
.item-info{
|
|
.item-info{
|
|
padding-left: 20upx;
|
|
padding-left: 20upx;
|
|
|
|
+ flex-grow: 1;
|
|
.item-name{
|
|
.item-name{
|
|
font-size: 32upx;
|
|
font-size: 32upx;
|
|
color: #191919;
|
|
color: #191919;
|
|
@@ -704,6 +729,13 @@
|
|
}
|
|
}
|
|
.item-name{
|
|
.item-name{
|
|
font-size: 36rpx;
|
|
font-size: 36rpx;
|
|
|
|
+ .item-tempPart{
|
|
|
|
+ background: #0055ff;
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-radius: 1em;
|
|
|
|
+ font-size: 0.8em;
|
|
|
|
+ padding: 0 0.5em;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.item-info{
|
|
.item-info{
|
|
border-bottom:2rpx solid #f8f8f8;
|
|
border-bottom:2rpx solid #f8f8f8;
|