Commit 3e995e0d authored by 罗超's avatar 罗超

1

parent fd2cea4a
......@@ -14,10 +14,9 @@
"@types/lockr": "^0.8.7",
"@types/lodash": "^4.14.175",
"@types/webpack-env": "^1.16.2",
"ant-design-vue": "^2.2.8",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"element-plus": "^1.2.0-beta.3",
"dayjs": "^1.10.7",
"katex": "^0.13.18",
"lockr": "^0.9.0-beta.0",
"lodash": "^4.17.21",
......
......@@ -29,7 +29,7 @@ module.exports = configure(function (ctx) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'dict', 'permission', 'globalcmp', 'antDesign','naiveUI'],
boot: ['i18n', 'axios', 'dict', 'permission', 'globalcmp','naiveUI'],
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
css: ['app.scss','svg.scss'],
......
......@@ -10,6 +10,6 @@ export default defineComponent({
</script>
<style lang="sass">
@import url('./css/font.sass')
@import url('//at.alicdn.com/t/font_2930340_5n2w0eo4056.css')
@import url('//at.alicdn.com/t/font_2930340_at4xv6vjdh.css')
@import url('./css/table.sass')
</style>
import { boot } from 'quasar/wrappers'
import Antd from 'ant-design-vue'
// import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'ant-design-vue/dist/antd.css'
export default boot(({ app }) => {
// Set Antd instance on app
app.use(Antd)
// app.use(ElementPlus)
})
import { boot } from 'quasar/wrappers'
import naive from 'naive-ui'
export default boot(({ app }) => {
// Set naive instance on app
app.use(naive)
......
......@@ -8,16 +8,16 @@
<q-input v-model="msg.Remark" maxlength="1000" type="textarea" placeholder="请填写跟进记录" />
<div class="file_box">
<div class="img_list">
<div v-for="(e,i) in msg.ImageList" :key="i" class="img_box">
<div v-for="(e, i) in msg.ImageList" :key="i" class="img_box">
<img :src="e" class="img" />
<q-icon name="cancel" color="primary" class="del_icon" @click="delImg(i)"/>
<q-icon name="cancel" color="primary" class="del_icon" @click="delImg(i)" />
</div>
</div>
<div class="file_list">
<div v-for="(e,i) in msg.FileList" :key="i" class="flex items-center file_box">
<div v-for="(e, i) in msg.FileList" :key="i" class="flex items-center file_box">
<div class="flex items-center">
附件:
<span style="color:#333">{{ e.FileName }}</span>
<span style="color: #333">{{ e.FileName }}</span>
({{ e.size }})
</div>
<div class="del_btn" @click="delFile(i)">删除</div>
......@@ -25,40 +25,23 @@
</div>
</div>
<div class="file_Space">
<div style="display:flex;align-items:center;">
<div style="display: flex; align-items: center">
<div>
<a-upload
accept="image/*"
v-model:file-list="data.imageList"
name="file"
:multiple="true"
:show-upload-list="false"
:customRequest="customUploadImg"
>
<i style="font-size:25px;cursor:pointer;" class="iconfont icon-picture"></i>
</a-upload>
<n-upload accept="image/*" multiple :show-file-list="false" v-model:file-list="data.imageList"
:custom-request="customUploadImg">
<i style="font-size: 25px; cursor: pointer" class="iconfont icon-picture"></i>
</n-upload>
</div>
<div style="margin-left:8px;">
<a-upload
v-model:file-list="data.fileList"
name="file"
:multiple="true"
:show-upload-list="false"
:customRequest="customUploadFile"
>
<i style="font-size:20px;cursor:pointer;" class="iconfont icon-paperclip"></i>
</a-upload>
<div style="margin-left: 8px">
<n-upload accept="image/*" multiple :show-file-list="false" v-model:file-list="data.fileList"
:custom-request="customUploadFile">
<i style="font-size: 20px; cursor: pointer" class="iconfont icon-paperclip"></i>
</n-upload>
</div>
</div>
<div>
<q-btn
color="myInput"
text-color="#000"
size="sm"
@click="data.isShowEdit = false"
label="取消"
/>
<q-btn color="primary" style="margin-left:10px;" size="sm" @click="save" label="确定" />
<q-btn color="myInput" text-color="#000" size="sm" @click="data.isShowEdit = false" label="取消" />
<q-btn color="primary" style="margin-left: 10px" size="sm" @click="save" label="确定" />
</div>
</div>
</div>
......@@ -66,52 +49,59 @@
</div>
</template>
<script lang="ts">
import {
import {
reactive,
inject
} from 'vue'
import customer2 from '@/api/customer2'
import massage from "@/utils/message"
import { UploadSelfFile } from '@/utils/upload'
interface dataParam {
} from 'vue'
import customer2 from '@/api/customer2'
import massage from '@/utils/message'
import {
UploadSelfFile
} from '@/utils/upload'
interface dataParam {
[key: string]: any
}
export default {
setup(props,ctx) {
let msg = reactive<dataParam>({
}
export default {
setup(props, ctx) {
let msg = reactive < dataParam > ({
CustomerId: inject('CustomerId'),
Remark: "",
Remark: '',
ImageList: [],
FileList: []
})
const data = reactive<dataParam>({
const data = reactive < dataParam > ({
isShowEdit: false,
fileList: [],
imageList: []
})
let customUploadImg = (file) => {
UploadSelfFile('/horse', file.file, (res) => {
msg.ImageList.push(res.FileUrl )
let customUploadImg = file => {
console.log(82,file)
UploadSelfFile('/horse', file.file.file, res => {
msg.ImageList.push(res.FileUrl)
})
}
let customUploadFile = (file) => {
UploadSelfFile('/horse', file.file, (res) => {
msg.FileList.push({ FileName: res.FileName, FileUrl: res.FileUrl, size: res.Size })
let customUploadFile = file => {
UploadSelfFile('/horse', file.file.file, res => {
msg.FileList.push({
FileName: res.FileName,
FileUrl: res.FileUrl,
size: res.Size
})
})
}
const delImg=(i)=>{
msg.ImageList.splice(i,1)
const delImg = i => {
msg.ImageList.splice(i, 1)
}
const delFile=(i)=>{
msg.FileList.splice(i,1)
const delFile = i => {
msg.FileList.splice(i, 1)
}
const save = () => {
customer2.setCustomerTripFollowUpInfo(msg).then((res)=>{
customer2.setCustomerTripFollowUpInfo(msg).then(res => {
massage.successMsg(res.data.Message)
msg.Remark=""
msg.ImageList=[]
msg.FileList=[]
ctx.emit("success")
msg.Remark = ''
msg.ImageList = []
msg.FileList = []
ctx.emit('success')
})
}
......@@ -126,34 +116,39 @@ export default {
save
}
}
}
}
</script>
<style lang="scss" scoped>
.editer_input {
.editer_input {
padding: 5px 0;
}
}
.myInput {
.myInput {
background-color: #f6f6f6 !important;
}
.file_box {
}
.file_box {
margin-top: 5px;
.img_list {
display: flex;
flex-wrap: wrap;
.img_box {
width: 40px;
height: 40px;
margin: 10px;
position: relative;
.img {
width: 100%;
height: 100%;
overflow: hidden;
object-fit: cover;
}
.del_icon {
font-size: 18px;
position: absolute;
......@@ -163,10 +158,12 @@ export default {
}
}
}
.file_list {
.file_box {
font-size: 14px;
color: #9696a6;
.del_btn {
margin-left: 10px;
padding-left: 5px;
......@@ -176,19 +173,21 @@ export default {
}
}
}
}
.file_Space {
}
.file_Space {
display: flex;
justify-content: space-between;
margin-top: 10px;
align-items: center;
}
}
.q-field__control {
.q-field__control {
background-color: #f6f6f6 !important;
}
}
.q-field--filled .q-field__control:hover:before {
.q-field--filled .q-field__control:hover:before {
opacity: 0;
}
}
</style>
<style>
.my-special-class {
.my-special-class {
width: 200px;
margin-right: 6px;
}
}
.input_label {
.input_label {
width: 200px;
height: 40px;
border-radius: 4px;
......@@ -15,32 +15,32 @@
align-items: center;
justify-content: space-between;
cursor: pointer;
}
}
.right_select {
.right_select {
width: 40px;
position: absolute;
left: 0;
top: 20px;
}
}
.border_top {
.border_top {
border: 1px solid #d7d7d7;
width: 29px;
border-bottom: none;
border-right: none;
margin-left: 12px;
}
}
.border-bottom {
.border-bottom {
border: 1px solid #d7d7d7;
width: 29px;
border-top: none;
border-right: none;
margin-left: 12px;
}
}
.right_select .border_mid div {
.right_select .border_mid div {
width: 23px;
height: 23px;
text-align: center;
......@@ -49,146 +49,72 @@
font-size: 12px;
cursor: pointer;
background: #d8d8d8;
}
}
.right_select .border_mid .checked {
.right_select .border_mid .checked {
background: #333 !important;
color: #fff !important;
}
}
.tag-select-input {
.tag-select-input {
padding: 4px 10px;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 14px;
}
}
</style>
<template>
<div class="requestgroup">
<div :style="{ 'position': 'relative', 'padding-left': addMsg.length > 1 ? '40px' : '0' }">
<div class="row" v-for="(x,y) in addMsg" :key="y" style="margin-bottom: 8px">
<div :style="{ position: 'relative', 'padding-left': addMsg.length > 1 ? '40px' : '0' }">
<div class="row" v-for="(x, y) in addMsg" :key="y" style="margin-bottom: 8px">
<!-- name -->
<q-select
outlined
v-model="x.Id"
:options="filedList"
dense
class="my-special-class"
label="请选择客户信息"
option-value="Id"
option-label="Name"
option-disable="disable"
emit-value
map-options
@update:model-value="changeName($event, y)"
/>
<q-select outlined v-model="x.Id" :options="filedList" dense class="my-special-class" label="请选择客户信息"
option-value="Id" option-label="Name" option-disable="disable" emit-value map-options
@update:model-value="changeName($event, y)" />
<!-- Direction -->
<q-select
v-if="x.Type === 1 || x.Type === 2 || x.Type === 5 || x.Type == ''"
outlined
v-model="x.Direction"
:options="x.directionList"
dense
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
<q-select v-if="x.Type === 1 || x.Type === 2 || x.Type === 5 || x.Type == ''" outlined v-model="x.Direction"
:options="x.directionList" dense label="请选择" class="my-special-class" option-value="Id" option-label="Name"
emit-value map-options />
<div class="cascader" v-if="x.Type == 3">
<a-cascader
v-model:value="birthday"
:options="dateOptions"
placeholder="请选择"
expandTrigger="hover"
size="large"
@change="changeDate($event, y)"
/>
<n-cascader v-model:value="birthday" clearable placeholder="请选择" check-strategy="child" multiple
style="width:200px" size="large" max-tag-count="responsive" :options="dateOptions" expand-trigger="hover"
@update:value="changeDate($event, y)" />
</div>
<div v-if="x.Type == 4">
<a-range-picker
style="width:auto"
v-model:value="x.rangeArr"
size="large"
:locale="locale"
format="YYYY/MM/DD HH:mm:ss"
showTime
@change="changeRange($event, y)"
/>
<n-config-provider :locale="zhCN" :date-locale="dateZhCN">
<n-date-picker v-model:value="x.rangeArr" type="datetimerange" size="large" separator="至"
clearable @update:value="changeRange($event,y)"/>
</n-config-provider>
</div>
<!-- StartValue -->
<div
v-if="x.Name == '标签' && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
class="input_label"
@click="showlabel(x, y)"
>
<div style="display: flex;" v-if="lableList && lableList.length > 0">
<div v-if="x.Name == '标签' && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
class="input_label" @click="showlabel(x, y)">
<div style="display: flex" v-if="lableList && lableList.length > 0">
<div class="text-clamp-1 tag-select-input">{{ lableList[0].Name }}</div>
<div
v-if="lableList.length > 1"
class="tag-select-input"
style="margin-left: 5px;"
>{{ lableList.length - 1 }}+</div>
<div v-if="lableList.length > 1" class="tag-select-input" style="margin-left: 5px">
{{ lableList.length - 1 }}+</div>
</div>
</div>
<div
v-if="(x.Type === 1 || x.Type === 2 || x.Type === 5 || x.Type == '') && x.Name !== '标签'"
>
<div v-if="(x.Type === 1 || x.Type === 2 || x.Type === 5 || x.Type == '') && x.Name !== '标签'">
<div v-if="x.labelType == 3">
<q-select
v-if="x.Direction == 1 || x.Direction == 2 || x.Direction == ''"
outlined
v-model="x.StartValue"
:options="x.OptionsList"
dense
:multiple="x.labelType == 4"
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
<q-select v-if="x.Direction == 1 || x.Direction == 2 || x.Direction == ''" outlined v-model="x.StartValue"
:options="x.OptionsList" dense :multiple="x.labelType == 4" label="请选择" class="my-special-class"
option-value="Id" option-label="Name" emit-value map-options />
</div>
<div v-else-if="x.labelType == 4">
<q-select
v-if="x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == ''"
outlined
v-model="x.StartValue"
:options="x.OptionsList"
dense
:multiple="true"
label="请选择"
class="my-special-class"
option-value="Id"
option-label="Name"
emit-value
map-options
/>
<q-select v-if="x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == ''" outlined
v-model="x.StartValue" :options="x.OptionsList" dense :multiple="true" label="请选择"
class="my-special-class" option-value="Id" option-label="Name" emit-value map-options />
</div>
<div v-else-if="x.labelType == 1 || x.labelType == 2 || x.labelType == 7">
<q-input
v-if="x.Type == 1 && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
<q-input
v-if="x.Type == 2 && (x.Direction == 1 || x.Direction == 2 || x.Direction == '')"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
<q-input
v-if="x.Type == 5 || x.Type == ''"
outlined
v-model="x.StartValue"
label="请输入"
dense
/>
outlined v-model="x.StartValue" label="请输入" dense />
<q-input v-if="x.Type == 2 && (x.Direction == 1 || x.Direction == 2 || x.Direction == '')" outlined
v-model="x.StartValue" label="请输入" dense />
<q-input v-if="x.Type == 5 || x.Type == ''" outlined v-model="x.StartValue" label="请输入" dense />
</div>
<div v-else>
<q-input outlined label="请输入" dense />
......@@ -196,86 +122,64 @@
</div>
<!-- 新增和删除 -->
<div style="display: flex;align-items: center;">
<img
src="../../assets/images/customer/delete.png"
v-if="addMsg.length > 1"
style="width: 20px;height: 20px;margin-left: 10px;"
@click="deleteadd(y)"
/>
<img
src="../../assets/images/customer/add.png"
v-if="addMsg.length == y + 1 && addMsg.length < 10"
style="width: 20px;height: 20px;margin-left: 10px;"
@click="addsList()"
/>
<div style="display: flex; align-items: center">
<img src="../../assets/images/customer/delete.png" v-if="addMsg.length > 1"
style="width: 20px; height: 20px; margin-left: 10px" @click="deleteadd(y)" />
<img src="../../assets/images/customer/add.png" v-if="addMsg.length == y + 1 && addMsg.length < 10"
style="width: 20px; height: 20px; margin-left: 10px" @click="addsList()" />
</div>
</div>
<div class="right_select" v-if="addMsg.length > 1">
<div
class="border_top"
:style="{ height: ((addMsg.length * 48 - 8 - 46 - 40) / 2) + 'px' }"
></div>
<div class="border_top" :style="{ height: (addMsg.length * 48 - 8 - 46 - 40) / 2 + 'px' }"></div>
<div class="border_mid">
<div
class="and"
:class="{ 'checked': addCondition == 1 }"
@click="changeAddCondition(1)"
>且</div>
<div
class="no"
:class="{ 'checked': addCondition == 2 }"
@click="changeAddCondition(2)"
>或</div>
<div class="and" :class="{ checked: addCondition == 1 }" @click="changeAddCondition(1)">且</div>
<div class="no" :class="{ checked: addCondition == 2 }" @click="changeAddCondition(2)">或</div>
</div>
<div
class="border-bottom"
:style="{ height: ((addMsg.length * 48 - 8 - 46 - 40) / 2) + 'px' }"
></div>
<div class="border-bottom" :style="{ height: (addMsg.length * 48 - 8 - 46 - 40) / 2 + 'px' }"></div>
</div>
</div>
<labelgroup
v-if="isshowlabel"
:list="lableList"
@close="isshowlabel = false"
@submit="getlabel"
></labelgroup>
<labelgroup v-if="isshowlabel" :list="lableList" @close="isshowlabel = false" @submit="getlabel"></labelgroup>
</div>
</template>
<script lang="ts">
import {
import {
defineComponent,
ref,
watch,
onMounted
} from 'vue'
import customerService from '@/api/customer'
import labelgroup from './label-group.vue'
import dayjs from 'dayjs'
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
import { Notify } from 'quasar'
interface params {
} from 'vue'
import customerService from '@/api/customer'
import labelgroup from './label-group.vue'
import dayjs from 'dayjs'
import {
Notify
} from 'quasar'
import {
zhCN,
dateZhCN
} from 'naive-ui'
interface params {
Name: number | string
IsCustom: number
Type: number | string
labelType?: number | string
Id?: number | string
Direction?: string | number
StartValue?: string | Array<any>
EndValue?: string
disable?: boolean
directionList?: Array<any>
OptionsList?: Array<any>
isSelect?: boolean
rangeArr?: Array<any>
}
interface dateParams {
labelType ? : number | string
Id ? : number | string
Direction ? : string | number
StartValue ? : string | Array < any >
EndValue ? : string
disable ? : boolean
directionList ? : Array < any >
OptionsList ? : Array < any >
isSelect ? : boolean
rangeArr ? : Array < any > | null
}
interface dateParams {
value: string | number
label: string
children?: Array<dateParams>
}
const format = "YYYY/MM/DD HH:mm:ss"
export default defineComponent({
children ? : Array < dateParams >
}
const format = 'YYYY/MM/DD HH:mm:ss'
export default defineComponent({
props: {
addCondition: {
type: Number,
......@@ -287,30 +191,30 @@ export default defineComponent({
}
},
components: {
labelgroup,
labelgroup
},
setup(props, ctx) {
let birthday = ref([])//只有一个
let lableList = ref<Array<any>>([]) //标签的数组//只有一个
let filedList = ref<Array<params>>([]); //客户字段数组
let addMsg = ref<Array<any>>([]) //筛选数组
let birthday = ref([]) //只有一个
let lableList = ref < Array < any >> ([]) //标签的数组//只有一个
let filedList = ref < Array < params >> ([]) //客户字段数组
let addMsg = ref < Array < any >> ([]) //筛选数组
let isshowlabel = ref(false) //标签弹出显示
let selectindex = ref(0) //现在筛选数组 索引
//日期数组
let dateOptions = ref<Array<dateParams>>([])
let dateOptions = ref < Array < dateParams >> ([])
let year: any = new Date().getFullYear()
for (let i = 1; i <= 12; i++) {
let obj: dateParams = {
value: i < 10 ? '0' + i : i,
value: i < 10 ? '0' + i : '' + i,
label: i + '月',
children: []
}
let day = new Date(year, i, 0).getDate()
for (let d = 1; d <= day; d++) {
obj.children?.push({
value: d < 10 ? '0' + d : d,
label: d + '号',
value: (i < 10 ? '0' + i : '' + i) + '-' + (d < 10 ? '0' + d : '' + d),
label: d + '号'
})
}
dateOptions.value.push(obj)
......@@ -318,86 +222,105 @@ export default defineComponent({
const directionList1 = [{
Id: 1,
Name: '包含所有'
}, {
},
{
Id: 2,
Name: '包含任意'
}, {
},
{
Id: 3,
Name: '不包含'
}, {
},
{
Id: 4,
Name: '为空'
}, {
},
{
Id: 5,
Name: '不为空'
},]
}
]
const directionList2 = [{
Id: 1,
Name: '等于'
}, {
},
{
Id: 2,
Name: '不等于'
}, {
},
{
Id: 3,
Name: '为空'
}, {
},
{
Id: 4,
Name: '不为空'
}, {
},
{
Id: 5,
Name: '模糊'
},]
}
]
const directionList5 = [{
Id: 1,
Name: '等于'
}, {
},
{
Id: 2,
Name: '大于'
}, {
},
{
Id: 3,
Name: '大于等于'
}, {
},
{
Id: 4,
Name: '小于'
}, {
},
{
Id: 5,
Name: '小于等于'
},]
}
]
const init = () => {
console.log('init', props.defaultData)
if (props.defaultData && props.defaultData.length > 0) {
addMsg.value = []
props.defaultData.map((e: any) => {
let find: any = filedList.value.find((_e) => {
let find: any = filedList.value.find(_e => {
return _e.Id == e.Id
})
if (find && find.OptionsList) {
e.OptionsList = find.OptionsList
}
switch (find.Type) {
case 1: {//单行文本
case 1: {
//单行文本
e.labelType = 1
e.directionList = directionList2
break;
break
}
case 2: {//多行文本
case 2: {
//多行文本
e.labelType = 2
e.directionList = directionList2
break;
break
}
case 3: {//单选
case 3: {
//单选
e.labelType = 3
e.directionList = directionList2
e.StartValue = Number(e.StartValue)
if (find.OptionsList) {
e.OptionsList = find.OptionsList
}
break;
break
}
case 4: {//多选
case 4: {
//多选
e.labelType = 4
if (e.Id == "标签") {
e.StartValue=''
if (e.Id == '标签') {
e.StartValue = ''
} else {
if (e.StartValue) {
e.StartValue = e.StartValue.split(',').map(e => Number(e))
......@@ -410,28 +333,31 @@ export default defineComponent({
if (find.OptionsList) {
e.OptionsList = find.OptionsList
}
break;
break
}
case 5: {//日期
case 5: {
//日期
e.labelType = 5
if (e.StartValue) {
birthday.value = e.StartValue.split('-')
birthday.value = e.StartValue.split(',')
} else {
birthday.value = []
}
console.log(5, e.StartValue)
break;
break
}
case 6: {//日期时间范围
case 6: {
//日期时间范围
e.labelType = 6
e.rangeArr = [e.StartValue, e.EndValue]
e.rangeArr = [Date.parse(e.StartValue), Date.parse(e.EndValue)]
console.log(6, e.StartValue)
break;
break
}
case 7: {//数值
case 7: {
//数值
e.labelType = 7
e.directionList = directionList5
break;
break
}
}
addMsg.value.push(e)
......@@ -449,19 +375,22 @@ export default defineComponent({
}]
}
}
let changeAddCondition = (val) => {
let changeAddCondition = val => {
ctx.emit('update:addCondition', val)
}
const getCustomerFiledList = () => {
customerService.getCustomerFiledList({
customerService
.getCustomerFiledList({
Enable: 1
}).then((res) => {
})
.then(res => {
let data = res.data.Data
filedList.value = data;
filedList.value.forEach((x) => { // IsCustom 是否自定义字段 1是 2标签 3阶段
filedList.value = data
filedList.value.forEach(x => {
// IsCustom 是否自定义字段 1是 2标签 3阶段
x.IsCustom = 1
})
getCustomerStageList(); //获取客户阶段
getCustomerStageList() //获取客户阶段
})
}
const getCustomerStageList = () => {
......@@ -481,10 +410,11 @@ export default defineComponent({
IsCustom: 2
}
filedList.value.unshift(obj2)
console.log("标签", filedList.value)
console.log('标签', filedList.value)
})
}
const deleteadd = (index) => { //删除addMsg某一项
const deleteadd = index => {
//删除addMsg某一项
addMsg.value.splice(index, 1)
}
const addsList = () => {
......@@ -502,46 +432,46 @@ export default defineComponent({
}
const showlabel = (x, y) => {
selectindex.value = y;
selectindex.value = y
isshowlabel.value = true
}
const getlabel = (list) => {
isshowlabel.value = false;
const getlabel = list => {
isshowlabel.value = false
lableList.value = list
addMsg.value[selectindex.value].StartValue = list.map(e => e.Id).toString()
}
//----------------------------------------------------------------------------
// 禁用标签
let changeLabel = () => {
let find: any = addMsg.value.find((e) => {
let find: any = addMsg.value.find(e => {
return e.Id == '标签'
})
if (find) {
filedList.value.map((_e) => {
filedList.value.map(_e => {
if (_e.Id == '标签') {
_e.disable = true
}
})
} else {
filedList.value.map((_e) => {
filedList.value.map(_e => {
if (_e.Id == '标签') {
_e.disable = false
}
})
}
//禁用生日
let find2: any = addMsg.value.find((e) => {
let find2: any = addMsg.value.find(e => {
return e.Id == 17
})
console.log('生日2', find2)
if (find2) {
filedList.value.map((_e) => {
filedList.value.map(_e => {
if (_e.Id == 17) {
_e.disable = true
}
})
} else {
filedList.value.map((_e) => {
filedList.value.map(_e => {
if (_e.Id == 17) {
_e.disable = false
}
......@@ -555,47 +485,51 @@ export default defineComponent({
addMsg.value[y].EndValue = ''
switch (val) {
case "标签": {
case '标签': {
addMsg.value[y].IsCustom = 2
break;
break
}
case "客户阶段": {
case '客户阶段': {
addMsg.value[y].IsCustom = 3
break;
break
}
default: {
addMsg.value[y].IsCustom = 1
}
}
let find: any = filedList.value.find((e) => {
let find: any = filedList.value.find(e => {
return e.Id == val
})
if (find) {
addMsg.value[y].Name = find.Name
}
switch (find.Type) {
case 1: {//单行文本
case 1: {
//单行文本
addMsg.value[y].labelType = 1
addMsg.value[y].directionList = directionList2
addMsg.value[y].Type = 2
break;
break
}
case 2: {//多行文本
case 2: {
//多行文本
addMsg.value[y].labelType = 2
addMsg.value[y].directionList = directionList2
addMsg.value[y].Type = 2
break;
break
}
case 3: {//多选
case 3: {
//多选
addMsg.value[y].labelType = 3
addMsg.value[y].directionList = directionList2
addMsg.value[y].Type = 2
if (find.OptionsList) {
addMsg.value[y].OptionsList = find.OptionsList
}
break;
break
}
case 4: {//多选
case 4: {
//多选
addMsg.value[y].labelType = 4
addMsg.value[y].StartValue = []
addMsg.value[y].directionList = directionList1
......@@ -603,39 +537,42 @@ export default defineComponent({
if (find.OptionsList) {
addMsg.value[y].OptionsList = find.OptionsList
}
break;
break
}
case 5: {//日期
case 5: {
//日期
addMsg.value[y].labelType = 5
addMsg.value[y].Type = 3
break;
break
}
case 6: {//日期时间范围
case 6: {
//日期时间范围
addMsg.value[y].labelType = 6
addMsg.value[y].Type = 4
addMsg.value[y].rangeArr = []
break;
addMsg.value[y].rangeArr = null
break
}
case 7: {//数值
case 7: {
//数值
addMsg.value[y].labelType = 7
addMsg.value[y].directionList = directionList5
addMsg.value[y].Type = 5
break;
break
}
}
}
let changeDate = (value, y) => {
console.log(500, value, y)
addMsg.value[y].StartValue = value.join('-')
addMsg.value[y].StartValue = value.toString();
}
let changeRange = (val, y) => {
let a = dayjs(val[0]._d).format(format)
let b = dayjs(val[1]._d).format(format)
console.log(a, b)
addMsg.value[y].StartValue = a
addMsg.value[y].EndValue = b
}
const checkRule = (val: Array<params>) => {
const newVal=JSON.parse(JSON.stringify(val))
const s= dayjs(newVal[0]).format(format)
const e= dayjs(newVal[1]).format(format)
console.log(570,val,s,e)
addMsg.value[y].StartValue = s
addMsg.value[y].EndValue = e
}
const checkRule = (val: Array < params > ) => {
let flag = false
flag = val.every(e => {
if (e.Type == 1) {
......@@ -644,7 +581,6 @@ export default defineComponent({
} else {
return !!e.Id && e.Direction
}
} else if (e.Type == 2) {
if (e.Direction == 1 || e.Direction == 2) {
return !!e.Id && !!e.StartValue
......@@ -658,7 +594,6 @@ export default defineComponent({
} else {
return e.Id && e.Direction && e.StartValue
}
})
if (!flag) {
Notify.create({
......@@ -669,9 +604,11 @@ export default defineComponent({
}
return flag
}
watch(() => [...addMsg.value], (val) => {
watch(
() => [...addMsg.value],
val => {
changeLabel()
let newVal: Array<params> = []
let newVal: Array < params > = []
val.map((e: params) => {
let item: params = JSON.parse(JSON.stringify(e))
if (e.OptionsList) {
......@@ -680,23 +617,25 @@ export default defineComponent({
if (e.directionList) {
delete item.directionList
}
if (item.labelType === 4 && Array.isArray(item.StartValue)) {
item.StartValue = item.StartValue.join(',')
}
delete item.labelType
newVal.push(item)
})
console.log('change', newVal)
ctx.emit('change', newVal)
}, { deep: true })
onMounted(() => { //进入页面就调用
}, {
deep: true
}
)
onMounted(() => {
//进入页面就调用
setTimeout(() => {
init()
}, 2000)
getCustomerFiledList(); //获取客户字段
getCustomerFiledList() //获取客户字段
})
return {
zhCN,
dateZhCN,
birthday,
dateOptions,
getCustomerFiledList,
......@@ -712,37 +651,41 @@ export default defineComponent({
changeName,
changeDate,
changeRange,
locale,
changeAddCondition,
checkRule
}
}
})
})
</script>
<style lang="scss" scoped>
::v-deep .ant-cascader-picker {
::v-deep .ant-cascader-picker {
border-radius: 4px;
border-color: rgb(0 0 0 / 24%);
overflow: hidden;
}
}
</style>
<style>
/*修改滚动条样式*/
ul::-webkit-scrollbar {
/*修改滚动条样式*/
ul::-webkit-scrollbar {
width: 6px;
height: 10px;
/**/
}
ul::-webkit-scrollbar-track {
}
ul::-webkit-scrollbar-track {
background: rgb(239, 239, 239);
border-radius: 3px;
}
ul::-webkit-scrollbar-thumb {
}
ul::-webkit-scrollbar-thumb {
background: #bfbfbf;
border-radius: 10px;
}
ul::-webkit-scrollbar-thumb:hover {
}
ul::-webkit-scrollbar-thumb:hover {
background: #333;
}
}
</style>
<template>
<div class="q-mt-md q-pa-md CustomerOperation flex">
<div class="customer-operation-category">
<div v-for="item in leftList" :key="item.Id" :class="{ active: curItem == item.Id }"
class="customer-operation-category--item" @click="changeActive(item)">{{ item.Name }}</div>
<div v-for="item in leftList" :key="item.Id" :class="{ active: curItem == item.Id }" class="customer-operation-category--item" @click="changeActive(item)">{{ item.Name }}</div>
</div>
<div class="customer-operation-content">
<div v-if="curItem == 1" class="row">
<div class="col-2 content-left">领取公海客户:</div>
<div class="collaborator-title">领取公海客户:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.IsPublicAudit" :true-value="1" :false-value="2" />
......@@ -14,7 +13,7 @@
</div>
<div class="flex items-center">
<q-toggle v-model="data.PublicGetDept" false-value="-1" />以下部门允许领取公海客户
<q-btn color="primary" label="修改" size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
<q-btn color="primary" unelevated label="修改" size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
</div>
<div>
<div v-for="item in items" :key="item.id">{{ item }}</div>
......@@ -23,7 +22,7 @@
</div>
<div v-if="curItem == 2">
<div class="row">
<div class="col-2 content-left">可放弃客户:</div>
<div class="collaborator-title">可放弃客户:</div>
<div class="col-10">
<div class="q-gutter-sm">
<q-radio v-model="data.AbandonType" :val="1" label="全部客户" />
......@@ -35,41 +34,47 @@
</div>
</div>
<div class="row">
<div class="col-2 content-left">可操作员工:</div>
<div class="collaborator-title">可操作员工:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.AbandonDept" false-value="-1" />以下部门允许将客户放弃到公海
<q-btn color="primary" label="修改" size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
<q-btn color="primary" label="修改" unelevated size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
</div>
</div>
</div>
<div class="row">
<div class="col-2 content-left">放弃后审核:</div>
<div class="collaborator-title">放弃后审核:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.AbandonAudit" false-value="-1" />开启后,员工放弃客户时需要企微端设置的部门上级审批,审批同意后才可放弃。</div>
<div class="flex items-center"><q-toggle v-model="data.AbandonAudit" false-value="-1" />开启后,员工放弃客户时需要企微端设置的部门上级审批,审批同意后才可放弃。</div>
</div>
</div>
<div class="row">
<div class="col-2 content-left" style="padding-top: 15px">放弃原因:</div>
<div class="collaborator-title" style="padding-top: 15px">放弃原因:</div>
<div class="col-10">
<draggable v-model="data.AbandonReasonList" tag="div" item-key="Id">
<template #item="{ element }">
<div class="flex items-center">
<i class="iconfont icon-drag" style="font-size: 20px; color: #777"></i>
<div class="AbandonReasonItem flex items-center">{{ element }}</div>
<n-popover trigger="hover">
<template #trigger>
<q-icon name="warning" />
</template>
<span>编辑</span>
</n-popover>
</div>
</template>
</draggable>
<div class="flex items-center q-pl-sm"><q-btn color="primary" label="添加" unelevated class="q-ml-lg q-mr-md" />已设/可设上限:5/10</div>
</div>
</div>
</div>
<div v-if="curItem == 3" class="row">
<div class="col-2 content-left">申请成为协作人:</div>
<div class="collaborator-title">申请成为协作人:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />以下部门允许申请成为协作人
<q-btn color="primary" label="修改" size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
<q-btn color="primary" label="修改" unelevated size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
</div>
<div>
<div v-for="item in items" :key="item.id">{{ item }}</div>
......@@ -77,11 +82,11 @@
</div>
</div>
<div v-if="curItem == 4" class="row">
<div class="col-2 content-left">添加协作人:</div>
<div class="collaborator-title">添加协作人:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.AddTeamDept" :true-value="1" :false-value="0" />以下部门允许申请成为协作人
<q-btn color="primary" label="修改" size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
<q-btn color="primary" label="修改" unelevated size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
</div>
<div>
<div v-for="item in items" :key="item.id">{{ item }}</div>
......@@ -91,32 +96,108 @@
</div>
</div>
</div>
<div v-if="curItem == 5">
<div class="row">
<div class="collaborator-title">转移客户:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
以下部门允许转移客户
<q-btn color="primary" label="修改" unelevated size="xs" class="q-ml-lg" @click="checkedPublicGetDept" />
</div>
</div>
</div>
<div class="row">
<div class="collaborator-title">转移范围:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
转移客户时允许选择的范围
<q-btn color="primary" label="设置" unelevated size="xs" class="q-ml-lg" />
</div>
</div>
</div>
</div>
<div class="row" v-if="curItem == 6">
<div class="collaborator-title">删除客户跟进记录:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
开启后,允许员工删除自己填写的客户跟进记录
</div>
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
开启后,仅允许添加跟进记录后
<q-input outlined v-model="data.text" dense type="number" :min="0" style="width: 100px; margin: 0 10px" />
分钟内删除
</div>
</div>
</div>
<div v-if="curItem == 7">
<div class="row">
<div class="collaborator-title">签到拜访限制:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
开启后,仅企业客户允许签到拜访
</div>
</div>
<departmentStaff v-model="showDptDialog" :defaultArray="defaultDpt" nodeKey="newId" :showType="1"
labelKey="DeptName" childrenKey="ChildList" strategy="leaf" :treeData="DptDataTree" @select="getdpt" />
</div>
<div class="row">
<div class="collaborator-title">签到拜访拍照:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
开启后,签到拜访时必须拍照
</div>
</div>
</div>
</div>
<div v-if="curItem == 8">
<div class="row">
<div class="collaborator-title" style="min-width: 140px">创建企业时查重方式:</div>
<div class="col-10">
<div class="q-gutter-sm">
<q-radio v-model="data.AbandonType" :val="1" label="模糊查重" />
<q-radio v-model="data.AbandonType" :val="2" label="精准查重 " />
</div>
</div>
</div>
<div class="row">
<div class="collaborator-title" style="min-width: 140px">创建企业客户:</div>
<div class="col-10">
<div class="flex items-center">
<q-toggle v-model="data.ApplyForTeamDept" :true-value="1" :false-value="0" />
仅支持通过工商信息库来创建企业
</div>
</div>
</div>
</div>
<div v-if="curItem == 9">
<div class="row flex justify-end">
<q-btn color="primary" label="添加自定义字段" unelevated />
</div>
</div>
</div>
<departmentStaff v-model="showDptDialog" :defaultArray="defaultDpt" nodeKey="newId" :showType="1" labelKey="DeptName" childrenKey="ChildList" strategy="leaf" :treeData="DptDataTree" @select="getdpt" />
</div>
</template>
<script lang="ts">
import {
ref,
toRefs,
reactive,
defineComponent,
onMounted
} from 'vue'
import customerService from '@/api/customer'
// import customerService2 from '@/api/customer2'
import departmentStaff from '@/components/common/departmentStaff.vue'
import requestGroup from '@/components/customer/request-group.vue'
import draggable from 'vuedraggable'
export default defineComponent({
import { ref, toRefs, reactive, defineComponent, onMounted } from 'vue'
import customerService from '@/api/customer'
// import customerService2 from '@/api/customer2'
import departmentStaff from '@/components/common/departmentStaff.vue'
import requestGroup from '@/components/customer/request-group.vue'
import draggable from 'vuedraggable'
export default defineComponent({
components: {
departmentStaff,
requestGroup,
draggable
},
setup() {
const leftList = ref([{
const leftList = ref([
{
Id: 1,
Name: '领取公海客户'
},
......@@ -187,7 +268,7 @@
})
})
}
const getChildList = (ChildList: Array < any > ) => {
const getChildList = (ChildList: Array<any>) => {
ChildList.forEach(x => {
x.newId = x.DataType + '-' + x.DeptId
if (x.ChildList && x.ChildList.length > 0) {
......@@ -221,15 +302,14 @@
setCustomerConfig
}
}
})
})
</script>
<style lang="scss" scoped>
.CustomerOperation {
.CustomerOperation {
background-color: rgb(243, 246, 249);
}
}
.customer-operation-category {
.customer-operation-category {
margin-right: 10px;
width: 200px;
flex: none;
......@@ -251,23 +331,17 @@
background-color: #eaf0ff;
color: #3470ff;
}
}
}
.customer-operation-content {
.customer-operation-content {
background: #fff;
flex: 1;
border-radius: 8px;
padding: 25px;
overflow: auto;
}
.content-left {
line-height: 40px;
font-weight: 600;
white-space: nowrap;
}
}
.AbandonReasonItem {
.AbandonReasonItem {
width: 453px;
height: 50px;
line-height: 50px;
......@@ -276,6 +350,13 @@
border-radius: 5px;
border: 1px solid #d7d7d7;
margin: 10px;
}
}
.collaborator-title {
min-width: 80px;
line-height: 40px;
text-align: right;
margin-right: 10px;
font-weight: 600;
white-space: nowrap;
}
</style>
......@@ -99,22 +99,10 @@
<q-input filled v-model="msg.Q_NotFollowUpDay" label="几天未跟进"></q-input>
</div>
<div class="col-3">
<!-- <selectTree
:treeData="data.EmployeeList"
:defaultArray="data.defaultArray"
nodeKey="newId"
:multiple="false"
labelKey="DeptName"
childrenKey="ChildList"
tipText="选择部门/人员"
@getChild="getChild"
></selectTree>-->
<n-cascader v-model:value="data.CascaderValue" clearable placeholder="选择部门/人员" check-strategy="all"
value-field="newId" label-field="DeptName" size="large" :show-path="false" max-tag-count="responsive"
:options="data.EmployeeList" cascade children-field="ChildList"
@update:value="CascaderUpdateValue" />
<!-- <Cascader :options="data.EmployeeList" optionLabel="DeptName" optionValue="newId" optionChildren="ChildList"
label="选择部门/人员" :multiple="true" /> -->
</div>
<div class="col-3">
<q-btn color="primary" size="sm" label="导入" />
......@@ -160,14 +148,10 @@
onMounted
} from 'vue'
import CustomerModule from '@/module/customer/customerModule'
// import selectTree from '@/components/common/selectTree.vue'
import customRight from '@/components/common/customRight.vue'
// import Cascader from "@/components/common/Cascader.vue"
export default defineComponent({
components: {
// selectTree,
customRight,
// Cascader
},
setup() {
let {
......
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