index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" @query="query" safe-area-inset-bottom>
  3. <template #top>
  4. <ut-navbar title="GAP基地信息" :fixed="false" border></ut-navbar>
  5. <view class="d-flex a-c pd-25">
  6. <view class="min-w-170 flex1">
  7. <ut-action-sheet v-model="form.type" :tabs="tabs" @change="onRefresh" title="选择基地类型">
  8. <view class="d-flex search-select-item a-c">
  9. <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }}</view>
  10. <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
  11. </view>
  12. </ut-action-sheet>
  13. </view>
  14. <view class="h-86 pl-20 w-100%">
  15. <ut-search ref="searchRef" v-model="form.keywords" @search="onRefresh" margin="0" :border="false" :placeholder="placeholder" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
  16. </view>
  17. </view>
  18. </template>
  19. <template>
  20. <template>
  21. <view class="pl-25 pr-25">
  22. <up-swipe-action>
  23. <up-swipe-action-item v-for="item in list" :name="item?.id" :key="item?.id" :options="optionsAction" @click="clickSwipe" class="mb-20 b-radius">
  24. <view class="b-radius bg-#fff pd-20 p-rtv">
  25. <view class="c-#333 f-s-34 f-w-5 pb-5">{{ item?.gapBaseName }}</view>
  26. <view class="c-#999 f-s-24 pb-20">{{ item?.ratedDate }}获评</view>
  27. <view class="d-flex pb-5">
  28. <view class="w-50%">
  29. <text class="c-#666 f-s-28">种养殖品种:</text>
  30. <text class="c-#333 f-s-28 f-w-5">{{ item?.medicineName }}</text>
  31. </view>
  32. <view class="w-50%">
  33. <text class="c-#666 f-s-28">基地面积:</text>
  34. <text class="c-#333 f-s-28 f-w-5">{{ item?.area }}</text>
  35. </view>
  36. </view>
  37. <view class="pb-20">
  38. <text class="c-#666 f-s-28">基地地址:</text>
  39. <text class="c-#333 f-s-28 f-w-5">{{ item?.address }}</text>
  40. </view>
  41. <view v-if="+item?.res == 2" class="pl-5 pr-5 pt-20 pb-20 border-top-#f7f7f7 c-#FC333F">
  42. <text class="f-s-28">审核不通过原因:</text>
  43. <text class="f-s-28">{{ item?.msg }}</text>
  44. </view>
  45. <image v-if="+item?.res == 2" class="w-145" src="/static/images/plant/resFailed.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  46. <image v-if="+item?.res == 0" class="w-100" src="/static/images/plant/resPendingReview.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  47. <image v-if="+item?.res == 1" class="w-90" src="/static/images/plant/resEffective.png" style="position: absolute; top: 0; right: 0" mode="widthFix" />
  48. </view>
  49. </up-swipe-action-item>
  50. </up-swipe-action>
  51. </view>
  52. </template>
  53. <!-- 空数据处理 -->
  54. <template #empty v-if="address">
  55. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">暂无获评GAP基地信息~</ut-empty>
  56. <view class="d-flex j-c f-s-28 c-#ccc">如需认定GAP基地,可前往数字云药官网进行申报</view>
  57. <view class="d-flex j-c f-s-28 c-primary pd-15">https://www.shuziyunyao.com/</view>
  58. <up-button type="primary" class="b-radius" style="width: 340rpx" @click="copyText('https://www.shuziyunyao.com/')">复制网址</up-button>
  59. </template>
  60. </template>
  61. <template #empty v-if="!address">
  62. <ut-empty class="mg-at" size="28rpx" color="#999" padding="10rpx" image="/static/images/plant/noEmptyBase.png">非云南省内企业,无法获取已获评的GAP基地信息~</ut-empty>
  63. <view class="d-flex j-c f-s-28 c-#ccc">可点击底部按钮上传佐证材料添加获评信息</view>
  64. </template>
  65. <template #bottom v-if="!address">
  66. <view class="base-bottom-wrap pd-20 pb-0">
  67. <up-button type="primary" @click="$u.route({ url: '/plant/base/gap-base-info-edit/index' })">
  68. <img class="w-38 h-36 mr-10" src="/static/images/plant/chooseGAP.png" alt="" mode="widthFix" />
  69. <text>添加GAP基地信息</text>
  70. </up-button>
  71. </view>
  72. </template>
  73. </z-paging>
  74. </template>
  75. <script setup lang="ts">
  76. import { copyText } from '@/utils/public';
  77. import { useClientRequest } from '@/utils/request';
  78. import { useInfoStore } from '@/store';
  79. interface ListItem {
  80. rows: MedicineBase[];
  81. code: number;
  82. msg: string;
  83. total: number;
  84. }
  85. interface MedicineBase {
  86. id: number;
  87. sourceType: string;
  88. gapBaseName: string;
  89. sn: string;
  90. medicineName: string;
  91. medicineId: number;
  92. area: number;
  93. basePic: string;
  94. lng: number;
  95. lat: number;
  96. adcode: string;
  97. address: string;
  98. ratedDate: string;
  99. certFile: Array<{
  100. fileName: string;
  101. url: string;
  102. fileSize: number;
  103. }>;
  104. res: string; // 0-待审核 1-通过 2-审核不通过
  105. auditor: number;
  106. msg: string;
  107. coordinates: Array<
  108. Array<{
  109. lng: number;
  110. lat: number;
  111. }>
  112. >;
  113. }
  114. const paging = ref();
  115. const list = ref<MedicineBase[]>([]);
  116. const placeholder = ref('搜基地名称、品种、基地地址');
  117. const tabs = ref([
  118. { label: '全部', value: '' },
  119. { label: '有效', value: '0' },
  120. { label: '审核不通过', value: '1' },
  121. { label: '待审核', value: '2' },
  122. ]);
  123. // 判断是否是云南的企业
  124. const isYunnanCompany = (): boolean => {
  125. const adcdCode = useInfoStore().companyInfo?.adcdCode;
  126. return adcdCode?.startsWith('53') || false;
  127. };
  128. const address = computed(() => isYunnanCompany());
  129. const form = ref({
  130. keywords: '',
  131. type: '',
  132. });
  133. const query = async (pageNum: number, pageSize: number) => {
  134. const params = {
  135. pageNum,
  136. pageSize,
  137. ...form.value,
  138. };
  139. // const res = await cpyList(params);
  140. ///app/gapCertificationInfo/pageList
  141. const res = await useClientRequest.get<ListItem>('/plt-api/app/gapCertificationInfo/pageList', params);
  142. const { rows } = res;
  143. paging.value.complete(rows);
  144. };
  145. const onRefresh = () => {
  146. paging.value.reload();
  147. };
  148. // 处理地块数据
  149. const showAction = ref(false);
  150. const optionsAction = reactive([
  151. {
  152. text: '删除',
  153. style: {
  154. backgroundColor: '#f56c6c',
  155. },
  156. },
  157. ]);
  158. const clickSwipe = (index: object) => {
  159. console.log(index);
  160. };
  161. </script>
  162. <style lang="scss" scoped>
  163. // @import '@/assets/styles/theme.scss';
  164. .search-select-item {
  165. height: 86rpx;
  166. background-color: #fff;
  167. border-radius: 10rpx;
  168. box-sizing: border-box;
  169. padding-left: 16rpx;
  170. padding-right: 16rpx;
  171. padding-top: 14rpx;
  172. padding-bottom: 14rpx;
  173. }
  174. .u-page {
  175. padding: 0;
  176. }
  177. .u-demo-block__title {
  178. padding: 10px 0 2px 15px;
  179. }
  180. .swipe-action {
  181. &__content {
  182. padding: 25rpx 0;
  183. &__text {
  184. font-size: 15px;
  185. color: $u-main-color;
  186. padding-left: 30rpx;
  187. }
  188. }
  189. }
  190. </style>