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.

518 lines
15 KiB

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. <el-form-item :label="'反馈单编码'">
  5. <el-input v-model="searchData.feedBackID" style="width: 120px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'设备编码'">
  8. <el-input v-model="searchData.objectID" style="width: 120px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'计划执行人员编码'">
  11. <el-input v-model="searchData.planOperator" style="width: 120px"></el-input>
  12. </el-form-item>
  13. <el-form-item :label="'状态'">
  14. <el-select filterable v-model="searchData.status" style="width: 130px">
  15. <el-option label="全部" value=""></el-option>
  16. <el-option label="未开工" value="未开工"></el-option>
  17. <el-option label="已完工" value="已完工"></el-option>
  18. <el-option label="已取消" value="已取消"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'反馈日期:'">
  22. <el-date-picker
  23. style="width: 120px"
  24. v-model="searchData.startDate"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item style="margin-top: 23px;">
  31. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-date-picker
  35. style="width: 120px"
  36. v-model="searchData.endDate"
  37. type="date"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item :label="' '">
  43. <el-button @click="getDataList()">查询</el-button>
  44. <!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
  45. </el-form-item>
  46. </el-form>
  47. <el-table
  48. :height="height"
  49. :data="dataList"
  50. border
  51. v-loading="dataListLoading"
  52. @selection-change="selectionChangeHandle"
  53. style="width: 100%;">
  54. <el-table-column
  55. type="selection"
  56. header-align="center"
  57. align="center"
  58. :selectable="selectFlag"
  59. width="50">
  60. </el-table-column>
  61. <el-table-column
  62. v-for="(item,index) in columnList" :key="index"
  63. :sortable="item.columnSortable"
  64. :prop="item.columnProp"
  65. :header-align="item.headerAlign"
  66. :show-overflow-tooltip="item.showOverflowTooltip"
  67. :align="item.align"
  68. :fixed="item.fixed==''?false:item.fixed"
  69. :min-width="item.columnWidth"
  70. :label="item.columnLabel">
  71. <template slot-scope="scope">
  72. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  73. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  74. style="width: 100px; height: 80px"/></span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. fixed="right"
  79. header-align="center"
  80. align="center"
  81. width="100"
  82. label="操作">
  83. <template slot-scope="scope">
  84. <a type="text" size="small" v-if="scope.row.status=='未开工'" @click="cancelOrder(scope.row)">取消工单</a>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <el-pagination
  89. @size-change="sizeChangeHandle"
  90. @current-change="currentChangeHandle"
  91. :current-page="pageIndex"
  92. :page-sizes="[20, 100, 500, 1000]"
  93. :page-size="pageSize"
  94. :total="totalPage"
  95. layout="total, sizes, prev, pager, next, jumper">
  96. </el-pagination>
  97. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  98. </div>
  99. </template>
  100. <script>
  101. import {
  102. eamFeedBackSearch,
  103. cancelOrder,
  104. } from "@/api/eam/eam.js"
  105. import Chooselist from '@/views/modules/common/Chooselist_eam'
  106. export default {
  107. components: {
  108. Chooselist
  109. },
  110. watch: {
  111. searchData: {
  112. deep: true,
  113. handler: function (newV, oldV) {
  114. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  115. }
  116. },
  117. modalData: {
  118. deep: true,
  119. handler: function (newV, oldV) {
  120. this.modalData.groupID = this.modalData.groupID.toUpperCase()
  121. }
  122. }
  123. },
  124. data () {
  125. return {
  126. tagNo:'',
  127. searchData: {
  128. site: this.$store.state.user.site,
  129. feedBackID: '',
  130. objectID: '',
  131. planOperator: '',
  132. functionType: 'C',
  133. status: '',
  134. startDate:'',
  135. endDate:'',
  136. page: 1,
  137. limit: 10,
  138. },
  139. height: 200,
  140. pageIndex: 1,
  141. pageSize: 100,
  142. totalPage: 0,
  143. dataList: [],
  144. dataListLoading: false,
  145. dataListSelections: [],
  146. modalFlag:false,
  147. modalDisableFlag:false,
  148. modalData:{
  149. flag:'',
  150. site: this.$store.state.user.site,
  151. groupID:'',
  152. groupDesc:'',
  153. active:'',
  154. },
  155. departmentList:[],
  156. // 展示列集
  157. columnList: [
  158. {
  159. userId: this.$store.state.user.name,
  160. functionId: 101020,
  161. serialNumber: '101020TableSite',
  162. tableId: "101020Table",
  163. tableName: "common",
  164. columnProp: 'site',
  165. headerAlign: "center",
  166. align: "left",
  167. columnLabel: '工厂编码',
  168. columnHidden: false,
  169. columnImage: false,
  170. columnSortable: false,
  171. sortLv: 0,
  172. status: true,
  173. fixed: '',
  174. columnWidth: 80,
  175. },
  176. {
  177. userId: this.$store.state.user.name,
  178. functionId: 101020,
  179. serialNumber: '101020TableFeedBackID',
  180. tableId: "101020Table",
  181. tableName: "common",
  182. columnProp: 'feedBackID',
  183. headerAlign: "center",
  184. align: "left",
  185. columnLabel: '反馈单号',
  186. columnHidden: false,
  187. columnImage: false,
  188. columnSortable: false,
  189. sortLv: 0,
  190. status: true,
  191. fixed: '',
  192. columnWidth: 120,
  193. },
  194. {
  195. userId: this.$store.state.user.name,
  196. functionId: 101020,
  197. serialNumber: '101020TableFeedBackDesc',
  198. tableId: "101020Table",
  199. tableName: "common",
  200. columnProp: 'feedBackDesc',
  201. headerAlign: "center",
  202. align: "left",
  203. columnLabel: '反馈描述',
  204. columnHidden: false,
  205. columnImage: false,
  206. columnSortable: false,
  207. sortLv: 0,
  208. status: true,
  209. fixed: '',
  210. columnWidth: 180,
  211. },
  212. {
  213. userId: this.$store.state.user.name,
  214. functionId: 101020,
  215. serialNumber: '101020TableDefectID',
  216. tableId: "101020Table",
  217. tableName: "common",
  218. columnProp: 'defectID',
  219. headerAlign: "center",
  220. align: "left",
  221. columnLabel: '故障代码',
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. sortLv: 0,
  226. status: true,
  227. fixed: '',
  228. columnWidth: 100,
  229. },
  230. {
  231. userId: this.$store.state.user.name,
  232. functionId: 101020,
  233. serialNumber: '101020TableDefectDesc',
  234. tableId: "101020Table",
  235. tableName: "common",
  236. columnProp: 'defectDesc',
  237. headerAlign: "center",
  238. align: "left",
  239. columnLabel: '故障原因',
  240. columnHidden: false,
  241. columnImage: false,
  242. columnSortable: false,
  243. sortLv: 0,
  244. status: true,
  245. fixed: '',
  246. columnWidth: 120,
  247. },
  248. {
  249. userId: this.$store.state.user.name,
  250. functionId: 101020,
  251. serialNumber: '101020TableObjectID',
  252. tableId: "101020Table",
  253. tableName: "common",
  254. columnProp: 'objectID',
  255. headerAlign: "center",
  256. align: "left",
  257. columnLabel: '设备编码',
  258. columnHidden: false,
  259. columnImage: false,
  260. columnSortable: false,
  261. sortLv: 0,
  262. status: true,
  263. fixed: '',
  264. columnWidth: 80,
  265. },
  266. {
  267. userId: this.$store.state.user.name,
  268. functionId: 101020,
  269. serialNumber: '101020TableObjectDesc',
  270. tableId: "101020Table",
  271. tableName: "common",
  272. columnProp: 'objectDesc',
  273. headerAlign: "center",
  274. align: "left",
  275. columnLabel: '设备名称',
  276. columnHidden: false,
  277. columnImage: false,
  278. columnSortable: false,
  279. sortLv: 0,
  280. status: true,
  281. fixed: '',
  282. columnWidth: 80,
  283. },
  284. {
  285. userId: this.$store.state.user.name,
  286. functionId: 101020,
  287. serialNumber: '101020TableStatus',
  288. tableId: "101020Table",
  289. tableName: "common",
  290. columnProp: 'status',
  291. headerAlign: "center",
  292. align: "left",
  293. columnLabel: '状态',
  294. columnHidden: false,
  295. columnImage: false,
  296. columnSortable: false,
  297. sortLv: 0,
  298. status: true,
  299. fixed: '',
  300. columnWidth: 80,
  301. },
  302. {
  303. userId: this.$store.state.user.name,
  304. functionId: 101020,
  305. serialNumber: '101020TablePlanOperatorName',
  306. tableId: "101020Table",
  307. tableName: "common",
  308. columnProp: 'planOperatorName',
  309. headerAlign: "center",
  310. align: "left",
  311. columnLabel: '计划机修人员',
  312. columnHidden: false,
  313. columnImage: false,
  314. columnSortable: false,
  315. sortLv: 0,
  316. status: true,
  317. fixed: '',
  318. columnWidth: 100,
  319. },
  320. {
  321. userId: this.$store.state.user.name,
  322. functionId: 101020,
  323. serialNumber: '101020TableActualOperatorName',
  324. tableId: "101020Table",
  325. tableName: "common",
  326. columnProp: 'actualOperatorName',
  327. headerAlign: "center",
  328. align: "left",
  329. columnLabel: '实际机修人员',
  330. columnHidden: false,
  331. columnImage: false,
  332. columnSortable: false,
  333. sortLv: 0,
  334. status: true,
  335. fixed: '',
  336. columnWidth: 100,
  337. },
  338. {
  339. userId: this.$store.state.user.name,
  340. functionId: 101020,
  341. serialNumber: '101020TableActualDefectDate',
  342. tableId: "101020Table",
  343. tableName: "common",
  344. columnProp: 'defectDate',
  345. headerAlign: "center",
  346. align: "left",
  347. columnLabel: '故障发现日期',
  348. columnHidden: false,
  349. columnImage: false,
  350. columnSortable: false,
  351. sortLv: 0,
  352. status: true,
  353. fixed: '',
  354. columnWidth: 130,
  355. },
  356. {
  357. userId: this.$store.state.user.name,
  358. functionId: 101020,
  359. serialNumber: '101020TableActualCreatedDate',
  360. tableId: "101020Table",
  361. tableName: "common",
  362. columnProp: 'createdDate',
  363. headerAlign: "center",
  364. align: "left",
  365. columnLabel: '反馈时间',
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 160,
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 101020,
  377. serialNumber: '101020TableActualCreatedBy',
  378. tableId: "101020Table",
  379. tableName: "common",
  380. columnProp: 'createdBy',
  381. headerAlign: "center",
  382. align: "left",
  383. columnLabel: '反馈账号',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 100,
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 101020,
  395. serialNumber: '101020TableActualRemark',
  396. tableId: "101020Table",
  397. tableName: "common",
  398. columnProp: 'remark',
  399. headerAlign: "center",
  400. align: "left",
  401. columnLabel: '备注',
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 150,
  409. },
  410. ],
  411. }
  412. },
  413. mounted () {
  414. this.$nextTick(() => {
  415. this.height = window.innerHeight - 210
  416. })
  417. },
  418. created () {
  419. this.getDataList()
  420. },
  421. methods: {
  422. // 获取基础数据列表S
  423. getBaseList (val,type) {
  424. this.tagNo = val
  425. this.$nextTick(() => {
  426. let strVal = ''
  427. if (val === 201) {
  428. strVal = this.planOperator
  429. this.$refs.baseList.init(val, strVal)
  430. }
  431. })
  432. },
  433. /* 列表方法的回调 */
  434. getBaseData (val) {
  435. if (this.tagNo === 201) {
  436. this.planOperator = val.AdminID
  437. this.planOperatorName = val.AdminName
  438. }
  439. },
  440. // 获取数据列表
  441. getDataList () {
  442. this.searchData.limit = this.pageSize
  443. this.searchData.page = this.pageIndex
  444. eamFeedBackSearch(this.searchData).then(({data}) => {
  445. if (data.code == 0) {
  446. this.dataList = data.page.list
  447. this.pageIndex = data.page.currPage
  448. this.pageSize = data.page.pageSize
  449. this.totalPage = data.page.totalCount
  450. }
  451. this.dataListLoading = false
  452. })
  453. },
  454. // 每页数
  455. sizeChangeHandle (val) {
  456. this.pageSize = val
  457. this.pageIndex = 1
  458. this.getDataList()
  459. },
  460. // 当前页
  461. currentChangeHandle (val) {
  462. this.pageIndex = val
  463. this.getDataList()
  464. },
  465. // 多选
  466. selectionChangeHandle (val) {
  467. this.dataListSelections = val
  468. },
  469. cancelOrder(row){
  470. this.$confirm(`是否取消选定工单?`, '提示', {
  471. confirmButtonText: '确定',
  472. cancelButtonText: '取消',
  473. type: 'warning'
  474. }).then(() => {
  475. cancelOrder(row).then(({data}) => {
  476. if (data && data.code === 0) {
  477. this.getDataList()
  478. this.$message({
  479. message: '操作成功',
  480. type: 'success',
  481. duration: 1500,
  482. onClose: () => {
  483. }
  484. })
  485. } else {
  486. this.$alert(data.msg, '错误', {
  487. confirmButtonText: '确定'
  488. })
  489. }
  490. })
  491. }).catch(() => {
  492. })
  493. },
  494. selectFlag(row,index){
  495. if(row.status!='未开工'){
  496. return false;
  497. }else {
  498. return true;
  499. }
  500. },
  501. }
  502. }
  503. </script>