|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="edu-training-edit">
|
|
|
- <DialogCom :title="'录入介绍信'" :close="onHide" :visible.sync="isShow" width="960px">
|
|
|
+ <DialogCom :title="title" @close="onHide" :visible.sync="isShow" width="800px">
|
|
|
<div class="page-body">
|
|
|
<el-form ref="form" :model="formData" :rules="formDataRules" label-width="100px">
|
|
|
<el-row>
|
|
|
@@ -11,10 +11,11 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="接待机构" prop="orgId">
|
|
|
+ <el-form-item label="接待机构" prop="orgIds">
|
|
|
<org-tree-select
|
|
|
- v-model="formData.orgId"
|
|
|
+ v-model="formData.orgIds"
|
|
|
ref="orgTreeSelect"
|
|
|
+ :enabledCheckOrgTypes="orgType"
|
|
|
>
|
|
|
</org-tree-select>
|
|
|
</el-form-item>
|
|
|
@@ -28,7 +29,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item prop="endTime" label="培训结束时间">
|
|
|
+ <el-form-item prop="endTime" label="有效结束时间">
|
|
|
<el-date-picker required v-model="formData.endTime" :picker-options="endDatepickerOptions" @change="endDateChanged"
|
|
|
type="date" placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
@@ -43,8 +44,8 @@
|
|
|
<K-file-upload ref="upload" :defaultValue="formFileListDefualtValue" v-model="formData.letterFile"/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="备注" prop="checkRemark">
|
|
|
- <el-input v-model="formData.checkRemark" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-form-item label="备注" prop="description">
|
|
|
+ <el-input v-model="formData.description" type="textarea" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
@@ -58,22 +59,23 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="formData.userInfos">
|
|
|
+ <el-table :data="formData.userInfos">
|
|
|
<el-table-column label="人员姓名" align="center" prop="userName" />
|
|
|
<el-table-column label="单位" align="center" prop="companyName" />
|
|
|
<el-table-column label="证据号码" align="center" prop="idCard">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="证件" align="center" prop="imgFile" >
|
|
|
<template slot-scope="scope">
|
|
|
- <img width="50" height="50" :src="scope.row.imgFile">
|
|
|
+ <img width="50" height="50" :src="splitImgFilePath(scope.row.imgFile,0)">
|
|
|
+ <img width="50" height="50" :src="splitImgFilePath(scope.row.imgFile,1)">
|
|
|
</template>
|
|
|
- </el-table-column>>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
- @click="editUser(scope.row)"
|
|
|
+ @click="editUser(scope.row,scope.$index)"
|
|
|
>编辑</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -86,31 +88,32 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
|
|
|
- <DialogCom title="添加出入人员" :visible.sync="open" width="800px" append-to-body @close="onHideUser">
|
|
|
- <el-form ref="formUser" :model="userInfo" :rules="userInfoRules" label-width="80px">
|
|
|
- <el-form-item label="人员姓名" prop="userName">
|
|
|
- <el-input v-model="userInfo.userName" placeholder="请输入姓名" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="单位" prop="companyName">
|
|
|
- <el-input v-model="userInfo.companyName" placeholder="请输入单位" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="证件号码" prop="idCard">
|
|
|
- <el-input v-model="userInfo.idCard" placeholder="请输入证件号码" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="imgFile" label="上传图片">
|
|
|
- <imgUpload ref="uploadimage" type="alone" :value="userInfo.imgFile"
|
|
|
- @input="imageListChanged"></imgUpload>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitUser">确 定</el-button>
|
|
|
- <el-button @click="onHideUser">取 消</el-button>
|
|
|
- </div>
|
|
|
- </DialogCom>
|
|
|
-
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="onHide">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </DialogCom>
|
|
|
+
|
|
|
+
|
|
|
+ <DialogCom title="添加出入人员" :visible.sync="open" width="800px" append-to-body @close="onHideUser">
|
|
|
+ <el-form ref="formUser" :model="userInfo" :rules="userInfoRules" label-width="80px">
|
|
|
+ <el-form-item label="人员姓名" prop="userName">
|
|
|
+ <el-input v-model="userInfo.userName" placeholder="请输入姓名" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位" prop="companyName">
|
|
|
+ <el-input v-model="userInfo.companyName" placeholder="请输入单位" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="证件号码" prop="idCard">
|
|
|
+ <el-input v-model="userInfo.idCard" placeholder="请输入证件号码" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="imgFile" label="上传图片">
|
|
|
+ <imgUpload ref="imgUpload" :limit="2" type="more" :value="userInfo.imgFile"
|
|
|
+ @input="imageListChanged"></imgUpload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onHideUser">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitUser">确 定</el-button>
|
|
|
</div>
|
|
|
</DialogCom>
|
|
|
</div>
|
|
|
@@ -120,7 +123,7 @@
|
|
|
import {mapState, mapMutations} from "vuex";
|
|
|
import { listLetter, getLetter, delLetter, addLetter, updateLetter } from "@/api/core/letter";
|
|
|
import OrgTreeSelect from "@/components/orgTreeSelect";
|
|
|
-import KFileUpload from "@/components/K-FileUpload/index.vue";
|
|
|
+import KFileUpload from "@/components/K-FileUpload";
|
|
|
import dayjs from "dayjs";
|
|
|
import imgUpload from "@/components/ImageUpload";
|
|
|
export default {
|
|
|
@@ -133,7 +136,7 @@ export default {
|
|
|
formData: this.reset(),
|
|
|
formDataRules: {
|
|
|
letterName: [{required: true, message: "请输入介绍信名称"}],
|
|
|
- orgId: [{required: true, message: "请选择接待机构"}],
|
|
|
+ orgIds: [{required: true, message: "请选择接待机构"}],
|
|
|
startTime: [{required: true, message: "请选择有效开始时间"}],
|
|
|
endTime: [{required: true, message: "请选择有效结束时间"}],
|
|
|
userInfos:[{required: true, message: "请添加出入人员"}],
|
|
|
@@ -151,8 +154,11 @@ export default {
|
|
|
},
|
|
|
formFileListDefualtValue: [],
|
|
|
open: false,
|
|
|
- userInfo:this.resetUserInfo(),
|
|
|
- imageList:[]
|
|
|
+ userInfo: this.resetUserInfo(),
|
|
|
+ imageList:[],
|
|
|
+ title:null,
|
|
|
+ index:null,
|
|
|
+ orgType:4
|
|
|
};
|
|
|
},
|
|
|
dicts: ['letter_status'],
|
|
|
@@ -169,12 +175,13 @@ export default {
|
|
|
reset(other = {}) {
|
|
|
return {
|
|
|
letterName:null,
|
|
|
- orgId:null,
|
|
|
+ orgIds:null,
|
|
|
startTime: null,
|
|
|
endTime: null,
|
|
|
- checkRemark: null,
|
|
|
+ description: null,
|
|
|
fileList: [],
|
|
|
- userInfos:[],
|
|
|
+ userInfos:null,
|
|
|
+ letterFile:null,
|
|
|
...other,
|
|
|
};
|
|
|
},
|
|
|
@@ -186,12 +193,28 @@ export default {
|
|
|
imgFile:null,
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ splitImgFilePath(imgPaths,index){
|
|
|
+ return imgPaths.split(',')[index];
|
|
|
+ },
|
|
|
async show(id, other = {}) {
|
|
|
this.isShow = true;
|
|
|
+ this.title = "新增介绍信";
|
|
|
+ console.log("-----------------",id);
|
|
|
+ if(id){
|
|
|
+ getLetter(id).then(response => {
|
|
|
+ this.formData = response.data;
|
|
|
+ this.userInfos = response.data.userInfos;
|
|
|
+ this.orgIds = response.data.orgIds;
|
|
|
+ this.formFileListDefualtValue = response.data.letterFile;
|
|
|
+ this.title = "修改介绍信";
|
|
|
+ console.log("-----------------",this.formFileListDefualtValue);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
handleAddUser() {
|
|
|
this.open = true;
|
|
|
+ console.log(this.userInfo,'hhhh')
|
|
|
},
|
|
|
imageListChanged(list) {
|
|
|
this.userInfo.imgFile = list;
|
|
|
@@ -220,6 +243,8 @@ export default {
|
|
|
onHide() {
|
|
|
this.isShow = false;
|
|
|
this.formData = this.reset();
|
|
|
+ this.$refs["upload"].clearFiles();
|
|
|
+ this.$emit('closed')
|
|
|
},
|
|
|
onHideUser() {
|
|
|
this.open = false;
|
|
|
@@ -231,9 +256,14 @@ export default {
|
|
|
if (valid) {
|
|
|
this.open = false;
|
|
|
console.log("================",this.userInfo);
|
|
|
- this.formData.userInfos.push(this.userInfo);
|
|
|
+ if(this.index==null){
|
|
|
+ this.formData.userInfos.push(this.userInfo);
|
|
|
+ }else{
|
|
|
+ this.formData.userInfos[this.index]=this.userInfo;
|
|
|
+ }
|
|
|
this.userInfo = this.resetUserInfo();
|
|
|
this.imageList=[];
|
|
|
+ this.index=null;
|
|
|
}})
|
|
|
},
|
|
|
submitForm(){
|
|
|
@@ -247,24 +277,23 @@ export default {
|
|
|
if (this.formData.id != null) {
|
|
|
updateLetter(this.formData).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
- this.isShow = false;
|
|
|
- this.formData = this.reset();
|
|
|
- this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
addLetter(this.formData).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
- this.isShow = false;
|
|
|
- this.formData = this.reset();
|
|
|
- this.getList();
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ this.onHide();
|
|
|
+ /* this.isShow = false;
|
|
|
+ this.formData = this.reset();
|
|
|
+ this.getList();
|
|
|
+ this.$refs["upload"].clearFiles();*/
|
|
|
}})
|
|
|
},
|
|
|
- editUser(row){
|
|
|
+ editUser(row,index){
|
|
|
this.open = true;
|
|
|
this.userInfo = row;
|
|
|
+ this.index=index;
|
|
|
},
|
|
|
remove(row){
|
|
|
console.log("================",row);
|