Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-repair-app
This commit is contained in:
commit
ae5278af76
@ -1,16 +1,20 @@
|
||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
3
App.vue
3
App.vue
@ -28,4 +28,7 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.image-view-img{
|
||||
background: white;
|
||||
}
|
||||
</style>
|
||||
|
@ -42,10 +42,15 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view @click="projectDis" v-if="order.ticketsStatus == '04' && roleCanPg" class="btn pg">
|
||||
<view @click="projectDis" v-if="order.ticketsStatus == '04' && (userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('general_inspection'))" class="btn pg">
|
||||
项目派工
|
||||
</view>
|
||||
<view @click="projectDis" v-if="order.ticketsStatus == '05' && roleCanPg" class="btn pg">
|
||||
<view @click="projectDis" v-if="order.ticketsStatus == '05' && userInfo.roleCodes.includes('repair_staff') && ifLeader && order.canOperate" class="btn pg">
|
||||
<!--维修班组长且当前施工人是本班组内的人,可以重新派工-->
|
||||
重新派工
|
||||
</view>
|
||||
<view @click="projectDis" v-if="order.ticketsStatus == '05' && (userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('general_inspection'))" class="btn pg">
|
||||
<!--服务顾问和总检,可以重新派工-->
|
||||
重新派工
|
||||
</view>
|
||||
<view @click="receiveOrder(order.id)" v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='01' && roleCanJd" class="btn qc">
|
||||
@ -92,27 +97,29 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//当前角色是否可以派工
|
||||
roleCanPg:false,
|
||||
//当前角色是否可以告知取车
|
||||
roleCanQc:false,
|
||||
//当前角色是否可以接单
|
||||
roleCanJd:false,
|
||||
//当前用户是否可以进行施工、施工过程、结束施工操作---
|
||||
roleCanSg:false,
|
||||
//当前用户
|
||||
userInfo:{},
|
||||
ifLeader:false,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
let userInfo = getUserInfo()
|
||||
if(userInfo.roleCodes.includes("service_advisor") || userInfo.roleCodes.includes("general_inspection") || (userInfo.roleCodes.includes("repair_staff") && getStrData("ifLeader"))){
|
||||
//服务顾问、总检、维修班组长可以派工
|
||||
this.ifLeader = getStrData('ifLeader')
|
||||
this.userInfo = getUserInfo()
|
||||
if(this.userInfo.roleCodes.includes("service_advisor") || this.userInfo.roleCodes.includes("general_inspection") || (this.userInfo.roleCodes.includes("repair_staff") && getStrData("ifLeader"))){
|
||||
//服务顾问、总检可以派工,维修班组长需要判断是否可以派工
|
||||
this.roleCanPg = true
|
||||
}
|
||||
if(userInfo.roleCodes.includes("service_advisor")){
|
||||
if(this.userInfo.roleCodes.includes("service_advisor")){
|
||||
//服务顾问可以告知取车
|
||||
this.roleCanQc = true
|
||||
}
|
||||
if(userInfo.roleCodes.includes("repair_staff") && this.order.nowRepairId==userInfo.id){
|
||||
if(this.userInfo.roleCodes.includes("repair_staff") && this.order.nowRepairId==userInfo.id){
|
||||
//维修工角色,并且指派处理的人就是当前用户可以接单
|
||||
this.roleCanJd = true
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<image mode="aspectFit" src="@/static/icons/tabbar/order.png" v-show="aindex != 2"></image>
|
||||
<image mode="aspectFit" src="@/static/icons/tabbar/order-checked.png" v-show="aindex == 2"></image>
|
||||
</view>
|
||||
<view class="">工单</view>
|
||||
<view class="">{{ title }}</view>
|
||||
</view>
|
||||
<!-- <view class="box" :class="{active: aindex == 3}" @click="getgogo(3)">-->
|
||||
<!-- <view class="imgs">-->
|
||||
@ -57,7 +57,14 @@
|
||||
}
|
||||
},
|
||||
props: {
|
||||
msg: String|Number
|
||||
msg: {
|
||||
type: String|Number,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '工单'
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.userInfo = getUserInfo();
|
||||
|
@ -1,12 +1,14 @@
|
||||
// 应用全局配置
|
||||
module.exports = {
|
||||
// baseUrl: 'https://www.nuoyunr.com',
|
||||
// baseUrl: 'http://192.168.1.17:48080',
|
||||
baseUrl: "http://localhost:48080",
|
||||
// baseUrl: 'http://124.222.105.7:48080',
|
||||
baseUrl: 'http://192.168.1.17:48080',
|
||||
// baseUrl: "http://localhost:48080",
|
||||
imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
|
||||
baseImageUrl: 'https://www.nuoyunr.com/minio/',
|
||||
shareUrl: 'https://www.lighting-it.cn/share?inviteId=',
|
||||
wsUrl: 'ws://192.168.1.17:48080',
|
||||
//com.carService.qx
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
|
@ -41,9 +41,27 @@
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"Ba-KeepAlive" : {
|
||||
"__plugin_info__" : {
|
||||
"name" : "安卓保活(采用多种主流技术) Ba-KeepAlive",
|
||||
"description" : "原生保活插件,支持市面上大部分机型,Android4.4到13.0 。为定位、推送、websocket、定时任务、蓝牙、聊天等保驾护航(**注意:**不保证支持所有机型和场景,建议先试用再购买)",
|
||||
"platforms" : "Android",
|
||||
"url" : "https://ext.dcloud.net.cn/plugin?id=9423",
|
||||
"android_package_name" : "com.carService.qx",
|
||||
"ios_bundle_id" : "",
|
||||
"isCloud" : true,
|
||||
"bought" : 1,
|
||||
"pid" : "9423",
|
||||
"parameters" : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
|
@ -101,14 +101,6 @@ export default {
|
||||
params:params
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
res.data.map((item)=>{
|
||||
getDictTextByCodeAndValue("repair_unit",item.wares.unit).then(value => {
|
||||
item.wares.unit = value
|
||||
}).catch(error => {
|
||||
item.wares.unit = "未知"
|
||||
console.error(error);
|
||||
});
|
||||
})
|
||||
this.repairList = res.data
|
||||
}
|
||||
})
|
||||
|
@ -220,7 +220,9 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (this.phone != '') {
|
||||
this.listUserInfo()
|
||||
setTimeout(() => {
|
||||
this.listUserInfo()
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -306,7 +308,7 @@ export default {
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请输入手机号',
|
||||
title: '请输入手机号|车牌号|车架号',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@ -340,7 +342,9 @@ export default {
|
||||
|
||||
getCarList() {
|
||||
const params = {
|
||||
userId: this.userInfo.userId
|
||||
userId: this.userInfo.userId,
|
||||
pageNo: 1,
|
||||
pageSize: 100000
|
||||
}
|
||||
request({
|
||||
url: '/admin-api/base/carMain/page',
|
||||
@ -348,7 +352,6 @@ 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
|
||||
@ -360,9 +363,21 @@ export default {
|
||||
}
|
||||
//将时间戳转换
|
||||
this.carList.forEach(item => {
|
||||
item.inspectionDate = formatTimestampCustom(item.inspectionDate)
|
||||
item.insuranceDate = formatTimestampCustom(item.insuranceDate)
|
||||
item.carRegisterDate = formatTimestampCustom(item.carRegisterDate)
|
||||
if (item.inspectionDate) {
|
||||
item.inspectionDate = formatTimestampCustom(item.inspectionDate)
|
||||
}else {
|
||||
item.inspectionDate = ''
|
||||
}
|
||||
if (item.insuranceDate) {
|
||||
item.insuranceDate = formatTimestampCustom(item.insuranceDate)
|
||||
}else {
|
||||
item.insuranceDate = ''
|
||||
}
|
||||
if (item.carRegisterDate) {
|
||||
item.carRegisterDate = formatTimestampCustom(item.carRegisterDate)
|
||||
}else {
|
||||
item.carRegisterDate = ''
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
@ -389,6 +404,10 @@ export default {
|
||||
|
||||
},
|
||||
editUserInfo(userInfo) {
|
||||
if (this.phone == '') return uni.showToast({
|
||||
title: '请先输入手机号,再添加客户',
|
||||
icon: 'none'
|
||||
})
|
||||
bus.$off('updateUserInfo')
|
||||
bus.$on('updateUserInfo', (userInfo) => {
|
||||
this.userInfo = userInfo
|
||||
|
@ -553,30 +553,30 @@ export default {
|
||||
}
|
||||
}
|
||||
if(this.loginUser.roleCodes.includes("repair_staff")){
|
||||
//维修工角色
|
||||
if(this.ticketInfo.nowRepairId==this.loginUser.id && "05"==this.ticketInfo.ticketsStatus){
|
||||
//当前用户就是施工人,,订单状态处于维修中 可以提交配件申请
|
||||
this.content.push({
|
||||
text: '配件申请', active: false,code:"apply"
|
||||
})
|
||||
if("02"==this.ticketInfo.ticketsWorkStatus){
|
||||
//当前正在施工,可以随时上传图片、也可以结束施工
|
||||
//维修工角色,可以提交配件申请
|
||||
this.content.push({
|
||||
text: '配件申请', active: false, code: "apply"
|
||||
})
|
||||
if ("05" == this.ticketInfo.ticketsStatus && this.ticketInfo.nowRepairId == this.loginUser.id) {
|
||||
//订单状态处于维修中 ,且自己就是施工人
|
||||
if ("02" == this.ticketInfo.ticketsWorkStatus) {
|
||||
//当前正在施工且可以随时上传图片、也可以结束施工
|
||||
this.content.push({
|
||||
text: '拍照上传', active: false,code:"working"
|
||||
text: '拍照上传', active: false, code: "working"
|
||||
})
|
||||
this.content.push({
|
||||
text: '阶段完成', active: false,code:"done_half"
|
||||
text: '阶段完成', active: false, code: "done_half"
|
||||
})
|
||||
this.content.push({
|
||||
text: '项目完成', active: false,code:"other"
|
||||
text: '项目完成', active: false, code: "other"
|
||||
})
|
||||
this.content.push({
|
||||
text: '移交总检', active: false,code:"done"
|
||||
text: '移交总检', active: false, code: "done"
|
||||
})
|
||||
//查当前维修的项目
|
||||
this.selectNowRepair()
|
||||
}
|
||||
if("03"==this.ticketInfo.ticketsWorkStatus || "04"==this.ticketInfo.ticketsWorkStatus) {
|
||||
if ("03" == this.ticketInfo.ticketsWorkStatus || "04" == this.ticketInfo.ticketsWorkStatus) {
|
||||
//当前子状态是已接单和已完成,可以开始施工
|
||||
this.content.push({
|
||||
text: '开始施工', active: false, code: "start"
|
||||
|
@ -34,7 +34,8 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<tabBarVue msg="2"></tabBarVue>
|
||||
<tabBarVue v-if="isRepairWarehouse" title="采购单" msg="2"></tabBarVue>
|
||||
<tabBarVue v-else msg="2"></tabBarVue>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
<text class="formValue"></text>
|
||||
</view>
|
||||
<view style="padding-bottom: 60rpx;border-bottom: 1px solid #ddd;" class="formItem">
|
||||
<checkbox-group v-model="checkedCorpIdList">
|
||||
<checkbox-group v-model="checkedCorpIdList" @change="cs">
|
||||
<checkbox v-for="(item, index) in allCompanyList" :key="index" :value="item.id" :checked="item.checked">{{ item.corpName }}</checkbox>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
@ -153,6 +153,9 @@ export default {
|
||||
|
||||
},
|
||||
methods: {
|
||||
cs(e){
|
||||
this.checkedCorpIdList =e.detail.value
|
||||
},
|
||||
/**
|
||||
* 初始化配件数据
|
||||
*/
|
||||
@ -290,10 +293,14 @@ export default {
|
||||
return
|
||||
}
|
||||
//组装可用的子公司
|
||||
|
||||
console.log(this.allCompanyList,"this.checkedCorpIdList")
|
||||
debugger
|
||||
if(this.checkedCorpIdList.length>0){
|
||||
this.formData.corpId = this.checkedCorpIdList.join()
|
||||
}
|
||||
//组装所属分类
|
||||
this.formData.status = "01"
|
||||
this.formData.type = this.allTypeList[this.typeIndex].id
|
||||
this.formData.unit = this.allUnitList[this.unitIndex].value
|
||||
this.formData.dataForm = this.allFromList[this.fromIndex].value
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<VNavigationBar background-color="rgba(0,0,0,0)" title="签名" title-color="#333"></VNavigationBar>
|
||||
<VNavigationBar background-color="rgba(0,0,0,0)" title="客户签名" title-color="#333"></VNavigationBar>
|
||||
<view class="container">
|
||||
<!-- <view class="instruction">-->
|
||||
<!-- 确定维修项目无误后请签名-->
|
||||
<!-- </view>-->
|
||||
<view class="instruction">
|
||||
确定维修项目无误后请客户签字确认
|
||||
</view>
|
||||
<canvas
|
||||
canvas-id="signatureCanvas"
|
||||
class="canvas"
|
||||
@ -38,6 +38,7 @@ export default {
|
||||
onLoad(data) {
|
||||
// 获取 canvas 上下文
|
||||
this.context = uni.createCanvasContext("signatureCanvas", this);
|
||||
this.context.fillStyle = "white";
|
||||
if (data.data){
|
||||
console.log('传递过来的内容', JSON.parse(data.data))
|
||||
this.data = JSON.parse(data.data)
|
||||
|
@ -88,7 +88,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<tabBarVue msg="1"></tabBarVue>
|
||||
<tabBarVue msg="1" title="采购单"></tabBarVue>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
<view class="footer" v-if="isToBeReviewed">
|
||||
<text class="label"></text>
|
||||
<text class="repairNum"></text>
|
||||
<!-- <view class="submit" @click="toPart">采购</view>-->
|
||||
<view class="submit" @click="toPart">采购</view>
|
||||
<view class="submit" @click="submit">{{isReceive?'通知领料':'通知退料'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<view class="list">
|
||||
<view class="formItem" v-if="!isInput">
|
||||
<text class="formLabel">供应商</text>
|
||||
<input type="text" style="text-align: right" v-model="serviceName" placeholder="请选择供应商"/>
|
||||
<input type="text" style="text-align: right" v-model="serviceName" placeholder="请输入供应商名称"/>
|
||||
<view @click="searchService">查询</view>
|
||||
</view>
|
||||
<view class="formItem" v-if="!isInput">
|
||||
@ -17,11 +17,11 @@
|
||||
</view>
|
||||
<uni-card v-for="(item, index) in partList" :key="index" :title="item.name" :extra="'上次价格:'+item.purPrice">
|
||||
<view class="formItem">
|
||||
<text class="formLabel">单价</text>
|
||||
<view class="formLabel">单价</view>
|
||||
<input type="number" style="text-align: right" v-model="item.newPrice" placeholder="请输入单价"/>
|
||||
</view>
|
||||
<view class="formItem">
|
||||
<text class="formLabel">数量</text>
|
||||
<view class="formLabel">数量</view>
|
||||
<input type="number" style="text-align: right" v-model="item.count" placeholder="请输入数量"/>
|
||||
</view>
|
||||
</uni-card>
|
||||
@ -325,6 +325,7 @@ export default {
|
||||
.formLabel {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.formValue {
|
||||
|
18
pages.json
18
pages.json
@ -67,8 +67,7 @@
|
||||
{
|
||||
"path": "pages/project/project",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增维修项目",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": "新增维修项目"
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -94,29 +93,25 @@
|
||||
{
|
||||
"path": "choosePeople/choosePeople",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "chooseImg/chooseImg",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "reviewList/reviewList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "inWare/inWare",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -204,8 +199,7 @@
|
||||
{
|
||||
"path": "signature/signature",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": true
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -10,10 +10,21 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
keepLive: {
|
||||
channelId: 'Ba-KeepAlive',
|
||||
channelName: "Ba-KeepAlive",
|
||||
title: "汽修小助手正在运行",
|
||||
content: "汽修小助手正在运行",
|
||||
dataResult: "",
|
||||
type: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef APP
|
||||
//保活技术
|
||||
this.register()
|
||||
// #endif
|
||||
if(getToken()){
|
||||
//跳转首页
|
||||
//判断是否是仓管,仓管需要跳单独的首页
|
||||
@ -32,10 +43,21 @@
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
register() { //注册
|
||||
console.log(keepAlivePlugin, 'keepAlive');
|
||||
keepAlivePlugin.register({
|
||||
channelId: this.keepLive.channelId,
|
||||
channelName: this.keepLive.channelName,
|
||||
title: this.keepLive.title,
|
||||
content: this.keepLive.content,
|
||||
},
|
||||
(res) => {
|
||||
console.log('保活注册', res);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -5,7 +5,14 @@
|
||||
<u-form labelPosition="top">
|
||||
<view class="card">
|
||||
<u-form-item borderBottom label="上传图片" labelWidth="200">
|
||||
<u-upload></u-upload>
|
||||
<u-upload
|
||||
:fileList="fileList1"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="1"
|
||||
:maxCount="1"
|
||||
multiple
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item borderBottom label="车牌号" labelWidth="200" @click="carInputClick();">
|
||||
<u-input
|
||||
@ -20,18 +27,11 @@
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item label="车辆品牌" labelWidth="200" @click="brandType = true;">
|
||||
<u-input
|
||||
v-model="car.brandStr"
|
||||
border="none"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择车辆品牌"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
<!-- @click="brandType = true;"-->
|
||||
<u-form-item label="车辆品牌" labelWidth="200">
|
||||
<picker @change="picker($event)" :value="arrayIndex" :range="brandList" range-key="brandName">
|
||||
<view class="uni-input">{{ brandList && brandList[arrayIndex] ? brandList[arrayIndex].brandName : '' }}</view>
|
||||
</picker>
|
||||
</u-form-item>
|
||||
<u-form-item label="车辆型号" labelWidth="200">
|
||||
<u-input
|
||||
@ -40,6 +40,11 @@
|
||||
placeholder="请输入车辆型号"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item class="formItem" label="车辆性质" labelWidth="200">
|
||||
<picker @change="natureChange" :value="natureIndex" :range="natureList" range-key="value">
|
||||
<view class="uni-input">{{ natureList[natureIndex].value}}</view>
|
||||
</picker>
|
||||
</u-form-item>
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
@ -91,24 +96,6 @@
|
||||
</view>
|
||||
</u-form>
|
||||
|
||||
<!-- 车辆品牌 -->
|
||||
<u-action-sheet
|
||||
:actions="brandList"
|
||||
:show="brandType"
|
||||
title="请选择车辆品牌"
|
||||
@close="brandType = false"
|
||||
@select="brandSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
<!-- 车辆型号 -->
|
||||
<u-action-sheet
|
||||
:actions="typeList"
|
||||
:show="showType"
|
||||
title="请选择车辆型号"
|
||||
@close="showType = false"
|
||||
@select="typeSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
|
||||
<keyboard-plate ref="plateNumber" :plateNum.sync='car.licenseNumber' isShow
|
||||
@change="getPlateNum"></keyboard-plate>
|
||||
@ -131,8 +118,10 @@
|
||||
|
||||
<script>
|
||||
import VNavigationBar from '@/components/VNavigationBar.vue';
|
||||
import {bus} from "@/utils/eventBus";
|
||||
import request from "@/utils/request";
|
||||
import config from '@/config'
|
||||
import upload from "@/utils/upload";
|
||||
import {getDictByCode} from "@/utils/utils";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -158,18 +147,24 @@ export default {
|
||||
brandAndModel: [],
|
||||
},
|
||||
userInfo: {},
|
||||
arrayIndex: 0,
|
||||
bo1: false,
|
||||
bo2: true,
|
||||
|
||||
datePickerShow: false,
|
||||
datePickerValue: new Date().getTime(),
|
||||
pickerConfirmField: 'njDate',
|
||||
brandId:'',
|
||||
brandId: '',
|
||||
|
||||
showType: false,
|
||||
brandType: false,
|
||||
typeList: [],
|
||||
brandList: [],
|
||||
fileList1: [],
|
||||
imageUrl: '',
|
||||
//可选车辆性质范围
|
||||
natureList: [],
|
||||
natureIndex: 0,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -182,42 +177,60 @@ export default {
|
||||
this.bo1 = true;
|
||||
this.bo2 = false;
|
||||
this.pageTitle = '修改车辆信息'
|
||||
if (this.car.carLicenseImg) {
|
||||
this.fileList1.push({
|
||||
url: config.baseImageUrl + this.car.carLicenseImg
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 没有数据 需要赋值一下初始化
|
||||
this.bo1 = false;
|
||||
this.bo2 = true;
|
||||
this.pageTitle = '添加车辆信息'
|
||||
}
|
||||
this.getBrandList()
|
||||
this.getNatureList()
|
||||
this.car.userId = JSON.parse(decodeURIComponent(options.userInfo)).userId;
|
||||
this.userInfo = JSON.parse(decodeURIComponent(options.userInfo))
|
||||
console.log(this.car)
|
||||
this.getBrandList()
|
||||
|
||||
},
|
||||
methods: {
|
||||
typeSelect(e) {
|
||||
console.log('e', e)
|
||||
},
|
||||
brandSelect(e) {
|
||||
console.log('e', e)
|
||||
this.brandId = e.value
|
||||
this.car.brandStr = e.name
|
||||
// this.getCarModule()
|
||||
picker(e) {
|
||||
// 或者
|
||||
this.arrayIndex = e.target.value;
|
||||
this.brandId = this.brandList[e.target.value].value
|
||||
},
|
||||
// 车辆性质选择事件
|
||||
natureChange(event) {
|
||||
const newIndex = event.detail.value;
|
||||
this.natureIndex = newIndex;
|
||||
//
|
||||
this.car.carNature = this.natureList[newIndex].value;
|
||||
},
|
||||
getBrandList() {
|
||||
request({
|
||||
url: '/admin-api/base/carBrand/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
page: 1,
|
||||
size: 10000
|
||||
pageNo: 1,
|
||||
pageSize: 10000
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
res.data.records.forEach(item => {
|
||||
item.name = item.brandName,
|
||||
item.value = item.id
|
||||
item.value = item.id
|
||||
})
|
||||
this.brandList = res.data.records
|
||||
if (this.car) {
|
||||
for (let i = 0; i < this.brandList.length; i++) {
|
||||
if (this.car.carBrand == this.brandList[i].id) {
|
||||
this.arrayIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -257,7 +270,6 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.car[this.pickerConfirmField] = date.getFullYear() + '-' + (Number(date.getMonth()) + 1 + '').padStart(2, '0') + '-' + (date.getDate() + '').padStart(2, '0')
|
||||
console.log("this.car[this.pickerConfirmField]",this.car[this.pickerConfirmField])
|
||||
this.datePickerCancel(picker)
|
||||
},
|
||||
datePickerCancel(picker) {
|
||||
@ -274,18 +286,28 @@ export default {
|
||||
if (type === 'day') {
|
||||
return `${value}日`
|
||||
}
|
||||
console.log('for value', value)
|
||||
return value
|
||||
},
|
||||
// 新增
|
||||
async submit() {
|
||||
// bus.$emit('updateCarInfo', this.car)
|
||||
this.car.brandAndModel = [this.brandId, this.car.carModel]
|
||||
console.log("car",this.car)
|
||||
//将日期转为时间戳
|
||||
this.car.inspectionDate = new Date(this.car.inspectionDate).getTime()
|
||||
this.car.insuranceDate = new Date(this.car.insuranceDate).getTime()
|
||||
this.car.carRegisterDate = new Date(this.car.carRegisterDate).getTime()
|
||||
if (this.car.inspectionDate) {
|
||||
this.car.inspectionDate = new Date(this.car.inspectionDate).getTime()
|
||||
}else {
|
||||
this.car.inspectionDate = undefined
|
||||
}
|
||||
if (this.car.insuranceDate) {
|
||||
this.car.insuranceDate = new Date(this.car.insuranceDate).getTime()
|
||||
}else {
|
||||
this.car.insuranceDate = undefined
|
||||
}
|
||||
if (this.car.carRegisterDate) {
|
||||
this.car.carRegisterDate = new Date(this.car.carRegisterDate).getTime()
|
||||
}else {
|
||||
this.car.carRegisterDate = undefined
|
||||
}
|
||||
if (this.car.id != null) {
|
||||
request({
|
||||
url: '/admin-api/base/carMain/update',
|
||||
@ -304,36 +326,103 @@ export default {
|
||||
url: '/admin-api/base/carMain/page',
|
||||
method: 'GET',
|
||||
params: {
|
||||
licenseNumber:this.car.licenseNumber
|
||||
licenseNumber: this.car.licenseNumber
|
||||
}
|
||||
}).then( res =>{
|
||||
}).then(res => {
|
||||
this.car = res.data.records[0]
|
||||
console.log("执行")
|
||||
request({
|
||||
url: '/admin-api/base/custom/bindCustomerCar',
|
||||
method: 'post',
|
||||
data :{
|
||||
data: {
|
||||
carList: [this.car],
|
||||
id: this.userInfo.id
|
||||
}
|
||||
}).then( res =>{
|
||||
}).then(res => {
|
||||
uni.navigateBack();
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
// 查询下拉 车辆性质
|
||||
async getNatureList() {
|
||||
this.natureList= getDictByCode('car_nature')
|
||||
if (this.bo2 == true) {
|
||||
this.car.carNature = this.natureList[0].value;
|
||||
} else {
|
||||
// 如果是修改 遍历当前集合 将index 同步
|
||||
this.natureList.forEach((item, index) => {
|
||||
if (item.value == this.car.carNature) {
|
||||
this.natureIndex = index;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// let res = await request({
|
||||
// url: '/userClient/base/myCar/create',
|
||||
// method: 'POST',
|
||||
// data: this.car,
|
||||
// })
|
||||
// if (res.code == 200) {
|
||||
// // 新增成功返回上一个页面
|
||||
// bus.$emit('updateCarInfo', res.result)
|
||||
// uni.navigateBack();
|
||||
// }
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
let fileListLen = this[`fileList${event.name}`].length
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result
|
||||
}))
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
upload({
|
||||
url: '/admin-api/infra/file/upload',
|
||||
filePath: url
|
||||
}).then(res => {
|
||||
resolve(config.baseImageUrl +res.data)
|
||||
this.car.carLicenseImg = res.data
|
||||
this.imageUrl = config.baseImageUrl + res.data
|
||||
request({
|
||||
url: '/admin-api/base/carMain/vehicleLicenseOCR',
|
||||
method: 'POST',
|
||||
data: this.imageUrl,
|
||||
tenantIdFlag: false
|
||||
}).then((res) => {
|
||||
this.car.vin = res.data.vin
|
||||
this.car.licenseNumber = res.data.plateNo
|
||||
this.car.carRegisterDate = res.data.issueDate
|
||||
this.car.engineNumber = res.data.engineNo
|
||||
//车辆品牌自动定位
|
||||
this.brandList.forEach((item, index) => {
|
||||
if (item.brandName == res.data.brand) {
|
||||
this.arrayIndex = index;
|
||||
this.brandId = this.brandList[index].id;
|
||||
}
|
||||
})
|
||||
//车辆性质自动定位
|
||||
this.natureList.forEach((item, index) => {
|
||||
if (item.label == res.data.useCharacter) {
|
||||
this.natureIndex = index;
|
||||
this.car.carNature = this.natureList[index].value;
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -32,19 +32,19 @@
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<u-form-item borderBottom label="选择所在地区" labelWidth="200" @click="areaOpen">
|
||||
<u-input
|
||||
v-model="userInfo.area"
|
||||
border="none"
|
||||
disabled
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择所在省/市/区"
|
||||
></u-input>
|
||||
<u-icon
|
||||
slot="right"
|
||||
name="arrow-right"
|
||||
></u-icon>
|
||||
</u-form-item>
|
||||
<!-- <u-form-item borderBottom label="选择所在地区" labelWidth="200" @click="areaOpen">-->
|
||||
<!-- <u-input-->
|
||||
<!-- v-model="userInfo.area"-->
|
||||
<!-- border="none"-->
|
||||
<!-- disabled-->
|
||||
<!-- disabledColor="#ffffff"-->
|
||||
<!-- placeholder="请选择所在省/市/区"-->
|
||||
<!-- ></u-input>-->
|
||||
<!-- <u-icon-->
|
||||
<!-- slot="right"-->
|
||||
<!-- name="arrow-right"-->
|
||||
<!-- ></u-icon>-->
|
||||
<!-- </u-form-item>-->
|
||||
<u-form-item label="详细地址" label-width="200">
|
||||
<u-input v-model="userInfo.address" border="none" placeholder="请输入详细地址"></u-input>
|
||||
</u-form-item>
|
||||
@ -52,20 +52,21 @@
|
||||
</u-form>
|
||||
|
||||
<!-- 车辆型号 -->
|
||||
<u-action-sheet
|
||||
:actions="typeList"
|
||||
:show="showType"
|
||||
title="请选择车辆型号"
|
||||
@close="showType = false"
|
||||
@select="typeSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
<!-- <u-action-sheet-->
|
||||
<!-- :actions="typeList"-->
|
||||
<!-- :show="showType"-->
|
||||
<!-- title="请选择车辆型号"-->
|
||||
<!-- @close="showType = false"-->
|
||||
<!-- @select="typeSelect"-->
|
||||
<!-- >-->
|
||||
<!-- </u-action-sheet>-->
|
||||
|
||||
<u-datetime-picker
|
||||
v-model="datePickerValue"
|
||||
:formatter="formatter"
|
||||
:show="datePickerShow"
|
||||
mode="date"
|
||||
:min-date="minDate"
|
||||
@cancel="datePickerCancel"
|
||||
@confirm="datePickerConfirm"
|
||||
></u-datetime-picker>
|
||||
@ -100,6 +101,7 @@ export default {
|
||||
},
|
||||
bo1: false,
|
||||
bo2: true,
|
||||
minDate: new Date(1900, 0, 1).getTime(),
|
||||
|
||||
datePickerShow: false,
|
||||
datePickerValue: new Date().getTime(),
|
||||
|
Loading…
Reference in New Issue
Block a user