Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform-ui
Commits
263a260a
Commit
263a260a
authored
Apr 18, 2019
by
164003836@qq.con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加随行物品模块
parent
76db8e1a
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
674 additions
and
39 deletions
+674
-39
index.js
src/api/base_info/branch_company/index.js
+3
-9
index.js
src/api/vehicle/accompanyingItem/index.js
+49
-0
index.js
src/api/vehicle/bookRecord/index.js
+2
-2
index.js
src/router/index.js
+8
-1
getters.js
src/store/getters.js
+4
-1
baseInfo.js
src/store/modules/baseInfo.js
+71
-3
accItemSelector.vue
src/views/vehicle/accompanyingItem/accItemSelector.vue
+123
-0
index.vue
src/views/vehicle/accompanyingItem/index.vue
+332
-0
index.vue
src/views/vehicle/bookRecord/index.vue
+34
-7
index.vue
src/views/vehicle/vehicleInfo/index.vue
+48
-16
No files found.
src/api/base_info/branch_company/index.js
View file @
263a260a
...
@@ -50,25 +50,19 @@ export function getAll() {
...
@@ -50,25 +50,19 @@ export function getAll() {
}
}
/**
/**
* 获取所有公司信息
,并缓存
* 获取所有公司信息
* @returns {null|*}
* @returns {null|*}
*/
*/
export
function
getAllCompanyCache
(
resolve
)
{
export
function
getAllCompany
(
resolve
)
{
let
codeAndBranchCompany
=
store
.
getters
.
getAllCompany
;
if
(
XEUtils
.
isEmpty
(
codeAndBranchCompany
))
{
//缓存中不存在
getAll
().
then
(
response
=>
{
getAll
().
then
(
response
=>
{
let
companyList
=
response
.
data
;
let
companyList
=
response
.
data
;
if
(
!
companyList
||
companyList
.
length
===
0
)
{
if
(
!
companyList
||
companyList
.
length
===
0
)
{
return
null
;
return
null
;
}
}
codeAndBranchCompany
=
{};
let
codeAndBranchCompany
=
{};
for
(
let
index
in
companyList
)
{
for
(
let
index
in
companyList
)
{
codeAndBranchCompany
[
companyList
[
index
].
id
]
=
companyList
[
index
];
codeAndBranchCompany
[
companyList
[
index
].
id
]
=
companyList
[
index
];
}
}
store
.
dispatch
(
"cacheCompany"
,
codeAndBranchCompany
);
resolve
(
codeAndBranchCompany
);
resolve
(
codeAndBranchCompany
);
});
});
}
else
{
resolve
(
codeAndBranchCompany
);
}
}
}
src/api/vehicle/accompanyingItem/index.js
0 → 100644
View file @
263a260a
import
fetch
from
'utils/fetch'
;
export
function
page
(
query
)
{
return
fetch
({
url
:
'/vehicle/accompanyingItem/page'
,
method
:
'get'
,
params
:
{
queryAccompanyItemVoJson
:
JSON
.
stringify
(
query
)
}
});
}
export
function
getAllAccItem
()
{
return
fetch
({
url
:
'/vehicle/accompanyingItem/all'
,
method
:
'get'
});
}
export
function
getObj
(
id
)
{
return
fetch
({
url
:
'/vehicle/accompanyingItem/'
+
id
,
method
:
'get'
});
}
export
function
addObj
(
obj
)
{
return
fetch
({
url
:
'/vehicle/accompanyingItem'
,
method
:
'post'
,
data
:
obj
});
}
export
function
putObj
(
obj
)
{
return
fetch
({
url
:
'/vehicle/accompanyingItem'
,
method
:
'put'
,
data
:
obj
})
}
export
function
delObj
(
id
)
{
return
fetch
({
url
:
'/vehicle/accompanyingItem/'
+
id
,
method
:
'delete'
})
}
src/api/vehicle/bookRecord/index.js
View file @
263a260a
...
@@ -9,9 +9,9 @@ export function page(query) {
...
@@ -9,9 +9,9 @@ export function page(query) {
});
});
}
}
export
function
getObj
(
id
)
{
export
function
getObj
(
id
,
bookEndDate
)
{
return
fetch
({
return
fetch
({
url
:
'/vehicle/vehicleInfo/bookedRecord/'
+
id
,
url
:
'/vehicle/vehicleInfo/bookedRecord/'
+
bookEndDate
+
'/'
+
id
,
method
:
'get'
method
:
'get'
});
});
}
}
...
...
src/router/index.js
View file @
263a260a
...
@@ -165,7 +165,14 @@ export const asyncRouterMap = [{
...
@@ -165,7 +165,14 @@ export const asyncRouterMap = [{
component
:
_import
(
'baseInfo/branchCompany/index'
),
component
:
_import
(
'baseInfo/branchCompany/index'
),
name
:
'分公司管理'
,
name
:
'分公司管理'
,
authority
:
'branchCompany'
authority
:
'branchCompany'
}]
},
{
path
:
'/baseInfo/accompanyingItem'
,
component
:
_import
(
'vehicle/accompanyingItem/index'
),
name
:
'随行物品管理'
,
authority
:
'accompanyingItem'
}
]
},
{
},
{
path
:
'/vehicle'
,
path
:
'/vehicle'
,
component
:
Layout
,
component
:
Layout
,
...
...
src/store/getters.js
View file @
263a260a
...
@@ -37,8 +37,11 @@ const getters = {
...
@@ -37,8 +37,11 @@ const getters = {
return
state
.
baseInfo
.
vehicleConstants
[
type
]
return
state
.
baseInfo
.
vehicleConstants
[
type
]
};
};
},
},
accompanyItemTypeAndCode
:
state
=>
state
.
baseInfo
.
accompanyItemTypeAndCode
,
vehicleStatus
:
state
=>
state
.
baseInfo
.
vehicleStatusAndCode
,
vehicleStatus
:
state
=>
state
.
baseInfo
.
vehicleStatusAndCode
,
bookRecordStatus
:
state
=>
state
.
baseInfo
.
bookRecordStatusAndCode
,
bookRecordStatus
:
state
=>
state
.
baseInfo
.
bookRecordStatusAndCode
,
getAllCompany
:
state
=>
state
.
baseInfo
.
codeAndBranchCompany
getAllCompany
:
state
=>
state
.
baseInfo
.
codeAndBranchCompany
,
allAccItem
:
state
=>
state
.
baseInfo
.
allAccItem
,
allAccItemIdAndName
:
state
=>
state
.
baseInfo
.
allAccItemIdAndName
};
};
export
default
getters
export
default
getters
src/store/modules/baseInfo.js
View file @
263a260a
...
@@ -16,11 +16,38 @@ export const BOOK_RECORD_STATUS_PROVED = 2; // 预定记录状态 - 已通过
...
@@ -16,11 +16,38 @@ export const BOOK_RECORD_STATUS_PROVED = 2; // 预定记录状态 - 已通过
export
const
BOOK_RECORD_STATUS_LIFT
=
7
;
// 预定记录状态 - 已提车
export
const
BOOK_RECORD_STATUS_LIFT
=
7
;
// 预定记录状态 - 已提车
export
const
ACCOMPANYING_ITEM_AMOUNT_INFINITY
=
-
1
;
// 随车物品余量 - 不作限制
import
XEUtils
from
'xe-utils'
;
// 加入常用工具类
import
VXEUtils
from
'vxe-utils'
;
// 加入常用工具类
import
{
getAllAccItem
}
from
'api/vehicle/accompanyingItem/'
;
const
baseInfo
=
{
const
baseInfo
=
{
state
:
{
state
:
{
regions
:
{},
regions
:
{},
regionAndCode
:
{},
regionAndCode
:
{},
vehicleConstants
:
{},
vehicleConstants
:
{},
allAccItem
:
{},
allAccItemIdAndName
:
{},
accompanyItemTypeAndCode
:
{
1
:
{
code
:
1
,
val
:
'随车工具'
},
2
:
{
code
:
2
,
val
:
'随车配备'
},
3
:
{
code
:
3
,
val
:
'可配物品'
}
},
vehicleStatusAndCode
:
{
vehicleStatusAndCode
:
{
1
:
{
1
:
{
code
:
1
,
code
:
1
,
...
@@ -80,8 +107,19 @@ const baseInfo = {
...
@@ -80,8 +107,19 @@ const baseInfo = {
REMOVE_CONSTANT_DATA
:
(
state
,
type
)
=>
{
REMOVE_CONSTANT_DATA
:
(
state
,
type
)
=>
{
state
.
vehicleConstants
[
type
]
=
null
;
state
.
vehicleConstants
[
type
]
=
null
;
},
},
CAHCE_
ALL_COMPANY
:
(
state
,
companyAndCode
)
=>
{
ALL_COMPANY
:
(
state
,
companyAndCode
)
=>
{
state
.
codeAndBranchCompany
=
companyAndCode
;
state
.
codeAndBranchCompany
=
companyAndCode
;
},
ALL_ACC_ITEM
:
(
state
,
allAccItem
)
=>
{
state
.
allAccItem
=
allAccItem
;
if
(
XEUtils
.
isEmpty
(
allAccItem
))
{
return
;
}
for
(
let
key
in
allAccItem
)
{
for
(
let
index
in
allAccItem
[
key
])
{
state
.
allAccItemIdAndName
[
allAccItem
[
key
][
index
].
id
]
=
allAccItem
[
key
][
index
].
name
;
}
}
}
}
},
},
...
@@ -110,10 +148,40 @@ const baseInfo = {
...
@@ -110,10 +148,40 @@ const baseInfo = {
},
type
)
{
},
type
)
{
commit
(
'REMOVE_CONSTANT_DATA'
,
type
);
commit
(
'REMOVE_CONSTANT_DATA'
,
type
);
},
},
cache
Company
({
all
Company
({
commit
commit
},
companyAndCode
)
{
},
companyAndCode
)
{
commit
(
'CAHCE_ALL_COMPANY'
,
companyAndCode
);
commit
(
'ALL_COMPANY'
,
companyAndCode
);
},
loadAccItem
({
getters
,
commit
},
resolve
)
{
// 从后端异步读取,返回promise
return
new
Promise
((
resolve
,
reject
)
=>
{
getAllAccItem
().
then
(
response
=>
{
let
accItemList
=
response
.
data
;
if
(
XEUtils
.
isEmpty
(
accItemList
))
{
resolve
();
return
;
}
let
allAccItem
=
{};
for
(
let
index
in
accItemList
)
{
let
arrayType
=
allAccItem
[
accItemList
[
index
].
type
];
if
(
!
XEUtils
.
isArray
(
allAccItem
[
accItemList
[
index
].
type
]))
{
arrayType
=
[];
}
arrayType
=
[...
arrayType
,
accItemList
[
index
]];
allAccItem
[
accItemList
[
index
].
type
]
=
arrayType
;
}
commit
(
'ALL_ACC_ITEM'
,
allAccItem
);
resolve
();
}).
catch
(
error
=>
{
console
.
error
(
error
);
reject
(
error
);
});
return
;
});
}
}
}
}
}
}
...
...
src/views/vehicle/accompanyingItem/accItemSelector.vue
0 → 100644
View file @
263a260a
<
template
>
<div>
<!-- 查看预定信息对话框相关html元素 -->
<el-dialog
title=
"选择随行物品"
v-loading
.
body=
"isLoadingShowed"
element-loading-text=
"加载随行物品中"
element-loading-spinner=
"el-icon-loading"
:visible
.
sync=
"dialogVisible"
>
<el-form
:model=
"selected"
:inline=
"true"
ref=
"form4Selected"
label-width=
"100px"
>
<el-collapse
v-model=
"activeTypes"
>
<el-collapse-item
v-for=
" (val, key, index) in allAccItem "
:title=
"getTypeName(key)"
:name=
"key"
>
<el-row
:gutter=
"10"
>
<el-col
v-for=
" item in val "
:span=
"8"
:style=
"
{padding: '2px'}">
<el-col
:span=
"16"
:style=
"
{textAlign: 'center'}">
<span
:style=
"
{padding: '3px 10px', fontSize: '14px' ,display: 'inline-block'}">
{{
item
.
name
}}
</span>
</el-col>
<el-col
:span=
"8"
>
<el-input
v-model=
"selected[item.id]"
clearable
placeholder=
"数量"
:disabled=
"readOnly"
></el-input>
</el-col>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
v-if=
"!readOnly"
@
click=
"cancel()"
>
取 消
</el-button>
<el-button
v-if=
"!readOnly"
@
click=
"clear()"
>
清 空
</el-button>
<el-button
v-if=
"!readOnly"
type=
"primary"
@
click=
"select()"
>
确 定
</el-button>
<el-button
v-if=
"readOnly"
@
click=
"clear()"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
mapGetters
}
from
'vuex'
;
export
default
{
name
:
'accItemSelector'
,
props
:
[
'selectedAccItem'
,
'isReadOnly'
],
data
()
{
return
{
isLoadingShowed
:
true
,
dialogVisible
:
false
,
selected
:
{},
readOnly
:
this
.
isReadOnly
}
},
created
()
{
this
.
$store
.
dispatch
(
'loadAccItem'
).
then
(()
=>
{
// 读取随行物品列表
this
.
isLoadingShowed
=
false
;
}).
catch
(()
=>
{
console
.
error
(
'读取随行物品列表失败'
);
this
.
isLoadingShowed
=
false
;
})
},
computed
:
{
...
mapGetters
([
'allAccItem'
,
'accompanyItemTypeAndCode'
,
'allAccItemIdAndName'
]),
activeTypes
:
{
get
:
function
()
{
let
keys
=
[];
for
(
let
key
in
this
.
allAccItem
)
{
keys
=
[...
keys
,
key
];
}
return
keys
;
},
set
:
function
()
{
return
;
}
}
},
methods
:
{
select
()
{
this
.
$emit
(
'select'
,
this
.
selected
);
this
.
dialogVisible
=
false
;
},
clear
()
{
this
.
selected
=
{};
this
.
$emit
(
'clear'
);
this
.
dialogVisible
=
false
;
},
show
()
{
if
(
this
.
$utils
.
isUndefined
(
this
.
selectedAccItem
))
{
this
.
selected
=
{};
}
else
{
this
.
selected
=
this
.
selectedAccItem
;
}
this
.
dialogVisible
=
true
;
this
.
readOnly
=
this
.
isReadOnly
;
},
getTypeName
:
function
(
type
)
{
if
(
this
.
$utils
.
isEmpty
(
this
.
accompanyItemTypeAndCode
[
type
]))
{
return
'未知'
;
}
return
this
.
accompanyItemTypeAndCode
[
type
].
val
;
},
getNameById
:
function
(
id
)
{
if
(
this
.
$utils
.
isEmpty
(
this
.
allAccItemIdAndName
)
||
this
.
$utils
.
isEmpty
(
this
.
allAccItemIdAndName
[
id
]))
{
return
'未知'
;
}
return
this
.
allAccItemIdAndName
[
id
];
},
cancel
()
{
this
.
dialogVisible
=
false
;
}
},
watch
:
{
selectedAccItem
:
function
()
{
if
(
this
.
$utils
.
isUndefined
(
this
.
selectedAccItem
))
{
this
.
selected
=
{};
}
else
{
this
.
selected
=
this
.
selectedAccItem
;
}
},
isReadOnly
:
function
()
{
this
.
readOnly
=
this
.
isReadOnly
;
}
}
}
</
script
>
src/views/vehicle/accompanyingItem/index.vue
0 → 100644
View file @
263a260a
This diff is collapsed.
Click to expand it.
src/views/vehicle/bookRecord/index.vue
View file @
263a260a
...
@@ -146,6 +146,13 @@
...
@@ -146,6 +146,13 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"随车物品"
width=
"120"
>
<
template
scope=
"scope"
>
<el-button
size=
"small"
type=
"success"
@
click=
"handleAccItemInfo(scope.row)"
>
查看随车物品
</el-button>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"250"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"250"
>
<
template
scope=
"scope"
>
<
template
scope=
"scope"
>
<el-button
size=
"small"
type=
"success"
@
click=
"handleBookInfo(scope.row)"
>
预订信息
</el-button>
<el-button
size=
"small"
type=
"success"
@
click=
"handleBookInfo(scope.row)"
>
预订信息
</el-button>
...
@@ -177,6 +184,7 @@
...
@@ -177,6 +184,7 @@
</div>
</div>
<book-info-viewer
ref=
"bookInfoViewer"
></book-info-viewer>
<book-info-viewer
ref=
"bookInfoViewer"
></book-info-viewer>
<acc-item-selector
:selectedAccItem=
"selectedAccItem"
:isReadOnly=
"true"
ref=
"accItemSelector"
></acc-item-selector>
<!-- 提车对话框相关html元素 -->
<!-- 提车对话框相关html元素 -->
...
@@ -241,7 +249,7 @@
...
@@ -241,7 +249,7 @@
import
{
import
{
getAllCompany
Cache
getAllCompany
}
from
'api/base_info/branch_company/'
;
}
from
'api/base_info/branch_company/'
;
import
{
import
{
...
@@ -265,15 +273,29 @@
...
@@ -265,15 +273,29 @@
}
from
'../../../store/modules/baseInfo'
;
}
from
'../../../store/modules/baseInfo'
;
import
bookInfoViewer
from
'../bookInfoViewer'
;
import
bookInfoViewer
from
'../bookInfoViewer'
;
import
accItemSelector
from
'../accompanyingItem/accItemSelector.vue'
;
export
default
{
export
default
{
name
:
'bookRecord'
,
name
:
'bookRecord'
,
components
:
{
components
:
{
bookInfoViewer
bookInfoViewer
,
accItemSelector
},
},
data
()
{
data
()
{
return
{
return
{
rules4Query
:
{},
rules4Query
:
{
selectedMonth4Query
:
[
{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
$utils
.
isUndefined
(
this
.
selectedMonth4Query
)
||
!
this
.
$utils
.
isDate
(
this
.
selectedMonth4Query
))
{
return
callback
(
new
Error
(
'请选择月份'
));
}
callback
();
},
trigger
:
'blur'
}
]
},
list
:
null
,
list
:
null
,
total
:
null
,
total
:
null
,
listLoading
:
true
,
listLoading
:
true
,
...
@@ -343,12 +365,13 @@
...
@@ -343,12 +365,13 @@
trigger
:
'blur'
trigger
:
'blur'
}
}
]
]
}
},
selectedAccItem
:
undefined
}
}
},
},
created
()
{
created
()
{
this
.
getList
();
this
.
getList
();
getAllCompany
Cache
(
codeAndBranchCompany
=>
{
//初始化公司列表
getAllCompany
(
codeAndBranchCompany
=>
{
//初始化公司列表
this
.
allCompanies
=
codeAndBranchCompany
;
this
.
allCompanies
=
codeAndBranchCompany
;
});
});
this
.
bookRecord_btn_prove
=
this
.
elements
[
'bookRecord:btn_prove'
];
this
.
bookRecord_btn_prove
=
this
.
elements
[
'bookRecord:btn_prove'
];
...
@@ -425,6 +448,10 @@
...
@@ -425,6 +448,10 @@
handleBookInfo
(
row
)
{
handleBookInfo
(
row
)
{
this
.
$refs
.
bookInfoViewer
.
handleBookInfo
(
row
.
vehicle
);
this
.
$refs
.
bookInfoViewer
.
handleBookInfo
(
row
.
vehicle
);
},
},
handleAccItemInfo
(
row
)
{
this
.
selectedAccItem
=
row
.
accItemAndAmount
;
this
.
$refs
.
accItemSelector
.
show
();
},
checkIfBooked
(
bookedDate
,
[
startDateStr
,
endDateStr
])
{
checkIfBooked
(
bookedDate
,
[
startDateStr
,
endDateStr
])
{
if
(
this
.
$utils
.
isInteger
(
bookedDate
)
&&
if
(
this
.
$utils
.
isInteger
(
bookedDate
)
&&
this
.
$utils
.
isString
(
startDateStr
)
&&
startDateStr
!==
''
&&
this
.
$utils
.
isString
(
startDateStr
)
&&
startDateStr
!==
''
&&
...
@@ -562,7 +589,7 @@
...
@@ -562,7 +589,7 @@
},
},
handleLift
(
row
)
{
handleLift
(
row
)
{
this
.
resetTemp4Lift
();
this
.
resetTemp4Lift
();
getObj
(
row
.
id
)
getObj
(
row
.
id
,
row
.
bookEndDate
)
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
!
this
.
$utils
.
isEmpty
(
response
.
data
)
&&
this
.
$utils
.
isInteger
(
response
.
data
.
liftCompany
))
{
if
(
!
this
.
$utils
.
isEmpty
(
response
.
data
)
&&
this
.
$utils
.
isInteger
(
response
.
data
.
liftCompany
))
{
this
.
form4Lift
.
liftCompany
=
response
.
data
.
liftCompany
;
this
.
form4Lift
.
liftCompany
=
response
.
data
.
liftCompany
;
...
@@ -573,7 +600,7 @@
...
@@ -573,7 +600,7 @@
},
},
handleRet
(
row
)
{
handleRet
(
row
)
{
this
.
resetTemp4Ret
();
this
.
resetTemp4Ret
();
getObj
(
row
.
id
)
getObj
(
row
.
id
,
row
.
bookEndDate
)
.
then
(
response
=>
{
.
then
(
response
=>
{
if
(
!
this
.
$utils
.
isEmpty
(
response
.
data
)
&&
this
.
$utils
.
isInteger
(
response
.
data
.
retCompany
))
{
if
(
!
this
.
$utils
.
isEmpty
(
response
.
data
)
&&
this
.
$utils
.
isInteger
(
response
.
data
.
retCompany
))
{
this
.
form4Ret
.
retCompany
=
response
.
data
.
retCompany
;
this
.
form4Ret
.
retCompany
=
response
.
data
.
retCompany
;
...
...
src/views/vehicle/vehicleInfo/index.vue
View file @
263a260a
...
@@ -476,6 +476,11 @@
...
@@ -476,6 +476,11 @@
<el-form-item
label=
"目的地"
prop=
"destination"
>
<el-form-item
label=
"目的地"
prop=
"destination"
>
<el-input
v-model=
"form4Apply.destination"
placeholder=
"请输入目的地"
></el-input>
<el-input
v-model=
"form4Apply.destination"
placeholder=
"请输入目的地"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"随行物品"
prop=
"selectedAccItem"
>
<el-input
type=
"textarea"
v-model=
"getSelectedAccItemStr"
:rows=
"5"
icon=
"menu"
@
focus=
"handleAccItemSelect"
clearable
placeholder=
"请选择随行物品"
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form4Apply.remark"
placeholder=
"请输入备注信息"
></el-input>
<el-input
v-model=
"form4Apply.remark"
placeholder=
"请输入备注信息"
></el-input>
</el-form-item>
</el-form-item>
...
@@ -489,6 +494,8 @@
...
@@ -489,6 +494,8 @@
</el-dialog>
</el-dialog>
<book-info-viewer
ref=
"bookInfoViewer"
></book-info-viewer>
<book-info-viewer
ref=
"bookInfoViewer"
></book-info-viewer>
<acc-item-selector
v-on:select=
"accItemSelected"
:selectedAccItem=
"form4Apply.selectedAccItem"
v-on:clear=
"accItemClear"
ref=
"accItemSelector"
></acc-item-selector>
</div>
</div>
</template>
</template>
...
@@ -526,7 +533,7 @@
...
@@ -526,7 +533,7 @@
}
from
'../../../store/modules/baseInfo'
;
}
from
'../../../store/modules/baseInfo'
;
import
{
import
{
getAllCompany
Cache
getAllCompany
}
from
'api/base_info/branch_company/'
;
}
from
'api/base_info/branch_company/'
;
import
{
import
{
...
@@ -545,12 +552,14 @@
...
@@ -545,12 +552,14 @@
import
{
mapGetters
}
from
'vuex'
;
import
{
mapGetters
}
from
'vuex'
;
import
bookInfoViewer
from
'../bookInfoViewer'
;
import
bookInfoViewer
from
'../bookInfoViewer'
;
import
accItemSelector
from
'../accompanyingItem/accItemSelector.vue'
;
export
default
{
export
default
{
name
:
'vehicleInfo'
,
name
:
'vehicleInfo'
,
components
:
{
components
:
{
bookInfoViewer
bookInfoViewer
,
accItemSelector
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -632,6 +641,7 @@
...
@@ -632,6 +641,7 @@
liftAddr
:
undefined
,
liftAddr
:
undefined
,
liftCompany
:
undefined
,
liftCompany
:
undefined
,
destination
:
undefined
,
destination
:
undefined
,
selectedAccItem
:
undefined
,
remark
:
undefined
remark
:
undefined
},
},
pickerOptions4Apply
:
{
pickerOptions4Apply
:
{
...
@@ -697,21 +707,23 @@
...
@@ -697,21 +707,23 @@
bookDateRange4Apply
:
[
bookDateRange4Apply
:
[
{
{
validator
:
(
rule
,
value
,
callback
)
=>
{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
$utils
.
isArray
(
this
.
bookDateRange4Apply
)
&&
this
.
bookDateRange4Apply
.
length
>
0
)
{
if
(
!
this
.
$utils
.
isArray
(
this
.
bookDateRange4Apply
)
||
this
.
bookDateRange4Apply
.
length
===
0
)
{
let
[
oriStartDate
,
ortEndDate
]
=
this
.
bookDateRange4Apply
;
if
(
!
this
.
$utils
.
isDate
(
oriStartDate
)
||
!
this
.
$utils
.
isDate
(
ortEndDate
))
{
return
callback
();
}
let
[
startDate
,
endDate
]
=
[
deepCopyDate
(
oriStartDate
),
deepCopyDate
(
ortEndDate
)];
for
(
let
curDate
=
startDate
;
curDate
<=
endDate
;
curDate
.
setDate
(
curDate
.
getDate
()
+
1
))
{
if
(
this
.
checkBookDate
(
curDate
))
{
return
callback
(
new
Error
(
'请选择从今天起两个月内,未预定的时间。'
));
}
}
callback
();
}
else
{
return
callback
(
new
Error
(
'请输入预定时间。'
));
return
callback
(
new
Error
(
'请输入预定时间。'
));
}
}
let
[
oriStartDate
,
ortEndDate
]
=
this
.
bookDateRange4Apply
;
if
(
!
this
.
$utils
.
isDate
(
oriStartDate
)
||
!
this
.
$utils
.
isDate
(
ortEndDate
))
{
return
callback
(
new
Error
(
'请输入预定时间。'
));
}
let
[
startDate
,
endDate
]
=
[
deepCopyDate
(
oriStartDate
),
deepCopyDate
(
ortEndDate
)];
if
(
!
this
.
$utils
.
isDate
(
oriStartDate
)
||
!
this
.
$utils
.
isDate
(
ortEndDate
))
{
return
callback
();
}
for
(
let
curDate
=
startDate
;
curDate
<=
endDate
;
curDate
.
setDate
(
curDate
.
getDate
()
+
1
))
{
if
(
this
.
checkBookDate
(
curDate
))
{
return
callback
(
new
Error
(
'请选择从今天起两个月内,未预定的时间。'
));
}
}
callback
();
},
},
trigger
:
'blur'
trigger
:
'blur'
}
}
...
@@ -786,7 +798,7 @@
...
@@ -786,7 +798,7 @@
},
},
created
()
{
created
()
{
this
.
getList
();
this
.
getList
();
getAllCompany
Cache
(
codeAndBranchCompany
=>
{
getAllCompany
(
codeAndBranchCompany
=>
{
this
.
allCompanies
=
codeAndBranchCompany
;
this
.
allCompanies
=
codeAndBranchCompany
;
});
});
this
.
vehicleInfo_btn_edit
=
this
.
elements
[
'vehicleInfo:btn_edit'
];
this
.
vehicleInfo_btn_edit
=
this
.
elements
[
'vehicleInfo:btn_edit'
];
...
@@ -798,6 +810,16 @@
...
@@ -798,6 +810,16 @@
'elements'
,
'elements'
,
'vehicleStatus'
'vehicleStatus'
]),
]),
getSelectedAccItemStr
()
{
if
(
!
this
.
$utils
.
isEmpty
(
this
.
form4Apply
.
selectedAccItem
))
{
let
rsStr
=
''
;
for
(
let
key
in
this
.
form4Apply
.
selectedAccItem
)
{
rsStr
=
rsStr
+
this
.
$refs
.
accItemSelector
.
getNameById
(
key
)
+
' : '
+
this
.
form4Apply
.
selectedAccItem
[
key
]
+
'
\
n'
;
}
return
rsStr
;
}
return
''
;
},
getUnkownBrandCode
:
()
=>
VEHICLE_CONSTANT_BRAND_CODE_UNKOWN
,
getUnkownBrandCode
:
()
=>
VEHICLE_CONSTANT_BRAND_CODE_UNKOWN
,
getCurBookedInfo
:
function
()
{
getCurBookedInfo
:
function
()
{
if
(
!
this
.
$utils
.
isEmpty
(
this
.
curBookedInfo3Month
)
&&
this
.
curBookedInfo3Month
.
length
>
0
)
{
if
(
!
this
.
$utils
.
isEmpty
(
this
.
curBookedInfo3Month
)
&&
this
.
curBookedInfo3Month
.
length
>
0
)
{
...
@@ -886,6 +908,15 @@
...
@@ -886,6 +908,15 @@
}
}
},
},
methods
:
{
methods
:
{
accItemSelected
(
selected
)
{
this
.
form4Apply
.
selectedAccItem
=
selected
;
},
accItemClear
()
{
this
.
form4Apply
.
selectedAccItem
=
undefined
;
},
handleAccItemSelect
()
{
this
.
$refs
.
accItemSelector
.
show
();
},
getAllInsuranceCompany
,
getAllInsuranceCompany
,
getInsuranceCompany
,
getInsuranceCompany
,
integerValidator
:
function
()
{
integerValidator
:
function
()
{
...
@@ -1158,6 +1189,7 @@
...
@@ -1158,6 +1189,7 @@
bookStartDate
:
undefined
,
bookStartDate
:
undefined
,
bookEndDate
:
undefined
,
bookEndDate
:
undefined
,
vehicle
:
undefined
,
vehicle
:
undefined
,
selectedAccItem
:
undefined
,
liftCompany
:
undefined
,
liftCompany
:
undefined
,
liftAddr
:
undefined
,
liftAddr
:
undefined
,
destination
:
undefined
,
destination
:
undefined
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment