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.

3003 lines
105 KiB

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