| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533 |
- <template>
- <z-paging ref="paging" v-model="list" bgColor="#f7f7f7" safe-area-inset-bottom>
- <template #top>
- <ut-navbar title="种养殖任务详情" :fixed="false"></ut-navbar>
- </template>
- <template>
- <!-- <up-alert :title="'备注' + form?.remark" type = "warning" ></up-alert> -->
- <view class="startline-title pl-24 ml-24 mb-16 mt-10">基地信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <view v-if="form?.remark" class="pd4-16-20-16-20 bg-#EBF6EE c-primary f-s-30 f-w-5 b-radius mb-24">备注:{{ form?.remark }}</view>
- <Baseinfo v-if="deawerData" :modeValue="deawerData" :baseType="form.taskType" :showClose="false" />
- </view>
- <view class="startline-title pl-24 ml-24 mb-16">种养殖信息</view>
- <view class="bg-#fff pd-24 mb-20 pt-0">
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">任务类型:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ selectDictLabel(pt_task_type, form.taskType) }}</text>
- </view>
- <!-- 种植字段显示(仅当 taskType == 1 时显示) -->
- <template v-if="form.taskType == 1">
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">符合要求:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.gapFlag ? selectDictLabel(pt_task_gap_flag, form.gapFlag) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">植物名称:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植批号:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationCode || '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">种植技术规程:</view>
- <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
- <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植日期:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植面积:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁殖方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.reproductionType ? selectDictLabel(pt_reproduction_type, form.reproductionType) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植类型:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationType ? selectDictLabel(pt_plantation_type, form.plantationType) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">播种方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.sowingMethod ? selectDictLabel(pt_sowing_method, form.sowingMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">移栽方法:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.transplantMethod ? selectDictLabel(pt_transplant_method, form.transplantMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">前茬植物:</view>
- <view v-if="PreBiological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- <view v-else class="">--</view>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">备注:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.remark || '--' }}</text>
- </view>
- </template>
- <!-- 养殖字段显示(仅当 taskType == 2 时显示) -->
- <template v-if="form.taskType == 2">
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">溯源级别:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">符合要求:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.gapFlag ? selectDictLabel(pt_task_gap_flag, form.gapFlag) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">动物名称:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖批号:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationCode || '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">养殖技术规程:</view>
- <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
- <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖日期:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖面积:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖区域:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.breedScale ? `${form.breedScale}个` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖量:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form?.plantingMgAmount ? `${form.plantingMgAmount}${form?.plantingMgUnit ? selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) : ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">备注:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.remark || '--' }}</text>
- </view>
- </template>
- <!-- 种畜繁育字段显示(仅当 taskType == 21 时显示) -->
- <template v-if="form.taskType == 21">
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">是否代繁育:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.delegateFlag ? selectDictLabel(yes_no, form.delegateFlag) : '--' }}</text>
- </view>
- <view v-if="+form.delegateFlag" class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">委托企业:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <view class="">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">{{ form?.delegateInfo?.cusCode }}</text>
- </view>
- </view>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">溯源级别:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">动物名称:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖批号:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationCode || '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">养殖繁育技术规程:</view>
- <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
- <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖日期:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖面积:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖区域:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.breedScale ? `${form.breedScale}个` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">养殖量:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form?.plantingMgAmount ? `${form.plantingMgAmount}${form?.plantingMgUnit ? selectDictLabel(pt_planting_mg_unit, form.plantingMgUnit) : ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">备注:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.remark || '--' }}</text>
- </view>
- </template>
- <!-- 种苗繁育字段显示(仅当 taskType == 11 时显示) -->
- <template v-if="form.taskType == 11">
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">是否代繁育:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.delegateFlag ? selectDictLabel(yes_no, form.delegateFlag) : '--' }}</text>
- </view>
- <view v-if="+form?.delegateFlag" class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">委托企业:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <view class="">
- <text class="c-#333 f-s-34 f-w-5 mr-5">{{ form?.delegateInfo?.cusName }}</text>
- </view>
- <view class="">
- <text class="c-#666 f-s-24">{{ form?.delegateInfo?.cusCode }}</text>
- </view>
- </view>
- </view>
- <view class="pt-16 pb-16 info-border-bottom" v-if="form?.baseRef?.baseInfo?.landList.length">
- <view class="c-#666 f-s-30 mb-20">具体位置:</view>
- <view class="p-rtv pd-24 b-radius mb-10" v-for="(it, indexs) in form?.baseRef?.baseInfo?.landList" :key="indexs" style="border: 1px solid #afddbb">
- <view class="c-#333 f-s-34 f-w-5">{{ it?.landName }}</view>
- <view class="c-#666 f-s-24">{{ stringifyCheckedList(it?.checkedList, Number(it?.capacityAmount || 0)) }}</view>
- </view>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">溯源级别:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.mgMethod ? selectDictLabel(pt_mg_method, form.mgMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">植物名称:</view>
- <view class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁育批号:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationCode || '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">繁育技术规程:</view>
- <ut-album v-if="form.technicalFile?.length > 0" :urls="form.technicalFile"></ut-album>
- <text v-else class="c-#333 f-s-30 f-w-5">{{ '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁育方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationMethod ? selectDictLabel(pt_feeding_method, form.plantationMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁育日期:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ `${form.plannedStartDate} 至 ${form.plannedEndDate}` }}</text>
- </view>
- <view v-if="+deawerData?.data?.[0]?.landType == 1" class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植面积:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantingAmount ? `${form.plantingAmount}${form.plantingUnit || ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">接种数量:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.inoculationAmount ? `${form.inoculationAmount}${form?.inoculationUnit}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁育量:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form?.plantingMgAmount ? `${form.plantingMgAmount}${form?.plantingMgUnit ? selectDictLabel(pt_inoculation_dosage_unit, form?.plantingMgUnit) : ''}` : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">繁殖方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.reproductionType ? selectDictLabel(pt_reproduction_type, form.reproductionType) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">种植类型:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.plantationType ? selectDictLabel(pt_plantation_type, form.plantationType) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">播种方式:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.sowingMethod ? selectDictLabel(pt_sowing_method, form.sowingMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">移栽方法:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.transplantMethod ? selectDictLabel(pt_transplant_method, form.transplantMethod) : '--' }}</text>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <view class="c-#666 f-s-30 mb-20">前茬植物:</view>
- <view v-if="PreBiological" class="pd-24 d-flex flex-cln bg-#FBFDFB border-#37A954 b-radius mb-20">
- <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>
- <view v-else class="">--</view>
- </view>
- <view class="pt-16 pb-16 info-border-bottom">
- <text class="c-#666 f-s-30">备注:</text>
- <text class="c-#333 f-s-30 f-w-5">{{ form.remark || '--' }}</text>
- </view>
- </template>
- </view>
- <template v-if="animalIds?.length > 0">
- <view class="startline-title pl-24 ml-24 mb-16">个体标识信息</view>
- <view class="bg-#fff pd-24 mb-20">
- <template v-for="(item, index) in animalIds" :key="index">
- <view class="pd-34 border-#37A954 mb-20 d-flex flex-cln b-radius">
- <text>{{ item }}</text>
- </view>
- </template>
- </view>
- </template>
- <view class="pd-24">
- <view class="d-flex j-c pd-10">
- <view class="mr-10 c-#ccc f-s-24">
- <text>最新操作人:</text>
- <text>{{ form?.updateByName || form?.createByName }}</text>
- </view>
- <view class="c-#ccc f-s-24">
- <text>最新操作时间:</text>
- <text>{{ form?.updateTime || form?.createTime }}</text>
- </view>
- </view>
- <view class="">
- <up-button type="primary" class="b-radius" @click="handlechoseConfirm">修改</up-button>
- </view>
- </view>
- </template>
- </z-paging>
- </template>
- <script setup lang="ts">
- import Baseinfo from '../port-create/models/baseinfo.vue';
- import { useClientRequest } from '@/utils/request';
- const { proxy } = getCurrentInstance() as ComponentInternalInstance;
- const { pt_feed_amount_unit, pt_planting_mg_unit, pt_inoculation_unit, pt_inoculation_dosage_unit, pt_transplant_method, pt_plantation_type, pt_sowing_method, pt_area_unit, pt_plantation_method, pt_reproduction_type, pt_scale_unit, pt_feeding_method, pt_mg_method, pt_task_gap_flag, pt_task_type, pt_org_type, yes_no } = toRefs<any>(
- proxy?.useDict('pt_feed_amount_unit', 'pt_planting_mg_unit', 'pt_inoculation_unit', 'pt_inoculation_dosage_unit', 'pt_transplant_method', 'pt_plantation_type', 'pt_sowing_method', 'pt_area_unit', 'pt_plantation_method', 'pt_reproduction_type', 'pt_scale_unit', 'pt_feeding_method', 'pt_mg_method', 'pt_task_gap_flag', 'pt_task_type', 'pt_org_type', 'yes_no'),
- );
- const paging = ref();
- const list = ref();
- const form = ref<any>({
- 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: {},
- plantationType: null,
- sowingMethod: null,
- transplantMethod: null,
- preCropId: null,
- inoculation: {
- inoculationAmount: null,
- inoculationUnit: null,
- inoculationDosage: null,
- inoculationDosageUnit: null,
- },
- cultureMediumFormula: null,
- });
- const deawerData = ref<any>(null);
- const animalIds = ref();
- // 所选动植物
- const Biological = ref<any>(null);
- const PreBiological = ref<any>(null);
- const taskId = ref();
- const getInfo = async () => {
- const res = await useClientRequest.get<any>(`/plt-api/app/plantationTask/getInfo/${taskId.value}`);
- if (!res.data) return;
- form.value = res.data;
- if (res.data.animalIds) {
- animalIds.value = res.data.animalIds;
- }
- if (res.data.preCropCode) {
- PreBiological.value = {};
- const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.preCropCode}`);
- PreBiological.value = Bio.data;
- }
- if (res.data.varietyCode) {
- Biological.value = {};
- const Bio = await useClientRequest.get(`/plt-api/app/medicine/getMedicineByCode/${res.data.varietyCode}`);
- Biological.value = Bio.data;
- }
- // 判断有没有基地,然后去获取基地数据
- if (res.data.baseId) {
- deawerData.value = {};
- deawerData.value.baseName = res.data.baseRef.baseName;
- deawerData.value.areaUnit = res.data.baseRef.baseInfo.areaUnit;
- deawerData.value.area = res.data.baseRef.baseInfo.area;
- deawerData.value.address = res.data.baseRef.baseInfo.address;
- // adcodeName
- deawerData.value.adcodeName = res.data.baseRef.baseInfo.adcodeName;
- if (+res.data.landFlag) {
- deawerData.value.aloneChecked = true;
- const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
- deawerData.value.data = landIds.rows;
- } else {
- deawerData.value.aloneChecked = false;
- deawerData.value.data = [];
- const landIds = await useClientRequest.get('/plt-api/app/baseLandInfo/pageList', { baseId: res.data.baseId });
- //找到res.data.landIds和landIds.rows中的id相同的项
- landIds.rows.forEach((i: any) => {
- if (res.data.landIds.find((t: any) => t == i.id)) {
- deawerData.value.data.push(i);
- }
- });
- }
- }
- };
- const handlechoseConfirm = () => {
- uni.$u.route({ type: 'navigateTo', url: '/plant/port/port-create/index', params: { taskId: taskId.value } });
- };
- const stringifyCheckedList = (list: CheckedPosition[], perLayerCount: number) => {
- if (!Array.isArray(list) || !list.length) {
- return '';
- }
- const capacity = Number(perLayerCount || 0);
- if (!capacity) {
- return '';
- }
- const serialMap = new Map<number, CheckedPosition>();
- list.forEach((item) => {
- const serial = (item.x - 1) * capacity + item.y;
- if (serial > 0 && !serialMap.has(serial)) {
- serialMap.set(serial, item);
- }
- });
- const serials = Array.from(serialMap.keys()).sort((a, b) => a - b);
- if (!serials.length) {
- return '';
- }
- const segments: string[] = [];
- let startSerial = serials[0];
- let endSerial = serials[0];
- const pushSegment = (start: number, end: number) => {
- const startItem = serialMap.get(start)!;
- const endItem = serialMap.get(end)!;
- if (start === end) {
- segments.push(`${startItem.x}-${startItem.y}`);
- } else {
- segments.push(`${startItem.x}-${startItem.y}至${endItem.x}-${endItem.y}`);
- }
- };
- for (let index = 1; index < serials.length; index++) {
- const current = serials[index];
- if (current === endSerial + 1) {
- endSerial = current;
- } else {
- pushSegment(startSerial, endSerial);
- startSerial = current;
- endSerial = current;
- }
- }
- pushSegment(startSerial, endSerial);
- return `${segments.join(',')}共${serials.length}个位置`;
- };
- onMounted(() => {
- getInfo();
- });
- onLoad((options: any) => {
- taskId.value = options?.id;
- });
- </script>
|