sunzehua 3 months ago
commit d57ef7c165

@ -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
},

@ -640,11 +640,12 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
{
field: 'etd',
label: '开船日期',
labelSlot: 'etd',
component: 'DatePicker',
rules: [{ required: true, message: '请选择开船日期' }],
dynamicDisabled: false,
defaultValue: undefined,
colProps: { span: 5 },
colProps: { className: 'edt-picker ant-col ant-col-5' },
componentProps: {
allowClear: true,
valueFormat: 'YYYY-MM-DD',
@ -680,10 +681,11 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
field: 'atd',
label: '计费日(PRICEDATE)',
component: 'DatePicker',
labelSlot: 'atd',
required: false,
dynamicDisabled: false,
// defaultValue: '',
colProps: { span: 5 },
colProps: { className: 'atd-picker ant-col ant-col-5' },
componentProps: {
allowClear: true,
valueFormat: 'YYYY-MM-DD',
@ -1995,7 +1997,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>

@ -72,7 +72,16 @@
<div style="position: relative;">
<h4>运输信息</h4>
</div>
<BasicForm class="auto" @register="registerFormR" @linkageForm="linkageForm" />
<BasicForm class="auto" @register="registerFormR" @linkageForm="linkageForm">
<!-- 开船日期 -->
<template #etd="{ model }">
<span class="week-day">{{ getWeekday(model.etd) }}</span>
</template>
<!-- 计费日 -->
<template #atd="{ model }">
<span class="week-day">{{ getWeekday(model.atd) }}</span>
</template>
</BasicForm>
</div>
</div>
</template>
@ -121,6 +130,14 @@
console.log(notifyPartyList.value)
})
}
//
const getWeekday = (dateStr) => {
if (!dateStr) return
const weekDays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
const date = new Date(dateStr)
const weekday = date.getDay()
return weekDays[weekday]
}
//
const openContactModal = () => {
twoFlag.value = true
@ -295,6 +312,28 @@
height: 102px;
}
}
.edt-picker {
.ant-form-item-label {
overflow: visible;
}
.week-day {
position: relative;
top: 23.5px;
left: 12px;
z-index: 10;
}
}
.atd-picker {
.ant-form-item-label {
overflow: visible;
}
.week-day {
position: relative;
top: 23.5px;
left: -28px;
z-index: 10;
}
}
.ant-divider-horizontal {
margin: 8px 0 8px!important;
background: #E8EBED;

@ -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">

@ -65,6 +65,16 @@ export const columns: BasicColumn[] = [
return text
},
},
{
title: '默认机构',
dataIndex: 'defaultOrgName',
width: 140,
},
{
title: '默认部门',
dataIndex: 'deptName',
width: 140,
},
{
title: '手机号',
dataIndex: 'phone',
@ -115,6 +125,38 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 4 },
},
{
field: 'defaultOrgId',
label: '默认机构',
component: 'Select',
colProps: { span: 4 },
componentProps: () => {
return {
options: orgIds.value,
resultField: 'data',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}
},
{
field: 'deptId',
label: '默认部门',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: getDeptList,
params: { orgId: null },
labelField: 'orgName',
valueField: 'id',
resultField: 'data',
immediate: false
}
},
},
]
export const formSchema: FormSchema[] = [
{
@ -325,8 +367,8 @@ export const formSchema: FormSchema[] = [
colProps: { span: 6 },
},
{
field: 'isLimitClient',
slot: 'isLimitClient',
field: 'isUseSystem',
slot: 'isUseSystem',
label: '是否允许使用本系统',
component: 'Switch',
colProps: { span: 6 },

@ -77,13 +77,14 @@
showTableSetting: true,
bordered: true,
showIndexColumn: true,
canResize: false,
canResize: true,
resizeHeightOffset: 15,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
fixed: 'right'
}
})
function handleCreate() {

Loading…
Cancel
Save