Commit 188113e5 authored by Damon's avatar Damon

完工页接口

parent bad4185a
......@@ -5,11 +5,11 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl: {
apiUrl: 'http://192.168.1.22', //java端域名请求头
apiUrl: 'http://192.168.0.62:37080', //java端域名请求头
// apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/',
qn_base_url: 'https://qn-static.banshouhui.com/self-support/',
qn_asset_url: 'http://deudn.c.pp.cc/',
argoDebugMode: 1
}
module.exports = UNI_APP;
......@@ -119,6 +119,11 @@ let orderApiFun = function(vm){
*/
let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 完工项阶段下一步
*/
let completeNextStep= async (params = {}, orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/nextStep', params);
/**
* 查询措施
*/
......@@ -212,7 +217,8 @@ let orderApiFun = function(vm){
workerApplyPay,
allowLogin,
otherUser,
checkAddCustomer
checkAddCustomer,
completeNextStep
}
return orderApi
}
......
......@@ -116,6 +116,33 @@
import Detail from "@/components/order/detail.vue"
// import XhRadio from '@/components/createCom/XhRadio.vue'
// 表单类型map
const formType = new Map([
['text', ['textarea','input']],
['password', ['password','input']],
['textarea', ['input','digit']],
['number', ['input','digit']],
['decimal', ['input','digit']],
['double', ['input','digit']],
['integer', ['input','digit']],
['string', ['input','text']],
['multiinput', ['multiinput','text']],
['select', ['select','text']],
['specifications', ['select','text']],
['radio', ['radio','text']],
['checkbox', ['checkbox','text']],
['file', ['file','text']],
['photos', ['file','text']],
['location', ['location','text']],
['scan', ['scan','text']],
['machine_code', ['scan','text']],
['service_measures', ['servicemeasure','text']],
['time', ['time','text']],
['date', ['time','text']],
['form', ['form','text']],
['label', ['label','text']],
])
/**
* modal 弹窗校验
* @description 用于校验下一步的动作
......@@ -153,10 +180,10 @@
action: 'nextAction',
}
}
if (name === '勘察信息') { // 勘察
if (name === 'partnerInspectItem') { // 勘察
if (!pass) return handerProgrom.perfect
return type === '01' ? handerProgrom.next : handerProgrom.appointment
} else if (name === '安装信息') { // 安装
} else if (name === 'partnerInstallItem') { // 安装
let hander = ''
switch (type){
case '01': // 安装完成
......@@ -226,6 +253,7 @@
takeStatus: false,
currentItemDate:{},
photoItem: {},
maintainStep: 'partnerInspectItem',
// showTab: true,
}
},
......@@ -252,15 +280,13 @@
onLoad(option) {
getApp().trackPage('订单完工信息页')
if (option) {
if (option.pageIndex) {
this.tabIndex = option.pageIndex
}
this.orderId = option.orderId
this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.auditResultsId = option.auditResultsId
this.maintainStep = option.maintainStep
this.orderId = option.orderId
this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId
this.auditResultsId = option.auditResultsId
// this.showTab =item.partnerCompanyName == '挚达充电桩'
} else {
......@@ -328,93 +354,23 @@
}
},
initData(res) {
for (var item of res.data.config) {
for (var i of item.items) {
for (var d of i.items) {
var inputType = 'text'
var formType = ''
var type = d.fieldsType.toLocaleLowerCase()
switch (type) {
case 'text':
inputType = 'textarea'
formType = 'input'
break
case 'password':
inputType = 'password'
formType = 'input'
break
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
inputType = 'digit'
break
case 'string':
formType='input',
inputType = 'text'
break
case 'multiinput':
formType = 'multiinput'
inputType = 'text'
break;
case 'select':
case 'specifications':
formType = 'select'
inputType = 'text'
break
case 'radio':
formType = 'radio'
inputType = 'text'
break
case 'checkbox':
formType = 'checkbox'
inputType = 'text'
break
case 'file':
case 'photos':
formType = 'file'
inputType = 'text'
break
case 'location':
formType = 'location'
inputType = 'text'
break
case 'scan':
case 'machine_code':
formType = 'scan'
inputType = 'text'
break
case 'service_measures':
formType = 'servicemeasure'
inputType = 'text'
break
case 'time':
case 'date':
formType = 'time'
inputType = 'text'
break
case 'form':
formType = 'form'
inputType = 'text'
break
case 'label':
formType = 'label'
inputType = 'text'
break
}
d.formType = formType
d.inputType = inputType
const list = res.data.config.sort((a, b) => a.order - b.order)
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index
item.items.forEach(v => {
v.items.forEach(d => {
const type = d.fieldsType.toLocaleLowerCase()
const formMap = formType.get(type)
d.formType = formMap[0]
d.inputType = formMap[1]
if (d.fieldsId == 200 && res.data.value) {
d.required = res.data.value['paymentMethodsType'] !='03'
d.required = res.data.value['paymentMethodsType'] != '03'
}
}
}
}
let list = res.data.config
})
})
})
this.list = list.length > 1 ? [list[1], list[2], list[0]] : list
this.list = list
// this.showTab = this.list.length > 1
this.form = res.data.value || {}
this.current = 0
......@@ -525,14 +481,18 @@
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
},
// 去预约
appointment() {
uni.reLaunch({
url: `/pages/order/detail?id=${this.orderId}`
})
async appointment() {
const save = await this.nextStepSaveData()
if (save) {
uni.reLaunch({
url: `/pages/order/detail?id=${this.orderId}`
})
}
},
// 下一步
nextAction() {
if (this.tabIndex < this.list.length - 1) {
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData()
if (this.tabIndex < this.list.length - 1 && save) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
......@@ -545,14 +505,15 @@
})
}
},
// 下一步弹窗处理
nextStep() {
this.pass = this.checkCompleteItem()
const name = this.list[this.tabIndex].panelName
const type = name === '勘察信息' ? this.form.inspectConclusionType : this.form.constructionConclusionType
const name = this.list[this.tabIndex].panelFieldsName
const type = name === 'partnerInspectItem' ? this.form.inspectConclusionType : this.form.constructionConclusionType
const submit = this.tabIndex === this.list.length - 1
const result = actions(name, this.pass, type, submit)
console.log("result", result)
this.completeCheck.status = true
this.completeCheck.confirmText = result.confirmText
this.completeCheck.action = result.action
......@@ -562,6 +523,25 @@
}
},
// 下一步数据保存
nextStepSaveData() {
const params = {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
}
return this.$u.api.completeNextStep(params, this.orderId).then((res)=>{
if (res.code == 200) {
return Promise.resolve(true)
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
return Promise.resolve(false)
}
})
},
tabsChange(index){
this.tabIndex = index
this.arr = []
......@@ -573,7 +553,7 @@
})
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.getMenuItemTop()
this.getMenuItemTop()
this.tabIndex = panelIndex
this.arr = []
this.scrollRightTop = 0;
......
......@@ -635,6 +635,7 @@
+ "&inGuaranteePeriod=" + this.order.inGuaranteePeriod
+ "&partnerCompanyId=" + this.order.partnerCompanyId
+ '&partnerCompanyName=' + this.order.partnerCompanyName
+ '&maintainStep=' + this.order.maintainStep
})
},
rejectOrder() { // 拒单
......
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