| | |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showUnitForm(scope.row,'编辑')">编辑</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button> |
| | | <!-- <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button>--> |
| | | <el-button type="text" style="color: red" @click="addBlack(scope.row)">黑名单</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <br> |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="unitFormVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="40%"> |
| | | <el-form ref="dataForm" :rules="unitFormRules" :model="unitForm" label-position="right" label-width="100px" style="margin-left:50px;width:500px;"> |
| | | <el-form-item label="单位名称"> |
| | | <el-form ref="unitForm" :rules="unitFormRules" :model="unitForm" label-position="right" label-width="100px" style="margin-left:50px;width:500px;"> |
| | | <el-form-item label="单位名称" prop="company"> |
| | | <el-input v-model="unitForm.company"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="单位代码"> |
| | | <el-form-item label="单位代码" prop="code"> |
| | | <el-input v-model="unitForm.code"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="是否为主体单位:" prop="ismain"> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="联系人"> |
| | | <el-form-item label="联系人" prop="contactname"> |
| | | <el-input v-model="unitForm.contactname"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系电话"> |
| | | <el-form-item label="联系电话" prop="contactphone"> |
| | | <el-input v-model="unitForm.contactphone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="省"> |
| | |
| | | company:'', |
| | | code:'', |
| | | unitFormVisible:false, |
| | | unitFormRules:{}, |
| | | unitForm:{ |
| | | id:'', |
| | | company:'', |
| | |
| | | town:'', |
| | | committee:'', |
| | | isbanned:'', |
| | | }, |
| | | unitFormRules:{ |
| | | company: [{ required: true, message: '单位名称不能为空', trigger: 'change' }], |
| | | code: [{ required: true, message: '单位代码不能为空', trigger: 'change' }], |
| | | ismain: [{ required: true, message: '是否为主体单位不能为空', trigger: 'blur' }], |
| | | contactname: [{ required: true, message: '联系人不能为空', trigger: 'change' }], |
| | | contactphone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }], |
| | | }, |
| | | provinceList:[], |
| | | cityList:[], |
| | |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | params['isMain'] = false |
| | | let res = await getUnitList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | |
| | | }, |
| | | showUnitForm(value,type){ |
| | | this.unitFormVisible = true |
| | | this.$nextTick(() =>{ |
| | | this.$refs["unitForm"].clearValidate() |
| | | }) |
| | | if(type === '新增'){ |
| | | this.title = '新增' |
| | | this.unitForm = { |
| | |
| | | } |
| | | }, |
| | | submitUnit(){ |
| | | if(this.title === '新增'){ |
| | | addUnit(this.unitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.unitFormVisible = false |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | this.$refs["unitForm"].validate(valid =>{ |
| | | if(valid){ |
| | | if(this.title === '新增'){ |
| | | addUnit(this.unitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.unitFormVisible = false |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | updateUnit(this.unitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.unitFormVisible = false |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | title:'成功', |
| | | message:'编辑成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }else{ |
| | | updateUnit(this.unitForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.unitFormVisible = false |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | title:'成功', |
| | | message:'编辑成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | deleteById(val){ |
| | | this.$confirm('删除此条信息,是否继续','提示',{ |