Commit 2246aa0e authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/xiangwei/horse

parents 71efaafb bfff7419
...@@ -10,7 +10,7 @@ export default defineComponent({ ...@@ -10,7 +10,7 @@ export default defineComponent({
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('./css/font.sass') @import url('./css/font.sass')
@import url('//at.alicdn.com/t/font_2930340_at4xv6vjdh.css') @import url('//at.alicdn.com/t/font_2930340_uvse4eempkh.css')
@import url('./css/table.sass') @import url('./css/table.sass')
.svg-icon-primary g [fill] .svg-icon-primary g [fill]
transition: fill 0.3s ease transition: fill 0.3s ease
......
...@@ -234,6 +234,7 @@ ...@@ -234,6 +234,7 @@
} }
let goback = () => { let goback = () => {
ctx.emit('select', selectArray.value) ctx.emit('select', selectArray.value)
show.value = false
} }
return { return {
show, show,
......
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
imageList: [] imageList: []
}) })
let customUploadImg = file => { let customUploadImg = file => {
console.log(82,file)
UploadSelfFile('/horse', file.file.file, res => { UploadSelfFile('/horse', file.file.file, res => {
msg.ImageList.push(res.FileUrl) msg.ImageList.push(res.FileUrl)
}) })
......
<template> <template>
<q-dialog v-model="show" class="col-6" persistent position="right" full-width maximized <q-dialog v-model="show" class="col-6" position="right" persistent full-width maximized @hide="hideDialog">
@hide="hideDialog">
<q-card class="full-height"> <q-card class="full-height">
<q-card-section class="row items-center q-pb-none"> <q-card-section class="row items-center q-pb-none">
<div class="text-h6"> <div class="text-h6">
...@@ -13,14 +12,31 @@ ...@@ -13,14 +12,31 @@
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<div class="row" style="width:800px ;max-width:800px"> <div class="row q-my-md" style="width:55vw ;max-width:55vw">
<div class="q-mb-sm">
<slot name="top"></slot>
</div>
<n-upload accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" multiple
:custom-request="customUploadFile" >
<n-upload-dragger>
<i class="iconfont icon-Excel" style="font-size:48px;margin-bottom: 12px"></i>
<div style="font-size: 14px;color:#000">将文件拖到此处,或 点击上传</div>
</n-upload-dragger>
</n-upload>
<div class="uplaod-tips">
请上传xls、xlsx文件
<q-btn flat color="primary" label="下载模板" /><br/>
每次最多可上传10000条数据
</div>
<div class="q-mt-sm full-width">
<slot name="bottom"></slot>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal q-pa-md">
<q-btn flat label="取消" v-close-popup /> <q-btn flat label="取消" v-close-popup />
<q-btn color="primary" unelevated label="确定" /> <q-btn color="primary" unelevated label="确定" @click="confirm"/>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
...@@ -30,7 +46,9 @@ ...@@ -30,7 +46,9 @@
ref, ref,
watch watch
} from 'vue' } from 'vue'
import {
UploadSelfFile
} from '@/utils/upload'
export default { export default {
props: { props: {
modelValue: { modelValue: {
...@@ -45,16 +63,32 @@ ...@@ -45,16 +63,32 @@
watch( watch(
() => props.modelValue, () => props.modelValue,
val => { val => {
console.log(48,val)
show.value = val show.value = val
} }
) )
let hideDialog = () => { let hideDialog = () => {
ctx.emit('update:modelValue', false) ctx.emit('update:modelValue', false)
}
let FileList = ref<any[]> ([])
let customUploadFile = file => {
UploadSelfFile('/horse', file.file.file, res => {
FileList.value.push({
FileName: res.FileName,
FileUrl: res.FileUrl,
})
})
}
const confirm=()=>{
console.log(FileList.value)
ctx.emit('confirm', FileList.value)
show.value = false
} }
return { return {
show, show,
hideDialog hideDialog,
FileList,
customUploadFile,
confirm
} }
} }
} }
...@@ -101,4 +135,13 @@ ...@@ -101,4 +135,13 @@
height: 30px; height: 30px;
} }
:deep(.n-upload-dragger) {
width: 55vw;
}
.uplaod-tips {
width: 100%;
margin-top: 10px;
font-size: 14px;
color: #333;
}
</style> </style>
...@@ -654,14 +654,6 @@ ...@@ -654,14 +654,6 @@
}) })
</script> </script>
<style lang="scss" scoped>
::v-deep .ant-cascader-picker {
border-radius: 4px;
border-color: rgb(0 0 0 / 24%);
overflow: hidden;
}
</style>
<style> <style>
/*修改滚动条样式*/ /*修改滚动条样式*/
ul::-webkit-scrollbar { ul::-webkit-scrollbar {
...@@ -671,7 +663,7 @@ ...@@ -671,7 +663,7 @@
} }
ul::-webkit-scrollbar-track { ul::-webkit-scrollbar-track {
background: rgb(239, 239, 239); background: rgb(32, 26, 26);
border-radius: 3px; border-radius: 3px;
} }
......
...@@ -83,10 +83,14 @@ const CustomerModule = () => { ...@@ -83,10 +83,14 @@ const CustomerModule = () => {
const data = reactive<dataParams>({ const data = reactive<dataParams>({
loading: false, loading: false,
isshowlabel: false,//设置标签弹窗 isshowlabel: false, //设置标签弹窗
showTransfer: false,//转移客户弹窗 showTransfer: false, //转移客户弹窗
showAbandon: false,//放弃客户弹窗 showAbandon: false, //放弃客户弹窗
showImport:false,//导入组件弹窗 showImport: false, //导入组件弹窗
showDptDialog: false, //部门弹窗
DptDialogArr: [],
DistributionRule: 1,
importTab: 1,
columns: [ columns: [
{ {
name: 'CustomerName', name: 'CustomerName',
...@@ -414,6 +418,18 @@ const CustomerModule = () => { ...@@ -414,6 +418,18 @@ const CustomerModule = () => {
}) })
}) })
} }
const getFile = (val) => {
console.log("文件",val)
}
const showdept = () => {
data.showDptDialog=true
}
//导入是获取部门arr
const getDeptDig = (arr: any) => {
//数据处理 获取id是 1-id,2-id 前面1代表部门2代表人员 后面是原生ID
console.log(425, arr)
data.DptDialogArr=arr
}
return { return {
getCustomerList, getCustomerList,
getWayList, getWayList,
...@@ -439,7 +455,10 @@ const CustomerModule = () => { ...@@ -439,7 +455,10 @@ const CustomerModule = () => {
TransferMsg, TransferMsg,
AbandonMsg, AbandonMsg,
setAbandon, setAbandon,
delCustomer delCustomer,
getFile,
getDeptDig,
showdept
} }
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<q-btn-dropdown label="导入" dense color="primary"> <q-btn-dropdown label="导入" dense color="primary">
<q-list> <q-list>
<q-item> <q-item>
<q-btn unelevated dense label="导入个人客户" @click="data.showImport=true"/> <q-btn unelevated dense label="导入个人客户" @click="data.showImport=true" />
</q-item> </q-item>
<q-item> <q-item>
<q-btn unelevated dense label="导入企业客户" /> <q-btn unelevated dense label="导入企业客户" />
...@@ -188,7 +188,48 @@ ...@@ -188,7 +188,48 @@
</q-card> </q-card>
</q-dialog> </q-dialog>
</q-page> </q-page>
<importComponents v-model="data.showImport"></importComponents> <importComponents v-model="data.showImport" @confirm="getFile">
<template #head>
<q-tabs v-model="data.importTab" dense class="text-grey" align="left" active-color="primary" indicator-color="primary"
narrow-indicator>
<q-tab :name="1" label="直接分配负责人" />
<q-tab :name="2" label="上传后再分配负责人" />
</q-tabs>
</template>
<template #top>
<div v-if="data.importTab==1">表格中需添加负责人“企微账号” </div>
<div v-if="data.importTab==2">仅限于客户库可重复模式下使用 </div>
</template>
<template #bottom>
<div class="full-width bottom-slot" v-if="data.importTab==2" >
<div class="row no-wrap">
<div class="col-1 add-dep-left">分配员工:</div>
<div class="col-11">
<q-btn outline unelevated size="14px" color="primary" label="选择" class="q-mb-sm" @click="showdept"/>
<div>
<q-chip
color="primary"
v-for="(item,index) in data.DptDialogArr"
:key="index"
text-color="white"
:icon="item.Type==1?'work':'person'"
:label="item.DeptName"
></q-chip>
</div>
</div>
</div>
<div class="row no-wrap">
<div class="col-1 add-dep-left">分配规则:</div>
<div class="col-11">
<q-radio dense v-model="data.DistributionRule" :val="1" label=" 按已选员工顺序依次轮流分配 " class="q-mt-sm"/><br/>
<q-radio dense v-model="data.DistributionRule" :val="2" label=" 按已选员工随机分配 " class="q-mt-sm"/>
</div>
</div>
</div>
</template>
</importComponents>
<departmentStaff v-model="data.showDptDialog" nodeKey="newId" labelKey="DeptName"
childrenKey="ChildList" strategy="leaf" :treeData="data.EmployeeList" @select="getDeptDig" />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -205,6 +246,7 @@ ...@@ -205,6 +246,7 @@
import visibleColumns from '@/components/common/visibleColumns.vue' import visibleColumns from '@/components/common/visibleColumns.vue'
import labelgroup from '@/components/customer/label-group.vue' import labelgroup from '@/components/customer/label-group.vue'
import importComponents from '@/components/common/import.vue' import importComponents from '@/components/common/import.vue'
import departmentStaff from '@/components/common/departmentStaff.vue'
import { import {
zhCN, zhCN,
dateZhCN dateZhCN
...@@ -215,7 +257,8 @@ ...@@ -215,7 +257,8 @@
customRight, customRight,
visibleColumns, visibleColumns,
labelgroup, labelgroup,
importComponents importComponents,
departmentStaff
}, },
setup() { setup() {
useMeta({ useMeta({
...@@ -245,7 +288,10 @@ ...@@ -245,7 +288,10 @@
TransferMsg, TransferMsg,
AbandonMsg, AbandonMsg,
setAbandon, setAbandon,
delCustomer delCustomer,
getFile,
getDeptDig,
showdept
} = CustomerModule() } = CustomerModule()
let isShowCustom = ref(false) let isShowCustom = ref(false)
const closeCustomer = () => { const closeCustomer = () => {
...@@ -291,7 +337,10 @@ ...@@ -291,7 +337,10 @@
TransferMsg, TransferMsg,
AbandonMsg, AbandonMsg,
setAbandon, setAbandon,
delCustomer delCustomer,
getFile,
getDeptDig,
showdept
} }
} }
}) })
...@@ -330,27 +379,27 @@ ...@@ -330,27 +379,27 @@
color: #9999a8; color: #9999a8;
} }
::v-deep .n-base-selection-label { :deep(.n-base-selection-label) {
height: 40px; height: 40px;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
border: none !important; border: none !important;
} }
::v-deep .n-base-selection-input { :deep(.n-base-selection-input) {
height: 40px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
border: none !important; border: none !important;
} }
::v-deep .n-input { :deep(.n-input) {
height: 100%; height: 100%;
border: none; border: none;
display: flex; display: flex;
align-items: center; align-items: center;
} }
::v-deep .n-base-selection-tags { :deep(.n-base-selection-tags) {
height: 40px; height: 40px;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
...@@ -359,5 +408,14 @@ ...@@ -359,5 +408,14 @@
background-color: #f6f6f6; background-color: #f6f6f6;
border-radius: 4px; border-radius: 4px;
} }
.bottom-slot{
border-top: 1px solid #ccc;
margin-top: 20px;
padding-top: 35px;
}
.add-dep-left{
white-space: nowrap;
min-width: 76px;
line-height: 36px;
}
</style> </style>
...@@ -28,7 +28,6 @@ export function UploadSelfFile(path, file, callback, configObj?) { ...@@ -28,7 +28,6 @@ export function UploadSelfFile(path, file, callback, configObj?) {
let uploadConfig: any = {} let uploadConfig: any = {}
if ( cacheInfo.UploadConfig ) { if ( cacheInfo.UploadConfig ) {
uploadConfig = JSON.parse(JSON.stringify(cacheInfo.UploadConfig)) uploadConfig = JSON.parse(JSON.stringify(cacheInfo.UploadConfig))
console.log('上传配置', uploadConfig)
} }
//获取文件扩展名 //获取文件扩展名
const index = file.name.lastIndexOf('.') const index = file.name.lastIndexOf('.')
...@@ -204,7 +203,6 @@ export function UploadFileToSystem(uploadConfig, fileFullPath, fileObj, uploadLo ...@@ -204,7 +203,6 @@ export function UploadFileToSystem(uploadConfig, fileFullPath, fileObj, uploadLo
tempArray.push(uploadConfig.CustomDomain + item) tempArray.push(uploadConfig.CustomDomain + item)
}) })
} }
console.log('obj', fileObj)
const uploadResult = { const uploadResult = {
Code: 1, Code: 1,
Size: (fileObj.size/1000).toFixed(2)+'KB', Size: (fileObj.size/1000).toFixed(2)+'KB',
......
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