addsendgoods.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <template>
  2. <view class="center">
  3. <view class="transaction">
  4. <u-form :model="purchaseOrder" ref="uForm" class="uForm">
  5. <u-form-item label="业务编号" prop="businessNumber" label-width="140" required>
  6. <u-input v-model="purchaseOrder.businessNumber" input-align="right" placeholder="请输入业务编号" />
  7. </u-form-item>
  8. <u-form-item label="收货方" prop="consignee" label-width="140" required>
  9. <u-input v-model="purchaseOrder.consignee" input-align="right" placeholder="请输入收货方名称" />
  10. </u-form-item>
  11. <u-form-item label="发货方" prop="shipper" label-width="140" required>
  12. <u-input v-model="purchaseOrder.shipper" input-align="right" placeholder="请输入发货方名称" />
  13. </u-form-item>
  14. <u-form-item label="货名" prop="goodsName" label-width="140" required>
  15. <u-input v-model="purchaseOrder.goodsName" input-align="right" placeholder="请输入货名,如玉米" />
  16. </u-form-item>
  17. <u-form-item label="货物单价(元/吨)" prop="goodsPrice" label-width="250" required>
  18. <u-input v-model="purchaseOrder.goodsPrice" input-align="right" placeholder="请输入货物单价" />
  19. </u-form-item>
  20. <u-form-item label="运费单价(元/吨)" prop="freightUnitPrice" label-width="250" required>
  21. <u-input v-model="purchaseOrder.freightUnitPrice" input-align="right" placeholder="请输入运费单价" />
  22. </u-form-item>
  23. <u-form-item label="运费承担方" prop="freightUnitPrice" label-width="250" required>
  24. <view class="con-list">
  25. <picker @change="packingChange" :value="packingIndex" :range="packingType">
  26. <view class="picker">
  27. {{packingIndex>-1?packingType[packingIndex]:'请选择'}}
  28. </view>
  29. </picker>
  30. </view>
  31. </u-form-item>
  32. <u-form-item label="收货地址" prop="receivingAddress" label-width="140" required>
  33. <u-input v-model="purchaseOrder.receivingAddress" input-align="right" placeholder="请输入收货地址" />
  34. </u-form-item>
  35. <u-form-item class='last' label="收货人账号" prop="accountNumber" label-width="160" required>
  36. <u-input v-model="purchaseOrder.accountNumber" input-align="right" placeholder="请输入收货人账号" />
  37. </u-form-item>
  38. </u-form>
  39. </view>
  40. <view class="account-tip">
  41. 注:收货人账号为收货人注册易粮易运的手机号码
  42. </view>
  43. <view class='footer'>
  44. <button class="btn" @click="commit()">提交</button>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. // import fullPopup from '@/components/common/fullPopup'
  50. export default {
  51. name: "business",
  52. components: {
  53. // fullPopup
  54. },
  55. data() {
  56. return {
  57. purchaseOrder: {
  58. freightPayer: "发货方承担"
  59. },
  60. packingType: ["发货方承担", "收货方承担"],
  61. isFreightUnitPrice: true,
  62. packingIndex: 0,
  63. phone: "",
  64. rules: {
  65. businessNumber: [{
  66. validator: (rule, value, callback) => {
  67. return !this.$u.test.isEmpty(value)
  68. },
  69. message: '业务编号不能为空',
  70. trigger: ['change', 'blur']
  71. }, ],
  72. consignee: [{
  73. validator: (rule, value, callback) => {
  74. return !this.$u.test.isEmpty(value)
  75. },
  76. message: '收货方不能为空',
  77. trigger: ['change', 'blur']
  78. }],
  79. shipper: [{
  80. validator: (rule, value, callback) => {
  81. return !this.$u.test.isEmpty(value)
  82. },
  83. message: '发货方不能为空',
  84. trigger: ['change', 'blur']
  85. }],
  86. goodsName: [{
  87. validator: (rule, value, callback) => {
  88. return !this.$u.test.isEmpty(value)
  89. },
  90. message: '货名不能为空',
  91. trigger: ['change', 'blur']
  92. }],
  93. goodsPrice: [{
  94. validator: (rule, value, callback) => {
  95. return !this.$u.test.isEmpty(value)
  96. },
  97. message: '货物单价不能为空',
  98. trigger: ['change', 'blur']
  99. },
  100. {
  101. validator: (rule, value, callback) => {
  102. return this.$u.test.amount(value)
  103. },
  104. message: '数值类型,最多保留两位小数',
  105. trigger: ['change', 'blur'],
  106. }
  107. ],
  108. freightUnitPrice: [{
  109. validator: (rule, value, callback) => {
  110. return !this.$u.test.isEmpty(value)
  111. },
  112. message: '运费单价不能为空',
  113. trigger: ['change', 'blur']
  114. },
  115. {
  116. validator: (rule, value, callback) => {
  117. return this.$u.test.amount(value)
  118. },
  119. message: '数值类型,最多保留两位小数',
  120. trigger: ['change', 'blur'],
  121. }
  122. ],
  123. receivingAddress: [{
  124. validator: (rule, value, callback) => {
  125. return !this.$u.test.isEmpty(value)
  126. },
  127. message: '收获地址不能为空',
  128. trigger: ['change', 'blur']
  129. }],
  130. accountNumber: [{
  131. validator: (rule, value, callback) => {
  132. return !this.$u.test.isEmpty(value)
  133. },
  134. message: '手机号码不能为空',
  135. trigger: ['change', 'blur']
  136. },
  137. {
  138. validator: (rule, value, callback) => {
  139. return this.$u.test.mobile(value);
  140. },
  141. message: '手机号格式不正确',
  142. trigger: ['change', 'blur']
  143. }
  144. ]
  145. }
  146. }
  147. },
  148. onReady() {
  149. this.$refs.uForm.setRules(this.rules);
  150. },
  151. onLoad(options) {
  152. this.phone = options.phone
  153. },
  154. methods: {
  155. packingChange(event) {
  156. console.log(event)
  157. this.packingIndex = event.detail.value;
  158. },
  159. commit() {
  160. this.purchaseOrder.shipperPhone = this.phone
  161. this.$refs.uForm.validate(valid => {
  162. if (valid) {
  163. uni.showLoading({
  164. title: '正在加载',
  165. mask: true
  166. })
  167. console.log('验证通过');
  168. this.$api.doRequest('post',
  169. '/freightReceivingDispatching/api/insertFreightReceivingDispatching',
  170. this
  171. .purchaseOrder).then(res => {
  172. if (res.data.code == 200) {
  173. uni.showToast({
  174. title: '提交成功',
  175. icon: 'none',
  176. duration: 2000,
  177. success: function() {
  178. uni.navigateTo({
  179. url: `/pageA/freightTransport/index`
  180. })
  181. }
  182. })
  183. }
  184. }).catch(res => {
  185. // uni.showToast({
  186. // title: res.data.message,
  187. // icon: 'none',
  188. // duration: 2000
  189. // })
  190. })
  191. } else {
  192. console.log('验证失败');
  193. }
  194. });
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang='scss'>
  200. page,
  201. .content {
  202. background: #F5F6FA;
  203. }
  204. .center {
  205. overflow-y: hidden;
  206. padding-bottom: 200rpx;
  207. }
  208. .c-row {
  209. display: -webkit-box;
  210. display: -webkit-flex;
  211. display: flex;
  212. -webkit-box-align: center;
  213. -webkit-align-items: center;
  214. align-items: center;
  215. padding: 20rpx 30rpx;
  216. position: relative;
  217. }
  218. .con-list {
  219. -webkit-box-flex: 1;
  220. -webkit-flex: 1;
  221. flex: 1;
  222. display: -webkit-box;
  223. display: -webkit-flex;
  224. display: flex;
  225. -webkit-box-orient: vertical;
  226. -webkit-box-direction: normal;
  227. -webkit-flex-direction: column;
  228. flex-direction: column;
  229. color: #303133;
  230. line-height: 40rpx;
  231. text-align: right;
  232. /* padding-right: 20rpx; */
  233. /* color: red; */
  234. }
  235. .transaction {
  236. background-color: #FFFFFF;
  237. margin: 10px;
  238. padding-bottom: 10px;
  239. border-radius: 10px;
  240. }
  241. .line {
  242. display: inline-block;
  243. padding: 5px;
  244. position: relative;
  245. font-size: 17px;
  246. }
  247. .line.active {
  248. font-size: 19px;
  249. font-weight: 900;
  250. }
  251. .line.active:after {
  252. content: '';
  253. display: block;
  254. position: absolute;
  255. width: 38px;
  256. left: 50%;
  257. transform: translateX(-50%);
  258. bottom: 0;
  259. border-bottom: 1px solid #22C572;
  260. }
  261. .cu-tag.badge {
  262. right: 26rpx;
  263. }
  264. .cu-item {
  265. height: 80rpx;
  266. display: inline-block;
  267. line-height: 80rpx;
  268. }
  269. .search-form {
  270. background: #F5F6F9;
  271. padding-left: 20rpx;
  272. }
  273. .title-tip {
  274. color: #E63113;
  275. text-align: right;
  276. }
  277. .tag1 {
  278. background: #F5F6F9;
  279. padding: 5px;
  280. color: #333333;
  281. display: inline-flex;
  282. font-size: 22rpx;
  283. border-radius: 3px;
  284. margin: 3px;
  285. }
  286. .tag {
  287. background: #F5F6F9;
  288. padding: 7px 12px;
  289. color: #333333;
  290. display: inline-flex;
  291. font-size: 22rpx;
  292. border-radius: 15px;
  293. margin: 3px;
  294. }
  295. .tag-bule {
  296. background: #EBEEFA;
  297. color: #5C76DF;
  298. }
  299. .tag-green {
  300. background: #C6F7BC;
  301. color: #065112;
  302. }
  303. .tag-yellow {
  304. background: #F9F2EA;
  305. color: #BE9C69;
  306. }
  307. .tag-red {
  308. background: #FEECE6;
  309. color: #FE6430;
  310. }
  311. .text-white {
  312. color: #fff;
  313. }
  314. .text-white text {
  315. position: relative;
  316. z-index: 2;
  317. background: linear-gradient(45deg, #3DC146, #B2D612);
  318. padding: 5px 10px;
  319. border-radius: 38rpx;
  320. }
  321. .guess-section {
  322. padding-bottom: 100upx;
  323. display: flex;
  324. flex-wrap: wrap;
  325. padding: 30upx;
  326. background: #fff;
  327. margin: 10px;
  328. border-radius: 6px;
  329. .type {
  330. border-radius: 10px;
  331. padding: 5px;
  332. wdith: 22px;
  333. height: 22px;
  334. line-height: 14px;
  335. font-size: 12px;
  336. }
  337. .type.send {
  338. background: #22C572;
  339. color: #fff;
  340. }
  341. .type.put {
  342. background: #FD714F;
  343. color: #fff;
  344. }
  345. .businessnumber {
  346. font-size: 16px;
  347. font-weight: 600;
  348. }
  349. .consigner {
  350. font-size: 12px;
  351. }
  352. .time {
  353. color: #878C9C;
  354. }
  355. .goods {
  356. font-size: 12px;
  357. }
  358. .goodsstatus {
  359. background: #F9F9FA;
  360. color: #9698A2;
  361. padding: 10px 0;
  362. padding-left: 47px;
  363. margin: 10px 0;
  364. }
  365. .del {
  366. width: 60px;
  367. height: 33px;
  368. line-height: 33px;
  369. font-size: 14px;
  370. background: #fff;
  371. border: 1px solid #CDCDCD;
  372. border-radius: 30px;
  373. text-align: center;
  374. }
  375. }
  376. .navbar {
  377. position: fixed;
  378. left: 0;
  379. top: var(--window-top);
  380. display: flex;
  381. width: 100%;
  382. height: 80upx;
  383. background: #fff;
  384. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  385. z-index: 10;
  386. .nav-item {
  387. flex: 1;
  388. display: flex;
  389. justify-content: center;
  390. align-items: center;
  391. height: 100%;
  392. font-size: 30upx;
  393. color: $font-color-dark;
  394. position: relative;
  395. &.current {
  396. color: $base-color;
  397. &:after {
  398. content: '';
  399. position: absolute;
  400. left: 50%;
  401. bottom: 0;
  402. transform: translateX(-50%);
  403. width: 120upx;
  404. height: 0;
  405. border-bottom: 4upx solid $base-color;
  406. }
  407. }
  408. }
  409. .p-box {
  410. display: flex;
  411. flex-direction: column;
  412. .yticon {
  413. display: flex;
  414. align-items: center;
  415. justify-content: center;
  416. width: 30upx;
  417. height: 14upx;
  418. line-height: 1;
  419. margin-left: 4upx;
  420. font-size: 26upx;
  421. color: #888;
  422. &.active {
  423. color: $base-color;
  424. }
  425. }
  426. .xia {
  427. transform: scaleY(-1);
  428. }
  429. }
  430. .cate-item {
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. height: 100%;
  435. width: 80upx;
  436. position: relative;
  437. font-size: 44upx;
  438. &:after {
  439. content: '';
  440. position: absolute;
  441. left: 0;
  442. top: 50%;
  443. transform: translateY(-50%);
  444. border-left: 1px solid #ddd;
  445. width: 0;
  446. height: 36upx;
  447. }
  448. }
  449. }
  450. /* 分类 */
  451. .cate-mask {
  452. position: fixed;
  453. left: 0;
  454. top: var(--window-top);
  455. bottom: 0;
  456. width: 100%;
  457. background: rgba(0, 0, 0, 0);
  458. z-index: 95;
  459. transition: .3s;
  460. .cate-content {
  461. width: 630upx;
  462. height: 100%;
  463. background: #fff;
  464. float: right;
  465. transform: translateX(100%);
  466. transition: .3s;
  467. }
  468. &.none {
  469. display: none;
  470. }
  471. &.show {
  472. background: rgba(0, 0, 0, .4);
  473. .cate-content {
  474. transform: translateX(0);
  475. }
  476. }
  477. }
  478. .cate-list {
  479. display: flex;
  480. flex-direction: column;
  481. height: 100%;
  482. .cate-item {
  483. display: flex;
  484. align-items: center;
  485. height: 90upx;
  486. padding-left: 30upx;
  487. font-size: 28upx;
  488. color: #555;
  489. position: relative;
  490. }
  491. .two {
  492. height: 64upx;
  493. color: #303133;
  494. font-size: 30upx;
  495. background: #f8f8f8;
  496. }
  497. .active {
  498. color: $base-color;
  499. }
  500. }
  501. .introduce-section .title {
  502. font-size: 17px;
  503. font-weight: bold;
  504. height: 40px;
  505. line-height: 40px;
  506. flex: 2.5;
  507. border-bottom: 1px solid #EEEEEE;
  508. }
  509. .introduce-section .address {
  510. color: #878C9C;
  511. font-size: 12px;
  512. padding: 10px 0 10px;
  513. }
  514. .introduce-section .price {
  515. padding: 10px 0 10px;
  516. color: #FD714F;
  517. font-size: 19px;
  518. font-weight: 700;
  519. }
  520. .introduce-section .guess-item {
  521. border-radius: 10px;
  522. background: #fff;
  523. padding: 0upx 30upx 20upx;
  524. margin: 8px;
  525. border-bottom: 1px solid #ccc;
  526. }
  527. /* 销售信息 */
  528. .introduce-section {
  529. .title-tip {
  530. flex: 1;
  531. }
  532. .price-box {
  533. display: flex;
  534. align-items: baseline;
  535. font-size: 26upx;
  536. }
  537. .price {
  538. font-size: $font-lg + 2upx;
  539. }
  540. .m-price {
  541. margin: 0 12upx;
  542. color: $font-color-light;
  543. text-decoration: line-through;
  544. }
  545. .coupon-tip {
  546. align-items: center;
  547. padding: 4upx 10upx;
  548. background: $uni-color-primary;
  549. font-size: $font-sm;
  550. color: #fff;
  551. border-radius: 6upx;
  552. line-height: 1;
  553. transform: translateY(-4upx);
  554. }
  555. .bot-row {
  556. display: flex;
  557. align-items: center;
  558. height: 50upx;
  559. font-size: $font-sm;
  560. color: $font-color-light;
  561. view {
  562. flex: 1;
  563. }
  564. }
  565. }
  566. .footer {
  567. position: fixed;
  568. bottom: 0;
  569. width: 100%;
  570. padding: 20px 0;
  571. z-index: 999;
  572. }
  573. .btn {
  574. width: 90%;
  575. background: #22C572;
  576. color: #fff;
  577. border-radius: 30px;
  578. }
  579. .btn:after {
  580. border: none;
  581. }
  582. .account-tip {
  583. font-size: 24rpx;
  584. font-weight: 400;
  585. color: #AFB3BF;
  586. padding-left: 60rpx;
  587. }
  588. .uForm {
  589. padding: 0 40rpx;
  590. }
  591. .last::after{
  592. border: 0 solid transparent;
  593. }
  594. </style>