modify.vue 75 KB

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