|
|
|
@ -6,9 +6,10 @@ |
|
|
|
|
|
|
|
<view class="tui-order-item boxbg"> |
|
|
|
<u-collapse> |
|
|
|
<u-collapse-item v-for="(item,index) in list" :key="index" :title="item.productName" :name="item.saleId" |
|
|
|
<u-collapse-item :open="isReturn" v-for="(item,index) in list" :key="index" :title="item.productName" |
|
|
|
:name="item.saleId" |
|
|
|
:value="'¥'+ item.wholesalePrice + ' * ' + (sales.discount < 10 ? sales.discount : item.discount)"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :key="index2"> |
|
|
|
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> |
|
|
|
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> --> |
|
|
|
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} |
|
|
|
@ -80,7 +81,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-order-info boxbg"> |
|
|
|
<view class="tui-order-info boxbg" v-if="isgys"> |
|
|
|
<view class="tui-order-title"> |
|
|
|
退款历史信息 |
|
|
|
</view> |
|
|
|
@ -88,19 +89,19 @@ |
|
|
|
<u-collapse :value="[shopList[0].saleId]"> |
|
|
|
<u-collapse-item v-for="(item,index) in shopList" :key="index" :title="item.productName" |
|
|
|
:name="item.saleId"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.saleDetailQueryDTO" :key="index2"> |
|
|
|
<view class="u-collapse-content" v-for="(val, index2) in item.stockLogList1" :key="index2"> |
|
|
|
<!-- <u-icon name="checkmark-circle" color="#5fd9ee" size="20" v-if="isReturn"></u-icon> |
|
|
|
<u-icon name="checkmark-circle" color="#999" size="20" v-if="isReturn"></u-icon> --> |
|
|
|
{{ val.attributeList.substr(1).substring(0,val.attributeList.substr(1).length-1).replace(/\"/g, "") }} |
|
|
|
* {{val.productCount}} |
|
|
|
<u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
v-model="val.returnCount"></u-number-box> |
|
|
|
<!-- <u-number-box integer v-if="isReturn" :max="val.productCount" :min="0" |
|
|
|
v-model="val.returnCount"></u-number-box> --> |
|
|
|
</view> |
|
|
|
</u-collapse-item> |
|
|
|
</u-collapse> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-order-info boxbg"> |
|
|
|
<view class="tui-order-info boxbg" v-if="isgys"> |
|
|
|
<view class="tui-order-title"> |
|
|
|
订单信息 |
|
|
|
</view> |
|
|
|
@ -141,17 +142,22 @@ |
|
|
|
<view class="tui-btn-mr"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">取消订单</u-button> |
|
|
|
</view> |
|
|
|
<view class="tui-btn-mr" v-if="sales.status == 5"> |
|
|
|
<view class="tui-btn-mr" v-if="sales.status == 4"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" |
|
|
|
@click="returnGoods">{{ !isReturn ? '退货' : '确认退货'}}</u-button> |
|
|
|
</view> |
|
|
|
<view class="tui-btn-mr"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="editnoEarn" |
|
|
|
v-if="!editNoPrice">汇款</u-button> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="sureNpPay" v-else>确认</u-button> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @tap="inputDialogToggle()" |
|
|
|
v-if="!editNoPrice">回款</u-button> |
|
|
|
<!-- <u-button type="error" :plain="true" shape="circle" @click="sureNpPay" v-else>确认</u-button> --> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- 回款金额输入框 --> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" title="回款金额" placeholder="请输入回款金额" |
|
|
|
@confirm="sureNpPay"></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -184,7 +190,10 @@ |
|
|
|
shopList: [], |
|
|
|
editNoPrice: false, |
|
|
|
newEarn: 0, |
|
|
|
qrcodeData: '' |
|
|
|
qrcodeData: '', |
|
|
|
isgys: true, |
|
|
|
isReturnPrice: 1, |
|
|
|
type: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -209,7 +218,7 @@ |
|
|
|
let sum = 0 |
|
|
|
this.list.forEach(item1 => { |
|
|
|
console.log(item1); |
|
|
|
item1.saleDetailQueryDTO.forEach(v => { |
|
|
|
item1.stockLogList1.forEach(v => { |
|
|
|
console.log(v); |
|
|
|
if (v.returnCount) { |
|
|
|
sum = v.returnCount * item1.wholesalePrice + sum |
|
|
|
@ -224,20 +233,35 @@ |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
if (option.id != null && option.id != undefined && option.id != "") { |
|
|
|
this.tui.request("/app/sale/get/" + option.id, "GET", null, false, false).then((res) => { |
|
|
|
if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
this.sales = res.result.sale |
|
|
|
this.list = res.result.saleDetailDTOList |
|
|
|
this.order = res.result.customer |
|
|
|
}else{ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
// this.tui.request("/app/return/get/" + option.id, "GET", null, false, false).then((res) => { |
|
|
|
// if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
// } |
|
|
|
// }).catch((res) => {}) |
|
|
|
this.getReturnOrder(option.id) |
|
|
|
if (option.type == 'gys') { |
|
|
|
this.type = option.type; |
|
|
|
this.tui.request("/app/purchase/getPurchaseAllData", "post", { |
|
|
|
id: option.id |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.isgys = false |
|
|
|
this.sales = res.result.purchase |
|
|
|
this.list = res.result.purchaseDetails |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
} else { |
|
|
|
this.tui.request("/app/sale/get/" + option.id, "GET", null, false, false).then((res) => { |
|
|
|
if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
this.sales = res.result.sale |
|
|
|
this.list = res.result.saleDetailDTOList |
|
|
|
this.order = res.result.customer |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
// this.tui.request("/app/return/get/" + option.id, "GET", null, false, false).then((res) => { |
|
|
|
// if (res.code == 200 && res.result != null && res.result != undefined) { |
|
|
|
// } |
|
|
|
// }).catch((res) => {}) |
|
|
|
this.getReturnOrder(option.id) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -296,28 +320,38 @@ |
|
|
|
current: "https://jewel-shop.oss-cn-beijing.aliyuncs.com/f02827ca8a7b4decadca812cb2f83110.jpg" |
|
|
|
}) |
|
|
|
}, |
|
|
|
sureNpPay() { |
|
|
|
this.sales.alreadyEarn = (this.sales.alreadyEarn * 1) + (this.newEarn * 1); |
|
|
|
this.tui |
|
|
|
.request( |
|
|
|
'/app/sale/edit', |
|
|
|
'post', { |
|
|
|
sale: this.sales, |
|
|
|
customer: this.order, |
|
|
|
saleDetailDTOList: this.list |
|
|
|
}, |
|
|
|
false, |
|
|
|
false |
|
|
|
) |
|
|
|
.then(res => { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.navigateBack(); |
|
|
|
}) |
|
|
|
.catch(res => {}); |
|
|
|
sureNpPay(e) { |
|
|
|
if(this.type=='gys'){ |
|
|
|
this.tui.request('/app/purchase/editPayPrice','post', { |
|
|
|
id:this.sales.id, |
|
|
|
price:e |
|
|
|
},false,false).then(res => { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.navigateBack(); |
|
|
|
}).catch(res => {}); |
|
|
|
}else{ |
|
|
|
this.sales.alreadyEarn = (this.sales.alreadyEarn * 1) + (this.newEarn * 1); |
|
|
|
this.tui.request('/app/sale/edit','post', { |
|
|
|
sale: this.sales, |
|
|
|
customer: this.order, |
|
|
|
saleDetailDTOList: this.list |
|
|
|
},false,false).then(res => { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.navigateBack(); |
|
|
|
}).catch(res => {}); |
|
|
|
} |
|
|
|
}, |
|
|
|
//回款金额输入框 |
|
|
|
inputDialogToggle() { |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
}, |
|
|
|
//回款按钮 this.type==gys时,是上游客户欠款接口。否则为销售单欠款接口 |
|
|
|
editnoEarn() { |
|
|
|
this.editNoPrice = true; |
|
|
|
}, |
|
|
|
@ -352,8 +386,8 @@ |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
@ -363,18 +397,14 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
transCompanyInput() { |
|
|
|
this.tui.request("/worker/getWXByCondition", "post", { |
|
|
|
ownerCompany: 999999999, |
|
|
|
region: 'A', |
|
|
|
signPerson: this.signCompany |
|
|
|
}, false, false).then((res) => { |
|
|
|
this.tui.request("/worker/getWXByCondition", "post", {}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.orderByWorkerList = res.result; |
|
|
|
this.orderByWorkerCandidates = res.result.map(item => { |
|
|
|
return item.workerName |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -392,7 +422,7 @@ |
|
|
|
sureReturn() { |
|
|
|
console.log(this.list); |
|
|
|
this.list.forEach(item1 => { |
|
|
|
item1.saleDetailQueryDTO.forEach(item2 => { |
|
|
|
item1.stockLogList1.forEach(item2 => { |
|
|
|
if (item2.returnCount) { |
|
|
|
item2.productCount = item2.returnCount |
|
|
|
} else { |
|
|
|
@ -420,15 +450,16 @@ |
|
|
|
returnSale: this.sales, |
|
|
|
returnSaleDetailList: this.list, |
|
|
|
transCompany: this.radio1 == 0 ? '99999999' : '', |
|
|
|
orderByWorker: worderId |
|
|
|
orderByWorker: worderId, |
|
|
|
isReturnPrice: 1 |
|
|
|
}, false, false).then((res) => { |
|
|
|
uni.showToast({ |
|
|
|
title: res.message |
|
|
|
}); |
|
|
|
if (res.code == 200) { |
|
|
|
uni.navigateBack() |
|
|
|
}else{ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
@ -458,8 +489,8 @@ |
|
|
|
console.log(res1) |
|
|
|
this.tui.toast("取消订单成功") |
|
|
|
uni.navigateBack() |
|
|
|
}else{ |
|
|
|
this.tui.toast(res.message) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res1) => {}) |
|
|
|
} |
|
|
|
|