GULIMMO
2023-11-11 924b6972cbc7993d66dd85d5bb3d3150a145f076
场所维护等页面更新
7 files modified
91 ■■■■ changed files
pages.json 2 ●●● patch | view | raw | blame | history
subPackage/bs/views/addRepair.vue 2 ●●● patch | view | raw | blame | history
subPackage/bs/views/repair.vue 2 ●●● patch | view | raw | blame | history
subPackage/house/family/index.vue 2 ●●● patch | view | raw | blame | history
subPackage/house/list/index.vue 2 ●●● patch | view | raw | blame | history
subPackage/workbench/components/formItem.vue 2 ●●● patch | view | raw | blame | history
subPackage/workbench/views/editExamine.vue 79 ●●●● patch | view | raw | blame | history
pages.json
@@ -246,7 +246,7 @@
                {
                    "path": "views/report",
                    "style": {
                        "navigationBarTitleText": "保修报事",
                        "navigationBarTitleText": "报事报修",
                        "enablePullDownRefresh": false,
                        "navigationBarBackgroundColor": "#fff",
                        "navigationBarTextStyle": "black"
subPackage/bs/views/addRepair.vue
@@ -86,7 +86,7 @@
            this.info.type = option.type
        },
        onShow() {
            this.curSelectSite = uni.getStorageSync('curSelectSite')
            this.curSelectSite = uni.getStorageSync('siteInfo')
            this.info.addressCode = this.curSelectSite.id
            console.log(this.curSelectSite);
        },
subPackage/bs/views/repair.vue
@@ -114,7 +114,7 @@
        },
        onShow() {
            this.getStatistics()
            this.curSelectSite = uni.getStorageSync('curSelectSite')
            this.curSelectSite = uni.getStorageSync('siteInfo')
            console.log(this.curSelectSite);
        },
subPackage/house/family/index.vue
@@ -117,7 +117,7 @@
        },
        onShow() {
            this.getBuildingList()
            this.curSelectSite = uni.getStorageSync('curSelectSite')
            this.curSelectSite = uni.getStorageSync('siteInfo')
        },
        methods: {
            async getBuildingList() {
subPackage/house/list/index.vue
@@ -62,7 +62,7 @@
        },
        onShow() {
            this.getHouseInfo()
            this.curSelectSite = uni.getStorageSync('curSelectSite')
            this.curSelectSite = uni.getStorageSync('siteInfo')
        },
        methods: {
subPackage/workbench/components/formItem.vue
@@ -7,7 +7,7 @@
            <u-form-item label="电话号码" class="form-item">
                <u--input v-model="form.telephone" border="none"></u--input>
            </u-form-item>
            <u-form-item label="咱据地" class="form-item">
            <u-form-item label="根据地" class="form-item">
                <u--input v-model="form.tempAddress" border="none"></u--input>
            </u-form-item>
        </u-form>
subPackage/workbench/views/editExamine.vue
@@ -20,7 +20,7 @@
        <view class="">
            <box-title title="营业执照"></box-title>
            <view class="upload-img">
                <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
                <u-upload :fileList="form.imageUrls" :previewFullImage="uploadConfig.previewFullImage"
                    :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
                    :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
                </u-upload>
@@ -29,7 +29,7 @@
        <view class="">
            <box-title title="场所平面图"></box-title>
            <view class="upload-img">
                <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
                <u-upload :fileList="form.planImageUrls" :previewFullImage="uploadConfig.previewFullImage"
                    :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
                    :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
                </u-upload>
@@ -51,7 +51,10 @@
</template>
<script>
    import { updatePlaceExtData } from '@/api/placeExp/placeExp.js'
    import {
        updatePlaceExtData,
        getPlaceDetail
    } from '@/api/placeExp/placeExp.js'
    import uploadMixin from "@/mixin/uploadMixin";
    import boxTtitle from '@/components/boxTitle/index.vue'
    import formItem from '../components/formItem.vue'
@@ -63,6 +66,7 @@
        data() {
            return {
                form: {
                    id: '',
                    localtion: '',
                    placeName: '',
                    legalPerson: '',
@@ -87,22 +91,79 @@
                        trigger: ['blur', 'change']
                    }
                },
                personNum: 1
                personNum: 1,
                curSelectSite: {},
                placeId: '',
            }
        },
        onShow() {
            this.curSelectSite = uni.getStorageSync('siteInfo')
            this.getCsDetails()
        },
        methods: {
            updatePlaceExt() {
            getCsDetails() {
                getPlaceDetail({
                    placeId: this.curSelectSite.id
                }).then(detailRes => {
                    const { code, data } = detailRes
                    if (code !== 200) {
                        uni.showToast({
                            title: '数据请求失败',
                            icon: 'error'
                        })
                        return
                    }
                    this.placeId = data.placeId
                    const placePractitioner = data?.placePractitioner || []
                    Object.keys(this.form).forEach(key => {
                        this.form[key] = data[key]
                        if(key === 'imageUrls' || key === 'planImageUrls') {
                            this.form[key] = []
                            !!data[key] && this.form[key].push()
                        }
                    })
                    this.personNum = placePractitioner.length
                    this.$nextTick(() => {
                        this.$refs.formItemRef.forEach((item, index) => {
                            item.form = this.$refs.formItemRef[index].form
                        })
                    })
                })
            },
            updatePlaceExt(data) {
                data['imageUrls'] = JSON.stringify(data['imageUrls'])
                data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
                updatePlaceExtData({...data}).then(res => {
                    const { code } = res
                    if (code !== 200) {
                        uni.showToast({
                            title: '提交失败',
                            icon: 'error'
                        })
                        return
                    }
                    uni.showToast({
                        title: '提交成功',
                        icon: 'success',
                        complete() {
                            setTimeout(() => {
                                uni.navigateBack()
                            }, 1500)
                        }
                    })
                })
            },
            addPerson() {
                this.personNum++
            },
            submit() {
                const personList = []
                const placePractitioner = []
                this.$refs.formItemRef.forEach(item => {
                    personList.push(item.form)
                    item.form.placeId = this.placeId
                    placePractitioner.push(item.form)
                })
                console.log(personList);
                this.form.placePractitioner = placePractitioner
                this.updatePlaceExt(this.form)
            }
        }
    }