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.

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