| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <div class="app-container">
- <div class="main-right-box">
- <div class="main-search-box">
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="介绍信编号" prop="letterNo">
- <el-input
- v-model="queryParams.letterNo"
- placeholder="请输入关键字"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="来访事由" prop="reasons">
- <el-input
- v-model="queryParams.reasons"
- placeholder="请输入关键字"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="状态" prop="status">
- <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
- <el-option
- v-for="dict in dict.type.letter_status"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['core:letter:add']"
- >录入介绍信</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- </div>
- <el-table v-loading="loading" height="650" border :data="letterList">
- <el-table-column label="介绍信编号" align="center" prop="letterNo" width="120">
- </el-table-column>
-
- <el-table-column label="接待机构" header-align="center" align="left" prop="receptionOrgNames" />
- <el-table-column label="来访事由" header-align="center" align="left" prop="reasons" width="300"/>
- <el-table-column label="开具日期" header-align="center" align="left" prop="startTime" width="150"/>
- <el-table-column label="有效天数" header-align="center" align="center" prop="effectiveDays" width="100"/>
- <!-- <el-table-column label="介绍信有效期" align="center" width="250">
- <template slot-scope="scope">
- <span>{{ scope.row.startTime}}~{{scope.row.endTime}}</span>
- </template>
- </el-table-column> -->
- <el-table-column label="状态" align="center" width="100" prop="status" >
- <template slot-scope="scope">
- <dict-tag :options="dict.type.letter_status" :value="scope.row.status"/>
- </template>
- </el-table-column>
- <el-table-column label="备注" header-align="center" align="left" width="200" prop="description" />
- <el-table-column label="操作" header-align="center" align="left" width="280" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-check"
- v-if="scope.row.status==0"
- @click="handleUseLetter(scope.row)"
- v-hasPermi="['core:letter:edit']"
- >下发</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDetailInfo(scope.row)"
- v-hasPermi="['core:letter:edit']"
- >详情</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit-outline"
- v-if="!scope.row.haveOutInRecord && scope.row.status!=2"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['core:letter:edit']"
- >编辑</el-button>
- <el-button
- size="mini"
- type="text"
- v-if="scope.row.status!=2"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['core:letter:remove']"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <dialog-add-letter ref="dialogAddLetter" @success="handleQuery(true)"></dialog-add-letter>
- <dialog-letter-detail ref="dialogLetterDetail" @success="handleQuery(true)"></dialog-letter-detail>
- </div>
- </div>
- </template>
- <script>
- import { listLetter, getLetter, delLetter, addLetter, updateLetter,updateLetterStatus } from "@/api/core/letter";
- import dialogAddLetter from "./dialog.addletter";
- import dialogLetterDetail from "./dialog.letter.detail.vue";
- export default {
- components: {dialogAddLetter,dialogLetterDetail},
- dicts: ['letter_status'],
- name: "Letter",
- data() {
- return {
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个停用
- single: true,
- // 非多个停用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 介绍信表格数据
- letterList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- letterNo:null,
- reasons: null,
- status: null,
- requestFromWeb:true,
- type:1,
- orgId:this.$store.getters.orgId,
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- }
- };
- },
- created() {
- this.getList();
- },
- methods: {
- /** 查询介绍信列表 */
- getList() {
- this.loading = true;
- listLetter(this.queryParams).then(response => {
- this.letterList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- // this.reset();
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.$refs["dialogAddLetter"].show(null,{});
- },
-
- /** 修改按钮操作 */
- handleUpdate(row) {
- // this.reset();
- // const id = row.id || this.ids
- this.$refs["dialogAddLetter"].show(row.id ,{});
- },
- handleUseLetter(row)
- {
- updateLetterStatus({id:row.id,status:1}).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.getList();
- });
- },
- handleDetailInfo(row)
- {
- this.$refs["dialogLetterDetail"].show(row.id);
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateLetter(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.getList();
- });
- } else {
- addLetter(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal.confirm('是否确认删除介绍信编号为 "' + row.letterNo + '" 的数据项?').then(function() {
- return delLetter(ids);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {});
- },
- }
- };
- </script>
|