Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
project
Project
Project
Details
Activity
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
高宇
project
Commits
a1cad095
Commit
a1cad095
authored
Apr 15, 2019
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整细节;
parent
5bc87b55
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1660 additions
and
140 deletions
+1660
-140
sales.js
src/apis/sales.js
+4
-0
buttonHeader.vue
src/components/common/buttonHeader.vue
+35
-5
clientHeader.vue
src/components/common/clientHeader.vue
+5
-1
keywordHeader.vue
src/components/common/keywordHeader.vue
+1
-1
multipleCheckGroup.vue
src/components/common/multipleCheckGroup.vue
+64
-0
sidePopup.vue
src/components/common/sidePopup.vue
+115
-0
singleSearchInput.vue
src/components/common/singleSearchInput.vue
+6
-2
singleSelect.vue
src/components/common/singleSelect.vue
+13
-2
list.vue
src/components/sales/list.vue
+62
-4
addSales.vue
src/components/sales/operation/addSales.vue
+48
-5
editSales.vue
src/components/sales/operation/editSales.vue
+48
-5
operationSales.vue
src/components/sales/operation/operationSales.vue
+246
-8
salesOfClient.vue
src/components/sales/salesOfClient/salesOfClient.vue
+240
-0
scheduleItem.vue
src/components/sales/scheduleItem.vue
+14
-10
addViewSales.vue
src/components/sales/view/addViewSales.vue
+46
-0
copyViewSales.vue
src/components/sales/view/copyViewSales.vue
+23
-0
editViewSales.vue
src/components/sales/view/editViewSales.vue
+23
-0
operationViewSales.vue
src/components/sales/view/operationViewSales.vue
+99
-0
salesDetail.vue
src/components/sales/view/salesDetail.vue
+66
-0
salesItemTable.vue
src/components/sales/view/salesItemTable.vue
+154
-0
salesView.vue
src/components/sales/view/salesView.vue
+230
-4
constant.js
src/lib/constant.js
+19
-82
operationMixins.js
src/lib/operationMixins.js
+24
-0
singleItemMixin.js
src/lib/singleItemMixin.js
+47
-2
salesOrders.js
src/routes/salesOrders.js
+18
-0
vupVueSdk.css
static/vupVueSdk.css
+7
-6
vupVueSdk.js
static/vupVueSdk.js
+3
-3
No files found.
src/apis/sales.js
View file @
a1cad095
...
...
@@ -58,5 +58,9 @@ export default {
// 获取产品类别
getSalesComponent
:
{
url
:
'/vue/sales-order/get-product-component'
},
// 搜索供应商名称
searchSupplierByName
:
{
url
:
'/vue/search/supplier-by-name'
}
}
src/components/common/buttonHeader.vue
View file @
a1cad095
<
template
>
<el-col
:span=
"12"
class=
"header-search"
>
<div
class=
"pull-right search-form"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"targetFun"
>
<i
class=
"fa fa-edit faa-pulse animated"
></i>
{{
buttonTitle
}}
<span
v-if=
"buttons.length > 0"
>
<el-button
type=
"primary"
size=
"mini"
v-for=
"(btn, key) in buttons"
:key=
"key"
@
click
.
prevent
.
stop=
"targetFun(btn.editClient)"
>
<i
:class=
"['fa', btn.icon, 'faa-pulse', 'animated']"
></i>
{{
btn
.
buttonTitle
}}
</el-button>
</span>
<el-button
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop=
"targetFun"
v-else
>
<i
:class=
"['fa', icon, 'faa-pulse', 'animated']"
></i>
{{
buttonTitle
}}
</el-button>
</div>
</el-col>
...
...
@@ -15,11 +24,32 @@
return
{}
},
methods
:
{
targetFun
()
{
targetFun
(
target
)
{
if
(
target
)
{
target
()
}
else
{
this
.
editClient
()
}
}
},
props
:
{
'editClient'
:
{
type
:
Function
},
'buttonTitle'
:
{
type
:
String
},
'buttons'
:
{
type
:
Array
,
default
()
{
return
[]
}
},
icon
:
{
type
:
String
,
default
:
'fa-edit'
}
},
props
:
[
'editClient'
,
'buttonTitle'
],
created
()
{
}
}
...
...
src/components/common/clientHeader.vue
View file @
a1cad095
...
...
@@ -12,6 +12,8 @@
:edit-client=
"editClient"
:button-title=
"buttonTitle"
:key-code=
"keyCode"
:buttons=
"buttons"
:icon=
"icon"
:model=
"model"
v-if=
"type !== ''"
></component>
</el-row>
</div>
...
...
@@ -39,7 +41,9 @@
'buttonTitle'
,
'editClient'
,
'model'
,
'keyCode'
],
'keyCode'
,
'buttons'
,
'icon'
],
created
()
{
}
}
...
...
src/components/common/keywordHeader.vue
View file @
a1cad095
...
...
@@ -8,7 +8,7 @@
</el-input>
</el-form-item>
<el-form-item
v-if=
"searchKey"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"addNewUser"
>
<el-button
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop
=
"addNewUser"
>
<i
class=
"fa fa-plus faa-pulse animated"
></i>
{{
buttonTitle
}}
</el-button>
</el-form-item>
...
...
src/components/common/multipleCheckGroup.vue
0 → 100644
View file @
a1cad095
<
template
>
<section
class=
"multiple-check-group"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"4"
:class=
"['client-label', 'text-right',
{'required': required}]">
<span>
{{
label
}}
</span>
</el-col>
<el-col
:span=
"14"
>
<span
v-for=
"(item, key) in groupOptionsList"
:key=
"key"
>
<el-card
class=
"box-card"
:body-style=
"
{ padding: '10px' }"
v-if="item.child.length > 0">
<div
slot=
"header"
class=
"clearfix"
>
<el-checkbox
:indeterminate=
"item.isIndeterminate"
v-model=
"item.checkAll"
@
change=
"(val) =>
{handleCheckGroupAll(val, item)}">
{{
item
.
name
}}
</el-checkbox>
</div>
<el-checkbox-group
v-model=
"item.checkItems"
@
change=
"(value) =>
{handleCheckGroupChange(value, item)}">
<el-checkbox
v-for=
"(check, key) in item.child"
:label=
"check.key"
:key=
"key"
>
{{
check
.
name
}}
</el-checkbox>
</el-checkbox-group>
</el-card>
</span>
</el-col>
<el-col
:span=
"6"
>
<slot
name=
"formError"
></slot>
<span
class=
"tips"
>
{{
tips
}}
</span>
</el-col>
</el-row>
</section>
</
template
>
<
script
>
import
itemMixin
from
'../../lib/singleItemMixin'
export
default
{
name
:
'multiple-check-group'
,
mixins
:
[
itemMixin
],
methods
:
{}
}
</
script
>
<
style
>
.multiple-check-group
.el-card
{
border
:
1px
solid
#5092d2
;
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;
margin-bottom
:
20px
;
line-height
:
20px
;
}
.multiple-check-group
.el-card
.el-card__header
{
padding
:
10px
;
background-color
:
#649FD7
;
}
.multiple-check-group
.el-card
.el-card__header
.el-checkbox__label
{
color
:
#ffffff
;
}
</
style
>
src/components/common/sidePopup.vue
0 → 100644
View file @
a1cad095
<
template
>
<transition
name=
"portal-move"
>
<section
v-show=
"is"
class=
"portal-content"
:style=
"
{ top: top + 'px', width: width + '%'}">
<div
class=
"content"
>
<el-row>
<el-col
:span=
"24"
>
<el-tooltip
effect=
"dark"
content=
"关闭"
placement=
"left"
>
<i
class=
"fa fa-angle-double-right"
@
click
.
prevent
.
stop=
"btnClose"
></i>
</el-tooltip>
</el-col>
<el-col
:span=
"24"
class=
"portal-content-leaveMessage"
>
<span>
{{
title
}}
</span>
</el-col>
</el-row>
<div
class=
"page-body-content"
>
<slot></slot>
</div>
</div>
</section>
</transition>
</
template
>
<
script
>
export
default
{
name
:
'sidePopup'
,
data
()
{
return
{
is
:
false
}
},
props
:
{
top
:
{
type
:
Number
,
default
:
100
},
width
:
{
type
:
Number
,
default
:
60
},
title
:
String
},
mounted
()
{
},
methods
:
{
close
(
cb
)
{
cb
&&
cb
()
this
.
is
=
false
},
show
(
cb
)
{
this
.
is
=
true
cb
&&
cb
()
this
.
$nextTick
(()
=>
{
this
.
$el
.
querySelector
(
'.portal-content .page-body-content'
).
scrollTo
(
0
,
0
)
})
},
btnClose
()
{
this
.
is
=
false
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.portal-content
{
position
:
fixed
;
right
:
0
;
bottom
:
0
;
width
:
60%
;
background-color
:
#333744
;
color
:
white
;
z-index
:
2
;
}
.portal-move-enter-active
,
.portal-move-leave-active
{
transition
:
all
0
.5s
ease
;
transform
:
trandslate3d
(
0
,
0
,
0
);
}
.portal-move-enter
,
.portal-move-leave
{
transform
:
translate3d
(
100%
,
0
,
0
);
}
.content
{
&
.content
{
width
:
100%
;
}
&
i
[
class
~=
fa-angle-double-right
]
{
cursor
:pointer
;
font-size
:
20px
;
margin-top
:
6px
;
margin-left
:
10px
;
}
}
.portal-content-leaveMessage
{
text-align
:center
;
height
:
30px
;
line-height
:
30px
;
color
:
#fff
;
font-size
:
14px
;
}
// .portal-content-body {
// margin: 0 auto;
// }
</
style
>
src/components/common/singleSearchInput.vue
View file @
a1cad095
...
...
@@ -12,6 +12,7 @@
:trigger-on-focus=
"false"
:fetch-suggestions=
"querySearchAsync"
placeholder=
"输入查找客户"
:disabled=
"singleSearchDisabled"
@
select=
"handleSelect"
></el-autocomplete>
</el-col>
...
...
@@ -73,8 +74,11 @@
}
</
script
>
<
style
scoped
>
.el-autocomplete
{
<
style
>
.
single-search-input
.
el-autocomplete
{
width
:
100%
;
}
.single-search-input
.el-autocomplete
.is-disabled
input
{
color
:
#606266
;
}
</
style
>
src/components/common/singleSelect.vue
View file @
a1cad095
...
...
@@ -5,7 +5,10 @@
<span>
{{
label
}}
</span>
</el-col>
<el-col
:span=
"14"
>
<el-select
v-model=
"item"
:placeholder=
"label"
size=
"mini"
>
<el-select
v-model=
"item"
:placeholder=
"label"
size=
"mini"
@
change=
"selectChange"
>
<template
slot=
"prefix"
v-if=
"prefix.text !== ''"
>
{{
prefix
.
text
}}
</
template
>
<el-option
v-for=
"item in optionsList"
:key=
"item.key"
...
...
@@ -27,7 +30,15 @@
export
default
{
name
:
'single-select'
,
mixins
:
[
itemMixin
],
methods
:
{}
methods
:
{
selectChange
(
key
)
{
console
.
log
(
key
)
if
(
this
.
setOption
)
{
this
.
setOption
(
key
)
}
}
},
props
:
[
'setOption'
]
}
</
script
>
...
...
src/components/sales/list.vue
View file @
a1cad095
...
...
@@ -27,14 +27,14 @@
type=
"primary"
size=
"mini"
:disabled=
"!item.can_delete"
@
click=
"del
Project
(item.id)"
>
@
click=
"del
Sales
(item.id)"
>
<i
class=
"fa fa-trash-o faa-shake"
></i>
删除
</el-button>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_update"
@
click
=
"editProject
(item)"
>
@
click
.
prevent
.
stop=
"editSales
(item)"
>
<i
class=
"fa fa-edit"
></i>
编辑
</el-button>
<el-button
class=
"pull-right"
...
...
@@ -66,6 +66,9 @@
</leave-message>
</div>
</div>
<side-popup
ref=
"sidePopup"
:title=
"operationTitle"
v-click-outside=
"popupClose"
>
<component
:is=
"operationPage"
:ref=
"operationPage"
@
close=
"getList =>
{close(getList)}">
</component>
</side-popup>
</section>
</
template
>
...
...
@@ -75,6 +78,8 @@
import
Pagenation
from
'../common/schedulePagenation'
import
clientForm
from
'./salesListForm'
import
ScheduleItem
from
'./scheduleItem'
import
addSales
from
'./operation/addSales'
import
editSales
from
'./operation/editSales'
import
{
requestAPI
,
api
...
...
@@ -86,7 +91,9 @@
clientHeader
,
clientForm
,
Pagenation
,
ScheduleItem
ScheduleItem
,
addSales
,
editSales
},
directives
:
{
clickOutside
...
...
@@ -143,15 +150,25 @@
}
},
methods
:
{
close
(
getList
)
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
if
(
getList
)
{
this
.
getList
()
}
},
leaveMessageSch
(
item
)
{
this
.
$refs
.
leaveMessage
.
btnShow
(
item
)
// console.log(this.$el.querySelector())
},
lmClose
()
{
this
.
$refs
.
leaveMessage
&&
this
.
$refs
.
leaveMessage
.
btnClose
()
},
addNewSales
()
{
popupClose
()
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
},
searchKeyword
(
search
)
{
this
.
updateForm
(
search
)
...
...
@@ -160,6 +177,47 @@
Object
.
assign
(
this
.
form
,
form
)
this
.
getList
()
},
delSales
(
id
)
{
this
.
$confirm
(
'确认删除吗?'
,
'提示'
).
then
(()
=>
{
requestAPI
(
api
.
delSales
,
{
data
:
{
id
}
}).
then
(()
=>
{
this
.
$message
(
'删除成功!'
)
this
.
getList
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
}).
catch
(
_
=>
{
})
},
addNewSales
()
{
this
.
operationPage
=
'addSales'
this
.
operationTitle
=
'新建销售记录'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
())
})
},
editSales
(
row
)
{
this
.
operationPage
=
'editSales'
this
.
operationTitle
=
'编辑销售记录'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
(
row
.
id
))
})
},
updatePage
(
pager
)
{
Object
.
assign
(
this
.
pagenation
,
pager
)
this
.
getList
()
},
getList
()
{
if
(
this
.
loading
)
{
return
...
...
src/components/sales/operation/addSales.vue
View file @
a1cad095
<
template
>
<div>
</div>
<section>
<operation-sales
ref=
"operationSales"
type=
"add"
:error-data=
"errorData"
>
<span
slot=
"operationBtn"
>
<el-button
type=
"primary"
@
click=
"saveSales"
size=
"mini"
>
保存
</el-button>
<el-button
@
click=
"close"
size=
"mini"
>
关闭
</el-button>
</span>
</operation-sales>
</section>
</
template
>
<
script
>
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationSales
from
'./operationSales'
import
{
setModule
}
from
'../../../lib/viewHelper'
export
default
{
name
:
''
,
components
:
{
operationSales
},
data
()
{
return
{}
return
{
errorData
:
{}
}
},
methods
:
{
saveSales
()
{
let
form
=
this
.
$refs
.
operationSales
.
getForm
()
let
subData
=
setModule
(
form
.
SalesOrders
,
'SalesOrders'
)
requestAPI
(
api
.
saveSalesAdd
,
{
data
:
{...
subData
}
}).
then
(
res
=>
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
})
this
.
close
(
true
)
},
error
=>
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$set
(
this
.
errorData
,
item
.
name
,
item
.
error
)
})
})
},
init
(
id
)
{
this
.
$refs
.
operationSales
.
initAdd
(
id
)
},
close
(
getList
)
{
this
.
$emit
(
'close'
,
getList
)
}
},
methods
:
{},
created
()
{
}
}
...
...
src/components/sales/operation/editSales.vue
View file @
a1cad095
<
template
>
<div>
</div>
<section>
<operation-sales
ref=
"operationSales"
type=
"edit"
:error-data=
"errorData"
>
<span
slot=
"operationBtn"
>
<el-button
type=
"primary"
@
click=
"saveSales"
size=
"mini"
>
保存
</el-button>
<el-button
@
click=
"close"
size=
"mini"
>
关闭
</el-button>
</span>
</operation-sales>
</section>
</
template
>
<
script
>
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationSales
from
'./operationSales'
import
{
setModule
}
from
'../../../lib/viewHelper'
export
default
{
name
:
''
,
components
:
{
operationSales
},
data
()
{
return
{}
return
{
errorData
:
{}
}
},
methods
:
{
saveSales
()
{
let
form
=
this
.
$refs
.
operationSales
.
getForm
()
let
subData
=
setModule
(
form
.
SalesOrders
,
'SalesOrders'
)
requestAPI
(
api
.
saveSalesEdit
,
{
data
:
{...
subData
}
}).
then
(
res
=>
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
})
this
.
close
(
true
)
},
error
=>
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$set
(
this
.
errorData
,
item
.
name
,
item
.
error
)
})
})
},
init
(
id
)
{
this
.
$refs
.
operationSales
.
initEdit
(
id
)
},
close
(
getList
)
{
this
.
$emit
(
'close'
,
getList
)
}
},
methods
:
{},
created
()
{
}
}
...
...
src/components/sales/operation/operationSales.vue
View file @
a1cad095
<
template
>
<div>
<div
class=
"sales-add-edit-form auto-template-form"
>
<el-form
ref=
"form"
:model=
"SalesOrders"
>
<el-form-item
:show-message=
"false"
:error=
"setError('client_id')"
>
<single-search-input
:form-serch-item=
"SalesOrders.client_id"
:form-show-text=
"searchText"
:set-option=
"setClientOption"
label=
"客户名称"
:single-search-disabled=
"singleSearchDisabled"
@
update:searchItem=
"val =>
{SalesOrders.client_id = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'client_id'
]
}}
</span>
</single-search-input>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('project_id')"
>
<single-select
:form-item=
"SalesOrders.project_id"
label=
"项目名称"
:options-list=
"getOptions('SalesOrders[project_id]')"
@
update:item=
"val =>
{SalesOrders.project_id = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'project_id'
]
}}
</span>
</single-select>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('sales_date')"
>
<single-date-picker
:form-time-item=
"SalesOrders.sales_date"
:required=
"true"
label=
"销售日期"
@
update:item=
"val =>
{SalesOrders.sales_date = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'project_id'
]
}}
</span>
</single-date-picker>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('description')"
>
<single-input
label=
"备注"
type=
"textarea"
:rows=
"4"
:form-item=
"SalesOrders.description"
@
update:item=
"val =>
{SalesOrders.description = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'description'
]
}}
</span>
</single-input>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('expire_date')"
>
<single-date-picker
:form-time-item=
"SalesOrders.expire_date"
label=
"服务截止日期"
@
update:item=
"val =>
{SalesOrders.expire_date = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'expire_date'
]
}}
</span>
</single-date-picker>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('expire_remind_ahead')"
>
<single-select
:form-item=
"SalesOrders.expire_remind_ahead"
:prefix=
"
{text: '提前'}"
label="提醒时间"
:options-list="getOptions('SalesOrders[expire_remind_ahead]')"
@update:item="val => {SalesOrders.expire_remind_ahead = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'project_id'
]
}}
</span>
</single-select>
</el-form-item>
<el-form-item
:show-message=
"false"
:error=
"setError('remindReceivers')"
>
<multiple-check-group
:check-group-form-item=
"SalesOrders.remindReceivers"
label=
"提醒人"
:check-group-options-list=
"getOptions('SalesOrders[remindReceivers]')"
@
update:item=
"val =>
{SalesOrders.remindReceivers = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'remindReceivers'
]
}}
</span>
</multiple-check-group>
</el-form-item>
<el-form-item>
<el-row
:gutter=
"10"
>
<el-col
:offset=
"4"
:span=
"14"
>
<slot
name=
"operationBtn"
>
</slot>
<!--
<el-button
type=
"primary"
@
click=
"test"
>
测试
</el-button>
-->
</el-col>
</el-row>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationMixins
from
'../../../lib/operationMixins'
export
default
{
name
:
''
,
mixins
:
[
operationMixins
],
data
()
{
return
{}
return
{
SalesOrders
:
{
id
:
''
,
client_id
:
''
,
project_id
:
''
,
sales_date
:
''
,
description
:
''
,
expire_date
:
''
,
expire_remind_ahead
:
''
,
remindReceivers
:
[]
},
methods
:
{},
created
()
{
singleSearchDisabled
:
false
,
options
:
{
'SalesOrders[project_id]'
:
{
value
:
[]
}
},
client
:
{},
searchText
:
''
,
pageType
:
''
,
optionsKey
:
'SalesOrders'
}
},
methods
:
{
setError
(
error
)
{
return
this
.
errorData
[
error
]
?
this
.
errorData
[
error
]
:
''
},
getOptions
(
key
)
{
let
option
=
{}
if
(
key
.
indexOf
(
'['
)
!==
-
1
&&
key
.
indexOf
(
']'
)
!==
-
1
)
{
option
=
this
.
options
[
key
]
}
else
{
option
=
this
.
options
[
this
.
optionsKey
+
'['
+
key
+
']'
]
}
if
(
option
)
{
if
(
Object
.
keys
(
option
).
length
>
0
)
{
if
(
Array
.
isArray
(
option
.
value
[
0
]))
{
return
option
.
value
[
0
]
}
return
option
.
value
}
}
return
[]
},
getForm
()
{
return
{[
this
.
optionsKey
]:
this
[
this
.
optionsKey
]}
},
setClientOption
(
id
)
{
requestAPI
(
api
.
searchProjectByClientId
,
{
data
:
{
client_id
:
id
}
}).
then
(
res
=>
{
this
.
options
[
'SalesOrders[project_id]'
].
value
=
res
})
},
initAdd
(
id
)
{
if
(
id
)
{
this
.
WorkLogs
.
client_id
=
id
requestAPI
(
api
.
getClient
,
{
data
:
{
id
:
id
}
}).
then
(
res
=>
{
this
.
searchText
=
res
.
model
.
name
})
requestAPI
(
api
.
searchContactByClientId
,
{
data
:
{
client_id
:
id
}
}).
then
(
res
=>
{
this
.
options
[
'WorkLogs[workLogContacts]'
].
value
=
res
})
requestAPI
(
api
.
searchProjectByClientId
,
{
data
:
{
client_id
:
id
}
}).
then
(
res
=>
{
this
.
options
[
'WorkLogs[project_id]'
].
value
=
res
})
}
requestAPI
(
api
.
getSalesNewOptions
).
then
(
res
=>
{
// res.options['WorkLogSearch[scenario_id]']
Object
.
keys
(
res
.
options
).
forEach
(
key
=>
{
this
.
$set
(
this
.
options
,
key
,
res
.
options
[
key
])
})
})
},
initEdit
(
id
)
{
requestAPI
(
api
.
getSalesEdit
,
{
data
:
{
id
}
}).
then
(
res
=>
{
this
.
searchText
=
res
.
model
.
client
.
name
this
.
options
[
'SalesOrders[project_id]'
].
value
=
[
res
.
model
.
project
]
Object
.
keys
(
res
.
options
).
forEach
(
key
=>
{
this
.
$set
(
this
.
options
,
key
,
res
.
options
[
key
])
})
Object
.
keys
(
this
.
SalesOrders
).
forEach
(
item
=>
{
if
(
res
.
model
[
item
])
{
this
.
SalesOrders
[
item
]
=
res
.
model
[
item
]
}
if
(
item
===
'remindReceivers'
)
{
res
.
model
.
salesOrderRemindReceivers
.
map
(
i
=>
i
.
user_id
).
forEach
(
id
=>
{
this
.
SalesOrders
.
remindReceivers
.
push
(
id
)
})
}
})
this
.
singleSearchDisabled
=
true
})
}
},
props
:
[
'errorData'
]
// watch: {
// SalesOrders: {
// handler (val) {
// console.log(val)
// },
// deep: true
// }
// }
}
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
>
.auto-template-form
{
.el-form-item
{
margin-bottom
:
15px
;
}
.client-label
{
position
:
relative
;
font-size
:
12px
;
}
.client-label
span
{
padding-right
:
10px
;
}
.client-label.required
:after
{
content
:
"*"
;
color
:
#eb7567
;
position
:
absolute
;
top
:
3px
;
right
:
6px
;
}
.el-form-item__error
{
position
:
static
;
}
}
</
style
>
src/components/sales/salesOfClient/salesOfClient.vue
0 → 100644
View file @
a1cad095
<
template
>
<section>
<div
class=
"content"
>
<client-header
ref=
"clientHeader"
:title=
"'客户名称:' + model.name"
:title-span=
"12"
type=
""
></client-header>
<div
class=
"page-body-content"
>
<client-nav
:trigger=
"addNewSales"
trigger-text=
"新建销售记录"
></client-nav>
<div
v-loading=
"loading"
>
<ScheduleItem
v-for=
"(item, key) in result.list"
:item=
"item"
:key=
"key"
@
update:image=
"imgs =>
{setImage(imgs)}">
<span
slot=
"opearate"
>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_delete"
@
click=
"delSales(item.id)"
>
<i
class=
"fa fa-trash-o faa-shake"
></i>
删除
</el-button>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
:disabled=
"!item.can_update"
@
click
.
prevent
.
stop=
"editSales(item)"
>
<i
class=
"fa fa-edit"
></i>
编辑
</el-button>
<el-button
class=
"pull-right"
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop=
"leaveMessageSch(item)"
>
<span
:class=
"['badge',
{'badge-unread': item.unread > 0}]"
v-if="item.commentCount">
{{
item
.
commentCount
.
comment
}}
</span>
<i
class=
"fa fa-commenting"
></i>
留言
</el-button>
</span>
</ScheduleItem>
<div
v-if=
"result.list.length === 0"
>
<el-card
class=
"box-card"
>
未查询到数据!
</el-card>
</div>
</div>
<Pagenation
@
update:pager=
"pager =>
{updatePage(pager)}"
:pager.sync="pagenation"
:total="totalcount">
</Pagenation>
<leave-message
v-click-outside=
"lmClose"
ref=
"leaveMessage"
:lmTemplate=
"lmTemplate"
:type=
"1"
>
</leave-message>
</div>
</div>
<side-popup
ref=
"sidePopup"
:title=
"operationTitle"
v-click-outside=
"popupClose"
>
<component
:is=
"operationPage"
:ref=
"operationPage"
@
close=
"close"
></component>
</side-popup>
</section>
</
template
>
<
script
>
import
clientHeader
from
'../../common/clientHeader'
import
clickOutside
from
'@/lib/bind'
import
Pagenation
from
'../../common/schedulePagenation'
import
ScheduleItem
from
'../scheduleItem'
import
addSales
from
'../operation/addSales'
import
editSales
from
'../operation/editSales'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
export
default
{
name
:
''
,
directives
:
{
clickOutside
},
components
:
{
clientHeader
,
Pagenation
,
ScheduleItem
,
addSales
,
editSales
},
data
()
{
return
{
model
:
{
name
:
''
},
lmTemplate
:
[
{
name
:
'客户名称'
,
value
:
'client.name'
,
default
:
''
},
{
name
:
'销售日期'
,
value
:
'sales_date'
,
default
:
''
},
{
name
:
'备注'
,
value
:
'description'
,
default
:
''
},
{
name
:
'客户经理'
,
value
:
'salesRep.name'
,
default
:
''
},
{
name
:
'录入人'
,
value
:
'createdBy.name'
,
default
:
''
},
{
name
:
'创建时间'
,
value
:
'created_at'
,
default
:
''
}
],
operationPage
:
''
,
operationTitle
:
''
,
result
:
{
list
:
[]
},
pagenation
:
{
page
:
1
},
totalcount
:
0
,
loading
:
false
}
},
methods
:
{
close
(
getList
)
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
if
(
getList
)
{
this
.
getList
()
}
},
leaveMessageSch
(
item
)
{
this
.
$refs
.
leaveMessage
.
btnShow
(
item
)
// console.log(this.$el.querySelector())
},
lmClose
()
{
this
.
$refs
.
leaveMessage
&&
this
.
$refs
.
leaveMessage
.
btnClose
()
},
popupClose
()
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
},
delSales
(
id
)
{
this
.
$confirm
(
'确认删除吗?'
,
'提示'
).
then
(()
=>
{
requestAPI
(
api
.
delSales
,
{
data
:
{
id
}
}).
then
(()
=>
{
this
.
$message
(
'删除成功!'
)
this
.
getList
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
}).
catch
(
_
=>
{
})
},
addNewSales
()
{
this
.
operationPage
=
'addSales'
this
.
operationTitle
=
'新建销售记录'
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
())
})
},
editSales
(
row
)
{
this
.
operationPage
=
'editSales'
this
.
operationTitle
=
'编辑销售记录'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
(
row
.
id
))
})
},
getList
()
{
if
(
this
.
loading
)
{
return
}
this
.
loading
=
true
requestAPI
(
api
.
getSalesClient
,
{
data
:
{
id
:
this
.
$route
.
params
.
id
}
}).
then
(
res
=>
{
this
.
result
.
list
=
res
.
list
// this.pagenation.page = res.pagenation.thispage
this
.
totalcount
=
res
.
pagenation
.
totalcount
}).
finally
(
_
=>
{
this
.
loading
=
false
})
}
},
created
()
{
requestAPI
(
api
.
getClient
,
{
data
:
{
id
:
this
.
$route
.
params
.
id
}
}).
then
(
res
=>
{
Object
.
keys
(
res
.
model
).
forEach
(
item
=>
{
this
.
$set
(
this
.
model
,
item
,
res
.
model
[
item
])
})
this
.
getList
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/sales/scheduleItem.vue
View file @
a1cad095
...
...
@@ -5,8 +5,8 @@
<el-row
:gutter=
"10"
>
<el-col
:span=
"24"
class=
"entity-name"
>
<i
class=
"fa fa-star"
aria-hidden=
"true"
></i>
<
router-link
:to
=
"toView(item)"
v-if=
"Object.keys(item.client).length > 0"
>
{{
item
.
client
.
name
}}
</
router-link
>
<
a
@
click
=
"toView(item)"
v-if=
"Object.keys(item.client).length > 0"
>
{{
item
.
client
.
name
}}
</
a
>
<span
v-else
>
客户名称
{{
noneText
}}
</span>
</el-col>
<el-col
:span=
"24"
class=
"entity-name"
>
...
...
@@ -25,7 +25,7 @@
<el-col
:span=
"6"
:xs=
"24"
class=
"show-picture"
>
销售日期:
<span
class=
"date-time"
>
<
router-link
:to=
"
{}">
{{
item
.
sales_date
!==
''
?
item
.
sales_date
:
noneText
}}
</router-link
>
<
a
@
click=
"toDetailView(item)"
v-if=
"item.sales_date !== ''"
>
{{
item
.
sales_date
!==
''
?
item
.
sales_date
:
noneText
}}
</a
>
</span>
</el-col>
<el-col
:span=
"6"
:xs=
"24"
>
...
...
@@ -80,18 +80,22 @@
}
},
toView
(
item
)
{
let
obj
=
{
app
:
'
project
'
,
this
.
$router
.
push
(
{
app
:
'
salesOrders
'
,
name
:
'ofClient'
,
params
:
{
id
:
item
.
client_id
}
}
return
obj
})
},
showImageViewer
(
images
)
{
this
.
$emit
(
'update:image'
,
images
.
map
(
i
=>
'https://beta.jinchangxiao.com'
+
i
.
attachment
.
name
))
// this.$emit('update:image', ['https://beta.jinchangxiao.com/files/protected/a57be577deb434/2019/03/34cf2b53-3959-33fe-93af-98a50fd18c11.jpg'])
toDetailView
(
item
)
{
this
.
$router
.
push
({
app
:
'salesOrders'
,
name
:
'salesOrderView'
,
params
:
{
id
:
item
.
id
}
})
}
},
computed
:
{
...
...
src/components/sales/view/addViewSales.vue
0 → 100644
View file @
a1cad095
<
template
>
<section>
<operation-view-sales
ref=
"operationViewSales"
type=
"add"
:error-data=
"errorData"
>
<span
slot=
"operationBtn"
>
<el-button
type=
"primary"
@
click=
"saveSalesItem"
size=
"mini"
>
保存
</el-button>
<el-button
@
click=
"close"
size=
"mini"
>
关闭
</el-button>
</span>
</operation-view-sales>
</section>
</
template
>
<
script
>
// import {
// requestAPI,
// api
// } from '@/lib/commonMixin'
import
operationViewSales
from
'./operationViewSales'
export
default
{
name
:
''
,
components
:
{
operationViewSales
},
data
()
{
return
{
errorData
:
{}
}
},
methods
:
{
saveSalesItem
()
{},
init
(
id
)
{
this
.
$refs
.
operationViewSales
.
initAdd
(
id
)
},
close
(
getList
)
{
this
.
$emit
(
'close'
,
getList
)
}
},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/sales/view/copyViewSales.vue
0 → 100644
View file @
a1cad095
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{
init
()
{}
},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/sales/view/editViewSales.vue
0 → 100644
View file @
a1cad095
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{
init
()
{}
},
created
()
{
}
}
</
script
>
<
style
scoped
>
</
style
>
src/components/sales/view/operationViewSales.vue
0 → 100644
View file @
a1cad095
<
template
>
<div
class=
"sales-view-operation-form auto-template-form"
>
<el-form
ref=
"form"
:model=
"SalesOrderItems"
>
<el-form-item
:show-message=
"false"
:error=
"setError('product_type')"
>
<single-select
:form-item=
"SalesOrderItems.product_type"
label=
"产品分类"
:options-list=
"getOptions('product_type')"
:set-option=
"key =>
{setAllOptions(key)}"
@update:item="val => {SalesOrderItems.product_type = val}">
<span
slot=
"formError"
class=
"el-form-item__error"
>
{{
errorData
[
'product_type'
]
}}
</span>
</single-select>
</el-form-item>
</el-form>
</div>
</
template
>
<
script
>
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
operationMixins
from
'../../../lib/operationMixins'
export
default
{
name
:
''
,
mixins
:
[
operationMixins
],
data
()
{
return
{
SalesOrderItems
:
{
pn
:
''
,
sn
:
''
,
product_id
:
''
,
product_type
:
''
,
product_component
:
''
,
product_brand
:
''
,
product_serie
:
''
,
product_misc
:
''
,
supplier_id
:
''
},
formKey
:
'SalesOrderItems'
,
options
:
{}
}
},
methods
:
{
setAllOptions
(
key
)
{
requestAPI
(
api
.
getSalesComponent
,
{
data
:
{
id
:
key
}
}).
then
(
res
=>
{
console
.
log
(
res
)
})
},
setError
(
error
)
{
return
this
.
errorData
[
error
]
?
this
.
errorData
[
error
]
:
''
},
querySearchAsync
(
queryString
,
cb
)
{
requestAPI
(
api
.
searchSupplierByName
,
{
data
:
{
name
:
queryString
}
}).
then
(
res
=>
{
cb
(
res
.
map
(
i
=>
{
return
{
value
:
i
.
name
,
key
:
i
.
key
}
}))
})
},
handleSelect
(
item
,
row
)
{
row
.
supplier_id
=
item
.
key
.
toString
()
},
saveSalesItem
(
tableForm
)
{
console
.
log
(
tableForm
)
},
getOptions
(
key
)
{
let
opt
=
this
.
options
[
this
.
formKey
+
'['
+
key
+
']'
]
if
(
opt
)
{
return
opt
.
value
}
return
[]
},
initAdd
(
id
)
{
requestAPI
(
api
.
getSalesNewItem
).
then
(
res
=>
{
console
.
log
(
res
)
Object
.
keys
(
res
.
options
).
forEach
(
item
=>
{
console
.
log
(
res
.
options
[
item
])
this
.
$set
(
this
.
options
,
item
,
res
.
options
[
item
])
})
})
}
},
props
:
[
'errorData'
]
}
</
script
>
<
style
scoped
>
</
style
>
src/components/sales/view/salesDetail.vue
0 → 100644
View file @
a1cad095
<
template
>
<section
class=
"client-user-table user-detail"
>
<el-table
:data=
"modelData"
style=
"width: 100%"
border
:row-class-name=
"tableRowClassName"
:cell-style=
"
{'font-size': '12px'}"
:header-cell-style="{'font-weight': 700,'font-size': '12px', color: '#000000'}">
<el-table-column
prop=
"title"
label=
"名称"
min-width=
"50%"
>
</el-table-column>
<el-table-column
label=
"内容"
min-width=
"50"
>
<template
slot-scope=
"scope"
>
<div
:style=
"
{color: scope.row.style ? scope.row.style.color : ''}">
<a
@
click=
"toView(scope.row)"
v-if=
"scope.row.toView"
>
{{
scope
.
row
.
value
}}
</a>
<span
v-else
>
{{
scope
.
row
.
value
}}
</span>
</div>
</
template
>
</el-table-column>
</el-table>
</section>
</template>
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{}
},
methods
:
{
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
%
2
===
0
)
{
return
'stripe-class'
}
},
toView
(
item
)
{
this
.
$router
.
push
({
app
:
item
.
app
,
name
:
item
.
name
,
params
:
{
id
:
item
.
id
}
})
}
},
props
:
[
'modelData'
]
}
</
script
>
<
style
>
.client-user-table
.el-table
td
{
padding
:
2px
0
;
}
.client-user-table
.stripe-class
{
background
:
rgba
(
0
,
0
,
0
,
.05
);
}
.user-detail
tbody
.cell
{
padding
:
5px
;
}
</
style
>
src/components/sales/view/salesItemTable.vue
0 → 100644
View file @
a1cad095
<
template
>
<section
class=
"client-user-table"
>
<el-table
:data=
"tableList"
style=
"width: 100%"
border
:row-class-name=
"tableRowClassName"
:cell-style=
"
{'font-size': '12px'}"
:header-cell-style="{'font-weight': 700,'font-size': '12px', color: '#000000'}">
<el-table-column
prop=
"product_type"
label=
"产品分类"
header-align=
"center"
min-width=
"10"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
productType
?
scope
.
row
.
productType
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"product_component"
label=
"类别"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
productComponent
?
scope
.
row
.
productComponent
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"product_brand"
label=
"品牌"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
productBrand
?
scope
.
row
.
productBrand
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"product_serie"
label=
"系列"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
productSerie
?
scope
.
row
.
productSerie
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"product_misc"
label=
"自定义"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
productMisc
?
scope
.
row
.
productMisc
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"product_id"
label=
"产品名称"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
product
?
scope
.
row
.
product
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"date"
label=
"PN"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
!==
''
?
scope
.
row
.
pn
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"date"
label=
"SN"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
sn
!==
''
?
scope
.
row
.
sn
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"date"
label=
"供应商"
header-align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
supplier
?
scope
.
row
.
supplier
.
name
:
'(未设置)'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
min-width=
"10"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
>
<i
class=
"fa fa-copy"
@
click
.
prevent
.
stop=
"copySalesItem(scope.row.id)"
></i>
</el-button>
<el-button
type=
"text"
@
click
.
prevent
.
stop=
"editSalesItem(scope.row.id)"
v-if=
"scope.row.can_update"
>
<i
class=
"fa fa-edit"
></i>
</el-button>
<el-button
type=
"text"
@
click=
"delSalesItem(scope.row.id)"
v-if=
"scope.row.can_delete"
>
<i
class=
"fa fa-trash-o faa-shake animated-hover"
></i>
</el-button>
</
template
>
</el-table-column>
</el-table>
</section>
</template>
<
script
>
// 销售记录条目表格
export
default
{
name
:
'sale-item-tabl'
,
data
()
{
return
{
}
},
methods
:
{
copySalesItem
(
id
)
{
this
.
$emit
(
'update:copyViewSales'
,
id
)
},
delSalesItem
(
id
)
{
this
.
$emit
(
'update:delViewSales'
,
id
)
},
editSalesItem
(
id
)
{
this
.
$emit
(
'update:editViewSales'
,
id
)
},
tableRowClassName
({
row
,
rowIndex
})
{
if
(
rowIndex
%
2
===
0
)
{
return
'stripe-class'
}
}
},
props
:
[
'tableList'
,
'options'
]
}
</
script
>
<
style
>
.client-user-table
.stripe-class
{
background
:
rgba
(
0
,
0
,
0
,
.05
);
}
.client-user-table
.el-button.el-button--text
{
margin-right
:
2px
;
}
.client-user-table
.el-table
td
{
padding
:
2px
0
;
}
.add-sales-item
td
{
padding
:
8px
0
!important
;
}
</
style
>
src/components/sales/view/salesView.vue
View file @
a1cad095
<
template
>
<div>
<section>
<div
class=
"content"
>
<client-header
ref=
"clientHeader"
title=
"查看销售记录"
:title-span=
"12"
:buttons=
"[
{
buttonTitle: '添加销售条目',
editClient: addSalesItem,
icon: 'fa-plus'
},{
buttonTitle: '编辑销售记录',
editClient: editSales,
icon: 'fa-edit'
}]"
type="button">
</client-header>
<div
class=
"page-body-content"
>
<sales-detail
:model-data=
"detailModel"
></sales-detail>
<sales-item-table
ref=
"salesItemTable"
:table-list=
"result.list"
:options=
"itemOptions"
@
update:delViewSales=
"id =>
{delSalesItem(id)}"
@update:editViewSales="id => {editSalesItem(id)}"
@update:copyViewSales="id => {copySalesItem(id)}">
</sales-item-table>
<Pagenation
@
update:pager=
"pager =>
{updatePage(pager)}"
:pager.sync="pagenation"
:total="totalcount">
</Pagenation>
</div>
</div>
<side-popup
ref=
"sidePopup"
:title=
"operationTitle"
v-click-outside=
"popupClose"
>
<component
:is=
"operationPage"
:ref=
"operationPage"
@
close=
"getList =>
{close(getList)}">
</component>
</side-popup>
</section>
</
template
>
<
script
>
import
clickOutside
from
'@/lib/bind'
import
clientHeader
from
'../../common/clientHeader'
import
editSales
from
'../operation/editSales'
import
salesDetail
from
'./salesDetail'
import
salesItemTable
from
'./salesItemTable'
import
Pagenation
from
'../../common/schedulePagenation'
import
addViewSales
from
'./addViewSales'
import
editViewSales
from
'./editViewSales'
import
copyViewSales
from
'./copyViewSales'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
import
{
detailKey
}
from
'../../../lib/constant'
export
default
{
name
:
''
,
components
:
{
clientHeader
,
editSales
,
salesDetail
,
salesItemTable
,
Pagenation
,
addViewSales
,
editViewSales
,
copyViewSales
},
directives
:
{
clickOutside
},
data
()
{
return
{}
return
{
salesId
:
''
,
operationPage
:
''
,
operationTitle
:
''
,
detailModel
:
[],
model
:
{
name
:
''
},
result
:
{
list
:
[]
},
options
:
[],
itemOptions
:
[],
pagenation
:
{
page
:
1
},
totalcount
:
0
,
loading
:
false
}
},
methods
:
{
addSalesItem
()
{
this
.
operationPage
=
'addViewSales'
this
.
operationTitle
=
'新建销售条目'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
())
})
},
editSalesItem
(
id
)
{
this
.
operationPage
=
'editViewSales'
this
.
operationTitle
=
'编辑销售条目'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
(
id
))
})
},
copySalesItem
(
id
)
{
this
.
operationPage
=
'copyViewSales'
this
.
operationTitle
=
'复制销售条目'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
(
id
))
})
},
delSalesItem
(
id
)
{
this
.
$confirm
(
'确认删除吗?'
,
'提示'
).
then
(()
=>
{
requestAPI
(
api
.
delSalesItem
,
{
data
:
{
id
}
}).
then
(()
=>
{
this
.
$message
(
'删除成功!'
)
this
.
getList
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
}).
catch
(
_
=>
{
})
},
close
(
getList
)
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
},
popupClose
()
{
this
.
$refs
.
sidePopup
&&
this
.
$refs
.
sidePopup
.
close
()
},
editSales
()
{
this
.
operationPage
=
'editSales'
this
.
operationTitle
=
'编辑销售记录'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this
.
$nextTick
(()
=>
{
this
.
$refs
.
sidePopup
.
show
(
this
.
$refs
[
this
.
operationPage
].
init
(
this
.
salesId
))
})
},
updateModel
()
{
detailKey
().
forEach
(
item
=>
{
let
value
=
''
let
obj
=
{
title
:
item
.
title
,
key
:
item
.
key
}
if
(
item
.
key
===
'client'
)
{
this
.
$set
(
obj
,
'toView'
,
{
app
:
'client'
,
name
:
'viewClient'
,
id
:
this
.
model
[
item
.
key
].
key
})
}
let
option
=
this
.
options
[
'SalesOrders['
+
item
.
key
+
']'
]
if
(
option
)
{
let
key
=
option
.
value
.
find
(
i
=>
this
.
model
[
item
.
key
]
===
i
.
key
)
if
(
key
)
{
value
=
key
.
name
}
}
else
if
(
Array
.
isArray
(
this
.
model
[
item
.
key
]))
{
value
=
this
.
model
[
item
.
key
].
map
(
i
=>
{
return
i
.
name
?
i
.
name
:
i
.
user
.
name
}).
join
(
' '
)
this
.
$set
(
obj
,
'value'
,
value
===
''
?
'(未设置)'
:
value
)
}
else
if
(
this
.
model
[
item
.
key
].
name
)
{
value
=
this
.
model
[
item
.
key
].
name
this
.
$set
(
obj
,
'value'
,
value
===
''
?
'(未设置)'
:
value
)
}
else
{
value
=
this
.
model
[
item
.
key
]
this
.
$set
(
obj
,
'value'
,
value
===
''
?
'(未设置)'
:
value
)
}
if
(
typeof
item
.
styleKey
!==
'undefined'
)
{
this
.
$set
(
obj
,
'style'
,
this
.
model
[
item
.
styleKey
])
}
if
(
typeof
item
.
value
!==
'undefined'
)
{
this
.
$set
(
obj
,
'value'
,
value
===
''
?
'(未设置)'
:
value
)
}
this
.
detailModel
.
push
(
obj
)
})
},
updatePage
(
pager
)
{
Object
.
assign
(
this
.
pagenation
,
pager
)
this
.
getList
()
},
getList
()
{
requestAPI
(
api
.
getSalesListItem
,
{
data
:
{
id
:
this
.
salesId
,
page
:
this
.
pagenation
.
page
}
}).
then
(
res
=>
{
this
.
result
.
list
=
res
.
list
this
.
totalcount
=
res
.
pagenation
.
totalcount
})
}
},
methods
:
{},
created
()
{
// 获取销售记录编辑信息
if
(
this
.
$route
.
params
.
id
)
{
this
.
salesId
=
this
.
$route
.
params
.
id
}
requestAPI
(
api
.
getSalesEdit
,
{
data
:
{
id
:
this
.
salesId
}
}).
then
(
res
=>
{
this
.
options
=
res
.
options
this
.
$set
(
this
.
options
,
'SalesOrders[project_id]'
,
{
value
:
[
res
.
model
.
project
]})
Object
.
keys
(
res
.
model
).
forEach
(
item
=>
{
this
.
$set
(
this
.
model
,
item
,
res
.
model
[
item
])
})
this
.
updateModel
()
},
error
=>
{
if
(
Array
.
isArray
(
error
.
msg
))
{
error
.
msg
.
forEach
(
item
=>
{
this
.
$notify
.
error
({
title
:
'错误'
,
message
:
item
.
error
})
})
}
})
requestAPI
(
api
.
getSalesNewItem
).
then
(
res
=>
{
this
.
itemOptions
=
res
.
options
})
// 获取销售记录条目信息
this
.
getList
()
}
}
</
script
>
...
...
src/lib/constant.js
View file @
a1cad095
...
...
@@ -2,115 +2,52 @@ export let detailKey = () => {
return
[
{
title
:
'客户名称'
,
key
:
'name'
,
value
:
''
},
{
title
:
'英文名称'
,
key
:
'en_name'
,
value
:
''
},
{
title
:
'客户性质'
,
key
:
'client_type'
,
value
:
''
},
{
title
:
'客户级别'
,
key
:
'client_class'
,
key
:
'client'
,
value
:
''
,
styleKey
:
'clientClass'
,
style
:
{}
toView
:
{
app
:
''
,
name
:
''
}
},
{
title
:
'
客户行业
'
,
key
:
'
client_industry
'
,
title
:
'
项目名称
'
,
key
:
'
project_id
'
,
value
:
''
},
{
title
:
'客户经理'
,
key
:
'sales_rep'
,
value
:
''
},
{
title
:
'公司性质'
,
key
:
'company_nature'
,
value
:
''
},
{
title
:
'公司网址'
,
key
:
'website'
,
value
:
''
,
link
:
''
},
{
title
:
'注册资金'
,
key
:
'capital'
,
value
:
''
},
{
title
:
'成立日期'
,
key
:
'established_at'
,
value
:
''
},
{
title
:
'法人代表'
,
key
:
'corp_rep'
,
value
:
''
},
{
title
:
'员工人数'
,
key
:
'headcount'
,
value
:
''
},
{
title
:
'办公地址'
,
key
:
'working_address'
,
key
:
'salesRep'
,
value
:
''
},
{
title
:
'
座机
'
,
key
:
'
telephon
e'
,
title
:
'
销售日期
'
,
key
:
'
sales_dat
e'
,
value
:
''
},
{
title
:
'
传真
'
,
key
:
'
fax
'
,
title
:
'
服务截止日期
'
,
key
:
'
expire_date
'
,
value
:
''
},
{
title
:
'
年营业额
'
,
key
:
'
scale
'
,
title
:
'
提醒时间
'
,
key
:
'
expire_remind_ahead
'
,
value
:
''
},
{
title
:
'分支机构'
,
key
:
'branch'
,
value
:
''
},
{
title
:
'年采购规模'
,
key
:
'purchase_scale_per_yr'
,
value
:
''
},
{
title
:
'年采购频率'
,
key
:
'purchase_freq'
,
title
:
'提醒人'
,
key
:
'salesOrderRemindReceivers'
,
value
:
''
},
{
title
:
'备注'
,
key
:
'description'
,
value
:
''
},
{
title
:
'开票信息'
,
key
:
'invoice_info'
,
value
:
''
value
:
''
,
link
:
''
},
{
title
:
'录入人'
,
key
:
'created
_b
y'
,
key
:
'created
B
y'
,
value
:
''
},
{
...
...
src/lib/operationMixins.js
0 → 100644
View file @
a1cad095
import
singleSearchInput
from
'../components/common/singleSearchInput'
import
singleInput
from
'../components/common/singleInput'
import
multipleInput
from
'../components/common/multipleInput'
import
singleCalcInput
from
'../components/common/singleCalcInput'
import
singleRadio
from
'../components/common/singleRadio'
import
singleDatePicker
from
'../components/common/singleDatePicker'
import
multipleEngineer
from
'../components/common/multipleEngineer'
import
singleCheckbox
from
'../components/common/singleCheckbox'
import
singleSelect
from
'../components/common/singleSelect'
import
multipleCheckGroup
from
'../components/common/multipleCheckGroup'
export
default
{
components
:
{
singleRadio
,
singleDatePicker
,
singleSearchInput
,
singleInput
,
multipleInput
,
singleCalcInput
,
multipleEngineer
,
singleCheckbox
,
singleSelect
,
multipleCheckGroup
}
}
src/lib/singleItemMixin.js
View file @
a1cad095
...
...
@@ -15,7 +15,8 @@ export default {
date
:
''
,
time
:
''
},
engineer
:
[]
engineer
:
[],
groupOptionsList
:
[]
}
},
props
:
{
...
...
@@ -48,12 +49,15 @@ export default {
type
:
Boolean
},
optionsList
:
Array
,
// check-group 的数据
checkGroupOptionsList
:
Array
,
tips
:
{
type
:
String
},
formInputSelect
:
{
type
:
String
},
// input 带的select option
formInputSelectOptions
:
Array
,
type
:
{
type
:
String
,
...
...
@@ -80,15 +84,35 @@ export default {
}
}
},
prefix
:
{
type
:
Object
,
default
()
{
return
{
icon
:
''
,
text
:
''
}
}
},
multipleKey
:
{
type
:
String
,
default
:
'name'
},
setPrepend
:
Function
,
setPrependText
:
''
,
engineerKey
:
''
engineerKey
:
''
,
checkGroupFormItem
:
Array
,
singleSearchDisabled
:
Boolean
},
methods
:
{
handleCheckGroupAll
(
val
,
item
)
{
item
.
checkItems
=
val
?
item
.
child
.
map
(
i
=>
i
.
key
)
:
[]
item
.
isIndeterminate
=
false
},
handleCheckGroupChange
(
value
,
item
)
{
let
checkedCount
=
value
.
length
item
.
checkAll
=
checkedCount
===
item
.
child
.
length
item
.
isIndeterminate
=
checkedCount
>
0
&&
checkedCount
<
item
.
child
.
length
},
addItem
(
items
)
{
items
.
push
({
key
:
this
.
multipleKey
,
...
...
@@ -179,6 +203,27 @@ export default {
}
},
deep
:
true
},
checkGroupOptionsList
(
val
)
{
this
.
groupOptionsList
=
[]
val
.
forEach
(
item
=>
{
let
checkItems
=
item
.
child
.
map
(
i
=>
i
.
key
).
filter
(
i
=>
this
.
checkGroupFormItem
.
some
(
ele
=>
ele
===
i
))
this
.
$set
(
item
,
'isIndeterminate'
,
checkItems
.
length
>
0
&&
checkItems
.
length
<
item
.
child
.
length
)
this
.
$set
(
item
,
'checkAll'
,
checkItems
.
length
>
0
&&
checkItems
.
length
===
item
.
child
.
length
)
this
.
$set
(
item
,
'checkItems'
,
checkItems
)
this
.
groupOptionsList
.
push
(
item
)
})
},
groupOptionsList
:
{
handler
(
val
)
{
let
conArray
=
[]
val
.
forEach
(
item
=>
{
conArray
=
conArray
.
concat
(
item
.
checkItems
)
})
this
.
$emit
(
'update:item'
,
Array
.
from
(
new
Set
(
conArray
)))
},
deep
:
true
}
}
}
src/routes/salesOrders.js
View file @
a1cad095
import
salesList
from
'../components/sales/list'
import
salesOfClient
from
'../components/sales/salesOfClient/salesOfClient'
import
salesView
from
'../components/sales/view/salesView'
const
projectTitle
=
'金畅逍BMS - '
const
routes
=
[
{
...
...
@@ -8,6 +10,22 @@ const routes = [
meta
:
{
title
:
projectTitle
+
'销售记录'
}
},
{
path
:
'/ofClient/:id'
,
name
:
'ofClient'
,
component
:
salesOfClient
,
meta
:
{
title
:
projectTitle
+
'销售记录'
}
},
{
path
:
'/salesView/:id'
,
name
:
'salesOrderView'
,
component
:
salesView
,
meta
:
{
title
:
projectTitle
+
'查看销售记录'
}
}
]
export
default
routes
static/vupVueSdk.css
View file @
a1cad095
...
...
@@ -13044,7 +13044,7 @@ html.iframe {
body
{
padding-bottom
:
0
;
min-height
:
100%
;
font-size
:
1
2px
;
font-size
:
1
rem
;
background-color
:
#F1F2F7
;
}
body
:before
{
...
...
@@ -13099,7 +13099,8 @@ input[type=file] {
border-left-style
:
solid
;
border-left-color
:
#333744
;
font-weight
:
400
;
font-size
:
1.5em
;
font-size
:
18.25px
;
line-height
:
26px
;
}
.header-search
{
min-height
:
40px
;
...
...
@@ -13111,9 +13112,8 @@ input[type=file] {
padding
:
15px
15px
0
;
}
.el-form--label-top
.el-form-item__label
{
font-size
:
.875rem
;
line-height
:
14px
!important
;
font-weight
:
normal
;
line-height
:
1.5
!important
;
font-weight
:
400
;
}
.el-form--label-top
.el-form-item__label
{
padding
:
0
!important
;
...
...
@@ -13174,7 +13174,8 @@ input[type=file] {
.form-content
.el-col
{
padding
:
0
15px
;
}
.form-content
.el-col
.el-select
{
.form-content
.el-col
.el-select
,
.form-content
.el-col
.el-cascader
{
width
:
100%
;
}
/*--------Page Components--------*/
...
...
static/vupVueSdk.js
View file @
a1cad095
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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