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.

1275 lines
37 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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-button @click="searchList()" type="primary">{{ buttons.search }}</el-button>
  9. <el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }}
  10. </el-button>
  11. <el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
  12. <el-button @click="updateExpDate()" v-if="" type="primary">{{ buttons.updateExp }}</el-button>
  13. <el-form style="margin-top: 5px" v-show="searchShow" :inline="true" :model="queryData"
  14. @keyup.enter.native="getDataList()">
  15. <el-form-item label="失效日期">
  16. <el-date-picker
  17. style="width: 100px"
  18. v-model="queryData.startDate"
  19. type="date"
  20. placeholder="选择日期">
  21. </el-date-picker>
  22. -
  23. <el-date-picker
  24. style="width: 100px"
  25. v-model="queryData.endDate"
  26. type="date"
  27. format="yyyy-MM-dd"
  28. value-format="yyyy-MM-dd"
  29. placeholder="选择日期">
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item label="卷号">
  33. <el-input v-model="queryData.rollno" clearable>
  34. </el-input>
  35. </el-form-item>
  36. <el-form-item label="物料编码">
  37. <el-input v-model="queryData.partno" clearable>
  38. </el-input>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button @click="getDataList()" type="primary">{{ buttons.search1 }}</el-button>
  42. </el-form-item>
  43. </el-form>
  44. <el-table
  45. ref="rawRollInfo"
  46. :height="height"
  47. :data="dataList"
  48. border
  49. v-loading="dataListLoading"
  50. style="width: 100%;">
  51. <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
  52. <el-table-column
  53. v-for="(item,index) in columnList" :key="index"
  54. :sortable="item.columnSortable"
  55. :prop="item.columnProp"
  56. :header-align="item.headerAlign"
  57. :show-overflow-tooltip="item.showOverflowTooltip"
  58. :align="item.align"
  59. :fixed="item.fixed"
  60. :min-width="item.columnWidth"
  61. :label="item.columnLabel">
  62. <template slot-scope="scope">
  63. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  64. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  65. style="width: 100px; height: 80px"/></span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. fixed="right"
  70. header-align="center"
  71. align="center"
  72. width="150"
  73. label="操作">
  74. <template slot-scope="scope">
  75. <a type="text" size="small" @click="update(scope.row)">修改有效期</a>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <!-- 设置列 -->
  80. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  81. <!-- 弹窗, 新增 / 修改 -->
  82. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  83. <el-dialog
  84. :title="'修改有效期'"
  85. :close-on-click-modal="false"
  86. width="350px"
  87. :visible.sync="updateExp">
  88. <el-form ref="dataForm"
  89. label-width="80px">
  90. <el-form-item label="失效日期" prop="expireddate">
  91. <el-date-picker value-format="yyyy-MM-dd" v-model="expireddate" placeholder="失效日期"></el-date-picker>
  92. </el-form-item>
  93. </el-form>
  94. <span slot="footer" class="dialog-footer">
  95. <el-button type="primary" @click="updateExpSubmit()">确定</el-button>
  96. <el-button @click="updateExp = false">取消</el-button>
  97. </span>
  98. </el-dialog>
  99. </div>
  100. </template>
  101. <script>
  102. import AddOrUpdate from './crollinfo-add-or-update'
  103. import {getCRollInfoList, batchUpdateExpireddate} from '@/api/crollinfo/crollinfo.js'
  104. import column from "../common/column";
  105. import search from "../common/search";
  106. import {
  107. searchSysLanguageParam,
  108. searchFunctionButtonList,
  109. saveButtonList,
  110. } from "@/api/sysLanguage.js"
  111. import {
  112. saveTableDefaultList,
  113. getTableDefaultListLanguage,
  114. getTableUserListLanguage,
  115. removerDefault,
  116. removerUser
  117. } from "@/api/table.js"
  118. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  119. export default {
  120. data() {
  121. return {
  122. searchVisible: false,
  123. visible: false,
  124. updateExp: false,
  125. searchShow: false,
  126. expireddate: '',
  127. addOrUpdateVisible: false,
  128. CRollInfo: {},
  129. // table高度
  130. height: 450,
  131. // 是否收藏
  132. favorite: false,
  133. addLanguage: false,
  134. functionId: this.$route.meta.menuId,
  135. tableId: "105001002ETM",
  136. languageCode: this.$i18n.locale,
  137. showDefault: false,
  138. queryData: {
  139. day: '',
  140. rollno: '',
  141. partno: '',
  142. startDate: '',
  143. endDate: ''
  144. },
  145. queryTable: {
  146. functionId: this.$route.meta.menuId,
  147. tableId: "105001002ETM",
  148. languageCode: this.$i18n.locale
  149. },
  150. // 语言词典集合
  151. sysLanguageParams: [],
  152. columnList: [
  153. {
  154. "userId": this.$store.state.user.name,
  155. "tableId": "105001002ETM",
  156. "tableName": "呆滞料预警",
  157. "columnProp": "rollno",
  158. "columnLabel": "卷号",
  159. "columnHidden": false,
  160. "columnImage": false,
  161. "columnSortable": false,
  162. "columnWidth": 100,
  163. "format": null,
  164. "sortLv": 0,
  165. "status": true,
  166. "fixed": true,
  167. "serialNumber": null,
  168. "columnType": "string",
  169. "align": null
  170. },
  171. {
  172. "userId": this.$store.state.user.name,
  173. "tableId": "105001002ETM",
  174. "tableName": "呆滞料预警",
  175. "columnProp": "partno",
  176. "columnLabel": "物料编号",
  177. "columnHidden": false,
  178. "columnImage": false,
  179. "columnSortable": false,
  180. "columnWidth": 100,
  181. "format": null,
  182. "sortLv": 1,
  183. "status": true,
  184. "fixed": false,
  185. "serialNumber": null,
  186. "columnType": "string",
  187. "align": null
  188. },
  189. {
  190. "userId": this.$store.state.user.name,
  191. "tableId": "105001002ETM",
  192. "tableName": "呆滞料预警",
  193. "columnProp": "partDescription",
  194. "columnLabel": "物料描述",
  195. "columnHidden": false,
  196. "columnImage": false,
  197. "columnSortable": false,
  198. "columnWidth": 250,
  199. "format": null,
  200. "sortLv": 2,
  201. "status": true,
  202. "fixed": false,
  203. "serialNumber": null,
  204. "columnType": "string",
  205. "align": null
  206. },
  207. {
  208. "userId": this.$store.state.user.name,
  209. "tableId": "105001002ETM",
  210. "tableName": "呆滞料预警",
  211. "columnProp": "site",
  212. "columnLabel": "工厂编号",
  213. "columnHidden": false,
  214. "columnImage": false,
  215. "columnSortable": false,
  216. "columnWidth": 80,
  217. "format": null,
  218. "sortLv": 3,
  219. "status": true,
  220. "fixed": false,
  221. "serialNumber": null,
  222. "columnType": "string",
  223. "align": null
  224. },
  225. {
  226. "userId": this.$store.state.user.name,
  227. "tableId": "105001002ETM",
  228. "tableName": "呆滞料预警",
  229. "columnProp": "toexpiredays",
  230. "columnLabel": "呆滞天数",
  231. "columnHidden": false,
  232. "columnImage": false,
  233. "columnSortable": false,
  234. "columnWidth": 80,
  235. "format": null,
  236. "sortLv": 4,
  237. "status": true,
  238. "fixed": false,
  239. "serialNumber": null,
  240. "columnType": "number",
  241. "align": null
  242. },
  243. {
  244. "userId": this.$store.state.user.name,
  245. "tableId": "105001002ETM",
  246. "tableName": "呆滞料预警",
  247. "columnProp": "status",
  248. "columnLabel": "状态",
  249. "columnHidden": false,
  250. "columnImage": false,
  251. "columnSortable": false,
  252. "columnWidth": 80,
  253. "format": null,
  254. "sortLv": 5,
  255. "status": true,
  256. "fixed": false,
  257. "serialNumber": null,
  258. "columnType": "number",
  259. "align": null
  260. },
  261. {
  262. "userId": this.$store.state.user.name,
  263. "tableId": "105001002ETM",
  264. "tableName": "呆滞料预警",
  265. "columnProp": "sourcetype",
  266. "columnLabel": "来源类型",
  267. "columnHidden": false,
  268. "columnImage": false,
  269. "columnSortable": false,
  270. "columnWidth": 80,
  271. "format": null,
  272. "sortLv": 6,
  273. "status": true,
  274. "fixed": false,
  275. "serialNumber": null,
  276. "columnType": "string",
  277. "align": null
  278. },
  279. {
  280. "userId": this.$store.state.user.name,
  281. "tableId": "105001002ETM",
  282. "tableName": "呆滞料预警",
  283. "columnProp": "rolltype",
  284. "columnLabel": "卷类型",
  285. "columnHidden": false,
  286. "columnImage": false,
  287. "columnSortable": false,
  288. "columnWidth": 80,
  289. "format": null,
  290. "sortLv": 7,
  291. "status": true,
  292. "fixed": false,
  293. "serialNumber": null,
  294. "columnType": "string",
  295. "align": null
  296. },
  297. {
  298. "userId": this.$store.state.user.name,
  299. "tableId": "105001002ETM",
  300. "tableName": "呆滞料预警",
  301. "columnProp": "rollqty",
  302. "columnLabel": "卷数量",
  303. "columnHidden": false,
  304. "columnImage": false,
  305. "columnSortable": false,
  306. "columnWidth": 80,
  307. "format": null,
  308. "sortLv": 8,
  309. "status": true,
  310. "fixed": false,
  311. "serialNumber": null,
  312. "columnType": "number",
  313. "align": null
  314. },
  315. {
  316. "userId": this.$store.state.user.name,
  317. "tableId": "105001002ETM",
  318. "tableName": "呆滞料预警",
  319. "columnProp": "createdby",
  320. "columnLabel": "创建人",
  321. "columnHidden": false,
  322. "columnImage": false,
  323. "columnSortable": false,
  324. "columnWidth": 80,
  325. "format": null,
  326. "sortLv": 96,
  327. "status": true,
  328. "fixed": false,
  329. "serialNumber": null,
  330. "columnType": "string",
  331. "align": null
  332. },
  333. {
  334. "userId": this.$store.state.user.name,
  335. "tableId": "105001002ETM",
  336. "tableName": "呆滞料预警",
  337. "columnProp": "rolldate",
  338. "columnLabel": "卷创建时间",
  339. "columnHidden": false,
  340. "columnImage": false,
  341. "columnSortable": false,
  342. "columnWidth": 120,
  343. "format": null,
  344. "sortLv": 97,
  345. "status": true,
  346. "fixed": false,
  347. "serialNumber": null,
  348. "columnType": "date",
  349. "align": null
  350. },
  351. {
  352. "userId": this.$store.state.user.name,
  353. "tableId": "105001002ETM",
  354. "tableName": "呆滞料预警",
  355. "columnProp": "expireddate",
  356. "columnLabel": "失效日期",
  357. "columnHidden": false,
  358. "columnImage": false,
  359. "columnSortable": false,
  360. "columnWidth": 120,
  361. "format": null,
  362. "sortLv": 98,
  363. "status": true,
  364. "fixed": false,
  365. "serialNumber": null,
  366. "columnType": "date",
  367. "align": null
  368. },
  369. {
  370. "userId": this.$store.state.user.name,
  371. "tableId": "105001002ETM",
  372. "tableName": "呆滞料预警",
  373. "columnProp": "manufacturedate",
  374. "columnLabel": "制造日期",
  375. "columnHidden": false,
  376. "columnImage": false,
  377. "columnSortable": false,
  378. "columnWidth": 120,
  379. "format": null,
  380. "sortLv": 99,
  381. "status": true,
  382. "fixed": false,
  383. "serialNumber": null,
  384. "columnType": "string",
  385. "align": null
  386. },
  387. {
  388. "userId": this.$store.state.user.name,
  389. "tableId": "105001002ETM",
  390. "tableName": "呆滞料预警",
  391. "columnProp": "createddate",
  392. "columnLabel": "创建时间",
  393. "columnHidden": false,
  394. "columnImage": false,
  395. "columnSortable": false,
  396. "columnWidth": 150,
  397. "format": null,
  398. "sortLv": 100,
  399. "status": true,
  400. "fixed": false,
  401. "serialNumber": null,
  402. "columnType": "date",
  403. "align": null
  404. },
  405. {
  406. "userId": this.$store.state.user.name,
  407. "tableId": "105001002ETM",
  408. "tableName": "呆滞料预警",
  409. "columnProp": "statusDb",
  410. "columnLabel": "statusDb",
  411. "columnHidden": false,
  412. "columnImage": false,
  413. "columnSortable": false,
  414. "columnWidth": 50,
  415. "format": null,
  416. "sortLv": 0,
  417. "status": false,
  418. "fixed": false,
  419. "serialNumber": null,
  420. "columnType": "string",
  421. "align": null
  422. },
  423. {
  424. "userId": this.$store.state.user.name,
  425. "tableId": "105001002ETM",
  426. "tableName": "呆滞料预警",
  427. "columnProp": "supprollno",
  428. "columnLabel": "供应商编号",
  429. "columnHidden": false,
  430. "columnImage": false,
  431. "columnSortable": false,
  432. "columnWidth": 50,
  433. "format": null,
  434. "sortLv": 0,
  435. "status": false,
  436. "fixed": false,
  437. "serialNumber": null,
  438. "columnType": "string",
  439. "align": null
  440. },
  441. {
  442. "userId": this.$store.state.user.name,
  443. "tableId": "105001002ETM",
  444. "tableName": "呆滞料预警",
  445. "columnProp": "rollseqno",
  446. "columnLabel": "rollseqno",
  447. "columnHidden": false,
  448. "columnImage": false,
  449. "columnSortable": false,
  450. "columnWidth": 50,
  451. "format": null,
  452. "sortLv": 0,
  453. "status": false,
  454. "fixed": false,
  455. "serialNumber": null,
  456. "columnType": "string",
  457. "align": null
  458. },
  459. {
  460. "userId": this.$store.state.user.name,
  461. "tableId": "105001002ETM",
  462. "tableName": "呆滞料预警",
  463. "columnProp": "supprollnoflag",
  464. "columnLabel": "供应商状态",
  465. "columnHidden": false,
  466. "columnImage": false,
  467. "columnSortable": false,
  468. "columnWidth": 50,
  469. "format": null,
  470. "sortLv": 0,
  471. "status": false,
  472. "fixed": false,
  473. "serialNumber": null,
  474. "columnType": "string",
  475. "align": null
  476. },
  477. {
  478. "userId": this.$store.state.user.name,
  479. "tableId": "105001002ETM",
  480. "tableName": "呆滞料预警",
  481. "columnProp": "supplierid",
  482. "columnLabel": "供应商编号",
  483. "columnHidden": false,
  484. "columnImage": false,
  485. "columnSortable": false,
  486. "columnWidth": 50,
  487. "format": null,
  488. "sortLv": 0,
  489. "status": false,
  490. "fixed": false,
  491. "serialNumber": null,
  492. "columnType": "string",
  493. "align": null
  494. },
  495. {
  496. "userId": this.$store.state.user.name,
  497. "tableId": "105001002ETM",
  498. "tableName": "呆滞料预警",
  499. "columnProp": "orderref1",
  500. "columnLabel": "关联单号1",
  501. "columnHidden": false,
  502. "columnImage": false,
  503. "columnSortable": false,
  504. "columnWidth": 50,
  505. "format": null,
  506. "sortLv": 0,
  507. "status": false,
  508. "fixed": false,
  509. "serialNumber": null,
  510. "columnType": "string",
  511. "align": null
  512. },
  513. {
  514. "userId": this.$store.state.user.name,
  515. "tableId": "105001002ETM",
  516. "tableName": "呆滞料预警",
  517. "columnProp": "orderref3",
  518. "columnLabel": "关联单号3",
  519. "columnHidden": false,
  520. "columnImage": false,
  521. "columnSortable": false,
  522. "columnWidth": 50,
  523. "format": null,
  524. "sortLv": 0,
  525. "status": false,
  526. "fixed": false,
  527. "serialNumber": null,
  528. "columnType": "string",
  529. "align": null
  530. },
  531. {
  532. "userId": this.$store.state.user.name,
  533. "tableId": "105001002ETM",
  534. "tableName": "呆滞料预警",
  535. "columnProp": "orderref4",
  536. "columnLabel": "关联单号4",
  537. "columnHidden": false,
  538. "columnImage": false,
  539. "columnSortable": false,
  540. "columnWidth": 50,
  541. "format": null,
  542. "sortLv": 0,
  543. "status": false,
  544. "fixed": false,
  545. "serialNumber": null,
  546. "columnType": "string",
  547. "align": null
  548. },
  549. {
  550. "userId": this.$store.state.user.name,
  551. "tableId": "105001002ETM",
  552. "tableName": "呆滞料预警",
  553. "columnProp": "rolltypeDb",
  554. "columnLabel": "卷类型编号",
  555. "columnHidden": false,
  556. "columnImage": false,
  557. "columnSortable": false,
  558. "columnWidth": 50,
  559. "format": null,
  560. "sortLv": 0,
  561. "status": false,
  562. "fixed": false,
  563. "serialNumber": null,
  564. "columnType": "string",
  565. "align": null
  566. },
  567. {
  568. "userId": this.$store.state.user.name,
  569. "tableId": "105001002ETM",
  570. "tableName": "呆滞料预警",
  571. "columnProp": "firstlevelrollno",
  572. "columnLabel": "首卷号",
  573. "columnHidden": false,
  574. "columnImage": false,
  575. "columnSortable": false,
  576. "columnWidth": 50,
  577. "format": null,
  578. "sortLv": 0,
  579. "status": false,
  580. "fixed": false,
  581. "serialNumber": null,
  582. "columnType": "string",
  583. "align": null
  584. },
  585. {
  586. "userId": this.$store.state.user.name,
  587. "tableId": "105001002ETM",
  588. "tableName": "呆滞料预警",
  589. "columnProp": "remark",
  590. "columnLabel": "备注",
  591. "columnHidden": false,
  592. "columnImage": false,
  593. "columnSortable": false,
  594. "columnWidth": 50,
  595. "format": null,
  596. "sortLv": 0,
  597. "status": false,
  598. "fixed": false,
  599. "serialNumber": null,
  600. "columnType": "string",
  601. "align": null
  602. },
  603. {
  604. "userId": this.$store.state.user.name,
  605. "tableId": "105001002ETM",
  606. "tableName": "呆滞料预警",
  607. "columnProp": "parttypeFlag",
  608. "columnLabel": "parttypeFlag",
  609. "columnHidden": false,
  610. "columnImage": false,
  611. "columnSortable": false,
  612. "columnWidth": 50,
  613. "format": null,
  614. "sortLv": 0,
  615. "status": false,
  616. "fixed": false,
  617. "serialNumber": null,
  618. "columnType": "string",
  619. "align": null
  620. },
  621. {
  622. "userId": this.$store.state.user.name,
  623. "tableId": "105001002ETM",
  624. "tableName": "呆滞料预警",
  625. "columnProp": "warehouseid",
  626. "columnLabel": "warehouseid",
  627. "columnHidden": false,
  628. "columnImage": false,
  629. "columnSortable": false,
  630. "columnWidth": 50,
  631. "format": null,
  632. "sortLv": 0,
  633. "status": false,
  634. "fixed": false,
  635. "serialNumber": null,
  636. "columnType": "string",
  637. "align": null
  638. },
  639. {
  640. "userId": this.$store.state.user.name,
  641. "tableId": "105001002ETM",
  642. "tableName": "呆滞料预警",
  643. "columnProp": "synchronizedflag",
  644. "columnLabel": "同步状态",
  645. "columnHidden": false,
  646. "columnImage": false,
  647. "columnSortable": false,
  648. "columnWidth": 50,
  649. "format": null,
  650. "sortLv": 0,
  651. "status": false,
  652. "fixed": false,
  653. "serialNumber": null,
  654. "columnType": "string",
  655. "align": null
  656. },
  657. {
  658. "userId": this.$store.state.user.name,
  659. "tableId": "105001002ETM",
  660. "tableName": "呆滞料预警",
  661. "columnProp": "consumeorderno",
  662. "columnLabel": "销售订单号",
  663. "columnHidden": false,
  664. "columnImage": false,
  665. "columnSortable": false,
  666. "columnWidth": 50,
  667. "format": null,
  668. "sortLv": 0,
  669. "status": false,
  670. "fixed": false,
  671. "serialNumber": null,
  672. "columnType": "string",
  673. "align": null
  674. },
  675. {
  676. "userId": this.$store.state.user.name,
  677. "tableId": "105001002ETM",
  678. "tableName": "呆滞料预警",
  679. "columnProp": "consumeseqno",
  680. "columnLabel": "销售序号",
  681. "columnHidden": false,
  682. "columnImage": false,
  683. "columnSortable": false,
  684. "columnWidth": 50,
  685. "format": null,
  686. "sortLv": 0,
  687. "status": false,
  688. "fixed": false,
  689. "serialNumber": null,
  690. "columnType": "string",
  691. "align": null
  692. },
  693. {
  694. "userId": this.$store.state.user.name,
  695. "tableId": "105001002ETM",
  696. "tableName": "呆滞料预警",
  697. "columnProp": "customerid",
  698. "columnLabel": "客户ID",
  699. "columnHidden": false,
  700. "columnImage": false,
  701. "columnSortable": false,
  702. "columnWidth": 50,
  703. "format": null,
  704. "sortLv": 0,
  705. "status": false,
  706. "fixed": false,
  707. "serialNumber": null,
  708. "columnType": "string",
  709. "align": null
  710. },
  711. {
  712. "userId": this.$store.state.user.name,
  713. "tableId": "105001002ETM",
  714. "tableName": "呆滞料预警",
  715. "columnProp": "fgpartno",
  716. "columnLabel": "fgpartno",
  717. "columnHidden": false,
  718. "columnImage": false,
  719. "columnSortable": false,
  720. "columnWidth": 50,
  721. "format": null,
  722. "sortLv": 0,
  723. "status": false,
  724. "fixed": false,
  725. "serialNumber": null,
  726. "columnType": "string",
  727. "align": null
  728. },
  729. {
  730. "userId": this.$store.state.user.name,
  731. "tableId": "105001002ETM",
  732. "tableName": "呆滞料预警",
  733. "columnProp": "refSupplierid",
  734. "columnLabel": "refSupplierid",
  735. "columnHidden": false,
  736. "columnImage": false,
  737. "columnSortable": false,
  738. "columnWidth": 50,
  739. "format": null,
  740. "sortLv": 0,
  741. "status": false,
  742. "fixed": false,
  743. "serialNumber": null,
  744. "columnType": "string",
  745. "align": null
  746. },
  747. {
  748. "userId": this.$store.state.user.name,
  749. "tableId": "105001002ETM",
  750. "tableName": "呆滞料预警",
  751. "columnProp": "refPartdesc",
  752. "columnLabel": "refPartdesc",
  753. "columnHidden": false,
  754. "columnImage": false,
  755. "columnSortable": false,
  756. "columnWidth": 50,
  757. "format": null,
  758. "sortLv": 0,
  759. "status": false,
  760. "fixed": false,
  761. "serialNumber": null,
  762. "columnType": "string",
  763. "align": null
  764. },
  765. {
  766. "userId": this.$store.state.user.name,
  767. "tableId": "105001002ETM",
  768. "tableName": "呆滞料预警",
  769. "columnProp": "needsynchronizeflag",
  770. "columnLabel": "needsynchronizeflag",
  771. "columnHidden": false,
  772. "columnImage": false,
  773. "columnSortable": false,
  774. "columnWidth": 50,
  775. "format": null,
  776. "sortLv": 0,
  777. "status": false,
  778. "fixed": false,
  779. "serialNumber": null,
  780. "columnType": "string",
  781. "align": null
  782. },
  783. {
  784. "userId": this.$store.state.user.name,
  785. "tableId": "105001002ETM",
  786. "tableName": "呆滞料预警",
  787. "columnProp": "opslog",
  788. "columnLabel": "opslog",
  789. "columnHidden": false,
  790. "columnImage": false,
  791. "columnSortable": false,
  792. "columnWidth": 50,
  793. "format": null,
  794. "sortLv": 0,
  795. "status": false,
  796. "fixed": false,
  797. "serialNumber": null,
  798. "columnType": "string",
  799. "align": null
  800. },
  801. {
  802. "userId": this.$store.state.user.name,
  803. "tableId": "105001002ETM",
  804. "tableName": "呆滞料预警",
  805. "columnProp": "frozenflag",
  806. "columnLabel": "frozenflag",
  807. "columnHidden": false,
  808. "columnImage": false,
  809. "columnSortable": false,
  810. "columnWidth": 50,
  811. "format": null,
  812. "sortLv": 0,
  813. "status": false,
  814. "fixed": false,
  815. "serialNumber": null,
  816. "columnType": "string",
  817. "align": null
  818. },
  819. {
  820. "userId": this.$store.state.user.name,
  821. "tableId": "105001002ETM",
  822. "tableName": "呆滞料预警",
  823. "columnProp": "frozendate",
  824. "columnLabel": "frozendate",
  825. "columnHidden": false,
  826. "columnImage": false,
  827. "columnSortable": false,
  828. "columnWidth": 50,
  829. "format": null,
  830. "sortLv": 0,
  831. "status": false,
  832. "fixed": false,
  833. "serialNumber": null,
  834. "columnType": "date",
  835. "align": null
  836. },
  837. {
  838. "userId": this.$store.state.user.name,
  839. "tableId": "105001002ETM",
  840. "tableName": "呆滞料预警",
  841. "columnProp": "frozenby",
  842. "columnLabel": "frozenby",
  843. "columnHidden": false,
  844. "columnImage": false,
  845. "columnSortable": false,
  846. "columnWidth": 50,
  847. "format": null,
  848. "sortLv": 0,
  849. "status": false,
  850. "fixed": false,
  851. "serialNumber": null,
  852. "columnType": "string",
  853. "align": null
  854. },
  855. {
  856. "userId": this.$store.state.user.name,
  857. "tableId": "105001002ETM",
  858. "tableName": "呆滞料预警",
  859. "columnProp": "originalrollno",
  860. "columnLabel": "原卷号",
  861. "columnHidden": false,
  862. "columnImage": false,
  863. "columnSortable": false,
  864. "columnWidth": 50,
  865. "format": null,
  866. "sortLv": 0,
  867. "status": false,
  868. "fixed": false,
  869. "serialNumber": null,
  870. "columnType": "string",
  871. "align": null
  872. },
  873. {
  874. "userId": this.$store.state.user.name,
  875. "tableId": "105001002ETM",
  876. "tableName": "呆滞料预警",
  877. "columnProp": "orderref5",
  878. "columnLabel": "关联单号5",
  879. "columnHidden": false,
  880. "columnImage": false,
  881. "columnSortable": false,
  882. "columnWidth": 50,
  883. "format": null,
  884. "sortLv": 0,
  885. "status": false,
  886. "fixed": false,
  887. "serialNumber": null,
  888. "columnType": "string",
  889. "align": null
  890. }
  891. ],
  892. dataList: [],
  893. buttonList: [],
  894. buttons: {
  895. add: '添加',
  896. edit: '编辑',
  897. delete: '删除',
  898. deleteList: '批量删除',
  899. cz: '操作',
  900. search: '搜索',
  901. search1: '查询',
  902. download: '导出',
  903. settingTable: '设置列表',
  904. defaultTable: '设置默认配置',
  905. updateExp: '修改有效期'
  906. },
  907. dataListLoading: false,
  908. dataListSelections: [],
  909. pagination: {
  910. page: 1,
  911. pageSize: 200,
  912. total: 0,
  913. },
  914. totalPage: 5,
  915. countTotal: 200,
  916. }
  917. },
  918. components: {
  919. AddOrUpdate,
  920. column,
  921. search
  922. },
  923. mounted() {
  924. this.$nextTick(() => {
  925. this.height = window.innerHeight - 165;
  926. this.lazyLoading()
  927. })
  928. },
  929. activated() {
  930. // this.getDataList()
  931. },
  932. methods: {
  933. // 打开搜索页面
  934. searchList() {
  935. if (this.searchShow) {
  936. this.searchShow = false
  937. return
  938. } else {
  939. this.searchShow = true
  940. }
  941. },
  942. lazyLoading() {
  943. let dom = document.querySelector(".el-table__body-wrapper");
  944. dom.addEventListener("scroll", (v) => {
  945. const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  946. // console.log("鼠标滑动-scrollDistance", scrollDistance)
  947. // if (scrollDistance <= 0) { //分辨率问题,如果设置 100% ,滑倒最底部,scrollDistance的值 可能为 0.201 到 -0.201
  948. if (scrollDistance <= 1) {
  949. //等于0证明已经到底,可以请求接口
  950. if (this.pagination.page >= this.totalPage) {
  951. //判断是否到达底部
  952. // this.$message.warning("我~是有底线的 (~ ̄▽ ̄)~");
  953. //console.log("我~是有底线的 (~ ̄▽ ̄)~")
  954. }
  955. if (this.pagination.page < this.totalPage) {
  956. //当前页数小于总页数就请求
  957. this.pagination.page++; //当前页数自增
  958. //console.log("页面已经到达底部,可以请求接口,请求第 " + this.pagination.page + " 页数据");
  959. this.pagination.pageSize = this.countTotal;
  960. this.getDataListAdd()
  961. }
  962. }
  963. });
  964. },
  965. // 获取数据列表
  966. getDataList() {
  967. this.dataListLoading = true
  968. let query = {
  969. parttypeFlag: 'R',
  970. toexpiredays: this.queryData.day,
  971. rollno: this.queryData.rollno,
  972. partno: this.queryData.partno,
  973. startDate: this.queryData.startDate,
  974. endDate: this.queryData.endDate,
  975. limit: 200,
  976. page: 1
  977. }
  978. getCRollInfoList(query).then(({data}) => {
  979. if (data && data.code === 0) {
  980. this.dataList = data.page.list
  981. this.totalPage = data.page.totalPage
  982. // this.countTotal = data.page.totalCount
  983. this.pagination.page = data.page.currPage
  984. this.pagination.total = data.page.totalCount
  985. }
  986. this.dataListLoading = false
  987. })
  988. // this.searchShow = false
  989. },
  990. // 滚动获取数据
  991. getDataListAdd() {
  992. this.dataListLoading = true
  993. let query = {
  994. parttypeFlag: 'R',
  995. toexpiredays: this.queryData.day,
  996. rollno: this.queryData.rollno,
  997. partno: this.queryData.partno,
  998. limit: this.pagination.pageSize,
  999. startDate: this.queryData.startDate,
  1000. endDate: this.queryData.endDate,
  1001. page: this.pagination.page
  1002. }
  1003. getCRollInfoList(query).then(({data}) => {
  1004. if (data && data.code === 0) {
  1005. let voList = data.page.list
  1006. this.dataList.push(...voList)
  1007. }
  1008. this.dataListLoading = false
  1009. })
  1010. // this.searchShow = false
  1011. },
  1012. // 修改有效期
  1013. updateExpDate() {
  1014. this.updateExp = true
  1015. },
  1016. // 表单提交
  1017. updateExpSubmit() {
  1018. let rollInfoList = this.$refs.rawRollInfo.selection.map(item => {
  1019. let rollInfo = {
  1020. site: item.site,
  1021. rollno: item.rollno,
  1022. expireddate: this.expireddate
  1023. }
  1024. return rollInfo;
  1025. })
  1026. batchUpdateExpireddate(rollInfoList).then(({data}) => {
  1027. if (data && data.code === 0) {
  1028. this.$message({
  1029. message: '操作成功',
  1030. type: 'success',
  1031. duration: 1500,
  1032. onClose: () => {
  1033. this.updateExp = false
  1034. this.expireddate = ''
  1035. this.getDataList()
  1036. }
  1037. })
  1038. } else {
  1039. this.$message.error(data.msg)
  1040. }
  1041. })
  1042. },
  1043. // 修改信息
  1044. update(val) {
  1045. this.CRollInfo = val
  1046. if (this.CRollInfo.expiredatecontrolflag != 'Y') return this.$message.info('该物料未设置有效期');
  1047. this.addOrUpdateVisible = true
  1048. this.$nextTick(() => {
  1049. this.$refs.addOrUpdate.init(this.CRollInfo.rollno, this.CRollInfo.site)
  1050. })
  1051. },
  1052. // 校验用户是否收藏
  1053. favoriteIsOk() {
  1054. let userFavorite = {
  1055. userId: this.$store.state.user.id,
  1056. languageCode: this.$i18n.locale
  1057. }
  1058. userFavoriteList(userFavorite).then(({data}) => {
  1059. let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length;
  1060. if (size > 0) {
  1061. this.favorite = true
  1062. } else {
  1063. this.favorite = false
  1064. }
  1065. })
  1066. },
  1067. // 收藏 OR 取消收藏
  1068. favoriteFunction() {
  1069. let userFavorite = {
  1070. userId: this.$store.state.user.id,
  1071. functionId: this.$route.meta.menuId,
  1072. }
  1073. if (this.favorite) {
  1074. // 取消收藏
  1075. this.$confirm(`确定取消收藏`, '提示', {
  1076. confirmButtonText: '确定',
  1077. cancelButtonText: '取消',
  1078. type: 'warning'
  1079. }).then(() => {
  1080. removeUserFavorite(userFavorite).then(({data}) => {
  1081. this.$message.success(data.msg)
  1082. this.favorite = false
  1083. })
  1084. })
  1085. } else {
  1086. // 收藏
  1087. saveUserFavorite(userFavorite).then(({data}) => {
  1088. this.$message.success(data.msg)
  1089. this.favorite = true
  1090. })
  1091. }
  1092. },
  1093. // 获取button的词典
  1094. getFunctionButtonList() {
  1095. let queryButton = {
  1096. functionId: this.functionId,
  1097. tableId: this.tableId,
  1098. languageCode: this.languageCode,
  1099. objectType: 'button'
  1100. }
  1101. searchFunctionButtonList(queryButton).then(({data}) => {
  1102. if (data.data.length > 0) {
  1103. this.buttons = data.data
  1104. }
  1105. })
  1106. },
  1107. // 获取语言词典
  1108. getSysLanguageParamList() {
  1109. let querySysLanguageParam = {
  1110. languageCode: this.$i18n.locale
  1111. }
  1112. searchSysLanguageParam(querySysLanguageParam).then(({data}) => {
  1113. this.sysLanguageParams = data.rows
  1114. })
  1115. },
  1116. // 打开页面设置
  1117. userSetting() {
  1118. this.visible = true;
  1119. let queryTable = {
  1120. userId: this.userId,
  1121. functionId: this.functionId,
  1122. tableId: this.tableId,
  1123. languageCode: this.languageCode
  1124. }
  1125. this.$nextTick(() => {
  1126. this.$refs.column.init(queryTable);
  1127. });
  1128. },
  1129. // 获取 用户保存的 格式列
  1130. getTableUserColumn() {
  1131. let queryTableUser = {
  1132. userId: this.userId,
  1133. functionId: this.functionId,
  1134. tableId: this.tableId,
  1135. languageCode: this.languageCode,
  1136. status: true,
  1137. }
  1138. getTableUserListLanguage(queryTableUser).then(({data}) => {
  1139. if (data.rows.length > 0) {
  1140. //this.columnList = []
  1141. this.columnList = data.rows
  1142. } else {
  1143. this.getColumnList()
  1144. }
  1145. })
  1146. },
  1147. // 保存 默认配置 列
  1148. async saveColumnList() {
  1149. // 删除所有的该页面下保存的数据
  1150. if (this.userColumnList) {
  1151. //删除 user自定义的数据
  1152. await removerUser(this.queryTable)
  1153. }
  1154. // 删除默认配置
  1155. await removerDefault(this.queryTable)
  1156. // 保存页面 table属性
  1157. let sumColumnList = this.columnList;
  1158. sumColumnList = sumColumnList.map(item => {
  1159. return item = {
  1160. tableId: item.tableId,
  1161. tableName: item.tableName,
  1162. columnProp: item.columnProp,
  1163. columnLabel: item.columnLabel,
  1164. columnHidden: false,
  1165. columnImage: false,
  1166. columnSortable: false,
  1167. columnWidth: null,
  1168. format: null,
  1169. functionId: this.$route.meta.menuId,
  1170. sortLv: 0,
  1171. status: true,
  1172. fixed: false,
  1173. serialNumber: null,
  1174. columnType: null,
  1175. align: null
  1176. }
  1177. })
  1178. await saveTableDefaultList(sumColumnList)
  1179. // 保存页面 button label title 属性
  1180. let buttons = this.buttonList.map(item => {
  1181. return item = {
  1182. functionId: this.$route.meta.menuId,
  1183. languageValue: item.languageValue,
  1184. objectId: item.objectId,
  1185. objectType: item.objectType,
  1186. tableId: item.tableId
  1187. }
  1188. })
  1189. await saveButtonList(buttons)
  1190. this.getFunctionButtonList()
  1191. this.getColumnList()
  1192. },
  1193. // 获取 tableDefault 列
  1194. getColumnList() {
  1195. let queryTable = {
  1196. functionId: this.functionId,
  1197. tableId: this.tableId,
  1198. languageCode: this.languageCode
  1199. }
  1200. getTableDefaultListLanguage(queryTable).then(({data}) => {
  1201. if (!data.rows.length == 0) {
  1202. this.showDefault = false
  1203. this.columnList = data.rows
  1204. } else {
  1205. this.showDefault = true
  1206. }
  1207. })
  1208. },
  1209. },
  1210. created() {
  1211. this.getTableUserColumn()
  1212. this.getSysLanguageParamList()
  1213. this.getFunctionButtonList()
  1214. this.favoriteIsOk()
  1215. }
  1216. }
  1217. </script>
  1218. <style scoped>
  1219. .sl-svg {
  1220. overflow: hidden;
  1221. float: right;
  1222. }
  1223. </style>