| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275 |
- <template>
- <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" safe-area-inset-bottom>
- <template #top>
- <ut-navbar title="创建种养殖任务" :fixed="false"></ut-navbar>
- </template>
- <view class="pt-24">
- <!-- 养殖 -->
- <template v-if="form.taskType == 2">
- <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules" labelWidth="auto" ref="upFormRef">
- <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
- <view class="bg-#fff pd-24">
- <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/培养架。</view>
- </view>
- <view class="bg-#fff pd-24 mb-20 pt-0">
- <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId" id="baseIdpppp">
- <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
- </view>
- <view class="w-100%" v-else>
- <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
- </view>
- </up-form-item>
- </view>
- <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
- <up-form-item borderBottom label="任务类型" required prop="taskType" id="taskTypepppp">
- <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
- <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
- <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择溯源级别</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
- <up-form-item borderBottom label="符合要求" required prop="gapFlag" id="gapFlagpppp">
- <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(task_gap_flag, form.gapFlag) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择符合要求</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="动物名称" required prop="varietyId" id="varietyIdpppp">
- <view v-if="!Biological" @click="gotoTorganism(1)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择养植的动物名称</view>
- </view>
- <view v-if="Biological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="养殖批号" required prop="plantationCode" id="plantationCodepppp">
- <view class="d-flex a-c j-sb w-100%">
- <view v-if="!form.plantationCode" class="flex1 c-#999">请生成养殖批号</view>
- <view v-else class="flex1 c-#333">{{ form.plantationCode }}</view>
- <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
- </view>
- </up-form-item>
- <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
- <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
- </up-form-item>
- <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
- <up-form-item borderBottom label="养殖方式" required prop="plantationMethod" id="plantationMethodpppp">
- <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(feeding_method, form.plantationMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择养殖方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <view class="h-1" id="queryType6pppp"></view>
- <up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
- <view class="d-flex mr-20">
- <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="day">
- <view class="d-flex">
- <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- </up-form-item>
- <up-form-item borderBottom label="养殖面积" required prop="plantingAmount" id="plantingAmountpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入养殖面积" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">{{ form.plantingUnit }}</view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="养殖区域" required prop="breedScale" id="breedScalepppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input v-model="form.breedScale" placeholder="请输入养殖区域" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">个</view>
- </view>
- </up-form-item>
- <view class="h-1" id="plantpppp"></view>
- <up-form-item borderBottom label="养殖量" required prop="plant">
- <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入养殖量" border="none"></up-input>
- <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="planting_mg_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- </up-form-item>
- <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
- <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
- </up-form-item>
- </view>
- </up-form>
- </template>
- <!-- 种畜繁育 -->
- <template v-if="form.taskType == 21">
- <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules1" labelWidth="auto" ref="upFormRef">
- <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
- <view class="bg-#fff pd-24">
- <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/培养架。</view>
- </view>
- <view class="bg-#fff pd-24 mb-20 pt-0">
- <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId" id="baseIdpppp">
- <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
- </view>
- <view class="w-100%" v-else>
- <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
- </view>
- </up-form-item>
- </view>
- <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
- <up-form-item borderBottom label="任务类型" required prop="taskType" id="taskTypepppp">
- <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="是否代繁育" required prop="delegateFlag" id="delegateFlagFlagpppp">
- <up-radio-group v-model="form.delegateFlag">
- <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
- </up-radio-group>
- </up-form-item>
- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
- <view v-if="!Enterprise" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择委托企业</view>
- </view>
- <view v-if="Enterprise" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Enterprise = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
- </view>
- </view>
- </up-form-item>
- <ut-action-sheet v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
- <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
- <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择溯源级别</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="动物名称" required prop="varietyId" id="varietyIdpppp">
- <view v-if="!Biological" @click="gotoTorganism(1)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择养植的动物名称</view>
- </view>
- <view v-if="Biological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="养殖批号" required prop="plantationCode" id="plantationCodepppp">
- <view class="d-flex a-c j-sb w-100%">
- <view v-if="!form.plantationCode" class="flex1 c-#999">请生成养殖批号</view>
- <view v-else class="flex1 c-#333">{{ form.plantationCode }}</view>
- <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
- </view>
- </up-form-item>
- <up-form-item label="请选择养殖技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
- <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
- </up-form-item>
- <ut-action-sheet v-model="form.plantationMethod" :tabs="feeding_method" title="选择养殖方式">
- <up-form-item borderBottom label="养殖方式" prop="plantationMethod" id="plantationMethodpppp">
- <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(feeding_method, form.plantationMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择养殖方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <view class="h-1" id="queryType6pppp"></view>
- <up-form-item :borderBottom="false" label="养殖时间" required prop="queryType6">
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
- <view class="d-flex mr-20">
- <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择养殖开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="day">
- <view class="d-flex">
- <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择养殖结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- </up-form-item>
- <up-form-item borderBottom label="养殖面积" required prop="plantingAmount" id="plantingAmountpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入养殖面积" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">{{ form.plantingUnit }}</view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="养殖区域" required prop="breedScale" id="breedScalepppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input v-model="form.breedScale" placeholder="请输入养殖区域" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">个</view>
- </view>
- </up-form-item>
- <view class="h-1" id="plantpppp"></view>
- <up-form-item borderBottom label="养殖量" required prop="plant">
- <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入养殖量" border="none"></up-input>
- <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="planting_mg_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(planting_mg_unit, form.plant?.plantingMgUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- </up-form-item>
- <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
- <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
- </up-form-item>
- </view>
- </up-form>
- </template>
- <!-- 种植 -->
- <template v-if="form.taskType == 1">
- <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules2" labelWidth="auto" ref="upFormRef">
- <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
- <view class="bg-#fff pd-24">
- <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/培养架。</view>
- </view>
- <view class="bg-#fff pd-24 mb-20 pt-0">
- <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId" id="baseIdpppp">
- <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
- </view>
- <view class="w-100%" v-else>
- <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
- </view>
- </up-form-item>
- </view>
- <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
- <up-form-item borderBottom label="任务类型" required prop="taskType" id="taskTypepppp">
- <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-model="form.gapFlag" :tabs="task_gap_flag" title="选择符合要求">
- <up-form-item borderBottom label="符合要求" required prop="gapFlag" id="gapFlagpppp">
- <view v-if="form.gapFlag" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(task_gap_flag, form.gapFlag) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择符合要求</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="植物名称" required prop="varietyId" id="varietyIdpppp">
- <view v-if="!Biological" @click="gotoTorganism(1)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种植的植物名称</view>
- </view>
- <view v-if="Biological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="种植批号" required prop="plantationCode" id="plantationCodepppp">
- <view class="d-flex a-c j-sb w-100%">
- <view v-if="!form.plantationCode" class="flex1 c-#999">请生成种植批号</view>
- <view v-else class="flex1 c-#333">{{ form.plantationCode }}</view>
- <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
- </view>
- </up-form-item>
- <up-form-item label="请选择种植技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
- <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
- </up-form-item>
- <ut-action-sheet v-model="form.plantationMethod" :tabs="plantation_method" title="选择种植方式">
- <up-form-item borderBottom label="种植方式" prop="plantationMethod" id="plantationMethodpppp">
- <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_method, form.plantationMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择种植方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="种植面积" required prop="plantingAmount" id="plantingAmountpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入种植面积" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">亩</view>
- </view>
- </up-form-item>
- <view class="h-1" id="plantpppp"></view>
- <up-form-item borderBottom label="种植量" required prop="plant">
- <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入种植量" border="none"></up-input>
- <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="scale_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(scale_unit, form.plant?.plantingMgUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- </up-form-item>
- <view class="h-1" id="queryType6pppp"></view>
- <up-form-item :borderBottom="false" label="种植时间" required prop="queryType6">
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
- <view class="d-flex mr-20">
- <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择种植开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="day">
- <view class="d-flex">
- <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择种植结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- </up-form-item>
- <ut-action-sheet v-model="form.reproductionType" :tabs="reproduction_type" title="选择繁殖方式">
- <up-form-item borderBottom label="繁殖方式" required prop="reproductionType" id="reproductionTypepppp">
- <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(reproduction_type, form.reproductionType) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择繁殖方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="plantation_type" title="选择种植类型">
- <up-form-item borderBottom label="种植类型" prop="plantationType" id="plantationTypepppp">
- <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_type, form.plantationType) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择种植类型</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="sowing_method" title="选择播种方法">
- <up-form-item borderBottom label="播种方法" prop="sowingMethod" id="sowingMethodpppp">
- <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(sowing_method, form.sowingMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择播种方法</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="transplant_method" title="选择移栽方法">
- <up-form-item borderBottom label="移栽方法" prop="transplantMethod" id="transplantMethodpppp">
- <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(transplant_method, form.transplantMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择移栽方法</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="前茬植物" prop="preCropId" id="preCropIddpppp">
- <view v-if="!PreBiological" @click="gotoTorganism(2)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择前茬植物名称</view>
- </view>
- <view v-if="PreBiological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="PreBiological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ PreBiological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ PreBiological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
- <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
- </up-form-item>
- </view>
- </up-form>
- </template>
- <!-- 种苗繁育 -->
- <template v-if="form.taskType == 11">
- <up-form class="p-rtv" labelPosition="top" :model="form" :rules="rules3" labelWidth="auto" ref="upFormRef">
- <view class="startline-title pl-24 ml-24 mb-16">基地信息</view>
- <view class="bg-#fff pd-24">
- <view class="b-radius bg-#EBF6EE c-primary f-s-24 pd-24 pb-16"> 注意:关联时请确保已添加到地块;关联时必须选到地块/圈舍/培养架。</view>
- </view>
- <view class="bg-#fff pd-24 mb-20 pt-0">
- <up-form-item :borderBottom="false" label="种养殖所在基地" required prop="baseId" id="baseIdpppp">
- <view v-if="!deawerData" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB" @click="openDrawer">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种养殖所在的基地</view>
- </view>
- <view class="w-100%" v-else>
- <Baseinfo :modeValue="deawerData" @close="handleBaseinfoClose" :baseType="form.taskType" />
- </view>
- </up-form-item>
- </view>
- <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <ut-action-sheet v-model="form.taskType" :tabs="pt_task_type" title="选择任务类型">
- <up-form-item borderBottom label="任务类型" required prop="taskType" id="taskTypepppp">
- <view class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(pt_task_type, form.taskType) }}</view>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="是否代繁育" required prop="delegateFlag" id="delegateFlagFlagpppp">
- <up-radio-group v-model="form.delegateFlag">
- <up-radio :customStyle="{ marginRight: '60rpx' }" v-for="(item, index) in yes_no" :key="index" :label="item.label" :name="item.value"></up-radio>
- </up-radio-group>
- </up-form-item>
- <up-form-item borderBottom label="委托企业" required prop="delegateInfo" id="delegateInfopppp">
- <view v-if="!Enterprise" @click="$u.route({ type: 'navigateTo', url: '/plant/port/por-torganism/index' })" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择委托企业</view>
- </view>
- <view v-if="Enterprise" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Enterprise = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#666 f-s-24">{{ form?.delegateInfo?.crediteCode }}</text>
- </view>
- </view>
- </up-form-item>
- <ut-action-sheet v-if="+deawerData?.data[0]?.landType == 3" v-model="form.mgMethod" :tabs="mg_method" title="选择溯源级别">
- <up-form-item borderBottom label="溯源级别" required prop="mgMethod" id="mgMethodpppp">
- <view v-if="form.mgMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(mg_method, form.mgMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择溯源级别</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="植物名称" required prop="varietyId" id="varietyIdpppp">
- <view v-if="!Biological" @click="gotoTorganism(1)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择种植的植物名称</view>
- </view>
- <view v-if="Biological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="繁育批号" required prop="plantationCode" id="plantationCodepppp">
- <view class="d-flex a-c j-sb w-100%">
- <view v-if="!form.plantationCode" class="flex1 c-#999">请生成繁育批号</view>
- <view v-else class="flex1 c-#333">{{ form.plantationCode }}</view>
- <up-button @click="randomCode" class="c-#fff" type="primary" style="height: 50rpx; width: 130rpx">随机生成</up-button>
- </view>
- </up-form-item>
- <up-form-item label="请选择繁育技术规程文件" prop="technicalFile" borderBottom id="technicalFilepppp">
- <ut-upload v-model="form.technicalFile" :max-count="9" valueType="array" accept="file"></ut-upload>
- </up-form-item>
- <ut-action-sheet v-model="form.plantationMethod" :tabs="plantation_method" title="选择繁育方式">
- <up-form-item borderBottom label="繁育方式" prop="plantationMethod" id="plantationMethodpppp">
- <view v-if="form.plantationMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_method, form.plantationMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择繁育方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <view class="h-1" id="queryType6pppp"></view>
- <up-form-item :borderBottom="false" label="繁育日期" required prop="queryType6">
- <ut-datetime-picker v-model="form.queryType6.plannedStartDate" mode="date" dateFields="day">
- <view class="d-flex mr-20">
- <up-input v-model="form.queryType6.plannedStartDate" placeholder="请选择种植开始时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- <ut-datetime-picker v-model="form.queryType6.plannedEndDate" mode="date" dateFields="day">
- <view class="d-flex">
- <up-input v-model="form.queryType6.plannedEndDate" placeholder="请选择种植结束时间" border="bottom" :customStyle="{ paddingLeft: '0rpx' }"></up-input>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill" style="margin-left: -20rpx"></up-icon>
- </view>
- </ut-datetime-picker>
- </up-form-item>
- <up-form-item v-if="+deawerData?.data[0]?.landType == 1" borderBottom label="种植面积" required prop="plantingAmount" id="plantingAmountpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.plantingAmount" placeholder="请输入种植面积" border="none"></up-input>
- <view class="c-#333 f-s-32 f-w-5">{{ form.plantingUnit }}</view>
- </view>
- </up-form-item>
- <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种数量" required prop="inoculation.inoculationAmount" id="inoculationpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.inoculation.inoculationAmount" placeholder="请输入接种数量" border="none"></up-input>
- <ut-action-sheet v-model="form.inoculation.inoculationUnit" :tabs="inoculation_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- </view>
- </up-form-item>
- <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="接种剂量" required prop="inoculation.inoculationDosage" id="inoculationpppp">
- <view class="d-flex a-c j-sb w-100%">
- <up-input style="padding-left: 0" v-model="form.inoculation.inoculationDosage" placeholder="请输入接种剂量" border="none"></up-input>
- <ut-action-sheet v-model="form.inoculation.inoculationDosageUnit" :tabs="inoculation_dosage_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.inoculation?.inoculationDosageUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_dosage_unit, form.inoculation?.inoculationDosageUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- <view v-if="form.inoculation?.inoculationUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_unit, form.inoculation?.inoculationUnit) }}</view>
- </view>
- </up-form-item>
- <view class="h-1" id="plantpppp"></view>
- <up-form-item v-if="+deawerData?.data[0]?.landType == 3" borderBottom label="繁育量" prop="plant">
- <view class="d-flex a-c j-sb w-100%">
- <view class="f-s-30 c-333 f-w-5 w-100">{{ plantingMgAmount }}</view>
- <view v-if="plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(inoculation_dosage_unit, plantingMgUnit) }}</view>
- </view>
- </up-form-item>
- <up-form-item v-else borderBottom label="繁育量" required prop="plant">
- <up-input v-model="form.plant.plantingMgAmount" placeholder="请输入繁育量" border="none"></up-input>
- <ut-action-sheet v-model="form.plant.plantingMgUnit" :tabs="feed_amount_unit" title="选择单位">
- <view class="d-flex a-c">
- <view v-if="form.plant?.plantingMgUnit" class="f-s-30 c-333 f-w-5 w-100">{{ selectDictLabel(feed_amount_unit, form.plant?.plantingMgUnit) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 w-100">单位</view>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </view>
- </ut-action-sheet>
- </up-form-item>
- <up-form-item borderBottom label="培养基配方" prop="cultureMediumFormula" id="cultureMediumFormulapppp">
- <view v-if="!Biological" @click="gotoTorganism(1)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择培养基配方</view>
- </view>
- <view v-if="Biological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="Biological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ Biological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ Biological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ Biological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ Biological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <ut-action-sheet v-model="form.reproductionType" :tabs="reproduction_type" title="选择繁殖方式">
- <up-form-item borderBottom label="选择繁殖方式" required prop="reproductionType" id="reproductionTypepppp">
- <view v-if="form.reproductionType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(reproduction_type, form.reproductionType) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择选择繁殖方式</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.plantationType" :tabs="plantation_type" title="选择种植类型">
- <up-form-item borderBottom label="种植类型" required prop="plantationType" id="plantationTypepppp">
- <view v-if="form.plantationType" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(plantation_type, form.plantationType) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择种植类型</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.sowingMethod" :tabs="sowing_method" title="选择播种方法">
- <up-form-item borderBottom label="播种方法" required prop="sowingMethod" id="sowingMethodpppp">
- <view v-if="form.sowingMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(sowing_method, form.sowingMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择播种方法</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <ut-action-sheet v-if="+form.reproductionType == 2" v-model="form.transplantMethod" :tabs="transplant_method" title="选择移栽方法">
- <up-form-item borderBottom label="移栽方法" required prop="transplantMethod" id="transplantMethodpppp">
- <view v-if="form.transplantMethod" class="f-s-30 c-333 f-w-5 flex1">{{ selectDictLabel(transplant_method, form.transplantMethod) }}</view>
- <view v-else class="f-s-30 c-ccc f-w-4 flex1">请选择移栽方法</view>
- <template #right>
- <up-icon size="22rpx" color="#2A6D52" name="arrow-down-fill"></up-icon>
- </template>
- </up-form-item>
- </ut-action-sheet>
- <up-form-item borderBottom label="前茬植物" prop="preCropId" id="preCropIddpppp">
- <view v-if="!PreBiological" @click="gotoTorganism(2)" class="w-100% d-flex a-c j-c pd-24 b-radius bg-#FBFDFB border-#AFDDBB">
- <view class=""></view>
- <view class="f-s-34 c-primary">请选择前茬植物名称</view>
- </view>
- <view v-if="PreBiological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20 w-100% p-rtv">
- <up-icon @click="PreBiological = null" size="26rpx" color="red" name="close" style="position: absolute; right: 10rpx; top: 10rpx"></up-icon>
- <view class="mb-20">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ PreBiological?.varietyName }}</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.latinName }}</text>
- </view>
- <view class="mb-20">
- <text class="c-#333 f-s-28 f-w-5 mr-5">{{ PreBiological?.genusName }}</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.genusLatinName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">产出:</text>
- <text class="c-#666 f-s-24">{{ PreBiological?.medicineName }}</text>
- </view>
- </view>
- </up-form-item>
- <up-form-item borderBottom label="备注" required prop="remark" id="remarkpppp">
- <up-input v-model="form.remark" placeholder="请输入备注" border="none"></up-input>
- </up-form-item>
- </view>
- </up-form>
- </template>
- <view v-if="+form.mgMethod == 2" class="">
- <view class="startline-title pl-24 ml-24 mb-16">个体标识信息</view>
- <view class="bg-#fff pd-24">
- <view class="d-flex pt-20 pb-20">
- <view class="">个体标识({{ animalIds.length }}个)</view>
- <view class="flex1"></view>
- <view class="border-#79C58C radius-100 c-primary f-s-24 pd4-10-20-10-20 d-flex a-c j-c">扫一扫添加</view>
- </view>
- <view class="d-flex gap-20 mb-20">
- <view @click="showDeleteDialog = true" class="b-radius border-#AFDDBB bg-#FBFDFB c-primary w-100% d-flex j-c a-c h-100 f-s-34">手动输入添加</view>
- <view class="b-radius border-#A3E5EA c-#18BECA bg-#FAFFFF w-100% d-flex j-c a-c h-100 f-s-34">从种源库快速添加</view>
- </view>
- <up-swipe-action>
- <up-swipe-action-item class="mb-20" v-for="(item, index) in animalIds" :key="index" :index="item" :name="item" :options="options1" @click="clickSwipe">
- <view class="b-radius border-#37A954 c-#333 f-s-28 pd4-34-30-34-30">{{ item }}</view>
- </up-swipe-action-item>
- </up-swipe-action>
- </view>
- </view>
- </view>
- <template #bottom>
- <view class="pd-24 d-flex j-c gap-20 base-bottom-wrap">
- <up-button type="primary" @click="saveDraft()">暂存</up-button>
- <up-button type="primary" @click="save()">提交</up-button>
- </view>
- </template>
- </z-paging>
- <ut-confirm-dialog v-model:show="showDeleteDialog" width="75vw" title="添加个体标识" :confirmText="'确认'" :cancelText="'取消'" @confirm="handleDeleteConfirm" @cancel="handleDeleteCancel">
- <view class="">
- <view class="c-#333 f-s-28">个体标识号</view>
- <view class="">
- <up-input placeholder="请输入个体标识号" v-model="animalId" border="bottom"></up-input>
- </view>
- </view>
- </ut-confirm-dialog>
- <ut-confirm-dialog v-model:show="showChangeDialog" width="75vw" title="修改个体标识" :confirmText="'确认'" :cancelText="'取消'" @confirm="handleChangeConfirm" @cancel="handleChangeCancel">
- <view class="">
- <view class="c-#333 f-s-28">个体标识号</view>
- <view class="">
- <up-input placeholder="请输入个体标识号" v-model="animalId" border="bottom"></up-input>
- </view>
- </view>
- </ut-confirm-dialog>
- <!-- 添加drawer组件 -->
- <Drawer v-if="drawerVisible" :baseType="form.taskType" v-model="drawerVisible" @open="onDrawerOpen" @close="onDrawerClose" @confirm="onDrawerConfirm" />
- </template>
- <script setup lang="ts">
- import { ref } from 'vue';
- import Drawer from './models/drawer.vue';
- import Baseinfo from './models/baseinfo.vue';
- import { useClientRequest } from '@/utils/request';
- import type { TaskType, YesNoType, TimeRange, PlantInfo, DelegateInfo, InoculationInfo, LandInfo, BaseSelectData, PlantationTaskForm, FormRuleItem, FormRules } from './models/types';
- const { proxy } = getCurrentInstance() as ComponentInternalInstance;
- const { feed_amount_unit, planting_mg_unit, inoculation_unit, inoculation_dosage_unit, transplant_method, plantation_type, sowing_method, area_unit, plantation_method, reproduction_type, scale_unit, feeding_method, mg_method, task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
- proxy?.useDict('feed_amount_unit', 'planting_mg_unit', 'inoculation_unit', 'inoculation_dosage_unit', 'transplant_method', 'plantation_type', 'sowing_method', 'area_unit', 'plantation_method', 'reproduction_type', 'scale_unit', 'feeding_method', 'mg_method', 'task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no')
- );
- const form = ref<PlantationTaskForm>({
- deawerData: null,
- baseId: null,
- landIds: [],
- taskType: null,
- gapFlag: null,
- mgMethod: null,
- varietyId: null,
- plantationCode: null,
- plantationMethod: null,
- reproductionType: null,
- technicalFile: [],
- plantingUnit: null,
- breedScale: null,
- queryType6: {
- plannedStartDate: null,
- plannedEndDate: null,
- },
- plant: {
- plantingMgAmount: null,
- plantingMgUnit: null,
- },
- plantingAmount: '',
- remark: null,
- delegateFlag: '0',
- delegateInfo: { cusId: '1795009980763025410', crediteCode: '91530102MACA96MJ9H', cusName: '演示企业' },
- plantationType: null,
- sowingMethod: null,
- transplantMethod: null,
- preCropId: null,
- inoculation: {
- inoculationAmount: null,
- inoculationUnit: null,
- inoculationDosage: null,
- inoculationDosageUnit: null,
- },
- cultureMediumFormula: null,
- });
- //单个溯源都数组
- const animalIds = ref<any>([]);
- const animalId = ref();
- const showDeleteDialog = ref(false);
- // 修改耽搁溯源弹窗
- const showChangeDialog = ref(false);
- let DialogFlag = ref();
- const handleChangeConfirm = () => {
- // 直接在animalIds中找到DialogFlag相同的项然后修改这个项
- const index = animalIds.value.findIndex((item: any) => item == DialogFlag.value);
- console.log(index, 'itemToUpdate');
- if (index !== -1) {
- animalIds.value[index] = animalId.value;
- }
- animalId.value = null;
- DialogFlag.value = null;
- };
- const handleChangeCancel = () => {
- animalId.value = null;
- DialogFlag.value = null;
- };
- // 使用 reactive 创建响应式对象
- const options1 = reactive([
- {
- text: '删除',
- style: {
- backgroundColor: '#f56c6c',
- },
- },
- {
- text: '编辑',
- style: {
- backgroundColor: '#37A954',
- },
- },
- ]);
- // 自定义校验函数:养殖时间校验
- const validateBreedingTime = (rule: any, value: any, callback: any) => {
- if (!value) {
- callback(new Error('请选择养殖时间'));
- return;
- }
- const { plannedStartDate, plannedEndDate } = value;
- if (!plannedStartDate) {
- callback(new Error('请选择养殖开始时间'));
- return;
- }
- if (!plannedEndDate) {
- callback(new Error('请选择养殖结束时间'));
- return;
- }
- const startDate = new Date(plannedStartDate);
- const endDate = new Date(plannedEndDate);
- if (endDate <= startDate) {
- callback(new Error('养殖结束时间必须晚于开始时间'));
- return;
- }
- callback();
- };
- // 自定义校验函数:养殖量校验
- const validateBreedingAmount = (rule: any, value: any, callback: any) => {
- if (+deawerData.value?.data[0]?.landType == 3) {
- callback();
- return;
- }
- if (!value) {
- callback(new Error('请输入养殖量'));
- return;
- }
- const { plantingMgAmount, plantingMgUnit } = value;
- if (!plantingMgAmount || plantingMgAmount.trim() === '') {
- callback(new Error('请输入养殖量'));
- return;
- }
- if (!plantingMgUnit) {
- callback(new Error('请选择养殖量单位'));
- return;
- }
- callback();
- };
- // 委托企业
- const Enterprise = ref('123');
- // 自定义delegateInfo 委托企业校验
- const validateDelegateInfo = (rule: any, value: any, callback: any) => {
- if (!value) {
- callback(new Error('请选择委托企业'));
- return;
- }
- const { cusId, crediteCode, cusName } = value;
- if (!cusId) {
- callback(new Error('请选择委托企业'));
- return;
- }
- if (!crediteCode) {
- callback(new Error('请选择委托企业'));
- return;
- }
- if (!cusName) {
- callback(new Error('请选择委托企业'));
- return;
- }
- callback();
- };
- //判断是否要填种植面积
- const validatePlantingAmount = (rule: any, value: any, callback: any) => {
- if (+deawerData.value?.data[0]?.landType == 1) {
- if (!value || value.trim() === '') {
- callback(new Error('请输入种植面积'));
- return;
- }
- callback();
- return;
- } else {
- callback();
- return;
- }
- };
- // 判断是否要填接种数量
- const validateinoculation = (rule: any, value: any, callback: any) => {
- if (+deawerData.value?.data[0]?.landType == 3) {
- if (!value || value.trim() === '') {
- callback(new Error('请输入接种数量'));
- return;
- }
- // 检查单位是否选择
- if (!form.value.inoculation?.inoculationUnit) {
- callback(new Error('请选择接种数量单位'));
- return;
- }
- callback();
- } else {
- callback();
- }
- };
- const validateInoculationDosage = (rule: any, value: any, callback: any) => {
- if (+deawerData.value?.data[0]?.landType == 3) {
- // value 就是 form.inoculation.inoculationDosage 的值
- if (!value || value.trim() === '') {
- callback(new Error('请输入接种剂量'));
- return;
- }
- // 检查单位是否选择
- if (!form.value.inoculation?.inoculationDosageUnit) {
- callback(new Error('请选择接种剂量单位'));
- return;
- }
- callback();
- } else {
- callback();
- }
- };
- // 判断溯源级别是否需要校验
- const validateMgMethod = (rule: any, value: any, callback: any) => {
- if (+deawerData.value?.data[0]?.landType == 3) {
- if (!value) {
- callback(new Error('请选择溯源级别'));
- return;
- }
- callback();
- } else {
- callback();
- }
- };
- const rules = reactive({
- baseId: [{ required: true, message: '请选择种养殖所在的基地' }],
- taskType: [{ required: true, message: '请选择任务类型' }],
- mgMethod: [{ required: true, message: '请选择溯源级别' }],
- gapFlag: [{ required: true, message: '请选择符合要求' }],
- varietyId: [{ required: true, message: '请选择养殖的动物名称' }],
- plantationCode: [{ required: true, message: '请输入养殖批号' }],
- technicalFile: [{ required: false, message: '请选择养殖技术规程文件' }],
- plantationMethod: [{ required: true, message: '请选择养殖方式' }],
- queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
- plantingAmount: [{ required: true, message: '请输入养殖面积' }],
- breedScale: [{ required: true, message: '请输入养殖区域' }],
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
- remark: [{ required: true, message: '请输入备注' }],
- });
- const rules1 = reactive({
- baseId: [{ required: true, message: '请选择种养殖所在的基地' }],
- taskType: [{ required: true, message: '请选择任务类型' }],
- delegateFlag: [{ required: true, message: '请选择是否代繁育' }],
- delegateInfo: [{ validator: validateDelegateInfo, trigger: 'blur' }],
- mgMethod: [{ required: true, message: '请选择溯源级别' }],
- varietyId: [{ required: true, message: '请选择养殖的动物名称' }],
- plantationCode: [{ required: true, message: '请输入养殖批号' }],
- technicalFile: [{ required: false, message: '请选择养殖技术规程文件' }],
- plantationMethod: [{ required: false, message: '请选择养殖方式' }],
- queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
- plantingAmount: [{ required: true, message: '请输入养殖面积' }],
- breedScale: [{ required: true, message: '请输入养殖区域' }],
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
- remark: [{ required: true, message: '请输入备注' }],
- });
- const rules2 = reactive({
- baseId: [{ required: true, message: '请选择种植所在的基地' }],
- taskType: [{ required: true, message: '请选择任务类型' }],
- gapFlag: [{ required: true, message: '请选择符合要求' }],
- varietyId: [{ required: true, message: '请选择种植的植物名称' }],
- plantationCode: [{ required: true, message: '请输入种植批号' }],
- technicalFile: [{ required: false, message: '请选择种植技术规程文件' }],
- plantationMethod: [{ required: false, message: '请选择种植方式' }],
- queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
- plantingAmount: [{ required: true, message: '请输入种植面积' }],
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
- remark: [{ required: true, message: '请输入备注' }],
- preCropId: [{ required: false, message: '请选择前茬植物' }],
- reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
- });
- const rules3 = reactive({
- baseId: [{ required: true, message: '请选择种植所在的基地' }],
- taskType: [{ required: true, message: '请选择任务类型' }],
- delegateFlag: [{ required: true, message: '请选择是否代繁育' }],
- delegateInfo: [{ validator: validateDelegateInfo, trigger: 'blur' }],
- mgMethod: [{ validator: validateMgMethod, trigger: 'blur' }],
- varietyId: [{ required: true, message: '请选择种植的植物名称' }],
- plantationCode: [{ required: true, message: '请输入种植批号' }],
- technicalFile: [{ required: false, message: '请选择繁育技术规程文件' }],
- plantationMethod: [{ required: false, message: '请选择繁育方式' }],
- queryType6: [{ validator: validateBreedingTime, trigger: 'blur' }],
- plantingAmount: [{ validator: validatePlantingAmount, trigger: 'blur' }],
- plant: [{ validator: validateBreedingAmount, trigger: 'blur' }],
- 'inoculation.inoculationAmount': [{ validator: validateinoculation, trigger: 'blur' }],
- 'inoculation.inoculationDosage': [{ validator: validateInoculationDosage, trigger: 'blur' }],
- remark: [{ required: true, message: '请输入备注' }],
- preCropId: [{ required: false, message: '请选择前茬植物' }],
- reproductionType: [{ required: true, message: '请选择选择繁殖方式' }],
- });
- const upFormRef = ref<any>();
- const paging = ref<any>();
- const list = ref<unknown>([]);
- // 控制抽屉显示状态
- const drawerVisible = ref(false);
- // 打开抽屉
- function openDrawer() {
- drawerVisible.value = true;
- }
- // 关闭抽屉
- function closeDrawer() {
- drawerVisible.value = false;
- }
- // 处理抽屉打开事件
- function onDrawerOpen() {
- console.log('抽屉打开了');
- }
- // 处理抽屉关闭事件
- function onDrawerClose() {
- console.log('抽屉关闭了');
- }
- const deawerData = ref<any>(null);
- // 处理抽屉确认事件
- function onDrawerConfirm(data: any) {
- console.log('收到基地选择数据:', data);
- deawerData.value = data;
- // 确认基地id
- form.value.baseId = data.data[0]?.baseId;
- //确认地块面积
- if (+data.data[0]?.landType !== 3) {
- form.value.plantingAmount = '';
- data.data.forEach((i: LandInfo) => {
- form.value.plantingAmount += i.area;
- });
- }
- //确认养殖区域的个数
- form.value.breedScale = data.data?.length;
- if (data?.aloneChecked) {
- form.value.landIds = [];
- } else {
- form.value.landIds = data?.checkBox;
- }
- }
- // 处理Baseinfo组件的关闭事件
- function handleBaseinfoClose() {
- deawerData.value = null;
- }
- // 所选动植物
- const Biological = ref<any>(null);
- // 所选前茬植物
- const PreBiological = ref<any>(null);
- //随机生成
- const randomCode = async () => {
- let plType = '';
- const taskType = form.value.taskType;
- if (taskType === 1) {
- plType = 'P';
- } else if (taskType === 2) {
- plType = 'F';
- } else {
- plType = 'C';
- }
- const code = await useClientRequest.post('/plt-api/app/plantationTask/getBatchCode', { plType: plType, linkType: plType });
- form.value.plantationCode = code.data;
- };
- //完成提交表单
- const save = () => {
- uni.$u.debounce(async () => {
- try {
- console.log('开始提交');
- await upFormRef.value?.validate();
- console.log('校验完成');
- const params = {
- ...form.value,
- ...form.value.queryType6,
- ...form.value.plant,
- animalIds: animalIds.value,
- };
- const res = await useClientRequest.post('/plt-api/app/plantationTask/saveTask', params);
- if (res.code == 200) {
- uni.showToast({
- title: '提交成功',
- icon: 'success',
- duration: 2000,
- });
- setTimeout(() => {
- uni.navigateBack();
- }, 1000);
- }
- } catch (error: any) {
- // 滚动到第一个错误字段
- console.log(error);
- const firstErrorField = error && error[0].field + 'pppp';
- paging.value?.scrollIntoViewById(firstErrorField, 30, true);
- return;
- }
- });
- };
- // 暂存
- const saveDraft = () => {
- uni.$u.debounce(async () => {
- try {
- const params = {
- ...form.value,
- plannedStartDate: form.value.queryType6.plannedStartDate,
- plannedEndDate: form.value.queryType6.plannedEndDate,
- plantingMgAmount: form.value.plant.plantingMgAmount,
- plantingMgUnit: form.value.plant.plantingMgUnit,
- };
- const res = await useClientRequest.post('/plt-api/app/plantationTask/draftTask', params);
- if (res.code == 200) {
- uni.showToast({
- title: '提交成功',
- icon: 'success',
- duration: 2000,
- });
- setTimeout(() => {
- uni.navigateBack();
- }, 1000);
- }
- } catch (error: any) {}
- });
- };
- //确认添加个体
- const handleDeleteConfirm = () => {
- if (animalId.value) {
- if (animalIds.value.includes(animalId.value)) {
- uni.showToast({
- title: '个体标识不可重复',
- icon: 'none',
- });
- animalId.value = null;
- return;
- }
- animalIds.value.push(animalId.value);
- animalId.value = null;
- } else {
- uni.showToast({
- title: '请输入个体标识号',
- icon: 'none',
- });
- }
- };
- const handleDeleteCancel = () => {
- animalId.value = null;
- };
- const clickSwipe = async (name: any, index: number) => {
- console.log(name, index);
- if (name?.index == 0) {
- const res = await uni.showModal({
- title: '删除提示',
- content: '删除后不可撤回,请谨慎操作!',
- confirmColor: '#f56c6c',
- });
- if (!res.confirm) return;
- await uni.showLoading({
- title: '删除中...',
- mask: true,
- });
- const findindex = animalIds.value.findIndex((i) => i == name?.name);
- animalIds.value.splice(findindex, 1);
- uni.hideLoading();
- uni.showToast({
- title: '删除成功',
- icon: 'success',
- });
- } else {
- showChangeDialog.value = true;
- DialogFlag.value = name?.name;
- }
- };
- // 如果是组培实验室的话,繁育量是一个计算属性
- const plantingMgAmount = computed(() => {
- if (+deawerData.value.data[0]?.landType == 3) {
- const inoculationAmount = form.value.inoculation?.inoculationAmount;
- const inoculationDosage = form.value.inoculation?.inoculationDosage;
- if (inoculationAmount && inoculationDosage) {
- form.value.plant.plantingMgAmount = +inoculationAmount * +inoculationDosage;
- return form.value.plant.plantingMgAmount || '';
- }
- return '';
- }
- return '';
- });
- // 如果是组培实验室的话,繁育量单位是一个计算属性
- const plantingMgUnit = computed(() => {
- if (form.value.taskType === 11) {
- form.value.plant.plantingMgUnit = form.value.inoculation?.inoculationDosageUnit || null;
- return form.value.plant.plantingMgUnit;
- }
- return null;
- });
- onLoad((options) => {
- form.value.taskType = options?.taskType;
- if (+options?.taskType == 1 || +options?.taskType == 11) {
- form.value.plantingUnit = '亩';
- if (+options?.taskType == 11) {
- form.value.gapFlag = 0;
- }
- } else {
- form.value.plantingUnit = '平方米';
- if (+options?.taskType == 21) {
- form.value.gapFlag = 0;
- }
- }
- });
- const gotoTorganism = (type: number) => {
- if (type == 1) {
- uni.$once('updateBiologicalname', function (data) {
- Biological.value = data.msg;
- form.value.varietyId = data.msg.id;
- });
- } else {
- uni.$once('updateBiologicalname', function (data) {
- PreBiological.value = data.msg;
- form.value.preCropId = data.msg.id;
- });
- }
- uni.navigateTo({
- url: '/tools/por-torganism/index',
- });
- };
- // 查看是否有缓存的信息
- const getCache = async (taskType: TaskType | null) => {
- const res = await useClientRequest.get(`/plt-api/app/plantationTask/getDraft/${taskType}`);
- form.value = res.data;
- form.value.queryType6 = {
- plannedStartDate: res.data.plannedStartDate,
- plannedEndDate: res.data.plannedEndDate,
- };
- form.value.inoculation = {
- inoculationAmount: res.data.inoculationAmount,
- inoculationDosage: res.data.inoculationDosage,
- inoculationUnit: res.data.inoculationUnit,
- inoculationDosageUnit: res.data.inoculationDosageUnit,
- };
- form.value.plant = {
- plantingMgAmount: res.data.plantingMgAmount,
- plantingMgUnit: res.data.plantingMgUnit,
- };
- // 判断有没有基地,然后去获取基地数据
- if (res.data.baseId) {
- deawerData.value = {};
- deawerData.value.baseName = res.data.baseRef.baseName;
- deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
- deawerData.value.address = res.data.baseRef.baseInfo.address;
- // adcodeName
- deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
- if (res.data.landIds.length == 0) {
- deawerData.value.aloneChecked = '';
- const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
- deawerData.value.data = landIds.rows;
- }
- console.log(deawerData.value);
- }
- };
- onMounted(() => {
- getCache(form.value.taskType);
- });
- </script>
|