Commit 8f2cde0e by 杨北旺

完成接口对接

1 parent 8e7d60a7
const url = '/rop-scrm-entmicro/router'
export default {
/**引流获客列表 */
getEntmicroChannelCodeList(data) {
data.method = 'entmicro.api.code.listEntmicroChannelCodeList'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**变更客户信息 */
editCustomer(data) {
data.method = 'entmicro.api.customer.editcustomer'
return window.$HTTP({
url,
data,
})
},
}
...@@ -12,7 +12,7 @@ import wxConfig from './wxConfig' ...@@ -12,7 +12,7 @@ import wxConfig from './wxConfig'
import liveBroadcast from './liveBroadcast' import liveBroadcast from './liveBroadcast'
import groupCustomer from './groupCustomer' import groupCustomer from './groupCustomer'
import groupTag from './groupTag' import groupTag from './groupTag'
import entmicroApi from './entmicroApi' import upload from './upload'
import detailApi from './detail' import detailApi from './detail'
import vehicle from './vehicle' import vehicle from './vehicle'
...@@ -23,7 +23,7 @@ export { ...@@ -23,7 +23,7 @@ export {
liveBroadcast, liveBroadcast,
groupCustomer, groupCustomer,
groupTag, groupTag,
entmicroApi, upload,
detailApi, detailApi,
vehicle vehicle
} }
\ No newline at end of file \ No newline at end of file
const url = '/rop-scrm-equity/router'
export default {
/**获取员工销售的无忧卡订单列表 */
orderListApi(data) {
data.method = 'scrm.api.equity.service.h5.service.order.get'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**获取列表总数 */
orderCountApi(data){
data.method = 'scrm.api.equity.service.h5.service.order.dataprefection.count'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**获取附件值 */
fileDataApi(data) {
data.method = 'scrm.api.equity.service.package.order.attachments.value.get.multiple'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**获取附件信息 */
fileInfoApi(data) {
data.method = 'scrm.api.equity.service.package.order.attachment.get'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**上传附件 */
uploadFileApi(data) {
data.method = 'scrm.api.equity.service.order.attachment.add'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**删除附件 */
deleteFileApi(data) {
data.method = 'scrm.api.equity.service.order.attachment.delete'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**上传图片 */
uploadImageApi(data){
data.method = 'scrm.api.equity.common.upload.image'
return window.$HTTP({
url,
data,
returnAll: true,
sign: true,
noSignAttr: ['file'],
})
}
}
...@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) { ...@@ -15,7 +15,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(config) return Promise.resolve(config)
} }
return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-customer-config', {}).then(res => res.json()) return window.fetch('https://oss-config.test.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-file-upload-config', {}).then(res => res.json())
} }
export const cfg = { export const cfg = {
install(vue, config) { install(vue, config) {
......
...@@ -152,7 +152,8 @@ const actions = { ...@@ -152,7 +152,8 @@ const actions = {
state.showWindow = true state.showWindow = true
}, },
registerHttp({}, sessionId = '') { registerHttp({}, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } }) // window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: '710c3866-90c9-47fb-9161-b702b7f262ad' } })
} }
} }
const getParams = name => { const getParams = name => {
......
...@@ -13,27 +13,28 @@ ...@@ -13,27 +13,28 @@
<div class="list_widget"> <div class="list_widget">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView"> <scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-for="(item, index) in serviceList"> <template v-for="(item, index) in serviceList">
<div :key="index" class="box_wrapper" @click="jumpPage"> <div :key="index" class="box_wrapper" @click="jumpPage(item)">
<div class="header_pannel flex_scb"> <div class="header_pannel flex_scb">
<span class="title text_hide">客户名称</span> <span class="title text_hide">{{item.customerName}}</span>
<p class="status" :class="{ other_color: index % 2 == 0 }"> <p class="status" :class="{ other_color: item.dataPerfection==1 }">
<span class="point" :style="{ background: index % 2 == 0 ? '#3975C6' : '' }"></span> <span class="point" :style="{ background: item.dataPerfection==1 ? '#3975C6' : '' }"></span>
{{ index % 2 == 0 ? '已完成' : '待上传' }} {{ item.dataPerfection==1 ? '已完成' : '待上传' }}
</p> </p>
</div> </div>
<div class="main_pannel"> <div class="main_pannel">
<img v-if="index % 2" class="iconCover" :src="imgBase + 'unActive_v.png'" /> <img v-if="item.packageName=='优享版'" class="iconCover" :src="imgBase + 'version_2.png'" />
<img v-else-if="item.packageName=='舒享版'" class="iconCover" :src="imgBase + 'version_3.png'" />
<img v-else class="iconCover" :src="imgBase + 'active_v.png'" /> <img v-else class="iconCover" :src="imgBase + 'active_v.png'" />
<div class="info_wrap"> <div class="info_wrap">
<p>联系方式:1806446816</p> <p>联系方式:{{item.customerPhone}}</p>
<p>车辆品牌:奔驰</p> <p>车辆品牌:{{item.vehicleBrandName}}</p>
<p>车辆型号:2022款2022款2022款2022款2022款2022款2022款</p> <p>车辆型号:{{item.vehicleShapeName}}</p>
<p>车架号码:LASDLSDKLSDLS</p> <p>车架号码:{{item.vin}}</p>
</div> </div>
</div> </div>
<div class="footer_pannel flex_scb"> <div class="footer_pannel flex_scb">
<span>时间:2021/8/21</span> <span>时间:{{item.successDate}}</span>
<span>{{ index % 2 == 0 ? '查看详情' : '去上传' }}>></span> <span>{{ item.dataPerfection==1 ? '查看详情' : '去上传' }}>></span>
</div> </div>
</div> </div>
</template> </template>
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
<script> <script>
import ScrollView from '../../components/ScrollView.vue' import ScrollView from '../../components/ScrollView.vue'
// import make from './make.vue' // import make from './make.vue'
// import { groupTag, ssoApi, groupCustomer, wxConfig } from '@/api' import { upload} from '@/api'
// import { Toast } from 'vant' // import { Toast } from 'vant'
const baseImg = 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/' const baseImg = 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/'
export default { export default {
...@@ -70,29 +71,88 @@ export default { ...@@ -70,29 +71,88 @@ export default {
], ],
currentTabIndex: 0, currentTabIndex: 0,
imgBase: baseImg, imgBase: baseImg,
serviceList: [1, 2, 3, 4, 5, 6, 7] serviceList: [],
paramForm:{
pageSize:10,
pageNum:1,
}
} }
}, },
created() {}, created() {},
mounted() { mounted() {
console.log(new Date()); this.getOrderCount()
this.getServicesList()
}, },
methods: { methods: {
// 获取列表总数
getOrderCount(queryText){
let para = {}
if(queryText){
para.queryText = queryText
}else{
para = {}
}
upload.orderCountApi(para).then(res=>{
const {finished,total,unfinished} = res.data
this.tabs[0].num = total
this.tabs[1].num = unfinished
this.tabs[2].num = finished
})
},
// 获取列表数据
getServicesList(){
upload.orderListApi(this.paramForm).then(res=>{
let {code,data} = res
if(code!=0){
return
}
data.list.map(item=>{
item.successDate = new Date(item.successDate).format('yyyy/MM/dd')
return item
})
if(this.paramForm.pageNum==1){
this.serviceList = data.list
}else{
data.list.forEach(item=>{
this.serviceList.push(item)
})
}
if((data.list.length<this.paramForm.pageSize)&&this.serviceList.length){
this.$refs.scrollView.finished = true
}
this.$refs.scrollView.loading = false
})
},
search(e) { search(e) {
console.log(e) this.paramForm.queryText = e
if(!e){
delete this.paramForm.queryText
}
this.getServicesList()
this.getOrderCount(e)
}, },
changeTab(e) { changeTab(e) {
this.currentTabIndex = e this.currentTabIndex = e
let dataPerfection = e==2?1:e==1?0:3
this.paramForm.dataPerfection = dataPerfection
if(dataPerfection==3){
delete this.paramForm.dataPerfection
}
this.getServicesList()
}, },
onReachBottom() { onReachBottom() {
console.log('触底') this.paramForm.pageNum++
this.$refs.scrollView.loading = false this.getServicesList()
this.$refs.scrollView.finished = true // this.$refs.scrollView.loading = false
// this.$refs.scrollView.finished = true
}, },
jumpPage() { jumpPage(item) {
this.$router.push({ this.$router.push({
name: 'upload', name: 'upload',
params: {} params: {
packageCode:item.packageCode,
contractNo:item.contractNo,
}
}) })
} }
} }
......
<template> <template>
<div class="contaienr"> <div class="contaienr">
<div class="upload_box_wrapper"> <template v-for="(item, index) in uploadList">
<div class="title flex_scb"> <div :key="index" class="upload_box_wrapper">
<span class="require">*</span> <div class="title flex_scb">
<span>个人客户身份证/单位客户营业执照</span> <span v-if="item.required" class="require">*</span>
<span>{{ item.attachmentName }}</span>
</div>
<div class="main_pannel" @click="toClickUpoload(item)">
<van-uploader v-if="loadingFinish" :before-delete="beforeDelete" :after-read="afterRread" preview-size="102px" v-model="fileURL[item.attachmentCode]" max-count="4">
<div class="box_wrap flex_ccc" style="width:102px;height:102px">
<van-icon name="add-o" size="20px" color="#999999" />
<p>添加</p>
</div>
</van-uploader>
</div>
</div> </div>
<div class="main_pannel"> </template>
<van-uploader :after-read="afterRread1" preview-size="102px" v-model="fileList1" multiple :max-count="6">
<div class="box_wrap flex_ccc">
<van-icon name="add-o" size="20px" color="#999999" />
<p>添加</p>
</div>
</van-uploader>
</div>
</div>
<div class="upload_box_wrapper">
<div class="title flex_scb">
<span class="require">*</span>
<span>新车发票</span>
</div>
<div class="main_pannel">
<van-uploader :after-read="afterRread2" preview-size="102px" v-model="fileList2" multiple :max-count="6">
<div class="box_wrap flex_ccc">
<van-icon name="add-o" size="20px" color="#999999" />
<p>添加</p>
</div>
</van-uploader>
</div>
</div>
<div class="upload_box_wrapper">
<div class="title flex_scb">
<span class="require">*</span>
<span>合同变更书</span>
</div>
<div class="main_pannel">
<van-uploader :after-read="afterRread3" preview-size="102px" v-model="fileList3" multiple :max-count="6">
<div class="box_wrap flex_ccc">
<van-icon name="add-o" size="20px" color="#999999" />
<p>添加</p>
</div>
</van-uploader>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { upload } from '@/api'
const baseImg = 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/' const baseImg = 'https://img01.glsx.com.cn/weapp/resource/equity-h5-new/mini/'
export default { export default {
data() { data() {
return { return {
imgBase: baseImg, imgBase: baseImg,
fileList1: [], fileList: [
fileList2: [], {
fileList3: [] url: 'http://qcimg01.glsx.com.cn/group1/M00/00/6F/wKgD3mINtxWAV8xYAAF0Ps_hc1c683.png',
isImage: true
}
],
uploadList: [],
fileURL: {},
loadingFinish: false
} }
}, },
name: 'upload',
created() {}, created() {},
mounted() {}, mounted() {
const packageCode = this.$route.params.packageCode
const contractNo = this.$route.params.contractNo
this.getFileInof(packageCode, contractNo)
this.contractNo = contractNo
this.packageCode = packageCode
},
methods: { methods: {
afterRread1(file) { // 获取附件信息
console.log(file); getFileInof(packageCode, contractNo) {
upload.fileInfoApi({ packageCode }).then(res => {
this.uploadList = res.data
this.getFileValue(contractNo, res.data)
})
},
// 获取附件信息的值
getFileValue(contractNo, list) {
upload.fileDataApi({ contractNo }).then(res => {
if (res.code == 0) {
this.fileURL = {}
res.data.forEach(el => {
list.forEach(item => {
if (el.attachmentCode === item.attachmentCode) {
let name = `${item.attachmentCode}`
let newArr = []
el.attachmentFiles.forEach(str => {
let temp = {
url: str,
isImage: true
}
newArr.push(temp)
})
let obj = {
[name]: newArr
}
this.fileURL = Object.assign(this.fileURL, obj)
}
})
})
this.loadingFinish = true
}
})
},
// 获取当前点击的位置
toClickUpoload(item) {
this.currentItem = item
},
afterRread(file, e) {
this.uploadImage(file)
}, },
afterRread2(file) { beforeDelete(file, e) {
console.log(file) this.currentDelImg = file.url
this.deleteFile()
},
// 上传图片
uploadImage(file) {
const imgFile = file.content
const base64 = file.file.name.split('.')[1] + '@' + imgFile.split(',')[1]
let para = {
file: base64,
fileType: 'image'
}
upload.uploadImageApi(para).then(res => {
if (res.code == 0) {
this.uploadFile(res.data)
}
})
}, },
afterRread3(file) { // 上传附件
console.log(file) uploadFile(url) {
let para = {
contractNo: this.contractNo,
attachmentCode: this.currentItem.attachmentCode,
attachmentType: this.currentItem.attachmentType,
attachmentFile: url
}
upload.uploadFileApi(para).then(res => {
this.getFileInof(this.packageCode, this.contractNo)
})
}, },
deleteImg1(file) { // 删除附件
console.log(file) deleteFile() {
const name = file.name let para = {
let newArr = this.fileList1.filter(item => { contractNo: this.contractNo,
return item.file.name != name attachmentFile: this.currentDelImg
}
upload.deleteFileApi(para).then(res => {
this.getFileInof(this.packageCode, this.contractNo)
}) })
this.fileList1 = newArr
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!