客户属性字典更换

zth
lijingjia 2 weeks ago
parent 7830dfc166
commit c96a0d8350

@ -74,7 +74,7 @@ export const formSchema: FormSchema[] = [
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
resolve(res) resolve(res)
}) })
}) })

@ -242,7 +242,7 @@
type: 'dropdown', type: 'dropdown',
visible: true, visible: true,
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('infoclient-ArrclientTag')
const dict = results.map((item) => { const dict = results.map((item) => {
return item.name + '-' + item.value return item.name + '-' + item.value
}) })
@ -672,7 +672,7 @@
} }
} }
// //
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
const item = res.filter((item) => { const item = res.filter((item) => {
return list.value[changes[0][0]]['customerTypeText'] && list.value[changes[0][0]]['customerTypeText'].includes(item.name) return list.value[changes[0][0]]['customerTypeText'] && list.value[changes[0][0]]['customerTypeText'].includes(item.name)
}) })
@ -701,7 +701,7 @@
} }
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
const item = res.filter((item) => { const item = res.filter((item) => {
return changes[0][3].includes(item.name) return changes[0][3].includes(item.name)
}) })

@ -222,7 +222,6 @@
...item, ...item,
}) })
}) })
console.log(ret)
return ret return ret
} }

@ -0,0 +1,64 @@
/*
* @Desc: hooks
* @Author: lijj
* @Date: 2024-11-14 09:57:21
*/
const domSymbol = Symbol('watermark-dom')
export function useWatermark(
op = 0.15,
appendEl: HTMLElement | null = document.body
) {
let func: any = () => {}
const id = domSymbol.toString()
const clear = () => {
const domId = document.getElementById(id)
if (domId) {
const el = appendEl
el && el.removeChild(domId)
}
window.removeEventListener('resize', func)
}
const createWatermark = (str: string) => {
clear()
const can = document.createElement('canvas')
can.width = 300
can.height = 240
const cans = can.getContext('2d')
if (cans) {
cans.rotate((-25 * Math.PI) / 120)
cans.font = '15px Vedana'
cans.fillStyle = `rgba(0, 0, 0, ${op})`
cans.textAlign = 'left'
cans.textBaseline = 'middle'
cans.fillText(str, can.width / 20, can.height)
}
const div = document.createElement('div')
div.id = id
div.style.pointerEvents = 'none'
div.style.top = '0px'
div.style.left = '0px'
div.style.position = 'absolute'
div.style.zIndex = '100000000'
div.style.width = document.documentElement.clientWidth + 'px'
div.style.height = document.documentElement.clientHeight - 80 + 'px'
div.style.background =
'url(' + can.toDataURL('image/png') + ') left top repeat'
const el = appendEl
el && el.appendChild(div)
return id
}
function setWatermark(str: string) {
createWatermark(str)
func = () => {
createWatermark(str)
}
window.addEventListener('resize', func)
}
return { setWatermark, clear }
}

@ -11,7 +11,7 @@ const accountTypeDict = ref([])
getDictOption('account_type').then((data) => { getDictOption('account_type').then((data) => {
accountTypeDict.value = data accountTypeDict.value = data
}) })
getDictOption('djy_cust_prop').then((data) => { getDictOption('infoclient-ArrclientTag').then((data) => {
customTypeDict.value = data customTypeDict.value = data
}) })
// 客户名称下拉框数据 // 客户名称下拉框数据

@ -58,7 +58,7 @@
const res: API.DataResult = await ApiList(p) const res: API.DataResult = await ApiList(p)
// //
const adicts = await getDictOption('account_type') const adicts = await getDictOption('account_type')
const ddicts = await getDictOption('djy_cust_prop') const ddicts = await getDictOption('infoclient-ArrclientTag')
res?.data.forEach((row) => { res?.data.forEach((row) => {
adicts.forEach((item) => { adicts.forEach((item) => {
if (item.value == row.accountType) { if (item.value == row.accountType) {

@ -1219,7 +1219,7 @@ export const detailsFormSchema: FormSchema[] = [
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
resolve(res) resolve(res)
}) })
}) })

@ -218,7 +218,7 @@
} }
const SetData = async (data) => { const SetData = async (data) => {
list.value.splice(0) list.value.splice(0)
const customerTypeList: any = await getDictOption('djy_cust_prop') const customerTypeList: any = await getDictOption('infoclient-ArrclientTag')
const unitList: any = await feeUnitDict2() const unitList: any = await feeUnitDict2()
const unitList2: any = await getDictOption('fee_unit') const unitList2: any = await getDictOption('fee_unit')
console.log(unitList, unitList2) console.log(unitList, unitList2)
@ -324,7 +324,7 @@
data: 'customerTypeText', data: 'customerTypeText',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('infoclient-ArrclientTag')
console.log(results) console.log(results)
const dict = results.map((item) => { const dict = results.map((item) => {
return item.value + '-' + item.name return item.value + '-' + item.name
@ -542,7 +542,7 @@
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
const item = res.filter((item) => { const item = res.filter((item) => {
return changes[0][3].includes(item.name) return changes[0][3].includes(item.name)
}) })

@ -1507,7 +1507,7 @@ export const detailsFormSchema: FormSchema[] = [
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
resolve(res) resolve(res)
}) })
}) })

@ -218,7 +218,7 @@
} }
const SetData = async (data) => { const SetData = async (data) => {
list.value.splice(0) list.value.splice(0)
const customerTypeList: any = await getDictOption('djy_cust_prop') const customerTypeList: any = await getDictOption('infoclient-ArrclientTag')
const unitList: any = await feeUnitDict2() const unitList: any = await feeUnitDict2()
const unitList2: any = await getDictOption('fee_unit') const unitList2: any = await getDictOption('fee_unit')
console.log(unitList, unitList2) console.log(unitList, unitList2)
@ -329,7 +329,7 @@
data: 'customerTypeText', data: 'customerTypeText',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('infoclient-ArrclientTag')
const dict = results.map((item) => { const dict = results.map((item) => {
return item.value + '-' + item.name return item.value + '-' + item.name
}) })
@ -546,7 +546,7 @@
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
const item = res.filter((item) => { const item = res.filter((item) => {
return changes[0][3].includes(item.name) return changes[0][3].includes(item.name)
}) })

@ -251,7 +251,7 @@ export const formSchema: FormSchema[] = [
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
resolve(res) resolve(res)
}) })
}) })
@ -285,7 +285,7 @@ export const formSchema: FormSchema[] = [
return { return {
api: () => { api: () => {
return new Promise((resolve) => { return new Promise((resolve) => {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
resolve(res) resolve(res)
}) })
}) })

@ -156,7 +156,7 @@
data: 'customerTypeText', data: 'customerTypeText',
type: 'dropdown', type: 'dropdown',
source: async (query, process) => { source: async (query, process) => {
const results = await getDictOption('djy_cust_prop') const results = await getDictOption('infoclient-ArrclientTag')
console.log(results) console.log(results)
const dict = results.map((item) => { const dict = results.map((item) => {
return item.value + '-' + item.name return item.value + '-' + item.name
@ -462,7 +462,7 @@
} }
// //
if (changes[0][1] === 'customerTypeText') { if (changes[0][1] === 'customerTypeText') {
getDictOption('djy_cust_prop').then((res) => { getDictOption('infoclient-ArrclientTag').then((res) => {
const item = res.filter((item) => { const item = res.filter((item) => {
return changes[0][3].includes(item.name) return changes[0][3].includes(item.name)
}) })

@ -4,7 +4,7 @@
* @Date: 2024-04-29 11:54:04 * @Date: 2024-04-29 11:54:04
--> -->
<template> <template>
<div class="sea-export-detail" :class="{ 'ds-view-box': source != 'edit' }"> <div ref="seaExportDetail" class="sea-export-detail" :class="{ 'ds-view-box': source != 'edit' }">
<a-tabs <a-tabs
size="small" size="small"
class="main-tab mt10" class="main-tab mt10"
@ -226,7 +226,9 @@
import { useMultipleTabStore } from '/@/store/modules/multipleTab' import { useMultipleTabStore } from '/@/store/modules/multipleTab'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import { useWatermark } from '/@/hooks/web/warterMark'
//
const seaExportDetail = ref(null)
const go = useGo() const go = useGo()
// loading // loading
const loading = ref(false) const loading = ref(false)
@ -482,11 +484,8 @@
bookingDetails.value = res.data bookingDetails.value = res.data
// //
inPageLoading.value = false inPageLoading.value = false
// const { setWatermark, clear } = useWatermark(0.2, seaExportDetail.value)
// if (res.data.formSetList && res.data.formSetList.length) { // setWatermark('')
// const formSetContent = JSON.parse(res.data.formSetList[0].content)
// RefbasicInfo.value.updateSchema()
// }
}) })
.catch(() => { .catch(() => {
loading.value = false loading.value = false

@ -80,7 +80,7 @@
} }
} else { } else {
// //
const arr = await getDictOption('djy_cust_prop') const arr = await getDictOption('infoclient-ArrclientTag')
if (data.companyType) { if (data.companyType) {
const res = arr.filter(item => { const res = arr.filter(item => {
return item.label == data.companyType return item.label == data.companyType

@ -2994,7 +2994,7 @@ export const otherInfoFormSchema: FormSchema[] = [
// 客户类别下拉框数据 // 客户类别下拉框数据
const customTypeDict = ref([]) const customTypeDict = ref([])
const personList = ref([]) const personList = ref([])
getDictOption('djy_cust_prop').then((data) => { getDictOption('infoclient-ArrclientTag').then((data) => {
customTypeDict.value = data customTypeDict.value = data
}) })
// 关系人表单 // 关系人表单

Loading…
Cancel
Save