index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="装置名称" prop="plants">
  5. <el-select v-model="plantIds" size="small" @change="handleCommand" multiple collapse-tags :placeholder="$t('请选择') + $t('装置')">
  6. <el-checkbox v-model="checked" @change="selectAll"> ALL</el-checkbox>
  7. <el-option
  8. v-for="item in plantOptions"
  9. :key="item.name"
  10. :label="item.name"
  11. :value="item.name">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="周排查日期" prop="checkDate">
  16. <el-date-picker
  17. v-model="chooseDate"
  18. @change="handleQuery"
  19. type="daterange"
  20. style="width: 508px"
  21. align="right"
  22. unlink-panels
  23. :range-separator="$t('至')"
  24. :start-placeholder="$t('开始日期')"
  25. :end-placeholder="$t('结束日期')"
  26. value-format="yyyy-MM-dd"
  27. :picker-options="pickerOptions">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item label="周" prop="weekNo">
  31. <el-input
  32. v-model="queryParams.weekNo"
  33. placeholder="请输入周"
  34. clearable
  35. size="small"
  36. @keyup.enter.native="handleQuery"
  37. />
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  41. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  42. </el-form-item>
  43. </el-form>
  44. <el-row :gutter="10" class="mb8">
  45. <el-col :span="1.5">
  46. <el-button
  47. type="primary"
  48. icon="el-icon-plus"
  49. size="mini"
  50. @click="handleAdd"
  51. v-hasPermi="['safecheck:personweekcheck:add']"
  52. >新增</el-button>
  53. </el-col>
  54. <el-col :span="1.5">
  55. <el-button
  56. type="success"
  57. icon="el-icon-edit"
  58. size="mini"
  59. :disabled="single"
  60. @click="handleUpdate"
  61. v-hasPermi="['safecheck:personweekcheck:edit']"
  62. >修改</el-button>
  63. </el-col>
  64. <el-col :span="1.5">
  65. <el-button
  66. type="danger"
  67. icon="el-icon-delete"
  68. size="mini"
  69. :disabled="multiple"
  70. @click="handleDelete"
  71. v-hasPermi="['safecheck:personweekcheck:remove']"
  72. >删除</el-button>
  73. </el-col>
  74. <el-col :span="1.5">
  75. <el-button
  76. type="warning"
  77. icon="el-icon-download"
  78. size="mini"
  79. @click="handleExport"
  80. v-hasPermi="['safecheck:personweekcheck:export']"
  81. >导出</el-button>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-button
  85. type="success"
  86. icon="el-icon-edit"
  87. size="mini"
  88. :disabled="multiple"
  89. @click="handleBatchConfirm"
  90. v-hasPermi="['safecheck:weekcheck:edit']"
  91. >批量确认</el-button>
  92. </el-col>
  93. <el-col :span="1.5">
  94. <el-button
  95. type="danger"
  96. icon="el-icon-edit"
  97. size="mini"
  98. :disabled="multiple"
  99. @click="handleBatchCancel"
  100. v-hasPermi="['safecheck:weekcheck:edit']"
  101. >取消确认</el-button>
  102. </el-col>
  103. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  104. </el-row>
  105. <el-table v-loading="loading" :data="personweekcheckList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  106. <el-table-column type="selection" width="55" align="center" />
  107. <el-table-column label="装置名称" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
  108. <el-table-column label="周排查日期" align="center" prop="checkDate" width="100">
  109. <template slot-scope="scope">
  110. <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="安全员" align="center" prop="checkerName" width="120">
  114. <template slot-scope="scope">
  115. <span v-if="scope.row.agentId">{{ scope.row.checkerName}} 代 {{ scope.row.agentName}}</span>
  116. <span v-else>{{ scope.row.checkerName}}</span>
  117. </template>
  118. </el-table-column> <el-table-column label="周" align="center" prop="weekNo" :show-overflow-tooltip="true"/>
  119. <el-table-column label="状态" align="center" prop="isConfirm" :show-overflow-tooltip="true" :formatter="isConfirmFormat"/>
  120. <el-table-column label="上周安全风险隐患问题整改核实情况" align="center" prop="lastWeekRisk" :show-overflow-tooltip="true"/>
  121. <el-table-column label="本周主要安全风险隐患和整改情况" align="center" prop="thisWeekRisk" :show-overflow-tooltip="true"/>
  122. <el-table-column label="本周安全管理情况评价" align="center" prop="safeCondition" :show-overflow-tooltip="true"/>
  123. <el-table-column label="下周工作重点" align="center" prop="nextWeekWork" :show-overflow-tooltip="true"/>
  124. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  125. <template slot-scope="scope">
  126. <el-button
  127. v-if="scope.row.isConfirm == 0"
  128. size="mini"
  129. type="text"
  130. icon="el-icon-edit"
  131. @click="handleUpdate(scope.row)"
  132. v-hasPermi="['safecheck:personweekcheck:edit']"
  133. >修改</el-button>
  134. <el-button
  135. v-if="scope.row.isConfirm == 0"
  136. size="mini"
  137. type="text"
  138. icon="el-icon-delete"
  139. @click="handleDelete(scope.row)"
  140. v-hasPermi="['safecheck:personweekcheck:remove']"
  141. >删除</el-button>
  142. <el-button
  143. size="mini"
  144. type="text"
  145. icon="el-icon-document"
  146. @click="handleDoc(scope.row)"
  147. >附件
  148. </el-button>
  149. </template>
  150. </el-table-column>
  151. </el-table>
  152. <pagination
  153. v-show="total>0"
  154. :total="total"
  155. :page.sync="queryParams.pageNum"
  156. :page-sizes="[20,100,300,500]"
  157. :limit.sync="queryParams.pageSize"
  158. @pagination="getList"
  159. />
  160. <!-- 添加或修改每周个人安全检查对话框 -->
  161. <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
  162. <el-form ref="form" :model="form" :rules="rules" label-width="150px">
  163. <el-form-item label="装置名称" prop="plantCode">
  164. <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small"
  165. >
  166. <el-option
  167. v-for="dict in plantOptions"
  168. :key="dict.name"
  169. :label="dict.name"
  170. :value="dict.name"
  171. />
  172. </el-select>
  173. </el-form-item>
  174. <el-row>
  175. <el-col :span="12">
  176. <el-form-item label-width="150px" label="周排查日期" prop="checkDate">
  177. <el-date-picker clearable size="small" style="width: 200px" @change="calculateWeekNumber"
  178. v-model="form.checkDate"
  179. type="date"
  180. value-format="yyyy-MM-dd"
  181. placeholder="选择周排查日期">
  182. </el-date-picker>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="12">
  186. <el-form-item label-width="150px" label="周" prop="weekNo">
  187. <el-input v-model="form.weekNo" placeholder="请输入周" />
  188. </el-form-item>
  189. </el-col>
  190. </el-row>
  191. <el-form-item label="上周安全风险隐患问题整改核实情况" prop="lastWeekRisk">
  192. <el-input v-model="form.lastWeekRisk" :autosize="{ minRows: 2, maxRows: 9}" type="textarea" placeholder="请输入上周安全风险隐患问题整改核实情况" />
  193. </el-form-item>
  194. <el-form-item label="本周主要安全风险隐患和整改情况" prop="thisWeekRisk">
  195. <el-input v-model="form.thisWeekRisk" :autosize="{ minRows: 2, maxRows: 9}" type="textarea" placeholder="请输入本周主要安全风险隐患和整改情况" />
  196. </el-form-item>
  197. <el-form-item label="本周安全管理情况评价" prop="safeCondition">
  198. <el-radio-group v-model="form.safeCondition">
  199. <el-radio label="安全风险可控,无较大(质量)安全风险隐患">安全风险可控,无较大(质量)安全风险隐患</el-radio>
  200. <el-radio label="存在安全风险隐患,需尽快采取防范措施">存在安全风险隐患,需尽快采取防范措施</el-radio>
  201. </el-radio-group>
  202. </el-form-item>
  203. <el-form-item label="下周工作重点" prop="nextWeekWork">
  204. <el-input v-model="form.nextWeekWork" :autosize="{ minRows: 2, maxRows: 9}" type="textarea" placeholder="请输入下周工作重点" />
  205. </el-form-item>
  206. </el-form>
  207. <div slot="footer" class="dialog-footer">
  208. <el-button type="primary" @click="submitForm">确 定</el-button>
  209. <el-button @click="cancel">取 消</el-button>
  210. </div>
  211. </el-dialog>
  212. <!-- 用户导入对话框 -->
  213. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  214. <el-upload
  215. ref="upload"
  216. :limit="1"
  217. accept=".xlsx, .xls"
  218. :headers="upload.headers"
  219. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  220. :disabled="upload.isUploading"
  221. :on-progress="handleFileUploadProgress"
  222. :on-success="handleFileSuccess"
  223. :auto-upload="false"
  224. drag
  225. >
  226. <i class="el-icon-upload"></i>
  227. <div class="el-upload__text">
  228. 将文件拖到此处,或
  229. <em>点击上传</em>
  230. </div>
  231. <div class="el-upload__tip" slot="tip">
  232. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  233. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  234. </div>
  235. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  236. </el-upload>
  237. <div slot="footer" class="dialog-footer">
  238. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  239. <el-button @click="upload.open = false">取 消</el-button>
  240. </div>
  241. </el-dialog>
  242. <Attachment ref="childRef"></Attachment>
  243. </div>
  244. </template>
  245. <script>
  246. import { batchCancel, batchConfirm,listPersonweekcheck, getPersonweekcheck, delPersonweekcheck, addPersonweekcheck, updatePersonweekcheck, exportPersonweekcheck, importTemplate} from "@/api/sems/safecheck/personweekcheck";
  247. import { treeselect } from "@/api/system/dept";
  248. import { getToken } from "@/utils/auth";
  249. import Treeselect from "@riophae/vue-treeselect";
  250. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  251. import {mylistPlant} from "@/api/system/plant";
  252. import Attachment from '@/views/components/file/attachment.vue'
  253. export default {
  254. name: "Personweekcheck",
  255. components: { Treeselect,Attachment },
  256. data() {
  257. return {
  258. // 遮罩层
  259. loading: true,
  260. checked:true,
  261. // 选中数组
  262. ids: [],
  263. dataListSelections: [],
  264. // 非单个禁用
  265. single: true,
  266. // 非多个禁用
  267. multiple: true,
  268. // 显示搜索条件
  269. showSearch: false,
  270. // 总条数
  271. total: 0,
  272. // 每周个人安全检查表格数据
  273. personweekcheckList: [],
  274. // 弹出层标题
  275. title: "",
  276. // 部门树选项
  277. deptOptions: undefined,
  278. plantOptions: [],
  279. plantIds: [],
  280. clientHeight:300,
  281. // 是否显示弹出层
  282. open: false,
  283. // 用户导入参数
  284. upload: {
  285. // 是否显示弹出层(用户导入)
  286. open: false,
  287. // 弹出层标题(用户导入)
  288. title: "",
  289. // 是否禁用上传
  290. isUploading: false,
  291. // 是否更新已经存在的用户数据
  292. updateSupport: 0,
  293. // 设置上传的请求头部
  294. headers: { Authorization: "Bearer " + getToken() },
  295. // 上传的地址
  296. url: process.env.VUE_APP_BASE_API + "/safecheck/personweekcheck/importData"
  297. },
  298. // 查询参数
  299. queryParams: {
  300. pageNum: 1,
  301. pageSize: 20,
  302. plantCode: null,
  303. checkDate: null,
  304. weekNo: null,
  305. lastWeekRisk: null,
  306. thisWeekRisk: null,
  307. safeCondition: null,
  308. nextWeekWork: null
  309. },
  310. //日期快速选择
  311. pickerOptions: {
  312. shortcuts: [{
  313. text: this.$t('最近一周'),
  314. onClick(picker) {
  315. const end = new Date();
  316. const start = new Date();
  317. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  318. picker.$emit('pick', [start, end]);
  319. }
  320. }, {
  321. text: this.$t('最近一个月'),
  322. onClick(picker) {
  323. const end = new Date();
  324. const start = new Date();
  325. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  326. picker.$emit('pick', [start, end]);
  327. }
  328. }, {
  329. text: this.$t('最近三个月'),
  330. onClick(picker) {
  331. const end = new Date();
  332. const start = new Date();
  333. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  334. picker.$emit('pick', [start, end]);
  335. }
  336. }]
  337. },
  338. //日期选择器
  339. chooseDate: [],
  340. // 表单参数
  341. form: {},
  342. // 表单校验
  343. rules: {
  344. }
  345. };
  346. },
  347. watch: {
  348. // 根据名称筛选部门树
  349. deptName(val) {
  350. this.$refs.tree.filter(val);
  351. }
  352. },
  353. created() {
  354. //设置表格高度对应屏幕高度
  355. this.$nextTick(() => {
  356. this.clientHeight = document.body.clientHeight -250
  357. })
  358. this.getList();
  359. let plantParams = {
  360. pType: 1
  361. }
  362. mylistPlant(plantParams).then(response => {
  363. this.plantOptions = response.data;
  364. });
  365. this.getTreeselect();
  366. },
  367. methods: {
  368. /** 查询每周个人安全检查列表 */
  369. getList() {
  370. this.loading = true;
  371. listPersonweekcheck(this.queryParams).then(response => {
  372. this.personweekcheckList = response.rows;
  373. this.total = response.total;
  374. this.loading = false;
  375. });
  376. },
  377. /** 查询部门下拉树结构 */
  378. getTreeselect() {
  379. treeselect().then(response => {
  380. this.deptOptions = response.data;
  381. });
  382. },
  383. // 字典翻译
  384. isConfirmFormat(row, column) {
  385. let type = 'info';
  386. if (row.isConfirm == 0) {
  387. let s = '未确认'
  388. return <el-tag type={type}>{s}</el-tag>;
  389. }
  390. if (row.isConfirm == 1) {
  391. let s = '已确认'
  392. type = 'success';
  393. return <el-tag type={type}>{s}</el-tag>;
  394. }
  395. },
  396. // 取消按钮
  397. cancel() {
  398. this.open = false;
  399. this.reset();
  400. },
  401. // 表单重置
  402. reset() {
  403. this.form = {
  404. id: null,
  405. plantCode: null,
  406. delFlag: null,
  407. createrCode: null,
  408. createdate: null,
  409. updaterCode: null,
  410. updatedate: null,
  411. checkDate: null,
  412. checkerId: null,
  413. weekNo: null,
  414. lastWeekRisk: '无',
  415. thisWeekRisk: '无',
  416. safeCondition: '安全风险可控,无较大(质量)安全风险隐患',
  417. nextWeekWork: '无'
  418. };
  419. this.resetForm("form");
  420. },
  421. /** 搜索按钮操作 */
  422. handleQuery() {
  423. this.queryParams.pageNum = 1;
  424. if (this.chooseDate == null) {
  425. this.chooseDate = []
  426. }
  427. this.queryParams.startDate = this.chooseDate[0]
  428. this.queryParams.endDate = this.chooseDate[1]
  429. this.queryParams.plants = this.plantIds.join(',')
  430. this.getList();
  431. },
  432. /** 重置按钮操作 */
  433. resetQuery() {
  434. this.resetForm("queryForm");
  435. this.chooseDate = "";
  436. this.plantIds = [];
  437. this.handleQuery();
  438. },
  439. // 多选框选中数据
  440. handleSelectionChange(selection) {
  441. this.ids = selection.map(item => item.id)
  442. this.single = selection.length!==1
  443. this.multiple = !selection.length
  444. this.dataListSelections = selection
  445. },
  446. /** 新增按钮操作 */
  447. handleAdd() {
  448. this.reset();
  449. this.open = true;
  450. this.title = "添加每周个人安全检查";
  451. },
  452. /** 修改按钮操作 */
  453. handleUpdate(row) {
  454. this.reset();
  455. const id = row.id || this.ids
  456. var rows = this.dataListSelections.map(item => {
  457. return item
  458. })
  459. for (let i = 0; i < rows.length; i++) {
  460. if (rows[i].isConfirm != 0) {
  461. this.$alert("已确认,无法修改", this.$t('提示'), {
  462. type: 'warning'
  463. })
  464. return
  465. }
  466. }
  467. getPersonweekcheck(id).then(response => {
  468. this.form = response.data;
  469. this.open = true;
  470. this.title = "修改每周个人安全检查";
  471. });
  472. },
  473. /** 提交按钮 */
  474. submitForm() {
  475. this.$refs["form"].validate(valid => {
  476. if (valid) {
  477. if (this.form.id != null) {
  478. updatePersonweekcheck(this.form).then(response => {
  479. this.msgSuccess("修改成功");
  480. this.open = false;
  481. this.getList();
  482. });
  483. } else {
  484. addPersonweekcheck(this.form).then(response => {
  485. this.msgSuccess("新增成功");
  486. this.open = false;
  487. this.getList();
  488. });
  489. }
  490. }
  491. });
  492. },
  493. calculateWeekNumber() {
  494. console.log(this.form.checkDate)
  495. if (this.form.checkDate) {
  496. const date = new Date(this.form.checkDate);
  497. const yearStart = new Date(date.getFullYear(), 0, 1);
  498. const days = Math.floor((date - yearStart) / (24 * 60 * 60 * 1000));
  499. const weekNumber = Math.ceil((days + yearStart.getDay() + 1) / 7);
  500. this.form.weekNo = weekNumber;
  501. }
  502. },
  503. /** 删除按钮操作 */
  504. handleDelete(row) {
  505. const ids = row.id || this.ids;
  506. var rows = this.dataListSelections.map(item => {
  507. return item
  508. })
  509. for (let i = 0; i < rows.length; i++) {
  510. if (rows[i].isConfirm != 0) {
  511. this.$alert("已确认,无法删除", this.$t('提示'), {
  512. type: 'warning'
  513. })
  514. return
  515. }
  516. }
  517. this.$confirm('是否确认删除?', "警告", {
  518. confirmButtonText: "确定",
  519. cancelButtonText: "取消",
  520. type: "warning"
  521. }).then(function() {
  522. return delPersonweekcheck(ids);
  523. }).then(() => {
  524. this.getList();
  525. this.msgSuccess("删除成功");
  526. })
  527. },
  528. /** 导出按钮操作 */
  529. handleExport() {
  530. const queryParams = this.queryParams;
  531. this.$confirm('是否确认导出所有每周个人安全检查数据项?', "警告", {
  532. confirmButtonText: "确定",
  533. cancelButtonText: "取消",
  534. type: "warning"
  535. }).then(function() {
  536. return exportPersonweekcheck(queryParams);
  537. }).then(response => {
  538. this.download(response.msg);
  539. })
  540. },
  541. /** 导入按钮操作 */
  542. handleImport() {
  543. this.upload.title = "用户导入";
  544. this.upload.open = true;
  545. },
  546. /** 下载模板操作 */
  547. importTemplate() {
  548. importTemplate().then(response => {
  549. this.download(response.msg);
  550. });
  551. },
  552. // 文件上传中处理
  553. handleFileUploadProgress(event, file, fileList) {
  554. this.upload.isUploading = true;
  555. },
  556. // 文件上传成功处理
  557. handleFileSuccess(response, file, fileList) {
  558. this.upload.open = false;
  559. this.upload.isUploading = false;
  560. this.$refs.upload.clearFiles();
  561. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  562. this.getList();
  563. },
  564. // 提交上传文件
  565. submitFileForm() {
  566. this.$refs.upload.submit();
  567. },
  568. /** 报告附件按钮操作 */
  569. handleDoc(row) {
  570. // 通过ref引用子组件
  571. const child = this.$refs.childRef;
  572. // 调用子组件的方法并传递参数
  573. child.handleDoc(row , 'personweekcheck');
  574. },
  575. /** 批量按钮操作 */
  576. handleBatchConfirm(row) {
  577. const ids = row.id || this.ids;
  578. this.$confirm('是否确认?', "警告", {
  579. confirmButtonText: "确定",
  580. cancelButtonText: "取消",
  581. type: "warning"
  582. }).then(function() {
  583. return batchConfirm(ids);
  584. }).then(() => {
  585. this.getList();
  586. this.msgSuccess("操作成功");
  587. })
  588. },
  589. /** 批量按钮操作 */
  590. handleBatchCancel(row) {
  591. const ids = row.id || this.ids;
  592. this.$confirm('是否取消确认?', "警告", {
  593. confirmButtonText: "确定",
  594. cancelButtonText: "取消",
  595. type: "warning"
  596. }).then(function() {
  597. return batchCancel(ids);
  598. }).then(() => {
  599. this.getList();
  600. this.msgSuccess("操作成功");
  601. })
  602. },
  603. selectAll() {
  604. this.plantIds = []
  605. if (this.checked) {
  606. this.plantOptions.map((item) => {
  607. this.plantIds.push(item.name)
  608. })
  609. } else {
  610. this.plantIds = []
  611. }
  612. if (this.plantIds.length == 0) {
  613. this.plantIds = ['']
  614. }
  615. },
  616. handleCommand(val) {
  617. if (this.plantIds.length == 0) {
  618. this.plantIds = ['']
  619. }
  620. val.forEach((item,index)=>{
  621. if(item===''){
  622. val.splice(index,1)
  623. }
  624. })
  625. if (val.length === this.plantOptions.length) {
  626. this.checked = true
  627. } else {
  628. this.checked = false
  629. }
  630. },
  631. }
  632. };
  633. </script>