index.vue 27 KB

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