requisitiondetail.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. let state=res.entity.state;
  114. that.entity = res.entity;
  115. that.procedureName=res.procedureName;
  116. if (that.entity.state == 0) {
  117. that.entity.state = '待审';
  118. that.isShow=true;
  119. } else if (that.entity.state == 1) {
  120. that.entity.state = '审核中';
  121. } else if (that.entity.state == 2) {
  122. that.entity.state = '已审';
  123. } else if (that.entity.state == 3) {
  124. that.entity.state = '作废';
  125. }
  126. if(that.entity.requisitionType==1){
  127. uni.setNavigationBarTitle({
  128. title:'变更申请单详情页'
  129. })
  130. }
  131. else{
  132. uni.setNavigationBarTitle({
  133. title:'签证单详情页'
  134. })
  135. }
  136. console.info('procedureName',that.procedureName);
  137. /* 是否显示流程审核按钮 */
  138. if(!that.$util.isEmpty(that.procedureName)){
  139. if(state==0){
  140. that.isWorkFlow=true;
  141. }
  142. else{
  143. that.isWorkFlow=false;
  144. }
  145. console.info('isWorkFlow',that.isWorkFlow);
  146. }
  147. that.entity.requisitionDate = that.entity.requisitionDate.substring(0, 10);
  148. that.GetDepartment(that.entity.unitCode);
  149. res.list.forEach(function(item, index, arr) {
  150. that.$set(that.list, index, item);
  151. });
  152. console.info('that.list', that.list);
  153. res.attachments.forEach(function(item, index, arr) {
  154. that.$set(that.attachments, index, item);
  155. });
  156. });
  157. },
  158. /* 显示部门 */
  159. GetDepartment: function(unitcode) {
  160. let that = this;
  161. GetUserDepartment(unitcode).then((res) => {
  162. console.info(res);
  163. that.unitCodeName = res;
  164. });
  165. },
  166. /* 流程审核按钮点击事件处理 */
  167. workFlow:function(){
  168. let url="../GetWorkFlowProcedureList/GetWorkFlowProcedureList?procedureName="+this.procedureName+"&applicationCode="+this.$util.getQuery("id");
  169. uni.navigateTo({ //跳转到流程控制列表页面
  170. url:url
  171. });
  172. },
  173. showImage: function(code) {
  174. console.info('showimage', code);
  175. uni.navigateTo({
  176. url: '/api/common/ShowImg?code=' + code
  177. })
  178. },
  179. modify: function() { //跳转到修改页面
  180. let id = this.$util.getQuery("id");
  181. uni.navigateTo({
  182. url: '/pages/template/requisitionedit/requisitionedit?id=' + id
  183. });
  184. }
  185. }
  186. }
  187. </script>
  188. <style scoped>
  189. .article-meta {
  190. padding: 20rpx 20rpx;
  191. display: flex;
  192. flex-direction: row;
  193. justify-content: flex-start;
  194. }
  195. .article-title {
  196. margin: 20rpx auto;
  197. display: flex;
  198. justify-content: center;
  199. font-size: 18px;
  200. font-weight: 600;
  201. }
  202. .text {
  203. font-size: 13rpx;
  204. }
  205. .flex-item {
  206. width: 120px;
  207. height: 30px;
  208. margin: 10px;
  209. }
  210. .flex-item1 {
  211. width: 150px;
  212. height: 30px;
  213. margin: 10px;
  214. }
  215. .slot-box {
  216. width: 10%;
  217. margin: 5px 5px;
  218. font-size: 14px;
  219. }
  220. .slot-box-main {
  221. width: 90%;
  222. margin: 5px 5px;
  223. font-size: 14px;
  224. }
  225. .header-slot-box {
  226. font-size: 14px;
  227. margin: 5px 5px;
  228. width: 20%;
  229. justify-content: center;
  230. }
  231. .body-slot-box {
  232. font-size: 14px;
  233. margin: 5px 5px;
  234. width: 60%;
  235. border-left: 1px solid #000;
  236. border-right: 1px solid #000;
  237. justify-content: center;
  238. }
  239. .footer-slot-box {
  240. font-size: 14px;
  241. margin: 5px 5px;
  242. width: 20%;
  243. justify-content: center;
  244. }
  245. /deep/ .uni-list-item__extra-text{
  246. font-size:15px;
  247. color:#666666;
  248. }
  249. /deep/ .uni-list-item__content-note{
  250. font-size:15px;
  251. color:#666666;
  252. }
  253. </style>