|
@ -15,30 +15,32 @@ |
|
|
</van-tab> |
|
|
</van-tab> |
|
|
</van-tabs> |
|
|
</van-tabs> |
|
|
</div> |
|
|
</div> |
|
|
<van-dialog v-model="showRole" title="请选择接单身份" show-cancel-button @confirm="receiveService"> |
|
|
<!-- 接单个性需求 --> |
|
|
<van-radio-group v-model="serviceOrgType"> |
|
|
<van-dialog v-model="showRole" title="" show-cancel-button :before-close="handelReceiveService"> |
|
|
<van-radio :name="item.serviceOrgType" v-for="(item) in roleList" :key="item.id" |
|
|
<p class="required">接单身份</p> |
|
|
@click="handelChangeRole(item.serviceOrgId)">{{ item.serviceOrgName |
|
|
<van-radio-group v-model="serviceOrgTypeT"> |
|
|
|
|
|
<van-radio :name="index" v-for="(item, index) in roleList" :key="item.id" |
|
|
|
|
|
@click="handelChangeRole(index)">{{ item.serviceOrgName |
|
|
}}</van-radio> |
|
|
}}</van-radio> |
|
|
</van-radio-group> |
|
|
</van-radio-group> |
|
|
</van-dialog> |
|
|
</van-dialog> |
|
|
|
|
|
<!--接单共性需求 --> |
|
|
<van-dialog v-model="showScope" title="" show-cancel-button @confirm="receiveService"> |
|
|
<van-dialog v-model="showScope" title="" show-cancel-button :before-close="handelReceiveService"> |
|
|
<p>服务时间</p> |
|
|
<p class="required">服务时间</p> |
|
|
<span @click="showStart = true, showPopup = true" class="font-size13">{{ serviceTimeStart || '开始时间' |
|
|
<span @click="showStart = true, showPopup = true" class="font-size13">{{ serviceTimeStart || '开始时间' |
|
|
}}</span><span class="tag-date">至</span><span @click="showEnd = true, showPopup = true" |
|
|
}}</span><span class="tag-date">至</span><span @click="showEnd = true, showPopup = true" |
|
|
class="font-size13">{{ serviceTimeEnd || '结束时间' }}</span> |
|
|
class="font-size13">{{ serviceTimeEnd || '结束时间' }}</span> |
|
|
<p>服务范围</p> |
|
|
<p class="required">服务范围</p> |
|
|
<span class="font-size13" @click="showTree = true, showPopup = true">{{ serviceScopeName || '请选择范围' |
|
|
<span class="font-size13" @click="showTree = true, showPopup = true">{{ serviceScopeName || '请选择范围' |
|
|
}}</span> |
|
|
}}</span> |
|
|
<p>接单身份</p> |
|
|
<p class="required">接单身份</p> |
|
|
<van-radio-group v-model="serviceOrgType"> |
|
|
<van-radio-group v-model="serviceOrgTypeT"> |
|
|
<van-radio :name="item.serviceOrgType" v-for="(item) in roleList" :key="item.id" |
|
|
<van-radio :name="index" v-for="(item, index) in roleList" :key="item.id" |
|
|
@click="handelChangeRole(item.serviceOrgId)">{{ item.serviceOrgName |
|
|
@click="handelChangeRole(index)">{{ item.serviceOrgName |
|
|
}}</van-radio> |
|
|
}}</van-radio> |
|
|
</van-radio-group> |
|
|
</van-radio-group> |
|
|
</van-dialog> |
|
|
</van-dialog> |
|
|
|
|
|
<!--个性需求 完成服务 --> |
|
|
<van-dialog v-model="showComplete" title="我已完成需求人的需求" show-cancel-button :before-close="onBeforeClose"> |
|
|
<van-dialog v-model="showComplete" title="我已完成需求人的需求" show-cancel-button :before-close="onBeforeClose"> |
|
|
<p>服务开始时间</p> |
|
|
<p>服务开始时间</p> |
|
|
<span @click="showStart = true, showPopup = true" class="font-size13">{{ actualServiceStartTime || '服务开始时间' |
|
|
<span @click="showStart = true, showPopup = true" class="font-size13">{{ actualServiceStartTime || '服务开始时间' |
|
@ -62,13 +64,14 @@ |
|
|
<van-field v-model="rdFinishDesc" rows="2" autosize type="textarea" placeholder="请输入备注" /> |
|
|
<van-field v-model="rdFinishDesc" rows="2" autosize type="textarea" placeholder="请输入备注" /> |
|
|
|
|
|
|
|
|
</van-dialog> |
|
|
</van-dialog> |
|
|
|
|
|
<!--表单类 --> |
|
|
<van-popup v-model="showPopup" position="bottom"> |
|
|
<van-popup v-model="showPopup" position="bottom"> |
|
|
<van-datetime-picker v-if="showStart" v-model="serviceTimeStart" type="datetime" title="开始时间" |
|
|
<van-datetime-picker v-if="showStart" v-model="serviceTimeStart" type="datetime" title="开始时间" |
|
|
@confirm="handelCLickConfirmStart" @cancel="showPopup = false" :min-date="minDate" /> |
|
|
@confirm="handelCLickConfirmStart" @cancel="showPopup = false" :min-date="minDate" /> |
|
|
<van-datetime-picker v-if="showEnd" v-model="serviceTimeEnd" @confirm="handelCLickConfirmEnd" |
|
|
<van-datetime-picker v-if="showEnd" v-model="serviceTimeEnd" @confirm="handelCLickConfirmEnd" |
|
|
@cancel="showPopup = false" type="datetime" title="结束时间" :min-date="minDate" /> |
|
|
@cancel="showPopup = false" type="datetime" title="结束时间" :min-date="minDate" /> |
|
|
<van-cascader v-if="showTree" v-model="cascaderValue" title="请选择范围" :options="treeOptions" |
|
|
<van-cascader v-if="showTree" v-model="cascaderValue" title="请选择范围" :options="treeOptions" |
|
|
@close="showTree = false, showPopup = false" @finish="onFinish" |
|
|
@close="showTree = false, showPopup = false" @change="onChange" |
|
|
:field-names="{ text: 'objectName', value: 'objectId' }" /> |
|
|
:field-names="{ text: 'objectName', value: 'objectId' }" /> |
|
|
</van-popup> |
|
|
</van-popup> |
|
|
</div> |
|
|
</div> |
|
@ -76,7 +79,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import card from './card.vue' |
|
|
import card from './card.vue' |
|
|
import throttle from 'lodash/debounce' |
|
|
import throttle from 'lodash/debounce' |
|
|
import { getServiceListRcv, getServiceListProcess, getServiceListCompleted, getCommonalityDetail, getMeasureDetail, getListMyIdentities, receiveService, getServiceScopeTree, serviceConfirm, serviceComplete,getSearchResis } from '@/api/service' |
|
|
import { getServiceListRcv, getServiceListProcess, getServiceListCompleted, getCommonalityDetail, getMeasureDetail, getListMyIdentities, receiveService, getServiceScopeTree, serviceConfirm, serviceComplete, getSearchResis } from '@/api/service' |
|
|
import { uploadvariedfile } from '@/api/basic' |
|
|
import { uploadvariedfile } from '@/api/basic' |
|
|
import { Dialog } from 'vant'; |
|
|
import { Dialog } from 'vant'; |
|
|
export default { |
|
|
export default { |
|
@ -105,14 +108,15 @@ export default { |
|
|
cascaderValue: null, |
|
|
cascaderValue: null, |
|
|
serviceScopeName: null, |
|
|
serviceScopeName: null, |
|
|
formData: {}, |
|
|
formData: {}, |
|
|
showComplete:false, |
|
|
showComplete: false, |
|
|
actualServiceStartTime:null,//服务开始时间 |
|
|
actualServiceStartTime: null,//服务开始时间 |
|
|
actualServiceEndTime:null,//服务结束时间 |
|
|
actualServiceEndTime: null,//服务结束时间 |
|
|
selfObj:{}, |
|
|
selfObj: {}, |
|
|
rdFinishResult: null,//是否解决 |
|
|
rdFinishResult: null,//是否解决 |
|
|
rdScore: 5,//评分 |
|
|
rdScore: 5,//评分 |
|
|
fileList: [],//图片上传 |
|
|
fileList: [],//图片上传 |
|
|
rdFinishDesc: null,//备注 |
|
|
rdFinishDesc: null,//备注 |
|
|
|
|
|
serviceOrgTypeT: null |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -123,15 +127,15 @@ export default { |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.scroll = this.$refs.scroll; |
|
|
this.scroll = this.$refs.scroll; |
|
|
if(this.$store.state.app.scrollTop){ |
|
|
if (this.$store.state.app.scrollTop) { |
|
|
setTimeout(()=>{ |
|
|
setTimeout(() => { |
|
|
this.$refs.scroll.scrollTo(0, this.$store.state.app.scrollTop); |
|
|
this.$refs.scroll.scrollTo(0, this.$store.state.app.scrollTop); |
|
|
},500) |
|
|
}, 500) |
|
|
} |
|
|
} |
|
|
this.scroll.addEventListener('scroll', this.bottomScroll); //监听底部加载 |
|
|
this.scroll.addEventListener('scroll', this.bottomScroll); //监听底部加载 |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
activated(){ |
|
|
activated() { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
@ -151,15 +155,15 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handelServiceComplete(item) { |
|
|
handelServiceComplete(item) { |
|
|
if(item.source != 4){ |
|
|
if (item.source != 4) { |
|
|
Dialog.confirm({ |
|
|
Dialog.confirm({ |
|
|
message: `确定已完成“${item.title}”服务吗?`, |
|
|
message: `确定已完成“${item.title}”服务吗?`, |
|
|
}).then( () => { |
|
|
}).then(() => { |
|
|
this.serviceComplete(item) |
|
|
this.serviceComplete(item) |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
}) |
|
|
}) |
|
|
}else if(item.source === 4){ |
|
|
} else if (item.source === 4) { |
|
|
this.showComplete= true; |
|
|
this.showComplete = true; |
|
|
this.selfObj = item; |
|
|
this.selfObj = item; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -212,16 +216,14 @@ export default { |
|
|
this.serverId = item.id; |
|
|
this.serverId = item.id; |
|
|
if (item.source === 4) { |
|
|
if (item.source === 4) { |
|
|
await this.getMeasureDetail() |
|
|
await this.getMeasureDetail() |
|
|
} else if(item.source === 1){ |
|
|
} else if (item.source === 1) { |
|
|
await this.getCommonalityDetail() |
|
|
await this.getCommonalityDetail() |
|
|
}else { |
|
|
} else { |
|
|
await this.getSearchResis() |
|
|
await this.getSearchResis() |
|
|
} |
|
|
} |
|
|
this.$router.push({ name: 'assistanceDetail', params: { detail: this.formData, selfObj: item } }) |
|
|
this.$router.push({ name: 'assistanceDetail', params: { detail: this.formData, selfObj: item } }) |
|
|
}, |
|
|
}, |
|
|
onFinish(value) { |
|
|
onChange(value) { |
|
|
this.showTree = false; |
|
|
|
|
|
this.showPopup = false; |
|
|
|
|
|
this.serviceScopeList = value.selectedOptions.map(item => ({ objectType: item.objectType, objectId: item.objectId, objectName: item.objectName })) |
|
|
this.serviceScopeList = value.selectedOptions.map(item => ({ objectType: item.objectType, objectId: item.objectId, objectName: item.objectName })) |
|
|
this.serviceScopeName = value.selectedOptions.map(item => item.objectName).join('-') |
|
|
this.serviceScopeName = value.selectedOptions.map(item => item.objectName).join('-') |
|
|
}, |
|
|
}, |
|
@ -244,23 +246,45 @@ export default { |
|
|
this.showEnd = false; |
|
|
this.showEnd = false; |
|
|
}, |
|
|
}, |
|
|
//提交接单 |
|
|
//提交接单 |
|
|
async receiveService() { |
|
|
async handelReceiveService(action, done) { |
|
|
|
|
|
if (action === "confirm") { |
|
|
let parm = { |
|
|
let parm = { |
|
|
...this.formData, |
|
|
...this.formData, |
|
|
id: this.serverId, |
|
|
id: this.serverId, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.showScope) { |
|
|
if (this.showScope) { |
|
|
parm.serviceScopeList = this.serviceScopeList; |
|
|
parm.serviceScopeList = this.serviceScopeList; |
|
|
parm.serviceTimeStart = this.serviceTimeStart; |
|
|
parm.serviceTimeStart = this.serviceTimeStart; |
|
|
parm.serviceTimeEnd = this.serviceTimeEnd; |
|
|
parm.serviceTimeEnd = this.serviceTimeEnd; |
|
|
parm.serviceOrgType = this.serviceOrgType; |
|
|
parm.serviceOrgType = this.serviceOrgType; |
|
|
parm.serviceOrgId = this.serviceOrgId; |
|
|
parm.serviceOrgId = this.serviceOrgId; |
|
|
|
|
|
if (!this.serviceTimeStart) { |
|
|
|
|
|
this.$tips.warning('请选择服务开始时间') |
|
|
|
|
|
return done(false) |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.serviceTimeEnd) { |
|
|
|
|
|
this.$tips.warning('请选择服务结束时间') |
|
|
|
|
|
return done(false) |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.serviceScopeList) { |
|
|
|
|
|
this.$tips.warning('请选择服务范围') |
|
|
|
|
|
return done(false) |
|
|
|
|
|
} |
|
|
|
|
|
if (!this.serviceOrgId) { |
|
|
|
|
|
this.$tips.warning('请选择接单身份') |
|
|
|
|
|
return done(false) |
|
|
|
|
|
} |
|
|
} else if (this.showRole) { |
|
|
} else if (this.showRole) { |
|
|
|
|
|
if (!this.serviceOrgId) { |
|
|
|
|
|
this.$tips.warning('请选择接单身份') |
|
|
|
|
|
return done(false) |
|
|
|
|
|
} |
|
|
parm.serviceOrgType = this.serviceOrgType; |
|
|
parm.serviceOrgType = this.serviceOrgType; |
|
|
parm.serviceOrgId = this.serviceOrgId; |
|
|
parm.serviceOrgId = this.serviceOrgId; |
|
|
} |
|
|
} |
|
|
console.log(parm); |
|
|
console.log(parm); |
|
|
let { data, code, msg } = await receiveService(parm) |
|
|
let { code } = await receiveService(parm) |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.$tips.success('接单成功') |
|
|
this.$tips.success('接单成功') |
|
|
this.showRole = false; |
|
|
this.showRole = false; |
|
@ -270,9 +294,15 @@ export default { |
|
|
this.list = []; |
|
|
this.list = []; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
done(true); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handelChangeRole(val) { |
|
|
handelChangeRole(val) { |
|
|
this.serviceOrgId = val; |
|
|
this.serviceOrgId = this.roleList[val].serviceOrgId; |
|
|
|
|
|
this.serviceOrgType = this.roleList[val].serviceOrgType; |
|
|
}, |
|
|
}, |
|
|
//接单 |
|
|
//接单 |
|
|
handleCLickReceive(item) { |
|
|
handleCLickReceive(item) { |
|
@ -330,14 +360,14 @@ export default { |
|
|
this.list = []; |
|
|
this.list = []; |
|
|
this.pageNo = 1; |
|
|
this.pageNo = 1; |
|
|
this.active = e; |
|
|
this.active = e; |
|
|
this.$store.dispatch('setTabActive',e); |
|
|
this.$store.dispatch('setTabActive', e); |
|
|
this.getTableData('tab') |
|
|
this.getTableData('tab') |
|
|
}, |
|
|
}, |
|
|
//滚动加载 |
|
|
//滚动加载 |
|
|
bottomScroll: throttle(function () { |
|
|
bottomScroll: throttle(function () { |
|
|
console.log('滚动加载'); |
|
|
console.log('滚动加载'); |
|
|
let scrollTop = this.scroll.scrollTop; //滚动条距离顶部的高度 |
|
|
let scrollTop = this.scroll.scrollTop; //滚动条距离顶部的高度 |
|
|
this.$store.dispatch('setScrollTop',scrollTop); |
|
|
this.$store.dispatch('setScrollTop', scrollTop); |
|
|
let scrollHeight = this.scroll.scrollHeight; //滚动条的高度 |
|
|
let scrollHeight = this.scroll.scrollHeight; //滚动条的高度 |
|
|
let clientHeight = this.scroll.clientHeight; //可视区域的高度 |
|
|
let clientHeight = this.scroll.clientHeight; //可视区域的高度 |
|
|
if (scrollTop + clientHeight >= scrollHeight) { |
|
|
if (scrollTop + clientHeight >= scrollHeight) { |
|
|