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.

2781 lines
97 KiB

7 months ago
7 months ago
7 months ago
10 months ago
7 months ago
7 months ago
7 months ago
10 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
10 months ago
7 months ago
7 months ago
10 months ago
10 months ago
10 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" :model="searchData">
  4. <el-form-item :label="'BU'">
  5. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
  6. <el-option
  7. v-for="i in userBuList"
  8. :key="i.buNo"
  9. :label="i.buDesc"
  10. :value="i.buDesc">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item :label="'报修方式'">
  15. <el-select v-model="searchData.repairReportingType" placeholder="请选择" clearable style="width: 100px">
  16. <el-option label="设备故障" value="设备故障"></el-option>
  17. <el-option label="TPM红牌" value="TPM红牌"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item :label="'紧急程度'">
  21. <el-select v-model="searchData.urgency" placeholder="请选择" clearable style="width: 80px">
  22. <el-option label="特急" value="特急"></el-option>
  23. <el-option label="紧急" value="紧急"></el-option>
  24. <el-option label="一般" value="一般"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item :label="'维修结论'">
  28. <el-select v-model="searchData.result" placeholder="请选择" clearable style="width: 100px">
  29. <el-option label="维修完成" value="维修完成"></el-option>
  30. <el-option label="维修失败" value="维修失败"></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item :label="'反馈单号'">
  34. <el-input v-model="searchData.planID" clearable style="width: 120px"></el-input>
  35. </el-form-item>
  36. <el-form-item :label="'工单编码'">
  37. <el-input v-model="searchData.orderNo" clearable style="width: 120px"></el-input>
  38. </el-form-item>
  39. <el-form-item :label="'设备编码'">
  40. <el-input v-model="searchData.objectID" clearable style="width: 100px"></el-input>
  41. </el-form-item>
  42. <el-form-item :label="'人员部门'">
  43. <el-input v-model="searchData.departmentName" readonly style="width: 200px"></el-input>
  44. </el-form-item>
  45. </el-form>
  46. <el-form :inline="true" label-position="top" :model="searchData">
  47. <el-form-item :label="'状态'">
  48. <el-select v-model="searchData.status" clearable style="width: 100px">
  49. <el-option label="未开工" value="未开工"></el-option>
  50. <el-option label="已到达" value="已到达"></el-option>
  51. <el-option label="待确认" value="待确认"></el-option>
  52. <el-option label="待审核" value="待审核"></el-option>
  53. <el-option label="已完工" value="已完工"></el-option>
  54. <el-option label="已取消" value="已取消"></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item :label="'单据来源'">
  58. <el-select v-model="searchData.documentSource" clearable style="width: 100px">
  59. <el-option label="设备点检" value="设备点检"></el-option>
  60. <el-option label="设备维修" value="设备维修"></el-option>
  61. <el-option label="维修失败" value="维修失败"></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item :label="'计划执行日期'">
  65. <el-date-picker
  66. style="width: 120px"
  67. v-model="searchData.startDate"
  68. type="date"
  69. value-format="yyyy-MM-dd"
  70. placeholder="选择日期">
  71. </el-date-picker>
  72. </el-form-item>
  73. <el-form-item style="margin-top: 23px;">
  74. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  75. </el-form-item>
  76. <el-form-item :label="' '">
  77. <el-date-picker
  78. style="width: 120px"
  79. v-model="searchData.endDate"
  80. type="date"
  81. value-format="yyyy-MM-dd"
  82. placeholder="选择日期">
  83. </el-date-picker>
  84. </el-form-item>
  85. <el-form-item :label="' '">
  86. <el-button v-if="!authSearch" @click="getDataList()">查询</el-button>
  87. <el-button v-if="!authCheck" @click="checkModals()">批量审核</el-button>
  88. <el-button v-if="!authChange" type="primary" @click="changeModel()">更改执行人员</el-button>
  89. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  90. <!-- <download-excel-->
  91. <!-- :fields="fields()"-->
  92. <!-- :data="exportData"-->
  93. <!-- type="xls"-->
  94. <!-- :name="exportName"-->
  95. <!-- :header="exportHeader"-->
  96. <!-- :footer="exportFooter"-->
  97. <!-- :fetch="createExportData"-->
  98. <!-- :before-generate="startDownload"-->
  99. <!-- :before-finish="finishDownload"-->
  100. <!-- worksheet="导出信息"-->
  101. <!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
  102. <!-- {{ "导出" }}-->
  103. <!-- </download-excel>-->
  104. </el-form-item>
  105. </el-form>
  106. <el-table
  107. :height="height"
  108. :data="dataList"
  109. border
  110. v-loading="dataListLoading"
  111. @selection-change="selectionChangeHandle"
  112. :row-style="controlRowStyle"
  113. style="width: 100%;">
  114. <el-table-column
  115. type="selection"
  116. header-align="center"
  117. align="center"
  118. width="50">
  119. </el-table-column>
  120. <el-table-column
  121. prop="urgency"
  122. header-align="center"
  123. align="center"
  124. label="紧急程度"
  125. width="70">
  126. <template slot-scope="scope">
  127. <div
  128. :style="{fontWeight:'bold', color: scope.row.urgency === '特急' ? 'red' : scope.row.urgency === '紧急' ? '#ffa500e0' : scope.row.urgency === '一般' ? '#47B0FF' : ''}">
  129. {{ scope.row.urgency }}
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column
  134. prop="result"
  135. header-align="center"
  136. align="center"
  137. label="维修结论"
  138. width="80">
  139. <template slot-scope="scope">
  140. <div
  141. :style="{fontWeight:'bold', color: scope.row.result === '维修失败' ? 'red' : scope.row.result === '维修完成' ? '#3ac252' : ''}">
  142. {{ scope.row.result }}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column
  147. v-for="(item,index) in columnList" :key="index"
  148. :sortable="item.columnSortable"
  149. :prop="item.columnProp"
  150. :header-align="item.headerAlign"
  151. :show-overflow-tooltip="item.showOverflowTooltip"
  152. :align="item.align"
  153. :fixed="item.fixed==''?false:item.fixed"
  154. :min-width="item.columnWidth"
  155. :label="item.columnLabel">
  156. <template slot-scope="scope">
  157. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  158. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. fixed="right"
  163. header-align="center"
  164. align="center"
  165. width="100"
  166. label="操作">
  167. <template slot-scope="scope">
  168. <!-- <a type="text" size="small" v-if="scope.row.status === '待审核'" @click="checkModal(scope.row)">审核</a>-->
  169. <el-link style="cursor: pointer" v-if="(scope.row.status === '待审核' || scope.row.status === '已完工') && !authDetail" @click="reportModal(scope.row)">详情</el-link>
  170. <el-link style="cursor: pointer" v-if="scope.row.status === '待确认' && !authDetail && confirmButtonFlag" @click="confirmResult(scope.row)">确认</el-link>
  171. <el-link style="cursor: pointer" v-if="scope.row.status === '未开工' && !authCancel" @click="cancelOrder(scope.row)">取消工单</el-link>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. <el-pagination
  176. @size-change="sizeChangeHandle"
  177. @current-change="currentChangeHandle"
  178. :current-page="pageIndex"
  179. :page-sizes="[20, 50, 100, 200, 500]"
  180. :page-size="pageSize"
  181. :total="totalPage"
  182. layout="total, sizes, prev, pager, next, jumper">
  183. </el-pagination>
  184. <el-dialog title="批量修改计划人员" :close-on-click-modal="false" v-drag :visible.sync="changeModelFlag" width="300px">
  185. <el-form :inline="true" label-position="top">
  186. <el-form-item style="margin-left: 10px">
  187. <span style="cursor: pointer" slot="label" @click="getBaseList(201)"><a>计划执行人员</a></span>
  188. <el-input v-model="planOperator" style="width: 120px"></el-input>
  189. </el-form-item>
  190. <el-form-item :label="'人员名称'">
  191. <el-input v-model="planOperatorName" disabled style="width: 120px"></el-input>
  192. </el-form-item>
  193. </el-form>
  194. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  195. <el-button type="primary" @click="changeOrderOperator()">保存</el-button>
  196. <el-button type="primary" @click="changeModelFlag = false">关闭</el-button>
  197. </el-footer>
  198. </el-dialog>
  199. <el-dialog title="审核" :close-on-click-modal="false" v-drag :visible.sync="submitModelFlag" width="375px">
  200. <el-form :inline="true" label-position="top">
  201. <el-form-item :label="'难度等级'">
  202. <el-select filterable v-model="submitData.difficultyLevel" style="width: 130px" placeholder="请评估难度等级">
  203. <el-option label="难度一" value="难度一"></el-option>
  204. <el-option label="难度二" value="难度二"></el-option>
  205. <el-option label="难度三" value="难度三"></el-option>
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item :label="'备注'">
  209. <el-input v-model="submitData.difficultyRemark" style="width: 200px"></el-input>
  210. </el-form-item>
  211. </el-form>
  212. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  213. <el-button type="primary" @click="submitModel(1)">通过</el-button>
  214. <el-button type="primary" @click="submitModel(2)">退回</el-button>
  215. <el-button @click="submitModelFlag = false">取消</el-button>
  216. </el-footer>
  217. </el-dialog>
  218. <el-dialog top="12vh" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="960px">
  219. <template v-slot:title>
  220. <div style="padding-top: 5px;padding-left: 15px">
  221. <span :style="{ fontSize: '15px', fontWeight: 'bold' }">维修工单</span>
  222. <span :style="{
  223. marginTop: '-5px',
  224. marginLeft: '5px',
  225. fontSize: '15px',
  226. verticalAlign: 'middle',
  227. display: 'inline-block',
  228. width: '17px',
  229. height: '17px',
  230. borderRadius: '50%',
  231. background: detailData.urgency === '特急' ? 'red' : detailData.urgency === '紧急' ? '#ffa500e0' : detailData.urgency === '一般' ? '#47B0FF' : ''}">
  232. </span>
  233. </div>
  234. </template>
  235. <div style="margin-left: 15px">
  236. <el-form :inline="true" label-position="top" style="margin-top: 10px">
  237. <el-form-item label="工单号">
  238. <el-input v-model="detailData.orderNo" disabled style="width: 100px"></el-input>
  239. </el-form-item>
  240. <el-form-item label="计划执行人员" style="margin-left: 30px">
  241. <el-input v-model="detailData.planOperatorName" disabled style="width: 100px"></el-input>
  242. </el-form-item>
  243. <el-form-item label="计划执行日期" style="margin-left: 30px">
  244. <el-date-picker style="width: 100px" v-model="detailData.planDate" type="datetime" disabled value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
  245. </el-form-item>
  246. <el-form-item label="设备编码" style="margin-left: 30px">
  247. <el-input v-model="detailData.objectID" disabled style="width: 100px"></el-input>
  248. </el-form-item>
  249. <el-form-item label="设备名称" style="margin-left: 30px">
  250. <el-input v-model="detailData.objectDesc" disabled style="width: 150px"></el-input>
  251. </el-form-item>
  252. <el-form-item label="机台" style="margin-left: 30px">
  253. <el-input v-model="detailData.resourceDesc" disabled style="width: 125px"></el-input>
  254. </el-form-item>
  255. </el-form>
  256. <el-form :inline="true" label-position="top">
  257. <el-form-item label="报修人">
  258. <el-input v-model="detailData.createBy" disabled style="width: 100px"></el-input>
  259. </el-form-item>
  260. <el-form-item label="报修时间" style="margin-left: 30px">
  261. <el-input v-model="detailData.createdDate" disabled style="width: 130px"></el-input>
  262. </el-form-item>
  263. <el-form-item label="响应人">
  264. <el-input v-model="detailData.reachOperatorName" disabled style="width: 100px"></el-input>
  265. </el-form-item>
  266. <el-form-item label="响应时间" style="margin-left: 30px">
  267. <el-date-picker :disabled="detailData.status === '已完工'" style="width: 170px" v-model="detailData.reachDate" type="datetime" value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss'></el-date-picker>
  268. </el-form-item>
  269. <el-form-item label="响应时长(m)" style="margin-left: 30px">
  270. <el-input-number :controls="false" :step="0" :min="0" :disabled="detailData.status === '已完工'" v-model="detailData.responseTime" style="width: 80px"></el-input-number>
  271. </el-form-item>
  272. <el-form-item label=" " style="margin-left: 30px">
  273. <el-checkbox v-model="detailData.uploadMalfunctionPicturesFlag"
  274. :class="detailData.uploadMalfunctionPicturesFlag==='Y'?'ifcheckboxColor':''" disabled :true-label="'Y'" :false-label="'N'">
  275. 是否上传故障图片</el-checkbox>
  276. </el-form-item>
  277. </el-form>
  278. <el-form :inline="true" label-position="top">
  279. <el-form-item label="维修结果">
  280. <el-input v-model="detailData.result" disabled style="width: 100px"></el-input>
  281. </el-form-item>
  282. <el-form-item label="处置措施" style="margin-left: 30px">
  283. <el-input v-model="detailData.disposalMeasures" disabled style="width: 130px"></el-input>
  284. </el-form-item>
  285. <el-form-item label="是否停机保修">
  286. <el-input v-model="detailData.shutdownWarranty" disabled style="width: 100px"></el-input>
  287. </el-form-item>
  288. <el-form-item label="实际执行时间" style="margin-left: 30px">
  289. <el-date-picker :disabled="detailData.status === '已完工'" style="width: 170px" v-model="detailData.actualDate" type="datetime" value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss'></el-date-picker>
  290. </el-form-item>
  291. <el-form-item label="工作时长(m)" style="margin-left: 30px">
  292. <el-input-number :controls="false" :step="0" :min="0" v-model="detailData.workTime" :disabled="detailData.status === '已完工'" style="width: 80px"></el-input-number>
  293. </el-form-item>
  294. <el-form-item label=" " style="margin-left: 30px">
  295. <el-checkbox v-model="detailData.uploadSparepartsPicturesFlag" :class="detailData.uploadSparepartsPicturesFlag==='Y'?'ifcheckboxColor':''" disabled :true-label="'Y'" :false-label="'N'">
  296. 是否上传备件图片</el-checkbox>
  297. </el-form-item>
  298. </el-form>
  299. <el-form :inline="true" :model="detailData" label-position="top">
  300. <el-form-item label="报修反馈描述">
  301. <el-input type="textarea" disabled v-model="detailData.feedBackDesc" :rows="3" resize='none' show-word-limit style="width: 900px"></el-input>
  302. </el-form-item>
  303. </el-form>
  304. <el-tabs v-model="activeTable" style="margin-top: 55px; width: 99%; height: 100%;" @tab-click="tabClick" class="customer-tab">
  305. <el-tab-pane label="维修单" name="inspection_form" style="height: 320px">
  306. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  307. <el-form-item label="故障编码">
  308. <el-input v-model="detailData.defectID" disabled style="width: 100px"></el-input>
  309. </el-form-item>
  310. <el-form-item label="故障名称" style="margin-left: -10px">
  311. <el-input v-model="detailData.defectDesc" disabled style="width: 200px"></el-input>
  312. </el-form-item>
  313. <el-form-item label="实际维修人员">
  314. <el-input v-model="detailData.actualOperatorName" disabled style="width: 200px"></el-input>
  315. </el-form-item>
  316. <el-form-item :label="' '" style="margin-left: 20px">
  317. <el-checkbox v-model="detailData.knowledgeFlag" true-label="Y">维修记录移至知识库</el-checkbox>
  318. <el-button v-if="detailData.status === '已完工'" type="primary" @click="revokeModel()" style="margin-left: 10px">审核撤销</el-button>
  319. <el-button v-else type="primary" @click="checkModal()" style="margin-left: 10px">审核</el-button>
  320. </el-form-item>
  321. <!-- <el-form-item :label="' '">-->
  322. <!-- <el-button type="primary" @click="coreComponentModal">核心配件</el-button>-->
  323. <!-- </el-form-item>-->
  324. </el-form>
  325. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  326. <el-form-item label="故障原因">
  327. <el-input :readonly="detailData.status === '已完工'" type="textarea" v-model="detailData.faultReason" :rows="3" resize='none' show-word-limit style="width: 440px"></el-input>
  328. </el-form-item>
  329. <el-form-item label="处理方式">
  330. <el-input :readonly="detailData.status === '已完工'" type="textarea" v-model="detailData.handlingMethod" :rows="3" resize='none' show-word-limit style="width: 440px"></el-input></el-form-item>
  331. </el-form>
  332. <el-form :inline="true" label-position="top" style="margin-top: 45px">
  333. <el-form-item label="预防措施">
  334. <el-input :readonly="detailData.status === '已完工'" type="textarea" v-model="detailData.preventiveMeasure" :rows="3" resize='none' show-word-limit style="width: 440px"></el-input>
  335. </el-form-item>
  336. <el-form-item label="备注说明">
  337. <el-input :readonly="detailData.status === '已完工'" type="textarea" v-model="detailData.remark" :rows="3" resize='none' show-word-limit style="width: 440px"></el-input>
  338. </el-form-item>
  339. </el-form>
  340. <el-form :inline="true" label-position="top" style="margin-top: 45px">
  341. <el-form-item label="车间评估结论">
  342. <el-select v-model="detailData.confirmAssessment" disabled style="width: 100px;margin-top: 20px">
  343. <el-option label="优秀" value="优秀"></el-option>
  344. <el-option label="一般" value="一般"></el-option>
  345. <el-option label="差" value="差"></el-option>
  346. <el-option label="未完全修复" value="未完全修复"></el-option>
  347. </el-select>
  348. </el-form-item>
  349. <el-form-item label="备注说明">
  350. <el-input readonly type="textarea" v-model="detailData.confirmRemark" :rows="3" resize='none' show-word-limit style="width: 325px"></el-input>
  351. </el-form-item>
  352. <el-form-item label="维修评估结论">
  353. <el-select v-model="detailData.checkAssessment" :disabled="detailData.status === '已完工'" style="width: 100px;margin-top: 20px">
  354. <el-option label="优秀" value="优秀"></el-option>
  355. <el-option label="一般" value="一般"></el-option>
  356. <el-option label="差" value="差"></el-option>
  357. <el-option label="未完全修复" value="未完全修复"></el-option>
  358. </el-select>
  359. </el-form-item>
  360. <el-form-item label="备注说明">
  361. <el-input :readonly="detailData.status === '已完工'" type="textarea" v-model="detailData.checkNotes" :rows="3" resize='none' show-word-limit style="width: 325px"></el-input>
  362. </el-form-item>
  363. </el-form>
  364. </el-tab-pane>
  365. <el-tab-pane label="故障图片" name="feed_back_img">
  366. <div class="rq ">
  367. <el-table
  368. :height="325"
  369. :data="feedBackImages"
  370. border
  371. style="width: 100%;">
  372. <el-table-column
  373. v-for="(item,index) in columnFeedBackImages" :key="index"
  374. :sortable="item.columnSortable"
  375. :prop="item.columnProp"
  376. :header-align="item.headerAlign"
  377. :show-overflow-tooltip="item.showOverflowTooltip"
  378. :align="item.align"
  379. :fixed="item.fixed==''?false:item.fixed"
  380. :min-width="item.columnWidth"
  381. :label="item.columnLabel">
  382. <template slot-scope="scope">
  383. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  384. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column
  388. fixed="right"
  389. header-align="center"
  390. align="center"
  391. width="120"
  392. label="操作">
  393. <template slot-scope="scope">
  394. <el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link>
  395. <el-link style="cursor:pointer" @click="downloadFile(scope.row)">下载</el-link>
  396. </template>
  397. </el-table-column>
  398. </el-table>
  399. </div>
  400. </el-tab-pane>
  401. <el-tab-pane label="备件图片" name="spar_part_img">
  402. <div class="rq ">
  403. <el-table
  404. :height="325"
  405. :data="sparPartImages"
  406. border
  407. style="width: 100%;">
  408. <el-table-column
  409. v-for="(item,index) in columnSparPartImages" :key="index"
  410. :sortable="item.columnSortable"
  411. :prop="item.columnProp"
  412. :header-align="item.headerAlign"
  413. :show-overflow-tooltip="item.showOverflowTooltip"
  414. :align="item.align"
  415. :fixed="item.fixed==''?false:item.fixed"
  416. :min-width="item.columnWidth"
  417. :label="item.columnLabel">
  418. <template slot-scope="scope">
  419. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  420. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  421. </template>
  422. </el-table-column>
  423. <el-table-column
  424. fixed="right"
  425. header-align="center"
  426. align="center"
  427. width="120"
  428. label="操作">
  429. <template slot-scope="scope">
  430. <el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link>
  431. <el-link style="cursor:pointer" @click="downloadFile(scope.row)">下载</el-link>
  432. </template>
  433. </el-table-column>
  434. </el-table>
  435. </div>
  436. </el-tab-pane>
  437. <el-tab-pane label="备品备件清单" name="part_spare_list">
  438. <div class="rq ">
  439. <el-table
  440. :height="325"
  441. :data="partSpareList"
  442. border
  443. style="width: 100%;">
  444. <el-table-column
  445. v-for="(item,index) in columnPartSpareList" :key="index"
  446. :sortable="item.columnSortable"
  447. :prop="item.columnProp"
  448. :header-align="item.headerAlign"
  449. :show-overflow-tooltip="item.showOverflowTooltip"
  450. :align="item.align"
  451. :fixed="item.fixed==''?false:item.fixed"
  452. :min-width="item.columnWidth"
  453. :label="item.columnLabel">
  454. <template slot-scope="scope">
  455. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  456. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  457. </template>
  458. </el-table-column>
  459. </el-table>
  460. </div>
  461. </el-tab-pane>
  462. <el-tab-pane label="维修记录" name="history_record">
  463. <div class="rq " style="margin-top: -10px">
  464. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  465. <el-form-item :label="'维修时间'">
  466. <el-date-picker
  467. style="width: 120px"
  468. v-model="detailData.startDate"
  469. type="date"
  470. value-format="yyyy-MM-dd"
  471. placeholder="选择日期">
  472. </el-date-picker>
  473. </el-form-item>
  474. <el-form-item style="margin-top: 23px;">
  475. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  476. </el-form-item>
  477. <el-form-item :label="' '">
  478. <el-date-picker
  479. style="width: 120px"
  480. v-model="detailData.endDate"
  481. type="date"
  482. value-format="yyyy-MM-dd"
  483. placeholder="选择日期">
  484. </el-date-picker>
  485. </el-form-item>
  486. <el-form-item :label="' '">
  487. <el-button v-if="!authSearch" @click="queryHistoryRecord()">查询</el-button>
  488. </el-form-item>
  489. </el-form>
  490. <el-table
  491. :height="295"
  492. :data="historyRecordList"
  493. border
  494. style="width: 100%;">
  495. <el-table-column
  496. v-for="(item,index) in columnHistoryList" :key="index"
  497. :sortable="item.columnSortable"
  498. :prop="item.columnProp"
  499. :header-align="item.headerAlign"
  500. :show-overflow-tooltip="item.showOverflowTooltip"
  501. :align="item.align"
  502. :fixed="item.fixed==''?false:item.fixed"
  503. :min-width="item.columnWidth"
  504. :label="item.columnLabel">
  505. <template slot-scope="scope">
  506. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  507. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  508. </template>
  509. </el-table-column>
  510. <el-table-column
  511. fixed="right"
  512. header-align="center"
  513. align="center"
  514. width="120"
  515. label="图片">
  516. <template slot-scope="scope">
  517. <el-button type="primary" @click="checkFaultImageModal(scope.row)">故障</el-button>
  518. <el-button type="primary" @click="checkSparPartImageModal(scope.row)">备件</el-button>
  519. </template>
  520. </el-table-column>
  521. </el-table>
  522. <!-- 分页插件 -->
  523. <el-pagination
  524. style="margin-top: 0px"
  525. @size-change="sizeChangeHandle2"
  526. @current-change="currentChangeHandle2"
  527. :current-page="pageIndex2"
  528. :page-sizes="[20, 50, 100, 200, 500]"
  529. :page-size="pageSize2"
  530. :total="totalPage2"
  531. layout="total, sizes, prev, pager, next, jumper">
  532. </el-pagination>
  533. </div>
  534. </el-tab-pane>
  535. <el-tab-pane label="核心备品备件更换记录" name="core_component">
  536. <div class="rq ">
  537. <el-table
  538. :height="280"
  539. :data="corePartSpareList"
  540. border
  541. style="width: 100%;">
  542. <el-table-column
  543. v-for="(item,index) in columnCoreComponent" :key="index"
  544. :sortable="item.columnSortable"
  545. :prop="item.columnProp"
  546. :header-align="item.headerAlign"
  547. :show-overflow-tooltip="item.showOverflowTooltip"
  548. :align="item.align"
  549. :fixed="item.fixed==''?false:item.fixed"
  550. :min-width="item.columnWidth"
  551. :label="item.columnLabel">
  552. <template slot-scope="scope">
  553. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  554. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  555. </template>
  556. </el-table-column>
  557. </el-table>
  558. </div>
  559. </el-tab-pane>
  560. </el-tabs>
  561. </div>
  562. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  563. <el-button style="margin-left: -12px" type="primary" @click="updateResult()">保存</el-button>
  564. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  565. </el-footer>
  566. </el-dialog>
  567. <el-dialog title="核心备件" :close-on-click-modal="false" v-drag :visible.sync="coreComponentFlag" width="450px">
  568. <el-form :inline="true" label-position="top">
  569. <el-form-item label="备件编码">
  570. <el-select v-model="coreComponentData.partNo" placeholder="请选择" style="width: 120px">
  571. <el-option
  572. v-for = "i in corePartSpareList"
  573. :key = "i.partNo"
  574. :label = "i.partNo"
  575. :value = "i.partNo">
  576. </el-option>
  577. </el-select>
  578. </el-form-item>
  579. <el-form-item label="备件名称">
  580. <el-input v-model="coreComponentData.partDescription" disabled style="width: 280px"></el-input>
  581. </el-form-item>
  582. </el-form>
  583. <el-form :inline="true" label-position="top">
  584. <el-form-item label="老序列号">
  585. <el-input v-model="coreComponentData.oldSerialNo" disabled style="width: 200px"></el-input>
  586. </el-form-item>
  587. <el-form-item label="新序列号">
  588. <el-input v-model="coreComponentData.newSerialNo" disabled style="width: 200px"></el-input>
  589. </el-form-item>
  590. </el-form>
  591. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  592. <el-button type="primary" @click="coreComponentFlag = false">关闭</el-button>
  593. </el-footer>
  594. </el-dialog>
  595. <!-- 部门 -->
  596. <el-dialog title="部门清单" :close-on-click-modal="false" v-drag :visible.sync="departmentModelFlag" width="520px">
  597. <div class="rq">
  598. <el-form :inline="true" label-position="top" :model="departmentData">
  599. <el-form-item :label="'部门编码'">
  600. <el-input v-model="departmentData.deptId" style="width: 120px"></el-input>
  601. </el-form-item>
  602. <el-form-item :label="'部门名称'">
  603. <el-input v-model="departmentData.deptName" style="width: 120px"></el-input>
  604. </el-form-item>
  605. <el-form-item :label="' '">
  606. <el-button type="primary" @click="getDepartmentList()">查询</el-button>
  607. </el-form-item>
  608. </el-form>
  609. <el-table
  610. :height="300"
  611. :data="departmentList"
  612. ref="departmentTable"
  613. @row-click="departmentClickRow"
  614. @selection-change="selectionDepartment"
  615. :row-key="getRowKeys"
  616. border
  617. v-loading="dataListLoading"
  618. style="width: 100%;">
  619. <el-table-column
  620. type="selection"
  621. header-align="center"
  622. align="center"
  623. :reserve-selection="true"
  624. width="50">
  625. </el-table-column>
  626. <el-table-column
  627. v-for="(item,index) in departmentDetailList" :key="index"
  628. :sortable="item.columnSortable"
  629. :prop="item.columnProp"
  630. :header-align="item.headerAlign"
  631. :show-overflow-tooltip="item.showOverflowTooltip"
  632. :align="item.align"
  633. :fixed="item.fixed==''?false:item.fixed"
  634. :min-width="item.columnWidth"
  635. :label="item.columnLabel">
  636. <template slot-scope="scope">
  637. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  638. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  639. </template>
  640. </el-table-column>
  641. </el-table>
  642. </div>
  643. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  644. <el-button type="primary" @click="confirmDepartment()">确认</el-button>
  645. <el-button type="primary" @click="departmentModelFlag = false">关闭</el-button>
  646. </el-footer>
  647. </el-dialog>
  648. <el-dialog title="图片查看" :close-on-click-modal="false" v-drag :visible.sync="imageModalFlag" width="390px" style="height: 550px;">
  649. <div v-viewer>
  650. <img v-for="(item, index) in descImages" :src="item" :key="index" style="width: 100px;height: 100px"/>
  651. </div>
  652. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  653. <el-button type="primary" @click="imageModalFlag = false">关闭</el-button>
  654. </el-footer>
  655. </el-dialog>
  656. <el-dialog title="维修确认" top="22vh" :close-on-click-modal="false" v-drag :visible.sync="confirmDefectModal" width="320px">
  657. <el-form :inline="true" label-position="top">
  658. <el-form-item :label="'确认结果'">
  659. <el-select v-model="confirmData.confirmResult" style="width: 135px">
  660. <el-option label="成功" value="Y"></el-option>
  661. <el-option label="失败" value="N"></el-option>
  662. </el-select>
  663. </el-form-item>
  664. <el-form-item :label="'维修评估'">
  665. <el-select v-model="confirmData.confirmAssessment" style="width: 135px">
  666. <el-option label="优秀" value="优秀"></el-option>
  667. <el-option label="一般" value="一般"></el-option>
  668. <el-option label="差" value="差"></el-option>
  669. <el-option label="未完全修复" value="未完全修复"></el-option>
  670. </el-select>
  671. </el-form-item>
  672. </el-form>
  673. <el-form :inline="true" label-position="top">
  674. <el-form-item :label="'生产维修评估说明'">
  675. <el-input type="textarea" v-model="confirmData.confirmRemark" :rows="3" resize='none' show-word-limit style="width: 285px"></el-input>
  676. </el-form-item>
  677. </el-form>
  678. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  679. <el-button style="margin-left: -12px" type="primary" @click="confirmDefectOrder()">保存</el-button>
  680. <el-button type="primary" @click="confirmDefectModal = false">关闭</el-button>
  681. <el-button type="primary" @click="cancelDefectOrder()">取消工单</el-button>
  682. </el-footer>
  683. </el-dialog>
  684. <el-dialog title="批量审核" top="25vh" :close-on-click-modal="false" v-drag :visible.sync="submitModelsFlag" width="340px">
  685. <el-form :inline="true" label-position="top">
  686. <el-form-item label="难度等级">
  687. <el-select filterable v-model="submitData.difficultyLevel" style="width: 130px" placeholder="请评估难度等级">
  688. <el-option label="难度一" value="难度一"></el-option>
  689. <el-option label="难度二" value="难度二"></el-option>
  690. <el-option label="难度三" value="难度三"></el-option>
  691. </el-select>
  692. </el-form-item>
  693. <el-form-item label=" " style="margin-left: 20px">
  694. <el-checkbox v-model="knowledgeFlag" true-label="Y">维修记录移至知识库</el-checkbox>
  695. </el-form-item>
  696. </el-form>
  697. <el-form :inline="true" label-position="top">
  698. <el-form-item label="备注">
  699. <el-input v-model="submitData.difficultyRemark" style="width: 300px"></el-input>
  700. </el-form-item>
  701. </el-form>
  702. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  703. <el-button type="primary" @click="submitModels()">确定</el-button>
  704. <el-button type="primary" @click="submitModelsFlag = false">取消</el-button>
  705. </el-footer>
  706. </el-dialog>
  707. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  708. </div>
  709. </template>
  710. <script>
  711. import {
  712. eamWorkOrderSearchForDefect,
  713. cancelOrder,
  714. changeOrderOperator,
  715. submitDefect,
  716. searchFileUrl,
  717. getEmpyDeptList,
  718. getDeptList,
  719. updateReportResult, // 修改执行结果
  720. getSiteAndBuByUserName,
  721. confirmDefectOrder, // 维修确认
  722. cancelDefectOrder, // 维修确认-取消工单
  723. submitDefects, // 批量审核
  724. getFeedBackImages, // 获取故障图片
  725. queryHistoryRecord, // 查看维修历史
  726. getSparPartImages, // 获取备件图片
  727. getConfirmButtonOperator, // 获取确认按钮操作人
  728. } from "@/api/eam/eam.js"
  729. import {
  730. downLoadObjectFile,
  731. getDeviceCorePartList,
  732. getDevicePartList,
  733. getKnowledgeBaseList,
  734. getFileContentList
  735. } from '@/api/eam/eam_object_list.js';
  736. import {
  737. getTableDefaultListLanguage,
  738. getTableUserListLanguage,
  739. } from "@/api/table.js"
  740. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  741. import Chooselist from '@/views/modules/common/Chooselist_eam'
  742. import {isAuth} from '../../../utils'
  743. import excel from "@/utils/excel-util.js";
  744. import {deleteSchedulingRecord} from "../../../api/scheduling/scheduling";
  745. export default {
  746. components: {
  747. Chooselist
  748. },
  749. watch: {
  750. searchData: {
  751. deep: true,
  752. handler: function (newV, oldV) {
  753. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  754. }
  755. },
  756. "detailData.actualDate"(newV, oldV) {
  757. this.detailData.workTime = Math.ceil(Math.floor(this.dayjs(this.detailData.actualDate).diff(this.detailData.reachDate, 'seconds') / 30) / 2)
  758. },
  759. "detailData.reachDate"(newV, oldV) {
  760. this.detailData.workTime = Math.ceil(Math.floor(this.dayjs(this.detailData.actualDate).diff(this.detailData.reachDate, 'seconds') / 30) / 2)
  761. this.detailData.responseTime = Math.ceil(Math.floor(this.dayjs(this.detailData.reachDate).diff(this.detailData.createDate, 'seconds') / 30) / 2)
  762. }
  763. },
  764. data() {
  765. return {
  766. // 是否收藏
  767. favorite: false,
  768. // 导出 start
  769. exportData: [],
  770. exportName: "维修工单" + this.dayjs().format('YYYYMMDDHHmmss'),
  771. exportHeader: ["维修工单"],
  772. exportFooter: [],
  773. exportList: [],
  774. confirmButtonOperatorList: [],
  775. confirmButtonFlag: false,
  776. // 导出 end
  777. tagNo: '',
  778. coreComponentData: {
  779. site: '',
  780. orderNo: '',
  781. buNo: '',
  782. objectID: '',
  783. partNo: '',
  784. partDescription: '',
  785. createdBy: '',
  786. oldSerialNo: '',
  787. newSerialNo: '',
  788. },
  789. coreComponentFlag: false,
  790. searchData: {
  791. site: '',
  792. userName: this.$store.state.user.name,
  793. orderNo: '',
  794. planID: '',
  795. objectID: '',
  796. planOperator: '',
  797. planOperatorName: '',
  798. functionType: 'C',
  799. status: '',
  800. startDate: '',
  801. endDate: '',
  802. departmentName: '',
  803. documentSource: '',
  804. page: 1,
  805. limit: 10,
  806. urgency: '',
  807. result: '',
  808. repairReportingType: '',
  809. repairType: '设备维修组'
  810. },
  811. height: 200,
  812. pageIndex: 1,
  813. pageSize: 50,
  814. totalPage: 0,
  815. pageIndex2: 1,
  816. pageSize2: 20,
  817. totalPage2: 0,
  818. dataList: [],
  819. dataListLoading: false,
  820. dataListSelections: [],
  821. modalFlag: false,
  822. modalDisableFlag: false,
  823. departmentList: [],
  824. // 展示列集
  825. columnList: [
  826. {
  827. userId: this.$store.state.user.name,
  828. functionId: 101004006,
  829. serialNumber: '101004006Table1BuDesc',
  830. tableId: "101004006Table1",
  831. tableName: "维修工单表",
  832. columnProp: 'buDesc',
  833. headerAlign: "center",
  834. align: "center",
  835. columnLabel: 'BU',
  836. columnHidden: false,
  837. columnImage: false,
  838. columnSortable: false,
  839. sortLv: 0,
  840. status: true,
  841. fixed: '',
  842. columnWidth: 80,
  843. },
  844. {
  845. userId: this.$store.state.user.name,
  846. functionId: 101004006,
  847. serialNumber: '101004006Table1DisposalMeasures',
  848. tableId: "101004006Table1",
  849. tableName: "维修工单表",
  850. columnProp: 'disposalMeasures',
  851. headerAlign: "center",
  852. align: "center",
  853. columnLabel: '处置措施',
  854. columnHidden: false,
  855. columnImage: false,
  856. columnSortable: false,
  857. sortLv: 0,
  858. status: true,
  859. fixed: '',
  860. columnWidth: 80,
  861. },
  862. {
  863. userId: this.$store.state.user.name,
  864. functionId: 101004006,
  865. serialNumber: '101004006Table1OrderNo',
  866. tableId: "101004006Table1",
  867. tableName: "维修工单表",
  868. columnProp: 'orderNo',
  869. headerAlign: "center",
  870. align: "left",
  871. columnLabel: '工单编码',
  872. columnHidden: false,
  873. columnImage: false,
  874. columnSortable: true,
  875. sortLv: 0,
  876. status: true,
  877. fixed: '',
  878. columnWidth: 100,
  879. },
  880. {
  881. userId: this.$store.state.user.name,
  882. functionId: 101004006,
  883. serialNumber: '101004006Table1PlanID',
  884. tableId: "101004006Table1",
  885. tableName: "维修工单表",
  886. columnProp: 'planID',
  887. headerAlign: "center",
  888. align: "left",
  889. columnLabel: '反馈单号',
  890. columnHidden: false,
  891. columnImage: false,
  892. columnSortable: true,
  893. sortLv: 0,
  894. status: true,
  895. fixed: '',
  896. columnWidth: 100,
  897. },
  898. {
  899. userId: this.$store.state.user.name,
  900. functionId: 101004006,
  901. serialNumber: '101004006Table1FeedBackDesc',
  902. tableId: "101004006Table1",
  903. tableName: "维修工单表",
  904. columnProp: 'feedBackDesc',
  905. headerAlign: "center",
  906. align: "left",
  907. columnLabel: '反馈描述',
  908. columnHidden: false,
  909. columnImage: false,
  910. columnSortable: true,
  911. sortLv: 0,
  912. status: true,
  913. fixed: '',
  914. columnWidth: 200,
  915. },
  916. {
  917. userId: this.$store.state.user.name,
  918. functionId: 101004006,
  919. serialNumber: '101004006Table1DefectID',
  920. tableId: "101004006Table1",
  921. tableName: "维修工单表",
  922. columnProp: 'defectID',
  923. headerAlign: "center",
  924. align: "left",
  925. columnLabel: '故障编码',
  926. columnHidden: false,
  927. columnImage: false,
  928. columnSortable: false,
  929. sortLv: 0,
  930. status: true,
  931. fixed: '',
  932. columnWidth: 100,
  933. },
  934. {
  935. userId: this.$store.state.user.name,
  936. functionId: 101004006,
  937. serialNumber: '101004006Table1DefectDesc',
  938. tableId: "101004006Table1",
  939. tableName: "维修工单表",
  940. columnProp: 'defectDesc',
  941. headerAlign: "center",
  942. align: "left",
  943. columnLabel: '故障名称',
  944. columnHidden: false,
  945. columnImage: false,
  946. columnSortable: false,
  947. sortLv: 0,
  948. status: true,
  949. fixed: '',
  950. columnWidth: 120,
  951. },
  952. {
  953. userId: this.$store.state.user.name,
  954. functionId: 101004006,
  955. serialNumber: '101004006Table1ObjectID',
  956. tableId: "101004006Table1",
  957. tableName: "维修工单表",
  958. columnProp: 'objectID',
  959. headerAlign: "center",
  960. align: "left",
  961. columnLabel: '设备编码',
  962. columnHidden: false,
  963. columnImage: false,
  964. columnSortable: false,
  965. sortLv: 0,
  966. status: true,
  967. fixed: '',
  968. columnWidth: 100,
  969. },
  970. {
  971. userId: this.$store.state.user.name,
  972. functionId: 101004006,
  973. serialNumber: '101004006Table1ObjectDesc',
  974. tableId: "101004006Table1",
  975. tableName: "维修工单表",
  976. columnProp: 'objectDesc',
  977. headerAlign: "center",
  978. align: "left",
  979. columnLabel: '设备名称',
  980. columnHidden: false,
  981. columnImage: false,
  982. columnSortable: false,
  983. sortLv: 0,
  984. status: true,
  985. fixed: '',
  986. columnWidth: 150,
  987. },
  988. {
  989. userId: this.$store.state.user.name,
  990. functionId: 101004006,
  991. serialNumber: '101004006Table1ResourceDesc',
  992. tableId: "101004006Table1",
  993. tableName: "维修工单表",
  994. columnProp: 'resourceDesc',
  995. headerAlign: "center",
  996. align: "left",
  997. columnLabel: '机台名称',
  998. columnHidden: false,
  999. columnImage: false,
  1000. columnSortable: false,
  1001. sortLv: 0,
  1002. status: true,
  1003. fixed: '',
  1004. columnWidth: 120,
  1005. },
  1006. {
  1007. userId: this.$store.state.user.name,
  1008. functionId: 101004006,
  1009. serialNumber: '101004006Table1DepartmentName',
  1010. tableId: "101004006Table1",
  1011. tableName: "维修工单表",
  1012. columnProp: 'departmentName',
  1013. headerAlign: "center",
  1014. align: "left",
  1015. columnLabel: '设备部门',
  1016. columnHidden: false,
  1017. columnImage: false,
  1018. columnSortable: false,
  1019. sortLv: 0,
  1020. status: true,
  1021. fixed: '',
  1022. columnWidth: 100,
  1023. },
  1024. {
  1025. userId: this.$store.state.user.name,
  1026. functionId: 101004006,
  1027. serialNumber: '101004006Table1CreateBy',
  1028. tableId: "101004006Table1",
  1029. tableName: "维修工单表",
  1030. columnProp: 'createBy',
  1031. headerAlign: "center",
  1032. align: "center",
  1033. columnLabel: '报修人员名称',
  1034. columnHidden: false,
  1035. columnImage: false,
  1036. columnSortable: false,
  1037. sortLv: 0,
  1038. status: true,
  1039. fixed: '',
  1040. columnWidth: 100,
  1041. },
  1042. {
  1043. userId: this.$store.state.user.name,
  1044. functionId: 101004006,
  1045. serialNumber: '101004006Table1Status',
  1046. tableId: "101004006Table1",
  1047. tableName: "维修工单表",
  1048. columnProp: 'status',
  1049. headerAlign: "center",
  1050. align: "center",
  1051. columnLabel: '状态',
  1052. columnHidden: false,
  1053. columnImage: false,
  1054. columnSortable: true,
  1055. sortLv: 0,
  1056. status: true,
  1057. fixed: '',
  1058. columnWidth: 80,
  1059. },
  1060. {
  1061. userId: this.$store.state.user.name,
  1062. functionId: 101004006,
  1063. serialNumber: '101004006Table1PlanOperatorName',
  1064. tableId: "101004006Table1",
  1065. tableName: "维修工单表",
  1066. columnProp: 'planOperatorName',
  1067. headerAlign: "center",
  1068. align: "center",
  1069. columnLabel: '计划执行人员',
  1070. columnHidden: false,
  1071. columnImage: false,
  1072. columnSortable: false,
  1073. sortLv: 0,
  1074. status: true,
  1075. fixed: '',
  1076. columnWidth: 100,
  1077. },
  1078. {
  1079. userId: this.$store.state.user.name,
  1080. functionId: 101004006,
  1081. serialNumber: '101004006Table1ActualOperatorName',
  1082. tableId: "101004006Table1",
  1083. tableName: "维修工单表",
  1084. columnProp: 'actualOperatorName',
  1085. headerAlign: "center",
  1086. align: "center",
  1087. columnLabel: '实际执行人员',
  1088. columnHidden: false,
  1089. columnImage: false,
  1090. columnSortable: false,
  1091. sortLv: 0,
  1092. status: true,
  1093. fixed: '',
  1094. columnWidth: 100,
  1095. },
  1096. {
  1097. userId: this.$store.state.user.name,
  1098. functionId: 101004006,
  1099. serialNumber: '101004006Table1PlanDate',
  1100. tableId: "101004006Table1",
  1101. tableName: "维修工单表",
  1102. columnProp: 'planDate',
  1103. headerAlign: "center",
  1104. align: "center",
  1105. columnLabel: '计划执行日期',
  1106. columnHidden: false,
  1107. columnImage: false,
  1108. columnSortable: true,
  1109. sortLv: 0,
  1110. status: true,
  1111. fixed: '',
  1112. columnWidth: 100,
  1113. },
  1114. {
  1115. userId: this.$store.state.user.name,
  1116. functionId: 101004006,
  1117. serialNumber: '101004006Table1CreatedDate',
  1118. tableId: "101004006Table1",
  1119. tableName: "维修工单表",
  1120. columnProp: 'createdDate',
  1121. headerAlign: "center",
  1122. align: "center",
  1123. columnLabel: '故障时间',
  1124. columnHidden: false,
  1125. columnImage: false,
  1126. columnSortable: true,
  1127. sortLv: 0,
  1128. status: true,
  1129. fixed: '',
  1130. columnWidth: 140,
  1131. },
  1132. {
  1133. userId: this.$store.state.user.name,
  1134. functionId: 101004006,
  1135. serialNumber: '101004006Table1ReachDate',
  1136. tableId: "101004006Table1",
  1137. tableName: "维修工单表",
  1138. columnProp: 'reachDate',
  1139. headerAlign: "center",
  1140. align: "center",
  1141. columnLabel: '到达时间',
  1142. columnHidden: false,
  1143. columnImage: false,
  1144. columnSortable: true,
  1145. sortLv: 0,
  1146. status: true,
  1147. fixed: '',
  1148. columnWidth: 140,
  1149. },
  1150. {
  1151. userId: this.$store.state.user.name,
  1152. functionId: 101004006,
  1153. serialNumber: '101004006Table1ActualDate',
  1154. tableId: "101004006Table1",
  1155. tableName: "维修工单表",
  1156. columnProp: 'actualDate',
  1157. headerAlign: "center",
  1158. align: "center",
  1159. columnLabel: '实际执行时间',
  1160. columnHidden: false,
  1161. columnImage: false,
  1162. columnSortable: true,
  1163. sortLv: 0,
  1164. status: true,
  1165. fixed: '',
  1166. columnWidth: 140,
  1167. },
  1168. {
  1169. userId: this.$store.state.user.name,
  1170. functionId: 101004006,
  1171. serialNumber: '101004006Table1ResponseTime',
  1172. tableId: "101004006Table1",
  1173. tableName: "维修工单表",
  1174. columnProp: 'responseTime',
  1175. headerAlign: "center",
  1176. align: "right",
  1177. columnLabel: '维修响应时长(m)',
  1178. columnHidden: false,
  1179. columnImage: false,
  1180. columnSortable: false,
  1181. sortLv: 0,
  1182. status: true,
  1183. fixed: '',
  1184. columnWidth: 110,
  1185. },
  1186. {
  1187. userId: this.$store.state.user.name,
  1188. functionId: 101004006,
  1189. serialNumber: '101004006Table1WorkTime',
  1190. tableId: "101004006Table1",
  1191. tableName: "维修工单表",
  1192. columnProp: 'workTime',
  1193. headerAlign: "center",
  1194. align: "right",
  1195. columnLabel: '工作时长(m)',
  1196. columnHidden: false,
  1197. columnImage: false,
  1198. columnSortable: false,
  1199. sortLv: 0,
  1200. status: true,
  1201. fixed: '',
  1202. columnWidth: 80,
  1203. },
  1204. {
  1205. userId: this.$store.state.user.name,
  1206. functionId: 101004006,
  1207. serialNumber: '101004006Table1DifficultyLevel',
  1208. tableId: "101004006Table1",
  1209. tableName: "维修工单表",
  1210. columnProp: 'difficultyLevel',
  1211. headerAlign: "center",
  1212. align: "center",
  1213. columnLabel: '难度等级',
  1214. columnHidden: false,
  1215. columnImage: false,
  1216. columnSortable: false,
  1217. sortLv: 0,
  1218. status: true,
  1219. fixed: '',
  1220. columnWidth: 80,
  1221. },
  1222. {
  1223. userId: this.$store.state.user.name,
  1224. functionId: 101004006,
  1225. serialNumber: '101004006Table1DifficultyRemark',
  1226. tableId: "101004006Table1",
  1227. tableName: "维修工单表",
  1228. columnProp: 'difficultyRemark',
  1229. headerAlign: "center",
  1230. align: "left",
  1231. columnLabel: '难度备注',
  1232. columnHidden: false,
  1233. columnImage: false,
  1234. columnSortable: false,
  1235. sortLv: 0,
  1236. status: true,
  1237. fixed: '',
  1238. columnWidth: 120,
  1239. },
  1240. {
  1241. userId: this.$store.state.user.name,
  1242. functionId: 101004006,
  1243. serialNumber: '101004006Table1DocumentSource',
  1244. tableId: "101004006Table1",
  1245. tableName: "维修工单表",
  1246. columnProp: 'documentSource',
  1247. headerAlign: "center",
  1248. align: "center",
  1249. columnLabel: '单据来源',
  1250. columnHidden: false,
  1251. columnImage: false,
  1252. columnSortable: false,
  1253. sortLv: 0,
  1254. status: true,
  1255. fixed: '',
  1256. columnWidth: 100,
  1257. },
  1258. {
  1259. userId: this.$store.state.user.name,
  1260. functionId: 101004006,
  1261. serialNumber: '101004006Table1FaultReason',
  1262. tableId: "101004006Table1",
  1263. tableName: "维修工单表",
  1264. columnProp: 'faultReason',
  1265. headerAlign: "center",
  1266. align: "left",
  1267. columnLabel: '故障原因',
  1268. columnHidden: false,
  1269. columnImage: false,
  1270. columnSortable: false,
  1271. sortLv: 0,
  1272. status: true,
  1273. fixed: '',
  1274. columnWidth: 200,
  1275. },
  1276. {
  1277. userId: this.$store.state.user.name,
  1278. functionId: 101004006,
  1279. serialNumber: '101004006Table1HandlingMethod',
  1280. tableId: "101004006Table1",
  1281. tableName: "维修工单表",
  1282. columnProp: 'handlingMethod',
  1283. headerAlign: "center",
  1284. align: "left",
  1285. columnLabel: '处理方式',
  1286. columnHidden: false,
  1287. columnImage: false,
  1288. columnSortable: false,
  1289. sortLv: 0,
  1290. status: true,
  1291. fixed: '',
  1292. columnWidth: 200,
  1293. },
  1294. {
  1295. userId: this.$store.state.user.name,
  1296. functionId: 101004006,
  1297. serialNumber: '101004006Table1PreventiveMeasure',
  1298. tableId: "101004006Table1",
  1299. tableName: "维修工单表",
  1300. columnProp: 'preventiveMeasure',
  1301. headerAlign: "center",
  1302. align: "left",
  1303. columnLabel: '预防措施',
  1304. columnHidden: false,
  1305. columnImage: false,
  1306. columnSortable: false,
  1307. sortLv: 0,
  1308. status: true,
  1309. fixed: '',
  1310. columnWidth: 200,
  1311. },
  1312. {
  1313. userId: this.$store.state.user.name,
  1314. functionId: 101004006,
  1315. serialNumber: '101004006Table1Remark',
  1316. tableId: "101004006Table1",
  1317. tableName: "维修工单表",
  1318. columnProp: 'remark',
  1319. headerAlign: "center",
  1320. align: "left",
  1321. columnLabel: '备注说明',
  1322. columnHidden: false,
  1323. columnImage: false,
  1324. columnSortable: false,
  1325. sortLv: 0,
  1326. status: true,
  1327. fixed: '',
  1328. columnWidth: 200,
  1329. },
  1330. ],
  1331. changeModelFlag: false,
  1332. planOperator: '',
  1333. planOperatorName: '',
  1334. submitData: {
  1335. site: '',
  1336. buNo: '',
  1337. orderNo: '',
  1338. planID: '',
  1339. objectID: '',
  1340. checker: '',
  1341. checkerName: '',
  1342. difficultyLevel: '',
  1343. difficultyRemark: '',
  1344. status: '',
  1345. updateBy: this.$store.state.user.name,
  1346. createBy: this.$store.state.user.name,
  1347. planDesc: '',
  1348. disposalMeasures: '',
  1349. defectID: '',
  1350. defectDesc: '',
  1351. remark: '',
  1352. faultReason: '',
  1353. handlingMethod: '',
  1354. preventiveMeasure: '',
  1355. feedbackBy: '',
  1356. actualOperatorName: '',
  1357. knowledgeFlag: '',
  1358. },
  1359. submitModelFlag: false,
  1360. detailData: {
  1361. site: '',
  1362. buNo: '',
  1363. orderNo: '',
  1364. planID: '',
  1365. objectID: '',
  1366. objectDesc: '',
  1367. status: '',
  1368. remark: '',
  1369. workTime: '',
  1370. result: '',
  1371. defectID: '',
  1372. defectDesc: '',
  1373. actualOperatorName: '',
  1374. planDate: '',
  1375. reachDate: '',
  1376. actualDate: '',
  1377. planDesc: '',
  1378. disposalMeasures: '',
  1379. handlingMethod: '',
  1380. functionType: '',
  1381. resourceDesc: '',
  1382. feedBackDesc: '',
  1383. faultReason: '',
  1384. preventiveMeasure: '',
  1385. corePartNo: '',
  1386. corePartDescription: '',
  1387. oldSerialNo: '',
  1388. newSerialNo: '',
  1389. planOperatorName: '',
  1390. createBy: '',
  1391. createdDate: '',
  1392. reachOperator: '',
  1393. reachOperatorName: '',
  1394. responseTime: '',
  1395. createDate: '',
  1396. confirmAssessment: '',
  1397. confirmRemark: '',
  1398. checkAssessment: '',
  1399. checkNotes: '',
  1400. knowledgeFlag: '',
  1401. shutdownWarranty: '',
  1402. startDate: '',
  1403. endDate: '',
  1404. uploadMalfunctionPicturesFlag: 'N',
  1405. uploadSparepartsPicturesFlag: 'N',
  1406. },
  1407. detailModelFlag: false,
  1408. descImages: [],
  1409. imageModalFlag: false,
  1410. departmentModelFlag: false,
  1411. departmentData: {
  1412. site: '',
  1413. buNo: '',
  1414. deptId: '',
  1415. deptName: '',
  1416. },
  1417. departmentListSelections: [],
  1418. departmentDetailList: [
  1419. {
  1420. columnProp: 'deptId',
  1421. headerAlign: "center",
  1422. align: "center",
  1423. columnLabel: '部门编码',
  1424. columnHidden: false,
  1425. columnImage: false,
  1426. columnSortable: false,
  1427. sortLv: 0,
  1428. status: true,
  1429. fixed: '',
  1430. },
  1431. {
  1432. columnProp: 'deptName',
  1433. headerAlign: "center",
  1434. align: "center",
  1435. columnLabel: '部门名称',
  1436. columnHidden: false,
  1437. columnImage: false,
  1438. columnSortable: false,
  1439. sortLv: 0,
  1440. status: true,
  1441. fixed: '',
  1442. },
  1443. ],
  1444. userBuList: [],
  1445. authSearch: false,
  1446. authChange: false,
  1447. authDetail: false,
  1448. authCancel: false,
  1449. authCheck: false,
  1450. menuId: this.$route.meta.menuId,
  1451. confirmData: {
  1452. site: '',
  1453. buNo: '',
  1454. orderNo: '',
  1455. functionType: '',
  1456. confirmResult: '',
  1457. confirmAssessment: '',
  1458. confirmRemark: '',
  1459. confirmBy: ''
  1460. },
  1461. confirmDefectModal: false,
  1462. submitModelsFlag: false,
  1463. activeTable: 'inspection_form',
  1464. feedBackImages: [],
  1465. sparPartImages: [],
  1466. partSpareList: [],
  1467. historyRecordList: [],
  1468. columnFeedBackImages: [
  1469. {
  1470. columnProp: 'fileName',
  1471. headerAlign: 'center',
  1472. align: 'left',
  1473. columnLabel: '文件名称',
  1474. columnHidden: false,
  1475. columnImage: false,
  1476. status: true,
  1477. fixed: false
  1478. },
  1479. {
  1480. columnProp: 'typeFlag',
  1481. headerAlign: 'center',
  1482. align: 'center',
  1483. columnLabel: '图片来源',
  1484. columnHidden: false,
  1485. columnImage: false,
  1486. status: true,
  1487. fixed: false
  1488. },
  1489. {
  1490. columnProp: 'createdBy',
  1491. headerAlign: 'center',
  1492. align: 'center',
  1493. columnLabel: '上传人',
  1494. columnHidden: false,
  1495. columnImage: false,
  1496. status: true,
  1497. fixed: false
  1498. },
  1499. {
  1500. columnProp: 'createDate',
  1501. headerAlign: 'center',
  1502. align: 'center',
  1503. columnLabel: '上传时间',
  1504. columnHidden: false,
  1505. columnImage: false,
  1506. status: true,
  1507. fixed: false
  1508. }
  1509. ],
  1510. columnSparPartImages: [
  1511. {
  1512. columnProp: 'fileName',
  1513. headerAlign: 'center',
  1514. align: 'left',
  1515. columnLabel: '文件名称',
  1516. columnHidden: false,
  1517. columnImage: false,
  1518. status: true,
  1519. fixed: false
  1520. },
  1521. {
  1522. columnProp: 'createdBy',
  1523. headerAlign: 'center',
  1524. align: 'center',
  1525. columnLabel: '上传人',
  1526. columnHidden: false,
  1527. columnImage: false,
  1528. status: true,
  1529. fixed: false
  1530. },
  1531. {
  1532. columnProp: 'createDate',
  1533. headerAlign: 'center',
  1534. align: 'center',
  1535. columnLabel: '上传时间',
  1536. columnHidden: false,
  1537. columnImage: false,
  1538. status: true,
  1539. fixed: false
  1540. }
  1541. ],
  1542. columnPartSpareList: [
  1543. {
  1544. columnProp: 'partNo',
  1545. headerAlign: 'center',
  1546. align: 'center',
  1547. columnLabel: '备品备件编码',
  1548. columnHidden: false,
  1549. columnImage: false,
  1550. status: true,
  1551. fixed: false,
  1552. columnWidth: 120,
  1553. },
  1554. {
  1555. columnProp: 'partDescription',
  1556. headerAlign: 'center',
  1557. align: 'left',
  1558. columnLabel: '备品备件名称',
  1559. columnHidden: false,
  1560. columnImage: false,
  1561. status: true,
  1562. fixed: false,
  1563. columnWidth: 150,
  1564. },
  1565. {
  1566. columnProp: 'spec',
  1567. headerAlign: 'center',
  1568. align: 'left',
  1569. columnLabel: '规格型号',
  1570. columnHidden: false,
  1571. columnImage: false,
  1572. status: true,
  1573. fixed: false,
  1574. columnWidth: 120,
  1575. },
  1576. {
  1577. columnProp: 'umid',
  1578. headerAlign: 'center',
  1579. align: 'left',
  1580. columnLabel: '单位',
  1581. columnHidden: false,
  1582. columnImage: false,
  1583. status: true,
  1584. fixed: false,
  1585. columnWidth: 100,
  1586. },
  1587. ],
  1588. columnHistoryList: [
  1589. {
  1590. columnWidth: 100,
  1591. columnProp: 'orderNo',
  1592. headerAlign: "center",
  1593. align: "left",
  1594. columnLabel: '工单编号',
  1595. columnHidden: false,
  1596. columnImage: false,
  1597. columnSortable: false,
  1598. sortLv: 0,
  1599. status: true,
  1600. fixed: '',
  1601. },
  1602. {
  1603. columnWidth: 200,
  1604. columnProp: 'planDesc',
  1605. headerAlign: "center",
  1606. align: "left",
  1607. columnLabel: '故障描述',
  1608. columnHidden: false,
  1609. columnImage: false,
  1610. columnSortable: false,
  1611. sortLv: 0,
  1612. status: true,
  1613. fixed: '',
  1614. },
  1615. {
  1616. columnWidth: 120,
  1617. columnProp: 'defectDesc',
  1618. headerAlign: "center",
  1619. align: "left",
  1620. columnLabel: '故障名称',
  1621. columnHidden: false,
  1622. columnImage: false,
  1623. columnSortable: false,
  1624. sortLv: 0,
  1625. status: true,
  1626. fixed: '',
  1627. },
  1628. {
  1629. columnWidth: 100,
  1630. columnProp: 'result',
  1631. headerAlign: "center",
  1632. align: "center",
  1633. columnLabel: '维修结论',
  1634. columnHidden: false,
  1635. columnImage: false,
  1636. columnSortable: false,
  1637. sortLv: 0,
  1638. status: true,
  1639. fixed: '',
  1640. },
  1641. {
  1642. columnWidth: 100,
  1643. columnProp: 'disposalMeasures',
  1644. headerAlign: "center",
  1645. align: "left",
  1646. columnLabel: '处置措施',
  1647. columnHidden: false,
  1648. columnImage: false,
  1649. columnSortable: false,
  1650. sortLv: 0,
  1651. status: true,
  1652. fixed: '',
  1653. },
  1654. {
  1655. columnWidth: 100,
  1656. columnProp: 'actualOperatorName',
  1657. headerAlign: "center",
  1658. align: "center",
  1659. columnLabel: '维修人员',
  1660. columnHidden: false,
  1661. columnImage: false,
  1662. columnSortable: false,
  1663. sortLv: 0,
  1664. status: true,
  1665. fixed: '',
  1666. },
  1667. {
  1668. columnWidth: 80,
  1669. columnProp: 'workTime',
  1670. headerAlign: "center",
  1671. align: "right",
  1672. columnLabel: '工作时长(m)',
  1673. columnHidden: false,
  1674. columnImage: false,
  1675. columnSortable: false,
  1676. sortLv: 0,
  1677. status: true,
  1678. fixed: '',
  1679. },
  1680. {
  1681. columnWidth: 130,
  1682. columnProp: 'actualDate',
  1683. headerAlign: "center",
  1684. align: "center",
  1685. columnLabel: '维修时间',
  1686. columnHidden: false,
  1687. columnImage: false,
  1688. columnSortable: false,
  1689. sortLv: 0,
  1690. status: true,
  1691. fixed: '',
  1692. },
  1693. {
  1694. columnWidth: 200,
  1695. columnProp: 'remark',
  1696. headerAlign: "center",
  1697. align: "left",
  1698. columnLabel: '备注说明',
  1699. columnHidden: false,
  1700. columnImage: false,
  1701. columnSortable: false,
  1702. sortLv: 0,
  1703. status: true,
  1704. fixed: '',
  1705. },
  1706. ],
  1707. columnCoreComponent: [
  1708. {
  1709. columnProp: 'partNo',
  1710. headerAlign: 'center',
  1711. align: 'left',
  1712. columnLabel: '备件编码',
  1713. columnHidden: false,
  1714. columnImage: false,
  1715. status: true,
  1716. fixed: false,
  1717. columnWidth: 120,
  1718. },
  1719. {
  1720. columnProp: 'partDescription',
  1721. headerAlign: 'center',
  1722. align: 'left',
  1723. columnLabel: '备件名称',
  1724. columnHidden: false,
  1725. columnImage: false,
  1726. status: true,
  1727. fixed: false,
  1728. columnWidth: 200,
  1729. },
  1730. {
  1731. columnProp: 'oldSerialNo',
  1732. headerAlign: 'center',
  1733. align: 'left',
  1734. columnLabel: '老序列号',
  1735. columnHidden: false,
  1736. columnImage: false,
  1737. status: true,
  1738. fixed: false,
  1739. columnWidth: 120,
  1740. },
  1741. {
  1742. columnProp: 'newSerialNo',
  1743. headerAlign: 'center',
  1744. align: 'left',
  1745. columnLabel: '新序列号',
  1746. columnHidden: false,
  1747. columnImage: false,
  1748. status: true,
  1749. fixed: false,
  1750. columnWidth: 120,
  1751. },
  1752. ],
  1753. knowledgeFlag: '',
  1754. corePartSpareList: []
  1755. }
  1756. },
  1757. mounted() {
  1758. this.$nextTick(() => {
  1759. this.height = window.innerHeight - 210
  1760. })
  1761. },
  1762. created() {
  1763. // 按钮控制
  1764. this.getButtonAuthData()
  1765. // 获取用户的 site 和 bu
  1766. this.getSiteAndBuByUserName()
  1767. this.favoriteIsOk()
  1768. // 动态列
  1769. this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1)
  1770. if (!this.authSearch) {
  1771. // 查询登陆人员的部门,并过滤出相应工单
  1772. this.getUserDept()
  1773. }
  1774. this.getConfirmButtonOperator()
  1775. },
  1776. methods: {
  1777. // ======= 正则校验 =======
  1778. handleInput(value, type) {
  1779. // 大于等于0,且只能输入4位小数
  1780. let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/, '$1')
  1781. if (val === null || val === undefined || val === '') {
  1782. val = 0
  1783. }
  1784. if (type === 1) {
  1785. this.detailData.workTime = val
  1786. } else if (type === 2) {
  1787. this.detailData.responseTime = val
  1788. }
  1789. },
  1790. // 获取用户的bu
  1791. getSiteAndBuByUserName() {
  1792. let tempData = {
  1793. username: this.$store.state.user.name,
  1794. }
  1795. getSiteAndBuByUserName(tempData).then(({data}) => {
  1796. if (data.code === 0) {
  1797. this.userBuList = data.rows
  1798. }
  1799. })
  1800. },
  1801. getConfirmButtonOperator(){
  1802. getConfirmButtonOperator().then(({data}) => {
  1803. if (data.code === 0) {
  1804. this.confirmButtonOperatorList = data.rows
  1805. let usernameList = []
  1806. this.confirmButtonOperatorList.forEach(val => {
  1807. usernameList.push(val.adminID)
  1808. })
  1809. this.confirmButtonFlag = usernameList.includes(this.$store.state.user.name)
  1810. }
  1811. })
  1812. },
  1813. // 控制单行的背景颜色
  1814. controlRowStyle({row, rowIndex}) {
  1815. // 区分不同的样式对应不同的颜色
  1816. if (row.status === '待审核') {
  1817. return "background-color: #D8ECF1"
  1818. }
  1819. },
  1820. // 查询登陆人员的部门
  1821. getUserDept() {
  1822. let tempDate = {
  1823. site: '',
  1824. username: this.$store.state.user.name,
  1825. }
  1826. getDeptList(tempDate).then(({data}) => {
  1827. if (data.code === 0) {
  1828. data.rows.forEach(val => {
  1829. this.searchData.departmentName = this.searchData.departmentName + ";" + val
  1830. })
  1831. this.searchData.departmentName = this.searchData.departmentName.substring(1)
  1832. this.getDataList()
  1833. }
  1834. })
  1835. },
  1836. // 校验用户是否收藏
  1837. favoriteIsOk() {
  1838. let userFavorite = {
  1839. userId: this.$store.state.user.id,
  1840. languageCode: this.$i18n.locale
  1841. }
  1842. userFavoriteList(userFavorite).then(({data}) => {
  1843. for (let i = 0; i < data.list.length; i++) {
  1844. if (this.$route.meta.menuId === data.list[i].menuId) {
  1845. this.favorite = true
  1846. }
  1847. }
  1848. })
  1849. },
  1850. // 收藏 OR 取消收藏
  1851. favoriteFunction() {
  1852. let userFavorite = {
  1853. userId: this.$store.state.user.id,
  1854. functionId: this.$route.meta.menuId,
  1855. }
  1856. if (this.favorite) {
  1857. removeUserFavorite(userFavorite).then(({data}) => {
  1858. this.$message.success(data.msg)
  1859. this.favorite = false
  1860. })
  1861. } else {
  1862. // 收藏
  1863. saveUserFavorite(userFavorite).then(({data}) => {
  1864. this.$message.success(data.msg)
  1865. this.favorite = true
  1866. })
  1867. }
  1868. },
  1869. // 获取基础数据列表S
  1870. getBaseList(val, type) {
  1871. this.tagNo = val
  1872. this.$nextTick(() => {
  1873. let strVal = ''
  1874. if (val === 201) {
  1875. strVal = this.planOperator
  1876. this.$refs.baseList.init(val, strVal)
  1877. }
  1878. })
  1879. },
  1880. /* 列表方法的回调 */
  1881. getBaseData(val) {
  1882. if (this.tagNo === 201) {
  1883. this.planOperator = val.username
  1884. this.planOperatorName = val.user_display
  1885. }
  1886. },
  1887. async exportExcel() {
  1888. this.searchData.limit = -1
  1889. this.searchData.page = 1
  1890. excel.exportTable({
  1891. url: "/pms/eam/eamWorkOrderSearchForDefect",
  1892. columnMapping: this.columnList,//可以直接用table,不需要的列就剔除
  1893. mergeSetting: [],//需要合并的列
  1894. params: this.searchData,
  1895. fileName: this.exportName+".xlsx",
  1896. rowFetcher: res => res.data,
  1897. columnFormatter: [],
  1898. dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列
  1899. });
  1900. },
  1901. //导出excel
  1902. // async createExportData() {
  1903. // this.searchData.limit = -1
  1904. // this.searchData.page = 1
  1905. // await eamWorkOrderSearchForDefect(this.searchData).then(({data}) => {
  1906. // this.exportList = data.page.list
  1907. // })
  1908. // return this.exportList
  1909. // },
  1910. //
  1911. // startDownload() {
  1912. // },
  1913. //
  1914. // finishDownload() {
  1915. // },
  1916. //
  1917. // fields() {
  1918. // let json = "{"
  1919. // this.columnList.forEach((item, index) => {
  1920. // if (index == this.columnList.length - 1) {
  1921. // json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1922. // } else {
  1923. // json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1924. // }
  1925. // })
  1926. // json += "}"
  1927. // let s = eval("(" + json + ")")
  1928. // return s
  1929. // },
  1930. // 获取数据列表
  1931. getDataList() {
  1932. this.searchData.limit = this.pageSize
  1933. this.searchData.page = this.pageIndex
  1934. eamWorkOrderSearchForDefect(this.searchData).then(({data}) => {
  1935. if (data.code === 0) {
  1936. this.dataList = data.page.list
  1937. this.pageIndex = data.page.currPage
  1938. this.pageSize = data.page.pageSize
  1939. this.totalPage = data.page.totalCount
  1940. }
  1941. this.dataListLoading = false
  1942. })
  1943. },
  1944. // 每页数
  1945. sizeChangeHandle(val) {
  1946. this.pageSize = val
  1947. this.pageIndex = 1
  1948. this.getDataList()
  1949. },
  1950. // 当前页
  1951. currentChangeHandle(val) {
  1952. this.pageIndex = val
  1953. this.getDataList()
  1954. },
  1955. // 每页数
  1956. sizeChangeHandle2 (val) {
  1957. this.pageSize2 = val
  1958. this.pageIndex2 = 1
  1959. this.queryHistoryRecord()
  1960. },
  1961. // 当前页
  1962. currentChangeHandle2 (val) {
  1963. this.pageIndex2 = val
  1964. this.queryHistoryRecord()
  1965. },
  1966. // 多选
  1967. selectionChangeHandle(val) {
  1968. this.dataListSelections = val
  1969. },
  1970. cancelOrder(row) {
  1971. this.$confirm(`是否取消选定工单?`, '提示', {
  1972. confirmButtonText: '确定',
  1973. cancelButtonText: '取消',
  1974. type: 'warning'
  1975. }).then(() => {
  1976. cancelOrder(row).then(({data}) => {
  1977. if (data && data.code === 0) {
  1978. this.getDataList()
  1979. this.$message({
  1980. message: '操作成功',
  1981. type: 'success',
  1982. duration: 1500,
  1983. onClose: () => {
  1984. }
  1985. })
  1986. } else {
  1987. this.$alert(data.msg, '错误', {
  1988. confirmButtonText: '确定'
  1989. })
  1990. }
  1991. })
  1992. }).catch(() => {
  1993. })
  1994. },
  1995. // 更改执行人员
  1996. changeModel() {
  1997. let tempData1 = '' // 记录不是未开工的单号
  1998. if (this.dataListSelections.length === 0) {
  1999. this.$message.warning('请勾选要更改的工单!')
  2000. return
  2001. }
  2002. for (let i = 0; i < this.dataListSelections.length; i++) {
  2003. if (this.dataListSelections[i].status !== '未开工') {
  2004. tempData1 = tempData1 + this.dataListSelections[i].orderNo + '、'
  2005. }
  2006. }
  2007. if (tempData1 !== '') {
  2008. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2009. this.$message.warning('工单编码 [' + tempData1 + '] 不是未开工状态!')
  2010. return
  2011. }
  2012. this.planOperator = ''
  2013. this.planOperatorName = ''
  2014. this.changeModelFlag = true
  2015. },
  2016. changeOrderOperator() {
  2017. let inList = JSON.parse(JSON.stringify(this.dataListSelections))
  2018. for (let i = 0; i < inList.length; i++) {
  2019. inList[i].planOperator = this.planOperator
  2020. }
  2021. changeOrderOperator(inList).then(({data}) => {
  2022. if (data && data.code === 0) {
  2023. this.changeModelFlag = false
  2024. this.getDataList()
  2025. this.$message({
  2026. message: '操作成功',
  2027. type: 'success',
  2028. duration: 1500,
  2029. onClose: () => {
  2030. }
  2031. })
  2032. } else {
  2033. this.$alert(data.msg, '错误', {
  2034. confirmButtonText: '确定'
  2035. })
  2036. }
  2037. })
  2038. },
  2039. // 批量审核按钮
  2040. checkModals() {
  2041. let tempData1 = '' // 记录不是待审核的单号
  2042. if (this.dataListSelections.length === 0) {
  2043. this.$message.warning('请勾选要审核的工单!')
  2044. return
  2045. }
  2046. for (let i = 0; i < this.dataListSelections.length; i++) {
  2047. if (this.dataListSelections[i].status !== '待审核') {
  2048. tempData1 = tempData1 + this.dataListSelections[i].orderNo + '、'
  2049. }
  2050. }
  2051. if (tempData1 !== '') {
  2052. tempData1 = tempData1.substring(0, tempData1.length - 1)
  2053. this.$message.warning('工单编码 [' + tempData1 + '] 不是待审核状态!')
  2054. return
  2055. }
  2056. this.submitData.difficultyLevel = ''
  2057. this.submitData.difficultyRemark = ''
  2058. this.knowledgeFlag = ''
  2059. this.submitModelsFlag = true
  2060. },
  2061. submitModels() {
  2062. if (this.submitData.difficultyLevel === '' || this.submitData.difficultyLevel == null) {
  2063. this.$message.warning('请选择难度等级!')
  2064. return
  2065. }
  2066. const list = this.dataListSelections.map(item => ({
  2067. ...item,
  2068. checker: '',
  2069. checkerName: '',
  2070. status: '已完工',
  2071. updateBy: this.$store.state.user.name,
  2072. createBy: this.$store.state.user.name,
  2073. difficultyLevel: this.submitData.difficultyLevel,
  2074. difficultyRemark: this.submitData.difficultyRemark,
  2075. planDesc: item.feedBackDesc,
  2076. feedbackBy: item.createBy,
  2077. knowledgeFlag: ''
  2078. }))
  2079. submitDefects(list).then(({data}) => {
  2080. if (data && data.code === 0) {
  2081. this.getDataList()
  2082. this.submitModelsFlag = false
  2083. this.$message({
  2084. message: '操作成功',
  2085. type: 'success',
  2086. duration: 1500,
  2087. onClose: () => {}
  2088. })
  2089. } else {
  2090. this.$alert(data.msg, '错误', {
  2091. confirmButtonText: '确定'
  2092. })
  2093. }
  2094. })
  2095. },
  2096. // 审核按钮
  2097. checkModal() {
  2098. if (this.authCheck) {
  2099. this.$message.warning('无审核权限!')
  2100. return
  2101. }
  2102. this.submitData.site = this.detailData.site
  2103. this.submitData.buNo = this.detailData.buNo
  2104. this.submitData.orderNo = this.detailData.orderNo
  2105. this.submitData.planID = this.detailData.planID
  2106. this.submitData.objectID = this.detailData.objectID
  2107. this.submitData.planDesc = this.detailData.feedBackDesc
  2108. this.submitData.disposalMeasures = this.detailData.disposalMeasures
  2109. this.submitData.defectID = this.detailData.defectID
  2110. this.submitData.defectDesc = this.detailData.defectDesc
  2111. this.submitData.remark = this.detailData.remark
  2112. this.submitData.difficultyLevel = ''
  2113. this.submitData.difficultyRemark = ''
  2114. this.submitData.faultReason = this.detailData.faultReason
  2115. this.submitData.handlingMethod = this.detailData.handlingMethod
  2116. this.submitData.preventiveMeasure = this.detailData.preventiveMeasure
  2117. this.submitData.feedbackBy = this.detailData.createBy
  2118. this.submitData.actualOperatorName = this.detailData.actualOperatorName
  2119. this.submitData.knowledgeFlag = this.detailData.knowledgeFlag
  2120. this.submitData.updateBy = this.$store.state.user.name
  2121. // if (this.detailData.status === '已完工') {
  2122. // this.$confirm(`是否取消审核?`, '提示', {
  2123. // confirmButtonText: '确定',
  2124. // cancelButtonText: '取消',
  2125. // type: 'warning'
  2126. // }).then(() => {
  2127. // this.submitData.status = '已到达'
  2128. // submitDefect(this.submitData).then(({data}) => {
  2129. // if (data && data.code === 0) {
  2130. // this.getDataList()
  2131. // this.detailData.status = '待审核'
  2132. // this.$message({
  2133. // message: '操作成功',
  2134. // type: 'success',
  2135. // duration: 1500,
  2136. // onClose: () => {
  2137. // }
  2138. // })
  2139. // } else {
  2140. // this.$alert(data.msg, '错误', {
  2141. // confirmButtonText: '确定'
  2142. // })
  2143. // }
  2144. // })
  2145. // })
  2146. // } else {
  2147. // this.submitData.status = '已完工'
  2148. // this.submitModelFlag = true
  2149. // }
  2150. this.submitData.status = '已完工'
  2151. this.submitModelFlag = true
  2152. },
  2153. // 确认审核
  2154. submitModel (param) {
  2155. if (param === 1) {
  2156. if (this.submitData.difficultyLevel === '' || this.submitData.difficultyLevel == null) {
  2157. this.$message.warning('请选择难度等级!')
  2158. return
  2159. }
  2160. submitDefect(this.submitData).then(({data}) => {
  2161. if (data && data.code === 0) {
  2162. this.getDataList()
  2163. this.detailData.status = '已完工'
  2164. this.submitModelFlag = false
  2165. this.$message({
  2166. message: '操作成功',
  2167. type: 'success',
  2168. duration: 1500,
  2169. onClose: () => {}
  2170. })
  2171. } else {
  2172. this.$alert(data.msg, '错误', {
  2173. confirmButtonText: '确定'
  2174. })
  2175. }
  2176. })
  2177. } else {
  2178. this.submitData.status = '已到达'
  2179. submitDefect(this.submitData).then(({data}) => {
  2180. if (data && data.code === 0) {
  2181. this.getDataList()
  2182. this.detailData.status = '待审核'
  2183. this.submitModelFlag = false
  2184. this.detailModelFlag = false
  2185. this.$message({
  2186. message: '操作成功',
  2187. type: 'success',
  2188. duration: 1500,
  2189. onClose: () => {
  2190. }
  2191. })
  2192. } else {
  2193. this.$alert(data.msg, '错误', {
  2194. confirmButtonText: '确定'
  2195. })
  2196. }
  2197. })
  2198. }
  2199. },
  2200. revokeModel(){
  2201. this.$confirm(`是否撤销审核,回退到‘待审核’状态?`, '提示', {
  2202. confirmButtonText: '确定',
  2203. cancelButtonText: '取消',
  2204. type: 'warning'
  2205. }).then(() => {
  2206. if (this.authCheck) {
  2207. this.$message.warning('无审核权限!')
  2208. return
  2209. }
  2210. this.submitData.site = this.detailData.site
  2211. this.submitData.buNo = this.detailData.buNo
  2212. this.submitData.orderNo = this.detailData.orderNo
  2213. this.submitData.planID = this.detailData.planID
  2214. this.submitData.objectID = this.detailData.objectID
  2215. this.submitData.planDesc = this.detailData.feedBackDesc
  2216. this.submitData.disposalMeasures = this.detailData.disposalMeasures
  2217. this.submitData.defectID = this.detailData.defectID
  2218. this.submitData.defectDesc = this.detailData.defectDesc
  2219. this.submitData.remark = this.detailData.remark
  2220. this.submitData.difficultyLevel = ''
  2221. this.submitData.difficultyRemark = ''
  2222. this.submitData.faultReason = this.detailData.faultReason
  2223. this.submitData.handlingMethod = this.detailData.handlingMethod
  2224. this.submitData.preventiveMeasure = this.detailData.preventiveMeasure
  2225. this.submitData.feedbackBy = this.detailData.createBy
  2226. this.submitData.actualOperatorName = this.detailData.actualOperatorName
  2227. this.submitData.knowledgeFlag = this.detailData.knowledgeFlag
  2228. this.submitData.updateBy = this.$store.state.user.name
  2229. this.submitData.status = '待审核'
  2230. submitDefect(this.submitData).then(({data}) => {
  2231. if (data && data.code === 0) {
  2232. this.getDataList()
  2233. this.detailData.status = '待审核'
  2234. this.$message({
  2235. message: '操作成功',
  2236. type: 'success',
  2237. duration: 1500,
  2238. onClose: () => {
  2239. }
  2240. })
  2241. } else {
  2242. this.$alert(data.msg, '错误', {
  2243. confirmButtonText: '确定'
  2244. })
  2245. }
  2246. })
  2247. })
  2248. },
  2249. // 详情
  2250. async reportModal(row) {
  2251. this.detailData = {
  2252. ...row,
  2253. shutdownWarranty: row.repairReportingType === '设备故障' ? '是' : '否',
  2254. }
  2255. await this.getSparPartImages();
  2256. await this.getFeedBackImages();
  2257. this.detailData.uploadMalfunctionPicturesFlag = this.feedBackImages.length > 0 ? 'Y' : 'N'
  2258. this.detailData.uploadSparepartsPicturesFlag = this.sparPartImages.length > 0 ? 'Y' : 'N'
  2259. // startDate为当前日期年月日,date类型
  2260. this.detailData.endDate = new Date()
  2261. // endDate为当前日期年月日加一个月,date类型
  2262. this.detailData.startDate = new Date(new Date().setMonth(new Date().getMonth() - 1))
  2263. this.activeTable = 'inspection_form'
  2264. this.detailModelFlag = true
  2265. },
  2266. updateResult() {
  2267. if (this.authCheck) {
  2268. this.$message.warning('无审核权限!')
  2269. return
  2270. }
  2271. if (this.detailData.reachDate === '' || this.detailData.reachDate == null) {
  2272. this.$message.warning('请选择到达时间!')
  2273. return
  2274. }
  2275. if (this.detailData.actualDate === '' || this.detailData.actualDate == null) {
  2276. this.$message.warning('请选择实际执行时间!')
  2277. return
  2278. }
  2279. if (this.detailData.reachDate > this.detailData.actualDate) {
  2280. this.$message.warning('到达时间不能大于实际执行时间!')
  2281. return
  2282. }
  2283. if (this.detailData.checkAssessment === '' || this.detailData.checkAssessment == null) {
  2284. this.$message.warning('请选择维修评估结论!')
  2285. return
  2286. }
  2287. if (this.detailData.checkNotes === '' || this.detailData.checkNotes == null) {
  2288. this.$message.warning('请填写维修评估的备注说明!')
  2289. return
  2290. }
  2291. updateReportResult(this.detailData).then(({data}) => {
  2292. if (data && data.code === 0) {
  2293. this.getDataList()
  2294. this.detailModelFlag = false
  2295. this.$message({
  2296. message: '操作成功',
  2297. type: 'success',
  2298. duration: 1500,
  2299. onClose: () => {
  2300. }
  2301. })
  2302. } else {
  2303. this.$alert(data.msg, '错误', {
  2304. confirmButtonText: '确定'
  2305. })
  2306. }
  2307. })
  2308. },
  2309. // 维修确认
  2310. confirmResult(row) {
  2311. this.confirmData = {
  2312. site: row.site,
  2313. buNo: row.buNo,
  2314. orderNo: row.orderNo,
  2315. planID: row.planID,
  2316. functionType: row.functionType,
  2317. confirmResult: 'Y',
  2318. confirmAssessment: '优秀',
  2319. confirmRemark: '',
  2320. confirmBy: this.$store.state.user.name
  2321. }
  2322. this.confirmDefectModal = true
  2323. },
  2324. // 确认结果
  2325. confirmDefectOrder() {
  2326. if (this.confirmData.confirmResult === '' || this.confirmData.confirmResult == null) {
  2327. this.$message.warning('请选择确认结果!')
  2328. return
  2329. }
  2330. if (this.confirmData.confirmAssessment === '' || this.confirmData.confirmAssessment == null) {
  2331. this.$message.warning('请选择维修评估!')
  2332. return
  2333. }
  2334. if (this.confirmData.confirmRemark === '' || this.confirmData.confirmRemark == null) {
  2335. this.$message.warning('请填写生产维修评估说明!')
  2336. return
  2337. }
  2338. confirmDefectOrder(this.confirmData).then(({data}) => {
  2339. if (data && data.code === 0) {
  2340. this.getDataList()
  2341. this.confirmDefectModal = false
  2342. this.$message({
  2343. message: '操作成功',
  2344. type: 'success',
  2345. duration: 1500,
  2346. onClose: () => {}
  2347. })
  2348. } else {
  2349. this.$alert(data.msg, '错误', {
  2350. confirmButtonText: '确定'
  2351. })
  2352. }
  2353. })
  2354. },
  2355. //取消工单按钮
  2356. cancelDefectOrder(){
  2357. this.$confirm('确定取消该工单吗?',{
  2358. confirmButtonText: '确定',
  2359. cancelButtonText: '取消',
  2360. type: 'warning'
  2361. }).then(()=>{
  2362. cancelDefectOrder(this.confirmData).then(({data})=>{
  2363. if (data && data.code === 0) {
  2364. this.$message.success(data.msg)
  2365. this.getDataList()
  2366. this.confirmDefectModal = false
  2367. } else {
  2368. this.$message.warning(data.msg)
  2369. }
  2370. }).catch((error)=>{
  2371. this.$message.error(error)
  2372. })
  2373. })
  2374. },
  2375. // 查看故障图片
  2376. checkFaultImageModal() {
  2377. this.descImages = []
  2378. let tempData = {
  2379. site: this.detailData.site,
  2380. buNo: this.detailData.buNo,
  2381. orderNo: this.detailData.orderNo,
  2382. folder: 'reportFault',
  2383. }
  2384. searchFileUrl(tempData).then(({data}) => {
  2385. if (data.code === 0) {
  2386. for (let i = 0; i < data.rows.length; i++) {
  2387. this.descImages.push(data.rows[i].url)
  2388. }
  2389. } else {
  2390. this.$message.warning(data.msg)
  2391. }
  2392. })
  2393. this.imageModalFlag = true
  2394. },
  2395. // 查看备件图片
  2396. checkSparPartImageModal() {
  2397. this.descImages = []
  2398. let tempData = {
  2399. site: this.detailData.site,
  2400. buNo: this.detailData.buNo,
  2401. orderNo: this.detailData.orderNo,
  2402. folder: 'reportSparPart',
  2403. }
  2404. searchFileUrl(tempData).then(({data}) => {
  2405. if (data.code === 0) {
  2406. for (let i = 0; i < data.rows.length; i++) {
  2407. this.descImages.push(data.rows[i].url)
  2408. }
  2409. } else {
  2410. this.$message.warning(data.msg)
  2411. }
  2412. })
  2413. this.imageModalFlag = true
  2414. },
  2415. // 获取部门列表
  2416. getDepartmentList() {
  2417. // 先清空缓存选中
  2418. this.$nextTick(() => this.$refs.departmentTable.clearSelection())
  2419. // 拿到选中的部门编号
  2420. let tempDataList = (this.searchData.departmentName == null ? '' : this.searchData.departmentName).split(';')
  2421. // 查询部门
  2422. getEmpyDeptList(this.departmentData).then(({data}) => {
  2423. if (data && data.code === 0) {
  2424. this.departmentList = data.rows
  2425. this.departmentList.forEach(val => {
  2426. // 回显选中的部门
  2427. if (tempDataList.includes(val.deptName)) {
  2428. this.$nextTick(() => this.$refs.departmentTable.toggleRowSelection(val, true))
  2429. }
  2430. })
  2431. this.departmentModelFlag = true
  2432. } else {
  2433. this.$alert(data.msg, '错误', {
  2434. confirmButtonText: '确定'
  2435. })
  2436. }
  2437. })
  2438. },
  2439. // 部门
  2440. departmentClickRow(row) {
  2441. this.$refs.departmentTable.toggleRowSelection(row)
  2442. },
  2443. // 多选
  2444. selectionDepartment(val) {
  2445. this.departmentListSelections = val
  2446. },
  2447. getRowKeys(row) {
  2448. // 唯一值,一般都为id
  2449. return row.deptId
  2450. },
  2451. // 确认多选部门
  2452. confirmDepartment() {
  2453. this.searchData.departmentName = ''
  2454. for (let i = 0; i < this.departmentListSelections.length; i++) {
  2455. this.searchData.departmentName = this.searchData.departmentName + ";" + this.departmentListSelections[i].deptName
  2456. }
  2457. this.searchData.departmentName = this.searchData.departmentName.substring(1)
  2458. this.departmentModelFlag = false
  2459. },
  2460. // 清空搜索框部门
  2461. clearDepartmentName() {
  2462. this.searchData.departmentName = ''
  2463. },
  2464. // 列表表格选择替换
  2465. tabClick(tab, event) {
  2466. // 刷新列表数据
  2467. this.refreshCurrentTabTable()
  2468. },
  2469. // 刷新页签的table数据
  2470. refreshCurrentTabTable() {
  2471. // 区分不同的页签刷新不同的列表数据
  2472. if (this.activeTable === 'inspection_form') {
  2473. //this.getInspectionFormData()
  2474. } else if (this.activeTable === 'history_record') {
  2475. this.queryHistoryRecord()
  2476. } else if (this.activeTable === 'feed_back_img') {
  2477. this.getFeedBackImages()
  2478. } else if (this.activeTable === 'part_spare_list') {
  2479. this.getPartSpareList()
  2480. } else if (this.activeTable === 'eam_knowledge') {
  2481. this.queryKnowledgeRecord()
  2482. } else if (this.activeTable === 'spar_part_img') {
  2483. this.getSparPartImages()
  2484. } else if (this.activeTable === 'core_component') {
  2485. this.getCorePartSpareList()
  2486. }
  2487. },
  2488. // 获取故障图片
  2489. async getFeedBackImages () {
  2490. let tempData = {
  2491. site: this.detailData.site,
  2492. buNo: this.detailData.buNo,
  2493. orderNo: this.detailData.orderNo
  2494. }
  2495. await getFeedBackImages(tempData).then(({data}) => {
  2496. if (data && data.code === 0) {
  2497. this.feedBackImages = data.rows
  2498. } else {
  2499. this.feedBackImages = []
  2500. }
  2501. })
  2502. },
  2503. // 获取备件图片
  2504. async getSparPartImages () {
  2505. let tempData = {
  2506. site: this.detailData.site,
  2507. buNo: this.detailData.buNo,
  2508. orderNo: this.detailData.orderNo,
  2509. folder: 'reportSparPart'
  2510. }
  2511. await getSparPartImages(tempData).then(({data}) => {
  2512. if (data && data.code === 0) {
  2513. this.sparPartImages = data.rows
  2514. } else {
  2515. this.sparPartImages = []
  2516. }
  2517. })
  2518. return
  2519. },
  2520. // 获取备品备件信息
  2521. getPartSpareList () {
  2522. let tempData = {
  2523. site: this.detailData.site,
  2524. objectID: this.detailData.objectID
  2525. }
  2526. getDevicePartList(tempData).then(({data}) => {
  2527. // 区分请求成功和失败的状况
  2528. if (data && data.code === 200) {
  2529. this.partSpareList = data.rows
  2530. } else {
  2531. this.partSpareList = []
  2532. }
  2533. })
  2534. },
  2535. // 维修记录
  2536. queryHistoryRecord () {
  2537. let tempData = {
  2538. site: this.detailData.site,
  2539. buNo: this.detailData.buNo,
  2540. objectID: this.detailData.objectID,
  2541. functionType: 'C',
  2542. limit: this.pageSize2,
  2543. page: this.pageIndex2,
  2544. startDate: this.detailData.startDate,
  2545. endDate: this.detailData.endDate,
  2546. }
  2547. queryHistoryRecord(tempData).then(({data}) => {
  2548. if (data && data.code === 0) {
  2549. this.historyRecordList = data.page.list
  2550. this.pageIndex2 = data.page.currPage
  2551. this.pageSize2 = data.page.pageSize
  2552. this.totalPage2 = data.page.totalCount
  2553. } else {
  2554. this.historyRecordList = []
  2555. }
  2556. })
  2557. },
  2558. // 预览
  2559. previewFile (row) {
  2560. // 预览文件
  2561. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  2562. let type = ''
  2563. if (image.includes(row.fileType.toLowerCase())) {
  2564. type = 'image/' + row.fileType
  2565. }
  2566. let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
  2567. if (video.includes(row.fileType.toLowerCase())) {
  2568. type = 'video/' + row.fileType
  2569. }
  2570. let txt = ['txt']
  2571. if (txt.includes(row.fileType.toLowerCase())) {
  2572. type = 'text/plain;charset=utf-8'
  2573. }
  2574. let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  2575. if (office.includes(row.fileType.toLowerCase())) {
  2576. if (row.fileType.toLowerCase() === 'doc' || row.fileType.toLowerCase() === 'docx') {
  2577. type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
  2578. } else if (row.fileType.toLowerCase() === 'ppt' || row.fileType.toLowerCase() === 'pptx') {
  2579. type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
  2580. } else {
  2581. type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  2582. }
  2583. }
  2584. let pdf = ['pdf']
  2585. if (pdf.includes(row.fileType.toLowerCase())) {
  2586. type = 'application/pdf'
  2587. }
  2588. downLoadObjectFile(row).then(({data}) => {
  2589. const blob = new Blob([data], { type: type });
  2590. // 创建URL来生成预览
  2591. const fileURL = URL.createObjectURL(blob);
  2592. // 在新标签页中打开文件预览
  2593. const newTab = window.open(fileURL, '_blank')
  2594. })
  2595. },
  2596. // 下载
  2597. downloadFile (row) {
  2598. downLoadObjectFile(row)
  2599. .then(({data}) => {
  2600. // 不限制文件下载类型
  2601. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  2602. // 下载文件名称
  2603. const fileName = row.fileName
  2604. // a标签下载
  2605. const linkNode = document.createElement('a')
  2606. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  2607. linkNode.style.display = 'none'
  2608. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  2609. document.body.appendChild(linkNode)
  2610. linkNode.click() // 模拟在按钮上的一次鼠标单击
  2611. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  2612. document.body.removeChild(linkNode)
  2613. })
  2614. },
  2615. // 动态列开始 获取 用户保存的 格式列
  2616. async getTableUserColumn(tableId, columnId) {
  2617. let queryTableUser = {
  2618. userId: this.$store.state.user.name,
  2619. functionId: this.$route.meta.menuId,
  2620. tableId: tableId,
  2621. status: true,
  2622. languageCode: this.$i18n.locale
  2623. }
  2624. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2625. if (data.rows.length > 0) {
  2626. switch (columnId) {
  2627. case 1:
  2628. this.columnList = data.rows
  2629. break;
  2630. }
  2631. } else {
  2632. this.getColumnList(tableId, columnId)
  2633. }
  2634. })
  2635. },
  2636. // 获取 tableDefault 列
  2637. async getColumnList(tableId, columnId) {
  2638. let queryTable = {
  2639. functionId: this.$route.meta.menuId,
  2640. tableId: tableId,
  2641. languageCode: this.$i18n.locale
  2642. }
  2643. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2644. if (!data.rows.length == 0) {
  2645. switch (columnId) {
  2646. case 1:
  2647. this.columnList = data.rows
  2648. break;
  2649. }
  2650. }
  2651. })
  2652. },
  2653. //获取按钮的权限数据
  2654. getButtonAuthData() {
  2655. let searchFlag = this.isAuth(this.menuId + ":search")
  2656. let changeFlag = this.isAuth(this.menuId + ":change")
  2657. let detailFlag = this.isAuth(this.menuId + ":detail")
  2658. let cancelFlag = this.isAuth(this.menuId + ":cancel")
  2659. let checkFlag = this.isAuth(this.menuId + ":check")
  2660. //处理页面的权限数据
  2661. this.authSearch = !searchFlag
  2662. this.authChange = !changeFlag
  2663. this.authDetail = !detailFlag
  2664. this.authCancel = !cancelFlag
  2665. this.authCheck = !checkFlag
  2666. },
  2667. coreComponentModal() {
  2668. this.coreComponentData = {
  2669. site: this.detailData.site,
  2670. buNo: this.detailData.buNo,
  2671. orderNo: this.detailData.orderNo,
  2672. objectID: this.detailData.objectID,
  2673. partNo: this.detailData.corePartNo,
  2674. partDescription: this.detailData.corePartDescription,
  2675. createdBy: this.$store.state.user.name,
  2676. oldSerialNo: this.detailData.oldSerialNo,
  2677. newSerialNo: this.detailData.newSerialNo,
  2678. }
  2679. this.coreComponentFlag = true
  2680. },
  2681. getCorePartSpareList () {
  2682. let tempData = {
  2683. site: this.detailData.site,
  2684. buNo: this.detailData.buNo,
  2685. objectID: this.detailData.objectID,
  2686. orderNo: this.detailData.orderNo,
  2687. }
  2688. getDeviceCorePartList(tempData).then(({data}) => {
  2689. if (data && data.code === 0) {
  2690. this.corePartSpareList = data.rows
  2691. } else {
  2692. this.corePartSpareList = []
  2693. }
  2694. })
  2695. },
  2696. }
  2697. }
  2698. </script>
  2699. <style scoped>
  2700. .numInput /deep/ .el-input__inner {
  2701. text-align: right;
  2702. }
  2703. /deep/ .customer-tab .el-tabs__content {
  2704. padding: 5px !important;
  2705. }
  2706. /deep/ .ifcheckboxColor .el-checkbox__label{
  2707. color: #EB6709 !important;
  2708. }
  2709. /deep/ .el-table .cell {
  2710. line-height: 14px;
  2711. font-size: 12px;
  2712. height: auto;
  2713. }
  2714. </style>