|
|
@@ -52,6 +52,16 @@
|
|
|
<!-- <uni-data-select v-model="person.power" :localdata="range" @change="change"></uni-data-select> -->
|
|
|
<u-input v-model="person.power" :placeholder="'请输入职务'" />
|
|
|
</u-form-item>
|
|
|
+ <u-form-item class="typeStyle">
|
|
|
+ <p style="width: 150rpx;margin-left: 20rpx;">上传附件</p>
|
|
|
+ <!-- 选择文件上传,limit="1则最多选择一张图片,del-icon隐藏删除按钮 -->
|
|
|
+ <uni-file-picker v-model="person.attId" del-icon limit="1" auto-upload file-mediatype="all"
|
|
|
+ @select="selectFile" @delete="deleteFile">
|
|
|
+ <button type="primary" class="selectBtn">选择文件</button>
|
|
|
+ <!-- 加载中 -->
|
|
|
+ <isLodingModel v-if="loading"></isLodingModel>
|
|
|
+ </uni-file-picker>
|
|
|
+ </u-form-item>
|
|
|
<u-form-item class="antherStyle">
|
|
|
<button class="useBtn" @click="sureAdd">确认新增</button>
|
|
|
<button class="useBtn" @click="noAdd">取消</button>
|
|
|
@@ -61,22 +71,45 @@
|
|
|
<div>
|
|
|
<u-popup :show="showModal" mode="center" @close="closeModal" class="popup-box">
|
|
|
<view class="modalBox">
|
|
|
- <u--form labelPosition="left" :model="modalList" ref="uForm">
|
|
|
- <u-form-item style="width: 500rpx;" prop="modalList.name" borderBottom ref="item1">
|
|
|
+ <u--form labelPosition="left" :model="formData" ref="uForm">
|
|
|
+ <u-form-item style="width: 500rpx;" prop="formData.name" borderBottom ref="item1">
|
|
|
<span style="width: 100rpx;">姓名</span>
|
|
|
- <u--input class="modalInput" v-model="modalList.mname" border="none"></u--input>
|
|
|
+ <u--input class="modalInput" v-model="formData.mname" border="none"></u--input>
|
|
|
</u-form-item>
|
|
|
- <u-form-item style="width: 500rpx;" prop="modalList.mphone" borderBottom ref="item2">
|
|
|
+ <u-form-item style="width: 500rpx;" prop="formData.mphone" borderBottom ref="item2">
|
|
|
<span style="width: 100rpx;">电话号</span>
|
|
|
- <u--input class="modalInput" v-model="modalList.mphone" border="none"></u--input>
|
|
|
+ <u--input class="modalInput" v-model="formData.mphone" border="none"></u--input>
|
|
|
</u-form-item>
|
|
|
- <u-form-item style="width: 500rpx;" prop="modalList.mpower" borderBottom ref="item3">
|
|
|
+ <u-form-item style="width: 500rpx;" prop="formData.mpower" borderBottom ref="item3">
|
|
|
<span style="width: 100rpx;">职务</span>
|
|
|
- <u--input class="modalInput" v-model="modalList.mpower" border="none"></u--input>
|
|
|
+ <u--input class="modalInput" v-model="formData.mpower" border="none"></u--input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item class="typeStyle">
|
|
|
+ <p style="width: 150rpx;">上传附件</p>
|
|
|
+ <!-- 选择文件上传,limit="1则最多选择一张图片,del-icon隐藏删除按钮 -->
|
|
|
+ <uni-file-picker v-model="formData.attId" del-icon limit="1" auto-upload file-mediatype="all"
|
|
|
+ @select="selectFile" @delete="deleteFile">
|
|
|
+ <button type="primary" class="selectBtn">选择文件</button>
|
|
|
+ <!-- 加载中 -->
|
|
|
+ <isLodingModel v-if="loading"></isLodingModel>
|
|
|
+ </uni-file-picker>
|
|
|
</u-form-item>
|
|
|
- <!-- <u-form-item style="width: 500rpx;" label="状态" prop="modalList.mstatus" borderBottom
|
|
|
+ <u-form-item v-if="formData.att">
|
|
|
+ <p style="width: 150rpx;">已上传附件:</p>
|
|
|
+ <u-icon name="close" color="#4CB2B6" size="20" @click="closeImage()">
|
|
|
+ </u-icon>
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <text style="color:#00a3f4;cursor: pointer;margin-left: 20px !important;"
|
|
|
+ @click.native="viewSee(formData.att)">下载附件</text>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
+ <a style="color:#00a3f4;cursor: pointer;margin-left: 20px !important;"
|
|
|
+ @click="viewSee(formData.att)">下载附件</a>
|
|
|
+ <!-- #endif -->
|
|
|
+ </u-form-item>
|
|
|
+ <!-- <u-form-item style="width: 500rpx;" label="状态" prop="formData.mstatus" borderBottom
|
|
|
ref="item4">
|
|
|
- <u--input class="modalInput" v-model="modalList.mstatus" border="none"></u--input>
|
|
|
+ <u--input class="modalInput" v-model="formData.mstatus" border="none"></u--input>
|
|
|
</u-form-item> -->
|
|
|
</u--form>
|
|
|
<div style="display: flex;justify-content: space-around;align-items: center;margin-top: 20rpx;">
|
|
|
@@ -111,6 +144,10 @@
|
|
|
import {
|
|
|
getUserProfile,
|
|
|
} from "@/api/system/user"
|
|
|
+ import {
|
|
|
+ uploadFile,
|
|
|
+ downSee,
|
|
|
+ } from '@/utils/common.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -133,11 +170,13 @@
|
|
|
tableList: [], //已经报名参会的人员
|
|
|
editId: "", //需要修改人员的id
|
|
|
showModal: false, //修改的模态框
|
|
|
- modalList: {
|
|
|
+ formData: {
|
|
|
mname: '',
|
|
|
mphone: "",
|
|
|
mpower: '',
|
|
|
mstatus: '',
|
|
|
+ attId:[],
|
|
|
+ att:''
|
|
|
},
|
|
|
nameRules: false,
|
|
|
userRules: false,
|
|
|
@@ -148,9 +187,49 @@
|
|
|
makeDelId: "",
|
|
|
show123: false,
|
|
|
ifMeet: true,
|
|
|
+ loading:false,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ loading: {
|
|
|
+ handler(newLength, oldLength) {
|
|
|
+ this.$modal.isLoadingModel(this.loading)
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ closeImage() {
|
|
|
+ this.formData.attId = []
|
|
|
+ this.formData.att = ''
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ //查看已上传附件
|
|
|
+ viewSee(val) {
|
|
|
+ downSee(val)
|
|
|
+ },
|
|
|
+ // 移出图片函数
|
|
|
+ async deleteFile(e) {
|
|
|
+ this.formData.attId = [];
|
|
|
+ },
|
|
|
+ selectFile(e) {
|
|
|
+ this.formData.attId = [];
|
|
|
+ this.formData.att=''
|
|
|
+ let promises = [];
|
|
|
+ for (let i = 0; i < e.tempFilePaths.length; i++) {
|
|
|
+ const promise = uploadFile(e.tempFilePaths, i, this);
|
|
|
+ promises.push(promise);
|
|
|
+ }
|
|
|
+ Promise.all(promises).then(result => {
|
|
|
+ // 处理上传文件成功的结果
|
|
|
+ }).catch(error => {
|
|
|
+ // 处理上传文件失败的错误
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 移出图片函数
|
|
|
+ async deleteFile(e) {
|
|
|
+ this.formData.attId = [];
|
|
|
+ },
|
|
|
open() {
|
|
|
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
|
|
|
this.$refs.popup.open('center')
|
|
|
@@ -187,6 +266,8 @@
|
|
|
phone: '',
|
|
|
power: "",
|
|
|
status: "",
|
|
|
+ att: '',
|
|
|
+ attId: []
|
|
|
};
|
|
|
this.meetList.push(newPerson);
|
|
|
}
|
|
|
@@ -205,9 +286,15 @@
|
|
|
sureAdd() {
|
|
|
console.log(this.meetList[0], '123');
|
|
|
if (!this.userRules && !this.phoneRules && !this.nameRules) {
|
|
|
+ if (this.formData.attId && this.formData.attId.length > 0) {
|
|
|
+ this.formData.att = this.formData.attId[0];
|
|
|
+ } else {
|
|
|
+ this.formData.att = this.formData.att;
|
|
|
+ }
|
|
|
creatPeople({
|
|
|
meetingId: parseInt(this.meetId),
|
|
|
orgId: this.doorId,
|
|
|
+ att:this.formData.att,
|
|
|
ppDuty: this.meetList[0].power,
|
|
|
ppName: this.meetList[0].name,
|
|
|
ppTel: this.meetList[0].phone,
|
|
|
@@ -262,10 +349,11 @@
|
|
|
}).then(res => {
|
|
|
// console.log(res.data, 'data');
|
|
|
this.editId = res.data.id
|
|
|
- this.modalList.mname = row.ppName
|
|
|
- this.modalList.mphone = res.data.ppTel
|
|
|
- this.modalList.mpower = res.data.ppDuty
|
|
|
- this.modalList.mstatus = res.data.status
|
|
|
+ this.formData.mname = row.ppName
|
|
|
+ this.formData.mphone = res.data.ppTel
|
|
|
+ this.formData.mpower = res.data.ppDuty
|
|
|
+ this.formData.mstatus = res.data.status
|
|
|
+ this.formData.att= res.data.att
|
|
|
this.showModal = true
|
|
|
})
|
|
|
},
|
|
|
@@ -291,14 +379,20 @@
|
|
|
this.showModal = false
|
|
|
},
|
|
|
sureUpdate() {
|
|
|
+ if (this.formData.attId && this.formData.attId.length > 0) {
|
|
|
+ this.formData.att = this.formData.attId[0];
|
|
|
+ } else {
|
|
|
+ this.formData.att = this.formData.att;
|
|
|
+ }
|
|
|
editPeople({
|
|
|
+ att:this.formData.att,
|
|
|
id: this.editId,
|
|
|
meetingId: parseInt(this.meetId),
|
|
|
orgId: this.doorId,
|
|
|
- ppDuty: this.modalList.mpower,
|
|
|
- ppName: this.modalList.mname,
|
|
|
- ppTel: this.modalList.mphone,
|
|
|
- status: this.modalList.mstatus,
|
|
|
+ ppDuty: this.formData.mpower,
|
|
|
+ ppName: this.formData.mname,
|
|
|
+ ppTel: this.formData.mphone,
|
|
|
+ status: this.formData.mstatus,
|
|
|
}).then(res => {
|
|
|
console.log(res, 'update');
|
|
|
if (res.data) {
|
|
|
@@ -316,6 +410,7 @@
|
|
|
console.error('toast消息提示显示失败', err);
|
|
|
}
|
|
|
});
|
|
|
+ this.formData.attId = [];
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -424,7 +519,7 @@
|
|
|
|
|
|
.modalBox {
|
|
|
width: 600rpx;
|
|
|
- height: 400rpx;
|
|
|
+ height: 630rpx;
|
|
|
margin-left: 60rpx;
|
|
|
}
|
|
|
|
|
|
@@ -432,6 +527,13 @@
|
|
|
color: #4DB1B6;
|
|
|
}
|
|
|
|
|
|
+ .selectBtn {
|
|
|
+ width: 200rpx;
|
|
|
+ margin-left: 0;
|
|
|
+ font-size: 30rpx;
|
|
|
+ background-color: #4cb2b6;
|
|
|
+ }
|
|
|
+
|
|
|
.useBox {
|
|
|
width: 90%;
|
|
|
height: auto;
|
|
|
@@ -500,6 +602,7 @@
|
|
|
/* width: 800rpx; */
|
|
|
/* height: auto; */
|
|
|
border: none;
|
|
|
+ margin-bottom: 130rpx;
|
|
|
/* margin: 10rpx auto; */
|
|
|
}
|
|
|
|