|
@@ -0,0 +1,221 @@
|
|
|
+function getShortName (comName) {
|
|
|
+ var areaMap = chinaMapJSON || []
|
|
|
+ var shortname = comName
|
|
|
+ // 1. 循环省份城市进行替换
|
|
|
+ areaMap.forEach(function (item) {
|
|
|
+ var p = item.name.replace(/[省市]/, '')
|
|
|
+ if (shortname.indexOf(p) !== -1) {
|
|
|
+ shortname = shortname.replace(item.name, '').replace(p, '')
|
|
|
+ console.log(p + ' -> \'\'')
|
|
|
+ }
|
|
|
+ item.city.forEach(function (iitem) {
|
|
|
+ var c = iitem.name.replace(/[省市]/, '')
|
|
|
+ if (shortname.indexOf(c) !== -1) {
|
|
|
+ shortname = shortname.replace(iitem.name, '').replace(c, '')
|
|
|
+ console.log(c + ' -> \'\'')
|
|
|
+ }
|
|
|
+ iitem.area.forEach(function (iiitem) {
|
|
|
+ if (shortname.indexOf(iiitem) !== -1) {
|
|
|
+ shortname = shortname.replace(iiitem, '')
|
|
|
+ console.log(iiitem + ' -> \'\'')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ var matchRes = shortname.match(/[\u4e00-\u9fa5]{4}/gm)
|
|
|
+ var shortname = matchRes ? matchRes[0] : shortname.slice(0, 4)
|
|
|
+ if (shortname.length < 4) {
|
|
|
+ shortname = shortname.slice(0, 4)
|
|
|
+ }
|
|
|
+ return shortname
|
|
|
+}
|
|
|
+function debounce(func, wait) {
|
|
|
+ var timeout;
|
|
|
+ return function () {
|
|
|
+ var context = this;
|
|
|
+ var args = Array.prototype.slice.call(arguments);
|
|
|
+ if (timeout) clearTimeout(timeout);
|
|
|
+ var callNow = !timeout;
|
|
|
+ timeout = setTimeout(function () {
|
|
|
+ timeout = null;
|
|
|
+ }, wait);
|
|
|
+ if (callNow) func.apply(context, args);
|
|
|
+ };
|
|
|
+}
|
|
|
+function downFile (src, name) {
|
|
|
+ var a = document.createElement('a')
|
|
|
+ var event = new MouseEvent('click')
|
|
|
+ a.download = name || '附件名称'
|
|
|
+ a.href = src
|
|
|
+ a.dispatchEvent(event)
|
|
|
+}
|
|
|
+
|
|
|
+var downFileOfURL = debounce(function (src , name) {
|
|
|
+ return downFile(src, name)
|
|
|
+}, 1500)
|
|
|
+
|
|
|
+var vm = new Vue({
|
|
|
+ el: '.see-container',
|
|
|
+ delimiters: ['{', '}'],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ working: false,
|
|
|
+ empty: false,
|
|
|
+ dateVal: '',
|
|
|
+ years: '',
|
|
|
+ months: '',
|
|
|
+ points: {},
|
|
|
+ statusEnum: ['存续', '吊销', '注销', '撤销'],
|
|
|
+ statusColors: ['#2CB7CA', '#F5AF5C', '#58A1E7', '#51CEA2'],
|
|
|
+ seeList: {
|
|
|
+ pageNum: 1, // 当前页
|
|
|
+ pageSize: 10, // 每页多少条数据
|
|
|
+ total: 0, // 总页数
|
|
|
+ list: [] // 返回的数据
|
|
|
+ },
|
|
|
+ helpDialog: false,
|
|
|
+ tipDialog: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ dialogBtnText: function() {
|
|
|
+ if (this.points.provin == -1) {
|
|
|
+ return '联系客服'
|
|
|
+ } else {
|
|
|
+ return '前往升级'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.years = new Date().getFullYear()
|
|
|
+ this.months = parseInt(new Date().getMonth() + 1)
|
|
|
+ this.dateVal = new Date()
|
|
|
+ this.subPoint()
|
|
|
+ this.subRecord()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ cellClick (row, column, cell, event) {
|
|
|
+ console.log(row, column, cell, event)
|
|
|
+ if (column.label === '附件') {
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: '/jypay/resourcePack/consumePack',
|
|
|
+ data: {
|
|
|
+ productName: '附件下载包',
|
|
|
+ platform: 'PC',
|
|
|
+ fileName: row.s_fileName,
|
|
|
+ id: row.s_id,
|
|
|
+ title: row.s_title
|
|
|
+ },
|
|
|
+ success: function (r) {
|
|
|
+ if (r && r.m === '' && r.r) {
|
|
|
+ downFileOfURL(r.r.downUrl, row.s_fileName);
|
|
|
+ }else{
|
|
|
+ console.log("附件下载异常,请联系管理员,谢谢!")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (column.label === '公告来源') {
|
|
|
+ location.href = row.articleUrl
|
|
|
+ }
|
|
|
+ },
|
|
|
+ indexMethod (index) {
|
|
|
+ return ((this.seeList.pageNum - 1) * this.seeList.pageSize) + index + 1
|
|
|
+ },
|
|
|
+ showTip () {
|
|
|
+ this.tipDialog = true
|
|
|
+ },
|
|
|
+ goHandle (item) {
|
|
|
+ if (item == '前往升级') {
|
|
|
+ window.open('/swordfish/page_big_pc/free/svip/buy?type=upgrade')
|
|
|
+ this.tipDialog = false
|
|
|
+ } else {
|
|
|
+ $('.open-customer').unbind('click').trigger('click')
|
|
|
+ this.tipDialog = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ subPoint () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jypay/resourcePack/account',
|
|
|
+ type: 'POST',
|
|
|
+ contentType: 'application/x-www-form-urlencoded',
|
|
|
+ data: {
|
|
|
+ product: 'attachmentDownPack'
|
|
|
+ },
|
|
|
+ dataType: 'json'
|
|
|
+ }).done(res => {
|
|
|
+ if (res.error_msg === '' && res.data && res.data.data) {
|
|
|
+ this.points = {
|
|
|
+ total: 0,
|
|
|
+ usage: 0
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ var tempInfo = res.data.data[0]
|
|
|
+ this.points = {
|
|
|
+ total: tempInfo.number,
|
|
|
+ usage: tempInfo.number
|
|
|
+ }
|
|
|
+ if (this.points.usage > tempInfo.thirtyNum) {
|
|
|
+ this.points.usage = tempInfo.thirtyNum
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.warn(e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDatas () {
|
|
|
+ return {
|
|
|
+ queryTime: new Date(this.years, this.months - 1, 1).pattern('yyyy-MM'),
|
|
|
+ platform: 'PC',
|
|
|
+ productName: '附件下载包',
|
|
|
+ pageSize: this.seeList.pageSize,
|
|
|
+ pageNum: this.seeList.pageNum
|
|
|
+ }
|
|
|
+ },
|
|
|
+ subRecord () {
|
|
|
+ this.working = true
|
|
|
+ this.empty = false
|
|
|
+ $.ajax({
|
|
|
+ url: '/jypay/resourcePack/recordList',
|
|
|
+ type: 'POST',
|
|
|
+ contentType: 'application/x-www-form-urlencoded',
|
|
|
+ data: this.getDatas(),
|
|
|
+ dataType: 'json'
|
|
|
+ }).done(res => {
|
|
|
+ var _this = this
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ this.working = false
|
|
|
+ this.empty = true
|
|
|
+ if (res.data.total) {
|
|
|
+ this.seeList.total = res.data.total
|
|
|
+ }
|
|
|
+ if (!res.data.list) {
|
|
|
+ res.data.list = []
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.seeList.list = this.seeList.list.concat(res.data.list)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onPageChange (page) {
|
|
|
+ this.seeList.pageNum = page
|
|
|
+ this.seeList.list = []
|
|
|
+ this.subRecord()
|
|
|
+ },
|
|
|
+ dateHandler (val) {
|
|
|
+ this.years = val.getFullYear()
|
|
|
+ this.months = val.getMonth() + 1
|
|
|
+ this.seeList.pageNum = 1
|
|
|
+ this.seeList.total = 0
|
|
|
+ this.seeList.list = []
|
|
|
+ this.subRecord()
|
|
|
+ },
|
|
|
+ detailed (ids) {
|
|
|
+ window.open('/swordfish/page_big_pc/unit_portrayal/' + ids, '_blank')
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|