addsendgoods.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  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 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. }
  207. .c-row {
  208. display: -webkit-box;
  209. display: -webkit-flex;
  210. display: flex;
  211. -webkit-box-align: center;
  212. -webkit-align-items: center;
  213. align-items: center;
  214. padding: 20rpx 30rpx;
  215. position: relative;
  216. }
  217. .con-list {
  218. -webkit-box-flex: 1;
  219. -webkit-flex: 1;
  220. flex: 1;
  221. display: -webkit-box;
  222. display: -webkit-flex;
  223. display: flex;
  224. -webkit-box-orient: vertical;
  225. -webkit-box-direction: normal;
  226. -webkit-flex-direction: column;
  227. flex-direction: column;
  228. color: #303133;
  229. line-height: 40rpx;
  230. text-align: right;
  231. /* padding-right: 20rpx; */
  232. /* color: red; */
  233. }
  234. .transaction {
  235. background-color: #FFFFFF;
  236. margin: 10px;
  237. padding-bottom: 10px;
  238. border-radius: 20px;
  239. }
  240. .line {
  241. display: inline-block;
  242. padding: 5px;
  243. position: relative;
  244. font-size: 17px;
  245. }
  246. .line.active {
  247. font-size: 19px;
  248. font-weight: 900;
  249. }
  250. .line.active:after {
  251. content: '';
  252. display: block;
  253. position: absolute;
  254. width: 38px;
  255. left: 50%;
  256. transform: translateX(-50%);
  257. bottom: 0;
  258. border-bottom: 1px solid #22C572;
  259. }
  260. .cu-tag.badge {
  261. right: 26rpx;
  262. }
  263. .cu-item {
  264. height: 80rpx;
  265. display: inline-block;
  266. line-height: 80rpx;
  267. }
  268. .search-form {
  269. background: #F5F6F9;
  270. padding-left: 20rpx;
  271. }
  272. .title-tip {
  273. color: #E63113;
  274. text-align: right;
  275. }
  276. .tag1 {
  277. background: #F5F6F9;
  278. padding: 5px;
  279. color: #333333;
  280. display: inline-flex;
  281. font-size: 22rpx;
  282. border-radius: 3px;
  283. margin: 3px;
  284. }
  285. .tag {
  286. background: #F5F6F9;
  287. padding: 7px 12px;
  288. color: #333333;
  289. display: inline-flex;
  290. font-size: 22rpx;
  291. border-radius: 15px;
  292. margin: 3px;
  293. }
  294. .tag-bule {
  295. background: #EBEEFA;
  296. color: #5C76DF;
  297. }
  298. .tag-green {
  299. background: #C6F7BC;
  300. color: #065112;
  301. }
  302. .tag-yellow {
  303. background: #F9F2EA;
  304. color: #BE9C69;
  305. }
  306. .tag-red {
  307. background: #FEECE6;
  308. color: #FE6430;
  309. }
  310. .text-white {
  311. color: #fff;
  312. }
  313. .text-white text {
  314. position: relative;
  315. z-index: 2;
  316. background: linear-gradient(45deg, #3DC146, #B2D612);
  317. padding: 5px 10px;
  318. border-radius: 38rpx;
  319. }
  320. .guess-section {
  321. padding-bottom: 100upx;
  322. display: flex;
  323. flex-wrap: wrap;
  324. padding: 30upx;
  325. background: #fff;
  326. margin: 10px;
  327. border-radius: 6px;
  328. .type {
  329. border-radius: 10px;
  330. padding: 5px;
  331. wdith: 22px;
  332. height: 22px;
  333. line-height: 14px;
  334. font-size: 12px;
  335. }
  336. .type.send {
  337. background: #22C572;
  338. color: #fff;
  339. }
  340. .type.put {
  341. background: #FD714F;
  342. color: #fff;
  343. }
  344. .businessnumber {
  345. font-size: 16px;
  346. font-weight: 600;
  347. }
  348. .consigner {
  349. font-size: 12px;
  350. }
  351. .time {
  352. color: #878C9C;
  353. }
  354. .goods {
  355. font-size: 12px;
  356. }
  357. .goodsstatus {
  358. background: #F9F9FA;
  359. color: #9698A2;
  360. padding: 10px 0;
  361. padding-left: 47px;
  362. margin: 10px 0;
  363. }
  364. .del {
  365. width: 60px;
  366. height: 33px;
  367. line-height: 33px;
  368. font-size: 14px;
  369. background: #fff;
  370. border: 1px solid #CDCDCD;
  371. border-radius: 30px;
  372. text-align: center;
  373. }
  374. }
  375. .navbar {
  376. position: fixed;
  377. left: 0;
  378. top: var(--window-top);
  379. display: flex;
  380. width: 100%;
  381. height: 80upx;
  382. background: #fff;
  383. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  384. z-index: 10;
  385. .nav-item {
  386. flex: 1;
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. height: 100%;
  391. font-size: 30upx;
  392. color: $font-color-dark;
  393. position: relative;
  394. &.current {
  395. color: $base-color;
  396. &:after {
  397. content: '';
  398. position: absolute;
  399. left: 50%;
  400. bottom: 0;
  401. transform: translateX(-50%);
  402. width: 120upx;
  403. height: 0;
  404. border-bottom: 4upx solid $base-color;
  405. }
  406. }
  407. }
  408. .p-box {
  409. display: flex;
  410. flex-direction: column;
  411. .yticon {
  412. display: flex;
  413. align-items: center;
  414. justify-content: center;
  415. width: 30upx;
  416. height: 14upx;
  417. line-height: 1;
  418. margin-left: 4upx;
  419. font-size: 26upx;
  420. color: #888;
  421. &.active {
  422. color: $base-color;
  423. }
  424. }
  425. .xia {
  426. transform: scaleY(-1);
  427. }
  428. }
  429. .cate-item {
  430. display: flex;
  431. justify-content: center;
  432. align-items: center;
  433. height: 100%;
  434. width: 80upx;
  435. position: relative;
  436. font-size: 44upx;
  437. &:after {
  438. content: '';
  439. position: absolute;
  440. left: 0;
  441. top: 50%;
  442. transform: translateY(-50%);
  443. border-left: 1px solid #ddd;
  444. width: 0;
  445. height: 36upx;
  446. }
  447. }
  448. }
  449. /* 分类 */
  450. .cate-mask {
  451. position: fixed;
  452. left: 0;
  453. top: var(--window-top);
  454. bottom: 0;
  455. width: 100%;
  456. background: rgba(0, 0, 0, 0);
  457. z-index: 95;
  458. transition: .3s;
  459. .cate-content {
  460. width: 630upx;
  461. height: 100%;
  462. background: #fff;
  463. float: right;
  464. transform: translateX(100%);
  465. transition: .3s;
  466. }
  467. &.none {
  468. display: none;
  469. }
  470. &.show {
  471. background: rgba(0, 0, 0, .4);
  472. .cate-content {
  473. transform: translateX(0);
  474. }
  475. }
  476. }
  477. .cate-list {
  478. display: flex;
  479. flex-direction: column;
  480. height: 100%;
  481. .cate-item {
  482. display: flex;
  483. align-items: center;
  484. height: 90upx;
  485. padding-left: 30upx;
  486. font-size: 28upx;
  487. color: #555;
  488. position: relative;
  489. }
  490. .two {
  491. height: 64upx;
  492. color: #303133;
  493. font-size: 30upx;
  494. background: #f8f8f8;
  495. }
  496. .active {
  497. color: $base-color;
  498. }
  499. }
  500. .introduce-section .title {
  501. font-size: 17px;
  502. font-weight: bold;
  503. height: 40px;
  504. line-height: 40px;
  505. flex: 2.5;
  506. border-bottom: 1px solid #EEEEEE;
  507. }
  508. .introduce-section .address {
  509. color: #878C9C;
  510. font-size: 12px;
  511. padding: 10px 0 10px;
  512. }
  513. .introduce-section .price {
  514. padding: 10px 0 10px;
  515. color: #FD714F;
  516. font-size: 19px;
  517. font-weight: 700;
  518. }
  519. .introduce-section .guess-item {
  520. border-radius: 10px;
  521. background: #fff;
  522. padding: 0upx 30upx 20upx;
  523. margin: 8px;
  524. border-bottom: 1px solid #ccc;
  525. }
  526. /* 销售信息 */
  527. .introduce-section {
  528. .title-tip {
  529. flex: 1;
  530. }
  531. .price-box {
  532. display: flex;
  533. align-items: baseline;
  534. font-size: 26upx;
  535. }
  536. .price {
  537. font-size: $font-lg + 2upx;
  538. }
  539. .m-price {
  540. margin: 0 12upx;
  541. color: $font-color-light;
  542. text-decoration: line-through;
  543. }
  544. .coupon-tip {
  545. align-items: center;
  546. padding: 4upx 10upx;
  547. background: $uni-color-primary;
  548. font-size: $font-sm;
  549. color: #fff;
  550. border-radius: 6upx;
  551. line-height: 1;
  552. transform: translateY(-4upx);
  553. }
  554. .bot-row {
  555. display: flex;
  556. align-items: center;
  557. height: 50upx;
  558. font-size: $font-sm;
  559. color: $font-color-light;
  560. view {
  561. flex: 1;
  562. }
  563. }
  564. }
  565. .footer {
  566. position: fixed;
  567. bottom: 0;
  568. width: 100%;
  569. padding: 20px 0;
  570. }
  571. .btn {
  572. width: 90%;
  573. background: #22C572;
  574. color: #fff;
  575. border-radius: 30px;
  576. }
  577. .btn:after {
  578. border: none;
  579. }
  580. .account-tip {
  581. font-size: 24rpx;
  582. font-weight: 400;
  583. color: #AFB3BF;
  584. padding-left: 60rpx;
  585. }
  586. .uForm {
  587. padding: 0 40rpx;
  588. }
  589. </style>