index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  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')" 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. trafficPoolType: '2',
  359. type:2
  360. }
  361. const {data} = await trafficPoolList(param)
  362. dataSource.value = (data.records || []).map((item, index) => {
  363. // const trafficPoolType = typeList.value.find(val => val.value == item.trafficPoolType)?.label
  364. const trafficPoolStatus = trafficList.value.find(val => val.value == item.status)?.label
  365. const sourceName = sourceList.value.find(val => val.value == item.source)?.label
  366. const Activated = 0 + '/' + item.iccids?.length
  367. const HaveBeenUsed = 0+ '/' + item.size+item.sizeType
  368. return {
  369. ...item,
  370. sourceName,// 运营商名称
  371. // trafficPoolType,
  372. Activated:Activated,
  373. HaveBeenUsed:HaveBeenUsed,
  374. trafficPoolStatus,
  375. }
  376. })
  377. pagination.value.total = data.total
  378. }
  379. // 删除
  380. const handleDel = async (id) => {
  381. const {code} = await deleteTrafficPool({id})
  382. if (code == 200) {
  383. Message.success({
  384. content: "删除成功!",
  385. duration: 2000,
  386. })
  387. intData()
  388. }
  389. };
  390. const evChangePage = (page) => {
  391. pagination.value.current = page
  392. intData()
  393. }
  394. const handleSearch = () => {
  395. intData()
  396. }
  397. const resetSearch = () => {
  398. searchForm.value.label = ''
  399. intData()
  400. }
  401. // -------------------弹窗数据------------------------------------
  402. const activeKey = ref('1');
  403. const visible = ref(false);
  404. const typeCurrent = ref(null);
  405. const sourceList = ref([])
  406. const trafficList = ref([])
  407. const typeList = ref([])
  408. const tariffIdList = ref([])
  409. // 详情---------------------------
  410. const openExport = ref(false);
  411. const columnsExport = [
  412. {title: '序号', dataIndex: 'index', align: 'center', render: ({rowIndex}) => rowIndex + 1},
  413. {
  414. title: '操作人',
  415. dataIndex: 'name',
  416. },
  417. {
  418. title: '导入时间',
  419. dataIndex: 'exportTime',
  420. },
  421. {
  422. title: '完成时间',
  423. dataIndex: 'successTime',
  424. },
  425. {
  426. title: '状态',
  427. slotName: 'status',
  428. align: 'center'
  429. },
  430. {title: '操作', slotName: 'operate', align: 'center'},
  431. ];
  432. const dataExport = reactive([{
  433. key: '1',
  434. name: 'Jane Doe',
  435. exportTime: '2024-10-13 22:20:01',
  436. successTime: '2024-10-13 22:20:01',
  437. status: 1
  438. }, {
  439. key: '2',
  440. name: 'Alisa Ross',
  441. exportTime: '2024-10-13 22:20:01',
  442. successTime: '2024-10-13 22:20:01',
  443. status: 2
  444. }, {
  445. key: '3',
  446. name: 'Kevin Sandra',
  447. exportTime: '2024-10-13 22:20:01',
  448. successTime: '2024-10-13 22:20:01',
  449. status: 3
  450. }, {
  451. key: '4',
  452. name: 'Ed Hellen',
  453. exportTime: '2024-10-13 22:20:01',
  454. successTime: '2024-10-13 22:20:01',
  455. status: 2
  456. }, {
  457. key: '5',
  458. name: 'William Smith',
  459. exportTime: '2024-10-13 22:20:01',
  460. successTime: '2024-10-13 22:20:01',
  461. status: 3
  462. }]);
  463. // -------------------------------
  464. const formState = ref({
  465. // 流量包名称
  466. "label": "",
  467. // 流量池类型: 1: 前流量池 2: 后流量池
  468. "trafficPoolType": "2",
  469. // 来源
  470. "source": "",
  471. // 流量包状态:1:正常(发布计划状态)2:线下暂停销售
  472. "status": "",
  473. // 流量池ID
  474. "simTariffId": null,
  475. // 过期时间
  476. "expireTime": "",
  477. // ICCID列表
  478. "iccids": [],
  479. "size": null,
  480. "sizeType": ''
  481. });
  482. const formWarning = reactive({
  483. // 总用量占比
  484. totalDosage: null,
  485. // 总用量占比达量预警
  486. totalDosageCheck: '',
  487. // 达量停机
  488. stoppagePool: '',
  489. stoppagePoolCheck: '',
  490. stopNetworkPool: '',
  491. stopNetworkPoolCheck: '',
  492. remindTotal: null,
  493. oneCardWarning: null,
  494. outTotalCheck: '',
  495. stoppageCard: '',
  496. stoppageCardCheck: '',
  497. stopNetworkCard: '',
  498. stopNetworkCardCheck: '',
  499. poolUsedWarning: null,
  500. poolUsedCheck: '',
  501. stoppageManagement: '',
  502. stoppageManagementCheck: '',
  503. stopNetworkManagement: '',
  504. stopNetworkManagementCheck: '',
  505. })
  506. const rules = {
  507. label: [{required: true, trigger: 'change',}],
  508. source: [{required: true, trigger: 'change',}],
  509. status: [{required: true, trigger: 'change',}],
  510. simTariffId: [{required: true, trigger: 'change',}],
  511. expireTime: [{required: true, trigger: 'change',}],
  512. // iccids: [{required: true, trigger: 'change',}],
  513. size: [{required: true, trigger: 'change',}],
  514. sizeType: [{required: true, trigger: 'change',}],
  515. };
  516. // 提交
  517. const handleSubmit = ({values, errors}) => {
  518. formRef.value.validate(async (errors) => {
  519. if (!errors) {
  520. values.size = Number(values.size)
  521. if (formState.value.id) {
  522. const {code, data} = await updateTrafficPool(formState.value)
  523. if (code == 200) {
  524. Message.success({
  525. content: "修改成功!",
  526. duration: 2000,
  527. })
  528. resetForm()
  529. intData()
  530. }
  531. } else {
  532. const {code, data} = await addTrafficPool(formState.value)
  533. if (code == 200) {
  534. Message.success({
  535. content: "添加成功!",
  536. duration: 2000,
  537. })
  538. resetForm()
  539. intData()
  540. }
  541. }
  542. }
  543. });
  544. }
  545. // 弹框
  546. const dictShowModel = (type, data) => {
  547. if (type == 3) {
  548. openExport.value = true;
  549. return
  550. }
  551. handleTariff()
  552. formRef.value.resetFields();
  553. typeCurrent.value = type;
  554. activeKey.value = "1"
  555. nextTick(() => {
  556. visible.value = true;
  557. });
  558. // 编辑
  559. if (type == 2) {
  560. Object.keys(formState.value).forEach(key => {
  561. if (data[key]) {
  562. formState.value[key] = data[key]
  563. }
  564. })
  565. formState.value.id = data.id
  566. }
  567. }
  568. // 获取资费列表选择id
  569. const handleTariff = async () => {
  570. const {code, data} = await tariffList({
  571. "current": 1,
  572. "size": 10
  573. })
  574. if (code == 200) {
  575. tariffIdList.value = (data.records || []).map(item => {
  576. return {
  577. ...item,
  578. value: item.id
  579. }
  580. })
  581. }
  582. }
  583. // 取消
  584. const resetForm = () => {
  585. visible.value = false;
  586. Object.keys(formState.value).forEach(key => {
  587. if (key != 'trafficPoolType') {
  588. formState.value[key] = ''
  589. }
  590. })
  591. delete formState.value.id
  592. }
  593. // --------------------------------------------------------
  594. // 获取字典
  595. const handleDictValue = async () => {
  596. sourceList.value = await Getdictionary('source')
  597. trafficList.value = await Getdictionary('trafficPacketStatus')
  598. typeList.value = await Getdictionary('trafficPoolType')
  599. }
  600. watch(() => formState.value.simTariffId, val => {
  601. if (!val) return
  602. updateCardList({id: val}).then(res => {
  603. if (res.code === 200) {
  604. card.value = res.data
  605. }
  606. })
  607. })
  608. onMounted(async () => {
  609. await handleDictValue()
  610. await intData()
  611. })
  612. </script>
  613. <style scoped lang="less">
  614. .m-r-10 {
  615. margin-right: 10px;
  616. }
  617. .head-title-right {
  618. }
  619. .search-section {
  620. margin-top: 20px;
  621. margin-bottom: 20px;
  622. }
  623. .container {
  624. .head-title {
  625. display: flex;
  626. justify-content: space-between;
  627. }
  628. .form-row {
  629. display: flex;
  630. .form-row-col {
  631. width: 25%;
  632. display: flex;
  633. align-items: center;
  634. .form-row-label {
  635. width: 120px;
  636. text-align: right;
  637. }
  638. }
  639. }
  640. }
  641. silent-expire-alarm {
  642. padding: 20px !important;
  643. // background: #fcf;
  644. }
  645. .search-section {
  646. margin-bottom: 20px;
  647. }
  648. .audit-btn {
  649. margin-bottom: 10px;
  650. }
  651. .echarts-box {
  652. // width: 100%;
  653. display: flex;
  654. justify-content: center;
  655. overflow: hidden;
  656. .chart-dom {
  657. width: 700px !important;
  658. height: 400px !important;
  659. }
  660. }
  661. .form-item-space-item {
  662. background-color: #f2f3f5;
  663. display: flex;
  664. align-items: center;
  665. font-size: 14px;
  666. }
  667. .form-pool-tit {
  668. display: flex;
  669. align-items: center;
  670. margin-bottom: 10px;
  671. .pool-icon {
  672. margin-right: 10px;
  673. width: 4px;
  674. height: 16px;
  675. background: #1B5DF8;
  676. font-size: 14px;
  677. color: #6C6E70;
  678. font-family: PingFang SC;
  679. }
  680. }
  681. .export-box {
  682. .export-box-item {
  683. .box-item-title {
  684. display: flex;
  685. align-items: center;
  686. font-family: PingFang SC;
  687. font-size: 16px;
  688. font-weight: 600;
  689. line-height: 24px;
  690. color: rgba(0, 0, 0, 0.85);
  691. margin-bottom: 10px;
  692. .title-icon {
  693. margin-right: 10px;
  694. width: 4px;
  695. height: 16px;
  696. background: #1B5DF8;
  697. }
  698. }
  699. .box-item-content {
  700. .item-txt {
  701. display: flex;
  702. align-items: center;
  703. margin-bottom: 10px;
  704. .item-txt-title {
  705. width: 300px;
  706. text-align: right;
  707. margin-right: 10px;
  708. }
  709. .item-txt-text {
  710. font-family: PingFang SC;
  711. font-size: 14px;
  712. font-weight: 400;
  713. line-height: 22px;
  714. text-align: left;
  715. color: #1B5DF8;
  716. }
  717. }
  718. .export-status {
  719. font-family: PingFang SC;
  720. font-size: 14px;
  721. font-weight: 400;
  722. line-height: 22px;
  723. text-align: left;
  724. color: rgba(51, 51, 51, 1);
  725. display: flex;
  726. align-items: center;
  727. .status-icon {
  728. width: 6px;
  729. height: 6px;
  730. border-radius: 50%;
  731. margin-right: 10px;
  732. }
  733. }
  734. }
  735. }
  736. }
  737. </style>