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.

1550 lines
51 KiB

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