|
@@ -8,26 +8,10 @@ export default {
|
|
|
formData: {
|
|
|
memberEmail: '',
|
|
|
memberName: '',
|
|
|
- team: ''
|
|
|
+ teamId: ''
|
|
|
},
|
|
|
- options: [{
|
|
|
- value: '选项1',
|
|
|
- label: '黄金糕'
|
|
|
- }, {
|
|
|
- value: '选项2',
|
|
|
- label: '双皮奶'
|
|
|
- }, {
|
|
|
- value: '选项3',
|
|
|
- label: '蚵仔煎'
|
|
|
- }, {
|
|
|
- value: '选项4',
|
|
|
- label: '龙须面'
|
|
|
- }, {
|
|
|
- value: '选项5',
|
|
|
- label: '北京烤鸭'
|
|
|
- }],
|
|
|
- file: {},
|
|
|
- fileList: []
|
|
|
+ teamList: {},
|
|
|
+ file: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -38,17 +22,26 @@ export default {
|
|
|
},
|
|
|
//提交单个添加表单
|
|
|
submitFormSingle(){
|
|
|
- if (this.formData.memberEmail.trim() === '' || this.formData.team.trim() === '') {
|
|
|
+ if (this.formData.memberEmail.trim() === '' || this.formData.teamId.trim() === '') {
|
|
|
this.$message.error('Missing required information')
|
|
|
+ } else {
|
|
|
+ post('http://81.68.234.235:8032/pdf-tech/vppTeam/addTeamMember',this.formData).then((res)=>{
|
|
|
+ if(res.data.msg === 'Add Success!'){
|
|
|
+ this.$message({
|
|
|
+ message: 'Change Success',
|
|
|
+ type: "success",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- //提交多个添加表单
|
|
|
+ //提交批量添加表单
|
|
|
submitFormVolume(){
|
|
|
+ this.$refs.upload.submit()
|
|
|
const formData = new FormData()
|
|
|
formData.append("file",this.file)
|
|
|
- post('http://127.0.0.1:4523/m1/1998420-0-default/pdf-tech/vppTeam/addTeamMemberBatch', formData).then((res) => {
|
|
|
- console.log(res)
|
|
|
- if(res){
|
|
|
+ post('http://81.68.234.235:8032/pdf-tech/vppTeam/addTeamMemberBatch', formData).then((res) => {
|
|
|
+ if(res.data.msg === "Add Success!"){
|
|
|
this.$message({
|
|
|
message: 'Change Success',
|
|
|
type: "success",
|
|
@@ -59,12 +52,19 @@ export default {
|
|
|
//批量上传文件
|
|
|
upLoadChange(file){
|
|
|
this.file = file
|
|
|
- this.fileList.push(file)
|
|
|
- console.log("上传的单个文件",this.file)
|
|
|
- console.log("上传的文件",this.fileList)
|
|
|
+ return false
|
|
|
}
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ //获取团队列表
|
|
|
+ get('http://81.68.234.235:8032/pdf-tech/vppTeam/listWithAdmin').then(
|
|
|
+ (res) => {
|
|
|
+ if(res.data.msg === "success"){
|
|
|
+ this.teamList = res.data.result
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
watch: {
|
|
|
|
|
|
}
|
|
@@ -138,15 +138,15 @@ export default {
|
|
|
<span class="text-[#FF5054]">*</span>
|
|
|
</span>
|
|
|
<el-select
|
|
|
- v-model="formData.team"
|
|
|
+ v-model="formData.teamId"
|
|
|
placeholder="Product Designer"
|
|
|
class="w-[40%]"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in teamList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -208,14 +208,18 @@ export default {
|
|
|
drag
|
|
|
action=""
|
|
|
:before-upload="upLoadChange"
|
|
|
- multiple
|
|
|
- accept=".csv">
|
|
|
+ :auto-upload="false"
|
|
|
+ :limit="1"
|
|
|
+ accept=".xlsx"
|
|
|
+ ref="upload">
|
|
|
<div class="el-upload__text">Drag or drop CSV file here or <em>browse</em></div>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<span slot="label" class="label leading-20px text-[#1460F3] hover:opacity-70 cursor-pointer">
|
|
|
- Download sample CSV <img src="@/assets/images/downLoadBlue.svg" class="inline-block ">
|
|
|
+ <a href="/download/团队成员导入模板.xlsx" download="团队成员导入模板.xlsx">
|
|
|
+ Download sample CSV <img src="@/assets/images/downLoadBlue.svg" class="inline-block ">
|
|
|
+ </a>
|
|
|
</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -304,6 +308,9 @@ export default {
|
|
|
::v-deep .el-upload{
|
|
|
width: 50%;
|
|
|
}
|
|
|
+::v-deep .el-upload-list__item{
|
|
|
+ width: 50%;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|