addWork.vue 60 KB

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