费用审核逻辑迭代

szh-new
lijingjia 3 months ago
parent dba857dc59
commit 6b5f78ae3e

@ -40,11 +40,8 @@
ref,
watch,
watchEffect,
computed,
unref,
defineComponent,
onMounted,
reactive,
nextTick,
provide,
} from 'vue'
@ -62,6 +59,8 @@
//
import { GetClientListByCode } from '/@/api/common'
import { useMessage } from '/@/hooks/web/useMessage'
//
import { getDictOption } from '/@/utils/dictUtil'
const { createMessage } = useMessage()
defineComponent({
HotTable,
@ -100,12 +99,22 @@
const feeDict = ref([])
//
const unitDict = ref([])
getDictOption('fee_unit').then(res => {
let b = []
if (props.details.ctnInfo && props.details.ctnInfo.length) {
const a = props.details.ctnInfo.filter(item => {
return item.ctn
})
b = a.map(item => {
return { label: item.ctn, value: item.ctn, name: item.ctnCode }
})
}
unitDict.value = [...b, ...res]
})
//
const currencyDict = ref([])
//
const companyDict = ref([])
//
import { getDictOption } from '/@/utils/dictUtil'
//
const hotTb = ref(null)
// loading
@ -237,13 +246,6 @@
return item.value + '-' + item.name
})
process(dict)
} else {
const results = await feeUnitDict()
unitDict.value = results
const dict = results.map((item) => {
return item.value + '-' + item.name
})
process(dict)
}
},
},
@ -468,29 +470,63 @@
//
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict = {}
changes.forEach((res) => {
//
if (res[1] === 'feeName') {
if (changes.length == 1) {
//
if (changes[0][1] === 'feeName') {
// ()
//
const item = feeDict.value.filter((item) => {
return changes[0][3].includes(item.name)
})
if (item) dict = item[0]
list.value[res[0]]['feeName'] = changes[0][3].split('-')[1]
list.value[res[0]]['feeEnName'] = dict['enName']
list.value[res[0]]['currency'] = dict['defaultCurrency']
list.value[res[0]]['unitText'] = dict['defaultUnitName']
list.value[res[0]]['unit'] = dict['defaultUnit']
list.value[res[0]]['customerTypeText'] = dict['defaultDebitName']
list.value[res[0]]['customerType'] = dict['defaultDebit']
list.value[res[0]]['isOpen'] = dict['isOpen']
list.value[res[0]]['isAdvancedPay'] = dict['isAdvancedPay']
list.value[res[0]]['isInvoice'] = dict['isInvoice']
list.value[res[0]]['feeFrt'] = dict['feeFrt']
list.value[res[0]]['feeCode'] = dict['code']
list.value[res[0]]['taxRate'] = dict['taxRate']
list.value[changes[0][0]]['feeName'] = changes[0][3].split('-')[1]
list.value[changes[0][0]]['feeEnName'] = dict['enName']
list.value[changes[0][0]]['currency'] = dict['defaultCurrency']
list.value[changes[0][0]]['customerTypeText'] = dict['defaultDebitName']
list.value[changes[0][0]]['customerType'] = dict['defaultDebit']
list.value[changes[0][0]]['isOpen'] = dict['isOpen']
list.value[changes[0][0]]['isAdvancedPay'] = dict['isAdvancedPay']
list.value[changes[0][0]]['isInvoice'] = dict['isInvoice']
list.value[changes[0][0]]['feeFrt'] = dict['feeFrt']
list.value[changes[0][0]]['feeCode'] = dict['code']
list.value[changes[0][0]]['taxRate'] = dict['taxRate']
//
if (dict.defaultUnit == 'XX') {
if (props?.details?.ctnInfo && props?.details?.ctnInfo?.length) {
list.value[changes[0][0]]['unitText'] = props.details.ctnInfo[0].ctn
list.value[changes[0][0]]['unit'] = props.details.ctnInfo[0].ctnCode
list.value[changes[0][0]]['quantity'] = props.details.ctnInfo[0].ctnNum
}
} else {
list.value[changes[0][0]]['unitText'] = dict['defaultUnitName']
list.value[changes[0][0]]['unit'] = dict['defaultUnit']
//
const uItem = unitDict.value.filter((item) => {
return list.value[changes[0][0]]['unitText'].includes(item.name)
})
if (uItem) dict = uItem[0]
if (dict && dict?.value) {
GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['quantity'] = res.data.quantity
})
}
}
//
getDictOption('djy_cust_prop').then((res) => {
const item = res.filter((item) => {
return list.value[changes[0][0]]['customerTypeText'].includes(item.name)
})
if (item) dict = item[0]
if (dict.value) {
//
GetClientSelectInfoByCode({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['customerCode'] = res.data.clientId
list.value[changes[0][0]]['customerName'] = res.data.clientName
})
}
})
}
})
}
//
if (changes[0][1] === 'feeEnName') {
}
@ -513,11 +549,12 @@
list.value[changes[0][0]]['customerType'] = dict?.value
list.value[changes[0][0]]['customerTypeText'] = changes[0][3].split('-')[1]
//
console.log(props.details)
GetClientSelectInfoByCode({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['customerCode'] = res.data.clientId
list.value[changes[0][0]]['customerName'] = res.data.clientName
})
if (dict && dict.value) {
GetClientSelectInfoByCode({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['customerCode'] = res.data.clientId
list.value[changes[0][0]]['customerName'] = res.data.clientName
})
}
})
}
//
@ -700,7 +737,7 @@
})
}
//
const selectInsert = (v) => {
const selectInsert = async (v) => {
const selectData = JSON.parse(JSON.stringify(list.value))
//
if (v === 1) {
@ -720,6 +757,36 @@
const res = selectData.filter((item) => {
return item.selected
})
//
const feeList = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
res.forEach(data => {
const item = feeList.filter((item) => {
return item.name == data.feeName
})
//
if (item && item.length) {
//
if (data.customerTypeText == item[0].defaultCreditName) {
data.customerTypeText = item[0].defaultDebitName
data.customerType = item[0].defaultDebit
}
//
if (data.customerTypeText == item[0].defaultDebitName) {
data.customerTypeText = item[0].defaultCreditName
data.customerType = item[0].defaultCredit
}
//
if (data && data.customerType) {
GetClientSelectInfoByCode({ code: data.customerType, businessId: props.id, businessType: props.type }).then(res => {
data.customerCode = res.data.clientId
data.customerName = res.data.clientName
})
} else {
data.customerCode = ''
data.customerName = ''
}
}
})
emits('broInsert', res)
} else {
//
@ -734,7 +801,6 @@
item.feeType = 1
}
})
console.log(selectData)
emits('broInsert', selectData)
}
}

@ -11,6 +11,10 @@ import { getDictOption } from '/@/utils/dictUtil'
import { GetFeeCurrencySelectList } from '/@/api/common'
// 引入计费标准字典
import { feeUnitDict } from '/@/hooks/dict/index'
const unitDict = ref([])
getDictOption('fee_unit').then(res => {
unitDict.value = res
})
// 客户类别下拉框数据
const customTypeDict = ref([])
// 付费方式字典
@ -214,14 +218,17 @@ export const formSchema: FormSchema[] = [
field: 'defaultUnit',
label: '默认计费标准',
defaultValue: '',
component: 'ApiSelect',
component: 'Select',
colProps: { span: 8 },
componentProps: ({ formModel }) => {
return {
api: feeUnitDict,
labelField: 'name',
valueField: 'value',
resultField: 'data',
options: unitDict,
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
getPopupContainer: () => document.body,
onChange: (v, obj) => {
formModel.defaultUnitName = obj?.label || ''
}
@ -252,6 +259,7 @@ export const formSchema: FormSchema[] = [
labelField: 'label',
valueField: 'value',
resultField: 'data',
getPopupContainer: () => document.body,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},

@ -1995,7 +1995,7 @@ export const cargoInfoFormSchema4: FormSchema[] = [
slot: 'ctnPriceInfo',
component: 'Input',
required: false,
defaultValue: [{}],
defaultValue: [{ guidePrice: 0, floorPrice: 0 }],
colProps: { span: 24 },
},
{

@ -74,7 +74,7 @@
<a-input-number v-model:value="item.floorPrice" size="small" :min="0" :max="999999999" placeholder="底价" />
</div>
<span v-show="model.ctnPriceInfo.length > 1" @click="deleteCtnPrice(model.ctnPriceInfo, index, item)" class="iconfont icon-del"></span>
<span v-show="model.ctnPriceInfo.length != 3" @click="model.ctnPriceInfo.push({})" class="iconfont icon-zengjiatianjiajiajian"></span>
<span v-show="model.ctnPriceInfo.length != 3" @click="model.ctnPriceInfo.push({ guidePrice: 0, floorPrice: 0 })" class="iconfont icon-zengjiatianjiajiajian"></span>
</div>
</div>
</a-form-item-rest>

@ -81,11 +81,11 @@
/>
<span class="s-txt" :class="{ 's-active': model.isDispatcher }">{{ model.isDispatcher ? '是' : '否'}}</span>
</template>
<template #isLimitClient="{ model }">
<template #isUseSystem="{ model }">
<a-switch
v-model:checked="model.isLimitClient"
v-model:checked="model.isUseSystem"
/>
<span class="s-txt" :class="{ 's-active': model.isLimitClient }">{{ model.isLimitClient ? '是' : '否'}}</span>
<span class="s-txt" :class="{ 's-active': model.isUseSystem }">{{ model.isUseSystem ? '是' : '否'}}</span>
</template>
<template #signatureUrl>
<DsFile :maxCount="1" ref="dsFile" :id="rowId" :show="false" height="300">

@ -325,8 +325,8 @@ export const formSchema: FormSchema[] = [
colProps: { span: 6 },
},
{
field: 'isLimitClient',
slot: 'isLimitClient',
field: 'isUseSystem',
slot: 'isUseSystem',
label: '是否允许使用本系统',
component: 'Switch',
colProps: { span: 6 },

Loading…
Cancel
Save