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.

1182 lines
39 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
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  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.objectID" style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'计划执行人员'">
  16. <el-input v-model="searchData.planOperator" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'状态'">
  19. <el-select filterable v-model="searchData.status" style="width: 130px">
  20. <el-option label="全部" value=""></el-option>
  21. <el-option label="未开工" value="未开工"></el-option>
  22. <el-option label="已完工" value="已完工"></el-option>
  23. <el-option label="已取消" value="已取消"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item :label="'计划执行日期:'">
  27. <el-date-picker
  28. style="width: 120px"
  29. v-model="searchData.startDate"
  30. :picker-options="pickerOptions"
  31. type="date"
  32. value-format="yyyy-MM-dd"
  33. placeholder="选择日期">
  34. </el-date-picker>
  35. </el-form-item>
  36. <el-form-item style="margin-top: 23px;">
  37. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  38. </el-form-item>
  39. <el-form-item :label="' '">
  40. <el-date-picker
  41. style="width: 120px"
  42. v-model="searchData.endDate"
  43. :picker-options="pickerOptions"
  44. type="date"
  45. value-format="yyyy-MM-dd"
  46. placeholder="选择日期">
  47. </el-date-picker>
  48. </el-form-item>
  49. <el-form-item :label="' '">
  50. <el-button @click="searchClick()">查询</el-button>
  51. <el-button type="primary" @click="changeModel()">更改机修人员</el-button>
  52. <download-excel
  53. :fields="fields()"
  54. :data="exportData"
  55. type="xls"
  56. :name="exportName"
  57. :header="exportHeader"
  58. :footer="exportFooter"
  59. :fetch="createExportData"
  60. :before-generate="startDownload"
  61. :before-finish="finishDownload"
  62. worksheet="导出信息"
  63. class="el-button el-button--primary el-button--medium">
  64. {{ "导出" }}
  65. </download-excel>
  66. </el-form-item>
  67. </el-form>
  68. <el-table
  69. :height="height"
  70. :data="dataList"
  71. border
  72. v-loading="dataListLoading"
  73. @selection-change="selectionChangeHandle"
  74. style="width: 100%;">
  75. <el-table-column
  76. type="selection"
  77. header-align="center"
  78. align="center"
  79. :selectable="selectFlag"
  80. width="50">
  81. </el-table-column>
  82. <el-table-column
  83. prop="checkResult"
  84. header-align="center"
  85. align="center"
  86. label="维保结论"
  87. width="60">
  88. <template slot-scope="scope">
  89. <div :style="{ color: scope.row.checkResult =='合格' ? 'green' : scope.row.checkResult =='异常' ? 'red' : ''}">
  90. {{ scope.row.checkResult }}
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. v-for="(item,index) in columnList" :key="index"
  96. :sortable="item.columnSortable"
  97. :prop="item.columnProp"
  98. :header-align="item.headerAlign"
  99. :show-overflow-tooltip="item.showOverflowTooltip"
  100. :align="item.align"
  101. :fixed="item.fixed==''?false:item.fixed"
  102. :min-width="item.columnWidth"
  103. :label="item.columnLabel">
  104. <template slot-scope="scope">
  105. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  106. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. fixed="right"
  111. header-align="center"
  112. align="center"
  113. width="100"
  114. label="操作">
  115. <template slot-scope="scope">
  116. <!-- <a type="text" size="small" v-if="scope.row.status=='待审核'" @click="checkModal(scope.row)">审核</a>-->
  117. <a type="text" size="small" v-if="scope.row.status==='未开工'" @click="cancelOrder(scope.row)">取消工单</a>
  118. <a type="text" size="small" v-if="scope.row.status==='已完工' || scope.row.status==='待审核'" @click="reportModal(scope.row)">详情</a>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <el-pagination
  123. @size-change="sizeChangeHandle"
  124. @current-change="currentChangeHandle"
  125. :current-page="pageIndex"
  126. :page-sizes="[20, 100, 500, 1000]"
  127. :page-size="pageSize"
  128. :total="totalPage"
  129. layout="total, sizes, prev, pager, next, jumper">
  130. </el-pagination>
  131. <el-dialog title="执行结果" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1200px">
  132. <el-form :inline="true" label-position="top" >
  133. <el-form-item :label="'工厂编码'">
  134. <el-input v-model="saveData.site" disabled style="width: 120px"></el-input>
  135. </el-form-item>
  136. <el-form-item :label="'工单号'">
  137. <el-input v-model="saveData.orderNo" disabled style="width: 120px"></el-input>
  138. </el-form-item>
  139. <el-form-item :label="'计划执行人员'">
  140. <el-input v-model="saveData.planOperatorName" disabled style="width: 120px"></el-input>
  141. </el-form-item>
  142. <el-form-item :label="'实际执行人员'">
  143. <el-input v-model="saveData.actualOperatorName" disabled style="width: 120px"></el-input>
  144. </el-form-item>
  145. <el-form-item :label="'维保结论'">
  146. <el-input v-model="saveData.checkResult" disabled style="width: 120px"></el-input>
  147. </el-form-item>
  148. <el-form-item v-if="this.saveData.checkResult === '异常'" :label="'异常原因'">
  149. <el-input v-model="saveData.disposalMeasures" disabled style="width: 120px"></el-input>
  150. </el-form-item>
  151. </el-form>
  152. <el-form :inline="true" label-position="top" >
  153. <el-form-item :label="'工作时间'">
  154. <el-input v-model="saveData.workTime" type="number" disabled style="width: 120px"></el-input>
  155. </el-form-item>
  156. <el-form-item :label="'执行结果备注'">
  157. <el-input v-model="saveData.remark" disabled style="width: 523px"></el-input>
  158. </el-form-item>
  159. <el-form-item :label="' '">
  160. <el-button v-if="saveData.status === '已完工'" type="primary" @click="checkModal()">取消审核</el-button>
  161. <el-button v-if="saveData.status === '待审核'" type="primary" @click="checkModal()">审核</el-button>
  162. </el-form-item>
  163. </el-form>
  164. <div class="rq ">
  165. <el-table
  166. :height="400"
  167. :data="detailList"
  168. border
  169. v-loading="dataListLoading"
  170. style="width: 100%;">
  171. <el-table-column
  172. prop=""
  173. header-align="center"
  174. align="center"
  175. min-width="40"
  176. label="操作">
  177. <template slot-scope="scope">
  178. <el-button class="el-icon-picture-outline" type="primary" @click="checkItemImageModal(scope.row)"></el-button>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. v-for="(item,index) in columnDetailList" :key="index"
  183. :sortable="item.columnSortable"
  184. :prop="item.columnProp"
  185. :header-align="item.headerAlign"
  186. :show-overflow-tooltip="item.showOverflowTooltip"
  187. :align="item.align"
  188. :fixed="item.fixed==''?false:item.fixed"
  189. :min-width="item.columnWidth"
  190. :label="item.columnLabel">
  191. <template slot-scope="scope">
  192. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  193. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  194. </template>
  195. </el-table-column>
  196. <!-- <el-table-column-->
  197. <!-- prop=""-->
  198. <!-- header-align="center"-->
  199. <!-- align="center"-->
  200. <!-- min-width="80"-->
  201. <!-- label="是否完成">-->
  202. <!-- <template slot-scope="scope">-->
  203. <!-- {{scope.row.finishFlag=='Y'?"是":"否"}}-->
  204. <!-- </template>-->
  205. <!-- </el-table-column>-->
  206. <el-table-column
  207. prop=""
  208. header-align="center"
  209. align="right"
  210. min-width="80"
  211. label="检验结论">
  212. <template slot-scope="scope">
  213. <el-select v-model="scope.row.itemResult" disabled style="height: 11px;padding: 0px">
  214. <el-option label="合格" value="合格"></el-option>
  215. <el-option label="不合格" value="不合格"></el-option>
  216. </el-select>
  217. </template>
  218. </el-table-column>
  219. </el-table>
  220. </div>
  221. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  222. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  223. </el-footer>
  224. </el-dialog>
  225. <el-dialog title="批量修改计划人员" :close-on-click-modal="false" v-drag :visible.sync="changeModelFlag" width="300px">
  226. <el-form :inline="true" label-position="top">
  227. <el-form-item style="margin-left: 10px">
  228. <span slot="label" style="" @click="getBaseList(201)"><a herf="#">计划执行人员</a></span>
  229. <el-input v-model="planOperator" style="width: 120px"></el-input>
  230. </el-form-item>
  231. <el-form-item :label="'人员名称'">
  232. <el-input v-model="planOperatorName" disabled style="width: 120px"></el-input>
  233. </el-form-item>
  234. </el-form>
  235. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  236. <el-button type="primary" @click="changeOrderOperator()">保存</el-button>
  237. <el-button type="primary" @click="changeModelFlag = false">关闭</el-button>
  238. </el-footer>
  239. </el-dialog>
  240. <el-dialog title="取消工单" :close-on-click-modal="false" v-drag :visible.sync="cancelModelFlag" width="375px">
  241. <el-form :inline="true" label-position="top">
  242. <el-form-item :label="' '">
  243. <h>是否取消选定工单?</h>
  244. </el-form-item>
  245. <el-form-item :label="' '">
  246. <input type="checkbox" value="Y" name="addWorkOrderRule" v-model="cancelData.cancelAll"/>
  247. </el-form-item>
  248. </el-form>
  249. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  250. <el-button type="primary" @click="cancelOrder2()">确定</el-button>
  251. <el-button type="primary" @click="cancelModelFlag = false">取消</el-button>
  252. </el-footer>
  253. </el-dialog>
  254. <el-dialog title="图片查看" :close-on-click-modal="false" v-drag :visible.sync="imageModalFlag" width="390px" style="height: 550px;">
  255. <div v-viewer>
  256. <img v-for="(item, index) in descImages" :src="item" :key="index" style="width: 100px;height: 100px"/>
  257. </div>
  258. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  259. <el-button type="primary" @click="imageModalFlag = false">关闭</el-button>
  260. </el-footer>
  261. </el-dialog>
  262. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  263. </div>
  264. </template>
  265. <script>
  266. import {
  267. eamWorkOrderSearch,
  268. cancelOrder,
  269. changeOrderOperator,
  270. eamWorkOrderReportSearch,
  271. selectNameByMes,
  272. checkWorkOrder,
  273. searchFileUrl
  274. } from "@/api/eam/eam.js"
  275. import Chooselist from '@/views/modules/common/Chooselist_eam'
  276. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  277. export default {
  278. components: {
  279. Chooselist
  280. },
  281. watch: {
  282. searchData: {
  283. deep: true,
  284. handler: function (newV, oldV) {
  285. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  286. }
  287. },
  288. modalData: {
  289. deep: true,
  290. handler: function (newV, oldV) {
  291. this.modalData.groupID = this.modalData.groupID.toUpperCase()
  292. }
  293. }
  294. },
  295. data () {
  296. return {
  297. // 是否收藏
  298. favorite: false,
  299. // 导出 start
  300. exportData: [],
  301. exportName: "维保工单" + this.dayjs().format('YYYYMMDDHHmmss'),
  302. exportHeader: ["维保工单"],
  303. exportFooter: [],
  304. exportList:[],
  305. // 导出 end
  306. tagNo:'',
  307. searchData: {
  308. site: this.$store.state.user.site,
  309. orderNo: '',
  310. planID: '',
  311. objectID: '',
  312. planOperator: '',
  313. functionType: 'B',
  314. status: '',
  315. startDate:'',
  316. endDate:'',
  317. page: 1,
  318. planDate: new Date(),
  319. limit: 10,
  320. },
  321. height: 200,
  322. pageIndex: 1,
  323. pageSize: 100,
  324. totalPage: 0,
  325. dataList: [],
  326. dataListLoading: false,
  327. dataListSelections: [],
  328. modalFlag:false,
  329. modalDisableFlag:false,
  330. modalData:{
  331. flag:'',
  332. site: this.$store.state.user.site,
  333. groupID:'',
  334. groupDesc:'',
  335. active:'',
  336. },
  337. departmentList:[],
  338. // 展示列集
  339. columnList: [
  340. {
  341. userId: this.$store.state.user.name,
  342. functionId: 101018,
  343. serialNumber: '101018TableOrderNo',
  344. tableId: "101018Table",
  345. tableName: "common",
  346. columnProp: 'disposalMeasures',
  347. headerAlign: "center",
  348. align: "center",
  349. columnLabel: '异常原因',
  350. columnHidden: false,
  351. columnImage: false,
  352. columnSortable: false,
  353. sortLv: 0,
  354. status: true,
  355. fixed: '',
  356. },
  357. {
  358. userId: this.$store.state.user.name,
  359. functionId: 101018,
  360. serialNumber: '101018TablePlanID',
  361. tableId: "101018Table",
  362. tableName: "common",
  363. columnProp: 'planID',
  364. headerAlign: "center",
  365. align: "center",
  366. columnLabel: '计划编码',
  367. columnHidden: false,
  368. columnImage: false,
  369. columnSortable: false,
  370. sortLv: 0,
  371. status: true,
  372. fixed: '',
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 101018,
  377. serialNumber: '101018TableOrderNo',
  378. tableId: "101018Table",
  379. tableName: "common",
  380. columnProp: 'orderNo',
  381. headerAlign: "center",
  382. align: "center",
  383. columnLabel: '工单编码',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. },
  391. {
  392. userId: this.$store.state.user.name,
  393. functionId: 101018,
  394. serialNumber: '101018TablePropertiesCode',
  395. tableId: "101018Table",
  396. tableName: "common",
  397. columnProp: 'propertiesCode',
  398. headerAlign: "center",
  399. align: "center",
  400. columnLabel: '模板编码',
  401. columnHidden: false,
  402. columnImage: false,
  403. columnSortable: false,
  404. sortLv: 0,
  405. status: true,
  406. fixed: '',
  407. },
  408. {
  409. userId: this.$store.state.user.name,
  410. functionId: 101014,
  411. serialNumber: '101014TablePropertiesCodeDesc',
  412. tableId: "101014Table",
  413. tableName: "common",
  414. columnProp: 'codeDesc',
  415. headerAlign: "center",
  416. align: "center",
  417. columnLabel: '模板名称',
  418. columnHidden: false,
  419. columnImage: false,
  420. columnSortable: false,
  421. sortLv: 0,
  422. status: true,
  423. fixed: '',
  424. },
  425. {
  426. userId: this.$store.state.user.name,
  427. functionId: 101018,
  428. serialNumber: '101018TableObjectID',
  429. tableId: "101018Table",
  430. tableName: "common",
  431. columnProp: 'objectID',
  432. headerAlign: "center",
  433. align: "center",
  434. columnLabel: '设备编码',
  435. columnHidden: false,
  436. columnImage: false,
  437. columnSortable: false,
  438. sortLv: 0,
  439. status: true,
  440. fixed: '',
  441. },
  442. {
  443. userId: this.$store.state.user.name,
  444. functionId: 101014,
  445. serialNumber: '101014TableObjectDesc',
  446. tableId: "101014Table",
  447. tableName: "common",
  448. columnProp: 'objectDesc',
  449. headerAlign: "center",
  450. align: "center",
  451. columnLabel: '设备名称',
  452. columnHidden: false,
  453. columnImage: false,
  454. columnSortable: false,
  455. sortLv: 0,
  456. status: true,
  457. fixed: '',
  458. },
  459. {
  460. userId: this.$store.state.user.name,
  461. functionId: 101018,
  462. serialNumber: '101018TableStatus',
  463. tableId: "101018Table",
  464. tableName: "common",
  465. columnProp: 'status',
  466. headerAlign: "center",
  467. align: "center",
  468. columnLabel: '状态',
  469. columnHidden: false,
  470. columnImage: false,
  471. columnSortable: false,
  472. sortLv: 0,
  473. status: true,
  474. fixed: '',
  475. },
  476. {
  477. userId: this.$store.state.user.name,
  478. functionId: 101018,
  479. serialNumber: '101018TablePlanOperatorName',
  480. tableId: "101018Table",
  481. tableName: "common",
  482. columnProp: 'planOperatorName',
  483. headerAlign: "center",
  484. align: "center",
  485. columnLabel: '计划机修人员',
  486. columnHidden: false,
  487. columnImage: false,
  488. columnSortable: false,
  489. sortLv: 0,
  490. status: true,
  491. fixed: '',
  492. },
  493. {
  494. userId: this.$store.state.user.name,
  495. functionId: 101018,
  496. serialNumber: '101018TableActualOperatorName',
  497. tableId: "101018Table",
  498. tableName: "common",
  499. columnProp: 'actualOperatorName',
  500. headerAlign: "center",
  501. align: "center",
  502. columnLabel: '实际机修人员',
  503. columnHidden: false,
  504. columnImage: false,
  505. columnSortable: false,
  506. sortLv: 0,
  507. status: true,
  508. fixed: '',
  509. },
  510. {
  511. userId: this.$store.state.user.name,
  512. functionId: 101018,
  513. serialNumber: '101018TableActualOperatorName',
  514. tableId: "101018Table",
  515. tableName: "common",
  516. columnProp: 'operator',
  517. headerAlign: "center",
  518. align: "center",
  519. columnLabel: '协同人员',
  520. columnHidden: false,
  521. columnImage: false,
  522. columnSortable: false,
  523. sortLv: 0,
  524. status: true,
  525. fixed: '',
  526. },
  527. {
  528. userId: this.$store.state.user.name,
  529. functionId: 101018,
  530. serialNumber: '101018TableActualOperatorName',
  531. tableId: "101018Table",
  532. tableName: "common",
  533. columnProp: 'checkerName',
  534. headerAlign: "center",
  535. align: "center",
  536. columnLabel: '审核人员',
  537. columnHidden: false,
  538. columnImage: false,
  539. columnSortable: false,
  540. sortLv: 0,
  541. status: true,
  542. fixed: '',
  543. },
  544. {
  545. userId: this.$store.state.user.name,
  546. functionId: 101018,
  547. serialNumber: '101018TableActualPlanDate',
  548. tableId: "101018Table",
  549. tableName: "common",
  550. columnProp: 'planDate',
  551. headerAlign: "center",
  552. align: "center",
  553. columnLabel: '计划执行日期',
  554. columnHidden: false,
  555. columnImage: false,
  556. columnSortable: false,
  557. sortLv: 0,
  558. status: true,
  559. fixed: '',
  560. },
  561. {
  562. userId: this.$store.state.user.name,
  563. functionId: 101018,
  564. serialNumber: '101018TableActualActualDate',
  565. tableId: "101018Table",
  566. tableName: "common",
  567. columnProp: 'actualDate',
  568. headerAlign: "center",
  569. align: "center",
  570. columnLabel: '实际执行日期',
  571. columnHidden: false,
  572. columnImage: false,
  573. columnSortable: false,
  574. sortLv: 0,
  575. status: true,
  576. fixed: '',
  577. },
  578. {
  579. userId: this.$store.state.user.name,
  580. functionId: 101018,
  581. serialNumber: '101018TableWorkTime',
  582. tableId: "101018Table",
  583. tableName: "common",
  584. columnProp: 'workTime',
  585. headerAlign: "center",
  586. align: "center",
  587. columnLabel: '工作时间',
  588. columnHidden: false,
  589. columnImage: false,
  590. columnSortable: false,
  591. sortLv: 0,
  592. status: true,
  593. fixed: '',
  594. },
  595. {
  596. userId: this.$store.state.user.name,
  597. functionId: 101018,
  598. serialNumber: '101018TableActualRemark',
  599. tableId: "101018Table",
  600. tableName: "common",
  601. columnProp: 'remark',
  602. headerAlign: "center",
  603. align: "center",
  604. columnLabel: '工单备注',
  605. columnHidden: false,
  606. columnImage: false,
  607. columnSortable: false,
  608. sortLv: 0,
  609. status: true,
  610. fixed: '',
  611. },
  612. ],
  613. changeModelFlag:false,
  614. planOperator:'',
  615. planOperatorName:'',
  616. //执行结果
  617. detailList:[],
  618. detailModelFlag:false,
  619. saveData:{
  620. site:'',
  621. orderNo:'',
  622. planOperatorName:'',
  623. workTime:'',
  624. remark:'',
  625. actualOperatorName: '',
  626. checkResult: '',
  627. disposalMeasures: '',
  628. planID: '',
  629. objectID: '',
  630. checker: '',
  631. checkerName: '',
  632. status: ''
  633. },
  634. columnDetailList: [
  635. {
  636. userId: this.$store.state.user.name,
  637. functionId: 101020,
  638. serialNumber: '101020Table2EamPropertiesItemID',
  639. tableId: "101020Table2",
  640. tableName: "维保项目表",
  641. columnProp: 'itemNo',
  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: 90,
  652. },
  653. {
  654. userId: this.$store.state.user.name,
  655. functionId: 101020,
  656. serialNumber: '101020Table2EamPropertiesItemDesc',
  657. tableId: "101020Table2",
  658. tableName: "维保项目表",
  659. columnProp: 'itemDesc',
  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: 90,
  670. },
  671. {
  672. userId: this.$store.state.user.name,
  673. functionId: 101020,
  674. serialNumber: '101020Table2EamPropertiesItemRemark',
  675. tableId: "101020Table2",
  676. tableName: "维保项目表",
  677. columnProp: 'itemRemark',
  678. headerAlign: "center",
  679. align: "center",
  680. columnLabel: '维保方法说明',
  681. columnHidden: false,
  682. columnImage: false,
  683. columnSortable: false,
  684. sortLv: 0,
  685. status: true,
  686. fixed: '',
  687. columnWidth: 120,
  688. },
  689. {
  690. userId: this.$store.state.user.name,
  691. functionId: 101020,
  692. serialNumber: '101020Table2ValueType',
  693. tableId: "101020Table2",
  694. tableName: "维保项目表",
  695. columnProp: 'valueType',
  696. headerAlign: "center",
  697. align: "center",
  698. columnLabel: '检测值类型',
  699. columnHidden: false,
  700. columnImage: false,
  701. columnSortable: false,
  702. sortLv: 0,
  703. status: true,
  704. fixed: '',
  705. columnWidth: 70,
  706. },
  707. {
  708. userId: this.$store.state.user.name,
  709. functionId: 101020,
  710. serialNumber: '101020Table2DefaultValue',
  711. tableId: "101020Table2",
  712. tableName: "维保项目表",
  713. columnProp: 'defaultValue',
  714. headerAlign: "center",
  715. align: "center",
  716. columnLabel: '参照值',
  717. columnHidden: false,
  718. columnImage: false,
  719. columnSortable: false,
  720. sortLv: 0,
  721. status: true,
  722. fixed: '',
  723. columnWidth: 70,
  724. },
  725. {
  726. userId: this.$store.state.user.name,
  727. functionId: 101020,
  728. serialNumber: '101020Table2MaxValue',
  729. tableId: "101020Table2",
  730. tableName: "维保项目表",
  731. columnProp: 'maxValue',
  732. headerAlign: "center",
  733. align: "center",
  734. columnLabel: '最大值',
  735. columnHidden: false,
  736. columnImage: false,
  737. columnSortable: false,
  738. sortLv: 0,
  739. status: true,
  740. fixed: '',
  741. columnWidth: 70,
  742. },
  743. {
  744. userId: this.$store.state.user.name,
  745. functionId: 101020,
  746. serialNumber: '101020Table2MinValue',
  747. tableId: "101020Table2",
  748. tableName: "维保项目表",
  749. columnProp: 'minValue',
  750. headerAlign: "center",
  751. align: "center",
  752. columnLabel: '最小值',
  753. columnHidden: false,
  754. columnImage: false,
  755. columnSortable: false,
  756. sortLv: 0,
  757. status: true,
  758. fixed: '',
  759. columnWidth: 70,
  760. },
  761. ],
  762. submitData:{
  763. site: this.$store.state.user.site,
  764. orderNo: '',
  765. planID: '',
  766. objectID: '',
  767. checker: '',
  768. checkerName: '',
  769. difficultyLevel: '',
  770. difficultyRemark: ''
  771. },
  772. submitModelFlag: false,
  773. // 日期限制
  774. pickerOptions: {
  775. disabledDate(time) {
  776. return time.getTime() > Date.now();
  777. },
  778. },
  779. cancelModelFlag: false,
  780. cancelData: {
  781. site: '',
  782. orderNo: '',
  783. objectID: '',
  784. functionType: '',
  785. cancelAll: '',
  786. planID: '',
  787. status: ''
  788. },
  789. descImages: [],
  790. imageModalFlag: false
  791. }
  792. },
  793. mounted () {
  794. this.$nextTick(() => {
  795. this.height = window.innerHeight - 210
  796. })
  797. },
  798. created () {
  799. this.getDataList()
  800. this.favoriteIsOk()
  801. },
  802. methods: {
  803. /**
  804. * 查看项目图片
  805. */
  806. checkItemImageModal (row){
  807. this.descImages = [];
  808. let tempData = {
  809. site: this.$store.state.user.site,
  810. orderNo: row.orderNo,
  811. folder: row.itemNo,
  812. };
  813. searchFileUrl(tempData).then(({data}) => {
  814. if (data.code === 0) {
  815. for (let i = 0; i < data.rows.length; i++) {
  816. this.descImages.push(data.rows[i].url)
  817. }
  818. }else {
  819. this.$message.warning(data.msg);
  820. }
  821. })
  822. this.imageModalFlag = true
  823. },
  824. // 校验用户是否收藏
  825. favoriteIsOk() {
  826. let userFavorite = {
  827. userId: this.$store.state.user.id,
  828. languageCode: this.$i18n.locale
  829. }
  830. userFavoriteList(userFavorite).then(({data}) => {
  831. for (let i = 0; i < data.list.length; i++) {
  832. if(this.$route.meta.menuId == data.list[i].menuId){
  833. this.favorite = true
  834. }
  835. }
  836. })
  837. },
  838. // 收藏 OR 取消收藏
  839. favoriteFunction() {
  840. let userFavorite = {
  841. userId: this.$store.state.user.id,
  842. functionId: this.$route.meta.menuId,
  843. }
  844. if (this.favorite) {
  845. removeUserFavorite(userFavorite).then(({data}) => {
  846. this.$message.success(data.msg)
  847. this.favorite = false
  848. })
  849. } else {
  850. // 收藏
  851. saveUserFavorite(userFavorite).then(({data}) => {
  852. this.$message.success(data.msg)
  853. this.favorite = true
  854. })
  855. }
  856. },
  857. // 获取基础数据列表S
  858. getBaseList (val,type) {
  859. this.tagNo = val
  860. this.$nextTick(() => {
  861. let strVal = ''
  862. if (val === 201) {
  863. strVal = this.planOperator
  864. this.$refs.baseList.init(val, strVal)
  865. }
  866. })
  867. },
  868. /* 列表方法的回调 */
  869. getBaseData (val) {
  870. if (this.tagNo === 201) {
  871. this.planOperator = val.AdminID
  872. this.planOperatorName = val.AdminName
  873. }
  874. },
  875. //导出excel
  876. async createExportData() {
  877. this.searchData.limit = -1
  878. this.searchData.page = 1
  879. await eamWorkOrderSearch(this.searchData).then(({data}) => {
  880. this.exportList= data.page.list;
  881. })
  882. return this.exportList;
  883. },
  884. startDownload() {
  885. },
  886. finishDownload() {
  887. },
  888. fields() {
  889. let json = "{"
  890. this.columnList.forEach((item, index) => {
  891. if (index == this.columnList.length - 1) {
  892. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  893. } else {
  894. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  895. }
  896. })
  897. json += "}"
  898. let s = eval("(" + json + ")")
  899. return s
  900. },
  901. // 导出 end
  902. // 重置查询时间
  903. searchClick(){
  904. this.searchData.planDate = ''
  905. this.getDataList()
  906. },
  907. // 获取数据列表
  908. getDataList () {
  909. this.searchData.limit = this.pageSize
  910. this.searchData.page = this.pageIndex
  911. eamWorkOrderSearch(this.searchData).then(({data}) => {
  912. if (data.code == 0) {
  913. this.dataList = data.page.list
  914. this.pageIndex = data.page.currPage
  915. this.pageSize = data.page.pageSize
  916. this.totalPage = data.page.totalCount
  917. }
  918. this.dataListLoading = false
  919. })
  920. },
  921. // 每页数
  922. sizeChangeHandle (val) {
  923. this.pageSize = val
  924. this.pageIndex = 1
  925. this.getDataList()
  926. },
  927. // 当前页
  928. currentChangeHandle (val) {
  929. this.pageIndex = val
  930. this.getDataList()
  931. },
  932. // 多选
  933. selectionChangeHandle (val) {
  934. this.dataListSelections = val
  935. },
  936. cancelOrder(row){
  937. this.cancelData = {
  938. site: row.site,
  939. orderNo: row.orderNo,
  940. objectID: row.objectID,
  941. functionType: row.functionType,
  942. planID: row.planID,
  943. status: row.status,
  944. cancelAll: ''
  945. }
  946. this.cancelModelFlag = true
  947. },
  948. cancelOrder2(){
  949. let obj = document.getElementsByName('addWorkOrderRule');
  950. let s = '';
  951. for (let i = 0; i < obj.length; i++) {
  952. if (obj[i].checked) {
  953. s += obj[i].value + ',';
  954. }
  955. }
  956. s = s.substring(0,s.length-1)
  957. this.cancelData.cancelAll = s
  958. if (this.cancelData.cancelAll === 'Y') {
  959. this.$confirm(`是否取消该计划设备的所有工单?`, '提示', {
  960. confirmButtonText: '确定',
  961. cancelButtonText: '取消',
  962. type: 'warning'
  963. }).then(() => {
  964. this.cancelOrder3()
  965. }).catch(() => {
  966. })
  967. }else {
  968. this.cancelOrder3()
  969. }
  970. },
  971. cancelOrder3(){
  972. cancelOrder(this.cancelData).then(({data}) => {
  973. if (data && data.code === 0) {
  974. this.getDataList()
  975. this.cancelModelFlag = false
  976. this.$message({
  977. message: '操作成功',
  978. type: 'success',
  979. duration: 1500,
  980. onClose: () => {
  981. }
  982. })
  983. } else {
  984. this.$alert(data.msg, '错误', {
  985. confirmButtonText: '确定'
  986. })
  987. }
  988. })
  989. },
  990. selectFlag(row,index){
  991. if(row.status!='未开工'){
  992. return false;
  993. }else {
  994. return true;
  995. }
  996. },
  997. changeModel(){
  998. if(this.dataListSelections.length==0){
  999. this.$alert('请勾选工单!', '错误', {
  1000. confirmButtonText: '确定'
  1001. })
  1002. return false
  1003. }
  1004. this.planOperator=''
  1005. this.planOperatorName=''
  1006. this.changeModelFlag=true;
  1007. },
  1008. changeOrderOperator(){
  1009. let inList=JSON.parse(JSON.stringify(this.dataListSelections));
  1010. for (let i = 0; i <inList.length ; i++) {
  1011. inList[i].planOperator = this.planOperator
  1012. }
  1013. changeOrderOperator(inList).then(({data}) => {
  1014. if (data && data.code === 0) {
  1015. this.changeModelFlag = false;
  1016. this.getDataList()
  1017. this.$message({
  1018. message: '操作成功',
  1019. type: 'success',
  1020. duration: 1500,
  1021. onClose: () => {
  1022. }
  1023. })
  1024. } else {
  1025. this.$alert(data.msg, '错误', {
  1026. confirmButtonText: '确定'
  1027. })
  1028. }
  1029. })
  1030. },
  1031. // 详情
  1032. reportModal(row){
  1033. let inData = {
  1034. site: row.site,
  1035. itemNo: row.itemNo,
  1036. planID: row.planID,
  1037. orderNo: row.orderNo,
  1038. itemType: row.functionType,
  1039. }
  1040. eamWorkOrderReportSearch(inData).then(({data}) => {
  1041. this.detailList = data.rows
  1042. })
  1043. this.saveData = {
  1044. site: row.site,
  1045. orderNo: row.orderNo,
  1046. planID: row.planID,
  1047. planOperatorName: row.planOperatorName,
  1048. workTime: row.workTime,
  1049. remark: row.remark,
  1050. actualOperatorName: row.actualOperatorName,
  1051. checkResult: row.checkResult,
  1052. disposalMeasures: row.disposalMeasures,
  1053. objectID: row.objectID,
  1054. checker: row.checker,
  1055. checkerName: row.checkerName,
  1056. status: row.status
  1057. },
  1058. this.detailModelFlag = true;
  1059. },
  1060. // 审核按钮
  1061. checkModal(){
  1062. this.submitData.site = this.saveData.site
  1063. this.submitData.orderNo = this.saveData.orderNo
  1064. this.submitData.planID = this.saveData.planID
  1065. this.submitData.objectID = this.saveData.objectID
  1066. this.submitData.checker = this.saveData.checker
  1067. this.submitData.checkerName = this.saveData.checkerName
  1068. this.submitData.status = this.saveData.status
  1069. let tempData = {
  1070. site: this.$store.state.user.site,
  1071. mesUser: this.$store.state.user.name
  1072. }
  1073. if (this.submitData.status === '已完工'){
  1074. this.$confirm(`是否取消审核?`, '提示', {
  1075. confirmButtonText: '确定',
  1076. cancelButtonText: '取消',
  1077. type: 'warning'
  1078. }).then(() => {
  1079. checkWorkOrder(this.submitData).then(({data}) => {
  1080. if (data && data.code === 0) {
  1081. this.getDataList();
  1082. this.saveData.status = '待审核'
  1083. this.$message({
  1084. message: '操作成功',
  1085. type: 'success',
  1086. duration: 1500,
  1087. onClose: () => {
  1088. }
  1089. })
  1090. } else {
  1091. this.$alert(data.msg, '错误', {
  1092. confirmButtonText: '确定'
  1093. })
  1094. }
  1095. })
  1096. }).catch(() => {
  1097. })
  1098. }else if (this.submitData.status === '待审核'){
  1099. if (!this.submitData.checker.split(';').includes(tempData.mesUser)){
  1100. this.$alert('审核人员与计划不符!', '错误', {
  1101. confirmButtonText: '确定',
  1102. type: 'warning'
  1103. })
  1104. return false
  1105. }
  1106. this.$confirm(`是否确认审核?`, '提示', {
  1107. confirmButtonText: '确定',
  1108. cancelButtonText: '取消',
  1109. type: 'warning'
  1110. }).then(() => {
  1111. checkWorkOrder(this.submitData).then(({data}) => {
  1112. if (data && data.code === 0) {
  1113. this.getDataList();
  1114. this.saveData.status = '已完工'
  1115. this.$message({
  1116. message: '操作成功',
  1117. type: 'success',
  1118. duration: 1500,
  1119. onClose: () => {
  1120. }
  1121. })
  1122. } else {
  1123. this.$alert(data.msg, '错误', {
  1124. confirmButtonText: '确定'
  1125. })
  1126. }
  1127. })
  1128. }).catch(() => {
  1129. })
  1130. // selectNameByMes(tempData).then(({data}) => {
  1131. // if (data.rows[0].adminName != this.submitData.checkerName){
  1132. // this.$alert('审核人员与计划不符!', '错误', {
  1133. // confirmButtonText: '确定',
  1134. // type: 'warning'
  1135. // })
  1136. // return false
  1137. // }else {
  1138. // this.$confirm(`是否确认审核?`, '提示', {
  1139. // confirmButtonText: '确定',
  1140. // cancelButtonText: '取消',
  1141. // type: 'warning'
  1142. // }).then(() => {
  1143. // checkWorkOrder(this.submitData).then(({data}) => {
  1144. // if (data && data.code === 0) {
  1145. // this.getDataList();
  1146. // this.detailModelFlag = false;
  1147. // this.$message({
  1148. // message: '操作成功',
  1149. // type: 'success',
  1150. // duration: 1500,
  1151. // onClose: () => {
  1152. // }
  1153. // })
  1154. // } else {
  1155. // this.$alert(data.msg, '错误', {
  1156. // confirmButtonText: '确定'
  1157. // })
  1158. // }
  1159. // })
  1160. // }).catch(() => {
  1161. // })
  1162. // }
  1163. // })
  1164. }
  1165. },
  1166. }
  1167. }
  1168. </script>