get_request_funds.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view>
  3. <view class='wrap'>
  4. <view class="xinxi" v-if="detailData.expensesType == '2'" style="font-size: 28rpx; ">请款信息</view>
  5. <view class="xinxi" v-if="detailData.expensesType == '1'" style="font-size: 28rpx; ">收款信息</view>
  6. <view class="c-row">
  7. <view class="title">用途</view>
  8. <view class="con-list">
  9. <view>{{detailData.purpose}}</view>
  10. </view>
  11. </view>
  12. <view class="c-row" v-if="detailData.purpose == '库点费用'">
  13. <view class="title">仓库名称</view>
  14. <view class="con-list">
  15. <view>{{detailData.warehouseName}}</view>
  16. </view>
  17. </view>
  18. <view class="c-row" v-if="detailData.purpose == '合同费用'">
  19. <view class="title">合同编号</view>
  20. <view class="con-list">
  21. <view>{{detailData.contractNo}}</view>
  22. </view>
  23. </view>
  24. <view class="c-row">
  25. <view class="title">费用名称</view>
  26. <view class="con-list">
  27. <view>{{detailData.expenseName}}</view>
  28. </view>
  29. </view>
  30. <view class="c-row">
  31. <view class="title">金额(元)</view>
  32. <view class="con-list">
  33. <view>{{detailData.amountMoney}}</view>
  34. </view>
  35. </view>
  36. <view class="c-row">
  37. <view class="left">备注</view>
  38. </view>
  39. <view style='position:relative;' class="wrap no-boder">
  40. <u-input class='textarea' v-model="detailData.remark" :disabled="disabled" :type="type" :border="border"
  41. placeholder="选填,不超过150字" :height="height" :auto-height="autoHeight" maxlength="150" />
  42. <view style='position:absolute;right:10px;bottom:20px;color:#AFB3BF;'>
  43. {{detailData.remark?detailData.remark.length:"0"}}/150个字
  44. </view>
  45. </view>
  46. <view class="c-row">
  47. <view class="title">附件</view>
  48. </view>
  49. <view>
  50. <view v-if='imglist2.length>0'>
  51. <view style="margin-top: 20rpx;" v-for='item in imglist2'>
  52. <view class="img_item">
  53. <view class="" style="width: 16%;">
  54. <image
  55. v-if="item.type == 'pdf'"
  56. style="width: 40px; height: 40px;" src="../../static/img/oa_office/pdf3.png"
  57. mode=""></image>
  58. <image v-else-if="item.type == 'xls'||item.type == 'xlsx'"
  59. style="width: 40px; height: 40px;" src="../../static/img/oa_office/excle3.png"
  60. mode=""></image>
  61. <image v-else-if="item.type == 'doc'||item.type == 'docx'"
  62. style="width: 40px; height: 40px;" src="../../static/img/oa_office/word3.png"
  63. mode=""></image>
  64. <image v-else style="width: 40px; height: 40px;" :src="item.appendixPath" mode="">
  65. </image>
  66. </view>
  67. <view class="" style="width: 70%;">
  68. <view class="char_css">{{item.appendixName}}</view>
  69. <view class="">{{item.appendixSize}}</view>
  70. </view>
  71. <view class="img_dowload" @click="openDocument(item)">下载</view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. disabled: false,
  84. detailData: {
  85. purpose: '',
  86. remark: "",
  87. warehouseName: '',
  88. expenseName: '',
  89. amountMoney: '',
  90. contractNo: '',
  91. expensesPurpose: ''
  92. },
  93. type: 'textarea',
  94. border: true,
  95. imglist: [], //存
  96. imglist2: [], //展示
  97. height: 150,
  98. autoHeight: true,
  99. }
  100. },
  101. onLoad(options) {
  102. this.id = options.id
  103. if (this.id) {
  104. this.disabled = true
  105. } else {
  106. return
  107. }
  108. this.getList()
  109. },
  110. watch: {
  111. imglist: {
  112. handler: function() {
  113. this.$api.doRequest('get', 'appendix/query/getFileList', {
  114. appendixIds: this.imglist.toString()
  115. }).then(res => {
  116. this.imglist2 = res.data.data
  117. for (let i = 0; i < this.imglist2.length; i++) {
  118. if (this.imglist2[i].appendixName) {
  119. this.imglist2[i].type = this.imglist2[i].appendixName.split(".")[1]
  120. }
  121. }
  122. })
  123. },
  124. deep: true
  125. }
  126. },
  127. methods: {
  128. openDocument(src) {
  129. uni.downloadFile({
  130. url: src.appendixPath,
  131. success: function(res) {
  132. var filePath = res.tempFilePath;
  133. uni.openDocument({
  134. filePath: filePath,
  135. showMenu: true,
  136. success: function(res) {
  137. console.log('打开文档成功');
  138. }
  139. });
  140. }
  141. });
  142. },
  143. calculate() {
  144. const query = uni.createSelectorQuery().in(this);
  145. query.selectAll('.left')
  146. console.log(query)
  147. },
  148. //获取信息
  149. getList() {
  150. this.$api.doRequest('get', '/expenseInfo/ExpenseInfo', {
  151. id: this.id,
  152. }).then(res => {
  153. if (res.data.code == 200) {
  154. this.detailData = res.data.data
  155. this.imglist = this.detailData.addressUrl.split(',')
  156. }
  157. })
  158. },
  159. },
  160. }
  161. </script>
  162. <style lang='scss' scoped>
  163. page {
  164. background: #F5F6FA;
  165. }
  166. .delete_img {
  167. position: absolute;
  168. z-index: 9999;
  169. left: 84px;
  170. color: #ffffff;
  171. font-size: 28rpx;
  172. border: 1px;
  173. border-radius: 5rpx;
  174. width: 32rpx;
  175. height: 32rpx;
  176. background-color: #ff0000;
  177. text-align: center;
  178. }
  179. .title_b {
  180. margin: 20rpx 20rpx 0rpx 20rpx;
  181. padding: 20rpx 10rpx 20rpx 10rpx;
  182. font-size: 18px;
  183. font-weight: 550;
  184. }
  185. .xinxi {
  186. padding: 20rpx 30rpx;
  187. }
  188. .c-row {
  189. display: -webkit-box;
  190. display: -webkit-flex;
  191. display: flex;
  192. -webkit-box-align: center;
  193. -webkit-align-items: center;
  194. align-items: center;
  195. padding: 20rpx 30rpx;
  196. position: relative;
  197. }
  198. .con-list {
  199. -webkit-box-flex: 1;
  200. flex: 1;
  201. display: flex;
  202. -webkit-box-orient: vertical;
  203. -webkit-box-direction: normal;
  204. flex-direction: column;
  205. color: #303133;
  206. line-height: 20px;
  207. text-align: right;
  208. padding-right: 10px;
  209. justify-content: space-between;
  210. }
  211. .wrap {
  212. padding-bottom: 10px;
  213. font-size: 14px;
  214. background: #fff;
  215. margin: 10px;
  216. border-radius: 10px;
  217. input {
  218. font-size: 14px;
  219. }
  220. >.title {
  221. padding: 10px 16px;
  222. }
  223. }
  224. .buns_item {
  225. display: flex;
  226. padding: 80rpx 0 50rpx 0;
  227. justify-content: space-around;
  228. }
  229. .but_css {
  230. background: #22C572;
  231. width: 40%;
  232. padding: 20rpx;
  233. color: #fff;
  234. text-align: center;
  235. border-radius: 20rpx;
  236. }
  237. /deep/.u-radio-group {
  238. flex-direction: row-reverse;
  239. }
  240. .no-boder {
  241. border: 0;
  242. }
  243. .textarea {
  244. background: #F9F9FA;
  245. border: 1px solid #EEEEEE;
  246. }
  247. .submit {
  248. width: 100%;
  249. background: #2c8ac5;
  250. border-radius: 10rpx;
  251. }
  252. .bottom-btn {
  253. padding: 30rpx;
  254. background: #FFFFFF;
  255. width: 100%;
  256. position: fixed;
  257. bottom: 0rpx;
  258. display: flex;
  259. z-index: 9999;
  260. }
  261. .upload {
  262. width: 80rpx;
  263. height: 80rpx;
  264. }
  265. .char_css {
  266. font-size: 30rpx;
  267. font-weight: 600;
  268. display: -webkit-box;
  269. overflow: hidden;
  270. /*! autoprefixer: off; */
  271. -webkit-box-orient: vertical;
  272. -webkit-line-clamp: 1;
  273. -webkit-box-orient: vertical;
  274. text-overflow: ellipsis;
  275. word-break: break-all;
  276. }
  277. .img_item {
  278. display: flex;
  279. width: 100%;
  280. margin: 10px 0;
  281. padding: 0 10rpx;
  282. .img_dowload {
  283. width: 14%;
  284. color: #22C572;
  285. text-align: right;
  286. }
  287. }
  288. </style>