requisitiondetail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view>
  3. <view style="margin:10px 10px;">
  4. <button type="default" style="border-radius: 5px;" class="mini-btn" size="mini" @click="modify">修改</button>
  5. </view>
  6. <view class="article-title">
  7. {{entity.requisitionName}}
  8. </view>
  9. <uni-list>
  10. <uni-list-item :title="'编号:' +entity.requisitionNumber">
  11. </uni-list-item>
  12. <uni-list-item :title="'状态:'+entity.state" />
  13. <uni-list-item :title="'申请日期:'+entity.requisitionDate" />
  14. <uni-list-item>
  15. <view slot="header" class="header-slot-box" style="width: 50%;">
  16. 经 办 人:{{entity.person}}
  17. </view>
  18. <view slot="footer" class="footer-slot-box" style="width: 50%;">
  19. 暂估金额:{{entity.totalEstimateCash}}
  20. </view>
  21. </uni-list-item>
  22. <uni-list-item>
  23. <view slot="body" class="body-slot-box" style="width: 100%;">
  24. 经办部门:{{unitCodeName}}
  25. </view>
  26. </uni-list-item>
  27. <uni-list-item direction="column">
  28. <view slot="header" class="slot-box">
  29. 原因:
  30. </view>
  31. <view slot="body" class="slot-box-main">
  32. {{entity.requisitionReason}}
  33. </view>
  34. </uni-list-item>
  35. <uni-list-item direction="column">
  36. <view slot="header" class="slot-box">
  37. 备注:
  38. </view>
  39. <view slot="body" class="slot-box-main">
  40. {{entity.remark}}
  41. </view>
  42. </uni-list-item>
  43. <uni-list-item direction="column">
  44. <view slot="header" class="slot-box" style="white-space: nowrap;">
  45. 附件:
  46. </view>
  47. <view slot="body" class="slot-box-main">
  48. <view v-for="(item,index) in attachments" :key="index">
  49. <!-- <image :src="'/api/common/ShowImg?code='+item.attachMentCode" style="width: 200px;"/> -->
  50. <a :href="'/api/common/ShowImg?code='+item.attachMentCode">{{item.fileName}}</a>
  51. </view>
  52. </view>
  53. </uni-list-item>
  54. </uni-list>
  55. <uni-section title="关联合同" type="line"></uni-section>
  56. <view class="uni-form-item uni-column">
  57. <uni-list>
  58. <uni-list-item v-for="(item,index) in list" :key="index" :title="item.contractID" :note="item.contractName" :rightText="item.estimateCash.toString()">
  59. </uni-list-item>
  60. </uni-list>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. GetRequistionDetail
  67. } from "@/common/api/requisitionApi.js";
  68. import {
  69. GetUserDepartment,
  70. showImage
  71. } from "@/common/api/commonApi.js";
  72. export default {
  73. data() {
  74. return {
  75. entity: {}, //申请单
  76. list: [], //关联合同
  77. attachments: [], //附件
  78. unitCodeName: ''
  79. }
  80. },
  81. onLoad(event) {
  82. if (this.$store == null || this.$store.state == null) {
  83. uni.navigateTo({
  84. url: '../../login/login'
  85. });
  86. return;
  87. }
  88. console.info("当前登录状态:" + this.$store.state.isLogin);
  89. //console.info(this);
  90. this.$util.persistLogin(this);
  91. },
  92. created: function() {
  93. let id = this.$util.getQuery('id');
  94. if (!id) {
  95. uni.navigateTo({
  96. url: '../requisitionlist/requisitionlist'
  97. })
  98. return;
  99. }
  100. this.getDetail(id);
  101. },
  102. computed:function(){
  103. },
  104. methods: {
  105. getDetail(reqisitionCode) {
  106. let that = this;
  107. GetRequistionDetail(reqisitionCode).then((res) => {
  108. console.info('GetRequistionDetail', res);
  109. that.entity = res.entity;
  110. if (that.entity.state == 0) {
  111. that.entity.state = '待审';
  112. } else if (that.entity.state == 1) {
  113. that.entity.state = '审核中';
  114. } else if (that.entity.state == 2) {
  115. that.entity.state = '已审';
  116. } else if (that.entity.state == 3) {
  117. that.entity.state = '作废';
  118. }
  119. that.entity.requisitionDate = that.entity.requisitionDate.substring(0, 10);
  120. that.GetDepartment(that.entity.unitCode);
  121. res.list.forEach(function(item, index, arr) {
  122. that.$set(that.list, index, item);
  123. });
  124. console.info('that.list', that.list);
  125. res.attachments.forEach(function(item, index, arr) {
  126. that.$set(that.attachments, index, item);
  127. })
  128. });
  129. },
  130. GetDepartment: function(unitcode) {
  131. let that = this;
  132. GetUserDepartment(unitcode).then((res) => {
  133. console.info(res);
  134. that.unitCodeName = res;
  135. });
  136. },
  137. showImage: function(code) {
  138. console.info('showimage', code);
  139. uni.navigateTo({
  140. url: '/api/common/ShowImg?code=' + code
  141. })
  142. },
  143. modify: function() { //跳转到修改页面
  144. let id = this.$util.getQuery("id");
  145. uni.navigateTo({
  146. url: '/pages/template/requisitionedit/requisitionedit?id=' + id
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style scoped>
  153. .article-meta {
  154. padding: 20rpx 20rpx;
  155. display: flex;
  156. flex-direction: row;
  157. justify-content: flex-start;
  158. }
  159. .article-title {
  160. margin: 20rpx auto;
  161. display: flex;
  162. justify-content: center;
  163. font-size: 18px;
  164. font-weight: 600;
  165. }
  166. .text {
  167. font-size: 13rpx;
  168. }
  169. .flex-item {
  170. width: 120px;
  171. height: 30px;
  172. margin: 10px;
  173. }
  174. .flex-item1 {
  175. width: 150px;
  176. height: 30px;
  177. margin: 10px;
  178. }
  179. .slot-box {
  180. width: 10%;
  181. margin: 5px 5px;
  182. font-size: 14px;
  183. }
  184. .slot-box-main {
  185. width: 90%;
  186. margin: 5px 5px;
  187. font-size: 14px;
  188. }
  189. .header-slot-box {
  190. font-size: 14px;
  191. margin: 5px 5px;
  192. width: 20%;
  193. justify-content: center;
  194. }
  195. .body-slot-box {
  196. font-size: 14px;
  197. margin: 5px 5px;
  198. width: 60%;
  199. border-left: 1px solid #000;
  200. border-right: 1px solid #000;
  201. justify-content: center;
  202. }
  203. .footer-slot-box {
  204. font-size: 14px;
  205. margin: 5px 5px;
  206. width: 20%;
  207. justify-content: center;
  208. }
  209. /deep/ .uni-list-item__extra-text{
  210. font-size:15px;
  211. color:#666666;
  212. }
  213. /deep/ .uni-list-item__content-note{
  214. font-size:15px;
  215. color:#666666;
  216. }
  217. </style>