purchasecontract.vue 16 KB

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