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.

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