|
@@ -265,7 +265,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { isFinishComInfo, getById, addCompanyExamine,upload } from "@/js_sdk/http.js"
|
|
|
+import { isFinishComInfo, getById, addCompanyExamine,upload,getUserLocalStorageInfo } from "@/js_sdk/http.js"
|
|
|
// import auth from '@/js_sdk/auth.js'
|
|
|
import constant from '@/pages/utils/constant.js'
|
|
|
export default {
|
|
@@ -329,9 +329,482 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
+ // this.getCommit()
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ takeshow() {
|
|
|
+ if (this.isnew) {
|
|
|
+ this.show = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ takeshow2() {
|
|
|
+ if (this.isnew) {
|
|
|
+ // console.log(123)
|
|
|
+ this.show2 = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ turnOff() {
|
|
|
+ this.$router.push('/home/home')
|
|
|
+ },
|
|
|
+ getInfo() {
|
|
|
+ getById({ id: auth.currUser().id }).then(res => {
|
|
|
+ console.log('res', res)
|
|
|
+ if (res && res.key == 200) {
|
|
|
+ this.company = res.data
|
|
|
+ this.qybqList = this.company.qybq.split(',')
|
|
|
+ // this.getTagList()
|
|
|
+ if (res.data.yyzzfbzp) {
|
|
|
+ const a = res.data.yyzzfbzp.split(',')
|
|
|
+ this.fileList.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ a +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ if (res.data.ryxxzp) {
|
|
|
+ this.fileIdList2 = res.data.ryxxzp.split(',')
|
|
|
+ // console.log(this.fileIdList2);
|
|
|
+ this.fileIdList2.forEach(item => {
|
|
|
+ this.fileList2.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ item +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (res.data.frsfzh) {
|
|
|
+ this.fileIdList5 = res.data.frsfzh.split(',')
|
|
|
+ this.frsfzzm = this.fileIdList5[0]
|
|
|
+ this.fileList3.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ this.frsfzzm +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ if (this.fileIdList5[1]) {
|
|
|
+ this.frsfzfm = this.fileIdList5[1]
|
|
|
+ this.fileList4.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ this.frsfzfm +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (res.key == 426) {
|
|
|
+ Toast(res.msg)
|
|
|
+ this.$router.push('/login')
|
|
|
+ } else {
|
|
|
+ Toast(res.msg)
|
|
|
+ }
|
|
|
+ if (this.company.shxydm && this.company.rzsj) {
|
|
|
+ this.isnew = false
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ isFinishComInfo({ comId: auth.currUser().id }).then(res => {
|
|
|
+ if (res.errno === 0) {
|
|
|
+ this.btnShow = false
|
|
|
+ } else if (res.errno === -1) {
|
|
|
+ this.btnShow = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取企业标签信息
|
|
|
+ // getTagList() {
|
|
|
+ // getTagInfo().then(res => {
|
|
|
+ // this.tagList = res.data
|
|
|
+ // this.checkBoxList = res.data[0].children
|
|
|
+ // this.checkBoxList.forEach(item => {
|
|
|
+ // if (this.qybqList.findIndex(e => e == item.id) !== -1) {
|
|
|
+ // item.checked = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // clickTag(item, index) {
|
|
|
+ // this.selectTag = index
|
|
|
+ // this.selectTagId = item.id
|
|
|
+ // this.tagList.forEach(item => {
|
|
|
+ // if (this.selectTagId == item.id) {
|
|
|
+ // this.checkBoxList = item.children
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // this.checkBoxList.forEach(item => {
|
|
|
+ // if (this.company.qybq.split(',').findIndex(e => e == item.id) !== -1) {
|
|
|
+ // item.checked = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // changeCheck(item) {
|
|
|
+ // console.log(this.qybqList)
|
|
|
+ // if (item.checked == true) {
|
|
|
+ // if (this.qybqList.findIndex(e => e == item.id) == -1) {
|
|
|
+ // this.qybqList.push(item.id)
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // const i = this.qybqList.findIndex(e => e == item.id)
|
|
|
+ // if (i !== -1) {
|
|
|
+ // this.qybqList.splice(i, 1)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.company.qybq = this.qybqList.toString()
|
|
|
+ // console.log(this.company.qybq)
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ getCommit() {
|
|
|
+ const local = localStorage.getItem('company' + auth.currUser().id)
|
|
|
+ if (local) {
|
|
|
+ this.company = JSON.parse(local)
|
|
|
+ this.qybqList = this.company.qybq.split(',')
|
|
|
+ // this.getTagList()
|
|
|
+ if (this.company.yyzzfbzp) {
|
|
|
+ const a = this.company.yyzzfbzp.split(',')
|
|
|
+ console.log(this.company.yyzzfbzp)
|
|
|
+ this.fileList.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ a +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ if (this.company.ryxxzp) {
|
|
|
+ this.fileIdList2 = this.company.ryxxzp.split(',')
|
|
|
+ // console.log(this.fileIdList2);
|
|
|
+ this.fileIdList2.forEach(item => {
|
|
|
+ this.fileList2.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ item +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.company.frsfzh) {
|
|
|
+ this.fileIdList5 = this.company.frsfzh.split(',')
|
|
|
+ this.frsfzzm = this.fileIdList5[0]
|
|
|
+ this.fileList3.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ this.frsfzzm +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ if (this.fileIdList5[1]) {
|
|
|
+ this.frsfzfm = this.fileIdList5[1]
|
|
|
+ this.fileList4.push(
|
|
|
+ JSON.parse(
|
|
|
+ '{"url":"' +
|
|
|
+ constant.BASE_URI +
|
|
|
+ '/wx/fileController/download/' +
|
|
|
+ this.frsfzfm +
|
|
|
+ '","isImage": true}'
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.getInfo()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 暂存本地
|
|
|
+ commit() {
|
|
|
+ if (this.frsfzzm || this.frsfzfm) {
|
|
|
+ this.company.frsfzh = this.frsfzzm + ',' + this.frsfzfm
|
|
|
+ } else {
|
|
|
+ this.company.frsfzh = null
|
|
|
+ }
|
|
|
+ this.company.czrid = auth.currUser().id
|
|
|
+ this.company.czr = auth.currUser().qymc
|
|
|
+ this.$delete(this.company, 'czsj')
|
|
|
+ localStorage.setItem('company' + auth.currUser().id, JSON.stringify(this.company))
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const local = localStorage.getItem('company' + auth.currUser().id)
|
|
|
+ if (local) {
|
|
|
+ Toast('暂存成功')
|
|
|
+ } else {
|
|
|
+ Toast('暂存失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ submit() {
|
|
|
+ // console.log(this.company.frsfzh)
|
|
|
+ if (!this.company.shxydm) {
|
|
|
+ Toast('请填写统一社会信用代码')
|
|
|
+ } else if (!this.company.zczj) {
|
|
|
+ Toast('请填写注册资金')
|
|
|
+ } else if (!this.company.zcsj) {
|
|
|
+ Toast('请填写注册时间')
|
|
|
+ } else if (!this.company.fddbr) {
|
|
|
+ Toast('请填写法定代表人')
|
|
|
+ } else if (!this.company.qylxr) {
|
|
|
+ Toast('请填写企业联系人')
|
|
|
+ } else if (!this.company.lxdh) {
|
|
|
+ Toast('请填写手机号')
|
|
|
+ } else if (!this.company.email) {
|
|
|
+ Toast('请填写联系人邮箱')
|
|
|
+ } else if (!this.company.cwfzr) {
|
|
|
+ Toast('请填写财务负责人')
|
|
|
+ } else if (!this.company.cwfzrdh) {
|
|
|
+ Toast('请填写财务负责人电话')
|
|
|
+ } else if (!this.company.zcdz) {
|
|
|
+ Toast('请填写注册地址')
|
|
|
+ } else if (!this.company.jydz) {
|
|
|
+ Toast('请填写经营地址')
|
|
|
+ } else if (this.fileList.length == 0) {
|
|
|
+ Toast('请上传营业执照副本')
|
|
|
+ } else if (!this.frsfzzm) {
|
|
|
+ Toast('请上传法人身份证正面')
|
|
|
+ } else if (!this.frsfzfm) {
|
|
|
+ Toast('请上传法人身份证反面')
|
|
|
+ } else {
|
|
|
+ this.company.frsfzh = this.frsfzzm + ',' + this.frsfzfm
|
|
|
+ this.company.czrid = auth.currUser().id
|
|
|
+ this.company.czr = auth.currUser().qymc
|
|
|
+ this.$delete(this.company, 'czsj')
|
|
|
+ this.$delete(this.company, 'gxsj')
|
|
|
+ add(this.company).then(res => {
|
|
|
+ if (res.key == 200) {
|
|
|
+ Toast('提交成功')
|
|
|
+ this.btnShow = false
|
|
|
+ localStorage.removeItem('company' + auth.currUser().id)
|
|
|
+ } else {
|
|
|
+ Toast(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectTime(e) {
|
|
|
+ const dayjs = require('dayjs')
|
|
|
+ this.company.zcsj = dayjs(e).format('YYYY-MM-DD')
|
|
|
+ this.show = false
|
|
|
+ },
|
|
|
+ selectTime2(e) {
|
|
|
+ const dayjs = require('dayjs')
|
|
|
+ this.company.rzsj = dayjs(e).format('YYYY-MM-DD')
|
|
|
+ this.show2 = false
|
|
|
+ },
|
|
|
+ afterRead(file) {
|
|
|
+ Toast.loading({
|
|
|
+ message: '上传中...',
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
+ if (file instanceof Array) {
|
|
|
+ file.map(v => {
|
|
|
+ this.uploadImg(v)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uploadImg(file)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ afterRead2(file) {
|
|
|
+ Toast.loading({
|
|
|
+ message: '上传中...',
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
+ if (file instanceof Array) {
|
|
|
+ file.map(v => {
|
|
|
+ this.uploadImg2(v)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uploadImg2(file)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ afterRead3(file) {
|
|
|
+ Toast.loading({
|
|
|
+ message: '上传中...',
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
+ if (file instanceof Array) {
|
|
|
+ file.map(v => {
|
|
|
+ this.uploadImg3(v)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uploadImg3(file)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ afterRead4(file) {
|
|
|
+ Toast.loading({
|
|
|
+ message: '上传中...',
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
+ if (file instanceof Array) {
|
|
|
+ file.map(v => {
|
|
|
+ this.uploadImg4(v)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.uploadImg4(file)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeDelete(file, detail) {
|
|
|
+ const vm = this
|
|
|
+ // name.index代表图片的索引
|
|
|
+ vm.company.yyzzfbzp = ''
|
|
|
+ this.fileList = []
|
|
|
+ },
|
|
|
+ beforeDelete2(file, detail) {
|
|
|
+ const vm = this
|
|
|
+ // name.index代表图片的索引
|
|
|
+ vm.fileIdList2.splice(detail.index, 1)
|
|
|
+ vm.company.ryxxzp = vm.fileIdList2.toString()
|
|
|
+ console.log(vm.company.ryxxzp)
|
|
|
+ return (file, name) => {
|
|
|
+ const fileIndex = name.index
|
|
|
+ vm.fileIdList2[detail.index].splice(fileIndex, 1)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeDelete3(file, detail) {
|
|
|
+ const vm = this
|
|
|
+ // name.index代表图片的索引
|
|
|
+ vm.frsfzzm = ''
|
|
|
+ this.fileList3 = []
|
|
|
+ this.fileIdList3 = []
|
|
|
+ },
|
|
|
+ beforeDelete4(file, detail) {
|
|
|
+ const vm = this
|
|
|
+ // name.index代表图片的索引
|
|
|
+ vm.frsfzfm = ''
|
|
|
+ this.fileList4 = []
|
|
|
+ this.fileIdList4 = []
|
|
|
+ },
|
|
|
+ uploadImg(file) {
|
|
|
+ const _this = this
|
|
|
+ const formParam = new FormData() // 创建form对象
|
|
|
+ formParam.append('file', file.file) // 通过append向form对象添加数据
|
|
|
+ const config = {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data',
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
|
|
|
+ } // 添加请求头
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
|
|
|
+ upload(formParam, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.length) {
|
|
|
+ _this.company.yyzzfbzp = response.data[0]
|
|
|
+ }
|
|
|
+ Toast.clear()
|
|
|
+ })
|
|
|
+ .catch((err, x) => {
|
|
|
+ reject(err, x)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadImg2(file) {
|
|
|
+ const _this = this
|
|
|
+ const formParam = new FormData() // 创建form对象
|
|
|
+ formParam.append('file', file.file) // 通过append向form对象添加数据
|
|
|
+ const config = {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data',
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
|
|
|
+ } // 添加请求头
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
|
|
|
+ upload(formParam, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.length) {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ _this.fileIdList2.push(element)
|
|
|
+ })
|
|
|
+ _this.company.ryxxzp = _this.fileIdList2.toString()
|
|
|
+ // console.log(_this.company.ryxxzp);
|
|
|
+ }
|
|
|
+ Toast.clear()
|
|
|
+ })
|
|
|
+ .catch((err, x) => {
|
|
|
+ reject(err, x)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadImg3(file) {
|
|
|
+ const _this = this
|
|
|
+ const formParam = new FormData() // 创建form对象
|
|
|
+ formParam.append('file', file.file) // 通过append向form对象添加数据
|
|
|
+ const config = {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data',
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
|
|
|
+ } // 添加请求头
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
|
|
|
+ upload(formParam, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.length) {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ _this.fileIdList3.push(element)
|
|
|
+ })
|
|
|
+ _this.frsfzzm = _this.fileIdList3.toString()
|
|
|
+ }
|
|
|
+ Toast.clear()
|
|
|
+ })
|
|
|
+ .catch((err, x) => {
|
|
|
+ reject(err, x)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadImg4(file) {
|
|
|
+ const _this = this
|
|
|
+ const formParam = new FormData() // 创建form对象
|
|
|
+ formParam.append('file', file.file) // 通过append向form对象添加数据
|
|
|
+ const config = {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data',
|
|
|
+ 'MVVM-Key': String(new Date().getTime()),
|
|
|
+ xx: 'anything'
|
|
|
+ } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
|
|
|
+ } // 添加请求头
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
|
|
|
+ upload(formParam, config)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data.length) {
|
|
|
+ response.data.forEach(element => {
|
|
|
+ _this.fileIdList4.push(element)
|
|
|
+ })
|
|
|
+ _this.frsfzfm = _this.fileIdList4.toString()
|
|
|
+ }
|
|
|
+ Toast.clear()
|
|
|
+ })
|
|
|
+ .catch((err, x) => {
|
|
|
+ reject(err, x)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|