task_detail_jy.vue 15 KB

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