You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

958 lines
32 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <div>
  4. <span @click="favoriteFunction()">
  5. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  6. </span>
  7. </div>
  8. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  9. <el-form-item :label="'计划编码'">
  10. <el-input v-model="searchData.planID" style="width: 120px"></el-input>
  11. </el-form-item>
  12. <el-form-item :label="'计划描述'">
  13. <el-input v-model="searchData.planDesc" style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'设备编码'">
  16. <el-input v-model="searchData.objectID" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'计划执行人员'">
  19. <el-input v-model="searchData.planOperatorName" style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'计划执行日期:'">
  22. <el-date-picker
  23. style="width: 120px"
  24. v-model="searchData.startDate"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item style="margin-top: 23px;">
  31. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-date-picker
  35. style="width: 120px"
  36. v-model="searchData.endDate"
  37. type="date"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item label=" ">
  43. <el-button @click="searchClick()">查询</el-button>
  44. <download-excel
  45. :fields="fields()"
  46. :data="exportData"
  47. type="xls"
  48. :name="exportName"
  49. :header="exportHeader"
  50. :footer="exportFooter"
  51. :fetch="createExportData"
  52. :before-generate="startDownload"
  53. :before-finish="finishDownload"
  54. worksheet="导出信息"
  55. class="el-button el-button--primary el-button--medium">
  56. {{ "导出" }}
  57. </download-excel>
  58. </el-form-item>
  59. </el-form>
  60. <el-table
  61. :height="height"
  62. :data="dataList"
  63. border
  64. v-loading="dataListLoading"
  65. style="width: 100%;">
  66. <el-table-column
  67. v-for="(item,index) in columnList" :key="index"
  68. :sortable="item.columnSortable"
  69. :prop="item.columnProp"
  70. :header-align="item.headerAlign"
  71. :show-overflow-tooltip="item.showOverflowTooltip"
  72. :align="item.align"
  73. :fixed="item.fixed==''?false:item.fixed"
  74. :min-width="item.columnWidth"
  75. :label="item.columnLabel">
  76. <template slot-scope="scope">
  77. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  78. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column
  82. prop=""
  83. header-align="center"
  84. align="center"
  85. min-width="100"
  86. fixed="right"
  87. label="操作">
  88. <template slot-scope="scope">
  89. <a type="text" size="small" v-if="scope.row.status=='未开工'" @click="reportModal(scope.row)">执行</a>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. <el-pagination
  94. @size-change="sizeChangeHandle"
  95. @current-change="currentChangeHandle"
  96. :current-page="pageIndex"
  97. :page-sizes="[20, 100, 500, 1000]"
  98. :page-size="pageSize"
  99. :total="totalPage"
  100. layout="total, sizes, prev, pager, next, jumper">
  101. </el-pagination>
  102. <el-dialog title="执行点检工单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1200px">
  103. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  104. <el-form-item :label="'工厂编码'">
  105. <el-input v-model="saveData.site" disabled style="width: 120px"></el-input>
  106. </el-form-item>
  107. <el-form-item :label="'工单号'">
  108. <el-input v-model="saveData.orderNo" disabled style="width: 120px"></el-input>
  109. </el-form-item>
  110. <el-form-item :label="'计划执行人员'">
  111. <el-input v-model="saveData.planOperatorName" disabled style="width: 120px"></el-input>
  112. </el-form-item>
  113. <el-form-item :label="'执行日期:'">
  114. <el-date-picker style="width: 150px" v-model="saveData.startDate" type="datetime"
  115. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="开始日期">
  116. </el-date-picker>
  117. -
  118. <el-date-picker style="width: 150px" v-model="saveData.endDate" type="datetime"
  119. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="结束日期">
  120. </el-date-picker>
  121. </el-form-item>
  122. <el-form-item :label="'工作时长(m)'">
  123. <el-input v-model="saveData.workTime" type="number" readonly :min="0" style="width: 60px"></el-input>
  124. </el-form-item>
  125. <el-form-item :label="'执行结果备注'">
  126. <el-input v-model="saveData.remark" style="width: 200px"></el-input>
  127. </el-form-item>
  128. <el-form-item :label="'点检结论'">
  129. <el-select v-model="saveData.checkResult" style="width: 100px" placeholder="请选择">
  130. <el-option label="合格" value="合格"></el-option>
  131. <el-option label="不合格" value="不合格"></el-option>
  132. </el-select>
  133. </el-form-item>
  134. </el-form>
  135. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  136. <el-button type="primary" @click="">点检单</el-button>
  137. <el-button type="primary" @click="queryHistoryRecord()">点检记录</el-button>
  138. </el-form>
  139. <div class="rq ">
  140. <el-table
  141. :height="400"
  142. :data="detailList"
  143. border
  144. v-loading="dataListLoading"
  145. style="width: 100%;">
  146. <el-table-column
  147. v-for="(item,index) in columnDetailList" :key="index"
  148. :sortable="item.columnSortable"
  149. :prop="item.columnProp"
  150. :header-align="item.headerAlign"
  151. :show-overflow-tooltip="item.showOverflowTooltip"
  152. :align="item.align"
  153. :fixed="item.fixed==''?false:item.fixed"
  154. :min-width="item.columnWidth"
  155. :label="item.columnLabel">
  156. <template slot-scope="scope">
  157. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  158. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. prop=""
  163. header-align="center"
  164. align="right"
  165. min-width="80"
  166. label="实测值">
  167. <template slot-scope="scope">
  168. <el-input v-if="scope.row.valueTypeDb=='T'&&scope.row.valueChooseFlag=='N'" v-model="scope.row.textValue" style="height: 11px;padding: 0px " filterable allow-create>;width:98%"></el-input>
  169. <el-input v-if="scope.row.valueTypeDb=='N'&&scope.row.valueChooseFlag=='N'" v-model="scope.row.numberValue" type="number" style="height: 11px;padding: 0px " filterable allow-create>;width:98%"></el-input>
  170. <el-select v-if="scope.row.valueTypeDb=='T'&&scope.row.valueChooseFlag=='Y'" v-model="scope.row.textValue" placeholder="请选择" style="height: 11px;padding: 0px " filterable allow-create>
  171. <el-option
  172. v-for="item in scope.row.availableList"
  173. :key="index"
  174. :label="item.availableValue"
  175. :value="item.availableValue">
  176. </el-option>
  177. </el-select>
  178. <el-select v-if="scope.row.valueTypeDb=='N'&&scope.row.valueChooseFlag=='Y'" v-model="scope.row.numberValue" placeholder="请选择" style="height: 11px;padding: 0px " filterable allow-create>
  179. <el-option
  180. v-for="item in scope.row.availableList"
  181. :key="index"
  182. :label="item.availableValue"
  183. :value="item.availableValue">
  184. </el-option>
  185. </el-select>
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. prop=""
  190. header-align="center"
  191. align="right"
  192. min-width="80"
  193. label="检验结论">
  194. <template slot-scope="scope">
  195. <el-select v-model="scope.row.itemResult" style="height: 11px;padding: 0px" placeholder="合格">
  196. <el-option label="合格" value="合格" style="color: green"></el-option>
  197. <el-option label="不合格" value="不合格" style="color: red"></el-option>
  198. </el-select>
  199. </template>
  200. </el-table-column>
  201. </el-table>
  202. </div>
  203. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  204. <el-button type="primary" @click="saveCheckReport()">保存</el-button>
  205. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  206. </el-footer>
  207. </el-dialog>
  208. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  209. </div>
  210. </template>
  211. <script>
  212. import {
  213. eamWorkOrderSearch,
  214. eamWorkOrderItemSearch,
  215. saveCheckOrderReport,
  216. queryHistoryRecord, // 查询设备的点检历史记录
  217. } from "@/api/eam/eam.js"
  218. import Chooselist from '@/views/modules/common/Chooselist_eam'
  219. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  220. export default {
  221. components: {
  222. Chooselist
  223. },
  224. watch: {
  225. saveData: {
  226. deep: true,
  227. handler: function (newV, oldV) {
  228. this.saveData.workTime = Math.ceil(Math.floor(this.dayjs(this.saveData.endDate).diff(this.saveData.startDate, 'seconds') / 30) / 2)
  229. }
  230. },
  231. searchData: {
  232. deep: true,
  233. handler: function (newV, oldV) {
  234. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  235. }
  236. },
  237. modalData: {
  238. deep: true,
  239. handler: function (newV, oldV) {
  240. this.modalData.groupID = this.modalData.groupID.toUpperCase()
  241. }
  242. }
  243. },
  244. data () {
  245. return {
  246. // 是否收藏
  247. favorite: false,
  248. tagNo:'',
  249. // 导出 start
  250. exportData: [],
  251. exportName: "点检执行" + this.dayjs().format('YYYYMMDDHHmmss'),
  252. exportHeader: ["点检执行"],
  253. exportFooter: [],
  254. exportList:[],
  255. // 导出 end
  256. searchData: {
  257. site: this.$store.state.user.site,
  258. orderNo: '',
  259. planID: '',
  260. planDesc: '',
  261. objectID: '',
  262. planOperator: '',
  263. functionType: 'A',
  264. status: '未开工',
  265. startDate: '',
  266. planDate: new Date(),
  267. endDate: '',
  268. page: 1,
  269. limit: 10,
  270. },
  271. height: 200,
  272. pageIndex: 1,
  273. pageSize: 100,
  274. totalPage: 0,
  275. dataList: [],
  276. dataListLoading: false,
  277. dataListSelections: [],
  278. modalFlag:false,
  279. modalDisableFlag:false,
  280. modalData:{
  281. flag:'',
  282. site: this.$store.state.user.site,
  283. groupID:'',
  284. groupDesc:'',
  285. active:'',
  286. },
  287. departmentList:[],
  288. // 展示列集
  289. columnList: [
  290. {
  291. userId: this.$store.state.user.name,
  292. functionId: 101019,
  293. serialNumber: '101019TableOrderNo',
  294. tableId: "101019Table",
  295. tableName: "common",
  296. columnProp: 'planID',
  297. headerAlign: "center",
  298. align: "center",
  299. columnLabel: '计划编码',
  300. columnHidden: false,
  301. columnImage: false,
  302. columnSortable: false,
  303. sortLv: 0,
  304. status: true,
  305. fixed: '',
  306. },
  307. {
  308. userId: this.$store.state.user.name,
  309. functionId: 101019,
  310. serialNumber: '101019TableOrderNo',
  311. tableId: "101019Table",
  312. tableName: "common",
  313. columnProp: 'planDesc',
  314. headerAlign: "center",
  315. align: "center",
  316. columnLabel: '计划描述',
  317. columnHidden: false,
  318. columnImage: false,
  319. columnSortable: false,
  320. sortLv: 0,
  321. status: true,
  322. fixed: '',
  323. },
  324. {
  325. userId: this.$store.state.user.name,
  326. functionId: 101019,
  327. serialNumber: '101019TableActualPlanDate',
  328. tableId: "101019Table",
  329. tableName: "common",
  330. columnProp: 'planDate',
  331. headerAlign: "center",
  332. align: "center",
  333. columnLabel: '计划执行日期',
  334. columnHidden: false,
  335. columnImage: false,
  336. columnSortable: false,
  337. sortLv: 0,
  338. status: true,
  339. fixed: '',
  340. },
  341. {
  342. userId: this.$store.state.user.name,
  343. functionId: 101019,
  344. serialNumber: '101019TableOrderNo',
  345. tableId: "101019Table",
  346. tableName: "common",
  347. columnProp: 'orderNo',
  348. headerAlign: "center",
  349. align: "center",
  350. columnLabel: '工单编码',
  351. columnHidden: false,
  352. columnImage: false,
  353. columnSortable: false,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. },
  358. {
  359. userId: this.$store.state.user.name,
  360. functionId: 101019,
  361. serialNumber: '101019TablePlanID',
  362. tableId: "101019Table",
  363. tableName: "common",
  364. columnProp: 'planID',
  365. headerAlign: "center",
  366. align: "center",
  367. columnLabel: '计划编码',
  368. columnHidden: false,
  369. columnImage: false,
  370. columnSortable: false,
  371. sortLv: 0,
  372. status: true,
  373. fixed: '',
  374. },
  375. {
  376. userId: this.$store.state.user.name,
  377. functionId: 101019,
  378. serialNumber: '101019TablePropertiesCode',
  379. tableId: "101019Table",
  380. tableName: "common",
  381. columnProp: 'propertiesCode',
  382. headerAlign: "center",
  383. align: "center",
  384. columnLabel: '模板编码',
  385. columnHidden: false,
  386. columnImage: false,
  387. columnSortable: false,
  388. sortLv: 0,
  389. status: true,
  390. fixed: '',
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 101019,
  395. serialNumber: '101019TableObjectID',
  396. tableId: "101019Table",
  397. tableName: "common",
  398. columnProp: 'objectID',
  399. headerAlign: "center",
  400. align: "center",
  401. columnLabel: '设备编码',
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. },
  409. {
  410. userId: this.$store.state.user.name,
  411. functionId: 101019,
  412. serialNumber: '101019TableStatus',
  413. tableId: "101019Table",
  414. tableName: "common",
  415. columnProp: 'status',
  416. headerAlign: "center",
  417. align: "center",
  418. columnLabel: '状态',
  419. columnHidden: false,
  420. columnImage: false,
  421. columnSortable: false,
  422. sortLv: 0,
  423. status: true,
  424. fixed: '',
  425. },
  426. {
  427. userId: this.$store.state.user.name,
  428. functionId: 101019,
  429. serialNumber: '101019TablePlanOperatorName',
  430. tableId: "101019Table",
  431. tableName: "common",
  432. columnProp: 'planOperatorName',
  433. headerAlign: "center",
  434. align: "center",
  435. columnLabel: '计划机修人员',
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. },
  443. {
  444. userId: this.$store.state.user.name,
  445. functionId: 101019,
  446. serialNumber: '101019TableActualOperatorName',
  447. tableId: "101019Table",
  448. tableName: "common",
  449. columnProp: 'actualOperatorName',
  450. headerAlign: "center",
  451. align: "center",
  452. columnLabel: '实际机修人员',
  453. columnHidden: false,
  454. columnImage: false,
  455. columnSortable: false,
  456. sortLv: 0,
  457. status: true,
  458. fixed: '',
  459. },
  460. {
  461. userId: this.$store.state.user.name,
  462. functionId: 101019,
  463. serialNumber: '101019TableActualOperatorName',
  464. tableId: "101019Table",
  465. tableName: "common",
  466. columnProp: 'checkerName',
  467. headerAlign: "center",
  468. align: "center",
  469. columnLabel: '审核人员',
  470. columnHidden: false,
  471. columnImage: false,
  472. columnSortable: false,
  473. sortLv: 0,
  474. status: true,
  475. fixed: '',
  476. },
  477. {
  478. userId: this.$store.state.user.name,
  479. functionId: 101019,
  480. serialNumber: '101019TableActualActualDate',
  481. tableId: "101019Table",
  482. tableName: "common",
  483. columnProp: 'actualDate',
  484. headerAlign: "center",
  485. align: "center",
  486. columnLabel: '实际执行时间',
  487. columnHidden: false,
  488. columnImage: false,
  489. columnSortable: false,
  490. sortLv: 0,
  491. status: true,
  492. fixed: '',
  493. },
  494. {
  495. userId: this.$store.state.user.name,
  496. functionId: 101019,
  497. serialNumber: '101019TableWorkTime',
  498. tableId: "101019Table",
  499. tableName: "common",
  500. columnProp: 'workTime',
  501. headerAlign: "center",
  502. align: "center",
  503. columnLabel: '工作时间',
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: '',
  510. },
  511. {
  512. userId: this.$store.state.user.name,
  513. functionId: 101019,
  514. serialNumber: '101019TableActualRemark',
  515. tableId: "101019Table",
  516. tableName: "common",
  517. columnProp: 'remark',
  518. headerAlign: "center",
  519. align: "center",
  520. columnLabel: '备注',
  521. columnHidden: false,
  522. columnImage: false,
  523. columnSortable: false,
  524. sortLv: 0,
  525. status: true,
  526. fixed: '',
  527. },
  528. ],
  529. detailModelFlag:false,
  530. detailList:[],
  531. saveData:{
  532. site:'',
  533. orderNo:'',
  534. planOperatorName:'',
  535. startDate: '',
  536. endDate: '',
  537. workTime:'',
  538. remark:'',
  539. mesUser:'',
  540. planID:'',
  541. itemList:[],
  542. checkResult: ''
  543. },
  544. columnDetailList: [
  545. {
  546. userId: this.$store.state.user.name,
  547. functionId: 101019,
  548. serialNumber: '101019Table2EamPropertiesItemID',
  549. tableId: "101019Table2",
  550. tableName: "点检项目表",
  551. columnProp: 'itemNo',
  552. headerAlign: "center",
  553. align: "center",
  554. columnLabel: '点检项目编码',
  555. columnHidden: false,
  556. columnImage: false,
  557. columnSortable: false,
  558. sortLv: 0,
  559. status: true,
  560. fixed: '',
  561. columnWidth: 60,
  562. },
  563. {
  564. userId: this.$store.state.user.name,
  565. functionId: 101019,
  566. serialNumber: '101019Table2EamPropertiesItemDesc',
  567. tableId: "101019Table2",
  568. tableName: "点检项目表",
  569. columnProp: 'itemDesc',
  570. headerAlign: "center",
  571. align: "center",
  572. columnLabel: '点检项目名称',
  573. columnHidden: false,
  574. columnImage: false,
  575. columnSortable: false,
  576. sortLv: 0,
  577. status: true,
  578. fixed: '',
  579. columnWidth: 150,
  580. },
  581. {
  582. userId: this.$store.state.user.name,
  583. functionId: 101019,
  584. serialNumber: '101019Table2EamPropertiesItemRemark',
  585. tableId: "101019Table2",
  586. tableName: "点检项目表",
  587. columnProp: 'itemRemark',
  588. headerAlign: "center",
  589. align: "center",
  590. columnLabel: '点检方法说明',
  591. columnHidden: false,
  592. columnImage: false,
  593. columnSortable: false,
  594. sortLv: 0,
  595. status: true,
  596. fixed: '',
  597. columnWidth: 150,
  598. },
  599. {
  600. userId: this.$store.state.user.name,
  601. functionId: 101019,
  602. serialNumber: '101019Table2ValueType',
  603. tableId: "101019Table2",
  604. tableName: "点检项目表",
  605. columnProp: 'valueType',
  606. headerAlign: "center",
  607. align: "center",
  608. columnLabel: '检测值类型',
  609. columnHidden: false,
  610. columnImage: false,
  611. columnSortable: false,
  612. sortLv: 0,
  613. status: true,
  614. fixed: '',
  615. columnWidth: 70,
  616. },
  617. {
  618. userId: this.$store.state.user.name,
  619. functionId: 101019,
  620. serialNumber: '101019Table2DefaultValue',
  621. tableId: "101019Table2",
  622. tableName: "点检项目表",
  623. columnProp: 'defaultValue',
  624. headerAlign: "center",
  625. align: "center",
  626. columnLabel: '参照值',
  627. columnHidden: false,
  628. columnImage: false,
  629. columnSortable: false,
  630. sortLv: 0,
  631. status: true,
  632. fixed: '',
  633. columnWidth: 70,
  634. },
  635. {
  636. userId: this.$store.state.user.name,
  637. functionId: 101019,
  638. serialNumber: '101019Table2MaxValue',
  639. tableId: "101019Table2",
  640. tableName: "点检项目表",
  641. columnProp: 'maxValue',
  642. headerAlign: "center",
  643. align: "center",
  644. columnLabel: '最大值',
  645. columnHidden: false,
  646. columnImage: false,
  647. columnSortable: false,
  648. sortLv: 0,
  649. status: true,
  650. fixed: '',
  651. columnWidth: 70,
  652. },
  653. {
  654. userId: this.$store.state.user.name,
  655. functionId: 101019,
  656. serialNumber: '101019Table2MinValue',
  657. tableId: "101019Table2",
  658. tableName: "点检项目表",
  659. columnProp: 'minValue',
  660. headerAlign: "center",
  661. align: "center",
  662. columnLabel: '最小值',
  663. columnHidden: false,
  664. columnImage: false,
  665. columnSortable: false,
  666. sortLv: 0,
  667. status: true,
  668. fixed: '',
  669. columnWidth: 70,
  670. },
  671. ],
  672. HistoryRecordList: [],
  673. HistoryModelFlag: false
  674. }
  675. },
  676. mounted () {
  677. this.$nextTick(() => {
  678. this.height = window.innerHeight - 210
  679. })
  680. },
  681. created () {
  682. this.favoriteIsOk()
  683. this.getDataList()
  684. },
  685. methods: {
  686. // 校验用户是否收藏
  687. favoriteIsOk() {
  688. let userFavorite = {
  689. userId: this.$store.state.user.id,
  690. languageCode: this.$i18n.locale
  691. }
  692. console.log(this.$route.meta.menuId)
  693. userFavoriteList(userFavorite).then(({data}) => {
  694. for (let i = 0; i < data.list.length; i++) {
  695. // let flag=false;
  696. if(this.$route.meta.menuId==data.list[i].menuId){
  697. this.favorite = true
  698. // flag=true;
  699. }
  700. }
  701. })
  702. },
  703. // 收藏 OR 取消收藏
  704. favoriteFunction() {
  705. let userFavorite = {
  706. userId: this.$store.state.user.id,
  707. functionId: this.$route.meta.menuId,
  708. }
  709. if (this.favorite) {
  710. // 取消收藏
  711. // this.$confirm(`确定取消收藏`, '提示', {
  712. // confirmButtonText: '确定',
  713. // cancelButtonText: '取消',
  714. // type: 'warning'
  715. // }).then(() => {
  716. removeUserFavorite(userFavorite).then(({data}) => {
  717. this.$message.success(data.msg)
  718. this.favorite = false
  719. })
  720. // })
  721. } else {
  722. // 收藏
  723. saveUserFavorite(userFavorite).then(({data}) => {
  724. this.$message.success(data.msg)
  725. this.favorite = true
  726. })
  727. }
  728. },
  729. // 获取基础数据列表S
  730. getBaseList (val,type) {
  731. this.tagNo = val
  732. this.$nextTick(() => {
  733. let strVal = ''
  734. if (val === 201) {
  735. strVal = this.searchData.planOperator
  736. this.$refs.baseList.init(val, strVal)
  737. }
  738. })
  739. },
  740. /* 列表方法的回调 */
  741. getBaseData (val) {
  742. if (this.tagNo === 201) {
  743. this.searchData.planOperator = val.AdminID
  744. }
  745. },
  746. // 重置查询时间
  747. searchClick(){
  748. this.searchData.planDate = ''
  749. this.getDataList()
  750. },
  751. // 获取数据列表
  752. getDataList () {
  753. this.searchData.limit = this.pageSize
  754. this.searchData.page = this.pageIndex
  755. eamWorkOrderSearch(this.searchData).then(({data}) => {
  756. if (data.code == 0) {
  757. this.dataList = data.page.list
  758. this.pageIndex = data.page.currPage
  759. this.pageSize = data.page.pageSize
  760. this.totalPage = data.page.totalCount
  761. }
  762. this.dataListLoading = false
  763. })
  764. },
  765. //导出excel
  766. async createExportData() {
  767. this.searchData.limit = -1
  768. this.searchData.page = 1
  769. await eamWorkOrderSearch(this.searchData).then(({data}) => {
  770. this.exportList= data.page.list;
  771. })
  772. return this.exportList;
  773. },
  774. startDownload() {
  775. // this.exportData = this.dataList
  776. },
  777. finishDownload() {
  778. },
  779. fields() {
  780. let json = "{"
  781. this.columnList.forEach((item, index) => {
  782. if (index == this.columnList.length - 1) {
  783. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  784. } else {
  785. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  786. }
  787. })
  788. json += "}"
  789. let s = eval("(" + json + ")")
  790. return s
  791. },
  792. // 导出 end
  793. // 每页数
  794. sizeChangeHandle (val) {
  795. this.pageSize = val
  796. this.pageIndex = 1
  797. this.getDataList()
  798. },
  799. // 当前页
  800. currentChangeHandle (val) {
  801. this.pageIndex = val
  802. this.getDataList()
  803. },
  804. // 多选
  805. selectionChangeHandle (val) {
  806. this.dataListSelections = val
  807. },
  808. reportModal(row){
  809. let indata = {
  810. site:row.site,
  811. itemNo:row.itemNo,
  812. planID:row.planID,
  813. orderNo:row.orderNo,
  814. itemType:row.functionType,
  815. objectID:row.objectID
  816. }
  817. eamWorkOrderItemSearch(indata).then(({data}) => {
  818. this.detailList = data.rows
  819. })
  820. this.saveData = {
  821. site: row.site,
  822. orderNo: row.orderNo,
  823. planID: row.planID,
  824. objectID: row.objectID,
  825. planOperatorName: row.planOperatorName,
  826. workTime: '',
  827. remark: '',
  828. mesUser: this.$store.state.user.name,
  829. itemList: [],
  830. checkResult: ''
  831. },
  832. this.detailModelFlag = true;
  833. },
  834. async saveCheckReport(){
  835. if(this.saveData.checkResult == ''||this.saveData.checkResult == null){
  836. this.$alert('请选择点检结论!', '错误', {
  837. confirmButtonText: '确定'
  838. })
  839. return false
  840. }
  841. if(this.saveData.startDate==''||this.saveData.startDate==null){
  842. this.$alert('请输入开始时间!', '错误', {
  843. confirmButtonText: '确定'
  844. })
  845. return false
  846. }
  847. if(this.saveData.endDate==''||this.saveData.endDate==null){
  848. this.$alert('请输入结束时间!', '错误', {
  849. confirmButtonText: '确定'
  850. })
  851. return false
  852. }
  853. if(this.saveData.workTime == 0){
  854. this.$alert('工作时长不能为0!', '错误', {
  855. confirmButtonText: '确定'
  856. })
  857. return false
  858. }
  859. if(this.saveData.workTime < 0){
  860. this.$alert('工作时长不能小于0', '错误', {
  861. confirmButtonText: '确定'
  862. })
  863. return false
  864. }
  865. for (let i = 0; i < this.detailList.length; i++) {
  866. if(this.detailList[i].valueTypeDb == 'N' && (this.detailList[i].numberValue == '' || this.detailList[i].numberValue == null)){
  867. this.$alert(this.detailList[i].itemDesc+'实测值未填写!', '错误', {
  868. confirmButtonText: '确定'
  869. })
  870. return false
  871. }
  872. if(this.detailList[i].itemResult == '' || this.detailList[i].itemResult == null){
  873. this.detailList[i].itemResult = '合格'
  874. }
  875. // if(this.detailList[i].valueTypeDb == 'T' && (this.detailList[i].textValue == '' || this.detailList[i].textValue == null)){
  876. // this.$alert(this.detailList[i].itemDesc+'实测值未填写!', '错误', {
  877. // confirmButtonText: '确定'
  878. // })
  879. // return false
  880. // }
  881. if(this.detailList[i].valueTypeDb == 'N' && this.detailList[i].numberValue != '' && this.detailList[i].numberValue != null){
  882. if(this.detailList[i].minValue != "" && this.detailList[i].minValue != null && this.detailList[i].minValue > this.detailList[i].numberValue){
  883. await this.$confirm(this.detailList[i].itemDesc+'实测值小于最小值!是否继续', '提示', {
  884. confirmButtonText: '确定',
  885. cancelButtonText: '取消',
  886. type: 'warning'
  887. }).then(() => {
  888. }).then(() =>{
  889. return false
  890. })
  891. }
  892. if(this.detailList[i].minValue!=""&&this.detailList[i].minValue!=null&&this.detailList[i].maxValue<this.detailList[i].numberValue){
  893. // this.$alert(this.detailList[i].itemDesc+'实测值大于最大值!', '错误', {
  894. // confirmButtonText: '确定'
  895. // })
  896. // return false
  897. await this.$confirm(this.detailList[i].itemDesc+'实测值大于最大值!是否继续', '提示', {
  898. confirmButtonText: '确定',
  899. cancelButtonText: '取消',
  900. type: 'warning'
  901. }).then(() => {
  902. }).then(() =>{
  903. return false
  904. })
  905. }
  906. }
  907. }
  908. this.saveData.itemList = JSON.parse(JSON.stringify(this.detailList))
  909. await saveCheckOrderReport(this.saveData).then(({data}) => {
  910. if (data && data.code == '0') {
  911. this.getDataList()
  912. this.detailModelFlag=false
  913. this.$message({
  914. message: '操作成功',
  915. type: 'success',
  916. duration: 1500,
  917. onClose: () => {
  918. }
  919. })
  920. } else {
  921. this.$alert(data.msg, '错误', {
  922. confirmButtonText: '确定'
  923. })
  924. }
  925. })
  926. },
  927. //查询设备的点检记录
  928. queryHistoryRecord(){
  929. let tempData = {
  930. site: this.saveData.site,
  931. objectID: this.saveData.objectID,
  932. functionType: 'A'
  933. }
  934. queryHistoryRecord(tempData).then(({data}) => {
  935. this.HistoryRecordList = data.rows
  936. })
  937. this.HistoryModelFlag = true
  938. },
  939. }
  940. }
  941. </script>
  942. <style >
  943. </style>