| | |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | import { all } from '@/api/business/solutions' |
| | | import { sendSms } from '@/api/business/smsEmail' |
| | | export default { |
| | | name: 'OperaCompanyWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow, UploadAvatarImage }, |
| | | data () { |
| | | return { |
| | | // 表单数据 |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | code: '', |
| | | legalName: '', |
| | | taxCode: '', |
| | | taxAccount: '', |
| | | username: '', |
| | | taxBank: '', |
| | | taxAddr: '', |
| | | invoiceEmail: '', |
| | | invoiceAddr: '', |
| | | phone: '', |
| | | email: '', |
| | | captche: '', |
| | | businessImg: { |
| | | fileurl: '', |
| | | name: '' |
| | | }, |
| | | idcardImgList: [], |
| | | signImg: { |
| | | fileurl: '', |
| | | name: '' |
| | | }, |
| | | solutionList: [ |
| | | { |
| | | solutionBaseId: '', |
| | | canAdd: 0, |
| | | canReduce: 0 |
| | | } |
| | | ], |
| | | type: '', |
| | | file: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | file1: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | file2: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | file3: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | }, |
| | | timer: null, |
| | | num: 0, |
| | | // 验证规则 |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请输入公司名称' } |
| | | ], |
| | | code: [ |
| | | { required: true, message: '请输入统一信用代码' } |
| | | ], |
| | | captche: [ |
| | | { required: true, message: '请输入验证码' } |
| | | ], |
| | | legalName: [ |
| | | { required: true, message: '请输入法人姓名' } |
| | | ], |
| | | phone: [ |
| | | { required: true, message: '请输入手机号' } |
| | | ], |
| | | taxAccount: [ |
| | | { required: true, message: '请输入手机号' } |
| | | ], |
| | | email: [ |
| | | { required: true, message: '请输入认证邮箱' } |
| | | ], |
| | | businessImg: [ |
| | | { required: true, message: '请上传营业执照' } |
| | | ], |
| | | idcardImgList: [ |
| | | { required: true, message: '请上传法人身份证' } |
| | | ], |
| | | signImg: [ |
| | | { required: true, message: '请上传电子签章' } |
| | | ], |
| | | username: [ |
| | | { required: true, message: '请输入公司账号' } |
| | | ] |
| | | }, |
| | | |
| | | programme: [] |
| | | } |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | import { all } from '@/api/business/solutions' |
| | | import { sendSms } from '@/api/business/smsEmail' |
| | | export default { |
| | | name: 'OperaCompanyWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow, UploadAvatarImage }, |
| | | data () { |
| | | return { |
| | | // 表单数据 |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | code: '', |
| | | legalName: '', |
| | | taxCode: '', |
| | | taxAccount: '', |
| | | username: '', |
| | | taxBank: '', |
| | | taxAddr: '', |
| | | invoiceEmail: '', |
| | | invoiceAddr: '', |
| | | phone: '', |
| | | email: '', |
| | | captche: '', |
| | | businessImg: { |
| | | fileurl: '', |
| | | name: '' |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/company', |
| | | 'field.id': 'id' |
| | | }) |
| | | idcardImgList: [], |
| | | signImg: { |
| | | fileurl: '', |
| | | name: '' |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(news) { |
| | | if (news) { |
| | | clearInterval(this.timer) |
| | | this.num = 0 |
| | | } |
| | | } |
| | | } |
| | | solutionList: [ |
| | | { |
| | | solutionBaseId: '', |
| | | canAdd: 0, |
| | | canReduce: 0 |
| | | } |
| | | ], |
| | | type: '', |
| | | file: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | methods: { |
| | | send() { |
| | | if (!this.form.phone) { |
| | | this.$message.warning('请输入手机号') |
| | | return |
| | | } |
| | | sendSms({ phone: this.form.phone }) |
| | | .then(res => { |
| | | this.num = 60 |
| | | this.setTime() |
| | | }) |
| | | }, |
| | | setTime() { |
| | | this.timer = setInterval(() => { |
| | | this.num -= 1 |
| | | if (this.num === 0) { |
| | | clearInterval(this.timer) |
| | | this.num = 0 |
| | | } |
| | | }, 1000) |
| | | }, |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getAll() |
| | | // 新建 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | }, |
| | | // 获取全部方案 |
| | | getAll() { |
| | | all({}) |
| | | .then(res => { |
| | | this.programme = res |
| | | }) |
| | | }, |
| | | dele(index) { |
| | | if (this.form.solutionList.length === 1) { |
| | | this.$message.warning('至少保留一项') |
| | | return |
| | | } |
| | | this.form.solutionList.splice(index, 1) |
| | | }, |
| | | add() { |
| | | this.form.solutionList.push({ |
| | | solutionName: '', |
| | | canAdd: '', |
| | | canReduce: '' |
| | | }) |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | }, |
| | | // 接收营业执照数据 |
| | | result(data) { |
| | | this.form.businessImg = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.businessImg.fileurl = data.imgurl |
| | | this.form.businessImg.name = data.name |
| | | }, |
| | | // 身份证照片1 |
| | | result1(data) { |
| | | this.form.idcardImgList[0] = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.idcardImgList[0] = { fileurl: data.imgurl, name: data.name } |
| | | }, |
| | | // 身份证照片2 |
| | | result2(data) { |
| | | this.form.idcardImgList[1] = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.idcardImgList[1] = { fileurl: data.imgurl, name: data.name } |
| | | }, |
| | | // 电子签章 |
| | | result3(data) { |
| | | this.form.signImg = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.signImg.fileurl = data.imgurl |
| | | this.form.signImg.name = data.name |
| | | } |
| | | file1: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | file2: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | }, |
| | | file3: { |
| | | imgurl: '', |
| | | imgurlfull: '' |
| | | } |
| | | }, |
| | | timer: null, |
| | | num: 0, |
| | | // 验证规则 |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请输入公司名称' } |
| | | ], |
| | | code: [ |
| | | { required: true, message: '请输入统一信用代码' } |
| | | ], |
| | | captche: [ |
| | | { required: true, message: '请输入验证码' } |
| | | ], |
| | | legalName: [ |
| | | { required: true, message: '请输入法人姓名' } |
| | | ], |
| | | phone: [ |
| | | { required: true, message: '请输入手机号' } |
| | | ], |
| | | taxAccount: [ |
| | | { required: true, message: '请输入手机号' } |
| | | ], |
| | | email: [ |
| | | { required: true, message: '请输入认证邮箱' } |
| | | ], |
| | | businessImg: [ |
| | | { required: true, message: '请上传营业执照' } |
| | | ], |
| | | idcardImgList: [ |
| | | { required: true, message: '请上传法人身份证' } |
| | | ], |
| | | signImg: [ |
| | | { required: true, message: '请上传电子签章' } |
| | | ], |
| | | username: [ |
| | | { required: true, message: '请输入公司账号' } |
| | | ] |
| | | }, |
| | | |
| | | programme: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/company', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler (news) { |
| | | if (news) { |
| | | clearInterval(this.timer) |
| | | this.num = 0 |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | send () { |
| | | if (!this.form.phone) { |
| | | this.$message.warning('请输入手机号') |
| | | return |
| | | } |
| | | sendSms({ phone: this.form.phone }) |
| | | .then(res => { |
| | | this.num = 60 |
| | | this.setTime() |
| | | }) |
| | | }, |
| | | setTime () { |
| | | this.timer = setInterval(() => { |
| | | this.num -= 1 |
| | | if (this.num === 0) { |
| | | clearInterval(this.timer) |
| | | this.num = 0 |
| | | } |
| | | }, 1000) |
| | | }, |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getAll() |
| | | // 新建 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | }, |
| | | // 获取全部方案 |
| | | getAll () { |
| | | all({}) |
| | | .then(res => { |
| | | this.programme = res |
| | | }) |
| | | }, |
| | | dele (index) { |
| | | if (this.form.solutionList.length === 1) { |
| | | this.$message.warning('至少保留一项') |
| | | return |
| | | } |
| | | this.form.solutionList.splice(index, 1) |
| | | }, |
| | | add () { |
| | | this.form.solutionList.push({ |
| | | solutionName: '', |
| | | canAdd: '', |
| | | canReduce: '' |
| | | }) |
| | | }, |
| | | handleRemove (file, fileList) { |
| | | console.log(file, fileList) |
| | | }, |
| | | // 接收营业执照数据 |
| | | result (data) { |
| | | this.form.businessImg = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.businessImg.fileurl = data.imgurl |
| | | this.form.businessImg.name = data.name |
| | | }, |
| | | // 身份证照片1 |
| | | result1 (data) { |
| | | this.form.idcardImgList[0] = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.idcardImgList[0] = { fileurl: data.imgurl, name: data.name } |
| | | }, |
| | | // 身份证照片2 |
| | | result2 (data) { |
| | | this.form.idcardImgList[1] = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.idcardImgList[1] = { fileurl: data.imgurl, name: data.name } |
| | | }, |
| | | // 电子签章 |
| | | result3 (data) { |
| | | this.form.signImg = { |
| | | fileurl: '', |
| | | name: '' |
| | | } |
| | | this.form.signImg.fileurl = data.imgurl |
| | | this.form.signImg.name = data.name |
| | | } |
| | | } |
| | | } |
| | | </script> |