| | |
| | | // 调用新建接口 |
| | | this.isWorking = true |
| | | if (!this.form.id) { |
| | | let arr = [] |
| | | this.form.budgetList.forEach(item => { |
| | | if (item.maxamount || item.minamount) { |
| | | arr.push(item) |
| | | } |
| | | }) |
| | | companyCreate({ |
| | | paramList: this.form.tableData, |
| | | type: this.form.type, |
| | |
| | | platCateId: this.form.platCateId, |
| | | name: this.form.name, |
| | | imgurl: this.form.imgurl, |
| | | budgetList: this.form.budgetList |
| | | budgetList: arr |
| | | }) |
| | | .then(() => { |
| | | this.visible = false |
| | |
| | | this.isWorking = false |
| | | }) |
| | | } else { |
| | | let arr = [] |
| | | this.form.budgetList.forEach(item => { |
| | | if (item.maxamount || item.minamount) { |
| | | arr.push(item) |
| | | } |
| | | }) |
| | | companyUpdateById({ |
| | | id: this.form.id, |
| | | paramList: this.form.tableData, |
| | |
| | | platCateId: this.form.platCateId, |
| | | name: this.form.name, |
| | | imgurl: this.form.imgurl, |
| | | budgetList: this.form.budgetList |
| | | budgetList: arr |
| | | }) |
| | | .then(() => { |
| | | this.visible = false |
| | |
| | | import pkg from '../../package' |
| | | import { trim } from './util' |
| | | import cache from '../plugins/cache' |
| | | import { Message } from 'element-ui' |
| | | |
| | | axios.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8' |
| | | const axiosInstance = axios.create({ |
| | |
| | | |
| | | // 新建响应拦截器 |
| | | axiosInstance.interceptors.response.use((response) => { |
| | | console.log(response.status) |
| | | // 请求失败 |
| | | if (response.status !== 200) { |
| | | return Promise.reject(new Error('服务器繁忙,请稍后再试')) |
| | |
| | | }).then(res => { |
| | | this.$tip.apiSuccess('更新成功') |
| | | }).finally(() => { |
| | | // this.search() |
| | | this.search() |
| | | }).catch(err => { |
| | | this.$message.warning({ message: err.message }) |
| | | }) |
| | | }, |
| | | turnNum (nums) { |