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

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