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