contractdetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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="请输入审核反馈" style="background-color: #F6F6F6;width: 640rpx;height: 200rpx;border-radius: 20rpx;padding: 20rpx;box-sizing: border-box;margin:20rpx 0;margin-bottom: 30rpx;" v-model="fankui"></textarea>
  47. </view>
  48. </view>
  49. <view class="tipup" >
  50. <text class="yu">反馈截图</text>
  51. <view class="upbox" style="margin-bottom: 30rpx;">
  52. <u-upload :fileList="fileList4" @afterRead="afterRead" @delete="deletePic" name="4" multiple
  53. :maxCount="6" ></u-upload>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="acpcardlist">
  60. <view class="lable " v-for="(item,index) in msg.contractDraft" :key="index">
  61. <view class="radiobox" v-if="editall">
  62. <radio :value="index" :checked="item.checked" color="#D8AB5A" @click="checkBox(item.id)"/>
  63. </view>
  64. <view class="acpcard" @click="billDetail(item.id,index)">
  65. <view class="allmsg">
  66. <view class="acpcont">
  67. <view class="acpname">
  68. <text style="flex: 1;">{{item.name}}</text>
  69. <view class="tag">{{item.statusText}}</view>
  70. </view>
  71. <view class="acpinfo ">
  72. <text class="pt">汇票号码:{{item.draftNo}}</text>
  73. <text class="pt">金额:¥ {{item.money}}</text>
  74. <text class="pt">服务费:¥ {{item.serviceMoney}}</text>
  75. <text class="pt">承兑人:{{item.acceptorName}}</text>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="totalmanage ">
  83. <text style="color:#68625B;font-size: 28rpx;">合计:4份</text>
  84. <view class=" maboxtitls" @click="editall=true">
  85. <view class="managebox">
  86. <image src="/static/img/manage.png" mode="aspectFit"></image>
  87. </view>
  88. <text style="padding-left: 15rpx;">管理</text>
  89. </view>
  90. </view>
  91. <view style="padding-bottom:150rpx;"></view>
  92. <view class="safebt"></view>
  93. <view class="newbill flex1" @click="addBill" v-if="state==1">
  94. <view class="newbillbtn">
  95. <text>新增汇票</text>
  96. </view>
  97. </view>
  98. <view class="newbill flex1" v-if="state==0&&msg.statusText=='待审核'">
  99. <view class="choosebtn">
  100. <view class="delbtn flex1">审核失败</view>
  101. <view class="succbtn flex1">审核成功</view>
  102. </view>
  103. </view>
  104. <!-- 底部删除 -->
  105. <u-popup :show="editall&&state==1" @close="closeEidt" @open="openEidt" :overlay="false">
  106. <view class="editbox">
  107. <view class="chooseall flex6">
  108. <view class="leftchoose ">
  109. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  110. <text>全选</text>
  111. </view>
  112. <view class="surebtn" @click="selectDown">
  113. 完成
  114. </view>
  115. </view>
  116. <view class="choosebtn">
  117. <view class="delbtn flex1">刪除</view>
  118. <view class="restorebtn flex1">复原</view>
  119. </view>
  120. </view>
  121. </u-popup>
  122. <!-- 底部删除 -->
  123. <u-popup :show="editall&&state==0" @close="closeEidt" @open="openEidt" :overlay="false">
  124. <view class="editbox">
  125. <view class="chooseall flex6">
  126. <view class="leftchoose ">
  127. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  128. <text>全选</text>
  129. </view>
  130. <view class="anniu">
  131. <text class="usa">删除</text>
  132. <text class="usa">复原</text>
  133. <text @click="selectDown" class="usa">完成</text>
  134. </view>
  135. </view>
  136. <view class="choosebtn">
  137. <view class="delbtn flex1">审核失败</view>
  138. <view class="restorebtn flex1">审核成功</view>
  139. </view>
  140. </view>
  141. </u-popup>
  142. </view>
  143. </template>
  144. <script>
  145. let that
  146. export default {
  147. data() {
  148. return {
  149. editall: false,
  150. quan: false,
  151. state: 0,
  152. fileList1: [],
  153. fileList2: [],
  154. fileList3:[],
  155. fileList4:[],
  156. msg:'',
  157. id:'',
  158. fankui:''
  159. }
  160. },
  161. onLoad(o) {
  162. that=this
  163. if(o.id){
  164. this.id=o.id
  165. }
  166. this.state = this.$store.state.admin
  167. this.init()
  168. },
  169. methods: {
  170. init(){
  171. uni.showLoading()
  172. uni.$u.http.get(`/api/Contract/${this.id}`,{
  173. custom: {
  174. auth: true
  175. }
  176. }).then((res) => {
  177. uni.hideLoading()
  178. this.msg=res
  179. this.msg.contractDraft.forEach(item=>{
  180. item.checked=false
  181. })
  182. const newData1 = res.picList.map((item)=>{
  183. return {
  184. url: item,
  185. }
  186. })
  187. this.fileList1=newData1
  188. const newData2 = res.invoicePicList.map((item)=>{
  189. return {
  190. url: item,
  191. }
  192. })
  193. this.fileList2=newData2
  194. const newData3 = res.tradePicList.map((item)=>{
  195. return {
  196. url: item,
  197. }
  198. })
  199. this.fileList3=newData3
  200. }).catch((err) => {
  201. uni.hideLoading()
  202. console.log(err)
  203. })
  204. },
  205. openEidt(){
  206. this.editall=true
  207. },
  208. checkBox(id){
  209. let list=this.msg.contractDraft
  210. list.forEach(item=>{
  211. if(item.id==id){
  212. item.checked=!item.checked
  213. }
  214. })
  215. this.msg.contractDraft = JSON.parse(JSON.stringify(list))
  216. },
  217. allSelect(){
  218. let list=this.msg.contractDraft
  219. if(this.quan){
  220. list.forEach(item => {
  221. item.checked =true
  222. })
  223. }else{
  224. list.forEach(item => {
  225. item.checked =false
  226. })
  227. }
  228. this.msg.contractDraft = JSON.parse(JSON.stringify(list))
  229. },
  230. acpDetail() {
  231. uni.navigateTo({
  232. url: "/pages/alldeatil/acptdetail"
  233. })
  234. },
  235. addBill(){
  236. uni.navigateTo({
  237. url: "/pages/alldeatil/addbill"
  238. })
  239. },
  240. billDetail(id,index){
  241. let obj={
  242. id:id,
  243. index:index
  244. }
  245. uni.navigateTo({
  246. url: "/pages/alldeatil/billdetail?obj="+JSON.stringify(obj)
  247. })
  248. },
  249. makeSureAll() {
  250. this.quan = true
  251. this.allSelect()
  252. },
  253. selectDown(){
  254. this.editall=false
  255. that.quan=true
  256. let list=this.msg.contractDraft
  257. list.forEach(item=>{
  258. item.checked=false
  259. })
  260. },
  261. // 删除图片
  262. deletePic(event) {
  263. this[`fileList${event.name}`].splice(event.index, 1)
  264. },
  265. // 新增图片
  266. async afterRead(event) {
  267. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  268. let lists = [].concat(event.file)
  269. let fileListLen = this[`fileList${event.name}`].length
  270. lists.map((item) => {
  271. this[`fileList${event.name}`].push({
  272. ...item,
  273. status: 'uploading',
  274. message: '上传中'
  275. })
  276. })
  277. for (let i = 0; i < lists.length; i++) {
  278. const result = await this.uploadFilePromise(lists[i].url)
  279. let item = this[`fileList${event.name}`][fileListLen]
  280. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  281. status: 'success',
  282. message: '',
  283. url: result
  284. }))
  285. fileListLen++
  286. }
  287. },
  288. uploadFilePromise(url) {
  289. return new Promise((resolve, reject) => {
  290. let a = uni.uploadFile({
  291. url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  292. filePath: url,
  293. name: 'file',
  294. formData: {
  295. user: 'test'
  296. },
  297. success: (res) => {
  298. setTimeout(() => {
  299. resolve(res.data.data)
  300. }, 1000)
  301. }
  302. });
  303. })
  304. },
  305. }
  306. }
  307. </script>
  308. <style lang="scss">
  309. page {
  310. background-color: #F6F6F6 !important;
  311. }
  312. .headboxcon {
  313. margin: 20rpx 30rpx;
  314. background-color: #fff;
  315. border-radius: 20rpx;
  316. padding: 0 30rpx;
  317. box-sizing: border-box;
  318. .tis {
  319. font-size: 36rpx;
  320. font-weight: 600;
  321. display: block;
  322. padding: 30rpx 0;
  323. padding-top: 50rpx;
  324. }
  325. .tipup{
  326. display: flex;
  327. }
  328. .upbox{
  329. margin-left: 30rpx;
  330. width: 490rpx;
  331. }
  332. .yu {
  333. display: block;
  334. width: 120rpx;
  335. color: #BEBDBB;
  336. }
  337. .tip {
  338. padding-bottom: 30rpx;
  339. font-size: 28rpx;
  340. display: flex;
  341. justify-content: space-between;
  342. .yuna {}
  343. }
  344. }
  345. .searchbox {
  346. padding-left: 30rpx;
  347. box-sizing: border-box;
  348. background-color: #ECECEC;
  349. border-radius: 38rpx;
  350. // width: 688rpx;
  351. flex: 1;
  352. height: 75rpx;
  353. margin: 0 auto;
  354. display: flex;
  355. align-items: center;
  356. justify-content: center;
  357. }
  358. .acpcardlist {
  359. // margin-top: 140rpx;
  360. .acpcard {
  361. flex: 1;
  362. // width: 690rpx;
  363. // height: 333rpx;
  364. margin: 0 30rpx;
  365. // margin-top: 20rpx;
  366. background-color: #fff;
  367. border-radius: 20rpx;
  368. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  369. .allmsg {
  370. display: flex;
  371. padding: 40rpx 30rpx;
  372. box-sizing: border-box;
  373. width: 100%;
  374. .cicle {
  375. width: 28rpx;
  376. height: 28rpx;
  377. border-radius: 50%;
  378. background-color: #D8AB5A;
  379. margin-top: 8rpx;
  380. }
  381. .acpcont {
  382. margin-left: 20rpx;
  383. width: 100%;
  384. .acpname {
  385. box-sizing: border-box;
  386. display: flex;
  387. align-items: center;
  388. justify-content: space-between;
  389. padding-bottom: 30rpx;
  390. flex-grow: 1;
  391. width: 100%;
  392. // width: 572rpx;
  393. font-size: 36rpx;
  394. font-weight: 600;
  395. .tag {
  396. margin-left: 10rpx;
  397. font-weight: 500;
  398. border-radius: 10rpx;
  399. // font-size: 36rpx;
  400. color: #BEBDBB;
  401. text-align: center;
  402. }
  403. }
  404. }
  405. .acpinfo {
  406. border-top: 1rpx solid #E8E8E8;
  407. display: flex;
  408. flex: 1;
  409. flex-direction: column;
  410. font-size: 28rpx;
  411. color: #68625B;
  412. justify-content: space-between;
  413. box-sizing: border-box;
  414. .pt {
  415. padding-top: 20rpx;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. .totalmanage {
  422. margin-top: 50rpx;
  423. margin-bottom: 100rpx;
  424. // position: fixed;
  425. bottom: 0;
  426. display: flex;
  427. justify-content: space-between;
  428. align-items: center;
  429. width: 100%;
  430. padding: 0 30rpx;
  431. box-sizing: border-box;
  432. .managebox {
  433. width: 23.8rpx;
  434. height: 29.7rpx;
  435. image {
  436. width: 100%;
  437. height: 100%;
  438. }
  439. }
  440. .maboxtitls {
  441. width: 160rpx;
  442. height: 60rpx;
  443. display: flex;
  444. align-items: center;
  445. justify-content: center;
  446. border-radius: 30rpx;
  447. background-color: #D9D9D9;
  448. // line-height: 60rpx;
  449. font-size: 28rpx;
  450. box-sizing: border-box;
  451. // align-items: center;
  452. }
  453. }
  454. .newbill {
  455. background-color: #fff;
  456. position: fixed;
  457. bottom: 0;
  458. padding-top: 10rpx;
  459. padding-bottom: 40rpx;
  460. width: 100%;
  461. .newbillbtn {
  462. background: linear-gradient(to right, #FFE1AD, #D8AB5A);
  463. width: 474rpx;
  464. height: 88rpx;
  465. border-radius: 43rpx;
  466. box-shadow: 0 10rpx 20rpx 1rpx rgba(179, 116, 5, 0.2);
  467. line-height: 88rpx;
  468. color: #fff;
  469. text-align: center;
  470. }
  471. }
  472. </style>