Commit 8d6a2299 authored by Facius's avatar Facius

配件操作接口

parent a5f0799c
......@@ -192,6 +192,10 @@ let orderApiFun = function(vm){
let getLogistics = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/orders/'+ orderId +'/express',{}, formType);
// 配件申请单-数量统计
let getOrderPartsSum = async (orderId) => await vm.$u.get(prefix + 'parts/' + vm.vuex_token + '/' + orderId +'/sum',{}, formType);
// 配件申请单-签收
let receiveParts = async (partOrderId) => await vm.$u.post(prefix + 'parts/' + vm.vuex_token + '/orders/' + partOrderId +'/receive',{}, formType);
// 配件申请单-取消申请
let cancelParts = async (partOrderId) => await vm.$u.post(prefix + 'parts/' + vm.vuex_token + '/orders/'+ partOrderId +'/cancel',{}, formType);
const orderApi = {
listByRecommendOrder,
......@@ -241,7 +245,9 @@ let orderApiFun = function(vm){
returnedParts,
reserveList,
getLogistics,
getOrderPartsSum
getOrderPartsSum,
receiveParts,
cancelParts
}
return orderApi
}
......
......@@ -56,6 +56,17 @@
'20': '',
}
},
operateTypes() {
return {
'1': 'cancelParts',
'10': '',
'15': 'receiveParts',
'20': '',
}
},
buttonOperateType() {
return this.operateTypes[this.info.status]
},
buttonText() {
return this.texts[this.info.status]
},
......@@ -70,13 +81,14 @@
return this.titles[String(this.info.status)]
},
titles() {
// 待签收 15 待发货 10 待审核 1 已取消 -1 已驳回 -2 已签收 20
return {
'1': '待审核',
'10': '待发货',
'15': '代签收',
'20': '已签收',
'-1': '审核未通过',
'1': '已取消'
'-2': '审核未通过',
'-1': '已取消'
}
},
titleColor() {
......@@ -89,6 +101,17 @@
return '#2272FF'
}
},
// 待签收 15 变 已签收 20; 10 待审核 1 变 已取消 -1
willStatus() {
return {
'1': '-1',
'10': '',
'15': '20',
'20': '',
'-2': '',
'-1': ''
}
},
total() { // 合计
var i = 0
for (var item of this.info.items) {
......@@ -119,10 +142,10 @@
},
methods: {
handleClick() {
this.$emit('action', this.info)
this.$emit('action', this.info.id, this.buttonOperateType, this.willStatus)
},
handleOperate() {
this.$emit('operate', this.info)
this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
},
handleLongpress() { // 长按复制单号
uni.setClipboardData({
......
This diff is collapsed.
......@@ -99,10 +99,29 @@
this.loaded = true
});
},
handleOperate(type) {
// 调接口
// 修改info的status
// 刷新页面
// 响应操作按钮
handleOperate(partsId, operateType, willStatus) {
this.$u.api[operateType](partsId).then(res => {
var type = 'error'
var message = res.message
if (res.code === 200) {
if (res.data == true) {
for (var item of this.partsList) {
if (item.id == partsId) {
item.status = willStatus
}
}
}
} else {
console.log(res.message)
}
this.$refs.uToast.show({
title: message,
type: type,
duration: 1000,
callback: function() {}
})
})
},
handleClickCell(info) {
var pages = getCurrentPages();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment