index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <!-- 流量池 -->
  2. <template>
  3. <div class="container">
  4. <div class="head-title">
  5. <span>{{ route.meta.title }} </span>
  6. <span class="head-title-right">
  7. <a-popconfirm :content="$t('lotCard.confirmTitleCancelOrder')" :ok-text="$t('form.Confirm')"
  8. :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
  9. <a-button type="primary">{{ $t('lotCard.titleCancelOrder') }}</a-button>
  10. </a-popconfirm>
  11. </span>
  12. </div>
  13. <!-- 搜索条件区 -->
  14. <div class="search-section">
  15. <a-form :model="searchForm" layout="inline">
  16. <a-form-item field="label" :label="$t('flowPool.label')">
  17. <a-input v-model="searchForm.label" :placeholder="$t('lotCard.please') + $t('flowPool.label')"
  18. allow-clear />
  19. </a-form-item>
  20. <a-form-item>
  21. <a-space>
  22. <a-button type="primary" @click="handleSearch">{{ $t('form.Search') }}</a-button>
  23. <a-button @click="resetSearch">{{ $t('form.Reset') }}</a-button>
  24. </a-space>
  25. </a-form-item>
  26. </a-form>
  27. </div>
  28. <div class="audit-btn">
  29. <a-button @click="dictShowModel(1, null)" type="text">
  30. <template #icon>
  31. <icon-plus-circle />
  32. </template>
  33. <template #default>
  34. {{ $t('form.Add') }}
  35. </template>
  36. </a-button>
  37. </div>
  38. <a-table row-key="id" :data="dataSource" :columns="columns" :pagination="pagination"
  39. :rowSelection="rowSelection" v-model:selected-keys="selectedKeys" :scroll="{ x: 'auto' }">
  40. <template #id="{ record }">
  41. <!-- 修改 -->
  42. <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(2, record)">{{
  43. $t('form.Edit') }}</a>
  44. <!-- 取消订单-退订 -->
  45. <a-popconfirm :content="$t('lotCard.confirmTitleCancelOrder')" :ok-text="$t('form.Confirm')"
  46. :cancel-text="$t('form.Cancel')" @ok="handleUnsubscribeDialog(record)">
  47. <a class="a-link" href="javascript:;" style="margin-right: 1rem">{{ $t('lotCard.titleCancelOrder')
  48. }}</a>
  49. </a-popconfirm>
  50. <!-- 删除 -->
  51. <a-popconfirm :content="$t('form.Delete')" :ok-text="$t('form.Confirm')"
  52. :cancel-text="$t('form.Cancel')" @ok="handleDel(record.id)">
  53. <a class="a-link" href="javascript:;" style="margin-right: 1rem">{{ $t('form.Delete')
  54. }}</a>
  55. </a-popconfirm>
  56. <!-- 导卡 -->
  57. <a class="a-link" href="javascript:;" style="margin-right: 1rem" @click="dictShowModel(3, record)">{{
  58. $t('flowPool.exportCard') }}</a>
  59. </template>
  60. </a-table>
  61. <!-- 新增弹框 -->
  62. <a-modal :title="typeCurrent == 1 ? $t('form.Add') : typeCurrent == 2 ? $t('form.Edit') : $t('flowPool.Detail')"
  63. v-model:visible="visible" @onCancel="resetForm" centered :maskClosable="false" :footer="null" width="55%">
  64. <a-tabs v-model:active-key="activeKey">
  65. <a-tab-pane key="1" :title="$t('flowPool.infoTabs')">
  66. <a-form ref="formRef" :rules="rules" :model="formState" @submit="handleSubmit"
  67. style="width: 620px;">
  68. <a-form-item :label="$t('flowPool.label')" field="label">
  69. <a-input v-model="formState.label"
  70. :placeholder="$t('form.PleaseEnterThe') + $t('flowPool.label')" />
  71. </a-form-item>
  72. <a-form-item :label="$t('flowPool.source')" field="source">
  73. <a-select v-model="formState.source"
  74. :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.source')">
  75. <a-option v-for=" item in sourceList" :key="item.id" :value="item.value">{{ item.label
  76. }}</a-option>
  77. </a-select>
  78. </a-form-item>
  79. <a-form-item :label="$t('flowPool.trafficPoolStatus')" field="status">
  80. <a-select v-model="formState.status"
  81. :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolStatus')">
  82. <a-option v-for=" item in trafficList" :key="item.id" :value="item.value">{{ item.label
  83. }}</a-option>
  84. </a-select>
  85. </a-form-item>
  86. <!-- <a-form-item :label="$t('flowPool.trafficPoolType')" field="traffic_pool_type">
  87. <a-select v-model="formState.traffic_pool_type" disabled
  88. :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.trafficPoolType')">
  89. <a-option v-for=" item in typeList" :key="item.id" :value="item.value">{{ item.label
  90. }}</a-option>
  91. </a-select>
  92. </a-form-item> -->
  93. <a-form-item :label="$t('flowPool.simRariff')" field="sim_tariff_id">
  94. <a-select v-model="formState.sim_tariff_id"
  95. :placeholder="$t('form.cardForm.pleaseSelect') + $t('flowPool.simRariff')">
  96. <a-option v-for=" item in tariffIdList" :key="item.id" :value="item.value">{{ item.label
  97. }}</a-option>
  98. </a-select>
  99. </a-form-item>
  100. <a-form-item :label="$t('flowPool.expireTime')" field="expire_time">
  101. <a-date-picker v-model="formState.expire_time" show-time
  102. :time-picker-props="{ defaultValue: '09:09:06' }" format="YYYY-MM-DD HH:mm:ss" />
  103. </a-form-item>
  104. <a-form-item>
  105. <a-button type="primary" html-type="submit" style="margin-right: 10px;">{{
  106. $t('form.Confirm')
  107. }}</a-button>
  108. <a-button @click="resetForm">{{ $t('form.Cancel') }}</a-button>
  109. </a-form-item>
  110. </a-form>
  111. </a-tab-pane>
  112. <a-tab-pane key="2" :title="$t('flowPool.warnTabs')">
  113. <a-form :model="formWarning" direction="inline">
  114. <div class="form-pool-tit">
  115. <div class="pool-icon"></div>
  116. 客户端·池预警设置
  117. </div>
  118. <a-form-item field="totalDosage" tooltip="请输入" label="总用量占比">
  119. <a-input-number v-model="formWarning.totalDosage" :style="{ width: '320px' }"
  120. placeholder="请输入" allow-clear hide-button>
  121. <template #suffix>
  122. %
  123. </template>
  124. </a-input-number>
  125. <a-checkbox value="1" v-model="formWarning.totalDosageCheck">达量预警</a-checkbox>
  126. </a-form-item>
  127. <a-form-item field="stoppagePool" label="达量停机">
  128. <a-select v-model="formWarning.stoppagePool" placeholder="请选择" :style="{ width: '320px' }"
  129. allow-clear>
  130. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  131. :label="item.label" />
  132. </a-select>
  133. <a-checkbox value="1" v-model="formWarning.stoppagePoolCheck">达量停机</a-checkbox>
  134. </a-form-item>
  135. <a-form-item field="stopNetworkPool" label="达量断网">
  136. <a-select v-model="formWarning.stopNetworkPool" placeholder="请选择"
  137. :style="{ width: '320px' }" allow-clear>
  138. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  139. :label="item.label" />
  140. </a-select>
  141. <a-checkbox value="1" v-model="formWarning.stopNetworkPoolCheck">达量断网</a-checkbox>
  142. </a-form-item>
  143. <a-form-item field="remindTotal" label="提醒次数">
  144. <a-input-number v-model="formWarning.remindTotal" :style="{ width: '320px' }"
  145. placeholder="请输入" allow-clear hide-button>
  146. <template #suffix>
  147. 次/月
  148. </template>
  149. </a-input-number>
  150. </a-form-item>
  151. <div class="form-pool-tit">
  152. <div class="pool-icon"></div>
  153. 客户端·单卡预警设置
  154. </div>
  155. <a-form-item field="oneCardWarning" tooltip="请输入" label="单卡用量预警">
  156. <a-input-number v-model="formWarning.oneCardWarning" :style="{ width: '320px' }"
  157. placeholder="请输入" allow-clear hide-button>
  158. </a-input-number>
  159. <a-checkbox value="1" v-model="formWarning.outTotalCheck">达量预警</a-checkbox>
  160. </a-form-item>
  161. <a-form-item field="stoppageCard" label="达量停机">
  162. <a-select v-model="formWarning.stoppageCard" placeholder="请选择" :style="{ width: '320px' }"
  163. allow-clear>
  164. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  165. :label="item.label" />
  166. </a-select>
  167. <a-checkbox value="1" v-model="formWarning.stoppageCardCheck">达量停机</a-checkbox>
  168. </a-form-item>
  169. <a-form-item field="stopNetworkCard" label="达量断网">
  170. <a-select v-model="formWarning.stopNetworkCard" placeholder="请选择"
  171. :style="{ width: '320px' }" allow-clear>
  172. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  173. :label="item.label" />
  174. </a-select>
  175. <a-checkbox value="1" v-model="formWarning.stopNetworkCardCheck">达量断网</a-checkbox>
  176. </a-form-item>
  177. <div class="form-pool-tit">
  178. <div class="pool-icon"></div>
  179. 管理端预警设置
  180. </div>
  181. <a-form-item field="poolUsedWarning" tooltip="请输入" label="池已用量预警">
  182. <a-input-number v-model="formWarning.poolUsedWarning" :style="{ width: '320px' }"
  183. placeholder="请输入" allow-clear hide-button>
  184. <template #suffix>
  185. %
  186. </template>
  187. </a-input-number>
  188. <a-checkbox value="1" v-model="formWarning.poolUsedCheck">达量预警</a-checkbox>
  189. </a-form-item>
  190. <a-form-item field="stoppageManagement" label="达量停机">
  191. <a-select v-model="formWarning.stoppageManagement" placeholder="请选择"
  192. :style="{ width: '320px' }" allow-clear>
  193. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  194. :label="item.label" />
  195. </a-select>
  196. <a-checkbox value="1" v-model="formWarning.stoppageManagementCheck">达量停机</a-checkbox>
  197. </a-form-item>
  198. <a-form-item field="stopNetworkManagement" label="达量断网">
  199. <a-select v-model="formWarning.stopNetworkManagement" placeholder="请选择"
  200. :style="{ width: '320px' }" allow-clear>
  201. <a-option v-for="item in earlyList" :key="item.value" :value="item.value"
  202. :label="item.label" />
  203. </a-select>
  204. <a-checkbox value="1" v-model="formWarning.stopNetworkManagementCheck">达量断网</a-checkbox>
  205. </a-form-item>
  206. <a-form-item>
  207. <a-button type="primary" html-type="submit" @click="resetForm"
  208. style="margin-right: 10px;">{{
  209. $t('form.Confirm')
  210. }}</a-button>
  211. <a-button @click="resetForm">{{ $t('form.Cancel') }}</a-button>
  212. </a-form-item>
  213. </a-form>
  214. </a-tab-pane>
  215. </a-tabs>
  216. </a-modal>
  217. <a-modal v-model:visible="openExport" @ok="handleOk" @cancel="handleCancel" width="1000px">
  218. <template #title>
  219. 批量导入
  220. </template>
  221. <div class="export-box">
  222. <div class="export-box-item">
  223. <div class="box-item-title">
  224. <div class="title-icon"></div>
  225. 批量导入
  226. </div>
  227. <div class="box-item-content">
  228. <div class="item-txt">
  229. <div class="item-txt-title">标题</div>
  230. <div class="item-txt-text">联通流量卡</div>
  231. </div>
  232. <div class="item-txt">
  233. <div class="item-txt-title">标题</div>
  234. <div class="item-txt-text">联通流量卡</div>
  235. </div>
  236. <div class="item-txt">
  237. <div class="item-txt-title"></div>
  238. <div class="item-txt-text"><a-upload action="/">
  239. <template #upload-button>
  240. <a-button type="primary">导入</a-button>
  241. </template>
  242. </a-upload></div>
  243. </div>
  244. </div>
  245. </div>
  246. <div class="export-box-item" style="margin-top:20px;">
  247. <div class="box-item-title">
  248. <div class="title-icon"></div>
  249. 导入结果
  250. </div>
  251. <div class="box-item-content">
  252. <a-table :columns="columnsExport" :data="dataExport">
  253. <template #operate="{ record }">
  254. <a-button @click="openContract(record)" type="text">下载</a-button>
  255. </template>
  256. <template #status="{ record }">
  257. <div class="export-status" v-if="record.status == 1">
  258. <div class="status-icon" style="background: rgba(82, 196, 27, 1);"></div>
  259. 导入成功
  260. </div>
  261. <div class="export-status" v-if="record.status == 2">
  262. <div class="status-icon" style="background: rgba(250, 173, 20, 1);"></div>
  263. 部分成功
  264. </div>
  265. <div class="export-status" v-if="record.status == 3">
  266. <div class="status-icon" style="background: rgba(247, 66, 75, 1);"></div>
  267. 校验失败
  268. </div>
  269. </template>
  270. </a-table>
  271. </div>
  272. </div>
  273. </div>
  274. </a-modal>
  275. </div>
  276. </template>
  277. <script setup>
  278. import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
  279. import { useRoute } from "vue-router";
  280. import { columns } from "./config";
  281. import { Message, Notification } from '@arco-design/web-vue'
  282. import { deleteTrafficPool, addTrafficPool, updateTrafficPool, trafficPoolList } from "@/api/path/flowPool.api"
  283. import { tariffList } from "@/api/path/tariffManagement.api"
  284. import { orderCancel } from "@/api/path/lotCard.api"
  285. import { enum_dict } from "@/hooks/enum";
  286. const { proxy } = getCurrentInstance()
  287. const formRef = ref()
  288. const searchForm = ref({
  289. "label": "",
  290. "traffic_pool_type": "1"
  291. });
  292. const dataSource = ref([]);
  293. const route = useRoute();
  294. const pagination = ref({
  295. total: 0,
  296. pageSize: 10,
  297. current: 1,
  298. })
  299. const rowSelection = reactive({
  300. type: 'checkbox',
  301. showCheckedAll: true,
  302. onlyCurrent: false,
  303. });
  304. const selectedKeys = ref([])
  305. const intData = async () => {
  306. const param = {
  307. current: pagination.value.current,
  308. size: pagination.value.pageSize,
  309. ...searchForm.value,
  310. }
  311. const { data } = await trafficPoolList(param)
  312. dataSource.value = (data.records || []).map((item, index) => {
  313. const trafficPoolType = typeList.value.find(val => val.value == item.traffic_pool_type)?.label
  314. const trafficPoolStatus = trafficList.value.find(val => val.value == item.status)?.label
  315. const sourceName = sourceList.value.find(val => val.value == item.source)?.label
  316. return {
  317. ...item,
  318. sourceName,// 运营商名称
  319. trafficPoolType,
  320. trafficPoolStatus,
  321. poolNumber: "NR0" + (index + 1),
  322. cardRariffName: "监控1G月租",
  323. cardFlow: "1G/月",
  324. cardNum: "11/100",
  325. UsedMonth: "1.00G",
  326. surplusFlow: "99.0G",
  327. totalFlow: "100.0G",
  328. exceededFlow: "--",
  329. }
  330. })
  331. pagination.value.total = data.total
  332. }
  333. // 删除
  334. const handleDel = async (id) => {
  335. const { code } = await deleteTrafficPool({ id })
  336. if (code == 200) {
  337. Message.success({
  338. content: "删除成功!",
  339. duration: 2000,
  340. })
  341. intData()
  342. }
  343. };
  344. //
  345. const handleSearch = () => {
  346. intData()
  347. }
  348. const resetSearch = () => {
  349. proxy.$refs.formRef.resetFields()
  350. intData()
  351. }
  352. // -------------------弹窗数据------------------------------------
  353. const activeKey = ref('1');
  354. const visible = ref(false);
  355. const typeCurrent = ref(null);
  356. const sourceList = ref([])
  357. const trafficList = ref([])
  358. const typeList = ref([])
  359. const tariffIdList = ref([])
  360. // 详情---------------------------
  361. const openExport = ref(false);
  362. const columnsExport = [
  363. { title: '序号', dataIndex: 'index', align: 'center', render: ({ rowIndex }) => rowIndex + 1 },
  364. {
  365. title: '操作人',
  366. dataIndex: 'name',
  367. },
  368. {
  369. title: '导入时间',
  370. dataIndex: 'exportTime',
  371. },
  372. {
  373. title: '完成时间',
  374. dataIndex: 'successTime',
  375. },
  376. {
  377. title: '状态',
  378. slotName: 'status',
  379. align: 'center'
  380. },
  381. { title: '操作', slotName: 'operate', align: 'center' },
  382. ];
  383. const dataExport = reactive([{
  384. key: '1',
  385. name: 'Jane Doe',
  386. exportTime: '2024-10-13 22:20:01',
  387. successTime: '2024-10-13 22:20:01',
  388. status: 1
  389. }, {
  390. key: '2',
  391. name: 'Alisa Ross',
  392. exportTime: '2024-10-13 22:20:01',
  393. successTime: '2024-10-13 22:20:01',
  394. status: 2
  395. }, {
  396. key: '3',
  397. name: 'Kevin Sandra',
  398. exportTime: '2024-10-13 22:20:01',
  399. successTime: '2024-10-13 22:20:01',
  400. status: 3
  401. }, {
  402. key: '4',
  403. name: 'Ed Hellen',
  404. exportTime: '2024-10-13 22:20:01',
  405. successTime: '2024-10-13 22:20:01',
  406. status: 2
  407. }, {
  408. key: '5',
  409. name: 'William Smith',
  410. exportTime: '2024-10-13 22:20:01',
  411. successTime: '2024-10-13 22:20:01',
  412. status: 3
  413. }]);
  414. // -------------------------------
  415. const formState = ref({
  416. "id": "",
  417. // 流量包名称
  418. "label": "",
  419. // 流量池类型: 1: 前流量池 2: 后流量池
  420. "traffic_pool_type": "1",
  421. // 来源
  422. "source": "",
  423. // 流量包状态:1:正常(发布计划状态)2:线下暂停销售
  424. "status": "",
  425. // 流量池ID
  426. "sim_tariff_id": null,
  427. // 过期时间
  428. "expire_time": "",
  429. // ICCID列表
  430. "iccids": ["89852342022040149139", "89852342022060861597"]
  431. });
  432. const formWarning = reactive({
  433. // 总用量占比
  434. totalDosage: null,
  435. // 总用量占比达量预警
  436. totalDosageCheck: '',
  437. // 达量停机
  438. stoppagePool: '',
  439. stoppagePoolCheck: '',
  440. stopNetworkPool: '',
  441. stopNetworkPoolCheck: '',
  442. remindTotal: null,
  443. oneCardWarning: null,
  444. outTotalCheck: '',
  445. stoppageCard: '',
  446. stoppageCardCheck: '',
  447. stopNetworkCard: '',
  448. stopNetworkCardCheck: '',
  449. poolUsedWarning: null,
  450. poolUsedCheck: '',
  451. stoppageManagement: '',
  452. stoppageManagementCheck: '',
  453. stopNetworkManagement: '',
  454. stopNetworkManagementCheck: '',
  455. })
  456. const rules = {
  457. label: [{ required: true, trigger: 'change', }],
  458. sim_data_plan_id: [{ required: true, trigger: 'change', }],
  459. user_id: [{ required: true, trigger: 'change', }],
  460. source: [{ required: true, trigger: 'change', }],
  461. traffic_type: [{ required: true, trigger: 'change', }],
  462. billing_type: [{ required: true, trigger: 'change', }],
  463. bag_size: [{ required: true, trigger: 'change', }],
  464. billing_cycle: [{ required: true, trigger: 'change', }],
  465. traffic_pool_type: [{ required: true, trigger: 'change', }],
  466. settlement_cycle: [{ required: true, trigger: 'change', }],
  467. sim_tariff_id: [{ required: true, trigger: 'change', }],
  468. expire_time: [{ required: true, trigger: 'change', }],
  469. // pricing: [{ required: true, trigger: 'change', }],
  470. // currency: [{ required: true, trigger: 'change', }],
  471. };
  472. const earlyList = [
  473. { value: 1, label: '手工停机' },
  474. ];
  475. // 退订
  476. const handleUnsubscribeDialog = async (record) => {
  477. // 订阅关系状态
  478. // 1:未激活
  479. // 2: 已过期
  480. // 3: 已激活99:已退款
  481. let param = {}
  482. let statusFlag = true
  483. if (selectedKeys.value.length > 0) {
  484. statusFlag = false
  485. param = {
  486. ids: selectedKeys.value
  487. }
  488. }
  489. if (record && record.id) {
  490. statusFlag = false
  491. param = {
  492. ids: [record.id]
  493. }
  494. }
  495. console.log(param, "param")
  496. if (!statusFlag) {
  497. const { code, data } = await orderCancel(param)
  498. if (code == 200) {
  499. Message.success({
  500. content: data,
  501. duration: 2000,
  502. })
  503. }
  504. } else {
  505. Message.warning({
  506. content: $t('lotCard.tipsOrder'),
  507. duration: 2000,
  508. })
  509. }
  510. };
  511. // 提交
  512. const handleSubmit = ({ values, errors }) => {
  513. formRef.value.validate(async (errors) => {
  514. if (!errors) {
  515. values.user_id = Number(values.user_id)
  516. if (formState.value.id) {
  517. const { code, data } = await updateTrafficPool(values)
  518. if (code == 200) {
  519. Message.success({
  520. content: "修改成功!",
  521. duration: 2000,
  522. })
  523. visible.value = false;
  524. intData()
  525. }
  526. } else {
  527. const { code, data } = await addTrafficPool(values)
  528. if (code == 200) {
  529. Message.success({
  530. content: "添加成功!",
  531. duration: 2000,
  532. })
  533. visible.value = false;
  534. intData()
  535. }
  536. }
  537. }
  538. });
  539. }
  540. // 弹框
  541. const dictShowModel = (type, data) => {
  542. if (type == 3) {
  543. openExport.value = true;
  544. return
  545. }
  546. handleTariff()
  547. formRef.value.resetFields();
  548. typeCurrent.value = type;
  549. activeKey.value = "1"
  550. nextTick(() => {
  551. visible.value = true;
  552. });
  553. // 编辑
  554. if (type == 2) {
  555. // Object.assign(formState.value, data);
  556. Object.keys(formState.value).forEach(key => {
  557. if (data[key]) {
  558. formState.value[key] = data[key]
  559. }
  560. });
  561. }
  562. }
  563. // 获取资费列表选择id
  564. const handleTariff = async () => {
  565. const { code, data } = await tariffList({
  566. "current": 1,
  567. "size": 10
  568. })
  569. if (code == 200) {
  570. tariffIdList.value = (data.records || []).map(item => {
  571. return {
  572. ...item,
  573. value: item.id
  574. }
  575. })
  576. }
  577. }
  578. // 取消
  579. const resetForm = () => {
  580. visible.value = false;
  581. formRef.value.resetFields();
  582. }
  583. // 卡详情
  584. const handleOk = () => {
  585. }
  586. const handleCancel = () => {
  587. }
  588. // --------------------------------------------------------
  589. // 获取字典
  590. const handleDictValue = () => {
  591. const dictList = JSON.parse(window.localStorage.getItem('dictList')) ?? []
  592. sourceList.value = dictList.filter((item) => item.type_key == enum_dict.SOURCE)
  593. trafficList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_PACKET_STATUS)
  594. typeList.value = dictList.filter((item) => item.type_key == enum_dict.TRAFFIC_POOL_TYPE)
  595. }
  596. onMounted(() => {
  597. handleDictValue()
  598. intData()
  599. })
  600. </script>
  601. <style scoped lang="less">
  602. .m-r-10 {
  603. margin-right: 10px;
  604. }
  605. .head-title-right {}
  606. .search-section {
  607. margin-top: 20px;
  608. margin-bottom: 20px;
  609. }
  610. .container {
  611. .head-title {
  612. display: flex;
  613. justify-content: space-between;
  614. }
  615. .form-row {
  616. display: flex;
  617. .form-row-col {
  618. width: 25%;
  619. display: flex;
  620. align-items: center;
  621. .form-row-label {
  622. width: 120px;
  623. text-align: right;
  624. }
  625. }
  626. }
  627. }
  628. silent-expire-alarm {
  629. padding: 20px !important;
  630. // background: #fcf;
  631. }
  632. .search-section {
  633. margin-bottom: 20px;
  634. }
  635. .audit-btn {
  636. margin-bottom: 10px;
  637. }
  638. .echarts-box {
  639. // width: 100%;
  640. display: flex;
  641. justify-content: center;
  642. overflow: hidden;
  643. .chart-dom {
  644. width: 700px !important;
  645. height: 400px !important;
  646. }
  647. }
  648. .form-item-space-item {
  649. background-color: #f2f3f5;
  650. display: flex;
  651. align-items: center;
  652. font-size: 14px;
  653. }
  654. .form-pool-tit {
  655. display: flex;
  656. align-items: center;
  657. margin-bottom: 10px;
  658. .pool-icon {
  659. margin-right: 10px;
  660. width: 4px;
  661. height: 16px;
  662. background: #1B5DF8;
  663. font-size: 14px;
  664. color: #6C6E70;
  665. font-family: PingFang SC;
  666. }
  667. }
  668. .export-box {
  669. .export-box-item {
  670. .box-item-title {
  671. display: flex;
  672. align-items: center;
  673. font-family: PingFang SC;
  674. font-size: 16px;
  675. font-weight: 600;
  676. line-height: 24px;
  677. color: rgba(0, 0, 0, 0.85);
  678. margin-bottom: 10px;
  679. .title-icon {
  680. margin-right: 10px;
  681. width: 4px;
  682. height: 16px;
  683. background: #1B5DF8;
  684. }
  685. }
  686. .box-item-content {
  687. .item-txt {
  688. display: flex;
  689. align-items: center;
  690. margin-bottom: 10px;
  691. .item-txt-title {
  692. width: 300px;
  693. text-align: right;
  694. margin-right: 10px;
  695. }
  696. .item-txt-text {
  697. font-family: PingFang SC;
  698. font-size: 14px;
  699. font-weight: 400;
  700. line-height: 22px;
  701. text-align: left;
  702. color: #1B5DF8;
  703. }
  704. }
  705. .export-status {
  706. font-family: PingFang SC;
  707. font-size: 14px;
  708. font-weight: 400;
  709. line-height: 22px;
  710. text-align: left;
  711. color: rgba(51, 51, 51, 1);
  712. display: flex;
  713. align-items: center;
  714. .status-icon {
  715. width: 6px;
  716. height: 6px;
  717. border-radius: 50%;
  718. margin-right: 10px;
  719. }
  720. }
  721. }
  722. }
  723. }
  724. </style>