<template>
|
<div class="app-container">
|
<el-button
|
type="primary"
|
plain
|
style="margin-right: 10px"
|
icon="el-icon-plus"
|
@click="handleView('add',{})"
|
>新增
|
</el-button>
|
<el-radio-group v-model="queryParams.categoryType" @change="changeTimeStatus">
|
<el-radio-button>全部</el-radio-button>
|
<el-radio-button :label="1">理论</el-radio-button>
|
<el-radio-button :label="2">实操</el-radio-button>
|
</el-radio-group>
|
<!-- <el-select v-model="queryParams.districtCode" style="margin-left: 10px" placeholder="行政区划">-->
|
<!-- <el-option-->
|
<!-- v-for="item in areaList"-->
|
<!-- :key="item.id"-->
|
<!-- :label="item.name"-->
|
<!-- :value="item.code">-->
|
<!-- </el-option>-->
|
<!-- </el-select>-->
|
<el-button
|
type="primary"
|
style="margin-bottom: 10px;margin-left: 20px"
|
@click="handleQuery()"
|
>查询
|
</el-button>
|
<el-button
|
type="primary"
|
style="margin-bottom: 10px"
|
@click="resetQuery()"
|
>重置
|
</el-button>
|
<el-table
|
:data="cateGoryList"
|
style="width: 100%;margin-bottom: 20px;"
|
row-key="id"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
<el-table-column label="地州" align="center" prop="districtName" width="260"/>
|
<el-table-column label="类别" align="center" prop="categoryType">
|
<template #default="scope">
|
{{scope.row.categoryType == 1?'理论':scope.row.categoryType == 2?'实操':''}}
|
</template>
|
</el-table-column>
|
<el-table-column label="科目名称" align="center" prop="subjectName" :show-overflow-tooltip="true"/>
|
<el-table-column label="关联资格类型" align="center" prop="operateTypeName" :show-overflow-tooltip="true"/>
|
<el-table-column label="金额(元)" align="center" prop="amount"/>
|
<el-table-column label="业务代码" align="center" prop="businessCode"/>
|
<el-table-column label="单位编码" align="center" prop="companyCode"/>
|
<el-table-column label="开票人" align="center" prop="drawer"/>
|
<el-table-column label="复核人" align="center" prop="reviewer"/>
|
<el-table-column label="开票单位社会信用代码" align="center" prop="invoicingCompanyCode"/>
|
<el-table-column label="描述" align="center" prop="describe"/>
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<template #default="scope">
|
<el-button
|
v-if="scope.row.subjectName"
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleView('edit',scope.row)"
|
>编辑
|
</el-button>
|
<el-button
|
v-if="scope.row.subjectName"
|
size="mini"
|
type="text"
|
style="color: #f56c6c"
|
icon="el-icon-delete"
|
@click="handleDelete(scope.row)"
|
v-hasPermi="['system:experts:remove']"
|
>删除
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- <pagination-->
|
<!-- v-show="total>0"-->
|
<!-- :total="total"-->
|
<!-- :page.sync="queryParams.pageNum"-->
|
<!-- :limit.sync="queryParams.pageSize"-->
|
<!-- @pagination="getList"-->
|
<!-- />-->
|
<detail-dialog ref="detailDialogRef" @getList="getList"></detail-dialog>
|
</div>
|
</template>
|
|
<script>
|
import detailDialog from './components/detailDialog.vue'
|
import {delNotCoalPayCategory, getNotCoalPayCategory} from '@/api/specialOperationsPay/notCoalPay'
|
import Cookies from 'js-cookie'
|
import {getAreaList} from "@/api/coalMine/placeManage/train";
|
import {delTeacher} from "@/api/coalMine/teacher";
|
import store from "@/store";
|
|
export default {
|
name: "coalWorkType",
|
dicts: [],
|
components: {detailDialog},
|
data() {
|
return {
|
loading: false,
|
single: true,
|
multiple: true,
|
showSearch: true,
|
addForm: false,
|
total: 0,
|
expertTypes: [],
|
areaList: [],
|
cateGoryList: [],
|
queryParams: {
|
categoryType: null,
|
districtCode: '',
|
pageNum: 1,
|
pageSize: 999,
|
},
|
districtCode: ''
|
};
|
},
|
created() {
|
const userInfo = store.getters && store.getters.userInfo
|
this.districtCode = userInfo.district.districtCode
|
if(userInfo.district.districtCode !== '65'){
|
this.queryParams.districtCode = this.districtCode
|
}else{
|
this.queryParams.districtCode = ''
|
}
|
this.getList()
|
this.getArea()
|
},
|
methods: {
|
getList() {
|
this.loading = true;
|
getNotCoalPayCategory(this.queryParams).then((res) => {
|
if (res.code == 200) {
|
let totalList = []
|
if(Array.isArray(res.rows) && res.rows.length>0){
|
for(let item of res.rows){
|
if(!totalList.find(i=>i.districtName == item.districtName)){
|
totalList.push({
|
districtName: item.districtName,
|
id: '100' + item.id,
|
children: [item]
|
})
|
}else{
|
for(let i of totalList){
|
if(i.districtName == item.districtName){
|
i.children.push(item)
|
}
|
}
|
}
|
}
|
totalList.map(i=>{
|
if(i.children.length == 1){
|
for(let key in i.children[0]){
|
i[key] = i.children[0][key]
|
}
|
delete i.children
|
}
|
if(i.children){
|
for(let j of i.children){
|
j.districtName = ''
|
}
|
}
|
return i
|
})
|
}
|
this.cateGoryList = JSON.parse(JSON.stringify(totalList))
|
this.total = res.total
|
this.loading = false;
|
}
|
})
|
},
|
async getArea() {
|
const res = await getAreaList();
|
if (res.code == 200) {
|
this.areaList = res.data.filter(i=>i.code !== '65')
|
console.log(this.areaList,'list')
|
}
|
},
|
changeTimeStatus(val) {
|
this.getList()
|
},
|
|
handleChange() {
|
|
},
|
handleQuery() {
|
this.getList()
|
},
|
resetQuery() {
|
this.queryParams = {
|
categoryType: null,
|
districtCode: ''
|
}
|
this.getList()
|
},
|
handleView(type,data) {
|
this.$refs.detailDialogRef.openDialog(type,data,this.areaList,this.districtCode);
|
},
|
handleDelete(row){
|
this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(async () => {
|
const res = await delNotCoalPayCategory(row.id)
|
if(res.code == 200){
|
this.$message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
await this.getList()
|
}else{
|
this.$message({
|
type: 'warning',
|
message: res.msg
|
});
|
}
|
}).catch(() => {
|
|
});
|
}
|
}
|
};
|
</script>
|
|
<style scoped>
|
.app-container /deep/ .el-table .tr-red {
|
color: red !important;
|
}
|
</style>
|