Commit 69194ec7 by 前端

Merge branch 'develop' into 'master'

上线合并

See merge request !382
2 parents 726f9151 25f3944a
...@@ -227,5 +227,9 @@ module.exports = { ...@@ -227,5 +227,9 @@ module.exports = {
// 校验订单是否需要上传合同协议 // 校验订单是否需要上传合同协议
checkZyPayFlag(data) { checkZyPayFlag(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.check', data) return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.check', data)
} },
// 更新合同协议内容
updateZyInfo(data) {
return api.post('dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.update', data)
}
} }
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
color: #FFFFFF; color: #FFFFFF;
background: #347BFF; background: #347BFF;
border-radius: var(--fontSize32); border-radius: var(--fontSize32);
padding: 0 var(--fontSize32); padding: 0 var(--fontSize24);
margin-right: var(--fontSize16); margin-right: var(--fontSize16);
} }
.order-btn:last-child{ .order-btn:last-child{
......
...@@ -59,7 +59,7 @@ Page({ ...@@ -59,7 +59,7 @@ Page({
}, },
// 合同协议上传确定 // 合同协议上传确定
zyPayConfirm(e) { zyPayConfirm(e) {
wx.showLoading({title: '加载中'}) wx.showLoading({title: '加载中', mask: true})
let { zyPayOrderInfo, zyConfirmFlag } = this.data let { zyPayOrderInfo, zyConfirmFlag } = this.data
if (zyConfirmFlag) return false if (zyConfirmFlag) return false
this.setData({ this.setData({
...@@ -204,6 +204,7 @@ Page({ ...@@ -204,6 +204,7 @@ Page({
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
let { timer } = this.data
clearInterval(timer) // 清除定时器 clearInterval(timer) // 清除定时器
}, },
...@@ -211,6 +212,7 @@ Page({ ...@@ -211,6 +212,7 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
let { timer } = this.data
clearInterval(timer) // 清除定时器 clearInterval(timer) // 清除定时器
}, },
......
...@@ -13,6 +13,7 @@ Component({ ...@@ -13,6 +13,7 @@ Component({
type: Boolean, type: Boolean,
observer: function(n) { observer: function(n) {
if (n) { if (n) {
let { showZyTarget, updateZyFlag } = this.data
let sysInfo = wx.getSystemInfoSync() let sysInfo = wx.getSystemInfoSync()
// sysInfo.environment 1 企业微信打开 0微信打开 // sysInfo.environment 1 企业微信打开 0微信打开
// sysInfo.platform === 'windows' || sysInfo.platform === 'mac' || sysInfo.platform === 'linux' 是否pc端打开 // sysInfo.platform === 'windows' || sysInfo.platform === 'mac' || sysInfo.platform === 'linux' 是否pc端打开
...@@ -20,12 +21,23 @@ Component({ ...@@ -20,12 +21,23 @@ Component({
envName: sysInfo.environment ? 1 : 0, envName: sysInfo.environment ? 1 : 0,
envPlat: sysInfo.platform === 'windows' || sysInfo.platform === 'mac' || sysInfo.platform === 'linux' ? 1 : 0 envPlat: sysInfo.platform === 'windows' || sysInfo.platform === 'mac' || sysInfo.platform === 'linux' ? 1 : 0
}) })
// 已上传协议 修改协议
if (updateZyFlag && showZyTarget?.zyPayUrl) {
let fileUrl = wx.$util.deepClone(showZyTarget?.zyPayUrl)
let fileList = fileUrl?.split(',')?.map(v => ({url: v, fileName: v?.split('/').pop()}))
this.setData({
fileType: fileUrl?.includes('.pdf') ? 'pdf' : 'image',
fileList: fileList
})
}
} }
} }
}, },
isListShow: Boolean, // 是否报价单列表 isListShow: Boolean, // 是否报价单列表
onlinePaymentFlag: Boolean, // 是否线上支付 onlinePaymentFlag: Boolean, // 是否线上支付
supplementaryFlag: Boolean // 是否订单补录 supplementaryFlag: Boolean, // 是否订单补录
showZyTarget: Object,
updateZyFlag: Boolean // 是否修改协议
}, },
/** /**
...@@ -107,6 +119,38 @@ Component({ ...@@ -107,6 +119,38 @@ Component({
}) })
}, },
// 预览pdf文件
previewFile(e) {
let { target } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
mask: true
})
wx.downloadFile({
url: target?.replace(/^http:/, 'https:'), // 将http文件地址转为https (开发环境文件服务器不支持https无法预览)
success: function (res) {
const manage = wx.getFileSystemManager()
let file = target.split('/')
let fileName = file[file.length - 1]
manage.saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
wx.hideLoading()
wx.openDocument({
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
fileType: 'pdf',
showMenu: true,
success: function (res) {
wx.hideLoading()
}
})
}
})
}
})
},
// 图片预览 // 图片预览
previewImage(e) { previewImage(e) {
let { url, index } = e.currentTarget.dataset let { url, index } = e.currentTarget.dataset
...@@ -118,14 +162,14 @@ Component({ ...@@ -118,14 +162,14 @@ Component({
}, },
async uploadPDFs() { async uploadPDFs() {
let { envPlat, envName } = this.data let { envPlat, envName, updateZyFlag } = this.data
if (envPlat == 1 || envName == 1) { // 企微或在pc端打开登录小程序使用跳转h5上传方式 if (envPlat == 1 || envName == 1) { // 企微或在pc端打开登录小程序使用跳转h5上传方式
this.setData({ this.setData({
showChangeFileType: false, showChangeFileType: false,
show: false show: false
}) })
const { zyWebViewUrl } = await wx.$util.getMockData() const { zyWebViewUrl } = await wx.$util.getMockData()
let path = `${zyWebViewUrl}/#/zyUpload` let path = updateZyFlag ? `${zyWebViewUrl}/#/zyUpload?updateZyFlag=true` : `${zyWebViewUrl}/#/zyUpload`
return wx.navigateTo({ return wx.navigateTo({
url: `/pages/webView/webView?url=${encodeURIComponent(path)}`, url: `/pages/webView/webView?url=${encodeURIComponent(path)}`,
events: { events: {
...@@ -153,6 +197,9 @@ Component({ ...@@ -153,6 +197,9 @@ Component({
let tempFile = res.tempFiles[0] let tempFile = res.tempFiles[0]
let fileName = tempFile.name // 获取文件名 let fileName = tempFile.name // 获取文件名
let fileType = fileName.split('.').pop() // 获取文件扩展名 let fileType = fileName.split('.').pop() // 获取文件扩展名
if (tempFile?.size > 1024 * 1024 * 10) {
return wx.$util.showToast('上传文件需≤10M,请压缩后重传或联系总部')
}
// 读取文件 // 读取文件
if (fileType != 'pdf') return wx.$util.showToast('只可上传pdf类型文件') if (fileType != 'pdf') return wx.$util.showToast('只可上传pdf类型文件')
_this.setData({ _this.setData({
...@@ -223,22 +270,42 @@ Component({ ...@@ -223,22 +270,42 @@ Component({
}, },
confirm(e, pageBackNum) { confirm(e, pageBackNum) {
// pageBackNum 从h5返回页面层级数 // pageBackNum 从h5返回页面层级数
let { fileList, isListShow, onlinePaymentFlag, supplementaryFlag } = this.data let _this = this
let thisPage = wx.$router.getPageInstance(pageBackNum || 1) let { fileList, updateZyFlag } = _this.data
if (fileList.length) { if (fileList.length) {
// 报价单列表上传协议或者线上支付方式上传协议或者补录订单上传协议 if (!pageBackNum && updateZyFlag) {
if (isListShow || onlinePaymentFlag || supplementaryFlag) { wx.showModal({
this.triggerEvent('confirm', {zyPayUrl: fileList.map(item => item.url)}) title: '修改确认',
} else { content: '本次操作将永久替换原图或协议(仅限1次修改权限),请确认是否更新?',
thisPage.setData({ confirmText: '确定',
['orderInfo.zyPayUrl']: fileList.map(item => item.url)?.join(','), confirmColor: '#347BFF',
confirmStatus: false success(res) {
if (res.confirm) {
_this.confirmEvent(pageBackNum)
}
}
}) })
thisPage.handleSecondConfirm() } else {
_this.confirmEvent(pageBackNum)
} }
} else { } else {
wx.$util.showToast('请上传合同协议') wx.$util.showToast('请上传合同协议')
} }
},
confirmEvent(pageBackNum) {
let _this = this
let { fileList, isListShow, onlinePaymentFlag, supplementaryFlag } = _this.data
let thisPage = wx.$router.getPageInstance(pageBackNum || 1)
// 报价单列表上传协议或者线上支付方式上传协议或者补录订单上传协议
if (isListShow || onlinePaymentFlag || supplementaryFlag) {
_this.triggerEvent('confirm', {zyPayUrl: fileList.map(item => item.url)})
} else {
thisPage.setData({
['orderInfo.zyPayUrl']: fileList.map(item => item.url)?.join(','),
confirmStatus: false
})
thisPage.handleSecondConfirm()
}
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
} }
.tips-text{ .tips-text{
display: flex; display: flex;
align-items: center; align-items: flex-start;
padding: var(--fontSize40) 0 var(--fontSize32) 0; padding: var(--fontSize40) 0 var(--fontSize32) 0;
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #222222; color: #222222;
image{ image{
flex-shrink: 0;
margin-top: var(--fontSize2);
width: var(--fontSize32); width: var(--fontSize32);
height: var(--fontSize32); height: var(--fontSize32);
margin-right: var(--fontSize12); margin-right: var(--fontSize12);
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy> <glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<block wx:if="{{!showChangeFileType && !loadingFlag}}"> <block wx:if="{{!showChangeFileType && !loadingFlag}}">
<popup <popup
title="{{'上传合同协议'}}" title="{{updateZyFlag ? '修改合同协议' : '上传合同协议'}}"
show="{{show}}" show="{{show}}"
bindconfirm="confirm" bindconfirm="confirm"
bindcancel="close" bindcancel="close"
cancelText="稍后补录" cancelText="{{updateZyFlag ? '取消' : '稍后补录'}}"
cancelStyle="color: #347BFF;" cancelStyle="color: #347BFF;"
notCloseOnClickOverlay="{{true}}" notCloseOnClickOverlay="{{true}}"
height="auto"> height="auto">
<view class="content"> <view class="content">
<block wx:if="{{!fileList.length}}"> <block wx:if="{{!fileList.length}}">
<view class="tips-text"><image src="{{IMG_URL}}zy_tips_icon.png"></image>事系提成核算,务必提供</view> <view class="tips-text"><image src="{{IMG_URL}}zy_tips_icon.png"></image>上传完毕计入有效成交,订单才可参与提成/清分/积分发放!</view>
<view class="upload_content" bindtap="selectUplaodType"> <view class="upload_content" bindtap="selectUplaodType">
<image src="{{IMG_URL}}zy-upload_icon.png"></image> <image src="{{IMG_URL}}zy-upload_icon.png"></image>
<text class="text">图片或PDF</text> <text class="text">图片或PDF</text>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</block> </block>
<block wx:else> <block wx:else>
<view class="file_content" wx:for="{{fileList}}" wx:key="index"> <view class="file_content" wx:for="{{fileList}}" wx:key="index">
<view class="file_box"> <view class="file_box" bindtap="previewFile" data-target="{{item.url}}">
<image class="pdf_icon" src="{{IMG_URL}}zy_upload_pdf.png" mode=""/> <image class="pdf_icon" src="{{IMG_URL}}zy_upload_pdf.png" mode=""/>
<text class="file_name">{{item.fileName}}</text> <text class="file_name">{{item.fileName}}</text>
</view> </view>
......
...@@ -265,7 +265,7 @@ Page({ ...@@ -265,7 +265,7 @@ Page({
// 补录订单上传合同协议点击确定 // 补录订单上传合同协议点击确定
zyPayConfirm(e) { zyPayConfirm(e) {
let { supplementaryOrderId, zyConfirmFlag } = this.data // 补录订单id let { supplementaryOrderId, zyConfirmFlag } = this.data // 补录订单id
wx.showLoading({title: '加载中'}) wx.showLoading({title: '加载中', mask: true})
if (zyConfirmFlag) return false if (zyConfirmFlag) return false
this.setData({ this.setData({
zyConfirmFlag: true zyConfirmFlag: true
......
...@@ -8,7 +8,8 @@ import { ...@@ -8,7 +8,8 @@ import {
cancelOrderById, cancelOrderById,
getQuotationInfoById, getQuotationInfoById,
updateCustomerInfo, updateCustomerInfo,
errorOrderById errorOrderById,
updateZyInfo
} from "../../../api"; } from "../../../api";
import { checkDailyReport } from "~/store/ModalToQueueControl"; import { checkDailyReport } from "~/store/ModalToQueueControl";
import data from "../constant/data"; import data from "../constant/data";
...@@ -482,7 +483,14 @@ Component({ ...@@ -482,7 +483,14 @@ Component({
// 校验是否填写昨日日报 // 校验是否填写昨日日报
let staffCheck = await checkDailyReport(true); let staffCheck = await checkDailyReport(true);
if (staffCheck) return false; if (staffCheck) return false;
return this.setData({ showZyPayPopup: true, showZyTarget: target }) return this.setData({ showZyPayPopup: true, showZyTarget: target, updateZyFlag: false })
}
// 修改合同协议
if (target?.zyPayStatus == '2' && target?.canUpdateZyPayUrl == 1 && type == 'upload') {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport(true);
if (staffCheck) return false;
return this.setData({ showZyPayPopup: true, showZyTarget: target, updateZyFlag: true })
} }
// wx.$router.go('createOrderCarQuotation', { // wx.$router.go('createOrderCarQuotation', {
// id: target.id // id: target.id
...@@ -589,43 +597,73 @@ Component({ ...@@ -589,43 +597,73 @@ Component({
}, },
// 合同协议上传确定 // 合同协议上传确定
zyPayConfirm(e) { zyPayConfirm(e) {
let { showZyTarget, zyConfirmFlag } = this.data let { showZyTarget, zyConfirmFlag, updateZyFlag } = this.data
wx.showLoading({title: '加载中'}) wx.showLoading({title: '加载中', mask: true})
if (zyConfirmFlag) return false if (zyConfirmFlag) return false
this.setData({ this.setData({
zyConfirmFlag: true zyConfirmFlag: true
}); });
getQuotationInfoById({ if (updateZyFlag) { // 更新合同协议
id: showZyTarget?.id updateZyInfo({ id: showZyTarget?.id, zyPayUrl: e.detail?.zyPayUrl?.join(',') }).then(res => {
}).then(res => { wx.hideLoading()
let { code, message, data } = res let { code, message } = res
if (code == 0) { if (code == 0) {
let orderInfo = this.getInsurance(data)
// 更新客户信息
updateCustomerInfo({ ...orderInfo, zyPayUrl: e.detail?.zyPayUrl?.join(',') }).then(result => {
wx.hideLoading()
this.setData({ this.setData({
showZyPayPopup: false showZyPayPopup: false
}, () => { }, () => {
this.setData({ this.setData({
zyConfirmFlag: false zyConfirmFlag: false,
}); updateZyFlag: false
})
this.search() this.search()
}) })
}) } else {
} else { this.setData({
wx.$util.showToast(message) showZyPayPopup: false
}, () => {
wx.$util.showToast(message)
})
}
}).catch(() => {
wx.hideLoading() wx.hideLoading()
this.setData({ this.setData({
zyConfirmFlag: false,
updateZyFlag: false
})
})
} else {
getQuotationInfoById({
id: showZyTarget?.id
}).then(res => {
let { code, message, data } = res
if (code == 0) {
let orderInfo = this.getInsurance(data)
// 更新客户信息
updateCustomerInfo({ ...orderInfo, zyPayUrl: e.detail?.zyPayUrl?.join(',') }).then(result => {
wx.hideLoading()
this.setData({
showZyPayPopup: false
}, () => {
this.setData({
zyConfirmFlag: false
});
this.search()
})
})
} else {
wx.$util.showToast(message)
wx.hideLoading()
this.setData({
zyConfirmFlag: false
})
}
}).catch(() => {
this.setData({
zyConfirmFlag: false zyConfirmFlag: false
}) })
} wx.hideLoading()
}).catch(() => {
this.setData({
zyConfirmFlag: false
}) })
wx.hideLoading() }
})
}, },
remarkCancel() { remarkCancel() {
this.setData({ this.setData({
......
...@@ -163,6 +163,9 @@ ...@@ -163,6 +163,9 @@
</block> </block>
<block wx:else> <block wx:else>
<view wx:if="{{ item.orderStatus != '4' && item.orderStatus!=11&& item.orderStatus!=9 }}" class="btn_class"> <view wx:if="{{ item.orderStatus != '4' && item.orderStatus!=11&& item.orderStatus!=9 }}" class="btn_class">
<block wx:if="{{ item.canUpdateZyPayUrl == 1 && item.zyPayStatus == 2 }}">
<view class="order-btn default-btn padding_20" bindtap="handleClickBtn" data-type="upload" data-target="{{ item }}">修改协议</view>
</block>
<block wx:if="{{ item.orderStatus != '0' }}"> <block wx:if="{{ item.orderStatus != '0' }}">
<view class="order-btn default-btn padding_20" bindtap="jumpReception" data-item="{{ item }}">接待记录</view> <view class="order-btn default-btn padding_20" bindtap="jumpReception" data-item="{{ item }}">接待记录</view>
</block> </block>
...@@ -281,4 +284,4 @@ ...@@ -281,4 +284,4 @@
</view> </view>
</view> </view>
</view> </view>
<zy-pay-popup wx:if="{{showZyPayPopup}}" isListShow="{{true}}" show="{{showZyPayPopup}}" bindconfirm="zyPayConfirm"></zy-pay-popup>
\ No newline at end of file \ No newline at end of file
<zy-pay-popup wx:if="{{showZyPayPopup}}" showZyTarget="{{showZyTarget}}" updateZyFlag="{{updateZyFlag}}" isListShow="{{true}}" show="{{showZyPayPopup}}" bindconfirm="zyPayConfirm"></zy-pay-popup>
\ No newline at end of file \ No newline at end of file
...@@ -516,7 +516,7 @@ ...@@ -516,7 +516,7 @@
.btn_class { .btn_class {
display: flex; display: flex;
gap: var(--fontSize20); gap: var(--fontSize16);
margin-left: auto; margin-left: auto;
} }
...@@ -530,7 +530,7 @@ ...@@ -530,7 +530,7 @@
color: #FFFFFF; color: #FFFFFF;
background: #347BFF; background: #347BFF;
border-radius: var(--fontSize32); border-radius: var(--fontSize32);
padding: var(--fontSize8) var(--fontSize40); padding: var(--fontSize8) var(--fontSize20);
flex-shrink: 0; flex-shrink: 0;
} }
...@@ -542,7 +542,7 @@ ...@@ -542,7 +542,7 @@
} }
.padding_20 { .padding_20 {
padding: 0 var(--fontSize20); padding: 0 var(--fontSize14);
} }
.list .item .order { .list .item .order {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!