modify.vue 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422
  1. <template>
  2. <div class="new-farming-page" ref="pageRef">
  3. <custom-header :name="isEdit ? (onlyPrice ? '编辑报价' : '编辑方案') : '查看详情'"></custom-header>
  4. <div class="new-farming-content" :class="{ 'no-permission': !hasPlanPermission }">
  5. <el-form
  6. ref="formRef"
  7. style="max-width: 600px"
  8. label-position="left"
  9. :rules="rules"
  10. :model="dynamicValidateForm"
  11. class="demo-dynamic"
  12. >
  13. <div class="farm-card">
  14. <div class="card-title between common-inputs">
  15. <div>{{ detailData?.name }}<span class="type-tag">标准农事</span></div>
  16. <el-select v-if="isEdit" size="small" v-model="tagName" placeholder="标记为" style="width: 94px">
  17. <el-option
  18. v-for="item in tagList"
  19. :key="item.value"
  20. :label="item.label"
  21. :value="item.value"
  22. />
  23. </el-select>
  24. <div class="edit-tag tag-text" v-else>{{ statusMap[tagName] }}</div>
  25. <!-- <el-tooltip
  26. effect="dark"
  27. placement="left"
  28. >
  29. <template #content>
  30. <div class="tag-item">全托管</div>
  31. <div class="tag-item">飞防托管</div>
  32. <div class="tag-item">营养托管</div>
  33. </template>
  34. <div class="title-tag add-tag">托管用户</div>
  35. </el-tooltip> -->
  36. </div>
  37. <div class="info-content">
  38. <el-form-item label-width="70px" class="form-item text-item" label="农事编号">
  39. <div class="info-text">
  40. {{ detailData?.code }}
  41. </div>
  42. </el-form-item>
  43. <el-form-item v-if="!noPrice" label-width="70px" class="form-item text-item" label="服务亩数">
  44. <div class="info-text">
  45. {{ detailData?.farm?.mianji ? formatArea(detailData?.farm?.mianji) + "亩" : "--" }}
  46. </div>
  47. </el-form-item>
  48. <el-form-item v-if="!noPrice" label-width="70px" class="form-item text-item" label="服务区域">
  49. <div class="info-text">
  50. {{ detailData?.farm?.address || "--" }}
  51. </div>
  52. </el-form-item>
  53. <el-form-item
  54. v-if="isEdit"
  55. label-width="70px"
  56. class="form-item"
  57. prop="executeDate"
  58. label="执行时间"
  59. >
  60. <el-date-picker
  61. class="item-input"
  62. style="width: 100%"
  63. value-format="YYYY-MM-DD"
  64. v-model="dynamicValidateForm.executeDate"
  65. type="date"
  66. :clearable="false"
  67. placeholder="选择日期"
  68. :editable="false"
  69. />
  70. </el-form-item>
  71. <el-form-item v-else label-width="70px" class="form-item text-item" label="执行时间">
  72. <div class="info-text">
  73. {{ detailData?.executeDate }}
  74. </div>
  75. </el-form-item>
  76. </div>
  77. </div>
  78. <div class="farm-card" v-if="!onlyPrice">
  79. <!-- 农情互动 -->
  80. <div class="card-title border-bottom between">
  81. <div>农情互动</div>
  82. <!-- <span class="del-tag">删除互动</span> -->
  83. </div>
  84. <div v-if="isEdit" class="interact-form">
  85. <div class="interact-form-item" data-interact-field="phenologyId">
  86. <div class="form-label">
  87. 互动阶段
  88. </div>
  89. <div class="form-input-wrapper two-select">
  90. <div class="select-item">
  91. <el-select
  92. style="width: 100%"
  93. v-model="interactFormData.phenologyId"
  94. placeholder="请选择物候期"
  95. @change="handlePhenologyChange"
  96. :editable="false">
  97. <el-option
  98. v-for="item in phenologyList"
  99. :key="item.id"
  100. :label="item.name"
  101. :value="item.id"
  102. ></el-option>
  103. </el-select>
  104. </div>
  105. <div class="select-item">
  106. <el-select style="width: 100%" v-model="interactFormData.reproductiveId" placeholder="请选择物候期" :editable="false">
  107. <el-option
  108. v-for="item in reproductiveList"
  109. :key="item.id"
  110. :label="item.name"
  111. :value="item.id"
  112. ></el-option>
  113. </el-select>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="interact-form-item" data-interact-field="interactionTime">
  118. <div class="form-label">
  119. 互动日期
  120. </div>
  121. <div class="form-input-wrapper">
  122. <el-date-picker
  123. v-model="interactFormData.interactionTime"
  124. disabled
  125. style="width: 100%"
  126. type="date"
  127. placeholder="请选择日期"
  128. :editable="false"
  129. />
  130. </div>
  131. </div>
  132. <div class="interact-form-item" data-interact-field="interactionQuestion">
  133. <div class="form-label">
  134. 互动问题
  135. </div>
  136. <el-input
  137. v-model="interactFormData.interactionQuestion"
  138. type="textarea"
  139. :rows="3"
  140. show-word-limit
  141. maxlength="35"
  142. placeholder="请设置互动问题"
  143. class="question-textarea"
  144. />
  145. </div>
  146. </div>
  147. <div v-else class="interact-content">
  148. {{ interactFormData?.interactionQuestion }}
  149. <!-- <span class="edit-tag" @click="handleEditInteract(detailData)">点击编辑</span> -->
  150. </div>
  151. </div>
  152. <template v-if="isEdit">
  153. <div class="farm-card prescription-content common-inputs">
  154. <div class="card-title pb-12 between">
  155. 药物处方
  156. <div class="add-tag" @click="addDomain()">
  157. <el-icon color="#2199F8"><Plus /></el-icon>新增药物
  158. </div>
  159. </div>
  160. <el-form-item label-width="82px" class="form-item" prop="usageMode" label="施用方式">
  161. <el-select
  162. v-model="dynamicValidateForm.prescription.usageMode"
  163. placeholder="请选择施用方式"
  164. style="width: 100%"
  165. >
  166. <el-option
  167. v-for="(usage, uId) in allUsageModeList"
  168. :key="uId"
  169. :label="usage"
  170. :value="usage"
  171. />
  172. </el-select>
  173. </el-form-item>
  174. <el-form-item v-if="dynamicValidateForm.prescription.usageMode === '叶面施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
  175. <el-select
  176. class="select-item"
  177. v-model="dynamicValidateForm.executeStyle"
  178. placeholder="执行方式"
  179. @change="handleExecutionMethodChange"
  180. >
  181. <el-option
  182. v-for="(item, index) in modeList"
  183. :key="index"
  184. :label="item.name"
  185. :value="item.value"
  186. />
  187. </el-select>
  188. </el-form-item>
  189. <el-form-item v-if="dynamicValidateForm.prescription.usageMode === '根部施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
  190. <div class="info-text">人工</div>
  191. </el-form-item>
  192. <div v-if="dynamicValidateForm.prescription.usageMode !== '人工农事'">
  193. <el-form-item
  194. v-for="(domain, index) in dynamicValidateForm.prescription.pesticideFertilizerList"
  195. :key="index"
  196. :prop="'prescription.pesticideFertilizerList.' + index + '.value'"
  197. class="prescription-item"
  198. >
  199. <div class="recipe-item">
  200. <div class="recipe-form">
  201. <div class="form-box">
  202. <div class="form-index">药肥{{ index + 1 }}</div>
  203. <div class="box-item" v-if="domain.typeName">
  204. <div class="form-l">药肥类型</div>
  205. <div class="form-r r-text">
  206. {{ domain.typeName }}
  207. </div>
  208. </div>
  209. <div class="box-item">
  210. <div class="form-l">药肥名称</div>
  211. <div class="form-r">
  212. <el-select
  213. filterable
  214. @change="
  215. handlePesticideFertilizerChange(index)
  216. "
  217. v-model="domain.code"
  218. placeholder="请选择"
  219. style="width: 150px"
  220. >
  221. <el-option
  222. v-for="item in pesticideFertilizersOptions"
  223. :key="item.pesticideFertilizerCode"
  224. :label="item.defaultName || item.name"
  225. :value="item.pesticideFertilizerCode"
  226. />
  227. </el-select>
  228. </div>
  229. </div>
  230. <div class="mt-8">
  231. <div class="box-item sub-item" :data-ratio-index="index">
  232. <div class="form-l has-sub">
  233. <div class="main-name">药肥配比</div>
  234. </div>
  235. <div class="form-r input-box text-center input-unit">
  236. <el-input
  237. v-model="domain.ratio"
  238. type="number"
  239. step="0.01"
  240. style="width: 150px"
  241. :placeholder="domain.placeholderRatio || '请输入'"
  242. >
  243. <template #append>倍</template>
  244. </el-input>
  245. </div>
  246. </div>
  247. <div class="box-item sub-item" :data-dosage-index="index">
  248. <div class="form-l has-sub">
  249. <div class="main-name">单亩用量</div>
  250. </div>
  251. <div class="form-r input-box text-center">
  252. <el-input
  253. v-model="domain.dosage"
  254. type="number"
  255. step="0.01"
  256. style="width: 150px"
  257. :placeholder="domain.placeholderDosage || '请输入'"
  258. >
  259. <template #append>{{ domain.unit }}</template>
  260. </el-input>
  261. </div>
  262. </div>
  263. <div class="box-item">
  264. <div class="form-l">药肥品牌</div>
  265. <div class="form-r">
  266. <el-input
  267. v-model="domain.brand"
  268. placeholder="药肥品牌"
  269. style="width: 150px"
  270. />
  271. </div>
  272. </div>
  273. <div class="box-item">
  274. <div class="form-l">药肥单价</div>
  275. <div class="form-r">
  276. <el-input
  277. style="width: 150px"
  278. v-model="domain.price"
  279. type="number"
  280. step="0.01"
  281. placeholder="单价"
  282. >
  283. <template #append>元/{{ domain.unit }}</template>
  284. </el-input>
  285. </div>
  286. </div>
  287. <div v-if="!noPrice" class="medicine-item">
  288. <div class="item-total">总计:</div>
  289. <div class="item-price">
  290. {{ getPesticideTotal(domain) }}<span class="item-unit">元</span>
  291. </div>
  292. </div>
  293. </div>
  294. <div class="input-box mark-box">
  295. <el-input
  296. v-model="domain.remark"
  297. style="width: 100%"
  298. type="textarea"
  299. :rows="2"
  300. placeholder="备注:用药注意事项"
  301. />
  302. </div>
  303. <div class="action-btn">
  304. <el-button
  305. class="btn delete-btn"
  306. @click.prevent="removeDomain(prescriptionI, domain)"
  307. >
  308. 删除
  309. </el-button>
  310. <el-button
  311. type="default"
  312. class="btn"
  313. @click.prevent="resetItemForm(prescriptionI, index)"
  314. >
  315. 重置
  316. </el-button>
  317. </div>
  318. </div>
  319. <!-- </el-form-item> -->
  320. </div>
  321. </div>
  322. </el-form-item>
  323. </div>
  324. </div>
  325. <div class="farm-card prescription-content">
  326. <div class="medicine-box">
  327. <div class="form-index">服务报价</div>
  328. <div class="box-wrap">
  329. <div class="medicine-item mt-8">
  330. <div class="item-name">单亩价格</div>
  331. <div class="item-val common-inputs">
  332. <el-input
  333. style="width: 150px"
  334. v-model="servicePricePerMu"
  335. type="number"
  336. step="0.01"
  337. placeholder="服务单价"
  338. >
  339. <template #append>元/亩</template>
  340. </el-input>
  341. </div>
  342. </div>
  343. <div v-if="!noPrice" class="medicine-item">
  344. <div class="item-total">总计:</div>
  345. <div class="item-price">
  346. {{ getServiceTotal() }}<span class="item-unit">元</span>
  347. </div>
  348. </div>
  349. </div>
  350. </div>
  351. </div>
  352. <div class="submit-btn" :class="{ 'center-btn': onlyPrice }">
  353. <div v-if="!onlyPrice" class="btn second" @click.prevent="cancelEdit">取消编辑</div>
  354. <div class="btn" @click.prevent="submitForm(formRef)">保存</div>
  355. </div>
  356. </template>
  357. <template v-else>
  358. <div class="farm-card prescription-content">
  359. <div class="card-title">药物处方</div>
  360. <div class="table-item">
  361. <div class="form-item">
  362. <div class="item-name">施用方式</div>
  363. <div class="item-text">{{ dynamicValidateForm?.prescription?.usageMode }}</div>
  364. </div>
  365. <div class="form-item">
  366. <div class="item-name">执行方式</div>
  367. <div class="item-text">
  368. {{ dynamicValidateForm?.prescription?.pesticideFertilizerList[0]?.executeStyle === 1 ? '无人机' : '人工' }}
  369. </div>
  370. </div>
  371. </div>
  372. <div class="new-wrap" v-if="detailData?.prescription?.pesticideFertilizerList?.length">
  373. <div class="new-title">
  374. <div class="title-1"><div class="table-name">使用功效</div></div>
  375. <div class="title-2"><div class="table-name">药肥名称</div></div>
  376. <div class="title-4"><div class="table-name">药肥配比</div></div>
  377. <div class="title-5"><div class="table-name">单亩用量</div></div>
  378. </div>
  379. <div
  380. class="new-table-wrap"
  381. v-for="(subP, prescriptionI) in detailData?.prescription?.pesticideFertilizerList || []"
  382. :key="prescriptionI"
  383. >
  384. <!-- <div
  385. class="new-prescription"
  386. v-for="(subP, subI) in prescriptionItem.pesticideFertilizerList"
  387. :key="subI"
  388. > -->
  389. <div class="new-table">
  390. <div class="line-l">
  391. <div class="line-1 title-1">{{ subP.typeName || '--' }}</div>
  392. <div class="line-2">
  393. {{ subP.name || subP.pesticideFertilizerName }}
  394. </div>
  395. </div>
  396. <div class="line-r">
  397. <div class="line-3">
  398. <div class="sub-line title-4">{{ subP.ratio ? (subP.ratio + '倍') : '--' }}</div>
  399. <div class="sub-line title-5">{{ subP.dosage ? (subP.dosage + subP.unit) : '--' }}</div>
  400. </div>
  401. </div>
  402. </div>
  403. <div class="note-text" v-if="subP.remark">{{ subP.remark }}</div>
  404. <!-- </div> -->
  405. </div>
  406. </div>
  407. </div>
  408. <div class="farm-card prescription-content">
  409. <div class="card-title">处方报价</div>
  410. <div class="price-bottom" v-if="!noPrice">
  411. <div class="info-title-wrap">
  412. <div class="sub-title font-bold">药肥费用</div>
  413. <div class="info-more">
  414. {{ pesticideCostTotal ? formatArea(pesticideCostTotal) : "--" }}<span class="unit-text">元</span>
  415. </div>
  416. </div>
  417. </div>
  418. <div class="info-content-wrap pt-8">
  419. <price-table :prescriptionData="dynamicValidateForm.prescription" :area="detailData?.farm?.mianji">
  420. <template #bottomContent>
  421. <div class="price-bottom">
  422. <div class="info-title-wrap">
  423. <div class="sub-title font-bold">服务费用</div>
  424. <div class="info-more" v-if="!noPrice">
  425. {{ detailData?.serviceMuPrice ? serviceCostTotal : '--' }}
  426. <span class="unit-text">元</span>
  427. </div>
  428. </div>
  429. <div class="price-info">
  430. <div class="info-l">
  431. 单亩价格<span class="main-text">{{
  432. detailData?.serviceMuPrice
  433. ? detailData?.serviceMuPrice + "元/亩"
  434. : "--"
  435. }}</span>
  436. </div>
  437. </div>
  438. <div class="price-total" v-if="!noPrice">
  439. 报价合计:<span class="main-val">{{
  440. totalCost ? formatArea(totalCost) : "--"
  441. }}</span
  442. >元
  443. </div>
  444. </div>
  445. </template>
  446. </price-table>
  447. </div>
  448. </div>
  449. <template v-if="!isDefault">
  450. <div class="submit-btn" v-has-permission="'农事规划'">
  451. <div class="btn second" @click.prevent="handleCancelAttention">取消关注</div>
  452. <div class="btn" @click.prevent="toEditPrescription">编辑处方</div>
  453. </div>
  454. </template>
  455. </template>
  456. </el-form>
  457. </div>
  458. </div>
  459. <!-- 服务报价单 -->
  460. <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
  461. <!-- 互动设置弹窗 -->
  462. <interact-popup
  463. ref="interactPopupRef"
  464. @handleSaveSuccess="handleSaveInteractSuccess"
  465. @handleDeleteInteract="handleDeleteInteract"
  466. ></interact-popup>
  467. <!-- 取消关注提示 -->
  468. <tip-popup
  469. v-model:show="showTipPopup"
  470. type="warning"
  471. text="您确定要取消关注"
  472. text2="农事吗?系统将不再为您推送该农事"
  473. :highlightText="detailData.name"
  474. :overlayStyle="{ 'z-index': 9999 }"
  475. buttonText="确认取消关注"
  476. @confirm="handleBtn"
  477. :hasClose="true"
  478. :closeOnClickOverlay="false"
  479. />
  480. <!-- 完善信息弹窗 -->
  481. <popup
  482. v-model:show="showCompletePopup"
  483. round
  484. class="complete-tip-popup"
  485. closeable
  486. >
  487. <img class="tip-icon success-icon" src="@/assets/img/home/right.png" alt="" />
  488. <div class="tip-text success-text">
  489. 农事信息已完善
  490. </div>
  491. <div class="complete-content">
  492. </div>
  493. <div class="btn-wrap">
  494. <div class="btn-item second" @click="handleViewDetail">查看详情</div>
  495. <div class="btn-item primary" v-if="!allDone" @click="handleCompleteNext">完善下一个农事</div>
  496. <div class="btn-item primary" v-else @click="handleBackToPlan">回到种植方案</div>
  497. </div>
  498. </popup>
  499. </template>
  500. <script setup>
  501. import { onActivated, ref, reactive, onDeactivated, onBeforeUnmount, computed, onMounted, nextTick } from "vue";
  502. import { useRouter, useRoute } from "vue-router";
  503. import { ElMessage, ElMessageBox } from "element-plus";
  504. import customHeader from "@/components/customHeader.vue";
  505. import { useStore } from "vuex";
  506. import { Popup } from "vant";
  507. import { formatArea } from "@/common/commonFun";
  508. import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
  509. import interactPopup from "@/components/popup/interactPopup.vue";
  510. import priceTable from "../agri_work/components/priceTable.vue";
  511. import tipPopup from "@/components/popup/tipPopup.vue";
  512. import dayjs from "dayjs";
  513. const store = useStore();
  514. const pageRef = ref(null);
  515. const router = useRouter();
  516. const route = useRoute();
  517. // 检查是否有"农事规划"权限
  518. const hasPlanPermission = computed(() => {
  519. try {
  520. const userInfoStr = localStorage.getItem("localUserInfo");
  521. if (!userInfoStr) return false;
  522. const userInfo = JSON.parse(userInfoStr);
  523. const permissions = userInfo.agriculturalPermissions || [];
  524. return permissions.includes("农事规划");
  525. } catch (error) {
  526. console.error("解析用户信息失败:", error);
  527. return false;
  528. }
  529. });
  530. const tagList = ref([
  531. { label: "托管农事", value: 2 },
  532. { label: "特别关注", value: 1 },
  533. // { label: "取消关注", value: 0 },
  534. ]);
  535. const tagName = ref("");
  536. // 互动表单数据
  537. const interactFormData = ref({
  538. phenologyId: "",
  539. reproductiveId: "",
  540. interactionTime: "",
  541. interactionQuestion: "",
  542. });
  543. const phenologyList = ref([]);
  544. const reproductiveList = ref([]);
  545. // 是否编辑
  546. const isEdit = ref(false);
  547. // 是否只显示价格,不需要农情互动
  548. const onlyPrice = ref(false);
  549. // 是否不显示价格,种植方案没有价格
  550. const noPrice = ref(false);
  551. // 是否标注方案
  552. const isDefault = ref(false);
  553. // 是否在完善信息弹窗中
  554. const isDoingComplete = ref(false);
  555. const showCompletePopup = ref(false);
  556. onActivated(() => {
  557. isDefault.value = route.query.isDefault == 'true' ? true : false;
  558. isEdit.value = route.query.isEdit == 'true' ? true : false;
  559. onlyPrice.value = route.query.onlyPrice == 'true' ? true : false;
  560. noPrice.value = route.query.noPrice == 'true' ? true : false;
  561. // enabled为0时,方案不可用,需要完善
  562. isDoingComplete.value = route.query.enabled == 0 ? true : false;
  563. // 方案列表中的ids数组
  564. if (route.query.farmWorkId) {
  565. getDetail();
  566. }
  567. if (isDoingComplete.value) {
  568. let farmWorkAndArrangeIdIdsArray = (() => {
  569. const stored = sessionStorage.getItem("farmWorkAndArrangeIds");
  570. return stored ? JSON.parse(stored) : [];
  571. })();
  572. ids.value = farmWorkAndArrangeIdIdsArray;
  573. if (ids.value.length === 0 || ids.value.length === 1) {
  574. allDone.value = true;
  575. }
  576. }
  577. nextTick(() => {
  578. if (pageRef.value) {
  579. pageRef.value.scrollTop = 0;
  580. } else {
  581. window.scrollTo(0, 0);
  582. }
  583. });
  584. // 初始化 prescription 对象
  585. if (!route.query.farmWorkId) {
  586. dynamicValidateForm.prescription = {
  587. usageMode: "",
  588. pesticideFertilizerList: [
  589. {
  590. code: "",
  591. name: "",
  592. dosage: "",
  593. ratio: "",
  594. typeName: "",
  595. muPrice: 0,
  596. executeStyle: 1,
  597. unit: "",
  598. },
  599. ],
  600. };
  601. }
  602. });
  603. const priceSheetPopupRef = ref(null);
  604. const showPriceSheetPopup = () => {
  605. priceSheetPopupRef.value.handleShowPopup(detailData.value);
  606. };
  607. const handlePhenologyChange = async (val) => {
  608. interactFormData.value.reproductiveId = "";
  609. const { data } = await VE_API.farm.listByPhenologyId({ phenologyId: val });
  610. if (!data || !Array.isArray(data)) return;
  611. reproductiveList.value = data;
  612. };
  613. const statusMap = ref({
  614. 0: "",
  615. 1: "特别关注",
  616. 2: "托管农事",
  617. });
  618. const detailData = ref({});
  619. const userInfo = localStorage.getItem('localUserInfo');
  620. const userInfoObj = userInfo ? JSON.parse(userInfo) : {};
  621. const getDetail = async () => {
  622. const { data, code } = await VE_API.farm.getFarmWorkLib({ id: route.query.farmWorkId, farmId: route.query.farmId, agriculturalId: userInfoObj?.agriculturalId });
  623. if(code === 0) {
  624. detailData.value = data;
  625. dynamicValidateForm.executeDate = data.executeDate;
  626. dynamicValidateForm.prescription.usageMode = data?.prescription?.usageMode === '其他' ? '根部施' : data?.prescription?.usageMode;
  627. // 从 prescription 获取数据
  628. dynamicValidateForm.prescription = data.prescription || {
  629. usageMode: "",
  630. pesticideFertilizerList: [],
  631. };
  632. dynamicValidateForm.executeStyle = data?.prescription?.pesticideFertilizerList[0]?.executeStyle;
  633. servicePricePerMu.value = detailData.value.serviceMuPrice || null;
  634. if (isDoingComplete.value && !isDefault.value) {
  635. data?.prescription?.pesticideFertilizerList.forEach(item => {
  636. item.placeholderRatio = item.ratio || '';
  637. item.placeholderDosage = item.dosage || '';
  638. if (isNaN(item.ratio)) {
  639. item.ratio = null;
  640. }
  641. if (isNaN(item.dosage)) {
  642. item.dosage = null;
  643. }
  644. });
  645. }
  646. const pesticideFertilizerCodes = data?.prescription?.pesticideFertilizerList.map(item => item.code);
  647. getPriceList(data.schemeId, pesticideFertilizerCodes);
  648. // 加载互动表单数据
  649. if (data.id) {
  650. // 重置互动表单数据
  651. interactFormData.value = {
  652. phenologyId: "",
  653. reproductiveId: "",
  654. interactionTime: "",
  655. interactionQuestion: "",
  656. };
  657. // 按照 interactPopup.vue 的方式获取数据
  658. await getPhenologyList(data.containerSpaceTimeId || route.query.containerSpaceTimeId);
  659. await getFarmWorkArrangeDetail(route.query.id || route.query.arrangeId);
  660. }
  661. }
  662. };
  663. const getPriceList = async (schemeId, pesticideFertilizerCodes) => {
  664. const { data } = await VE_API.farm.getPriceList({ schemeId, pesticideFertilizerCodes });
  665. if (!data || !Array.isArray(data)) return;
  666. dynamicValidateForm.prescription.pesticideFertilizerList.forEach((item) => {
  667. const priceInfo = data.find((p) => p.pesticideFertilizerCode === item.code);
  668. if (!priceInfo) return;
  669. item.price = priceInfo.price ?? item.price;
  670. item.brand = priceInfo.brand ?? item.brand;
  671. });
  672. quotationData.value = {...detailData.value, ...dynamicValidateForm};
  673. };
  674. const showTipPopup = ref(false);
  675. // 取消关注弹窗
  676. const handleCancelAttention = () => {
  677. showTipPopup.value = true;
  678. };
  679. const handleBtn = () => {
  680. showTipPopup.value = false;
  681. // 切换标记
  682. VE_API.container_farm_work_arrange.toggleFollow({ id: route.query.id, isFollow: 0 }).then((res) => {
  683. if (res.code === 0) {
  684. ElMessage.success("操作成功");
  685. router.back();
  686. }
  687. });
  688. };
  689. const toEditPrescription = () => {
  690. isEdit.value = true;
  691. nextTick(() => {
  692. if (pageRef.value) {
  693. pageRef.value.scrollTo({ top: 0, behavior: "auto" });
  694. } else {
  695. window.scrollTo(0, 0);
  696. }
  697. });
  698. };
  699. const quotationData = ref({});
  700. // 计算单个药肥的总计:单价 * 单亩用量 * 亩数
  701. const getPesticideTotal = (pesticide) => {
  702. const price = Number(pesticide.price || 0);
  703. const dosage = Number(pesticide.dosage || 0); // 单亩用量
  704. const area = Number(detailData.value.farm?.mianji || 0); // 农场面积
  705. if (!price || !dosage || !area) return "--";
  706. const total = (price * dosage * area).toFixed(2);
  707. return total;
  708. };
  709. function getServiceCost(cost, area) {
  710. if (!cost || !area) return "--";
  711. return (parseFloat(cost) * parseFloat(area)).toFixed(2);
  712. }
  713. const handleViewDetail = () => {
  714. showCompletePopup.value = false;
  715. isEdit.value = false;
  716. nextTick(() => {
  717. if (pageRef.value) {
  718. pageRef.value.scrollTo({ top: 0, behavior: "auto" });
  719. } else {
  720. window.scrollTo(0, 0);
  721. }
  722. });
  723. };
  724. const allDone = ref(false);
  725. const handleBackToPlan = () => {
  726. router.back();
  727. };
  728. const ids = ref([]);
  729. const handleCompleteNext = () => {
  730. showCompletePopup.value = false;
  731. // 如果数组为空,说明已经全部完成
  732. if (!ids.value || ids.value.length === 0) {
  733. allDone.value = true;
  734. return;
  735. }
  736. // 找到当前 farmWorkId 在数组中的索引
  737. const currentFarmWorkId = route.query.farmWorkId;
  738. const currentIndex = ids.value.findIndex(item => String(item.farmWorkId) === String(currentFarmWorkId));
  739. if (currentIndex === -1) {
  740. // 如果找不到当前项,说明可能已经被删除或不存在
  741. allDone.value = true;
  742. console.log('未找到当前farmWorkId');
  743. return;
  744. }
  745. // 如果数组只剩一个(最后一个),标记为全部完成
  746. if (ids.value.length === 1) {
  747. // 从数组中删除当前项(已经完成的)
  748. ids.value.splice(currentIndex, 1);
  749. // 更新 sessionStorage
  750. sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
  751. allDone.value = true;
  752. return;
  753. }
  754. // 判断是否是最后一个
  755. const isLast = currentIndex === ids.value.length - 1;
  756. // 如果是最后一个,标记为全部完成
  757. if (isLast) {
  758. // 从数组中删除当前项(已经完成的)
  759. ids.value.splice(currentIndex, 1);
  760. // 更新 sessionStorage
  761. sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
  762. allDone.value = true;
  763. return;
  764. }
  765. // 获取下一个农事:取当前索引+1位置的值
  766. const nextItem = ids.value[currentIndex + 1];
  767. if (nextItem && nextItem.farmWorkId && nextItem.arrangeId) {
  768. // 从数组中删除当前项(已经完成的)
  769. ids.value.splice(currentIndex, 1);
  770. // 更新 sessionStorage
  771. sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
  772. router.replace({
  773. path: "/modify",
  774. query: {
  775. id: nextItem.arrangeId,
  776. farmWorkId: nextItem.farmWorkId,
  777. farmId: route.query.farmId,
  778. containerSpaceTimeId: route.query.containerSpaceTimeId,
  779. schemeId: route.query.schemeId,
  780. enabled: 0,
  781. isEdit: true,
  782. onlyPrice: false,
  783. noPrice: true,
  784. isDefault: false,
  785. },
  786. });
  787. setTimeout(() => {
  788. window.location.reload();
  789. }, 500);
  790. } else {
  791. // 从数组中删除当前项(已经完成的)
  792. ids.value.splice(currentIndex, 1);
  793. // 更新 sessionStorage
  794. sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
  795. allDone.value = true;
  796. console.log('没有下一个农事需要完善');
  797. }
  798. };
  799. const resetForm = (formEl) => {
  800. if (!formEl) return;
  801. formEl.resetFields();
  802. };
  803. // 清空所有数据
  804. const clearData = () => {
  805. // 清空表单
  806. resetForm(formRef.value);
  807. // 清空详情数据
  808. detailData.value = {};
  809. // 清空表单数据
  810. dynamicValidateForm.farmWorkName = "";
  811. dynamicValidateForm.conditionRate = "";
  812. dynamicValidateForm.purpose = "";
  813. dynamicValidateForm.executeDate = dayjs().format("YYYY-MM-DD");
  814. dynamicValidateForm.prescription = {
  815. id: "",
  816. usageMode: "",
  817. farmWorkLibCode: "",
  818. expertId: "",
  819. phenology: "",
  820. soil: "",
  821. speed: null,
  822. pesticideFertilizerList: [
  823. {
  824. code: "",
  825. name: "",
  826. dosage: "",
  827. ratio: "",
  828. typeName: "",
  829. muPrice: 0,
  830. executeStyle: 1,
  831. unit: "",
  832. },
  833. ],
  834. };
  835. };
  836. onDeactivated(() => {
  837. clearData();
  838. });
  839. onBeforeUnmount(() => {
  840. clearData();
  841. });
  842. const cancelEdit = () => {
  843. ElMessageBox.confirm("确认要取消编辑吗?", "提示", {
  844. confirmButtonText: "确认",
  845. cancelButtonText: "取消",
  846. type: "warning",
  847. })
  848. .then(() => {
  849. isEdit.value = false;
  850. nextTick(() => {
  851. if (pageRef.value) {
  852. pageRef.value.scrollTop = 0;
  853. } else {
  854. window.scrollTo(0, 0);
  855. }
  856. });
  857. })
  858. .catch(() => {
  859. console.log("取消编辑");
  860. });
  861. };
  862. const modeList = ref([
  863. { name: "无人机", value: 1 },
  864. { name: "人工", value: 2 },
  865. ]);
  866. const handleExecutionMethodChange = (index, val) => {
  867. // if (val == 1) {
  868. // servicePricePerMu.value = detailData.value.uavServicePrice;
  869. // } else {
  870. // servicePricePerMu.value = detailData.value.manualServicePrice;
  871. // }
  872. };
  873. // 表单
  874. const formRef = ref();
  875. const dynamicValidateForm = reactive({
  876. farmWorkName: "",
  877. conditionRate: "",
  878. purpose: "",
  879. executeDate: dayjs().format("YYYY-MM-DD"),
  880. usageMode: "",
  881. executeStyle: 2,
  882. executionMethod: 2,
  883. prescription: {
  884. id: "",
  885. usageMode: "",
  886. farmWorkLibCode: "",
  887. expertId: "",
  888. phenology: "",
  889. soil: "",
  890. speed: null,
  891. pesticideFertilizerList: [
  892. {
  893. code: "",
  894. id: "",
  895. name: "",
  896. dosage: "",
  897. ratio: "",
  898. brand: "",
  899. price: "",
  900. typeName: "",
  901. muPrice: 0,
  902. executeStyle: 1,
  903. unit: "",
  904. },
  905. ],
  906. },
  907. });
  908. const rules = {
  909. farmWorkName: [
  910. {
  911. required: true,
  912. message: "请输入农事名称",
  913. trigger: "blur",
  914. },
  915. ],
  916. conditionRate: [
  917. {
  918. required: false,
  919. message: "请输入触发条件",
  920. trigger: "blur",
  921. },
  922. ],
  923. executeDate: [
  924. {
  925. required: false,
  926. message: "请选择执行时间",
  927. trigger: "blur",
  928. },
  929. ],
  930. };
  931. const addDomain = () => {
  932. if (!dynamicValidateForm.prescription.pesticideFertilizerList) {
  933. dynamicValidateForm.prescription.pesticideFertilizerList = [];
  934. }
  935. dynamicValidateForm.prescription.pesticideFertilizerList.unshift({
  936. code: "",
  937. name: "",
  938. dosage: "",
  939. ratio: "",
  940. brand: "",
  941. price: "",
  942. typeName: "",
  943. muPrice: 0,
  944. id: "",
  945. executeStyle: 2,
  946. unit: "",
  947. });
  948. };
  949. let pesticideFertilizersOptions = ref([]);
  950. VE_API.z_farm_work_order.pesticideFertilizersList().then(({ data }) => {
  951. pesticideFertilizersOptions.value = data;
  952. });
  953. const allUsageModeList = ["叶面施", "根部施", "人工农事"];
  954. /**
  955. * 选择药肥的时候修改订单中药肥pesticideFertilizerId 以外其他数据
  956. * @param index
  957. */
  958. const handlePesticideFertilizerChange = (index) => {
  959. const currentItem = dynamicValidateForm.prescription.pesticideFertilizerList[index];
  960. let obj = pesticideFertilizersOptions.value.filter(
  961. (item) => currentItem.code === item.pesticideFertilizerCode
  962. )[0];
  963. if (obj) {
  964. dynamicValidateForm.prescription.pesticideFertilizerList[index] = {
  965. ...currentItem,
  966. code: obj.pesticideFertilizerCode,
  967. id: obj.id,
  968. name: obj.name || obj.defaultName,
  969. typeName: obj.typeName,
  970. unit: obj.unit,
  971. ratio: "", // 清空亩兑水量
  972. dosage: "", // 清空单亩用量
  973. executeStyle: obj.executionMethod || 1,
  974. };
  975. }
  976. };
  977. const removeDomain = (index) => {
  978. if (index !== -1 && dynamicValidateForm.prescription.pesticideFertilizerList) {
  979. dynamicValidateForm.prescription.pesticideFertilizerList.splice(index, 1);
  980. }
  981. };
  982. const resetItemForm = (index) => {
  983. if (dynamicValidateForm.prescription.pesticideFertilizerList) {
  984. dynamicValidateForm.prescription.pesticideFertilizerList[index] = {
  985. code: "",
  986. id: "",
  987. name: "",
  988. dosage: "",
  989. ratio: "",
  990. brand: "",
  991. price: "",
  992. typeName: "",
  993. muPrice: 0,
  994. executeStyle: 1,
  995. unit: "",
  996. };
  997. }
  998. };
  999. const servicePricePerMu = ref(null);
  1000. // 服务费用总计(数值):亩单价 * 亩数
  1001. const serviceCostTotal = computed(() => {
  1002. const price = Number(servicePricePerMu.value || 0);
  1003. const area = Number(detailData.value?.farm?.mianji || detailData.value?.area || 0);
  1004. if (!price || !area) return 0;
  1005. return Number((price * area).toFixed(2));
  1006. });
  1007. // 显示用的服务费用(字符串或 "--")
  1008. const getServiceTotal = () => {
  1009. const total = serviceCostTotal.value;
  1010. return total ? total.toFixed(2) : "--";
  1011. };
  1012. // 药肥费用总计:∑(单价 * 单亩用量 * 亩数)
  1013. const pesticideCostTotal = computed(() => {
  1014. const list = dynamicValidateForm.prescription?.pesticideFertilizerList || [];
  1015. const area = Number(detailData.value?.farm?.mianji || detailData.value?.area || 0);
  1016. if (!list.length || !area) return 0;
  1017. const sum = list.reduce((acc, item) => {
  1018. const price = Number(item?.price || 0);
  1019. const dosage = Number(item?.dosage || 0);
  1020. if (!price || !dosage) return acc;
  1021. return acc + price * dosage * area;
  1022. }, 0);
  1023. return Number(sum.toFixed(2));
  1024. });
  1025. // 报价合计 = 药肥费用 + 服务费用
  1026. const totalCost = computed(() => {
  1027. const pesticide = Number(pesticideCostTotal.value || 0);
  1028. const service = Number(serviceCostTotal.value || 0);
  1029. if (!pesticide && !service) return '--';
  1030. return Number((pesticide + service).toFixed(2));
  1031. });
  1032. const submitForm = (formEl) => {
  1033. if (!formEl) return;
  1034. formEl.validate(async (valid) => {
  1035. if (valid) {
  1036. // 校验标记是否已选择
  1037. if (!validateTagName()) return;
  1038. // 校验农情互动,不通过,直接返回失败
  1039. if (!onlyPrice.value && !validateInteractForm()) return false;
  1040. // 校验药肥的亩兑水量和单亩用量是否填写
  1041. if (!validatePesticideDosage()) return;
  1042. // 保存报价信息前先校验是否填写完整
  1043. if (!validatePriceInfos()) return;
  1044. // 检验服务报价是否填写
  1045. if (!validateServicePrice()) return;
  1046. submit();
  1047. } else {
  1048. console.log("error submit!");
  1049. }
  1050. });
  1051. };
  1052. // 校验标记是否已选择
  1053. const validateTagName = () => {
  1054. if (tagName.value !== 1 && tagName.value !== 2) {
  1055. ElMessage.warning("请选择标记类型");
  1056. return false;
  1057. }
  1058. return true;
  1059. };
  1060. // 检验服务报价是否填写
  1061. const validateServicePrice = () => {
  1062. if (!servicePricePerMu.value) {
  1063. ElMessage.warning("请完善服务报价信息");
  1064. return false;
  1065. }
  1066. return true;
  1067. };
  1068. // 校验药肥的亩兑水量和单亩用量是否填写
  1069. const validatePesticideDosage = () => {
  1070. const list = dynamicValidateForm.prescription?.pesticideFertilizerList || [];
  1071. if (!list.length) return true; // 没有药肥就不校验
  1072. // 找到第一个未填写完整的药肥
  1073. for (let i = 0; i < list.length; i++) {
  1074. const item = list[i];
  1075. // 如果选择了药肥(有 code),就必须填写亩兑水量和单亩用量
  1076. if (item.code) {
  1077. const hasRatio = item.ratio !== undefined && item.ratio !== null && item.ratio !== "";
  1078. const hasDosage = item.dosage !== undefined && item.dosage !== null && item.dosage !== "";
  1079. if (!hasRatio || !hasDosage) {
  1080. ElMessage.warning("请完善药物处方信息");
  1081. return false;
  1082. }
  1083. }
  1084. }
  1085. return true;
  1086. };
  1087. // 校验报价信息是否填写完整
  1088. const validatePriceInfos = () => {
  1089. const list = dynamicValidateForm.prescription?.pesticideFertilizerList || [];
  1090. if (!list.length) return true; // 没有药肥就不校验
  1091. // 找到第一个未填写完整的药肥
  1092. const invalidIndex = list.findIndex((item) => {
  1093. // 只要选择了药肥(有 id),就必须填写单价和品牌
  1094. if (!item.id) return false; // 没选择药肥不校验
  1095. const hasPrice = item.price !== undefined && item.price !== null && item.price !== "";
  1096. const hasBrand = !!item.brand;
  1097. return !hasPrice || !hasBrand;
  1098. });
  1099. if (invalidIndex !== -1) {
  1100. ElMessage.warning("请先完善报价信息");
  1101. return false;
  1102. }
  1103. return true;
  1104. };
  1105. const submit = () => {
  1106. const data = {
  1107. id: route.query.farmWorkId,
  1108. ...dynamicValidateForm,
  1109. serviceMuPrice: servicePricePerMu.value,
  1110. prescription: dynamicValidateForm.prescription
  1111. };
  1112. VE_API.monitor.saveFarmWorkLib(data);
  1113. if (!onlyPrice.value) {
  1114. handleSaveInteract();
  1115. }
  1116. // 保存报价信息
  1117. const priceList = {
  1118. schemeId: detailData.value.schemeId,
  1119. pesticideFertilizerInfos: dynamicValidateForm.prescription.pesticideFertilizerList.map(item => {
  1120. return {
  1121. pesticideFertilizerId: item.id,
  1122. price: item.price,
  1123. brand: item.brand,
  1124. }
  1125. }),
  1126. }
  1127. VE_API.farm.updateBatchByScheme(priceList).then(async (res) => {
  1128. if (res.code === 0) {
  1129. await getDetail();
  1130. if (isDoingComplete.value) {
  1131. // 更新 sessionStorage(不删除当前项,保持数组完整)
  1132. sessionStorage.setItem("farmWorkAndArrangeIds", JSON.stringify(ids.value));
  1133. showCompletePopup.value = true;
  1134. return;
  1135. }
  1136. ElMessage.success("保存成功");
  1137. if (onlyPrice.value) {
  1138. // router.push(`/task_condition?noReload=true`);
  1139. router.back();
  1140. return;
  1141. }
  1142. isEdit.value = false;
  1143. nextTick(() => {
  1144. if (pageRef.value) {
  1145. pageRef.value.scrollTop = 0;
  1146. } else {
  1147. window.scrollTo(0, 0);
  1148. }
  1149. });
  1150. } else {
  1151. // 不需要处方报价信息的农事
  1152. if (priceList.pesticideFertilizerInfos.length === 0) {
  1153. if (onlyPrice.value) {
  1154. // router.push(`/task_condition?noReload=true`);
  1155. router.back();
  1156. return;
  1157. }
  1158. isEdit.value = false;
  1159. getDetail();
  1160. nextTick(() => {
  1161. if (pageRef.value) {
  1162. pageRef.value.scrollTop = 0;
  1163. } else {
  1164. window.scrollTo(0, 0);
  1165. }
  1166. });
  1167. }
  1168. }
  1169. }).catch(() => {
  1170. });
  1171. // 切换标记
  1172. VE_API.container_farm_work_arrange.toggleFollow({ id: route.query.id, isFollow: tagName.value });
  1173. };
  1174. const handleSaveInteractSuccess = () => {
  1175. getDetail();
  1176. };
  1177. const interactPopupRef = ref(null);
  1178. const handleEditInteract = (item) => {
  1179. if (interactPopupRef.value) {
  1180. interactPopupRef.value.showPopup({...item, containerSpaceTimeId: route.query.containerSpaceTimeId,id:route.query.id});
  1181. }
  1182. };
  1183. // 获取物候期列表
  1184. const getPhenologyList = async (containerSpaceTimeId) => {
  1185. if (!containerSpaceTimeId) {
  1186. phenologyList.value = [];
  1187. return;
  1188. }
  1189. const res = await VE_API.monitor.listPhenology({ containerSpaceTimeId });
  1190. if (res.code === 0) {
  1191. phenologyList.value = res.data || [];
  1192. }
  1193. };
  1194. // 获取互动设置详情
  1195. const getFarmWorkArrangeDetail = async (id) => {
  1196. if (!id) return;
  1197. const { data, code } = await VE_API.farm.getFarmWorkArrangeDetail({ id });
  1198. if(code === 0) {
  1199. tagName.value = data.isFollow === 0 ? null : data.isFollow;
  1200. await handlePhenologyChange(data.phenologyId);
  1201. interactFormData.value = {
  1202. phenologyId: data.phenologyId || "",
  1203. reproductiveId: data.reproductiveId || "",
  1204. interactionTime: data.interactionTime || "",
  1205. interactionQuestion: data.interactionQuestion || "",
  1206. };
  1207. }
  1208. };
  1209. // 格式化日期
  1210. const formatInteractDate = (date) => {
  1211. // 如果已经是字符串格式 YYYY-MM-DD,直接返回
  1212. if (typeof date === "string" && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
  1213. return date;
  1214. }
  1215. // 如果是 Date 对象,进行转换
  1216. if (date instanceof Date) {
  1217. let year = date.getFullYear();
  1218. let month = String(date.getMonth() + 1).padStart(2, "0");
  1219. let day = String(date.getDate()).padStart(2, "0");
  1220. return `${year}-${month}-${day}`;
  1221. }
  1222. // 其他情况返回原值
  1223. return date;
  1224. };
  1225. // 验证互动表单
  1226. const validateInteractForm = () => {
  1227. if (!interactFormData.value.phenologyId) {
  1228. ElMessage.warning("请选择互动阶段");
  1229. return false;
  1230. }
  1231. if (!interactFormData.value.reproductiveId) {
  1232. ElMessage.warning("请选择互动阶段");
  1233. return false;
  1234. }
  1235. if (!interactFormData.value.interactionTime) {
  1236. ElMessage.warning("请选择互动时间");
  1237. return false;
  1238. }
  1239. if (!interactFormData.value.interactionQuestion?.trim()) {
  1240. ElMessage.warning("请设置互动问题");
  1241. return false;
  1242. }
  1243. return true;
  1244. };
  1245. // 保存互动设置
  1246. const handleSaveInteract = async () => {
  1247. const paramsObj = {
  1248. id: route.query.id,
  1249. ...interactFormData.value,
  1250. interactionTime: formatInteractDate(interactFormData.value.interactionTime),
  1251. };
  1252. try {
  1253. const res = await VE_API.monitor.updateFarmWorkArrange(paramsObj);
  1254. if (res.code !== 0) {
  1255. ElMessage.error(res.message || "保存农情互动信息失败");
  1256. return false;
  1257. }
  1258. return true;
  1259. } catch (error) {
  1260. console.error("保存互动设置失败:", error);
  1261. ElMessage.error("保存失败,请重试");
  1262. return false;
  1263. }
  1264. };
  1265. // 删除互动设置
  1266. const handleDeleteInteract = () => {
  1267. ElMessageBox.confirm("确定要删除该互动设置吗?", "提示", {
  1268. confirmButtonText: "确定",
  1269. cancelButtonText: "取消",
  1270. type: "warning",
  1271. })
  1272. .then(async () => {
  1273. if (!detailData.value.id) return;
  1274. const res = await VE_API.monitor.deleteFarmWorkArrange({ id: detailData.value.id });
  1275. if (res.code === 0) {
  1276. ElMessage.success("删除成功");
  1277. // 清空表单数据
  1278. interactFormData.value = {
  1279. phenologyId: "",
  1280. interactionTime: "",
  1281. interactionQuestion: "",
  1282. };
  1283. await getDetail(); // 重新获取详情
  1284. } else {
  1285. ElMessage.error(res.message || "删除失败");
  1286. }
  1287. })
  1288. .catch(() => {
  1289. // 用户取消,不做任何操作
  1290. });
  1291. };
  1292. </script>
  1293. <style lang="scss" scoped>
  1294. .new-farming-page {
  1295. height: 100vh;
  1296. position: relative;
  1297. overflow: auto;
  1298. font-size: 14px;
  1299. background: #f2f3f5;
  1300. ::v-deep {
  1301. .custom-header {
  1302. position: fixed;
  1303. top: 0;
  1304. padding-bottom: 1px;
  1305. }
  1306. }
  1307. .step-wrap {
  1308. padding: 12px 0;
  1309. }
  1310. .box-wrap {
  1311. background: #fff;
  1312. padding: 20px 10px 10px;
  1313. border-radius: 6px;
  1314. }
  1315. .new-farming-content {
  1316. margin: 41px 0 62px 0;
  1317. padding: 4px 12px 8px 12px;
  1318. width: 100%;
  1319. box-sizing: border-box;
  1320. &.no-permission{
  1321. margin-bottom: 12px;
  1322. }
  1323. // ::v-deep {
  1324. // .el-select__input {
  1325. // color: #2199F8;
  1326. // }
  1327. // .el-select__wrapper {
  1328. // color: #2199F8;
  1329. // min-height: 30px;
  1330. // line-height: 28px;
  1331. // box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
  1332. // }
  1333. // .el-select__caret {
  1334. // color: #2199F8;
  1335. // }
  1336. // .el-select__placeholder {
  1337. // color: #2199F8;
  1338. // }
  1339. // .el-radio {
  1340. // margin-right: 16px;
  1341. // }
  1342. // .el-input__wrapper {
  1343. // box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
  1344. // }
  1345. // .el-input__prefix {
  1346. // color: #2199F8;
  1347. // }
  1348. // .el-input__inner {
  1349. // color: #2199F8;
  1350. // --el-input-placeholder-color: rgba(33, 153, 248, 0.43);
  1351. // }
  1352. // .el-tag.el-tag--info {
  1353. // --el-tag-text-color: #2199F8;
  1354. // --el-tag-bg-color: rgba(33, 153, 248, 0.1);
  1355. // }
  1356. // }
  1357. .farm-info {
  1358. color: rgba(0, 0, 0, 0.6);
  1359. font-size: 14px;
  1360. margin-top: 14px;
  1361. .info-title {
  1362. display: flex;
  1363. align-items: center;
  1364. justify-content: space-between;
  1365. color: rgba(41, 41, 41, 0.3);
  1366. .info-more {
  1367. display: flex;
  1368. align-items: center;
  1369. }
  1370. }
  1371. }
  1372. .farm-photo {
  1373. margin-top: 10px;
  1374. .photo-list {
  1375. display: flex;
  1376. align-items: center;
  1377. width: 100%;
  1378. overflow: auto;
  1379. padding-bottom: 10px;
  1380. .photo-item {
  1381. width: 92px;
  1382. height: 92px;
  1383. border-radius: 8px;
  1384. object-fit: cover;
  1385. }
  1386. .img-item {
  1387. img {
  1388. width: 92px;
  1389. height: 92px;
  1390. border-radius: 8px;
  1391. object-fit: cover;
  1392. margin-right: 12px;
  1393. }
  1394. }
  1395. }
  1396. .list-text {
  1397. text-align: center;
  1398. color: rgba(0, 0, 0, 0.5);
  1399. padding-top: 2px;
  1400. }
  1401. }
  1402. .submit-btn {
  1403. z-index: 10;
  1404. position: fixed;
  1405. bottom: 0px;
  1406. left: 0;
  1407. width: 100%;
  1408. display: flex;
  1409. align-items: center;
  1410. justify-content: space-between;
  1411. padding: 12px;
  1412. background: #fff;
  1413. box-sizing: border-box;
  1414. box-shadow: 0 4px 4px rgba(0, 0, 0, 0.4);
  1415. border-top: 1px solid rgba(0, 0, 0, 0.1);
  1416. &.center-btn {
  1417. justify-content: center;
  1418. }
  1419. .btn {
  1420. height: 40px;
  1421. border-radius: 25px;
  1422. line-height: 40px;
  1423. width: 110px;
  1424. text-align: center;
  1425. background: linear-gradient(180deg, #70bffe, #2199f8);
  1426. color: #ffffff;
  1427. font-size: 14px;
  1428. &.second {
  1429. background: #ffffff;
  1430. border: 1px solid rgba(153, 153, 153, 0.5);
  1431. color: #666666;
  1432. }
  1433. }
  1434. .btn + .btn {
  1435. margin-left: 12px;
  1436. }
  1437. }
  1438. }
  1439. .card-title {
  1440. font-size: 16px;
  1441. font-weight: bold;
  1442. color: #000;
  1443. display: flex;
  1444. align-items: center;
  1445. &.between {
  1446. justify-content: space-between;
  1447. .del-tag {
  1448. color: #e04c4c;
  1449. border: 1px solid #e04c4c;
  1450. border-radius: 5px;
  1451. padding: 4px 14px;
  1452. font-size: 12px;
  1453. font-weight: normal;
  1454. }
  1455. .title-tag {
  1456. padding: 2px 10px;
  1457. height: 26px;
  1458. line-height: 26px;
  1459. }
  1460. }
  1461. // justify-content: space-between;
  1462. .add-tag {
  1463. font-size: 12px;
  1464. color: #2199f8;
  1465. padding: 0px 11px;
  1466. border: 1px solid #2199F8;
  1467. border-radius: 5px;
  1468. font-weight: normal;
  1469. height: 28px;
  1470. line-height: 28px;
  1471. }
  1472. .type-tag {
  1473. margin-left: 5px;
  1474. font-size: 12px;
  1475. color: #000000;
  1476. padding: 0 10px;
  1477. background: rgba(119, 119, 119, 0.1);
  1478. border-radius: 20px;
  1479. font-weight: normal;
  1480. height: 26px;
  1481. line-height: 26px;
  1482. display: inline-block;
  1483. }
  1484. }
  1485. .pb-12 {
  1486. padding-bottom: 12px;
  1487. }
  1488. .farm-card {
  1489. background: #ffffff;
  1490. border-radius: 8px;
  1491. padding: 12px 12px 0 12px;
  1492. width: 100%;
  1493. box-sizing: border-box;
  1494. margin-top: 10px;
  1495. color: rgba(0, 0, 0, 0.4);
  1496. &.progress {
  1497. display: flex;
  1498. align-items: center;
  1499. padding: 12px;
  1500. .progress-title {
  1501. margin-right: 12px;
  1502. }
  1503. ::v-deep {
  1504. .el-radio {
  1505. margin-right: 10px;
  1506. }
  1507. }
  1508. }
  1509. &.map-content {
  1510. margin-top: 12px;
  1511. }
  1512. &.prescription-content {
  1513. padding: 12px;
  1514. }
  1515. .border-bottom {
  1516. padding-bottom: 7px;
  1517. border-bottom: 1px solid rgba(245, 245, 245, 0.99);
  1518. }
  1519. }
  1520. .table-item {
  1521. padding: 6px 0 10px 0;
  1522. .form-item {
  1523. display: flex;
  1524. align-items: center;
  1525. font-size: 14px;
  1526. color: #767676;
  1527. height: 24px;
  1528. .item-name {
  1529. width: 80px;
  1530. color: rgba(0, 0, 0, 0.2);
  1531. }
  1532. }
  1533. }
  1534. .new-wrap {
  1535. border-radius: 5px;
  1536. text-align: center;
  1537. border: 1px solid rgba(225, 225, 225, 0.5);
  1538. .new-title {
  1539. background: rgba(241, 241, 241, 0.4);
  1540. border-radius: 5px 5px 0 0;
  1541. border-bottom: 1px solid rgba(225, 225, 225, 0.5);
  1542. display: flex;
  1543. color: #767676;
  1544. // justify-content: space-around;
  1545. padding: 3px 0px;
  1546. font-size: 12px;
  1547. .table-name {
  1548. width: 24px;
  1549. font-size: 12px;
  1550. margin: 0 auto;
  1551. }
  1552. }
  1553. .title-1 {
  1554. width: 46px;
  1555. }
  1556. .title-2 {
  1557. flex: 1;
  1558. }
  1559. .title-3 {
  1560. width: 52px;
  1561. }
  1562. .title-4 {
  1563. width: 56px;
  1564. }
  1565. .title-5 {
  1566. width: 52px;
  1567. }
  1568. .new-table-wrap {
  1569. padding: 5px 0;
  1570. .new-prescription + .new-prescription {
  1571. border-top: 1px solid rgba(225, 225, 225, 0.8);
  1572. }
  1573. // .new-prescription {
  1574. .new-table {
  1575. display: flex;
  1576. align-items: center;
  1577. // border: 1px solid rgba(225, 225, 225, 0.8);
  1578. background: #fff;
  1579. border-radius: 5px;
  1580. color: rgba(0, 0, 0, 0.6);
  1581. font-size: 11px;
  1582. .line-l {
  1583. display: flex;
  1584. flex: 1;
  1585. .line-2 {
  1586. flex: 1;
  1587. padding: 0 2px;
  1588. }
  1589. }
  1590. .line-r {
  1591. &.has-border {
  1592. border-left: 1px solid rgba(225, 225, 225, 0.8);
  1593. }
  1594. .line-3 {
  1595. display: flex;
  1596. align-items: center;
  1597. }
  1598. .sub-line {
  1599. padding: 10px 0;
  1600. }
  1601. .line-4 {
  1602. display: flex;
  1603. align-items: center;
  1604. border-top: 1px solid rgba(225, 225, 225, 0.8);
  1605. }
  1606. .execute-line {
  1607. border-right: 1px solid rgba(225, 225, 225, 0.8);
  1608. }
  1609. }
  1610. }
  1611. .note-text {
  1612. margin: 8px 0 4px 0;
  1613. color: rgba(0, 0, 0, 0.4);
  1614. background: #fff;
  1615. padding: 6px 8px;
  1616. border-radius: 5px;
  1617. text-align: left;
  1618. font-size: 11px;
  1619. }
  1620. // }
  1621. // .new-prescription + .new-prescription {
  1622. // padding-top: 8px;
  1623. // }
  1624. }
  1625. }
  1626. .info-content-wrap {
  1627. ::v-deep {
  1628. .new-table-wrap {
  1629. padding: 5px 0;
  1630. .new-prescription + .new-prescription {
  1631. border-top: 1px solid rgba(225, 225, 225, 0.8);
  1632. }
  1633. }
  1634. }
  1635. }
  1636. .price-bottom {
  1637. padding-top: 8px;
  1638. .info-title-wrap {
  1639. display: flex;
  1640. align-items: center;
  1641. justify-content: space-between;
  1642. color: #000;
  1643. .info-more {
  1644. font-size: 18px;
  1645. }
  1646. .unit-text {
  1647. font-size: 12px;
  1648. }
  1649. }
  1650. .price-info {
  1651. padding: 8px 0;
  1652. display: flex;
  1653. align-items: center;
  1654. justify-content: space-between;
  1655. color: rgba(0, 0, 0, 0.2);
  1656. .main-text {
  1657. padding-left: 20px;
  1658. color: rgba(0, 0, 0, 0.8);
  1659. }
  1660. .info-c {
  1661. flex: 1;
  1662. text-align: center;
  1663. }
  1664. }
  1665. .price-total {
  1666. height: 38px;
  1667. display: flex;
  1668. align-items: center;
  1669. justify-content: center;
  1670. border: 1px solid rgba(33, 153, 248, 0.5);
  1671. background: rgba(33, 153, 248, 0.1);
  1672. color: #000000;
  1673. border-radius: 4px;
  1674. .main-val {
  1675. font-size: 20px;
  1676. font-weight: bold;
  1677. color: #2199f8;
  1678. padding-right: 2px;
  1679. }
  1680. }
  1681. }
  1682. .pt-8 {
  1683. padding-top: 8px;
  1684. }
  1685. .pb-8 {
  1686. padding-bottom: 8px;
  1687. }
  1688. .common-inputs {
  1689. ::v-deep {
  1690. .el-input__wrapper {
  1691. box-shadow: none;
  1692. }
  1693. .el-input-group__append {
  1694. padding: 0 10px;
  1695. background: none;
  1696. box-shadow: none;
  1697. }
  1698. .el-input-group__append {
  1699. color: rgba(33, 153, 248, 0.5);
  1700. }
  1701. .el-input {
  1702. border: 1px solid rgba(33, 153, 248, 0.3);
  1703. border-radius: 5px;
  1704. height: 30px;
  1705. box-sizing: border-box;
  1706. }
  1707. .el-input__wrapper {
  1708. padding: 0 2px 0 10px;
  1709. height: 28px;
  1710. line-height: 28px;
  1711. min-height: 28px;
  1712. }
  1713. .el-input__inner {
  1714. --el-input-inner-height: 28px;
  1715. height: 28px;
  1716. line-height: 28px;
  1717. min-height: 28px;
  1718. color: #2199f8;
  1719. --el-input-placeholder-color: rgba(33, 153, 248, 0.43);
  1720. }
  1721. .el-select__wrapper {
  1722. box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
  1723. }
  1724. .el-select__placeholder,
  1725. .el-select__caret {
  1726. color: #2199f8;
  1727. }
  1728. }
  1729. }
  1730. .medicine-item {
  1731. display: flex;
  1732. align-items: center;
  1733. justify-content: space-between;
  1734. height: 32px;
  1735. .item-name {
  1736. color: rgba(0, 0, 0, 0.4);
  1737. }
  1738. .item-val {
  1739. min-width: 142px;
  1740. text-align: center;
  1741. color: #302f2f;
  1742. display: flex;
  1743. align-items: center;
  1744. justify-content: center;
  1745. gap: 4px;
  1746. .price-unit {
  1747. font-size: 12px;
  1748. color: rgba(0, 0, 0, 0.4);
  1749. white-space: nowrap;
  1750. }
  1751. }
  1752. .item-total {
  1753. font-size: 16px;
  1754. color: #000;
  1755. }
  1756. .item-price {
  1757. color: #2199f8;
  1758. font-size: 20px;
  1759. font-weight: bold;
  1760. .item-unit {
  1761. font-size: 14px;
  1762. font-weight: normal;
  1763. padding-left: 2px;
  1764. color: #474747;
  1765. }
  1766. }
  1767. }
  1768. .medicine-box {
  1769. // padding-top: 10px;
  1770. border: 1px solid rgba(33, 153, 248, 0.8);
  1771. position: relative;
  1772. border-radius: 6px;
  1773. .item-title {
  1774. padding-left: 5px;
  1775. font-size: 16px;
  1776. color: #000000;
  1777. font-weight: 500;
  1778. padding-bottom: 10px;
  1779. }
  1780. .medicine-item + .medicine-item {
  1781. padding-top: 2px;
  1782. }
  1783. .mt-8 {
  1784. margin-top: 8px;
  1785. }
  1786. }
  1787. .usage-mode-wrap {
  1788. padding: 0 12px;
  1789. margin-top: 12px;
  1790. .info-content {
  1791. padding-top: 14px;
  1792. padding-bottom: 1px;
  1793. }
  1794. .el-form-item--default {
  1795. margin-bottom: 0;
  1796. }
  1797. }
  1798. ::v-deep {
  1799. .el-form-item__label {
  1800. height: 30px;
  1801. line-height: 30px;
  1802. color: rgba(0, 0, 0, 0.4);
  1803. }
  1804. .el-form-item.is-required:not(.is-no-asterisk).asterisk-left > .el-form-item__label:before {
  1805. display: none;
  1806. }
  1807. }
  1808. .interact-content {
  1809. padding: 10px 0;
  1810. line-height: 20px;
  1811. color: #919191;
  1812. font-size: 14px;
  1813. }
  1814. .interact-form {
  1815. padding: 8px 0 20px 0px;
  1816. .interact-form-item {
  1817. display: flex;
  1818. align-items: baseline;
  1819. margin-bottom: 12px;
  1820. &:last-child {
  1821. margin-bottom: 0;
  1822. }
  1823. .form-label {
  1824. width: 70px;
  1825. color: rgba(0, 0, 0, 0.4);
  1826. font-weight: normal;
  1827. margin-right: 10px;
  1828. font-size: 14px;
  1829. flex: none;
  1830. }
  1831. .form-input-wrapper {
  1832. position: relative;
  1833. width: calc(100% - 70px);
  1834. &.two-select {
  1835. display: flex;
  1836. gap: 10px;
  1837. .select-item {
  1838. flex: 1;
  1839. }
  1840. }
  1841. ::v-deep {
  1842. .el-input__inner {
  1843. caret-color: transparent;
  1844. padding-right: 40px;
  1845. }
  1846. .el-input__suffix {
  1847. display: none;
  1848. }
  1849. }
  1850. }
  1851. .question-textarea {
  1852. ::v-deep {
  1853. .el-textarea__inner {
  1854. resize: none;
  1855. line-height: 1.5;
  1856. min-height: 80px;
  1857. }
  1858. }
  1859. }
  1860. }
  1861. .interact-buttons {
  1862. display: flex;
  1863. gap: 12px;
  1864. padding-top: 16px;
  1865. .btn-delete,
  1866. .btn-save {
  1867. flex: 1;
  1868. padding: 8px;
  1869. border-radius: 25px;
  1870. font-size: 16px;
  1871. text-align: center;
  1872. cursor: pointer;
  1873. transition: all 0.3s;
  1874. user-select: none;
  1875. }
  1876. .btn-delete {
  1877. background: #ffffff;
  1878. border: 1px solid #ff4d4f;
  1879. color: #ff4d4f;
  1880. &:hover {
  1881. background: #fff5f5;
  1882. }
  1883. &:active {
  1884. opacity: 0.8;
  1885. transform: scale(0.98);
  1886. }
  1887. }
  1888. .btn-save {
  1889. background: #2199f8;
  1890. color: #fff;
  1891. border: none;
  1892. &:hover:not(.disabled) {
  1893. background: #1a8ae6;
  1894. }
  1895. &:active:not(.disabled) {
  1896. opacity: 0.9;
  1897. transform: scale(0.98);
  1898. }
  1899. &.disabled {
  1900. opacity: 0.6;
  1901. cursor: not-allowed;
  1902. pointer-events: none;
  1903. }
  1904. }
  1905. }
  1906. }
  1907. .edit-tag {
  1908. padding-left: 4px;
  1909. color: #2199f8;
  1910. }
  1911. .tag-text {
  1912. font-size: 12px;
  1913. font-weight: normal;
  1914. }
  1915. .info-content {
  1916. padding: 10px 0;
  1917. position: relative;
  1918. .condition-wrap {
  1919. display: flex;
  1920. align-items: center;
  1921. width: 100%;
  1922. .symbol {
  1923. width: 10px;
  1924. // text-align: center;
  1925. // padding: 0 4px;
  1926. }
  1927. }
  1928. .item-input {
  1929. // width: 60%;
  1930. min-width: 140px;
  1931. max-width: 240px;
  1932. }
  1933. .recheck-text {
  1934. padding-left: 6px;
  1935. }
  1936. .info-item {
  1937. display: flex;
  1938. justify-content: space-between;
  1939. align-items: center;
  1940. width: 100%;
  1941. }
  1942. .info-item + .info-item {
  1943. margin-top: 12px;
  1944. }
  1945. .bottom-map {
  1946. width: 100%;
  1947. height: 250px;
  1948. clip-path: inset(0px round 8px);
  1949. }
  1950. .check-btn {
  1951. position: absolute;
  1952. bottom: 16px;
  1953. right: 6px;
  1954. background: rgba(0, 0, 0, 0.6);
  1955. padding: 0 8px;
  1956. border-radius: 8px;
  1957. ::v-deep {
  1958. .el-checkbox {
  1959. color: #fff;
  1960. }
  1961. }
  1962. }
  1963. .area-select {
  1964. padding-bottom: 12px;
  1965. .block {
  1966. width: 12px;
  1967. display: inline-block;
  1968. }
  1969. }
  1970. }
  1971. ::v-deep {
  1972. .el-form-item--default {
  1973. margin-bottom: 8px;
  1974. &.text-item {
  1975. margin-bottom: 2px;
  1976. .el-form-item__content {
  1977. line-height: 24px;
  1978. }
  1979. .el-form-item__label {
  1980. height: 24px;
  1981. line-height: 24px;
  1982. }
  1983. }
  1984. }
  1985. }
  1986. .sub-title {
  1987. display: flex;
  1988. align-items: center;
  1989. justify-content: space-between;
  1990. color: rgba(0, 0, 0, 0.6);
  1991. font-size: 14px;
  1992. .add-tag {
  1993. font-size: 12px;
  1994. color: #2199f8;
  1995. padding: 0 8px;
  1996. border: 1px solid #2199f8;
  1997. border-radius: 5px;
  1998. font-weight: normal;
  1999. height: 28px;
  2000. line-height: 28px;
  2001. }
  2002. }
  2003. .font-bold {
  2004. font-weight: 500;
  2005. color: #000000;
  2006. }
  2007. .form-index {
  2008. position: absolute;
  2009. left: 0;
  2010. top: 0;
  2011. padding: 0 6px;
  2012. background: #2199f8;
  2013. border-radius: 5px 0 4px 0;
  2014. height: 18px;
  2015. line-height: 18px;
  2016. font-size: 12px;
  2017. color: #fff;
  2018. }
  2019. .recipe-item {
  2020. width: 100%;
  2021. .recipe-form {
  2022. padding-top: 8px;
  2023. ::v-deep {
  2024. .el-form-item {
  2025. &:last-child {
  2026. margin-bottom: 0;
  2027. }
  2028. }
  2029. }
  2030. }
  2031. .mt-8 {
  2032. margin-top: 8px;
  2033. }
  2034. .box-item {
  2035. display: flex;
  2036. align-items: center;
  2037. justify-content: space-between;
  2038. color: rgba(0, 0, 0, 0.4);
  2039. .r-text {
  2040. color: #302f2f;
  2041. width: 150px;
  2042. text-align: center;
  2043. }
  2044. .form-r {
  2045. width: 150px;
  2046. min-width: 140px;
  2047. max-width: 240px;
  2048. }
  2049. }
  2050. .form-box {
  2051. border: 1px solid rgba(33, 153, 248, 0.8);
  2052. border-radius: 6px;
  2053. padding: 20px 10px;
  2054. width: 100%;
  2055. box-sizing: border-box;
  2056. position: relative;
  2057. // background: rgb(209, 235, 255, 0.3);
  2058. // margin-bottom: 12px;
  2059. .input-box {
  2060. &.mark-box {
  2061. padding: 8px 0 12px 0;
  2062. }
  2063. }
  2064. // .input-unit {
  2065. // ::v-deep {
  2066. // .el-input {
  2067. // border: 1px solid #dcdfe6;
  2068. // border-radius: 5px;
  2069. // height: 32px;
  2070. // box-sizing: border-box;
  2071. // }
  2072. // .el-input__wrapper {
  2073. // padding: 0 2px 0 10px;
  2074. // height: 30px;
  2075. // line-height: 30px;
  2076. // min-height: 30px;
  2077. // box-shadow: none;
  2078. // }
  2079. // .el-input__inner {
  2080. // --el-input-inner-height: 30px;
  2081. // height: 30px;
  2082. // line-height: 30px;
  2083. // min-height: 30px;
  2084. // color: #606266;
  2085. // --el-input-placeholder-color: #a8abb2;
  2086. // }
  2087. // .el-input-group__append {
  2088. // box-shadow: none;
  2089. // border: none;
  2090. // background: none;
  2091. // }
  2092. // }
  2093. // }
  2094. // .text-center {
  2095. // ::v-deep {
  2096. // .el-input__inner {
  2097. // text-align: center;
  2098. // }
  2099. // }
  2100. // }
  2101. .action-btn {
  2102. display: flex;
  2103. justify-content: flex-end;
  2104. .btn {
  2105. color: #8f8f8f;
  2106. border-radius: 25px;
  2107. padding: 5px 30px;
  2108. }
  2109. .delete-btn {
  2110. color: rgba(255, 89, 89, 0.9);
  2111. background: #fff;
  2112. border: 1px solid rgba(255, 89, 89, 0.9);
  2113. }
  2114. }
  2115. .btn-group {
  2116. padding-top: 12px;
  2117. }
  2118. .sub-item {
  2119. // padding-left: 10px;
  2120. .has-sub {
  2121. display: flex;
  2122. flex-direction: column;
  2123. align-items: center;
  2124. .main-name {
  2125. line-height: 20px;
  2126. }
  2127. .sub-name {
  2128. font-size: 10px;
  2129. color: rgba(129, 129, 129, 0.5);
  2130. line-height: 14px;
  2131. }
  2132. }
  2133. .colunm-sub {
  2134. display: flex;
  2135. align-items: center;
  2136. .sub-name {
  2137. font-size: 10px;
  2138. color: rgba(129, 129, 129, 0.5);
  2139. }
  2140. }
  2141. .r-text {
  2142. width: 132px;
  2143. text-align: center;
  2144. font-size: 14px;
  2145. color: #474747;
  2146. }
  2147. .price {
  2148. ::v-deep {
  2149. .el-input__wrapper {
  2150. box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
  2151. }
  2152. .el-input__inner {
  2153. color: #2199f8;
  2154. }
  2155. }
  2156. }
  2157. }
  2158. .form-title {
  2159. font-size: 14px;
  2160. padding-top: 6px;
  2161. color: #000;
  2162. font-weight: 600;
  2163. }
  2164. .box-item + .box-item {
  2165. margin-top: 8px;
  2166. }
  2167. }
  2168. .form-box + .form-box {
  2169. margin-top: 8px;
  2170. }
  2171. .usageMode-wrap {
  2172. padding-top: 8px;
  2173. }
  2174. }
  2175. // 状况描述样式
  2176. .situation-description {
  2177. width: 100%;
  2178. .description-title {
  2179. font-size: 16px;
  2180. font-weight: bold;
  2181. color: #000;
  2182. margin-bottom: 12px;
  2183. }
  2184. .description-content {
  2185. .description-textarea {
  2186. margin-bottom: 10px;
  2187. width: 100%;
  2188. }
  2189. .upload-section {
  2190. .upload-btn {
  2191. width: 112px;
  2192. height: 32px;
  2193. border-radius: 3px;
  2194. border: 1px solid #e0e0e0;
  2195. background: #fff;
  2196. color: #000;
  2197. font-size: 14px;
  2198. display: flex;
  2199. align-items: center;
  2200. justify-content: center;
  2201. margin-bottom: 8px;
  2202. .el-icon {
  2203. margin-right: 6px;
  2204. }
  2205. }
  2206. .upload-tip {
  2207. font-size: 12px;
  2208. color: #999;
  2209. line-height: 1.4;
  2210. }
  2211. }
  2212. }
  2213. }
  2214. // 专家诊断按钮样式
  2215. .expert-diagnosis-btn {
  2216. width: 180px;
  2217. height: 40px;
  2218. border-radius: 24px;
  2219. background: linear-gradient(180deg, #70bffe 0%, #2199f8 100%);
  2220. color: #ffffff;
  2221. display: flex;
  2222. align-items: center;
  2223. justify-content: center;
  2224. margin: 30px auto 0;
  2225. }
  2226. }
  2227. .complete-tip-popup {
  2228. width: 80%;
  2229. min-width: 294px;
  2230. padding: 28px 20px 20px;
  2231. display: flex;
  2232. flex-direction: column;
  2233. align-items: center;
  2234. justify-content: center;
  2235. .tip-icon {
  2236. margin-bottom: 12px;
  2237. &.create-icon {
  2238. width: 40px;
  2239. height: 40px;
  2240. }
  2241. &.success-icon {
  2242. width: 68px;
  2243. height: 68px;
  2244. }
  2245. }
  2246. .tip-text {
  2247. margin-bottom: 32px;
  2248. text-align: center;
  2249. &.success-text {
  2250. font-size: 24px;
  2251. font-weight: 400;
  2252. }
  2253. }
  2254. .btn-wrap {
  2255. display: flex;
  2256. align-items: center;
  2257. justify-content: center;
  2258. gap: 10px;
  2259. width: 100%;
  2260. .btn-item {
  2261. height: 40px;
  2262. line-height: 40px;
  2263. border-radius: 20px;
  2264. font-size: 16px;
  2265. color: #2199F8;
  2266. text-align: center;
  2267. &.second {
  2268. flex: none;
  2269. width: 92px;
  2270. border: 1px solid #2199F8;
  2271. }
  2272. &.primary {
  2273. flex: 1;
  2274. background: #2199f8;
  2275. color: #fff;
  2276. }
  2277. }
  2278. }
  2279. }
  2280. </style>