index.vue 28 KB

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