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.

1789 lines
61 KiB

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