1.增加通过车牌号、车架号查询客户信息
2.增加创建工单钱用户签名
This commit is contained in:
parent
b7c91de3aa
commit
56305348d1
@ -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 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 style="margin-bottom: 20rpx" v-for="(item, index) in goodsList">
|
||||
<view class="desc">
|
||||
配件名称:{{ item.repairWares.name }}
|
||||
</view>
|
||||
<view class="desc">
|
||||
入库数量:{{ item.inCount }}
|
||||
<view class="projBaseInfo">
|
||||
<view>单价:{{ item.goodsPrice || "" }}</view>
|
||||
<view>入库数量:{{ item.inCount || "" }}</view>
|
||||
</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;
|
||||
}
|
||||
|
@ -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
|
||||
@ -239,10 +238,7 @@ export default {
|
||||
})
|
||||
return
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/repair/tickets/create',
|
||||
method: 'POST',
|
||||
data: {
|
||||
const data = {
|
||||
userId: this.userInfo.id,
|
||||
ticketNo: this.ticketNo,
|
||||
userName: this.userInfo.cusName,
|
||||
@ -258,22 +254,45 @@ export default {
|
||||
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`
|
||||
});
|
||||
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)
|
||||
|
@ -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',
|
||||
|
183
pages-repair/signature/signature.vue
Normal file
183
pages-repair/signature/signature.vue
Normal 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>
|
13
pages.json
13
pages.json
@ -191,17 +191,22 @@
|
||||
},
|
||||
{
|
||||
"path": "applyList/applyList",
|
||||
"style" :
|
||||
{
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "applyList/todoDetail",
|
||||
"style" :
|
||||
{
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "signature/signature",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user