马宇豪
2024-02-06 6c153ca68080df99f9ec8ad1666413f65b6a5881
src/views/enterprise/basic.vue
@@ -124,6 +124,7 @@
                  <el-button v-if="userType === 1" style="margin-left: 10px;" type="primary" icon="el-icon-download" @click="importUnitCode">导入单位代码</el-button>
                  <el-button v-if="userType === 1" style="margin-left: 10px;" type="primary" icon="el-icon-download" @click="exportUnitCode">导出单位代码</el-button>
                  <el-button type="primary" icon="el-icon-search" @click="queryHandle" />
                  <el-button type="primary" v-if="isShow" icon="el-icon-delete" @click="openDelete">旧企业清除</el-button>
              </div>
          </div>
@@ -242,6 +243,31 @@
              <el-button  type="primary" @click="importHandle()">导入</el-button>
          </div>
      </el-dialog>
      <el-dialog
          :visible.sync="deleteVisible"
          append-to-body
          title="清理企业数据"
          :close-on-click-modal="false"
          @close="resetDelete"
      >
          <el-form
              ref="deleteForm"
              label-position="right"
              label-width="120px"
              style="width:500px;"
              element-loading-text="删除中..."
          >
              <el-form-item label="企业名称:">
                  <el-input v-model.trim="deleteForm.enterprisename" class="carrierLicense_select">
                  </el-input>
              </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
              <el-button @click="deleteVisible = false">取消</el-button>
              <el-button  type="primary" @click="deleteEnter">确认</el-button>
          </div>
      </el-dialog>
      <uploadExcel ref="import" @getinfo="getEnterpriseList"></uploadExcel>
      <div style="clear: both;"></div>
  </div>
@@ -326,6 +352,7 @@
                }
            }
            return {
                deleteVisible: false,
                pageSize: 10,
                recordTotal: 0,
                currentPage: 1,
@@ -412,6 +439,9 @@
                },
                queryForm: {
                    name: ''
                },
                deleteForm: {
                    enterprisename: ''
                },
                dialogFormVisible: false,
                unitCodeVisible:false,
@@ -717,8 +747,22 @@
                })
            },//删除企业
            async deleteEnter(){
                if(this.deleteForm.enterprisename !== ''){
                    await this.deleteByName(this.deleteForm)
                }else{
                    this.$message({
                        type:'warning',
                        message: '请输入企业名称'
                    })
                }
            },
            resetDelete(){
              this.deleteForm = {
                  enterprisename:''
              }
            },
            async deleteByName(row){
                console.log(row,'row')
                this.$confirm('删除此条信息,是否继续','提示',{
                    confirmButtonText:'确定',
                    cancelButtonText:'取消',
@@ -733,6 +777,7 @@
                                duration:2000,
                            })
                            this.getEnterpriseList()
                            this.deleteVisible = false
                        }else{
                            this.$message({
                                type:'warning',
@@ -1041,7 +1086,9 @@
                    this.$refs['dataForm'].clearValidate()
                })
            },
            openDelete(){
              this.deleteVisible = true
            },
            updateHandle() {
                this.$refs['dataForm'].validate((valid) => {
                    const _this = this