| | |
| | | import {getToken} from "../utils/auth"; |
| | | import request from '@/utils/request' |
| | | import { getToken } from '@/utils/auth' |
| | | |
| | | |
| | | export function getBlackList(data){ |
| | | |
| | | export function getBlackList(params) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization':getToken() |
| | | }, |
| | | url:process.env.BASE_API+ '/blackList/list', |
| | | url: process.env.BASE_API + '/blackList', |
| | | method: 'get', |
| | | params:params?params:{} |
| | | }) |
| | | } |
| | | |
| | | export function addBlack(data) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/banCompany', |
| | | method:'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function addBlackList(data){ |
| | | export function deleteBlack(data) { |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization':getToken() |
| | | }, |
| | | url:process.env.BASE_API+ '/blackList/add', |
| | | method:'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function updateBlackList(data){ |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization':getToken() |
| | | }, |
| | | url:process.env.BASE_API+ '/blackList/mod', |
| | | method:'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function deleteBlackList(data){ |
| | | return request({ |
| | | headers:{ |
| | | 'Authorization':getToken() |
| | | }, |
| | | url:process.env.BASE_API+ '/blackList/del?id=' + data, |
| | | url: process.env.BASE_API + '/cancelBan', |
| | | method:'post', |
| | | data |
| | | }) |
对比新文件 |
| | |
| | | import {getToken} from "../utils/auth"; |
| | | import request from '@/utils/request' |
| | | |
| | | |
| | | |
| | | export function getTroubleList(params) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/hiddenDanger/statistics', |
| | | method: 'get', |
| | | params:params?params:{} |
| | | }) |
| | | } |
| | | |
| | | export function getTroubleDetailList(params) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/hiddenDanger/info', |
| | | method: 'get', |
| | | params:params?params:{} |
| | | }) |
| | | } |
| | | |
| | | export function getWorkList(params) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/task/statistics', |
| | | method: 'get', |
| | | params:params?params:{} |
| | | }) |
| | | } |
| | | |
| | | export function getWorkDetailList(params) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/task/info', |
| | | method: 'get', |
| | | params:params?params:{} |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export function importSupplierUser(data) { |
| | | return request({ |
| | | headers: { |
| | | 'Authorization': getToken() |
| | | }, |
| | | url: process.env.BASE_API + '/importSupplierUser', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="company" style="width:200px"> |
| | | </el-input> |
| | | </div> |
| | | <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-plus" @click="showUnitForm('','新增')">新增</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="blackData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column type="index" label="序号" align="center" width="60"/> |
| | | <el-table-column label="单位名称" prop="company" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建人" prop="code" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" prop="contactname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <br> |
| | | </div> |
| | | <el-dialog :title="title" :visible.sync="blackFormVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="40%"> |
| | | <el-form ref="blackForm" :rules="blackFormRules" :model="blackForm" label-position="right" label-width="100px" style="margin-left:50px;width:500px;"> |
| | | <el-form-item label="单位名称" prop="company"> |
| | | <el-input v-model="blackForm.company"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div align="right"> |
| | | <el-button @click="unitFormVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitUnit()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '../../../utils' |
| | | import { addBlack, deleteBlack, getBlackList } from '../../../api/blackList' |
| | | import { getDistrict } from '../../../api/user' |
| | | import { parseError } from '../../../utils/messageDialog' |
| | | import { getCityListData } from '../../../api/area' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | blackData: [], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | title:'', |
| | | company:'', |
| | | code:'', |
| | | blackFormVisible:false, |
| | | blackFormRules:{company: [{ required: true, message: '单位名称不能为空', trigger: 'blur' }],}, |
| | | blackForm:{ |
| | | id:'', |
| | | company:'', |
| | | |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getBlackData() |
| | | this.getProvince() |
| | | }, |
| | | methods: { |
| | | async getBlackData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | let res = await getBlackList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.blackData = res.data.result.result |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | | type:'warning' |
| | | }) |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | showUnitForm(value,type){ |
| | | this.blackFormVisible = true |
| | | if(type === '新增'){ |
| | | this.title = '新增' |
| | | this.blackForm = { |
| | | id:'', |
| | | company:'', |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.blackForm = value |
| | | } |
| | | }, |
| | | submitUnit(){ |
| | | addBlack(this.blackForm).then((res)=>{ |
| | | if(res.data.code === '200'){ |
| | | this.blackFormVisible = false |
| | | this.getBlackData() |
| | | this.$notify({ |
| | | type:'success', |
| | | duration:2000, |
| | | message:'新增成功', |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | deleteById(val){ |
| | | this.$confirm('取消拉黑,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | deleteBlack({company:val.company}).then( ()=>{ |
| | | this.getBlackData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getBlackData() |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getBlackData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getBlackData() |
| | | }, |
| | | |
| | | getProvince(){ |
| | | const params = {} |
| | | params['parenttype'] = 0 |
| | | params['type'] = 1 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.provinceList = res.result; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | async changeArea(value){ |
| | | if(value === 'province'){ |
| | | this.unitForm.city = '' |
| | | this.unitForm.area = '' |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 2, |
| | | parenttype: 1, |
| | | parentname: this.unitForm.province, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.cityList = res.data.result |
| | | } |
| | | }else if(value === 'city'){ |
| | | this.unitForm.area = '' |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 3, |
| | | parenttype: 2, |
| | | parentname: this.unitForm.city, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.districtList = res.data.result |
| | | } |
| | | }else if(value === 'area'){ |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 4, |
| | | parenttype: 3, |
| | | parentname: this.unitForm.area, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.streetList = res.data.result |
| | | } |
| | | }else if(value === 'town'){ |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 5, |
| | | parenttype: 4, |
| | | parentname: this.unitForm.town, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.committeeList = res.data.result |
| | | } |
| | | } |
| | | },//市、镇、街道、委员会 |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog :title="title" :visible.sync="troubleDetailVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="70%"> |
| | | <div class="app-container"> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="troubleDetailData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column type="index" label="序号" align="center" width="80"/> |
| | | <el-table-column label="状态" prop="status" align="center" /> |
| | | <el-table-column label="作业编号" prop="taskcode" align="center" /> |
| | | <el-table-column label="隐患等级" prop="level" align="center" > |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="scope.row.level == '紧急'?'danger':'warning'">{{scope.row.level}}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="上报人" prop="requestor" align="center" /> |
| | | <el-table-column label="负责人" prop="principal" align="center" /> |
| | | <el-table-column label="整改人" prop="supervisor" align="center" /> |
| | | <el-table-column label="创建时间" prop="createtime" align="center" /> |
| | | <el-table-column label="图片" align="center" > |
| | | <template slot-scope="scope"> |
| | | <el-popover placement="top-start" trigger="click"> |
| | | <img slot="reference" v-for="(item,index) in scope.row.reportResources" :src="item.url" :key="index" style="width:40px;height:40px;margin-left:10px;cursor:pointer" @click="reportResources(item)"></img> |
| | | </el-popover> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <br> |
| | | </div> |
| | | <el-dialog :visible.sync="dialogVisible" :append-to-body="true"> |
| | | <img width="100%" :src="dialogImageUrl" alt=""> |
| | | </el-dialog> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { getTroubleDetailList } from '../../../../../api/troubleStatistics' |
| | | import { computePageCount } from '../../../../../utils' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | troubleDetailData: [], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | title:'', |
| | | company:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | troubleDetailVisible:false, |
| | | dialogImageUrl:'', |
| | | dialogVisible:false, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | showTroubleDetail(company,starttime,endtime){ |
| | | this.troubleDetailVisible = true |
| | | this.starttime = starttime |
| | | this.endtime = endtime |
| | | this.company = company |
| | | this.getTroubleData() |
| | | }, |
| | | async getTroubleData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | params['starttime'] = this.starttime |
| | | params['endtime'] = this.endtime |
| | | let res = await getTroubleDetailList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.troubleDetailData = res.data.result.result |
| | | for(let i=0;i<this.troubleDetailData.length;i++){ |
| | | if(this.troubleDetailData[i].reportResources.length != 0) { |
| | | for (let j = 0; j < this.troubleDetailData[i].reportResources.length; j++) { |
| | | this.troubleDetailData[i].reportResources[j].url = process.env.IMG_API + this.troubleDetailData[i].reportResources[j].url |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | reportResources(file){ |
| | | this.dialogImageUrl = file.url; |
| | | this.dialogVisible = true; |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getTroubleData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getTroubleData() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="company" style="width:200px"> |
| | | </el-input> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>开始时间:</span> |
| | | <el-date-picker |
| | | v-model="starttime" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="开始时间"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>结束时间:</span> |
| | | <el-date-picker |
| | | v-model="endtime" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="开始时间"> |
| | | </el-date-picker> |
| | | </div> |
| | | <el-button style="margin-left: 10px;" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="troubleData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="单位名称" prop="constructionunit" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="隐患数量" prop="countNum" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showTroubleDetail(scope.row)">详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <br> |
| | | <trouble-detail ref="troubleDetail"></trouble-detail> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import troubleDetail from './components/troubleDetail/index' |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '../../../utils' |
| | | import { getTroubleList, } from '../../../api/troubleStatistics' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | components:{ |
| | | troubleDetail |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | troubleData: [], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | company:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTroubleData() |
| | | }, |
| | | methods: { |
| | | async getTroubleData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | params['starttime'] = this.starttime |
| | | params['endtime'] = this.endtime |
| | | let res = await getTroubleList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.troubleData = res.data.result.result |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | | type:'warning' |
| | | }) |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | showTroubleDetail(val){ |
| | | this.$refs.troubleDetail.showTroubleDetail(val.constructionunit,this.starttime,this.endtime) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getTroubleData() |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getTroubleData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getTroubleData() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="company" style="width:200px"> |
| | | </el-input> |
| | | </div> |
| | | <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-plus" @click="showUnitForm('','新增')">新增</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="unitData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="单位名称" prop="company" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="单位代码" prop="code" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="是否为主体单位" prop="ismain" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.ismain | parseMain}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="联系人" prop="contactname" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="联系电话" prop="contactphone" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="地址" prop="address" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div> |
| | | <span>{{scope.row.province}}</span> |
| | | <span v-if="scope.row.city !== null && scope.row.city !== '' && scope.row.province !== undefined">{{"-" + scope.row.city}}</span> |
| | | <span v-if="scope.row.area !== null && scope.row.area !== '' && scope.row.city !== undefined">{{"-" + scope.row.area}}</span> |
| | | <span v-if="scope.row.town !== null && scope.row.town !== '' && scope.row.town !== undefined">{{"-" + scope.row.town}}</span> |
| | | <span v-if="scope.row.committee !== null && scope.row.committee !== '' && scope.row.committee !== undefined">{{"-" + scope.row.committee}}</span> |
| | | </div> |
| | | <div></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建者" prop="createdby" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" prop="createddate" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="是否黑名单" prop="isbanned" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.isbanned | parseIsBanned }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <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="addBlack(scope.row)">黑名单</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <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-input v-model="unitForm.company"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="单位代码"> |
| | | <el-input v-model="unitForm.code"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="是否为主体单位:" prop="ismain"> |
| | | <el-select v-model.trim="unitForm.ismain" auto-complete="on" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in isMainList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="联系人"> |
| | | <el-input v-model="unitForm.contactname"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系电话"> |
| | | <el-input v-model="unitForm.contactphone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="省"> |
| | | <el-select v-model="unitForm.province" clearable filterable @change="changeArea('province')" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in provinceList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="市"> |
| | | <el-select v-model="unitForm.city" prop="city" clearable filterable @change="changeArea('city')" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in cityList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="区"> |
| | | <el-select v-model="unitForm.area" clearable filterable @change="changeArea('area')" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in districtList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="街道"> |
| | | <el-select v-model="unitForm.town" clearable filterable @change="changeArea('town')" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in streetList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="居委会"> |
| | | <el-select v-model="unitForm.community" clearable filterable style="width:100%;"> |
| | | <el-option |
| | | v-for="item in committeeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div align="right"> |
| | | <el-button @click="unitFormVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="submitUnit()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '../../../utils' |
| | | import { addUnit, deleteUnit, getUnitList, updateUnit } from '../../../api/unitManage' |
| | | import { getDistrict } from '../../../api/user' |
| | | import { parseError } from '../../../utils/messageDialog' |
| | | import { getCityListData } from '../../../api/area' |
| | | import { addBlack } from '../../../api/blackList' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | parseIsBanned(value){ |
| | | if(value === 1){ |
| | | return "是" |
| | | }else if(value === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | unitData: [], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | title:'', |
| | | company:'', |
| | | code:'', |
| | | unitFormVisible:false, |
| | | unitFormRules:{}, |
| | | unitForm:{ |
| | | id:'', |
| | | company:'', |
| | | code:'', |
| | | contactname:'', |
| | | contactphone:'', |
| | | province:'', |
| | | city:'', |
| | | area:'', |
| | | town:'', |
| | | committee:'', |
| | | isbanned:'', |
| | | }, |
| | | provinceList:[], |
| | | cityList:[], |
| | | districtList:[], |
| | | committeeList:[], |
| | | streetList:[], |
| | | isMainList:[{id:1,name:'是'},{id:0,name:'否'}], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getUnitData() |
| | | this.getProvince() |
| | | }, |
| | | methods: { |
| | | async getUnitData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | let res = await getUnitList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.unitData = res.data.result.result |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | | type:'warning' |
| | | }) |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | showUnitForm(value,type){ |
| | | this.unitFormVisible = true |
| | | if(type === '新增'){ |
| | | this.title = '新增' |
| | | this.unitForm = { |
| | | id:'', |
| | | company:'', |
| | | code:'', |
| | | contactname:'', |
| | | contactphone:'', |
| | | province:'', |
| | | city:'', |
| | | area:'', |
| | | town:'', |
| | | committee:'', |
| | | isbanned:'', |
| | | } |
| | | }else{ |
| | | this.title = '修改' |
| | | this.unitForm = value |
| | | } |
| | | }, |
| | | 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:'成功' |
| | | }) |
| | | }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 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | deleteById(val){ |
| | | this.$confirm('删除此条信息,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | deleteUnit({id:val.id}).then( ()=>{ |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | addBlack(val){ |
| | | this.$confirm('将此单位添加黑名单,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | addBlack({company:val.company}).then( ()=>{ |
| | | this.getUnitData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getUnitData() |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getUnitData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getUnitData() |
| | | }, |
| | | |
| | | getProvince(){ |
| | | const params = {} |
| | | params['parenttype'] = 0 |
| | | params['type'] = 1 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.provinceList = res.result; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | async changeArea(value){ |
| | | if(value === 'province'){ |
| | | this.unitForm.city = '' |
| | | this.unitForm.area = '' |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 2, |
| | | parenttype: 1, |
| | | parentname: this.unitForm.province, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.cityList = res.data.result |
| | | } |
| | | }else if(value === 'city'){ |
| | | this.unitForm.area = '' |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 3, |
| | | parenttype: 2, |
| | | parentname: this.unitForm.city, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.districtList = res.data.result |
| | | } |
| | | }else if(value === 'area'){ |
| | | this.unitForm.town = '' |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 4, |
| | | parenttype: 3, |
| | | parentname: this.unitForm.area, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.streetList = res.data.result |
| | | } |
| | | }else if(value === 'town'){ |
| | | this.unitForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 5, |
| | | parenttype: 4, |
| | | parentname: this.unitForm.town, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.committeeList = res.data.result |
| | | } |
| | | } |
| | | },//市、镇、街道、委员会 |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | :visible.sync="workLicenseDialog" |
| | | :close-on-click-modal="false" |
| | | title="工作证" |
| | | width="60%" |
| | | > |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <el-button type="primary" @click="showLicenseForm('','新增')">新增</el-button> |
| | | <el-button type="primary" icon="el-icon-search">查询</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table :data="workLicenseData" v-loading="listLoading" :key="tableKey" fit border highlight-current-row style="width: 100%;"> |
| | | <el-table-column type="index" label="" align="center" width="60"/> |
| | | <el-table-column label="姓名" prop="realname" align="center" sortable="custom"> |
| | | </el-table-column> |
| | | <el-table-column label="手机号" prop="mobile" align="center" sortable="custom"> |
| | | </el-table-column> |
| | | <el-table-column label="身份证" prop="idcard" align="center" sortable="custom"> |
| | | </el-table-column> |
| | | <el-table-column label="特殊作业工种" prop="branch" align="center" sortable="custom"> |
| | | </el-table-column> |
| | | <el-table-column label="特殊作业证件号" prop="certname" align="center" sortable="custom"> |
| | | </el-table-column> |
| | | <el-table-column label="文件路径" prop="certpath" align="center" sortable="custom"> |
| | | <template slot-scope="scope"> |
| | | <a :href="baseUrl+scope.row.certpath" target="_blank">{{baseUrl+scope.row.url}}</a> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="有效期开始时间" prop="starttime" align="center" > |
| | | </el-table-column> |
| | | <el-table-column label="有效期结束时间" prop="endtime" align="center" > |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showLicenseForm(scope.row,'编辑')">编辑</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | :visible.sync="LicenseFormDialog" |
| | | :close-on-click-modal="false" |
| | | :append-to-body="true" |
| | | :title="title" |
| | | width="30%" |
| | | > |
| | | <el-form ref="licenseForm" :rules="licenseRules" :model="licenseForm" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中..."> |
| | | <el-form-item label="真实姓名:" prop="realname"> |
| | | <el-input v-model.trim="licenseForm.realname" :disabled="true"/> |
| | | </el-form-item> |
| | | <el-form-item label="联系方式:" prop="mobile"> |
| | | <el-input v-model.trim="licenseForm.mobile" :disabled="true"/> |
| | | </el-form-item> |
| | | <el-form-item label="身份证:" prop="idcard"> |
| | | <el-input v-model.trim="licenseForm.idcard" :disabled="true"/> |
| | | </el-form-item> |
| | | <el-form-item label="特种作业工种:" prop="branch"> |
| | | <el-select v-model.trim="licenseForm.branch"/> |
| | | <el-option |
| | | v-for="item in branchList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | > |
| | | </el-option> |
| | | </el-form-item> |
| | | <el-form-item label="特种作业证件号:" prop="certname"> |
| | | <el-input v-model.trim="licenseForm.certname"/> |
| | | </el-form-item> |
| | | <el-form-item label="有效期开始时间:" prop="starttime"> |
| | | <el-date-picker |
| | | value-format="yyyy-MM-dd" |
| | | v-model="licenseForm.starttime" |
| | | type="date" |
| | | placeholder="选择日期时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="有效期结束时间:" prop="endtime"> |
| | | <el-date-picker |
| | | value-format="yyyy-MM-dd" |
| | | v-model="licenseForm.endtime" |
| | | type="date" |
| | | placeholder="选择日期时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="文件:" prop="upload"> |
| | | <input id="upload" ref="upload" type="file"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="LicenseFormDialog = false">取消</el-button> |
| | | <el-button type="primary" @click="submit()">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { addWorkLicense, deleteWorkLicense, getWorkLicenseList, updateWorkLicense } from '../../../../../api/user' |
| | | import { parseError } from '../../../../../utils/messageDialog' |
| | | import { deleteUnit } from '../../../../../api/unitManage' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | data(){ |
| | | return{ |
| | | baseUrl: process.env.IMG_API, |
| | | title:'', |
| | | tableKey:'', |
| | | mobile:'', |
| | | listLoading:false, |
| | | workLicenseData:[], |
| | | branchList:[{id:1,name:'电工作业'},{id:2,name:'焊接与热切割作业'},{id:3,name:'高处作业'},{id:4,name:'制冷与空调作业'},{id:5,name:'煤矿安全作业'},{id:6,name:'压力容器作业'},{id:7,name:'采掘(剥)作业'},{id:8,name:'矿山提升运输作业'},{id:9,name:'矿山安全检查作业'},{id:10,name:'矿山通风作业'},{id:11,name:'矿山排水作业'},], |
| | | workLicenseDialog:false, |
| | | LicenseFormDialog:false, |
| | | licenseForm:{ |
| | | id:'', |
| | | realname:'', |
| | | mobile:'', |
| | | idcard:'', |
| | | certname:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | branch:'', |
| | | }, |
| | | licenseRules:{ |
| | | |
| | | } |
| | | } |
| | | }, |
| | | methods:{ |
| | | openWorkLicense(row){ |
| | | this.workLicenseDialog = true |
| | | this.licenseForm.realname = row.realname |
| | | this.licenseForm.mobile = row.username |
| | | this.licenseForm.idcard = row.idcard |
| | | this.licenseForm.branch = row.branch |
| | | this.getWorkLicenseData() |
| | | }, |
| | | async getWorkLicenseData(){ |
| | | let res = await getWorkLicenseList(this.licenseForm.mobile) |
| | | if(res.data.code === '200'){ |
| | | this.workLicenseData = res.data.result |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }, |
| | | showLicenseForm(value,type){ |
| | | this.LicenseFormDialog = true |
| | | if(type === '新增'){ |
| | | this.licenseForm.certname = '' |
| | | this.licenseForm.starttime = '' |
| | | this.licenseForm.endtime = '' |
| | | this.licenseForm.branch = '' |
| | | this.title = '新增' |
| | | }else{ |
| | | this.title = '编辑' |
| | | this.licenseForm = value |
| | | } |
| | | }, |
| | | submit(){ |
| | | if(this.title === '新增'){ |
| | | const formData = new FormData(); |
| | | for (const i in this.licenseForm) { |
| | | if ( |
| | | this.licenseForm[i] != undefined && |
| | | this.licenseForm[i].toString() != "" |
| | | ) { |
| | | formData.append(i, this.licenseForm[i]); |
| | | } |
| | | } |
| | | if(this.$refs["upload"].files.length !== 0){ |
| | | formData.append('file', this.$refs["upload"].files[0]) |
| | | } |
| | | addWorkLicense(formData).then(res =>{ |
| | | if(res.data.code === '200'){ |
| | | this.LicenseFormDialog = false |
| | | this.getWorkLicenseData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'新增成功', |
| | | duration:2000, |
| | | type:'success' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: this }) |
| | | }) |
| | | }else{ |
| | | const formData = new FormData(); |
| | | for (const i in this.licenseForm) { |
| | | if ( |
| | | this.licenseForm[i] != undefined && |
| | | this.licenseForm[i].toString() != "" |
| | | ) { |
| | | formData.append(i, this.licenseForm[i]); |
| | | } |
| | | } |
| | | if(this.$refs["upload"].files.length !== 0){ |
| | | formData.append('file', this.$refs["upload"].files[0]) |
| | | } |
| | | updateWorkLicense(formData).then(res =>{ |
| | | if(res.data.code === '200'){ |
| | | this.LicenseFormDialog = false |
| | | this.getWorkLicenseData() |
| | | this.$notify({ |
| | | type:'success', |
| | | message:'新增成功', |
| | | duration:2000, |
| | | title:'成功' |
| | | }) |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | | type:'warning' |
| | | }) |
| | | } |
| | | }).catch(error =>{ |
| | | parseError({error:error,vm:this}) |
| | | }) |
| | | } |
| | | }, |
| | | deleteById(row){ |
| | | this.$confirm('删除此条工作证,是否继续','提示',{ |
| | | confirmButtonText:'确定', |
| | | cancelButtonText:'取消', |
| | | type:'warning', |
| | | }).then(()=> { |
| | | deleteWorkLicense({id:row.id}).then( ()=>{ |
| | | this.getWorkLicenseData() |
| | | this.$notify({ |
| | | title:'成功', |
| | | message:'删除成功', |
| | | type:'success', |
| | | duration:2000, |
| | | }) |
| | | }) |
| | | }).catch(error => parseError({error:error, vm:this})) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div> |
| | | <el-form :inline="true" :model="queryForm"> |
| | | <el-form-item label="用户名"> |
| | | <el-input |
| | | v-model="queryForm.username" |
| | | class="filter-item" |
| | | placeholder="" |
| | | style="width: 150px;" |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="单位"> |
| | | <el-input |
| | | v-model="queryForm.company" |
| | | class="filter-item" |
| | | placeholder="" |
| | | style="width: 200px;" |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="部门"> |
| | | <el-input |
| | | v-model="queryForm.department" |
| | | class="filter-item" |
| | | placeholder="" |
| | | style="width: 150px;" |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="职务"> |
| | | <el-input |
| | | v-model="queryForm.job" |
| | | class="filter-item" |
| | | placeholder="" |
| | | style="width: 150px;" |
| | | @keyup.enter.native="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | class="filter-item" |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="queryHandle" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="getBtnPermission('add')" |
| | | v-show="userType != 3" |
| | | class="filter-item" |
| | | style="margin-left: 10px;" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="showCreateHandle" |
| | | >新增</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="getBtnPermission('import')" |
| | | v-show="userType != 3" |
| | | class="filter-item" |
| | | style="margin-left: 10px;" |
| | | type="primary" |
| | | icon="el-icon-upload2" |
| | | @click="showImportHandle" |
| | | >导入</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- <div style="display: block;margin-top: -10px;margin-bottom: 10px">--> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <span>区域:</span>--> |
| | | <!-- <el-select v-model="queryForm.province" clearable filterable @change="changeArea('province')">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in provinceList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <el-select v-model="queryForm.city" prop="city" clearable filterable @change="changeArea('city')">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in cityList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <el-select v-model="queryForm.area" clearable filterable @change="changeArea('area')">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in districtList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <el-select v-model="queryForm.town" clearable filterable @change="changeArea('town')" >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in streetList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="basic_search">--> |
| | | <!-- <el-select v-model="queryForm.community" clearable filterable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in committeeList"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.name"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="userData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | @sort-change="sortUserChange" |
| | | > |
| | | <el-table-column type="index" label="" align="center" width="60"/> |
| | | <el-table-column label="用户名" prop="username" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.username }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="真实姓名" prop="realname" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.realname }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="身份证号" prop="idcard" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.idcard }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="部门" prop="department" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.department }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="职位" prop="job" align="center" sortable="custom" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.job }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="用户类型" prop="type" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.type | parseType}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="角色" prop="role" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.roles | parseRoles }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="人脸数据" prop="code" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.code == null || scope.row.code === '' ?"":"已采集" }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="是否通过考试" prop="ispass" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in isList"> |
| | | <div v-if="item.id === scope.row.ispass"> |
| | | <span>{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="考试合格有效期" prop="starttime" align="center" width="300px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.starttime}}</span> |
| | | <span>-</span> |
| | | <span>{{ scope.row.endtime}}</span> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | <el-table-column label="是否单位负责人" prop="iscompany" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in isList"> |
| | | <div v-if="item.id === scope.row.iscompany"> |
| | | <span>{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="是否部门负责人" prop="isdepartment" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in isList"> |
| | | <div v-if="item.id === scope.row.isdepartment"> |
| | | <span>{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="status" align="center" width="100px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.status | parseStatus }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="更新时间" prop="lastmodifieddate" align="center" sortable="custom">--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <span>{{ scope.row.lastmodifieddate | parseTime('{y}-{m}-{d}') }}</span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showEditHandle(scope.row)">编辑</el-button> |
| | | <el-button type="text" @click="showWorkLicense(scope.row)">查看工作证</el-button> |
| | | <el-button v-show="userType != 3" :disabled="scope.row.type==1" type="text" style="color:red;" @click="deleteHandle(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <el-dialog :title="dialogStatus==='create'?'新增':'编辑'" :visible.sync="dialogFormVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="50%"> |
| | | <el-form ref="dataForm" :rules="dialogStatus==='create'?dataFormRules:rules" :model="dataForm" label-position="right" label-width="150px" style="padding-right: 50px" element-loading-text="保存中..."> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户名(手机号):" prop="username"> |
| | | <el-input v-model.trim="dataForm.username"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="真实姓名:" prop="realname"> |
| | | <el-input v-model.trim="dataForm.realname"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-if="dialogStatus=='create'"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input v-model.trim="dataForm.password" :type="passwordType" placeholder="请输入密码"> |
| | | <el-button slot="append" icon="el-icon-view" @click="showPwd"/> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="确认密码:" prop="confirmPassword"> |
| | | <el-input v-model.trim="dataForm.confirmPassword" :type="confirmPasswordType" placeholder="请输入确认密码" @change="passwordChangeEvent"> |
| | | <el-button slot="append" icon="el-icon-view" @click="showConfirmPwd"/> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <div v-else> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input v-model.trim="dataForm.password" :type="passwordType" placeholder="请输入密码"> |
| | | <el-button slot="append" icon="el-icon-view" @click="showPwd"/> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="确认密码:" prop="confirmPassword"> |
| | | <el-input v-model.trim="dataForm.confirmPassword" :type="confirmPasswordType" placeholder="请输入确认密码" @change="passwordChangeEvent"> |
| | | <el-button slot="append" icon="el-icon-view" @click="showConfirmPwd"/> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="身份证号:" prop="idcard"> |
| | | <el-input v-model.trim="dataForm.idcard"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="邮箱:" prop="email"> |
| | | <el-input v-model.trim="dataForm.email"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单位:" prop="company"> |
| | | <el-select v-model.trim="dataForm.company" auto-complete="on" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in companyList" |
| | | :key="item.id" |
| | | :value="item.company" |
| | | :label="item.company" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部门:" prop="department"> |
| | | <el-select v-model.trim="dataForm.department" auto-complete="on" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in departmentList" |
| | | :key="item.id" |
| | | :value="item.department" |
| | | :label="item.department" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="职务:" prop="job"> |
| | | <el-input v-model.trim="dataForm.job"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户类型:" prop="type"> |
| | | <el-select v-model.trim="dataForm.type" placeholder="请选择用户类型" auto-complete="on" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in typeList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否单位负责人:" prop="iscompany"> |
| | | <el-select v-model.trim="dataForm.iscompany" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in isList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否部门负责人:" prop="isdepartment"> |
| | | <el-select v-model.trim="dataForm.isdepartment" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in isList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态:" prop="status"> |
| | | <el-select v-model.trim="dataForm.status" auto-complete="on" style="width:100%;"> |
| | | <el-option |
| | | v-for="item in statusList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="dialogStatus==='create'?createHandle():updateHandle()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :visible.sync="importDialogFormVisible" |
| | | :modal-append-to-body="false" |
| | | :close-on-click-modal="false" |
| | | title="用户导入" |
| | | width="700px" |
| | | > |
| | | <el-form |
| | | ref="importForm" |
| | | label-position="right" |
| | | label-width="120px" |
| | | style="margin-left:50px;width:500px;" |
| | | element-loading-text="导入中..." |
| | | > |
| | | <el-form-item label="导入文件:"> |
| | | <input ref="importLabInput" type="file" accept=".xls, .xlsx" > |
| | | </el-form-item> |
| | | <el-form-item label="excel参考模板:"> |
| | | <el-button type="text" @click="viewHandle">下载模板</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="importDialogFormVisible = false">取消</el-button> |
| | | <el-button :disabled="importDisabled" type="primary" @click="importHandle()">导入</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <div style="clear: both;"/> |
| | | <workLicense ref="workLicense"></workLicense> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import workLicense from './components/workLicense/index' |
| | | import { mapGetters } from 'vuex' |
| | | import { userList, createUser, deleteUser, updateUser, importUser, importDistrict,getDistrict,getDistrictByName,updateUserRole} from '@/api/user' |
| | | import { checkBtnPermission } from '@/utils/permission' |
| | | import { roleList } from '@/api/role' |
| | | import { parseTime, computePageCount, parseUserType } from '@/utils' |
| | | import { parseError } from '@/utils/messageDialog' |
| | | import Cookies from 'js-cookie' |
| | | import { Message, MessageBox } from 'element-ui' |
| | | import {getCityListData, getProvinceListData} from "@/api/area"; |
| | | import { getAllCompany } from '../../../api/unitManage' |
| | | import { getAllDepartment } from '../../../api/departmentManage' |
| | | import { importSupplierUser } from '../../../api/user' |
| | | const exampleFile = require('@/assets/example/contractoruser.xlsx') |
| | | export default { |
| | | name: 'UserTable', |
| | | filters: { |
| | | parseRoles(roles) { |
| | | if (!roles) { |
| | | return |
| | | } |
| | | let message = '' |
| | | for (const role of roles) { |
| | | message += role.name + ',' |
| | | } |
| | | if (message) { |
| | | message = message.substring(0, message.lastIndexOf(',')) |
| | | } |
| | | return message |
| | | }, |
| | | parseType(type){ |
| | | let typeList = [{id:1,name:'超级管理员'},{id:2,name:'管理员'},{id:3,name:'普通用户'}] |
| | | if(type){ |
| | | let a = typeList.find(item => item.id === type) |
| | | return a.name |
| | | } |
| | | }, |
| | | parseStatus(status){ |
| | | if(status === 1){ |
| | | return "正常" |
| | | }else if(status === 0){ |
| | | return "正常" |
| | | } |
| | | }, |
| | | filterSafety(value) { |
| | | if (value) { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | }, |
| | | filterUserType(value) { |
| | | return parseUserType(value) |
| | | }, |
| | | parseGX(value){ |
| | | let arr = value.split('-'); |
| | | let guanxia=''; |
| | | for (let i = 0; i < arr.length; i++){ |
| | | if (arr[i] == null || arr[i] == '' || arr[i] == 'null'){ |
| | | if (i == 0){ |
| | | guanxia = '全部省份'; |
| | | } |
| | | if (i == 1){ |
| | | guanxia += '-全部城市'; |
| | | } |
| | | if (i == 2){ |
| | | guanxia += '-全部区县'; |
| | | } |
| | | if (i == 3){ |
| | | guanxia += '-全部街道'; |
| | | } |
| | | if (i == 4){ |
| | | guanxia += '-全部居委会'; |
| | | } |
| | | }else { |
| | | if (i == 0){ |
| | | guanxia = arr[i]; |
| | | }else { |
| | | guanxia += '-'+arr[i]; |
| | | } |
| | | } |
| | | } |
| | | return guanxia; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType', |
| | | 'username' |
| | | ]) |
| | | }, |
| | | components:{ |
| | | workLicense |
| | | }, |
| | | data() { |
| | | let _ref = this; |
| | | const validateEmail = (rule, value, callback) => { |
| | | |
| | | if (value == null || value == '') { |
| | | callback() |
| | | } else { |
| | | // 对电子邮件的验证 |
| | | const myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/ |
| | | if (!myreg.test(value)) { |
| | | return callback(new Error('请输入有效的邮箱格式')) |
| | | } |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | return { |
| | | sort:'username', |
| | | order:'asc', |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | tableKey: 0, |
| | | userData: null, |
| | | listLoading: true, |
| | | iscompanyList:[{id:1,name:'否'},{id:0,name:'是'}], |
| | | queryForm: { |
| | | username: '', |
| | | company:'', |
| | | department:'', |
| | | job:'', |
| | | province:'', |
| | | city:'', |
| | | area:'', |
| | | town:'', |
| | | community:'', |
| | | }, |
| | | dataForm: { |
| | | id: '', |
| | | username: '', |
| | | password: '', |
| | | realname:'', |
| | | idcard:'', |
| | | email:'', |
| | | company:'', |
| | | department:'', |
| | | job:'', |
| | | type:'', |
| | | iscompany:'', |
| | | isdepartment:'', |
| | | ispass:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | status:'', |
| | | createdby:'', |
| | | createddate:'', |
| | | lastmodifiedby:'', |
| | | lastmodifieddate:'', |
| | | }, |
| | | importDialogFormVisible: false, |
| | | importDisabled: false, |
| | | dialogFormVisible: false, |
| | | dialogStatus: '', |
| | | dataFormRules: { |
| | | username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }], |
| | | realname: [{ required: true, message: '真实姓名不能为空', trigger: 'blur' }], |
| | | // email: [{ validator: validateEmail, trigger: 'blur' }], |
| | | password: [{ required: true, message: '密码不能为空', trigger: 'blur' }], |
| | | confirmPassword: [{ required: true, message: '确认密码不能为空', trigger: 'blur' }], |
| | | type: [{ required: true, message: '用户类型不能为空', trigger: 'change' }], |
| | | status: [{ required: true, message: '状态不能为空', trigger: 'change' }] |
| | | }, |
| | | rules: { |
| | | username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }], |
| | | realname: [{ required: true, message: '真实姓名不能为空', trigger: 'blur' }], |
| | | // email: [{ validator: validateEmail, trigger: 'blur' }], |
| | | // password: [{ required: true, message: '密码不能为空', trigger: 'blur' }], |
| | | // confirmPassword: [{ required: true, message: '确认密码不能为空', trigger: 'blur' }], |
| | | type: [{ required: true, message: '用户类型不能为空', trigger: 'change' }], |
| | | status: [{ required: true, message: '状态不能为空', trigger: 'change' }] |
| | | }, |
| | | isList:[{id:1,name:'是'},{id:0,name:'否'}], |
| | | typeList:[{id:1,name:'超级管理员'},{id:2,name:'管理员'},{id:3,name:'普通用户'}], |
| | | dialogUserRoleFormVisible: false, |
| | | userRoleDataForm: { |
| | | userRoles: [], |
| | | userId: '' |
| | | }, |
| | | userRoleDataFormRules: { |
| | | userRoles: [{ type: 'array', required: true, message: '角色不能为空', trigger: 'change' }] |
| | | }, |
| | | roleList: [], |
| | | passwordType: 'password', |
| | | confirmPasswordType: 'password', |
| | | templateRadio: '', |
| | | instituteList: [], |
| | | departmentList: [], |
| | | companyList:[], |
| | | statusList:[{id:1,name:'正常'},{id:0,name:'停用'}], |
| | | } |
| | | }, |
| | | created() { |
| | | console.log(this.userType) |
| | | this.getUserList() |
| | | this.getProvince() |
| | | this.getDepartmentData() |
| | | this.getCompanyData() |
| | | }, |
| | | methods: { |
| | | refreshHandle: function() { |
| | | this.getUserList() |
| | | }, |
| | | queryHandle: function() { |
| | | this.currentPage = 1 |
| | | this.getUserList() |
| | | }, |
| | | sortUserChange: function(param) { |
| | | this.sort = param.prop; |
| | | this.order = param.order; |
| | | this.getUserList() |
| | | }, |
| | | getUserList() { |
| | | const _this = this |
| | | const params = {} |
| | | params['sort'] = _this.sort |
| | | params['order'] = _this.order |
| | | params['pageIndex'] = _this.currentPage |
| | | params['pageSize'] = _this.pageSize |
| | | params['type'] = _this.userType |
| | | for (const i in _this.queryForm) { |
| | | if (_this.queryForm[i] != undefined && _this.queryForm[i].toString() != '') { |
| | | params[i] = _this.queryForm[i] |
| | | } |
| | | } |
| | | _this.listLoading = true |
| | | userList(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | const result = res.result |
| | | _this.recordTotal = result.totalCount |
| | | _this.pageSize = result.pageSize |
| | | _this.pageTotal = computePageCount(result.totalCount, result.pageSize) |
| | | _this.currentPage = result.pageIndex |
| | | _this.userData = result.result |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | _this.listLoading = false |
| | | }).catch(error => { |
| | | _this.listLoading = false |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | }, |
| | | |
| | | showWorkLicense(row){ |
| | | this.$refs.workLicense.openWorkLicense(row) |
| | | }, |
| | | |
| | | createHandle: function() { |
| | | this.$refs['dataForm'].validate((valid) => { |
| | | const _this = this |
| | | if (valid) { |
| | | if (_this.dataForm.password != _this.dataForm.confirmPassword) { |
| | | parseError({ error: '密码输入不一致', vm: _this }) |
| | | return |
| | | } |
| | | const userName = Cookies.get('userName') |
| | | _this.dataForm['operator'] = userName |
| | | createUser(_this.dataForm).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | _this.dialogFormVisible = false |
| | | _this.$message({ |
| | | message: '创建成功', |
| | | type: 'success' |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | deleteHandle: function(row) { |
| | | const _this = this |
| | | MessageBox.confirm('确定删除用户' + row.username + '信息', '确定删除', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | _this.deleteAction(row) |
| | | }).catch(() => { |
| | | console.log('已取消删除') |
| | | }) |
| | | }, |
| | | deleteAction: function(row) { |
| | | const _this = this |
| | | const params = {} |
| | | params['id'] = row.id |
| | | const userName = Cookies.get('userName') |
| | | const name = Cookies.get('name') |
| | | params['operator'] = name + '(' + userName + ')' |
| | | deleteUser(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | _this.$message({ |
| | | message: '删除成功', |
| | | type: 'success' |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | }, |
| | | resetDataForm() { |
| | | this.dataForm = { |
| | | id: '', |
| | | username: '', |
| | | password: '', |
| | | realname:'', |
| | | idcard:'', |
| | | email:'', |
| | | company:'', |
| | | department:'', |
| | | job:'', |
| | | type:'', |
| | | iscompany:'', |
| | | isdepartment:'', |
| | | ispass:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | status:'', |
| | | createdby:'', |
| | | createddate:'', |
| | | lastmodifiedby:'', |
| | | lastmodifieddate:'', |
| | | } |
| | | }, |
| | | getDepartmentData(){ |
| | | getAllDepartment().then(res=>{ |
| | | if(res.data.code === '200'){ |
| | | this.departmentList = res.data.result |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }).catch(error =>{ |
| | | parseError({error:error,vm:this}) |
| | | }) |
| | | }, |
| | | getCompanyData(){ |
| | | getAllCompany().then(res=>{ |
| | | if(res.data.code === '200'){ |
| | | this.companyList = res.data.result |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:res.data.message |
| | | }) |
| | | } |
| | | }).catch(error =>{ |
| | | parseError({error:error,vm:this}) |
| | | }) |
| | | }, |
| | | showCreateHandle() { |
| | | this.resetDataForm() |
| | | this.dialogStatus = 'create' |
| | | this.dialogFormVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs['dataForm'].clearValidate() |
| | | }) |
| | | }, |
| | | updateHandle() { |
| | | this.$refs['dataForm'].validate((valid) => { |
| | | const _this = this |
| | | if (valid) { |
| | | if (_this.dataForm.password || _this.dataForm.confirmPassword) { |
| | | if (_this.dataForm.password != _this.dataForm.confirmPassword) { |
| | | parseError({ error: '密码输入不一致', vm: _this }) |
| | | return |
| | | } |
| | | } |
| | | const userName = Cookies.get('userName') |
| | | _this.dataForm['lastmodifiedby'] = userName |
| | | updateUser(_this.dataForm).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | _this.dialogFormVisible = false |
| | | _this.$message({ |
| | | message: '更新成功', |
| | | type: 'success' |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | getRoleList: async function() { |
| | | const _this = this |
| | | const params = {} |
| | | roleList(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | const roleList = res.result |
| | | _this.roleList = roleList |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }) |
| | | }, |
| | | showAssignRole: async function(row) { |
| | | await this.getRoleList() |
| | | |
| | | this.userRoleDataForm.userId = row.id |
| | | |
| | | this.$nextTick(() => { |
| | | const assigedRoles = [] |
| | | if (row.roles) { |
| | | for (const role of row.roles) { |
| | | assigedRoles.push(role.id) |
| | | } |
| | | } |
| | | this.userRoleDataForm.userRoles = assigedRoles |
| | | }) |
| | | this.dialogUserRoleFormVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs['userRoleDataForm'].clearValidate() |
| | | }) |
| | | }, |
| | | assignUserRoleHandle: function() { |
| | | const _this = this |
| | | this.$refs['userRoleDataForm'].validate((valid) => { |
| | | if (valid) { |
| | | const userName = Cookies.get('userName') |
| | | const params = {} |
| | | params['id'] = _this.userRoleDataForm.userId |
| | | params['roles'] = _this.userRoleDataForm.userRoles |
| | | updateUserRole(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | _this.dialogUserRoleFormVisible = false |
| | | _this.$message({ |
| | | message: '角色分配成功', |
| | | type: 'success' |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | showEditHandle: function(row) { |
| | | this.resetDataForm() |
| | | this.dataForm = row |
| | | this.dataForm.password = null |
| | | this.dialogStatus = 'update' |
| | | this.dialogFormVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs['dataForm'].clearValidate() |
| | | }) |
| | | |
| | | }, |
| | | passwordChangeEvent: function(value) { |
| | | if (this.dataForm.password != value) { |
| | | parseError({ error: '密码输入不一致', vm: this }) |
| | | } |
| | | }, |
| | | showPwd() { |
| | | if (this.passwordType === 'password') { |
| | | this.passwordType = '' |
| | | } else { |
| | | this.passwordType = 'password' |
| | | } |
| | | }, |
| | | showConfirmPwd() { |
| | | if (this.confirmPasswordType === 'password') { |
| | | this.confirmPasswordType = '' |
| | | } else { |
| | | this.confirmPasswordType = 'password' |
| | | } |
| | | }, |
| | | handleSizeChange: function(val) { |
| | | this.pageSize = val |
| | | this.currentPage = 1 |
| | | this.getUserList() |
| | | }, |
| | | handleCurrentChange: function(val) { |
| | | this.currentPage = val |
| | | this.getUserList() |
| | | }, |
| | | getTemplateRow(row) { |
| | | console.log(row, '22222') |
| | | }, |
| | | handleInstituteChange(value) { |
| | | if (value) { |
| | | this.dataForm.departmentId = '' |
| | | } |
| | | }, |
| | | disableRole(row) { |
| | | if (row.type == 1) { |
| | | return true |
| | | } else { |
| | | return false |
| | | } |
| | | }, |
| | | getRoleInfo(role) { |
| | | return role.name |
| | | }, |
| | | getBtnPermission(btnType) { |
| | | return checkBtnPermission(this.userType, btnType) |
| | | }, |
| | | showImportHandle() { |
| | | this.importDisabled = false |
| | | this.importDialogFormVisible = true |
| | | }, |
| | | viewHandle() { |
| | | window.open(exampleFile, '_blank') |
| | | }, |
| | | importHandle() { |
| | | const _this = this |
| | | const formData = new FormData() |
| | | const userName = Cookies.get('userName') |
| | | formData.append('operator', userName) |
| | | const files = this.$refs['importLabInput'].files |
| | | if (files && files.length > 0) { |
| | | formData.append('file', files[0]) |
| | | } |
| | | formData.append('action', 'import') |
| | | importSupplierUser(formData) |
| | | .then((response) => { |
| | | const res = response.data |
| | | if (res.code == 200) { |
| | | _this.importDialogFormVisible = false |
| | | _this.$message({ |
| | | message: '导入成功', |
| | | type: 'success' |
| | | }) |
| | | _this.getUserList() |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | parseError({ error: error, vm: _this }) |
| | | }) |
| | | }, |
| | | getProvince(){ |
| | | const _this = this |
| | | const params = {} |
| | | params['parenttype'] = 0 |
| | | params['type'] = 1 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.provinceList = res.result; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | resetCity(name){ |
| | | const _this = this |
| | | const params = {} |
| | | params['parentname'] = name |
| | | params['parenttype'] = 1 |
| | | params['type'] = 2 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.cityList = res.result; |
| | | this.areaList = []; |
| | | this.townList = []; |
| | | this.communityList = []; |
| | | this.dataForm.city = ''; |
| | | this.dataForm.area = ''; |
| | | this.dataForm.town = ''; |
| | | this.dataForm.community = ''; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | resetArea(name){ |
| | | const _this = this |
| | | const params = {} |
| | | params['parentname'] = name |
| | | params['parenttype'] = 2 |
| | | params['type'] = 3 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.areaList = res.result; |
| | | this.townList = []; |
| | | this.communityList = []; |
| | | this.dataForm.area = ''; |
| | | this.dataForm.town = ''; |
| | | this.dataForm.community = ''; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | resetTown(name){ |
| | | const _this = this |
| | | const params = {} |
| | | params['parentname'] = name |
| | | params['parenttype'] = 3 |
| | | params['type'] = 4 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.townList = res.result; |
| | | this.communityList = []; |
| | | this.dataForm.town = ''; |
| | | this.dataForm.community = ''; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | resetCommunity(name){ |
| | | const _this = this |
| | | const params = {} |
| | | params['parentname'] = name |
| | | params['parenttype'] = 4 |
| | | params['type'] = 5 |
| | | getDistrict(params).then(response => { |
| | | const res = response.data |
| | | if (res.code == 200){ |
| | | this.communityList = res.result; |
| | | this.dataForm.community = ''; |
| | | } else { |
| | | parseError({ error: res.data.message, vm: _this }) |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | }, |
| | | async changeArea(value){ |
| | | if(value === 'province'){ |
| | | this.queryForm.city = '' |
| | | this.queryForm.area = '' |
| | | this.queryForm.town = '' |
| | | this.queryForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 2, |
| | | parenttype: 1, |
| | | parentname: this.queryForm.province, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.cityList = res.data.result |
| | | } |
| | | }else if(value === 'city'){ |
| | | this.queryForm.area = '' |
| | | this.queryForm.town = '' |
| | | this.queryForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 3, |
| | | parenttype: 2, |
| | | parentname: this.queryForm.city, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.districtList = res.data.result |
| | | } |
| | | }else if(value === 'area'){ |
| | | this.queryForm.town = '' |
| | | this.queryForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 4, |
| | | parenttype: 3, |
| | | parentname: this.queryForm.area, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.streetList = res.data.result |
| | | } |
| | | }else if(value === 'town'){ |
| | | this.queryForm.community = '' |
| | | this.areaListQuery = { |
| | | type: 5, |
| | | parenttype: 4, |
| | | parentname: this.queryForm.town, |
| | | } |
| | | let res = await getCityListData(this.areaListQuery) |
| | | if(res.data.code === "200"){ |
| | | this.committeeList = res.data.result |
| | | } |
| | | } |
| | | },//市、镇、街道、委员会 |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="filter-container"> |
| | | <div class="basic_search"> |
| | | <span>单位名称:</span> |
| | | <el-input v-model="company" style="width:150px" @change="getTroubleData"> |
| | | </el-input> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>作业状态:</span> |
| | | <el-select v-model="status" style="width:150px" clearable @change="getTroubleData"> |
| | | <el-option |
| | | v-for="item in statusList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>审批状态:</span> |
| | | <el-select v-model="flag" style="width:150px" clearable @change="getTroubleData"> |
| | | <el-option |
| | | v-for="item in flagList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>开始时间:</span> |
| | | <el-date-picker |
| | | @change="getTroubleData" |
| | | v-model="starttime" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="开始时间"> |
| | | </el-date-picker> |
| | | </div> |
| | | <div class="basic_search"> |
| | | <span>结束时间:</span> |
| | | <el-date-picker |
| | | @change="getTroubleData" |
| | | v-model="endtime" |
| | | align="right" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="开始时间"> |
| | | </el-date-picker> |
| | | </div> |
| | | <el-button style="margin-left: 10px;" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> |
| | | </div> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="troubleData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column label="单位名称" prop="constructionunit" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="作业类型" prop="type" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="作业数量" prop="countNum" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="showTroubleDetail(scope.row)">详情</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <br> |
| | | <work-detail ref="workDetail"></work-detail> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import workDetail from './workDetail/index' |
| | | import { mapGetters } from 'vuex' |
| | | import { computePageCount } from '../../../utils' |
| | | import { getWorkList } from '../../../api/troubleStatistics' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | components:{ |
| | | workDetail |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | troubleData: [], |
| | | statusList:[ |
| | | {id:0,name:'已驳回'}, |
| | | {id:1,name:'未提交'}, |
| | | {id:2,name:'已提交'}, |
| | | {id:3,name:'施工单位已确认'}, |
| | | {id:4,name:'动火部位负责人审批通过'}, |
| | | {id:5,name:'相关部门审批通过'}, |
| | | {id:6,name:'安全部门审批通过'}, |
| | | {id:7,name:'审批通过'}, |
| | | ], |
| | | flagList:[ |
| | | {id:0,name:'待提交'}, |
| | | {id:1,name:'作业中止'}, |
| | | {id:2,name:'等待检查'}, |
| | | {id:3,name:'等待开始'}, |
| | | {id:4,name:'作业中'}, |
| | | {id:5,name:'作业完成'}, |
| | | ], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | company:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | status:'', |
| | | flag:'', |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTroubleData() |
| | | }, |
| | | methods: { |
| | | async getTroubleData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | params['starttime'] = this.starttime |
| | | params['endtime'] = this.endtime |
| | | params['status'] = this.status |
| | | params['flag'] = this.flag |
| | | let res = await getWorkList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.troubleData = res.data.result.result |
| | | }else{ |
| | | this.$message({ |
| | | message:res.data.message, |
| | | type:'warning' |
| | | }) |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | showTroubleDetail(val){ |
| | | this.$refs.workDetail.showTroubleDetail(val.constructionunit,this.status,this.flag,this.starttime,this.endtime,val.type) |
| | | }, |
| | | refreshHandle(){ |
| | | this.getTroubleData() |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getTroubleData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getTroubleData() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog :title="title" :visible.sync="troubleDetailVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="70%"> |
| | | <div class="app-container"> |
| | | <div class="table_content"> |
| | | <el-table |
| | | v-loading="listLoading" |
| | | :key="tableKey" |
| | | :data="troubleDetailData" |
| | | border |
| | | fit |
| | | highlight-current-row |
| | | style="width: 100%;" |
| | | > |
| | | <el-table-column type="index" label="序号" align="center" width="80"/> |
| | | <el-table-column label="单位名称" prop="unit" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="单位代码" prop="code" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="申请人" prop="applicant" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="施工单位" prop="constructionunit" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="作业内容" prop="area" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="开始时间" prop="starttime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="结束时间" prop="endtime" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="作业级别" prop="level" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in levelList"> |
| | | <div v-if="scope.row.level === item.id"> |
| | | <span>{{item.name}}</span> |
| | | <!-- <el-tag v-if="scope.row.level ===0" type="success">{{item.name}}</el-tag>--> |
| | | <!-- <el-tag v-if="scope.row.level ===1" type="warning">{{item.name}}</el-tag>--> |
| | | <!-- <el-tag v-if="scope.row.level ===2" type="danger">{{item.name}}</el-tag>--> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="任务审批状态" prop="status" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in statusList"> |
| | | <div v-if="scope.row.status === item.id"> |
| | | <span>{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="作业状态" prop="flag" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in flagList"> |
| | | <div v-if="scope.row.flag === item.id"> |
| | | <span>{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br> |
| | | <el-pagination |
| | | v-show="recordTotal>0" |
| | | :current-page="currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="pageSize" |
| | | :total="recordTotal" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | background |
| | | style="float:right;" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | <br> |
| | | </div> |
| | | <el-dialog :visible.sync="dialogVisible" :append-to-body="true"> |
| | | <img width="100%" :src="dialogImageUrl" alt=""> |
| | | </el-dialog> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import { getWorkDetailList } from '../../../../api/troubleStatistics' |
| | | import { computePageCount } from '../../../../utils' |
| | | |
| | | export default { |
| | | name: 'index', |
| | | filters: { |
| | | parseMain(type){ |
| | | if(type === 1){ |
| | | return "是" |
| | | }else if(type === 0){ |
| | | return "否" |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'userType' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | tableKey: 0, |
| | | troubleDetailData: [], |
| | | levelList:[{id:2,name:'特级'},{id:1,name:'一级'},{id:0,name:'二级'},], |
| | | statusList:[ |
| | | {id:0,name:'已驳回'}, |
| | | {id:1,name:'未提交'}, |
| | | {id:2,name:'已提交'}, |
| | | {id:3,name:'施工单位已确认'}, |
| | | {id:4,name:'动火部位负责人审批通过'}, |
| | | {id:5,name:'相关部门审批通过'}, |
| | | {id:6,name:'安全部门审批通过'}, |
| | | {id:7,name:'审批通过'}, |
| | | ], |
| | | flagList:[ |
| | | {id:0,name:'待提交'}, |
| | | {id:1,name:'作业中止'}, |
| | | {id:2,name:'等待检查'}, |
| | | {id:3,name:'等待开始'}, |
| | | {id:4,name:'作业中'}, |
| | | {id:5,name:'作业完成'}, |
| | | ], |
| | | listLoading: false, |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | currentPage: 1, |
| | | pageTotal: 0, |
| | | title:'', |
| | | company:'', |
| | | starttime:'', |
| | | endtime:'', |
| | | status:'', |
| | | flag:'', |
| | | troubleDetailVisible:false, |
| | | dialogImageUrl:'', |
| | | dialogVisible:false, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | showTroubleDetail(company,status,flag,starttime,endtime,type){ |
| | | this.troubleDetailVisible = true |
| | | this.starttime = starttime |
| | | this.status = status |
| | | this.flag = flag |
| | | this.endtime = endtime |
| | | this.company = company |
| | | this.type = type |
| | | this.getTroubleData() |
| | | }, |
| | | async getTroubleData(){ |
| | | this.listLoading = true |
| | | let params = {} |
| | | params['pageIndex'] = this.currentPage |
| | | params['pageSize'] = this.pageSize |
| | | params['company'] = this.company |
| | | params['starttime'] = this.starttime |
| | | params['endtime'] = this.endtime |
| | | params['status'] = this.status |
| | | params['flag'] = this.flag |
| | | params['type'] = this.type |
| | | let res = await getWorkDetailList(params) |
| | | if(res.data.code === '200'){ |
| | | this.recordTotal = res.data.result.totalCount |
| | | this.pageSize = res.data.result.pageSize |
| | | this.pageTotal = computePageCount(res.data.result.totalCount, res.data.result.pageSize) |
| | | this.currentPage = res.data.result.pageIndex |
| | | this.troubleDetailData = res.data.result.result |
| | | }else{ |
| | | } |
| | | this.listLoading = false |
| | | }, |
| | | reportResources(file){ |
| | | this.dialogImageUrl = file.url; |
| | | this.dialogVisible = true; |
| | | }, |
| | | handleSizeChange(val){ |
| | | this.pageSize = val |
| | | this.getTroubleData() |
| | | }, |
| | | handleCurrentChange(val){ |
| | | this.currentPage = val |
| | | this.getTroubleData() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .basic_search{ |
| | | display:inline-block; |
| | | padding-bottom: 10px; |
| | | } |
| | | </style> |