|
|
@ -94,20 +94,29 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-checkList" v-if="value[1].stockLogList !=''"> |
|
|
<view class="shop-checkList" v-if="value[1].stockLogList !=''"> |
|
|
<view class="shop-checkList-box" style="width: 67%;"> |
|
|
<view class="shop-checkList-box" style="width: 67%;"> |
|
|
<text style="text-align:center;width: 356rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text> |
|
|
<text style="text-align:center;width: 400rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;"> |
|
|
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: center;">库存</text> |
|
|
规格 |
|
|
|
|
|
</text> |
|
|
|
|
|
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 60rpx;display: inline-block;text-align: center;"> |
|
|
|
|
|
库存 |
|
|
|
|
|
</text> |
|
|
</view> |
|
|
</view> |
|
|
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 140rpx;display: inline-block;text-align: right;">数量</view> |
|
|
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 152rpx;display: inline-block;text-align: right;">数量</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" |
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)" |
|
|
:key='keys'> |
|
|
:key='keys'> |
|
|
<view @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
<view @tap.stop="delShopSpec(value[0],values[0])"> |
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
<uni-icons color="red" type="minus" size="26"></uni-icons> |
|
|
</view> |
|
|
</view> |
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
<text @tap="checkSpec('颜色',value[0],values[0],numData(values[0])[0])"> |
|
|
<text style="width: 15%;">{{values[1].productNum}}</text> |
|
|
{{numData(values[0])[0]}} |
|
|
|
|
|
</text> |
|
|
|
|
|
<text @tap="checkSpec('尺码',value[0],values[0],numData(values[0])[1])"> |
|
|
|
|
|
{{numData(values[0])[1]}} |
|
|
|
|
|
</text> |
|
|
|
|
|
<text style="width: 25%;font-size: 22rpx;">{{values[1].productNum == null ?'无库存':values[1].productNum}}</text> |
|
|
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;"> |
|
|
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;"> |
|
|
<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1].productCount" |
|
|
<uni-number-box max="100000" style="margin-top:9rpx;border-right:0;" v-model="values[1].productCount" |
|
|
@change="GoodsNumChange($event,value,values[0])" /> |
|
|
@change="GoodsNumChange($event,value,values[0])" /> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -452,6 +461,27 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
</uni-popup> |
|
|
|
|
|
<!-- 弹出规格选择 --> |
|
|
|
|
|
<uni-popup ref="getaPopup" background-color="#fff" :is-mask-click="true"> |
|
|
|
|
|
<view class="type-popup" style="margin-bottom: 0;border-radius: 0;"> |
|
|
|
|
|
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;"> |
|
|
|
|
|
修改当前规格 |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="card-list"> |
|
|
|
|
|
<ul> |
|
|
|
|
|
<li v-for="items in attrList" :key="items.id"> |
|
|
|
|
|
<view class="title-fur"> |
|
|
|
|
|
<view class="name">{{items.attributeName}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="content-fur"> |
|
|
|
|
|
<view class="content-low" v-for="item in attributeValue" :key="item.id" |
|
|
|
|
|
@tap="changeSpec(item.value)">{{item.value}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</li> |
|
|
|
|
|
</ul> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
@ -464,7 +494,9 @@ |
|
|
let manager = plugin.getRecordRecognitionManager() |
|
|
let manager = plugin.getRecordRecognitionManager() |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
attrList:[], |
|
|
|
|
|
attributeValue:[], |
|
|
lsprice: 0, //临时零售价 |
|
|
lsprice: 0, //临时零售价 |
|
|
wholesalePrice: 0, // 临时显示批发价 |
|
|
wholesalePrice: 0, // 临时显示批发价 |
|
|
price: 0, //总金额 |
|
|
price: 0, //总金额 |
|
|
@ -661,6 +693,7 @@ |
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
price: 0, //总价 |
|
|
price: 0, //总价 |
|
|
discount: 10, //折扣 |
|
|
discount: 10, //折扣 |
|
|
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
unitPrice: this.carList1[i].unitPrice || 0, //单价 |
|
|
unitPrice: this.carList1[i].unitPrice || 0, //单价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
@ -727,6 +760,7 @@ |
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
purchasePrice: this.carList1[i].price, //采购价 |
|
|
price: 0, |
|
|
price: 0, |
|
|
discount: 10, |
|
|
discount: 10, |
|
|
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
discountAmount: this.carList1[i].unitPrice || 0, |
|
|
discountAmount: this.carList1[i].unitPrice || 0, |
|
|
unitPrice: this.carList1[i].unitPrice || 0, //单价 |
|
|
unitPrice: this.carList1[i].unitPrice || 0, //单价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
@ -806,6 +840,7 @@ |
|
|
purchasePrice: this.carList1[i].purchasePrice, //采购价 |
|
|
purchasePrice: this.carList1[i].purchasePrice, //采购价 |
|
|
price: 0, //总价 |
|
|
price: 0, //总价 |
|
|
discount: 10, //折扣 |
|
|
discount: 10, //折扣 |
|
|
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
@ -859,6 +894,7 @@ |
|
|
purchasePrice: this.carList1[i].purchasePrice, //采购价 |
|
|
purchasePrice: this.carList1[i].purchasePrice, //采购价 |
|
|
price: 0, //总价 |
|
|
price: 0, //总价 |
|
|
discount: 10, //折扣 |
|
|
discount: 10, //折扣 |
|
|
|
|
|
categoryId:this.carList1[i].categoryId, |
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
unitPrice: this.carList1[i].price || 0, //单价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
discountAmount: this.carList1[i].unitPrice || 0, //折后价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: this.carList1[i].wholesalePrice, //批发价 |
|
|
@ -934,6 +970,81 @@ |
|
|
result = res |
|
|
result = res |
|
|
}) |
|
|
}) |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
}, |
|
|
|
|
|
numData(val){ |
|
|
|
|
|
var name = [] |
|
|
|
|
|
if (typeof(val) == 'string') { |
|
|
|
|
|
let newObj = JSON.parse(val) |
|
|
|
|
|
for (let as in newObj) { |
|
|
|
|
|
name.push(newObj[as]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return name; |
|
|
|
|
|
}, |
|
|
|
|
|
checkSpec(type,id,attr,value){ |
|
|
|
|
|
this.temporary = [id,attr,type,value] |
|
|
|
|
|
let num = type == '颜色' ? 0 : 1 |
|
|
|
|
|
this.getGategoryLowList() |
|
|
|
|
|
}, |
|
|
|
|
|
//初始化获取子分类列表 |
|
|
|
|
|
getGategoryLowList() { |
|
|
|
|
|
this.attrList = [] |
|
|
|
|
|
let num = this.temporary[2] == '颜色' ? 0 : 1 |
|
|
|
|
|
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", { |
|
|
|
|
|
categoryId: this.carList.get(this.temporary[0]).categoryId |
|
|
|
|
|
}, false, true).then((res1) => { |
|
|
|
|
|
if (res1.code == 200) { |
|
|
|
|
|
this.attrList.push(res1.result[num]) |
|
|
|
|
|
if (res1.result.length > 0) { |
|
|
|
|
|
this.attributeValue = [] |
|
|
|
|
|
this.tui.request( |
|
|
|
|
|
"/app/productAttributeValue/selectByAttributeId", |
|
|
|
|
|
"get", { |
|
|
|
|
|
id: this.attrList[0].id |
|
|
|
|
|
}, false, true).then((res2) => { |
|
|
|
|
|
if (res2.code == 200) { |
|
|
|
|
|
this.attributeValue = res2.result; |
|
|
|
|
|
this.$forceUpdate() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.tui.toast(res.message) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
|
} |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.showList = this.attrList; |
|
|
|
|
|
}, 1000) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.tui.toast(res.message) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
|
this.$forceUpdate() |
|
|
|
|
|
this.$refs.getaPopup.open() |
|
|
|
|
|
}, |
|
|
|
|
|
//点击某一个规格,可修改 |
|
|
|
|
|
changeSpec(item){ |
|
|
|
|
|
let that = this; |
|
|
|
|
|
if(item == ''){ |
|
|
|
|
|
this.tui.toast('请输入要修改的规格值') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
let data = this.temporary |
|
|
|
|
|
let specMap = new Map() //新的临时存放值那个更改过的值的数组 |
|
|
|
|
|
this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
|
|
if(key == data[1]){ |
|
|
|
|
|
let stringKey = key.replace(data[3],item) //拿到了更改过的key |
|
|
|
|
|
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面 |
|
|
|
|
|
that.carList.get(data[0]).stockLogList.delete(data[1]) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(this.carList.get(data[0]).stockLogList.size > 0){ |
|
|
|
|
|
this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
|
|
specMap.set(key,value) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
this.carList.get(data[0]).stockLogList = specMap |
|
|
|
|
|
this.$forceUpdate() |
|
|
|
|
|
this.$refs.getaPopup.close() |
|
|
}, |
|
|
}, |
|
|
//销售员列表 |
|
|
//销售员列表 |
|
|
xsyList() { |
|
|
xsyList() { |
|
|
@ -1154,10 +1265,24 @@ |
|
|
clearText(){ |
|
|
clearText(){ |
|
|
this.voiceText = '' |
|
|
this.voiceText = '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
spliceMsg(res){ |
|
|
|
|
|
let regex = /嗯|啊|儿|各|阿|恩/g; |
|
|
|
|
|
return res.replace(regex, '') |
|
|
|
|
|
}, |
|
|
|
|
|
convertChineseToArabic(str) { |
|
|
|
|
|
const chineseNumToArabic = { |
|
|
|
|
|
'零': 0, '一': 1, '二': 2, '两': 2, '三': 3, |
|
|
|
|
|
'四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9 |
|
|
|
|
|
}; |
|
|
|
|
|
const regex = /(零|一|二|两|三|四|五|六|七|八|九)/g; |
|
|
|
|
|
return str.replace(regex, match => chineseNumToArabic[match]); |
|
|
|
|
|
}, |
|
|
//编辑挂单信息 |
|
|
//编辑挂单信息 |
|
|
setDetail(e) { |
|
|
setDetail(e) { |
|
|
|
|
|
let convertedStr = this.convertChineseToArabic(this.voiceText); |
|
|
|
|
|
let getMsg = this.spliceMsg(convertedStr) |
|
|
this.tui.request("/app/sale/buyAi", "POST", { |
|
|
this.tui.request("/app/sale/buyAi", "POST", { |
|
|
aiMsg:this.voiceText |
|
|
aiMsg:getMsg |
|
|
}, false, true).then((res) => { |
|
|
}, false, true).then((res) => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
this.voiceText = '' |
|
|
this.voiceText = '' |
|
|
@ -1322,11 +1447,6 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
AiAddSpec(value){ |
|
|
AiAddSpec(value){ |
|
|
if(value.categoryId == ''){ |
|
|
|
|
|
this.tui.toast('请先选择商品分类') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
console.log(value) |
|
|
|
|
|
this.getById(value.productId || value.id); |
|
|
this.getById(value.productId || value.id); |
|
|
}, |
|
|
}, |
|
|
//通过商品id查询商品详细信息 |
|
|
//通过商品id查询商品详细信息 |
|
|
@ -1624,6 +1744,7 @@ |
|
|
price: 0, //总价 |
|
|
price: 0, //总价 |
|
|
discount: 10, //折扣 |
|
|
discount: 10, //折扣 |
|
|
unitPrice: 0, //单价 |
|
|
unitPrice: 0, //单价 |
|
|
|
|
|
categoryId:carList1[i].categoryId, |
|
|
discountAmount: 0, //折后价 |
|
|
discountAmount: 0, //折后价 |
|
|
wholesalePrice: carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: carList1[i].wholesalePrice, //批发价 |
|
|
lsprice: carList1[i].lsprice, //零售价 |
|
|
lsprice: carList1[i].lsprice, //零售价 |
|
|
@ -1699,6 +1820,7 @@ |
|
|
discount: 10, |
|
|
discount: 10, |
|
|
discountAmount: 0, |
|
|
discountAmount: 0, |
|
|
unitPrice: 0, //单价 |
|
|
unitPrice: 0, //单价 |
|
|
|
|
|
categoryId:carList1[i].categoryId, |
|
|
wholesalePrice: carList1[i].wholesalePrice, //批发价 |
|
|
wholesalePrice: carList1[i].wholesalePrice, //批发价 |
|
|
lsprice: carList1[i].lsprice, //零售价 |
|
|
lsprice: carList1[i].lsprice, //零售价 |
|
|
productCount: 0, |
|
|
productCount: 0, |
|
|
@ -1857,7 +1979,7 @@ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
let obj = { |
|
|
let obj = { |
|
|
orderByWorker: this.lbgName.workerId, |
|
|
orderByWorker: this.lbgName.workerId || this.kdyName.workerId, |
|
|
oldSaleId: this.saleId || '', |
|
|
oldSaleId: this.saleId || '', |
|
|
sale: { |
|
|
sale: { |
|
|
// relPrice:, |
|
|
// relPrice:, |
|
|
@ -2868,5 +2990,52 @@ |
|
|
height: 180rpx; |
|
|
height: 180rpx; |
|
|
background: #eee; |
|
|
background: #eee; |
|
|
border-radius: 50%; |
|
|
border-radius: 50%; |
|
|
|
|
|
} |
|
|
|
|
|
.type-popup{ |
|
|
|
|
|
width: 500rpx; |
|
|
|
|
|
height: auto; |
|
|
|
|
|
background: #fff; |
|
|
|
|
|
border-radius: 10px; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
margin-bottom: 40rpx; |
|
|
|
|
|
} |
|
|
|
|
|
.card-list { |
|
|
|
|
|
width: 95%; |
|
|
|
|
|
border-radius: 10upx; |
|
|
|
|
|
background: #fff; |
|
|
|
|
|
height: auto; |
|
|
|
|
|
margin: 40rpx auto 0; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.title-fur { |
|
|
|
|
|
width: 95%; |
|
|
|
|
|
height: 70rpx; |
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.name { |
|
|
|
|
|
font-size: 30rpx; |
|
|
|
|
|
width: 50%; |
|
|
|
|
|
float: left; |
|
|
|
|
|
height: 70rpx; |
|
|
|
|
|
line-height: 70rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.content-fur { |
|
|
|
|
|
padding-bottom: 25rpx; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.content-low { |
|
|
|
|
|
width: auto; |
|
|
|
|
|
border: 1px solid #eee; |
|
|
|
|
|
display: inline-block; |
|
|
|
|
|
min-width: 90rpx; |
|
|
|
|
|
padding: 5rpx; |
|
|
|
|
|
font-size: 35rpx; |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
color: #777; |
|
|
|
|
|
margin: 20rpx 0 0 20rpx; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |