|
@@ -1,125 +1,125 @@
|
|
-<template>
|
|
|
|
- <div class="hui-flex hui-dialog">
|
|
|
|
- <div class="hui-flex-box hui-dialog-content">
|
|
|
|
- <el-form ref="informationForm" label-position="top" :model="informationForm">
|
|
|
|
- <el-form-item label="组织代码">
|
|
|
|
- <el-input type="text" :value="informationForm.organizationCode" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="组织名称" prop="name">
|
|
|
|
- <el-input type="text" v-model="informationForm.name"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="联系人" prop="contact">
|
|
|
|
- <el-input type="text" v-model="informationForm.contact"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="联系方式" prop="contactTel">
|
|
|
|
- <el-input type="text" v-model="informationForm.contactTel" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="组织地址" prop="address">
|
|
|
|
- <city v-model="informationForm.address"></city>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="详细地址">
|
|
|
|
- <el-input type="text" v-model="informationForm.detailAddress"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="公司简介" class="hui-textarea">
|
|
|
|
- <el-input type="textarea" v-model="informationForm.introduction" placeholder="请输入公司简介"
|
|
|
|
- resize="none">
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="LOGO" class="hui-textarea">
|
|
|
|
- <upload ref="uploadLogo" :list="informationForm.logo" :maxLen="1" type="insert" text="上传LOGO">
|
|
|
|
- </upload>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="附件" class="hui-textarea">
|
|
|
|
- <upload ref="upload" :list="informationForm.businessLicense" type="insert">
|
|
|
|
- </upload>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </div>
|
|
|
|
- <div class="hui-dialog-submit">
|
|
|
|
- <el-button size="small" @click="$emit('callback')">取 消</el-button>
|
|
|
|
- <el-button size="small" :loading="loading" type="primary" @click="submit">保 存</el-button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- import upload from '@/components/common/upload'
|
|
|
|
- import city from '@/components/common/city'
|
|
|
|
- import {
|
|
|
|
- updateOrganization,
|
|
|
|
- } from '@/api/organization'
|
|
|
|
- export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- informationForm: {
|
|
|
|
- organizationCode: '',
|
|
|
|
- name: '',
|
|
|
|
- contact: '',
|
|
|
|
- contactTel: '',
|
|
|
|
- address: [],
|
|
|
|
- businessLicense: [],
|
|
|
|
- logo: [],
|
|
|
|
- detailAddress: '',
|
|
|
|
- introduction: ''
|
|
|
|
- },
|
|
|
|
- isUpdate: true,
|
|
|
|
- loading: false
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted() {
|
|
|
|
- let obj = JSON.parse(JSON.stringify(this.$store.getters.organization));
|
|
|
|
- obj.address = obj['address'] ? JSON.parse(obj.address) : [];
|
|
|
|
- obj.businessLicense = obj['businessLicense'] ? JSON.parse(obj.businessLicense) : [];
|
|
|
|
- obj.logo = obj['logo'] ? [JSON.parse(obj.logo)] : [];
|
|
|
|
- this.informationForm = Object.assign(this.informationForm, obj);
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- submit() {
|
|
|
|
- let postData = JSON.parse(JSON.stringify(this.informationForm));
|
|
|
|
- postData['businessLicense'] = JSON.stringify(this.$refs.upload.fileList);
|
|
|
|
- postData['address'] = JSON.stringify(postData.address);
|
|
|
|
- postData['logo'] = this.$refs.uploadLogo.fileList.length === 0 ? '{}' : JSON.stringify(this.$refs
|
|
|
|
- .uploadLogo.fileList[0]);
|
|
|
|
- this.loading = true;
|
|
|
|
- updateOrganization(postData).then(res => {
|
|
|
|
- if (res.state) {
|
|
|
|
- this.$message.success('操作成功');
|
|
|
|
- this.$store.dispatch('app/changeOrganization', postData);
|
|
|
|
- this.$emit('callback', 'init');
|
|
|
|
- }
|
|
|
|
- this.loading = false;
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- components: {
|
|
|
|
- upload,
|
|
|
|
- city
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="scss">
|
|
|
|
- .organization-information {
|
|
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
-
|
|
|
|
- .hui-title {
|
|
|
|
- .el-icon-edit-outline {
|
|
|
|
- font-size: 18px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- color: $--color-primary;
|
|
|
|
- padding: 0 8px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .el-form {
|
|
|
|
- padding-top: 10px;
|
|
|
|
- padding-right: 10px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .work-people-user-information-submit {
|
|
|
|
- padding: 10px;
|
|
|
|
- text-align: right;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+<template>
|
|
|
|
+ <div class="hui-flex hui-dialog">
|
|
|
|
+ <div class="hui-flex-box hui-dialog-content">
|
|
|
|
+ <el-form ref="informationForm" label-position="top" :model="informationForm">
|
|
|
|
+ <el-form-item label="组织代码">
|
|
|
|
+ <el-input type="text" :value="informationForm.organizationCode" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="组织名称" prop="name">
|
|
|
|
+ <el-input type="text" v-model="informationForm.name"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系人" prop="contact">
|
|
|
|
+ <el-input type="text" v-model="informationForm.contact"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系方式" prop="contactTel">
|
|
|
|
+ <el-input type="text" v-model="informationForm.contactTel" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="组织地址" prop="address">
|
|
|
|
+ <city v-model="informationForm.address"></city>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="详细地址">
|
|
|
|
+ <el-input type="text" v-model="informationForm.detailAddress"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="公司简介" class="hui-textarea">
|
|
|
|
+ <el-input type="textarea" v-model="informationForm.introduction" placeholder="请输入公司简介"
|
|
|
|
+ resize="none">
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="LOGO" class="hui-textarea">
|
|
|
|
+ <upload ref="uploadLogo" :list="informationForm.logo" :maxLen="1" type="insert" text="上传LOGO">
|
|
|
|
+ </upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="附件" class="hui-textarea">
|
|
|
|
+ <upload ref="upload" :list="informationForm.businessLicense" type="insert">
|
|
|
|
+ </upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="hui-dialog-submit">
|
|
|
|
+ <el-button size="small" @click="$emit('callback')">取 消</el-button>
|
|
|
|
+ <el-button size="small" :loading="loading" type="primary" @click="submit">保 存</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ const upload = () => import('@/components/common/upload');
|
|
|
|
+ const city = () => import('@/components/common/city');
|
|
|
|
+ import {
|
|
|
|
+ updateOrganization,
|
|
|
|
+ } from '@/api/organization'
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ informationForm: {
|
|
|
|
+ organizationCode: '',
|
|
|
|
+ name: '',
|
|
|
|
+ contact: '',
|
|
|
|
+ contactTel: '',
|
|
|
|
+ address: [],
|
|
|
|
+ businessLicense: [],
|
|
|
|
+ logo: [],
|
|
|
|
+ detailAddress: '',
|
|
|
|
+ introduction: ''
|
|
|
|
+ },
|
|
|
|
+ isUpdate: true,
|
|
|
|
+ loading: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.$store.getters.organization));
|
|
|
|
+ obj.address = obj['address'] ? JSON.parse(obj.address) : [];
|
|
|
|
+ obj.businessLicense = obj['businessLicense'] ? JSON.parse(obj.businessLicense) : [];
|
|
|
|
+ obj.logo = obj['logo'] ? [JSON.parse(obj.logo)] : [];
|
|
|
|
+ this.informationForm = Object.assign(this.informationForm, obj);
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ submit() {
|
|
|
|
+ let postData = JSON.parse(JSON.stringify(this.informationForm));
|
|
|
|
+ postData['businessLicense'] = JSON.stringify(this.$refs.upload.fileList);
|
|
|
|
+ postData['address'] = JSON.stringify(postData.address);
|
|
|
|
+ postData['logo'] = this.$refs.uploadLogo.fileList.length === 0 ? '{}' : JSON.stringify(this.$refs
|
|
|
|
+ .uploadLogo.fileList[0]);
|
|
|
|
+ this.loading = true;
|
|
|
|
+ updateOrganization(postData).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
+ this.$store.dispatch('app/changeOrganization', postData);
|
|
|
|
+ this.$emit('callback', 'init');
|
|
|
|
+ }
|
|
|
|
+ this.loading = false;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ components: {
|
|
|
|
+ upload,
|
|
|
|
+ city
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss">
|
|
|
|
+ .organization-information {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+
|
|
|
|
+ .hui-title {
|
|
|
|
+ .el-icon-edit-outline {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ color: $--color-primary;
|
|
|
|
+ padding: 0 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-form {
|
|
|
|
+ padding-top: 10px;
|
|
|
|
+ padding-right: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .work-people-user-information-submit {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|