Commit 0f4e7b9b authored by 罗超's avatar 罗超

1

parent 2246aa0e
...@@ -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
...@@ -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
} }
} }
} }
......
...@@ -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,
......
...@@ -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>
......
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment