|
|
@@ -445,7 +445,7 @@
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
- @click="openForm('update', scope.row.id, scope.row)"
|
|
|
+ @click="handleOpenForm(scope.row.id, 'edit')"
|
|
|
v-hasPermi="['pms:iot-ry-daily-report:update']"
|
|
|
>
|
|
|
编辑
|
|
|
@@ -472,15 +472,15 @@
|
|
|
</ContentWrap>
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
- <IotRyDailyReportForm ref="formRef" @success="getList" :row-data="selectedRowData" />
|
|
|
+ <ry-form v-model:visible="visible" type="edit" ref="formRef" :load-list="getList" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import ryForm from './ry-form.vue'
|
|
|
import { dateFormatter, dateFormatter2, rangeShortcuts } from '@/utils/formatTime'
|
|
|
import { IotRyDailyReportApi, IotRyDailyReportVO } from '@/api/pms/iotrydailyreport'
|
|
|
-import IotRyDailyReportForm from './IotRyDailyReportForm.vue'
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
import { ref, reactive, onMounted, nextTick, watch, onUnmounted } from 'vue'
|
|
|
|
|
|
@@ -930,27 +930,37 @@ const resetQuery = () => {
|
|
|
handleQuery()
|
|
|
}
|
|
|
|
|
|
-/** 添加/修改操作 */
|
|
|
+const visible = ref(false)
|
|
|
+
|
|
|
const formRef = ref()
|
|
|
-const openForm = (type: string, id?: number, row?: any) => {
|
|
|
- // 保存当前行数据
|
|
|
- if (row) {
|
|
|
- selectedRowData.value = {
|
|
|
- deptName: row.deptName,
|
|
|
- contractName: row.contractName,
|
|
|
- taskName: row.taskName,
|
|
|
- designWellDepth: row.designWellDepth,
|
|
|
- designWellStruct: row.designWellStruct,
|
|
|
- totalConstructionWells: row.totalConstructionWells,
|
|
|
- completedWells: row.completedWells
|
|
|
- }
|
|
|
- } else {
|
|
|
- selectedRowData.value = null
|
|
|
- }
|
|
|
|
|
|
- formRef.value.open(type, id)
|
|
|
+function handleOpenForm(id: number, type: 'edit' | 'readonly') {
|
|
|
+ if (formRef.value) {
|
|
|
+ formRef.value.handleOpenForm(id, type)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+/** 添加/修改操作 */
|
|
|
+// const formRef = ref()
|
|
|
+// const openForm = (type: string, id?: number, row?: any) => {
|
|
|
+// // 保存当前行数据
|
|
|
+// if (row) {
|
|
|
+// selectedRowData.value = {
|
|
|
+// deptName: row.deptName,
|
|
|
+// contractName: row.contractName,
|
|
|
+// taskName: row.taskName,
|
|
|
+// designWellDepth: row.designWellDepth,
|
|
|
+// designWellStruct: row.designWellStruct,
|
|
|
+// totalConstructionWells: row.totalConstructionWells,
|
|
|
+// completedWells: row.completedWells
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// selectedRowData.value = null
|
|
|
+// }
|
|
|
+
|
|
|
+// formRef.value.open(type, id)
|
|
|
+// }
|
|
|
+
|
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async (id: number) => {
|
|
|
try {
|