费用录入组件优化单位联动

feature-JimuReport-1106-yjl
lijingjia 1 month ago
parent e3f7816c46
commit 193c264f11

@ -47,7 +47,7 @@
defineComponent,
onMounted,
nextTick,
provide,
provide
} from 'vue'
//
import { GetFeeCurrencySelectList, GetFeeCodeSelectList, GetClientSelectInfoByCode, GetUnitSelectInfo } from '/@/api/common'
@ -57,8 +57,6 @@
//
import ActionBar from './actionBar.vue'
import { feeStatusList } from './columns'
//
import { feeUnitDict } from '/@/hooks/dict/index'
import { GetList, SubmitFee, DeleteFee, ApplyAudit, Withdraw, SubmitWithAudit } from './api'
//
import { GetClientListByCode } from '/@/api/common'
@ -105,18 +103,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 getUnitList = () => {
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.ctnCode, name: item.ctn }
})
}
unitDict.value = [...b, ...res]
})
}
getUnitList()
//
const currencyDict = ref([])
//
@ -204,7 +206,7 @@
return item.value + '-' + item.name
})
process(dict)
},
}
},
{
title: '结算对象',
@ -213,10 +215,7 @@
type: 'dropdown',
source: async (query, process) => {
if (query && query.indexOf('~') > -1) query = query.split('~')[1]
//
const rowIndex = hotTb.value.hotInstance.getActiveEditor().row
const code = list.value[rowIndex]?.customerType || null
GetClientListByCode({ code, queryKey: query }).then((res) => {
GetClientListByCode({ queryKey: query }).then((res) => {
const { data } = res
data.forEach((item) => {
item['label'] = item.shortName
@ -230,7 +229,7 @@
console.log(dict)
process(dict)
})
},
}
},
{
title: '单位标准',
@ -597,7 +596,6 @@
const item = companyDict.value.filter((item) => {
return changes[0][3].includes(item.label)
})
console.log(item)
if (item) dict = item[0]
console.log(dict)
list.value[changes[0][0]]['customerId'] = dict?.id
@ -629,7 +627,7 @@
})
if (item) dict = item[0]
list.value[changes[0][0]]['unit'] = dict?.value
list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[1]
list.value[changes[0][0]]['unitText'] = changes[0][3].split('-')[0]
GetUnitSelectInfo({ code: dict?.value, businessId: props.id, businessType: props.type }).then(res => {
list.value[changes[0][0]]['quantity'] = res.data.quantity
})
@ -741,9 +739,9 @@
SubmitFee(postData)
.then((res) => {
loading.value = false
init()
//
emits('refreshStatic')
init()
if (!b) createMessage.success(res.message)
})
.catch(() => {
@ -1089,7 +1087,8 @@
}
)
defineExpose({
allSave
allSave,
getUnitList
})
</script>

@ -18,6 +18,7 @@
:id="details.id"
:details="details"
@broInsert="broReceive"
@refreshStatic="refreshStatic"
@allBillSubmit="allBillSubmit"
></FeeTable>
</div>
@ -40,7 +41,7 @@
</div>
</template>
<script lang="ts" setup>
import { defineProps, ref, watch, computed, unref } from 'vue'
import { defineProps, ref, watch, defineExpose } from 'vue'
//
import MainInfo from './mainInfo.vue'
//
@ -89,6 +90,10 @@
}, 1000)
})
}
const getUnitList = () => {
rtb.value.getUnitList()
ptb.value.getUnitList()
}
watch(
() => props.details,
(val) => {
@ -96,6 +101,9 @@
},
{ immediate: true, deep: true }
)
defineExpose({
getUnitList
})
</script>
<style scoped>

@ -99,10 +99,7 @@
function handleSubmitCopyMore() {
const select = props.selectRow()
if (copyMoreForm.number === 1) {
SeaExportCopy({ id: select[0].id }).then((res) => {
createMessage.success('复制成功')
go(`/BookingDetail?id=${res.data}&source=copy`)
})
go(`/BookingDetail?id=${select[0].id}&source=copy`)
copyMoreFlag.value = false
return
}

@ -90,7 +90,7 @@
<ediMore ref="RefediMore" :details="bookingDetails"></ediMore>
</a-tab-pane>
<a-tab-pane key="5-5" tab="应收应付费用" v-if="id">
<costEntry :height="feeHeight" :details="bookingDetails" type="1" style="margin-bottom: 20px;"></costEntry>
<costEntry ref="costManage" :height="feeHeight" :details="bookingDetails" type="1" style="margin-bottom: 20px;"></costEntry>
</a-tab-pane>
</a-tabs>
<ApproveBtns
@ -107,10 +107,10 @@
{{ completeText }}
</a-button>
<a-button class="ml10" v-repeat v-if="route.query.status == 'RETURN_CABIN_POOL' && route.query.source != 'Complete'" @click="save('cjtc')" type="primary">
创建退舱任务
直接退舱
</a-button>
<a-button class="ml10" v-repeat v-if="route.query.status == 'RETURN_CABIN_POOL' && route.query.source != 'Complete'" @click="save('ctrc')" type="primary">
退出入
转舱位
</a-button>
</span>
</ApproveBtns>
@ -245,6 +245,7 @@
const RefediMore = ref(null)
const RefNoteInfo = ref(null)
const mainOrderActiveKey = ref('1-1')
const costManage = ref(null)
watch(
() => mainOrderActiveKey.value,
(v) => {
@ -253,6 +254,7 @@
RefrightContent.value.flag = true
}
if (v == '5-5') {
if (costManage.value) costManage.value.getUnitList()
OtherInfo.value.flag = false
RefrightContent.value.flag = false
}
@ -430,8 +432,11 @@
bookingRemark: null,
contractNo: null,
mblno: null,
hblno: null
hblno: null,
ctnInfo: [],
ctnPriceInfo: []
}
id.value = null
}
// permission
getFormSet(res.data.businessStatus)
@ -444,6 +449,7 @@
res.data.stlDate = res.data.stlDate.split(' ')[0]
}
bookingDetails.value = res.data
console.log(bookingDetails.value)
//
inPageLoading.value = false
})
@ -1030,7 +1036,6 @@
RefgoodsTable.value.loadingTable = false
})
}
function changeCtnInfoFun({ type, val }) {
if (type === 'kindpkgs') {
bookingDetails.value.kindpkgs = val

Loading…
Cancel
Save