123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import ajax from '../../util/ajax'
- import api from '../../util/api'
-
- export default {
- namespaced: true,
- state: {
- courseVerifs: [],
- },
- mutations: {
- updateCourseList (state, payload) {
- state.courseVerifs = payload || []
- },
- },
- actions: {
- GetCourseVerList ({ commit }, {id, payload}) {
- return new Promise((resolve, reject) => {
- ajax(api.verification.coursebycode.url, {
- method: api.verification.coursebycode.method,
- urlData: {
- id,
- },
- queryData: {
- ...payload
- }
- }).then(res => {
- commit('updateCourseList', res)
- resolve(res)
- }).catch(reject)
- })
- },
- GetCourseVerListByTel ({ commit }, payload) {
- return new Promise((resolve, reject) => {
- ajax(api.verification.coursebytel.url, {
- method: api.verification.coursebytel.method,
- urlData: {
- tel: payload.tel
- },
- queryData: {
- ...payload
- }
- }).then(res => {
- commit('updateCourseList', res)
- resolve(res)
- }).catch(reject)
- })
- },
- CourseVerifs ({ commit }, payload) {
- ajax(api.verification.courseverify.url, {
- method: api.verification.courseverify.method,
- urlData: {
- id: payload.id
- }
- }).then(res => {
- if (payload.callback) {
- payload.callback()
- }
- })
- },
- drawVerify ({ commit }, { id }) {
- return new Promise((resolve, reject) => {
- ajax(api.verification.drawVerify.url, {
- method: api.verification.drawVerify.method,
- urlData: {
- id,
- }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- drawVerifyList ({ commit }, { id }) {
- return new Promise((resolve, reject) => {
- ajax(api.verification.drawVerifyList.url, {
- method: api.verification.drawVerifyList.method,
- urlData: {
- id,
- }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- getCustomerName ({ commit }, { id }) {
- return new Promise((resolve, reject) => {
- ajax(api.verification.getCustomerName.url, {
- method: api.verification.getCustomerName.method,
- urlData: {
- id,
- }
- }).then(res => {
- resolve(res)
- }).catch(reject)
- })
- },
- },
- }
|