contractdetail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. <template>
  2. <view>
  3. <view class="headboxcon">
  4. <view class="contractin">
  5. <text class="tis">合同基础信息</text>
  6. <view class="tip">
  7. <text class="yu">合同名称</text>
  8. <text class="yuna">{{msg.name}}</text>
  9. </view>
  10. <view class="tip">
  11. <text class="yu">合同编号</text>
  12. <text class="yuna">{{msg.contractNo}}</text>
  13. </view>
  14. <view class="tipup">
  15. <text class="yu">合同附件</text>
  16. <view class="upbox">
  17. <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
  18. :maxCount="fileList1.length" :deletable="false"></u-upload>
  19. </view>
  20. </view>
  21. <view class="tipup">
  22. <text class="yu">发票附件</text>
  23. <view class="upbox">
  24. <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple
  25. :maxCount="fileList2.length" :deletable="false"></u-upload>
  26. </view>
  27. </view>
  28. <view class="tipup">
  29. <text class="yu">贸易合同</text>
  30. <view class="upbox">
  31. <u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple
  32. :maxCount="fileList3.length" :deletable="false"></u-upload>
  33. </view>
  34. </view>
  35. <view class="tip" style="border-top: 1rpx solid #E8E8E8;margin-top: 20rpx;padding-top: 30rpx;">
  36. <text class="yu">合同状态</text>
  37. <text v-if="msg.statusText=='待审核'" :style="{'color':'#D05C39;'}">{{msg.statusText}}</text>
  38. <text v-if="msg.statusText=='失败'" :style="{'color':'#1F242A'}">{{msg.statusText}}</text>
  39. <text v-if="msg.statusText=='已删除'" :style="{'color':'#1F242A'}">{{msg.statusText}}</text>
  40. <text v-if="msg.statusText=='成功'" :style="{'color':'#D8AB5A'}">{{msg.statusText}}</text>
  41. </view>
  42. <view class="">
  43. <view class="tipup " style="display: flex;flex-direction: column;">
  44. <text class="yu">审核反馈</text>
  45. <view>
  46. <textarea placeholder="请输入审核反馈"
  47. style="background-color: #F6F6F6;width: 640rpx;height: 200rpx;border-radius: 20rpx;padding: 20rpx;box-sizing: border-box;margin:20rpx 0;margin-bottom: 30rpx;"
  48. v-model="fankui"></textarea>
  49. </view>
  50. </view>
  51. <view class="tipup">
  52. <text class="yu">反馈截图</text>
  53. <view class="upbox" style="margin-bottom: 30rpx;">
  54. <u-upload :fileList="fileList4" @afterRead="afterRead" @delete="deletePic" name="4" multiple
  55. :maxCount="6"></u-upload>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="acpcardlist">
  62. <view class="lable " v-for="(item,index) in msg.contractDraft.result" :key="index">
  63. <view class="radiobox" v-if="editall">
  64. <radio :value="index" :checked="item.checked" color="#D8AB5A" @click="checkBox(item.id)" />
  65. </view>
  66. <view class="acpcard" @click="billDetail(item.id,index)">
  67. <view class="allmsg">
  68. <view class="acpcont">
  69. <view class="acpname">
  70. <text style="flex: 1;">{{item.name}}</text>
  71. <view class="tag">{{item.statusText}}</view>
  72. </view>
  73. <view class="acpinfo ">
  74. <text class="pt">汇票号码:{{item.draftNo}}</text>
  75. <text class="pt">金额:¥ {{item.money}}</text>
  76. <text class="pt">服务费:¥ {{item.serviceMoney}}</text>
  77. <text class="pt">承兑人:{{item.acceptorName}}</text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="totalmanage ">
  85. <text style="color:#68625B;font-size: 28rpx;">合计:4份</text>
  86. <view class=" maboxtitls" @click="editall=true">
  87. <view class="managebox">
  88. <image src="/static/img/manage.png" mode="aspectFit"></image>
  89. </view>
  90. <text style="padding-left: 15rpx;">管理</text>
  91. </view>
  92. </view>
  93. <view style="padding-bottom:150rpx;"></view>
  94. <view class="safebt"></view>
  95. <view class="newbill flex1" @click="addBill" v-if="state==1">
  96. <view class="newbillbtn">
  97. <text>新增汇票</text>
  98. </view>
  99. </view>
  100. <view class="newbill flex1" v-if="state==0&&msg.statusText=='待审核'">
  101. <view class="choosebtn">
  102. <view class="delbtn flex1" @click="examineFail()">审核失败</view>
  103. <view class="succbtn flex1" @click="examineSuccess">审核成功</view>
  104. </view>
  105. </view>
  106. <!-- 底部删除 -->
  107. <u-popup :show="editall&&state==1" @close="closeEidt" @open="openEidt" :overlay="false">
  108. <view class="editbox">
  109. <view class="chooseall flex6">
  110. <view class="leftchoose ">
  111. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  112. <text>全选</text>
  113. </view>
  114. <view class="surebtn" @click="selectDown">
  115. 完成
  116. </view>
  117. </view>
  118. <view class="choosebtn">
  119. <view class="delbtn flex1" @click="dele()">刪除</view>
  120. <view class="restorebtn flex1" @click="restore()">复原</view>
  121. </view>
  122. </view>
  123. </u-popup>
  124. <!-- 底部删除 -->
  125. <u-popup :show="editall&&state==0" @close="closeEidt" @open="openEidt" :overlay="false">
  126. <view class="editbox">
  127. <view class="chooseall flex6">
  128. <view class="leftchoose ">
  129. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  130. <text>全选</text>
  131. </view>
  132. <view class="anniu">
  133. <text class="usa" @click="dele()">删除</text>
  134. <text class="usa" @click="restore()">复原</text>
  135. <text @click="selectDown" class="usa">完成</text>
  136. </view>
  137. </view>
  138. <view class="choosebtn">
  139. <view class="delbtn flex1" @click="examineBillFail()">审核失败</view>
  140. <view class="restorebtn flex1" @click="examineBillSuccess()">审核成功</view>
  141. </view>
  142. </view>
  143. </u-popup>
  144. </view>
  145. </template>
  146. <script>
  147. let that
  148. export default {
  149. data() {
  150. return {
  151. editall: false,
  152. quan: false,
  153. state: 0,
  154. fileList1: [],
  155. fileList2: [],
  156. fileList3: [],
  157. fileList4: [],
  158. msg: '',
  159. id: '',
  160. fankui: ''
  161. }
  162. },
  163. onLoad(o) {
  164. that = this
  165. if (o.id) {
  166. this.id = o.id
  167. }
  168. this.state = this.$store.state.admin
  169. this.init()
  170. },
  171. methods: {
  172. init() {
  173. uni.showLoading()
  174. uni.$u.http.get(`/api/Contract/${this.id}`, {
  175. custom: {
  176. auth: true
  177. }
  178. }).then((res) => {
  179. uni.hideLoading()
  180. this.msg = res
  181. this.msg.contractDraft.result.forEach(item => {
  182. item.checked = false
  183. })
  184. const newData1 = res.picList.map((item) => {
  185. return {
  186. url: item,
  187. }
  188. })
  189. console.log(newData2)
  190. this.fileList1 = newData1
  191. console.log(newData2)
  192. const newData2 = res.invoicePicList.map((item) => {
  193. return {
  194. url: item,
  195. }
  196. })
  197. this.fileList2 = newData2
  198. const newData3 = res.tradePicList.map((item) => {
  199. return {
  200. url: item,
  201. }
  202. })
  203. this.fileList3 = newData3
  204. }).catch((err) => {
  205. uni.hideLoading()
  206. console.log(err)
  207. })
  208. },
  209. openEidt() {
  210. this.editall = true
  211. },
  212. checkBox(id) {
  213. let list = this.msg.contractDraft.result
  214. list.forEach(item => {
  215. if (item.id == id) {
  216. item.checked = !item.checked
  217. }
  218. })
  219. this.msg.contractDraft.result = JSON.parse(JSON.stringify(list))
  220. },
  221. allSelect() {
  222. let list = this.msg.contractDraft.result
  223. if (this.quan) {
  224. list.forEach(item => {
  225. item.checked = true
  226. })
  227. } else {
  228. list.forEach(item => {
  229. item.checked = false
  230. })
  231. }
  232. this.msg.contractDraft.result = JSON.parse(JSON.stringify(list))
  233. },
  234. acpDetail() {
  235. uni.navigateTo({
  236. url: "/pages/alldeatil/acptdetail"
  237. })
  238. },
  239. addBill() {
  240. uni.navigateTo({
  241. url: "/pages/alldeatil/addbill"
  242. })
  243. },
  244. billDetail(id, index) {
  245. let obj = {
  246. id: id,
  247. index: index
  248. }
  249. uni.navigateTo({
  250. url: "/pages/alldeatil/billdetail?obj=" + JSON.stringify(obj)
  251. })
  252. },
  253. makeSureAll() {
  254. this.quan = !this.quan
  255. this.allSelect()
  256. },
  257. selectDown() {
  258. this.editall = false
  259. this.quan = true
  260. let list = this.msg.contractDraft.result
  261. list.forEach(item => {
  262. item.checked = false
  263. })
  264. },
  265. examineSuccess() {
  266. let ids = []
  267. ids.push(this.id)
  268. if (ids.length == 0) {
  269. that.$toast("请选择合同")
  270. return
  271. }
  272. uni.showModal({
  273. title: '提示',
  274. content: "是否审核成功?",
  275. success: function(res) {
  276. if (res.confirm) {
  277. uni.showLoading()
  278. uni.$u.http.post('/api/Contract/manage', {
  279. ids: ids,
  280. operateType: 3
  281. }, {
  282. custom: {
  283. auth: true
  284. }
  285. }).then((res) => {
  286. uni.hideLoading()
  287. that.editall = false
  288. that.quan = false
  289. that.$toast("操作成功")
  290. setTimeout(() => {
  291. that.init()
  292. }, 500)
  293. }).catch((err) => {
  294. uni.hideLoading()
  295. that.$toast(err.msg)
  296. })
  297. } else if (res.cancel) {
  298. }
  299. }
  300. })
  301. },
  302. examineFail() {
  303. let ids = []
  304. ids.push(this.id)
  305. if (ids.length == 0) {
  306. this.$toast("请选择合同")
  307. return
  308. }
  309. uni.showModal({
  310. title: '提示',
  311. content: '是否审核失败?',
  312. success: function(res) {
  313. if (res.confirm) {
  314. uni.showLoading()
  315. uni.$u.http.post('/api/Contract/manage', {
  316. ids: ids,
  317. operateType: 4
  318. }, {
  319. custom: {
  320. auth: true
  321. }
  322. }).then((res) => {
  323. uni.hideLoading()
  324. that.editall = false
  325. that.quan = false
  326. that.$toast("操作成功")
  327. setTimeout(() => {
  328. that.init()
  329. }, 500)
  330. }).catch((err) => {
  331. uni.hideLoading()
  332. that.$toast(err.msg)
  333. })
  334. } else if (res.cancel) {
  335. console.log('用户点击取消');
  336. }
  337. }
  338. });
  339. },
  340. examineBillSuccess() {
  341. let ids = []
  342. this.msg.contractDraft.result.forEach(item => {
  343. if (item.checked) {
  344. ids.push(item.id)
  345. }
  346. })
  347. if (ids.length == 0) {
  348. that.$toast("请选择汇票")
  349. return
  350. }
  351. uni.showModal({
  352. title: '提示',
  353. content: "是否批量审核成功?",
  354. success: function(res) {
  355. if (res.confirm) {
  356. uni.showLoading()
  357. uni.$u.http.post('/api/Contract/contractDraft/manager', {
  358. ids: ids,
  359. operateType: 3
  360. }, {
  361. custom: {
  362. auth: true
  363. }
  364. }).then((res) => {
  365. uni.hideLoading()
  366. that.editall = false
  367. that.quan = false
  368. that.$toast("操作成功")
  369. setTimeout(() => {
  370. that.init()
  371. }, 500)
  372. }).catch((err) => {
  373. uni.hideLoading()
  374. that.$toast(err.msg)
  375. })
  376. } else if (res.cancel) {
  377. }
  378. }
  379. })
  380. },
  381. examineBillFail() {
  382. let ids = []
  383. this.msg.contractDraft.result.forEach(item => {
  384. if (item.checked) {
  385. ids.push(item.id)
  386. }
  387. })
  388. if (ids.length == 0) {
  389. this.$toast("请选择汇票")
  390. return
  391. }
  392. uni.showModal({
  393. title: '提示',
  394. content: '是否审核失败?',
  395. success: function(res) {
  396. if (res.confirm) {
  397. uni.showLoading()
  398. uni.$u.http.post('/api/Contract/contractDraft/manager', {
  399. ids: ids,
  400. operateType: 4
  401. }, {
  402. custom: {
  403. auth: true
  404. }
  405. }).then((res) => {
  406. uni.hideLoading()
  407. that.editall = false
  408. that.quan = false
  409. that.$toast("操作成功")
  410. setTimeout(() => {
  411. that.init()
  412. }, 500)
  413. }).catch((err) => {
  414. uni.hideLoading()
  415. that.$toast(err.msg)
  416. })
  417. } else if (res.cancel) {
  418. console.log('用户点击取消');
  419. }
  420. }
  421. });
  422. },
  423. dele() {
  424. let ids = []
  425. this.msg.contractDraft.result.forEach(item => {
  426. if (item.checked) {
  427. ids.push(item.id)
  428. }
  429. })
  430. if (ids.length == 0) {
  431. that.$toast("请选择汇票")
  432. return
  433. }
  434. uni.showModal({
  435. title: '提示',
  436. content: "是否删除合同?",
  437. success: function(res) {
  438. if (res.confirm) {
  439. uni.showLoading()
  440. uni.$u.http.post('/api/Contract/contractDraft/manager', {
  441. ids: ids,
  442. operateType: 1
  443. }, {
  444. custom: {
  445. auth: true
  446. }
  447. }).then((res) => {
  448. uni.hideLoading()
  449. that.editall = false
  450. that.quan = false
  451. that.$toast("操作成功")
  452. setTimeout(() => {
  453. that.init()
  454. }, 500)
  455. }).catch((err) => {
  456. uni.hideLoading()
  457. that.$toast(err.msg)
  458. })
  459. } else if (res.cancel) {
  460. }
  461. }
  462. })
  463. },
  464. restore() {
  465. let ids = []
  466. this.msg.contractDraft.result.forEach(item => {
  467. if (item.checked) {
  468. ids.push(item.id)
  469. }
  470. })
  471. if (ids.length == 0) {
  472. that.$toast("请选择汇票")
  473. return
  474. }
  475. uni.showModal({
  476. title: '提示',
  477. content: "是否复原汇票?",
  478. success: function(res) {
  479. if (res.confirm) {
  480. uni.showLoading()
  481. uni.$u.http.post('/api/Contract/contractDraft/manager', {
  482. ids: ids,
  483. operateType: 2
  484. }, {
  485. custom: {
  486. auth: true
  487. }
  488. }).then((res) => {
  489. uni.hideLoading()
  490. that.editall = false
  491. that.quan = false
  492. that.$toast("操作成功")
  493. setTimeout(() => {
  494. that.init()
  495. }, 500)
  496. }).catch((err) => {
  497. uni.hideLoading()
  498. that.$toast(err.msg)
  499. })
  500. } else if (res.cancel) {
  501. }
  502. }
  503. })
  504. },
  505. // 删除图片
  506. deletePic(event) {
  507. this[`fileList${event.name}`].splice(event.index, 1)
  508. },
  509. // 新增图片
  510. async afterRead(event) {
  511. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  512. let lists = [].concat(event.file)
  513. let fileListLen = this[`fileList${event.name}`].length
  514. lists.map((item) => {
  515. this[`fileList${event.name}`].push({
  516. ...item,
  517. status: 'uploading',
  518. message: '上传中'
  519. })
  520. })
  521. for (let i = 0; i < lists.length; i++) {
  522. const result = await this.uploadFilePromise(lists[i].url)
  523. let item = this[`fileList${event.name}`][fileListLen]
  524. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  525. status: 'success',
  526. message: '',
  527. url: result
  528. }))
  529. fileListLen++
  530. }
  531. },
  532. uploadFilePromise(url) {
  533. return new Promise((resolve, reject) => {
  534. let a = uni.uploadFile({
  535. url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  536. filePath: url,
  537. name: 'file',
  538. formData: {
  539. user: 'test'
  540. },
  541. success: (res) => {
  542. setTimeout(() => {
  543. resolve(res.data.data)
  544. }, 1000)
  545. }
  546. });
  547. })
  548. },
  549. }
  550. }
  551. </script>
  552. <style lang="scss">
  553. page {
  554. background-color: #F6F6F6 !important;
  555. }
  556. .headboxcon {
  557. margin: 20rpx 30rpx;
  558. background-color: #fff;
  559. border-radius: 20rpx;
  560. padding: 0 30rpx;
  561. box-sizing: border-box;
  562. .tis {
  563. font-size: 36rpx;
  564. font-weight: 600;
  565. display: block;
  566. padding: 30rpx 0;
  567. padding-top: 50rpx;
  568. }
  569. .tipup {
  570. display: flex;
  571. }
  572. .upbox {
  573. margin-left: 30rpx;
  574. width: 490rpx;
  575. }
  576. .yu {
  577. display: block;
  578. width: 120rpx;
  579. color: #BEBDBB;
  580. }
  581. .tip {
  582. padding-bottom: 30rpx;
  583. font-size: 28rpx;
  584. display: flex;
  585. justify-content: space-between;
  586. .yuna {}
  587. }
  588. }
  589. .searchbox {
  590. padding-left: 30rpx;
  591. box-sizing: border-box;
  592. background-color: #ECECEC;
  593. border-radius: 38rpx;
  594. // width: 688rpx;
  595. flex: 1;
  596. height: 75rpx;
  597. margin: 0 auto;
  598. display: flex;
  599. align-items: center;
  600. justify-content: center;
  601. }
  602. .acpcardlist {
  603. // margin-top: 140rpx;
  604. .acpcard {
  605. flex: 1;
  606. // width: 690rpx;
  607. // height: 333rpx;
  608. margin: 0 30rpx;
  609. // margin-top: 20rpx;
  610. background-color: #fff;
  611. border-radius: 20rpx;
  612. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  613. .allmsg {
  614. display: flex;
  615. padding: 40rpx 30rpx;
  616. box-sizing: border-box;
  617. width: 100%;
  618. .cicle {
  619. width: 28rpx;
  620. height: 28rpx;
  621. border-radius: 50%;
  622. background-color: #D8AB5A;
  623. margin-top: 8rpx;
  624. }
  625. .acpcont {
  626. margin-left: 20rpx;
  627. width: 100%;
  628. .acpname {
  629. box-sizing: border-box;
  630. display: flex;
  631. align-items: center;
  632. justify-content: space-between;
  633. padding-bottom: 30rpx;
  634. flex-grow: 1;
  635. width: 100%;
  636. // width: 572rpx;
  637. font-size: 36rpx;
  638. font-weight: 600;
  639. .tag {
  640. margin-left: 10rpx;
  641. font-weight: 500;
  642. border-radius: 10rpx;
  643. // font-size: 36rpx;
  644. color: #BEBDBB;
  645. text-align: center;
  646. }
  647. }
  648. }
  649. .acpinfo {
  650. border-top: 1rpx solid #E8E8E8;
  651. display: flex;
  652. flex: 1;
  653. flex-direction: column;
  654. font-size: 28rpx;
  655. color: #68625B;
  656. justify-content: space-between;
  657. box-sizing: border-box;
  658. .pt {
  659. padding-top: 20rpx;
  660. }
  661. }
  662. }
  663. }
  664. }
  665. .totalmanage {
  666. margin-top: 50rpx;
  667. margin-bottom: 100rpx;
  668. // position: fixed;
  669. bottom: 0;
  670. display: flex;
  671. justify-content: space-between;
  672. align-items: center;
  673. width: 100%;
  674. padding: 0 30rpx;
  675. box-sizing: border-box;
  676. .managebox {
  677. width: 23.8rpx;
  678. height: 29.7rpx;
  679. image {
  680. width: 100%;
  681. height: 100%;
  682. }
  683. }
  684. .maboxtitls {
  685. width: 160rpx;
  686. height: 60rpx;
  687. display: flex;
  688. align-items: center;
  689. justify-content: center;
  690. border-radius: 30rpx;
  691. background-color: #D9D9D9;
  692. // line-height: 60rpx;
  693. font-size: 28rpx;
  694. box-sizing: border-box;
  695. // align-items: center;
  696. }
  697. }
  698. .newbill {
  699. background-color: #fff;
  700. position: fixed;
  701. bottom: 0;
  702. padding-top: 10rpx;
  703. padding-bottom: 40rpx;
  704. width: 100%;
  705. .newbillbtn {
  706. background: linear-gradient(to right, #FFE1AD, #D8AB5A);
  707. width: 474rpx;
  708. height: 88rpx;
  709. border-radius: 43rpx;
  710. box-shadow: 0 10rpx 20rpx 1rpx rgba(179, 116, 5, 0.2);
  711. line-height: 88rpx;
  712. color: #fff;
  713. text-align: center;
  714. }
  715. }
  716. </style>