| | |
| | | <template> |
| | | <div> |
| | | 审核年度计划 |
| | | <div class="content-main"> |
| | | <div class="top-bar"> |
| | | <el-form ref="form" :inline="true" style="margin-top: 10px;"> |
| | | <el-form-item> |
| | | <el-date-picker |
| | | size="small" |
| | | v-model="input" |
| | | class="input-form" |
| | | type="month" |
| | | placeholder="请选择查询日期" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" @click="getData()">查询</el-button> |
| | | <el-button size="small" type="primary" plain @click="resetData()">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form class="rightBtn" style="margin-top: 10px;"> |
| | | <!-- 上传附件 --> |
| | | <el-form-item class="createBtn"> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | icon="el-icon-upload2" |
| | | @click=" |
| | | dialogFormVisible1 = true; |
| | | uploading = {}; |
| | | resetForm('uploading'); |
| | | " |
| | | >上传附件</el-button |
| | | > |
| | | <el-dialog |
| | | title="上传附件" |
| | | :visible.sync="dialogFormVisible1" |
| | | width="30%" |
| | | > |
| | | <el-form :model="uploading" :rules="rules1" ref="uploading"> |
| | | <el-form-item |
| | | label="审核日期:" |
| | | :label-width="formLabelWidth1" |
| | | prop="auditTime" |
| | | style="margin-bottom: 20px" |
| | | > |
| | | <el-date-picker |
| | | class="uploading-form" |
| | | v-model="uploading.auditTime" |
| | | type="date" |
| | | placeholder="请选择日期" |
| | | autocomplete="off" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="accessoryFile" |
| | | label="上传附件:" |
| | | :label-width="formLabelWidth1" |
| | | > |
| | | <el-input |
| | | class="uploading-form" |
| | | v-model="uploading.accessoryFile" |
| | | autocomplete="off" |
| | | placeholder="请选择文件" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible1 = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitUp('uploading')" |
| | | >确 定</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </el-form-item> |
| | | <!-- 新增计划 --> |
| | | <el-form-item class="createBtn"> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click=" |
| | | dialogFormVisible2 = true; |
| | | newly = {}; |
| | | resetForm('newly'); |
| | | " |
| | | >新增计划</el-button |
| | | > |
| | | |
| | | <el-dialog |
| | | title="新增计划" |
| | | :visible.sync="dialogFormVisible2" |
| | | width="55%" |
| | | > |
| | | <el-form :model="newly" :rules="rules2" ref="newly"> |
| | | <!-- 第一行 --> |
| | | <el-row class="newly-margin-bottom"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="计划时间:" |
| | | :label-width="formLabelWidth2" |
| | | prop="planTime" |
| | | > |
| | | <el-date-picker |
| | | class="newly-form" |
| | | v-model="newly.planTime" |
| | | type="date" |
| | | placeholder="请选择计划日期" |
| | | autocomplete="off" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="部门:" |
| | | :label-width="formLabelWidth2" |
| | | prop="department" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.department" |
| | | placeholder="请选择部门" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 第二行 --> |
| | | <el-row class="newly-margin-bottom"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="性质:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditType" |
| | | > |
| | | <el-select |
| | | class="newly-form" |
| | | v-model="newly.auditType" |
| | | placeholder="请选择性质" |
| | | autocomplete="off" |
| | | > |
| | | <el-option label="内审" value="0"></el-option> |
| | | <el-option label="管理评审" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="审核目的:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditPurpose" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.auditPurpose" |
| | | placeholder="请输入审核目的" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 第三行 --> |
| | | <el-row class="newly-margin-bottom"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="审核组长:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditLeader" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.auditLeader" |
| | | placeholder="请输入审核组长" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="审核范围:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditScope" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.auditScope" |
| | | placeholder="请输入审核范围" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 第四行 --> |
| | | <el-row class="newly-margin-bottom"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="组员:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditEmp" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.auditEmp" |
| | | placeholder="请输入组员" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="审核依据:" |
| | | :label-width="formLabelWidth2" |
| | | prop="auditPursuant" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.auditPursuant" |
| | | placeholder="请输入审核依据" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- 第五行 --> |
| | | <el-row class="newly-margin-bottom"> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="编制人:" |
| | | :label-width="formLabelWidth2" |
| | | prop="writeUser" |
| | | > |
| | | <el-input |
| | | class="newly-form" |
| | | v-model="newly.writeUser" |
| | | placeholder="请输入编制人" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="审核日期:" |
| | | :label-width="formLabelWidth2" |
| | | > |
| | | <el-date-picker |
| | | class="newly-form" |
| | | v-model="newly.auditTime" |
| | | type="date" |
| | | placeholder="请选择审核日期" |
| | | autocomplete="off" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible2 = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitAddData('newly')" |
| | | >确 定</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </el-form-item> |
| | | <!-- 导出年度计划 --> |
| | | <el-form-item class="createBtn"> |
| | | <el-button size="small" type="primary" icon="el-icon-document-checked" |
| | | >导出年度计划</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item class="createBtn"> |
| | | <el-button size="small" type="primary" icon="el-icon-document-checked" |
| | | >导出内部实施计划</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="library-table"> |
| | | <div class="table-box"> |
| | | <el-table |
| | | ref="auditTable" |
| | | border |
| | | :max-height="800" |
| | | :cell-style="{ textAlign: 'left' }" |
| | | :header-cell-style="{ |
| | | border: '0px', |
| | | background: '#f5f7fa', |
| | | color: '#606266', |
| | | boxShadow: 'inset 0 1px 0 #ebeef5', |
| | | textAlign: 'left', |
| | | }" |
| | | :data="auditTable" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="index" label="序号" min-width="30px"> |
| | | <template> |
| | | <el-checkbox type="checkbox" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="year" label="年度" min-width="60px" /> |
| | | <el-table-column prop="month" label="月度" min-width="60px" /> |
| | | <el-table-column prop="planTime" label="计划时间" min-width="100px" /> |
| | | <el-table-column prop="auditType" label="性质" min-width="80px"> |
| | | <template slot-scope="scope"> |
| | | <span> |
| | | {{ scope.row.auditType == 0 ? "内审" : "管理评审" }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="department" label="部门" min-width="80px" /> |
| | | <el-table-column |
| | | prop="auditLeader" |
| | | label="审核组长" |
| | | min-width="80px" |
| | | /> |
| | | <el-table-column prop="auditEmp" label="组员" min-width="80px" /> |
| | | <el-table-column |
| | | prop="auditPurpose" |
| | | label="审核目的" |
| | | min-width="100px" |
| | | /> |
| | | <el-table-column |
| | | prop="auditScope" |
| | | label="审核范围" |
| | | min-width="100px" |
| | | /> |
| | | <el-table-column |
| | | prop="auditPursuant" |
| | | label="审核依据" |
| | | min-width="100px" |
| | | /> |
| | | <el-table-column prop="writeUser" label="编制人" min-width="80px" /> |
| | | <el-table-column prop="createTime" label="编制日期" min-width="100px"> |
| | | </el-table-column> |
| | | <el-table-column prop="keyboarder" label="录入人" min-width="80px" /> |
| | | <el-table-column prop="checker" label="检验人" min-width="80px" /> |
| | | <el-table-column |
| | | prop="auditTime" |
| | | label="审核日期" |
| | | min-width="100px" |
| | | /> |
| | | <el-table-column prop="count" label="不符合项目数" min-width="60px" /> |
| | | <el-table-column prop="auditState" label="状态" min-width="100px"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.auditState === 0"> |
| | | <el-tag class="tag-item" type="warning">即将开始</el-tag> |
| | | </div> |
| | | <div v-else-if="scope.row.auditState === 1"> |
| | | <el-tag class="tag-item" type="success">完成</el-tag> |
| | | </div> |
| | | <div v-else> |
| | | <el-tag class="tag-item" type="danger">逾期</el-tag> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" min-width="100" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" size="small">查看</el-button> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteClick(scope.row.id)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页器 --> |
| | | <div> |
| | | <el-pagination |
| | | :current-page="page" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | selectAllList, |
| | | addCnasAnnualPlan, |
| | | addAccessory, |
| | | deleteCnasAnnualPlan, |
| | | } from "@/api/CNAS/reviewAnnualPlan"; |
| | | import { P } from "af-table-column"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | input: "", |
| | | auditTable: [], |
| | | page: 1, |
| | | total: 0, |
| | | pageSize: 10, |
| | | dialogFormVisible1: false, |
| | | dialogFormVisible2: false, |
| | | formLabelWidth1: "80px", |
| | | formLabelWidth2: "80px", |
| | | //上传附件参数 |
| | | uploading: { |
| | | auditTime: "", |
| | | //====================文件上传还没做,此处是应是文件参数,暂时还是文本 |
| | | accessoryFile: "", |
| | | }, |
| | | rules1: { |
| | | auditTime: [ |
| | | { |
| | | type: "date", |
| | | required: true, |
| | | message: "请选择日期", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | accessoryFile: [ |
| | | { required: true, message: "请输入活动名称", trigger: "blur" }, |
| | | { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | //新增计划对象 |
| | | newly: { |
| | | planTime: "", |
| | | auditType: "", |
| | | department: "", |
| | | auditPurpose: "", |
| | | auditLeader: "", |
| | | auditEmp: "", |
| | | auditPursuant: "", |
| | | auditScope: "", |
| | | writeUser: "", |
| | | auditTime: "", |
| | | }, |
| | | rules2: { |
| | | planTime: [ |
| | | { |
| | | type: "date", |
| | | required: true, |
| | | message: "请选择日期", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | auditType: [ |
| | | { required: true, message: "请选择性质", trigger: "change" }, |
| | | ], |
| | | department: [ |
| | | { required: true, message: "请输入部门", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | auditPurpose: [ |
| | | { required: true, message: "请输入审核目的", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | auditLeader: [ |
| | | { required: true, message: "请输入审核组长", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | auditEmp: [ |
| | | { required: true, message: "请输入组员", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | auditPursuant: [ |
| | | { required: true, message: "请输入审核依据", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | auditScope: [ |
| | | { required: true, message: "请输入审核范围", trigger: "blur" }, |
| | | { min: 1, max: 5, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | writeUser: [ |
| | | { required: true, message: "请输入编制人", trigger: "blur" }, |
| | | { min: 1, max: 25, message: "字数过长", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | //====================================================上传附件 |
| | | //上传附件字段确认 |
| | | submitUp(uploading) { |
| | | this.$refs[uploading].validate((valid) => { |
| | | if (!valid) { |
| | | return false; |
| | | } else { |
| | | // this.upData(); |
| | | } |
| | | }); |
| | | }, |
| | | // //上传附件 |
| | | // async upData() { |
| | | // try { |
| | | // const res = await addAccessory(this.uploading); |
| | | // console.log(res); |
| | | // } catch (error) { |
| | | // this.$message.error("添加失败"); |
| | | // } |
| | | // this.resetData(); |
| | | // this.dialogFormVisible1 = false; |
| | | // }, |
| | | |
| | | //新增计划字段确认 |
| | | submitAddData(newly) { |
| | | this.$refs[newly].validate((valid) => { |
| | | if (!valid) { |
| | | return false; |
| | | } else { |
| | | this.addData(); |
| | | } |
| | | }); |
| | | }, |
| | | //新增计划 |
| | | async addData() { |
| | | try { |
| | | const res = await deleteCnasAnnualPlan(this.newly); |
| | | } catch (error) { |
| | | this.$message.error("添加失败"); |
| | | } |
| | | this.getData(); |
| | | this.dialogFormVisible2 = false; |
| | | }, |
| | | // 每页条数改变时触发 选择一页显示多少行 |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | this.pageSize = val; |
| | | this.getData(); |
| | | }, |
| | | // 当前页改变时触发 跳转其他页 |
| | | handleCurrentChange(val) { |
| | | console.log(`当前页: ${val}`); |
| | | this.page = val; |
| | | this.getData(); |
| | | }, |
| | | // 重置按钮 |
| | | resetData() { |
| | | this.input = undefined; |
| | | this.page = 1; |
| | | this.pageSize = 10; |
| | | this.getData(); |
| | | }, |
| | | // 查询列表 |
| | | async getData() { |
| | | const params = { |
| | | page: this.page, |
| | | pageSize: this.pageSize, |
| | | planTime: this.input ? this.input : undefined, |
| | | }; |
| | | const { data } = await selectAllList(params); |
| | | this.auditTable = data.row; |
| | | this.total = data.total; |
| | | }, |
| | | async deleteOneData(planId) { |
| | | await deleteCnasAnnualPlan({ planId: planId }); |
| | | this.getData(); |
| | | console.log(planId); |
| | | }, |
| | | |
| | | deleteClick(planId) { |
| | | this.$confirm("确认删除?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | }).then(() => { |
| | | this.deleteOneData(planId); |
| | | }); |
| | | }, |
| | | //重置表单 |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .top-bar { |
| | | margin: -25px -15px; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding: 5px 24px 0px 24px; |
| | | .input-form { |
| | | width: 400px; |
| | | } |
| | | .uploading-form { |
| | | // margin-bottom: 20px; |
| | | width: 400px; |
| | | } |
| | | .newly-form { |
| | | // margin-bottom: 20px; |
| | | width: 400px; |
| | | } |
| | | .newly-margin-bottom { |
| | | margin-bottom: 23px; |
| | | } |
| | | } |
| | | |
| | | .library-table { |
| | | background-color: #fff; |
| | | flex: 1; |
| | | margin: 0px -15px; |
| | | margin-top: 40px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .table-box { |
| | | padding: 0px 20px; |
| | | margin-top: 20px; |
| | | flex: 1; |
| | | background: #fff; |
| | | display: flex; |
| | | flex-direction: column; |
| | | > div:nth-child(2) { |
| | | display: flex; |
| | | justify-content: end; |
| | | margin: 10px 0; |
| | | } |
| | | .tag-item { |
| | | width: 80px; |
| | | } |
| | | } |
| | | } |
| | | .rightBtn { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | .createBtn { |
| | | margin-left: 10px; |
| | | } |
| | | </style> |