index.vue 16 KB

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