salecontract.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <view class="container">
  3. <u-form ref="uForm">
  4. <u-form-item label-width='260' label="合同编号">
  5. <u-input v-model="list.contractNo" input-align="right" placeholder="" disabled />
  6. </u-form-item>
  7. <u-form-item label-width='260' label="运输方式">
  8. <u-input v-model="list.shippingType" input-align="right" placeholder="" disabled />
  9. </u-form-item>
  10. <u-form-item label-width='260' label="买方">
  11. <u-input v-model="list.buyer" input-align="right" placeholder="" disabled />
  12. </u-form-item>
  13. <u-form-item label-width='260' label="买方电话">
  14. <u-input v-model="list.buyerPhone" input-align="right" placeholder="" disabled />
  15. </u-form-item>
  16. <u-form-item label-width='260' label="卖方">
  17. <u-input v-model="list.seller" input-align="right" placeholder="" disabled />
  18. </u-form-item>
  19. <u-form-item label-width='260' label="卖方电话">
  20. <u-input v-model="list.sellerPhone" input-align="right" placeholder="" disabled />
  21. </u-form-item>
  22. <u-form-item label-width='260' label="结算方式">
  23. <u-input v-model="list.settlementMethod" input-align="right" placeholder="" disabled />
  24. </u-form-item>
  25. <u-form-item label-width='260' label="交货方式">
  26. <u-input v-model="list.deliverType1" input-align="right" placeholder="" disabled />
  27. </u-form-item>
  28. <u-form-item label-width='260' label="包装方式">
  29. <u-input v-model="list.packingMethod" input-align="right" placeholder="" disabled />
  30. </u-form-item>
  31. <u-form-item label-width='260' label="验收方式">
  32. <u-input v-model="list.acceptanceMethod" input-align="right" placeholder="" disabled />
  33. </u-form-item>
  34. <u-form-item label-width='260' label="重量(吨)">
  35. <u-input v-model="list.weight" input-align="right" placeholder="" disabled />
  36. </u-form-item>
  37. <u-form-item label-width='260' label="交货日期(起)">
  38. <u-input v-model="list.deliveryDateStart" input-align="right" placeholder="" disabled />
  39. </u-form-item>
  40. <u-form-item label-width='260' label="溢短装(%)">
  41. <u-input v-model="list.overShort" input-align="right" placeholder="" disabled />
  42. </u-form-item>
  43. <u-form-item label-width='260' label="交货日期(止)">
  44. <u-input v-model="list.deliveryDateEnd" input-align="right" placeholder="" disabled />
  45. </u-form-item>
  46. <u-form-item label-width='260' label="合同单价(元/吨)">
  47. <u-input v-model="list.unitContractPrice" input-align="right" placeholder="" disabled />
  48. </u-form-item>
  49. <u-form-item label-width='260' label="合同总价(元)">
  50. <u-input v-model="list.totalContractPrice" input-align="right" placeholder="" disabled />
  51. </u-form-item>
  52. <u-form-item label-width='260' label="货源所在地区">
  53. <view class="textCss">
  54. {{list.sourceProvince}}{{list.sourceCity}}{{list.sourceArea}}
  55. </view>
  56. </u-form-item>
  57. <u-form-item label-width='260' label="货源详细地址">
  58. <u-input v-model="list.sourceGoods" input-align="right" placeholder="" disabled />
  59. </u-form-item>
  60. <u-form-item label-width='260' label="交货地所在地区">
  61. <view class="textCss">
  62. {{list.deliveryProvince}}{{list.deliveryCity}}{{list.deliveryArea}}
  63. </view>
  64. </u-form-item>
  65. <u-form-item label-width='260' label="交货地详细地址">
  66. <u-input v-model="list.placeDelivery" input-align="right" placeholder="" disabled />
  67. </u-form-item>
  68. <u-form-item label-width='260' label="签订日期">
  69. <u-input v-model="list.signingDate" input-align="right" placeholder="" disabled />
  70. </u-form-item>
  71. <u-form-item label-width='300' label="最终实际交易量(吨)">
  72. <u-input v-model="list.finalTradingVolume" input-align="right" placeholder="" disabled />
  73. </u-form-item>
  74. <u-form-item label-width='260' label="货名">
  75. <u-input v-model="list.contractGoodsInfo.goodsName" input-align="right" placeholder="" disabled />
  76. </u-form-item>
  77. <u-form-item label-width='260' label="水分(%)<=">
  78. <u-input v-model="list.contractGoodsInfo.waterContent" input-align="right" placeholder="" disabled />
  79. </u-form-item>
  80. <u-form-item label-width='260' label="品级">
  81. <u-input v-model="list.contractGoodsInfo.grade" input-align="right" placeholder="" disabled />
  82. </u-form-item>
  83. <u-form-item label-width='260' label="杂质(%)<=">
  84. <u-input v-model="list.contractGoodsInfo.impurity" input-align="right" placeholder="" disabled />
  85. </u-form-item>
  86. <u-form-item label-width='260' label="容重(克/升)>=">
  87. <u-input v-model="list.contractGoodsInfo.bulkDensity" input-align="right" placeholder="" disabled />
  88. </u-form-item>
  89. <u-form-item label-width='260' label="霉变粒(%)<=">
  90. <u-input v-model="list.contractGoodsInfo.mildewGrain" input-align="right" placeholder="" disabled />
  91. </u-form-item>
  92. <u-form-item label-width='260' label="热损伤(%)<=">
  93. <u-input v-model="list.contractGoodsInfo.jiaorenli" input-align="right" placeholder="" disabled />
  94. </u-form-item>
  95. <u-form-item label-width='260' label="不完善粒(%)<=">
  96. <u-input v-model="list.contractGoodsInfo.imperfectGrain" input-align="right" placeholder="" disabled />
  97. </u-form-item>
  98. <u-form-item label-width='260' label="合同收入(元)">
  99. <u-input v-model="list.contractProcessInfo.goodsNameKey" input-align="right" placeholder="" disabled />
  100. </u-form-item>
  101. <u-form-item label-width='260' label="已开发票(元)">
  102. <u-input v-model="list.contractProcessInfo.goodsName" input-align="right" placeholder="" disabled />
  103. </u-form-item>
  104. <u-form-item label-width='260' label="费用支出(元)">
  105. <u-input v-model="list.contractProcessInfo.waterContent" input-align="right" placeholder="" disabled />
  106. </u-form-item>
  107. <u-form-item label-width='260' label="未开发票(元)">
  108. <u-input v-model="list.contractProcessInfo.impurity" input-align="right" placeholder="" disabled />
  109. </u-form-item>
  110. <u-form-item label-width='260' label="未回款(元)">
  111. <u-input v-model="list.contractProcessInfo.mildewGrain" input-align="right" placeholder="" disabled />
  112. </u-form-item>
  113. <u-form-item label-width='260' label="双章原件回收情况">
  114. <u-input v-model="list.contractProcessInfo.grade" input-align="right" placeholder="" disabled />
  115. </u-form-item>
  116. <u-form-item label-width='260' label="备注信息">
  117. </u-form-item>
  118. <u-form-item>
  119. <textarea class='textarea' v-model="list.remarks" input-align="right" placeholder="" disabled />
  120. </u-form-item>
  121. <u-form-item label-width='260' label="附件">
  122. <!-- <view class="textCss">
  123. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1" :file-list="imglist"
  124. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  125. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress" :deletable="false" :showProgress = "false"></upload>
  126. </view> -->
  127. <!-- {{list.contractProcessInfo.grade}} -->
  128. <!-- <view v-for='item in imglist'>
  129. <image style='width:100px;height:100px;' :src="item" mode=""></image>
  130. </view> -->
  131. <view v-for='item in imglist'>
  132. <view @click='shadeshow(item)'>
  133. <image style='width: 200rpx;height: 200rpx;' :src="item" mode=""></image>
  134. </view>
  135. </view>
  136. </u-form-item>
  137. </u-form>
  138. <view style='padding:10px;' class='flex bottom-btn'>
  139. <u-button v-if='list.approveStatus||isSHowBtn' @click='reject' type="error" class="btn1" hover-class='none'>
  140. 驳回
  141. </u-button>
  142. <u-button v-if='list.approveStatus||isSHowBtn' @click='pass' type="success" class="btn2">通过
  143. </u-button>
  144. </view>
  145. <view v-if='show' class="shade">
  146. <view class="wrap">
  147. <view class="alert-top">
  148. <view class="title">
  149. {{title}}
  150. </view>
  151. <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
  152. </view>
  153. <view class="u-textarea-style">
  154. <view class="right-bottom">
  155. {{auditMind.length}}/100个字
  156. </view>
  157. <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
  158. maxlength="100" />
  159. </view>
  160. <view @click='close()' class="cancel">取消</view>
  161. <view @click='passSubmit()' class="confirm">确定</view>
  162. </view>
  163. </view>
  164. <view @click='imgShow=false' v-if="imgShow" class="shade">
  165. <image style='position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;' :src="url" mode=""></image>
  166. </view>
  167. </view>
  168. </template>
  169. <script>
  170. import upload from '@/components/upload.vue';
  171. import helper from '@/common/helper.js';
  172. export default {
  173. components: {
  174. upload
  175. },
  176. data() {
  177. return {
  178. everyCheck: '',
  179. id: "",
  180. currentPage: 1,
  181. pageSize: 10,
  182. list: {
  183. status: "",
  184. contractGoodsInfo: {},
  185. contractProcessInfo: {}
  186. },
  187. imglist: [],
  188. title: '',
  189. auditMind: '',
  190. show: false,
  191. contractNo: "",
  192. action: this.$uploadUrl,
  193. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  194. isAdd: true,
  195. url: "",
  196. imgShow: false,
  197. height: 200,
  198. autoHeight: true,
  199. border: false,
  200. rejectInfo: "",
  201. rejectInfo1: "",
  202. isSHowBtn: true,
  203. }
  204. },
  205. onBackPress(e) {
  206. if(this.everyCheck){
  207. uni.navigateTo({
  208. url: "/pages/task/my_task"
  209. })
  210. return true;
  211. }
  212. },
  213. onLoad(options) {
  214. this.id = options.id
  215. this.everyCheck = uni.getStorageSync("everyTask")
  216. this.isSHowBtn = options.isShowbtn
  217. this.getList()
  218. },
  219. methods: {
  220. shadeshow(url) {
  221. this.imgShow = true
  222. this.url = url
  223. },
  224. getList(id) {
  225. var that = this
  226. this.$api.doRequest('get', '/contractManagementInfo/getInfo', {
  227. id: this.id
  228. }).then(res => {
  229. if (res.data.code == 200) {
  230. this.list = res.data.data
  231. if (this.list.deliverType == 1) {
  232. this.list.deliverType1 = '我方送货'
  233. } else if (this.list.deliverType == 2) {
  234. this.list.deliverType1 = '对方自提'
  235. }
  236. this.$api.doRequest('get', '/appendix/query/getFileList', {
  237. appendixIds: that.list.addressUrl
  238. }).then(res1 => {
  239. for (var i = 0; i < res1.data.data.length; i++) {
  240. that.imglist.push(
  241. res1.data.data[i].appendixPath
  242. )
  243. }
  244. })
  245. }
  246. })
  247. },
  248. onRemove() {
  249. return
  250. },
  251. filterFileType(index, lists) {
  252. if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
  253. lists.splice(index, 1);
  254. // 当前文件不支持
  255. uni.showModal({
  256. title: '暂不支持当前图片类型',
  257. showCancel: false
  258. });
  259. } else {
  260. this.isAdd = false;
  261. }
  262. },
  263. close() {
  264. this.show = false
  265. },
  266. pass() {
  267. this.show = true
  268. this.title = '审核意见(通过)'
  269. },
  270. reject() {
  271. this.show = true
  272. this.title = '驳回原因(驳回)'
  273. },
  274. //驳回
  275. rejectSubmit() {
  276. var that = this
  277. uni.showLoading({
  278. title: '加载中',
  279. mask: true
  280. });
  281. that.$api.doRequest('post', '/workflow/api/handle', {
  282. taskId: that.list.taskId,
  283. approved: false,
  284. auditMind: this.rejectInfo,
  285. needReapply: true,
  286. }).then(res => {
  287. that.$api.msg('驳回成功')
  288. that.show = false
  289. setTimeout(function() {
  290. if (that.everyCheck) {
  291. helper.setAudit(that.list)
  292. } else {
  293. uni.navigateBack()
  294. }
  295. uni.hideLoading()
  296. }, 1000);
  297. })
  298. },
  299. pass() {
  300. this.show = true
  301. this.title = '审核意见'
  302. },
  303. reject() {
  304. this.show = true
  305. this.title = '驳回原因(驳回)'
  306. },
  307. //通过
  308. passSubmit() {
  309. var that = this
  310. if (this.title == '驳回原因(驳回)') {
  311. this.rejectSubmit()
  312. } else {
  313. uni.showLoading({
  314. title: '加载中',
  315. mask: true
  316. });
  317. that.$api.doRequest('post', '/workflow/api/handle', {
  318. taskId: that.list.taskId,
  319. approved: true,
  320. auditMind: this.rejectInfo1,
  321. needReapply: true,
  322. }).then(res => {
  323. that.$api.msg('通过成功')
  324. that.show = false
  325. setTimeout(function() {
  326. if (that.everyCheck) {
  327. helper.setAudit(that.list)
  328. } else {
  329. uni.navigateBack()
  330. }
  331. uni.hideLoading()
  332. }, 1000);
  333. })
  334. }
  335. },
  336. //审核方法
  337. audit(item, index, status, status2, reason) {
  338. if (index < this.list.length) {
  339. this.$api.doRequest('post', '/workflow/api/handle', {
  340. taskId: item.taskId,
  341. approved: status,
  342. auditMind: reason != undefined ? '已驳回' : '34',
  343. needReapply: status2 != undefined ? true : false,
  344. }).then(res => {
  345. this.audit(this.list[index + 1], index + 1, status)
  346. })
  347. } else {
  348. if (status == true) {
  349. that.$api.msg('通过成功')
  350. this.getList()
  351. } else if (status == false) {
  352. that.$api.msg('驳回成功')
  353. this.getList()
  354. }
  355. }
  356. },
  357. }
  358. }
  359. </script>
  360. <style scoped lang="scss">
  361. .container {
  362. padding: 20rpx 20rpx 250rpx 20rpx;
  363. }
  364. .u-form {
  365. background: #fff;
  366. border-radius: 10px;
  367. padding: 0 10px;
  368. .u-form-item {
  369. line-height: 30px;
  370. padding: 5px 0;
  371. }
  372. }
  373. .content {
  374. margin-top: 30rpx;
  375. .top {
  376. display: flex;
  377. justify-content: space-between;
  378. }
  379. .content-item {
  380. border-radius: 20rpx;
  381. background: white;
  382. padding: 40rpx 20rpx;
  383. margin-bottom: 30rpx;
  384. }
  385. .title {
  386. font-size: 32rpx;
  387. font-weight: 600;
  388. color: #333333;
  389. text-align: left;
  390. margin: 20rpx 0;
  391. }
  392. .car-container {
  393. border-bottom: 2rpx solid #EEEEEE;
  394. }
  395. .car-type-item {
  396. font-size: 28rpx;
  397. margin: 20rpx 0;
  398. color: #878C9C;
  399. }
  400. .weightInfoCss {
  401. font-size: 28rpx;
  402. color: #333333;
  403. font-weight: 500;
  404. }
  405. .row {
  406. display: flex;
  407. justify-content: space-between;
  408. // .right,
  409. // input {
  410. // font-size: 28rpx;
  411. // // color: #333333;
  412. // }
  413. }
  414. .money {
  415. font-size: 32rpx;
  416. font-weight: 500;
  417. margin-bottom: 30rpx;
  418. }
  419. .moneyInfo {
  420. color: #22C572;
  421. font-size: 32rpx;
  422. }
  423. }
  424. .bottom-btn {
  425. width: 100%;
  426. position: fixed;
  427. bottom: 0;
  428. display: flex;
  429. z-index: 2;
  430. left: 0;
  431. background-color: #f8f8f8;
  432. flex-direction: column;
  433. .btn1,
  434. .btn2 {
  435. width: 100%;
  436. margin-bottom: 26rpx;
  437. border-radius: 90rpx;
  438. }
  439. .btn1 {
  440. background: white;
  441. color: #00C265;
  442. }
  443. }
  444. .topInfo {
  445. height: 210rpx;
  446. background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
  447. padding: 30rpx;
  448. .topInfo-item {
  449. height: 150rpx;
  450. background-color: #FFFFFF;
  451. border-radius: 20rpx;
  452. padding: 40rpx;
  453. .logo {
  454. width: 40rpx;
  455. height: 40rpx;
  456. margin-top: 8rpx;
  457. }
  458. .infoText {
  459. font-size: 36rpx;
  460. font-weight: 600;
  461. margin-left: 20rpx;
  462. }
  463. .infoData {
  464. color: #878C9C;
  465. font-size: 26rpx;
  466. margin-top: 10rpx;
  467. }
  468. }
  469. }
  470. .shade {
  471. position: fixed;
  472. top: 0;
  473. left: 0;
  474. height: 100%;
  475. width: 100%;
  476. background: rgba(0, 0, 0, 0.4);
  477. z-index: 3;
  478. .wrap {
  479. position: absolute;
  480. left: 0;
  481. top: 0;
  482. right: 0;
  483. bottom: 0;
  484. margin: auto;
  485. background: #fff;
  486. width: calc(100% - 198rpx);
  487. height: 700rpx;
  488. border-radius: 20rpx;
  489. .alert-top {
  490. padding: 33rpx;
  491. display: flex;
  492. justify-content: center;
  493. align-items: center;
  494. position: relative;
  495. }
  496. .title {
  497. font-size: 32rpx;
  498. font-weight: 600;
  499. color: #333333;
  500. }
  501. .close {
  502. position: absolute;
  503. right: 33rpx;
  504. }
  505. }
  506. }
  507. .cancel,
  508. .confirm {
  509. position: absolute;
  510. display: inline-block;
  511. width: 50%;
  512. text-align: center;
  513. bottom: 0;
  514. padding: 10px;
  515. border-top: 1px solid #eee;
  516. font-size: 34rpx;
  517. }
  518. .cancel {
  519. left: 0;
  520. border-right: 1px solid #eee;
  521. color: #AFB3BF;
  522. }
  523. .confirm {
  524. right: 0;
  525. color: #22C572;
  526. }
  527. .textarea {
  528. margin: 20px auto;
  529. width: 100%;
  530. background: #F9F9FA;
  531. border-radius: 10px;
  532. border: 1px solid #EEEEEE;
  533. font-size: 28rpx;
  534. padding: 10px;
  535. }
  536. .textCss {
  537. display: flex;
  538. justify-content: flex-end;
  539. width: 100%;
  540. text-align: right;
  541. }
  542. .u-textarea-style {
  543. margin: 20rpx;
  544. background: #F9F9FA;
  545. border-radius: 10px;
  546. border: 1px solid #EEEEEE;
  547. padding: 10rpx 20rpx;
  548. position: relative;
  549. .right-bottom {
  550. position: absolute;
  551. right: 20rpx;
  552. bottom: 20rpx;
  553. color: #AFB3BF;
  554. }
  555. }
  556. /deep/.u-input__textarea {
  557. height: 300rpx !important;
  558. }
  559. </style>