移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

caseListNew.vue 8.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 登记列表
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <div style="height: 58px;"></div>
  8. <div class="search_box">
  9. <div class="search">
  10. <input type="text" v-model="searchInput" placeholder="请输入登记名称" />
  11. <img src="../../../../static/images/lawEnforcement/new/index_icon_04.png" @click="goSearch">
  12. </div>
  13. <img src="../../../../static/images/lawEnforcement/new/list_icon_03.png" @click="$router.push({name:'lawEnforcementCaseAdd'})"/>
  14. </div>
  15. <van-list
  16. v-model="loading"
  17. :finished="finished"
  18. finished-text="没有更多了"
  19. @load="getList"
  20. >
  21. <van-swipe-cell v-for="(item,index) in list" :key="index">
  22. <van-cell :title="item.caseName" center :to="{name:'lawEnforcementCaseDetailNew', query: {id:item.id}}">
  23. <template #icon>
  24. <van-icon name="../../../../static/images/lawEnforcement/new/list_icon_01.png" size="20" color="#FF4646" style="margin-right: 10px;" />
  25. </template>
  26. <template #label>
  27. <p>{{item.caseSourceText}}</p>
  28. <p>第{{item.belongTeamText}}</p>
  29. <p>{{item.registerDate}}</p>
  30. </template>
  31. </van-cell>
  32. <template #right>
  33. <van-row>
  34. <van-col>
  35. <van-button v-if="item.caseProgress == 1" square text="修改" type="info" :to="{name:'lawEnforcementCaseEdit', query: {id:item.id}}" class="delete-button" />
  36. </van-col>
  37. <van-col>
  38. <van-button v-if="item.caseProgress == 1" square text="删除" type="danger" @click="deleteCase(item.id)" class="delete-button" />
  39. </van-col>
  40. <van-col>
  41. <van-button v-if="item.caseProgress == 1" color="#FFA63E" square text="提交" type="info" @click="submitCase(item)" class="delete-button" />
  42. </van-col>
  43. <van-col>
  44. <van-button v-if="item.caseProgress != 1" color="#1CB8B1" square type="info" :to="{name:'lawEnforcementCaseEnforceList', query: {id:item.id}}" class="delete-button" >添加<br/>执法<br/>员</van-button>
  45. </van-col>
  46. </van-row>
  47. </template>
  48. </van-swipe-cell>
  49. </van-list>
  50. </div>
  51. </template>
  52. <script>
  53. import { listCase , delCase , updateCase } from "@/api/lawEnforcement/index";
  54. export default {
  55. name: "caseAllocation",
  56. data() {
  57. return {
  58. loading: false,
  59. finished: false,
  60. searchInput:'',
  61. queryApplyParams: {
  62. // 分页
  63. pageNum: 1,
  64. pageSize: 10,
  65. // 查询排序
  66. orderByColumn: "id",
  67. isAsc: "desc",
  68. caseName: null,
  69. caseProgress: "1",
  70. createBy: "use",
  71. },
  72. list:[],
  73. belongTeamOptions:[],
  74. caseSourceOptions:[],
  75. caseProgressOptions:[],
  76. };
  77. },
  78. created() {
  79. this.getDicts("case_source").then(response => {
  80. this.caseSourceOptions = response.data;
  81. });
  82. this.getDicts("team_category").then(response => {
  83. this.belongTeamOptions = response.data;
  84. });
  85. this.getDicts("case_node").then(response => {
  86. this.caseProgressOptions = response.data;
  87. });
  88. },
  89. methods: {
  90. getList(){
  91. var _this = this;
  92. listCase(_this.queryApplyParams).then(response => {
  93. response.rows.map(res=>{
  94. res.caseSourceText = res.caseSource == '' ? '' : this.selectDictLabel(this.caseSourceOptions, res.caseSource);
  95. res.belongTeamText = res.belongTeam == '' ? '' : this.selectDictLabel(this.belongTeamOptions, res.belongTeam);
  96. this.list.push(res);
  97. })
  98. console.log(this.list.length)
  99. if(this.list.length >= response.total){
  100. this.finished = true;
  101. return;
  102. }else{
  103. this.loading = false;
  104. this.queryApplyParams.pageNum += 1 ;
  105. }
  106. });
  107. },
  108. goSearch(){
  109. // if (this.searchInput == ''){
  110. // location.reload()
  111. // }
  112. this.list = [];
  113. this.queryApplyParams.caseName = this.searchInput;
  114. this.queryApplyParams.pageNum = 1 ;
  115. this.loading = false;
  116. this.finished = false;
  117. // this.getList();
  118. },
  119. deleteCase(id){
  120. this.$dialog.confirm({
  121. message: '是否确认删除案件登记标识为"' + id + '"的数据项?',
  122. }).then(function () {
  123. return delCase(id);
  124. }).then(() => {
  125. this.list = [];
  126. this.loading = false;
  127. this.finished = false;
  128. this.queryApplyParams.pageNum = 1 ;
  129. this.getList();
  130. this.$notify({ type: 'success', message: '删除成功' });
  131. }).catch(() => {});
  132. },
  133. submitCase(data){
  134. var _this = this;
  135. data.caseId = data.id;
  136. data.caseStatus = "1";
  137. data.caseProgress = "2"; // 勘察
  138. data.caseProgressName = this.selectDictLabel(this.caseProgressOptions, data.caseProgress); // 勘察
  139. this.$dialog.confirm({
  140. message: '提交后案件将进入后续流程并且不能修改,是否确认提交?',
  141. }).then(function () {
  142. // 更新案件的节点和状态
  143. updateCase(data).then(response => {
  144. _this.$notify({ type: 'success', message: '提交成功' });
  145. });
  146. }).then(() => {
  147. this.list = [];
  148. this.loading = false;
  149. this.finished = false;
  150. this.queryApplyParams.pageNum = 1 ;
  151. this.getList();
  152. this.$notify({ type: 'success', message: '提交成功' });
  153. }).catch(() => {});
  154. }
  155. },
  156. }
  157. </script>
  158. <style scoped lang="scss">
  159. .home_wrapper{
  160. background: #e9e9e9;
  161. min-height: 100vh;
  162. width: 100vw;
  163. padding: 0 3% 0.2rem;
  164. .search_box{
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. width: 92%;
  169. margin: 0PX auto;
  170. .search{
  171. background: #ffffff;
  172. display: flex;
  173. justify-content: space-between;
  174. align-items: center;
  175. width: 100%;
  176. margin: 10PX auto;
  177. border: 1px solid #1D6FE9;
  178. padding: 1PX 1PX 1PX 12PX ;
  179. border-radius: 50PX;
  180. margin-right: 10PX;
  181. input{
  182. flex: 1;
  183. background: transparent;
  184. }
  185. }
  186. }
  187. .header_main{
  188. height: 116px;
  189. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  190. background-size: 100% 100%;
  191. position: fixed;
  192. top: 0;
  193. left: 0;
  194. width: 100%;
  195. font-size: 36px;
  196. line-height: 116px;
  197. text-align: center;
  198. color: #fff;
  199. z-index: 999;
  200. .return_btn{
  201. width: 24px;
  202. height: 43.2px;
  203. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  204. background-size: 20px 36px;
  205. position: absolute;
  206. left: 38px;
  207. top: 36px;
  208. }
  209. .add_btn{
  210. width: 56.4px;
  211. height: 40.8px;
  212. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  213. background-size: 47px 34px;
  214. position: absolute;
  215. right: 38px;
  216. top: 36px;
  217. }
  218. }
  219. }
  220. /deep/.van-cell__title span{
  221. font-family: Arial;
  222. font-size: 0.4rem;
  223. font-weight: normal;
  224. color: #666666;
  225. display: -webkit-box;
  226. -webkit-box-orient: vertical;
  227. -webkit-line-clamp: 1;
  228. word-break: break-all;
  229. overflow: hidden;
  230. }
  231. /deep/.van-cell__label {
  232. display: flex;
  233. justify-content: space-between;
  234. p{
  235. display: inline-block;
  236. &:first-child{
  237. background: rgba(28,184,177,0.2);
  238. padding: 0 5PX;
  239. border-radius: 3PX;
  240. color: #1CB8B1;
  241. }
  242. }
  243. }
  244. /deep/.van-cell__value{
  245. flex: 0.3;
  246. color: #1D6FE9;
  247. font-weight: bold;
  248. }
  249. /deep/.van-swipe-cell{
  250. margin-bottom: 0.2rem;
  251. border-radius: 0.2rem;
  252. overflow: hidden;
  253. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  254. .van-swipe-cell__right{
  255. right: -2PX;
  256. }
  257. }
  258. /deep/van-ellipsis{
  259. font-weight: bold;
  260. }
  261. .van-row{
  262. height: 100%;
  263. }
  264. .van-col{
  265. height: 100%;
  266. }
  267. .delete-button {
  268. height: 100%;
  269. }
  270. </style>