代码格式修改
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="姓名" prop="auditor">
|
||||
<el-input v-model="queryParams.auditor" placeholder="请输入审核者" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -15,22 +15,26 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['routine:audit:add']">新增</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:add']" type="primary" plain icon="el-icon-plus" size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['routine:audit:edit']">修改</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:edit']" type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['routine:audit:remove']">删除</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:remove']" type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['routine:audit:export']">导出</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:export']" type="warning" plain icon="el-icon-download" size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="auditList" @selection-change="handleSelectionChange">
|
||||
@@ -49,18 +53,22 @@
|
||||
</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" icon="el-icon-edit" @click="handleCheckUsage(scope.row.id)"
|
||||
v-if="scope.row.auStatus === '0'">审批</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['routine:audit:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['routine:audit:remove']">删除</el-button>
|
||||
<el-button v-if="scope.row.auStatus === '0'" size="mini" type="text" icon="el-icon-edit"
|
||||
@click="handleCheckUsage(scope.row.id)"
|
||||
>审批</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:edit']" size="mini" type="text" icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button v-hasPermi="['routine:audit:remove']" size="mini" type="text" icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</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" />
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改功能房预约审核对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@@ -82,14 +90,15 @@
|
||||
<!-- 内层弹出框 -->
|
||||
<div style="height: 60vh;padding: 20px; position: relative;">
|
||||
<el-dialog width="40%" title="不同意说明" :visible.sync="innerVisible" append-to-body
|
||||
style="position: absolute; top: 100px;">
|
||||
style="position: absolute; top: 100px;"
|
||||
>
|
||||
<div style="display: flex; height: 30vh; justify-content: center; margin-top: 50px;"> <label>不同意说明</label>
|
||||
<el-input style="width: 70%; margin-left: 20px;" type="textarea" :rows="4" placeholder="请输入内容"
|
||||
v-model="queryParams.reason">
|
||||
</el-input>
|
||||
<el-input v-model="queryParams.reason" style="width: 70%; margin-left: 20px;" type="textarea" :rows="4"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
<div style="position: absolute; bottom: 20px; right: 10px;">
|
||||
<el-button @click="innerVisible = false" style="margin-right: 10px;">取 消</el-button>
|
||||
<el-button @click="disAgree" style="margin-right: 10px;">确定</el-button>
|
||||
<el-button style="margin-right: 10px;" @click="innerVisible = false">取 消</el-button>
|
||||
<el-button style="margin-right: 10px;" @click="disAgree">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -133,8 +142,8 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style=" position: absolute; bottom: 20px; right: 10px;">
|
||||
<el-button @click="outerVisible = false" style="margin-right: 10px;">取 消</el-button>
|
||||
<el-button @click="approveAudit" style="margin-right: 10px;">同意</el-button>
|
||||
<el-button style="margin-right: 10px;" @click="outerVisible = false">取 消</el-button>
|
||||
<el-button style="margin-right: 10px;" @click="approveAudit">同意</el-button>
|
||||
<el-button @click="innerVisible = true">不同意</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,10 +152,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAudit, getAudit, delAudit, addAudit, updateAudit } from "@/api/routine/audit";
|
||||
import { listAudit, getAudit, delAudit, addAudit, updateAudit } from '@/api/routine/audit'
|
||||
|
||||
export default {
|
||||
name: "Audit",
|
||||
name: 'Audit',
|
||||
dicts: ['rt_fu_audit_au_status'],
|
||||
data() {
|
||||
return {
|
||||
@@ -165,7 +174,7 @@ export default {
|
||||
// 功能房预约审核表格数据
|
||||
auditList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@@ -191,15 +200,15 @@ export default {
|
||||
outerVisible: false,
|
||||
innerVisible: false,
|
||||
selectedAudit: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询功能房预约审核列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.loading = true
|
||||
listAudit(this.queryParams).then(response => {
|
||||
this.auditList = response.rows.map(item => ({
|
||||
id:item.id,
|
||||
@@ -216,17 +225,17 @@ export default {
|
||||
rtTime:item.reservation.rtTime,
|
||||
rtYuyue:item.reservation.rtYuyue
|
||||
|
||||
}));
|
||||
}))
|
||||
// console.log(response.rows)
|
||||
console.log(this.auditList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
console.log(this.auditList)
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
@@ -239,18 +248,18 @@ export default {
|
||||
depart: null,
|
||||
createTime: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@@ -260,49 +269,49 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加功能房预约审核";
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加功能房预约审核'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getAudit(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改功能房预约审核";
|
||||
});
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改功能房预约审核'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateAudit(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addAudit(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除功能房预约审核编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delAudit(ids);
|
||||
return delAudit(ids)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => { })
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -311,8 +320,8 @@ export default {
|
||||
}, `audit_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleCheckUsage(id) {
|
||||
this.selectedAudit = id;
|
||||
this.outerVisible = true;
|
||||
this.selectedAudit = id
|
||||
this.outerVisible = true
|
||||
},
|
||||
|
||||
/** 同意审批 */
|
||||
@@ -320,14 +329,14 @@ export default {
|
||||
const approvalData = {
|
||||
id: this.selectedAudit,
|
||||
auStatus: 1
|
||||
};
|
||||
}
|
||||
updateAudit(approvalData).then(response => {
|
||||
this.$message.success("审批成功");
|
||||
this.outerVisible = false;
|
||||
this.getList();
|
||||
this.$message.success('审批成功')
|
||||
this.outerVisible = false
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
this.$message.error("审批失败:" + error.message);
|
||||
});
|
||||
this.$message.error('审批失败:' + error.message)
|
||||
})
|
||||
},
|
||||
//不同意理由
|
||||
disAgree() {
|
||||
@@ -335,21 +344,21 @@ export default {
|
||||
id: this.selectedAudit,
|
||||
reason: this.queryParams.reason,
|
||||
auStatus: 2 // 将审批状态更新为2,表示不同意
|
||||
};
|
||||
}
|
||||
updateAudit(disAgree).then(response => {
|
||||
this.$message.success("提交成功");
|
||||
this.innerVisible = false;
|
||||
this.getList();
|
||||
this.$message.success('提交成功')
|
||||
this.innerVisible = false
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
this.$message.error("提交失败:" + error.message);
|
||||
});
|
||||
this.$message.error('提交失败:' + error.message)
|
||||
})
|
||||
},
|
||||
formatDateToWeekday(dateString) {
|
||||
const days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
const date = new Date(dateString); // 假设dateString是一个合法的日期格式,如 "2024-07-30"
|
||||
const dayOfWeek = date.getDay(); // 获取星期几的数字,0表示星期日,1表示星期一,以此类推
|
||||
return days[dayOfWeek];
|
||||
const days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
|
||||
const date = new Date(dateString) // 假设dateString是一个合法的日期格式,如 "2024-07-30"
|
||||
const dayOfWeek = date.getDay() // 获取星期几的数字,0表示星期日,1表示星期一,以此类推
|
||||
return days[dayOfWeek]
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user