¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |