Browse Source

退款及供应商欠款

master
tianyi@bogon 3 years ago
parent
commit
d43736b7fc
  1. 157
      pages/index/orderDetail.vue
  2. 19
      pages/index/uparrears.vue

157
pages/index/orderDetail.vue

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

19
pages/index/uparrears.vue

@ -14,6 +14,7 @@
<view class="uni-body"> <text class="cardText"> <view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}} 订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}}
</view> </view>
<view class="return-price" @tap="returnPrice(item)">回款</view>
</uni-card> </uni-card>
</li> </li>
</ul> </ul>
@ -67,8 +68,10 @@
}) })
}, },
goDetail(){ returnPrice(item){
uni.navigateTo({
url: '/pages/index/orderDetail?type=gys&id='+ item.id
})
} }
} }
} }
@ -96,5 +99,17 @@
} }
} }
} }
}
.return-price{
position: absolute;
bottom: 30rpx;
right: 30rpx;
background: #5fd9ee;
color: #fff;
width: 80rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border-radius: 10px;
} }
</style> </style>
Loading…
Cancel
Save