xyc
16 小时以前 5b41c8896ef7850be2672e45b69bb58e149729ec
traffic-audit-web/src/views/RuleManage.vue
@@ -10,6 +10,7 @@
          <el-menu-item index="/explain">企业解释</el-menu-item>
          <el-menu-item index="/audit">审核结果</el-menu-item>
          <el-menu-item index="/report">报表生成</el-menu-item>
          <el-menu-item index="/ledger-audit">事后核查</el-menu-item>
          <el-submenu index="/special-stats">
            <template slot="title">专项统计</template>
            <el-menu-item index="/holiday-stat">节假日</el-menu-item>
@@ -83,7 +84,8 @@
  TREND_CONSISTENCY: '趋势一致', RATIO_CHANGE: '占比变化', AVG_DIST_CHANGE: '平均运距变化',
  PAX_PER_TRIP_CHANGE: '单车次载客人数变化', LOADED_RATIO_DIFF: '载货里程占比对比',
  FUEL_RANGE: '单耗超范围', FUEL_MOM: '单耗环比', FREIGHT_VS_H2032: '与货运月报对比',
  AVG_DIST_VS_H2032: '平均运距对比', LOADED_TON_RATIO: '载货吨位比值'
  AVG_DIST_VS_H2032: '平均运距对比', LOADED_TON_RATIO: '载货吨位比值',
  EFFICIENCY_RATIO: '运输效率比值', VEHICLE_VS_ENT_AVG: '单车与月报每主车对比', MILEAGE_VS_TRACK: '单车行程与轨迹对比'
}
export default {
  components: { AppHeader },
@@ -108,7 +110,16 @@
    saveThreshold(row) {
      api.post('/rules/update', {
        id: row.id, threshold: row.threshold, alertLevel: row.alertLevel
      }).then(() => { this.$message.success('已保存:' + row.ruleCode) })
      }).then(res => {
        // 后端会按新阈值同步改写「规则名称/说明」,把最新值回填到当前行,否则列表还显示旧文案
        const r = res && res.data
        if (r) {
          row.ruleName = r.ruleName
          row.description = r.description
          row.threshold = r.threshold
        }
        this.$message.success('已保存:' + row.ruleCode)
      })
        .catch(e => { if (e && e._toast) return; this.$message.error('保存失败') })
    }
  },