Commit 4f6620f43ee00e77a6695ed15d5792cb4688f3fb

Authored by youxiw2000
1 parent 346a8256

a

trash-ui/src/api/business/credit.js
... ... @@ -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 30 export function getCredit(id) {
22 31 return request({
... ... @@ -58,4 +67,4 @@ export function exportCredit(query) {
58 67 method: 'get',
59 68 params: query
60 69 })
61   -}
62 70 \ No newline at end of file
  71 +}
... ...
trash-ui/src/views/business/ConstructionCredit/index.vue
... ... @@ -5,13 +5,15 @@
5 5 <el-button :class="{'el-button':true, 'el-button--primary':this.queryParams.status==0}" size="mini" @click="getData(1);" >失信工地</el-button>
6 6 </el-col>
7 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 9 </el-col>
10 10 </el-row>
11 11  
12 12 <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
13 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 17 <el-select v-model="queryParams.name"
16 18 filterable
17 19 reserve-keyword
... ... @@ -26,30 +28,39 @@
26 28 </el-option>
27 29 </el-select>
28 30 </el-form-item>
  31 + </el-col>
  32 +
  33 + <el-col>
29 34 <el-form-item label="所属场地" prop="place">
30 35 <el-select v-model="queryParams.place" placeholder="所属场地" clearable size="small">
31 36 <el-option label="请选择字典生成" value="" />
32 37 </el-select>
33 38 </el-form-item>
  39 + </el-col>
34 40 </el-row>
35 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 45 <el-select v-model="queryParams.type" placeholder="建筑垃圾类型" clearable size="small">
38 46 <el-option label="请选择字典生成" value="" />
39 47 </el-select>
40 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 57 </el-row>
47 58  
48 59 </el-form>
49 60  
50 61 <el-row :gutter="10" class="mb8">
51 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 64 </el-col>
54 65 <el-col :span="1.5">
55 66 <el-button size="mini" @click="handleExport" v-hasPermi="['business:ConstructionCredit:export']">导出</el-button>
... ... @@ -68,7 +79,7 @@
68 79 <el-table-column label="序号" align="center" prop="id" />
69 80 <el-table-column label="工地名称" align="center" prop="name" />
70 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 83 <template slot-scope="scope">
73 84 <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span>
74 85 </template>
... ... @@ -77,8 +88,8 @@
77 88 <el-table-column label="失信原因" align="center" prop="reason" />
78 89 <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
79 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 93 </template>
83 94 </el-table-column>
84 95 </el-table>
... ... @@ -157,6 +168,21 @@
157 168 <el-button @click="cancel">退出</el-button>
158 169 </div>
159 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 186 </div>
161 187 </template>
162 188  
... ... @@ -168,7 +194,8 @@
168 194 addCredit,
169 195 updateCredit,
170 196 exportCredit,
171   - getNames
  197 + getNames,
  198 + historyCredit
172 199 } from "@/api/business/credit";
173 200  
174 201 export default {
... ... @@ -185,11 +212,12 @@
185 212 multiple: true,
186 213 // 显示搜索条件
187 214 showSearch: true,
188   -
  215 + infoDialog :false,
189 216 // 总条数
190 217 total: 0,
191 218 // 工地表格数据
192 219 creditList: [],
  220 + creditListInfo: [],
193 221 dictNames:[],
194 222 dictTypes:[],
195 223 dictPlaces:[],
... ... @@ -247,15 +275,31 @@
247 275 this.getNamesData();
248 276 },
249 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 289 getNamesData(){
251 290 getNames(this.queryParams).then(response => {
252 291 this.dictNames = response;
253 292 });
254 293 },
255 294 getData(stauts){
  295 + this.queryParams.status=0;
256 296 this.queryParams.lostCredit=stauts;
257 297 this.getList();
258 298 },
  299 + getHistoryData(){
  300 + this.queryParams.status=1;
  301 + this.getList();
  302 + },
259 303 colStyle(obj){
260 304 if(obj.column.property == "id"){
261 305 return {background:"#f8f8f9"}
... ... @@ -266,11 +310,21 @@
266 310 },
267 311 getList() {
268 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 330 cancel() {
... ...
trash-workFlow/src/main/java/com/trash/business/controller/ConstructionCreditController.java
... ... @@ -46,6 +46,16 @@ public class ConstructionCreditController extends BaseController
46 46 List<ConstructionCredit> list = constructionCreditService.selectConstructionCreditList(constructionCredit);
47 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 61 public int deleteConstructionCreditByIds(Long[] ids);
62 62  
63 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 62 public int deleteConstructionCreditById(Long id);
63 63  
64 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 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 &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
19 19 <sql id="selectConstructionCreditVo">
20 20 select id, name, type, time, place, reason, status, lost_credit,object_id from construction_credit
21 21 </sql>
22   -
  22 +
23 23 <select id="selectConstructionCreditList" parameterType="ConstructionCredit" resultMap="ConstructionCreditResult">
24 24 <include refid="selectConstructionCreditVo"/>
25 25 <where>
... ... @@ -91,14 +91,24 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
91 91  
92 92 <select id="getNames" parameterType="ConstructionCredit" resultType="String">
93 93  
94   - select name from construction_credit
  94 + select DISTINCT name from construction_credit
95 95 <where>
96 96 <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
97 97 <if test="status != null "> and status = #{status}</if>
98 98 <if test="lostCredit != null "> and lost_credit = #{lostCredit}</if>
99 99 </where>
100   - GROUP BY name
101 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 &lt; 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 114 </mapper>
105 115 \ No newline at end of file
... ...