健腾mes前端
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.

1669 lines
56 KiB

  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="'BU'">
  10. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
  11. <el-option
  12. v-for = "i in userBuList"
  13. :key = "i.buNo"
  14. :label = "i.buDesc"
  15. :value = "i.buDesc">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item :label="'反馈单号'">
  20. <el-input v-model="searchData.planID" clearable style="width: 120px"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'工单编码'">
  23. <el-input v-model="searchData.orderNo" clearable style="width: 120px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'设备编码'">
  26. <el-input ref="objectID" @focus="cancelKeyboard" v-model="searchData.objectID" placeholder="请扫描设备" @keyup.native.enter="objectIdEnter" clearable style="width: 120px"></el-input>
  27. </el-form-item>
  28. <!-- <el-form-item style="margin-left: 0px" >-->
  29. <!-- <span slot="label" style="" @click="getBaseList(201)"><a herf="#">计划执行人员编码</a></span>-->
  30. <!-- <el-input v-model="searchData.planOperator" clearable style="width: 120px"></el-input>-->
  31. <!-- </el-form-item>-->
  32. <el-form-item :label="'状态'">
  33. <el-select v-model="searchData.status" style="width: 100px">
  34. <el-option label="全部" value=""></el-option>
  35. <el-option label="未开工" value="未开工"></el-option>
  36. <el-option label="已到达" value="已到达"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item :label="'单据来源'">
  40. <el-select v-model="searchData.documentSource" style="width: 100px">
  41. <el-option label="全部" value=""></el-option>
  42. <el-option label="设备点检" value="设备点检"></el-option>
  43. <el-option label="设备维修" value="设备维修"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item :label="'计划执行日期:'">
  47. <el-date-picker
  48. style="width: 120px"
  49. v-model="searchData.startDate"
  50. type="date"
  51. value-format="yyyy-MM-dd"
  52. placeholder="选择日期">
  53. </el-date-picker>
  54. </el-form-item>
  55. <el-form-item style="margin-top: 23px;">
  56. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  57. </el-form-item>
  58. <el-form-item :label="' '">
  59. <el-date-picker
  60. style="width: 120px"
  61. v-model="searchData.endDate"
  62. type="date"
  63. value-format="yyyy-MM-dd"
  64. placeholder="选择日期">
  65. </el-date-picker>
  66. </el-form-item>
  67. <el-form-item label=" ">
  68. <el-button @click="getDataList()">查询</el-button>
  69. <download-excel
  70. :fields="fields()"
  71. :data="exportData"
  72. type="xls"
  73. :name="exportName"
  74. :header="exportHeader"
  75. :footer="exportFooter"
  76. :fetch="createExportData"
  77. :before-generate="startDownload"
  78. :before-finish="finishDownload"
  79. worksheet="导出信息"
  80. class="el-button el-button--primary el-button--medium">
  81. {{ "导出" }}
  82. </download-excel>
  83. </el-form-item>
  84. </el-form>
  85. <el-table
  86. :height="height"
  87. :data="dataList"
  88. border
  89. v-loading="dataListLoading"
  90. style="width: 100%;">
  91. <el-table-column
  92. v-for="(item,index) in columnList" :key="index"
  93. :sortable="item.columnSortable"
  94. :prop="item.columnProp"
  95. :header-align="item.headerAlign"
  96. :show-overflow-tooltip="item.showOverflowTooltip"
  97. :align="item.align"
  98. :fixed="item.fixed==''?false:item.fixed"
  99. :min-width="item.columnWidth"
  100. :label="item.columnLabel">
  101. <template slot-scope="scope">
  102. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  103. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. prop=""
  108. header-align="center"
  109. align="center"
  110. min-width="100"
  111. fixed="right"
  112. label="操作">
  113. <template slot-scope="scope">
  114. <a type="text" size="small" v-if="scope.row.status=='未开工'" @click="chooseReachOperator(scope.row)">到达</a>
  115. <a type="text" size="small" v-if="scope.row.status=='已到达'" @click="reportModal(scope.row)">执行</a>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <el-pagination
  120. @size-change="sizeChangeHandle"
  121. @current-change="currentChangeHandle"
  122. :current-page="pageIndex"
  123. :page-sizes="[20, 50, 100, 200, 500]"
  124. :page-size="pageSize"
  125. :total="totalPage"
  126. layout="total, sizes, prev, pager, next, jumper">
  127. </el-pagination>
  128. <el-dialog title="执行维修工单" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="1200px">
  129. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  130. <el-form-item :label="'工单号'">
  131. <el-input v-model="saveData.orderNo" disabled style="width: 221px"></el-input>
  132. </el-form-item>
  133. <el-form-item :label="'计划执行人员'">
  134. <el-input v-model="saveData.planOperatorName" disabled style="width: 221px"></el-input>
  135. </el-form-item>
  136. <el-form-item label="设备编码">
  137. <el-input v-model="saveData.objectID" disabled style="width: 221px"></el-input>
  138. </el-form-item>
  139. <el-form-item label="设备名称">
  140. <el-input v-model="saveData.objectDesc" disabled style="width: 240px"></el-input>
  141. </el-form-item>
  142. </el-form>
  143. <el-tabs v-model="activeTable" style="margin-top: 10px; width: 100%; height: 100%;" type="border-card" @tab-click="tabClick" class="customer-tab">
  144. <el-tab-pane label="维修单" name="inspection_form" style="height: 305px">
  145. <el-form :inline="true" label-position="top">
  146. <el-form-item>
  147. <span slot="label" @click="getBaseList(1033)"><a herf="#">故障编码</a></span>
  148. <el-input v-model="saveData.defectID" style="width: 221px"></el-input>
  149. </el-form-item>
  150. <el-form-item label="故障名称">
  151. <el-input v-model="saveData.defectDesc" disabled style="width: 221px"></el-input>
  152. </el-form-item>
  153. <el-form-item :label="'到达时间'">
  154. <el-date-picker
  155. style="width: 221px"
  156. v-model="saveData.reachDate"
  157. :picker-options="pickerOptions"
  158. type="datetime"
  159. value-format='yyyy-MM-dd HH:mm:ss'
  160. format='yyyy-MM-dd HH:mm:ss'
  161. placeholder="到达时间"
  162. :editable="false"
  163. @focus='elDatePickerOnFocus'
  164. @change="handleChangeTime"
  165. disabled>
  166. </el-date-picker>
  167. </el-form-item>
  168. <el-form-item :label="' '">
  169. <el-button type="primary" @click="uploadFaultImageModal()">故障图片</el-button>
  170. </el-form-item>
  171. <el-form-item :label="' '">
  172. <el-button type="primary" @click="uploadSparPartImageModal()">备件图片</el-button>
  173. </el-form-item>
  174. </el-form>
  175. <el-form :inline="true" label-position="top">
  176. <el-form-item >
  177. <span slot="label" @click="getOperatorList()"><a>选择执行人员</a></span>
  178. <el-input v-model="saveData.operatorName" style="width: 556px"></el-input>
  179. </el-form-item>
  180. <el-form-item :label="'维修结果'">
  181. <el-select v-model="saveData.result" style="width: 155px">
  182. <el-option label="维修完成" value="维修完成"></el-option>
  183. <el-option label="维修失败" value="维修失败"></el-option>
  184. </el-select>
  185. </el-form-item>
  186. <el-form-item v-if="this.saveData.result === '维修失败'" :label="'处置措施'">
  187. <el-select v-model="saveData.disposalMeasures" style="width: 120px">
  188. <el-option label="缺少备件" value="缺少备件"></el-option>
  189. <el-option label="等待售后" value="等待售后"></el-option>
  190. <el-option label="远程协助" value="远程协助"></el-option>
  191. <el-option label="换班换人" value="换班换人"></el-option>
  192. </el-select>
  193. </el-form-item>
  194. </el-form>
  195. <el-form :inline="true" label-position="top">
  196. <el-form-item label="反馈描述">
  197. <el-input v-model="saveData.feedBackDesc" style="width: 860px"></el-input>
  198. </el-form-item>
  199. </el-form>
  200. <el-form :inline="true" label-position="top">
  201. <el-form-item :label="'故障原因'">
  202. <el-input type="textarea" v-model="saveData.faultReason" :rows="3" resize='none' show-word-limit style="width: 560px"></el-input>
  203. </el-form-item>
  204. <el-form-item :label="'处理方式'">
  205. <el-input type="textarea" v-model="saveData.handlingMethod" :rows="3" resize='none' show-word-limit style="width: 560px"></el-input>
  206. </el-form-item>
  207. </el-form>
  208. <el-form :inline="true" label-position="top" style="margin-top: 45px">
  209. <el-form-item :label="'预防措施'">
  210. <el-input type="textarea" v-model="saveData.preventiveMeasure" :rows="3" resize='none' show-word-limit style="width: 560px"></el-input>
  211. </el-form-item>
  212. <el-form-item :label="'执行结果备注'">
  213. <el-input type="textarea" v-model="saveData.remark" :rows="3" resize='none' show-word-limit style="width: 560px"></el-input>
  214. </el-form-item>
  215. </el-form>
  216. </el-tab-pane>
  217. <el-tab-pane label="维修记录" name="history_record">
  218. <div class="rq ">
  219. <el-table
  220. :height="305"
  221. :data="HistoryRecordList"
  222. border
  223. v-loading="dataListLoading"
  224. style="width: 100%;">
  225. <el-table-column
  226. v-for="(item,index) in columnHistoryList" :key="index"
  227. :sortable="item.columnSortable"
  228. :prop="item.columnProp"
  229. :header-align="item.headerAlign"
  230. :show-overflow-tooltip="item.showOverflowTooltip"
  231. :align="item.align"
  232. :fixed="item.fixed==''?false:item.fixed"
  233. :min-width="item.columnWidth"
  234. :label="item.columnLabel">
  235. <template slot-scope="scope">
  236. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  237. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  238. </template>
  239. </el-table-column>
  240. <el-table-column
  241. fixed="right"
  242. header-align="center"
  243. align="center"
  244. width="120"
  245. label="图片">
  246. <template slot-scope="scope">
  247. <!-- <a type="text" size="small" @click="detailModal(scope.row)">详情</a>-->
  248. <el-button type="primary" @click="checkFaultImageModal(scope.row)" >故障</el-button>
  249. <el-button type="primary" @click="checkSparPartImageModal(scope.row)" >备件</el-button>
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. </div>
  254. </el-tab-pane>
  255. </el-tabs>
  256. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  257. <el-button type="primary" @click="saveCheckReport()">保存</el-button>
  258. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  259. </el-footer>
  260. </el-dialog>
  261. <!-- 执行人员清单 -->
  262. <el-dialog title="执行人员清单" :close-on-click-modal="false" v-drag :visible.sync="operatorModelFlag" width="820px">
  263. <div class="rq">
  264. <el-form :inline="true" label-position="top" :model="operatorData">
  265. <el-form-item :label="'所属角色'">
  266. <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px">
  267. <el-option
  268. v-for = "i in roleList"
  269. :key = "i.roleId"
  270. :label = "i.roleName"
  271. :value = "i.roleId">
  272. </el-option>
  273. </el-select>
  274. </el-form-item>
  275. <el-form-item :label="'人员编码'">
  276. <el-input v-model="operatorData.adminID" clearable style="width: 120px"></el-input>
  277. </el-form-item>
  278. <el-form-item :label="'人员姓名'">
  279. <el-input v-model="operatorData.adminName" clearable style="width: 120px"></el-input>
  280. </el-form-item>
  281. <el-form-item :label="' '">
  282. <el-button type="primary" @click="getOperatorList2">查询</el-button>
  283. </el-form-item>
  284. </el-form>
  285. <el-table
  286. :height="300"
  287. :data="operatorList"
  288. ref="operatorTable"
  289. @row-click="operatorClickRow"
  290. @selection-change="selectionChangeHandle2"
  291. border
  292. v-loading="dataListLoading"
  293. style="width: 100%;">
  294. <el-table-column
  295. type="selection"
  296. header-align="center"
  297. align="center"
  298. :selectable="selectFlag"
  299. width="50">
  300. </el-table-column>
  301. <el-table-column
  302. v-for="(item,index) in operatorDetailList" :key="index"
  303. :sortable="item.columnSortable"
  304. :prop="item.columnProp"
  305. :header-align="item.headerAlign"
  306. :show-overflow-tooltip="item.showOverflowTooltip"
  307. :align="item.align"
  308. :fixed="item.fixed==''?false:item.fixed"
  309. :min-width="item.columnWidth"
  310. :label="item.columnLabel">
  311. <template slot-scope="scope">
  312. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  313. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. </div>
  318. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  319. <el-button type="primary" @click="confirmOperator()">确认</el-button>
  320. <el-button type="primary" @click="operatorModelFlag = false">关闭</el-button>
  321. </el-footer>
  322. </el-dialog>
  323. <el-dialog title="到达" :close-on-click-modal="false" v-drag :visible.sync="chooseReachModelFlag" width="410px">
  324. <el-form :inline="true" label-position="top">
  325. <el-form-item >
  326. <span slot="label" @click="getOperatorList()"><a>选择到达人员</a></span>
  327. <el-input v-model="saveData.operatorName" style="width: 389px"></el-input>
  328. </el-form-item>
  329. </el-form>
  330. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  331. <el-button type="primary" @click="reach()">保存</el-button>
  332. <el-button type="primary" @click="chooseReachModelFlag = false">关闭</el-button>
  333. </el-footer>
  334. </el-dialog>
  335. <el-dialog title="图片查看" :close-on-click-modal="false" v-drag :visible.sync="imageModalFlag" width="390px" style="height: 550px;">
  336. <div v-viewer>
  337. <img v-for="(item, index) in descImages" :src="item" :key="index" style="width: 100px;height: 100px"/>
  338. </div>
  339. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  340. <el-button type="primary" @click="imageModalFlag = false">关闭</el-button>
  341. </el-footer>
  342. </el-dialog>
  343. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  344. <!-- 上传文件的modal -->
  345. <reportImageUpload ref="reportImageUpload" @refreshPageTables="getDataList()" v-drag></reportImageUpload>
  346. </div>
  347. </template>
  348. <script>
  349. import {
  350. eamWorkOrderSearch,
  351. eamWorkOrderItemSearch,
  352. saveOrderReportForDefect,
  353. checkSparPartImage,
  354. getOperatorList, // 获取机修人员列表
  355. queryHistoryRecord,
  356. searchFileUrl, // 查询文件路径
  357. reach, // 到达
  358. getSiteAndBuByUserName, // 获取用户的site和bu
  359. getUserRoleList, // 获取用户角色列表
  360. } from "@/api/eam/eam.js"
  361. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  362. import Chooselist from '@/views/modules/common/Chooselist_eam'
  363. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  364. import reportImageUpload from "./report_image_upload.vue"
  365. export default {
  366. components: {
  367. Chooselist,
  368. reportImageUpload
  369. },
  370. watch: {
  371. saveData: {
  372. deep: true,
  373. handler: function (newV, oldV) {
  374. this.saveData.workTime = Math.ceil(Math.floor(this.dayjs(this.saveData.endDate).diff(this.saveData.startDate, 'seconds') / 30) / 2)
  375. }
  376. },
  377. searchData: {
  378. deep: true,
  379. handler: function (newV, oldV) {
  380. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  381. }
  382. }
  383. },
  384. data () {
  385. return {
  386. // 是否收藏
  387. favorite: false,
  388. tagNo:'',
  389. // 导出 start
  390. userBuList: [],
  391. exportData: [],
  392. exportName: "维修执行" + this.dayjs().format('YYYYMMDDHHmmss'),
  393. exportHeader: ["维修执行"],
  394. exportFooter: [],
  395. exportList: [],
  396. // 导出 end
  397. searchData: {
  398. site: '',
  399. userName: this.$store.state.user.name,
  400. orderNo: '',
  401. planID: '',
  402. objectID: '',
  403. buNo: '',
  404. planOperator: '',
  405. buDesc: '',
  406. functionType: 'C',
  407. status: '',
  408. startDate: '',
  409. endDate: '',
  410. page: 1,
  411. limit: 10,
  412. searchType: 'reportDefect',
  413. documentSource: ''
  414. },
  415. height: 200,
  416. pageIndex: 1,
  417. pageSize: 20,
  418. totalPage: 0,
  419. dataList: [],
  420. dataListLoading: false,
  421. dataListSelections: [],
  422. modalFlag: false,
  423. modalDisableFlag: false,
  424. departmentList: [],
  425. // 展示列集
  426. columnList: [
  427. {
  428. userId: this.$store.state.user.name,
  429. functionId: 101004003,
  430. serialNumber: '101004003Table1BuDesc',
  431. tableId: "101004003Table1",
  432. tableName: "维修执行表",
  433. columnProp: 'buDesc',
  434. headerAlign: "center",
  435. align: "center",
  436. columnLabel: 'BU',
  437. columnHidden: false,
  438. columnImage: false,
  439. columnSortable: false,
  440. sortLv: 0,
  441. status: true,
  442. fixed: '',
  443. columnWidth: 60,
  444. },
  445. {
  446. userId: this.$store.state.user.name,
  447. functionId: 101004003,
  448. serialNumber: '101004003Table1Urgency',
  449. tableId: "101004003Table1",
  450. tableName: "维修执行表",
  451. columnProp: 'urgency',
  452. headerAlign: "center",
  453. align: "center",
  454. columnLabel: '紧急程度',
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: '',
  461. columnWidth: 60,
  462. },
  463. {
  464. userId: this.$store.state.user.name,
  465. functionId: 101004003,
  466. serialNumber: '101004003Table1OrderNo',
  467. tableId: "101004003Table1",
  468. tableName: "维修执行表",
  469. columnProp: 'orderNo',
  470. headerAlign: "center",
  471. align: "center",
  472. columnLabel: '工单编码',
  473. columnHidden: false,
  474. columnImage: false,
  475. columnSortable: false,
  476. sortLv: 0,
  477. status: true,
  478. fixed: '',
  479. columnWidth: 107,
  480. },
  481. {
  482. userId: this.$store.state.user.name,
  483. functionId: 101004003,
  484. serialNumber: '101004003Table1PlanID',
  485. tableId: "101004003Table1",
  486. tableName: "维修执行表",
  487. columnProp: 'planID',
  488. headerAlign: "center",
  489. align: "center",
  490. columnLabel: '反馈单号',
  491. columnHidden: false,
  492. columnImage: false,
  493. columnSortable: false,
  494. sortLv: 0,
  495. status: true,
  496. fixed: '',
  497. columnWidth: 107,
  498. },
  499. {
  500. userId: this.$store.state.user.name,
  501. functionId: 101004003,
  502. serialNumber: '101004003Table1FeedBackDesc',
  503. tableId: "101004003Table1",
  504. tableName: "维修执行表",
  505. columnProp: 'feedBackDesc',
  506. headerAlign: "center",
  507. align: "center",
  508. columnLabel: '反馈描述',
  509. columnHidden: false,
  510. columnImage: false,
  511. columnSortable: false,
  512. sortLv: 0,
  513. status: true,
  514. fixed: '',
  515. columnWidth: 107,
  516. },
  517. {
  518. userId: this.$store.state.user.name,
  519. functionId: 101004003,
  520. serialNumber: '101004003Table1DefectID',
  521. tableId: "101004003Table1",
  522. tableName: "维修执行表",
  523. columnProp: 'defectID',
  524. headerAlign: "center",
  525. align: "center",
  526. columnLabel: '故障编码',
  527. columnHidden: false,
  528. columnImage: false,
  529. columnSortable: false,
  530. sortLv: 0,
  531. status: true,
  532. fixed: '',
  533. columnWidth: 107,
  534. },
  535. {
  536. userId: this.$store.state.user.name,
  537. functionId: 101004003,
  538. serialNumber: '101004003Table1DefectDesc',
  539. tableId: "101004003Table1",
  540. tableName: "维修执行表",
  541. columnProp: 'defectDesc',
  542. headerAlign: "center",
  543. align: "center",
  544. columnLabel: '故障名称',
  545. columnHidden: false,
  546. columnImage: false,
  547. columnSortable: false,
  548. sortLv: 0,
  549. status: true,
  550. fixed: '',
  551. columnWidth: 107,
  552. },
  553. {
  554. userId: this.$store.state.user.name,
  555. functionId: 101004003,
  556. serialNumber: '101004003Table1ObjectID',
  557. tableId: "101004003Table1",
  558. tableName: "维修执行表",
  559. columnProp: 'objectID',
  560. headerAlign: "center",
  561. align: "center",
  562. columnLabel: '设备编码',
  563. columnHidden: false,
  564. columnImage: false,
  565. columnSortable: false,
  566. sortLv: 0,
  567. status: true,
  568. fixed: '',
  569. columnWidth: 107,
  570. },
  571. {
  572. userId: this.$store.state.user.name,
  573. functionId: 101004003,
  574. serialNumber: '101004003Table1ObjectDesc',
  575. tableId: "101004003Table1",
  576. tableName: "维修执行表",
  577. columnProp: 'objectDesc',
  578. headerAlign: "center",
  579. align: "center",
  580. columnLabel: '设备名称',
  581. columnHidden: false,
  582. columnImage: false,
  583. columnSortable: false,
  584. sortLv: 0,
  585. status: true,
  586. fixed: '',
  587. columnWidth: 107,
  588. },
  589. {
  590. userId: this.$store.state.user.name,
  591. functionId: 101004003,
  592. serialNumber: '101004003Table1CreateBy',
  593. tableId: "101004003Table1",
  594. tableName: "维修执行表",
  595. columnProp: 'createBy',
  596. headerAlign: "center",
  597. align: "center",
  598. columnLabel: '报修人员名称',
  599. columnHidden: false,
  600. columnImage: false,
  601. columnSortable: false,
  602. sortLv: 0,
  603. status: true,
  604. fixed: '',
  605. columnWidth: 107,
  606. },
  607. {
  608. userId: this.$store.state.user.name,
  609. functionId: 101004003,
  610. serialNumber: '101004003Table1Status',
  611. tableId: "101004003Table1",
  612. tableName: "维修执行表",
  613. columnProp: 'status',
  614. headerAlign: "center",
  615. align: "center",
  616. columnLabel: '状态',
  617. columnHidden: false,
  618. columnImage: false,
  619. columnSortable: false,
  620. sortLv: 0,
  621. status: true,
  622. fixed: '',
  623. columnWidth: 107,
  624. },
  625. {
  626. userId: this.$store.state.user.name,
  627. functionId: 101004003,
  628. serialNumber: '101004003Table1PlanOperatorName',
  629. tableId: "101004003Table1",
  630. tableName: "维修执行表",
  631. columnProp: 'planOperatorName',
  632. headerAlign: "center",
  633. align: "center",
  634. columnLabel: '计划执行人员',
  635. columnHidden: false,
  636. columnImage: false,
  637. columnSortable: false,
  638. sortLv: 0,
  639. status: true,
  640. fixed: '',
  641. columnWidth: 107,
  642. },
  643. {
  644. userId: this.$store.state.user.name,
  645. functionId: 101004003,
  646. serialNumber: '101004003Table1PlanDate',
  647. tableId: "101004003Table1",
  648. tableName: "维修执行表",
  649. columnProp: 'planDate',
  650. headerAlign: "center",
  651. align: "center",
  652. columnLabel: '计划执行日期',
  653. columnHidden: false,
  654. columnImage: false,
  655. columnSortable: false,
  656. sortLv: 0,
  657. status: true,
  658. fixed: '',
  659. columnWidth: 107,
  660. },
  661. {
  662. userId: this.$store.state.user.name,
  663. functionId: 101004003,
  664. serialNumber: '101004003Table1Remark',
  665. tableId: "101004003Table1",
  666. tableName: "维修执行表",
  667. columnProp: 'remark',
  668. headerAlign: "center",
  669. align: "center",
  670. columnLabel: '备注',
  671. columnHidden: false,
  672. columnImage: false,
  673. columnSortable: false,
  674. sortLv: 0,
  675. status: true,
  676. fixed: '',
  677. columnWidth: 107,
  678. },
  679. {
  680. userId: this.$store.state.user.name,
  681. functionId: 101004003,
  682. serialNumber: '101004003Table1DocumentSource',
  683. tableId: "101004003Table1",
  684. tableName: "维修执行表",
  685. columnProp: 'documentSource',
  686. headerAlign: "center",
  687. align: "center",
  688. columnLabel: '单据来源',
  689. columnHidden: false,
  690. columnImage: false,
  691. columnSortable: false,
  692. sortLv: 0,
  693. status: true,
  694. fixed: '',
  695. columnWidth: 107,
  696. },
  697. ],
  698. detailModelFlag: false,
  699. detailList: [],
  700. saveData: {
  701. site: '',
  702. buNo: '',
  703. functionType: 'C',
  704. orderNo: '',
  705. planOperatorName: '',
  706. startDate: '',
  707. endDate: '',
  708. workTime: '',
  709. remark: '',
  710. mesUser: '',
  711. planID: '',
  712. itemList: [],
  713. result: '',
  714. defectID: '',
  715. defectDesc: '',
  716. operator: '',
  717. operatorName: '',
  718. disposalMeasures: '',
  719. objectID: '',
  720. objectDesc: '',
  721. checkWorkPlanId: '',
  722. checkItemNo: '',
  723. reachDate: '',
  724. finishDate: '',
  725. handlingMethod: '',
  726. feedBackDesc: '',
  727. faultReason: '',
  728. preventiveMeasure: ''
  729. },
  730. operatorData: {
  731. site: '',
  732. bu: '',
  733. adminID: '',
  734. adminName: '',
  735. roleId: '',
  736. roleName: '',
  737. },
  738. operatorModelFlag: false,
  739. operatorList: [],
  740. roleList: [],
  741. dataListSelections2: [],
  742. operatorDetailList: [
  743. {
  744. columnProp: 'adminID',
  745. headerAlign: "center",
  746. align: "center",
  747. columnLabel: '用户账号',
  748. columnHidden: false,
  749. columnImage: false,
  750. columnSortable: false,
  751. sortLv: 0,
  752. status: true,
  753. fixed: '',
  754. },
  755. {
  756. columnProp: 'adminName',
  757. headerAlign: "center",
  758. align: "center",
  759. columnLabel: '用户名称',
  760. columnHidden: false,
  761. columnImage: false,
  762. columnSortable: false,
  763. sortLv: 0,
  764. status: true,
  765. fixed: '',
  766. },
  767. {
  768. columnProp: 'email',
  769. headerAlign: "center",
  770. align: "center",
  771. columnLabel: '邮箱',
  772. columnHidden: false,
  773. columnImage: false,
  774. columnSortable: false,
  775. sortLv: 0,
  776. status: true,
  777. fixed: '',
  778. },
  779. {
  780. columnProp: 'phone',
  781. headerAlign: "center",
  782. align: "center",
  783. columnLabel: '手机号',
  784. columnHidden: false,
  785. columnImage: false,
  786. columnSortable: false,
  787. sortLv: 0,
  788. status: true,
  789. fixed: '',
  790. },
  791. ],
  792. // 日期限制
  793. pickerOptions: {
  794. disabledDate(time) {
  795. return time.getTime() > Date.now();
  796. },
  797. },
  798. activeTable: 'inspection_form',
  799. HistoryRecordList: [],
  800. columnHistoryList: [
  801. {
  802. userId: this.$store.state.user.name,
  803. functionId: 101004003,
  804. serialNumber: '101004003Table2OrderNo',
  805. tableId: "101004003Table2",
  806. tableName: "维修记录表",
  807. columnWidth: 114,
  808. columnProp: 'orderNo',
  809. headerAlign: "center",
  810. align: "center",
  811. columnLabel: '工单编号',
  812. columnHidden: false,
  813. columnImage: false,
  814. columnSortable: false,
  815. sortLv: 0,
  816. status: true,
  817. fixed: '',
  818. },
  819. {
  820. userId: this.$store.state.user.name,
  821. functionId: 101004003,
  822. serialNumber: '101004003Table2PlanDesc',
  823. tableId: "101004003Table2",
  824. tableName: "维修记录表",
  825. columnWidth: 114,
  826. columnProp: 'planDesc',
  827. headerAlign: "center",
  828. align: "center",
  829. columnLabel: '故障描述',
  830. columnHidden: false,
  831. columnImage: false,
  832. columnSortable: false,
  833. sortLv: 0,
  834. status: true,
  835. fixed: '',
  836. },
  837. {
  838. userId: this.$store.state.user.name,
  839. functionId: 101004003,
  840. serialNumber: '101004003Table2DefectDesc',
  841. tableId: "101004003Table2",
  842. tableName: "维修记录表",
  843. columnWidth: 114,
  844. columnProp: 'defectDesc',
  845. headerAlign: "center",
  846. align: "center",
  847. columnLabel: '故障名称',
  848. columnHidden: false,
  849. columnImage: false,
  850. columnSortable: false,
  851. sortLv: 0,
  852. status: true,
  853. fixed: '',
  854. },
  855. {
  856. userId: this.$store.state.user.name,
  857. functionId: 101004003,
  858. serialNumber: '101004003Table2Result',
  859. tableId: "101004003Table2",
  860. tableName: "维修记录表",
  861. columnWidth: 114,
  862. columnProp: 'result',
  863. headerAlign: "center",
  864. align: "center",
  865. columnLabel: '维修结论',
  866. columnHidden: false,
  867. columnImage: false,
  868. columnSortable: false,
  869. sortLv: 0,
  870. status: true,
  871. fixed: '',
  872. },
  873. {
  874. userId: this.$store.state.user.name,
  875. functionId: 101004003,
  876. serialNumber: '101004003Table2DisposalMeasures',
  877. tableId: "101004003Table2",
  878. tableName: "维修记录表",
  879. columnWidth: 114,
  880. columnProp: 'disposalMeasures',
  881. headerAlign: "center",
  882. align: "center",
  883. columnLabel: '处置措施',
  884. columnHidden: false,
  885. columnImage: false,
  886. columnSortable: false,
  887. sortLv: 0,
  888. status: true,
  889. fixed: '',
  890. },
  891. {
  892. userId: this.$store.state.user.name,
  893. functionId: 101004003,
  894. serialNumber: '101004003Table2ActualOperatorName',
  895. tableId: "101004003Table2",
  896. tableName: "维修记录表",
  897. columnWidth: 114,
  898. columnProp: 'actualOperatorName',
  899. headerAlign: "center",
  900. align: "center",
  901. columnLabel: '维修人员',
  902. columnHidden: false,
  903. columnImage: false,
  904. columnSortable: false,
  905. sortLv: 0,
  906. status: true,
  907. fixed: '',
  908. },
  909. {
  910. userId: this.$store.state.user.name,
  911. functionId: 101004003,
  912. serialNumber: '101004003Table2WorkTime',
  913. tableId: "101004003Table2",
  914. tableName: "维修记录表",
  915. columnWidth: 114,
  916. columnProp: 'workTime',
  917. headerAlign: "center",
  918. align: "right",
  919. columnLabel: '工作时长',
  920. columnHidden: false,
  921. columnImage: false,
  922. columnSortable: false,
  923. sortLv: 0,
  924. status: true,
  925. fixed: '',
  926. },
  927. {
  928. userId: this.$store.state.user.name,
  929. functionId: 101004003,
  930. serialNumber: '101004003Table2ActualDate',
  931. tableId: "101004003Table2",
  932. tableName: "维修记录表",
  933. columnWidth: 114,
  934. columnProp: 'actualDate',
  935. headerAlign: "center",
  936. align: "center",
  937. columnLabel: '维修时间',
  938. columnHidden: false,
  939. columnImage: false,
  940. columnSortable: false,
  941. sortLv: 0,
  942. status: true,
  943. fixed: '',
  944. },
  945. {
  946. userId: this.$store.state.user.name,
  947. functionId: 101004003,
  948. serialNumber: '101004003Table2Remark',
  949. tableId: "101004003Table2",
  950. tableName: "维修记录表",
  951. columnWidth: 114,
  952. columnProp: 'remark',
  953. headerAlign: "center",
  954. align: "center",
  955. columnLabel: '工单备注',
  956. columnHidden: false,
  957. columnImage: false,
  958. columnSortable: false,
  959. sortLv: 0,
  960. status: true,
  961. fixed: '',
  962. },
  963. ],
  964. descImages: [],
  965. imageModalFlag: false,
  966. chooseReachModelFlag: false,
  967. reachData: {}
  968. }
  969. },
  970. mounted () {
  971. this.$nextTick(() => {
  972. this.height = window.innerHeight - 210
  973. })
  974. this.$refs.objectID.focus()
  975. },
  976. created() {
  977. this.getSiteAndBuByUserName()
  978. this.getDataList()
  979. this.favoriteIsOk()
  980. // 动态列
  981. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  982. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  983. // 获取用户角色
  984. this.getUserRoleList()
  985. },
  986. methods: {
  987. // 取消小键盘
  988. cancelKeyboard (e) {
  989. // this.$refs.objectID
  990. e.target.setAttribute('readonly', true);
  991. setTimeout(() => {
  992. e.target.removeAttribute('readonly');
  993. }, 100);
  994. },
  995. // 设备编码回车事件
  996. objectIdEnter () {
  997. this.searchData.limit = this.pageSize
  998. this.searchData.page = this.pageIndex
  999. eamWorkOrderSearch(this.searchData).then(({data}) => {
  1000. if (data.code === 0) {
  1001. this.dataList = data.page.list
  1002. this.pageIndex = data.page.currPage
  1003. this.pageSize = data.page.pageSize
  1004. this.totalPage = data.page.totalCount
  1005. if (this.searchData.objectID != null && this.searchData.objectID !== '' && this.dataList.length > 0) {
  1006. if (this.dataList[0].status == '未开工') {
  1007. this.saveData.site = this.dataList[0].site
  1008. this.saveData.buNo = this.dataList[0].buNo
  1009. this.saveData.operator = ''
  1010. this.saveData.operatorName = ''
  1011. this.operatorData.bu = this.dataList[0].site + '_' + this.dataList[0].buNo
  1012. this.reachData = this.dataList[0]
  1013. this.chooseReachModelFlag = true
  1014. } else if (this.dataList[0].status == '已到达') {
  1015. this.reportModal(this.dataList[0])
  1016. }
  1017. }
  1018. }
  1019. })
  1020. },
  1021. // 获取用户的bu
  1022. getSiteAndBuByUserName () {
  1023. let tempData = {
  1024. username: this.$store.state.user.name,
  1025. }
  1026. getSiteAndBuByUserName(tempData).then(({data}) => {
  1027. if (data.code === 0) {
  1028. this.userBuList = data.rows
  1029. }
  1030. })
  1031. },
  1032. // 时间处理函数
  1033. getStandTime (data) {
  1034. let value =
  1035. data.getFullYear() +
  1036. "-" +
  1037. this.checkTime(data.getMonth() + 1) +
  1038. "-" +
  1039. this.checkTime(data.getDate()) +
  1040. " " +
  1041. this.checkTime(data.getHours()) +
  1042. ":" +
  1043. this.checkTime(data.getMinutes()) +
  1044. ":" +
  1045. this.checkTime(data.getSeconds());
  1046. return value;
  1047. },
  1048. // 时间处理,如果时间小于10 则再前面加一个'0'
  1049. checkTime (i) {
  1050. if (i < 10) {
  1051. i = "0" + i
  1052. }
  1053. return i
  1054. },
  1055. // 日期时间选择器改变
  1056. handleChangeTime () {
  1057. // 当选择的时间大于当前时间,自动填充为当前时间
  1058. // 设备开始时间
  1059. let start = (new Date(this.saveData.startDate) * 1000) / 1000
  1060. if (start > Date.now()) {
  1061. this.saveData.startDate = this.getStandTime(new Date())
  1062. this.$message({
  1063. message: "时间超出范围!",
  1064. type: "warning",
  1065. })
  1066. }
  1067. // 设备结束时间
  1068. let end = (new Date(this.saveData.endDate) * 1000) / 1000
  1069. if (end > Date.now()) {
  1070. this.saveData.endDate = this.getStandTime(new Date())
  1071. this.$message({
  1072. message: "时间超出范围!",
  1073. type: "warning",
  1074. })
  1075. }
  1076. // 结束时间小于开始时间
  1077. if (start > end) {
  1078. this.saveData.endDate = this.saveData.startDate
  1079. this.$message({
  1080. message: "结束时间小于开始时间!",
  1081. type: "warning",
  1082. })
  1083. }
  1084. },
  1085. // 点击行选中复选框
  1086. operatorClickRow (row) {
  1087. this.$refs.operatorTable.toggleRowSelection(row)
  1088. },
  1089. // 获取用户角色
  1090. getUserRoleList () {
  1091. getUserRoleList().then(({data}) => {
  1092. if (data.code === 0) {
  1093. this.roleList = data.rows
  1094. } else {
  1095. this.roleList = []
  1096. }
  1097. })
  1098. },
  1099. // 获取机修人员列表
  1100. getOperatorList () {
  1101. this.operatorData.bu = this.saveData.site + '_' + this.saveData.buNo
  1102. if (this.roleList.length > 0) {
  1103. let filterList = this.roleList.filter(item => item.roleName === '机修人员')
  1104. if (filterList.length > 0) {
  1105. this.operatorData.roleId = filterList[0].roleId
  1106. } else {
  1107. this.operatorData.roleId = this.roleList[0].roleId
  1108. }
  1109. } else {
  1110. this.operatorData.roleId = ''
  1111. }
  1112. // 先清空缓存选中
  1113. this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  1114. // 拿到选中的人员编号
  1115. let tempDataList = (this.saveData.operator == null ? '' : this.saveData.operator).split(';')
  1116. // 查询人员
  1117. getOperatorList(this.operatorData).then(({data}) => {
  1118. if (data && data.code === 0) {
  1119. this.operatorList = data.rows
  1120. this.operatorList.forEach(val => {
  1121. // 回显选中的人员
  1122. if (tempDataList.includes(val.adminID)) {
  1123. this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  1124. }
  1125. })
  1126. this.operatorModelFlag = true
  1127. } else {
  1128. this.$alert(data.msg, '错误', {
  1129. confirmButtonText: '确定'
  1130. })
  1131. }
  1132. })
  1133. if (this.saveData.operator == null) {
  1134. this.saveData.operator = ''
  1135. this.saveData.operatorName = ''
  1136. }
  1137. },
  1138. // 查询机修人员列表
  1139. getOperatorList2 () {
  1140. // // 先清空缓存选中
  1141. // this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  1142. // 查询人员
  1143. getOperatorList(this.operatorData).then(({data}) => {
  1144. if (data && data.code === 0) {
  1145. this.operatorList = data.rows
  1146. } else {
  1147. this.operatorList = []
  1148. }
  1149. })
  1150. },
  1151. // // 获取机修人员列表
  1152. // getOperatorList () {
  1153. // this.operatorData.bu = this.saveData.site + '_' + this.saveData.buNo
  1154. // this.operatorData.site = this.$store.state.user.site
  1155. // this.getRoleNameList()
  1156. // if (this.saveData.operator == null) {
  1157. // this.saveData.operator = ''
  1158. // this.saveData.operatorName = ''
  1159. // }
  1160. // // 先清空缓存选中
  1161. // this.$nextTick(() => this.$refs.operatorTable.clearSelection())
  1162. // // 拿到选中的人员编号
  1163. // let tempDataList = this.saveData.operator.split(';')
  1164. // // 查询人员
  1165. // getOperatorList(this.operatorData).then(({data}) => {
  1166. // if (data && data.code === 0) {
  1167. // this.operatorList = data.rows
  1168. // this.operatorList.forEach(val => {
  1169. // // 回显选中的人员
  1170. // if (tempDataList.includes(val.adminID)) {
  1171. // this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
  1172. // }
  1173. // })
  1174. // this.operatorModelFlag = true
  1175. // } else {
  1176. // this.$alert(data.msg, '错误', {
  1177. // confirmButtonText: '确定'
  1178. // })
  1179. // }
  1180. // })
  1181. // },
  1182. //
  1183. // // 获取数据列表
  1184. // getRoleNameList () {
  1185. // this.dataListLoading = true
  1186. // this.$http({
  1187. // url: this.$http.adornUrl('/sys/role/list2'),
  1188. // method: 'get',
  1189. // params: this.$http.adornParams({
  1190. // 'page': this.pageIndex,
  1191. // 'limit': this.pageSize,
  1192. // })
  1193. // }).then(({data}) => {
  1194. // let temp = []
  1195. // if (data && data.code === 0) {
  1196. // this.roleList = data.page.list
  1197. // temp = this.roleList[0]
  1198. // this.roleList[0] = this.roleList[1]
  1199. // this.roleList[1] = temp
  1200. // this.totalPage = data.page.totalCount
  1201. // } else {
  1202. // this.roleList = []
  1203. // this.totalPage = 0
  1204. // }
  1205. // this.dataListLoading = false
  1206. // })
  1207. // },
  1208. // 多选
  1209. selectionChangeHandle2 (val) {
  1210. this.dataListSelections2 = val
  1211. },
  1212. selectFlag () {
  1213. return true
  1214. },
  1215. // 确认多选机修人员
  1216. confirmOperator () {
  1217. this.saveData.operatorName = ''
  1218. this.saveData.operator = ''
  1219. for (let i = 0; i < this.dataListSelections2.length; i++) {
  1220. this.saveData.operatorName = this.saveData.operatorName + ";" + this.dataListSelections2[i].adminName
  1221. this.saveData.operator = this.saveData.operator + ";" + this.dataListSelections2[i].adminID
  1222. }
  1223. this.saveData.operator = this.saveData.operator.substring(1)
  1224. this.saveData.operatorName = this.saveData.operatorName.substring(1)
  1225. this.operatorModelFlag = false
  1226. },
  1227. // 校验用户是否收藏
  1228. favoriteIsOk () {
  1229. let userFavorite = {
  1230. userId: this.$store.state.user.id,
  1231. languageCode: this.$i18n.locale
  1232. }
  1233. userFavoriteList(userFavorite).then(({data}) => {
  1234. for (let i = 0; i < data.list.length; i++) {
  1235. if(this.$route.meta.menuId === data.list[i].menuId){
  1236. this.favorite = true
  1237. }
  1238. }
  1239. })
  1240. },
  1241. // 收藏 OR 取消收藏
  1242. favoriteFunction () {
  1243. let userFavorite = {
  1244. userId: this.$store.state.user.id,
  1245. functionId: this.$route.meta.menuId,
  1246. }
  1247. if (this.favorite) {
  1248. removeUserFavorite(userFavorite).then(({data}) => {
  1249. this.$message.success(data.msg)
  1250. this.favorite = false
  1251. })
  1252. } else {
  1253. // 收藏
  1254. saveUserFavorite(userFavorite).then(({data}) => {
  1255. this.$message.success(data.msg)
  1256. this.favorite = true
  1257. })
  1258. }
  1259. },
  1260. // 获取基础数据列表S
  1261. getBaseList (val,type) {
  1262. this.tagNo = val
  1263. this.$nextTick(() => {
  1264. let strVal = ''
  1265. if (val === 201) {
  1266. strVal = this.searchData.planOperator
  1267. this.$refs.baseList.init(val, strVal)
  1268. }
  1269. if (val === 1033) {
  1270. strVal = this.saveData.defectID
  1271. this.$refs.baseList.init(val, strVal)
  1272. }
  1273. })
  1274. },
  1275. /* 列表方法的回调 */
  1276. getBaseData (val) {
  1277. if (this.tagNo === 201) {
  1278. this.searchData.planOperator = val.username
  1279. }
  1280. if (this.tagNo === 1033) {
  1281. this.saveData.defectID = val.DefectID
  1282. this.saveData.defectDesc = val.DefectDesc
  1283. }
  1284. },
  1285. //导出excel
  1286. async createExportData () {
  1287. this.searchData.limit = -1
  1288. this.searchData.page = 1
  1289. await eamWorkOrderSearch(this.searchData).then(({data}) => {
  1290. this.exportList= data.page.list
  1291. })
  1292. return this.exportList
  1293. },
  1294. startDownload () {},
  1295. finishDownload () {},
  1296. fields () {
  1297. let json = "{"
  1298. this.columnList.forEach((item, index) => {
  1299. if (index == this.columnList.length - 1) {
  1300. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1301. } else {
  1302. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1303. }
  1304. })
  1305. json += "}"
  1306. let s = eval("(" + json + ")")
  1307. return s
  1308. },
  1309. // 获取数据列表
  1310. getDataList () {
  1311. this.searchData.limit = this.pageSize
  1312. this.searchData.page = this.pageIndex
  1313. eamWorkOrderSearch(this.searchData).then(({data}) => {
  1314. if (data.code === 0) {
  1315. this.dataList = data.page.list
  1316. this.pageIndex = data.page.currPage
  1317. this.pageSize = data.page.pageSize
  1318. this.totalPage = data.page.totalCount
  1319. }
  1320. this.dataListLoading = false
  1321. })
  1322. },
  1323. // 每页数
  1324. sizeChangeHandle (val) {
  1325. this.pageSize = val
  1326. this.pageIndex = 1
  1327. this.getDataList()
  1328. },
  1329. // 当前页
  1330. currentChangeHandle (val) {
  1331. this.pageIndex = val
  1332. this.getDataList()
  1333. },
  1334. // 多选
  1335. selectionChangeHandle (val) {
  1336. this.dataListSelections = val
  1337. },
  1338. // 选择到达人员
  1339. chooseReachOperator (row) {
  1340. this.saveData.site = row.site
  1341. this.saveData.buNo = row.buNo
  1342. this.saveData.operator = ''
  1343. this.saveData.operatorName = ''
  1344. this.operatorData.bu = row.site + '_' + row.buNo
  1345. this.reachData = row
  1346. this.chooseReachModelFlag = true
  1347. },
  1348. // 到达
  1349. reach () {
  1350. let tempData = {
  1351. site: this.saveData.site,
  1352. buNo: this.saveData.buNo,
  1353. functionType: 'C',
  1354. orderNo: this.reachData.orderNo,
  1355. status: '已到达',
  1356. reachOperator: this.saveData.operator,
  1357. reachOperatorName: this.saveData.operatorName
  1358. }
  1359. reach(tempData).then(({data}) => {
  1360. if (data && data.code === 0) {
  1361. this.getDataList()
  1362. this.chooseReachModelFlag = false
  1363. this.$message({
  1364. message: '操作成功',
  1365. type: 'success',
  1366. duration: 1500,
  1367. onClose: () => {}
  1368. })
  1369. } else {
  1370. this.$alert(data.msg, '错误', {
  1371. confirmButtonText: '确定'
  1372. })
  1373. }
  1374. })
  1375. },
  1376. // 执行
  1377. reportModal (row) {
  1378. this.saveData = {
  1379. site: row.site,
  1380. buNo: row.buNo,
  1381. functionType: 'C',
  1382. orderNo: row.orderNo,
  1383. planID: row.planID,
  1384. planOperatorName: row.planOperatorName,
  1385. workTime: '',
  1386. remark: '',
  1387. disposalMeasures: '',
  1388. mesUser: this.$store.state.user.name,
  1389. itemList: [],
  1390. defectID: row.defectID,
  1391. defectDesc: row.defectDesc,
  1392. objectID: row.objectID,
  1393. objectDesc: row.objectDesc,
  1394. checkWorkPlanId: row.checkWorkPlanId,
  1395. checkItemNo: row.checkItemNo,
  1396. reachDate: row.reachDate,
  1397. operator: row.reachOperator,
  1398. operatorName: row.reachOperatorName,
  1399. handlingMethod: '',
  1400. feedBackDesc: row.feedBackDesc,
  1401. faultReason: '',
  1402. preventiveMeasure: '',
  1403. result: ''
  1404. }
  1405. this.queryHistoryRecord()
  1406. this.detailModelFlag = true
  1407. },
  1408. saveCheckReport () {
  1409. if (this.saveData.defectID === '' || this.saveData.defectID == null) {
  1410. this.$message.warning('请选择故障编码!')
  1411. return
  1412. }
  1413. if (this.saveData.result === '' || this.saveData.result == null) {
  1414. this.$message.warning('请选择维修结果!')
  1415. return
  1416. }
  1417. if (this.saveData.result === '维修失败' && (this.saveData.disposalMeasures == null || this.saveData.disposalMeasures === '')) {
  1418. this.$message.warning('请选择处置措施!')
  1419. return
  1420. }
  1421. if (this.saveData.operator == null || this.saveData.operator === '') {
  1422. this.$message.warning('请选择维修人员!')
  1423. return
  1424. }
  1425. if (this.saveData.handlingMethod == null || this.saveData.handlingMethod === '') {
  1426. this.$message.warning('请填写处理方式!')
  1427. return
  1428. }
  1429. saveOrderReportForDefect(this.saveData).then(({data}) => {
  1430. if (data && data.code === 0) {
  1431. this.getDataList()
  1432. this.detailModelFlag = false
  1433. this.$message({
  1434. message: '操作成功',
  1435. type: 'success',
  1436. duration: 1500,
  1437. onClose: () => {}
  1438. })
  1439. } else {
  1440. this.$alert(data.msg, '错误', {
  1441. confirmButtonText: '确定'
  1442. })
  1443. }
  1444. })
  1445. },
  1446. // 上传故障图片
  1447. uploadFaultImageModal () {
  1448. let currentData = {
  1449. site: this.saveData.site,
  1450. buNo: this.saveData.buNo,
  1451. createBy: this.$store.state.user.name,
  1452. orderNo: this.saveData.orderNo,
  1453. folder: 'reportFault',
  1454. }
  1455. // 打开组件 去做新增业务
  1456. this.$nextTick(() => {
  1457. this.$refs.reportImageUpload.init(currentData)
  1458. })
  1459. },
  1460. // 上传备件图片
  1461. uploadSparPartImageModal () {
  1462. let currentData = {
  1463. site: this.saveData.site,
  1464. buNo: this.saveData.buNo,
  1465. createBy: this.$store.state.user.name,
  1466. orderNo: this.saveData.orderNo,
  1467. folder: 'reportSparPart',
  1468. }
  1469. // 打开组件 去做新增业务
  1470. this.$nextTick(() => {
  1471. this.$refs.reportImageUpload.init(currentData)
  1472. })
  1473. },
  1474. // 列表表格选择替换
  1475. tabClick (tab, event) {
  1476. // 刷新列表数据
  1477. this.refreshCurrentTabTable()
  1478. },
  1479. // 刷新页签的table数据
  1480. refreshCurrentTabTable () {
  1481. // 区分不同的页签刷新不同的列表数据
  1482. if (this.activeTable === 'inspection_form') {
  1483. this.getInspectionFormData()
  1484. } else if (this.activeTable === 'history_record') {
  1485. this.queryHistoryRecord()
  1486. }
  1487. },
  1488. // 维修记录
  1489. queryHistoryRecord () {
  1490. let tempData = {
  1491. site: this.saveData.site,
  1492. buNo: this.saveData.buNo,
  1493. objectID: this.saveData.objectID,
  1494. functionType: 'C'
  1495. }
  1496. queryHistoryRecord(tempData).then(({data}) => {
  1497. if (data && data.code === 0) {
  1498. this.HistoryRecordList = data.rows
  1499. } else {
  1500. this.HistoryRecordList = []
  1501. }
  1502. })
  1503. },
  1504. /**
  1505. * 查看故障图片
  1506. */
  1507. checkFaultImageModal (row) {
  1508. this.descImages = []
  1509. let tempData = {
  1510. site: this.saveData.site,
  1511. buNo: this.saveData.buNo,
  1512. orderNo: row.orderNo,
  1513. folder: 'reportFault',
  1514. }
  1515. searchFileUrl(tempData).then(({data}) => {
  1516. if (data.code === 0) {
  1517. for (let i = 0; i < data.rows.length; i++) {
  1518. this.descImages.push(data.rows[i].url)
  1519. }
  1520. } else {
  1521. this.$message.warning(data.msg)
  1522. }
  1523. })
  1524. this.imageModalFlag = true
  1525. },
  1526. /**
  1527. * 查看备件图片
  1528. */
  1529. checkSparPartImageModal (row) {
  1530. this.descImages = []
  1531. let tempData = {
  1532. site: this.saveData.site,
  1533. buNo: this.saveData.buNo,
  1534. orderNo: row.orderNo,
  1535. folder: 'reportSparPart',
  1536. }
  1537. searchFileUrl(tempData).then(({data}) => {
  1538. if (data.code === 0) {
  1539. for (let i = 0; i < data.rows.length; i++) {
  1540. this.descImages.push(data.rows[i].url)
  1541. }
  1542. } else {
  1543. this.$message.warning(data.msg)
  1544. }
  1545. })
  1546. this.imageModalFlag = true
  1547. },
  1548. //去掉input框获得的焦点
  1549. elDatePickerOnFocus () {
  1550. document.activeElement.blur()
  1551. },
  1552. // 动态列开始 获取 用户保存的 格式列
  1553. async getTableUserColumn (tableId, columnId) {
  1554. let queryTableUser = {
  1555. userId: this.$store.state.user.name,
  1556. functionId: this.$route.meta.menuId,
  1557. tableId: tableId,
  1558. status: true,
  1559. languageCode: this.$i18n.locale
  1560. }
  1561. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1562. if (data.rows.length > 0) {
  1563. //this.columnList1 = []
  1564. switch (columnId) {
  1565. case 1:
  1566. this.columnList = data.rows
  1567. break;
  1568. case 2:
  1569. this.columnHistoryList = data.rows
  1570. break;
  1571. // case 3:
  1572. // this.columnList2 = data.rows
  1573. // break;
  1574. // case 4:
  1575. // this.columnList3 = data.rows
  1576. // break;
  1577. }
  1578. } else {
  1579. this.getColumnList(tableId, columnId)
  1580. }
  1581. })
  1582. },
  1583. // 获取 tableDefault 列
  1584. async getColumnList (tableId, columnId) {
  1585. let queryTable = {
  1586. functionId: this.$route.meta.menuId,
  1587. tableId: tableId,
  1588. languageCode: this.$i18n.locale
  1589. }
  1590. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1591. if (!data.rows.length == 0) {
  1592. switch (columnId) {
  1593. case 1:
  1594. this.columnList = data.rows
  1595. break;
  1596. case 2:
  1597. this.columnHistoryList = data.rows
  1598. break;
  1599. // case 3:
  1600. // this.columnList2 = data.rows
  1601. // break;
  1602. // case 4:
  1603. // this.columnList3 = data.rows
  1604. // break;
  1605. }
  1606. } else {
  1607. // this.showDefault = true.
  1608. }
  1609. })
  1610. },
  1611. }
  1612. }
  1613. </script>
  1614. <style>
  1615. </style>