linwe
2024-05-24 49206cb6c017bf537fa7c9ccf2d227796038834f
从业人员导入优化
3 files modified
212 ■■■■■ changed files
src/views/cGovernance/taskECallTwo/index.vue 4 ●●●● patch | view | raw | blame | history
src/views/place/index.vue 202 ●●●●● patch | view | raw | blame | history
src/views/place/tenanthold.vue 6 ●●●●● patch | view | raw | blame | history
src/views/cGovernance/taskECallTwo/index.vue
@@ -471,9 +471,9 @@
            //经纬度替换
            this.form.sceneGeoLat = arr[1]
            this.form.sceneGeoLng = arr[0]
            this.form.location = arr[2]
          }
        },
        immediate: true,
      },
      "editForm.sceneGeo": {
@@ -490,9 +490,9 @@
            //经纬度替换
            this.editForm.sceneGeoLat = arr[1]
            this.editForm.sceneGeoLng = arr[0]
            this.editForm.location = arr[2]
          }
        },
        immediate: true,
      },
    },
    computed: {
src/views/place/index.vue
@@ -1,10 +1,9 @@
<template>
    <basic-container>
        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.place_delete"
@@ -16,6 +15,11 @@
                <el-button type="warning" size="small" plain v-if="permission.place_export" icon="el-icon-download"
                    @click="handleExport">导出
                </el-button>
        <el-button type="success" size="small" plain v-if="permission.place_import" icon="el-icon-upload2"
          @click="handlePractitionerImport">从业人员导入
        </el-button>
            </template>
            <template slot-scope="{row}" slot="location">
                <span v-text="showLocation(row.location)"></span>
@@ -77,6 +81,17 @@
                </template>
            </avue-form>
        </el-dialog>
    <el-dialog title="从业人员数据导入" append-to-body :visible.sync="excelBoxPractitioner" width="555px">
      <avue-form :option="excelPractitionerOption" v-model="excelPractitionerForm"
        :upload-after="uploadPractitionerAfter">
        <template slot="excelTemplate">
          <el-button size="small" type="primary" @click="handlePractitionerTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog>
    </basic-container>
</template>
@@ -129,6 +144,54 @@
        }
        return {
        excelPractitionerOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              label: '模板上传',
              prop: 'excelFile',
              type: 'upload',
              drag: true,
              loadText: '模板上传中,请稍等',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              tip: '请上传 .xls,.xlsx 标准格式文件',
              action: "/api/blade-placePractitioner/placePractitioner/import-practitioner"
            },
            {
              label: "数据覆盖",
              prop: "isCovered",
              type: "switch",
              align: "center",
              width: 80,
              dicData: [{
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                }
              ],
              value: 0,
              slot: true,
              rules: [{
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur"
              }]
            },
            {
              label: '模板下载',
              prop: 'excelTemplate',
              formslot: true,
              span: 24,
            }
          ]
        },
        excelPractitionerForm: {},
            excelOption: {
                submitBtn: false,
                emptyBtn: false,
@@ -143,7 +206,7 @@
                        res: 'data'
                    },
                    tip: '请上传 .xls,.xlsx 标准格式文件',
                    action: "/api/blade-household/household/import-household"
              action: "/api/blade-place/place/import-place"
                },
                {
                    label: "数据覆盖",
@@ -178,6 +241,7 @@
            },
            excelForm: {}, 
            excelBox: false,
        excelBoxPractitioner: false,
            form: {},
            query: {},
            loading: true,
@@ -208,8 +272,7 @@
                selection: true,
                dialogClickModal: false,
                menuFixed: 'right',
                column: [
                    {
          column: [{
                        width: 156,
                        overHidden: true,
                        label: "场所名称",
@@ -245,12 +308,10 @@
                        search: true,
                        searchSpan: 4,
                        slot: true,
                        rules: [
                            {
              rules: [{
                                validator: validatorPhone,
                                trigger: 'blur'
                            }
                        ],
              }],
                    },
                    {
                        width: 120,
@@ -260,13 +321,11 @@
                        // search: true,
                        searchSpan: 4,
                        slot: true,
                        rules: [
                            {
              rules: [{
                                required: false,
                                message: "请输身份证号",
                                trigger: "blur",
                            }
                        ],
              }],
                    },
                    {
                        width: 110,
@@ -288,13 +347,11 @@
                        prop: "neiName",
                        search: true,
                        searchSpan: 4,
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择所属社区",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        hide: true,
@@ -310,13 +367,11 @@
                            value: "id",
                        },
                        cascader: ["gridCode"],
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择所属社区",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        width: 110,
@@ -326,13 +381,11 @@
                        editDisplay: false,
                        viewDisplay: false,
                        prop: "gridName",
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择所属网格",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        hide: true,
@@ -344,15 +397,12 @@
                            label: "gridName",
                            value: "gridCode",
                        },
                        dicUrl:
                            "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
                        rules: [
                            {
              dicUrl: "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
              rules: [{
                                required: true,
                                message: "请选择所属网格",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        span: 7,
@@ -392,8 +442,7 @@
                        label: "标签颜色",
                        prop: "color",
                        type: "select",
                        dicData: [
                            {
              dicData: [{
                                label: '绿',
                                value: 'green'
                            }, {
@@ -402,8 +451,7 @@
                            }, {
                                label: '红',
                                value: 'red'
                            }
                        ],
              }],
                        props: {
                            label: "label",
                            value: "value"
@@ -415,8 +463,7 @@
                        label: "九小场所",
                        prop: "isNine",
                        type: "select",
                        dicData: [
                            {
              dicData: [{
                                label: "是",
                                value: 1,
                            },
@@ -426,13 +473,11 @@
                            }
                        ],
                        hide: true,
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择九小场所",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        span: 12,
@@ -453,8 +498,7 @@
                        label: "阵地",
                        prop: "isFront",
                        type: "select",
                        dicData: [
                            {
              dicData: [{
                                label: "是",
                                value: 1,
                            },
@@ -464,13 +508,11 @@
                            }
                        ],
                        hide: true,
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择阵地",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        span: 12,
@@ -536,13 +578,11 @@
                        minWidth: 250,
                        span: 24,
                        value: [117.966460, 28.431002, ""],
                        rules: [
                            {
              rules: [{
                                required: true,
                                message: "请选择地址",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        label: "备注",
@@ -550,13 +590,11 @@
                        type: 'textarea',
                        hide: true,
                        span: 24,
                        rules: [
                            {
              rules: [{
                                required: false,
                                message: "请输入场所备注",
                                trigger: "blur",
                            },
                        ],
              }, ],
                    },
                    {
                        width: 96,
@@ -587,8 +625,7 @@
                        prop: 'confirmFlag',
                        type: 'radio',
                        slot: true,
                        dicData: [
                            {
              dicData: [{
                                label: '待审核',
                                value: 1
                            }, {
@@ -597,8 +634,7 @@
                            }, {
                                label: '未通过',
                                value: 3
                            }
                        ]
              }]
                    },
                    {
                        width: 120,
@@ -610,15 +646,13 @@
                        search: true,
                        searchSpan: 5,
                        slot: true,
                        dicData: [
                            {
              dicData: [{
                                label: '是',
                                value: 1
                            }, {
                                label: '否',
                                value: 2
                            }
                        ]
              }]
                    }
                ],
            },
@@ -634,7 +668,10 @@
        }
    },
    components: { auditBase, baseAllInfo },
    components: {
      auditBase,
      baseAllInfo
    },
    watch: {
        'form.isNine': {
@@ -673,6 +710,14 @@
            if (this.excelForm.isCovered !== '') {
                const column = this.findObject(this.excelOption.column, "excelFile")
                column.action = `/api/blade-place/place/import-place?isCovered=${this.excelForm.isCovered}`
        }
      },
      'excelPractitionerForm.isCovered'() {
        if (this.excelForm.isCovered !== '') {
          const column = this.findObject(this.excelPractitionerForm.column, "excelFile")
          column.action =
            `/api/blade-placePractitioner/placePractitioner/import-practitioner?isCovered=${this.excelPractitionerForm.isCovered}`
            }
        }
    },
@@ -926,11 +971,25 @@
                this.$refs.crud && this.$refs.crud.toggleSelection()
            })
        },
      handlePractitionerImport() {
        this.excelBoxPractitioner = true
      },
        handleImport() {
            this.excelBox = true
        },
        uploadAfter(res, done, loading, column) {
            this.excelBox = false
        this.onLoad(this.page)
        this.$message({
          type: "success",
          message: res
        })
        this.$refs.crud.toggleSelection()
        done()
      },
      uploadPractitionerAfter(res, done, loading, column) {
        this.excelBoxPractitioner = false
            this.onLoad(this.page)
            this.$message({
                type: "success",
@@ -961,6 +1020,14 @@
        handleTemplate() {
            exportBlob(`/api/blade-place/place/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
                downloadXls(res.data, "场所数据模板.xlsx")
        })
      },
      handlePractitionerTemplate() {
        exportBlob(
            `/api/blade-placePractitioner/placePractitioner/export-practitioner-template?${this.website.tokenHeader}=${getToken()}`
          )
          .then(res => {
            downloadXls(res.data, "从业人员数据模板.xlsx")
            })
        },
        handleDelete() {
@@ -994,7 +1061,8 @@
                    this.form.location = [this.form.lng, this.form.lat, this.form.location].join(',')
                    if (this.form.imageUrls.length) {
                        this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website.minioUrl + item).join(',')
              this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website
                .minioUrl + item).join(',')
                    }
                    if (this.form.placePoiLabelVOList.length) {
src/views/place/tenanthold.vue
@@ -748,7 +748,8 @@
          }
          data = Qs.stringify(data)
          exportBlob(
            `/api/blade-household/household/export-household?${this.website.tokenHeader}=${getToken()}&` + data
            `/api/blade-household/household/export-tenant-household?${this.website.tokenHeader}=${getToken()}&` +
            data
          ).then(res => {
            downloadXls(res.data, `租客数据表${dateNow()}.xlsx`)
            NProgress.done()
@@ -757,7 +758,8 @@
      },
      handleTemplate() {
        exportBlob(
          `/api/blade-household/household/export-template?isTenant=1&${this.website.tokenHeader}=${getToken()}`).then(
          `/api/blade-household/household/export-tenant-template?isTenant=1&${this.website.tokenHeader}=${getToken()}`
          ).then(
          res => {
            downloadXls(res.data, "租客数据模板.xlsx")
          })