task_detail_jy.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. <template>
  2. <view class="container">
  3. <view class="detail-desc">
  4. <view class="d-header">
  5. <text>交易信息</text>
  6. </view>
  7. <view class="c-list">
  8. <view class="c-row b-b">
  9. <text class="tit">卖方</text>
  10. <view class="con-list">
  11. <text>{{tradeInfo.seller}}</text>
  12. </view>
  13. </view>
  14. <view class="c-row b-b">
  15. <text class="tit">买方</text>
  16. <view class="con-list">
  17. <text>{{tradeInfo.buyer}}</text>
  18. </view>
  19. </view>
  20. <view class="c-row b-b">
  21. <text class="tit">交易数量</text>
  22. <view class="con-list">
  23. <text>{{numFilter(tradeInfo.count)}}</text>
  24. </view>
  25. </view>
  26. <view class="c-row b-b">
  27. <text class="tit">库点</text>
  28. <view class="con-list">
  29. <text>{{tradeInfo.title}}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="d-header">
  34. <text>审核项目</text>
  35. </view>
  36. <view class="c-list">
  37. <view class="c-row b-b">
  38. <text class="tit">发票类型</text>
  39. <view class="con-list">
  40. <input placeholder="请填写发票类型" name="input" v-model="tradeInfo.invoiceType" @input="invoiceTypeInput"></input>
  41. </view>
  42. </view>
  43. <view class="c-row b-b">
  44. <text class="tit">包装方式</text>
  45. <view class="con-list">
  46. <input placeholder="请填写包装方式" name="input" v-model="tradeInfo.packing" @input="packingInput"></input>
  47. </view>
  48. </view>
  49. <view class="c-row b-b">
  50. <text class="tit">点价(元/吨)</text>
  51. <view class="con-list">
  52. <input placeholder="请填写点价" name="input" v-model="tradeInfo.unitPrice" @input="unitPriceInput"></input>
  53. </view>
  54. </view>
  55. <view class="c-row b-b">
  56. <text class="tit">基差(元/吨)</text>
  57. <view class="con-list">
  58. <input placeholder="请填写基差" name="input" v-model="tradeInfo.basis" @input="basisInput"></input>
  59. </view>
  60. </view>
  61. <view class="c-row b-b">
  62. <text class="tit">发票费用(元/吨)</text>
  63. <view class="con-list">
  64. <input placeholder="请填写发票费用" name="input" v-model="tradeInfo.invoiceMoney" @input="invoiceMoneyInput"></input>
  65. </view>
  66. </view>
  67. <view v-if="tradeInfo.type == 1" class="c-row b-b">
  68. <text class="tit">卸车费(元/吨)</text>
  69. <view class="con-list">
  70. <input placeholder="请填写卸车费" name="input" v-model="tradeInfo.unloadingFee" @input="unloadingFeeInput"></input>
  71. </view>
  72. </view>
  73. <view v-else class="c-row b-b">
  74. <text class="tit">包装费用(元/吨)</text>
  75. <view class="con-list">
  76. <input placeholder="请填写包装费用" name="input" v-model="tradeInfo.packingMoney" @input="packingMoneyInput"></input>
  77. </view>
  78. </view>
  79. <view class="c-row b-b">
  80. <text class="tit">合同编号</text>
  81. <view class="con-list">
  82. <input placeholder="请填写合同编号" name="input" v-model="tradeInfo.tradeContractNo" @input="tradeContractNoInput"></input>
  83. </view>
  84. </view>
  85. </view>
  86. <view v-if="taskStatus == 1" class="page-bottom">
  87. <view class="action-btn-group">
  88. <button type="primary" class=" action-btn no-border add-cart-btn" @click="finish">完成</button>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import {
  96. mapState
  97. } from 'vuex';
  98. export default {
  99. data() {
  100. return {
  101. tradeInfo:[],
  102. taskStatus:0
  103. };
  104. },
  105. computed: {
  106. ...mapState(['hasLogin','userInfo']),
  107. },
  108. onShow() {
  109. },
  110. onLoad(options) {
  111. const that = this
  112. this.taskId = options.taskId
  113. this.taskStatus = options.taskStatus
  114. uni.showLoading({
  115. title: '正在加载'
  116. })
  117. that.$api.request('trade', 'getTradeDetailTask', {
  118. taskId: options.taskId
  119. }, failres => {
  120. that.$api.msg(failres.errmsg)
  121. uni.hideLoading()
  122. }).then(res => {
  123. that.tradeInfo = res.data
  124. uni.hideLoading()
  125. })
  126. },
  127. onReady(){
  128. },
  129. methods: {
  130. invoiceTypeInput(e){
  131. this.tradeInfo.invoiceType = e.detail.value
  132. },
  133. packingInput(e){
  134. this.tradeInfo.packing = e.detail.value
  135. },
  136. unitPriceInput(e){
  137. this.tradeInfo.unitPrice = e.detail.value
  138. },
  139. basisInput(e){
  140. this.tradeInfo.basis = e.detail.value
  141. },
  142. invoiceMoneyInput(e){
  143. this.tradeInfo.invoiceMoney = e.detail.value
  144. },
  145. packingMoneyInput(e){
  146. this.tradeInfo.packingMoney = e.detail.value
  147. },
  148. tradeContractNoInput(e){
  149. this.tradeInfo.tradeContractNo = e.detail.value
  150. },
  151. unloadingFeeInput(e){
  152. this.tradeInfo.unloadingFee = e.detail.value
  153. },
  154. finish(){
  155. const that = this
  156. if(!that.tradeInfo.tradeContractNo){
  157. this.$api.msg('请填写合同编号');
  158. return;
  159. }
  160. uni.showLoading({
  161. title: '正在加载'
  162. })
  163. that.$api.request('trade', 'finishTradeTask', {
  164. taskId: that.taskId,
  165. tradeDO:JSON.stringify(that.tradeInfo)
  166. }, failres => {
  167. that.$api.msg(failres.errmsg)
  168. uni.hideLoading()
  169. }).then(res => {
  170. uni.hideLoading()
  171. that.$api.msg('完成成功')
  172. setTimeout(()=>{uni.navigateBack({})},1000);
  173. })
  174. },
  175. priceInput(e){
  176. this.price = e.detail.value
  177. },
  178. otherPriceInput(e){
  179. this.otherPrice = e.detail.value
  180. },
  181. insuranceFeeInput(e){
  182. this.insuranceFee = e.detail.value
  183. },
  184. netWeightInput(e){
  185. this.netWeight = e.detail.value
  186. },
  187. carNoInput(e){
  188. this.carNo = e.detail.value
  189. },
  190. rentboxFeeInput(e){
  191. this.rentboxFee = e.detail.value
  192. },
  193. loadingFeeInput(e){
  194. this.loadingFee = e.detail.value
  195. },
  196. boxNoInput(e){
  197. this.boxNo = e.detail.value
  198. },
  199. numFilter (value) {
  200. if(!value){
  201. return 0
  202. }
  203. // 截取当前数据到小数点后两位
  204. let realVal = parseFloat(value).toFixed(2)
  205. return realVal
  206. },
  207. carInput(item,e){
  208. if(item.count>item.tranCount){
  209. uni.showToast({
  210. title: `当前车辆可载吨数为${item.tranCount},请不要超过`,
  211. icon:'none',
  212. duration: 2000
  213. })
  214. item.count = 0
  215. }else{
  216. item.count = e.detail.value
  217. }
  218. },
  219. selectInPerson(item){
  220. if(JSON.stringify(this.carlist).indexOf(JSON.stringify(item.id))==-1){
  221. this.carlist.push(item)
  222. }else{
  223. for(var i=0;i<this.carlist.length;i++){
  224. if(this.carlist[i].id==item.id){
  225. this.carlist[i].count=item.count
  226. }
  227. }
  228. }
  229. this.modalName = null
  230. },
  231. ChooseSignImage() {
  232. this.handwriting = new Handwriting({
  233. lineColor: this.lineColor,
  234. slideValue: this.slideValue, // 0, 25, 50, 75, 100
  235. canvasName: 'handWriting',
  236. })
  237. this.showAutograph = true
  238. },
  239. uploadScaleStart(event){
  240. this.handwriting.uploadScaleStart(event)
  241. },
  242. uploadScaleMove(event){
  243. this.handwriting.uploadScaleMove(event)
  244. },
  245. uploadScaleEnd(event){
  246. this.handwriting.uploadScaleEnd(event)
  247. },
  248. retDraw() {
  249. this.handwriting.retDraw()
  250. },
  251. hideModal(e) {
  252. this.modalName = null
  253. },
  254. ViewImage(e) {
  255. var img = [];
  256. img = e.currentTarget.dataset.url.split(' ')
  257. uni.previewImage({
  258. current:0,
  259. urls: img
  260. });
  261. },
  262. selectPerson(){
  263. const that = this
  264. uni.showLoading({
  265. title: '正在加载'
  266. })
  267. that.$api.request('tran', 'getCarList', {
  268. tranNo:that.carInfo.tranNo,
  269. taskId:that.taskId
  270. }, failres => {
  271. that.$api.msg(failres.errmsg)
  272. uni.hideLoading()
  273. }).then(res => {
  274. for(var i=0;i<res.data.length;i++){
  275. console.log(res.data[i].tranCount)
  276. res.data[i].count = res.data[i].tranCount
  277. }
  278. that.userList = res.data
  279. if(that.userList.length == 0){
  280. that.$api.msg('暂无汽车号')
  281. }
  282. else{
  283. var height = that.userList.length * 100
  284. var width = 500
  285. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  286. that.modalName = 'inModal'
  287. }
  288. uni.hideLoading()
  289. })
  290. },
  291. DelImg(e) {
  292. uni.showModal({
  293. title: '提示',
  294. content: '确定要删除该照片吗?',
  295. cancelText: '取消',
  296. confirmText: '确定',
  297. success: res => {
  298. if (res.confirm) {
  299. if(e.currentTarget.dataset.index == 0){
  300. this.trainImg = "";
  301. }
  302. else if(e.currentTarget.dataset.index == 1){
  303. this.otherImg = "";
  304. }
  305. }
  306. }
  307. })
  308. },
  309. ChooseImage() {
  310. uni.chooseImage({
  311. count: 1, //默认9
  312. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  313. sourceType: ['album','camera'], //从相册选择
  314. success: (res) => {
  315. //上传图片
  316. //图片路径可自行修改
  317. uploadImage(res.tempFilePaths[0], 'trainImg/',
  318. result => {
  319. this.trainImg = result
  320. uni.hideLoading();
  321. }
  322. )
  323. }
  324. });
  325. },
  326. ChooseImageOther() {
  327. uni.chooseImage({
  328. count: 1, //默认9
  329. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  330. sourceType: ['album','camera'], //从相册选择
  331. success: (res) => {
  332. //上传图片
  333. //图片路径可自行修改
  334. uploadImage(res.tempFilePaths[0], 'otherImg/',
  335. result => {
  336. this.otherImg = result
  337. uni.hideLoading();
  338. }
  339. )
  340. }
  341. });
  342. },
  343. goodsValueInput(e){
  344. this.goodsValue = e.detail.value
  345. },
  346. numInput(e){
  347. this.addNum = e.detail.value
  348. },
  349. wechatNoInput(e) {
  350. this.wechatNo = e.detail.value
  351. },
  352. gaipai(){
  353. console.log(1111)
  354. const that = this
  355. uni.showLoading({
  356. title: '正在加载'
  357. })
  358. that.$api.request('user', 'getUserList', {
  359. role:'外勤'
  360. }, failres => {
  361. that.$api.msg(failres.errmsg)
  362. uni.hideLoading()
  363. }).then(res => {
  364. that.userList = res.data
  365. if(that.userList.length == 0){
  366. that.$api.msg('暂无外勤信息')
  367. }
  368. else{
  369. var height = that.userList.length * 100
  370. var width = 500
  371. that.userStyle = "height:"+height+"rpx;width:" + width+"rpx"
  372. that.modalName = 'userModal'
  373. }
  374. uni.hideLoading()
  375. })
  376. },
  377. mygaipai(id){
  378. this.nextUserId=id
  379. var that = this
  380. that.$api.request('tran', 'gaipai',{
  381. taskId: that.taskId,
  382. outPersonId:id,
  383. taskType:that.taskType
  384. },failres => {
  385. that.$api.msg(failres.errmsg)
  386. that.modalName = null
  387. uni.hideLoading()
  388. }).then(res => {
  389. that.modalName = null
  390. uni.navigateBack({
  391. delta: 2
  392. })
  393. uni.hideLoading()
  394. })
  395. },
  396. },
  397. }
  398. </script>
  399. <style lang='scss' scoped="true">
  400. .container{
  401. padding-bottom: 160upx;
  402. }
  403. .carwrap{
  404. font-size:20rpx;
  405. }
  406. .detail-desc {
  407. background: #fff;
  408. margin-top: 16upx;
  409. width: 750upx;
  410. .d-header {
  411. display: flex;
  412. justify-content: center;
  413. align-items: center;
  414. height: 80upx;
  415. font-size: $font-base + 2upx;
  416. color: $font-color-dark;
  417. position: relative;
  418. text {
  419. padding: 0 20upx;
  420. background: #fff;
  421. position: relative;
  422. z-index: 1;
  423. }
  424. &:after {
  425. position: absolute;
  426. left: 50%;
  427. top: 50%;
  428. transform: translateX(-50%);
  429. width: 300upx;
  430. height: 0;
  431. content: '';
  432. border-bottom: 1px solid #ccc;
  433. }
  434. }
  435. }
  436. .carwrap{
  437. display: flex;
  438. justify-content: space-between;
  439. padding: 10px 40px;
  440. border-bottom:1px solid #f0f0f0;
  441. }
  442. .trancount{
  443. display: inline-block;
  444. vertical-align: middle;
  445. text-align: right;
  446. width: 100rpx;
  447. }
  448. .c-list {
  449. font-size: $font-sm + 2upx;
  450. color: $font-color-base;
  451. background: #fff;
  452. .c-row {
  453. display: flex;
  454. align-items: center;
  455. padding: 20upx 30upx;
  456. position: relative;
  457. }
  458. .tit {
  459. width: 220upx;
  460. }
  461. .con {
  462. flex: 1;
  463. color: $font-color-dark;
  464. .selected-text {
  465. margin-right: 10upx;
  466. }
  467. }
  468. .bz-list {
  469. height: 40upx;
  470. font-size: $font-sm+2upx;
  471. color: $font-color-dark;
  472. text {
  473. display: inline-block;
  474. margin-right: 30upx;
  475. }
  476. }
  477. .con-list {
  478. flex: 1;
  479. display: flex;
  480. flex-direction: column;
  481. color: $font-color-dark;
  482. line-height: 40upx;
  483. text-align: right;
  484. padding-right: 20upx;
  485. }
  486. .red {
  487. color: $uni-color-primary;
  488. }
  489. }
  490. /* 底部操作菜单 */
  491. .page-bottom {
  492. position: fixed;
  493. left: 30upx;
  494. bottom: 30upx;
  495. z-index: 95;
  496. display: flex;
  497. justify-content: center;
  498. align-items: center;
  499. width: 690upx;
  500. height: 100upx;
  501. background: rgba(255, 255, 255, .9);
  502. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  503. border-radius: 16upx;
  504. .p-b-btn {
  505. display: flex;
  506. flex-direction: column;
  507. align-items: center;
  508. justify-content: center;
  509. font-size: $font-sm;
  510. color: $font-color-base;
  511. width: 96upx;
  512. height: 80upx;
  513. .yticon {
  514. font-size: 40upx;
  515. line-height: 48upx;
  516. color: $font-color-light;
  517. }
  518. &.active,
  519. &.active .yticon {
  520. color: $uni-color-primary;
  521. }
  522. .icon-fenxiang2 {
  523. font-size: 42upx;
  524. transform: translateY(-2upx);
  525. }
  526. .icon-shoucang {
  527. font-size: 46upx;
  528. }
  529. }
  530. }
  531. @mixin playcenter {
  532. display: flex;
  533. align-items: center;
  534. justify-content: center;
  535. }
  536. .xsh-start {
  537. width: 105rpx;
  538. height: 105rpx;
  539. background: #FFFFFF;
  540. border-radius: 50%;
  541. font-size: 29rpx;
  542. color: #4135EB;
  543. @include playcenter;
  544. flex-wrap: wrap;
  545. }
  546. .x-modal {
  547. width: 100%;
  548. .x-m-title {
  549. width: 100%;
  550. height: 90rpx;
  551. padding: 0 38rpx 0 31rpx;
  552. box-sizing: border-box;
  553. font-size: 29rpx;
  554. color: #333333;
  555. border-bottom: 1px dashed #999;
  556. @include playcenter;
  557. justify-content: space-between;
  558. .xm-t-clear {
  559. font-size: 25rpx;
  560. color: #341DB7;
  561. @include playcenter;
  562. >image {
  563. width: 28rpx;
  564. height: 28rpx;
  565. display: block;
  566. margin-right: 8rpx;
  567. }
  568. }
  569. }
  570. .x-m-con {
  571. width: 100%;
  572. padding: 0 31rpx 18rpx;
  573. margin-top: 5rpx;
  574. box-sizing: border-box;
  575. }
  576. }
  577. .wrapper {
  578. width: 100%;
  579. height: 100%;
  580. margin: 30upx 0;
  581. overflow: hidden;
  582. display: flex;
  583. align-content: center;
  584. flex-direction: column;
  585. justify-content: center;
  586. font-size: 28upx;
  587. }
  588. .handWriting {
  589. background: #fff;
  590. width: 100%;
  591. height: 350upx;
  592. }
  593. .handRight {
  594. align-items: center;
  595. }
  596. .handCenter {
  597. border: 4upx dashed #e9e9e9;
  598. flex: 5;
  599. overflow: hidden;
  600. box-sizing: border-box;
  601. width: 90%;
  602. margin: 0 auto;
  603. }
  604. .handTitle {
  605. flex: 1;
  606. color: #666;
  607. justify-content: center;
  608. font-size: 30upx;
  609. }
  610. .handBtn {
  611. flex-direction: column;
  612. padding: 40upx 20upx;
  613. }
  614. .buttons{
  615. width: 100%;
  616. margin-top: 20upx;
  617. justify-content: space-between;
  618. }
  619. .buttons>button{
  620. font-size: 30upx;
  621. height: 80upx;
  622. }
  623. .delBtn {
  624. background: #23df02;
  625. color: #fff;
  626. }
  627. .color{
  628. align-items: center;
  629. }
  630. .color>text{
  631. margin-right: 20upx;
  632. }
  633. .subBtn {
  634. background: #008ef6;
  635. color: #fff;
  636. text-align: center;
  637. justify-content: center;
  638. }
  639. .black-select {
  640. width: 60upx;
  641. height: 60upx;
  642. }
  643. .black-select.color_select {
  644. width: 90upx;
  645. height: 90upx;
  646. }
  647. .red-select {
  648. width: 60upx;
  649. height: 60upx;
  650. }
  651. .red-select.color_select {
  652. width: 90upx;
  653. height: 90upx;
  654. }
  655. .slide-wrapper {
  656. align-items: center;
  657. margin-bottom: 20upx;
  658. }
  659. .slider{
  660. width: 400upx;
  661. padding-left: 20upx;
  662. }
  663. .drop {
  664. width: 50upx;
  665. height: 50upx;
  666. border-radius: 50%;
  667. background: #FFF;
  668. position: absolute;
  669. left: 0upx;
  670. top: -10upx;
  671. box-shadow: 0px 1px 5px #888888;
  672. }
  673. .slide {
  674. width: 250upx;
  675. height: 30upx;
  676. }
  677. .showimg{
  678. border: 4upx solid #e9e9e9;
  679. overflow: hidden;
  680. width: 90%;
  681. margin: 0 auto;
  682. background: #eee;
  683. height: 350upx;
  684. margin-top: 40upx;
  685. align-items: center;
  686. justify-content: center;
  687. }
  688. .showimg>image{
  689. width: 100%;
  690. height: 100%;
  691. }
  692. .showimg>text{
  693. font-size: 40upx;
  694. color: #888;
  695. }
  696. .indexFixed{
  697. position: fixed;
  698. left:0;
  699. bottom:0;
  700. right:0;
  701. }
  702. </style>