Bläddra i källkod

中间计量申请增加预览按钮

duy 1 år sedan
förälder
incheckning
2f978cbbc0

+ 16 - 9
src/views/debit-pay/admin/components/middlepay/addModal.vue

@@ -1,5 +1,5 @@
 <template>
-    <hc-new-dialog is-table widths="95%" :show="isShow" :title="`中间计量${dataId ? '修改' : '新增'}`" @save="addModalSave" @close="addModalClose">
+    <hc-new-dialog is-table widths="95%" :show="isShow" :title="`中间计量${dataId ? '修改' : '新增'}`" :footer="!isView	" @save="addModalSave" @close="addModalClose">
         <div v-loading="isLoading" class="relative h-full flex">
             <div v-if="!dataId" :id="`hc_tree_card_${uuid}`" class="hc_tree_card_border relative">
                 <hc-body scrollbar padding="0px">
@@ -10,7 +10,7 @@
                 <hc-body scrollbar padding="0px">
                     <!-- 基础表单 -->
                     <hc-card-item>
-                        <el-form ref="baseFormRef" :model="baseForm" :rules="baseFormRules" label-position="left" label-width="auto">
+                        <el-form ref="baseFormRef" :model="baseForm" :rules="baseFormRules" label-position="left" label-width="auto" :disabled="isView">
                             <el-row :gutter="20">
                                 <el-col :span="8">
                                     <el-form-item label="计量期:" prop="contractPeriodId">
@@ -61,7 +61,7 @@
                                 </el-col>
                                 <el-col :span="16">
                                     <el-form-item label="草图文件:">
-                                        <hc-form-upload :src="baseForm.pictureList" :h-props="uploadFormProps" @upload="formUpload" @change="formUploadChange" />
+                                        <hc-form-upload :src="baseForm.pictureList" :h-props="uploadFormProps" :disabled="isView" @upload="formUpload" @change="formUploadChange" />
                                     </el-form-item>
                                 </el-col>
                                 <el-col :span="24">
@@ -79,7 +79,7 @@
                             <span class="text-orange font-400">温馨提示:超计,累计计量量> 变更后数量,分解清单超计整行红色</span>
                         </template>
                         <template #extra>
-                            <el-button type="primary" text @click="addBillBaseModalClick">
+                            <el-button type="primary" text :disabled="isView" @click="addBillBaseModalClick">
                                 <HcIcon name="add" />
                                 <span>添加清单</span>
                             </el-button>
@@ -92,10 +92,10 @@
                                 <hc-table-input v-model="row.changeTotal" disabled />
                             </template>
                             <template #currentMeterTotal="{ row }">
-                                <hc-table-input v-model="row.currentMeterTotal" @blur="currentMeterTotalBlur(row)" />
+                                <hc-table-input v-model="row.currentMeterTotal" :disabled="isView" @blur="currentMeterTotalBlur(row)" />
                             </template>
                             <template #containChangeTotal="{ row }">
-                                <hc-table-input v-model="row.containChangeTotal" @blur="containChangeTotalBlur(row)" />
+                                <hc-table-input v-model="row.containChangeTotal" :disabled="isView" @blur="containChangeTotalBlur(row)" />
                             </template>
                             <template #currentMeterMoney="{ row }">
                                 <hc-table-input v-model="row.currentMeterMoney" disabled />
@@ -104,7 +104,7 @@
                                 <hc-table-input v-model="row.allMeterTotal" disabled />
                             </template>
                             <template #action="{ index }">
-                                <el-link type="danger" @click="delAddTableClick(index)">删除</el-link>
+                                <el-link type="danger" :disabled="isView" @click="delAddTableClick(index)">删除</el-link>
                             </template>
                         </hc-table>
                     </hc-card-item>
@@ -115,7 +115,7 @@
                         </template>
                         <el-form :model="baseForm" label-position="left" label-width="auto">
                             <el-form-item label="上传附件">
-                                <hc-form-upload type="list" :src="baseForm.fileList" :h-props="uploadFormProps" @upload="attachmentUpload" @change="attachmentUploadChange" />
+                                <hc-form-upload type="list" :src="baseForm.fileList" :h-props="uploadFormProps" :disabled="isView" @upload="attachmentUpload" @change="attachmentUploadChange" />
                             </el-form-item>
                         </el-form>
                     </hc-card-item>
@@ -169,6 +169,10 @@ const props = defineProps({
         type: [String, Number],
         default: '',
     },
+    isView:{
+        type:Boolean,
+        default:false, //是否预览
+    },
 })
 
 //事件
@@ -180,6 +184,7 @@ const period_id = ref(props.periodId)
 const pid = ref(props.projectId)
 const cid = ref(props.contractId)
 const isLoading = ref(false)
+const isView = ref(props.isView)
 
 //双向绑定
 // eslint-disable-next-line no-undef
@@ -193,11 +198,13 @@ watch(() => [
     props.contractId,
     props.allPeriods,
     props.periodId,
-], ([projectId, contractId, periods, periodId]) => {
+    props.isView,
+], ([projectId, contractId, periods, periodId, view]) => {
     period.value = periods
     pid.value = projectId
     cid.value = contractId
     period_id.value = periodId
+    isView.value = view
     setBasePeriodForm(periodId)
 }, { deep: true })
 

+ 12 - 2
src/views/debit-pay/admin/middlepay.vue

@@ -35,6 +35,7 @@
                         {{ getTableStatus(row) }}
                     </template>
                     <template #action="{ row }">
+                        <el-link type="primary" @click="rowViewClick(row)">预览</el-link>
                         <el-link type="success" :disabled="approveStatus !== 0" @click="rowEditClick(row)">修改</el-link>
                         <el-link type="danger" :disabled="approveStatus !== 0" @click="rowDelClick(row)">删除</el-link>
                     </template>
@@ -45,7 +46,7 @@
             </hc-new-card>
         </div>
         <!-- 中间计量新增 -->
-        <HcAddModal v-model="addModalShow" :ids="addModalIds" :project-id="projectId" :contract-id="contractId" :all-periods="key1Data" :period-id="searchForm.contractPeriodId" @finish="addModalFinish" />
+        <HcAddModal v-model="addModalShow" :ids="addModalIds" :project-id="projectId" :contract-id="contractId" :all-periods="key1Data" :period-id="searchForm.contractPeriodId" :is-view="isView" @finish="addModalFinish" />
 
         <!-- 清单明细 -->
         <HcDetailsModal v-model="detailsModalShow" :project-id="projectId" :contract-id="contractId" :period-id="searchForm.contractPeriodId" />
@@ -255,11 +256,20 @@ const addModalClick = () => {
 const addModalIds = ref('')
 const rowEditClick = (row) => {
     addModalIds.value = row.id
+    isView.value = false
+    nextTick(() => {
+        addModalShow.value = true
+    })
+}
+//预览rowViewClick
+const isView = ref(false)
+const rowViewClick = (row) => {
+    addModalIds.value = row.id
+    isView.value = true
     nextTick(() => {
         addModalShow.value = true
     })
 }
-
 //删除
 const rowDelClick = (row) => {
     delMessage(async () => {