index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div>
  3. <van-nav-bar title="应急仓库" left-arrow placeholder @click-left="goback" :fixed="true" @click-right="bjclick">
  4. <template #right>
  5. </template>
  6. </van-nav-bar>
  7. <div v-if="!isempt">
  8. <div class="content">
  9. <div class="itemc" v-for="item in cklist" >
  10. <div class="itemcc">
  11. <div class="title" @click="gotockedit(item)">{{item.name}}
  12. <div class="btng">
  13. <!-- <div class="wbtn"></div> -->
  14. <div class="hbtn" @click.stop="gotowzedit(item)"></div>
  15. </div>
  16. </div>
  17. <div class="content">
  18. <div>
  19. <span class="left-title">管理单位:</span
  20. ><span class="left-content">{{item.manageUnit}}</span>
  21. </div>
  22. <div>
  23. <span class="left-title">联系人:</span
  24. ><span class="left-content">{{item.contactName}}</span>
  25. </div>
  26. <div>
  27. <span class="left-title">联系方式:</span
  28. ><span class="left-content">{{item.contactPhone}}</span>
  29. </div>
  30. <div>
  31. <span class="left-title">地址:</span
  32. ><span class="left-content"
  33. >{{item.address}}</span
  34. >
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div><van-empty v-if="isempt" description="无仓库" /></div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { ref, reactive, onUpdated, onMounted, watch } from 'vue';
  46. import { RouterView, useRoute, useRouter } from 'vue-router';
  47. import {
  48. api_getresource,
  49. api_getresourcedetail,
  50. api_putresource,
  51. api_bj,
  52. api_isbj,
  53. } from '@/service/warehouse';
  54. import { Toast, Notify, Dialog } from 'vant';
  55. import { BaseMediaUrl } from '@/utils';
  56. import { upload } from '@/api/common';
  57. import router from '@/router';
  58. const cklist = ref([])
  59. const gotockedit=(item)=>{
  60. localStorage.setItem("cck",JSON.stringify(item))
  61. localStorage.setItem("cedit",true)
  62. router.push("/warehouse/edit"+(taskid==""?"":`taskid=${taskid}`))
  63. }
  64. const gotowzedit=(item)=>{
  65. localStorage.setItem("cck",JSON.stringify(item))
  66. localStorage.setItem("cedit",true)
  67. router.push("/warehouse/detail"+(taskid==""?"":`taskid=${taskid}`))
  68. }
  69. const goback = () => {
  70. try {
  71. uni.navigateBack();
  72. } catch (E) {}
  73. //window.history.back();
  74. };
  75. let taskid = "";
  76. onMounted(()=>{
  77. try{
  78. taskid = route.query.taskid;
  79. }catch(E){
  80. }
  81. Toast.loading({
  82. message: '加载中...',
  83. duration: 0,
  84. forbidClick: true,
  85. });
  86. api_getresource({
  87. resourceType: 1,
  88. }).then(res=>{
  89. Toast.clear();
  90. // console.log(res);
  91. cklist.value = res.rows;
  92. })
  93. })
  94. </script>
  95. <style lang="scss">
  96. .content label,
  97. .content span {
  98. font-size: 15px;
  99. font-family: PingFangSC, PingFangSC-Regular;
  100. color: #333333;
  101. }
  102. .bjbtn {
  103. font-size: 14px;
  104. font-weight: 500;
  105. color: #ffffff;
  106. font-size: 13px;
  107. font-weight: 500;
  108. background: #bb0000;
  109. padding: 3px 8px;
  110. border-radius: 2px;
  111. }
  112. .content {
  113. .itemc {
  114. padding: 12px 15px;
  115. padding-bottom: 0;;
  116. .itemcc {
  117. background: #ffffff;
  118. border-radius: 2%;
  119. box-shadow: 0px 2px 6px 0px rg;
  120. .title {
  121. font-size: 16px;
  122. font-family: PingFangSC, PingFangSC-Medium;
  123. font-weight: 500;
  124. padding: 11px 15px;
  125. border-bottom: 1px solid #f0f2f5;
  126. position: relative;color:#0b33a8;
  127. .btng {
  128. position: absolute;
  129. right:15px;
  130. top:11px;
  131. .wbtn {
  132. background: url("../../assets/icons/incident/storehouse@2x.png");
  133. width: 24px;
  134. height: 24px;
  135. background-size: 100% 100%;
  136. display:inline-block;
  137. margin-right:16px;
  138. }
  139. .hbtn {
  140. background: url("../../assets/icons/incident/materials@2x.png");
  141. width: 24px;
  142. height: 24px;
  143. background-size: 100% 100%;
  144. display:inline-block;
  145. }
  146. }
  147. }
  148. .content {
  149. padding: 11px 15px;
  150. margin-bottom: 3px;
  151. font-size: 14px;
  152. word-wrap: break-word;
  153. .left-title {
  154. color: #999999;
  155. }
  156. .left-content {
  157. color: rgb(38, 38, 38);
  158. word-wrap: break-word;
  159. }
  160. }
  161. }
  162. }
  163. .cell-header {
  164. font-family: PingFangSC, PingFangSC-Regular;
  165. font-weight: 400;
  166. line-height: 42px;
  167. padding: 0px 15px;
  168. span {
  169. font-size: 12px;
  170. }
  171. div {
  172. font-size: 14px;
  173. color: #0b33a8;
  174. }
  175. }
  176. }
  177. </style>