|
@@ -86,6 +86,7 @@ const seeDetail = new Vue({
|
|
|
openBank: [{required: true,message: '请填写开户银行',trigger: 'blur'}],
|
|
|
bankAccountNo: [{required: true,message: '请填写银行账号',trigger: 'blur'}]
|
|
|
},
|
|
|
+ submitLoading:false,
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
@@ -250,23 +251,27 @@ const seeDetail = new Vue({
|
|
|
},
|
|
|
handleConfirmOrder(params){
|
|
|
const _this = this;
|
|
|
- SupplierApi.shopGenerateOrder(params,function(response){
|
|
|
- if(response.code === 0){
|
|
|
- const data = response.data
|
|
|
- _this.$notify({
|
|
|
- title: '成功',
|
|
|
- message: '订单已提交~',
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- setTimeout(()=>{
|
|
|
+ this.submitLoading = true
|
|
|
+ setTimeout(()=>{
|
|
|
+ SupplierApi.shopGenerateOrder(params,function(response){
|
|
|
+ if(response.code === 0){
|
|
|
+ const data = response.data
|
|
|
+ _this.submitLoading = false
|
|
|
+ _this.$message({
|
|
|
+ message: '恭喜你,订单提交成功~',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ setTimeout(()=>{
|
|
|
+ _this.submitLoading = false
|
|
|
+ _this.formatConfirmParam()
|
|
|
+ window.location.href = '/supplier/order/detail.html?shopOrderId='+data.shopOrderId
|
|
|
+ },2000)
|
|
|
+ }else{
|
|
|
+ _this.$message.error(response.msg)
|
|
|
_this.formatConfirmParam()
|
|
|
- window.location.href = '/supplier/order/detail.html?shopOrderId='+data.shopOrderId
|
|
|
- },2000)
|
|
|
- }else{
|
|
|
- _this.$message.error(response.msg)
|
|
|
- _this.formatConfirmParam()
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },1000)
|
|
|
},
|
|
|
// 还原提交订单参数格式
|
|
|
formatConfirmParam:function(){
|
|
@@ -311,6 +316,56 @@ const seeDetail = new Vue({
|
|
|
this.getSettlement(this.prosParams)
|
|
|
}
|
|
|
},
|
|
|
+ //修改sku
|
|
|
+ handleChangeSku(row){
|
|
|
+ console.log('skuId',row.skuId)
|
|
|
+ let skus = row.skus
|
|
|
+ console.log('skus',skus)
|
|
|
+ skus.forEach((sku)=>{
|
|
|
+ if(row.skuId === sku.skuId){
|
|
|
+ if(sku.ladderPriceFlag === 1){
|
|
|
+ row.price = sku.ladderPriceList[0].buyPrice
|
|
|
+ row.count = sku.minBuyNumber
|
|
|
+ row.minBuyNumber = sku.minBuyNumber
|
|
|
+ row.ladderPriceFlag = sku.ladderPriceFlag
|
|
|
+ row.ladderPriceList = sku.ladderPriceList
|
|
|
+ }else{
|
|
|
+ row.price = sku.price
|
|
|
+ row.count = sku.minBuyNumber
|
|
|
+ row.minBuyNumber = sku.minBuyNumber
|
|
|
+ row.ladderPriceFlag = sku.ladderPriceFlag
|
|
|
+ row.ladderPriceList = sku.ladderPriceList
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 修改数量判断阶梯价
|
|
|
+ handleChangeNumber(row){
|
|
|
+ console.log('count',row.count)
|
|
|
+ console.log('minBuyNumber',row.minBuyNumber)
|
|
|
+ if (row.count < row.minBuyNumber) {
|
|
|
+ row.count = row.minBuyNumber
|
|
|
+ if (row.ladderPriceFlag === 1) {
|
|
|
+ row.ladderPriceList.forEach((item) => {
|
|
|
+ if (row.count >= item.buyNum) {
|
|
|
+ row.price = item.buyPrice
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ row.price = row.price
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (row.ladderPriceFlag === 1) {
|
|
|
+ row.ladderPriceList.forEach((item) => {
|
|
|
+ if (row.count >= item.buyNum) {
|
|
|
+ row.price = item.buyPrice
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ row.price = row.price
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
//确认选择商品
|
|
|
handleAddProConfirm(){
|
|
|
this.checkedProductList = [...this.checkedProductList,...this.productRadio]
|
|
@@ -322,7 +377,7 @@ const seeDetail = new Vue({
|
|
|
return JSON.stringify(productInfo.map((pros)=>{
|
|
|
return {
|
|
|
productId:pros.productId,
|
|
|
- count:pros.minBuyNumber,
|
|
|
+ count:pros.count,
|
|
|
skuId:pros.skuId,
|
|
|
price:pros.price
|
|
|
}
|
|
@@ -368,7 +423,10 @@ const seeDetail = new Vue({
|
|
|
SupplierApi.getShopProduct(this.listQuery,function(response){
|
|
|
if(response.code === 0){
|
|
|
const data = response.data
|
|
|
- _this.productsList = data.results
|
|
|
+ _this.productsList = data.results.map((pros)=>{
|
|
|
+ pros.count = pros.minBuyNumber
|
|
|
+ return pros
|
|
|
+ })
|
|
|
_this.total = data.totalRecord
|
|
|
_this.isLoading = false
|
|
|
}else{
|