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.

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