Commit 4f6620f43ee00e77a6695ed15d5792cb4688f3fb
1 parent
346a8256
a
Showing
7 changed files
with
117 additions
and
23 deletions
trash-ui/src/api/business/credit.js
| @@ -17,6 +17,15 @@ export function getNames(query) { | @@ -17,6 +17,15 @@ export function getNames(query) { | ||
| 17 | }) | 17 | }) |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | +export function historyCredit(query) { | ||
| 21 | + return request({ | ||
| 22 | + url: '/business/ConstructionCredit/historyCredit', | ||
| 23 | + method: 'get', | ||
| 24 | + params: query | ||
| 25 | + }) | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | + | ||
| 20 | // 查询【请填写功能名称】详细 | 29 | // 查询【请填写功能名称】详细 |
| 21 | export function getCredit(id) { | 30 | export function getCredit(id) { |
| 22 | return request({ | 31 | return request({ |
| @@ -58,4 +67,4 @@ export function exportCredit(query) { | @@ -58,4 +67,4 @@ export function exportCredit(query) { | ||
| 58 | method: 'get', | 67 | method: 'get', |
| 59 | params: query | 68 | params: query |
| 60 | }) | 69 | }) |
| 61 | -} | ||
| 62 | \ No newline at end of file | 70 | \ No newline at end of file |
| 71 | +} |
trash-ui/src/views/business/ConstructionCredit/index.vue
| @@ -5,13 +5,15 @@ | @@ -5,13 +5,15 @@ | ||
| 5 | <el-button :class="{'el-button':true, 'el-button--primary':this.queryParams.status==0}" size="mini" @click="getData(1);" >失信工地</el-button> | 5 | <el-button :class="{'el-button':true, 'el-button--primary':this.queryParams.status==0}" size="mini" @click="getData(1);" >失信工地</el-button> |
| 6 | </el-col> | 6 | </el-col> |
| 7 | <el-col :span="1.5"> | 7 | <el-col :span="1.5"> |
| 8 | - <el-button :class="{'el-button':true,'el-button--primary':this.queryParams.status==1}" size="mini" @click="getData(1);">历史失信工地</el-button> | 8 | + <el-button :class="{'el-button':true,'el-button--primary':this.queryParams.status==1}" size="mini" @click="getHistoryData(1);">历史失信工地</el-button> |
| 9 | </el-col> | 9 | </el-col> |
| 10 | </el-row> | 10 | </el-row> |
| 11 | 11 | ||
| 12 | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> | 12 | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
| 13 | <el-row type="flex" justify="center"> | 13 | <el-row type="flex" justify="center"> |
| 14 | - <el-form-item label="工地名称" prop="name"> | 14 | + <el-col> |
| 15 | + <el-form-item label="工地名称" prop="name" | ||
| 16 | + style="float:right;"> | ||
| 15 | <el-select v-model="queryParams.name" | 17 | <el-select v-model="queryParams.name" |
| 16 | filterable | 18 | filterable |
| 17 | reserve-keyword | 19 | reserve-keyword |
| @@ -26,30 +28,39 @@ | @@ -26,30 +28,39 @@ | ||
| 26 | </el-option> | 28 | </el-option> |
| 27 | </el-select> | 29 | </el-select> |
| 28 | </el-form-item> | 30 | </el-form-item> |
| 31 | + </el-col> | ||
| 32 | + | ||
| 33 | + <el-col> | ||
| 29 | <el-form-item label="所属场地" prop="place"> | 34 | <el-form-item label="所属场地" prop="place"> |
| 30 | <el-select v-model="queryParams.place" placeholder="所属场地" clearable size="small"> | 35 | <el-select v-model="queryParams.place" placeholder="所属场地" clearable size="small"> |
| 31 | <el-option label="请选择字典生成" value="" /> | 36 | <el-option label="请选择字典生成" value="" /> |
| 32 | </el-select> | 37 | </el-select> |
| 33 | </el-form-item> | 38 | </el-form-item> |
| 39 | + </el-col> | ||
| 34 | </el-row> | 40 | </el-row> |
| 35 | <el-row type="flex" justify="center"> | 41 | <el-row type="flex" justify="center"> |
| 36 | - <el-form-item label="垃圾类型" prop="type"> | 42 | + <el-col> |
| 43 | + <el-form-item label="垃圾类型" prop="type" | ||
| 44 | + style="float:right;"> | ||
| 37 | <el-select v-model="queryParams.type" placeholder="建筑垃圾类型" clearable size="small"> | 45 | <el-select v-model="queryParams.type" placeholder="建筑垃圾类型" clearable size="small"> |
| 38 | <el-option label="请选择字典生成" value="" /> | 46 | <el-option label="请选择字典生成" value="" /> |
| 39 | </el-select> | 47 | </el-select> |
| 40 | </el-form-item> | 48 | </el-form-item> |
| 41 | - <el-form-item label="失信日期" prop="time"> | ||
| 42 | - <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.time" type="date" | ||
| 43 | - value-format="yyyy-MM-dd" placeholder="失信日期"> | ||
| 44 | - </el-date-picker> | ||
| 45 | - </el-form-item> | 49 | + |
| 50 | + </el-col><el-col> | ||
| 51 | + <el-form-item label="失信日期" prop="time" v-show="queryParams.status==0"> | ||
| 52 | + <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.time" type="date" | ||
| 53 | + value-format="yyyy-MM-dd" placeholder="失信日期"> | ||
| 54 | + </el-date-picker> | ||
| 55 | + </el-form-item> | ||
| 56 | + </el-col> | ||
| 46 | </el-row> | 57 | </el-row> |
| 47 | 58 | ||
| 48 | </el-form> | 59 | </el-form> |
| 49 | 60 | ||
| 50 | <el-row :gutter="10" class="mb8"> | 61 | <el-row :gutter="10" class="mb8"> |
| 51 | <el-col :span="1.5"> | 62 | <el-col :span="1.5"> |
| 52 | - <el-button type="primary" size="mini" @click="handleAdd" v-hasPermi="['business:ConstructionCredit:add']">新增</el-button> | 63 | + <el-button type="primary" size="mini" @click="handleAdd" v-hasPermi="['business:ConstructionCredit:add']" v-if="queryParams.status==0">新增</el-button> |
| 53 | </el-col> | 64 | </el-col> |
| 54 | <el-col :span="1.5"> | 65 | <el-col :span="1.5"> |
| 55 | <el-button size="mini" @click="handleExport" v-hasPermi="['business:ConstructionCredit:export']">导出</el-button> | 66 | <el-button size="mini" @click="handleExport" v-hasPermi="['business:ConstructionCredit:export']">导出</el-button> |
| @@ -68,7 +79,7 @@ | @@ -68,7 +79,7 @@ | ||
| 68 | <el-table-column label="序号" align="center" prop="id" /> | 79 | <el-table-column label="序号" align="center" prop="id" /> |
| 69 | <el-table-column label="工地名称" align="center" prop="name" /> | 80 | <el-table-column label="工地名称" align="center" prop="name" /> |
| 70 | <el-table-column label="建筑垃圾类型" align="center" prop="type" /> | 81 | <el-table-column label="建筑垃圾类型" align="center" prop="type" /> |
| 71 | - <el-table-column label="失信时间" align="center" prop="time" width="180"> | 82 | + <el-table-column label="失信时间" align="center" prop="time" width="180" v-if="queryParams.status==0"> |
| 72 | <template slot-scope="scope"> | 83 | <template slot-scope="scope"> |
| 73 | <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span> | 84 | <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span> |
| 74 | </template> | 85 | </template> |
| @@ -77,8 +88,8 @@ | @@ -77,8 +88,8 @@ | ||
| 77 | <el-table-column label="失信原因" align="center" prop="reason" /> | 88 | <el-table-column label="失信原因" align="center" prop="reason" /> |
| 78 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 89 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 79 | <template slot-scope="scope"> | 90 | <template slot-scope="scope"> |
| 80 | - <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:ConstructionCredit:edit']" v-if="scope.row.lostCredit==1">撤销失信</el-button> | ||
| 81 | - <el-button size="mini" type="text" icon="el-icon-edit" @click="getDataInfo(scope.row)" v-if="scope.row.lostCredit==0">查看</el-button> | 91 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:ConstructionCredit:edit']" v-if="queryParams.status==0">撤销失信</el-button> |
| 92 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="getDataInfo(scope.row)" v-if="queryParams.status==1">查看</el-button> | ||
| 82 | </template> | 93 | </template> |
| 83 | </el-table-column> | 94 | </el-table-column> |
| 84 | </el-table> | 95 | </el-table> |
| @@ -157,6 +168,21 @@ | @@ -157,6 +168,21 @@ | ||
| 157 | <el-button @click="cancel">退出</el-button> | 168 | <el-button @click="cancel">退出</el-button> |
| 158 | </div> | 169 | </div> |
| 159 | </el-dialog> | 170 | </el-dialog> |
| 171 | + | ||
| 172 | + <el-dialog title="历史失信" :visible.sync="infoDialog" width="800px" append-to-body center="true"> | ||
| 173 | + <el-table v-loading="loading" :data="creditListInfo" :cell-style="colStyle" border> | ||
| 174 | + <el-table-column label="序号" align="center" prop="id" /> | ||
| 175 | + <el-table-column label="工地名称" align="center" prop="name" /> | ||
| 176 | + <el-table-column label="建筑垃圾类型" align="center" prop="type" /> | ||
| 177 | + <el-table-column label="失信时间" align="center" prop="time" width="180" v-if="queryParams.status==0"> | ||
| 178 | + <template slot-scope="scope"> | ||
| 179 | + <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span> | ||
| 180 | + </template> | ||
| 181 | + </el-table-column> | ||
| 182 | + <el-table-column label="所属区域" align="center" prop="place" /> | ||
| 183 | + <el-table-column label="失信原因" align="center" prop="reason" /> | ||
| 184 | + </el-table> | ||
| 185 | + </el-dialog> | ||
| 160 | </div> | 186 | </div> |
| 161 | </template> | 187 | </template> |
| 162 | 188 | ||
| @@ -168,7 +194,8 @@ | @@ -168,7 +194,8 @@ | ||
| 168 | addCredit, | 194 | addCredit, |
| 169 | updateCredit, | 195 | updateCredit, |
| 170 | exportCredit, | 196 | exportCredit, |
| 171 | - getNames | 197 | + getNames, |
| 198 | + historyCredit | ||
| 172 | } from "@/api/business/credit"; | 199 | } from "@/api/business/credit"; |
| 173 | 200 | ||
| 174 | export default { | 201 | export default { |
| @@ -185,11 +212,12 @@ | @@ -185,11 +212,12 @@ | ||
| 185 | multiple: true, | 212 | multiple: true, |
| 186 | // 显示搜索条件 | 213 | // 显示搜索条件 |
| 187 | showSearch: true, | 214 | showSearch: true, |
| 188 | - | 215 | + infoDialog :false, |
| 189 | // 总条数 | 216 | // 总条数 |
| 190 | total: 0, | 217 | total: 0, |
| 191 | // 工地表格数据 | 218 | // 工地表格数据 |
| 192 | creditList: [], | 219 | creditList: [], |
| 220 | + creditListInfo: [], | ||
| 193 | dictNames:[], | 221 | dictNames:[], |
| 194 | dictTypes:[], | 222 | dictTypes:[], |
| 195 | dictPlaces:[], | 223 | dictPlaces:[], |
| @@ -247,15 +275,31 @@ | @@ -247,15 +275,31 @@ | ||
| 247 | this.getNamesData(); | 275 | this.getNamesData(); |
| 248 | }, | 276 | }, |
| 249 | methods: { | 277 | methods: { |
| 278 | + getDataInfo(row){ | ||
| 279 | + console.log(row); | ||
| 280 | + | ||
| 281 | + let param ={"objectId":row.objectId} | ||
| 282 | + | ||
| 283 | + listCredit(param).then(response => { | ||
| 284 | + this.creditListInfo = response.rows; | ||
| 285 | + this.infoDialog = true; | ||
| 286 | + }); | ||
| 287 | + | ||
| 288 | + }, | ||
| 250 | getNamesData(){ | 289 | getNamesData(){ |
| 251 | getNames(this.queryParams).then(response => { | 290 | getNames(this.queryParams).then(response => { |
| 252 | this.dictNames = response; | 291 | this.dictNames = response; |
| 253 | }); | 292 | }); |
| 254 | }, | 293 | }, |
| 255 | getData(stauts){ | 294 | getData(stauts){ |
| 295 | + this.queryParams.status=0; | ||
| 256 | this.queryParams.lostCredit=stauts; | 296 | this.queryParams.lostCredit=stauts; |
| 257 | this.getList(); | 297 | this.getList(); |
| 258 | }, | 298 | }, |
| 299 | + getHistoryData(){ | ||
| 300 | + this.queryParams.status=1; | ||
| 301 | + this.getList(); | ||
| 302 | + }, | ||
| 259 | colStyle(obj){ | 303 | colStyle(obj){ |
| 260 | if(obj.column.property == "id"){ | 304 | if(obj.column.property == "id"){ |
| 261 | return {background:"#f8f8f9"} | 305 | return {background:"#f8f8f9"} |
| @@ -266,11 +310,21 @@ | @@ -266,11 +310,21 @@ | ||
| 266 | }, | 310 | }, |
| 267 | getList() { | 311 | getList() { |
| 268 | this.loading = true; | 312 | this.loading = true; |
| 269 | - listCredit(this.queryParams).then(response => { | ||
| 270 | - this.creditList = response.rows; | ||
| 271 | - this.total = response.total; | ||
| 272 | - this.loading = false; | ||
| 273 | - }); | 313 | + if(this.queryParams.status==0){ |
| 314 | + listCredit(this.queryParams).then(response => { | ||
| 315 | + this.creditList = response.rows; | ||
| 316 | + this.total = response.total; | ||
| 317 | + this.loading = false; | ||
| 318 | + }); | ||
| 319 | + } | ||
| 320 | + if(this.queryParams.status==1){ | ||
| 321 | + historyCredit(this.queryParams).then(response => { | ||
| 322 | + this.creditList = response.rows; | ||
| 323 | + this.total = response.total; | ||
| 324 | + this.loading = false; | ||
| 325 | + }); | ||
| 326 | + } | ||
| 327 | + | ||
| 274 | }, | 328 | }, |
| 275 | // 取消按钮 | 329 | // 取消按钮 |
| 276 | cancel() { | 330 | cancel() { |
trash-workFlow/src/main/java/com/trash/business/controller/ConstructionCreditController.java
| @@ -46,6 +46,16 @@ public class ConstructionCreditController extends BaseController | @@ -46,6 +46,16 @@ public class ConstructionCreditController extends BaseController | ||
| 46 | List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditList(constructionCredit); | 46 | List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditList(constructionCredit); |
| 47 | return getDataTable(list); | 47 | return getDataTable(list); |
| 48 | } | 48 | } |
| 49 | + | ||
| 50 | + @PreAuthorize("@ss.hasPermi('business:ConstructionCredit:list')") | ||
| 51 | + @GetMapping("/historyCredit") | ||
| 52 | + public TableDataInfo historyCredit(ConstructionCredit constructionCredit) | ||
| 53 | + { | ||
| 54 | + startPage(); | ||
| 55 | + List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditHistory(constructionCredit); | ||
| 56 | + return getDataTable(list); | ||
| 57 | + } | ||
| 58 | + | ||
| 49 | 59 | ||
| 50 | /** | 60 | /** |
| 51 | * 导出工地失信列表 | 61 | * 导出工地失信列表 |
trash-workFlow/src/main/java/com/trash/business/mapper/ConstructionCreditMapper.java
| @@ -61,4 +61,6 @@ public interface ConstructionCreditMapper | @@ -61,4 +61,6 @@ public interface ConstructionCreditMapper | ||
| 61 | public int deleteConstructionCreditByIds(Long[] ids); | 61 | public int deleteConstructionCreditByIds(Long[] ids); |
| 62 | 62 | ||
| 63 | public List<String> getNames(ConstructionCredit constructionCredit); | 63 | public List<String> getNames(ConstructionCredit constructionCredit); |
| 64 | + | ||
| 65 | + public List<ConstructionCredit> selectConstructionCreditHistory(ConstructionCredit constructionCredit); | ||
| 64 | } | 66 | } |
trash-workFlow/src/main/java/com/trash/business/service/IConstructionCreditService.java
| @@ -62,4 +62,6 @@ public interface IConstructionCreditService | @@ -62,4 +62,6 @@ public interface IConstructionCreditService | ||
| 62 | public int deleteConstructionCreditById(Long id); | 62 | public int deleteConstructionCreditById(Long id); |
| 63 | 63 | ||
| 64 | public List<String> getNames(ConstructionCredit constructionCredit); | 64 | public List<String> getNames(ConstructionCredit constructionCredit); |
| 65 | + | ||
| 66 | + public List<ConstructionCredit> selectConstructionCreditHistory(ConstructionCredit constructionCredit); | ||
| 65 | } | 67 | } |
trash-workFlow/src/main/java/com/trash/business/service/impl/ConstructionCreditServiceImpl.java
| @@ -48,6 +48,13 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService | @@ -48,6 +48,13 @@ public class ConstructionCreditServiceImpl implements IConstructionCreditService | ||
| 48 | return constructionCreditMapper.selectConstructionCreditList(constructionCredit); | 48 | return constructionCreditMapper.selectConstructionCreditList(constructionCredit); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | + @Override | ||
| 52 | + public List<ConstructionCredit> selectConstructionCreditHistory(ConstructionCredit constructionCredit) | ||
| 53 | + { | ||
| 54 | + return constructionCreditMapper.selectConstructionCreditHistory(constructionCredit); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + | ||
| 51 | /** | 58 | /** |
| 52 | * 新增【请填写功能名称】 | 59 | * 新增【请填写功能名称】 |
| 53 | * | 60 | * |
trash-workFlow/src/main/resources/mapper/ConstructionCreditMapper.xml
| @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 19 | <sql id="selectConstructionCreditVo"> | 19 | <sql id="selectConstructionCreditVo"> |
| 20 | select id, name, type, time, place, reason, status, lost_credit,object_id from construction_credit | 20 | select id, name, type, time, place, reason, status, lost_credit,object_id from construction_credit |
| 21 | </sql> | 21 | </sql> |
| 22 | - | 22 | + |
| 23 | <select id="selectConstructionCreditList" parameterType="ConstructionCredit" resultMap="ConstructionCreditResult"> | 23 | <select id="selectConstructionCreditList" parameterType="ConstructionCredit" resultMap="ConstructionCreditResult"> |
| 24 | <include refid="selectConstructionCreditVo"/> | 24 | <include refid="selectConstructionCreditVo"/> |
| 25 | <where> | 25 | <where> |
| @@ -91,14 +91,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -91,14 +91,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 91 | 91 | ||
| 92 | <select id="getNames" parameterType="ConstructionCredit" resultType="String"> | 92 | <select id="getNames" parameterType="ConstructionCredit" resultType="String"> |
| 93 | 93 | ||
| 94 | - select name from construction_credit | 94 | + select DISTINCT name from construction_credit |
| 95 | <where> | 95 | <where> |
| 96 | <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> | 96 | <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
| 97 | <if test="status != null "> and status = #{status}</if> | 97 | <if test="status != null "> and status = #{status}</if> |
| 98 | <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> | 98 | <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if> |
| 99 | </where> | 99 | </where> |
| 100 | - GROUP BY name | ||
| 101 | </select> | 100 | </select> |
| 102 | 101 | ||
| 103 | 102 | ||
| 103 | + <select id="selectConstructionCreditHistory" parameterType="ConstructionCredit" resultMap="ConstructionCreditResult"> | ||
| 104 | + | ||
| 105 | + select c.* from (select a.* from construction_credit a where not exists (select b.* from construction_credit b where a.name = b.name and a.id < id )) c | ||
| 106 | + | ||
| 107 | + <where> | ||
| 108 | + <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> | ||
| 109 | + <if test="type != null and type != ''"> and type = #{type}</if> | ||
| 110 | + <if test="place != null and place != ''"> and place = #{place}</if> | ||
| 111 | + </where> | ||
| 112 | + </select> | ||
| 113 | + | ||
| 104 | </mapper> | 114 | </mapper> |
| 105 | \ No newline at end of file | 115 | \ No newline at end of file |