lijingjia 2 months ago
commit 9bef5a8252

@ -245,18 +245,18 @@
}, },
{ {
title: '顺序', title: '顺序',
width: 200, width: 50,
data: 'sortNumber', data: 'sortNumber',
}, },
{ {
title: '列标题', title: '列标题',
width: 120, width: 200,
data: 'columnTitle', data: 'columnTitle',
}, },
{ {
title: '对应变动字段', title: '对应变动字段',
width: 120, width: 200,
data: 'fieldName', data: 'fieldName',
type: 'dropdown', type: 'dropdown',
// (process) // (process)

@ -77,7 +77,14 @@ export const formSchema: FormSchema[] = [
queryCondition: '[]', queryCondition: '[]',
pageCondition: { pageIndex: 1, pageSize: 100, sortConditions: [] }, pageCondition: { pageIndex: 1, pageSize: 100, sortConditions: [] },
}).then((res) => { }).then((res) => {
resolve(res) let RData = { ...res }
RData.data = []
res.data.forEach((item) => {
if (item.templetName) {
RData.data.push(item)
}
})
resolve(RData)
}) })
}) })
}, },
@ -85,7 +92,6 @@ export const formSchema: FormSchema[] = [
valueField: 'templetName', valueField: 'templetName',
resultField: 'data', resultField: 'data',
onChange: (e, obj) => { onChange: (e, obj) => {
console.log(e, obj)
if (e && obj) { if (e && obj) {
formModel.templetName = obj.label formModel.templetName = obj.label
formModel.templetId = obj.value formModel.templetId = obj.value

@ -1,124 +1,214 @@
{ {
"code": 0, "code": 0,
"multiCode": "", "multiCode": "string",
"count": 0, "count": 0,
"message": "", "message": "string",
"succeeded": true, "succeeded": true,
"data": [ "data": {
{ "id": 0,
"type": "STATUS", "codeName": "string",
"data": [ "shortName": "string",
{ "code": "Create", "name": "待处理" }, "description": "string",
{ "code": "Retransmit", "name": "已转发" }, "name": "string",
{ "code": "Complete", "name": "已完成" }, "enFullName": "string",
{ "code": "Cancel", "name": "已取消" }, "address": "string",
{ "code": "Pending", "name": "已挂起" } "email": "string",
] "web": "string",
"tel": "string",
"fax": "string",
"chief": "string",
"country": "string",
"province": "string",
"city": "string",
"blContent": "string",
"isStop": true,
"level": "string",
"qq": "string",
"msn": "string",
"farCode": "string",
"fapCode": "string",
"unitPrice": "string",
"registrationNo": "string",
"orderNo": "string",
"taxNo": "string",
"ediCode": "string",
"ediCode2": "string",
"ediCode3": "string",
"organizationCode": "string",
"pcorpId": 0,
"pcorpName": "string",
"inspectionNo": "string",
"auditStatus": 0,
"auditStatusText": "string",
"auditTime": "2024-09-19T06:55:51.134Z",
"auditNote": "string",
"feeFRT": "string",
"sourceId": 0,
"invoiceBank": "string",
"invoiceAddrTel": "string",
"saleOrgId": "string",
"saleOrgIdList": [0],
"saleOrgNames": "string",
"commissionRate": 0,
"proportionRate": 0,
"commissionUserId": 0,
"carrierList": "string",
"ctnType": "string",
"enShortName": "string",
"wmsFeeRateType": "string",
"status": 0,
"note": "string",
"createTime": "2024-09-19T06:55:51.134Z",
"clientTag": {
"id": 0,
"clientId": 0,
"isCarrier": true,
"isBooking": true,
"isYard": true,
"isTruck": true,
"isController": true,
"isCustom": true,
"isAgent": true,
"isAgentCn": true,
"isExpress": true,
"isAirLines": true,
"isShipper": true,
"isConsignee": true,
"isNotifyParty": true,
"isWareHouse": true,
"isWharf": true,
"isInsurer": true,
"isLeasing": true,
"isTradingAgency": true,
"isOther": true,
"others": "string",
"isShipAgency": true,
"isEnterprise": true,
"isShipperCn": true,
"isContract": true,
"note": "string",
"createTime": "2024-09-19T06:55:51.134Z"
}, },
{ "clientContactList": [
"type": "TASK_TYPE", {
"data": [ "id": 0,
{ "code": "CAUTION_NOTICE", "name": "重要提醒" }, "clientId": 0,
{ "code": "BC", "name": "BC" }, "name": "string",
{ "code": "DRAFT", "name": "DRAFT" }, "enName": "string",
{ "code": "CANCELLATION", "name": "Cancellation" }, "job": "string",
{ "code": "SEAWAYBILL_DOWN", "name": "SEAWAY BILL" }, "jobs": ["string"],
{ "code": "ORIGINAL_DOWN", "name": "提单正本下载" }, "address": "string",
{ "code": "NOT_LOADED", "name": "未装载" }, "email": "string",
{ "code": "NOT_SHIPMENG", "name": "未装船" }, "mobile": "string",
{ "code": "INVOICE_BILL_MAIL", "name": "航次账单" }, "tel": "string",
{ "code": "VGM_COMPARE", "name": "VGM对比" }, "fax": "string",
{ "code": "TELEX_NOTICE", "name": "电放通知" }, "qq": "string",
{ "code": "SI_FEEDBACK", "name": "SI回执" }, "isDefault": true,
{ "code": "PER_BILL", "name": "单票账单" }, "isOperator": true,
{ "code": "CHANGE_SHIP", "name": "换船通知" }, "isFinancialStaff": true,
{ "code": "ABORT_CHANGE_SHIP", "name": "取消换船通知" }, "isSaleMan": true,
{ "code": "SHIPPING_ORDER", "name": "下货纸" }, "isOther": true,
{ "code": "ORIGINAL_LOST", "name": "正本缺失" }, "isInsurance": true,
{ "code": "VGM_EXCEPT", "name": "VGM异常" }, "isCheckAccount": true,
{ "code": "SHIPPING_ORDER_COMPARE", "name": "比对下货纸" }, "anniversary1": "2024-09-19T06:55:51.134Z",
{ "code": "TRUCK_DISPATCH", "name": "派车" }, "anniversary2": "2024-09-19T06:55:51.134Z",
{ "code": "BC_MODIFY", "name": "Amendment" }, "anniversaryNote1": "string",
{ "code": "CUT_MODIFY", "name": "截止时间变更" }, "anniversaryNote2": "string",
{ "code": "ROLLING_NOMINATION", "name": "RollingNomination" }, "status": 0,
{ "code": "TRANSFER_NOMINATION", "name": "TransferNomination" }, "note": "string",
{ "code": "VGM_FEEDBACK", "name": "VGM回执" }, "createTime": "2024-09-19T06:55:51.134Z"
{ "code": "VGM_MISSING", "name": "VGM未提交" }, }
{ "code": "POD_DISCHARGE_FULL", "name": "目的港未提货" }, ],
{ "code": "POD_GATEOUT_FULL", "name": "目的港未返空箱" }, "saleId": 0,
{ "code": "ROUTE_CUT_CHANGE", "name": "航线截止时间调整" }, "sale": "string",
{ "code": "POL_CTN_NOT_PICKUP", "name": "装货港未提箱" }, "doc": 0,
{ "code": "TRNAS_PLAN_HAS_CHANGE", "name": "运输计划已变更" }, "docName": "string",
{ "code": "WAIT_ORDER_AUDIT", "name": "审单" }, "operatorId": 0,
{ "code": "WAIT_BOOKING", "name": "订舱" }, "operatorName": "string",
{ "code": "WAIT_BC", "name": "收BC" }, "customerService": 0,
{ "code": "WAIT_SPACE_RELEASE", "name": "放舱" }, "customerServiceName": "string",
{ "code": "WAIT_BILL_CONFIRM", "name": "提单确认" }, "isShared": true,
{ "code": "WAIT_SI", "name": "提交SI" }, "invoicingMethod": 1,
{ "code": "WAIT_DRAFT", "name": "处理Draft" }, "invoicingMethodText": "string",
{ "code": "WAIT_CHECKOUT_BILL", "name": "截单" }, "notification": 0,
{ "code": "WAIT_BAOGUAN", "name": "报关" }, "notifications": [0],
{ "code": "WAIT_CANGDAN", "name": "发舱单" }, "isOverdueDeduction": true,
{ "code": "WAIT_VGM", "name": "提交VGM" }, "overdueDays": 0,
{ "code": "WAIT_AFR", "name": "发AFR" }, "isMortgageLastOrder": true,
{ "code": "WAIT_AMS", "name": "发AMS" }, "invoiceHeaders": [
{ "code": "WAIT_ISF", "name": "发ISF" }, {
{ "code": "WAIT_XUNZHENG", "name": "熏蒸" }, "id": 0,
{ "code": "WAIT_SHANGJIAN", "name": "商检" }, "relativeId": 0,
{ "code": "WAIT_COA", "name": "报COA" }, "header": "string",
{ "code": "WAIT_CHANDIZHENG", "name": "出产地证" }, "addressTel": "string"
{ "code": "WAIT_TUOCHE", "name": "拖车" }, }
{ "code": "WAIT_INSURANCE", "name": "保险" }, ],
{ "code": "WAIT_CHUHAO", "name": "出号" }, "sourceDetailId": 0,
{ "code": "WAIT_NDRH", "name": "内点入货" }, "sourceName": "string",
{ "code": "WAIT_DELIVERY", "name": "快递" }, "sourceDetailName": "string",
{ "code": "WAIT_XIANGSHI", "name": "箱使" }, "saleOrgName": "string",
{ "code": "RETURN_CABIN", "name": "退舱" }, "serviceItemCodes": ["string"],
{ "code": "INFO_CLIENT_AUDIT", "name": "客户/供应商审核" }, "isCustomer": true,
{ "code": "FEE_AUDIT", "name": "费用审核" }, "isSupplier": true,
{ "code": "FEE_MODIFY_AUDIT", "name": "费用修改" }, "grade": "string",
{ "code": "FEE_DELETE_AUDIT", "name": "费用删除" }, "registeredCapital": 0,
{ "code": "FEE_BUSINESS_AUDIT", "name": "费用整单审核" }, "registrationTime": "2024-09-19T06:55:51.134Z",
{ "code": "APPLICATION_PAYMENT_AUDIT", "name": "付费申请审核" }, "defaultContact": {
{ "code": "APPLICATION_INVOICE_AUDIT", "name": "发票申请审核" }, "id": 0,
{ "code": "WORK_FLOW_MAIN", "name": "工作流任务创建主流程" }, "clientId": 0,
{ "code": "WORK_FLOW_RETURN_CABIN", "name": "工作流退舱流程" }, "name": "string",
{ "code": "WORK_FLOW_HANDLE_DRAFT", "name": "工作流处理DRAFT流程" }, "enName": "string",
{ "code": "APPLICATION_INVOICE_REJECTED", "name": "发票申请驳回" }, "job": "string",
{ "code": "APPLICATION_PAYMENT_REJECTED", "name": "付费申请驳回" }, "jobs": ["string"],
{ "code": "FEE_BUSINESS_REJECTED", "name": "费用整单审核驳回" }, "address": "string",
{ "code": "FEE_DELETE_REJECTED", "name": "费用删除驳回" }, "email": "string",
{ "code": "FEE_MODIFY_REJECTED", "name": "费用修改驳回" }, "mobile": "string",
{ "code": "FEE_REJECTED", "name": "费用审核驳回" }, "tel": "string",
{ "code": "INFO_CLIENT_REJECTED", "name": "客户/供应商审核驳回" }, "fax": "string",
{ "code": "RETURN_CABIN_REJECTED", "name": "退舱驳回" }, "qq": "string",
{ "code": "ORDER_AUDIT_REJECTED", "name": "审单驳回" }, "isDefault": true,
{ "code": "NOT_SPECIFIED", "name": "未指定" } "isOperator": true,
] "isFinancialStaff": true,
"isSaleMan": true,
"isOther": true,
"isInsurance": true,
"isCheckAccount": true,
"anniversary1": "2024-09-19T06:55:51.134Z",
"anniversary2": "2024-09-19T06:55:51.134Z",
"anniversaryNote1": "string",
"anniversaryNote2": "string",
"status": 0,
"note": "string",
"createTime": "2024-09-19T06:55:51.134Z"
}, },
{ "lastAccountDate": {
"type": "SOURCE", "id": 0,
"data": [ "clientId": 0,
{ "code": "EDI", "name": "EDI" }, "sourceId": 0,
{ "code": "MAIL", "name": "邮件" }, "beginDate": "2024-09-19T06:55:51.134Z",
{ "code": "MAIL_PARSE", "name": "邮件解析" }, "endDate": "2024-09-19T06:55:51.134Z",
{ "code": "FTP", "name": "FTP" }, "businessType": "string",
{ "code": "RETRANSMIT", "name": "转发" }, "saleId": 0,
{ "code": "BILL_TRACE", "name": "运踪" }, "accountType": "string",
{ "code": "WEBSITE", "name": "网站查询" }, "accountTypeName": "string",
{ "code": "CUSTOMER_SUBMIT", "name": "客户提交" }, "accountStartDate": "string",
{ "code": "SYSTEM", "name": "系统" }, "accountStartDateName": "string",
{ "code": "WORK_FLOW", "name": "工作流" } "accountMonth": 0,
] "accountDays": 0,
}, "accountFirstHalf": 0,
{ "accountSecondHalf": 0,
"type": "CATEGORY", "allowAmount": 0,
"data": [ "contractId": 0,
{ "code": "EXCPTION", "name": "异常" }, "commissionRate": 0,
{ "code": "PERSON", "name": "个人" }, "status": 0,
{ "code": "PUBLIC", "name": "公共" } "note": "string",
] "createTime": "2024-09-19T06:55:51.134Z",
"isSpecial": true
} }
], },
"additionalData": null "additionalData": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
} }

@ -62,6 +62,9 @@ if (res13.succeeded) {
UserData.push(e) UserData.push(e)
}) })
} }
// 账期 字典
const accountTypeList = await getDictOption('infoclient_business_accountType')
const Jobres = await getDictOption('infoclient-Jobs')
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '助记码', title: '助记码',
@ -149,6 +152,18 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
width: 150, width: 150,
}, },
{
title: '默认联系人',
dataIndex: 'defaultContact_name',
sorter: true,
width: 150,
},
{
title: '手机',
dataIndex: 'defaultContact_mobile',
sorter: true,
width: 150,
},
{ {
title: '电话', title: '电话',
dataIndex: 'tel', dataIndex: 'tel',
@ -281,6 +296,46 @@ export const columns: BasicColumn[] = [
sorter: true, sorter: true,
width: 150, width: 150,
}, },
{
title: '职务',
dataIndex: 'defaultContact_jobs',
sorter: true,
width: 200,
customRender: ({ text }) => {
let RData = ''
if (text) {
text.forEach((e) => {
Jobres.forEach((item) => {
if (item.value == e) {
RData = RData == '' ? item.label : `${RData},${item.label}`
}
})
})
}
return RData
},
},
{
title: '账期',
dataIndex: 'lastAccountDate_accountType',
sorter: true,
width: 150,
customRender: ({ text }) => {
let RData = text
accountTypeList.forEach((e) => {
if (e.value == text) {
RData = e.label
}
})
return RData
},
},
{
title: '末次合作时间',
dataIndex: 'etd',
sorter: true,
width: 150,
},
{ {
title: '备注', title: '备注',
@ -343,6 +398,21 @@ export const searchFormSchema: FormSchema[] = [
unCheckedValue: false, unCheckedValue: false,
}, },
}, },
{
field: 'etd',
label: '超期未合作客户',
component: 'Select',
colProps: { span: 4 },
defaultValue: false,
componentProps: {
options: [
{ value: 1, label: '1月' },
{ value: 2, label: '2月' },
{ value: 3, label: '3月' },
{ value: 4, label: '6月' },
],
},
},
{ {
label: '客户属性', label: '客户属性',
field: 'clientTag', field: 'clientTag',

@ -71,7 +71,7 @@
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
const route = useRoute() const route = useRoute()
import { useAppStore } from '/@/store/modules/app' import { useAppStore } from '/@/store/modules/app'
import { e } from 'unocss' import dayjs from 'dayjs'
const appStore = useAppStore() const appStore = useAppStore()
const [registerTable, { reload, getForm, getSelectRows }] = useTable({ const [registerTable, { reload, getForm, getSelectRows }] = useTable({
title: '', title: '',
@ -83,6 +83,19 @@
const ids = res.data.map((item) => { const ids = res.data.map((item) => {
return item.id return item.id
}) })
res.data.forEach((e) => {
if (e?.lastAccountDate) {
Object.keys(e.lastAccountDate).forEach((item) => {
e[`lastAccountDate_${item}`] = e.lastAccountDate[item]
})
}
if (e.defaultContact) {
Object.keys(e.defaultContact).forEach((item) => {
e[`defaultContact_${item}`] = e.defaultContact[item]
})
}
})
appStore.setIds(ids, 'wldw') appStore.setIds(ids, 'wldw')
let Sourceres = await GetClientSourceSelectList() let Sourceres = await GetClientSourceSelectList()
if (Sourceres.succeeded && Sourceres?.data) { if (Sourceres.succeeded && Sourceres?.data) {
@ -112,12 +125,26 @@
} else if (route.path == '/Supplierinfoclient') { } else if (route.path == '/Supplierinfoclient') {
p.isSupplier = 1 p.isSupplier = 1
} }
console.log(p) console.log(p)
return formatParams( let Rdata = formatParams(
p, p,
['isCustomer', 'isSupplier'], ['isCustomer', 'isSupplier'],
['contactInfo', 'isContractExpired', 'clientTag'] ['contactInfo', 'isContractExpired', 'clientTag'],
) )
if (p.etd) {
const now = dayjs()
const MonthsLater = now.add(p.etd, 'month')
let etd = JSON.parse(Rdata.queryCondition)
etd.forEach((item) => {
if (item.FieldName == 'etd') {
item.FieldValue = MonthsLater.format('YYYY-MM-DD')
item.ConditionalType = 2
}
})
Rdata.queryCondition = JSON.stringify(etd)
}
return Rdata
}, },
columns, columns,
formConfig: { formConfig: {

@ -58,7 +58,7 @@ import { useMessage } from '/@/hooks/web/useMessage'
import { getOptions } from '/@/hooks/dict' import { getOptions } from '/@/hooks/dict'
const { createMessage } = useMessage() const { createMessage } = useMessage()
import { BasicColumn, FormSchema } from '/@/components/Table' import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetControllerClientList, GetSaleUserList, GetCustomerServiceList, GetVouchingClerkList,GetSaleList } from '/@/views/operation/seaexport/api/BookingLedger' import { GetControllerClientList, GetSaleUserList, GetCustomerServiceList, GetVouchingClerkList,GetSaleList,GetOperatorUserList,GetLaneUserList } from '/@/views/operation/seaexport/api/BookingLedger'
import { GetClientInfoWithContact } from './api' import { GetClientInfoWithContact } from './api'
import { GetClientListByCode } from '/@/api/common' import { GetClientListByCode } from '/@/api/common'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
@ -245,7 +245,7 @@ const formSchema: FormSchema[] = [
colProps: { span: 6 }, colProps: { span: 6 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: GetCustomerServiceList, api: GetOperatorUserList,
labelField: 'pinYinCode', labelField: 'pinYinCode',
valueField: 'userName', valueField: 'userName',
showName: 'userName', showName: 'userName',
@ -353,7 +353,7 @@ const formSchema: FormSchema[] = [
colProps: { span: 6 }, colProps: { span: 6 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: GetCustomerServiceList, api: GetLaneUserList,
labelField: 'pinYinCode', labelField: 'pinYinCode',
valueField: 'userName', valueField: 'userName',
showName: 'userName', showName: 'userName',
@ -380,7 +380,7 @@ const formSchema: FormSchema[] = [
colProps: { span: 6 }, colProps: { span: 6 },
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
api: GetCustomerServiceList, api: GetLaneUserList,
labelField: 'pinYinCode', labelField: 'pinYinCode',
valueField: 'userName', valueField: 'userName',
showName: 'userName', showName: 'userName',

@ -0,0 +1,36 @@
<template>
<div @mouseover="showTooltip = true" @mouseleave="showTooltip = false" class="invoiceNo">
<span>{{ label }}</span>
<span v-show="invoiceEditFlag">
<slot name="text"></slot>
</span>
<span v-show="!invoiceEditFlag">
<slot name="content"></slot>
</span>
<span class="iconfont icon-bianji1" style="cursor: pointer" @click="CilckEdit" v-show="showTooltip"></span>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, watch } from 'vue'
const showTooltip = ref(false)
const invoiceEditFlag = ref(true)
function CilckEdit() {
invoiceEditFlag.value = !invoiceEditFlag.value
}
defineExpose({ invoiceEditFlag })
const props = defineProps({
//
label: {
type: String,
default: '',
},
})
</script>
<style lang="less" scoped >
.invoiceNo {
font-size: 12px;
display: flex;
width: 100%;
}
</style>

@ -74,11 +74,55 @@
</a-button> </a-button>
</div> </div>
</div> </div>
<div class="content">
<div class="left">
<div class="left-top">
<div class="left-top-item">
<editCompent ref="editCompentRef" label="发票币别:">
<template #text>
<span> {{ form.currency }}</span>
</template>
<template #content>
<a-select size="small" v-model:value="form.currency" style="width: 100%" >
<a-select-option :key="index" v-for="(item,index) in currencyList" :value="item.codeName">{{item.description}}</a-select-option>
</a-select>
</template>
</editCompent>
</div>
<div class="left-top-item">
<editCompent ref="editCompentRef" label="发票币别:">
<template #text>
<span> {{ form.currency }}</span>
</template>
<template #content>
<a-select size="small" v-model:value="form.invoiceNO" style="width: 100%" >
<a-select-option :key="index" v-for="(item,index) in currencyList" :value="item.codeName">{{item.description}}</a-select-option>
</a-select>
</template>
</editCompent>
</div>
<div class="left-top-item">
<editCompent ref="editCompentRef" label="发票币别:">
<template #text>
<span> {{ form.currency }}</span>
</template>
<template #content>
<a-select size="small" v-model:value="form.invoiceNO" style="width: 100%" >
<a-select-option :key="index" v-for="(item,index) in currencyList" :value="item.codeName">{{item.description}}</a-select-option>
</a-select>
</template>
</editCompent>
</div>
</div>
</div>
</div>
</a-spin> </a-spin>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, watch } from 'vue' import { ref, onMounted, watch } from 'vue'
import editCompent from './editCompent.vue'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { AutoComplete } from 'ant-design-vue' import { AutoComplete } from 'ant-design-vue'
import feeTable from './feeTable.vue' import feeTable from './feeTable.vue'
@ -108,7 +152,28 @@ const route = useRoute()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const id = ref(route.query.id) const id = ref(route.query.id)
const loading = ref(false) const loading = ref(false)
const invoiceNO = ref('')
const editCompentRef = ref()
const form = ref({}) as any
const currencyList = ref([]) as any
onMounted(() => {
GetFeeCurrencySelectList().then(res => {
currencyList.value = res.data
})
})
function handleBlur() {
editCompentRef.value.invoiceEditFlag = true
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.infoclientBox { .infoclientBox {
display: flex; display: flex;
@ -138,4 +203,20 @@ const loading = ref(false)
padding-right: 20px; padding-right: 20px;
margin-right: 20px; margin-right: 20px;
} }
.content {
.left {
background-color: #fffbf7;
padding: 15px 20px;
width: 60%;
.left-top{
display: flex;
width: 100%;
.left-top-item{
width: 20%;
}
}
}
}
</style> </style>

@ -5,9 +5,9 @@
<a-switch v-model:checked="queryData.logicalOperator" class="mt10" checked-value="1" un-checked-value="0" <a-switch v-model:checked="queryData.logicalOperator" class="mt10" checked-value="1" un-checked-value="0"
checked-children="或" un-checked-children="且" /> checked-children="或" un-checked-children="且" />
<div style="flex: 1"> <div style="flex: 1">
<div v-for="(item, index) in queryData.conditions" class="ds-advanced-search-item flex" :key="`f-${index}`"> <div v-for="(item, index) in queryData.groups" class="ds-advanced-search-item flex" :key="`f-${index}`">
<data :style="{ left: index == 0 ? '-30px' : '-15px' }" class="v-line" style="top: 21px"></data> <data :style="{ left: index == 0 ? '-30px' : '-15px' }" class="v-line" style="top: 21px"></data>
<data v-if="index != queryData.conditions.length - 1" class="r-line r-height" <data v-if="index != queryData.groups.length - 1" class="r-line r-height"
style="left: -15px; top: 21px"></data> style="left: -15px; top: 21px"></data>
<a-switch v-model:checked="item.logicalOperator" checked-value="1" class="mt2" un-checked-value="0" <a-switch v-model:checked="item.logicalOperator" checked-value="1" class="mt2" un-checked-value="0"
checked-children="或" un-checked-children="且" /> checked-children="或" un-checked-children="且" />
@ -38,7 +38,7 @@
<span class="iconfont icon-new_document"></span> <span class="iconfont icon-new_document"></span>
添加条件 添加条件
</a-button> </a-button>
<a-button v-if="queryData.conditions.length != 1" type="link" @click="deleteGroup(index)"> <a-button v-if="queryData.groups.length != 1" type="link" @click="deleteGroup(index)">
<span class="iconfont icon-shanchuzu"></span> <span class="iconfont icon-shanchuzu"></span>
删除整组 删除整组
</a-button> </a-button>
@ -103,12 +103,12 @@ const emit = defineEmits(['toSearch'])
const modalFlag = ref(false) const modalFlag = ref(false)
const queryData = reactive({ const queryData = reactive({
logicalOperator: '0', logicalOperator: '0',
conditions: [], groups: [],
}) })
// //
const queryOldData = reactive({ const queryOldData = reactive({
logicalOperator: '0', logicalOperator: '0',
conditions: [ groups: [
{ {
logicalOperator: '0', logicalOperator: '0',
conditions: [ conditions: [
@ -207,7 +207,7 @@ const operatorOptions = [
// //
const sourceData = { const sourceData = {
logicalOperator: '', logicalOperator: '',
conditions: '', groups: '',
} }
function filterOption(input, option) { function filterOption(input, option) {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
@ -218,12 +218,12 @@ const init = (IsApiData) => {
if (props.IsApi) { if (props.IsApi) {
const content = IsApiData ? IsApiData : {} const content = IsApiData ? IsApiData : {}
const source = JSON.parse(JSON.stringify(queryOldData)) const source = JSON.parse(JSON.stringify(queryOldData))
if (content && content?.conditions?.length) { if (content && content?.groups?.length) {
queryData.logicalOperator = content.logicalOperator queryData.logicalOperator = content.logicalOperator
queryData.conditions = content.conditions queryData.groups = content.groups
} else { } else {
queryData.logicalOperator = source.logicalOperator queryData.logicalOperator = source.logicalOperator
queryData.conditions = source.conditions queryData.groups = source.groups
} }
} else { } else {
let source = JSON.parse(JSON.stringify(queryOldData)) let source = JSON.parse(JSON.stringify(queryOldData))
@ -231,7 +231,7 @@ const init = (IsApiData) => {
source = JSON.parse(IsApiData) source = JSON.parse(IsApiData)
} }
queryData.logicalOperator = source.logicalOperator queryData.logicalOperator = source.logicalOperator
queryData.conditions = source.conditions queryData.groups = source.groups
} }
} }
@ -246,11 +246,11 @@ const changeHandle = (e, row) => {
} }
// //
const deleteItem = (index, key) => { const deleteItem = (index, key) => {
queryData.conditions[index].conditions.splice(key, 1) queryData.groups[index].conditions.splice(key, 1)
} }
// //
const addRow = (index) => { const addRow = (index) => {
queryData.conditions[index].conditions.push({ queryData.groups[index].conditions.push({
field: null, field: null,
operator: null, operator: null,
value: '', value: '',
@ -259,11 +259,11 @@ const addRow = (index) => {
} }
// //
const deleteGroup = (index) => { const deleteGroup = (index) => {
queryData.conditions.splice(index, 1) queryData.groups.splice(index, 1)
} }
// //
const addGroup = () => { const addGroup = () => {
queryData.conditions.push({ queryData.groups.push({
logicalOperator: 'and', logicalOperator: 'and',
conditions: [ conditions: [
{ {

Loading…
Cancel
Save