addWork.vue 61 KB

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