|
@@ -68,13 +68,16 @@
|
|
|
<text class="cell-title">管道类别</text>
|
|
<text class="cell-title">管道类别</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
<view class="table-cell content">
|
|
|
- <input
|
|
|
|
|
- v-if="isEdit"
|
|
|
|
|
- v-model="equipment.pipeCategory"
|
|
|
|
|
- class="edit-input-text"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- />
|
|
|
|
|
- <text v-else class="cell-text">{{ equipment.pipeCategory }}</text>
|
|
|
|
|
|
|
+ <picker
|
|
|
|
|
+ :range="pipeCategoryOptions"
|
|
|
|
|
+ range-key="label"
|
|
|
|
|
+ mode="selector"
|
|
|
|
|
+ :value="selectedPipeCategoryIndex"
|
|
|
|
|
+ :disabled="!isEdit"
|
|
|
|
|
+ @change="handlePipeCategoryChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <text class="cell-text">{{ pipeCategoryOptions[selectedPipeCategoryIndex]?.label }}</text>
|
|
|
|
|
+ </picker>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -116,13 +119,18 @@
|
|
|
<text class="cell-title">所在行政区</text>
|
|
<text class="cell-title">所在行政区</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
<view class="table-cell content">
|
|
|
- <input
|
|
|
|
|
- v-if="isEdit"
|
|
|
|
|
- v-model="equipment.equipDistrictName"
|
|
|
|
|
- class="edit-input-text"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
|
|
+ <view v-if="isEdit" class="edit-input" @click="showCascader = true">
|
|
|
|
|
+ <text>{{ districtFullName || '请选择' }}</text>
|
|
|
|
|
+ <image class="arrow-icon" src="/static/images/arrow-right.png" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text v-else class="cell-text">{{ getDistrictFullName(equipment.equipDistrict) }}</text>
|
|
|
|
|
+ <AreaCascader
|
|
|
|
|
+ v-show="isEdit"
|
|
|
|
|
+ v-model="selectedDistrict"
|
|
|
|
|
+ v-model:visible="showCascader"
|
|
|
|
|
+ title="请选择行政区"
|
|
|
|
|
+ @confirm="handleAreaConfirm"
|
|
|
/>
|
|
/>
|
|
|
- <text v-else class="cell-text">{{ equipment.equipDistrictName }}</text>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -132,13 +140,14 @@
|
|
|
<text class="cell-title">所在街道</text>
|
|
<text class="cell-title">所在街道</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
<view class="table-cell content">
|
|
|
- <input
|
|
|
|
|
|
|
+ <StreetSelect
|
|
|
v-if="isEdit"
|
|
v-if="isEdit"
|
|
|
- v-model="equipment.equipStreetName"
|
|
|
|
|
- class="edit-input-text"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
|
|
+ v-model="equipment.equipStreet"
|
|
|
|
|
+ :districtId="equipment.equipDistrict"
|
|
|
|
|
+ placeholder="请选择街道"
|
|
|
|
|
+ style="width: 100%"
|
|
|
/>
|
|
/>
|
|
|
- <text v-else class="cell-text">{{ equipment.equipStreetName }}</text>
|
|
|
|
|
|
|
+ <text v-else class="cell-text">{{ streetNameDisplay }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -196,13 +205,16 @@
|
|
|
<text class="cell-title">使用状态</text>
|
|
<text class="cell-title">使用状态</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="table-cell content">
|
|
<view class="table-cell content">
|
|
|
- <input
|
|
|
|
|
- v-if="isEdit"
|
|
|
|
|
- v-model="equipment.useStatus"
|
|
|
|
|
- class="edit-input-text"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- />
|
|
|
|
|
- <text v-else class="cell-text">{{ equipment.useStatus }}</text>
|
|
|
|
|
|
|
+ <picker
|
|
|
|
|
+ :range="useStatusOptions"
|
|
|
|
|
+ range-key="label"
|
|
|
|
|
+ mode="selector"
|
|
|
|
|
+ :value="selectedUseStatusIndex"
|
|
|
|
|
+ :disabled="!isEdit"
|
|
|
|
|
+ @change="handleUseStatusChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <text class="cell-text">{{ useStatusOptions[selectedUseStatusIndex]?.label }}</text>
|
|
|
|
|
+ </picker>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -1324,8 +1336,29 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref, reactive, computed, onMounted, watchEffect } from 'vue'
|
|
|
|
|
|
|
+import { ref, reactive, computed, onMounted, watch } from 'vue'
|
|
|
import { updateEquipPipe } from '@/api/pipe/pipeEquip'
|
|
import { updateEquipPipe } from '@/api/pipe/pipeEquip'
|
|
|
|
|
+import { getDictOptions, DICT_TYPE } from '@/utils/dictMap'
|
|
|
|
|
+import AreaCascader from '@/components/AreaCascader/AreaCascader.vue'
|
|
|
|
|
+import StreetSelect from '@/components/StreetSelect/StreetSelect.vue'
|
|
|
|
|
+import { useAreaStore } from '@/store/area'
|
|
|
|
|
+
|
|
|
|
|
+const areaStore = useAreaStore()
|
|
|
|
|
+const getDistrictFullName = areaStore.getDistrictFullName
|
|
|
|
|
+
|
|
|
|
|
+const pipeCategoryOptions = getDictOptions(DICT_TYPE.PIPE_TYPE)
|
|
|
|
|
+const useStatusOptions = getDictOptions(DICT_TYPE.SYSTEM_EQUIP_BOILER_STATUS)
|
|
|
|
|
+
|
|
|
|
|
+const selectedPipeCategoryIndex = ref(0)
|
|
|
|
|
+const selectedUseStatusIndex = ref(0)
|
|
|
|
|
+
|
|
|
|
|
+const districtFullName = computed(() => {
|
|
|
|
|
+ return getDistrictFullName(Number(selectedDistrict.value))
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const streetNameDisplay = computed(() => {
|
|
|
|
|
+ return areaStore.getStreetName(Number(equipment.equipStreet), Number(equipment.equipDistrict))
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
dataSource?: any
|
|
dataSource?: any
|
|
@@ -1401,13 +1434,20 @@ const equipment = reactive<any>({
|
|
|
categories: '',
|
|
categories: '',
|
|
|
})
|
|
})
|
|
|
const pipeList = ref<any[]>([])
|
|
const pipeList = ref<any[]>([])
|
|
|
-watchEffect(() => {
|
|
|
|
|
- if (props.equipmentData) {
|
|
|
|
|
- Object.assign(equipment, props.equipmentData)
|
|
|
|
|
- }
|
|
|
|
|
- pipeList.value = !props.equipmentData?.detailSaveReqVOS
|
|
|
|
|
- ? []
|
|
|
|
|
- : props.equipmentData.detailSaveReqVOS.map((item: any) => ({
|
|
|
|
|
|
|
+const selectedDistrict = ref<string | number | (string | number)[]>('')
|
|
|
|
|
+const showCascader = ref(false)
|
|
|
|
|
+
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => props.equipmentData,
|
|
|
|
|
+ (newVal) => {
|
|
|
|
|
+ if (newVal) {
|
|
|
|
|
+ Object.assign(equipment, newVal)
|
|
|
|
|
+ selectedPipeCategoryIndex.value = pipeCategoryOptions.findIndex((item: any) => item.value == equipment.pipeCategory)
|
|
|
|
|
+ selectedUseStatusIndex.value = useStatusOptions.findIndex((item: any) => item.value == equipment.useStatus)
|
|
|
|
|
+ }
|
|
|
|
|
+ pipeList.value = !newVal?.detailSaveReqVOS
|
|
|
|
|
+ ? []
|
|
|
|
|
+ : newVal.detailSaveReqVOS.map((item: any) => ({
|
|
|
pipeId: item.id || '',
|
|
pipeId: item.id || '',
|
|
|
pipeName: item.pipeName || '',
|
|
pipeName: item.pipeName || '',
|
|
|
pipeNo: item.pipeNo || '',
|
|
pipeNo: item.pipeNo || '',
|
|
@@ -1457,7 +1497,23 @@ watchEffect(() => {
|
|
|
lastYearCheckConclusion: item.lastYearCheckConclusion || '',
|
|
lastYearCheckConclusion: item.lastYearCheckConclusion || '',
|
|
|
lastYearCheckProblem: item.lastYearCheckProblem || '',
|
|
lastYearCheckProblem: item.lastYearCheckProblem || '',
|
|
|
}))
|
|
}))
|
|
|
-})
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ { immediate: true, deep: true }
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
|
|
+function handleAreaConfirm(data: {
|
|
|
|
|
+ value: string | number | (string | number)[]
|
|
|
|
|
+ selectedOptions: any[]
|
|
|
|
|
+}) {
|
|
|
|
|
+ selectedDistrict.value = data.value
|
|
|
|
|
+ if (data.selectedOptions.length > 0) {
|
|
|
|
|
+ const lastOption = data.selectedOptions[data.selectedOptions.length - 1]
|
|
|
|
|
+ if (equipment.equipDistrict !== lastOption.id) {
|
|
|
|
|
+ equipment.equipDistrict = lastOption.id
|
|
|
|
|
+ equipment.equipStreet = null
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const expandedNames = ref<string>('1')
|
|
const expandedNames = ref<string>('1')
|
|
|
const handleCollapseChange = (detail: any) => {
|
|
const handleCollapseChange = (detail: any) => {
|
|
@@ -1465,6 +1521,11 @@ const handleCollapseChange = (detail: any) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
|
|
|
+watch(isEdit, (editing) => {
|
|
|
|
|
+ if (editing) {
|
|
|
|
|
+ selectedDistrict.value = equipment.equipDistrict || ''
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
const originalData = ref<any>(null)
|
|
const originalData = ref<any>(null)
|
|
|
const handleEdit = () => {
|
|
const handleEdit = () => {
|
|
|
if (isEdit.value) {
|
|
if (isEdit.value) {
|
|
@@ -1478,6 +1539,8 @@ const handleEdit = () => {
|
|
|
const handleCancel = () => {
|
|
const handleCancel = () => {
|
|
|
if (originalData.value) {
|
|
if (originalData.value) {
|
|
|
Object.assign(equipment, originalData.value)
|
|
Object.assign(equipment, originalData.value)
|
|
|
|
|
+ selectedPipeCategoryIndex.value = pipeCategoryOptions.findIndex((item: any) => item.value == equipment.pipeCategory)
|
|
|
|
|
+ selectedUseStatusIndex.value = useStatusOptions.findIndex((item: any) => item.value == equipment.useStatus)
|
|
|
}
|
|
}
|
|
|
isEdit.value = false
|
|
isEdit.value = false
|
|
|
}
|
|
}
|
|
@@ -1550,6 +1613,16 @@ const onAcceptDateChange = (e: any) => {
|
|
|
equipment.acceptdate = parseDate(e.detail.value)
|
|
equipment.acceptdate = parseDate(e.detail.value)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handlePipeCategoryChange = (e: any) => {
|
|
|
|
|
+ selectedPipeCategoryIndex.value = e.detail.value
|
|
|
|
|
+ equipment.pipeCategory = pipeCategoryOptions[e.detail.value].value
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleUseStatusChange = (e: any) => {
|
|
|
|
|
+ selectedUseStatusIndex.value = e.detail.value
|
|
|
|
|
+ equipment.useStatus = useStatusOptions[e.detail.value].value
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const onDesignDateChange = (e: any) => {
|
|
const onDesignDateChange = (e: any) => {
|
|
|
equipment.designdate = parseDate(e.detail.value)
|
|
equipment.designdate = parseDate(e.detail.value)
|
|
|
}
|
|
}
|