Distribute.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container" style="margin: 10px 0 10px 0">
  4. <div class="flex">
  5. <div class="w_input">
  6. <span class="textSpan"> 订单号:</span>
  7. <el-input
  8. v-model="body.orderId"
  9. style="width:65%;"
  10. placeholder="请输入订单号"
  11. size="small"
  12. clearable
  13. />
  14. </div>
  15. <div class="w_input stylephone">
  16. <div class="textSpan marginphone">手机号:</div>
  17. <el-input
  18. v-model="body.phoneNo"
  19. type="textarea"
  20. :autosize="{ minRows: 1.1, maxRows: 5}"
  21. class="phone"
  22. size="small"
  23. placeholder="请输入内容"
  24. clearable
  25. />
  26. </div>
  27. <div class="w_input">
  28. <span class="textSpan">通道名称:</span>
  29. <el-input
  30. v-model="body.channelName"
  31. style="width:65%;"
  32. placeholder="请输入通道名称"
  33. size="small"
  34. clearable
  35. />
  36. </div>
  37. </div>
  38. <div class="flex">
  39. <div class="w_input">
  40. <span class="textSpan">订单状态:</span>
  41. <el-select v-model="body.status" size="small" clearable placeholder="请选择订单状态" style="width: 65%" @change="changeScope">
  42. <el-option
  43. v-for="item in status"
  44. :key="item.id"
  45. :label="item.name"
  46. :value="item.id"
  47. />
  48. </el-select>
  49. </div>
  50. <div class="w_input">
  51. <span class="textSpan"> 面额:</span>
  52. <el-input
  53. v-model="flowAmount"
  54. style="width:65%;"
  55. placeholder="请输入订单号"
  56. size="small"
  57. clearable
  58. @change="changeflow"
  59. />
  60. </div>
  61. <div class="w_input">
  62. <span class="textSpan"> 归属地:</span>
  63. <el-input
  64. v-model="body.phoneHome"
  65. style="width: 65%;"
  66. placeholder="请选择归属地"
  67. size="small"
  68. clearable
  69. />
  70. </div>
  71. </div>
  72. <div class="flex">
  73. <div class="w_input">
  74. <span class="textSpan">分发ID号:</span>
  75. <el-input
  76. v-model="body.recId"
  77. style="width:65%;"
  78. placeholder="请输入订单号"
  79. size="small"
  80. clearable
  81. />
  82. </div>
  83. <div class="w_input">
  84. <span class="textSpan">运营商:</span>
  85. <el-select v-model="body.phoneOperator" size="small" clearable placeholder="请选择运营商" style="width: 65%" @change="changeoperator">
  86. <el-option
  87. v-for="item in mobileOperator"
  88. :key="item.id"
  89. :label="item.name"
  90. :value="item.id"
  91. />
  92. </el-select>
  93. </div>
  94. </div>
  95. <div class="flex">
  96. <div class="w_date" >
  97. <span class="textSpan">发送时间:</span>
  98. <el-date-picker
  99. v-model="applyDateStart"
  100. size="small"
  101. type="datetimerange"
  102. style="width:70%"
  103. range-separator="至"
  104. value-format="yyyy-MM-dd HH:mm:ss"
  105. :default-time="[&quot;00:00:00&quot;,&quot;23:59:59&quot;]"
  106. start-placeholder="开始日期"
  107. end-placeholder="结束日期"
  108. @change="oncustom"
  109. />
  110. </div>
  111. </div>
  112. <div class="flexend">
  113. <el-button class="classitem" type="primary" plain icon="el-icon-star-off" @click="handleReset">导出
  114. </el-button>
  115. <el-button class="filter-item" icon="el-icon-search" type="primary" plain @click="handleSearch">搜索</el-button>
  116. </div>
  117. </div>
  118. <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  119. <el-table-column label="订单号" width="120" align="center" show-overflow-tooltip>
  120. <template slot-scope="scope">
  121. <span>{{ scope.row.orderId }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="分发订单号" width="120" align="center" show-overflow-tooltip>
  125. <template slot-scope="scope">
  126. <span>{{ scope.row.recId }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="客户名称" width="100" align="center" show-overflow-tooltip>
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.customerName }}</span>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="手机号码" width="110" align="center" show-overflow-tooltip>
  135. <template slot-scope="scope">
  136. <span>{{ scope.row.phoneNo }}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="流量包ID" width="100" align="center" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. <span>{{ scope.row.packageId }}</span>
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="运营商" width="70" align="center" show-overflow-tooltip>
  145. <template slot-scope="scope">
  146. <!-- 运营商:1、移动 2、电信 3、联通 -->
  147. <span v-if="scope.row.phoneOperator==1">移动</span>
  148. <span v-if="scope.row.phoneOperator==2">电信</span>
  149. <span v-if="scope.row.phoneOperator==3">联通</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="归属地" width="100" align="center" show-overflow-tooltip>
  153. <template slot-scope="scope">
  154. <span>{{ scope.row.phoneHome }}</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="发送时间" width="160" align="center">
  158. <template slot-scope="scope">
  159. <span>{{ scope.row.createDate}}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="回调时间" width="160" align="center">
  163. <template slot-scope="scope">
  164. <span>{{ scope.row.callbackTime }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="分发组次数" width="160" align="center">
  168. <template slot-scope="scope">
  169. <span>{{ scope.row.sendCount }}</span>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="通道组次数" width="160" align="center">
  173. <template slot-scope="scope">
  174. <span>{{ scope.row.batchCount }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="发送状态" width="90" align="center" show-overflow-tooltip>
  178. <template slot-scope="scope">
  179. <el-tag v-if="scope.row.sendStatus === 2" size="small">已发</el-tag>
  180. <el-tag v-if="scope.row.sendStatus === 4" size="small">失败</el-tag>
  181. <el-tag v-if="scope.row.sendStatus === 6" size="small">成功</el-tag>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="通道名称" width="90" align="center" show-overflow-tooltip>
  185. <template slot-scope="scope">
  186. <span>{{ scope.row.channelName }}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column label="通道订单号" width="120" align="center" show-overflow-tooltip>
  190. <template slot-scope="scope">
  191. <span>{{ scope.row.gwSeqNo }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="通道错误代码" width="120" align="center" show-overflow-tooltip>
  195. <template slot-scope="scope">
  196. <span>{{ scope.row.gwErrorCode }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="通道错误信息" width="120" align="center" show-overflow-tooltip>
  200. <template slot-scope="scope">
  201. <span>{{ scope.row.gwErrorMsg }}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="运营商订单号" width="120" align="center" show-overflow-tooltip>
  205. <template slot-scope="scope">
  206. <span>{{ scope.row.operatorId }}</span>
  207. </template>
  208. </el-table-column>
  209. </el-table>
  210. <!--分页-->
  211. <div class="pagination">
  212. <el-pagination
  213. current-page.sync="body.page"
  214. :current-page="body.page"
  215. :page-sizes="[10, 20, 30, 50]"
  216. :page-size="body.size"
  217. layout="total, sizes, prev, pager, next, jumper"
  218. background
  219. :total="total"
  220. @size-change="handleSizeChange"
  221. @current-change="handleCurrentChange"
  222. />
  223. </div>
  224. </div>
  225. </template>
  226. <script>
  227. import api from '@/api/orderList'
  228. export default {
  229. data() {
  230. return {
  231. Name: '',
  232. tableData: [],
  233. applyDateStart: '', // 发送时间
  234. checkTimeStart: '', // 回调时间
  235. flowAmount: '', // 面额乘以10000
  236. body: {
  237. orderId: '',
  238. channelName:'',
  239. createDateEnd:'',
  240. createDateStart:'',
  241. flowAmount:'',
  242. phoneHome:'',
  243. phoneNo:'',
  244. phoneOperator:'',
  245. recId:'',
  246. sendStatus:'',
  247. page: 1,
  248. size: 10
  249. },
  250. total: 0, // 总数据
  251. loading: false,
  252. status: [
  253. { id: 2, name: '已发' },
  254. { id: 6, name: '成功' },
  255. { id: 4, name: '失败' },
  256. ],
  257. mobileOperator: [
  258. { id: 1, name: '移动' },
  259. { id: 3, name: '联通' },
  260. { id: 2, name: '电信' }
  261. ],
  262. dealFlag: [
  263. { id: '0', name: '运营商处理中' },
  264. { id: '1', name: '待回调' },
  265. { id: '3', name: '以回调' },
  266. { id: '2', name: '无需回调' }
  267. ]
  268. }
  269. },
  270. created() {
  271. const nowDate = new Date()
  272. const date = {
  273. year: nowDate.getFullYear(),
  274. month: nowDate.getMonth() + 1,
  275. date: nowDate.getDate()
  276. }
  277. const systemTime = date.year + '-' + date.month + '-' + date.date
  278. // this.body.applyDateStart = "2021-05-14 + " 00:00:00"
  279. this.applyDateStart = [systemTime + ' 00:00:00', systemTime + ' 23:59:59']
  280. this.body.createDateStart = systemTime + ' 00:00:00'
  281. this.body.createDateEnd = systemTime + ' 23:59:59'
  282. // this.body.applyDateEnd = systemTime + " 23:59:59"
  283. // this.
  284. this.getTenantList()
  285. },
  286. methods: {
  287. // 获取数据
  288. getTenantList() {
  289. this.loading = true
  290. api.dispatch.Search(this.body).then(res => {
  291. this.loading = false
  292. // this.tableData=res.data.data.records
  293. // limitedDate :发送时间
  294. // lastModifyDate :回调
  295. // usedTime :用时
  296. const tableData = res.data.data.records
  297. const arry = tableData.map((res) => {
  298. if (res.lastModifyDate != null && res.lastModifyDate != '') {
  299. const limitedDate = res.limitedDate
  300. const lastModifyDate = res.lastModifyDate
  301. // 发送时间 减去 回调时间
  302. const date = new Date(limitedDate)
  303. const time = date.valueOf()
  304. const modify = new Date(lastModifyDate)
  305. const last = modify.valueOf()
  306. const used = last - time
  307. res.usedTime = used
  308. }
  309. return res
  310. })
  311. this.tableData = arry
  312. console.log(arry)
  313. this.total = res.data.data.total
  314. console.log(res.data.data.records)
  315. })
  316. },
  317. // 搜索手机号
  318. onphon() {
  319. console.log(this.phone)
  320. },
  321. // 搜索面额
  322. changeflow() {
  323. const flow = this.flowAmount
  324. // let body=this.body.flowAmount;
  325. this.body.flowAmount = flow //* 10000
  326. },
  327. // 搜索发送时间
  328. oncustom() {
  329. const applyDateStart = this.applyDateStart
  330. this.body.createDateStart = applyDateStart[0]
  331. this.body.createDateEnd = applyDateStart[1]
  332. // console.log(applyDateStart)
  333. // console.log(this.body.applyDateStart)
  334. },
  335. // 搜索回调时间
  336. oncheckTimeStart() {
  337. // checkTimeStart:"",
  338. // checkTimeEnd:"",
  339. const checkTimeStart = this.checkTimeStart
  340. this.body.checkTimeStart = checkTimeStart[0]
  341. this.body.checkTimeEnd = checkTimeStart[1]
  342. },
  343. // 搜索状态
  344. changeScope() {
  345. console.log(this.body.status)
  346. },
  347. // 运营商
  348. changeoperator() {
  349. console.log(this.body.mobileOperator)
  350. },
  351. // 搜索
  352. handleSearch() {
  353. console.log(this.applyDateStart)
  354. this.body.page = 1
  355. if (this.applyDateStart == null) { // 发送时间为空时清空 body 里的发送时间
  356. this.body.applyDateEnd = ''
  357. this.body.applyDateStart = ''
  358. }
  359. if (this.checkTimeStart == null) { // 回调时间
  360. this.body.checkTimeStart = ''
  361. this.body.checkTimeEnd = ''
  362. }
  363. if (this.flowAmount == null || this.flowAmount == 0) { // 面额
  364. this.body.flowAmount = ''
  365. }
  366. this.currentPage = '1'
  367. this.getTenantList()
  368. },
  369. //
  370. handleReset() {
  371. },
  372. // 分页
  373. handleSizeChange: function(val) {
  374. this.body.size = val
  375. this.getTenantList()
  376. },
  377. // 换页
  378. handleCurrentChange: function(val) {
  379. this.body.page = val
  380. this.getTenantList()
  381. }
  382. }
  383. }
  384. </script>
  385. <style scoped>
  386. .textSpan{
  387. position: relative;
  388. top: 0;
  389. font-size: 14px;
  390. font-weight: 600;
  391. color:rgb(87, 86, 86)
  392. }
  393. .stylephone{
  394. display: flex;
  395. }
  396. .marginphone{
  397. padding-top: 9px;
  398. }
  399. .flex{
  400. width: 100%;
  401. display: flex;
  402. flex-direction: row;
  403. margin-bottom: 10px;
  404. /* flex-wrap: wrap; */
  405. /* justify-content: space-evenly; */
  406. }
  407. .w_date{
  408. width: 66%;
  409. }
  410. .w_input{
  411. width:33.33%;
  412. }
  413. .flexend{
  414. display: flex;
  415. justify-content: flex-end;
  416. padding-top:20px;
  417. padding-right: 40px;
  418. }
  419. .phone{
  420. width:66.5% !important ;
  421. z-index: 100;
  422. }
  423. /* .classitem{
  424. background: salmon;
  425. } */
  426. </style>