requisitiondetail.vue 6.7 KB

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