Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
horse
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
向伟
horse
Commits
0f4e7b9b
Commit
0f4e7b9b
authored
Dec 06, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
2246aa0e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
27 deletions
+102
-27
customer.ts
src/api/customer.ts
+8
-0
import.vue
src/components/common/import.vue
+26
-10
editRuleModule.ts
src/module/editor/editRuleModule.ts
+20
-15
customer.vue
src/pages/customerManage/customer.vue
+1
-1
upload.ts
src/utils/upload.ts
+47
-1
No files found.
src/api/customer.ts
View file @
0f4e7b9b
...
@@ -153,6 +153,14 @@ class CustomerService {
...
@@ -153,6 +153,14 @@ class CustomerService {
data
data
})
})
}
}
//获取客户线索下载模板地址
static
async
getCustomerClueTemplateUrl
(
data
:
any
):
Promise
<
HttpResponse
>
{
return
Axios
(
'/QYCustomer/GetCustomerClueExportFile'
,
{
method
:
'post'
,
responseType
:
'json'
,
data
})
}
}
}
export
{
CutomerParams
}
export
{
CutomerParams
}
export
default
CustomerService
export
default
CustomerService
src/components/common/import.vue
View file @
0f4e7b9b
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
</n-upload>
</n-upload>
<div
class=
"uplaod-tips"
>
<div
class=
"uplaod-tips"
>
请上传xls、xlsx文件
请上传xls、xlsx文件
<q-btn
flat
color=
"primary"
label=
"下载模板"
/><br/>
<q-btn
flat
color=
"primary"
label=
"下载模板"
@
click=
"getTemplate"
/><br/>
每次最多可上传10000条数据
每次最多可上传10000条数据
</div>
</div>
<div
class=
"q-mt-sm full-width"
>
<div
class=
"q-mt-sm full-width"
>
...
@@ -46,9 +46,10 @@
...
@@ -46,9 +46,10 @@
ref
,
ref
,
watch
watch
}
from
'vue'
}
from
'vue'
import
{
// import {UploadSelfFile} from '@/utils/upload'
UploadSelfFile
import
{
getStoreGetter
}
from
'@/store/utils'
}
from
'@/utils/upload'
import
CustomerService
from
'@/api/customer'
import
{
UploadLocalSystem
}
from
'@/utils/upload'
export
default
{
export
default
{
props
:
{
props
:
{
modelValue
:
{
modelValue
:
{
...
@@ -71,11 +72,20 @@
...
@@ -71,11 +72,20 @@
}
}
let
FileList
=
ref
<
any
[]
>
([])
let
FileList
=
ref
<
any
[]
>
([])
let
customUploadFile
=
file
=>
{
let
customUploadFile
=
file
=>
{
UploadSelfFile
(
'/horse'
,
file
.
file
.
file
,
res
=>
{
// UploadSelfFile('/horse', file.file.file, res => {
FileList
.
value
.
push
({
// FileList.value.push({
FileName
:
res
.
FileName
,
// FileName: res.FileName,
FileUrl
:
res
.
FileUrl
,
// FileUrl: res.FileUrl,
})
// })
// })
const
LoginUserInfo
=
getStoreGetter
(
'user'
,
'getLoginUserInfo'
)
const
fileParams
=
{
Excel
:
1
,
Analysis
:
1
,
Uid
:
LoginUserInfo
.
Id
}
UploadLocalSystem
(
fileParams
,
file
.
file
.
file
,(
res
)
=>
{
console
.
log
(
88
,
res
)
})
})
}
}
const
confirm
=
()
=>
{
const
confirm
=
()
=>
{
...
@@ -83,12 +93,18 @@
...
@@ -83,12 +93,18 @@
ctx
.
emit
(
'confirm'
,
FileList
.
value
)
ctx
.
emit
(
'confirm'
,
FileList
.
value
)
show
.
value
=
false
show
.
value
=
false
}
}
const
getTemplate
=
()
=>
{
CustomerService
.
getCustomerClueTemplateUrl
({}).
then
(
res
=>
{
console
.
log
(
89
,
res
)
})
}
return
{
return
{
show
,
show
,
hideDialog
,
hideDialog
,
FileList
,
FileList
,
customUploadFile
,
customUploadFile
,
confirm
confirm
,
getTemplate
}
}
}
}
}
}
...
...
src/module/editor/editRuleModule.ts
View file @
0f4e7b9b
...
@@ -124,21 +124,26 @@ const editRuleModule = () => {
...
@@ -124,21 +124,26 @@ const editRuleModule = () => {
}
}
// 新增,修改
// 新增,修改
const
setCustomerClueRuleInfo
=
()
=>
{
const
setCustomerClueRuleInfo
=
()
=>
{
// console.log(data.editMsg.ConditionList)
// const flag = condition.value.checkRule(data.editMsg.ConditionList)
console
.
log
(
data
.
editMsg
.
ConditionList
)
// console.log(94, flag)
const
flag
=
condition
.
value
.
checkRule
(
data
.
editMsg
.
ConditionList
)
// if (!flag) return
console
.
log
(
94
,
flag
)
customerSetService
.
setCustomerClueRuleInfo
(
data
.
editMsg
).
then
(
res
=>
{
if
(
!
flag
)
return
message
.
successMsg
(
res
.
data
.
Message
)
if
(
data
.
editMsg
.
DeptList
.
length
==
0
&&
data
.
editMsg
.
EmpList
.
length
==
0
)
{
setTimeout
(()
=>
{
message
.
warnMsg
(
'适用部门/成员'
)
router
.
push
({
return
path
:
'/customerSetup'
,
}
query
:
{
// customerSetService.setCustomerClueRuleInfo(data.editMsg).then(res => {
type
:
'clue'
// message.successMsg(res.data.Message)
}
// setTimeout(() => {
})
// router.push({
},
2000
)
// path: '/customerSetup',
})
// query: {
// type: 'clue'
// }
// })
// }, 2000)
// })
}
}
return
{
return
{
msg
,
msg
,
...
...
src/pages/customerManage/customer.vue
View file @
0f4e7b9b
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</div>
</div>
</
template
>
</
template
>
</importComponents>
</importComponents>
<departmentStaff
v-model=
"data.showDptDialog"
nodeKey=
"newId"
labelKey=
"DeptName"
<departmentStaff
v-model=
"data.showDptDialog"
:defaultArray=
"[]"
nodeKey=
"newId"
labelKey=
"DeptName"
childrenKey=
"ChildList"
strategy=
"leaf"
:treeData=
"data.EmployeeList"
@
select=
"getDeptDig"
/>
childrenKey=
"ChildList"
strategy=
"leaf"
:treeData=
"data.EmployeeList"
@
select=
"getDeptDig"
/>
</div>
</div>
</template>
</template>
...
...
src/utils/upload.ts
View file @
0f4e7b9b
...
@@ -296,7 +296,7 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, uploadL
...
@@ -296,7 +296,7 @@ export function UploadFileToTencent(uploadConfig, fileFullPath, fileObj, uploadL
export
function
downloadLocalFile
(
fileName
,
filePath
)
{
export
function
downloadLocalFile
(
fileName
,
filePath
)
{
const
a
=
document
.
createElement
(
'a'
)
const
a
=
document
.
createElement
(
'a'
)
a
.
setAttribute
(
'download'
,
''
)
a
.
setAttribute
(
'download'
,
''
)
const
url
=
process
.
env
.
API
const
url
=
process
.
env
.
BASE_APP_
API
a
.
setAttribute
(
'href'
,
url
+
'/Upload/DownloadFileForPdf?fileName='
+
fileName
+
'.pdf&fPath='
+
filePath
)
a
.
setAttribute
(
'href'
,
url
+
'/Upload/DownloadFileForPdf?fileName='
+
fileName
+
'.pdf&fPath='
+
filePath
)
a
.
click
()
a
.
click
()
}
}
...
@@ -377,3 +377,49 @@ export function DownLoadFileByUrl(url, fileName) {
...
@@ -377,3 +377,49 @@ export function DownLoadFileByUrl(url, fileName) {
// UploadFileToTencent(uploadConfig, newPath, file, uploadLoadding, callback)
// UploadFileToTencent(uploadConfig, newPath, file, uploadLoadding, callback)
// }
// }
// }
// }
/**
* 上传到当前站点
*/
export
function
UploadLocalSystem
(
configObj
,
fileObj
,
successCall
)
{
const
uploadLoadding
=
Loading
uploadLoadding
.
show
({
message
:
'正在上传文件,请稍后...'
})
const
url
=
process
.
env
.
BASE_APP_API
+
'/Upload/UploadFile'
const
formData
=
new
FormData
()
if
(
configObj
)
{
formData
.
append
(
"params"
,
configObj
);
}
formData
.
append
(
'myfile'
,
fileObj
)
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onload
=
function
()
{
uploadLoadding
.
hide
();
const
jsonObj
=
JSON
.
parse
(
xhr
.
responseText
)
if
(
jsonObj
&&
jsonObj
.
StatusCode
&&
jsonObj
.
StatusCode
==
1
&&
successCall
)
{
const
uploadResult
=
{
Code
:
1
,
FileName
:
fileObj
.
name
,
FileUrl
:
process
.
env
.
BASE_APP_API
+
jsonObj
.
FilePath
,
VideoCoverImg
:
process
.
env
.
BASE_APP_API
+
jsonObj
.
VideoCoverImg
,
Data
:
jsonObj
.
Data
}
if
(
successCall
)
{
successCall
(
uploadResult
);
}
}
if
(
jsonObj
&&
jsonObj
.
Code
&&
jsonObj
.
Code
==
1
&&
successCall
)
{
const
uploadResult
=
{
Code
:
1
,
Data
:
jsonObj
.
Data
,
Message
:
jsonObj
.
Message
}
if
(
successCall
)
{
successCall
(
uploadResult
);
}
}
}
xhr
.
open
(
'post'
,
url
,
true
)
xhr
.
send
(
formData
)
}
\ No newline at end of file
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