riku
2023-12-14 c37f0db24bcb9c08c11da9cd96e562a84cd66e6a
评估管理模块完成历史记录展示
已修改11个文件
已添加3个文件
307 ■■■■ 文件已修改
src/api/fysp/evaluateApi.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/form/FYForm.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionLocation.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionOnlineStatus.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionScene.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionTime.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/search-option/FYOptionUserType.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/FYTable.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/composables/formConfirm.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/ResultManage.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompHistoryRecord.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompPreCheck.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompQuickSet.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/fysp/evaluateApi.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import { $fysp } from '../index';
export default {
  /**
   * èŽ·å–è‡ªåŠ¨è¯„ä¼°åŽ†å²è®°å½•
   */
  fetchAutoEvaluation(param){
    return $fysp.post(`evaluation/auto/record`, param).then((res) => res.data);
  }
};
src/api/index.js
@@ -9,7 +9,7 @@
let ip2_file = 'https://fyami.com.cn/';
if (debug) {
  // ip1 = 'http://192.168.0.123:8082/';
  ip1 = 'http://192.168.0.138:8082/';
  // ip1_file = 'http://47.100.191.150:9005/';
  ip2 = 'http://192.168.0.138:8080/';
  // ip2_file = 'https://fyami.com.cn/';
src/components/form/FYForm.vue
@@ -1,4 +1,3 @@
<!-- åœºæ™¯åŸºæœ¬ä¿¡æ¯ç¼–辑 -->
<template>
  <el-form
    :inline="false"
src/components/search-option/FYOptionLocation.vue
@@ -82,12 +82,13 @@
        }
        if (nVal != oVal) {
          if (nVal || nVal.length > 0) {
            this.selectedOptions = this.optionFormatReverse(nVal);
            this.selectedOptions = this.optionFormatReverse(nVal)
          }
        }
      },
      deep: true,
    },
      immediate: true
    }
  },
  methods: {
    /**
src/components/search-option/FYOptionOnlineStatus.vue
@@ -56,6 +56,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
src/components/search-option/FYOptionScene.vue
@@ -61,6 +61,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
src/components/search-option/FYOptionTime.vue
@@ -47,7 +47,8 @@
        if (nVal != oVal) {
          this.selectedOptions = nVal
        }
      }
      },
      immediate: true
    }
  },
  methods: {
src/components/search-option/FYOptionUserType.vue
@@ -56,6 +56,7 @@
        }
      },
      deep: true,
      immediate: true
    },
  },
  mounted() {
src/components/table/FYTable.vue
@@ -6,7 +6,9 @@
      </template>
    </FYSearchBar>
  </el-row>
  <el-row ref="expandRef">
    <slot name="options-expand"></slot>
  </el-row>
  <el-table
    :data="tableData"
    v-loading="loading"
@@ -18,6 +20,7 @@
  </el-table>
  <el-pagination
    v-if="pagination"
    ref="paginationRef"
    class="el-pagination"
    v-model:current-page="currentPage"
@@ -41,6 +44,10 @@
export default {
  props: {
    rowClassName: undefined,
    pagination: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
@@ -49,21 +56,21 @@
      total: 0,
      currentPage: 1,
      pageSize: 20,
      loading: false,
    };
      loading: false
    }
  },
  emits: ['search'],
  watch: {
    currentPage(nValue, oValue) {
      if (nValue != oValue) {
        this.onSearch();
        this.onSearch()
      }
    },
    pageSize(nValue, oValue) {
      if (nValue != oValue) {
        this.onSearch();
        this.onSearch()
      }
    },
    }
  },
  methods: {
    /**
@@ -72,43 +79,45 @@
     * å›žè°ƒå‡½æ•°æŽ¥æ”¶ä¸€ä¸ªå¯¹è±¡ï¼ŒåŒ…括表格数据数组data和数据总数total
     */
    onSearch() {
      this.loading = true;
      this.loading = true
      this.$emit(
        'search',
        {
          currentPage: this.currentPage,
          pageSize: this.pageSize,
          pageSize: this.pageSize
        },
        (res) => {
          this.tableData = res.data;
          this.total = res.total;
          this.loading = false;
          this.tableData = res.data
          this.total = res.total ? res.total : 0
          this.loading = false
        }
      );
      )
    },
    calcTableHeight() {
      const h1 = this.$refs.searchRef.$el.offsetHeight;
      const h2 = this.$refs.paginationRef.$el.offsetHeight;
      const h1 = this.$refs.searchRef.$el.offsetHeight
      const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0
      const h3 = this.$refs.expandRef.$el.offsetHeight
      const h = h1 + h2 + h3
      // return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`;
      return `calc(100vh - ${h1}px - ${h2}px - 60px - var(--el-main-padding) * 2)`;
      return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`
    },
    tableRowClassName({ row }) {
      if (this.rowClassName) {
        if (typeof this.rowClassName == 'string') {
          return this.rowClassName;
          return this.rowClassName
        } else if (typeof this.rowClassName == 'function') {
          return this.rowClassName({ row });
          return this.rowClassName({ row })
        }
      } else {
        return row.extension1 != '0' ? 'online-row' : 'offline-row';
        return row.extension1 != '0' ? 'online-row' : 'offline-row'
      }
      }
    },
  },
  mounted() {
    this.tableHeight = this.calcTableHeight();
    this.onSearch();
  },
};
    this.tableHeight = this.calcTableHeight()
    this.onSearch()
  }
}
</script>
<style>
src/composables/formConfirm.js
@@ -1,8 +1,8 @@
// è¡¨å•的确认和取消
import { onActivated, onDeactivated, ref, watch } from 'vue';
import { useCloned } from '@vueuse/core';
import { useMessageBoxTip, useMessageBox } from './messageBox';
// è¡¨å•的确认和取消
export function useFormConfirm({
  defaultForm = undefined,
  submit = {
src/views/fysp/evaluation/ResultManage.vue
@@ -1,24 +1,102 @@
<template>
  <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck>
  <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> -->
  <FYTable @search="onSearch" :pagination="false">
    <template #options>
      <!-- åŒºåŽ¿ -->
      <FYOptionLocation
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch.locations"
      ></FYOptionLocation>
      <!-- åœºæ™¯ç±»åž‹ -->
      <FYOptionScene
        :allOption="false"
        :type="2"
        v-model:value="formSearch.scenetype"
      ></FYOptionScene>
      <!-- æ—¶é—´ -->
      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
    </template>
    <template #options-expand>
      <CompQuickSet @quick-set="setOptions"></CompQuickSet>
    </template>
    <template #table-column>
      <el-table-column
        type="index"
        fixed="left"
        prop="sceneName"
        label="名称"
        width="400"
      >
        <template #default="{row}">
          <el-tooltip
            effect="dark"
            :content="row.sceneName"
            placement="top-start"
            :show-after="500"
          >
            {{ row.sceneName }}
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="dname" label="区县" width="90" />
      <el-table-column prop="tname" label="街道" width="110" />
      <el-table-column prop="evaluation.scenseaddress" label="地址" />
      <!-- <el-table-column prop="biArea" label="集中区" width="110" />
      <el-table-column prop="biManagementCompany" label="物业" min-width="110"/> -->
      <el-table-column prop="evaluation.resultscorebef" label="得分" width="110" />
    </template>
  </FYTable>
</template>
<script>
import CompPreCheck from './components/CompPreCheck.vue';
import CompPreCheck from './components/CompPreCheck.vue'
import evaluateApi from '@/api/fysp/evaluateApi'
import dayjs from 'dayjs'
import CompQuickSet from './components/CompQuickSet.vue'
export default {
    name: 'ResultManage',
    components: { CompPreCheck },
  components: { CompPreCheck, CompQuickSet },
    data() {
        return {};
    return {
      formSearch: {
        locations: {},
        scenetype: {},
        time: dayjs().add(-1, 'M').date(1).toDate()
      }
    }
    },
    methods:{
      /**
       * é€šè¿‡è‡ªè¯„预检后,执行自动评估
       * @param {*} options æŸ¥è¯¢å‚æ•°
       */
      autoEvaluate(options){
    setOptions(param) {
      this.formSearch.locations = param.locations
      this.formSearch.scenetype = param.scenetype
    },
    onSearch(page, func) {
      const { locations, scenetype, time } = this.formSearch
      const area = {
        provincecode: locations.pCode,
        provincename: locations.pName,
        citycode: locations.cCode,
        cityname: locations.cName,
        districtcode: locations.dCode,
        districtname: locations.dName,
        starttime: dayjs(time).format('YYYY-MM-DD'),
        scensetypeid: scenetype.value
      }
      evaluateApi.fetchAutoEvaluation(area).then((res) => {
        if (res) {
          func({
            data: res.data
          })
        }
      })
      }
    }
};
}
</script>
src/views/fysp/evaluation/components/CompHistoryRecord.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
<template>
  <div></div>
</template>
<script>
export default {
  methods:{
  }
}
</script>
src/views/fysp/evaluation/components/CompPreCheck.vue
@@ -6,7 +6,7 @@
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch._locations"
        v-model:value="formSearch.locations"
      ></FYOptionLocation>
      <!-- åœºæ™¯ç±»åž‹ -->
      <FYOptionScene
@@ -15,7 +15,7 @@
        v-model:value="formSearch.scenetype"
      ></FYOptionScene>
      <!-- æ—¶é—´ -->
      <FYOptionTime type="month" v-model:value="formSearch.time"></FYOptionTime>
      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
    </template>
  </FYSearchBar>
  <el-row>
@@ -27,6 +27,8 @@
</template>
<script>
import dayjs from 'dayjs'
/**
 * è‡ªåŠ¨è¯„ä¼°æ¡ä»¶åˆè§„æ€§æ£€æŸ¥
 */
@@ -105,9 +107,9 @@
  data() {
    return {
      formSearch: {
        _locations: {},
        locations: {},
        scenetype: {},
        time: undefined
        time: dayjs().add(-1, 'M').date(1).toDate()
      }
    }
  },
@@ -117,17 +119,22 @@
     * æ£€æŸ¥æ‰€é€‰èŒƒå›´å†…各项评估数据源是否完整
     */
    preCheck() {
      this.$emit('preCheck', this.formSearch)
      const param = {
        locations: this.formSearch.locations,
        scenetype: this.formSearch.scenetype,
        time: dayjs(this.formSearch.time).format('YYYY-MM-DD')
      }
      this.$emit('preCheck', param)
    },
    /**
     * å¿«é€Ÿè®¾ç½®æ¡ä»¶
     */
    quickSet(set) {
      this.formSearch._locations = set.locations
      this.formSearch.locations = set.locations
      this.formSearch.scenetype = set.scenetype
      this.preCheck()
      // this.preCheck()
    }
  }
}
src/views/fysp/evaluation/components/CompQuickSet.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
<template>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
      v.name
    }}</el-button>
  </el-row>
</template>
<script>
export default {
  props: {
    quickSetting: {
      type: Array,
      default: () => {
        return [
          {
            name: '静安工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310106',
              dName: '静安区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '徐汇餐饮',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310104',
              dName: '徐汇区'
            },
            scenetype: { label: '餐饮', value: '5' }
          },
          {
            name: '金山工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '金山码头',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '码头', value: '2' }
          },
          {
            name: '金山搅拌站',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '搅拌站', value: '3' }
          }
        ]
      }
    }
  },
  emits: ['quickSet'],
  methods: {
    /**
     * å¿«é€Ÿè®¾ç½®æ¡ä»¶
     * @param {locations, scenetype} set
     */
    quickSet(set) {
      // this.formSearch.locations = set.locations
      // this.formSearch.scenetype = set.scenetype
      this.$emit('quickSet', set)
    }
  }
}
</script>