移动端
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

placeOrder.vue 16 KiB

2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
2 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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 : ''
  177. }
  178. let query1 = {
  179. tree : true
  180. }
  181. productTypes(query).then(response => {
  182. this.productList = response.data;
  183. });
  184. productTypes(query1).then(response => {
  185. this.productList1 = response.data;
  186. });
  187. this.getDicts("newBusinessEntity_statistics_project").then(response => {
  188. for (var i = 0; i < response.data.length; i++) {
  189. this.projectTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  190. }
  191. this.bodyTypeOptions = response.data;
  192. });
  193. this.getDicts("crop_type").then(response => {
  194. this.cropTypeOptions = response.data;
  195. });
  196. this.getDetail();
  197. },
  198. methods: {
  199. getDetail(){
  200. supplyDemandGet(this.$route.query.id).then(response => {
  201. response.data.bodyType = this.selectDictLabel(this.bodyTypeOptions, response.data.bodyType);
  202. this.productType = this.productList1.filter(function (e) { return e.id == response.data.productType; })[0].dictName;
  203. if (response.data.supplyMasterMap){
  204. var attachement = response.data.supplyMasterMap.split( "," );
  205. response.data.supplyMasterMap = '/api' + attachement[0];
  206. }
  207. response.data.serviceNum = 1;
  208. this.supplyDemand = response.data;
  209. });
  210. },
  211. onConfirmFwht(val){
  212. this.contractionName = val.contractionName;
  213. this.supplyDemand.fwhtId = val.id;
  214. this.cropType = this.selectDictLabel(this.cropTypeOptions, val.cropType);
  215. this.supplyDemand.cropType = val.cropType;
  216. this.showfwht = false;
  217. },
  218. onConfirmOrderAt(data){
  219. this.supplyDemand.orderAt = this.format(data,'yyyy-MM-dd');
  220. this.orderAt = data;
  221. this.showOrderAt = false;
  222. },
  223. onConfirmServiceAt(data){
  224. console.log(data)
  225. this.supplyDemand.serviceAt = this.format(data,'yyyy-MM-dd');
  226. this.serviceAt = data;
  227. this.showServiceAt = false;
  228. },
  229. placeOrder(){
  230. console.log(this.supplyDemand)
  231. this.supplyDemand.demandId = this.$route.query.id;
  232. this.supplyDemand.id = '';
  233. this.supplyDemand.linkera = this.user.nickName
  234. this.supplyDemand.phonea = this.user.phonenumber
  235. this.supplyDemand.serviceAddress = this.user.deptName
  236. placeOrder(this.supplyDemand).then(response => {
  237. if(response.code=="200"){
  238. this.$notify({ type: 'success', message: '发布成功' });
  239. setTimeout(function(){
  240. history.back(-1);
  241. },2000)
  242. }
  243. });
  244. }
  245. },
  246. }
  247. </script>
  248. <style scoped lang="scss">
  249. .home_wrapper{
  250. }
  251. /deep/ .van-cell--required::before{
  252. left: 17vw;
  253. }
  254. /*头部*/
  255. .header{
  256. display: flex;
  257. align-items: center;
  258. justify-content: space-between;
  259. padding: 2vh 4% 0vh;
  260. }
  261. .search{
  262. display: flex;
  263. justify-content: space-between;
  264. align-items: center;
  265. border: 1px solid #6E93F3;
  266. padding: 1PX 1PX 1PX 12PX ;
  267. border-radius: 50PX;
  268. margin-right: 30PX;
  269. flex: 1;
  270. input{
  271. flex: 1;
  272. background: transparent;
  273. margin-left: 10PX;
  274. }
  275. }
  276. /*导航栏目*/
  277. .nav{
  278. width: 94%;
  279. margin: 0 auto;
  280. margin-top: 2vh;
  281. padding: 1.5vh 3%;
  282. background: #ffffff;
  283. border-radius: 10PX;
  284. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  285. .date{
  286. display: flex;
  287. justify-content: space-around;
  288. align-items: center;
  289. p{
  290. border-radius: 1rem;
  291. padding: 5PX 0PX 5PX 5%;
  292. width: 40%;
  293. text-align: center;
  294. color: #334281;
  295. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  296. background:#D6D9E6 url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 20% center no-repeat;
  297. }
  298. }
  299. .billCount {
  300. display: flex;
  301. text-align: center;
  302. margin-top: 3vh;
  303. .billCount_left{
  304. width: 50%;
  305. color: #1B5DEA;
  306. p{
  307. &:nth-child(1){
  308. font-size: .45rem;
  309. }
  310. }
  311. }
  312. .billCount_right{
  313. width: 50%;
  314. color: #FF5E00;
  315. p{
  316. &:nth-child(1){
  317. font-size: .45rem;
  318. }
  319. }
  320. }
  321. }
  322. }
  323. /*内容*/
  324. .main{
  325. width: 94%;
  326. margin: 0 auto;
  327. .main_content_right_list{
  328. margin-top: 2vh;
  329. padding: 1.5vh 3%;
  330. background: #ffffff;
  331. border-radius: 10PX;
  332. /*box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);*/
  333. /deep/ .van-cell{
  334. padding: 0;
  335. margin-top: 10PX;
  336. }
  337. .main_content_right_list_header{
  338. display: flex;
  339. margin-bottom: 1vh;
  340. align-items: center;
  341. p{
  342. padding: 3PX 10PX;
  343. border-radius: 8PX;
  344. &:nth-child(2){background: #2B7EEC;color: #ffffff;margin-left: auto;}
  345. &:nth-child(3){background: #E2E9FD;color: #497CE8;margin-left: 10PX;}
  346. }
  347. .on{
  348. color: #334281;
  349. border-radius: initial;
  350. padding:0 0 0 20PX;
  351. font-size: 0.35rem;
  352. background: url("../../../../static/images/agriculturalTrusteeship/socialization/bill_icon_01.png") no-repeat left center
  353. }
  354. .off{
  355. color: #E60505;
  356. border-radius: initial;
  357. margin-left: auto;
  358. padding:0 0 0 15PX;
  359. background: url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_off.png") no-repeat left center
  360. }
  361. }
  362. .main_content_right_list_center{
  363. display: flex;
  364. img{
  365. border-radius: 15PX;
  366. margin-right: 4%;
  367. }
  368. .main_content_right_list_content{
  369. display: flex;
  370. flex-direction:column;
  371. justify-content: space-between;
  372. .tt{
  373. color: #333333;
  374. font-size: .35rem;
  375. }
  376. .tab{
  377. display: flex;
  378. justify-content: space-between;
  379. p{
  380. &:nth-child(1){
  381. flex: 1;
  382. color: #FF5E00;
  383. span{
  384. font-size: .4rem;
  385. }
  386. }
  387. &:nth-child(2){
  388. span{
  389. display: inline-block;
  390. text-align: center;
  391. padding: 2PX 5PX;
  392. &:nth-child(1){
  393. color: #497CE8;
  394. background: #E2E9FD;
  395. border-top-left-radius: 10PX;
  396. }
  397. &:nth-child(2){
  398. color: #ffffff;
  399. background-image: linear-gradient(to right , #5D87FA , #5FD5F5);
  400. border-bottom-right-radius: 10PX;
  401. }
  402. }
  403. }
  404. }
  405. }
  406. .name{
  407. color: #7A7A7A;
  408. span{
  409. &:nth-child(2){
  410. margin-left: 5PX;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }
  418. /*弹出层*/
  419. .popup_header{
  420. display: flex;
  421. align-items: center;
  422. color: #334281;
  423. font-size: .38rem;
  424. margin-bottom: 15PX;
  425. img{
  426. margin-right: 10PX;
  427. display: block;
  428. }
  429. p{
  430. line-height: 1;
  431. }
  432. }
  433. .popup_content{
  434. .selected{
  435. .on{
  436. font-size: .35rem;
  437. padding: 10PX 20PX;
  438. color: #334281;
  439. background: url("../../../../static/images/agriculturalTrusteeship/socialization/down.png")left center no-repeat;
  440. }
  441. .off{
  442. font-size: .35rem;
  443. padding: 10PX 20PX;
  444. color: #334281;
  445. background: url("../../../../static/images/agriculturalTrusteeship/socialization/right.png")left center no-repeat;
  446. }
  447. .options{
  448. display: flex;
  449. justify-content: space-between;
  450. flex-wrap: wrap;
  451. p{
  452. background: #F5F5F5;
  453. color: #8F8F8F;
  454. width: 30%;
  455. padding: 5PX 0;
  456. border-radius: 5PX;
  457. text-align: center;
  458. &.active{
  459. background: #E2E9FD;
  460. color: #1B5DEA;
  461. }
  462. }
  463. }
  464. }
  465. }
  466. .popup_date{
  467. display: flex;
  468. justify-content: space-around;
  469. align-items: center;
  470. p{
  471. border-radius: 1rem;
  472. padding: 5PX 0PX 5PX 5%;
  473. width: 45%;
  474. text-align: center;
  475. color: #1B5DEA;
  476. background:#E2E9FD url("../../../../static/images/agriculturalTrusteeship/socialization/socialization_icon_date.png") 15% center no-repeat;
  477. }
  478. }
  479. .popup_btn{
  480. position: fixed;
  481. bottom: 5vh;
  482. display: flex;
  483. align-items: center;
  484. justify-content: space-between;
  485. width: 94%;
  486. left: 3%;
  487. p{
  488. width: 30%;
  489. padding: 7PX 0;
  490. border-radius: 5rem;
  491. text-align: center;
  492. font-size: .35rem;
  493. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  494. &:nth-child(1){
  495. background: #1B5DEA;
  496. color: #ffffff;
  497. }
  498. &:nth-child(2){
  499. border: 1PX solid #1B5DEA;
  500. color: #1B5DEA;
  501. }
  502. &:nth-child(3){
  503. background-image: linear-gradient(to right , #6E93F3 , #54C6E4);
  504. color: #ffffff;
  505. }
  506. }
  507. }
  508. .main_btn{
  509. display: flex;
  510. justify-content: space-around;
  511. padding: 4vh 0;
  512. p{
  513. font-size: .4rem;
  514. width: 35%;
  515. text-align: center;
  516. padding: 10PX 0;
  517. border-radius: 5rem;
  518. box-shadow: 0px 3PX 6PX 0px rgba(0,0,0,0.16);
  519. &:nth-child(1){
  520. background: #334281;
  521. color: #ffffff;
  522. }
  523. &:nth-child(2){
  524. background: #D1D5E4;
  525. color: #334281;
  526. }
  527. }
  528. }
  529. </style>