index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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"></ut-navbar>
  5. </template>
  6. <view class="pt-26">
  7. <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
  8. <view class="startline-title pl-24 ml-26 mb-16">基地信息</view>
  9. <view class="bg-#fff pd-26">
  10. <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-26"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈 舍/组培架。</view>
  11. </view>
  12. <view class="bg-#fff pd-26 mb-20">
  13. <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="plantBase">
  14. <view class="w-100% d-flex a-c j-c pd-26 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
  15. <view class=""></view>
  16. <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
  17. </view>
  18. </up-form-item>
  19. </view>
  20. <view class="startline-title pl-24 ml-26 mb-16">种养殖信息</view>
  21. <view class="bg-#fff pd-26 mb-20">
  22. <ut-action-sheet v-model="form.queryType" :tabs="pt_task_type" title="选择任务类型">
  23. <up-form-item borderBottom label="任务类型" required prop="baseType">
  24. <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
  25. <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择任务类型</view>
  26. <template #right>
  27. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  28. </template>
  29. </up-form-item>
  30. </ut-action-sheet>
  31. <ut-action-sheet v-model="form.queryType1" :tabs="pt_org_type" title="选择溯源级别">
  32. <up-form-item borderBottom label="溯源级别" required prop="orgType">
  33. <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
  34. <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择溯源级别</view>
  35. <template #right>
  36. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  37. </template>
  38. </up-form-item>
  39. </ut-action-sheet>
  40. <up-form-item borderBottom label="符合要求" required prop="gapFlag">
  41. <view v-if="form.queryType2" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
  42. <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择符合要求</view>
  43. <template #right>
  44. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  45. </template>
  46. </up-form-item>
  47. <up-form-item borderBottom label="动物名称" required prop="plantBase">
  48. <view class="w-100% d-flex a-c j-c pd-26 b-radius bg-#FBFDFB border-#AFDDBB">
  49. <view class=""></view>
  50. <view class="f-s-34 c-primary">请选择养植的动物名称</view>
  51. </view>
  52. </up-form-item>
  53. <up-form-item borderBottom label="养殖批号" required prop="plantBase">
  54. <view class="d-flex a-c j-sb w-100%">
  55. <up-input v-model="form.queryType3" placeholder="请输入养殖批号" border="none"></up-input>
  56. <up-button class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
  57. </view>
  58. </up-form-item>
  59. <up-form-item label="请选择养殖技术规程文件" prop="environmentInfo.report" borderBottom>
  60. <ut-upload v-model="form.queryType4" :max-count="9" valueType="array" accept="file"></ut-upload>
  61. </up-form-item>
  62. <ut-action-sheet v-model="form.queryType5" :tabs="pt_task_type" title="选择任务类型">
  63. <up-form-item borderBottom label="任务类型" required prop="baseType">
  64. <view v-if="form.queryType1" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_org_type, form.queryType1) }}</view>
  65. <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择养殖方式</view>
  66. <template #right>
  67. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  68. </template>
  69. </up-form-item>
  70. </ut-action-sheet>
  71. <up-form-item borderBottom label="养殖时间" required prop="queryType6">
  72. <ut-datetime-picker v-model="form.queryType6.startDate" mode="date" dateFields="month">
  73. <view class="d-flex mr-20">
  74. <up-input v-model="form.queryType6.startDate" placeholder="请选择养殖开始时间" border="none"></up-input>
  75. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  76. </view>
  77. </ut-datetime-picker>
  78. <ut-datetime-picker v-model="form.queryType6.endDate" mode="date" dateFields="month">
  79. <view class="d-flex">
  80. <up-input v-model="form.queryType6.endDate" placeholder="请选择养殖结束时间" border="none"></up-input>
  81. <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
  82. </view>
  83. </ut-datetime-picker>
  84. </up-form-item>
  85. </view>
  86. </up-form>
  87. </view>
  88. </z-paging>
  89. <!-- 添加drawer组件 -->
  90. <Drawer v-if="drawerVisible" v-model="drawerVisible" @open="onDrawerOpen" @close="onDrawerClose" />
  91. </template>
  92. <script setup lang="ts">
  93. import { ref } from 'vue';
  94. import Drawer from './models/drawer.vue';
  95. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  96. const { pt_task_type, pt_org_type, yes_no } = toRefs<any>(proxy?.useDict('pt_task_type', 'pt_org_type', 'yes_no'));
  97. const form = ref({
  98. queryType: '',
  99. queryType1: '',
  100. queryType2: '',
  101. queryType3: '',
  102. queryType4: '',
  103. queryType5: '',
  104. queryType6: {
  105. startDate: '',
  106. endDate: '',
  107. },
  108. });
  109. const paging = ref<unknown>('paging');
  110. const list = ref<unknown>([]);
  111. // 控制抽屉显示状态
  112. const drawerVisible = ref(false);
  113. // 打开抽屉
  114. function openDrawer() {
  115. drawerVisible.value = true;
  116. }
  117. // 关闭抽屉
  118. function closeDrawer() {
  119. drawerVisible.value = false;
  120. }
  121. // 处理抽屉打开事件
  122. function onDrawerOpen() {
  123. console.log('抽屉打开了');
  124. }
  125. // 处理抽屉关闭事件
  126. function onDrawerClose() {
  127. console.log('抽屉关闭了');
  128. }
  129. onLoad((options) => {
  130. console.log(options);
  131. });
  132. </script>