|
|
@@ -94,463 +94,466 @@ import Reminder from './reminder.vue'
|
|
|
import { sendSmsList } from './sendSms'
|
|
|
import { Notify } from 'vant'
|
|
|
import { Toast } from 'vant'
|
|
|
+import { dbSqlConfig } from '@/constant'
|
|
|
|
|
|
export default {
|
|
|
- components: {
|
|
|
- IbpsMoreSearch,
|
|
|
- IbpsTypeTree,
|
|
|
- IbpsAvatar,
|
|
|
- IbpsToolbar,
|
|
|
- IbpsListResultPage,
|
|
|
- IbpsBpmnFormrenderDialog,
|
|
|
- Reminder
|
|
|
- },
|
|
|
- mixins: [random, bpmnStatus],
|
|
|
- data() {
|
|
|
- const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
|
|
|
- const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
- const N = new Date(currentTime).getTime()
|
|
|
- return {
|
|
|
- visible: true,
|
|
|
- currentTime: N,
|
|
|
- reminderSon: false,
|
|
|
- sonData: '',
|
|
|
- userId: userId,
|
|
|
- footText: false,
|
|
|
- showPop: false,
|
|
|
- noData: false,
|
|
|
- showConfirmationBoxList: true,
|
|
|
- countTotal: {},
|
|
|
- examPopup: '',
|
|
|
- ReachBottomShow: false,
|
|
|
- moreSearchPopup: false,
|
|
|
- searchForms: {
|
|
|
- forms: [
|
|
|
- // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
|
|
|
- // { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
|
|
|
- { prop: 'examName', label: '考试名称', fieldType: 'text' },
|
|
|
- { prop: 'bankName', label: '题库名称', fieldType: 'text' },
|
|
|
- {
|
|
|
- prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
|
|
|
- { value: 'trainingExam', label: '培训考试' },
|
|
|
- { value: 'POCTtraining', label: 'POCT培训' },
|
|
|
- { value: 'selfAssessment', label: '自主考核' },
|
|
|
- { value: 'routine', label: '常规' }
|
|
|
- ]
|
|
|
- },
|
|
|
- { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
|
|
|
- { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
- // { prop: ['Q^startDate^DL^yyyy-MM-dd', 'Q^startDate^DG^yyyy-MM-dd'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
|
|
|
- // { prop: ['Q^limitDate^DL^yyyy-MM-dd', 'Q^limitDate^DG^yyyy-MM-dd'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
- ]
|
|
|
- },
|
|
|
- mainActions: [{
|
|
|
- 'name': '信息催办',
|
|
|
- 'type': 'primary',
|
|
|
- 'callback': this.batchReminders
|
|
|
- }
|
|
|
- // {
|
|
|
- // 'name': '消息催办',
|
|
|
- // 'type': 'default',
|
|
|
- // 'callback': this.smsReminders
|
|
|
- // }
|
|
|
- ],
|
|
|
- stateActive: false,
|
|
|
- subject: '',
|
|
|
- moreSubject: '',
|
|
|
- subjectTitle: '',
|
|
|
- typeId: '',
|
|
|
- moreParams: {},
|
|
|
- listData: [],
|
|
|
- pagination: {},
|
|
|
- sorts: {},
|
|
|
+ components: {
|
|
|
+ IbpsMoreSearch,
|
|
|
+ IbpsTypeTree,
|
|
|
+ IbpsAvatar,
|
|
|
+ IbpsToolbar,
|
|
|
+ IbpsListResultPage,
|
|
|
+ IbpsBpmnFormrenderDialog,
|
|
|
+ Reminder
|
|
|
+ },
|
|
|
+ mixins: [random, bpmnStatus],
|
|
|
+ data() {
|
|
|
+ const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
|
|
|
+ const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
+ const N = new Date(currentTime).getTime()
|
|
|
+ return {
|
|
|
+ visible: true,
|
|
|
+ currentTime: N,
|
|
|
+ reminderSon: false,
|
|
|
+ sonData: '',
|
|
|
+ userId: userId,
|
|
|
+ footText: false,
|
|
|
+ showPop: false,
|
|
|
+ noData: false,
|
|
|
+ showConfirmationBoxList: true,
|
|
|
+ countTotal: {},
|
|
|
+ examPopup: '',
|
|
|
+ ReachBottomShow: false,
|
|
|
+ moreSearchPopup: false,
|
|
|
+ searchForms: {
|
|
|
+ forms: [
|
|
|
+ // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
|
|
|
+ // { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
|
|
|
+ { prop: 'examName', label: '考试名称', fieldType: 'text' },
|
|
|
+ { prop: 'bankName', label: '题库名称', fieldType: 'text' },
|
|
|
+ {
|
|
|
+ prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
|
|
|
+ { value: 'trainingExam', label: '培训考试' },
|
|
|
+ { value: 'POCTtraining', label: 'POCT培训' },
|
|
|
+ { value: 'selfAssessment', label: '自主考核' },
|
|
|
+ { value: 'routine', label: '常规' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
|
|
|
+ { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
+ // { prop: ['Q^startDate^DL^yyyy-MM-dd', 'Q^startDate^DG^yyyy-MM-dd'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
|
|
|
+ // { prop: ['Q^limitDate^DL^yyyy-MM-dd', 'Q^limitDate^DG^yyyy-MM-dd'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ mainActions: [{
|
|
|
+ 'name': '信息催办',
|
|
|
+ 'type': 'primary',
|
|
|
+ 'callback': this.batchReminders
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // 'name': '消息催办',
|
|
|
+ // 'type': 'default',
|
|
|
+ // 'callback': this.smsReminders
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ stateActive: false,
|
|
|
+ subject: '',
|
|
|
+ moreSubject: '',
|
|
|
+ subjectTitle: '',
|
|
|
+ typeId: '',
|
|
|
+ moreParams: {},
|
|
|
+ listData: [],
|
|
|
+ pagination: {},
|
|
|
+ sorts: {},
|
|
|
|
|
|
- loading: false,
|
|
|
- finished: false,
|
|
|
- refreshing: false,
|
|
|
- resultType: 'init',
|
|
|
- errorType: null,
|
|
|
- resultMessage: null,
|
|
|
+ loading: false,
|
|
|
+ finished: false,
|
|
|
+ refreshing: false,
|
|
|
+ resultType: 'init',
|
|
|
+ errorType: null,
|
|
|
+ resultMessage: null,
|
|
|
|
|
|
- checkMode: false,
|
|
|
- checkedIds: [],
|
|
|
- proInstId: '',
|
|
|
- defId: '',
|
|
|
- formrenderVisible: false,
|
|
|
- formrenderTitle: '',
|
|
|
- typeTreePopup: false,
|
|
|
- keyword: '',
|
|
|
- name: '全部',
|
|
|
- current: 0,
|
|
|
- startTime: [],
|
|
|
- endTime: []
|
|
|
+ checkMode: false,
|
|
|
+ checkedIds: [],
|
|
|
+ proInstId: '',
|
|
|
+ defId: '',
|
|
|
+ formrenderVisible: false,
|
|
|
+ formrenderTitle: '',
|
|
|
+ typeTreePopup: false,
|
|
|
+ keyword: '',
|
|
|
+ name: '全部',
|
|
|
+ current: 0,
|
|
|
+ startTime: [],
|
|
|
+ endTime: []
|
|
|
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState('ibps/user', [
|
|
|
- 'info'
|
|
|
- ]),
|
|
|
- rightText() {
|
|
|
- return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
|
|
|
- },
|
|
|
- selectedIds() {
|
|
|
- return this.checkedIds.join(',')
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState('ibps/user', [
|
|
|
+ 'info'
|
|
|
+ ]),
|
|
|
+ rightText() {
|
|
|
+ return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
|
|
|
},
|
|
|
+ selectedIds() {
|
|
|
+ return this.checkedIds.join(',')
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- if (this.showPop === true) {
|
|
|
- // this.showConfirmationBoxList = true
|
|
|
- this.$refs.childPop.parentSubmit()
|
|
|
- this.showPop = false
|
|
|
- next(false)
|
|
|
- } else {
|
|
|
- next()
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if (this.showPop === true) {
|
|
|
+ // this.showConfirmationBoxList = true
|
|
|
+ this.$refs.childPop.parentSubmit()
|
|
|
+ this.showPop = false
|
|
|
+ next(false)
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.setBrowseTime()
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ prompt(item, type) {
|
|
|
+ if (type === 'mesg') {
|
|
|
+ Notify({ type: 'warning', message: `上次消息催办时间为${item.ti_xing_shi_jian_.substring(0, 16)},距今不足两小时,请勿频繁催办!` })
|
|
|
+ } else {
|
|
|
+ Notify({ type: 'warning', message: `上次短信催办时间为${item.duan_xin_shi_jian.substring(0, 16)},距今不足两小时,请勿频繁催办!` })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 设置定时器
|
|
|
+ setBrowseTime() {
|
|
|
+ this.clearTimeSet = setInterval(() => {
|
|
|
+ this.currentTime += 1000
|
|
|
+ }, 1000)
|
|
|
+ },
|
|
|
+ sendFunction(listData) {
|
|
|
+ const sendNotice = (req, ups) => {
|
|
|
+ req.forEach((item, i) => {
|
|
|
+ this.$common.sendMsg(item)
|
|
|
+ })
|
|
|
+ updateTimes(ups)
|
|
|
+ }
|
|
|
+ // 更新数据并重新渲染
|
|
|
+ const updateTimes = req => {
|
|
|
+ const params = {
|
|
|
+ tableName: 't_gqswb',
|
|
|
+ updList: req
|
|
|
+ }
|
|
|
+ this.$common.request('update', JSON.stringify(params)).then(() => {
|
|
|
+ Notify({ type: 'success', message: '消息催办成功!' })
|
|
|
+ this.onRefreshPage()
|
|
|
+ })
|
|
|
+ // this.$common.request('update', JSON.stringify(params)).then(() => {
|
|
|
+ // template.$message.success('消息催办成功')
|
|
|
+ // template.handleAction('search', position, [], [], 0, { button_type: 'search' })
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ const msgContent = {
|
|
|
+ soon: '即将超时,请及时处理!',
|
|
|
+ overtime: '已超时,请及时处理!'
|
|
|
+ }
|
|
|
+ const msgTitle = {
|
|
|
+ soon: '计划事务即将到期提醒',
|
|
|
+ overtime: '事务超时提醒'
|
|
|
+ }
|
|
|
+ const noticeList = []
|
|
|
+ const upList = []
|
|
|
+ let flag = false
|
|
|
+ let msg = ''
|
|
|
+ const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
+ console.log('currentTime', currentTime)
|
|
|
+ listData.forEach(item => {
|
|
|
+ const notice = {
|
|
|
+ subject: msgTitle[item.guo_qi_zhuang_tai],
|
|
|
+ content: `${item.shi_wu_ming_cheng}【${item.shi_wu_shuo_ming_}】${msgContent[item.guo_qi_zhuang_tai]}`,
|
|
|
+ receiverId: item.chu_li_ren_id_,
|
|
|
+ canreplay: '0'
|
|
|
+ }
|
|
|
+ const up = {
|
|
|
+ where: {
|
|
|
+ id_: item.id_
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ ti_xing_ci_shu_: parseInt(item.ti_xing_ci_shu_) + 1,
|
|
|
+ ti_xing_shi_jian_: currentTime
|
|
|
+ }
|
|
|
+ }
|
|
|
+ noticeList.push(notice)
|
|
|
+ upList.push(up)
|
|
|
+ // 校验提醒时间 (间隔不足2小时不允许发送)
|
|
|
+ const D = new Date(item.ti_xing_shi_jian_).getTime()
|
|
|
+ const N = new Date(currentTime).getTime()
|
|
|
+ if (N - D < 7200000) {
|
|
|
+ flag = true
|
|
|
+ msg = `事务【${item.shi_wu_ming_cheng}】上次消息催办时间为${item.ti_xing_shi_jian_},距今不足两小时,请勿频繁催办!`
|
|
|
}
|
|
|
+ })
|
|
|
+ if (flag) {
|
|
|
+ Notify({ type: 'primary', message: msg })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // updateTimes(upList)
|
|
|
+ sendNotice(noticeList, upList)
|
|
|
},
|
|
|
- created() {
|
|
|
- this.setBrowseTime()
|
|
|
+ overlayShow(item) {
|
|
|
+ this.reminderSon = true
|
|
|
+ this.sonData = item
|
|
|
},
|
|
|
-
|
|
|
- methods: {
|
|
|
- prompt(item, type) {
|
|
|
- if (type === 'mesg') {
|
|
|
- Notify({ type: 'warning', message: `上次消息催办时间为${item.ti_xing_shi_jian_.substring(0, 16)},距今不足两小时,请勿频繁催办!` })
|
|
|
- } else {
|
|
|
- Notify({ type: 'warning', message: `上次短信催办时间为${item.duan_xin_shi_jian.substring(0, 16)},距今不足两小时,请勿频繁催办!` })
|
|
|
- }
|
|
|
- },
|
|
|
- // 设置定时器
|
|
|
- setBrowseTime() {
|
|
|
- this.clearTimeSet = setInterval(() => {
|
|
|
- this.currentTime += 1000
|
|
|
- }, 1000)
|
|
|
- },
|
|
|
- sendFunction(listData) {
|
|
|
- const sendNotice = (req, ups) => {
|
|
|
- req.forEach((item, i) => {
|
|
|
- this.$common.sendMsg(item)
|
|
|
- })
|
|
|
- updateTimes(ups)
|
|
|
- }
|
|
|
- // 更新数据并重新渲染
|
|
|
- const updateTimes = req => {
|
|
|
- const params = {
|
|
|
- tableName: 't_gqswb',
|
|
|
- updList: req
|
|
|
- }
|
|
|
- this.$common.request('update', JSON.stringify(params)).then(() => {
|
|
|
- Notify({ type: 'success', message: '消息催办成功!' })
|
|
|
- this.onRefreshPage()
|
|
|
- })
|
|
|
- // this.$common.request('update', JSON.stringify(params)).then(() => {
|
|
|
- // template.$message.success('消息催办成功')
|
|
|
- // template.handleAction('search', position, [], [], 0, { button_type: 'search' })
|
|
|
- // })
|
|
|
- }
|
|
|
- const msgContent = {
|
|
|
- soon: '即将超时,请及时处理!',
|
|
|
- overtime: '已超时,请及时处理!'
|
|
|
- }
|
|
|
- const msgTitle = {
|
|
|
- soon: '计划事务即将到期提醒',
|
|
|
- overtime: '事务超时提醒'
|
|
|
- }
|
|
|
- const noticeList = []
|
|
|
- const upList = []
|
|
|
- let flag = false
|
|
|
- let msg = ''
|
|
|
- const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
- console.log('currentTime', currentTime)
|
|
|
- listData.forEach(item => {
|
|
|
- const notice = {
|
|
|
- subject: msgTitle[item.guo_qi_zhuang_tai],
|
|
|
- content: `${item.shi_wu_ming_cheng}【${item.shi_wu_shuo_ming_}】${msgContent[item.guo_qi_zhuang_tai]}`,
|
|
|
- receiverId: item.chu_li_ren_id_,
|
|
|
- canreplay: '0'
|
|
|
- }
|
|
|
- const up = {
|
|
|
- where: {
|
|
|
- id_: item.id_
|
|
|
- },
|
|
|
- param: {
|
|
|
- ti_xing_ci_shu_: parseInt(item.ti_xing_ci_shu_) + 1,
|
|
|
- ti_xing_shi_jian_: currentTime
|
|
|
- }
|
|
|
- }
|
|
|
- noticeList.push(notice)
|
|
|
- upList.push(up)
|
|
|
- // 校验提醒时间 (间隔不足2小时不允许发送)
|
|
|
- const D = new Date(item.ti_xing_shi_jian_).getTime()
|
|
|
- const N = new Date(currentTime).getTime()
|
|
|
- if (N - D < 7200000) {
|
|
|
- flag = true
|
|
|
- msg = `事务【${item.shi_wu_ming_cheng}】上次消息催办时间为${item.ti_xing_shi_jian_},距今不足两小时,请勿频繁催办!`
|
|
|
- }
|
|
|
- })
|
|
|
- if (flag) {
|
|
|
- Notify({ type: 'primary', message: msg })
|
|
|
- return
|
|
|
- }
|
|
|
- // updateTimes(upList)
|
|
|
- sendNotice(noticeList, upList)
|
|
|
- },
|
|
|
- overlayShow(item) {
|
|
|
- this.reminderSon = true
|
|
|
- this.sonData = item
|
|
|
- },
|
|
|
- son() {
|
|
|
- this.reminderSon = false
|
|
|
- },
|
|
|
- onClick(item, index) {
|
|
|
- if (this.checkMode) {
|
|
|
- this.$refs.checkboxes[index].toggle()
|
|
|
- }
|
|
|
- },
|
|
|
- // 信息批量催办
|
|
|
- batchReminders() {
|
|
|
- // console.log('进入催办函数', this.checkedIds)
|
|
|
- if (this.checkedIds.length === 0) {
|
|
|
- this.$notify({
|
|
|
- type: 'warning',
|
|
|
- message: this.$t('common.dialog.selectedRecords')
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.getSMSInfo(this.checkedIds).then(res => {
|
|
|
- this.sendFunction(res)
|
|
|
- })
|
|
|
- },
|
|
|
- // 消息批量催办
|
|
|
- smsReminders() {
|
|
|
- if (this.checkedIds.length === 0) {
|
|
|
- this.$notify({
|
|
|
- type: 'warning',
|
|
|
- message: this.$t('common.dialog.selectedRecords')
|
|
|
- })
|
|
|
- return
|
|
|
+ son() {
|
|
|
+ this.reminderSon = false
|
|
|
+ },
|
|
|
+ onClick(item, index) {
|
|
|
+ if (this.checkMode) {
|
|
|
+ this.$refs.checkboxes[index].toggle()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 信息批量催办
|
|
|
+ batchReminders() {
|
|
|
+ // console.log('进入催办函数', this.checkedIds)
|
|
|
+ if (this.checkedIds.length === 0) {
|
|
|
+ this.$notify({
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('common.dialog.selectedRecords')
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getSMSInfo(this.checkedIds).then(res => {
|
|
|
+ this.sendFunction(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 消息批量催办
|
|
|
+ smsReminders() {
|
|
|
+ if (this.checkedIds.length === 0) {
|
|
|
+ this.$notify({
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('common.dialog.selectedRecords')
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getSMSInfo(this.checkedIds).then(res => {
|
|
|
+ res.forEach(item => {
|
|
|
+ this.smsFunction(item)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询所有详细信息
|
|
|
+ getSMSInfo(list) {
|
|
|
+ const sql = `select * from t_gqswb`
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$common.request(dbSqlConfig ? 'query' : 'sql', dbSqlConfig ? { key: 'yddksgqswbcx', params: [null] } : sql).then(res => {
|
|
|
+ const listData = []
|
|
|
+ res.variables.data.forEach(item => {
|
|
|
+ if (list.includes(item.id_)) {
|
|
|
+ listData.push(item)
|
|
|
}
|
|
|
- this.getSMSInfo(this.checkedIds).then(res => {
|
|
|
- res.forEach(item => {
|
|
|
- this.smsFunction(item)
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- // 查询所有详细信息
|
|
|
- getSMSInfo(list) {
|
|
|
- const sql = `select * from t_gqswb`
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$common.request('sql', sql).then(res => {
|
|
|
- const listData = []
|
|
|
- res.variables.data.forEach(item => {
|
|
|
- if (list.includes(item.id_)) {
|
|
|
- listData.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(listData)// 将处理后的数据作为参数传递给resolve
|
|
|
- }).catch(err => {
|
|
|
- reject(err)
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- // 单条数据催办
|
|
|
- sendSystemInfo(item) {
|
|
|
- this.sendFunction([item])
|
|
|
- },
|
|
|
- // 单条短信信息发布
|
|
|
- sendSmsInfo(item) {
|
|
|
- // console.log('发送短信消息', item)
|
|
|
- this.smsFunction(item)
|
|
|
- // sendSmsList().then(res=>{
|
|
|
- // console.log('发送短信成功', res);
|
|
|
- // })
|
|
|
- },
|
|
|
- // 短信催办函数
|
|
|
- smsFunction(item) {
|
|
|
- if (item.chu_li_ren_dian_h) {
|
|
|
- const obj = {
|
|
|
- sig: item.id_,
|
|
|
- list: [
|
|
|
- { chu_li_ren_: item.chu_li_ren_ming_, chu_li_ren_dian_h: item.chu_li_ren_dian_h, ren_wu_ming_cheng: item.shi_wu_ming_cheng }
|
|
|
- ]
|
|
|
- }
|
|
|
- // 获取当时时间
|
|
|
- const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
- const D = new Date(item.duan_xin_shi_jian).getTime()
|
|
|
- const N = new Date(currentTime).getTime()
|
|
|
- if (N - D < 7200000) {
|
|
|
- Notify({ type: 'primary', message: `事务【${item.shi_wu_ming_cheng}】上次信息催办时间为${item.duan_xin_shi_jian},距今不足两小时,请勿频繁催办!` })
|
|
|
- return
|
|
|
+ })
|
|
|
+ resolve(listData)// 将处理后的数据作为参数传递给resolve
|
|
|
+ }).catch(err => {
|
|
|
+ reject(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 单条数据催办
|
|
|
+ sendSystemInfo(item) {
|
|
|
+ this.sendFunction([item])
|
|
|
+ },
|
|
|
+ // 单条短信信息发布
|
|
|
+ sendSmsInfo(item) {
|
|
|
+ // console.log('发送短信消息', item)
|
|
|
+ this.smsFunction(item)
|
|
|
+ // sendSmsList().then(res=>{
|
|
|
+ // console.log('发送短信成功', res);
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ // 短信催办函数
|
|
|
+ smsFunction(item) {
|
|
|
+ if (item.chu_li_ren_dian_h) {
|
|
|
+ const obj = {
|
|
|
+ sig: item.id_,
|
|
|
+ list: [
|
|
|
+ { chu_li_ren_: item.chu_li_ren_ming_, chu_li_ren_dian_h: item.chu_li_ren_dian_h, ren_wu_ming_cheng: item.shi_wu_ming_cheng }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ // 获取当时时间
|
|
|
+ const currentTime = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace('T', ' ')
|
|
|
+ const D = new Date(item.duan_xin_shi_jian).getTime()
|
|
|
+ const N = new Date(currentTime).getTime()
|
|
|
+ if (N - D < 7200000) {
|
|
|
+ Notify({ type: 'primary', message: `事务【${item.shi_wu_ming_cheng}】上次信息催办时间为${item.duan_xin_shi_jian},距今不足两小时,请勿频繁催办!` })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ sendSmsList(obj).then((res) => {
|
|
|
+ // console.log('短信催办成功', res)
|
|
|
+ const up = {
|
|
|
+ tableName: 't_gqswb',
|
|
|
+ updList: [
|
|
|
+ {
|
|
|
+ where: {
|
|
|
+ id_: item.id_
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ duan_xin_ci_shu_: parseInt(item.duan_xin_ci_shu_) + 1,
|
|
|
+ duan_xin_shi_jian: this.getCurrentDateTime()
|
|
|
}
|
|
|
- sendSmsList(obj).then((res) => {
|
|
|
- // console.log('短信催办成功', res)
|
|
|
- const up = {
|
|
|
- tableName: 't_gqswb',
|
|
|
- updList: [
|
|
|
- {
|
|
|
- where: {
|
|
|
- id_: item.id_
|
|
|
- },
|
|
|
- param: {
|
|
|
- duan_xin_ci_shu_: parseInt(item.duan_xin_ci_shu_) + 1,
|
|
|
- duan_xin_shi_jian: this.getCurrentDateTime()
|
|
|
- }
|
|
|
- }]
|
|
|
- }
|
|
|
- this.$common.request('update', JSON.stringify(up)).then(() => {
|
|
|
- // 更改数据库信息成功
|
|
|
- console.log('更改数据库信息成功')
|
|
|
- Notify({ type: 'success', message: '短信催办成功!' })
|
|
|
- this.onRefreshPage()
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- Notify({ type: 'danger', message: '还未上传手机号' })
|
|
|
- }
|
|
|
- },
|
|
|
- getCurrentDateTime() {
|
|
|
- const now = new Date()
|
|
|
- const year = now.getFullYear()
|
|
|
- const month = ('0' + (now.getMonth() + 1)).slice(-2) // 月份从0开始,所以加1,并补零
|
|
|
- const day = ('0' + now.getDate()).slice(-2) // 补零
|
|
|
- const hours = ('0' + now.getHours()).slice(-2) // 补零
|
|
|
- const minutes = ('0' + now.getMinutes()).slice(-2) // 补零
|
|
|
- const seconds = ('0' + now.getSeconds()).slice(-2) // 补零
|
|
|
- return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
- },
|
|
|
- updataSet(v) {
|
|
|
- this.showPop = v
|
|
|
- },
|
|
|
- generateTitle(name, title) { // generateTitle by vue-i18n
|
|
|
- return i18n.generateTitle(name, title)
|
|
|
- },
|
|
|
- toCheckMode() {
|
|
|
- if (this.$utils.isEmpty(this.listData)) {
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.checkMode) {
|
|
|
- // this.show = true
|
|
|
- this.checkedIds = []
|
|
|
- }
|
|
|
- this.checkMode = !this.checkMode
|
|
|
- },
|
|
|
- clickType() {
|
|
|
- this.typeTreePopup = true
|
|
|
- },
|
|
|
- onSearch() {
|
|
|
- this.stateActive = false
|
|
|
- ActionUtils.initListData(this)
|
|
|
- this.current = 0
|
|
|
- this.listData = []
|
|
|
- this.loadData()
|
|
|
- },
|
|
|
- clickMoreSearch() {
|
|
|
- this.moreSearchPopup = true
|
|
|
- this.stateActive = false
|
|
|
- },
|
|
|
- clickTypeNode(data) {
|
|
|
- this.typeId = data.id
|
|
|
- this.onMoreSearch({})
|
|
|
- },
|
|
|
- // 高级查询
|
|
|
- onMoreSearch(params) {
|
|
|
- if (this.$utils.isNotEmpty(this.typeId)) {
|
|
|
- params['Q^type_id_^SL'] = this.typeId
|
|
|
- }
|
|
|
- this.moreParams = params
|
|
|
- this.onSearch()
|
|
|
- if (this.$utils.isNotEmpty(params)) {
|
|
|
- this.stateActive = true
|
|
|
- }
|
|
|
- },
|
|
|
- resetForm() {
|
|
|
- this.typeId = ''
|
|
|
- },
|
|
|
- // 下拉刷新
|
|
|
- onRefresh() {
|
|
|
- this.footText = false
|
|
|
- this.noData = false
|
|
|
- this.refreshing = true
|
|
|
- this.finished = false
|
|
|
- this.loading = true
|
|
|
- this.onSearch()
|
|
|
- },
|
|
|
- onRefreshPage() {
|
|
|
- this.checkedIds = []
|
|
|
- this.checkMode = false
|
|
|
- this.onRefresh()
|
|
|
- },
|
|
|
- /**
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.$common.request('update', JSON.stringify(up)).then(() => {
|
|
|
+ // 更改数据库信息成功
|
|
|
+ console.log('更改数据库信息成功')
|
|
|
+ Notify({ type: 'success', message: '短信催办成功!' })
|
|
|
+ this.onRefreshPage()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Notify({ type: 'danger', message: '还未上传手机号' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getCurrentDateTime() {
|
|
|
+ const now = new Date()
|
|
|
+ const year = now.getFullYear()
|
|
|
+ const month = ('0' + (now.getMonth() + 1)).slice(-2) // 月份从0开始,所以加1,并补零
|
|
|
+ const day = ('0' + now.getDate()).slice(-2) // 补零
|
|
|
+ const hours = ('0' + now.getHours()).slice(-2) // 补零
|
|
|
+ const minutes = ('0' + now.getMinutes()).slice(-2) // 补零
|
|
|
+ const seconds = ('0' + now.getSeconds()).slice(-2) // 补零
|
|
|
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
+ },
|
|
|
+ updataSet(v) {
|
|
|
+ this.showPop = v
|
|
|
+ },
|
|
|
+ generateTitle(name, title) { // generateTitle by vue-i18n
|
|
|
+ return i18n.generateTitle(name, title)
|
|
|
+ },
|
|
|
+ toCheckMode() {
|
|
|
+ if (this.$utils.isEmpty(this.listData)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.checkMode) {
|
|
|
+ // this.show = true
|
|
|
+ this.checkedIds = []
|
|
|
+ }
|
|
|
+ this.checkMode = !this.checkMode
|
|
|
+ },
|
|
|
+ clickType() {
|
|
|
+ this.typeTreePopup = true
|
|
|
+ },
|
|
|
+ onSearch() {
|
|
|
+ this.stateActive = false
|
|
|
+ ActionUtils.initListData(this)
|
|
|
+ this.current = 0
|
|
|
+ this.listData = []
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ clickMoreSearch() {
|
|
|
+ this.moreSearchPopup = true
|
|
|
+ this.stateActive = false
|
|
|
+ },
|
|
|
+ clickTypeNode(data) {
|
|
|
+ this.typeId = data.id
|
|
|
+ this.onMoreSearch({})
|
|
|
+ },
|
|
|
+ // 高级查询
|
|
|
+ onMoreSearch(params) {
|
|
|
+ if (this.$utils.isNotEmpty(this.typeId)) {
|
|
|
+ params['Q^type_id_^SL'] = this.typeId
|
|
|
+ }
|
|
|
+ this.moreParams = params
|
|
|
+ this.onSearch()
|
|
|
+ if (this.$utils.isNotEmpty(params)) {
|
|
|
+ this.stateActive = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resetForm() {
|
|
|
+ this.typeId = ''
|
|
|
+ },
|
|
|
+ // 下拉刷新
|
|
|
+ onRefresh() {
|
|
|
+ this.footText = false
|
|
|
+ this.noData = false
|
|
|
+ this.refreshing = true
|
|
|
+ this.finished = false
|
|
|
+ this.loading = true
|
|
|
+ this.onSearch()
|
|
|
+ },
|
|
|
+ onRefreshPage() {
|
|
|
+ this.checkedIds = []
|
|
|
+ this.checkMode = false
|
|
|
+ this.onRefresh()
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 加载数据
|
|
|
*/
|
|
|
- // 用户下拉时refreshing 为true,调用onRefresh函数,获取数据之后设置为false
|
|
|
- // 当用户滚动到底部时,loading 变为 true,执行 onLoad 方法,完成后将 loading 设置为 false
|
|
|
- // 当 finished 为 true 时,表示已经没有更多数据可加载。
|
|
|
- // 当 finished 为 false 时,表示还有更多数据可以加载
|
|
|
- // 当 finished 为 true 时,即使用户继续上拉,也不会触发 @load 事件,从而避免重复加载数据。
|
|
|
- loadData() {
|
|
|
- this.loading = true
|
|
|
- this.noData = false
|
|
|
- this.footText = false
|
|
|
- let page = 0
|
|
|
- if (this.current === 0) {
|
|
|
- page = 0
|
|
|
- } else {
|
|
|
- page = this.current * 10
|
|
|
- }
|
|
|
- const key = this.subject
|
|
|
- const sql = `select * from t_gqswb where t_gqswb.shi_wu_ming_cheng like'%` + key + `%' ORDER BY t_gqswb.create_time_ DESC LIMIT ${page},10 `
|
|
|
- this.$common.request('sql', sql).then(res => {
|
|
|
- if (res.variables.data.length === 0) {
|
|
|
- if (this.current === 0) {
|
|
|
- this.noData = true
|
|
|
- } else {
|
|
|
- this.footText = true
|
|
|
- }
|
|
|
- this.finished = true
|
|
|
- this.loading = false
|
|
|
- this.refreshing = false
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- this.listData.push(...res.variables.data)
|
|
|
+ // 用户下拉时refreshing 为true,调用onRefresh函数,获取数据之后设置为false
|
|
|
+ // 当用户滚动到底部时,loading 变为 true,执行 onLoad 方法,完成后将 loading 设置为 false
|
|
|
+ // 当 finished 为 true 时,表示已经没有更多数据可加载。
|
|
|
+ // 当 finished 为 false 时,表示还有更多数据可以加载
|
|
|
+ // 当 finished 为 true 时,即使用户继续上拉,也不会触发 @load 事件,从而避免重复加载数据。
|
|
|
+ loadData() {
|
|
|
+ this.loading = true
|
|
|
+ this.noData = false
|
|
|
+ this.footText = false
|
|
|
+ let page = 0
|
|
|
+ if (this.current === 0) {
|
|
|
+ page = 0
|
|
|
+ } else {
|
|
|
+ page = this.current * 10
|
|
|
+ }
|
|
|
+ const key = this.subject
|
|
|
+ const sql = `select * from t_gqswb where t_gqswb.shi_wu_ming_cheng like'%` + key + `%' ORDER BY t_gqswb.create_time_ DESC LIMIT ${page},10 `
|
|
|
|
|
|
- // 判断是否还有更多数据
|
|
|
- if ((this.listData.length) % 10 !== 0) {
|
|
|
- this.footText = true
|
|
|
- this.finished = true
|
|
|
- } else {
|
|
|
- this.current++
|
|
|
- }
|
|
|
+ // sql注入接口
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.variables.data.length === 0) {
|
|
|
+ if (this.current === 0) {
|
|
|
+ this.noData = true
|
|
|
+ } else {
|
|
|
+ this.footText = true
|
|
|
+ }
|
|
|
+ this.finished = true
|
|
|
+ this.loading = false
|
|
|
+ this.refreshing = false
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- this.loading = false
|
|
|
- this.refreshing = false
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取格式化参数
|
|
|
- getSearcFormData() {
|
|
|
- let params = {}
|
|
|
- if (this.$utils.isNotEmpty(this.subject)) {
|
|
|
- params['Q^subject_^SL'] = this.subject
|
|
|
- }
|
|
|
- if (this.$utils.isNotEmpty(this.moreParams)) {
|
|
|
- params = Object.assign(params, this.moreParams)
|
|
|
- }
|
|
|
- return ActionUtils.formatParams(
|
|
|
- params,
|
|
|
- this.pagination,
|
|
|
- this.sorts)
|
|
|
- },
|
|
|
+ this.listData.push(...res.variables.data)
|
|
|
|
|
|
- transformTime(timeStamp) {
|
|
|
- const hours = Math.floor(parseInt(timeStamp) / 3600000)
|
|
|
- const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
|
|
|
- return hours + '小时' + minutes + '分钟'
|
|
|
+ // 判断是否还有更多数据
|
|
|
+ if ((this.listData.length) % 10 !== 0) {
|
|
|
+ this.footText = true
|
|
|
+ this.finished = true
|
|
|
+ } else {
|
|
|
+ this.current++
|
|
|
}
|
|
|
+
|
|
|
+ this.loading = false
|
|
|
+ this.refreshing = false
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取格式化参数
|
|
|
+ getSearcFormData() {
|
|
|
+ let params = {}
|
|
|
+ if (this.$utils.isNotEmpty(this.subject)) {
|
|
|
+ params['Q^subject_^SL'] = this.subject
|
|
|
+ }
|
|
|
+ if (this.$utils.isNotEmpty(this.moreParams)) {
|
|
|
+ params = Object.assign(params, this.moreParams)
|
|
|
+ }
|
|
|
+ return ActionUtils.formatParams(
|
|
|
+ params,
|
|
|
+ this.pagination,
|
|
|
+ this.sorts)
|
|
|
+ },
|
|
|
+
|
|
|
+ transformTime(timeStamp) {
|
|
|
+ const hours = Math.floor(parseInt(timeStamp) / 3600000)
|
|
|
+ const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
|
|
|
+ return hours + '小时' + minutes + '分钟'
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|