jiangping
2024-06-19 c5d6ccdcdad3837bf84313549e61410721533bf3
提交一把
已添加1个文件
已修改4个文件
144 ■■■■ 文件已修改
company/.env.developmentCom 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/public/template/personnel_add.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/common/upload.vue 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/src/components/enterprise/importEmployees.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/company/src/main/java/com/doumee/api/business/MemberController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company/.env.developmentCom
@@ -8,7 +8,6 @@
VUE_APP_COOKIE_NAME='doumee-auth-token'
# VUE_APP_API = 'https://dmtest.ahapp.net/yyb_admin_api/'
#VUE_APP_API = 'http://localhost:10031/'
VUE_APP_API = 'http://192.168.0.135:10031/'
VUE_APP_API = 'http://localhost:10031/'
#VUE_APP_API = 'http://192.168.0.135:10031/'
#VUE_APP_API = 'https://www.yyb.red/yyb_web_api/'
company/public/template/personnel_add.xlsx
Binary files differ
company/src/components/common/upload.vue
@@ -17,74 +17,82 @@
</template>
<script>
    import axios from 'axios';
    export default {
        props: {
            width: {
                type: String,
                default: '90px'
            },
            height: {
                type: String,
                default: '90px'
            },
            list: {
                type: Array,
                default: []
            },
            accept: {
                type: String,
                default: ''
            },
            folder: {
                type: String,
                default: ''
            }
        },
        data() {
            return {
                uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload'
            }
        },
        methods: {
            fileType(url) {
                if (url.indexOf('.mp4') !== -1) {
                    return 'video'
                } else {
                    return 'img'
                }
            },
            getFile(e) {
                if (e.target && e.target.files.length > 0) {
                    this.$emit('loading')
                    const formdate = new FormData()
                    formdate.append('file', e.target.files[0])
                    formdate.append('folder', this.folder)
                    axios.post(this.uploadImgUrl, formdate)
                        .then(res => {
                            this.$emit('success', res.data.data)
                        })
                        .catch(e => {
                            this.$message.error(e)
                        })
                        .finally(() => {
                            this.$refs.file.value = null
                        })
                }
            },
            deleItem(index) {
                this.$emit('dele', index)
            }
        }
import axios from 'axios'
export default {
  props: {
    width: {
      type: String,
      default: '90px'
    },
    height: {
      type: String,
      default: '90px'
    },
    list: {
      type: Array,
      default: []
    },
    accept: {
      type: String,
      default: ''
    },
    folder: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload'
    }
  },
  methods: {
    fileType (url) {
      if (url.indexOf('.mp4') !== -1) {
        return 'video'
      } else {
        return 'img'
      }
    },
    getFile (e) {
      if (e.target && e.target.files.length > 0) {
        this.$emit('loading')
        const formdate = new FormData()
        formdate.append('file', e.target.files[0])
        formdate.append('folder', this.folder)
        axios.post(this.uploadImgUrl, formdate)
          .then(res => {
            this.$emit('success', res.data.data)
          })
          .catch(e => {
            this.$message.error(e)
          })
          .finally(() => {
            this.$refs.file.value = null
          })
      }
    },
    deleItem (index) {
      this.$emit('dele', index)
    }
  }
}
</script>
<style lang="scss" scoped>
    .file {
        /*width: 100%;*/
        /*height: 90px;*/
        margin: 10px 0;
      padding: 10px;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: relative;
      margin-bottom: 10px;
      /* margin-right: 20px; */
       /* margin: 10px 0;*/
        input {
            opacity: 0;
        }
@@ -138,4 +146,3 @@
        }
    }
</style>
company/src/components/enterprise/importEmployees.vue
@@ -60,9 +60,11 @@
    exportTemplate () {
      // 投保申请
      if (this.type === 1) {
        window.open(process.env.VUE_APP_MEMBER1_URL)
        window.open('/template/personnel_add.xlsx')
        // window.open(process.env.VUE_APP_MEMBER1_URL)
      } else {
        window.open(process.env.VUE_APP_MEMBER_URL)
        window.open('/template/personnel_add.xlsx')
        // window.open(process.env.VUE_APP_MEMBER_URL)
      }
    },
    clickRef () {
server/company/src/main/java/com/doumee/api/business/MemberController.java
@@ -120,7 +120,7 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class),
    })
    @RequiresPermissions("business:worktype:create")
    @RequiresPermissions("business:member:importExcel")
    public ApiResponse<List<MemberImport>> importExcel (@ApiParam(value = "file") MultipartFile file,Integer  solutionId) {
        return ApiResponse.success(memberService.importBatch(file,solutionId));
    }