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.

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