Qrcodemanage.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  1. <template>
  2. <div class="content">
  3. <div class="tabs">
  4. <ul>
  5. <li v-for="(tab,i) in tabs" @click="goTab(tab.url)" :class="{'active':tabIndex == i}">
  6. {{tab.name}}
  7. </li>
  8. </ul>
  9. </div>
  10. <div class="panel">
  11. <div class="panel-body">
  12. <div class=" panel_control">
  13. <el-row :gutter="20">
  14. <el-col :span="6">
  15. <em>登记时间:</em>
  16. <el-date-picker
  17. v-model="panel.time1"
  18. type="daterange"
  19. range-separator="至"
  20. start-placeholder="开始日期"
  21. end-placeholder="结束日期">
  22. </el-date-picker>
  23. </el-col>
  24. <el-col :span="4">
  25. <em>时限类型:</em>
  26. <el-select v-model="panel.timeLimit">
  27. <el-option
  28. v-for="item in panel.options"
  29. :key="item.value"
  30. :label="item.label"
  31. :value="item.value">
  32. </el-option>
  33. </el-select>
  34. </el-col>
  35. <el-col :span="4">
  36. <em>关键词:</em>
  37. <el-input v-model="panel.qrcodename" placeholder="请输入关键词"></el-input>
  38. </el-col>
  39. <el-col :span="4">
  40. <el-button size="small" type="primary" @click="query">查询</el-button>
  41. </el-col>
  42. </el-row>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="contorl">
  47. <el-button size="small" type="primary" @click="addList">添加</el-button>
  48. <el-button size="small" type="primary" @click="changeList">修改</el-button>
  49. <el-button size="small" type="primary" @click="delList">删除</el-button>
  50. </div>
  51. <el-table
  52. :data="tableData"
  53. class=""
  54. stripe
  55. is-horizontal-resize
  56. v-loading="loading"
  57. element-loading-background="rgba(0, 0, 0, 0.8)"
  58. @selection-change="handleSelectionChange"
  59. >
  60. <el-table-column
  61. type="selection"
  62. width="55">
  63. </el-table-column>
  64. <el-table-column
  65. prop="QrId"
  66. label="二维码编号"
  67. >
  68. </el-table-column>
  69. <el-table-column
  70. prop="CreateTime"
  71. label="创建时间"
  72. width="180">
  73. <template slot-scope="scope">
  74. {{scope.row.CreateTime |fmtDate}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. prop="Frequency"
  79. label="有效时长(分钟)"
  80. >
  81. </el-table-column>
  82. <el-table-column
  83. prop="DetIdStr"
  84. label="探测器"
  85. width="180">
  86. <!--探测器详细信息 todo-->
  87. </el-table-column>
  88. <el-table-column
  89. prop="QrName"
  90. label="二维码名字">
  91. </el-table-column>
  92. <el-table-column
  93. prop="Tel"
  94. label="联系电话">
  95. </el-table-column>
  96. <el-table-column
  97. prop="Memo"
  98. label="备注">
  99. </el-table-column>
  100. <el-table-column
  101. prop="QrId"
  102. label="操作">
  103. <template slot-scope="scope">
  104. <el-button class="control_btn" type="text" @click="goPoster(scope.row)">海报</el-button>
  105. <el-button class="control_btn" type="text" @click="goQrcode(scope.row)">二维码</el-button>
  106. <el-button class="control_btn red" type="text" @click="pauseQrcode(scope.row)">禁用</el-button>
  107. </template>
  108. </el-table-column>
  109. </el-table>
  110. <br>
  111. <el-pagination
  112. background
  113. :total="pageination.total"
  114. :page-size="pageination.pageItem"
  115. @current-change="pageChange"
  116. ></el-pagination>
  117. <dialog_referrer_list
  118. :show="dialog_state"
  119. :title="dialog_title"
  120. :large="true"
  121. @dialog_cancel="dialog_cancel"
  122. @dialog_ok="dialog_ok"
  123. >
  124. <div class="dialogContent">
  125. <el-row :gutter="20">
  126. <el-col :span="10">
  127. <label>
  128. 二维码名称 *
  129. </label>
  130. <el-input v-model="dialog.comname"></el-input>
  131. </el-col>
  132. <el-col :span="10">
  133. <label>
  134. 电话 *
  135. </label>
  136. <el-input v-model="dialog.tel"></el-input>
  137. </el-col>
  138. <el-col :span="10">
  139. <label>
  140. 房间号 *
  141. </label>
  142. <el-input v-model="dialog.qrname"></el-input>
  143. </el-col>
  144. <el-col :span="10">
  145. <label>
  146. 备注
  147. </label>
  148. <el-input v-model="dialog.memo"></el-input>
  149. </el-col>
  150. <el-col :span="10">
  151. <label>
  152. 房间所属探测器
  153. </label>
  154. <!--改成list todo -->
  155. <el-checkbox-group v-model="dialog.checkList">
  156. <el-checkbox :label="det.Id" v-for="det in dialog.detOptions">{{det.Name}}</el-checkbox>
  157. </el-checkbox-group>
  158. </el-col>
  159. <el-col :span="10">
  160. <label>
  161. 海报有效期 *
  162. </label>
  163. <el-radio v-model="dialog.timeType" label="1">无限期</el-radio>
  164. <el-radio v-model="dialog.timeType" label="2">有时限</el-radio>
  165. </el-col>
  166. <el-col :span="10" v-if="dialog.timeType == 2">
  167. <label>
  168. 有效期时长
  169. </label>
  170. <el-input class="short" v-model="dialog.frequency"></el-input>
  171. <el-select class="short shortRight" v-model="dialog.validType" placeholder="时间单位">
  172. <el-option
  173. v-for="item in dialog.timeOptions"
  174. :key="item.value"
  175. :label="item.label"
  176. :value="item.value">
  177. </el-option>
  178. </el-select>
  179. </el-col>
  180. <el-col :span="10">
  181. <label>
  182. 单位形象图
  183. </label>
  184. <el-upload
  185. action="/api/v1/Detector/QrCodeUpload"
  186. ref="upload"
  187. list-type="picture-card"
  188. :data="dialog"
  189. :on-success="handleImgSuccess"
  190. :before-upload="handleImgbefore"
  191. :auto-upload="true">
  192. <i slot="default" class="el-icon-plus"></i>
  193. <div slot="file" slot-scope="{file}">
  194. <img
  195. class="el-upload-list__item-thumbnail"
  196. :src="file.url" alt=""
  197. >
  198. <span class="el-upload-list__item-actions">
  199. <span
  200. class="el-upload-list__item-preview"
  201. @click="handlePictureCardPreview(file)"
  202. >
  203. <i class="el-icon-zoom-in"></i>
  204. </span>
  205. <span
  206. v-if="!disabled"
  207. class="el-upload-list__item-delete"
  208. @click="handleDownload(file)"
  209. >
  210. <i class="el-icon-download"></i>
  211. </span>
  212. </span>
  213. </div>
  214. </el-upload>
  215. <img
  216. v-if="dialog.imgSrc"
  217. class="editImg"
  218. :src="dialog.imgSrc" alt=""
  219. >
  220. <el-dialog :visible.sync="dialogVisible">
  221. <img width="100%" :src="dialogImageUrl" alt="">
  222. </el-dialog>
  223. </el-col>
  224. </el-row>
  225. </div>
  226. </dialog_referrer_list>
  227. </div>
  228. </template>
  229. <script>
  230. import Global from '../Global.js'
  231. import dialog_referrer_list from '../components/dialog_referrer_list'
  232. import {
  233. GetRegionAndDectorSelect,
  234. GetQrcodeList,
  235. QrCodeAdd,
  236. QrCodeEdit,
  237. QrcodeEditStatus,
  238. } from '../api/getApiRes.js'
  239. let qs = require('qs');
  240. export default {
  241. data() {
  242. return {
  243. // dialog
  244. dialog_state: false,
  245. dialog_title: '添加二维码',
  246. dialog_type: '',//类型,1是添加,2是修改
  247. tabIndex: 0,
  248. tabs: [
  249. {name: '二维码管理', url: 'qrcodemanage'},
  250. ],
  251. // panel 配置项目
  252. panel: {
  253. qrcodename: '',
  254. timeLimit: 0,
  255. options: [
  256. {value: 0, label: '全部'},
  257. {value: 1, label: '无期限'},
  258. {value: 2, label: '有时限'},
  259. ],
  260. time1: globalBt2(),
  261. },
  262. dialog: {
  263. shopID: 1,//One and always is one
  264. comID: 1,//One and always is one
  265. qrcodeid: 0,//One and always is one
  266. token: localStorage.token,
  267. comname: '',
  268. tel: '',
  269. qrname: '',
  270. detId: '',
  271. detidstr: '',
  272. frequency: '',
  273. timeType: '1',
  274. memo: '',
  275. imagekey: '',
  276. imgSrc: '',
  277. validType: 0,
  278. detOptions: [],
  279. checkList: [],
  280. timeOptions: [
  281. {value: 0, label: '分钟'},
  282. {value: 1, label: '小时'},
  283. {value: 2, label: '天'},
  284. {value: 3, label: '月(30天)'},
  285. {value: 4, label: '年'},
  286. ],
  287. },
  288. pageination: {
  289. pageItem: 10,
  290. pageoptions: pageOptions(),
  291. total: 300,
  292. pageIndex: 1,
  293. },
  294. draw: 1,
  295. start: 0,
  296. recordsTotal: 0,
  297. tableData: [],
  298. allTableData: [],
  299. limit: '10',
  300. multipleSort: false,
  301. loading: true,
  302. fileList: [],
  303. dialogVisible: false,
  304. disabled: false,
  305. plateTitle: '',
  306. plateImg: false,
  307. loftListState: false,
  308. multipleSelection: [],
  309. detectedmac: '',
  310. plateImgSrc: '',
  311. dialogImageUrl: '',
  312. }
  313. },
  314. mounted() {
  315. this.getTableQuery();
  316. this.getDetList();
  317. },
  318. methods: {
  319. // 跳转tab页面
  320. goTab(url) {
  321. this.$router.push({path: url});
  322. },
  323. // 查询按钮
  324. query() {
  325. this.getTableQuery();
  326. this.$message.success('查询完毕');
  327. },
  328. handleImgbefore(file) {
  329. this.dialog.image = file;
  330. this.dialog.imgSrc = '';
  331. },
  332. handleImgSuccess(res, file) {
  333. let that = this;
  334. if (res.Code == 0) {
  335. that.dialog.imagekey = res.Key
  336. } else {
  337. that.$message.error(res.Memo);
  338. }
  339. },
  340. handleSelectionChange(val) {
  341. this.multipleSelection = val;
  342. console.log(val);
  343. },
  344. // 获取探测器列表
  345. getDetList() {
  346. let param = {
  347. 'token': localStorage.token,
  348. };
  349. let postdata = qs.stringify(param);
  350. GetRegionAndDectorSelect(postdata).then(res => {
  351. let json = res;
  352. if (json.Code == 0) {
  353. this.dialog.detOptions = json.DectectorRs;
  354. }
  355. })
  356. },
  357. // 页面数据查询
  358. getTableQuery() {
  359. let that = this;
  360. that.loading = true;
  361. let param = {
  362. token: localStorage.token,
  363. comid: 0,
  364. qrcodename: that.panel.qrcodename,
  365. timeLimit: that.panel.timeLimit,
  366. cdtbt: globaltime2String(that.panel.time1[0]) + ' 00:00:01',//开始时间
  367. cdtet: globaltime2String(that.panel.time1[1]) + ' 23:59:59',//结束时间
  368. start: 1,//
  369. tableMax: 300,//
  370. };
  371. let postdata = qs.stringify(param);
  372. GetQrcodeList(postdata).then(res => {
  373. let json = res;
  374. that.loading = false;
  375. if (json.Code == 0) {
  376. if (json.Rs) {
  377. that.allTableData = json.Rs;
  378. that.recordsTotal = json.Rs.length;
  379. } else {
  380. that.allTableData = [];
  381. that.recordsTotal = 0;
  382. }
  383. // 设置分页数据
  384. that.setPaginations();
  385. } else {
  386. that.$message.error(json.Memo);
  387. }
  388. })
  389. },
  390. // 设置分页数据
  391. setPaginations() {
  392. // 分页属性
  393. let that = this;
  394. that.pageination.total = that.recordsTotal;
  395. // 默认分页
  396. that.tableData = that.allTableData.filter((item, index) => {
  397. return index < that.pageination.pageItem;
  398. });
  399. },
  400. // 每页显示数量
  401. handleSizeChange() {
  402. let that = this;
  403. that.tableData = that.allTableData.filter((item, index) => {
  404. return index < that.pageination.pageItem;
  405. });
  406. that.draw = that.pageination.pageItem;
  407. that.getTableQuery();
  408. },
  409. // 翻页
  410. pageChange(pageIndex) {
  411. let that = this;
  412. // 获取当前页
  413. let index = that.pageination.pageItem * (pageIndex - 1);
  414. // 数据总数
  415. let nums = that.pageination.pageItem * pageIndex;
  416. // 容器
  417. let tables = [];
  418. for (var i = index; i < nums; i++) {
  419. if (that.allTableData[i]) {
  420. tables.push(that.allTableData[i])
  421. }
  422. this.tableData = tables;
  423. }
  424. that.start = index * that.draw;
  425. that.getTableQuery();
  426. },
  427. // 自动排序
  428. sortChange(params) {
  429. console.log(params)
  430. },
  431. // 过滤时间
  432. filterFmtDate(value, row, column) {
  433. let that = this;
  434. return globalfmtDate(column, 11);
  435. },
  436. addList() {
  437. this.dialog_state = true;
  438. this.dialog_title = '添加二维码';
  439. this.dialog_type = 1;
  440. // clear
  441. this.dialog.detId = '';
  442. this.dialog.timeType = '1';
  443. this.dialog.memo = '';
  444. this.dialog.checkList = [];
  445. },
  446. delList() {
  447. let that = this;
  448. // checkNum
  449. if (!this.multipleSelection.length) {
  450. that.$message({
  451. showClose: true,
  452. message: '错了哦,需要先选中至少一条记录',
  453. type: 'error'
  454. });
  455. return false
  456. }
  457. let qrcodeid = that.multipleSelection[0].QrId;
  458. let param = {
  459. token: localStorage.token,
  460. qrcodeid: qrcodeid,
  461. status: 9,//0禁用1启用9删除
  462. };
  463. let postdata = qs.stringify(param);
  464. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  465. confirmButtonText: '确定',
  466. cancelButtonText: '取消',
  467. type: 'warning'
  468. }).then(() => {
  469. QrcodeEditStatus(postdata).then(res => {
  470. let json = res;
  471. if (json.Code == 0) {
  472. that.$message({
  473. showClose: true,
  474. message: '选中的二维码已删除!',
  475. type: 'success'
  476. });
  477. // 重载列表
  478. that.getTableQuery();
  479. that.dialog_state = false;
  480. } else {
  481. that.$message.error(json.Memo);
  482. }
  483. });
  484. }).catch(() => {
  485. this.$message({
  486. type: 'info',
  487. message: '已取消删除'
  488. });
  489. });
  490. },
  491. changeList() {
  492. let that = this;
  493. // checkNum
  494. if (!this.multipleSelection.length) {
  495. this.$message({
  496. showClose: true,
  497. message: '错了哦,需要先选中一条记录',
  498. type: 'error'
  499. });
  500. return false
  501. }
  502. if (this.multipleSelection.length > 1) {
  503. this.$message({
  504. showClose: true,
  505. message: '错了哦,只能选中一条记录',
  506. type: 'error'
  507. });
  508. return false
  509. }
  510. this.dialog_state = true;
  511. this.dialog_title = '修改二维码';
  512. that.dialog_type = 2;
  513. let row = this.multipleSelection[0];
  514. this.dialog.comname = row.ComName;
  515. this.dialog.qrcodeid = row.QrId;
  516. this.dialog.tel = row.Tel;
  517. this.dialog.qrname = row.QrName;
  518. this.dialog.memo = row.Memo;
  519. this.dialog.checkList = row.DetIdStr.split(',').map(Number);
  520. // 为0时候表示无限期
  521. // 获取时限类型
  522. let timeType = parseInt(row.Frequency);
  523. if (timeType == 0) {
  524. that.dialog.timeType = "1";
  525. } else {
  526. that.dialog.timeType = "2";
  527. }
  528. },
  529. // 探测记录
  530. goRecord(row) {
  531. console.log(row);
  532. this.$router.push({path: '/record', query: {row: row}});
  533. },
  534. dialog_cancel() {
  535. let that = this;
  536. that.dialog_state = false;
  537. },
  538. dialog_ok() {
  539. console.log(this.dialog_type);
  540. if (this.dialog_type == 1) {
  541. this.confirmAddQrcode();
  542. } else {
  543. this.confirmEditQrcode();
  544. }
  545. },
  546. // 确认添加新的二维码
  547. confirmAddQrcode() {
  548. // checkVal
  549. let that = this;
  550. // checkVal
  551. if (!that.dialog.comname) {
  552. this.$message.error('错了哦,区域名称不能空');
  553. return false
  554. }
  555. if (that.dialog.comname.length > 20) {
  556. this.$message.error('错了哦,区域名称不能超过20个字符');
  557. return false
  558. }
  559. if (!that.dialog.qrname) {
  560. this.$message.error('错了哦,二维码名称不能空');
  561. return false
  562. }
  563. if (that.dialog.qrname.length > 20) {
  564. this.$message.error('错了哦,二维码名称不能超过20个字符');
  565. return false
  566. }
  567. if (!that.dialog.tel) {
  568. this.$message.error('错了哦,电话名称不能空');
  569. return false
  570. }
  571. let detidstr = that.dialog.checkList;
  572. if (!detidstr) {
  573. this.$message.error('错了哦,至少勾选一个探测器');
  574. return false
  575. }
  576. let extime = 0;
  577. if (that.dialog.timeType == 0) {
  578. extime = 0;//无限时
  579. } else {
  580. switch (parseInt(that.dialog.validType)) {
  581. case 0://分钟
  582. extime = that.dialog.frequency * 1;
  583. break;
  584. case 1://小时
  585. extime = that.dialog.frequency * 60;
  586. break;
  587. case 2://天
  588. extime = that.dialog.frequency * 60 * 24;
  589. break;
  590. case 3://月
  591. extime = that.dialog.frequency * 60 * 24 * 30;
  592. break;
  593. case 4://年
  594. extime = that.dialog.frequency * 60 * 24 * 30 * 12;
  595. break;
  596. }
  597. }
  598. let param = {
  599. token: localStorage.token,
  600. comname: that.dialog.comname,
  601. comid: 1,
  602. qrname: that.dialog.qrname,
  603. tel: that.dialog.tel,
  604. memo: that.dialog.memo,
  605. detidstr: detidstr.join(',') + ',',
  606. frequency: extime,
  607. imagekey: that.dialog.imagekey,
  608. };
  609. let postdata = qs.stringify(param);
  610. QrCodeAdd(postdata).then(res => {
  611. let json = res;
  612. if (json.Code == 0) {
  613. that.$message({
  614. showClose: true,
  615. message: '创建成功,前往二维码页面进行查看!',
  616. type: 'success'
  617. });
  618. // 二维码页面 页面跳转
  619. that.$router.push({
  620. path: '/createmeetingqrcode',
  621. query: {
  622. shopname: that.dialog.comname,
  623. qrname: that.dialog.qrname,
  624. qrcodeId: json.Id,
  625. }
  626. });
  627. // 重载列表
  628. that.getTableQuery()
  629. } else {
  630. that.$message.error(json.Memo);
  631. }
  632. });
  633. that.dialog_state = false;
  634. },
  635. // 确认修改旧的二维码
  636. confirmEditQrcode() {
  637. // checkVal
  638. let that = this;
  639. // checkVal
  640. if (!that.dialog.comname) {
  641. this.$message.error('错了哦,区域名称不能空');
  642. return false
  643. }
  644. if (that.dialog.comname.length > 20) {
  645. this.$message.error('错了哦,区域名称不能超过20个字符');
  646. return false
  647. }
  648. if (!that.dialog.qrname) {
  649. this.$message.error('错了哦,二维码名称不能空');
  650. return false
  651. }
  652. if (that.dialog.qrname.length > 20) {
  653. this.$message.error('错了哦,二维码名称不能超过20个字符');
  654. return false
  655. }
  656. if (!that.dialog.tel) {
  657. this.$message.error('错了哦,电话名称不能空');
  658. return false
  659. }
  660. let detidstr = that.dialog.checkList;
  661. if (!detidstr) {
  662. this.$message.error('错了哦,至少勾选一个探测器');
  663. return false
  664. }
  665. let extime = 0;
  666. if (that.dialog.timeType == 0) {
  667. extime = 0;//无限时
  668. } else {
  669. switch (parseInt(that.dialog.validType)) {
  670. case 0://分钟
  671. extime = that.dialog.frequency * 1;
  672. break;
  673. case 1://小时
  674. extime = that.dialog.frequency * 60;
  675. break;
  676. case 2://天
  677. extime = that.dialog.frequency * 60 * 24;
  678. break;
  679. case 3://月
  680. extime = that.dialog.frequency * 60 * 24 * 30;
  681. break;
  682. case 4://年
  683. extime = that.dialog.frequency * 60 * 24 * 30 * 12;
  684. break;
  685. }
  686. }
  687. let param = {
  688. token: localStorage.token,
  689. comname: that.dialog.comname,
  690. comid: 1,
  691. qrname: that.dialog.qrname,
  692. tel: that.dialog.tel,
  693. memo: that.dialog.memo,
  694. detidstr: detidstr.join(',') + ',',
  695. frequency: extime,
  696. imagekey: that.dialog.imagekey,
  697. qrcodeid: that.dialog.qrcodeid,
  698. };
  699. let postdata = qs.stringify(param);
  700. QrCodeEdit(postdata).then(res => {
  701. let json = res;
  702. if (json.Code == 0) {
  703. that.$message({
  704. showClose: true,
  705. message: '创建成功,前往二维码页面进行查看!',
  706. type: 'success'
  707. });
  708. // 二维码页面 页面跳转
  709. that.$router.push({
  710. path: '/createmeetingqrcode',
  711. query: {
  712. shopname: that.dialog.comname,
  713. qrname: that.dialog.qrname,
  714. qrcodeId: json.Id,
  715. }
  716. });
  717. // 重载列表
  718. that.getTableQuery()
  719. } else {
  720. that.$message.error(json.Memo);
  721. }
  722. });
  723. that.dialog_state = false;
  724. },
  725. // 禁用二维码
  726. pauseQrcode(row) {
  727. let that = this;
  728. let param = {
  729. token: localStorage.token,
  730. qrcodeid: row.QrId,
  731. status: 0//新状态0禁用1启用 9删除
  732. };
  733. let postdata = qs.stringify(param);
  734. this.$confirm('是否禁用' + row.QrName + '的二维码?', '禁用操作', {
  735. confirmButtonText: '确定',
  736. cancelButtonText: '取消',
  737. type: 'warning'
  738. }).then(() => {
  739. // // ajax todo
  740. // RegionStatusEdit(postdata).then(res => {
  741. // let json = res;
  742. // if (json.Code == 0) {
  743. that.$message({
  744. type: 'success',
  745. message: `禁用成功`
  746. });
  747. that.getTableQuery();
  748. // } else {
  749. // that.$message.error(json.Memo);
  750. // }
  751. // })
  752. }).catch(() => {
  753. this.$message({
  754. type: 'info',
  755. message: '已取消禁用'
  756. });
  757. });
  758. },
  759. // 查看海报
  760. goPoster(node) {
  761. this.$router.push({
  762. path: '/poster',
  763. query: {
  764. shopname: 1,
  765. ComName: node.ComName,
  766. qrname: node.QrName,
  767. qrcodeId: node.QrId,
  768. vfcode: node.Vfcode,
  769. }
  770. })
  771. },
  772. // 查看二维码
  773. goQrcode(node) {
  774. this.$router.push({
  775. path: '/createmeetingqrcode',
  776. query: {
  777. shopname: 1,
  778. ComName: node.ComName,
  779. qrname: node.QrName,
  780. qrcodeId: node.QrId,
  781. vfcode: node.Vfcode,
  782. }
  783. })
  784. },
  785. },
  786. filters: {
  787. fmtDate: function (value) {
  788. let res = '';
  789. if (!value) {
  790. return '---';
  791. } else {
  792. res = new Date(+new Date(value) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
  793. return res;
  794. }
  795. }
  796. }
  797. ,
  798. components: {
  799. dialog_referrer_list
  800. }
  801. }
  802. </script>
  803. <style scoped>
  804. @import "../assets/css/panel.css";
  805. @import "../assets/css/dialog.css";
  806. .tabs ul {
  807. width: 168px;
  808. }
  809. table span {
  810. cursor: pointer;
  811. }
  812. .control_btn {
  813. float: left;
  814. margin: 0 4px;
  815. }
  816. .content {
  817. width: 100%;
  818. height: 100%;
  819. overflow: hidden;
  820. display: block;
  821. margin: 0 auto;
  822. }
  823. .modal-content .el-select {
  824. display: block;
  825. }
  826. /deep/ .modal-content .el-select .el-input .el-select__caret {
  827. position: relative;
  828. top: 10px;
  829. line-height: 0px !important;
  830. }
  831. /deep/ .el-radio {
  832. width: 45%;
  833. height: 35px;
  834. float: left;
  835. padding-top: 10px;
  836. }
  837. /deep/ .el-radio__input {
  838. float: left;
  839. }
  840. /deep/ .el-radio__inner {
  841. float: left;
  842. }
  843. /deep/ .el-radio__label {
  844. float: left;
  845. }
  846. .short {
  847. width: 40%;
  848. float: left;
  849. margin-right: 10px;
  850. }
  851. .red {
  852. color: red !important;
  853. }
  854. /deep/ .modal-body {
  855. width: 100%;
  856. height: 400px;
  857. overflow: hidden;
  858. display: block;
  859. margin: 0 auto;
  860. margin-bottom: 40px;
  861. }
  862. /*upload*/
  863. /deep/ .el-upload--picture-card {
  864. float: left;
  865. background: none;
  866. border: 1px solid #005EA2;
  867. color: #005EA2;
  868. }
  869. /deep/ .el-upload--picture-card i {
  870. color: #005EA2;
  871. }
  872. .editImg {
  873. width: 140px;
  874. height: 140px;
  875. float: left;
  876. margin-left: 30px;
  877. }
  878. </style>