Commit 11891ecd authored by 李超鹏's avatar 李超鹏

完工校验弹窗

parent fafdd87f
<template> <template>
<view class="com-content"> <view class="com-content">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" @close="closeCheckResult" @handle-problem="handerProgrom"></complete-check>
<view class="u-wrap" v-if="!takeStatus"> <view class="u-wrap" v-if="!takeStatus">
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="26" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="26" title-color="#fff" :border-bottom="false" title="完工信息"></u-navbar>
<u-tabs-swiper ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper> <u-tabs-swiper ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="120"></u-tabs-swiper>
...@@ -60,8 +61,8 @@ ...@@ -60,8 +61,8 @@
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-picker> </xh-picker>
<xh-service-measure v-else-if="typeToComponentType(item.fieldsType)==='servicemeasure'" <xh-service-measure v-else-if="typeToComponentType(item.fieldsType)==='servicemeasure'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId"
:orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]" :orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]"
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-service-measure> </xh-service-measure>
<xh-time v-else-if="typeToComponentType(item.fieldsType)==='time'" <xh-time v-else-if="typeToComponentType(item.fieldsType)==='time'"
...@@ -161,7 +162,12 @@ ...@@ -161,7 +162,12 @@
submitBtnStatus: false, submitBtnStatus: false,
takeStatus: false, takeStatus: false,
fileIndex: null, fileIndex: null,
files: [] files: [],
completeCheckStatus: false,
completeCheckResult: [],
waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0,
} }
}, },
components: { components: {
...@@ -286,17 +292,75 @@ ...@@ -286,17 +292,75 @@
} }
}) })
}, },
checkCompleteItem(){
let self = this
let checkResult = []
let pass = true
let first = true
self.list.forEach((panel, panelIndex)=>{
let panelResult = {label: panel.panelName, submitted: 0, required: 0, pass: true}
panel.items.forEach((group, groupIndex) =>{
group.items.forEach((ele, eleIndex)=>{
if(ele.required){
panelResult.required++
let value = self.form[ele.fieldsName]
if(value&&!Array.isArray(value)){
panelResult.submitted++
}else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
first = false
self.waitHandlerPanelIndex = panelIndex
self.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex
}
}
})
})
panelResult.pass = panelResult.required <= panelResult.submitted
pass = pass&&panelResult.pass
checkResult.push(panelResult)
})
console.log(checkResult)
self.completeCheckResult = checkResult
return pass
},
closeCheckResult(){// 检查结果窗口取消回调
this.completeCheckStatus = false
},
handerProgrom(){// 检查结果窗口 去处理回调 定位到缺失的项
this.completeCheckStatus = false
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
this.swichMenu(groupIndex)
})
},
orderFinish(){ orderFinish(){
let self = this let self = this
if(self.inGuaranteePeriod === 'Y'){ let pass = this.checkCompleteItem()
self.$u.api.inOrderFinish(self.orderId).then((res)=>{ if(!pass){
console.log(res) self.completeCheckStatus = true
}) }else{
}else{ console.log("完工");
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{ self.completeCheckStatus = true
console.log(res) if(self.inGuaranteePeriod === 'Y'){
}) self.$u.api.inOrderFinish(self.orderId).then((res)=>{
} console.log(res)
self.completeCheckStatus = true
})
}else{
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{
console.log(res)
self.completeCheckStatus = true
})
}
}
}, },
getTakeStatus(event) { getTakeStatus(event) {
this.takeStatus = event.status this.takeStatus = event.status
...@@ -307,7 +371,7 @@ ...@@ -307,7 +371,7 @@
this.tabIndex = index this.tabIndex = index
this.arr = [] this.arr = []
this.scrollRightTop = 0; this.scrollRightTop = 0;
this.current = 0; this.current = 0;
this.leftMenuStatus(0) this.leftMenuStatus(0)
this.$nextTick(function() { this.$nextTick(function() {
this.getMenuItemTop() this.getMenuItemTop()
...@@ -587,7 +651,7 @@ ...@@ -587,7 +651,7 @@
.u-tab-view { .u-tab-view {
width: 200rpx; width: 200rpx;
height: 100%; height: 100%;
border: 4rpx solid #F4F5F7; border: 4rpx solid #F4F5F7;
} }
...@@ -666,11 +730,11 @@ ...@@ -666,11 +730,11 @@
height: 120rpx; height: 120rpx;
} }
/*提交按钮*/ /*提交按钮*/
.btn-bottom { .btn-bottom {
border: 2rpx solid #F4F5F7; border: 2rpx solid #F4F5F7;
} }
.btn-wrap { .btn-wrap {
width: 100%; width: 100%;
padding: 20rpx 0 44rpx 0; padding: 20rpx 0 44rpx 0;
...@@ -678,7 +742,7 @@ ...@@ -678,7 +742,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.btn-save { .btn-save {
color: #FFFFFF; color: #FFFFFF;
background-color: #2272FF; background-color: #2272FF;
......
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