1.增加通过车牌号、车架号查询客户信息

2.增加创建工单钱用户签名
This commit is contained in:
许允枞 2024-10-28 16:37:28 +08:00
parent b7c91de3aa
commit 56305348d1
5 changed files with 525 additions and 96 deletions

View File

@ -4,25 +4,23 @@
<view class="orderNo">
入库单号{{ order.id }}
</view>
<!-- <view :style="{ color: getFlagColor(order.flag) }" class="flag">-->
<!-- {{ order.flagStr }}-->
<!-- </view>-->
</view>
<view class="order-body">
<view class="project">
<view class="project-left">
<view class="title">
<image class="titleIcon" mode="aspectFit" src="/static/icons/order-icon1.png"></image>
配件信息
</view>
<view style="margin-bottom: 20rpx" v-for="(item, index) in goodsList">
<view class="desc">
配件名称{{ item.repairWares.name }}
<view v-if="goodsList && goodsList.length > 0" class="card cardInfo projCard" style="width: 100%">
<view class="projTitle">配件信息</view>
<view class="projList">
<template>
<view v-for="item in goodsList" :key="item.id" class="projEditItem">
<view class="projEditLine1">
<text>{{ item.repairWares.name }}</text>
</view>
<view class="projBaseInfo">
<view>单价{{ item.goodsPrice || "" }}</view>
<view>入库数量{{ item.inCount || "" }}</view>
</view>
</view>
<view class="desc">
入库数量{{ item.inCount }}
</view>
</view>
</template>
</view>
</view>
<view class="baseInfo">
@ -192,6 +190,220 @@ export default {
}
.order-body {
.card {
background: #FFFFFF;
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin: 20rpx 0;
}
.projCard {
padding-bottom: 30rpx;
.projList {
//padding: 0 30rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
margin-top: 20rpx;
.projItem {
background: #FFFFFF;
border-radius: 4rpx 4rpx 4rpx 4rpx;
border: 2rpx solid #DDDDDD;
padding: 0 20rpx;
.projTop {
padding: 20rpx 0;
border-bottom: 1rpx solid #DDDDDD;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 28rpx;
color: #333333;
.projAmount {
font-weight: bold;
color: #0174F6;
}
}
.projBody {
padding-bottom: 20rpx;
.projDate {
font-weight: 500;
font-size: 24rpx;
color: #858BA0;
display: flex;
align-items: center;
column-gap: 10rpx;
padding: 20rpx 0;
}
.projDesc {
font-weight: 500;
font-size: 24rpx;
color: #858BA0;
}
.projImg {
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fill, 120rpx);
justify-content: space-between;
gap: 20rpx;
padding: 20rpx 0;
.projImgItem {
width: 120rpx;
height: 120rpx;
background-color: #efefef;
}
}
.projSend {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
column-gap: 8rpx;
}
}
}
.projEditItem {
padding: 0 20rpx;
background: #F2F2F7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.projEditLine1 {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 28rpx;
color: #333333;
padding: 30rpx 0;
.projAmount {
color: #0174F6;
}
}
.projBaseInfo {
display: grid;
grid-template-columns: 1fr 1fr;
font-size: 24rpx;
color: #999999;
gap: 20rpx;
margin-bottom: 20rpx;
}
.projEditFoot {
padding: 30rpx 0;
border-top: 1px solid #DDDDDD;
display: flex;
align-items: center;
column-gap: 10rpx;
.block1, .block2 {
flex: 1;
width: 0;
display: flex;
align-items: center;
justify-content: center;
column-gap: 8rpx;
font-size: 28rpx;
color: #0174F6;
line-height: 28rpx;
.editPeople {
flex: 1;
width: 0;
display: flex;
justify-content: space-between;
align-items: center;
.editForm {
display: flex;
flex-direction: column;
row-gap: 10rpx;
font-size: 28rpx;
color: #333333;
.label {
font-size: 24rpx;
color: #999999;
}
}
}
}
.line {
height: 28rpx;
width: 2rpx;
background-color: #DDDDDD;
}
}
}
}
}
.cardInfo {
.noReviewPart {
padding: 10rpx 36rpx 10rpx 36rpx;
display: flex;
align-items: center;
column-gap: 10rpx;
margin-top: 10rpx;
background: #FFF6E7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
font-weight: 500;
font-size: 28rpx;
color: #E8A321;
.messageText {
flex: 1;
width: 0;
}
}
&.none {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
.cardNoneIcon {
width: 336rpx;
}
.btn {
position: absolute;
bottom: 40rpx;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
column-gap: 10rpx;
font-weight: 500;
font-size: 28rpx;
color: #0174F6;
}
}
}
.carNum {
margin: 20rpx 0;
}

View File

@ -5,12 +5,12 @@
<view class="body">
<view class="card phone">
<view class="phoneHeader">
<view class="title">查找手机号</view>
<view class="desc">根据手机号查找/建立客户信息</view>
<view class="title">查找手机号|车牌号|车架号</view>
<view class="desc">根据手机号查找|车牌号|车架号/建立客户信息</view>
</view>
<view class="phoneBody">
<view class="searchBox">
<input v-model="phone" placeholder="请输入手机号码" type="tel">
<input v-model="phone" placeholder="请输入手机号码|车牌号|车架号" type="tel">
</view>
<view class="btn" @click="listUserInfo">
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
@ -202,7 +202,6 @@ export default {
}
},
onLoad(data) {
console.log('预约订单页面跳转传进来的数据',data)
this.ticketNo = this.createUniqueCodeByHead('GD')
if (data.phone) {
this.phone = data.phone
@ -217,7 +216,7 @@ export default {
}
}
}
},500)
}, 500)
},
onShow() {
if (this.phone != '') {
@ -239,41 +238,61 @@ export default {
})
return
}
request({
url: '/admin-api/repair/tickets/create',
method: 'POST',
data: {
userId: this.userInfo.id,
ticketNo: this.ticketNo,
userName: this.userInfo.cusName,
userMobile: this.userInfo.phoneNumber,
carId: this.carList[this.activeCarIndex].id,
carNo: this.carList[this.activeCarIndex].licenseNumber,
carVin: this.carList[this.activeCarIndex].vin,
carBrandId: this.carList[this.activeCarIndex].carBrand,
carBrandName: this.carList[this.activeCarIndex].brandStr,
carBrandType: this.carList[this.activeCarIndex].brandType,
adviserId: getUserInfo().id,
adviserName: getUserInfo().nickname,
ticketType: this.ticketType,
itemList: this.formatItem(this.selectedProj)
}
}).then(res => {
uni.showToast({
title: '创建成功',
icon: 'success'
})
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${res.data.id}&isDetail=0`
});
const data = {
userId: this.userInfo.id,
ticketNo: this.ticketNo,
userName: this.userInfo.cusName,
userMobile: this.userInfo.phoneNumber,
carId: this.carList[this.activeCarIndex].id,
carNo: this.carList[this.activeCarIndex].licenseNumber,
carVin: this.carList[this.activeCarIndex].vin,
carBrandId: this.carList[this.activeCarIndex].carBrand,
carBrandName: this.carList[this.activeCarIndex].brandStr,
carBrandType: this.carList[this.activeCarIndex].brandType,
adviserId: getUserInfo().id,
adviserName: getUserInfo().nickname,
ticketType: this.ticketType,
itemList: this.formatItem(this.selectedProj)
}
uni.navigateTo({
url: '/pages-repair/signature/signature?data=' + JSON.stringify(data)
})
// request({
// url: '/admin-api/repair/tickets/create',
// method: 'POST',
// data: {
// userId: this.userInfo.id,
// ticketNo: this.ticketNo,
// userName: this.userInfo.cusName,
// userMobile: this.userInfo.phoneNumber,
// carId: this.carList[this.activeCarIndex].id,
// carNo: this.carList[this.activeCarIndex].licenseNumber,
// carVin: this.carList[this.activeCarIndex].vin,
// carBrandId: this.carList[this.activeCarIndex].carBrand,
// carBrandName: this.carList[this.activeCarIndex].brandStr,
// carBrandType: this.carList[this.activeCarIndex].brandType,
// adviserId: getUserInfo().id,
// adviserName: getUserInfo().nickname,
// ticketType: this.ticketType,
// itemList: this.formatItem(this.selectedProj)
// }
// }).then(res => {
// uni.showToast({
// title: '',
// icon: 'success'
// })
// uni.navigateTo({
// url: `/pages-order/orderDetail/orderDetail?id=${res.data.id}&isDetail=0`
// });
// })
},
listUserInfo() {
this.carList = []
this.userInfo = null
this.activeCarIndex = 0
if (this.phone != '') {
const params = {
phoneNumber: this.phone
phoneOrCar: this.phone
}
request({
url: '/admin-api/base/custom/page',
@ -329,6 +348,16 @@ export default {
params: params
}).then(res => {
this.carList = res.data.records
console.log('车列表', this.carList)
for (let i = 0; i < this.carList.length; i++) {
if (this.carList[i].licenseNumber.toLowerCase() == this.phone.toLowerCase()) {
this.activeCarIndex = i
break
} else if (this.carList[i].vin.toLowerCase() == this.phone.toLowerCase()) {
this.activeCarIndex = i
break
}
}
//
this.carList.forEach(item => {
item.inspectionDate = formatTimestampCustom(item.inspectionDate)

View File

@ -5,12 +5,12 @@
<view class="body">
<view class="card phone">
<view class="phoneHeader">
<view class="title">查找手机号</view>
<view class="desc">根据手机号查找/建立客户信息</view>
<view class="title">查找手机号|车牌号|车架号</view>
<view class="desc">根据手机号查找|车牌号|车架号/建立客户信息</view>
</view>
<view class="phoneBody">
<view class="searchBox">
<input v-model="phone" placeholder="请输入手机号码" type="tel">
<input v-model="phone" placeholder="请输入手机号码|车牌号|车架号" type="tel">
</view>
<view class="btn" @click="listUserInfo">
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
@ -59,7 +59,7 @@ export default {
console.log("获取用户信息")
if (this.phone != '') {
const params = {
phoneNumber: this.phone
phoneOrCar: this.phone
}
request({
url: '/admin-api/base/custom/page',

View File

@ -0,0 +1,183 @@
<template>
<view class="page">
<VNavigationBar background-color="rgba(0,0,0,0)" title="签名" title-color="#333"></VNavigationBar>
<view class="container">
<!-- <view class="instruction">-->
<!-- 确定维修项目无误后请签名-->
<!-- </view>-->
<canvas
canvas-id="signatureCanvas"
class="canvas"
:disable-scroll="true"
@touchstart="startSign"
@touchmove="drawSign"
@touchend="endSign"
></canvas>
<view class="buttons">
<button @click="clearSign">清除</button>
<button @click="saveSign">保存</button>
</view>
</view>
</view>
</template>
<script>
import upload from "@/utils/upload";
import VNavigationBar from "@/components/VNavigationBar.vue";
import request from "@/utils/request";
export default {
components: {VNavigationBar},
data() {
return {
context: null, // Canvas
isSigning: false, //
data:{}
};
},
onLoad(data) {
// canvas
this.context = uni.createCanvasContext("signatureCanvas", this);
if (data.data){
console.log('传递过来的内容', JSON.parse(data.data))
this.data = JSON.parse(data.data)
}
},
methods: {
//
startSign(e) {
const { x, y } = e.touches[0];
this.context.moveTo(x, y);
this.context.beginPath();
this.isSigning = true;
},
//
drawSign(e) {
if (!this.isSigning) return;
const { x, y } = e.touches[0];
this.context.lineTo(x, y);
this.context.setStrokeStyle("#000000"); //
this.context.setLineWidth(2); // 线
this.context.setLineCap("round"); //
this.context.stroke();
this.context.draw(true); //
},
//
endSign() {
this.isSigning = false;
},
//
clearSign() {
this.context.clearRect(0, 0, 750, 750); // Canvas
this.context.draw();
},
//
saveSign() {
uni.canvasToTempFilePath({
canvasId: "signatureCanvas",
success: (res) => {
const tempFilePath = res.tempFilePath;
uni.showToast({
title: "签名已保存",
icon: "success",
});
upload({
url: '/admin-api/common/upload',
filePath: tempFilePath,
}).then((res) => {
console.log('服务器返回图片地址', res);
this.data.image = res.data.url
console.log('提交的内容', this.data)
request({
url: '/admin-api/repair/tickets/create',
method: 'POST',
data: this.data
}).then(res => {
uni.showToast({
title: '创建工单成功',
icon: 'success'
})
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${res.data.id}&isDetail=0`
});
})
});
},
fail: (err) => {
console.log("保存签名失败:", err);
},
});
},
},
};
</script>
<style>
.page {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f5f5f5;
}
.VNavigationBar {
padding: 20rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
position: relative;
}
.container {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20rpx;
background-color: #f5f5f5;
}
.instruction {
font-size: 32rpx;
color: #333;
margin-bottom: 20rpx;
text-align: center;
}
.canvas {
width: 100%;
height: 500rpx;
border: 1px solid #ccc;
border-radius: 10rpx;
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
margin-bottom: 20rpx;
background-color: #fff;
}
.buttons {
display: flex;
gap: 10rpx;
margin-top: 20rpx;
}
button {
padding: 15rpx 30rpx;
background-color: #007aff;
color: #fff;
border: none;
border-radius: 5rpx;
font-size: 28rpx;
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0066cc;
}
button:active {
background-color: #0055aa;
}
</style>

View File

@ -162,49 +162,54 @@
}
]
},
{
"root": "pages-repair",
"pages": [
{
"path": "apply/applyForm",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "apply/newWare",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "reviewList/reviewList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "orderList/orderList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "applyList/applyList",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "applyList/todoDetail",
"style" :
{
"navigationBarTitleText" : ""
}
}
]
},
{
"root": "pages-repair",
"pages": [
{
"path": "apply/applyForm",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "apply/newWare",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "reviewList/reviewList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "orderList/orderList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "applyList/applyList",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "applyList/todoDetail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "signature/signature",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
}
]
},
{
"root": "pages-warehouse",
"pages": [