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

504 lines
16 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <!-- 头部开始 -->
  4. <div class="header">
  5. <div class="search">
  6. <img src="../../../../static/images/agriculturalTrusteeship/index/search_icon_01.png" />
  7. <input type="text" placeholder="输入需求进行搜索" />
  8. <img src="../../../../static/images/agriculturalTrusteeship/index/search_icon_02.png" />
  9. </div>
  10. <!-- <img src="../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_01.png" alt="" @click="show = true;">-->
  11. </div>
  12. <!-- 头部结束 -->
  13. <!-- 导航开始 -->
  14. <div class="nav">
  15. <div class="date">
  16. <p @click="startTimeShow = true">{{startOrderAt}}</p>
  17. <span>-</span>
  18. <p @click="endTimeShow = true">{{endOrderAt}}</p>
  19. </div>
  20. <van-popup v-model="startTimeShow" position="bottom">
  21. <van-datetime-picker
  22. v-model="currentDateStar"
  23. @confirm="onConfirmStar"
  24. type="year-month"
  25. title="选择年月"
  26. />
  27. </van-popup>
  28. <van-popup v-model="endTimeShow" position="bottom">
  29. <van-datetime-picker
  30. v-model="currentDateEnd"
  31. @confirm="onConfirmEnd"
  32. type="year-month"
  33. title="选择年月"
  34. />
  35. </van-popup>
  36. <div class="nav_list">
  37. <p class="active">全部</p>
  38. <p v-for="(item,index) in orderStatusOptions" :key="index">{{item.dictLabel}}</p>
  39. </div>
  40. </div>
  41. <!-- 导航结束 -->
  42. <!-- 内容开始 -->
  43. <div class="main">
  44. <van-list
  45. v-model="loading"
  46. :finished="finished"
  47. finished-text="没有更多了"
  48. @load="getList"
  49. >
  50. <!-- @load="onLoad" v-for="item in 10" :key="item"-->
  51. <div class="main_content_right_list" v-for="(item,index) in supplyDemandList" :key="index">
  52. <div class="main_content_right_list_header">
  53. <p>{{item.productType}}</p>
  54. <p>服务</p>
  55. <p :class="{'off': item.orderStatus== '已拒单','on': item.orderStatus!= '已拒单'}">{{item.orderStatus}}</p>
  56. </div>
  57. <!-- $router.push({name:'agriculturalTrusteeshipBillDetail2',query:{id:item.id}})-->
  58. <div class="main_content_right_list_center" @click="goDetail(item.orderStatus,item.id)">
  59. <img src="../../../../static/images/agriculturalTrusteeship/index/test.png">
  60. <div class="main_content_right_list_content">
  61. <p class="tt">{{item.contractionName}}</p>
  62. <div class="tab">
  63. <p>¥<span>{{item.realityServiceMoney}}</span>.00</p>
  64. </div>
  65. <p class="name">
  66. <span>数量:{{item.serviceNum}}</span>
  67. <span>作物:{{item.cropType}}</span>
  68. </p>
  69. </div>
  70. </div>
  71. <van-cell title="买方名称" :border="false" :value="item.bookName" />
  72. <van-cell title="联系人" :border="false" :value="item.linkera" />
  73. <van-cell title="联系电话" :border="false" :value="item.phonea" />
  74. </div>
  75. <!-- <div class="main_content_right_list">-->
  76. <!-- <div class="main_content_right_list_header">-->
  77. <!-- <p>灌溉</p>-->
  78. <!-- <p>服务</p>-->
  79. <!-- <p class="on">已评分</p>-->
  80. <!-- </div>-->
  81. <!-- <div class="main_content_right_list_center" @click="$router.push({name:'agriculturalTrusteeshipBillDetail3'})">-->
  82. <!-- <img src="../../../../static/images/agriculturalTrusteeship/index/test.png">-->
  83. <!-- <div class="main_content_right_list_content">-->
  84. <!-- <p class="tt">如果只有一行就空着啊啊啊啊啊啊啊啊啊啊啊啊</p>-->
  85. <!-- <div class="tab">-->
  86. <!-- <p>¥<span>165,836,365</span>.00</p>-->
  87. <!-- </div>-->
  88. <!-- <p class="name">-->
  89. <!-- <span>数量:300</span>-->
  90. <!-- <span>作物:玉米</span>-->
  91. <!-- </p>-->
  92. <!-- </div>-->
  93. <!-- </div>-->
  94. <!-- <van-cell title="买方名称" :border="false" value="张三李四联合合作社" />-->
  95. <!-- <van-cell title="联系人" :border="false" value="林晓春" />-->
  96. <!-- <van-cell title="联系电话" :border="false" value="165 8874 0311" />-->
  97. <!-- </div>-->
  98. <!-- <div class="main_content_right_list">-->
  99. <!-- <div class="main_content_right_list_header">-->
  100. <!-- <p>灌溉</p>-->
  101. <!-- <p>服务</p>-->
  102. <!-- <p class="off">已拒单</p>-->
  103. <!-- </div>-->
  104. <!-- <div class="main_content_right_list_center" @click="$router.push({name:'agriculturalTrusteeshipBillDetail4'})">-->
  105. <!-- <img src="../../../../static/images/agriculturalTrusteeship/index/test.png">-->
  106. <!-- <div class="main_content_right_list_content">-->
  107. <!-- <p class="tt">如果只有一行就空着啊啊啊啊啊啊啊啊啊啊啊啊</p>-->
  108. <!-- <div class="tab">-->
  109. <!-- <p>¥<span>165,836,365</span>.00</p>-->
  110. <!-- </div>-->
  111. <!-- <p class="name">-->
  112. <!-- <span>数量:300</span>-->
  113. <!-- <span>作物:玉米</span>-->
  114. <!-- </p>-->
  115. <!-- </div>-->
  116. <!-- </div>-->
  117. <!-- <van-cell title="买方名称" :border="false" value="张三李四联合合作社" />-->
  118. <!-- <van-cell title="联系人" :border="false" value="林晓春" />-->
  119. <!-- <van-cell title="联系电话" :border="false" value="165 8874 0311" />-->
  120. <!-- </div>-->
  121. </van-list>
  122. </div>
  123. <!-- 内容结束 -->
  124. <buyer></buyer>
  125. </div>
  126. </template>
  127. <script>
  128. import Cookies from "js-cookie";
  129. import buyer from "@/components/common/buyer_footer";
  130. import {productTypes, supplyorderList} from "@/api/agriculturalTrusteeship";
  131. export default {
  132. name: "agriculturalTrusteeshipIndex",
  133. components: {
  134. buyer,
  135. },
  136. data() {
  137. return {
  138. activeKey: 0,
  139. active: 0,
  140. loading: false,
  141. finished: false,
  142. show:true,
  143. activeNames:[],
  144. showDialog:false,
  145. startTimeShow:false,
  146. endTimeShow:false,
  147. supplyDemandList:[],
  148. cropTypeOptions:[],
  149. orderStatusOptions:[],
  150. productList:[],
  151. currentDateStar: new Date(),
  152. currentDateEnd: new Date(),
  153. query:{
  154. orderByColumn:'order_at',
  155. isAsc:'asc',
  156. demandName :'',
  157. startOrderAt :'',
  158. endOrderAt :'',
  159. orderStatus :'',
  160. },
  161. startOrderAt:this.format(new Date(),'yyyy年MM月'),
  162. endOrderAt:this.format(new Date(),'yyyy年MM月'),
  163. params : {
  164. startOrderAt:this.format(new Date(),'yyyy-MM'),
  165. endOrderAt:this.format(new Date(),'yyyy-MM'),
  166. },
  167. content:''
  168. };
  169. },
  170. created() {
  171. let query = {
  172. parentId : 0,
  173. tree:true
  174. }
  175. productTypes(query).then(response => {
  176. this.productList = response.data;
  177. });
  178. this.getDicts("crop_type").then(response => {
  179. this.cropTypeOptions = response.data;
  180. });
  181. this.getDicts("service_order_status").then(response => {
  182. this.orderStatusOptions = response.data;
  183. });
  184. },
  185. methods: {
  186. getList(){
  187. supplyorderList(this.query).then(response => {
  188. response.rows.map(res=>{
  189. res.cropType = this.selectDictLabel(this.cropTypeOptions, res.cropType);
  190. res.orderStatus = this.selectDictLabel(this.orderStatusOptions, res.orderStatus);
  191. res.productType = this.productList.filter(function (e) { return e.id == res.productType; })[0].dictName;
  192. this.supplyDemandList.push(res);
  193. })
  194. if(this.supplyDemandList.length >= response.total){
  195. this.finished = true;
  196. return;
  197. }else{
  198. this.loading = false;
  199. this.query.pageNum += 1 ;
  200. }
  201. });
  202. },
  203. onConfirmStar(data){
  204. this.params.startOrderAt = this.format(data,'yyyy-mm');
  205. this.query.startOrderAt = this.format(data,'yyyy-mm');
  206. this.startOrderAt = this.format(data,'yyyy年MM月');
  207. this.startTimeShow = false;
  208. // orderStatistics(this.params).then(response => {
  209. // this.content = response.data;
  210. // });
  211. this.getList();
  212. },
  213. onConfirmEnd(data){
  214. this.params.endOrderAt = this.format(data,'yyyy-mm');
  215. this.query.endOrderAt = this.format(data,'yyyy-mm');
  216. this.endOrderAt = this.format(data,'yyyy年MM月');
  217. this.endTimeShow = false;
  218. // orderStatistics(this.params).then(response => {
  219. // this.content = response.data;
  220. // });
  221. this.getList();
  222. },
  223. goDetail(type,id){
  224. if (type == '已接单'){
  225. this.$router.push({name:'agriculturalTrusteeshipBillDetail2',query:{id:id}})
  226. }
  227. if (type == '已评价'){
  228. this.$router.push({name:'agriculturalTrusteeshipBillDetail3',query:{id:id}})
  229. }
  230. if (type == '已拒单'){
  231. this.$router.push({name:'agriculturalTrusteeshipBillDetail4',query:{id:id}})
  232. }
  233. },
  234. openDialog(val){
  235. this.showDialog = val
  236. },
  237. },
  238. }
  239. </script>
  240. <style scoped lang="scss">
  241. .home_wrapper{
  242. background: #F9F9F9;
  243. }
  244. /*头部*/
  245. .header{
  246. display: flex;
  247. align-items: center;
  248. justify-content: space-between;
  249. padding: 2vh 4% 0vh;
  250. }
  251. .search{
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. border: 1px solid #6E93F3;
  256. padding: 1PX 1PX 1PX 12PX ;
  257. border-radius: 50PX;
  258. /*margin-right: 30PX;*/
  259. flex: 1;
  260. input{
  261. flex: 1;
  262. background: transparent;
  263. margin-left: 10PX;
  264. }
  265. }
  266. /*导航栏目*/
  267. .nav{
  268. width: 94%;
  269. margin: 0 auto;
  270. padding: 2vh 0 0;
  271. /*background: #ffffff;*/
  272. /*border-radius: 10PX;*/
  273. /*box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);*/
  274. .date{
  275. display: flex;
  276. justify-content: space-around;
  277. align-items: center;
  278. p{
  279. border-radius: 1rem;
  280. padding: 5PX 0PX 5PX 5%;
  281. width: 40%;
  282. text-align: center;
  283. color: #334281;
  284. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  285. background:#D6D9E6 url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 20% center no-repeat;
  286. }
  287. }
  288. .nav_list{
  289. display: flex;
  290. justify-content: space-between;
  291. align-items: center;
  292. margin-top: 2vh;
  293. p{
  294. background: #F0F0F0;
  295. padding: 7PX 0;
  296. width: 18%;
  297. text-align: center;
  298. color: #888888;
  299. border-radius: 7PX;
  300. &.active{
  301. background: #E2E9FD;
  302. color: #1B5DEA;
  303. }
  304. }
  305. }
  306. }
  307. /*内容*/
  308. .main{
  309. width: 94%;
  310. margin: 0 auto;
  311. .main_content_right_list{
  312. margin-top: 2vh;
  313. padding: 1.5vh 3%;
  314. background: #ffffff;
  315. border-radius: 10PX;
  316. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  317. /deep/ .van-cell{
  318. padding: 0;
  319. margin-top: 8PX;
  320. }
  321. .main_content_right_list_header{
  322. display: flex;
  323. margin-bottom: 1vh;
  324. align-items: center;
  325. p{
  326. padding: 3PX 10PX;
  327. border-radius: 8PX;
  328. &:nth-child(1){background: #2B7EEC;color: #ffffff;}
  329. &:nth-child(2){background: #E2E9FD;color: #497CE8;margin-left: 10PX;}
  330. }
  331. .on{
  332. color: #39BD18;
  333. border-radius: initial;
  334. margin-left: auto;
  335. padding:0 0 0 20PX;
  336. background: url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_on.png") no-repeat left center
  337. }
  338. .off{
  339. color: #E60505;
  340. border-radius: initial;
  341. margin-left: auto;
  342. padding:0 0 0 20PX;
  343. background: url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_off.png") no-repeat left center
  344. }
  345. }
  346. .main_content_right_list_center{
  347. display: flex;
  348. img{
  349. border-radius: 15PX;
  350. margin-right: 4%;
  351. }
  352. .main_content_right_list_content{
  353. display: flex;
  354. flex-direction:column;
  355. justify-content: space-between;
  356. .tt{
  357. color: #333333;
  358. font-size: .35rem;
  359. }
  360. .tab{
  361. display: flex;
  362. justify-content: space-between;
  363. p{
  364. &:nth-child(1){
  365. flex: 1;
  366. color: #FF5E00;
  367. span{
  368. font-size: .4rem;
  369. }
  370. }
  371. &:nth-child(2){
  372. span{
  373. display: inline-block;
  374. text-align: center;
  375. padding: 2PX 5PX;
  376. &:nth-child(1){
  377. color: #497CE8;
  378. background: #E2E9FD;
  379. border-top-left-radius: 10PX;
  380. }
  381. &:nth-child(2){
  382. color: #ffffff;
  383. background-image: linear-gradient(to right , #5D87FA , #5FD5F5);
  384. border-bottom-right-radius: 10PX;
  385. }
  386. }
  387. }
  388. }
  389. }
  390. .name{
  391. color: #7A7A7A;
  392. span{
  393. &:nth-child(2){
  394. margin-left: 5PX;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. /*弹出层*/
  403. .popup_header{
  404. display: flex;
  405. align-items: center;
  406. color: #334281;
  407. font-size: .38rem;
  408. margin-bottom: 15PX;
  409. img{
  410. margin-right: 10PX;
  411. display: block;
  412. }
  413. p{
  414. line-height: 1;
  415. }
  416. }
  417. .popup_content{
  418. .selected{
  419. .on{
  420. font-size: .35rem;
  421. padding: 10PX 20PX;
  422. color: #334281;
  423. background: url("../../../../static/images/agriculturalTrusteeship/socialization/down.png")left center no-repeat;
  424. }
  425. .off{
  426. font-size: .35rem;
  427. padding: 10PX 20PX;
  428. color: #334281;
  429. background: url("../../../../static/images/agriculturalTrusteeship/socialization/right.png")left center no-repeat;
  430. }
  431. .options{
  432. display: flex;
  433. justify-content: space-between;
  434. flex-wrap: wrap;
  435. p{
  436. background: #F5F5F5;
  437. color: #8F8F8F;
  438. width: 30%;
  439. padding: 5PX 0;
  440. border-radius: 5PX;
  441. text-align: center;
  442. &.active{
  443. background: #E2E9FD;
  444. color: #1B5DEA;
  445. }
  446. }
  447. }
  448. }
  449. }
  450. .popup_date{
  451. display: flex;
  452. justify-content: space-around;
  453. align-items: center;
  454. p{
  455. border-radius: 1rem;
  456. padding: 5PX 0PX 5PX 5%;
  457. width: 45%;
  458. text-align: center;
  459. color: #1B5DEA;
  460. background:#E2E9FD url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 15% center no-repeat;
  461. }
  462. }
  463. .popup_btn{
  464. position: fixed;
  465. bottom: 5vh;
  466. display: flex;
  467. align-items: center;
  468. justify-content: space-between;
  469. width: 94%;
  470. left: 3%;
  471. p{
  472. width: 30%;
  473. padding: 7PX 0;
  474. border-radius: 5rem;
  475. text-align: center;
  476. font-size: .35rem;
  477. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  478. &:nth-child(1){
  479. background: #1B5DEA;
  480. color: #ffffff;
  481. }
  482. &:nth-child(2){
  483. border: 1PX solid #1B5DEA;
  484. color: #1B5DEA;
  485. }
  486. &:nth-child(3){
  487. background-image: linear-gradient(to right , #6E93F3 , #54C6E4);
  488. color: #ffffff;
  489. }
  490. }
  491. }
  492. </style>