Commit 8d6a2299 authored by Facius's avatar Facius

配件操作接口

parent a5f0799c
...@@ -192,6 +192,10 @@ let orderApiFun = function(vm){ ...@@ -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 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 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 = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
...@@ -241,7 +245,9 @@ let orderApiFun = function(vm){ ...@@ -241,7 +245,9 @@ let orderApiFun = function(vm){
returnedParts, returnedParts,
reserveList, reserveList,
getLogistics, getLogistics,
getOrderPartsSum getOrderPartsSum,
receiveParts,
cancelParts
} }
return orderApi return orderApi
} }
......
...@@ -56,6 +56,17 @@ ...@@ -56,6 +56,17 @@
'20': '', '20': '',
} }
}, },
operateTypes() {
return {
'1': 'cancelParts',
'10': '',
'15': 'receiveParts',
'20': '',
}
},
buttonOperateType() {
return this.operateTypes[this.info.status]
},
buttonText() { buttonText() {
return this.texts[this.info.status] return this.texts[this.info.status]
}, },
...@@ -70,13 +81,14 @@ ...@@ -70,13 +81,14 @@
return this.titles[String(this.info.status)] return this.titles[String(this.info.status)]
}, },
titles() { titles() {
// 待签收 15 待发货 10 待审核 1 已取消 -1 已驳回 -2 已签收 20
return { return {
'1': '待审核', '1': '待审核',
'10': '待发货', '10': '待发货',
'15': '代签收', '15': '代签收',
'20': '已签收', '20': '已签收',
'-1': '审核未通过', '-2': '审核未通过',
'1': '已取消' '-1': '已取消'
} }
}, },
titleColor() { titleColor() {
...@@ -89,6 +101,17 @@ ...@@ -89,6 +101,17 @@
return '#2272FF' return '#2272FF'
} }
}, },
// 待签收 15 变 已签收 20; 10 待审核 1 变 已取消 -1
willStatus() {
return {
'1': '-1',
'10': '',
'15': '20',
'20': '',
'-2': '',
'-1': ''
}
},
total() { // 合计 total() { // 合计
var i = 0 var i = 0
for (var item of this.info.items) { for (var item of this.info.items) {
...@@ -119,10 +142,10 @@ ...@@ -119,10 +142,10 @@
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('action', this.info) this.$emit('action', this.info.id, this.buttonOperateType, this.willStatus)
}, },
handleOperate() { handleOperate() {
this.$emit('operate', this.info) this.$emit('operate', this.info.id, this.buttonOperateType, this.willStatus)
}, },
handleLongpress() { // 长按复制单号 handleLongpress() { // 长按复制单号
uni.setClipboardData({ uni.setClipboardData({
......
This diff is collapsed.
...@@ -99,10 +99,29 @@ ...@@ -99,10 +99,29 @@
this.loaded = true this.loaded = true
}); });
}, },
handleOperate(type) { // 响应操作按钮
// 调接口 handleOperate(partsId, operateType, willStatus) {
// 修改info的status 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) { handleClickCell(info) {
var pages = getCurrentPages(); 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