123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902 |
- var selectDataIds = []
- var inInjectBI = getParam('report') === 'bi' // 是否bi嵌入
- if (inInjectBI) {
- $('body').addClass('in-bi')
- }
- var vm = new Vue({
- el: '.search-content',
- delimiters: ['${', '}'],
- components: {
- selectListComponent: selectListComponent,
- dateTimeComponent: dateTimeComponent,
- selectLevel2Component: selectLevel2Component,
- articleItemComponent: articleItemComponent,
- noData: noDataComponent
- },
- data: function () {
- return {
- sessKey: '$data-collection-index',
- inInjectBI: inInjectBI,
- bi: {
- loading: false,
- addedIds: []
- },
- powerInfo: {},
- powerLoaded: false,
- toast: {
- show: false,
- content: '暂无数据'
- },
- buyclassMap: buyclassArr,
- tagList: [],
- tagSelectList: [],
- buyerPhoneOptions: [
- {
- label: '不限',
- value: 0
- },
- {
- label: '有联系方式',
- value: 1
- },
- {
- label: '无联系方式',
- value: -1
- }
- ],
- filterState: {
- tags: [],
- selectTime: '',
- timeSelectorObj: {
- start: '',
- end: '',
- exact: ''
- },
- buyerclass: [],
- buyerclassObj: {}, // buyerclass原始选中数据
- buyerPhone: 0, // 采购单位联系方式
- winnerPhone: 0, // 中标企业联系方式
- },
- listState: {
- listType: 'line', // line/table
- loaded: false, // 是否已经搜索过
- loading: false,
- pageNum: 1, // 当前页
- pageSize: 50, // 每页多少条数据
- total: 0, // 一共多少条数据
- list: [] // 查询请求返回的数据
- },
- currentPageAllChecked: false,
- currentSelectItems: [],
- tagDrawer: {
- dialogShow: false,
- toastShow: false,
- show: false,
- currentDelTagInfo: {}, // 当前要删除标签的信息
- },
- addTagInfo: {
- content: ''
- },
- powerDialogShow: false,
- urlFilterTagId: [],
- tableShowData: [],
- tableFirst20: [],
- checkNum: 0,
- exportChecked: false
- }
- },
- watch: {
- exportChecked (newval) {
- $.ajax({
- type: 'POST',
- url: '/front/dataExport/setDontPromptAgain',
- contentType: 'application/x-www-form-urlencoded',
- data: {
- status: newval ? '1' : '0'
- }
- })
- }
- },
- computed: {
- biEnv: function () {
- return this.inInjectBI
- },
- power: function () {
- return this.powerInfo.entniche || this.powerInfo.member || this.powerInfo.vip !== 0
- }
- },
- created: function () {
- var _this = this
- var tag = utils.getParam('tag')
- if (tag) {
- this.urlFilterTagId = tag.split(',')
- }
- if (this.biEnv) {
- this.getBiAddedProjects()
- }
- this.getPower(function () {
- if (_this.hasRestoreState()) {
- // 等TagList请求完成后在恢复数据
- _this.getTagList(function () {
- setTimeout(function () {
- var $data = _this.restorePageState()
- if (!$data) {
- _this.getList()
- }
- }, 0)
- })
- } else {
- _this.getTagList(function () {
- _this.getList()
- })
- }
- })
- var _this = this
- document.addEventListener('visibilitychange', function() {
- if (document.visibilityState === 'visible') {
- _this.getBidIsJoin()
- }
- })
- },
- methods: {
- showToast: function (content, timer, callback) {
- if (this.toast.show) return
- content = content || '暂无数据'
- timer = timer || 2000
- this.toast.content = content
- this.toast.show = true
- setTimeout(function () {
- this.toast.show = false
- callback && callback()
- }.bind(this), timer)
- },
- getPower: function (callback) {
- $.ajax({
- url: '/publicapply/bidcoll/power',
- type: 'POST',
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- this.powerInfo = res.data
- if (!this.power) {
- // this.listState.pageSize = 100
- }
- }
- }.bind(this),
- complete: function () {
- this.powerLoaded = true
- callback && callback()
- }.bind(this)
- })
- },
- getTagList: function (callback) {
- $.ajax({
- url: '/publicapply/bidcoll/getLabel',
- type: 'POST',
- success: function (res) {
- if (res.error_code === 0) {
- if (res.data) {
- this.tagList = res.data.reverse()
- } else {
- this.tagList = []
- }
- this.initSelectTagList()
- if (this.urlFilterTagId.length) {
- this.filterState.tags = this.filterState.tags.concat(this.urlFilterTagId)
- }
- callback && callback()
- }
- }.bind(this)
- })
- },
- getList: function () {
- var _this = this
- var data = {
- pagenum: this.listState.pageNum,
- pagesize: this.listState.pageSize,
- label: this.filterState.tags.join(','),
- selectTime: this.filterState.selectTime,
- buyerclass: this.filterState.buyerclass.join(','),
- buyerPhone: this.filterState.buyerPhone ? this.filterState.buyerPhone : 0,
- winnerPhone: this.filterState.winnerPhone ? this.filterState.winnerPhone : 0
- }
- this.listState.loading = true
- this.listState.loaded = false
- $.ajax({
- url: '/publicapply/bidcoll/list',
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify(data),
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- var list = res.data.res
- if (res.data.count) {
- _this.listState.total = res.data.count
- }
- // 给list添加额外属性
- if (list) {
- list.forEach(function (item, index) {
- item.selected = false
- selectDataIds.forEach((sum, i) => {
- if(item._id == sum) {
- item.selected = true
- }
- })
- if(!item.selected) {
- _this.currentPageAllChecked = false
- } else {
- _this.currentPageAllChecked = true
- }
- item.joinBid = undefined
- item.star = true
- item.index = _this.calcListIndex(index)
- try {
- item.visited = visitedPath.pathVisited(
- new VisitedPathItem(
- '/article/content/*.html',
- 'id=' + item._id
- )
- )
- } catch (error) {}
- })
- this.listState.list = list || []
- if (_this.listState.pageNum === 1 && _this.listState.pageSize >= 50) {
- _this.tableShowData = list || []
- _this.tableFirst20 = list.slice(0, 20)
- }
- // 获取参标数据
- _this.getBidIsJoin()
- }
- } else {
- this.listState.total = 0
- this.listState.list = []
- }
- }.bind(this),
- complete: function () {
- this.checkAddedState()
- this.listState.loading = false
- this.listState.loaded = true
- }.bind(this)
- })
- },
- bidCollectAction: function (ids, callback) {
- var binfo = []
- ids.forEach(function (item) {
- binfo.push({
- bid: item
- })
- })
- var data = {
- baction: 'R',
- binfo: binfo
- }
- $.ajax({
- url: '/publicapply/bidcoll/action',
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify(data),
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- selectDataIds = []
- callback && callback()
- }
- }.bind(this)
- })
- },
- addTagConfirmed: function () {
- var name = this.addTagInfo.content
- if (!name) return
- $.ajax({
- url: '/publicapply/bidcoll/addLabel',
- type: 'POST',
- data: {
- name: name
- },
- success: function (res) {
- if (res.error_code === 0 && res.data) {
- this.addTagInfo.content = ''
- this.tagList.unshift({
- count: 0,
- lanme: name,
- lid: res.data
- })
- // 数组去重
- this.tagList = utils.unique(this.tagList)
- this.initSelectTagList()
- // 重新请求数据
- this.filterState.tags = []
- this.doQuery()
- } else {
- // this.showToast(res.error_msg)
- this.showToast('标签已经存在,无需添加')
- }
- }.bind(this)
- })
- },
- resetListState: function () {
- var state = {
- loaded: false,
- loading: false,
- pageNum: 1, // 当前页
- pageSize: 50,
- total: 0, // 一共多少条数据
- list: []
- }
- Object.assign(this.listState, state)
- },
- onPageChange: function (p) {
- this.listState.pageNum = p
- var info = this.getSelectedIdArr()
- var ids = info.ids
- if(selectDataIds.length == 0) {
- selectDataIds = ids
- } else {
- ids.forEach((item, index) => {
- //避免重复添加(若存在元素时,不添加)
- if(!this.contains(selectDataIds, item)) {
- selectDataIds.push(item)
- }
- })
- }
- this.getList()
- },
- contains: function (arr, ele) {
- if(arr.length == 0){
- return;
- }
- var i = arr.length;
- while (i--) {
- if (arr[i] == ele) {
- return true;
- }
- }
- return false;
- },
- doQuery: function () {
- this.resetListState()
- this.getList()
- },
- initSelectTagList: function () {
- var arr = []
- this.tagList.forEach(function (item) {
- arr.push({
- label: item.lanme,
- value: item.lid,
- count: item.count
- })
- })
- this.tagSelectList = arr
- },
- tagFilterChange: function (tagList) {
- this.filterState.tags = tagList
- this.clearSelectState()
- this.doQuery()
- },
- dateTimeFilterChange: function (t) {
- this.filterState.timeSelectorObj = t
- var arr = []
- if (t.start) {
- arr.push(t.start / 1000)
- }
- if (t.end) {
- arr.push(t.end / 1000)
- }
- if (arr.length === 0) {
- this.filterState.selectTime = ''
- } else {
- this.filterState.selectTime = arr.join('_')
- }
- this.clearSelectState()
- this.doQuery()
- },
- buyerClassFilterChange: function (buyerclass) {
- if (this.power) {
- var buyerclassArr = []
- this.filterState.buyerclassObj = buyerclass
- for (var key in buyerclass) {
- buyerclassArr = buyerclassArr.concat(buyerclass[key])
- }
- this.filterState.buyerclass = buyerclassArr
- this.clearSelectState()
- this.doQuery()
- } else {
- this.$refs.buyerClassFilter.setState()
- this.filterState.buyerclass = ''
- this.powerDialogShow = true
- }
- },
- otherFilterChange: function (t) {
- if (this.power) {
- this.clearSelectState()
- this.doQuery()
- } else {
- this.filterState.buyerPhone = 0
- this.filterState.winnerPhone = 0
- this.powerDialogShow = true
- }
- },
- changeListType: function (type) {
- this.listState.listType = type
- },
- dataExport: function () {
- const _this = this
- //数据导出
- $.ajax({
- type: "POST",
- url: "/front/dataExport/getDontPromptAgain",
- contentType: "application/x-www-form-urlencoded",
- success: function (res) {
- if(res.error_code === 0) {
- // 数据导出-判断是否展示弹框
- if(res.isPrompt && _this.listState.total >= 20000) {
- $('.have-thousand-dialog').show()
- // 获取微信客服二维码
- if (window.customers && window.customers.length > 0) {
- const customerInfo = window.customers.filter(v => v.name === '高静')
- if (customerInfo) {
- const html = `<img src="${customerInfo[0].wxer}" alt="">`
- $('.custom-wx').html(html)
- }
- }
- } else {
- $('.have-thousand-dialog').hide()
- // _this.toDataExportEvent()
- }
- } else {
- $('.have-thousand-dialog').hide()
- // _this.toDataExportEvent()
- }
- },
- error: function(err) {
- // _this.toDataExportEvent()
- }
- })
- },
- toDataExportEvent: function () {
- this.onPageChange(this.listState.pageNum)
- var info = this.getSelectedIdArr()
- var ids = info.ids
- var data = null
- if (ids.length === 0 && selectDataIds.length === 0) {
- data = {
- label: this.filterState.tags.join(','),
- selectTime: this.filterState.selectTime,
- buyerclass: this.filterState.buyerclass.join(','),
- buyerPhone: this.filterState.buyerPhone ? this.filterState.buyerPhone : 0,
- winnerPhone: this.filterState.winnerPhone ? this.filterState.winnerPhone : 0
- }
- } else {
- data = {
- selectIds: selectDataIds.join(',')
- }
- }
- $.ajax({
- url: '/publicapply/dataexpoet/bycollection',
- type: 'POST',
- data: data,
- success: function (res) {
- if (res.error_code === 0) {
- if (res.data._id) {
- this.savePageState()
- this.listState.loaded = true
- location.href = '/front/dataExport/toCreateOrderPage/' + res.data._id
- }
- }
- }.bind(this)
- })
- },
- setCloseDialog () {
- $('.have-thousand-dialog').hide()
- },
- setCheckBox ($this, type) {
- $($this).hide()
- if (type === 'open') {
- $('.el-icon-check').show()
- } else {
- $('.bif-checkbox').show()
- }
- },
- checkNotEnoughOnePage: function (unStarCount) {
- // 当前数据总共多少页数据
- var totalPageCount = Math.ceil(this.listState.total / this.listState.pageSize)
- // 选中数量大于等于当前页数量
- var lastCount = this.listState.list.length - unStarCount
- // 剩余几页数据
- var lastPageCount = Math.ceil((this.listState.total - unStarCount) / this.listState.pageSize)
- // 取消了几页数据
- var unStarPageCount = totalPageCount - lastPageCount
- console.log('剩余几页数据', lastPageCount)
- return {
- notEnoughOnePage: lastCount <= 0,
- lastPageCount: lastPageCount,
- unStarPageCount: unStarPageCount
- }
- },
- getListAfterUnStar: function (unStarCount) {
- var unStarInfo = this.checkNotEnoughOnePage(unStarCount)
- if (unStarInfo.notEnoughOnePage) {
- var diff = this.listState.pageNum - unStarInfo.unStarPageCount
- if (diff <= 1) {
- this.doQuery()
- } else {
- this.onPageChange(diff)
- }
- } else {
- this.getList()
- }
- },
- // 批量取消收藏
- unStarSelected: function () {
- baiduEvent('列表页标讯收藏-星标') // 收藏按钮百度统计
- var _this = this
- var info = this.getSelectedIdArr()
- var ids = info.ids
- var selectedArr = info.arr
- if (ids.length === 0 && selectDataIds.length == 0) {
- return this.showToast('请选择收藏信息')
- }
- if(selectDataIds.length !== 0) {
- ids = selectDataIds
- }
- this.bidCollectAction(ids, function () {
- _this.showToast('已取消收藏', null)
- _this.getListAfterUnStar(ids.length)
- })
- },
- clearSelectState: function () {
- selectDataIds = []
- this.listState.list.forEach(function (item) {
- item.selected = selectDataIds.indexOf(item._id) !== -1
- })
- },
- unStarThis: function (item) {
- baiduEvent('列表页标讯收藏-星标') // 收藏按钮百度统计
- var _this = this
- this.bidCollectAction([item._id], function () {
- _this.showToast('已取消收藏', null, function () {})
- _this.getListAfterUnStar(1)
- })
- },
- getSelectedIdArr: function () {
- var arr = []
- var ids = []
- this.listState.list.forEach(function (item) {
- if (item.selected) {
- arr.push(item)
- ids.push(item._id)
- }
- })
- this.currentSelectItems = ids
- return {
- ids: ids,
- arr: arr
- }
- },
- toListDetail: function (item) {
- try {
- item.visited = true
- visitedPath.pathVisiting(
- new VisitedPathItem(
- '/article/content/*.html',
- 'id=' + item._id
- )
- )
- } catch (error) {}
- window.open('/article/content/' + item._id + '.html')
- },
- calcArticleItemTags: function (article) {
- var arr = []
- if (article.area) {
- arr.push(article.area)
- }
- if (article.buyerclass) {
- arr.push(article.buyerclass)
- }
- if (article.type) {
- arr.push(article.type)
- }
- if (article.budget) {
- arr.push(utils.moneyUnit(article.budget))
- }
- return arr
- },
- calcListIndex: function (index) {
- return (this.listState.pageSize * (this.listState.pageNum - 1)) + index + 1
- },
- calcMoney: function (m) {
- if (m) {
- return parseInt(utils.moneyUnit(m))
- } else {
- return ''
- }
- },
- calcArticleType: function (type) {
- if (type) {
- return type + '公告'
- } else {
- return ''
- }
- },
- calcTime: function (time, pattern) {
- if (time) {
- var t = new Date(time)
- return t.pattern(pattern)
- } else {
- return ''
- }
- },
- allCheckboxChange: function (state) {
- let _this = this
- this.listState.list.forEach(function (item) {
- if(state) {
- if(!_this.contains(selectDataIds,item._id)) {
- selectDataIds.push(item._id)
- }
- } else {
- selectDataIds.forEach(function(v,index) {
- if (v == item._id) {
- selectDataIds.splice(index, 1)
- }
- })
- }
- item.selected = state
- })
- this.checkNum = selectDataIds? selectDataIds.length : 0
- },
- listItemCheckboxChange: function (data, check) {
- if (check) {
- if(!this.contains(selectDataIds, data)) {
- selectDataIds.push(data)
- }
- } else {
- selectDataIds.forEach(function(v,index) {
- if (v == data) {
- selectDataIds.splice(index, 1)
- }
- })
- }
- var arr = []
- this.listState.list.forEach(function (item) {
- arr.push(item.selected)
- })
- this.currentPageAllChecked = arr.indexOf(false) === -1
- this.checkNum = selectDataIds? selectDataIds.length : 0
- },
- openTagDrawer: function () {
- this.tagDrawer.show = true
- },
- openVipPage: function () {
- window.open('/front/subscribe.html')
- },
- drawerConfirm: function () {
- this.tagDrawer.show = false
- },
- drawerCancel: function () {
- this.tagDrawer.show = false
- },
- delThisTag: function (tag) {
- this.tagDrawer.dialogShow = true
- for (var key in tag) {
- this.$set(this.tagDrawer.currentDelTagInfo, key, tag[key])
- }
- },
- delThisTagConfirm: function () {
- var _this = this
- var data = {
- lids: this.tagDrawer.currentDelTagInfo.value,
- lname: this.tagDrawer.currentDelTagInfo.label,
- laction: 'D'
- }
- $.ajax({
- url: '/publicapply/bidcoll/label',
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify(data),
- success: function (res) {
- if (res.error_code === 0) {
- _this.tagDrawer.dialogShow = false
- if (res.data) {
- _this.tagDrawer.toastShow = true
- setTimeout(function () {
- _this.tagDrawer.toastShow = false
- _this.getTagList()
- // 重新请求数据
- _this.filterState.tags = []
- _this.doQuery()
- }, 1500)
- }
- }
- }.bind(this)
- })
- },
- savePageState: function () {
- var data = {
- filterState: this.filterState,
- listState: this.listState,
- currentSelectItems: this.currentSelectItems,
- currentPageAllChecked: this.currentPageAllChecked,
- selectDataIds: selectDataIds,
- tableShowData: this.tableShowData,
- tableFirst20: this.tableFirst20
- }
- this.listState.loaded = true
- sessionStorage.setItem(this.sessKey, JSON.stringify(data))
- },
- hasRestoreState: function () {
- return !!sessionStorage.getItem(this.sessKey)
- },
- restorePageState: function () {
- var $data = sessionStorage.getItem(this.sessKey)
- if ($data) {
- $data = JSON.parse($data)
- // 恢复数据
- Object.assign(this.filterState, $data.filterState || {})
- Object.assign(this.listState, $data.listState || {})
- Object.assign(this.currentSelectItems, $data.currentSelectItems || {})
- Object.assign(this.tableShowData, $data.tableShowData || [])
- Object.assign(this.tableFirst20, $data.tableFirst20 || [])
- selectDataIds = $data.selectDataIds
- this.listState.loading = false
- // 恢复页面状态
- this.currentPageAllChecked = $data.currentPageAllChecked
- sessionStorage.removeItem(this.sessKey)
- }
- return !!$data
- },
- onSizeChange: function (val) {
- this.listState.pageSize = val
- this.listState.pageNum = 1
- this.onPageChange(this.listState.pageNum)
- },
- getBiAddedProjects: function () {
- $.ajax({
- url: '/jyapi/biService/getInfoId',
- type: 'POST',
- success: function (res) {
- if (res && res.error_code === 0 && $.isArray(res.data)) {
- this.bi.addedIds = res.data
- this.checkAddedState()
- }
- }.bind(this)
- })
- },
- checkAddedState: function () {
- var _this = this
- var addedIds = this.bi.addedIds || []
- if (!$.isArray(addedIds)) return
- if (addedIds.length === 0) return
- this.listState.list.forEach(function (item) {
- var added = addedIds.indexOf(item._id) !== -1
- _this.$set(item, 'added', added)
- })
- },
- // 单个添加
- biAddProject: function (item) {
- if (item.added) return
- const id = item._id
- if (!id) return
- this.biBatchAddRequest([id])
- },
- // bi下批量操作
- biBatchAddSelected: function () {
- var ids = selectDataIds
- if (!$.isArray(ids)) return
- if (ids.length === 0) {
- return this.showToast('请选择要添加的信息')
- }
- this.biBatchAddRequest(ids)
- },
- biBatchAddRequest: function (ids) {
- if (this.bi.loading) return
- this.bi.loading = true
- var _this = this
- var data = {
- info_id: ids.join(','),
- source: 1
- }
- $.ajax({
- url: '/jyapi/biService/addProject',
- type: 'POST',
- contentType: 'application/json',
- data: JSON.stringify(data),
- success: function (res) {
- if (res) {
- if (res.error_code === 0) {
- if (res.data && res.data.status === 1) {
- _this.clearSelectState()
- _this.showToast('添加成功')
- }
- _this.getBiAddedProjects()
- } else {
- if (res.error_msg) {
- _this.showToast(res.error_msg)
- }
- }
- }
- },
- complete: function () {
- _this.bi.loading = false
- }
- })
- },
- // 获取参标数据
- getBidIsJoin: function () {
- var _this = this
- var paramsData = {
- ids: _this.listState.list.map(function(item){
- return item._id
- }).join()
- }
- $.ajax({
- type: 'post',
- contentType: "application/json",
- url: '/jyapi/jybx/core/participate/show?t=' + Date.now(),
- data: JSON.stringify(paramsData),
- dataType: 'json',
- success: function (r) {
- if (r.data && r.error_code == 0) {
- var data = r.data || []
- if(data.length > 0) {
- Bidrenewal_Dialog.initBidrenewalDialog = true // 加载参标状态更新弹窗
- }
- data.forEach(function(item) {
- _this.listState.list.forEach(function(temp) {
- if (item.id == temp._id) {
- temp.joinBid = Boolean(item.value)
- }
- })
- })
- }
- }
- })
- },
- /******参标********/
- /**
- * 参标、终止参标
- * @param action in:参标;out:终止参标;transfer:划转
- * @param bidIds 招标信息id(加密) 必传
- * @param projectIds 项目信息id ,多个,号隔开 划转和终止参标必传(bidIds和projectIds必传一个)
- * @param callback
- */
- joinBidAction: function (item) {
- if(item.joinBid) {
- return this.showToast('如需终止参标,需要在详情页进行操作。')
- }
- var params = {
- bidIds: item._id
- }
- var _this = this
- $.ajax({
- type:'post',
- contentType: "application/json",
- url:'/jyapi/jybx/core/participate/in/info',
- data: JSON.stringify(params),
- dataType: 'json',
- success: function(r){
- if (r && r.data && r.error_code == 0) {
- item.joinBid = true
- // _this.showToast('已参标,请前往我的参标项目列表查看。')
- try{
- Bidrenewal_Dialog.sendId(item._id)
- window.$BidrenewalDialog.open()
- }catch(e){
- setTimeout(function() {
- Bidrenewal_Dialog.sendId(item._id)
- window.$BidrenewalDialog.open()
- } , 100)
- }
- } else if(r.error_code == -1) {
- var msg = r.error_msg || '参标错误,请稍后重试'
- _this.showToast(msg)
- }
- }
- })
- },
- goCollect: function () {
- window.open('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(location.origin + '/jylab/supsearch/index.html'))
- }
- }
- })
|