|
@@ -19,7 +19,7 @@
|
|
|
<script setup>
|
|
|
import { ref, defineProps, toRef, defineEmits, watch } from 'vue';
|
|
|
import { Message } from '@arco-design/web-vue';
|
|
|
-import { ReturntheCard,TariffOrderCard } from '@/api/path/order'
|
|
|
+import { ReturntheCard, TariffOrderCard } from '@/api/path/order'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
const { t } = useI18n();
|
|
|
const props = defineProps({
|
|
@@ -28,14 +28,13 @@ const props = defineProps({
|
|
|
default: false
|
|
|
},
|
|
|
ReturnData: [Array, Object],
|
|
|
- id: String,
|
|
|
})
|
|
|
const modelValue = toRef(props, 'modelValue')
|
|
|
const emit = defineEmits(['update:modelValue', 'submit'])
|
|
|
const selectedKeys = ref([])
|
|
|
const inputValue = ref()
|
|
|
const form = ref({})
|
|
|
-const columns = [{ title: 'ICCID', dataIndex: 'iccid' }, { title: t('order.CardStatus'), dataIndex: 'status' }, { title: t('order.CreationTime'), dataIndex: 'expireTime' }]
|
|
|
+const columns = [{ title: 'ICCID', dataIndex: 'iccid' }, { title: t('order.CardStatus'), dataIndex: 'iccidStatus' }, { title: t('order.CreationTime'), dataIndex: 'expireTime' }]
|
|
|
const data = ref()
|
|
|
const rowSelection = ref({
|
|
|
type: 'checkbox',
|
|
@@ -51,23 +50,25 @@ const submitStatus = async () => {
|
|
|
Message.warning($t('form.pleaseSelect') + 'ICCID')
|
|
|
return
|
|
|
}
|
|
|
- await ReturntheCard({ iccids: selectedKeys.value, id: props.id })
|
|
|
- emit('update:modelValue', false)
|
|
|
- emit('submit', true)
|
|
|
- data.value = []
|
|
|
+ let res = await ReturntheCard({ iccids: selectedKeys.value, id: form.value.id })
|
|
|
+ if (res.code == 200) {
|
|
|
+ emit('update:modelValue', false)
|
|
|
+ emit('submit', true)
|
|
|
+ data.value = []
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const getDetaileICCID = async (traaid) => {
|
|
|
- const res = await TariffOrderCard({ id: traaid,iccid:inputValue.value })
|
|
|
- if(res.code==200){
|
|
|
- data.value = (res.data || []).map(res=>({ ...res, status: res.status == 1 ? t('order.normal') : t('order.unsubscribe') }))
|
|
|
- }
|
|
|
+ const res = await TariffOrderCard({ id: traaid, iccid: inputValue.value })
|
|
|
+ if (res.code == 200) {
|
|
|
+ data.value = res.data || []
|
|
|
+ }
|
|
|
}
|
|
|
watch(() => props.ReturnData, val => {
|
|
|
- if(val.id){
|
|
|
- form.value = val
|
|
|
- getDetaileICCID(val.trafficId)
|
|
|
- }
|
|
|
+ if (val.id) {
|
|
|
+ form.value = val
|
|
|
+ getDetaileICCID(val.trafficId)
|
|
|
+ }
|
|
|
}, { immediate: true })
|
|
|
</script>
|
|
|
<style scoped></style>
|