Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f450fd0a
authored
Nov 04, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.12.0' into 'develop'
V1.12.0 See merge request
!31
2 parents
79e49fa5
d9d62a7a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
18 deletions
src/services/order.js
src/utils/http.js
src/views/work/add.vue
src/views/work/addCar.vue
src/views/work/image.vue
src/services/order.js
View file @
f450fd0
...
...
@@ -109,3 +109,7 @@ export const SAVE_RELINKVEHICLE_INFO = params => {
return
request
(
params
,
"/trialdrive/workorder/reLinkVehicle"
,
'POST'
);
}
// 工单管理-工单列表-关联车辆-校验车架号
export
const
CHECK_WORKORDER_VERIFYDUPLICATEVIM
=
params
=>
{
return
request
(
params
,
"/trialdrive/workorder/verifyDuplicateVim"
);
}
\ No newline at end of file
src/utils/http.js
View file @
f450fd0
...
...
@@ -5,7 +5,7 @@ import store from '@/store';
import
{
checkStatus
,
showLoading
}
from
'./checkStatus'
;
const
instance
=
axios
.
create
({
// 创建axios实例,在这里可以设置请求的默认配置
timeout
:
60000
,
// 设置超时时间60s
timeout
:
180000
,
// 设置超时时间3分钟
retry
:
3
,
retryDelay
:
1000
})
...
...
src/views/work/add.vue
View file @
f450fd0
...
...
@@ -91,7 +91,7 @@
<!-- 弹框 开始 -->
<glsx-dialog
:show=
"showDialog"
:title=
"current.id?'编辑车辆':'新增车辆'"
@
close=
"closeDialog()"
>
<div>
<add-car
ref=
"addCarCom"
:info=
"current"
@
change=
"onChange"
></add-car>
<add-car
ref=
"addCarCom"
:info=
"current"
:list=
"tableData"
@
change=
"onChange"
></add-car>
</div>
<
template
slot=
"footer"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"saveCar()"
>
保存
</el-button>
...
...
src/views/work/addCar.vue
View file @
f450fd0
...
...
@@ -25,16 +25,18 @@
<el-input
v-model=
"addForm.engineNo"
maxlength=
"17"
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
import
{
GET_DEVICE_COMPOSE
,
GET_VEHICLE_SELECTEDTYPETREE
,
CHECK_WORKORDER_VERIFYDUPLICATEVIM
,
}
from
"@/services/order"
;
import
{
Validator
}
from
"@/common/validator"
;
import
PlateNumberInput
from
"@/components/plateNumberInput"
;
import
{
deepClone
}
from
"@/utils/util"
;
import
{
deepClone
,
showModal
}
from
"@/utils/util"
;
export
default
{
name
:
"AddCar"
,
components
:
{
...
...
@@ -47,8 +49,31 @@ export default {
return
{};
},
},
list
:
{
type
:
Array
,
default
:
function
()
{
return
[];
},
},
},
data
()
{
var
validCarVin
=
(
rule
,
value
,
callback
)
=>
{
console
.
log
(
this
.
list
);
let
info
=
this
.
info
;
let
list
=
this
.
list
;
let
idx
=
list
.
findIndex
((
k
)
=>
k
.
vin
==
value
);
console
.
log
(
info
.
vin
+
'---------'
+
value
)
// 编辑车辆,不修改车架号,不校验
if
(
info
&&
info
.
vin
==
value
)
{
console
.
log
(
'7777777777'
)
return
callback
();
}
if
(
idx
>=
0
)
{
console
.
log
(
'66666666'
)
return
callback
(
new
Error
(
"该车架号已新增,请修改后再保存"
));
}
callback
();
};
return
{
addForm
:
{},
addFormRules
:
{
...
...
@@ -59,6 +84,7 @@ export default {
message
:
"17位英文和数字组合"
,
trigger
:
"blur"
,
},
{
validator
:
validCarVin
,
trigger
:
"blur"
},
],
deviceCompose
:
[
{
required
:
true
,
message
:
"请选择设备组合"
,
trigger
:
"change"
},
...
...
@@ -84,7 +110,7 @@ export default {
info
:
{
handler
:
function
(
n
,
o
)
{
console
.
log
(
n
);
this
.
addForm
=
n
;
this
.
addForm
=
deepClone
(
n
)
;
},
immediate
:
true
,
},
...
...
@@ -158,15 +184,21 @@ export default {
return
false
;
}
let
o
=
deepClone
(
_this
.
addForm
);
let
list
=
this
.
deviceList
;
let
n
=
list
.
find
((
k
)
=>
k
.
code
==
o
.
deviceCompose
);
if
(
!
o
.
id
)
{
o
.
id
=
new
Date
().
getTime
();
}
o
.
deviceComposeName
=
n
.
name
;
_this
.
$emit
(
"change"
,
o
);
_this
.
rest
();
// 校验车架号
CHECK_WORKORDER_VERIFYDUPLICATEVIM
({
vin
:
o
.
vin
}).
then
((
res
)
=>
{
// true:标识存在相同的车架号,false:表示不存在相同车架号的车辆
if
(
res
.
data
)
{
showModal
({
message
:
"该车架号已存在,请核对!"
,
showCancelButton
:
true
,
success
:
function
()
{
_this
.
addCarInfo
();
},
});
return
false
;
}
_this
.
addCarInfo
();
});
});
},
...
...
@@ -183,6 +215,19 @@ export default {
_this
.
$refs
.
addCarForm
.
clearValidate
();
},
100
);
},
// 添加车辆
addCarInfo
()
{
let
o
=
deepClone
(
this
.
addForm
);
let
list
=
this
.
deviceList
;
let
n
=
list
.
find
((
k
)
=>
k
.
code
==
o
.
deviceCompose
);
if
(
!
o
.
id
)
{
o
.
id
=
new
Date
().
getTime
();
}
o
.
deviceComposeName
=
n
.
name
;
this
.
$emit
(
"change"
,
o
);
this
.
rest
();
},
},
};
</
script
>
...
...
src/views/work/image.vue
View file @
f450fd0
...
...
@@ -64,9 +64,7 @@ export default {
immediate
:
true
,
},
},
mounted
()
{
},
mounted
()
{},
methods
:
{
// 监听选择图片
onChange
(
file
,
fileList
)
{
...
...
@@ -108,8 +106,8 @@ export default {
// 上传图片到服务器
uploadImage
(
params
=
{},
noSignAttr
=
[
"file"
])
{
let
_this
=
this
;
const
fileUploadURL
=
"https://didicb.glsx.com.cn"
||
localStorage
.
getItem
(
"FILE_UPLOAD_URL"
);
const
fileUploadURL
=
"https://didicb.glsx.com.cn"
||
localStorage
.
getItem
(
"FILE_UPLOAD_URL"
);
//const fileUploadURL = 'http://qcdidicb.dev.glsx.com.cn:7060' // 给java后台测试用的地址
params
.
source
=
"glsx-oss-carowner"
;
params
.
app_key
=
"48e5e13229b82c1b4e6e8c96151f0637"
;
params
.
timestamp
=
new
Date
().
getTime
();
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment