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

544 regels
16 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <!-- 头部开始 -->
  4. <van-nav-bar
  5. title="确认订单"
  6. fixed
  7. placeholder
  8. left-arrow
  9. @click-left="onClickLeft"
  10. />
  11. <!-- 头部结束 -->
  12. <!-- 内容开始 -->
  13. <div class="main">
  14. <div class="main_content_right_list">
  15. <div class="main_content_right_list_header">
  16. <p class="on">商品信息</p>
  17. <p>{{productType}}</p>
  18. <p>服务</p>
  19. </div>
  20. <div class="main_content_right_list_center">
  21. <img :src="supplyDemand.supplyMasterMap" style="width: 25vw;height: 25vw;">
  22. <div class="main_content_right_list_content">
  23. <p class="tt">{{supplyDemand.supplyDemandName}}</p>
  24. <div class="tab">
  25. <p>¥<span>{{supplyDemand.unitPrice}}</span>/{{supplyDemand.unit}}</p>
  26. </div>
  27. </div>
  28. </div>
  29. <van-cell title="卖方名称" :border="false" :value="supplyDemand.entityName" />
  30. <van-cell title="联系人" :border="false" :value="supplyDemand.linker" />
  31. <van-cell title="联系电话" :border="false" :value="supplyDemand.supplyDemandTal" />
  32. </div>
  33. <div class="main_content_right_list">
  34. <div class="main_content_right_list_header">
  35. <p class="on">买家信息</p>
  36. </div>
  37. <van-cell title="联系人" :border="false" :value="user.nickName" />
  38. <van-cell title="联系电话" :border="false" :value="user.phonenumber" />
  39. <van-cell title="服务地点" :border="false" :value="user.deptName" />
  40. </div>
  41. <div class="main_content_right_list">
  42. <div class="main_content_right_list_header">
  43. <p class="on">订单信息</p>
  44. </div>
  45. <van-field
  46. readonly
  47. clickable
  48. required
  49. :border="false"
  50. :rules="[{ required: true , message:'请选择服务合同'}]"
  51. v-model="contractionName"
  52. label="服务合同"
  53. placeholder="请选择服务合同"
  54. @click="showfwht = true"
  55. input-align="right"
  56. right-icon="arrow-down"
  57. label-width="auto"
  58. />
  59. <van-popup v-model="showfwht" position="bottom">
  60. <van-picker
  61. show-toolbar
  62. :columns="fwhtOptions"
  63. value-key="contractionName"
  64. @confirm="onConfirmFwht"
  65. @cancel="showfwht = false"
  66. />
  67. </van-popup>
  68. <!-- <van-field label="服务合同" v-model="supplyDemand.fwhtId" :border="false" input-align="right" placeholder="请输入服务合同" />-->
  69. <van-field readonly label="服务作物" v-model="cropType" :border="false" input-align="right" placeholder="服务作物" />
  70. <!-- <van-field label="下单时间" v-model="supplyDemand.orderAt" :border="false" input-align="right" placeholder="请输入下单时间" />-->
  71. <van-field
  72. readonly
  73. clickable
  74. required
  75. :border="false"
  76. :rules="[{ required: true , message:'请选择下单时间'}]"
  77. v-model="supplyDemand.orderAt"
  78. label="下单时间"
  79. placeholder="请选择下单时间"
  80. @click="showOrderAt = true"
  81. input-align="right"
  82. right-icon="arrow-down"
  83. label-width="auto"
  84. />
  85. <van-popup v-model="showOrderAt" position="bottom">
  86. <van-datetime-picker
  87. v-model="orderAt"
  88. @confirm="onConfirmOrderAt"
  89. type="date"
  90. title="选择年月"
  91. />
  92. </van-popup>
  93. <van-field
  94. readonly
  95. clickable
  96. required
  97. :border="false"
  98. :rules="[{ required: true , message:'请选择服务时间'}]"
  99. v-model="supplyDemand.serviceAt"
  100. label="服务时间"
  101. placeholder="请选择服务时间"
  102. @click="showServiceAt = true"
  103. input-align="right"
  104. right-icon="arrow-down"
  105. label-width="auto"
  106. />
  107. <van-popup v-model="showServiceAt" position="bottom">
  108. <van-datetime-picker
  109. v-model="serviceAt"
  110. @confirm="onConfirmServiceAt"
  111. type="date"
  112. title="选择年月"
  113. />
  114. </van-popup>
  115. <van-field label="服务数量" :border="false" input-align="right" >
  116. <template #input>
  117. <van-stepper v-model="supplyDemand.serviceNum" />
  118. </template>
  119. </van-field>
  120. <van-field label="数量单位" v-model="supplyDemand.numUnit" :border="false" input-align="right" placeholder="请输入数量单位" />
  121. <van-field label="备注" v-model="supplyDemand.serviceRemark" :border="false" input-align="right" placeholder="请输入备注" />
  122. </div>
  123. </div>
  124. <div class="main_btn">
  125. <p @click="placeOrder">下单</p>
  126. <p @click="onClickLeft">取消</p>
  127. </div>
  128. <!-- 内容结束 -->
  129. </div>
  130. </template>
  131. <script>
  132. import Cookies from "js-cookie";
  133. import {productTypes, supplyDemandGet,fwhtList,placeOrder} from "@/api/agriculturalTrusteeship";
  134. import {getInfo} from "@/api/login";
  135. import request from "@/utils/request";
  136. export default {
  137. name: "agriculturalTrusteeshipIndex",
  138. data() {
  139. return {
  140. activeKey: 0,
  141. active: 0,
  142. loading: false,
  143. finished: false,
  144. showfwht: false,
  145. show:true,
  146. orderAt:new Date(),
  147. showOrderAt: false,
  148. serviceAt:new Date(),
  149. showServiceAt: false,
  150. activeNames:[],
  151. supplyDemand:{
  152. },
  153. projectTypeOptions:[],
  154. productList:[],
  155. productList1:[],
  156. demandTypeOptions:[],
  157. productTypeOptions:[],
  158. supplyMasterMapArr:[],
  159. bodyTypeOptions:[],
  160. fwhtOptions:[],
  161. user:{},
  162. fwht:'',
  163. contractionName:'',
  164. productType:'',
  165. cropType:''
  166. };
  167. },
  168. created() {
  169. getInfo().then(response => {
  170. this.user = response.user;
  171. fwhtList({deptId: response.user.loginDeptId,bookId:'0', contractionStatus: '1'}).then(response => {
  172. this.fwhtOptions = response.rows;
  173. });
  174. });
  175. let query = {
  176. parentId : null,
  177. tree : false
  178. }
  179. productTypes(query).then(response => {
  180. this.productList = response.data;
  181. });
  182. this.getDicts("newBusinessEntity_statistics_project").then(response => {
  183. for (var i = 0; i < response.data.length; i++) {
  184. this.projectTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  185. }
  186. this.bodyTypeOptions = response.data;
  187. });
  188. this.getDicts("crop_type").then(response => {
  189. this.cropTypeOptions = response.data;
  190. });
  191. this.getDetail();
  192. },
  193. methods: {
  194. getDetail(){
  195. supplyDemandGet(this.$route.query.id).then(response => {
  196. response.data.bodyType = this.selectDictLabel(this.bodyTypeOptions, response.data.bodyType);
  197. this.productType = this.productList.filter(function (e) { return e.id == response.data.productType; })[0].dictName;
  198. if (response.data.supplyMasterMap){
  199. var attachement = response.data.supplyMasterMap.split( "," );
  200. response.data.supplyMasterMap = '/api' + attachement[0];
  201. }
  202. response.data.serviceNum = 1;
  203. this.supplyDemand = response.data;
  204. });
  205. },
  206. onConfirmFwht(val){
  207. this.contractionName = val.contractionName;
  208. this.supplyDemand.fwhtId = val.id;
  209. this.cropType = this.selectDictLabel(this.cropTypeOptions, val.cropType);
  210. this.supplyDemand.cropType = val.cropType;
  211. this.showfwht = false;
  212. },
  213. onConfirmOrderAt(data){
  214. this.supplyDemand.orderAt = this.format(data,'yyyy-MM-dd');
  215. this.orderAt = data;
  216. this.showOrderAt = false;
  217. },
  218. onConfirmServiceAt(data){
  219. console.log(data)
  220. this.supplyDemand.serviceAt = this.format(data,'yyyy-MM-dd');
  221. this.serviceAt = data;
  222. this.showServiceAt = false;
  223. },
  224. placeOrder(){
  225. console.log(this.supplyDemand)
  226. this.supplyDemand.demandId = this.$route.query.id;
  227. this.supplyDemand.id = '';
  228. this.supplyDemand.linkera = this.user.nickName
  229. this.supplyDemand.phonea = this.user.phonenumber
  230. this.supplyDemand.serviceAddress = this.user.deptName
  231. placeOrder(this.supplyDemand).then(response => {
  232. if(response.code=="200"){
  233. this.$notify({ type: 'success', message: '下单成功' });
  234. setTimeout(function(){
  235. history.back(-1);
  236. },2000)
  237. }
  238. });
  239. }
  240. },
  241. }
  242. </script>
  243. <style scoped lang="scss">
  244. .home_wrapper{
  245. }
  246. /deep/ .van-cell--required::before{
  247. left: 17vw;
  248. }
  249. /*头部*/
  250. .header{
  251. display: flex;
  252. align-items: center;
  253. justify-content: space-between;
  254. padding: 2vh 4% 0vh;
  255. }
  256. .search{
  257. display: flex;
  258. justify-content: space-between;
  259. align-items: center;
  260. border: 1px solid #6E93F3;
  261. padding: 1PX 1PX 1PX 12PX ;
  262. border-radius: 50PX;
  263. margin-right: 30PX;
  264. flex: 1;
  265. input{
  266. flex: 1;
  267. background: transparent;
  268. margin-left: 10PX;
  269. }
  270. }
  271. /*导航栏目*/
  272. .nav{
  273. width: 94%;
  274. margin: 0 auto;
  275. margin-top: 2vh;
  276. padding: 1.5vh 3%;
  277. background: #ffffff;
  278. border-radius: 10PX;
  279. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  280. .date{
  281. display: flex;
  282. justify-content: space-around;
  283. align-items: center;
  284. p{
  285. border-radius: 1rem;
  286. padding: 5PX 0PX 5PX 5%;
  287. width: 40%;
  288. text-align: center;
  289. color: #334281;
  290. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  291. background:#D6D9E6 url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 20% center no-repeat;
  292. }
  293. }
  294. .billCount {
  295. display: flex;
  296. text-align: center;
  297. margin-top: 3vh;
  298. .billCount_left{
  299. width: 50%;
  300. color: #1B5DEA;
  301. p{
  302. &:nth-child(1){
  303. font-size: .45rem;
  304. }
  305. }
  306. }
  307. .billCount_right{
  308. width: 50%;
  309. color: #FF5E00;
  310. p{
  311. &:nth-child(1){
  312. font-size: .45rem;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. /*内容*/
  319. .main{
  320. width: 94%;
  321. margin: 0 auto;
  322. .main_content_right_list{
  323. margin-top: 2vh;
  324. padding: 1.5vh 3%;
  325. background: #ffffff;
  326. border-radius: 10PX;
  327. /*box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);*/
  328. /deep/ .van-cell{
  329. padding: 0;
  330. margin-top: 10PX;
  331. }
  332. .main_content_right_list_header{
  333. display: flex;
  334. margin-bottom: 1vh;
  335. align-items: center;
  336. p{
  337. padding: 3PX 10PX;
  338. border-radius: 8PX;
  339. &:nth-child(2){background: #2B7EEC;color: #ffffff;margin-left: auto;}
  340. &:nth-child(3){background: #E2E9FD;color: #497CE8;margin-left: 10PX;}
  341. }
  342. .on{
  343. color: #334281;
  344. border-radius: initial;
  345. padding:0 0 0 20PX;
  346. font-size: 0.35rem;
  347. background: url("../../../../static/images/agriculturalTrusteeship/socialization/bill_icon_01.png") no-repeat left center
  348. }
  349. .off{
  350. color: #E60505;
  351. border-radius: initial;
  352. margin-left: auto;
  353. padding:0 0 0 15PX;
  354. background: url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_off.png") no-repeat left center
  355. }
  356. }
  357. .main_content_right_list_center{
  358. display: flex;
  359. img{
  360. border-radius: 15PX;
  361. margin-right: 4%;
  362. }
  363. .main_content_right_list_content{
  364. display: flex;
  365. flex-direction:column;
  366. justify-content: space-between;
  367. .tt{
  368. color: #333333;
  369. font-size: .35rem;
  370. }
  371. .tab{
  372. display: flex;
  373. justify-content: space-between;
  374. p{
  375. &:nth-child(1){
  376. flex: 1;
  377. color: #FF5E00;
  378. span{
  379. font-size: .4rem;
  380. }
  381. }
  382. &:nth-child(2){
  383. span{
  384. display: inline-block;
  385. text-align: center;
  386. padding: 2PX 5PX;
  387. &:nth-child(1){
  388. color: #497CE8;
  389. background: #E2E9FD;
  390. border-top-left-radius: 10PX;
  391. }
  392. &:nth-child(2){
  393. color: #ffffff;
  394. background-image: linear-gradient(to right , #5D87FA , #5FD5F5);
  395. border-bottom-right-radius: 10PX;
  396. }
  397. }
  398. }
  399. }
  400. }
  401. .name{
  402. color: #7A7A7A;
  403. span{
  404. &:nth-child(2){
  405. margin-left: 5PX;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. /*弹出层*/
  414. .popup_header{
  415. display: flex;
  416. align-items: center;
  417. color: #334281;
  418. font-size: .38rem;
  419. margin-bottom: 15PX;
  420. img{
  421. margin-right: 10PX;
  422. display: block;
  423. }
  424. p{
  425. line-height: 1;
  426. }
  427. }
  428. .popup_content{
  429. .selected{
  430. .on{
  431. font-size: .35rem;
  432. padding: 10PX 20PX;
  433. color: #334281;
  434. background: url("../../../../static/images/agriculturalTrusteeship/socialization/down.png")left center no-repeat;
  435. }
  436. .off{
  437. font-size: .35rem;
  438. padding: 10PX 20PX;
  439. color: #334281;
  440. background: url("../../../../static/images/agriculturalTrusteeship/socialization/right.png")left center no-repeat;
  441. }
  442. .options{
  443. display: flex;
  444. justify-content: space-between;
  445. flex-wrap: wrap;
  446. p{
  447. background: #F5F5F5;
  448. color: #8F8F8F;
  449. width: 30%;
  450. padding: 5PX 0;
  451. border-radius: 5PX;
  452. text-align: center;
  453. &.active{
  454. background: #E2E9FD;
  455. color: #1B5DEA;
  456. }
  457. }
  458. }
  459. }
  460. }
  461. .popup_date{
  462. display: flex;
  463. justify-content: space-around;
  464. align-items: center;
  465. p{
  466. border-radius: 1rem;
  467. padding: 5PX 0PX 5PX 5%;
  468. width: 45%;
  469. text-align: center;
  470. color: #1B5DEA;
  471. background:#E2E9FD url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 15% center no-repeat;
  472. }
  473. }
  474. .popup_btn{
  475. position: fixed;
  476. bottom: 5vh;
  477. display: flex;
  478. align-items: center;
  479. justify-content: space-between;
  480. width: 94%;
  481. left: 3%;
  482. p{
  483. width: 30%;
  484. padding: 7PX 0;
  485. border-radius: 5rem;
  486. text-align: center;
  487. font-size: .35rem;
  488. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  489. &:nth-child(1){
  490. background: #1B5DEA;
  491. color: #ffffff;
  492. }
  493. &:nth-child(2){
  494. border: 1PX solid #1B5DEA;
  495. color: #1B5DEA;
  496. }
  497. &:nth-child(3){
  498. background-image: linear-gradient(to right , #6E93F3 , #54C6E4);
  499. color: #ffffff;
  500. }
  501. }
  502. }
  503. .main_btn{
  504. display: flex;
  505. justify-content: space-around;
  506. padding: 4vh 0;
  507. p{
  508. font-size: .4rem;
  509. width: 35%;
  510. text-align: center;
  511. padding: 10PX 0;
  512. border-radius: 5rem;
  513. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  514. &:nth-child(1){
  515. background: #334281;
  516. color: #ffffff;
  517. }
  518. &:nth-child(2){
  519. background: #D1D5E4;
  520. color: #334281;
  521. }
  522. }
  523. }
  524. </style>