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.

1750 lines
61 KiB

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