移动端
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.
 
 

430 lines
14 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 合同信息
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. <div class="add_btn" @click="goAdd"></div>
  7. </div>
  8. <div class="search_info">
  9. <div class="search_block">
  10. <i class="icon"></i>
  11. <input type="text" class="ipt" placeholder="搜索" v-model="queryParams.name" @input="getSearchList">
  12. </div>
  13. <div class="total">共{{listLength}}个合同</div>
  14. </div>
  15. <div class="list_main">
  16. <van-list
  17. v-model="loading"
  18. :finished="finished"
  19. finished-text="没有更多了"
  20. @load="getList"
  21. >
  22. <!--1-->
  23. <van-swipe-cell right-width="150" class="item" v-for="(item,index) in applicationList" :key="index">
  24. <div class="item_box" @click="$router.push({name:'sunVillageInfoInformationDetail',query:{id:item.id}})">
  25. <div class="head_block">
  26. <i class="icon"></i>
  27. <div class="title">{{item.name}}</div>
  28. </div>
  29. <div class="order_block">
  30. <div class="order">{{item.code}}</div>
  31. <div :class="{'describe':true,'suspend':item.contractionStatus == '撤销','normal':item.contractionStatus == '正常','undo':item.contractionStatus == '终止'}">{{item.contractionStatus}}<i class="icon"></i></div>
  32. </div>
  33. <div class="function_block">
  34. <div class="value">合同金额<span class="amount">¥{{item.totalAmount}}</span></div>
  35. <div class="startStop_time">
  36. <div class="time"><div class="unim start">起</div>{{item.startTime}}</div>
  37. <div class="time"><div class="unim stop">止</div>{{item.endTime}}</div>
  38. </div>
  39. </div>
  40. </div>
  41. <template #right>
  42. <div @click="handleDelete(item,index)" style="background-color: #ee0a24;height: 100%">删除</div>
  43. <router-link :to="{name:'sunVillageInfoInformationEdit',query:{id:item.id}}" style="background-color: #07c160">修改</router-link>
  44. <div @click="openLoader(item.id,0)" style="background-color: rgba(98,173,102,0.2);color: #62AD66;">附件</div>
  45. </template>
  46. </van-swipe-cell>
  47. </van-list>
  48. </div>
  49. <!-- <div class="bottom_tips">-->
  50. <!-- <span class="xs">已经到底啦</span>-->
  51. <!-- </div>-->
  52. <van-popup v-model="show" lock-scroll closeable position="top" :style="{ height: '30%' }" >
  53. <div style="padding: 0 13% 0 5%;">
  54. <van-divider>附件</van-divider>
  55. <van-uploader v-model="fileList" :after-read="afterRead" @delete="deleteFile1" multiple />
  56. </div>
  57. </van-popup>
  58. </div>
  59. </template>
  60. <script>
  61. import { contractionList , delInfo , commonAttach , attachmentList , systemAttachment } from "@/api/sunVillage_info/fixedAssets";
  62. import request from '@/utils/request'
  63. export default {
  64. name: "certificateList",
  65. data() {
  66. return {
  67. applicationList:[],
  68. applicationListSecond:[],
  69. assetStatusOptions:[],
  70. auditStatus:[],
  71. loading: false,
  72. finished: false,
  73. show: false,
  74. fileList:[],
  75. listLength:'0',
  76. searchInput:'',
  77. queryParams:{
  78. pageNum:1,
  79. pageSize:10,
  80. orderByColumn:'createTime',
  81. isAsc:'desc',
  82. name:'',
  83. },
  84. uploadFiles1:[],
  85. projectId:'',
  86. projectIndex:''
  87. };
  88. },
  89. created() {
  90. this.houseGetDicts("contraction_status").then((response) => {
  91. this.contractionStatusOptions = response.data;
  92. });
  93. },
  94. methods: {
  95. getList(){
  96. setTimeout(() => {
  97. contractionList(this.queryParams).then(response => {
  98. this.listLength = response.total;
  99. for (var i = 0; i < response.rows.length; i++) {
  100. response.rows[i].contractionStatus = this.selectDictLabel(this.contractionStatusOptions, response.rows[i].contractionStatus);
  101. response.rows[i].totalAmount = Number(response.rows[i].totalAmount ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => { return $1 + ","; }).replace(/\.$/, "")
  102. this.applicationList.push(response.rows[i]);
  103. this.applicationListSecond.push(response.rows[i]);
  104. }
  105. if(this.applicationList.length >= response.total){
  106. this.finished = true;
  107. return;
  108. }else{
  109. this.loading = false;
  110. this.queryParams.pageNum += 1 ;
  111. }
  112. });
  113. }, 1000);
  114. },
  115. getSearchList(){
  116. this.applicationList = [];
  117. this.queryParams.pageNum = 1;
  118. this.getList();
  119. },
  120. afterRead(file) {
  121. // 此时可以自行将文件上传至服务器
  122. this.uploadFiles1.push(file.file);
  123. let params1 = new FormData();
  124. params1.append("tableId", this.projectId);
  125. params1.append("tableName", "t_contraction_info");
  126. params1.append("bizPath", "contraction");
  127. params1.append("fileType", this.projectIndex);
  128. params1.append("file", file.file);
  129. commonAttach(params1).then((r1) => {
  130. this.$notify({ type: 'success', message: '上传成功' });
  131. })
  132. },
  133. openLoader(id,index){
  134. this.show = true;
  135. this.projectId = id;
  136. this.projectIndex = index;
  137. this.fileList = [];
  138. let oData1= {
  139. tableId: id,
  140. tableName: "t_contraction_info",
  141. bizPath: "contraction",
  142. fileType: '',
  143. }
  144. attachmentList(oData1).then(res => {
  145. res.rows.map(r => {
  146. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  147. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  148. })
  149. })
  150. },
  151. /** 删除按钮操作 */
  152. handleDelete(row,index) {
  153. const ids = row.id || this.ids;
  154. this.$dialog.alert(
  155. {
  156. message:'是否确认删除合同信息?',
  157. title:"警告",
  158. showCancelButton:true,
  159. confirmButtonText: "确定",
  160. cancelButtonText: "取消",
  161. }
  162. )
  163. .then(function () {
  164. return delInfo(ids);
  165. })
  166. .then(() => {
  167. this.applicationList.splice(index, 1);
  168. this.$notify({ type: 'success', message: '删除成功' });
  169. });
  170. },
  171. deleteFile1(file){
  172. console.log(file)
  173. systemAttachment(file.id).then(res => {
  174. this.$notify({ type: 'success', message: '删除成功' });
  175. })
  176. },
  177. goAdd(){
  178. this.$router.push('/sunVillage_info/informationAdd')
  179. },
  180. },
  181. }
  182. </script>
  183. <style scoped lang="scss">
  184. .home_wrapper{
  185. background: #e9e9e9;
  186. min-height: 100vh;
  187. width: 100vw;
  188. .header_main {
  189. height: 116px;
  190. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  191. background-size: 100% 100%;
  192. position: fixed;
  193. top: 0;
  194. left: 0;
  195. width: 100%;
  196. font-size: 36px;
  197. line-height: 116px;
  198. text-align: center;
  199. color: #fff;
  200. position: relative;
  201. .return_btn {
  202. width: 24px;
  203. height: 43.2px;
  204. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  205. background-size: 20px 36px;
  206. position: absolute;
  207. left: 38px;
  208. top: 36px;
  209. }
  210. .add_btn {
  211. width: 56.4px;
  212. height: 40.8px;
  213. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  214. background-size: 47px 34px;
  215. position: absolute;
  216. right: 38px;
  217. top: 36px;
  218. }
  219. }
  220. .search_info{
  221. padding:20px 23px;
  222. display: flex;
  223. .search_block{
  224. height: 59px;
  225. width: 535px;
  226. border-radius: 59px;
  227. background: #fff;
  228. display: flex;
  229. border:2px solid #3494ff;
  230. padding-right: 35px;
  231. align-items: center;
  232. .icon{
  233. width: 30px;
  234. height: 30px;
  235. background: url('../../assets/images/sunVillage_info/fixedAssets_icon_1.png') no-repeat;
  236. background-size: 100% 100%;
  237. display: block;
  238. margin:0 8px 0 26px;
  239. }
  240. .ipt{
  241. flex: 1;
  242. font-size: 26px;
  243. background: none;
  244. border:0 none;
  245. line-height: 59px;
  246. }
  247. }
  248. .total{
  249. flex: 1;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. font-size: 26px;
  254. color: #858585;
  255. }
  256. }
  257. .list_main{
  258. padding:0 22px;
  259. .item{
  260. height: 207px;
  261. border-radius: 30px;
  262. background: #fff;
  263. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  264. margin-bottom: 20px;
  265. .item_box{
  266. padding:25px 32px;
  267. }
  268. .head_block{
  269. height: 56px;
  270. display: flex;
  271. align-items: center;
  272. width: 100%;
  273. .icon{
  274. width: 34px;
  275. height: 30px;
  276. background: url('../../assets/images/sunVillage_info/fixedAssets_icon_2.png') no-repeat;
  277. background-size: 100% 100%;
  278. display: block;
  279. margin-right: 12px;
  280. }
  281. .title{
  282. flex:1;
  283. font-size: 32px;
  284. color: #252525;
  285. overflow: hidden;
  286. text-overflow: ellipsis;
  287. white-space: nowrap;
  288. padding-right: 20px;
  289. }
  290. }
  291. .order_block{
  292. height: 50px;
  293. display: flex;
  294. align-items: center;
  295. width: 100%;
  296. .order{
  297. flex: 1;
  298. font-size: 26px;
  299. color: #252525;
  300. }
  301. .describe{
  302. font-size: 26px;
  303. display: flex;
  304. align-items: center;
  305. &.suspend{
  306. color: #f69600;
  307. .icon{
  308. width: 27px;
  309. height: 26px;
  310. background: url('../../assets/images/sunVillage_info/information_icon_1.png') no-repeat;
  311. background-size: 100% 100%;
  312. display: block;
  313. margin-left: 15px;
  314. }
  315. }
  316. &.normal{
  317. color: #69c100;
  318. .icon{
  319. width: 32px;
  320. height: 26px;
  321. background: url('../../assets/images/sunVillage_info/information_icon_2.png') no-repeat;
  322. background-size: 100% 100%;
  323. display: block;
  324. margin-left: 15px;
  325. }
  326. }
  327. &.undo{
  328. color: #858585;
  329. .icon{
  330. width: 27px;
  331. height: 26px;
  332. background: url('../../assets/images/sunVillage_info/information_icon_3.png') no-repeat;
  333. background-size: 100% 100%;
  334. display: block;
  335. margin-left: 15px;
  336. }
  337. }
  338. }
  339. }
  340. .function_block{
  341. height: 50px;
  342. display: flex;
  343. align-items: center;
  344. width: 100%;
  345. .value{
  346. flex: 1;
  347. font-size: 24px;
  348. color: #252525;
  349. .amount{
  350. color: #eb1616;
  351. }
  352. }
  353. .startStop_time{
  354. display: flex;
  355. align-items: center;
  356. .time{
  357. display: flex;
  358. align-items: center;
  359. font-size: 24px;
  360. color: #002022;
  361. margin-left: 25px;
  362. .unim{
  363. width: 32px;
  364. height: 32px;
  365. font-size: 22px;
  366. color: #fff;
  367. text-align: center;
  368. line-height: 32px;
  369. border-radius: 6px;
  370. margin-right: 8px;
  371. &.start{background: #3e7df2;}
  372. &.stop{background: #eb1616;}
  373. }
  374. }
  375. }
  376. }
  377. // <div class="function_block">
  378. // <div class="value">合同金额<span class="amount">¥199.00</span></div>
  379. // <div class="startStop_time">
  380. // <div class="time"><div class="unim">起</div>2022.05.04</div>
  381. // <div class="time"><div class="unim">起</div>2022.05.04</div>
  382. // </div>
  383. // </div>
  384. }
  385. }
  386. .bottom_tips{
  387. font-size: 24px;
  388. color: #a7a6a6;
  389. text-align: center;
  390. margin-top: 32px;
  391. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  392. background-size: 260px 2px;
  393. .xs{
  394. padding:0 8px;
  395. background: #e9e9e9;
  396. }
  397. }
  398. /deep/ .van-swipe-cell__right{
  399. display: flex;
  400. align-items: center;
  401. width: 150PX;
  402. margin-left: 5PX;
  403. a,div{
  404. margin: 0;
  405. display: flex;
  406. align-items: center;
  407. justify-content: center;
  408. color: #ffffff;
  409. font-size: 14PX;
  410. height: 100%;
  411. flex: 1;
  412. }
  413. }
  414. }
  415. </style>