冷凝胶前端
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.

733 lines
21 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="customer-css">
  3. <!-- 菜单按钮区域 -->
  4. <fieldset class="customer-field" style="width: 675px; padding: 0.35em 0.75em 0.425em;">
  5. <!-- 查询产品 -->
  6. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
  7. <el-form-item label="工站:">
  8. <el-select v-model="searchData.itemNo">
  9. <el-option value="-1" label="全部"></el-option>
  10. <el-option value="10" label="模切工站"></el-option>
  11. <el-option value="20" label="FQC工站"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="工单号:">
  15. <el-input v-model="searchData.orderNo" style="width: 120px" @keyup.enter.native="refreshPageTables"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="' '" >
  18. <el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid"
  19. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }}
  20. </el-button>
  21. </el-form-item>
  22. <el-form-item :label="' '">
  23. <el-button type="primary" @click="dieCuttingReportModal" class="customer-bun-mid"
  24. :disabled="reportButton.dieCuttingButton"
  25. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.dieCuttingButton }}
  26. </el-button>
  27. </el-form-item>
  28. <el-form-item :label="' '">
  29. <el-button type="primary" @click="switchOperatorModal(1)" class="customer-bun-mid"
  30. :disabled="reportButton.fqcReportButton"
  31. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.fqcReportButton }}
  32. </el-button>
  33. </el-form-item>
  34. </el-form>
  35. </fieldset>
  36. <!-- 工单主表信息 -->
  37. <el-main style="margin-left: -20px; margin-top: -20px; width: 104%;">
  38. <el-table @row-click="setCurrentRow"
  39. :height="height"
  40. highlight-current-row
  41. :data="produceScheduleList"
  42. border
  43. v-loading="dataListLoading"
  44. style="width: 100%;">
  45. <el-table-column
  46. v-for="(item,index) in columnList" :key="index"
  47. :sortable="item.columnSortable"
  48. :prop="item.columnProp"
  49. :header-align="item.headerAlign"
  50. :show-overflow-tooltip="item.showOverflowTooltip"
  51. :align="item.align"
  52. :fixed="item.fixed==''?false:item.fixed"
  53. :min-width="item.columnWidth"
  54. :label="item.columnLabel">
  55. <template slot-scope="scope">
  56. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  57. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  58. style="width: 100px; height: 80px"/></span>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. </el-main>
  63. <!--列表的组件-->
  64. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  65. <!-- 动态列 -->
  66. <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
  67. <!-- 正常报工的组件 -->
  68. <comDieCuttingReport :close-on-click-modal="false" ref="comDieCuttingReport">
  69. </comDieCuttingReport>
  70. </div>
  71. </template>
  72. <script>
  73. import {
  74. getProduceScheduleList,
  75. reportCheck,
  76. getUserSpecialSecurity,
  77. closeOrOpenProduceOrder,
  78. pauseOrOpenProduceOrder,
  79. costRollUpProduceOrder,
  80. manualProduceOrder,
  81. repairSOFlagProduceOrder,
  82. workbenchCancelallops,
  83. getShopOrder,
  84. getScheduleMultiReportSpecialAuth,/* 获取派工单的特殊权限 */
  85. } from '@/api/scheduleReport/produce_order.js'
  86. /* 动态表头 */
  87. import {
  88. saveTableDefaultList,
  89. getTableDefaultListLanguage,
  90. getTableUserListLanguage,
  91. removerDefault,
  92. removerUser
  93. } from '@/api/table.js'
  94. /* 引入组件 */
  95. import Chooselist from '@/views/modules/common/Chooselist'/* 列表组件 */
  96. import column from '@/views/modules/common/column'
  97. import comDieCuttingReport from './com_die_cutting_report' /* 模切报工的组件 */
  98. var functionId = '600001';
  99. export default {
  100. data() {
  101. return {
  102. height: 800,
  103. authEdit: false,
  104. authAdd: false,
  105. authDelete: false,
  106. menuId: this.$route.meta.menuId,
  107. menuShow: false,
  108. showOperatorFlag: false,
  109. showReportFlag: false,
  110. showSplitReportFlag: false,
  111. showDefault: false,
  112. visible: false,
  113. fqcShowReportFlag: false,
  114. reworkShowReportFlag: false,
  115. fqcRollShowReportFlag: false,
  116. showFinishScheduleFlag: false,
  117. changePackagingFlag: false,
  118. showPartStockFlag: false,
  119. searchData: {
  120. site: this.$store.state.user.site,
  121. itemNo: '',
  122. orderNo: '',
  123. status: 1,
  124. username: this.$store.state.user.name,
  125. searchFlag: true,
  126. exportFlag: "N",
  127. },
  128. currentRow: {},
  129. produceScheduleList: [],
  130. dataListLoading: false,
  131. columnList: [
  132. {
  133. userId: this.$store.state.user.name,
  134. functionId: functionId,
  135. serialNumber: '600001ProduceOrderNo',
  136. tableId: '600001Produce',
  137. tableName: '待生产工单',
  138. columnProp: 'orderNo',
  139. headerAlign: 'center',
  140. align: 'center',
  141. columnLabel: '生产订单号',
  142. columnWidth: 120,
  143. columnHidden: false,
  144. columnImage: false,
  145. columnSortable: false,
  146. sortLv: 0,
  147. status: true,
  148. fixed: ''
  149. },
  150. {
  151. userId: this.$store.state.user.name,
  152. functionId: functionId,
  153. serialNumber: '600001ProduceItemNo',
  154. tableId: '600001Produce',
  155. tableName: '待生产工单',
  156. columnProp: 'itemNo',
  157. headerAlign: 'center',
  158. align: 'center',
  159. columnLabel: '工序号',
  160. columnWidth: 80,
  161. columnHidden: false,
  162. columnImage: false,
  163. columnSortable: true,
  164. sortLv: 0,
  165. status: true,
  166. fixed: ''
  167. },
  168. {
  169. userId: this.$store.state.user.name,
  170. functionId: functionId,
  171. serialNumber: '600001ProduceItemDesc',
  172. tableId: '600001Produce',
  173. tableName: '待生产工单',
  174. columnProp: 'itemDesc',
  175. headerAlign: 'center',
  176. align: 'center',
  177. columnLabel: '工序描述',
  178. columnWidth: 80,
  179. columnHidden: false,
  180. columnImage: false,
  181. columnSortable: false,
  182. sortLv: 0,
  183. status: true,
  184. fixed: ''
  185. },
  186. {
  187. userId: this.$store.state.user.name,
  188. functionId: functionId,
  189. serialNumber: '600001ProduceQtyRequired',
  190. tableId: '600001Produce',
  191. tableName: '待生产工单',
  192. columnProp: 'qtyRequired',
  193. headerAlign: 'center',
  194. align: 'center',
  195. columnLabel: '需求数量',
  196. columnWidth: 60,
  197. columnHidden: false,
  198. columnImage: false,
  199. columnSortable: false,
  200. sortLv: 0,
  201. status: true,
  202. fixed: ''
  203. },
  204. {
  205. userId: this.$store.state.user.name,
  206. functionId: functionId,
  207. serialNumber: '600001ProduceQtyReported',
  208. tableId: '600001Produce',
  209. tableName: '待生产工单',
  210. columnProp: 'qtyReported',
  211. headerAlign: 'center',
  212. align: 'right',
  213. columnLabel: '已报告数量',
  214. columnWidth: 100,
  215. columnHidden: false,
  216. columnImage: false,
  217. columnSortable: true,
  218. sortLv: 0,
  219. status: true,
  220. fixed: ''
  221. },
  222. {
  223. userId: this.$store.state.user.name,
  224. functionId: functionId,
  225. serialNumber: '600001ProducePartNo',
  226. tableId: '600001Produce',
  227. tableName: '待生产工单',
  228. columnProp: 'partNo',
  229. headerAlign: 'center',
  230. align: 'center',
  231. columnLabel: '产品编码',
  232. columnWidth: 120,
  233. columnHidden: false,
  234. columnImage: false,
  235. columnSortable: true,
  236. sortLv: 0,
  237. status: true,
  238. fixed: ''
  239. },
  240. {
  241. userId: this.$store.state.user.name,
  242. functionId: functionId,
  243. serialNumber: '600001ProducePartDesc',
  244. tableId: '600001Produce',
  245. tableName: '待生产工单',
  246. columnProp: 'partDesc',
  247. headerAlign: 'center',
  248. align: 'center',
  249. columnLabel: '产品名称',
  250. columnWidth: 180,
  251. columnHidden: false,
  252. columnImage: false,
  253. columnSortable: false,
  254. sortLv: 0,
  255. status: true,
  256. fixed: ''
  257. },
  258. {
  259. userId: this.$store.state.user.name,
  260. functionId: functionId,
  261. serialNumber: '600001ProduceRemark',
  262. tableId: '600001Produce',
  263. tableName: '待生产工单',
  264. columnProp: 'remark',
  265. headerAlign: 'center',
  266. align: 'center',
  267. columnLabel: '备注',
  268. columnWidth: 180,
  269. columnHidden: false,
  270. columnImage: false,
  271. columnSortable: false,
  272. sortLv: 0,
  273. status: true,
  274. fixed: ''
  275. },
  276. {
  277. userId: this.$store.state.user.name,
  278. functionId: functionId,
  279. serialNumber: '600001ProduceScheduledDate',
  280. tableId: '600001Produce',
  281. tableName: '待生产工单',
  282. columnProp: 'scheduledDate',
  283. headerAlign: 'center',
  284. align: 'center',
  285. columnLabel: '排产日期',
  286. columnWidth: 120,
  287. columnHidden: false,
  288. columnImage: false,
  289. columnSortable: false,
  290. sortLv: 0,
  291. status: true,
  292. fixed: ''
  293. },
  294. {
  295. userId: this.$store.state.user.name,
  296. functionId: functionId,
  297. serialNumber: '600001ProduceShiftNo',
  298. tableId: '600001Produce',
  299. tableName: '待生产工单',
  300. columnProp: 'shiftNo',
  301. headerAlign: 'center',
  302. align: 'center',
  303. columnLabel: '班次',
  304. columnWidth: 80,
  305. columnHidden: false,
  306. columnImage: false,
  307. columnSortable: false,
  308. sortLv: 0,
  309. status: true,
  310. fixed: ''
  311. },
  312. {
  313. userId: this.$store.state.user.name,
  314. functionId: functionId,
  315. serialNumber: '600001ProduceCustomerName',
  316. tableId: '600001Produce',
  317. tableName: '待生产工单',
  318. columnProp: 'customerName',
  319. headerAlign: 'center',
  320. align: 'center',
  321. columnLabel: '客户名称',
  322. columnWidth: 180,
  323. columnHidden: false,
  324. columnImage: false,
  325. columnSortable: false,
  326. sortLv: 0,
  327. status: true,
  328. fixed: ''
  329. },
  330. ],
  331. reportButton: {
  332. dieCuttingButton: true,
  333. fqcReportButton: true,
  334. },
  335. queryTable: {
  336. userId: this.$store.state.user.name,
  337. functionId: this.$route.meta.menuId,
  338. tableId: '600001Produce',
  339. languageCode: this.$i18n.locale
  340. },
  341. // 用户table 查询参数
  342. userColumnList: [],
  343. buttons: {
  344. searchButton: '查询',
  345. dieCuttingButton: '模切工站',
  346. fqcReportButton: 'FQC报工',
  347. },
  348. // 导出 start
  349. exportList: [],
  350. exportName: "生产工单",
  351. exportHeader: [],
  352. exportFooter: [],
  353. exportDefaultValue: "",
  354. // 导出 end
  355. }
  356. },
  357. components: {
  358. Chooselist, /* 选择的组件 */
  359. column,/* 动态列 */
  360. comDieCuttingReport, /* 报工页面的组件 */
  361. },
  362. mounted() {
  363. this.$nextTick(() => {
  364. this.height = window.innerHeight - 190
  365. })
  366. },
  367. methods: {
  368. /* 查询派工单 */
  369. getProduceScheduleList() {
  370. // 开始真的查询;
  371. this.searchData.searchFlag = true
  372. getProduceScheduleList(this.searchData).then(({data}) => {
  373. // 设置查询数据
  374. this.produceScheduleList = data.rows
  375. })
  376. },
  377. /* 刷新页面table */
  378. refreshPageTables() {
  379. this.currentRow = {}
  380. this.getProduceScheduleList()
  381. },
  382. /* 设置选中行的参数 */
  383. setCurrentRow(row, column, event) {
  384. this.currentRow = JSON.parse(JSON.stringify(row));
  385. //区分当前的工序数据
  386. if(10 === this.currentRow.itemNo){
  387. this.reportButton.dieCuttingButton = false;
  388. this.reportButton.fqcReportButton = true;
  389. }else if(20 === this.currentRow.itemNo){
  390. this.reportButton.dieCuttingButton = true;
  391. this.reportButton.fqcReportButton = false;
  392. }
  393. },
  394. // 切换报工modal
  395. dieCuttingReportModal() {
  396. // 首先判断是否选择好派工单
  397. if (JSON.stringify(this.currentRow) == '{}') {
  398. this.$message.error('请先选择好工单!')
  399. return false
  400. }
  401. // 打开操作员切换功能
  402. this.$nextTick(() => {
  403. this.$refs.comDieCuttingReport.init(this.currentRow.seqNo)
  404. })
  405. },
  406. // 打开分切报工的
  407. showSplitOrderReportModal() {
  408. // 首先判断是否选择好派工单
  409. if (JSON.stringify(this.currentRow) == '{}') {
  410. this.$message.error(this.labels.pleaseSelectSchedule)
  411. return false
  412. }
  413. this.$nextTick(() => {
  414. // 打开分切报工功能
  415. this.showSplitReportFlag = true
  416. this.$refs.comSplitOrderReport.init(this.currentRow.seqNo, this.operatorData)
  417. })
  418. },
  419. // 打开结束派工单的modal
  420. showFinishScheduleModal() {
  421. // 首先判断是否选择好派工单
  422. if (JSON.stringify(this.currentRow) == '{}') {
  423. this.$message.error(this.labels.pleaseSelectSchedule)
  424. return false
  425. }
  426. // 打开操作员切换功能
  427. this.showFinishScheduleFlag = true
  428. this.$nextTick(() => {
  429. this.$refs.comFinishSchedule.init(this.currentRow, this.operatorData)
  430. })
  431. },
  432. // 结束派工单后刷新页面
  433. processFinishScheduleOperation() {
  434. // 刷新当前页面的数据
  435. this.refreshPageTables()
  436. },
  437. // 保存操作员的信息
  438. saveOperatorData() {
  439. // 查询操作员信息
  440. getOperatorData(this.operatorData).then(({data}) => {
  441. let operatorData = data.row
  442. let status = operatorData.status
  443. this.operatorData.operatorName = data.row.operatorName
  444. // 重置操作员信息状态
  445. this.operatorData.status = status
  446. // 判断是否验证通过
  447. if (status == 'N') {
  448. this.operatorFlag = false
  449. } else {
  450. this.operatorFlag = true
  451. }
  452. if (!this.operatorFlag) {
  453. this.$message.error(this.labels.operatorCantBeUsed)
  454. }
  455. })
  456. // 判断是否检查通过--不通过不在继续
  457. .then(() => {
  458. if (!this.operatorFlag) {
  459. return false
  460. }
  461. // 关闭操作员切换功能
  462. this.operatorData.showFlag = false
  463. // 打开组件
  464. this.showReportFlag = true
  465. // 打开报工操作页面
  466. this.$nextTick(() => {
  467. this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData)
  468. })
  469. })
  470. },
  471. /* 列表方法的回调 */
  472. getBaseData(val) {
  473. if (this.tagNo === 88) {
  474. this.searchData.resourceId = val.ResourceID
  475. }
  476. },
  477. // 获取基础数据列表
  478. getBaseList(val) {
  479. this.tagNo = val
  480. this.$nextTick(() => {
  481. let strVal = ''
  482. if (val === 88) {
  483. strVal = this.searchData.resourceId
  484. }
  485. this.$refs.baseList.init(val, strVal, " AND WorkCenterNo <> 'FQC'")
  486. })
  487. },
  488. // 打开页面设置
  489. userSetting() {
  490. this.visible = true
  491. let queryTable = {
  492. userId: this.$store.state.user.name,
  493. functionId: this.$route.meta.menuId,
  494. tableId: '600001Produce',
  495. languageCode: this.$i18n.locale
  496. }
  497. this.$nextTick(() => {
  498. this.$refs.column.init(queryTable)
  499. })
  500. },
  501. // 获取 用户保存的 格式列
  502. getTableUserColumn() {
  503. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  504. if (data && data.code == 0 && data.rows.length > 0) {
  505. // this.columnList = []
  506. this.columnList = data.rows
  507. } else {
  508. this.getColumnList()
  509. }
  510. })
  511. },
  512. // 保存 默认配置 列
  513. async saveColumnList() {
  514. // 删除所有的该页面下保存的数据
  515. if (this.userColumnList) {
  516. // 删除 user自定义的数据
  517. await removerUser(this.queryTable)
  518. }
  519. // 删除默认配置
  520. await removerDefault(this.queryTable)
  521. // 保存页面 table属性
  522. let sumColumnList = this.columnList// concat(this.columnList1);
  523. sumColumnList = sumColumnList.map(item => {
  524. return item = {
  525. tableId: item.tableId,
  526. tableName: item.tableName,
  527. columnProp: item.columnProp,
  528. columnLabel: item.columnLabel,
  529. columnHidden: item.columnHidden,
  530. columnImage: item.columnImage,
  531. columnSortable: item.columnSortable,
  532. columnWidth: item.columnWidth,
  533. format: item.format,
  534. functionId: this.$route.meta.menuId,
  535. sortLv: item.sortLv,
  536. status: true,
  537. fixed: item.fixed,
  538. serialNumber: item.serialNumber,
  539. columnType: item.columnType,
  540. align: item.align
  541. }
  542. })
  543. await saveTableDefaultList(sumColumnList)
  544. // 保存页面 button label title 属性
  545. /* let buttons = this.buttonList.map(item => {
  546. return item = {
  547. functionId: this.$route.meta.menuId,
  548. languageValue: item.languageValue,
  549. objectId: item.objectId,
  550. objectType: item.objectType,
  551. tableId: item.tableId
  552. }
  553. })
  554. await saveButtonList(buttons) */
  555. this.getFunctionButtonList()
  556. this.getColumnList()
  557. },
  558. // 获取 tableDefault 列
  559. getColumnList() {
  560. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  561. if (data && data.code == 0) {
  562. // this.showDefault = false
  563. this.columnList = data.rows
  564. } else {
  565. // this.showDefault = true
  566. }
  567. })
  568. },
  569. fields() {
  570. let json = "{"
  571. this.columnList.forEach((item, index) => {
  572. if (index == this.columnList.length - 1) {
  573. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  574. } else {
  575. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  576. }
  577. })
  578. json += "}"
  579. let s = eval("(" + json + ")")
  580. return s
  581. },
  582. //导出excel
  583. async createExportData() {
  584. // 开始真的查询;
  585. this.searchData.searchFlag = true;
  586. this.searchData.exportFlag = "Y";
  587. await getProduceScheduleList(this.searchData).then(({data}) => {
  588. // 设置查询数据
  589. this.exportList = data.rows
  590. })
  591. //重置判断是否是导出的sql
  592. this.searchData.exportFlag = "N";
  593. return this.exportList;
  594. },
  595. startDownload() {
  596. // this.exportData = this.dataList
  597. },
  598. finishDownload() {
  599. },
  600. },
  601. created() {
  602. // 不查询
  603. getProduceScheduleList(this.searchData).then(({data}) => {
  604. // 设置查询数据
  605. this.searchData.searchFlag = false;
  606. this.searchData.exportFlag = 'N';
  607. this.produceScheduleList = data.rows
  608. })
  609. // 获取动态表头的信息
  610. //this.getTableUserColumn()
  611. }
  612. }
  613. </script>
  614. <style>
  615. .el-textarea__inner {
  616. padding: 5px 5px;
  617. }
  618. </style>
  619. <!--当前页面的标签样式-->
  620. <style scoped lang="scss">
  621. /*针对el-card*/
  622. .customer-card .el-form-item__content {
  623. margin-top: -15px;
  624. }
  625. .customer-card .el-form-item {
  626. height: 22px;
  627. }
  628. .customer-border .el-form-item__content {
  629. margin-top: -30px;
  630. }
  631. /*全局年与日类型 宽度*/
  632. div.el-time-width {
  633. width: 110px !important;
  634. }
  635. /* 全局时间右边框*/
  636. .customer-css input.el-input__inner {
  637. height: 22px !important;
  638. padding-right: 0px !important;
  639. }
  640. /* 控制el-card标签的数据*/
  641. div.customer-el-card {
  642. margin-left: 110px;
  643. margin-top: -15px;
  644. height: 20px;
  645. width: 60px;
  646. }
  647. /* 颜色控制 */
  648. div.customer-el-card-pink {
  649. background: #FF00FF;
  650. }
  651. div.customer-el-card-orange {
  652. background: #FFD700;
  653. }
  654. div.customer-el-card-blue {
  655. background: #0000CD;
  656. }
  657. /*清掉样式*/
  658. .el-radio + .el-radio {
  659. margin-left: 0px;
  660. }
  661. /*当前按钮的通用样式*/
  662. .customer-css .customer-bun-mid {
  663. width: 65px;
  664. text-align: center;
  665. }
  666. /*当前按钮的通用样式*/
  667. .customer-css .el-button--medium {
  668. padding: 5px 5px;
  669. }
  670. /*添加主菜单和明细菜单的样式*/
  671. .customer-css .customer-dropdown .el-button--primary {
  672. padding: 2px;
  673. font-size: 12px;
  674. }
  675. .el-dropdown-menu--medium .el-dropdown-menu__item {
  676. line-height: 18px;
  677. padding: 0 17px;
  678. font-size: 12px;
  679. }
  680. hr {
  681. margin-top: 0px;
  682. }
  683. /*控制上下间距*/
  684. </style>