From e888346ebcd8e3e099a15c7edd7bf367c057193a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 04 三月 2025 15:33:33 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev'
---
src/views/CNAS/systemManagement/internalAuditManagement/components/yearPlanDia.vue | 342 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 342 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/systemManagement/internalAuditManagement/components/yearPlanDia.vue b/src/views/CNAS/systemManagement/internalAuditManagement/components/yearPlanDia.vue
new file mode 100644
index 0000000..0c1eba1
--- /dev/null
+++ b/src/views/CNAS/systemManagement/internalAuditManagement/components/yearPlanDia.vue
@@ -0,0 +1,342 @@
+<template>
+ <div>
+ <el-dialog v-loading="diaLoading" :close-on-click-modal="false" :close-on-press-escape="false"
+ :visible.sync="formDia" title="鍐呴儴瀹℃牳骞村害璁″垝" width="1000px" @close="closeYearDia">
+ <el-form ref="form" :model="form" :rules="rules" label-position="top" label-width="auto">
+ <el-row :gutter="20">
+ <el-col :span="24">
+ <el-form-item label="鍐呭鐩殑" prop="purpose">
+ <el-input v-model="form.purpose" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ :rows="3" clearable size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍐呭鑼冨洿" prop="scope">
+ <el-input v-model="form.scope" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ :rows="3" clearable size="small" type="textarea"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="24">
+ <el-form-item label="鍐呭渚濇嵁" prop="basis">
+ <el-input v-model="form.basis" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁勯暱" prop="leader">
+ <el-input v-model="form.leader" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁勫憳" prop="crew">
+ <el-input v-model="form.crew" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ <table border="1" cellspacing="10" class="table">
+ <tr>
+ <td class="div-with-line">
+ <span style="float: left;">閮ㄩ棬</span>
+ <span style="float: right;">鏈堜唤</span>
+ </td>
+ <th v-for="(item, index) in dic1" :key="index">{{ item }}</th>
+ </tr>
+ <tr v-for="(item, index) in planDetailList" :key="index">
+ <td>{{ item.department }}</td>
+ <th>
+ <el-input v-model="item.january" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.february" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.march" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.april" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.may" :disabled="operationType === 'examine' || operationType === 'ratify'" clearable
+ size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.june" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.july" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.august" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.september" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.october" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.november" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ <th>
+ <el-input v-model="item.december" :disabled="operationType === 'examine' || operationType === 'ratify'"
+ clearable size="small"></el-input>
+ </th>
+ </tr>
+ </table>
+ <span slot="footer" class="dialog-footer">
+ <el-button v-if="operationType === 'examine'" :loading="loading" @click="examine(0)">涓嶉�氳繃</el-button>
+ <el-button v-if="operationType === 'examine'" :loading="loading" type="primary" @click="examine(1)">閫�
+ 杩�</el-button>
+ <el-button v-if="operationType === 'ratify'" :loading="loading" @click="approval(0)">涓嶆壒鍑�</el-button>
+ <el-button v-if="operationType === 'ratify'" :loading="loading" type="primary" @click="handleApproval(1)">鎵�
+ 鍑�</el-button>
+ <el-button v-if="operationType !== 'ratify' && operationType !== 'examine'" @click="closeYearDia">鍙�
+ 娑�</el-button>
+ <el-button v-if="operationType !== 'ratify' && operationType !== 'examine'" :loading="loading" type="primary"
+ @click="handleEdit">鎻� 浜�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="examineDialog" title="瀹℃牳" width="30%" @close="examineDialog = false">
+ <span>
+ 瀹℃牳澶囨敞锛�
+ <el-input v-model="examineRemark" type="textarea"></el-input>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button :loading="examineLoading" @click="examineDialog = false">鍙� 娑�</el-button>
+ <el-button :loading="examineLoading" type="primary" @click="handleExamine(0)">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="approvalDialog" title="鎵瑰噯" width="30%" @close="approvalDialog = false">
+ <span>
+ 鎵瑰噯澶囨敞锛�
+ <el-input v-model="ratifyRemark" type="textarea"></el-input>
+ </span>
+ <span slot="footer" class="dialog-footer">
+ <el-button :loading="approvalLoading" @click="approvalDialog = false">鍙� 娑�</el-button>
+ <el-button :loading="approvalLoading" type="primary" @click="handleApproval(0)">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import {
+ getInternalPlanOne,
+ addInternalPlan,
+ updateInternalPlan,
+ examineInternalPlan,
+ ratifyInternalPlan,
+} from '@/api/cnas/systemManagement/internalAuditManagement.js'
+export default {
+ name: 'yearPlanDia',
+ // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+ components: {},
+ data() {
+ // 杩欓噷瀛樻斁鏁版嵁
+ return {
+ formDia: false,
+ diaLoading: false,
+ loading: false,
+ form: {
+ purpose: '',
+ scope: '',
+ basis: '',
+ leader: '',
+ crew: '',
+ },
+ rules: {
+ purpose: [{ required: true, message: '璇峰~鍐欏唴瀹$洰鐨�', trigger: 'blur' }],
+ scope: [{ required: true, message: '璇峰~鍐欏唴瀹¤寖鍥�', trigger: 'blur' }],
+ basis: [{ required: true, message: '璇峰~鍐欏唴瀹′緷鎹�', trigger: 'blur' }],
+ leader: [{ required: true, message: '璇峰~鍐欑粍闀�', trigger: 'blur' }],
+ crew: [{ required: true, message: '璇峰~鍐欑粍鍛�', trigger: 'blur' }],
+ },
+ operationType: '',
+ approvalDialog: false,
+ approvalLoading: false,
+ examineDialog: false,
+ examineLoading: false,
+ ratifyRemark: '',
+ examineRemark: '',
+ dic1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+ planDetailList: [{ department: '瑁呭鐢电紗瀹為獙瀹�' }, { department: '閫氫俊浜у搧瀹為獙瀹�' }, { department: '鐢靛姏浜у搧瀹為獙瀹�' }, { department: '鍌ㄨ兘浜у搧瀹為獙瀹�' }, { department: '灏勯绾跨紗瀹為獙瀹�' }],
+ };
+ },
+ mounted() {
+ },
+ // 鏂规硶闆嗗悎
+ methods: {
+ // 鎵撳紑寮规
+ openDia(type, row) {
+ this.formDia = true
+ this.operationType = type
+ if (type !== 'add') {
+ this.searchInfo(row)
+ }
+ },
+ // 鏌ヨ璇︽儏
+ searchInfo(row) {
+ this.diaLoading = true
+ getInternalPlanOne({ planId: row.planId }).then(res => {
+ this.diaLoading = false
+ if (res.code === 201) return
+ this.form = res.data
+ this.planDetailList = this.form.planDetailList
+ }).catch(err => {
+ console.log(err)
+ this.diaLoading = false
+ })
+ },
+ // 鎻愪氦寮规鏁版嵁
+ handleEdit() {
+ this.$refs['form'].validate((valid) => {
+ if (valid) {
+ this.loading = true
+ const internalPlan = this.HaveJson(this.form)
+ internalPlan.planDetailList = this.HaveJson(this.planDetailList)
+ if (this.operationType === 'add') {
+ addInternalPlan(internalPlan).then(res => {
+ this.loading = false
+ if (res.code === 201) return
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.closeYearDia()
+ }).catch(err => {
+ console.log('err---', err);
+ this.loading = false
+ })
+ } else if (this.operationType === 'edit') {
+ updateInternalPlan(internalPlan).then(res => {
+ this.loading = false
+ if (res.code === 201) return
+ this.$message.success('鎿嶄綔鎴愬姛')
+ this.closeYearDia()
+ }).catch(err => {
+ console.log('err---', err);
+ this.loading = false
+ })
+ }
+ } else {
+ console.log('error submit!!');
+ return false;
+ }
+ });
+ },
+ // 瀹℃牳娴佺▼
+ examine(examineStatus) {
+ if (examineStatus === 0) {
+ this.examineDialog = true
+ } else {
+ this.handleExamine(examineStatus)
+ }
+ },
+ handleExamine(examineStatus) {
+ this.examineLoading = true
+ const internalReport = this.HaveJson(this.form)
+ internalReport.examineStatus = examineStatus
+ internalReport.examineRemark = this.examineRemark
+ examineInternalPlan(internalReport).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鎻愪氦鎴愬姛锛�');
+ this.approvalDialog = false
+ this.closeYearDia(this.departId);
+ }
+ this.examineLoading = false
+ }).catch(() => {
+ this.examineLoading = false
+ })
+ },
+ // 鎻愪氦鎵瑰噯淇℃伅
+ approval(ratifyStatus) {
+ if (ratifyStatus === 0) {
+ this.approvalDialog = true
+ } else {
+ this.handleApproval(ratifyStatus)
+ }
+ },
+ handleApproval(ratifyStatus) {
+ this.approvalLoading = true
+ const internalReport = this.HaveJson(this.form)
+ internalReport.ratifyStatus = ratifyStatus
+ internalReport.ratifyRemark = this.ratifyRemark
+ ratifyInternalPlan(internalReport).then(res => {
+ if (res.code === 200) {
+ this.$message.success('鎻愪氦鎴愬姛锛�');
+ this.approvalDialog = false
+ this.closeYearDia(this.departId);
+ }
+ this.approvalLoading = false
+ }).catch(() => {
+ this.approvalLoading = false
+ })
+ },
+ closeYearDia() {
+ this.$refs.form.resetFields();
+ this.formDia = false
+ this.$emit('closeYearDia')
+ },
+ }
+};
+</script>
+
+<style scoped>
+>>>.el-dialog {
+ margin: 6vh auto 50px !important;
+}
+
+>>>.el-dialog__body {
+ max-height: 42em;
+ overflow-y: auto;
+}
+
+>>>.is-required {
+ margin-bottom: 6px;
+}
+
+.table {
+ width: 100%;
+ margin-top: 20px;
+}
+
+.table th {
+ width: 70px;
+}
+
+.table td {
+ width: 70px;
+ height: 70px;
+ text-align: center;
+}
+
+.div-with-line {
+ width: 70px;
+ height: 70px;
+ position: relative;
+ /*overflow: hidden; /* 闅愯棌婧㈠嚭鍐呭 */
+}
+
+.div-with-line::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ height: 1px;
+ background-color: #000000;
+ left: 50%;
+ transform: translateX(-50%) rotate(45deg);
+ transform-origin: center 50%;
+ top: 50%;
+ width: 100px;
+}
+</style>
--
Gitblit v1.9.3