detaile.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <a-modal v-model:visible="modelValue" width="800px" title="订单详情" @cancel="cancel" @ok="showDetail = false">
  3. <div class="detail-box">
  4. <div class="detail-item-box">
  5. <div class="detail-item">
  6. <div class="item-label">订单编号</div>
  7. <div class="item-content">{{ FormDataList.id }}</div>
  8. </div>
  9. <div class="detail-item">
  10. <div class="item-label">订单状态</div>
  11. <div class="item-content">
  12. <a-tag color="#168cff" v-if="FormDataList.tmsStatus == 1">未发货</a-tag>
  13. <a-tag color="#00b42a" v-if="FormDataList.tmsStatus == 2">已发货</a-tag>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="detail-item-box">
  18. <div class="detail-item">
  19. <div class="item-label">运营商</div>
  20. <div class="item-content">{{ FormDataList.sourceName }}</div>
  21. </div>
  22. <div class="detail-item">
  23. <div class="item-label">资费信息</div>
  24. <div class="item-content">{{ TariffInfomr }}</div>
  25. </div>
  26. </div>
  27. <div class="detail-item-box">
  28. <div class="detail-item">
  29. <div class="item-label">最短订阅周期</div>
  30. <div class="item-content">{{ tariffForm.settlementCycle?.split('~')[0] }}个月</div>
  31. </div>
  32. <div class="detail-item">
  33. <div class="item-label">最长订阅周期</div>
  34. <div class="item-content">{{ tariffForm.settlementCycle?.split('~')[1] }}个月</div>
  35. </div>
  36. </div>
  37. <div class="detail-item-box">
  38. <div class="detail-item">
  39. <div class="item-label">计费方式</div>
  40. <div class="item-content">{{ tariffForm.billingMethodName }}</div>
  41. </div>
  42. <div class="detail-item">
  43. <div class="item-label">结算周期</div>
  44. <div class="item-content">{{ tariffForm.billingcycleName }}</div>
  45. </div>
  46. </div>
  47. <div class="detail-item-box">
  48. <div class="detail-item">
  49. <div class="item-label">卡类型</div>
  50. <div class="item-content">{{ FormDataList.CardType }}</div>
  51. </div>
  52. <div class="detail-item">
  53. <div class="item-label">标准价格</div>
  54. <div class="item-content">{{ tariffForm.pricingName }}</div>
  55. </div>
  56. </div>
  57. <div class="detail-item-box">
  58. <div class="detail-item">
  59. <div class="item-label">流量池</div>
  60. <div class="item-content">{{ FormDataList.isTrafficPool == 1 ? '是' : '否' }}</div>
  61. </div>
  62. </div>
  63. <div class="detail-item-box">
  64. <div class="detail-item">
  65. <div class="item-label">卡数量</div>
  66. <div class="item-content">10000
  67. <a-button type="primary" @click="showCard = true" style="margin-left:10px;"
  68. v-if="userType == 1 && FormDataList.moderationStatus == 2">分配卡号</a-button>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="detail-table">
  74. <a-table :columns="columnsDetail" :data="dataDetail" />
  75. </div>
  76. </a-modal>
  77. <!-- 分配卡号 -->
  78. <a-modal v-model:visible="showCard" title="分配卡号" @cancel="closeModal(showCard, FormDataList)"
  79. @before-ok="showCard = false" okText="确认" cancelText="取消">
  80. <Upload listType="" minx="9999" accept=".xlsx" :handelUpload="customRequest">
  81. </Upload>
  82. </a-modal>
  83. </template>
  84. <script setup>
  85. import { ref, onMounted, toRefs, toRef ,watch} from 'vue';
  86. import { AcquireOrdertariff, DistributionCard } from '@/api/path/order'
  87. import { Message } from '@arco-design/web-vue';
  88. import Upload from "@/components/upload/index.vue";
  89. import { Getdictionary } from '@/mixins/index.js'
  90. const props = defineProps({
  91. modelValue: {
  92. type: Boolean,
  93. default: false
  94. },
  95. FormDataList: {
  96. type: Object,
  97. default: () => ({})
  98. }
  99. })
  100. const modelValue = toRef(props, 'modelValue')
  101. const FormDataList = toRef(props, 'FormDataList')
  102. const emit = defineEmits(['update:modelValue', 'submit'])
  103. const state = ref({
  104. tariffForm: {},
  105. showCard: false,
  106. res1:[],
  107. res2:[],
  108. res3:[],
  109. userType: JSON.parse(localStorage.getItem('user_login_information'))?.userType, // 1平台 2用户
  110. })
  111. const { tariffForm, showCard,res1,res2,res3,userType } = toRefs(state.value)
  112. const columnsDetail = [{ title: 'ICCID', dataIndex: 'iccid' }
  113. ]
  114. const dataDetail = ref([{
  115. iccid: '8986061800002054589N',
  116. nameAndId: '泰国监控40G共享/53357981207',
  117. status: '沉默期'
  118. },
  119. {
  120. iccid: '8986061800002054588N',
  121. nameAndId: '泰国监控40G共享/53357981207',
  122. status: '沉默期'
  123. }, {
  124. iccid: '8986061800002054587N',
  125. nameAndId: '泰国监控40G共享/53357981207',
  126. status: '沉默期'
  127. }, {
  128. iccid: '8986061800002054586N',
  129. nameAndId: '泰国监控40G共享/53357981207',
  130. status: '沉默期'
  131. },])
  132. // 分配卡号
  133. const customRequest = (options) => {
  134. const formData = new FormData();
  135. formData.append('file', options.fileItem.file); // 这里将文件添加到 FormDataList 中
  136. formData.append('orderId', FormDataList.value.id);
  137. DistributionCard(formData).then(res => {
  138. Message.success(res.message)
  139. })
  140. }
  141. const cancel = () => {
  142. emit('update:modelValue', false)
  143. }
  144. watch(() => FormDataList.value, val => {
  145. if (Object.keys(val).length === 0) return
  146. AcquireOrdertariff({ id: val.trafficId }).then(res => {
  147. tariffForm.value = res.data
  148. tariffForm.value.billingcycleName = res1.value.filter(val => val.value == res.data.billingCycle)[0]?.label;
  149. tariffForm.value.billingMethodName = res2.value.filter(val => val.value == res.data.billingMethod)[0]?.label;
  150. tariffForm.value.TariffInfomr = res.data.trafficBilling + '/' + res.data.trafficBillingType
  151. tariffForm.value.pricingName = tariffForm.value.pricing !== '' ? tariffForm.value.pricing + '/' + res3.value.filter(val => val.value == res.data.currency)[0]?.label : '';
  152. })
  153. },{deep: true})
  154. onMounted(async () => {
  155. res1.value = await Getdictionary('Billingcycle')
  156. res2.value = await Getdictionary('billingMethod')
  157. res3.value = await Getdictionary('currencyType')
  158. })
  159. </script>
  160. <style scoped lang="less">
  161. .detail-box {
  162. .detail-item-box {
  163. display: flex;
  164. justify-content: space-between;
  165. align-items: center;
  166. margin-bottom: 10px;
  167. .detail-item {
  168. //styleName: Body/Medium;
  169. font-family: PingFang SC;
  170. font-size: 14px;
  171. font-weight: 400;
  172. line-height: 22px;
  173. text-align: left;
  174. display: flex;
  175. align-items: center;
  176. min-width: 350px;
  177. .item-label {
  178. color: rgba(0, 0, 0, 0.4);
  179. width: 120px;
  180. text-align: right;
  181. margin-right: 10px;
  182. }
  183. .item-content {
  184. color: rgba(51, 51, 51, 1);
  185. }
  186. }
  187. }
  188. }
  189. </style>