From 604623b4920a997df7d2007ff50686961d181012 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期六, 18 十一月 2023 16:47:40 +0800 Subject: [PATCH] 问题项修改 --- src/views/eam/modules/dailyInspectionStandard/AuditApprovalModal.vue | 260 ++++++++++++++++++++++++++++ src/views/eam/modules/dailyMaintenanceStandard/AuditApprovalModal.vue | 254 ++++++++++++++++++++++++++++ 2 files changed, 514 insertions(+), 0 deletions(-) diff --git a/src/views/eam/modules/dailyInspectionStandard/AuditApprovalModal.vue b/src/views/eam/modules/dailyInspectionStandard/AuditApprovalModal.vue new file mode 100644 index 0000000..8f89e78 --- /dev/null +++ b/src/views/eam/modules/dailyInspectionStandard/AuditApprovalModal.vue @@ -0,0 +1,260 @@ +<template> + <a-modal + :title='title' + :width="650" + :visible='visible' + :maskClosable='false' + cancelText='鍏抽棴' + @cancel='handleCancel' + :confirmLoading='confirmLoading' + > + <!-- @ok='handleOk' --> + <a-spin :spinning='confirmLoading'> + <a-form :form="form"> + <a-row> + <a-col :span='24'> + <a-form-item + label='鏍囧噯缂栫爜' + :labelCol='labelCol' + :wrapperCol='wrapperCol' + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ョ偣妫�鏍囧噯缂栫爜'" + v-decorator="['num', validatorRules.num ]" + /> + </a-form-item> + </a-col> + <a-col + v-if="this.model.approvalStatus == '1' ||this.model.approvalStatus == '2'||this.model.approvalStatus == '4'" + :span='24' + > + + <a-form-item + label="瀹℃牳鎰忚" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-textarea + rows='3' + placeholder='璇疯緭鍏ュ鏍告剰瑙�' + v-decorator="['auditFeedback', validatorRules.auditFeedback ]" + ></a-textarea> + </a-form-item> + </a-col> + <a-col + v-if="this.model.approvalStatus == '3' " + :span='24' + > + <a-form-item + label="瀹℃壒鎰忚" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-textarea + rows='3' + placeholder='璇疯緭鍏ュ鎵规剰瑙�' + v-decorator="['approvalFeedback', validatorRules.approvalFeedback ]" + ></a-textarea> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <template slot='footer'> + <a-popconfirm + @confirm="() => handleReject()" + title="纭灏嗗綋鍓嶇偣妫�鏍囧噯椹冲洖锛�" + > + <a-button + :loading='confirmLoading' + :style="{marginRight: '8px'}" + > + 椹冲洖 + </a-button> + </a-popconfirm> + <a-popconfirm + @confirm="() => handleOk()" + title="纭灏嗗綋鍓嶇偣妫�鏍囧噯瀹℃牳閫氳繃锛�" + > + <a-button + type='primary' + :loading='confirmLoading' + :style="{marginRight: '8px'}" + > + 閫氳繃 + </a-button> + </a-popconfirm> + <!-- <a-button + @click='handleOk' + type='primary' + :loading='confirmLoading' + >閫氳繃 + </a-button> --> + </template> + </a-modal> + +</template> + +<script> +import { httpAction, requestPut, postAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import pick from 'lodash.pick' + + +export default { + name: 'ApprovelModal', + components: { + Tooltip + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + disableSubmit: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + auditFeedback: { + rules: [ + { required: true, message: '璇疯緭鍏ュ鏍告剰瑙�!' }, + ] + }, + approvalFeedback: { + rules: [ + { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }, + ] + }, + }, + url: { + auditApproval: "/eam/inspectionStandard/auditApproval", + }, + } + }, + + + methods: { + close() { + this.$emit('close') + this.visible = false + }, + + handleCancel() { + this.close() + }, + showModals(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.visible = true; + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'num', 'auditFeedback', 'approvalFeedback')); + }, 200); + }, + + + + handleReject() { + const that = this; + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + if (this.model.approvalStatus == '1') { + formData.approvalStatus = '2' + } else if (this.model.approvalStatus == '3') { + formData.approvalStatus = '4' + } else if (this.model.approvalStatus == '4') { + formData.approvalStatus = '2' + } + requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + + + handleOk() { + const that = this; + that.form.validateFields((err, values) => { + if (!err) { + this.confirmLoading = true; + let formData = Object.assign(this.model, values); + if (this.model.approvalStatus == '1') { + formData.approvalStatus = '3' + } else if (this.model.approvalStatus == '2') { + formData.approvalStatus = '3' + } else if (this.model.approvalStatus == '3') { + formData.approvalStatus = '5' + } else if (this.model.approvalStatus == '4') { + formData.approvalStatus = '3' + } + requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + } + +} +</script> + +<style lang='less' scoped> +/deep/ .frozenRowClass { + color: #c9c9c9; +} + +.fontweight { + font-weight: bold; +} + +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} + +/deep/ .ant-modal-title { + text-align: center; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/dailyMaintenanceStandard/AuditApprovalModal.vue b/src/views/eam/modules/dailyMaintenanceStandard/AuditApprovalModal.vue new file mode 100644 index 0000000..e629313 --- /dev/null +++ b/src/views/eam/modules/dailyMaintenanceStandard/AuditApprovalModal.vue @@ -0,0 +1,254 @@ +<template> + <a-modal + :title='title' + :width="650" + :visible='visible' + :maskClosable='false' + cancelText='鍏抽棴' + @cancel='handleCancel' + :confirmLoading='confirmLoading' + > + <!-- @ok='handleOk' --> + <a-spin :spinning='confirmLoading'> + <a-form :form="form"> + <a-row> + <a-col :span='24'> + <a-form-item + label='鏍囧噯缂栫爜' + :labelCol='labelCol' + :wrapperCol='wrapperCol' + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヤ繚鍏绘爣鍑嗙紪鐮�'" + v-decorator="['num', validatorRules.num ]" + /> + </a-form-item> + </a-col> + <a-col + v-if="this.model.approvalStatus == '1' ||this.model.approvalStatus == '2'||this.model.approvalStatus == '4'" + :span='24' + > + + <a-form-item + label="瀹℃牳鎰忚" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-textarea + rows='3' + placeholder='璇疯緭鍏ュ鏍告剰瑙�' + v-decorator="['auditFeedback', validatorRules.auditFeedback ]" + ></a-textarea> + </a-form-item> + </a-col> + <a-col + v-if="this.model.approvalStatus == '3' " + :span='24' + > + <a-form-item + label="瀹℃壒鎰忚" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-textarea + rows='3' + placeholder='璇疯緭鍏ュ鎵规剰瑙�' + v-decorator="['approvalFeedback', validatorRules.approvalFeedback ]" + ></a-textarea> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <template slot='footer'> + <a-popconfirm + @confirm="() => handleReject()" + title="纭灏嗗綋鍓嶄繚鍏绘爣鍑嗛┏鍥烇紵" + > + <a-button + :loading='confirmLoading' + :style="{marginRight: '8px'}" + > + 椹冲洖 + </a-button> + </a-popconfirm> + <a-popconfirm + @confirm="() => handleOk()" + title="纭灏嗗綋鍓嶄繚鍏绘爣鍑嗗鏍搁�氳繃锛�" + > + <a-button + type='primary' + :loading='confirmLoading' + :style="{marginRight: '8px'}" + > + 閫氳繃 + </a-button> + </a-popconfirm> + </template> + </a-modal> + +</template> + +<script> +import { httpAction, requestPut, postAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import pick from 'lodash.pick' + + +export default { + name: 'ApprovelModal', + components: { + Tooltip + }, + data() { + return { + title: '鎿嶄綔', + visible: false, + disableSubmit: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + auditFeedback: { + rules: [ + { required: true, message: '璇疯緭鍏ュ鏍告剰瑙�!' }, + ] + }, + approvalFeedback: { + rules: [ + { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }, + ] + }, + }, + url: { + auditApproval: "/eam/maintenanceStandard/auditApproval", + }, + } + }, + + + methods: { + close() { + this.$emit('close') + this.visible = false + }, + + handleCancel() { + this.close() + }, + showModals(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.visible = true; + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'num', 'auditFeedback', 'approvalFeedback')); + }, 200); + }, + + + + handleReject() { + const that = this; + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + if (this.model.approvalStatus == '1') { + formData.approvalStatus = '2' + } else if (this.model.approvalStatus == '3') { + formData.approvalStatus = '4' + } else if (this.model.approvalStatus == '4') { + formData.approvalStatus = '2' + } + requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + + + handleOk() { + const that = this; + that.form.validateFields((err, values) => { + if (!err) { + this.confirmLoading = true; + let formData = Object.assign(this.model, values); + if (this.model.approvalStatus == '1') { + formData.approvalStatus = '3' + } else if (this.model.approvalStatus == '2') { + formData.approvalStatus = '3' + } else if (this.model.approvalStatus == '3') { + formData.approvalStatus = '5' + } else if (this.model.approvalStatus == '4') { + formData.approvalStatus = '3' + } + requestPut(this.url.auditApproval, formData, { id: this.model.id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + } + +} +</script> + +<style lang='less' scoped> +/deep/ .frozenRowClass { + color: #c9c9c9; +} + +.fontweight { + font-weight: bold; +} + +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} + +/deep/ .ant-modal-title { + text-align: center; +} +</style> \ No newline at end of file -- Gitblit v1.9.3