Commit e63794f3 authored by Facius's avatar Facius

improve: 前台-订单挂起/悬浮-保存记录优化、跳转

parent 6dc2a933
...@@ -101,10 +101,44 @@ export default { ...@@ -101,10 +101,44 @@ export default {
handleClickCell(item, type, showCountTime) { handleClickCell(item, type, showCountTime) {
this.$emit('update:visible', false) this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime) this.$emit('click', item, type, showCountTime)
// type:类型,showCountTime:是否显示倒计时。详情页面情况太多,提前传值可以避免页面晃动
//type类型
// 'waitAccept': 待接单、待抢单;'waitAppointment': 待预约;'waitCheckIn': 待签到;'waitFinish': 待完工;'audit': 审核中;'exception': 异常单;'finish': 已完工;'other': 工单结算信息
uni.navigateTo({
url:
'pages/order/detail?id=' +
item.orderId +
'&type=' +
type +
'&showCountTime=' +
showCountTime,
})
}, },
handleClickButton(item, type) { handleClickButton(item, type) {
this.$emit('update:visible', false) this.$emit('update:visible', false)
this.$emit('click', item, type, showCountTime) this.$emit('click', item, type, showCountTime)
// 去完工
uni.navigateTo({
url:
'pages/order/complete?orderId=' +
item.orderId +
'&categoryId=' +
item.categoryId +
'&orderServiceType=' +
item.orderServiceType +
'&inGuaranteePeriod=' +
item.inGuaranteePeriod +
'&partnerCompanyId=' +
item.partnerCompanyId +
'&maintainStep=' +
item.maintainStep +
'&orderStatus=' +
item.orderStatus +
'&brandId=' +
item.lianbaoBrandId +
'&auditResults=' +
(item.auditResults ? Object.keys(item.auditResults).join() : ''),
})
}, },
}, },
} }
......
...@@ -98,10 +98,7 @@ ...@@ -98,10 +98,7 @@
</template> </template>
<script> <script>
import uIcon from '../../uview-ui/components/u-icon/u-icon.vue'
import stringMixin from '../createCom/stringMixin'
export default { export default {
components: { uIcon },
props: { props: {
orderData: { orderData: {
type: Object, type: Object,
...@@ -405,7 +402,7 @@ export default { ...@@ -405,7 +402,7 @@ export default {
this.type, this.type,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : ''
) )
this.storeOparation() this.otherAction()
}, },
handleClickCell() { handleClickCell() {
var func = 'click' var func = 'click'
...@@ -420,22 +417,30 @@ export default { ...@@ -420,22 +417,30 @@ export default {
this.type, this.type,
this.showCountTime ? 'show' : '' this.showCountTime ? 'show' : ''
) )
this.otherAction()
},
// 如果是异常单告诉后台
// 更新最近5条查看记录
otherAction() {
this.exceptionRecord()
this.storeOparation() this.storeOparation()
}, },
exceptionRecord() {
// 如果是异常单告诉后台
if (this.type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
},
storeOparation() { storeOparation() {
// 更新最近5条查看记录
if (!this.isSimple) { if (!this.isSimple) {
var array = [...this.vuex_last_five_orders] || [] var array = (this.vuex_last_five_orders || []).filter((item) => {
var i = 0 // 如果记录中有该工单,删除
for (var item of array) { return item && item.orderId != this.orderData.orderId
if (item && item.orderId == this.orderData.orderId) { })
// 需要替换,跳出for循环
break
}
i++
}
array[i] = this.orderData // 用this.orderData替换或新增进this.vuex_last_five_orders
this.$u.vuex('vuex_last_five_orders', array.slice(-5)) array.unshift(this.orderData)
this.$u.vuex('vuex_last_five_orders', array.slice(0, 5))
} }
}, },
handleChange(timestamp) { handleChange(timestamp) {
......
...@@ -368,9 +368,6 @@ export default { ...@@ -368,9 +368,6 @@ export default {
}, },
handleClickCellButton(item, type) { handleClickCellButton(item, type) {
if (!this.loaded) return if (!this.loaded) return
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: url:
......
...@@ -171,9 +171,6 @@ export default { ...@@ -171,9 +171,6 @@ export default {
}, },
handleClickCellButton(item, type) { handleClickCellButton(item, type) {
if (type == 'exception') {
this.$u.api.workerDealWithError(item.orderId).then(() => {})
}
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: url:
......
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