index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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="种养殖任务" :fixed="false">
  5. <template #left><view class=""></view></template>
  6. </ut-navbar>
  7. </template>
  8. <up-sticky :offset-top="0">
  9. <view class="d-flex a-c pd-26 pb-0 bg-#f7f7f7">
  10. <view class="min-w-170 flex1">
  11. <ut-action-sheet v-model="form.queryType" :tabs="[{ label: '全部', value: '' }]" @change="onRefresh" title="选择原料类型">
  12. <view class="d-flex search-select-item a-c">
  13. <view class="flex1 ov-hd f-s-28 c-333 text-center f-w-5 w-s-no">{{ '全部' }} </view>
  14. <up-icon size="24rpx" color="#333" name="arrow-down-fill" class="mr-5"></up-icon>
  15. </view>
  16. </ut-action-sheet>
  17. </view>
  18. <view class="h-86 pl-20 w-100%">
  19. <ut-search ref="searchRef" v-model="form.keyword" @search="changeSeach" margin="0" :border="false" placeholder="搜批次号、品种名、基地名" bgColor="#fff" height="86rpx" borderRadius="10rpx"></ut-search>
  20. </view>
  21. </view>
  22. <view class="pd-26 bg-#f7f7f7" :style="{ width: windowInfo ? windowInfo.screenWidth - 26 + 'px' : '100%' }">
  23. <up-subsection :list="subList" :current="subCurrent" @change="sectionChange" style="width: 100%; height: 100rpx; background-color: #fff" inactive-color="#999" active-color="#37A954" fontSize="36rpx" mode="subsection"></up-subsection>
  24. </view>
  25. </up-sticky>
  26. <!-- 养殖 -->
  27. <view class="pd-26 pt-0">
  28. <view class="b-radius bg-#fff pd-10">
  29. <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
  30. <view class="d-flex a-ed pd-16 pt-8 pb-8">
  31. <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
  32. <view class="c-#666 f-s-26">虫卵属蓝棵</view>
  33. </view>
  34. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  35. <view class="c-#666 w-s-no">养殖批号:</view>
  36. <view class="c-#333 f-w-5">1231231231232</view>
  37. </view>
  38. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  39. <view class="c-#666 w-s-no">种源批号:</view>
  40. <view class="c-#333 f-w-5">1231231231232</view>
  41. </view>
  42. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  43. <view class="c-#666 w-s-no">基地:</view>
  44. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
  45. <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
  46. </view>
  47. <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
  48. <view class="d-flex a-c w-50%">
  49. <view class="c-#666 w-s-no">养殖区域:</view>
  50. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
  51. </view>
  52. <view class="d-flex a-c w-50%">
  53. <view class="c-#666 w-s-no">养殖量:</view>
  54. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
  55. </view>
  56. </view>
  57. <view class="pd-16 pt-8 pb-8">
  58. <up-line color="#f7f7f7"></up-line>
  59. </view>
  60. <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
  61. <up-button :customStyle="customStyle1">种源信息</up-button>
  62. <up-button :customStyle="customStyle2">饲养管理</up-button>
  63. <up-button :customStyle="customStyle3">采收管理</up-button>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 种苗繁育 -->
  68. <view class="pd-26 pt-0">
  69. <view class="b-radius bg-#fff pd-10">
  70. <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
  71. <view class="d-flex a-ed pd-16 pt-8 pb-8">
  72. <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
  73. <view class="c-#666 f-s-26">虫卵属蓝棵</view>
  74. </view>
  75. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  76. <view class="c-#666 w-s-no">繁育批号:</view>
  77. <view class="c-#333 f-w-5">1231231231232</view>
  78. </view>
  79. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  80. <view class="c-#666 w-s-no">种源批号:</view>
  81. <view class="c-#333 f-w-5">1231231231232</view>
  82. </view>
  83. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  84. <view class="c-#666 w-s-no">基地:</view>
  85. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
  86. <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
  87. </view>
  88. <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
  89. <view class="d-flex a-c w-50%">
  90. <view class="c-#666 w-s-no">种植面积:</view>
  91. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
  92. </view>
  93. <view class="d-flex a-c w-50%">
  94. <view class="c-#666 w-s-no">繁育量:</view>
  95. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
  96. </view>
  97. </view>
  98. <view class="pd-16 pt-8 pb-8">
  99. <up-line color="#f7f7f7"></up-line>
  100. </view>
  101. <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
  102. <up-button :customStyle="customStyle1">种源信息</up-button>
  103. <up-button :customStyle="customStyle2">种植管理</up-button>
  104. <up-button :customStyle="customStyle3">采收管理</up-button>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 种植 -->
  109. <view class="pd-26 pt-0">
  110. <view class="b-radius bg-#fff pd-10">
  111. <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
  112. <view class="d-flex a-ed pd-16 pt-8 pb-8">
  113. <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
  114. <view class="c-#666 f-s-26">虫卵属蓝棵</view>
  115. </view>
  116. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  117. <view class="c-#666 w-s-no">种植批号:</view>
  118. <view class="c-#333 f-w-5">1231231231232</view>
  119. </view>
  120. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  121. <view class="c-#666 w-s-no">种源批号:</view>
  122. <view class="c-#333 f-w-5">1231231231232</view>
  123. </view>
  124. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  125. <view class="c-#666 w-s-no">基地:</view>
  126. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
  127. <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
  128. </view>
  129. <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
  130. <view class="d-flex a-c w-50%">
  131. <view class="c-#666 w-s-no">种植面积:</view>
  132. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
  133. </view>
  134. <view class="d-flex a-c w-50%">
  135. <view class="c-#666 w-s-no">种植量:</view>
  136. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
  137. </view>
  138. </view>
  139. <view class="pd-16 pt-8 pb-8">
  140. <up-line color="#f7f7f7"></up-line>
  141. </view>
  142. <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
  143. <up-button :customStyle="customStyle1">种源信息</up-button>
  144. <up-button :customStyle="customStyle2">种植管理</up-button>
  145. <up-button :customStyle="customStyle3">采收管理</up-button>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 种畜繁育 -->
  150. <view class="pd-26 pt-0">
  151. <view class="b-radius bg-#fff pd-10">
  152. <view class="d-flex j-ed f-s-22 c-#666"> 2025-12-25 </view>
  153. <view class="d-flex a-ed pd-16 pt-8 pb-8">
  154. <view class="c-#333 f-s-34 f-w-5 mr-6"> 美洲大蠊</view>
  155. <view class="c-#666 f-s-26">虫卵属蓝棵</view>
  156. </view>
  157. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  158. <view class="c-#666 w-s-no">繁育批号:</view>
  159. <view class="c-#333 f-w-5">1231231231232</view>
  160. </view>
  161. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  162. <view class="c-#666 w-s-no">种源批号:</view>
  163. <view class="c-#333 f-w-5">1231231231232</view>
  164. </view>
  165. <view class="d-flex a-c f-s-28 pd-16 pt-8 pb-8">
  166. <view class="c-#666 w-s-no">基地:</view>
  167. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">123112312312312312312312312312312312312312312323</view>
  168. <view class="flex1 d-flex j-ed"><up-icon name="arrow-right" size="34rpx"></up-icon></view>
  169. </view>
  170. <view class="d-flex f-s-28 pd-16 pt-8 pb-8">
  171. <view class="d-flex a-c w-50%">
  172. <view class="c-#666 w-s-no">养殖区域:</view>
  173. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">20亩</view>
  174. </view>
  175. <view class="d-flex a-c w-50%">
  176. <view class="c-#666 w-s-no">养殖量:</view>
  177. <view class="c-#333 f-w-5 tx-ov w-s-no ov-hd">120000</view>
  178. </view>
  179. </view>
  180. <view class="pd-16 pt-8 pb-8">
  181. <up-line color="#f7f7f7"></up-line>
  182. </view>
  183. <view class="pd-16 pt-8 pb-8 d-flex j-sb gap-20">
  184. <up-button :customStyle="customStyle1">种源信息</up-button>
  185. <up-button :customStyle="customStyle2">饲养管理</up-button>
  186. <up-button :customStyle="customStyle3">采收管理</up-button>
  187. </view>
  188. </view>
  189. </view>
  190. <up-button open-type="share" :customStyle="{ borderColor: 'rgba(0,0,0,0)', padding: '0 10rpx', height: '36rpx' }">
  191. <image class="small-icon mr-5" style="width: 28rpx" src="https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/share_icon.png" mode="widthFix" />
  192. <span class="f-s-24">分享</span>
  193. </up-button>
  194. <view class="h-210" v-if="list?.length"></view>
  195. <view v-if="list?.length" :style="{ height: `${safeAreaBottom}px` }"></view>
  196. <template #empty>
  197. <view class="d-flex flex-cln a-c" style="margin-top: -200rpx">
  198. <ut-empty class="mg-at" color="#ccc" size="28rpx" image="/static/images/plant/noEmptyBase.png">暂无进行中的养殖任务</ut-empty>
  199. <text class="c-#ccc f-s-28">点击下方按钮去添加吧~</text>
  200. </view>
  201. </template>
  202. <template #bottom>
  203. <ut-tabar activeTab="planting"></ut-tabar>
  204. </template>
  205. </z-paging>
  206. <ut-suspension v-if="sus?.left" :imageWidth="60" :imageHeight="60" :x="sus?.left" :y="sus?.bottom" :inertia="false" :snap-threshold="40">
  207. <image src="/static/images/plant/addBase.png" mode="widthFix" class="w-120 h-120" @click="showDeleteDialog = true"></image>
  208. </ut-suspension>
  209. <ut-confirm-dialog v-model:show="showDeleteDialog" width="80vw" title="请选择要创建的任务类型" :confirmText="'确认选择'" :cancelText="'取消'" @confirm="handlechoseConfirm" @cancel="handleDeleteCancel">
  210. <view class="" v-for="item in pt_task_type" :key="item?.value">
  211. <view style="border: 1rpx solid" :style="{ backgroundColor: item?.value == basetype ? '#EBF6EE' : '#f7f7f7', borderColor: item?.value == basetype ? '#37A954' : 'transparent' }" class="pr-30 d-flex a-c mb-20 radius-100" @click="handlechose(item.value)">
  212. <view class="radius-50% mg-8">
  213. <up-avatar size="90rpx" :src="item?.avatar || 'https://ta.zycpzs.cn/oss-file/smart-trace/szyy/images/common/avatar.png'" class="mr-20"></up-avatar>
  214. </view>
  215. <view class="c-#333 f-s-34">
  216. {{ item?.label }}
  217. </view>
  218. <view class="flex1"></view>
  219. <view class="d-flex">
  220. <img v-if="basetype === item.value" class="w-30 h-30" src="/static/images/plant/chooseSuccessfully.png" mode="widthFix" alt="" />
  221. </view>
  222. </view>
  223. </view>
  224. </ut-confirm-dialog>
  225. </template>
  226. <script setup lang="ts">
  227. import { useClientRequest } from '@/utils/request';
  228. import { onShareAppMessage } from '@dcloudio/uni-app';
  229. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  230. const { pt_task_type } = toRefs<any>(proxy?.useDict('pt_task_type'));
  231. setTimeout(() => {
  232. console.log(pt_task_type.value, 'pt_task_type');
  233. }, 2000);
  234. const list = ref<unknown[]>();
  235. const form = ref({ queryType: '', keyword: '' });
  236. const paging = ref();
  237. const windowInfo = uni.getWindowInfo();
  238. const safeAreaBottom = windowInfo.safeAreaInsets.bottom;
  239. const systemInfo = uni.getSystemInfoSync();
  240. const sus = ref({
  241. left: 0,
  242. bottom: 0,
  243. });
  244. sus.value.left = systemInfo.windowWidth - 10;
  245. sus.value.bottom = systemInfo.windowHeight - 200;
  246. //分段器的配置
  247. const subList = ref(['进行中', '已结束']);
  248. const subCurrent = ref(0);
  249. const sectionChange = (index: number) => {
  250. subCurrent.value = index;
  251. paging.value.reload();
  252. };
  253. const changeSeach = () => {
  254. paging.value.reload();
  255. };
  256. const query = async (pageNum: number, pageSize: number) => {
  257. const params = {
  258. pageNum,
  259. pageSize,
  260. ...form.value,
  261. };
  262. const res = await useClientRequest.get('/plt-api/app/base/pageList', params);
  263. if (res) {
  264. const { rows } = res;
  265. paging.value.complete(rows);
  266. }
  267. };
  268. //按钮样式
  269. const customStyle1 = reactive({
  270. color: '#37A954',
  271. boxShadow: 'inset 0 0 10px #D7F5DF',
  272. background: '#ECFFF1',
  273. border: '2rpx solid #9BD4A9',
  274. borderRadius: '10rpx',
  275. });
  276. const customStyle2 = reactive({
  277. color: '#18BECA',
  278. boxShadow: 'inset 0 0 10px #C7F5F8',
  279. background: '#E5FDFF',
  280. border: '2rpx solid #93E8EE',
  281. borderRadius: '10rpx',
  282. });
  283. const customStyle3 = reactive({
  284. color: '#FC8834',
  285. boxShadow: 'inset 0 0 10px #FFEED7',
  286. background: '#FFFAF3',
  287. border: '2rpx solid #FFD499',
  288. borderRadius: '10rpx',
  289. });
  290. const onRefresh = () => {
  291. paging.value.reload();
  292. };
  293. //选择创建类型
  294. const showDeleteDialog = ref(false);
  295. const basetype = ref();
  296. const handlechose = (item: string) => {
  297. basetype.value = item;
  298. };
  299. // 处理取消
  300. const handleDeleteCancel = () => {
  301. showDeleteDialog.value = false;
  302. basetype.value = null;
  303. };
  304. const handlechoseConfirm = () => {
  305. uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { baseType: basetype.value } });
  306. };
  307. </script>
  308. <style lang="scss" scoped>
  309. // @import '@/assets/styles/theme.scss';
  310. .search-select-item {
  311. height: 86rpx;
  312. background-color: #fff;
  313. border-radius: 10rpx;
  314. box-sizing: border-box;
  315. padding-left: 16rpx;
  316. padding-right: 16rpx;
  317. padding-top: 14rpx;
  318. padding-bottom: 14rpx;
  319. }
  320. :deep(.u-subsection__item) {
  321. border: 1px solid transparent !important;
  322. }
  323. </style>