| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- <template>
- <div class="edu-training-edit">
- <DialogCom
- :title="title"
- @close="onHide"
- :visible.sync="isShow"
- width="1000px"
- >
- <div class="page-body">
- <el-form
- ref="form"
- :model="formData"
- :rules="formDataRules"
- label-width="120px"
- label-suffix=":"
- >
- <el-row>
- <el-col :span="24">
- <el-form-item label="介绍信类型">
- <dict-tag :options="dict.type.out_in_type" :value="formData.type"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="介绍信编号">
- {{formData.letterNo}}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="接待机构" prop="receptionOrgIds">
- {{formData.receptionOrgNames}}
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="来访事由">
- {{formData.reasons}}
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="开具时间">
- {{formData.startTimeStr}}
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="有效天数">
- {{ formData.effectiveDays}}
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="介绍信">
- <K-file-upload ref="upload" :isShowUploadBtn="false"
- :defaultValue="formFileListDefualtValue"
- v-model="formData.letterFile"/>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="备注" prop="letterNo">
- {{formData.description}}
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10" >
- <el-col :span="12">
- <h3>
- <i class="el-icon-collection-tag"></i>
- 人员信息
- </h3>
- </el-col>
- </el-row>
- <el-table border :data="formData.userInfos" height="300">
- <el-table-column label="序号" align="center" type="index" width="70" />
- <el-table-column label="来访单位" width="100" align="center" prop="companyName" />
- <el-table-column label="来访人员" width="100" align="center" prop="userName" />
- <el-table-column label="证件类型" width="100" align="center" prop="idType">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.letter_id_type" :value="scope.row.idType"/>
- </template>
- </el-table-column>
- <el-table-column label="证件号码" width="200" align="center" prop="idCard">
- </el-table-column>
- <el-table-column label="证件照" align="center" prop="imgFile">
- <template slot-scope="scope">
- <ImageListPreview v-model="scope.row.imgFile"></ImageListPreview>
- </template>
- </el-table-column>
- </el-table>
- <el-row :gutter="10">
- <el-col :span="12">
- <h3>
- <i class="el-icon-collection-tag"></i>
- 审批信息
- </h3>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="审批操作" prop="approveStatus">
- <el-radio v-model="formData.approveStatus" label="1">同意</el-radio>
- <el-radio v-model="formData.approveStatus" label="2">不同意</el-radio>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="审批说明" prop="approveRemark">
- <el-input
- v-model="formData.approveRemark"
- placeholder="请输入审批说明"
- maxlength="100"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="onHide">取 消</el-button>
- </div>
- </DialogCom>
- </div>
- </template>
- <script>
- import { mapState, mapMutations } from "vuex";
- import {
- getLetter,
- approveLetter,
- } from "@/api/core/letter";
- import KFileUpload from "@/components/K-FileUpload/index.vue";
- import dayjs from "dayjs";
- import imgUpload from "@/components/ImageUpload";
- import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
- export default {
- components: { KFileUpload, imgUpload,DataRangePicker },
- data() {
- const params = this.$route.params;
- return {
- id: params ? params.id : null,
- isShow: false,
- title: "来访事项审批",
- formData: this.reset(),
- formDataRules: {
- approveStatus: [{ required: true, message: "请勾选审批结果" }],
- },
- formFileListDefualtValue: [],
- };
- },
- dicts: ['out_in_type','letter_id_type'],
- props: {},
- watch: {},
- created() {},
- computed: {
- ...mapState(["loginUser", "org"]),
- },
- methods: {
- ...mapMutations([]),
- reset(other = {}) {
- return {
- reasons: null,
- letterNo:null,
- receptionOrgIds: [],
- range:[],
- description: null,
- letterFile: [],
- userInfos: [],
- type:null,
- approveRemark:null,
- approveStatus:null,
- ...other,
- };
- },
- // checkApprove(rule,value,callback)
- // {
- // console.log("checkApprove rule",rule);
- // console.log("checkApprove value",value);
- // console.log("checkApprove callback",callback);
- // },
- async show(id, other = {}) {
- if (id) {
- this.title = "出入事项审批";
- this.isShow = true;
- getLetter(id).then((response) => {
- // let tempRange=[];
- // tempRange.push(dayjs(response.data.startTime));
- // tempRange.push(new Date(response.data.endTime));
- // response.data.range=tempRange;
- this.formData = response.data;
- this.formFileListDefualtValue=this.formData.letterFile;
- });
- }
- else
- {
- this.isShow = true;
- this.title = "录入介绍信";
- this.formData = this.reset();
- }
- },
- handleAddUser() {
- this.open = true;
- },
- imageListChanged(list) {
- this.userInfo.imgFile = list;
- },
- endDisabledDate(time) {
- //小于开始日期禁止选择
- let startDate = new Date();
- startDate.setTime(startDate.getTime() - 3600 * 1000 * 24);
- if (this.formData.trainingStartDateTime) {
- startDate = new Date(
- dayjs(this.formData.trainingStartDateTime).format("YYYY-MM-DD")
- );
- startDate.setTime(startDate.getTime() - 3600 * 1000 * 24);
- }
- return time.getTime() < new Date(startDate).getTime();
- },
- startDateChanged(time) {
- if (
- dayjs(this.formData.startTime).isAfter(dayjs(this.formData.endTime))
- ) {
- this.formData.endTime = this.formData.startTime;
- }
- },
- endDateChanged(time) {
- if (
- dayjs(this.formData.startTime).isAfter(dayjs(this.formData.endTime))
- ) {
- this.formData.startTime = this.formData.endTime;
- }
- },
- onHide() {
- this.isShow = false;
- this.formData = this.reset();
- this.$refs["upload"].clearFiles();
- },
-
- submitForm() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- let {approveRemark,approveStatus,approveLog} = this.formData;
- let tempRquest={approveRemark,approveStatus,id:approveLog.id};
- console.log("================",tempRquest );
- approveLetter(tempRquest).then((response) => {
- this.$modal.msgSuccess("提交成功");
- this.isShow = false;
- this.formData = this.reset();
- this.$emit("success", this.formData);
- });
- }
- });
- },
- },
- mounted() {},
- };
- </script>
|