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.

1754 lines
60 KiB

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