From a22a69946912221dab4d32987dda6c4c8ba3c5d8 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期二, 24 六月 2025 17:43:24 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue | 137 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 137 insertions(+), 0 deletions(-) diff --git a/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue b/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue new file mode 100644 index 0000000..96bef70 --- /dev/null +++ b/src/views/eam/repair/modules/EamMajorPartialRepairDetailModal.vue @@ -0,0 +1,137 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <j-vxe-table + ref="editableDetailTable" + :rowNumber="true" + :rowSelection="false" + :bordered="false" + :alwaysEdit="true" + :toolbar="false" + keep-source + :height="300" + :loading="detail.loading" + :dataSource="detail.dataSource" + :columns="equipmentColumns" + style="margin-top: 8px;" /> + + </j-modal> + +</template> + +<script> + +import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' +import { JVXETypes } from '@/components/jeecg/JVxeTable' +import { getAction, postAction } from '../../../../api/manage' + +export default { + name: 'EamMajorPartialRepairDetailModal', + mixins: [JVxeTableModelMixin], + data() { + return { + title: '', + width: 1200, + visible: false, + disableSubmit: false, + equipmentOptions: [], + detail: { + loading: false, + dataSource: [] + }, + url: { + queryDetailList: '/eam/eamMajorPartialRepairDetail/list', + fillResult: '/eam/eamMajorPartialRepair/fillResult' + } + } + }, + computed: { + equipmentColumns() { + return [ + { + title: '璁惧', + key: 'equipmentId_dictText', + type: JVXETypes.normal, + width: '25%', + align: 'center' + }, + { + title: '鍗曚环', + key: 'unitPrice', + type: JVXETypes.normal, + width: '10%', + align: 'center' + }, + { + title: '缁翠慨缁撴灉', + key: 'repairResult', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [{ required: true, message: '缁翠慨缁撴灉涓嶈兘涓虹┖锛�' }] + }, + { + title: '缁翠慨鎻忚堪', + key: 'repairDescription', + type: JVXETypes.textarea, + width: '30%', + align: 'center', + validateRules: [{ required: true, message: '缁翠慨鎻忚堪涓嶈兘涓虹┖锛�' }] + } + ]; + } + }, + methods: { + open(record) { + this.visible = true + getAction(this.url.queryDetailList, { repairId: record.id }).then((res) => { + if (res.success) { + if (res.result.total) { + this.detail.dataSource = res.result.records + } + } + }) + }, + close() { + this.$emit('close') + this.visible = false + }, + async handleOk() { + // 馃憞 瑙﹀彂琛ㄦ牸鏍¢獙 + const errMap = await this.$refs.editableDetailTable.validateTable(); + + if (errMap) { + return; + } + + // 鏍¢獙閫氳繃锛岃幏鍙栬〃鏍兼暟鎹� + const tableData = this.$refs.editableDetailTable.getTableData(); + + postAction(this.url.fillResult, tableData).then((res) => { + if (res.success) { + this.$message.success(res.message) + // 馃憞 鎻愪氦鎴愬姛鍚庡叧闂脊绐� + this.submitCallback(); + } else { + this.$message.warning(res.message) + } + }) + }, + submitCallback() { + this.$emit('ok') + this.visible = false + }, + handleCancel() { + this.close() + } + } +} +</script> \ No newline at end of file -- Gitblit v1.9.3