Commit b6030ed5 authored by 罗超's avatar 罗超

拆分客户页搜索栏

parent 0f4e7b9b
This diff is collapsed.
import message from '@/utils/message'
import dayjs from 'dayjs'
import { Dialog } from 'quasar'
import { reactive } from 'vue'
import customerService, { CutomerParams } from '@/api/customer'
import customerSetService from '@/api/customerSet'
......@@ -23,8 +21,6 @@ interface dataParams {
selected: Array<any>
EmployeeList: Array<memberParams>
defaultArray: Array<number | string>
customerCascaderValue: Array<any> | string
deptCascaderValue: string | null
colLoadingFinish: boolean
[key: string]: any
}
......@@ -83,14 +79,6 @@ const CustomerModule = () => {
const data = reactive<dataParams>({
loading: false,
isshowlabel: false, //设置标签弹窗
showTransfer: false, //转移客户弹窗
showAbandon: false, //放弃客户弹窗
showImport: false, //导入组件弹窗
showDptDialog: false, //部门弹窗
DptDialogArr: [],
DistributionRule: 1,
importTab: 1,
columns: [
{
name: 'CustomerName',
......@@ -169,9 +157,7 @@ const CustomerModule = () => {
dataList: [],
WayList: [],
EmployeeList: [],
defaultArray: [], //
deptCascaderValue: null,
customerCascaderValue: '',
defaultArray: [],
colLoadingFinish: false
})
const msg = reactive<CutomerParams>({
......@@ -309,18 +295,7 @@ const CustomerModule = () => {
msg.PageIndex = val
getCustomerList()
}
const getDept = (id: any) => {
//数据处理 获取id是 1-id,2-id 前面1代表部门2代表人员 后面是原生ID
if (id) {
msg.EmpId = id.slice(2)
} else {
msg.EmpId = 0
}
getCustomerList()
}
const customerUpdateValue = val => {
console.log('customerUpdateValue', val)
}
data.sysColumns.map(e => {
data.columns.push(e)
data.showColumns.push(e.field)
......@@ -352,84 +327,10 @@ const CustomerModule = () => {
data.colLoadingFinish = true
})
const showDialog = (dialogName) => {
data[dialogName] = true
}
const getlabel = val => {
const ids=val.map(e=>e.Id).toString()
setLabel(ids)
}
const setLabel = (id) => {
const labelMsg = {
CustomerIds: data.selected.map(e => e.Id).toString(),
LableIds: id
}
customerService.setCustomLabelBatch(labelMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
})
}
const TransferMsg = reactive({
CustomerIds: '',
EmpId: 0
})
const setTransfer = async () => {
TransferMsg.CustomerIds = data.selected.map(e => e.Id).toString()
await customerService.setCustomerTransfer(TransferMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
data.showTransfer=false
})
TransferMsg.EmpId = 0
}
const AbandonMsg = reactive({
CustomerIds: '',
Reason: ""
})
const setAbandon = async () => {
AbandonMsg.CustomerIds = data.selected.map(e => e.Id).toString()
await customerService.setCustomerAbandon(AbandonMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
data.showAbandon = false
})
AbandonMsg.Reason = ''
}
const delCustomer = () => {
Dialog.create({
title: '确认删除?',
message: "请输入'删除'",
prompt: {
model: '',
isValid: val => val == '删除', // << here is the magic
outlined :true
},
cancel: '取消',
ok: '确认'
}).onOk(() => {
const delMsg = {
CustomerIds: data.selected.map(e => e.Id).toString()
}
customerService.delCustomerInfo(delMsg).then(res => {
message.successMsg(res.data.Message)
data.selected=[]
getCustomerList()
})
})
}
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 {
getCustomerList,
getWayList,
......@@ -446,19 +347,6 @@ const CustomerModule = () => {
changePage,
pagination,
CustomList,
getDept,
customerUpdateValue,
showDialog,
getlabel,
setLabel,
setTransfer,
TransferMsg,
AbandonMsg,
setAbandon,
delCustomer,
getFile,
getDeptDig,
showdept
}
}
......
This diff is collapsed.
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