费用录入主单信息

szh-new
lijingjia 7 months ago
parent 25abfb9c39
commit 0af8d243d7

@ -5,61 +5,36 @@
-->
<template>
<div>
<div></div>
<div>
<!-- 主单信息组件 -->
<MainInfo :data="details"></MainInfo>
</div>
<div></div>
<div></div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, watchEffect, computed, unref } from 'vue'
const props = {
value: { type: [Object, Number, String, Array] },
count: { type: Number, default: 60 },
beforeStartFunc: {
type: Function as PropType<() => Promise<boolean>>,
default: null,
},
}
export default defineComponent({
name: 'CostEntry',
components: { Button },
props,
setup(props) {
const loading = ref(false)
const { currentCount, isStart, start, reset } = useCountdown(props.count)
const { t } = useI18n()
const getButtonText = computed(() => {
return !unref(isStart)
? t('component.countdown.normalText')
: t('component.countdown.sendText', [unref(currentCount)])
})
watchEffect(() => {
props.value === undefined && reset()
})
/**
* @description: Judge whether there is an external function before execution, and decide whether to start after execution
*/
async function handleStart() {
const { beforeStartFunc } = props
if (beforeStartFunc && isFunction(beforeStartFunc)) {
loading.value = true
try {
const canStart = await beforeStartFunc()
canStart && start()
} finally {
loading.value = false
}
} else {
start()
}
}
return { handleStart, currentCount, loading, getButtonText, isStart }
},
<script lang="ts" setup>
import { defineProps, ref, watch, computed, unref } from 'vue'
//
import MainInfo from './mainInfo.vue'
defineProps({
details: { type: [Object, Array] }
})
// watch(
// () => props.details,
// (nval, oval) => {
// console.log(nval, 222222)
// }
// )
// export default defineComponent({
// name: 'CostEntry',
// props,
// setup(props) {
// console.log(props, 222)
// watchEffect(() => {
// console.log(props.details)
// })
// }
// })
</script>

@ -0,0 +1,18 @@
<!--
* @Description: 费用录入布局组件
* @Author: lijj
* @Date: 2024-05-07 15:19:07
-->
<template>
<div>
222
</div>
</template>
<script lang="ts" setup>
import { defineProps, ref, watch, computed, unref } from 'vue'
const props = defineProps({
data: { type: [Object, Array] }
})
console.log(props, 222)
</script>

@ -48,7 +48,7 @@
<input type="radio" name="tabs" id="tab4" checked="false" />
<label class="tabs-label" for="tab4">MASTER单信息</label>
</li>
<li @click="changeParentTabs('5-5')">
<li @click="changeParentTabs('5-5')" v-if="$route.query.id">
<input type="radio" name="tabs" id="tab5" checked="false" />
<label class="tabs-label" for="tab5">费用录入</label>
</li>
@ -140,7 +140,10 @@
></mastetMore>
</div>
<div id="tab-content5" class="tab-content" v-show="mainOrderActiveKey === '5-5'">
<costEntry></costEntry>
<costEntry
v-if="$route.query.id"
:details="bookingDetails"
></costEntry>
<!-- <mastetMore
ref="RefmastetMore"
class="pane-box"

Loading…
Cancel
Save