代码格式修改
This commit is contained in:
@@ -1,88 +1,105 @@
|
||||
<template>
|
||||
<div v-if="applicationInfo">
|
||||
<!-- 弹出层 -->
|
||||
<el-drawer :visible.sync="drawer" direction="btt" :append-to-body="true" :modal-append-to-body="false"
|
||||
:with-header="false" size="100%">
|
||||
<div style="padding: 20px;">
|
||||
<!-- 页头 -->
|
||||
<el-page-header @back="goBack" content="申请表详情">
|
||||
</el-page-header>
|
||||
<h2>申请理由:{{ applicationInfo.reason | filterReason }}</h2>
|
||||
<!-- 功能按钮 -->
|
||||
<el-row :gutter="10" class="mb8" style="margin: 20px 0; ">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" :disabled="disabledAddApprover" size="mini"
|
||||
@click="handleAddApp" v-hasPermi="['system:application:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini"
|
||||
:disabled="applicationInfo.approvalList.length ? false : true" @click="deleteReview"
|
||||
v-hasPermi="['system:application:remove']">清空</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 表单 -->
|
||||
<el-table :loading="appLoading" :data="applicationInfo.approvalList"
|
||||
@selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column prop="approverName" align="center" label="审核人" />
|
||||
<el-table-column prop="status" align="center" label="审核情况">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | filterStatus }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phonenumber" align="center" label="审核人联系方式tel" />
|
||||
<el-table-column prop="approverTime" align="center" label="审核起始时间" />
|
||||
<el-table-column prop="createTime" align="center" label="审核通过时间" />
|
||||
<el-table-column prop="comment" align="center" label="备注" />
|
||||
<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="handleEditApp"
|
||||
v-hasPermi="['system:application:edit']">修改</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="deleteReview(scope.row)"
|
||||
<div v-if="applicationInfo">
|
||||
<!-- 弹出层 -->
|
||||
<el-drawer :visible.sync="drawer" direction="btt" :append-to-body="true" :modal-append-to-body="false"
|
||||
:with-header="false" size="100%"
|
||||
>
|
||||
<div style="padding: 20px;">
|
||||
<!-- 页头 -->
|
||||
<el-page-header content="申请表详情" @back="goBack" />
|
||||
<h2>申请理由:{{ applicationInfo.reason | filterReason }}</h2>
|
||||
<!-- 功能按钮 -->
|
||||
<el-row :gutter="10" class="mb8" style="margin: 20px 0; ">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:application:add']" type="primary" plain icon="el-icon-plus" :disabled="disabledAddApprover"
|
||||
size="mini" @click="handleAddApp"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:application:remove']" type="danger" plain icon="el-icon-delete"
|
||||
size="mini" :disabled="applicationInfo.approvalList.length ? false : true"
|
||||
@click="deleteReview"
|
||||
>清空</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 表单 -->
|
||||
<el-table :loading="appLoading" :data="applicationInfo.approvalList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column prop="approverName" align="center" label="审核人" />
|
||||
<el-table-column prop="status" align="center" label="审核情况">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | filterStatus }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phonenumber" align="center" label="审核人联系方式tel" />
|
||||
<el-table-column prop="approverTime" align="center" label="审核起始时间" />
|
||||
<el-table-column prop="createTime" align="center" label="审核通过时间" />
|
||||
<el-table-column prop="comment" align="center" label="备注" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-hasPermi="['system:application:edit']" size="mini" type="text" icon="el-icon-edit"
|
||||
@click="handleEditApp"
|
||||
>修改</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="deleteReview(scope.row)"
|
||||
v-hasPermi="['system:application:remove']">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 添加审核人 -->
|
||||
<el-dialog :visible.sync="openAddApp" :title="title" width="500px">
|
||||
<el-form ref="applicationForm" :model="approverForm" label-width="80px" :rules="approverRules"
|
||||
label-position="top">
|
||||
<!-- 添加审核人 -->
|
||||
<el-dialog :visible.sync="openAddApp" :title="title" width="500px">
|
||||
<el-form ref="applicationForm" :model="approverForm" label-width="80px" :rules="approverRules"
|
||||
label-position="top"
|
||||
>
|
||||
|
||||
<el-form-item label="申请表" prop="applicationIds">
|
||||
<el-select style="width: 100%;" v-model="approverForm.applicationIds" multiple placeholder="请选择申请表">
|
||||
<el-option v-for="item in applicationList" :key="item.id" :label="item.stuName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请表" prop="applicationIds">
|
||||
<el-select v-model="approverForm.applicationIds" style="width: 100%;" multiple placeholder="请选择申请表">
|
||||
<el-option v-for="item in applicationList" :key="item.id" :label="item.stuName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审核人" prop="approverIds">
|
||||
<el-select style="width: 100%;" v-model="approverForm.approverIds" :loading="selectLoading" multiple
|
||||
:filterable="true" :remote="true" :default-first-option="true" :remote-method="remoteFn"
|
||||
placeholder="请输入审核人姓名搜索选择">
|
||||
<el-option v-for="item in approverList" :key="item.userId" :label="item.nickName"
|
||||
:value="item.userId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitApproverForm">确 定</el-button>
|
||||
<el-button @click="appriverCancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-form-item label="审核人" prop="approverIds">
|
||||
<el-select v-model="approverForm.approverIds" style="width: 100%;" :loading="selectLoading" multiple
|
||||
:filterable="true" :remote="true" :default-first-option="true" :remote-method="remoteFn"
|
||||
placeholder="请输入审核人姓名搜索选择"
|
||||
>
|
||||
<el-option v-for="item in approverList" :key="item.userId" :label="item.nickName"
|
||||
:value="item.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitApproverForm">确 定</el-button>
|
||||
<el-button @click="appriverCancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { remoteApprover } from "@/api/dormitory/application";
|
||||
import { createReview, delReview, reviewProcess } from "@/api/dormitory/accommodation-management/review";
|
||||
import { remoteApprover } from '@/api/dormitory/application'
|
||||
import { createReview, delReview, reviewProcess } from '@/api/dormitory/accommodation-management/review'
|
||||
|
||||
export default {
|
||||
name: 'SRSUiIndex',
|
||||
props: ["type"],
|
||||
filters: {
|
||||
filterStatus(value) {
|
||||
if (!value) {
|
||||
return '审核中'
|
||||
}
|
||||
return '审核完成'
|
||||
},
|
||||
filterReason(value) {
|
||||
if (!value) return '暂无'
|
||||
return value
|
||||
}
|
||||
},
|
||||
props: ['type'],
|
||||
data() {
|
||||
return {
|
||||
// 加载
|
||||
@@ -96,7 +113,7 @@ export default {
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 添加审核人表单
|
||||
approverForm: {
|
||||
// 审核人id列表
|
||||
@@ -109,10 +126,10 @@ export default {
|
||||
// 添加审核人表单验证规则
|
||||
approverRules: {
|
||||
applicationIds: [
|
||||
{ required: true, message: "需要添加审核人的申请不能为空", trigger: "blur" }
|
||||
{ required: true, message: '需要添加审核人的申请不能为空', trigger: 'blur' }
|
||||
],
|
||||
approverIds: [
|
||||
{ required: true, message: "审核人不能为空", trigger: "blur" }
|
||||
{ required: true, message: '审核人不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
// 申请表列表
|
||||
@@ -128,12 +145,18 @@ export default {
|
||||
// ids列表
|
||||
ids: [],
|
||||
approverNameList: []
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openAddApp(newValue) {
|
||||
if (newValue) return
|
||||
this.approverForm.approverIds = []
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// 获取申请表详细信息
|
||||
this.$bus.$on("sendApplicationInfo", this.getApplicationInfo)
|
||||
this.$bus.$on('sendApplicationInfo', this.getApplicationInfo)
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -144,7 +167,7 @@ export default {
|
||||
}, 500)
|
||||
this.appLoading = false
|
||||
clearTimeout(timer)
|
||||
this.$emit("resetData", this.applicationInfo.id)
|
||||
this.$emit('resetData', this.applicationInfo.id)
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@@ -183,7 +206,7 @@ export default {
|
||||
this.$modal.confirm(`是否删除审核人为"${this.approverNameList}"的数据项`).then(() => {
|
||||
return delReview(ids)
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getApplication()
|
||||
})
|
||||
},
|
||||
@@ -198,10 +221,10 @@ export default {
|
||||
},
|
||||
// 表单确认
|
||||
submitApproverForm() {
|
||||
this.$refs["applicationForm"].validate(valid => {
|
||||
this.$refs['applicationForm'].validate(valid => {
|
||||
if (valid) {
|
||||
createReview(this.approverForm).then(res => {
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
this.$modal.msgSuccess('添加成功')
|
||||
this.getApplication()
|
||||
this.appLoading = true
|
||||
this.openAddApp = false
|
||||
@@ -211,44 +234,26 @@ export default {
|
||||
},
|
||||
// 新增
|
||||
handleAddApp() {
|
||||
this.title = "为审核表添加审核人"
|
||||
this.title = '为审核表添加审核人'
|
||||
this.openAddApp = true
|
||||
this.selectDisabled = false
|
||||
this.approverForm.approverIds = []
|
||||
},
|
||||
// 修改审核人员
|
||||
handleEditApp() {
|
||||
this.title = "修改审核内容"
|
||||
this.title = '修改审核内容'
|
||||
this.openAddApp = true
|
||||
this.selectDisabled = true
|
||||
this.applicationInfo.approvalList.forEach(element => {
|
||||
this.approverForm.approverIds.push(element.approverName)
|
||||
});
|
||||
})
|
||||
},
|
||||
// 表单取消
|
||||
appriverCancel() {
|
||||
this.openAddApp = false
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
filterStatus(value) {
|
||||
if (!value) {
|
||||
return "审核中"
|
||||
}
|
||||
return "审核完成"
|
||||
},
|
||||
filterReason(value) {
|
||||
if (!value) return "暂无"
|
||||
return value
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openAddApp(newValue) {
|
||||
if (newValue) return
|
||||
this.approverForm.approverIds = []
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,26 +1,26 @@
|
||||
<!-- 自定义用户输入(编号、账号) -->
|
||||
<template>
|
||||
<input-with-helper :showLabel="true" v-bind="$attrs" v-on="$listeners" v-model="childValue" dialogTitle="选择宿舍" dialogWidth="600px"
|
||||
:searchCriteria="[
|
||||
{ label: '园区', prop: 'parkName' },
|
||||
{ label: '楼栋', prop: 'buildingName' },
|
||||
{ label: '房间号', prop: 'roomNo' },
|
||||
]" :columns="[
|
||||
{ title: '#', field: 'id', sortable: true },
|
||||
{ title: '宿舍', field: 'dorm_name' },
|
||||
]" :defaultSort="{
|
||||
field: 'id',
|
||||
order: 'asc',
|
||||
}" :searchMethod="listDorm" :valueProps="valueProps">
|
||||
</input-with-helper>
|
||||
<input-with-helper v-model="childValue" :show-label="true" v-bind="$attrs" dialog-title="选择宿舍" dialog-width="600px" :search-criteria="[
|
||||
{ label: '园区', prop: 'parkName' },
|
||||
{ label: '楼栋', prop: 'buildingName' },
|
||||
{ label: '房间号', prop: 'roomNo' },
|
||||
]"
|
||||
:columns="[
|
||||
{ title: '#', field: 'id', sortable: true },
|
||||
{ title: '宿舍', field: 'dorm_name' },
|
||||
]" :default-sort="{
|
||||
field: 'id',
|
||||
order: 'asc',
|
||||
}" :search-method="listDorm" :value-props="valueProps" v-on="$listeners"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDorm } from "@/api/dormitory/dmsDormitoryCheck/dormitoryCheck";
|
||||
import InputWithHelper from "@/components/ValueHelper/index";
|
||||
import { listDorm } from '@/api/dormitory/dmsDormitoryCheck/dormitoryCheck'
|
||||
import InputWithHelper from '@/components/ValueHelper/index'
|
||||
|
||||
export default {
|
||||
name: "DormSelect",
|
||||
name: 'DormSelect',
|
||||
components: {
|
||||
InputWithHelper,
|
||||
},
|
||||
@@ -30,9 +30,9 @@ export default {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
value: "id",
|
||||
label: "dorm_name"
|
||||
};
|
||||
value: 'id',
|
||||
label: 'dorm_name'
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -40,16 +40,16 @@ export default {
|
||||
return {
|
||||
//选择值
|
||||
childValue: this.value,
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//父组件值变更
|
||||
value(val) {
|
||||
this.childValue = val;
|
||||
this.childValue = val
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listDorm,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -1,32 +1,32 @@
|
||||
<!-- 自定义用户输入(编号、账号) -->
|
||||
<template>
|
||||
<input-with-helper showLabel v-bind="$attrs" v-on="$listeners" v-model="childValue" dialogTitle="选择用户" dialogWidth="600px"
|
||||
:searchCriteria="[
|
||||
{ label: '工号', prop: 'employeeId' },
|
||||
{ label: '姓名', prop: 'name' },
|
||||
{ label: '部门', prop: 'deptName' },
|
||||
]" :columns="[
|
||||
{
|
||||
title: '工号',
|
||||
field: 'employeeId',
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
},
|
||||
{ title: '姓名', field: 'name', sortable: true },
|
||||
{ title: '部门', field: 'deptName', sortable: true },
|
||||
]" :defaultSort="{
|
||||
field: 'employeeId',
|
||||
order: 'asc',
|
||||
}" :searchMethod="listTeacher" :valueProps="valueProps">
|
||||
</input-with-helper>
|
||||
<input-with-helper v-model="childValue" show-label v-bind="$attrs" dialog-title="选择用户" dialog-width="600px" :search-criteria="[
|
||||
{ label: '工号', prop: 'employeeId' },
|
||||
{ label: '姓名', prop: 'name' },
|
||||
{ label: '部门', prop: 'deptName' },
|
||||
]"
|
||||
:columns="[
|
||||
{
|
||||
title: '工号',
|
||||
field: 'employeeId',
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
},
|
||||
{ title: '姓名', field: 'name', sortable: true },
|
||||
{ title: '部门', field: 'deptName', sortable: true },
|
||||
]" :default-sort="{
|
||||
field: 'employeeId',
|
||||
order: 'asc',
|
||||
}" :search-method="listTeacher" :value-props="valueProps" v-on="$listeners"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTeacher } from "@/api/stuCQS/basedata/teacher";
|
||||
import InputWithHelper from "@/components/ValueHelper/index";
|
||||
import { listTeacher } from '@/api/stuCQS/basedata/teacher'
|
||||
import InputWithHelper from '@/components/ValueHelper/index'
|
||||
|
||||
export default {
|
||||
name: "UserSelect",
|
||||
name: 'UserSelect',
|
||||
components: {
|
||||
InputWithHelper,
|
||||
},
|
||||
@@ -36,9 +36,9 @@ export default {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
value: "employeeId",
|
||||
label: "name",
|
||||
};
|
||||
value: 'employeeId',
|
||||
label: 'name',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -46,16 +46,16 @@ export default {
|
||||
return {
|
||||
//选择值
|
||||
childValue: this.value,
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//父组件值变更
|
||||
value(val) {
|
||||
this.childValue = val;
|
||||
this.childValue = val
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listTeacher,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
@@ -1,32 +1,32 @@
|
||||
<!-- 自定义用户输入(编号、账号) -->
|
||||
<template>
|
||||
<input-with-helper v-bind="$attrs" v-on="$listeners" v-model="childValue" dialogTitle="选择用户" dialogWidth="600px"
|
||||
:searchCriteria="[
|
||||
{ label: '工号', prop: 'userName' },
|
||||
{ label: '姓名', prop: 'nickName' },
|
||||
{ label: '部门', prop: 'deptName' },
|
||||
]" :columns="[
|
||||
{
|
||||
title: '工号',
|
||||
field: 'userName',
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
},
|
||||
{ title: '姓名', field: 'nickName', sortable: true },
|
||||
{ title: '部门', field: 'deptName', sortable: true },
|
||||
]" :defaultSort="{
|
||||
field: 'userId',
|
||||
order: 'asc',
|
||||
}" :searchMethod="listUser" :valueProps="valueProps">
|
||||
</input-with-helper>
|
||||
<input-with-helper v-model="childValue" v-bind="$attrs" dialog-title="选择用户" dialog-width="600px" :search-criteria="[
|
||||
{ label: '工号', prop: 'userName' },
|
||||
{ label: '姓名', prop: 'nickName' },
|
||||
{ label: '部门', prop: 'deptName' },
|
||||
]"
|
||||
:columns="[
|
||||
{
|
||||
title: '工号',
|
||||
field: 'userName',
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
},
|
||||
{ title: '姓名', field: 'nickName', sortable: true },
|
||||
{ title: '部门', field: 'deptName', sortable: true },
|
||||
]" :default-sort="{
|
||||
field: 'userId',
|
||||
order: 'asc',
|
||||
}" :search-method="listUser" :value-props="valueProps" v-on="$listeners"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser } from "@/api/system/user";
|
||||
import InputWithHelper from "@/components/ValueHelper/index";
|
||||
import { listUser } from '@/api/system/user'
|
||||
import InputWithHelper from '@/components/ValueHelper/index'
|
||||
|
||||
export default {
|
||||
name: "UserSelect",
|
||||
name: 'UserSelect',
|
||||
components: {
|
||||
InputWithHelper,
|
||||
},
|
||||
@@ -36,9 +36,9 @@ export default {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
value: "userId",
|
||||
label: "nickName",
|
||||
};
|
||||
value: 'userId',
|
||||
label: 'nickName',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -46,16 +46,16 @@ export default {
|
||||
return {
|
||||
//选择值
|
||||
childValue: this.value,
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
//父组件值变更
|
||||
value(val) {
|
||||
this.childValue = val;
|
||||
this.childValue = val
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listUser,
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user