laboratory.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. <!-- -->
  2. <template>
  3. <div class="laboratory_box">
  4. <el-card :style="'height:' + fullHeight + 'px'">
  5. <!-- 筛选 -->
  6. <el-row>
  7. <el-col>
  8. <div class="search_box">
  9. <!-- 任务处理人 -->
  10. <el-select
  11. filterable
  12. v-model="input"
  13. clearable
  14. @change="searchData"
  15. placeholder="请选择任务处理人/实际处理人"
  16. size="mini"
  17. >
  18. <el-option
  19. v-for="item in conductorList"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. >
  24. </el-option>
  25. </el-select>
  26. <!-- 任务状态 -->
  27. <el-select
  28. filterable
  29. v-model="value"
  30. @change="searchData"
  31. clearable
  32. placeholder="请选择任务状态"
  33. size="mini"
  34. >
  35. <el-option
  36. v-for="item in options"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. <!-- 时间筛选 -->
  44. <el-date-picker
  45. size="mini"
  46. v-model="value1"
  47. @change="searchData"
  48. type="daterange"
  49. range-separator="至"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. align="right"
  53. :editable="false"
  54. >
  55. </el-date-picker>
  56. <div class="btn_box">
  57. <el-button type="primary" size="mini" @click="searchData"
  58. >搜索</el-button
  59. >
  60. <el-button type="primary" size="mini" @click="reset"
  61. >重置</el-button
  62. >
  63. </div>
  64. </div>
  65. </el-col>
  66. </el-row>
  67. <!-- 列表 -->
  68. <el-table
  69. :data="tableData"
  70. stripe
  71. v-loading="loading"
  72. style="width: 100%"
  73. >
  74. <el-table-column prop="serial" label="序号" width="100">
  75. </el-table-column>
  76. <el-table-column prop="trap_number" label="设备编号" width="120">
  77. </el-table-column>
  78. <el-table-column prop="lng" label="经度" width="150">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.lng || "无" }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="lat" label="纬度" width="150">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.lat || "无" }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="id" label="任务编号" width="180">
  89. </el-table-column>
  90. <el-table-column
  91. prop="operator_user_name"
  92. label="任务处理人"
  93. width="180"
  94. >
  95. </el-table-column>
  96. <el-table-column
  97. prop="actual_operator_name"
  98. label="实际处理人"
  99. width="180"
  100. >
  101. <template slot-scope="scope">
  102. <span>{{ scope.row.actual_operator_name || "暂无" }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column prop="report_time" label="带回时间">
  106. <template slot-scope="scope">
  107. <span>{{ scope.row.report_time || "暂无" }}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column prop="discern_status" label="任务状态" width="280">
  111. <template slot-scope="scope">
  112. <span v-if="scope.row.discern_status == '待接收'">
  113. <span
  114. style="
  115. width: 6px;
  116. height: 6px;
  117. background: #f93f3d;
  118. border-radius: 50%;
  119. display: inline-block;
  120. margin: 0 0 2px 0;
  121. "
  122. ></span>
  123. <span>待接收样本</span>
  124. </span>
  125. <span v-if="scope.row.discern_status == '已接收'">
  126. <span
  127. style="
  128. width: 6px;
  129. height: 6px;
  130. background: #f93f3d;
  131. border-radius: 50%;
  132. display: inline-block;
  133. margin: 0 0 2px 0;
  134. "
  135. ></span>
  136. <span>已接收样本</span>
  137. </span>
  138. <span v-if="scope.row.discern_status == '已填报'">
  139. <span
  140. style="
  141. width: 6px;
  142. height: 6px;
  143. background: #e6a23c;
  144. border-radius: 50%;
  145. display: inline-block;
  146. margin: 0 0 2px 0;
  147. "
  148. ></span>
  149. <span>已填报样本</span>
  150. </span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="操作" fixed="right">
  154. <template slot-scope="scope">
  155. <a
  156. v-if="scope.row.discern_status == '待接收'"
  157. class="reset"
  158. href="javascript:;"
  159. @click="receive(scope.row)"
  160. >确认接收</a
  161. >
  162. <a
  163. v-if="scope.row.discern_status == '已接收'"
  164. class="reset"
  165. @click="examine(scope.row)"
  166. href="javascript:;"
  167. >填报</a
  168. >
  169. <a
  170. v-if="scope.row.discern_status == '已填报'"
  171. class="reset"
  172. href="javascript:;"
  173. @click="examine(scope.row)"
  174. >编辑</a
  175. >
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. <!-- 分页 -->
  180. <el-pagination
  181. style="margin: 60px 0 0 0"
  182. :page-size="10"
  183. @current-change="newPage"
  184. :current-page="page"
  185. v-if="tableData.length > 0"
  186. background
  187. layout="prev, pager, next, jumper"
  188. :total="tableSum"
  189. >
  190. </el-pagination>
  191. </el-card>
  192. <!-- 填报弹框 -->
  193. <el-dialog
  194. title="填报"
  195. v-loading="loading1"
  196. :visible.sync="dialogVisible"
  197. width="50%"
  198. :close-on-click-modal="false"
  199. :close-on-press-escape="false"
  200. >
  201. <ul class="fill_ul">
  202. <li class="fill_listTlt">
  203. <div class="fill_div">
  204. <div class="fill_tltie">有害生物</div>
  205. <div class="fill_tltie">
  206. 数量
  207. </div>
  208. </div>
  209. </li>
  210. <li class="fill_list1" v-if="fillList.length !== 0">
  211. <div v-for="(item, index) in fillList" :key="item.ind">
  212. <el-select
  213. v-model="models[index]"
  214. size="mini"
  215. clearable
  216. @change="compileInsect($event, item, index)"
  217. placeholder="请选择"
  218. >
  219. <el-option
  220. v-for="item1 in fillList"
  221. :key="item1.value"
  222. :label="item1.label"
  223. :value="item1.value"
  224. >
  225. </el-option>
  226. </el-select>
  227. <el-input
  228. placeholder="请输入内容"
  229. size="mini"
  230. @change="compileInsect($event, item, index)"
  231. v-model="item.num"
  232. clearable
  233. type="number"
  234. style="width: 30%"
  235. >
  236. </el-input>
  237. <span @click="delInsect(item)">删除</span>
  238. </div>
  239. </li>
  240. <!-- 添加 -->
  241. <li class="fill_list">
  242. <el-select
  243. style="margin: 0 0 0 -8px;"
  244. v-model="insectVal"
  245. size="mini"
  246. clearable
  247. placeholder="请选择"
  248. filterable
  249. >
  250. <el-option
  251. v-for="item1 in options2"
  252. :key="item1.value"
  253. :label="item1.label"
  254. :value="item1.value"
  255. >
  256. </el-option>
  257. </el-select>
  258. <el-input
  259. placeholder="请输入数量"
  260. size="mini"
  261. v-model="numVal"
  262. clearable
  263. onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));"
  264. @keyup.native="proving2($event)"
  265. type="number"
  266. style="width: 30%"
  267. >
  268. </el-input>
  269. <span
  270. style="color: #000; font-size: 30px; cursor: pointer"
  271. @click="addInsect()"
  272. >+</span
  273. >
  274. </li>
  275. </ul>
  276. </el-dialog>
  277. </div>
  278. </template>
  279. <script>
  280. export default {
  281. components: {},
  282. data() {
  283. //这里存放数据
  284. return {
  285. fullHeight: document.documentElement.clientHeight - 116, //
  286. // 筛选
  287. input: "", // 任务处理人
  288. conductorList: [], // 任务处理人列表
  289. options: [
  290. {
  291. value: "待接收",
  292. label: "待接收"
  293. },
  294. {
  295. value: "已接收",
  296. label: "已接收"
  297. },
  298. {
  299. value: "已填报",
  300. lanbel: "已填报"
  301. }
  302. ],
  303. value: "", // 任务状态
  304. value1: "", // 时间筛选
  305. startTime: "",
  306. endTime: "",
  307. // 表格
  308. tableData: [],
  309. page: 1,
  310. tableSum: 0, // 总页数
  311. // 填报弹框
  312. dialogVisible: false,
  313. options1: [],
  314. options2: [], //新增有害生物
  315. value2: "",
  316. input2: "",
  317. loading: false, // 加载
  318. // 已识别
  319. examineObj: {}, // 选中的对象值
  320. fillList: [], // 填报详情数据
  321. spareData: [], // 填报详情备用数据
  322. // models: Array(fillList.length).fill(''), // 填报select数据
  323. models: null, // 填报select数据
  324. insectVal: "", // 添加 - 有害生物
  325. numVal: "", // 添加 - 数量
  326. loading1: false // 加载
  327. };
  328. },
  329. //监听属性 类似于data概念
  330. computed: {},
  331. //监控data中的数据变化
  332. watch: {
  333. fullHeight(val) {
  334. //监控浏览器高度变化
  335. if (!this.timer) {
  336. this.fullHeight = val;
  337. this.timer = true;
  338. let that = this;
  339. setTimeout(function() {
  340. //防止过度调用监测事件,导致卡顿
  341. that.timer = false;
  342. }, 400);
  343. }
  344. },
  345. // 填报弹框
  346. dialogVisible(val) {
  347. if (val == false) {
  348. this.fillList = [];
  349. this.spareData = []; // 备用数据
  350. }
  351. },
  352. // 填报 - 新添加数据
  353. numValZ(val) {
  354. console.log(val);
  355. }
  356. },
  357. //方法集合
  358. methods: {
  359. //动态获取浏览器高度
  360. get_boderHeight() {
  361. const that = this;
  362. window.onresize = () => {
  363. return (() => {
  364. window.fullHeight = document.documentElement.clientHeight;
  365. that.fullHeight = window.fullHeight;
  366. })();
  367. };
  368. },
  369. // 筛选
  370. searchData() {
  371. // 对时间筛选中获取到的时间进行处理
  372. if (this.value1) {
  373. this.startTime = this.formatTime(this.value1[0], "yyyy-MM-dd");
  374. this.endTime = this.formatTime(this.value1[1], "yyyy-MM-dd");
  375. } else {
  376. this.startTime = "";
  377. this.endTime = "";
  378. }
  379. this.loading = true;
  380. this.tableData = [];
  381. this.tableList();
  382. },
  383. // 重置
  384. reset() {
  385. this.input = "";
  386. this.value = "";
  387. this.value1 = "";
  388. this.startTime = "";
  389. this.endTime = "";
  390. this.loading = true;
  391. this.tableList();
  392. },
  393. // 下页
  394. newPage(page) {
  395. this.loading = true;
  396. this.page = page;
  397. this.tableList();
  398. },
  399. // 表格数据
  400. tableList() {
  401. this.$axios({
  402. method: "POST",
  403. url: "/api/api_gateway?method=control_center.task.discern_list",
  404. data: this.qs.stringify({
  405. page: this.page,
  406. page_item: 10,
  407. operator_user_id: this.input, // 任务处理人id
  408. start_time: this.startTime, // 开始时间
  409. end_time: this.endTime, // 结束时间
  410. task_status: this.value // 任务状态
  411. })
  412. })
  413. .then(res => {
  414. if (res.data.data.total_item !== 0) {
  415. this.tableSum = res.data.data.total_item;
  416. var data = res.data.data.page_list;
  417. var list = [];
  418. data.forEach((item, index) => {
  419. item.serial = index + 1;
  420. list.push(item);
  421. });
  422. this.tableData = list;
  423. }
  424. this.loading = false;
  425. })
  426. .catch(err => {
  427. this.loading = false;
  428. });
  429. },
  430. // 筛选列表 - 任务处理人
  431. conductorAxios() {
  432. this.$axios({
  433. method: "POST",
  434. url: "/api/api_gateway?method=control_center.task.task_user_list",
  435. data: this.qs.stringify({
  436. user_type: "operator", // 用户类型,operator(任务处理人), supervisor(任务监督人), owner(任务发布人)
  437. operator_id: "", // 已经选择的任务处理人id
  438. supervisor_id: "", // 已经选择的任务监督人id
  439. owner_id: "" // 已经选择的任务发布人id
  440. })
  441. })
  442. .then(res => {
  443. if (res.data.data.length !== 0) {
  444. var data = res.data.data;
  445. var list = [];
  446. data.forEach(item => {
  447. var obj = {};
  448. obj["value"] = item.user_id;
  449. obj["label"] = item.real_name;
  450. list.push(obj);
  451. });
  452. this.conductorList = list;
  453. }
  454. })
  455. .catch(err => {});
  456. },
  457. // 确认接收
  458. receive(data) {
  459. this.$confirm("此操作将确认接收, 是否继续?", "提示", {
  460. confirmButtonText: "确定",
  461. cancelButtonText: "取消",
  462. type: "warning"
  463. })
  464. .then(() => {
  465. this.$axios({
  466. method: "POST",
  467. url: "/api/api_gateway?method=control_center.task.discern_modify",
  468. data: this.qs.stringify({
  469. record_id: data.id // 任务id
  470. })
  471. })
  472. .then(res => {
  473. if (res.data.data == true) {
  474. this.$message({
  475. type: "success",
  476. message: "接收成功!",
  477. duration: 1500
  478. });
  479. this.loading = true;
  480. this.tableList();
  481. }
  482. })
  483. .catch(err => {
  484. console.log(err);
  485. });
  486. })
  487. .catch(() => {
  488. this.$message({
  489. type: "info",
  490. message: "已取消接收",
  491. duration: 1500
  492. });
  493. });
  494. },
  495. // 填报、编辑事件 (表格中的操作)
  496. examine(data) {
  497. // console.log(data);
  498. this.examineObj = data;
  499. // 填报记录详情接口
  500. this.$axios({
  501. method: "POST",
  502. url:
  503. "/api/api_gateway?method=control_center.task.trap_pest_record_info",
  504. data: this.qs.stringify({
  505. trap_record_id: data.id // 任务id
  506. })
  507. })
  508. .then(res => {
  509. var data = res.data.data;
  510. var list = [];
  511. var arr = [];
  512. data.forEach((item, index) => {
  513. var obj = {};
  514. obj["value"] = item.id;
  515. obj["label"] = item.pest_name;
  516. obj["num"] = item.pest_number;
  517. obj["ind"] = index;
  518. list.push(obj);
  519. arr.push(item.id);
  520. });
  521. this.fillList = list;
  522. this.spareData = list; // 备用数据
  523. this.models = arr;
  524. this.dialogVisible = true;
  525. this.addEditor(); // 新添加 - 编辑接口
  526. })
  527. .catch(err => {
  528. console.log(err);
  529. });
  530. },
  531. // 新添加 -编辑
  532. addEditor() {
  533. this.$axios({
  534. method: "POST",
  535. url: "/api/api_gateway?method=sysmenage.maintain.pest_list",
  536. data: this.qs.stringify({
  537. page: 1, // 页码
  538. page_item: "1000000000000000000000000000", // 每页条目数,默认10
  539. pest_name: "" // 有害生物
  540. })
  541. })
  542. .then(res => {
  543. if (res.data.data.total_item !== 0) {
  544. var data = res.data.data;
  545. var list = [];
  546. for (var i = 0; i < data.page_list.length; i++) {
  547. var obj = {};
  548. obj["id"] = data.page_list[i].pest_id;
  549. obj["value"] = data.page_list[i].pest_name;
  550. obj["label"] = data.page_list[i].pest_name;
  551. list.push(obj);
  552. }
  553. this.options2 = list;
  554. }
  555. })
  556. .catch(err => {
  557. console.log(err);
  558. });
  559. },
  560. // 添加有害生物
  561. addInsect() {
  562. if (this.insectVal !== "" && this.numVal !== "") {
  563. var array = [];
  564. for (var i = 0; i < this.fillList.length; i++) {
  565. var obj = {};
  566. obj["pest_name"] = this.fillList[i].label;
  567. obj["pest_number"] = this.fillList[i].num;
  568. array.push(obj);
  569. }
  570. var obj1 = {};
  571. obj1["pest_name"] = this.insectVal;
  572. obj1["pest_number"] = Number(this.numVal);
  573. array = [...array, obj1];
  574. this.$confirm("此操作将新增有害生物, 是否继续?", "提示", {
  575. confirmButtonText: "确定",
  576. cancelButtonText: "取消",
  577. type: "warning"
  578. })
  579. .then(() => {
  580. this.$axios({
  581. method: "POST",
  582. url: "/api/api_gateway?method=control_center.task.discern_add",
  583. data: this.qs.stringify({
  584. record_id: this.examineObj.id, // 任务id
  585. pest_list: JSON.stringify(array) // 害虫数组
  586. })
  587. })
  588. .then(res => {
  589. if (res.data.message == "") {
  590. this.$message({
  591. type: "success",
  592. message: "添加成功!",
  593. duration: 1500
  594. });
  595. this.examine(this.examineObj);
  596. }
  597. this.insectVal = "";
  598. this.numVal = "";
  599. })
  600. .catch(err => {
  601. console.log(err);
  602. });
  603. })
  604. .catch(() => {
  605. this.$message({
  606. type: "info",
  607. message: "已取消添加",
  608. duration: 1500
  609. });
  610. });
  611. } else {
  612. this.$message({
  613. type: "info",
  614. message: "请将信息填写完整!",
  615. duration: 1500
  616. });
  617. }
  618. },
  619. // 删除有害生物
  620. delInsect(data) {
  621. this.$confirm("此操作将永久删除该有害生物, 是否继续?", "提示", {
  622. confirmButtonText: "确定",
  623. cancelButtonText: "取消",
  624. type: "warning"
  625. })
  626. .then(() => {
  627. this.loading1 = true;
  628. var list = this.fillList;
  629. list.splice(data.ind, 1);
  630. var arr = [];
  631. list.forEach(item => {
  632. var obj = {};
  633. obj["pest_name"] = item.label;
  634. obj["pest_number"] = item.num;
  635. arr.push(obj);
  636. });
  637. this.$axios({
  638. method: "POST",
  639. url: "/api/api_gateway?method=control_center.task.discern_add",
  640. data: this.qs.stringify({
  641. record_id: this.examineObj.id, // 任务id
  642. pest_list: JSON.stringify(arr) // 害虫数组
  643. })
  644. })
  645. .then(res => {
  646. if (res.data.message == "") {
  647. this.$message({
  648. type: "success",
  649. message: "删除成功!",
  650. duration: 1500
  651. });
  652. this.examine(this.examineObj);
  653. }
  654. this.loading1 = false;
  655. })
  656. .catch(err => {
  657. this.loading1 = false;
  658. });
  659. })
  660. .catch(() => {
  661. this.$message({
  662. type: "info",
  663. message: "已取消删除",
  664. duration: 1500
  665. });
  666. });
  667. },
  668. // 编辑有害生物
  669. compileInsect(e, data, index) {
  670. this.$confirm("此操作将编辑该有害生物, 是否继续?", "提示", {
  671. confirmButtonText: "确定",
  672. cancelButtonText: "取消",
  673. type: "warning"
  674. })
  675. .then(() => {
  676. this.$set(this.models, index, e);
  677. var list = this.spareData;
  678. var newList = [];
  679. // 下拉框数据改变处理
  680. for (var i = 0; i < list.length; i++) {
  681. var obj = {};
  682. if (e == list[i].value) {
  683. obj["pest_name"] = list[i].label;
  684. obj["pest_number"] = data.num;
  685. newList.push(obj);
  686. }
  687. }
  688. // 修改数据为可发送到后端接口数据
  689. var arr = [];
  690. var list = this.fillList;
  691. list.forEach(item => {
  692. var obj = {};
  693. obj["pest_name"] = item.label;
  694. obj["pest_number"] = item.num;
  695. arr.push(obj);
  696. });
  697. arr.splice(index, 1, ...newList);
  698. this.$axios({
  699. method: "POST",
  700. url: "/api/api_gateway?method=control_center.task.discern_add",
  701. data: this.qs.stringify({
  702. record_id: this.examineObj.id, // 任务id
  703. pest_list: JSON.stringify(arr) // 害虫数组
  704. })
  705. })
  706. .then(res => {
  707. if (res.data.message == "") {
  708. this.$message({
  709. type: "success",
  710. message: "编辑成功!",
  711. duration: 1500
  712. });
  713. this.examine(this.examineObj);
  714. }
  715. this.insectVal = "";
  716. this.numVal = "";
  717. })
  718. .catch(err => {
  719. console.log(err);
  720. });
  721. })
  722. .catch(() => {
  723. this.loading1 = false;
  724. this.$set(this.models, index, this.fillList[index].value);
  725. this.$message({
  726. type: "info",
  727. message: "已取消编辑"
  728. });
  729. });
  730. },
  731. getBit(value, bit) {
  732. let str = Number(value);
  733. str = str.toFixed(bit);
  734. return str;
  735. },
  736. proving2(e) {
  737. var keynum = window.event ? e.keyCode : e.which; //获取键盘码
  738. var keychar = String.fromCharCode(keynum); //获取键盘码对应的字符
  739. if (keynum == 189 || keynum == 109) {
  740. //禁止输入负数
  741. this.$message.warning("禁止输入负数");
  742. e.target.value = 0;
  743. }
  744. if (String(e.target.value).indexOf("-") == -1) {
  745. } else {
  746. //禁止输入负数
  747. this.$message.warning("禁止输入负数");
  748. e.target.value = 0;
  749. }
  750. }
  751. },
  752. //生命周期 - 创建完成(可以访问当前this实例)
  753. created() {},
  754. //生命周期 - 挂载完成(可以访问DOM元素)
  755. mounted() {
  756. this.loading = true;
  757. this.get_boderHeight(); // 动态获取浏览器高度
  758. this.tableList(); // 表格列表数据
  759. this.conductorAxios(); // 筛选列表 - 任务处理人列表
  760. },
  761. beforeCreate() {}, //生命周期 - 创建之前
  762. beforeMount() {}, //生命周期 - 挂载之前
  763. beforeUpdate() {}, //生命周期 - 更新之前
  764. updated() {}, //生命周期 - 更新之后
  765. beforeDestroy() {}, //生命周期 - 销毁之前
  766. destroyed() {}, //生命周期 - 销毁完成
  767. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  768. };
  769. </script>
  770. <style lang="less" scoped>
  771. .laboratory_box {
  772. // 搜索
  773. .search_box {
  774. display: flex;
  775. /deep/.el-select {
  776. margin: 0 15px 0 0;
  777. }
  778. /deep/.el-input {
  779. // width: 15%;
  780. margin: 0 15px 0 0;
  781. }
  782. .btn_box {
  783. margin: 0 0 0 15px;
  784. // width: 50%;
  785. display: flex;
  786. justify-content: start;
  787. }
  788. /deep/.el-range-editor--mini.el-input__inner {
  789. width: 20%;
  790. }
  791. }
  792. a {
  793. text-decoration: none;
  794. }
  795. .reset {
  796. color: #1890ff;
  797. }
  798. // 填报弹框
  799. .fill_ul {
  800. .fill_listTlt {
  801. width: 95%;
  802. .fill_div {
  803. width: 60%;
  804. margin: 0 0 0 60px;
  805. display: flex;
  806. justify-content: space-between;
  807. .fill_tltie {
  808. margin: 0 0 10px 0;
  809. width: 35%;
  810. display: inline-block;
  811. }
  812. }
  813. }
  814. .fill_list {
  815. display: flex;
  816. justify-content: space-around;
  817. margin: 0 20px 10px 0;
  818. span {
  819. line-height: 30px;
  820. color: #1890ff;
  821. }
  822. }
  823. .fill_list1 {
  824. div {
  825. display: flex;
  826. justify-content: space-around;
  827. margin: 0 20px 10px 0;
  828. span {
  829. line-height: 30px;
  830. color: #1890ff;
  831. cursor: pointer;
  832. }
  833. }
  834. }
  835. }
  836. /deep/.el-card {
  837. overflow: hidden;
  838. overflow-y: auto;
  839. }
  840. }
  841. // 去除elementui input数字框里上下箭头
  842. /deep/ input::-webkit-outer-spin-button,
  843. /deep/ input::-webkit-inner-spin-button {
  844. -webkit-appearance: none !important;
  845. }
  846. /deep/ input[type="number"] {
  847. -moz-appearance: textfield !important;
  848. }
  849. /deep/.el-date-editor{
  850. cursor: pointer;
  851. .el-range-input{
  852. cursor: pointer;
  853. }
  854. }
  855. </style>