1. 新增自动评估记录的获取和展示;
2. 新增评估记录排序功能;
3. 新增评估任务界面;
已修改16个文件
已添加1个文件
564 ■■■■■ 文件已修改
.prettierrc.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/core/SiderMenu.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/form/FYForm.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/FYTable.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/envCreditCode.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/index.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/menu.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/loadingStore.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/baseinfo/fysp/scene/SceneInfo.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/DataSource.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/ResultManage.vue 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/evaluation/components/CompPreCheck.vue 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/UserInfo.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fytz/user/components/CompUserInfo.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.prettierrc.json
@@ -1,6 +1,6 @@
{
  "$schema": "https://json.schemastore.org/prettierrc",
  "semi": false,
  "semi": true,
  "tabWidth": 2,
  "singleQuote": true,
  "printWidth": 100,
package-lock.json
@@ -13,7 +13,7 @@
        "@vueuse/core": "^9.7.0",
        "axios": "^1.2.1",
        "dayjs": "^1.11.10",
        "element-plus": "^2.2.26",
        "element-plus": "^2.4.3",
        "pinia": "^2.0.26",
        "vue": "^3.2.45",
        "vue-router": "^4.1.6"
@@ -1838,8 +1838,9 @@
      }
    },
    "node_modules/@element-plus/icons-vue": {
      "version": "2.0.10",
      "license": "MIT",
      "version": "2.3.1",
      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
      "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
      "peerDependencies": {
        "vue": "^3.2.0"
      }
@@ -3729,11 +3730,12 @@
      "license": "ISC"
    },
    "node_modules/element-plus": {
      "version": "2.2.26",
      "license": "MIT",
      "version": "2.4.3",
      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
      "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
      "dependencies": {
        "@ctrl/tinycolor": "^3.4.1",
        "@element-plus/icons-vue": "^2.0.6",
        "@element-plus/icons-vue": "^2.3.1",
        "@floating-ui/dom": "^1.0.1",
        "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
        "@types/lodash": "^4.14.182",
@@ -8693,7 +8695,9 @@
      }
    },
    "@element-plus/icons-vue": {
      "version": "2.0.10",
      "version": "2.3.1",
      "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
      "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==",
      "requires": {}
    },
    "@eslint-community/eslint-utils": {
@@ -9942,10 +9946,12 @@
      "dev": true
    },
    "element-plus": {
      "version": "2.2.26",
      "version": "2.4.3",
      "resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.4.3.tgz",
      "integrity": "sha512-b3q26j+lM4SBqiyzw8HybybGnP2pk4MWgrnzzzYW5qKQUgV6EG1Zg7nMCfgCVccI8tNvZoTiUHb2mFaiB9qT8w==",
      "requires": {
        "@ctrl/tinycolor": "^3.4.1",
        "@element-plus/icons-vue": "^2.0.6",
        "@element-plus/icons-vue": "^2.3.1",
        "@floating-ui/dom": "^1.0.1",
        "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
        "@types/lodash": "^4.14.182",
package.json
@@ -18,7 +18,7 @@
    "@vueuse/core": "^9.7.0",
    "axios": "^1.2.1",
    "dayjs": "^1.11.10",
    "element-plus": "^2.2.26",
    "element-plus": "^2.4.3",
    "pinia": "^2.0.26",
    "vue": "^3.2.45",
    "vue-router": "^4.1.6"
src/components.d.ts
@@ -10,7 +10,6 @@
    BaseContentLayout: typeof import('./components/core/BaseContentLayout.vue')['default']
    BasePanelLayout: typeof import('./components/core/BasePanelLayout.vue')['default']
    Content: typeof import('./components/core/Content.vue')['default']
    copy: typeof import('./components/search-option/FYOptionScene copy.vue')['default']
    ElAside: typeof import('element-plus/es')['ElAside']
    ElAvatar: typeof import('element-plus/es')['ElAvatar']
    ElBacktop: typeof import('element-plus/es')['ElBacktop']
@@ -56,6 +55,7 @@
    ElTabPane: typeof import('element-plus/es')['ElTabPane']
    ElTabs: typeof import('element-plus/es')['ElTabs']
    ElTag: typeof import('element-plus/es')['ElTag']
    ElText: typeof import('element-plus/es')['ElText']
    ElTooltip: typeof import('element-plus/es')['ElTooltip']
    ElTransfer: typeof import('element-plus/es')['ElTransfer']
    ElTree: typeof import('element-plus/es')['ElTree']
@@ -72,7 +72,6 @@
    FYTable: typeof import('./components/table/FYTable.vue')['default']
    Header: typeof import('./components/core/Header.vue')['default']
    MenuItems: typeof import('./components/core/MenuItems.vue')['default']
    ProblemCard: typeof import('./components/ProblemCard.vue')['default']
    RouterLink: typeof import('vue-router')['RouterLink']
    RouterView: typeof import('vue-router')['RouterView']
    SearchBar: typeof import('./components/SearchBar.vue')['default']
src/components/core/SiderMenu.vue
@@ -60,7 +60,7 @@
</template>
<script>
import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '../../constants/index'
import { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from '@/constants/index'
export default {
  name: 'CoreSiderMenu',
src/components/form/FYForm.vue
@@ -8,12 +8,8 @@
    label-width="150px"
  >
    <slot name="form-item" :formObj="formObj"></slot>
    <el-form-item>
      <el-button
        :disabled="!edit"
        type="primary"
        @click="onSubmit"
        :loading="loading"
    <el-form-item v-if="showButtons">
      <el-button :disabled="!edit" type="primary" @click="onSubmit" :loading="loading"
        >提交</el-button
      >
      <el-button :disabled="!edit" @click="onReset">重置</el-button>
@@ -38,12 +34,16 @@
  formInfo: Object,
  //表单检验规则
  rules: Object,
  showButtons: {
    type: Boolean,
    default: true
  },
  //取消按钮是否可用
  enableCancelBtn: Boolean,
  //触发重置
  reset: Boolean,
  //通知编辑状态
  isEdit: Boolean,
  isEdit: Boolean
});
//触发函数,提交和取消
@@ -52,11 +52,11 @@
//表单操作函数
const { formObj, formRef, edit, onSubmit, onCancel, onReset } = useFormConfirm({
  submit: {
    do: submit,
    do: submit
  },
  cancel: {
    do: cancel,
  },
    do: cancel
  }
});
//加载状态
src/components/table/FYTable.vue
@@ -15,6 +15,7 @@
    table-layout="fixed"
    :row-class-name="tableRowClassName"
    :height="tableHeight"
    border
  >
    <slot name="table-column"></slot>
  </el-table>
src/constants/envCreditCode.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
// çŽ¯ä¿¡ç è½¬æ¢
function envCreditCode(score) {
  const s = parseInt(score)
  if (s <= 59) {
    return {
      value: 2,
      name: '红码',
      color: '#db2828'
    };
  } else if (s <= 89) {
    return {
      value: 1,
      name: '黄码',
      color: '#f7a62c'
    };
  } else {
    return {
      value: 0,
      name: '绿码',
      color: '#21ba45'
    };
  }
}
export { envCreditCode };
src/constants/index.js
@@ -1 +1,2 @@
export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu'
export { MENU_FYSP, MENU_FYTZ, MENU_FYPW } from './menu';
export { envCreditCode } from './envCreditCode';
src/constants/menu.js
@@ -36,12 +36,12 @@
      {
        path: '/fysp/evaluation/datasource',
        icon: 'MessageBox',
        name: '评估数据源',
        name: '评估任务',
      },
      {
        path: '/fysp/evaluation/resultManage',
        icon: 'Tickets',
        name: '评估管理',
        name: '评估记录',
      },
    ],
  },
src/stores/loadingStore.js
@@ -1,23 +1,26 @@
// åŠ è½½çŠ¶æ€çš„é€»è¾‘ç®¡ç†
import { defineStore } from 'pinia'
import { defineStore } from 'pinia';
export const useLoadingStore = defineStore('loading', {
  state: () => {
    return {
      loadingStatus: []
    }
    };
  },
  actions: {
    pushLoading(func) {
      const timeout = setTimeout(func, 3000);
      this.loadingStatus.push({ t: timeout, f: func });
    },
    clearLoading() {
      this.loadingStatus.forEach(l => {
        if (typeof l === 'function') {
          l()
      if (this.loadingStatus.length > 0) {
        this.loadingStatus.forEach((obj) => {
          clearTimeout(obj.t)
          obj.f()
        });
        this.loadingStatus = [];
      }
    }
        }
      });
      if (this.loadingStatus.length > 0) {
        this.loadingStatus = []
      }
    }
  }
})
src/views/baseinfo/fysp/scene/SceneInfo.vue
@@ -107,7 +107,7 @@
    },
    itemEdit(scope) {
      scope.row.loading1 = true;
      this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false));
      this.loadingStore.pushLoading(() => (scope.row.loading1 = false));
      this.$router.push(`sceneEdit/${scope.row.guid}`);
    },
    itemActive(scope) {
src/views/fysp/evaluation/DataSource.vue
@@ -1,14 +1,28 @@
<template>
  <div>DataSource</div>
  <el-row :gutter="16">
    <el-col :span="16">
      <CompPreCheck></CompPreCheck>
    </el-col>
    <el-col :span="8">
      <div class="radius"></div>
    </el-col>
  </el-row>
</template>
<script>
import CompPreCheck from "./components/CompPreCheck.vue";
export default {
  name: 'DataSource',
  components: { CompPreCheck },
  data() {
    return {
    }
    return {};
  }
};
</script>
<style scoped>
.radius {
  height: 80vh;
  border: 1px solid var(--el-border-color);
  border-radius: var(--el-border-radius-base);
}
</style>
src/views/fysp/evaluation/ResultManage.vue
@@ -1,7 +1,7 @@
<template>
  <!-- <CompPreCheck @pre-check="autoEvaluate"></CompPreCheck> -->
  <FYTable @search="onSearch" :pagination="false">
  <FYTable @search="onSearch" :pagination="false" ref="tableRef">
    <template #options>
      <!-- åŒºåŽ¿ -->
      <FYOptionLocation
@@ -25,13 +25,7 @@
    </template>
    <template #table-column>
      <el-table-column
        type="index"
        fixed="left"
        prop="sceneName"
        label="名称"
        width="400"
      >
      <el-table-column type="index" fixed="left" prop="sceneName" label="名称" width="300">
        <template #default="{row}">
          <el-tooltip
            effect="dark"
@@ -43,42 +37,78 @@
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column
        prop="subTaskTime"
        label="巡查日期"
        width="110"
        sortable
        :formatter="timeFormat"
      />
      <el-table-column
        prop="evaluation.resultscorebef"
        label="得分"
        width="90"
        sortable
        :sort-method="sortScore"
      />
      <el-table-column prop="evaluation.resultscorebef" label="环信码" width="100">
        <template #default="{ row }">
          <span :style="`color: ${toCode(row).color};`">{{ toCode(row).name }}</span>
        </template>
      </el-table-column>
      
      <el-table-column prop="dname" label="区县" width="90" />
      <el-table-column prop="tname" label="街道" width="110" />
      <el-table-column
        prop="tname"
        label="街道"
        width="110"
        :filters="townFilters"
        :filter-method="filterHandler"
      />
      <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" />
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button icon="DocumentAdd" size="default" type="success" @click="drawer = true"
            >自动评估</el-button
          >
        </template>
        <template #default="{ row }">
          <el-button type="primary" size="small" @click="editRow(row)">查看</el-button>
        </template>
      </el-table-column>
    </template>
  </FYTable>
</template>
<script>
import CompPreCheck from './components/CompPreCheck.vue'
import evaluateApi from '@/api/fysp/evaluateApi'
import dayjs from 'dayjs'
import CompQuickSet from './components/CompQuickSet.vue'
import dayjs from 'dayjs';
import evaluateApi from '@/api/fysp/evaluateApi';
import { envCreditCode } from '@/constants/index';
import CompQuickSet from './components/CompQuickSet.vue';
export default {
  name: 'ResultManage',
  components: { CompPreCheck, CompQuickSet },
  components: { CompQuickSet },
  data() {
    return {
      formSearch: {
        locations: {},
        scenetype: {},
        time: dayjs().add(-1, 'M').date(1).toDate()
      }
    }
      },
      townFilters: []
    };
  },
  methods: {
    setOptions(param) {
      this.formSearch.locations = param.locations
      this.formSearch.scenetype = param.scenetype
      this.formSearch.locations = param.locations;
      this.formSearch.scenetype = param.scenetype;
      this.$refs.tableRef.onSearch()
    },
    onSearch(page, func) {
      const { locations, scenetype, time } = this.formSearch
      const { locations, scenetype, time } = this.formSearch;
      const area = {
        provincecode: locations.pCode,
        provincename: locations.pName,
@@ -88,15 +118,56 @@
        districtname: locations.dName,
        starttime: dayjs(time).format('YYYY-MM-DD'),
        scensetypeid: scenetype.value
      }
      };
      evaluateApi.fetchAutoEvaluation(area).then((res) => {
        if (res) {
          func({
            data: res.data
          })
        if (typeof func === 'function') {
          func({ data: res.data });
        }
      })
        if (res.data) {
          this.getFilters(res.data);
        }
      });
    },
    getFilters(data) {
      const townList = [];
      data.forEach((e) => {
        if (townList.indexOf(e.tname) == -1) {
          townList.push(e.tname);
        }
      });
      this.townFilters = townList.map((v) => {
        return { text: v, value: v };
      });
    },
    toCode(row, column) {
      if (row.evaluation) {
        return envCreditCode(row.evaluation.resultscorebef);
      } else {
        return '';
      }
    },
    timeFormat(row, column) {
      const time = row.subTaskTime;
      if (time) {
        return dayjs(time).format('MM-DD');
      } else {
        return '';
      }
    },
    filterHandler(value, row, column) {
      const property = column['property'];
      return row[property] === value;
    },
    sortScore(a, b) {
      const s1 = a.evaluation ? parseInt(a.evaluation.resultscorebef) : 0;
      const s2 = b.evaluation ? parseInt(b.evaluation.resultscorebef) : 0;
      return s1 - s2;
    }
  }
}
};
</script>
<style scoped>
.a {
  color: #f7a62c;
}
</style>
src/views/fysp/evaluation/components/CompPreCheck.vue
@@ -1,117 +1,76 @@
<template>
  <FYSearchBar @search="preCheck">
    <template #options>
  <el-steps :active="stepIndex" finish-status="success" style="" align-center>
    <el-step title="评估范围" />
    <el-step title="数据源检查" />
    <el-step title="豁免条目" />
    <el-step title="自动评估" />
  </el-steps>
  <el-card v-if="stepIndex == 0" shadow="never">
    <template #header>
      <div><el-text tag="b" size="large">选择评估范围</el-text></div>
      <el-text size="small" type="info">包括区县、场景类型以及月份</el-text>
    </template>
    <FYForm :form-info="evaConditon" :rules="evaConditionRules" :showButtons="false">
      <template #form-item="{ formObj }">
      <!-- åŒºåŽ¿ -->
      <FYOptionLocation
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch.locations"
          v-model:value="formObj.locations"
      ></FYOptionLocation>
      <!-- åœºæ™¯ç±»åž‹ -->
      <FYOptionScene
        :allOption="false"
        :type="2"
        v-model:value="formSearch.scenetype"
          v-model:value="formObj.scenetype"
      ></FYOptionScene>
      <!-- æ—¶é—´ -->
      <FYOptionTime :initValue="false" type="month" v-model:value="formSearch.time"></FYOptionTime>
        <FYOptionTime
          :initValue="true"
          type="month"
          v-model:value="formObj.time"
        ></FYOptionTime>
    </template>
  </FYSearchBar>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
      v.name
    }}</el-button>
    </FYForm>
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default">下一步</el-button>
  </el-row>
    </template>
  </el-card>
  <el-card v-if="stepIndex == 1" shadow="never"> Never2 </el-card>
  <el-card v-if="stepIndex == 2" shadow="never"> Never3 </el-card>
  <el-card v-if="stepIndex == 3" shadow="never"> Never4 </el-card>
</template>
<script>
import dayjs from 'dayjs'
import dayjs from 'dayjs';
/**
 * è‡ªåŠ¨è¯„ä¼°æ¡ä»¶åˆè§„æ€§æ£€æŸ¥
 */
export default {
  name: 'CompPreCheck',
  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' }
          }
        ]
      }
    }
  },
  props: {},
  emits: ['preCheck'],
  data() {
    return {
      formSearch: {
        locations: {},
        scenetype: {},
        time: dayjs().add(-1, 'M').date(1).toDate()
      // æ“ä½œæ­¥éª¤ä¸‹æ ‡
      stepIndex: 0,
      // è¯„估任务范围
      evaConditon: {},
      evaConditionRules: {
        acountname: [
          {
            required: true,
            message: '账户名不能为空',
            trigger: 'blur'
      }
        ]
    }
    };
  },
  methods: {
    /**
@@ -119,23 +78,8 @@
     * æ£€æŸ¥æ‰€é€‰èŒƒå›´å†…各项评估数据源是否完整
     */
    preCheck() {
      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.scenetype = set.scenetype
      // this.preCheck()
      // this.$emit('preCheck', param)
    }
  }
}
};
</script>
src/views/fytz/user/UserInfo.vue
@@ -52,7 +52,7 @@
        </template>
      </el-table-column>
      <el-table-column prop="userInfo.usertype" label="用户类型" width="90" />
      <el-table-column fixed="right" align="right" label="操作" width="140">
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button
            icon="DocumentAdd"
@@ -70,13 +70,13 @@
            @click="editRow(scope)"
            >查看</el-button
          >
          <!-- <el-button
          <el-button
            :loading="scope.row.loading2"
            :type="scope.row.extension1 != '0' ? 'danger' : 'primary'"
            :type="scope.row.userInfo.isenable != '0' ? 'danger' : 'primary'"
            size="small"
            @click="itemActive(scope)"
            >{{ scope.row.extension1 != '0' ? '下线' : '上线' }}</el-button
          > -->
            >{{ scope.row.userInfo.isenable != '0' ? '下线' : '上线' }}</el-button
          >
        </template>
      </el-table-column>
    </template>
@@ -147,24 +147,25 @@
    },
    editRow(scope) {
      scope.row.loading1 = true;
      this.loadingStore.loadingStatus.push(() => (scope.row.loading1 = false));
      this.$router.push(`userEdit/${scope.row.biGuid}`);
      this.loadingStore.pushLoading(() => (scope.row.loading1 = false));
      this.$router.push(`userEdit/${scope.row.userInfo.guid}`);
    },
    itemActive(scope) {
      const rb = {};
      rb.guid = scope.row.guid;
      rb.extension1 = scope.row.extension1 != '0' ? '0' : '1';
      const msg = scope.row.extension1 != '0' ? '下线' : '上线';
      const param = {
        guid: scope.row.userInfo.guid,
        isenable: !scope.row.userInfo.isenable
      }
      const msg = scope.row.userInfo.isenable ? '下线' : '上线';
      useMessageBoxTip({
        confirmMsg: `确认${msg}该场景?`,
        confirmTitle: msg,
        onConfirm: () => {
          scope.row.loading2 = true;
          return userApi
            .updateScene(rb)
            .updateUserInfo(param)
            .then((res) => {
              if (res == 1) {
                scope.row.extension1 = rb.extension1;
              if (res.success) {
                scope.row.userInfo.isenable = param.isenable;
              }
            })
            .finally(() => {
src/views/fytz/user/components/CompUserInfo.vue
@@ -33,9 +33,7 @@
        </el-col>
        <el-col :span="6" v-if="!create">
          <el-row justify="end">
            <el-button type="danger" @click="onResetPw" :loading="pwLoading"
              >重置密码</el-button
            >
            <el-button type="danger" @click="onResetPw" :loading="pwLoading">重置密码</el-button>
          </el-row>
        </el-col>
      </el-form-item>
@@ -54,20 +52,13 @@
      </el-form-item> -->
      <el-form-item label="是否可用" prop="isenable">
        <el-switch v-model="formObj.isenable" />
        <span style="margin-left: 16px">{{
          formObj.isenable ? '可用' : '不可用'
        }}</span>
        <span style="margin-left: 16px">{{ formObj.isenable ? '可用' : '不可用' }}</span>
      </el-form-item>
      <el-form-item label="工号" prop="workno">
        <el-input clearable v-model="formObj.workno" placeholder="工号" />
      </el-form-item>
      <el-form-item label="手机" prop="telephone">
        <el-input
          clearable
          type="tel"
          v-model="formObj.telephone"
          placeholder="手机"
        />
        <el-input clearable type="tel" v-model="formObj.telephone" placeholder="手机" />
      </el-form-item>
      <!-- <el-form-item label="省/市/区/镇" prop="_locations">
        <el-cascader
@@ -94,6 +85,7 @@
import { getSceneName } from '@/enum/scene';
import { enumLocation } from '@/enum/location';
import userApi from '@/api/fytz/userApi';
import { useMessageBoxTip } from '@/composables/messageBox';
const props = defineProps({
  //基本信息
@@ -101,36 +93,37 @@
  isEdit: Boolean,
  create: {
    type: Boolean,
    default: false,
    default: false
  },
  active: {
    type: Boolean,
    default: false,
  },
    default: false
  }
});
const emit = defineEmits(['onSubmit', 'onCancel', 'update:isEdit']);
const _formInfo = ref();
const _formObject = { value: {} };
const _edit = ref(false);
const locations = enumLocation(false);
const locationsProps = reactive({
  checkStrictly: true,
  checkStrictly: true
});
const rules = reactive({
  acountname: [
    {
      required: true,
      message: '账户名不能为空',
      trigger: 'blur',
    },
      trigger: 'blur'
    }
  ],
  realname: [
    {
      required: true,
      message: '用户昵称不能为空',
      trigger: 'blur',
    },
      trigger: 'blur'
    }
  ],
  // password: [
  //   {
@@ -143,30 +136,30 @@
    {
      required: true,
      message: '用户类型不能为空',
      trigger: 'change',
    },
      trigger: 'change'
    }
  ],
  _locations: [
    {
      required: props.create,
      message: '省/市/区/镇不能为空',
      trigger: 'change',
    },
      trigger: 'change'
    }
  ],
  _scenetype: [
    {
      required: true,
      message: '场景类型不能为空',
      trigger: 'change',
    },
  ],
      trigger: 'change'
    }
  ]
});
// ç”¨æˆ·åŸºæœ¬ä¿¡æ¯æ ¼å¼åŒ–
function parseUserInfo(s) {
  s._usertype = {
    label: s.usertype,
    value: s.usertypeid + '',
    value: s.usertypeid + ''
  };
  s._scenetype = getSceneName(s.extension2, 1);
@@ -176,6 +169,19 @@
  return s;
}
function parseUserInfoReverse(formObj) {
  // ç”¨æˆ·ç±»åž‹ä¿¡æ¯å¡«å……
  const b = formObj.value._usertype;
  formObj.value.usertypeid = b.value;
  formObj.value.usertype = b.label;
  // åœºæ™¯ç±»åž‹ä¿¡æ¯å¡«å……
  const c = formObj.value._scenetype;
  formObj.value.extension2 = c.value;
  return formObj;
}
function createUser(formObj, func) {
  return userApi
    .createUser(formObj.value)
@@ -183,6 +189,7 @@
      emit('onSubmit', formObj);
    })
    .finally(() => {
      _formObject.value = formObj.value;
      func();
    });
}
@@ -194,38 +201,32 @@
      emit('onSubmit', formObj);
    })
    .finally(() => {
      func();
      _formObject.value = formObj.value;
      if (func) func();
    });
}
function submit(formObj, func) {
  // è¡Œæ”¿åŒºåˆ’信息填充
  const a = formObj.value._locations;
  if (a[0]) {
    formObj.value.provincecode = a[0][0];
    formObj.value.provincename = a[0][1];
  }
  if (a[1]) {
    formObj.value.citycode = a[1][0];
    formObj.value.cityname = a[1][1];
  }
  if (a[2]) {
    formObj.value.districtcode = a[2][0];
    formObj.value.extension1 = a[2][1];
  }
  if (a[3]) {
    formObj.value.towncode = a[3][0];
    formObj.value.townname = a[3][1];
  }
  // const a = formObj.value._locations;
  // if (a[0]) {
  //   formObj.value.provincecode = a[0][0];
  //   formObj.value.provincename = a[0][1];
  // }
  // if (a[1]) {
  //   formObj.value.citycode = a[1][0];
  //   formObj.value.cityname = a[1][1];
  // }
  // if (a[2]) {
  //   formObj.value.districtcode = a[2][0];
  //   formObj.value.extension1 = a[2][1];
  // }
  // if (a[3]) {
  //   formObj.value.towncode = a[3][0];
  //   formObj.value.townname = a[3][1];
  // }
  // ç”¨æˆ·ç±»åž‹ä¿¡æ¯å¡«å……
  const b = formObj.value._usertype;
  formObj.value.usertypeid = b.value;
  formObj.value.usertype = b.label;
  // åœºæ™¯ç±»åž‹ä¿¡æ¯å¡«å……
  const c = formObj.value._scenetype;
  formObj.value.extension2 = c.value;
  parseUserInfoReverse(formObj);
  return props.create ? createUser(formObj, func) : updateUser(formObj, func);
}
@@ -238,6 +239,7 @@
  () => props.formInfo,
  (nValue) => {
    _formInfo.value = parseUserInfo(nValue);
    _formObject.value = _formInfo.value;
  }
);
@@ -245,5 +247,21 @@
  emit('update:isEdit', nValue);
});
// é‡ç½®å¯†ç 
const pwLoading = ref(false);
function onResetPw() {
  useMessageBoxTip({
    confirmMsg: '是否重置该场景密码?',
    confirmTitle: '重置密码',
    onConfirm: async () => {
      pwLoading.value = true
      _formObject.value.password = '123456';
      await updateUser(_formObject);
      pwLoading.value = false
    }
  });
}
</script>