Commit 508ec5ad by 李伟康

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents 950ae9a7 b03a08d1
...@@ -200,5 +200,29 @@ module.exports = { ...@@ -200,5 +200,29 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
},
// 更新客户签名
updateCustomerNameUrlAPI(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.updateCustomerNameUrl',
projectName: 'boutique',
...data
})
},
/** 查询合同*/
equityOrderList(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.listContracts',
projectName: 'boutique',
...data
})
},
/** 打印合同*/
printContract(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.equityOrder.print',
projectName: 'boutique',
...data
})
} }
} }
...@@ -140,6 +140,9 @@ ...@@ -140,6 +140,9 @@
.ml-32 { .ml-32 {
margin-left: toRpx(32); margin-left: toRpx(32);
} }
.ml-36 {
margin-left: toRpx(36);
}
.ml-48 { .ml-48 {
margin-left: toRpx(48); margin-left: toRpx(48);
} }
......

2.93 MB | W: | H:

2.94 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
<view v-if="((!userInfo.isSuper && userInfo.userType == 2 && orderCardDetail.orderStatus != 4) || orderCardDetail.orderStatus == 2) && isOrder"> <view v-if="((!userInfo.isSuper && userInfo.userType == 2 && orderCardDetail.orderStatus != 4) || orderCardDetail.orderStatus == 2) && isOrder">
<view class="btn_box_class"> <view class="btn_box_class">
<view class="order-btn default-btn" @click="handleSignature">{{ orderCardDetail.customerNameUrl ? '修改客户签名' : '补录客户签名' }}</view> <view class="order-btn default-btn" @click="handleSignature">{{ orderCardDetail.customerNameUrl ? '修改客户签名' : '补录客户签名' }}</view>
<view v-if="orderCardDetail.orderStatus == '2'" class="order-btn default-btn" @click="handlePreviewContract">下载合同</view> <view v-if="orderCardDetail.orderStatus == '2'" class="order-btn default-btn" @click.stop="handlePreviewContract('download')">下载合同</view>
<view v-if="orderCardDetail.orderStatus == '2'" class="order-btn" @click="handlePreviewContract">{{ btnTxt[orderCardDetail.orderStatus] }}</view> <view v-if="orderCardDetail.orderStatus == '2'" class="order-btn" @click.stop="handlePreviewContract()">{{ btnTxt[orderCardDetail.orderStatus] }}</view>
<view v-else class="order-btn" @click="handleRecordOrder">{{ btnTxt[orderCardDetail.orderStatus] }}</view> <view v-else class="order-btn" @click.stop="handleRecordOrder">{{ btnTxt[orderCardDetail.orderStatus] }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -138,39 +138,11 @@ export default { ...@@ -138,39 +138,11 @@ export default {
} }
}) })
}, },
handleClickBtn(type) { // 录单/重新录单
switch (type) { async handleRecordOrder(e) {
case 'upload': // 校验是否填写昨日日报
// 处理上传协议 let staffCheck = await checkDailyReport(true)
this.uploadContract() if (staffCheck) return false
break
case 'handle':
// 处理去处理
this.createorder()
break
case 'price':
// 处理去报价
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' })
break
case 'pay':
this.$emit('openPay', this.orderCardDetail)
// 处理去支付
break
case 'defeat':
// 处理战败
this.defeatOrder()
break
case 'revoke':
// 处理撤销
this.revokeOrder()
break
case 'default':
// 处理默认情况
break
default:
// 其他情况
break
}
}, },
//去处理 //去处理
...@@ -181,6 +153,51 @@ export default { ...@@ -181,6 +153,51 @@ export default {
handleSignature() { handleSignature() {
this.$emit('jump', 'SignName', { paramsData: this.orderCardDetail, type: 'SignName' }) this.$emit('jump', 'SignName', { paramsData: this.orderCardDetail, type: 'SignName' })
}, },
// 预览文件
handlePreviewContract(type) {
let params = {
contractNo: this.orderCardDetail.contractNo
// contractNo: 'car679883190869172224' //开发测试用
}
console.log(this.orderCardDetail)
uni.showLoading({
title: '加载中...',
mask: true
})
uni.$api.equityApi
.equityOrderList({ orderId: this.orderCardDetail.orderId })
.then(res => {
if (res.length == 1) {
uni.$api.equityApi
.printContract(params)
.then(res => {
console.log(res)
uni.hideLoading()
const url = res.url || res
if (type == 'download') {
this.handleDownload(url)
} else {
const fileName = this.getFileNameFromUrl(res.url || res)
const type = 3
console.log(url, fileName, type)
// 跳转到预览页面
uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
})
}
})
.catch(err => {
uni.hideLoading()
})
} else {
uni.hideLoading()
this.$emit('jump', 'PreviewList', { paramsData: res, type: 'PreviewList' })
}
})
.catch(err => {
uni.hideLoading()
})
},
showRefundAlert(type) { showRefundAlert(type) {
const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。' const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。'
uni.showModal({ uni.showModal({
...@@ -214,6 +231,36 @@ export default { ...@@ -214,6 +231,36 @@ export default {
icon: 'none' icon: 'none'
}) })
} }
},
// 从URL获取文件名
getFileNameFromUrl(url) {
return url.split('/').pop().split('?')[0] || '未知文件'
},
getFileTypeFromUrl(url) {
const ext = url.split('.').pop().toLowerCase()
return ext === 'pdf' ? 'pdf' : 'image'
},
handleDownload(url) {
if (!url) {
uni.showToast({ title: '没有合同', icon: 'none' })
return
}
uni.downloadFile({
url: url,
success: res => {
if (res.statusCode === 200) {
uni.showToast({ title: '保存成功', icon: 'none' })
var filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {
console.log('打开文档成功')
}
})
}
}
})
} }
}, },
get methods() { get methods() {
......
<template> <template>
<view class="order-management"> <view class="order-management">
<view class="search-box"> <view class="search-box">
<input class="search-input" placeholder-class="placeholder" v-model="customerName" confirm-type="search" @confirm="search" placeholder="输入客户姓名/商品名称/订单编号/手机号搜索" /> <input class="search-input" placeholder-class="placeholder" v-model="customerName" confirm-type="search" @confirm="search" placeholder="输入客户姓名搜索" />
<view class="clear flex" @click="clear"> <view class="clear flex" @click="clear">
<uni-icons type="closeempty" size="16" v-if="customerName"></uni-icons> <uni-icons type="closeempty" size="16" v-if="customerName"></uni-icons>
</view> </view>
...@@ -353,8 +353,8 @@ export default { ...@@ -353,8 +353,8 @@ export default {
.clear { .clear {
position: absolute; position: absolute;
right: toRpx(18); right: toRpx(18);
top: toRpx(10); top: toRpx(40);
height: 100%; height: toRpx(72);
padding: 0 48rpx; padding: 0 48rpx;
} }
......
...@@ -361,8 +361,8 @@ export default { ...@@ -361,8 +361,8 @@ export default {
.clear { .clear {
position: absolute; position: absolute;
right: toRpx(18); right: toRpx(18);
top: toRpx(10); top: toRpx(40);
height: 100%; height: toRpx(72);
padding: 0 48rpx; padding: 0 48rpx;
} }
......
<template>
<view class="previewList">
<view class="previewList-box">
<view class="common-title">合同列表</view>
<view class="box">
<scroll-view class="scroll-view" scroll-y="true">
<view class="box-content">
<view class="box-shell">
<view class="flex align-item cell-item justify-between" v-for="item in list" :key="item.contractNo">
<view>{{ item.goodName ? '合同:' + item.goodName : '合同' + item.label }}</view>
<view class="flex align-item">
<view class="sprite-icon icon-preview" @click.stop="handlePreviewContract(item)"></view>
<view class="sprite-icon icon-previewDownLoad ml-36" @click.stop="handlePreviewContract(item, 'download')"></view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import utils from '@/utils/utils'
export default {
name: 'PreviewList',
props: {
transmissionOfData: {
type: Object,
default: () => null
}
},
data() {
return {
list: []
}
},
computed: {
userInfo() {
return uni.$storage.get('userInfo') || {}
}
},
mounted() {
this.initData()
},
methods: {
initData() {
console.log('initData', this.transmissionOfData)
this.list = this.transmissionOfData.paramsData
},
handleDownload(url) {
if (!url) {
uni.showToast({ title: '没有合同', icon: 'none' })
return
}
uni.downloadFile({
url: url,
success: res => {
if (res.statusCode === 200) {
uni.showToast({ title: '保存成功', icon: 'none' })
var filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {
console.log('打开文档成功')
}
})
}
}
})
},
handlePreviewContract(item, type) {
let params = {
contractNo: item.contractNo
}
uni.showLoading({
title: '加载中...',
mask: true
})
uni.$api.equityApi
.printContract(params)
.then(res => {
console.log(res)
uni.hideLoading()
const url = res.url || res
if (type == 'download') {
this.handleDownload(url)
} else {
const fileName = this.getFileNameFromUrl(res.url || res)
const type = 3
console.log(url, fileName, type)
// 跳转到预览页面
uni.navigateTo({
url: `/pages/common/filePreview?fileUrl=${encodeURIComponent(url)}&fileType=${type}&fileName=${encodeURIComponent(fileName)}`
})
}
})
.catch(err => {
uni.hideLoading()
})
},
// 从URL获取文件名
getFileNameFromUrl(url) {
return url.split('/').pop().split('?')[0] || '未知文件'
},
getFileTypeFromUrl(url) {
const ext = url.split('.').pop().toLowerCase()
return ext === 'pdf' ? 'pdf' : 'image'
}
}
}
</script>
<style scoped lang="scss">
.previewList {
height: 100%;
position: relative;
.previewList-box {
height: 100%;
position: relative;
}
.box {
height: calc(100% - #{toRpx(120)});
padding-bottom: toRpx(24);
.scroll-view {
height: 100%;
.box-content {
padding: 0 toRpx(48);
.box-shell {
width: 100%;
border-radius: toRpx(16);
background: #ffffff;
padding: toRpx(32);
margin-top: toRpx(16);
.cell-item {
padding: toRpx(28) 0;
border-bottom: toRpx(1) solid #f7f7f6;
}
}
}
}
}
.btns {
position: absolute;
width: 100%;
bottom: 0;
padding: 24rpx 128rpx;
gap: 32rpx;
.save {
background: #3b73ff1a;
color: #4673ff;
font-size: 28rpx;
font-weight: 500;
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: toRpx(1130);
height: toRpx(80);
color: #fff;
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
}
</style>
...@@ -40,8 +40,11 @@ ...@@ -40,8 +40,11 @@
import utils from '@/utils/utils' import utils from '@/utils/utils'
import { UpdateOrderInfo, popupTypeEnum, payTypeList, titleList } from '../contant' import { UpdateOrderInfo, popupTypeEnum, payTypeList, titleList } from '../contant'
import NoticePopup from '@/components/NoticePopup.vue' import NoticePopup from '@/components/NoticePopup.vue'
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import { interceptionMixin } from '@/mixin/index'
export default { export default {
name: 'SignName', name: 'SignName',
mixins: [interceptionMixin],
components: { components: {
NoticePopup NoticePopup
}, },
...@@ -80,9 +83,6 @@ export default { ...@@ -80,9 +83,6 @@ export default {
} }
}, },
computed: { computed: {
showPayTips() {
return this.orderObj.payee == 0 && this.orderObj.payType == 7
},
userInfo() { userInfo() {
return uni.$storage.get('userInfo') || {} return uni.$storage.get('userInfo') || {}
} }
...@@ -99,106 +99,55 @@ export default { ...@@ -99,106 +99,55 @@ export default {
} }
}, },
mounted() { mounted() {
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.initData() this.initData()
}, },
methods: { methods: {
initData() { initData() {
console.log('initData', this.transmissionOfData) console.log('initData', this.transmissionOfData)
const { paramsData } = this.transmissionOfData
this.getQuotationInfoById(paramsData.id)
// 埋点
// uni.$track.add({ eventCode: 'app_create_order' })
},
async getQuotationInfoById(id) {
const data = await uni.$api.equityApi.getQuotationInfoById({ id })
console.log(data, 'data')
// this.orderInfo = data
this.orderObj.id = id
this.orderObj.ownerId = data.owner.id
this.orderObj.carVin = data.owner.carVin
this.orderObj.owner = data.owner.owner
this.orderObj.phone = data.owner.phone
this.orderObj.salesType = data.owner.salesType.toString()
this.orderObj.certificateNo = data.owner.certificateNo
this.orderObj.notes = data.notes
this.updateFormSelection()
}, },
// 输入框失去焦点事件
inputBlur(e, val) {
console.log(e, val)
this.orderObj[val.value] = this.orderObj[val.value]
},
// 校验必填等规则
checkRequired() {
try {
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
requiredArr = [],
onlyLabelItem = [],
{ orderObj } = this
this.formList.forEach(group => {
group.forEach(item => {
if (item.required === true && item.hidden !== true) {
if (item.isArray) onlyLabelItem.push(item)
else requiredArr.push(item)
}
})
})
// 遍历requiredArr,检查orderObj中是否有对应的值
for (let i = 0; i < requiredArr.length; i++) {
const item = requiredArr[i]
// 兼容嵌套customer对象的情况
let value = orderObj[item.value]
if (value === undefined || value === null || value === '') throw `${item.label}不能为空`
// 如果是customerPhone,添加phoneRex校验
if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}`
}
if (orderObj.carVin) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
if (!vinRex.test(orderObj.carVin)) throw '请输入正确的车架号'
}
if (orderObj.certificateNo && orderObj.certificateNo.length != 18) throw '请输入正确的18位证件号'
return true
} catch (error) {
if (error)
uni.showToast({
title: error,
icon: 'none'
})
return false
}
},
// 提交 // 提交
async submit() { async submit() {
if (await this.checkDailyReport()) return if (await this.checkDailyReport()) return
let params = { this.$refs.signatureRef.canvasToTempFilePath({
id: this.orderObj.id, success: async res => {
notes: this.orderObj.notes || '', // 是否为空画板 无签名
owner: { console.log(res.isEmpty)
id: this.orderObj.ownerId, // 生成图片的临时路径
owner: this.orderObj.owner, // H5 生成的是base64
phone: this.orderObj.phone, uni.showLoading({
carVin: this.orderObj.carVin || '', title: '上传中...',
certificateNo: this.orderObj.certificateNo || '', mask: true
salesType: this.orderObj.salesType || 0 })
} console.log(res, 'res')
} let url = await uploadFile(res.tempFilePath)
console.log(params, 'params')
uni.showLoading({
title: '提交中...',
mask: true
})
uni.$api.equityApi
.updateCustomerInfo(params)
.then(result => {
uni.hideLoading() uni.hideLoading()
console.log(result) let params = {
this.$emit('jump', 'OrderManagement', {}) orderId: this.transmissionOfData.paramsData.orderId,
}) customerNameUrl: url
.catch(err => { }
console.log(params, 'params')
uni.showLoading({
title: '提交中...',
mask: true
})
uni.$api.equityApi
.updateCustomerNameUrlAPI(params)
.then(result => {
uni.hideLoading()
console.log(result)
setTimeout(() => {
this.$emit('jump', 'EquityManagement', {})
}, 500)
})
.catch(err => {
uni.hideLoading()
})
},
fail: err => {
uni.hideLoading() uni.hideLoading()
}) }
})
}, },
back() { back() {
// 配置弹窗按钮 // 配置弹窗按钮
...@@ -209,7 +158,7 @@ export default { ...@@ -209,7 +158,7 @@ export default {
callback: () => { callback: () => {
this.transmissionOfData = null this.transmissionOfData = null
this.$refs.notice.close() this.$refs.notice.close()
this.$emit('jump', 'OrderManagement', {}) this.$emit('jump', 'EquityManagement', {})
} }
}, },
{ {
...@@ -223,37 +172,11 @@ export default { ...@@ -223,37 +172,11 @@ export default {
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
}, },
radioChange(val) {
console.log(val)
this.orderObj.salesType = val.detail.value.toString()
},
updateFormSelection() {
this.formList.forEach(group => {
group.forEach(item => {
if (item.value === 'salesType') {
item.current = this.orderObj.salesType
console.log('更新salesType字段:', item.current)
}
})
})
},
onClick(type) { onClick(type) {
if (type == 'openSmooth') { if (type == 'openSmooth') {
this.openSmooth = !this.openSmooth this.openSmooth = !this.openSmooth
return return
} }
if (type == 'save') {
this.$refs.signatureRef.canvasToTempFilePath({
success: res => {
// 是否为空画板 无签名
console.log(res.isEmpty)
// 生成图片的临时路径
// H5 生成的是base64
this.url = res.tempFilePath
}
})
return
}
if (this.$refs.signatureRef) this.$refs.signatureRef[type]() if (this.$refs.signatureRef) this.$refs.signatureRef[type]()
}, },
fullScreen() { fullScreen() {
......
...@@ -50,6 +50,7 @@ import EquityManagement from './components/EquityManagement.vue' ...@@ -50,6 +50,7 @@ import EquityManagement from './components/EquityManagement.vue'
import CreateEquity from './components/CreateEquity.vue' import CreateEquity from './components/CreateEquity.vue'
import SignName from './components/SignName.vue' import SignName from './components/SignName.vue'
import PreviewList from './components/PreviewList.vue'
export default { export default {
mixins: [interceptionMixin], mixins: [interceptionMixin],
...@@ -67,7 +68,8 @@ export default { ...@@ -67,7 +68,8 @@ export default {
StudyCenterPermissionPopup, StudyCenterPermissionPopup,
EquityManagement, EquityManagement,
CreateEquity, CreateEquity,
SignName SignName,
PreviewList
}, },
data() { data() {
return { return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!