status.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <a-modal v-model:visible="modelValue" width="800px" :title="$t('order.examine')" @cancel="cancel" @ok="submitStatus"
  3. :okText="$t('form.Confirm')" :cancelText="$t('form.Cancel')">
  4. <a-form :model="formStatus" :style="{ width: '600px' }">
  5. <a-form-item :label="$t('lotCard.userName')">
  6. {{ FormDataList.userName }}
  7. </a-form-item>
  8. <a-form-item :label="$t('order.OrderNum')">
  9. {{ FormDataList.id }}
  10. </a-form-item>
  11. <a-form-item label="套餐计划名称">
  12. {{ FormDataList.terminalName }}
  13. </a-form-item>
  14. <a-form-item :label="$t('order.AuditOpinion')">
  15. <a-radio-group v-model="formStatus.moderationStatus" :options="optionsStatus">
  16. <template #label="{ data }">
  17. <a-tag>{{ data.label }}</a-tag>
  18. </template>
  19. </a-radio-group>
  20. </a-form-item>
  21. <a-form-item :label="$t('lotCard.remark')">
  22. <a-textarea :placeholder="$t('form.datapoolForm.pleaseSelect')+$t('lotCard.remark')" v-model:model-value="formStatus.moderationNotes" allow-clear />
  23. </a-form-item>
  24. </a-form>
  25. </a-modal>
  26. </template>
  27. <script setup>
  28. import { ref, onMounted, toRefs, defineProps, toRef, defineEmits } from 'vue';
  29. import { OrderCardStatus } from '@/api/path/order'
  30. import { Message } from '@arco-design/web-vue';
  31. import {useI18n} from 'vue-i18n'
  32. const {t} = useI18n();
  33. const props = defineProps({
  34. modelValue: {
  35. type: Boolean,
  36. default: false
  37. },
  38. FormDataList: {
  39. type: Object,
  40. default: () => ({})
  41. }
  42. })
  43. const modelValue = toRef(props, 'modelValue')
  44. const FormDataList = toRef(props, 'FormDataList')
  45. const emit = defineEmits(['update:modelValue', 'submit'])
  46. const state = ref({
  47. formStatus: {
  48. id: null,
  49. moderationStatus: '', // 审核状态
  50. moderationNotes: '', // 审核备注
  51. },
  52. optionsStatus: [
  53. { label: t('order.PassTheExamination'), value: '2' },
  54. { label: t('order.TurnDown'), value: '3' },
  55. ],
  56. })
  57. const { formStatus ,optionsStatus} = toRefs(state.value)
  58. // 订单审核
  59. const submitStatus = async () => {
  60. new Promise((resolve, reject) => {
  61. formStatus.value.id = FormDataList.value.id
  62. OrderCardStatus(formStatus.value).then(res => {
  63. Message.success(res.message)
  64. emit('update:modelValue', false)
  65. emit('submit', true)
  66. }).catch(error => [
  67. reject(error)
  68. ])
  69. })
  70. }
  71. const cancel = ()=>{
  72. emit('update:modelValue', false)
  73. Object.keys(formStatus.value).forEach(key => {
  74. formStatus.value[key] = ''
  75. })
  76. }
  77. </script>
  78. <style scoped></style>