|
@@ -7,33 +7,40 @@
|
|
placeholder="请输入单位名称"
|
|
placeholder="请输入单位名称"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item style="width: 350px" label="托管单位:">
|
|
|
|
- <el-tag
|
|
|
|
- :key="tag.id"
|
|
|
|
- v-for="tag in dynamicTags"
|
|
|
|
- closable
|
|
|
|
- :disable-transitions="false"
|
|
|
|
- @close="handleClose(tag)"
|
|
|
|
|
|
+ <el-form-item style="width: 1000px" label="托管单位:">
|
|
|
|
+ <div
|
|
|
|
+ class="hostunit"
|
|
|
|
+ style="width: 1000px; height: auto; overflow: auto; display: flex"
|
|
>
|
|
>
|
|
- {{ tag.name }}
|
|
|
|
- </el-tag>
|
|
|
|
- <el-input
|
|
|
|
- class="input-new-tag"
|
|
|
|
- v-if="inputVisible"
|
|
|
|
- v-model="newHostInputValue"
|
|
|
|
- ref="saveTagInput"
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleInputConfirm"
|
|
|
|
- @blur="handleInputConfirm"
|
|
|
|
- >
|
|
|
|
- </el-input>
|
|
|
|
- <el-button v-else class="button-new-tag" size="small" @click="showInput"
|
|
|
|
- >+ New Tag</el-button
|
|
|
|
- >
|
|
|
|
- <!-- <el-input
|
|
|
|
- v-model="form.hostUnit"
|
|
|
|
- placeholder="请输入单位名称"
|
|
|
|
- ></el-input> -->
|
|
|
|
|
|
+ <el-tag
|
|
|
|
+ :key="tag.id"
|
|
|
|
+ v-for="tag in dynamicTags"
|
|
|
|
+ closable
|
|
|
|
+ :disable-transitions="false"
|
|
|
|
+ @close="handleClose(tag)"
|
|
|
|
+ >
|
|
|
|
+ {{ tag.name }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ placeholder="请输入单位名称"
|
|
|
|
+ class="input-new-tag"
|
|
|
|
+ v-show="inputVisible"
|
|
|
|
+ v-model="inputValue"
|
|
|
|
+ ref="saveTagInput"
|
|
|
|
+ size="small"
|
|
|
|
+ @keyup.enter="handleInputConfirm"
|
|
|
|
+ @blur="handleInputConfirm"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="!inputVisible"
|
|
|
|
+ class="button-new-tag"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="showInput"
|
|
|
|
+ >+ New Tag</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="width: 350px" label="公司简介:">
|
|
<el-form-item style="width: 350px" label="公司简介:">
|
|
<el-input v-model="form.profile" placeholder=""></el-input>
|
|
<el-input v-model="form.profile" placeholder=""></el-input>
|
|
@@ -46,9 +53,10 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="width: 500px" label="上传图片:">
|
|
<el-form-item style="width: 500px" label="上传图片:">
|
|
<el-upload
|
|
<el-upload
|
|
- action="#"
|
|
|
|
|
|
+ action=""
|
|
|
|
+ :http-request="uploadSectionFile"
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
- :auto-upload="false"
|
|
|
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
:file-list="fileList"
|
|
:file-list="fileList"
|
|
>
|
|
>
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
@@ -96,10 +104,15 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import publicFunc from "@/utils/publicFunc";
|
|
import publicFunc from "@/utils/publicFunc";
|
|
|
|
+import {
|
|
|
|
+ getCompanyBasicInfo,
|
|
|
|
+ editCompanyBasicInfo,
|
|
|
|
+} from "@/api/data/basicInfo";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
fileList: [],
|
|
fileList: [],
|
|
|
|
+ currentFile: "",
|
|
dynamicTags: [
|
|
dynamicTags: [
|
|
{
|
|
{
|
|
id: 1,
|
|
id: 1,
|
|
@@ -127,14 +140,34 @@ export default {
|
|
profile: "",
|
|
profile: "",
|
|
contact_person: "",
|
|
contact_person: "",
|
|
contact_num: "",
|
|
contact_num: "",
|
|
|
|
+ pictureList: [],
|
|
},
|
|
},
|
|
action: "", //上传地址
|
|
action: "", //上传地址
|
|
- newHostInputValue: "",
|
|
|
|
|
|
+ inputValue: "",
|
|
inputVisible: false,
|
|
inputVisible: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ this.displayCompanyInfo();
|
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ displayCompanyInfo() {
|
|
|
|
+ getCompanyBasicInfo().then((res) => {
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
+ // contact_information: "123456"
|
|
|
|
+ // contact_person: "张三"
|
|
|
|
+ // custodian_unit: "北京电信规划院"
|
|
|
|
+ // introduction: "中讯邮电咨询设计院有限公司"
|
|
|
|
+ // management_unit: "中讯邮电咨询设计院有限公司"
|
|
|
|
+ let obj = res.data.data;
|
|
|
|
+ this.form.manageUnit = obj.management_unit;
|
|
|
|
+ this.form.profile = obj.introduction;
|
|
|
|
+ this.form.contact_num = obj.contact_information;
|
|
|
|
+ this.form.contact_person = obj.contact_person;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
handleRemove(file) {
|
|
handleRemove(file) {
|
|
console.log(file);
|
|
console.log(file);
|
|
console.log(this.fileList);
|
|
console.log(this.fileList);
|
|
@@ -154,15 +187,15 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleInputConfirm() {
|
|
handleInputConfirm() {
|
|
- let newHostInputValue = this.newHostInputValue;
|
|
|
|
- if (newHostInputValue) {
|
|
|
|
|
|
+ let inputValue = this.inputValue;
|
|
|
|
+ if (inputValue) {
|
|
this.dynamicTags.push({
|
|
this.dynamicTags.push({
|
|
id: Math.random() * 100,
|
|
id: Math.random() * 100,
|
|
- name: newHostInputValue,
|
|
|
|
|
|
+ name: inputValue,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.inputVisible = false;
|
|
this.inputVisible = false;
|
|
- this.newHostInputValue = "";
|
|
|
|
|
|
+ this.inputValue = "";
|
|
},
|
|
},
|
|
showInput() {
|
|
showInput() {
|
|
this.inputVisible = true;
|
|
this.inputVisible = true;
|
|
@@ -170,13 +203,38 @@ export default {
|
|
this.$refs.saveTagInput.$refs.input.focus();
|
|
this.$refs.saveTagInput.$refs.input.focus();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ beforeAvatarUpload(response, file, fileList) {
|
|
|
|
+ console.log(response);
|
|
|
|
+ return true;
|
|
|
|
+ },
|
|
|
|
+ uploadSectionFile(params) {
|
|
|
|
+ debugger;
|
|
|
|
+ console.log(params);
|
|
|
|
+ let picture = params.file;
|
|
|
|
+ this.currentFile = params.file;
|
|
|
|
+ this.form.pictureList.push(picture);
|
|
|
|
+ },
|
|
resetEvent() {
|
|
resetEvent() {
|
|
- this.form.manageUnit = "";
|
|
|
|
- this.form.profile = "";
|
|
|
|
- this.form.contact_person = "";
|
|
|
|
- this.form.contact_num = "";
|
|
|
|
|
|
+ this.displayCompanyInfo();
|
|
|
|
+ },
|
|
|
|
+ submitEvent() {
|
|
|
|
+ let options = {
|
|
|
|
+ management_unit: this.form.manageUnit,
|
|
|
|
+ custodian_unit: JSON.stringify(this.dynamicTags),
|
|
|
|
+ introduction: this.form.profile,
|
|
|
|
+ contact_person: this.form.contact_person,
|
|
|
|
+ contact_information: this.form.contact_num,
|
|
|
|
+ picture: this.form.pictureList,
|
|
|
|
+ };
|
|
|
|
+ debugger;
|
|
|
|
+ editCompanyBasicInfo(options).then((res) => {
|
|
|
|
+ if (res.data.code === 0) {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.displayCompanyInfo();
|
|
|
|
+ }, 500);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- submitEvent() {},
|
|
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -193,22 +251,31 @@ export default {
|
|
padding-top: 20px;
|
|
padding-top: 20px;
|
|
margin-inline: 20px;
|
|
margin-inline: 20px;
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
- }
|
|
|
|
-
|
|
|
|
- .el-tag + .el-tag {
|
|
|
|
- margin-left: 10px;
|
|
|
|
- }
|
|
|
|
- .button-new-tag {
|
|
|
|
- margin-left: 10px;
|
|
|
|
- height: 32px;
|
|
|
|
- line-height: 30px;
|
|
|
|
- padding-top: 0;
|
|
|
|
- padding-bottom: 0;
|
|
|
|
- }
|
|
|
|
- .input-new-tag {
|
|
|
|
- width: 100px;
|
|
|
|
- margin-left: 10px;
|
|
|
|
- vertical-align: bottom;
|
|
|
|
|
|
+ .hostunit {
|
|
|
|
+ width: 800px;
|
|
|
|
+ height: auto;
|
|
|
|
+ overflow: auto;
|
|
|
|
+ display: flex;
|
|
|
|
+ .el-tag + .el-tag {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ .button-new-tag {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ height: 32px;
|
|
|
|
+ line-height: 30px;
|
|
|
|
+ padding-top: 0;
|
|
|
|
+ padding-bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ input {
|
|
|
|
+ width: 150px;
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ &:focus {
|
|
|
|
+ outline: none;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/deep/.el-form-item__label {
|
|
/deep/.el-form-item__label {
|