Commit f447045b by cen

fix:确认交车

1 parent 806687b2
No preview for this file type
......@@ -116,6 +116,9 @@
.mr-8 {
margin-right: toRpx(8);
}
.ml-4 {
margin-left: toRpx(4);
}
.ml-8 {
margin-left: toRpx(8);
}
......@@ -161,6 +164,7 @@
.mb-16 {
margin-bottom: toRpx(16);
}
.mb-20 {
margin-bottom: toRpx(20);
}
......
......@@ -98,6 +98,7 @@
</view>
</template>
</GeneralPopup>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
<script>
......@@ -109,6 +110,7 @@ import FormCell from './components/FormCell.vue'
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import SelectCity from './components/SelectCity.vue'
import UploadMedia from './components/uploadMedia.vue'
import NoticePopup from '@/components/NoticePopup.vue'
export default {
name: 'AddEvaluationFrom',
components: {
......@@ -117,7 +119,8 @@ export default {
FormCell,
SelectCity,
GeneralPopup,
UploadMedia
UploadMedia,
NoticePopup
},
computed: {
displayData() {
......@@ -206,7 +209,7 @@ export default {
{ key: 'vin', label: '车架号', required: true, maxlength: 17, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'vin', targetObj: 'carBaseReqDTO', type: 'input', showText: 'shopMerchantName', isScan: true, pattern: '^[A-Z0-9]{17}$' },
{ key: 'licensePlate', label: '车牌号', required: true, maxlength: 10, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'licensePlate', targetObj: 'carBaseReqDTO', type: 'input', showText: 'shopMerchantName' },
{ key: 'engineNumber', label: '发动机号', required: true, maxlength: 20, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'engineNumber', targetObj: 'carBaseReqDTO', type: 'input', showText: 'shopMerchantName' },
{ key: 'registrationCity', label: '上牌城市', required: true, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'registrationCityId', targetObj: 'carBaseReqDTO', type: 'select', showText: 'shopMerchantName', isCity: true },
{ key: 'registrationCity', label: '上牌城市', required: true, fullWidth: false, targetNameKey: 'cityName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'registrationCityName', targetObj: 'carBaseReqDTO', type: 'select', showText: 'shopMerchantName', isCity: true },
{ key: 'registrationDate', label: '上牌时间', required: true, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'registrationDate', targetObj: 'carBaseReqDTO', type: 'calendar', showText: 'shopMerchantName' },
{ key: 'carCity', label: '车辆所在地', required: true, fullWidth: false, targetNameKey: 'carCityName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'carCityName', targetObj: 'carBaseReqDTO', type: 'select', isCarCity: true },
{ key: 'mileage', label: '表显里程', inputType: 'number', min: 0, max: 999999, required: true, fullWidth: false, targetNameKey: 'sellerName', sourceNameKey: 'staffName', sourceKey: 'uuid', targetKey: 'mileage', targetObj: 'carBaseReqDTO', type: 'input', showText: 'shopMerchantName', pattern: '^[0-9]{0,6}$' },
......@@ -514,9 +517,26 @@ export default {
console.log('query:', this.query)
},
backPage() {
uni.navigateBack({
delta: 1
})
this.$refs.notice.buttonsList = [
{
text: '确认退出',
type: 'default',
callback: () => {
this.$refs.notice.close()
uni.navigateBack({
delta: 1
})
}
},
{
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
}
}
]
this.$refs.notice.open()
},
getDetail(evalOrderNo) {
......@@ -748,15 +768,15 @@ export default {
this.$set(this.formData.carBaseReqDTO, 'carTypeName', date.year.name)
},
handleCitySelected(date) {
this.$set(this.formData.carBaseReqDTO, 'registrationProvinceId', date.province.id)
this.$set(this.formData.carBaseReqDTO, 'registrationProvinceId', '')
this.$set(this.formData.carBaseReqDTO, 'registrationProvinceName', date.province.name)
this.$set(this.formData.carBaseReqDTO, 'registrationCityId', date.city.name)
this.$set(this.formData.carBaseReqDTO, 'registrationCityId', '')
this.$set(this.formData.carBaseReqDTO, 'registrationCityName', date.city.name)
},
handleCarCitySelected(date) {
this.$set(this.formData.carBaseReqDTO, 'carProvinceId', date.province.id)
this.$set(this.formData.carBaseReqDTO, 'carProvinceId', '')
this.$set(this.formData.carBaseReqDTO, 'carProvinceName', date.province.name)
this.$set(this.formData.carBaseReqDTO, 'carCityId', date.city.id)
this.$set(this.formData.carBaseReqDTO, 'carCityId', '')
this.$set(this.formData.carBaseReqDTO, 'carCityName', date.city.name)
console.log('handleCarCitySelected', this.formData.carBaseReqDTO)
},
......@@ -1017,27 +1037,30 @@ export default {
})
console.log('提交的表单数据:', this.formData)
if (this.query.type === 'add') {
const res = uni.$api.evaluationApi.evalOrderCreate(this.formData).then(res => {
console.log('res:', res)
})
if (res.code == 0) {
const res = await uni.$api.evaluationApi.evalOrderCreate(this.formData)
console.log('res:', res)
if (res) {
uni.hideLoading()
uni.showToast({
title: '新增成功',
icon: 'none'
})
this.backPage()
setTimeout(() => {
this.backPage()
}, 300)
}
} else if (this.query.type === 'edit') {
const res = await uni.$api.evaluationApi.evalOrderUpdate(this.formData)
console.log('res:', res)
if (res.code == 0) {
if (res) {
uni.hideLoading()
uni.showToast({
title: '编辑成功',
icon: 'none'
})
this.backPage()
setTimeout(() => {
this.backPage()
}, 300)
}
}
},
......@@ -1275,12 +1298,11 @@ export default {
color: #fff;
position: relative;
z-index: 1;
line-height: 1;
}
.step-name {
margin-left: toRpx(16);
font-size: toRpx(28);
font-size: toRpx(32);
color: #999999;
&.active {
......@@ -1291,7 +1313,7 @@ export default {
.dash-line {
width: toRpx(64);
height: 0;
border-top: toRpx(4) dashed #999999;
border-top: toRpx(4) dashed #d6d6d6;
margin: 0 toRpx(32);
&.active {
......
......@@ -24,12 +24,12 @@ export default {
default: 10
},
subStatus: {
type: String,
type: Number,
default: ''
},
paymentType: {
type: String,
default: '1'
type: Number,
default: 1
}
},
data() {
......
......@@ -236,7 +236,7 @@ export default {
.from-label {
color: #333333;
font-size: toRpx(32);
font-size: toRpx(28);
font-weight: 400;
display: flex;
align-items: flex-start;
......
......@@ -3,8 +3,8 @@
<view class="card-box" v-if="carInfo.evalOrderNo">
<view class="flex align-center justify-between mb-24">
<view class="status-box">
<text class="label">工单编号:</text>
<text class="value">{{ carInfo.evalOrderNo }}</text>
<text class="label">工单编号</text>
<text class="value ml-12">{{ carInfo.evalOrderNo }}</text>
</view>
<view :class="['status', statusClass(carInfo.status)]">{{ statusMap[carInfo.status].name }}</view>
</view>
......@@ -15,7 +15,7 @@
{{ carInfo.carSeriesName + ' ' + carInfo.carTypeName }}
<view class="common-label ml-20">{{ carInfo.previousOwnerName }} {{ carInfo.previousOwnerPhone }}</view>
</view>
<view class="flex mb-16">
<view class="flex mb-20">
<view class="car-number mr-12">{{ carInfo.licensePlate }}</view>
<view class="car-number mr-12">{{ carInfo.registrationDateStr }}</view>
<view class="car-number mr-12">{{ carInfo.mileageStr }}</view>
......@@ -167,7 +167,7 @@ export default {
border-radius: toRpx(4);
opacity: 1;
border: toRpx(2) solid #e8ecf0;
padding: toRpx(4) toRpx(12);
padding: toRpx(6) toRpx(12);
}
.common-label {
color: #999ea8;
......
......@@ -45,10 +45,10 @@ export default {
popKey: 'previousOwnerPhone'
},
{
placeholder: '车架号',
placeholder: '车牌号',
key: 'carModel',
type: 'input',
popKey: 'vin'
popKey: 'licensePlate'
},
{
placeholder: '评估单号',
......
......@@ -76,7 +76,7 @@
</view>
<view class="button-module flex justify-center align-center">
<view class="button-container flex justify-between">
<view class="cancel-btn">取消</view>
<view class="cancel-btn" @click="backPage">取消</view>
<view class="next-btn" @click="confirmDelivery">确认交车</view>
</view>
</view>
......@@ -100,6 +100,7 @@
</template>
</GeneralPopup>
<order-popup ref="openDate" popupType="13" @onConfirm="confirmDate" />
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
<script>
......@@ -108,11 +109,13 @@ import FormCell from './components/FormCell.vue'
import GeneralPopup from './components/GeneralPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
export default {
components: {
FormCell,
GeneralPopup,
OrderPopup
OrderPopup,
NoticePopup
},
data() {
return {
......@@ -150,7 +153,7 @@ export default {
{
key: 'sellerUserId',
label: '补充协议条款',
required: true,
required: false,
fullWidth: false,
targetNameKey: 'sellerName',
sourceNameKey: 'staffName',
......@@ -216,9 +219,26 @@ export default {
this.query = options
},
backPage() {
uni.navigateBack({
delta: 1
})
this.$refs.notice.buttonsList = [
{
text: '确认退出',
type: 'default',
callback: () => {
this.$refs.notice.close()
uni.navigateBack({
delta: 1
})
}
},
{
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
}
}
]
this.$refs.notice.open()
},
handleCell(field) {
console.log('handleCell', field)
......@@ -248,10 +268,29 @@ export default {
}
},
confirmDelivery() {
if (!this.formData.handoverTime) {
uni.showToast({ title: '请选择交车时间', icon: 'none' })
return
}
if (!this.formData.handoverAddress) {
uni.showToast({ title: '请输入交车地点', icon: 'none' })
return
}
const requiredUploadFields = this.uploadFields.filter(field => field.required)
for (const field of requiredUploadFields) {
const images = this.getImages(field, 'upload')
if (!images || images.length === 0) {
uni.showToast({ title: `请上传${field.label}`, icon: 'none' })
return
}
}
this.$refs.tipsPopup.open()
},
confirmTips() {
async confirmTips() {
// this.uploadedImages
Object.keys(this.uploadedImages).forEach(key => {
if (Array.isArray(this.uploadedImages[key])) {
// 将图片URL数组转换为逗号分隔的字符串
......@@ -260,16 +299,19 @@ export default {
this.formData[key] = imagesStr
}
})
uni.$api.evaluationApi
.confirmDelivery({
evalOrderNo: this.query.evalOrderNo,
...this.formData
})
.then(res => {
console.log('交车成功', res)
})
// uni.showToast({ title: '交车成功', icon: 'none' })
// this.backPage()
const res = await uni.$api.evaluationApi.confirmDelivery({
evalOrderNo: this.query.evalOrderNo,
...this.formData
})
console.log('res:', res)
if (res) {
uni.showToast({ title: '交车成功', icon: 'none' })
setTimeout(() => {
// uni.navigateBack({
// delta: 1
// })
}, 500)
}
},
handleImageUpload(field) {
// 显示操作菜单,让用户选择拍照或从相册选择
......
......@@ -6,17 +6,17 @@
</view>
<view class="title">评估单详情</view>
</view>
<view class="flex justify-between align-center mb-24">
<view class="flex justify-between align-center mb-24 px-48">
<view class="flex align-center justify-between">
<view :class="['status mr-24', statusClass(detailsInfo.basic.status)]">{{ statusMap[detailsInfo.basic.status].name }}</view>
<view class="status-box">
<text class="label">工单编号:</text>
<text class="value">{{ detailsInfo.basic.evalOrderNo }}</text>
<text class="label">工单编号</text>
<text class="value ml-12">{{ detailsInfo.basic.evalOrderNo }}</text>
</view>
</view>
<view class="status-box">
<text class="label">工单编号:</text>
<text class="value">{{ detailsInfo.basic.evalOrderNo }}</text>
<text class="label">工单编号</text>
<text class="value ml-12">{{ detailsInfo.basic.evalOrderNo }}</text>
</view>
</view>
<view class="detail-content">
......@@ -28,11 +28,11 @@
</view>
</scroll-view>
</view>
<view class="tab-panel" :class="{ 'no-bac': activeTab != 1 || activeTab != 0 }">
<view class="tab-panel" :class="{ 'no-bac': activeTab != 1 && activeTab != 0 }">
<!-- 动态标题 -->
<view class="tab-panel-title" v-if="activeTab == 0 || activeTab == 1">{{ tabs[activeTab].name }}</view>
<!-- 动态内容区域 -->
<view v-if="activeTab === 0" class="gridBox mb-32">
<view v-if="activeTab === 0" class="gridBox">
<view v-for="(item, index) in carInfoItems" :key="index" :class="['flex align-center', { 'full-width': item.fullWidth }]">
<view class="title-label-see mr-16">{{ item.label }}</view>
<view>{{ formatValue(item, detailsInfo) }}</view>
......@@ -679,7 +679,7 @@ export default {
.tab-panel {
border-radius: toRpx(16);
background: #ffffff;
padding: toRpx(24) toRpx(32);
padding: toRpx(24) toRpx(32) 0 toRpx(32);
.tab-panel-title {
font-size: toRpx(32);
font-weight: 600;
......@@ -689,7 +689,7 @@ export default {
.gridBoxNoPadding {
display: grid;
grid-template-columns: 1fr 1fr;
gap: toRpx(24);
gap: toRpx(28);
border-radius: toRpx(16);
background: #ffffff;
......@@ -730,7 +730,7 @@ export default {
.gridBox {
display: grid;
grid-template-columns: 1fr 1fr;
gap: toRpx(24);
gap: toRpx(28);
border-radius: toRpx(16);
background: #ffffff;
padding: toRpx(28) toRpx(32);
......
......@@ -11,12 +11,14 @@
<view class="box-class mt-32">
<type-tab-component :typeList="typeList" :isShowCount="true" :tabIndex.sync="tabIndex" @tabClick="search"></type-tab-component>
<z-paging ref="paging" :fixed="false" paging-class="paging-class " :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
<template #empty>
<view class="mask-box flex flex-col justify-center align-center">
<image src="@/assets/images/evaluationForm/noData.png" />
<view>暂无客户工单</view>
</view>
</template>
<EvaluationCard @button-click="handleButtonClick" v-for="(item, index) in dataList" :key="index" :carInfo="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()" :class="{ 'mb-40': index < dataList.length - 1 }"></EvaluationCard>
</z-paging>
<view class="mask-box flex flex-col justify-center align-center" v-if="dataList.length == 0">
<image src="@/assets/images/evaluationForm/noData.png" />
<view>暂无客户工单</view>
</view>
</view>
</view>
<view class="addBtn" @click="addEvaluationForm({ type: 'add' })">
......@@ -127,6 +129,17 @@
</view>
</template>
</GeneralPopup>
<GeneralPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips">
<template #content>
<view>
<image class="tipsPopupBg" :src="bg" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>是否确定取消签约?</view>
</view>
</view>
</template>
</GeneralPopup>
<OrderPopup ref="orderPopup" :data="custodyAgreementList" :isDefeatOrder="true" :externalData="[]" @onConfirm="onConfirm" :popupType="14" />
</view>
</template>
......@@ -152,6 +165,7 @@ export default {
},
data() {
return {
bg: require('@/assets/images/boutique/tipsPopupBg.png'),
tabIndex: 0,
currentPage: 1,
amountRequestedPopupTitle: '',
......@@ -190,7 +204,7 @@ export default {
searchValue: {
previousOwnerName: '',
previousOwnerPhone: '',
vin: '',
licensePlate: '',
evalOrderNo: ''
},
typeList: [
......@@ -225,9 +239,12 @@ export default {
},
search() {
console.log(this.searchValue, '32323')
this.$refs.paging.reload()
this.$refs.paging?.reload()
this.getStatByStatus()
},
onShow() {
this.search()
},
reset() {
this.searchValue = {
previousOwnerName: '',
......@@ -244,9 +261,14 @@ export default {
currentPage: pageNo,
pageSize: 10
})
console.log('res:', res)
this.dataList = res.records
this.$refs.paging.complete(this.dataList)
if (res) {
console.log('res:', res)
// this.dataList = res.records
this.$refs.paging.complete(res.records)
} else {
this.$refs.paging.complete(false)
console.log(err)
}
},
getStatByStatus() {
uni.$api.evaluationApi
......@@ -263,7 +285,7 @@ export default {
this.typeList.forEach(item => {
item.count = res[item.keyNum] || 0
})
this.$set(this.typeList, item.count, res[item.keyNum])
// this.$set(this.typeList, item.count, res[item.keyNum])
console.log('this.typeList:', this.typeList)
})
},
......@@ -330,7 +352,16 @@ export default {
console.log('res:', res)
if (!res.false) {
that.$refs.signAgreementPopup.open().then(() => {
uni.$api.evaluationApi.sendCustodyAgreement({ ...that.signAgreementObj, evalOrderNo: e.evalOrderNo })
uni.$api.evaluationApi.sendCustodyAgreement({ ...that.signAgreementObj, evalOrderNo: e.evalOrderNo }).then(res => {
if (res) {
uni.showToast({
title: '代保管协议已发送',
icon: 'none'
})
that.currentPage = 1
that.search()
}
})
})
} else {
await uni.$api.evaluationApi.signAgreement({
......@@ -379,21 +410,35 @@ export default {
return
}
const res = uni.$api.evaluationApi.evalOrderOwnerReQuote(this.requoteObj)
uni.showToast({
title: '重新报价成功',
icon: 'none'
})
this.$refs.requotePopup.closePopup()
this.currentPage = 1
this.search()
if (res) {
uni.showToast({
title: '重新报价成功',
icon: 'none'
})
this.$refs.requotePopup.closePopup()
this.currentPage = 1
this.search()
}
},
cancelSign(e) {
this.cancelSignObj.evalOrderNo = e.evalOrderNo
this.$refs.cancleSignPopup.open().then(() => {
const res = uni.$api.evaluationApi.evalOrderCancelContract(this.cancelSignObj)
console.log('取消签约成功')
this.currentPage = 1
this.search()
this.$refs.tipsPopup
.open()
.then(() => {
const res = uni.$api.evaluationApi.evalOrderCancelContract(this.cancelSignObj)
if (res) {
uni.showToast({
title: '取消签约成功',
icon: 'none'
})
this.currentPage = 1
this.search()
}
})
.catch(() => {
this.$refs.cancleSignPopup.closePopup()
})
})
},
async showsignAgreementPopup() {
......
......@@ -127,7 +127,7 @@
<checkbox-group @change="checkboxChange" class="checkbox-group flex align-center">
<label class="uni-list-cell uni-list-cell-pd align-center flex ml-48" v-for="item in checkboxList" :key="item.value">
<view>
<checkbox style="transform: scale(0.7)" :value="item.value" :checked="item.checked" :disabled="item.disabled" />
<checkbox style="transform: scale(0.7)" activeBackgroundColor="#4673FF" iconColor="#fff" :value="item.value" :checked="item.checked" :disabled="item.disabled" />
</view>
<view class="checkbox-name">{{ item.name }}</view>
<input class="checkbox-input" v-if="item.isShowInput" v-model="formData[item.inputValue]" placeholder="请输入" type="text" />
......@@ -144,7 +144,7 @@
</view>
</view>
<view class="footerBtn">
<view class="btn cancle">取消</view>
<view class="btn cancle" @click="backPage">取消</view>
<view class="btn next" @click="comfirmPage = true">下一步</view>
</view>
</view>
......@@ -248,6 +248,7 @@
<uni-calendar class="calendar" :showMonth="false" @change="calendarChange" />
</template>
</GeneralPopup>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
<script>
......@@ -256,11 +257,13 @@ import GeneralPopup from './components/GeneralPopup.vue'
import { uploadFile } from '@/utils/ossUploadFile/uploadFile.js'
import OrderPopup from '@/components/OrderPopup/index.vue'
import dayjs from 'dayjs'
import NoticePopup from '@/components/NoticePopup.vue'
export default {
components: {
FormCell,
GeneralPopup,
OrderPopup
OrderPopup,
NoticePopup
},
data() {
return {
......@@ -837,8 +840,26 @@ export default {
})
},
backPage() {
// 返回上一页
uni.navigateBack()
this.$refs.notice.buttonsList = [
{
text: '确认退出',
type: 'default',
callback: () => {
this.$refs.notice.close()
uni.navigateBack({
delta: 1
})
}
},
{
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
}
}
]
this.$refs.notice.open()
},
comfirm() {
uni.$api.evaluationApi.evalOrderSignContract({ ...this.formData, evalOrderNo: this.query.evalOrderNo })
......@@ -846,7 +867,9 @@ export default {
title: '电子签约已发送,请注意查收短信',
icon: 'none'
})
uni.navigateBack()
setTimeout(() => {
uni.navigateBack()
}, 500)
},
// 计算尾款:尾款 = 评估价 - 定金
calculateFinalPrice() {
......@@ -924,7 +947,9 @@ export default {
background-size: 100%;
padding: toRpx(160) toRpx(64) toRpx(48);
box-sizing: border-box;
::v-deep .uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled {
background-color: #4673ff !important;
}
.detail-content {
width: 100%;
height: 100%;
......@@ -1054,7 +1079,7 @@ export default {
}
.upload-text {
margin-top: toRpx(12);
margin-top: toRpx(20);
font-size: toRpx(24);
}
.requiredLabel {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!