SupplierList.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view>
  3. <uni-list>
  4. <uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.id)" clickable>
  5. <view slot="body" class="slot-box">
  6. <view class="row">
  7. <view class="column-left">编号:</view>
  8. <view class="column-right section-title">{{item.id}}</view>
  9. </view>
  10. <view class="row">
  11. <view class="column-left">标题:</view>
  12. <view class="column-right">{{item.title}}</view>
  13. </view>
  14. <view class="row">
  15. <view class="column-left">原因:</view>
  16. <view class="column-right">{{item.reason}}</view>
  17. </view>
  18. <view class="row">
  19. <view class="column-left">项目:</view>
  20. <view class="column-right">{{item.projectName}}</view>
  21. </view>
  22. <view class="row" >
  23. <view class="column-left">申请日期:</view>
  24. <view class="column-right">{{item.createDateStr}}</view>
  25. </view>
  26. <view class="row">
  27. <view class="column-left">当前状态:</view>
  28. <view class="column-right">{{item.stateName}}</view>
  29. </view>
  30. </view>
  31. </uni-list-item>
  32. </uni-list>
  33. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;" v-show="isAdd">
  34. <router-link :to="'/pages/template/InsertzzSupplierEx/InsertzzSupplierEx'" style="text-decoration: none;" title="申请添加">
  35. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  36. </router-link>
  37. </view>
  38. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  39. </view>
  40. </template>
  41. <script>
  42. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  43. import {
  44. GetzzSupplierExList,GetzzSupplierExListByProject
  45. } from "@/common/api/requisitionApi.js";
  46. export default {
  47. components: {
  48. uniLoadMore
  49. },
  50. data() {
  51. return {
  52. listData: [],
  53. last_id: '',
  54. reload: false,
  55. status: 'more',
  56. adpid: '',
  57. type:0,
  58. isAdd:true,
  59. contentText: {
  60. contentdown: '上拉加载更多',
  61. contentrefresh: '加载中',
  62. contentnomore: '没有更多'
  63. }
  64. };
  65. },
  66. onLoad() {
  67. console.info("当前登录状态:" + this.$store.state.isLogin);
  68. //console.info(this);
  69. this.$util.persistLogin(this);
  70. this.adpid = this.$adpid;
  71. //this.getList();
  72. },
  73. onPullDownRefresh() {
  74. this.reload = true;
  75. this.last_id = '';
  76. this.getList();
  77. },
  78. onReachBottom() {
  79. this.status = 'more';
  80. this.getList();
  81. },
  82. created: function() {
  83. if(!this.$util.isEmpty(this.$util.getQuery("projectCode")))
  84. {
  85. uni.setNavigationBarTitle({
  86. title:"供应商申请"
  87. });
  88. }
  89. else{
  90. uni.setNavigationBarTitle({
  91. title:"我提交的信息"
  92. });
  93. }
  94. this.getList();
  95. //console.info("usercode",this.$store.state.user.userCode);
  96. console.info("aa");
  97. },
  98. methods: {
  99. getList() {
  100. let that = this;
  101. let supplierCode=this.$util.getState(this,'user').supplierCode;
  102. let projectCode=this.$util.getQuery("projectCode");
  103. console.info('projectCode',projectCode);
  104. if(!this.$util.isEmpty(projectCode))
  105. {
  106. this.isAdd=false;
  107. GetzzSupplierExListByProject(projectCode).then((res) => {
  108. console.info(res);
  109. if(typeof res=="string"){
  110. uni.showToast({
  111. title:res,
  112. duration:4000,
  113. icon:'none'
  114. });
  115. return;
  116. }
  117. res.forEach(function(item, index, array) {
  118. that.$set(that.listData, index, item);
  119. });
  120. console.info(that.listData);
  121. });
  122. }
  123. else{
  124. this.isAdd=true;
  125. //let type=this.$util.getQuery("type")-0;
  126. GetzzSupplierExList(supplierCode).then((res) => {
  127. console.info(res);
  128. if(res=="-1"){
  129. uni.showToast({
  130. title:'供应商编号不能为空',
  131. duration:4000,
  132. icon:'none'
  133. });
  134. return;
  135. }
  136. if(res=="-2"){
  137. uni.showToast({
  138. title:'执行过程中出现系统错误,执行中断',
  139. duration:4000,
  140. icon:'none'
  141. });
  142. return;
  143. }
  144. res.forEach(function(item, index, array) {
  145. that.$set(that.listData, index, item);
  146. });
  147. console.info(that.listData);
  148. });
  149. }
  150. },
  151. goDetail: function(id) {
  152. console.info('godetail',id);
  153. //console.info(id);
  154. uni.navigateTo({
  155. // requisitiondetail
  156. url: '../zzSupplierExDetail/zzSupplierExDetail?id=' + id
  157. });
  158. },
  159. }
  160. };
  161. </script>
  162. <style scoped lang="scss">
  163. .uni-list-item{
  164. border-bottom: $BgColorBlue;
  165. }
  166. </style>