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.

2436 lines
79 KiB

9 months ago
8 months ago
9 months ago
3 months ago
9 months ago
9 months ago
3 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
6 months ago
6 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
3 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
3 months ago
9 months ago
9 months ago
9 months ago
9 months ago
3 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
  1. <template>
  2. <div class="customer-css">
  3. <!-- 菜单按钮区域 -->
  4. <fieldset class="customer-field" style="width: 200px; padding: 0.35em 0.75em 0.425em;">
  5. <legend>菜单</legend>
  6. <el-form :inline="true" label-position="top" label-width="100px" style="">
  7. <el-form-item :label="''">
  8. <el-button type="primary" @click="refreshPageTables()" class="customer-bun-mid"
  9. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.searchButton }}
  10. </el-button>
  11. </el-form-item>
  12. <el-form-item :label="''">
  13. <el-button type="primary" @click="switchOperatorModal(0)" class="customer-bun-mid"
  14. :disabled="reportButton.normalReportButton"
  15. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.reportButton }}
  16. </el-button>
  17. </el-form-item>
  18. </el-form>
  19. </fieldset>
  20. <!-- 查询时间和产品 -->
  21. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
  22. <el-form-item :label=labels.siteNo>
  23. <el-input v-model="searchData.site" style="width: 85px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label=labels.resourceId>
  26. <span slot="label" @click="getBaseList(95)"><a herf="#">机台编号:</a></span>
  27. <el-input v-model="searchData.resourceId" clearable style="width: 110px"></el-input>
  28. </el-form-item>
  29. <el-form-item :label=labels.planStartTime>
  30. <el-date-picker class="el-time-width"
  31. style=""
  32. v-model="searchData.planStartTime1"
  33. value-format="yyyy-MM-dd">
  34. </el-date-picker>
  35. </el-form-item>
  36. <el-form-item :label="''">
  37. <el-date-picker class="el-time-width"
  38. style="margin-top: 20px;"
  39. v-model="searchData.planStartTime2"
  40. format="yyyy-MM-dd"
  41. value-format="yyyy-MM-dd"
  42. placeholder="">
  43. </el-date-picker>
  44. </el-form-item>
  45. <el-form-item :label=labels.orderNo>
  46. <el-input v-model="searchData.orderNo" clearable style="width: 140px" @keyup.enter.native="refreshPageTables"></el-input>
  47. </el-form-item>
  48. <el-form-item :label=labels.seqNo>
  49. <el-input v-model="searchData.seqNo" clearable style="width: 120px" @keyup.enter.native="refreshPageTables"></el-input>
  50. </el-form-item>
  51. <el-form-item :label="''" style="margin-left: -5px;">
  52. <el-checkbox style="margin-top: 20px;" true-label="Y" false-label="N" v-model="searchData.closedFlag">{{ labels.showFinishedSeqNo }}
  53. </el-checkbox>
  54. </el-form-item>
  55. </el-form>
  56. <!-- 右键操作菜单 -->
  57. <el-form :inline="true">
  58. <el-form-item :label=labels.shopOrderList>
  59. <el-dropdown trigger="click" style="margin-top: 3px" class="customer-dropdown" @command="handleCommand">
  60. <el-button type="primary" @click="menuButtonFlag" :disabled="authEdit">
  61. {{ labels.primaryMenu }}<i class="el-icon-arrow-down el-icon--right"></i>
  62. </el-button>
  63. <el-dropdown-menu v-show="menuShow" slot="dropdown">
  64. <el-dropdown-item class="customer-li" command="0" :disabled="menuButton.prdButton">
  65. <span>{{ labels.shopOrderLabel }}</span>
  66. </el-dropdown-item>
  67. <hr width="95%"/>
  68. <el-dropdown-item class="customer-li" command="1" :disabled="menuButton.closedButton">{{
  69. labels.closeLabel
  70. }}
  71. </el-dropdown-item>
  72. <el-dropdown-item class="customer-li" command="2" :disabled="menuButton.openButton">{{ labels.openLabel }}
  73. </el-dropdown-item>
  74. <hr width="95%"/>
  75. <el-dropdown-item class="customer-li" command="3" :disabled="menuButton.pauseButton">{{
  76. labels.pauseLabel
  77. }}
  78. </el-dropdown-item>
  79. <el-dropdown-item class="customer-li" command="4" :disabled="menuButton.openReverseButton">
  80. {{ labels.reopenLabel }}
  81. </el-dropdown-item>
  82. <hr width="95%"/>
  83. <el-dropdown-item class="customer-li" command="5" :disabled="menuButton.createRecheckButton">
  84. {{ labels.createReCheckSeqNo }}
  85. </el-dropdown-item>
  86. <hr width="95%"/>
  87. <el-dropdown-item class="customer-li" command="6" :disabled="menuButton.canceledAllPrdButton">
  88. {{ labels.cancelAllScheduleOperations }}
  89. </el-dropdown-item>
  90. <hr width="95%"/>
  91. <!-- <el-dropdown-item class="customer-li" command="7" :disabled="menuButton.costRollUpFlagButton">-->
  92. <!-- {{ labels.prodIssued }}-->
  93. <!-- </el-dropdown-item>-->
  94. <!-- <el-dropdown-item class="customer-li" command="8" :disabled="menuButton.canceledCostRollUpFlagButton">-->
  95. <!-- {{ labels.cancelProdIssued }}-->
  96. <!-- </el-dropdown-item>-->
  97. <el-dropdown-item class="customer-li" command="查看物料库存"
  98. :disabled="menuButton.partStockFlag">{{ labels.viewPartStock }}
  99. </el-dropdown-item>
  100. <hr width="95%"/>
  101. <!-- <el-dropdown-item class="customer-li" command="9" :disabled="menuButton.manualFlagButton">-->
  102. <!-- {{ labels.toolIssued }}-->
  103. <!-- </el-dropdown-item>-->
  104. <!-- <el-dropdown-item class="customer-li" command="10" :disabled="menuButton.canceledManualFlagButton">-->
  105. <!-- {{ labels.cancelToolIssued }}-->
  106. <!-- </el-dropdown-item>-->
  107. <!-- <hr width="95%"/>-->
  108. <!-- <el-dropdown-item class="customer-li" command="11" :disabled="menuButton.repairSOFlagButton">-->
  109. <!-- {{ labels.printIssued }}-->
  110. <!-- </el-dropdown-item>-->
  111. <!-- <el-dropdown-item class="customer-li" command="12" :disabled="menuButton.canceledRepairSOFlagButton">-->
  112. <!-- {{ labels.cancelPrintIssued }}-->
  113. <!-- </el-dropdown-item>-->
  114. <!-- <hr width="95%"/>-->
  115. </el-dropdown-menu>
  116. </el-dropdown>
  117. <!-- <el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>-->
  118. <!-- <el-button v-if="showDefault" @click="saveColumnList()" type="primary">{{ buttons.defaultTable }}</el-button>-->
  119. <download-excel
  120. :fields="fields()"
  121. :data="exportList"
  122. type="xls"
  123. :name="exportName"
  124. :header="exportHeader"
  125. :footer="exportFooter"
  126. :defaultValue="exportDefaultValue"
  127. :fetch="createExportData"
  128. :before-generate="startDownload"
  129. :before-finish="finishDownload"
  130. worksheet="导出信息"
  131. class="el-button el-button--primary el-button--medium">
  132. {{ buttons.download||'导出' }}
  133. </download-excel>
  134. </el-form-item>
  135. </el-form>
  136. <!-- 工单主表信息 -->
  137. <el-main style="margin-left: -20px; margin-top: -20px; width: 104%;">
  138. <el-table @row-click="setCurrentRow"
  139. :height="height"
  140. highlight-current-row
  141. :data="produceScheduleList"
  142. border
  143. v-loading="dataListLoading"
  144. style="width: 100%;">
  145. <el-table-column
  146. v-for="(item,index) in columnList" :key="index"
  147. :sortable="item.columnSortable"
  148. :prop="item.columnProp"
  149. :header-align="item.headerAlign"
  150. :show-overflow-tooltip="item.showOverflowTooltip"
  151. :align="item.align"
  152. :fixed="item.fixed==''?false:item.fixed"
  153. :width="item.columnWidth"
  154. :label="item.columnLabel">
  155. <template slot-scope="scope">
  156. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  157. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  158. style="width: 100px; height: 80px"/></span>
  159. </template>
  160. </el-table-column>
  161. </el-table>
  162. </el-main>
  163. <!-- 切换操作员 -->
  164. <comSwitchOperator ref="comSwitchOperator" :close-on-click-modal="false"
  165. :visible.sync="showOperatorFlag"
  166. @initOperatorData="initOperatorData"
  167. @notInitOperatorData="notInitOperatorData">
  168. </comSwitchOperator>
  169. <!-- 正常报工的组件 -->
  170. <comProduceReportNormal :close-on-click-modal="false"
  171. :visible.sync="showReportFlag" ref="comProduceReportNormal">
  172. </comProduceReportNormal>
  173. <!-- 分切报工的组件 -->
  174. <comSplitOrderReport :close-on-click-modal="false"
  175. :visible.sync="showSplitReportFlag" ref="comSplitOrderReport">
  176. </comSplitOrderReport>
  177. <!-- 正常的结束派工单组件 -->
  178. <comFinishSchedule :close-on-click-modal="false"
  179. :visible.sync="showFinishScheduleFlag" ref="comFinishSchedule"
  180. @processFinishScheduleOperation="processFinishScheduleOperation">
  181. </comFinishSchedule>
  182. <!-- fqc报工的组件 -->
  183. <fqcProduceReportNormal :close-on-click-modal="false"
  184. :visible.sync="fqcShowReportFlag" ref="fqcProduceReportNormal">
  185. </fqcProduceReportNormal>
  186. <!-- 返工重检 -->
  187. <reworkInspectReport :close-on-click-modal="false"
  188. :visible.sync="reworkShowReportFlag" ref="reworkInspectReport"></reworkInspectReport>
  189. <!-- FQC分卷 -->
  190. <fqcSplitRollReport :close-on-click-modal="false"
  191. :visible.sync="fqcRollShowReportFlag" ref="fqcSplitRollReport"></fqcSplitRollReport>
  192. <!-- 创建重检派工单 -->
  193. <createRecheck ref="createRecheck"></createRecheck>
  194. <!-- 换包装 -->
  195. <changePackaging :close-on-click-modal="false"
  196. :visible.sync="changePackagingFlag" ref="changePackaging"></changePackaging>
  197. <!-- 物料库存查询 -->
  198. <comPartStock ref="comPartStock" :close-on-click-modal="false"
  199. :visible.sync="showPartStockFlag">
  200. </comPartStock>
  201. <!--列表的组件-->
  202. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  203. <!-- 动态列 -->
  204. <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
  205. </div>
  206. </template>
  207. <script>
  208. import {
  209. getProduceScheduleList,
  210. reportCheck,
  211. getUserSpecialSecurity,
  212. closeOrOpenProduceOrder,
  213. pauseOrOpenProduceOrder,
  214. costRollUpProduceOrder,
  215. manualProduceOrder,
  216. repairSOFlagProduceOrder,
  217. workbenchCancelallops,
  218. getShopOrder,
  219. getScheduleMultiReportSpecialAuth,/* 获取派工单的特殊权限 */
  220. getResourceByUser
  221. } from '@/api/yieldReport/produce_order.js'
  222. /* 动态表头 */
  223. import {
  224. saveTableDefaultList,
  225. getTableDefaultListLanguage,
  226. getTableUserListLanguage,
  227. removerDefault,
  228. removerUser
  229. } from '@/api/table.js'
  230. /* 引入组件 */
  231. import Chooselist from '@/views/modules/common/Chooselist_eam'
  232. import comSwitchOperator from './com_switch_operator'/* 切换操作员 */
  233. import comProduceReportNormal from './com_produce_report_normal'/* 报工的组件 */
  234. import comFinishSchedule from './com_finish_schedule'/* 结束派工的组件 */
  235. import fqcProduceReportNormal from './otherReport/fqc_produce_report_normal'/* 结束派工的组件 */
  236. import reworkInspectReport from './otherReport/rework_inspect_report'/* 结束派工的组件 */
  237. import fqcSplitRollReport from './otherReport/fqc_split_roll_report'/* 结束派工的组件 */
  238. import changePackaging from './otherReport/change_packaging'/* 结束派工的组件 */
  239. import createRecheck from './com_create_recheck'
  240. import Com_split_schedule from '../schedule/com_split_schedule'
  241. import comSplitOrderReport from './com_split_order_report'
  242. import comPartStock from '../common/com_part_stock'
  243. import column from '@/views/modules/common/column'
  244. /* 展示物料库存的组件 */
  245. /* 分切报工 */
  246. import {
  247. searchSysLanguagePackList,
  248. searchSysLanguageParam,
  249. searchFunctionButtonList,
  250. saveButtonList,
  251. searchSysLanguage,
  252. searchLanguageListByLanguageCode,
  253. saveSysLanguageOne,
  254. searchPageLanguageData,
  255. removerLanguage,
  256. saveSysLanguageList
  257. } from "@/api/sysLanguage.js";
  258. var functionId = '104003006';
  259. export default {
  260. data() {
  261. return {
  262. height: 800,
  263. authEdit: false,
  264. authAdd: false,
  265. authDelete: false,
  266. menuId: this.$route.meta.menuId,
  267. menuShow: false,
  268. showOperatorFlag: false,
  269. showReportFlag: false,
  270. showSplitReportFlag: false,
  271. showDefault: false,
  272. visible: false,
  273. fqcShowReportFlag: false,
  274. reworkShowReportFlag: false,
  275. fqcRollShowReportFlag: false,
  276. showFinishScheduleFlag: false,
  277. changePackagingFlag: false,
  278. showPartStockFlag: false,
  279. searchData: {
  280. site: this.$store.state.user.site,
  281. resourceId: '',
  282. orderNo: '',
  283. seqNo: '',
  284. planStartTime1: '',
  285. planStartTime2: '',
  286. closedFlag: 'N',
  287. status: 1,
  288. username: this.$store.state.user.name,
  289. searchFlag: false,
  290. exportFlag: "N",
  291. },
  292. currentRow: {},
  293. operatorData: {
  294. site: this.$store.state.user.site,
  295. username: this.$store.state.user.name,
  296. userDisplay: this.$store.state.user.userDisplay,
  297. operatorId: '',
  298. operatorName: '',
  299. status: '',
  300. showFlag: false
  301. },
  302. produceScheduleList: [],
  303. dataListLoading: false,
  304. columnList: [
  305. {
  306. userId: this.$store.state.user.name,
  307. functionId: 5302,
  308. serialNumber: '5302ProduceSerialNumber',
  309. tableId: '5302Produce',
  310. tableName: '待生产工单',
  311. columnProp: 'serialNumber',
  312. headerAlign: 'center',
  313. align: 'right',
  314. columnLabel: '序号',
  315. columnWidth: 80,
  316. columnHidden: false,
  317. columnImage: false,
  318. columnSortable: false,
  319. sortLv: 0,
  320. status: true,
  321. fixed: ''
  322. },
  323. {
  324. userId: this.$store.state.user.name,
  325. functionId: 5302,
  326. serialNumber: '5302ProduceOrderNo',
  327. tableId: '5302Produce',
  328. tableName: '待生产工单',
  329. columnProp: 'orderNo',
  330. headerAlign: 'center',
  331. align: 'left',
  332. columnLabel: '生产订单号',
  333. columnWidth: 120,
  334. columnHidden: false,
  335. columnImage: false,
  336. columnSortable: false,
  337. sortLv: 0,
  338. status: true,
  339. fixed: ''
  340. },
  341. {
  342. userId: this.$store.state.user.name,
  343. functionId: 5302,
  344. serialNumber: '5302ProduceSeqNo',
  345. tableId: '5302Produce',
  346. tableName: '待生产工单',
  347. columnProp: 'seqNo',
  348. headerAlign: 'center',
  349. align: 'left',
  350. columnLabel: '派工单号',
  351. columnWidth: 80,
  352. columnHidden: false,
  353. columnImage: false,
  354. columnSortable: false,
  355. sortLv: 0,
  356. status: true,
  357. fixed: ''
  358. },
  359. {
  360. userId: this.$store.state.user.name,
  361. functionId: 5302,
  362. serialNumber: '5302ProduceItemNo',
  363. tableId: '5302Produce',
  364. tableName: '待生产工单',
  365. columnProp: 'itemNo',
  366. headerAlign: 'center',
  367. align: 'right',
  368. columnLabel: '生产工序',
  369. columnWidth: 80,
  370. columnHidden: false,
  371. columnImage: false,
  372. columnSortable: true,
  373. sortLv: 0,
  374. status: true,
  375. fixed: ''
  376. },
  377. {
  378. userId: this.$store.state.user.name,
  379. functionId: 5302,
  380. serialNumber: '5302ProduceItemDesc',
  381. tableId: '5302Produce',
  382. tableName: '待生产工单',
  383. columnProp: 'itemDesc',
  384. headerAlign: 'center',
  385. align: 'left',
  386. columnLabel: '工序名称',
  387. columnWidth: 100,
  388. columnHidden: false,
  389. columnImage: false,
  390. columnSortable: false,
  391. sortLv: 0,
  392. status: true,
  393. fixed: ''
  394. },
  395. {
  396. userId: this.$store.state.user.name,
  397. functionId: 5302,
  398. serialNumber: '5302ProduceResourceId',
  399. tableId: '5302Produce',
  400. tableName: '待生产工单',
  401. columnProp: 'resourceId',
  402. headerAlign: 'center',
  403. align: 'left',
  404. columnLabel: '生产机台',
  405. columnWidth: 100,
  406. columnHidden: false,
  407. columnImage: false,
  408. columnSortable: true,
  409. sortLv: 0,
  410. status: true,
  411. fixed: ''
  412. },
  413. {
  414. userId: this.$store.state.user.name,
  415. functionId: 5302,
  416. serialNumber: '5302ProducePartNo',
  417. tableId: '5302Produce',
  418. tableName: '待生产工单',
  419. columnProp: 'partNo',
  420. headerAlign: 'center',
  421. align: 'left',
  422. columnLabel: '产品编码',
  423. columnWidth: 120,
  424. columnHidden: false,
  425. columnImage: false,
  426. columnSortable: true,
  427. sortLv: 0,
  428. status: true,
  429. fixed: ''
  430. },
  431. {
  432. userId: this.$store.state.user.name,
  433. functionId: 5302,
  434. serialNumber: '5302ProducePartDesc',
  435. tableId: '5302Produce',
  436. tableName: '待生产工单',
  437. columnProp: 'partDesc',
  438. headerAlign: 'center',
  439. align: 'left',
  440. columnLabel: '产品名称',
  441. columnWidth: 200,
  442. columnHidden: false,
  443. columnImage: false,
  444. columnSortable: false,
  445. sortLv: 0,
  446. status: true,
  447. fixed: ''
  448. },
  449. {
  450. userId: this.$store.state.user.name,
  451. functionId: 5302,
  452. serialNumber: '5302ProduceSpec',
  453. tableId: '5302Produce',
  454. tableName: '待生产工单',
  455. columnProp: 'spec',
  456. headerAlign: 'center',
  457. align: 'left',
  458. columnLabel: '规格型号',
  459. columnWidth: 100,
  460. columnHidden: false,
  461. columnImage: false,
  462. columnSortable: false,
  463. sortLv: 0,
  464. status: true,
  465. fixed: ''
  466. },
  467. {
  468. userId: this.$store.state.user.name,
  469. functionId: 5302,
  470. serialNumber: '5302ProduceQtyRequired',
  471. tableId: '5302Produce',
  472. tableName: '待生产工单',
  473. columnProp: 'qtyRequired',
  474. headerAlign: 'center',
  475. align: 'right',
  476. columnLabel: '需求数量',
  477. columnWidth: 100,
  478. columnHidden: false,
  479. columnImage: false,
  480. columnSortable: false,
  481. sortLv: 0,
  482. status: true,
  483. fixed: ''
  484. },
  485. {
  486. userId: this.$store.state.user.name,
  487. functionId: 5302,
  488. serialNumber: '5302ProduceQtyReported',
  489. tableId: '5302Produce',
  490. tableName: '待生产工单',
  491. columnProp: 'qtyReported',
  492. headerAlign: 'center',
  493. align: 'right',
  494. columnLabel: '完工数量',
  495. columnWidth: 100,
  496. columnHidden: false,
  497. columnImage: false,
  498. columnSortable: true,
  499. sortLv: 0,
  500. status: true,
  501. fixed: ''
  502. },
  503. {
  504. userId: this.$store.state.user.name,
  505. functionId: 5302,
  506. serialNumber: '5302ProduceQtyToReport',
  507. tableId: '5302Produce',
  508. tableName: '待生产工单',
  509. columnProp: 'qtyToReport',
  510. headerAlign: 'center',
  511. align: 'right',
  512. columnLabel: '未完数量',
  513. columnWidth: 100,
  514. columnHidden: false,
  515. columnImage: false,
  516. columnSortable: true,
  517. sortLv: 0,
  518. status: true,
  519. fixed: ''
  520. },
  521. {
  522. userId: this.$store.state.user.name,
  523. functionId: 5302,
  524. serialNumber: '5302ProduceTimeRequired',
  525. tableId: '5302Produce',
  526. tableName: '待生产工单',
  527. columnProp: 'timeRequired',
  528. headerAlign: 'center',
  529. align: 'right',
  530. columnLabel: '需求时间',
  531. columnWidth: 80,
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 0,
  536. status: true,
  537. fixed: ''
  538. },
  539. {
  540. userId: this.$store.state.user.name,
  541. functionId: 5302,
  542. serialNumber: '5302ProduceTimeReported',
  543. tableId: '5302Produce',
  544. tableName: '待生产工单',
  545. columnProp: 'timeReported',
  546. headerAlign: 'center',
  547. align: 'right',
  548. columnLabel: '累计工时(m)',
  549. columnWidth: 80,
  550. columnHidden: false,
  551. columnImage: false,
  552. columnSortable: false,
  553. sortLv: 0,
  554. status: true,
  555. fixed: ''
  556. },
  557. {
  558. userId: this.$store.state.user.name,
  559. functionId: 5302,
  560. serialNumber: '5302ProduceQtyApprove',
  561. tableId: '5302Produce',
  562. tableName: '待生产工单',
  563. columnProp: 'qtyApprove',
  564. headerAlign: 'center',
  565. align: 'right',
  566. columnLabel: '合格数量',
  567. columnWidth: 80,
  568. columnHidden: false,
  569. columnImage: false,
  570. columnSortable: false,
  571. sortLv: 0,
  572. status: true,
  573. fixed: ''
  574. },
  575. {
  576. userId: this.$store.state.user.name,
  577. functionId: 5302,
  578. serialNumber: '5302ProduceQtyScrapt',
  579. tableId: '5302Produce',
  580. tableName: '待生产工单',
  581. columnProp: 'qtyScrapt',
  582. headerAlign: 'center',
  583. align: 'right',
  584. columnLabel: '不良数量',
  585. columnWidth: 80,
  586. columnHidden: false,
  587. columnImage: false,
  588. columnSortable: false,
  589. sortLv: 0,
  590. status: true,
  591. fixed: ''
  592. },
  593. {
  594. userId: this.$store.state.user.name,
  595. functionId: 5302,
  596. serialNumber: '5302ProduceScheduledDate',
  597. tableId: '5302Produce',
  598. tableName: '待生产工单',
  599. columnProp: 'scheduledDate',
  600. headerAlign: 'center',
  601. align: 'center',
  602. columnLabel: '排产日期',
  603. columnWidth: 100,
  604. columnHidden: false,
  605. columnImage: false,
  606. columnSortable: false,
  607. sortLv: 0,
  608. status: true,
  609. fixed: ''
  610. },
  611. {
  612. userId: this.$store.state.user.name,
  613. functionId: 5302,
  614. serialNumber: '5302ProducePlanStartTime',
  615. tableId: '5302Produce',
  616. tableName: '待生产工单',
  617. columnProp: 'planStartTime',
  618. headerAlign: 'center',
  619. align: 'center',
  620. columnLabel: '计划开工时间',
  621. columnWidth: 130,
  622. columnHidden: false,
  623. columnImage: false,
  624. columnSortable: true,
  625. sortLv: 0,
  626. status: true,
  627. fixed: ''
  628. },
  629. {
  630. userId: this.$store.state.user.name,
  631. functionId: 5302,
  632. serialNumber: '5302ProducePlanFinishTime',
  633. tableId: '5302Produce',
  634. tableName: '待生产工单',
  635. columnProp: 'planFinishTime',
  636. headerAlign: 'center',
  637. align: 'center',
  638. columnLabel: '计划完工时间',
  639. columnWidth: 130,
  640. columnHidden: false,
  641. columnImage: false,
  642. columnSortable: true,
  643. sortLv: 0,
  644. status: true,
  645. fixed: ''
  646. },
  647. {
  648. userId: this.$store.state.user.name,
  649. functionId: 5302,
  650. serialNumber: '5302ProduceShiftNo',
  651. tableId: '5302Produce',
  652. tableName: '待生产工单',
  653. columnProp: 'shiftNo',
  654. headerAlign: 'center',
  655. align: 'left',
  656. columnLabel: '班次',
  657. columnWidth: 80,
  658. columnHidden: false,
  659. columnImage: false,
  660. columnSortable: false,
  661. sortLv: 0,
  662. status: true,
  663. fixed: ''
  664. },
  665. {
  666. userId: this.$store.state.user.name,
  667. functionId: 5302,
  668. serialNumber: '5302ProduceMachSetupTime',
  669. tableId: '5302Produce',
  670. tableName: '待生产工单',
  671. columnProp: 'machSetupTime',
  672. headerAlign: 'center',
  673. align: 'right',
  674. columnLabel: '调机时间',
  675. columnWidth: 80,
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: ''
  682. },
  683. {
  684. userId: this.$store.state.user.name,
  685. functionId: 5302,
  686. serialNumber: '5302ProduceMachRunFactor',
  687. tableId: '5302Produce',
  688. tableName: '待生产工单',
  689. columnProp: 'machRunFactor',
  690. headerAlign: 'center',
  691. align: 'right',
  692. columnLabel: '单位产出',
  693. columnWidth: 80,
  694. columnHidden: false,
  695. columnImage: false,
  696. columnSortable: false,
  697. sortLv: 0,
  698. status: true,
  699. fixed: ''
  700. },
  701. {
  702. userId: this.$store.state.user.name,
  703. functionId: 5302,
  704. serialNumber: '5302ProduceFactorUnit',
  705. tableId: '5302Produce',
  706. tableName: '待生产工单',
  707. columnProp: 'factorUnit',
  708. headerAlign: 'center',
  709. align: 'left',
  710. columnLabel: '产出单位',
  711. columnWidth: 80,
  712. columnHidden: false,
  713. columnImage: false,
  714. columnSortable: false,
  715. sortLv: 0,
  716. status: true,
  717. fixed: ''
  718. },
  719. {
  720. userId: this.$store.state.user.name,
  721. functionId: 5302,
  722. serialNumber: '5302ProduceEfficiency',
  723. tableId: '5302Produce',
  724. tableName: '待生产工单',
  725. columnProp: 'efficiency',
  726. headerAlign: 'center',
  727. align: 'right',
  728. columnLabel: '效率',
  729. columnWidth: 80,
  730. columnHidden: false,
  731. columnImage: false,
  732. columnSortable: false,
  733. sortLv: 0,
  734. status: true,
  735. fixed: ''
  736. },
  737. {
  738. userId: this.$store.state.user.name,
  739. functionId: 5302,
  740. serialNumber: '5302ProduceNextItemNo',
  741. tableId: '5302Produce',
  742. tableName: '待生产工单',
  743. columnProp: 'nextItemNo',
  744. headerAlign: 'center',
  745. align: 'right',
  746. columnLabel: '下道工序号',
  747. columnWidth: 80,
  748. columnHidden: false,
  749. columnImage: false,
  750. columnSortable: false,
  751. sortLv: 0,
  752. status: true,
  753. fixed: ''
  754. },
  755. {
  756. userId: this.$store.state.user.name,
  757. functionId: 5302,
  758. serialNumber: '5302ProduceNextItemDesc',
  759. tableId: '5302Produce',
  760. tableName: '待生产工单',
  761. columnProp: 'nextItemDesc',
  762. headerAlign: 'center',
  763. align: 'left',
  764. columnLabel: '下道工序名称',
  765. columnWidth: 100,
  766. columnHidden: false,
  767. columnImage: false,
  768. columnSortable: false,
  769. sortLv: 0,
  770. status: true,
  771. fixed: ''
  772. },
  773. {
  774. userId: this.$store.state.user.name,
  775. functionId: 5302,
  776. serialNumber: '5302ProducePreItemNo',
  777. tableId: '5302Produce',
  778. tableName: '待生产工单',
  779. columnProp: 'preItemNo',
  780. headerAlign: 'center',
  781. align: 'right',
  782. columnLabel: '前道工序号',
  783. columnWidth: 80,
  784. columnHidden: false,
  785. columnImage: false,
  786. columnSortable: false,
  787. sortLv: 0,
  788. status: true,
  789. fixed: ''
  790. },
  791. {
  792. userId: this.$store.state.user.name,
  793. functionId: 5302,
  794. serialNumber: '5302ProducePreItemDesc',
  795. tableId: '5302Produce',
  796. tableName: '待生产工单',
  797. columnProp: 'preItemDesc',
  798. headerAlign: 'center',
  799. align: 'left',
  800. columnLabel: '前道工序名称',
  801. columnWidth: 100,
  802. columnHidden: false,
  803. columnImage: false,
  804. columnSortable: false,
  805. sortLv: 0,
  806. status: true,
  807. fixed: ''
  808. },
  809. {
  810. userId: this.$store.state.user.name,
  811. functionId: 5302,
  812. serialNumber: '5302ProduceCustomerName',
  813. tableId: '5302Produce',
  814. tableName: '待生产工单',
  815. columnProp: 'customerName',
  816. headerAlign: 'center',
  817. align: 'left',
  818. columnLabel: '客户名称',
  819. columnWidth: 100,
  820. columnHidden: false,
  821. columnImage: false,
  822. columnSortable: false,
  823. sortLv: 0,
  824. status: true,
  825. fixed: ''
  826. },
  827. {
  828. userId: this.$store.state.user.name,
  829. functionId: 5302,
  830. serialNumber: '5302ProduceCustPartNo',
  831. tableId: '5302Produce',
  832. tableName: '待生产工单',
  833. columnProp: 'custPartNo',
  834. headerAlign: 'center',
  835. align: 'left',
  836. columnLabel: '客户料号',
  837. columnWidth: 100,
  838. columnHidden: false,
  839. columnImage: false,
  840. columnSortable: false,
  841. sortLv: 0,
  842. status: true,
  843. fixed: ''
  844. },
  845. {
  846. userId: this.$store.state.user.name,
  847. functionId: 5302,
  848. serialNumber: '5302ProducePreResourceInfo',
  849. tableId: '5302Produce',
  850. tableName: '待生产工单',
  851. columnProp: 'preResourceInfo',
  852. headerAlign: 'center',
  853. align: 'left',
  854. columnLabel: '上工序机台信息',
  855. columnWidth: 100,
  856. columnHidden: false,
  857. columnImage: false,
  858. columnSortable: false,
  859. sortLv: 0,
  860. status: true,
  861. fixed: ''
  862. },
  863. {
  864. userId: this.$store.state.user.name,
  865. functionId: 5302,
  866. serialNumber: '5302ProducePreQtyFinished',
  867. tableId: '5302Produce',
  868. tableName: '待生产工单',
  869. columnProp: 'preQtyFinished',
  870. headerAlign: 'center',
  871. align: 'right',
  872. columnLabel: '上工序完工数',
  873. columnWidth: 100,
  874. columnHidden: false,
  875. columnImage: false,
  876. columnSortable: false,
  877. sortLv: 0,
  878. status: true,
  879. fixed: ''
  880. },
  881. {
  882. userId: this.$store.state.user.name,
  883. functionId: 5302,
  884. serialNumber: '5302ProduceNeedDate',
  885. tableId: '5302Produce',
  886. tableName: '待生产工单',
  887. columnProp: 'needDate',
  888. headerAlign: 'center',
  889. align: 'center',
  890. columnLabel: '生产订单要求完工日期',
  891. columnWidth: 160,
  892. columnHidden: false,
  893. columnImage: false,
  894. columnSortable: true,
  895. sortLv: 0,
  896. status: true,
  897. fixed: ''
  898. },
  899. {
  900. userId: this.$store.state.user.name,
  901. functionId: 5302,
  902. serialNumber: '5302ProduceClosedFlag',
  903. tableId: '5302Produce',
  904. tableName: '待生产工单',
  905. columnProp: 'closedFlag',
  906. headerAlign: 'center',
  907. align: 'center',
  908. columnLabel: '已关闭',
  909. columnWidth: 50,
  910. columnHidden: false,
  911. columnImage: false,
  912. columnSortable: false,
  913. sortLv: 0,
  914. status: true,
  915. fixed: ''
  916. },
  917. {
  918. userId: this.$store.state.user.name,
  919. functionId: 5302,
  920. serialNumber: '5302ProduceBarcodeId',
  921. tableId: '5302Produce',
  922. tableName: '条形码',
  923. columnProp: 'barcodeId',
  924. headerAlign: 'center',
  925. align: 'left',
  926. columnLabel: '条形码',
  927. columnWidth: 80,
  928. columnHidden: false,
  929. columnImage: false,
  930. columnSortable: false,
  931. sortLv: 0,
  932. status: true,
  933. fixed: ''
  934. },
  935. {
  936. userId: this.$store.state.user.name,
  937. functionId: 5302,
  938. serialNumber: '5302ProduceRemark',
  939. tableId: '5302Produce',
  940. tableName: '待生产工单',
  941. columnProp: 'remark',
  942. headerAlign: 'center',
  943. align: 'left',
  944. columnLabel: '备注',
  945. columnWidth: 200,
  946. columnHidden: false,
  947. columnImage: false,
  948. columnSortable: false,
  949. sortLv: 0,
  950. status: true,
  951. fixed: ''
  952. },
  953. {
  954. userId: this.$store.state.user.name,
  955. functionId: 5302,
  956. serialNumber: '5302ProduceCrewSize',
  957. tableId: '5302Produce',
  958. tableName: '待生产工单',
  959. columnProp: 'crewSize',
  960. headerAlign: 'center',
  961. align: 'right',
  962. columnLabel: '操作工人数',
  963. columnWidth: 100,
  964. columnHidden: false,
  965. columnImage: false,
  966. columnSortable: false,
  967. sortLv: 0,
  968. status: true,
  969. fixed: ''
  970. },
  971. {
  972. userId: this.$store.state.user.name,
  973. functionId: 5302,
  974. serialNumber: '5302ProduceOutWorkFlag',
  975. tableId: '5302Produce',
  976. tableName: '待生产工单',
  977. columnProp: 'outWorkFlag',
  978. headerAlign: 'center',
  979. align: 'center',
  980. columnLabel: '是否外协',
  981. columnWidth: 80,
  982. columnHidden: false,
  983. columnImage: false,
  984. columnSortable: false,
  985. sortLv: 0,
  986. status: true,
  987. fixed: ''
  988. },
  989. {
  990. userId: this.$store.state.user.name,
  991. functionId: 5302,
  992. serialNumber: '5302ProduceScheduledSeqNo',
  993. tableId: '5302Produce',
  994. tableName: '待生产工单',
  995. columnProp: 'scheduledSeqNo',
  996. headerAlign: 'center',
  997. align: 'left',
  998. columnLabel: '次序号',
  999. columnWidth: 80,
  1000. columnHidden: false,
  1001. columnImage: false,
  1002. columnSortable: false,
  1003. sortLv: 0,
  1004. status: true,
  1005. fixed: ''
  1006. },
  1007. {
  1008. userId: this.$store.state.user.name,
  1009. functionId: 5302,
  1010. serialNumber: '5302ProduceParkFlag',
  1011. tableId: '5302Produce',
  1012. tableName: '待生产工单',
  1013. columnProp: 'parkFlag',
  1014. headerAlign: 'center',
  1015. align: 'center',
  1016. columnLabel: '暂停',
  1017. columnWidth: 80,
  1018. columnHidden: false,
  1019. columnImage: false,
  1020. columnSortable: false,
  1021. sortLv: 0,
  1022. status: true,
  1023. fixed: ''
  1024. },
  1025. {
  1026. userId: this.$store.state.user.name,
  1027. functionId: 5302,
  1028. serialNumber: '5302ProduceQtyRequiredOriginal',
  1029. tableId: '5302Produce',
  1030. tableName: '待生产工单',
  1031. columnProp: 'qtyRequiredOriginal',
  1032. headerAlign: 'center',
  1033. align: 'right',
  1034. columnLabel: '原始派工单需求数量',
  1035. columnWidth: 80,
  1036. columnHidden: false,
  1037. columnImage: false,
  1038. columnSortable: false,
  1039. sortLv: 0,
  1040. status: true,
  1041. fixed: ''
  1042. },
  1043. {
  1044. userId: this.$store.state.user.name,
  1045. functionId: 5302,
  1046. serialNumber: '5302ProduceClosedBy',
  1047. tableId: '5302Produce',
  1048. tableName: '待生产工单',
  1049. columnProp: 'closedBy',
  1050. headerAlign: 'center',
  1051. align: 'center',
  1052. columnLabel: '关闭人',
  1053. columnWidth: 100,
  1054. columnHidden: false,
  1055. columnImage: false,
  1056. columnSortable: false,
  1057. sortLv: 0,
  1058. status: true,
  1059. fixed: ''
  1060. },
  1061. {
  1062. userId: this.$store.state.user.name,
  1063. functionId: 5302,
  1064. serialNumber: '5302ProduceClosedDate',
  1065. tableId: '5302Produce',
  1066. tableName: '待生产工单',
  1067. columnProp: 'closedDate',
  1068. headerAlign: 'center',
  1069. align: 'center',
  1070. columnLabel: '关闭日期',
  1071. columnWidth: 130,
  1072. columnHidden: false,
  1073. columnImage: false,
  1074. columnSortable: false,
  1075. sortLv: 0,
  1076. status: true,
  1077. fixed: ''
  1078. }
  1079. ],
  1080. reportButton: {
  1081. normalReportButton: true,
  1082. fqcReportButton: true,
  1083. reworkReportButton: true,
  1084. packReportButton: true,
  1085. fqcSegmentReportButton: true,
  1086. slitReportButton: true
  1087. },
  1088. menuButton: {
  1089. prdButton: true,
  1090. openButton: true,
  1091. closedButton: true,
  1092. pauseButton: true,
  1093. openReverseButton: true,
  1094. costRollUpFlagButton: true,
  1095. canceledCostRollUpFlagButton: false,
  1096. manualFlagButton: false,
  1097. canceledManualFlagButton: false,
  1098. repairSOFlagButton: false,
  1099. canceledRepairSOFlagButton: false,
  1100. canceledAllPrdButton: false,
  1101. createRecheckButton: false,
  1102. partStockFlag: true/* 查看物料库存 */
  1103. },
  1104. queryTable: {
  1105. userId: this.$store.state.user.name,
  1106. functionId: this.$route.meta.menuId,
  1107. tableId: '5302Produce',
  1108. languageCode: this.$i18n.locale
  1109. },
  1110. // 用户table 查询参数
  1111. queryTableUser: {
  1112. userId: this.$store.state.user.name,
  1113. functionId: this.$route.meta.menuId,
  1114. tableId: '5302Produce',
  1115. status: true,
  1116. languageCode: this.$i18n.locale
  1117. },
  1118. // 用户table 配置集合
  1119. userColumnList: [],
  1120. buttons: {
  1121. searchButton: '查询',
  1122. reportButton: '报工',
  1123. fqcReportButton: 'FQC报工',
  1124. reworkInspectReport: '返工重检',
  1125. repackageReport: '换包装',
  1126. fqcSplitRollReport: 'FQC分卷',
  1127. splitReport: '分切报工',
  1128. settingTable: '设置列表',
  1129. defaultTable: '设置默认配置',
  1130. },
  1131. queryButton: {
  1132. functionId: functionId,
  1133. table_id: '*',
  1134. languageCode: this.$i18n.locale,
  1135. objectType: 'button'
  1136. },
  1137. labels: {
  1138. menuLabel: '菜单',
  1139. siteNo: '工厂编号:',
  1140. resourceId: '机台编号:',
  1141. planStartTime: '计划开工时间:',
  1142. orderNo: '生产订单号:',
  1143. seqNo: '派工单号:',
  1144. showFinishedSeqNo: '显示已结束派工单',
  1145. shopOrderList: '生产工单列表 ',
  1146. primaryMenu: '主菜单',
  1147. shopOrderLabel: '生产订单',
  1148. closeLabel: '关闭',
  1149. openLabel: '打开',
  1150. pauseLabel: '暂停',
  1151. reopenLabel: '重新开工',
  1152. createReCheckSeqNo: '创建重检派工单',
  1153. cancelAllScheduleOperations: '取消所有派工单操作',
  1154. prodIssued: '生产已排料',
  1155. cancelProdIssued: '取消生产已排料',
  1156. viewPartStock: '查看物料库存',
  1157. toolIssued: '刀模已发',
  1158. cancelToolIssued: '取消刀模已发',
  1159. printIssued: '印版已发',
  1160. cancelPrintIssued: '取消印版已发',
  1161. pleaseSelectSchedule: '请先选择派工单!',
  1162. confirmLabel: '确定',
  1163. cancelLabel: '取消',
  1164. sureCloseThisSchedule: '确定要关闭当前派工单吗?',
  1165. closeScheduleLabel: '关闭派工单',
  1166. sureOpenThisSchedule: '确定要打开当前派工单吗?',
  1167. surePauseThisSchedule: '确定要暂停当前派工单吗??',
  1168. sureReopenThisSchedule: '确定要重开当前派工单吗?',
  1169. sureCancelScheduleAllOperations: '确定取消所有派工单操作?',
  1170. sureThisOrderMaterialIsIssued: '确定该订单的料已排?',
  1171. sureCancelThisOrderMaterialIssued: '确定要撤销该订单的排料?',
  1172. cancelOrderMaterialIssued: '撤销订单排料',
  1173. sureThisOrderToolIsIssued: '确定该订单的刀模已发?',
  1174. sureCancelThisOrderToolIssued: '确定要撤销该订单的刀模已发?',
  1175. sureThisOrderPrintIsIssued: '确定该订单的印版已发?',
  1176. sureCancelThisOrderPrintIssued: '确定要撤销该订单的印版已发?',
  1177. thisScheduleCantReport: '当前派工单无法使用报工!',
  1178. thisOrderIsNotSplitOrder: '当前工单非分切工单!',
  1179. thisScheduleIsNotFqc: '当前派工单非FQC报工派工单!',
  1180. thisOrderIsNotSpecialOrder: '该订单不是特殊订单,不能采用该功能!',
  1181. operatorCantBeUsed: '操作员信息不可用!',
  1182. },
  1183. queryLabel: {
  1184. functionId: functionId,
  1185. table_id: '*',
  1186. languageCode: this.$i18n.locale,
  1187. objectType: 'label'
  1188. },
  1189. // 导出 start
  1190. exportList: [],
  1191. exportName: "生产工单",
  1192. exportHeader: [],
  1193. exportFooter: [],
  1194. exportDefaultValue: "",
  1195. // 导出 end
  1196. }
  1197. },
  1198. components: {
  1199. Chooselist, /* 选择的组件 */
  1200. Com_split_schedule,
  1201. comSwitchOperator, /* 切换用户的组件 */
  1202. comProduceReportNormal, /* 报工页面的组件 */
  1203. comSplitOrderReport, /* 分切报工 */
  1204. comFinishSchedule, /* 结束派工单的组件 */
  1205. fqcProduceReportNormal, /* FQC报工 */
  1206. reworkInspectReport, /* 返工重建 */
  1207. fqcSplitRollReport, /* FQC分卷 */
  1208. createRecheck, /* 创建重检派工单 */
  1209. changePackaging, /* 换包装 */
  1210. comPartStock, /* 展示物料库存的组件 */
  1211. column/* 动态列 */
  1212. },
  1213. mounted() {
  1214. this.$nextTick(() => {
  1215. this.height = window.innerHeight - 235
  1216. })
  1217. },
  1218. methods: {
  1219. // 控制是否显示功能
  1220. menuButtonFlag() {
  1221. this.menuShow = false
  1222. if (JSON.stringify(this.currentRow) == '{}') {
  1223. this.menuButton.prdButton = true
  1224. this.menuButton.openButton = true
  1225. this.menuButton.closedButton = true
  1226. this.menuButton.pauseButton = true
  1227. this.menuButton.costRollUpFlagButton = true
  1228. this.menuButton.canceledCostRollUpFlagButton = true
  1229. this.menuButton.manualFlagButton = true
  1230. this.menuButton.canceledManualFlagButton = true
  1231. this.menuButton.repairSOFlagButton = true
  1232. this.menuButton.canceledRepairSOFlagButton = true
  1233. this.menuButton.canceledAllPrdButton = true
  1234. this.menuButton.createRecheckButton = true
  1235. } else {
  1236. let currentRow = null
  1237. // 获取订单信息
  1238. let searchOrder = {
  1239. orderNo: this.currentRow.orderNo,
  1240. seqNo: this.currentRow.seqNo,
  1241. site: this.currentRow.site,
  1242. username: this.$store.state.user.name,
  1243. searchFlag: true,
  1244. exportFlag: 'N',
  1245. }
  1246. getProduceScheduleList(searchOrder).then(({data}) => {
  1247. // 设置查询数据
  1248. currentRow = data.rows[0]
  1249. if (currentRow == null) {
  1250. return
  1251. }
  1252. // this.menuButton.canceledAllPrdButton = false
  1253. this.menuButton.createRecheckButton = false
  1254. this.menuButton.partStockFlag = false
  1255. // 判断是否具有该页面权限
  1256. let menList = JSON.parse(sessionStorage.getItem('dynamicMenuRoutes') || '[]').filter(item => item.path == 'shopOrder-shopOrder/shopOrder')
  1257. if (menList.length > 0) {
  1258. this.menuButton.prdButton = false
  1259. }
  1260. let canceledAllPrd = {
  1261. userSpecialSecurityNo: 232,
  1262. username: this.$store.state.user.name
  1263. }
  1264. getUserSpecialSecurity(canceledAllPrd).then(({data}) => {
  1265. if (data.userSpecialSecurity == 'Y') {
  1266. this.menuButton.canceledAllPrdButton = false
  1267. } else {
  1268. this.menuButton.canceledAllPrdButton = true
  1269. }
  1270. })
  1271. // 关闭按钮
  1272. if (currentRow.closedFlag == 'N') {
  1273. let data = {
  1274. userSpecialSecurityNo: 230,
  1275. username: this.$store.state.user.name
  1276. }
  1277. getUserSpecialSecurity(data).then(({data}) => {
  1278. if (data.userSpecialSecurity == 'Y') {
  1279. this.menuButton.closedButton = false
  1280. } else {
  1281. this.menuButton.closedButton = true
  1282. }
  1283. })
  1284. } else {
  1285. this.menuButton.closedButton = true
  1286. }
  1287. // 打开按钮
  1288. if (currentRow.closedFlag == 'Y') {
  1289. let data = {
  1290. userSpecialSecurityNo: 231,
  1291. username: this.$store.state.user.name
  1292. }
  1293. getUserSpecialSecurity(data).then(({data}) => {
  1294. if (data.userSpecialSecurity == 'Y') {
  1295. this.menuButton.openButton = false
  1296. } else {
  1297. this.menuButton.openButton = true
  1298. }
  1299. })
  1300. } else {
  1301. this.menuButton.openButton = true
  1302. }
  1303. // 暂停
  1304. if (currentRow.closedFlag == 'N' && currentRow.parkFlag == 'N') {
  1305. this.menuButton.pauseButton = false
  1306. } else {
  1307. this.menuButton.pauseButton = true
  1308. }
  1309. // 重开
  1310. if (currentRow.closedFlag == 'N' && currentRow.parkFlag == 'Y') {
  1311. this.menuButton.openReverseButton = false
  1312. } else {
  1313. this.menuButton.openReverseButton = true
  1314. }
  1315. // 生产排料
  1316. if (currentRow.matIssueFlag == 'N') {
  1317. // 获取特殊权限
  1318. let data = {
  1319. userSpecialSecurityNo: 238,
  1320. username: this.$store.state.user.name
  1321. }
  1322. getUserSpecialSecurity(data).then(({data}) => {
  1323. if (data.userSpecialSecurity == 'Y') {
  1324. this.menuButton.costRollUpFlagButton = false
  1325. } else {
  1326. this.menuButton.costRollUpFlagButton = true
  1327. }
  1328. })
  1329. } else {
  1330. this.menuButton.costRollUpFlagButton = true
  1331. }
  1332. // 取消生产排料
  1333. if (currentRow.matIssueFlag == 'Y') {
  1334. // 获取特殊权限
  1335. let data = {
  1336. userSpecialSecurityNo: 238,
  1337. username: this.$store.state.user.name
  1338. }
  1339. getUserSpecialSecurity(data).then(({data}) => {
  1340. if (data.userSpecialSecurity == 'Y') {
  1341. this.menuButton.canceledCostRollUpFlagButton = false
  1342. } else {
  1343. this.menuButton.canceledCostRollUpFlagButton = true
  1344. }
  1345. })
  1346. } else {
  1347. this.menuButton.canceledCostRollUpFlagButton = true
  1348. }
  1349. // 刀模已发 确认
  1350. if (currentRow.toolIssueFlag == 'N') {
  1351. // 获取特殊权限
  1352. let data = {
  1353. userSpecialSecurityNo: 258,
  1354. username: this.$store.state.user.name
  1355. }
  1356. getUserSpecialSecurity(data).then(({data}) => {
  1357. if (data.userSpecialSecurity == 'Y') {
  1358. this.menuButton.manualFlagButton = false
  1359. } else {
  1360. this.menuButton.manualFlagButton = true
  1361. }
  1362. })
  1363. } else {
  1364. this.menuButton.manualFlagButton = true
  1365. }
  1366. // 刀模已发 取消
  1367. if (currentRow.toolIssueFlag == 'Y') {
  1368. // 获取特殊权限
  1369. let canceledAllPrdData = {
  1370. userSpecialSecurityNo: 259,
  1371. username: this.$store.state.user.name
  1372. }
  1373. getUserSpecialSecurity(canceledAllPrdData).then(({data}) => {
  1374. if (data.userSpecialSecurity == 'Y') {
  1375. this.menuButton.canceledManualFlagButton = false
  1376. } else {
  1377. this.menuButton.canceledManualFlagButton = true
  1378. }
  1379. })
  1380. } else {
  1381. this.menuButton.canceledManualFlagButton = true
  1382. }
  1383. // 印版已发 确认
  1384. if (currentRow.plateIssueFlag == 'N') {
  1385. // 获取特殊权限
  1386. let data = {
  1387. userSpecialSecurityNo: 259,
  1388. username: this.$store.state.user.name
  1389. }
  1390. getUserSpecialSecurity(data).then(({data}) => {
  1391. if (data.userSpecialSecurity == 'Y') {
  1392. this.menuButton.repairSOFlagButton = false
  1393. } else {
  1394. this.menuButton.repairSOFlagButton = true
  1395. }
  1396. })
  1397. } else {
  1398. this.menuButton.repairSOFlagButton = true
  1399. }
  1400. // 印版已发 取消
  1401. if (currentRow.plateIssueFlag == 'Y') {
  1402. // 获取特殊权限
  1403. let data = {
  1404. userSpecialSecurityNo: 259,
  1405. username: this.$store.state.user.name
  1406. }
  1407. getUserSpecialSecurity(data).then(({data}) => {
  1408. if (data.userSpecialSecurity == 'Y') {
  1409. this.menuButton.canceledRepairSOFlagButton = false
  1410. } else {
  1411. this.menuButton.canceledRepairSOFlagButton = true
  1412. }
  1413. })
  1414. } else {
  1415. this.menuButton.canceledRepairSOFlagButton = true
  1416. }
  1417. this.menuShow = true
  1418. })
  1419. }
  1420. },
  1421. /* 区分不同的菜单 调用不同的方法 调用不同的方法 */
  1422. handleCommand(val) {
  1423. // 区分是哪一个方法调用
  1424. // 页面跳转
  1425. if (val == '0') {
  1426. if (JSON.stringify(this.currentRow) == '{}') {
  1427. this.$message.error(this.labels.pleaseSelectSchedule)
  1428. return false
  1429. }
  1430. this.$router.push({
  1431. path: '/shopOrder-shopOrder/shopOrder',
  1432. query: {
  1433. order: this.currentRow.orderNo,
  1434. site: this.currentRow.site,
  1435. user: this.$store.state.user.name
  1436. }
  1437. })
  1438. }
  1439. if (val === '查看物料库存') {
  1440. // 判断是否选择好了工单
  1441. if (this.currentRow == null || this.currentRow == {}) {
  1442. // 重置按钮
  1443. this.menuButton.partStockFlag = true
  1444. // 返回错误
  1445. this.$message.error(this.labels.pleaseSelectSchedule)
  1446. return false
  1447. }
  1448. let tempData = {'site': this.currentRow.site, 'orderNo': this.currentRow.orderNo}
  1449. // 打开组件 需要的数据 展示需要的数据
  1450. this.$nextTick(() => {
  1451. this.showPartStockFlag = true
  1452. this.$refs.comPartStock.init(tempData)
  1453. })
  1454. }
  1455. // 关闭
  1456. if (val == '1') {
  1457. // 调用提示的方法
  1458. this.$confirm(this.labels.sureCloseThisSchedule, this.labels.closeScheduleLabel, {
  1459. confirmButtonText: this.labels.confirmLabel,
  1460. cancelButtonText: this.labels.cancelLabel,
  1461. type: 'warning'
  1462. }).then(() => {
  1463. let data = {
  1464. username: this.$store.state.user.name,
  1465. itemNo: this.currentRow.itemNo,
  1466. site: this.currentRow.site,
  1467. orderNo: this.currentRow.orderNo,
  1468. seqNo: this.currentRow.seqNo,
  1469. closedFlag: 'Y'
  1470. }
  1471. closeOrOpenProduceOrder(data).then(({data}) => {
  1472. if (data.code == 0) {
  1473. this.$message.success(data.msg)
  1474. } else {
  1475. this.$message.error(data.msg)
  1476. }
  1477. })
  1478. })
  1479. }
  1480. // 打开
  1481. if (val == '2') {
  1482. // 调用提示的方法
  1483. this.$confirm(this.labels.sureOpenThisSchedule, this.labels.closeScheduleLabel, {
  1484. confirmButtonText: this.labels.confirmLabel,
  1485. cancelButtonText: this.labels.cancelLabel,
  1486. type: 'warning'
  1487. }).then(() => {
  1488. let data = {
  1489. username: this.$store.state.user.name,
  1490. itemNo: this.currentRow.itemNo,
  1491. site: this.currentRow.site,
  1492. orderNo: this.currentRow.orderNo,
  1493. seqNo: this.currentRow.seqNo,
  1494. closedFlag: 'N'
  1495. }
  1496. closeOrOpenProduceOrder(data).then(({data}) => {
  1497. if (data.code == 0) {
  1498. this.$message.success(data.msg)
  1499. } else {
  1500. this.$message.error(data.msg)
  1501. }
  1502. })
  1503. })
  1504. }
  1505. // 暂停
  1506. if (val == '3') {
  1507. // 调用提示的方法
  1508. this.$confirm(this.labels.surePauseThisSchedule, this.labels.closeScheduleLabel, {
  1509. confirmButtonText: this.labels.confirmLabel,
  1510. cancelButtonText: this.labels.cancelLabel,
  1511. type: 'warning'
  1512. }).then(() => {
  1513. let data = {
  1514. username: this.$store.state.user.name,
  1515. itemNo: this.currentRow.itemNo,
  1516. site: this.currentRow.site,
  1517. orderNo: this.currentRow.orderNo,
  1518. seqNo: this.currentRow.seqNo,
  1519. parkFlag: 'Y'
  1520. }
  1521. pauseOrOpenProduceOrder(data).then(({data}) => {
  1522. if (data.code == 0) {
  1523. this.$message.success(data.msg)
  1524. } else {
  1525. this.$message.error(data.msg)
  1526. }
  1527. })
  1528. })
  1529. }
  1530. // 重开
  1531. if (val == '4') {
  1532. // 调用提示的方法
  1533. this.$confirm(this.labels.sureReopenThisSchedule, this.labels.closeScheduleLabel, {
  1534. confirmButtonText: this.labels.confirmLabel,
  1535. cancelButtonText: this.labels.cancelLabel,
  1536. type: 'warning'
  1537. }).then(() => {
  1538. let data = {
  1539. username: this.$store.state.user.name,
  1540. itemNo: this.currentRow.itemNo,
  1541. site: this.currentRow.site,
  1542. orderNo: this.currentRow.orderNo,
  1543. seqNo: this.currentRow.seqNo,
  1544. parkFlag: 'N'
  1545. }
  1546. pauseOrOpenProduceOrder(data).then(({data}) => {
  1547. if (data.code == 0) {
  1548. this.$message.success(data.msg)
  1549. } else {
  1550. this.$message.error(data.msg)
  1551. }
  1552. })
  1553. })
  1554. }
  1555. // 创建重检派工单
  1556. if (val == '5') {
  1557. this.$nextTick(() => {
  1558. this.$refs.createRecheck.init(this.currentRow)
  1559. })
  1560. }
  1561. // 取消所有派工单操作
  1562. if (val == '6') {
  1563. // 调用提示的方法
  1564. this.$confirm(this.labels.sureCancelScheduleAllOperations, this.labels.shopOrderLabel, {
  1565. confirmButtonText: this.labels.confirmLabel,
  1566. cancelButtonText: this.labels.cancelLabel,
  1567. type: 'warning'
  1568. }).then(() => {
  1569. let data = {
  1570. orderNo: this.currentRow.orderNo,
  1571. itemNo: this.currentRow.itemNo,
  1572. site: this.currentRow.site,
  1573. seqNo: this.currentRow.seqNo,
  1574. username: this.searchData.username,
  1575. userDisplay: this.searchData.userDisplay
  1576. }
  1577. workbenchCancelallops(data).then(({data}) => {
  1578. if (data.code == 0) {
  1579. this.$message.success(data.msg)
  1580. } else {
  1581. this.$message.warning(data.msg)
  1582. }
  1583. })
  1584. })
  1585. }
  1586. // 生产已排料 确认
  1587. if (val == '7') {
  1588. // 调用提示的方法
  1589. this.$confirm(this.labels.sureThisOrderMaterialIsIssued, this.labels.prodIssued, {
  1590. confirmButtonText: this.labels.confirmLabel,
  1591. cancelButtonText: this.labels.cancelLabel,
  1592. type: 'warning'
  1593. }).then(() => {
  1594. let data = {
  1595. site: this.currentRow.site,
  1596. orderNo: this.currentRow.orderNo,
  1597. itemNo: this.currentRow.itemNo,
  1598. seqNo: this.currentRow.seqNo,
  1599. username: this.$store.state.user.name,
  1600. matIssueFlag: 'Y',
  1601. orderChangeStatus: '订单已排料'
  1602. }
  1603. costRollUpProduceOrder(data).then(({data}) => {
  1604. if (data.code == 0) {
  1605. this.$message.success(data.msg)
  1606. } else {
  1607. this.$message.warning(data.msg)
  1608. }
  1609. })
  1610. })
  1611. }
  1612. // 生产已排料 取消
  1613. if (val == '8') {
  1614. // 调用提示的方法
  1615. this.$confirm(this.labels.sureCancelThisOrderMaterialIssued, this.labels.cancelOrderMaterialIssued, {
  1616. confirmButtonText: this.labels.confirmLabel,
  1617. cancelButtonText: this.labels.cancelLabel,
  1618. type: 'warning'
  1619. }).then(() => {
  1620. let data = {
  1621. site: this.currentRow.site,
  1622. orderNo: this.currentRow.orderNo,
  1623. itemNo: this.currentRow.itemNo,
  1624. seqNo: this.currentRow.seqNo,
  1625. matIssueFlag: 'N',
  1626. orderChangeStatus: '撤销订单排料'
  1627. }
  1628. costRollUpProduceOrder(data).then(({data}) => {
  1629. if (data.code == 0) {
  1630. this.$message.success(data.msg)
  1631. } else {
  1632. this.$message.warning(data.msg)
  1633. }
  1634. })
  1635. })
  1636. }
  1637. // 刀模 确认
  1638. if (val == '9') {
  1639. this.$confirm(this.labels.sureCancelThisOrderToolIssued, this.labels.toolIssued, {
  1640. confirmButtonText: this.labels.confirmLabel,
  1641. cancelButtonText: this.labels.cancelLabel,
  1642. type: 'warning'
  1643. }).then(() => {
  1644. let data = {
  1645. site: this.currentRow.site,
  1646. orderNo: this.currentRow.orderNo,
  1647. itemNo: this.currentRow.itemNo,
  1648. seqNo: this.currentRow.seqNo,
  1649. toolIssueFlag: 'Y',
  1650. orderChangeStatus: '订单刀模已发'
  1651. }
  1652. manualProduceOrder(data).then(({data}) => {
  1653. if (data.code == 0) {
  1654. this.$message.success(data.msg)
  1655. } else {
  1656. this.$message.warning(data.msg)
  1657. }
  1658. })
  1659. })
  1660. }
  1661. // 刀模 取消
  1662. if (val == '10') {
  1663. this.$confirm(this.labels.sureCancelThisOrderToolIssued, this.labels.toolIssued, {
  1664. confirmButtonText: this.labels.confirmLabel,
  1665. cancelButtonText: this.labels.cancelLabel,
  1666. type: 'warning'
  1667. }).then(() => {
  1668. let data = {
  1669. site: this.currentRow.site,
  1670. orderNo: this.currentRow.orderNo,
  1671. itemNo: this.currentRow.itemNo,
  1672. seqNo: this.currentRow.seqNo,
  1673. toolIssueFlag: 'N',
  1674. orderChangeStatus: '撤销订单刀模已发'
  1675. }
  1676. manualProduceOrder(data).then(({data}) => {
  1677. if (data.code == 0) {
  1678. this.$message.success(data.msg)
  1679. } else {
  1680. this.$message.warning(data.msg)
  1681. }
  1682. })
  1683. })
  1684. }
  1685. // 印版已发
  1686. if (val == '11') {
  1687. this.$confirm(this.labels.sureThisOrderPrintIsIssued, this.labels.printIssued, {
  1688. confirmButtonText: this.labels.confirmLabel,
  1689. cancelButtonText: this.labels.cancelLabel,
  1690. type: 'warning'
  1691. }).then(() => {
  1692. let data = {
  1693. site: this.currentRow.site,
  1694. orderNo: this.currentRow.orderNo,
  1695. itemNo: this.currentRow.itemNo,
  1696. seqNo: this.currentRow.seqNo,
  1697. plateIssueFlag: 'Y',
  1698. orderChangeStatus: '订单印版已发'
  1699. }
  1700. repairSOFlagProduceOrder(data).then(({data}) => {
  1701. if (data.code == 0) {
  1702. this.$message.success(data.msg)
  1703. } else {
  1704. this.$message.warning(data.msg)
  1705. }
  1706. })
  1707. })
  1708. }
  1709. // 印版已发 取消
  1710. if (val == '12') {
  1711. this.$confirm(this.labels.sureCancelThisOrderPrintIssued, this.labels.printIssued, {
  1712. confirmButtonText: this.labels.confirmLabel,
  1713. cancelButtonText: this.labels.cancelLabel,
  1714. type: 'warning'
  1715. }).then(() => {
  1716. let data = {
  1717. site: this.currentRow.site,
  1718. orderNo: this.currentRow.orderNo,
  1719. itemNo: this.currentRow.itemNo,
  1720. seqNo: this.currentRow.seqNo,
  1721. plateIssueFlag: 'N',
  1722. orderChangeStatus: '订单印版已发'
  1723. }
  1724. repairSOFlagProduceOrder(data).then(({data}) => {
  1725. if (data.code == 0) {
  1726. this.$message.success(data.msg)
  1727. } else {
  1728. this.$message.warning(data.msg)
  1729. }
  1730. })
  1731. })
  1732. }
  1733. },
  1734. // FQC 报工
  1735. fqcReportModal() {
  1736. // 首先判断是否选择好派工单
  1737. if (JSON.stringify(this.currentRow) == '{}') {
  1738. this.$message.error(this.labels.pleaseSelectSchedule)
  1739. return false
  1740. }
  1741. // 打开操作员切换功能
  1742. this.fqcShowReportFlag = true
  1743. this.$nextTick(() => {
  1744. this.$refs.fqcProduceReportNormal.init(this.currentRow.seqNo, this.operatorData)
  1745. })
  1746. },
  1747. // FQC 分卷
  1748. fqcSplitRollModal() {
  1749. if (JSON.stringify(this.currentRow) == '{}') {
  1750. this.$message.error(this.labels.pleaseSelectSchedule)
  1751. return false
  1752. }
  1753. // 打开操作员切换功能
  1754. this.fqcRollShowReportFlag = true
  1755. this.$nextTick(() => {
  1756. this.$refs.fqcSplitRollReport.init(this.currentRow.seqNo, this.operatorData)
  1757. })
  1758. },
  1759. // 返工重捡
  1760. reworkInspectModal() {
  1761. // 首先判断是否选择好派工单
  1762. if (JSON.stringify(this.currentRow) == '{}') {
  1763. this.$message.error(this.labels.pleaseSelectSchedule)
  1764. return false
  1765. }
  1766. // 打开操作员切换功能
  1767. this.reworkShowReportFlag = true
  1768. this.$nextTick(() => {
  1769. this.$refs.reworkInspectReport.init(this.currentRow.seqNo, this.operatorData)
  1770. })
  1771. },
  1772. // 换包装
  1773. changePackaging() {
  1774. // 首先判断是否选择好派工单
  1775. if (JSON.stringify(this.currentRow) == '{}') {
  1776. this.$message.error(this.labels.pleaseSelectSchedule)
  1777. return false
  1778. }
  1779. // 打开操作员切换功能
  1780. this.changePackagingFlag = true
  1781. this.$nextTick(() => {
  1782. this.$refs.changePackaging.init(this.currentRow.seqNo, this.operatorData)
  1783. })
  1784. },
  1785. /* 查询派工单 */
  1786. getProduceScheduleList() {
  1787. // 校验:派工单号、机台、生产订单号必须填一个
  1788. const hasResourceId = this.searchData.resourceId && this.searchData.resourceId.trim() !== ''
  1789. const hasSeqNo = this.searchData.seqNo && this.searchData.seqNo.trim() !== ''
  1790. const hasOrderNo = this.searchData.orderNo && this.searchData.orderNo.trim() !== ''
  1791. if (!hasResourceId && !hasSeqNo && !hasOrderNo) {
  1792. this.$message.warning('派工单号、机台、生产订单号必须填一个!')
  1793. return
  1794. }
  1795. // 开始真的查询;
  1796. this.searchData.searchFlag = true
  1797. getProduceScheduleList(this.searchData).then(({data}) => {
  1798. // 设置查询数据
  1799. this.produceScheduleList = data.rows
  1800. })
  1801. },
  1802. /* 刷新页面table */
  1803. refreshPageTables() {
  1804. this.currentRow = {}
  1805. this.getProduceScheduleList()
  1806. },
  1807. /* 设置选中行的参数 */
  1808. setCurrentRow(row, column, event) {
  1809. this.currentRow = JSON.parse(JSON.stringify(row))
  1810. },
  1811. // 设置参数
  1812. initOperatorData(operatorData) {
  1813. this.showOperatorFlag = false
  1814. this.operatorData = JSON.parse(JSON.stringify(operatorData))
  1815. if (operatorData.reportType == 0) {
  1816. // 切换到报工组件
  1817. this.switchProduceReportModal()
  1818. }
  1819. if (operatorData.reportType == 1) {
  1820. // 切换到fqc报工组件
  1821. this.fqcReportModal()
  1822. }
  1823. if (operatorData.reportType == 2) {
  1824. // 切换到返工 重检组件
  1825. this.reworkInspectModal()
  1826. }
  1827. if (operatorData.reportType == 3) {
  1828. // 切换到fqc分卷组件
  1829. this.fqcSplitRollModal()
  1830. }
  1831. if (operatorData.reportType == 4) {
  1832. // 换包装
  1833. this.changePackaging()
  1834. }
  1835. /* 分切报工 */
  1836. if (operatorData.reportType == 8) {
  1837. // 分切报工
  1838. this.showSplitOrderReportModal()
  1839. }
  1840. },
  1841. notInitOperatorData(val) {
  1842. // 注意:现在关闭对话框时会自动设置为当前登录人,不再清空操作员信息
  1843. // 关闭切换用户模态框
  1844. this.showOperatorFlag = false
  1845. if (val == 0) {
  1846. // 切换到报工组件
  1847. this.switchProduceReportModal()
  1848. }
  1849. if (val == 1) {
  1850. // 切换到fqc报工组件
  1851. this.fqcReportModal()
  1852. }
  1853. if (val == 2) {
  1854. // 切换到返工 重检组件
  1855. this.reworkInspectModal()
  1856. }
  1857. if (val == 3) {
  1858. // 切换到fqc分卷组件
  1859. this.fqcSplitRollModal()
  1860. }
  1861. if (val == 4) {
  1862. // 切换到换包装
  1863. this.changePackaging()
  1864. }
  1865. // 分切报工
  1866. if (val == 8) {
  1867. // 分切报工
  1868. this.showSplitOrderReportModal()
  1869. }
  1870. },
  1871. // 切换员工modal
  1872. switchOperatorModal(val) {
  1873. // 首先判断是否选择好派工单
  1874. if (JSON.stringify(this.currentRow) == '{}') {
  1875. this.$message.error(this.labels.pleaseSelectSchedule)
  1876. return false
  1877. }
  1878. //获取下一道工序
  1879. let nextItemNo = this.currentRow.nextItemNo;
  1880. if (val == 0) {
  1881. let orderType = this.currentRow.orderType
  1882. let workCenterNo = this.currentRow.workCenterNo
  1883. // if (orderType != 'S' || workCenterNo === 'FQC' || nextItemNo == 0) {
  1884. // // 验证通过
  1885. // this.$message.error(this.labels.thisScheduleCantReport)
  1886. // return false
  1887. // }
  1888. let data = {
  1889. site: this.currentRow.site,
  1890. resourceId: this.currentRow.resourceId,
  1891. workCenterNo: this.currentRow.workCenterNo,
  1892. seqNo: this.currentRow.seqNo,
  1893. username: this.$store.state.user.name
  1894. }
  1895. reportCheck(data).then(({data}) => {
  1896. if (data.code == 0) {
  1897. // 打开操作员切换功能
  1898. this.showOperatorFlag = true
  1899. this.$nextTick(() => {
  1900. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1901. })
  1902. }
  1903. if (data.code == 300) {
  1904. this.$message.warning(data.msg)
  1905. }
  1906. if (data.code == 400) {
  1907. this.$confirm(`${data.msg}`, '提示', {
  1908. confirmButtonText: this.labels.confirmLabel,
  1909. cancelButtonText: this.labels.cancelLabel,
  1910. type: 'warning'
  1911. }).then(() => {
  1912. // 打开操作员切换功能
  1913. this.showOperatorFlag = true
  1914. this.$nextTick(() => {
  1915. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1916. })
  1917. })
  1918. }
  1919. })
  1920. } else if (val == 8) { // 处理 分切工单
  1921. // 判断当前工单是否是分切工单
  1922. let orderType = this.currentRow.orderType
  1923. if (orderType === 'D') {
  1924. this.showOperatorFlag = true
  1925. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1926. } else {
  1927. this.$message.error(this.labels.thisOrderIsNotSplitOrder)
  1928. return false
  1929. }
  1930. } else if (val == 1) { // 处理 FQC
  1931. // 判断订单类型和加工中心
  1932. let workCenterNo = this.currentRow.workCenterNo
  1933. if (workCenterNo === 'FQC' || nextItemNo == 0) {
  1934. this.showOperatorFlag = true
  1935. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1936. } else {
  1937. this.$message.error(this.labels.thisScheduleIsNotFqc)
  1938. return false
  1939. }
  1940. } else {
  1941. if (val == 4) {
  1942. getShopOrder(this.currentRow).then(({data}) => {
  1943. if (data.code == 0) {
  1944. if (data.data == 'P') {
  1945. // 打开操作员切换功能
  1946. this.showOperatorFlag = true
  1947. this.$nextTick(() => {
  1948. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1949. })
  1950. } else {
  1951. this.$alert(this.labels.thisOrderIsNotSpecialOrder, '提示', {
  1952. confirmButtonText: this.labels.confirmLabel
  1953. })
  1954. }
  1955. }
  1956. })
  1957. } else {
  1958. // 打开操作员切换功能
  1959. this.showOperatorFlag = true
  1960. this.$nextTick(() => {
  1961. this.$refs.comSwitchOperator.init(val, this.currentRow, false, false)
  1962. })
  1963. }
  1964. }
  1965. },
  1966. // 切换报工modal
  1967. switchProduceReportModal() {
  1968. // 首先判断是否选择好派工单
  1969. if (JSON.stringify(this.currentRow) == '{}') {
  1970. this.$message.error(this.labels.pleaseSelectSchedule)
  1971. return false
  1972. }
  1973. // 打开操作员切换功能
  1974. this.showReportFlag = true
  1975. this.$nextTick(() => {
  1976. this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData)
  1977. })
  1978. },
  1979. // 打开分切报工的
  1980. showSplitOrderReportModal() {
  1981. // 首先判断是否选择好派工单
  1982. if (JSON.stringify(this.currentRow) == '{}') {
  1983. this.$message.error(this.labels.pleaseSelectSchedule)
  1984. return false
  1985. }
  1986. this.$nextTick(() => {
  1987. // 打开分切报工功能
  1988. this.showSplitReportFlag = true
  1989. this.$refs.comSplitOrderReport.init(this.currentRow.seqNo, this.operatorData)
  1990. })
  1991. },
  1992. // 打开结束派工单的modal
  1993. showFinishScheduleModal() {
  1994. // 首先判断是否选择好派工单
  1995. if (JSON.stringify(this.currentRow) == '{}') {
  1996. this.$message.error(this.labels.pleaseSelectSchedule)
  1997. return false
  1998. }
  1999. // 打开操作员切换功能
  2000. this.showFinishScheduleFlag = true
  2001. this.$nextTick(() => {
  2002. this.$refs.comFinishSchedule.init(this.currentRow, this.operatorData)
  2003. })
  2004. },
  2005. // 结束派工单后刷新页面
  2006. processFinishScheduleOperation() {
  2007. // 刷新当前页面的数据
  2008. this.refreshPageTables()
  2009. },
  2010. // 保存操作员的信息
  2011. saveOperatorData() {
  2012. // 查询操作员信息
  2013. getOperatorData(this.operatorData).then(({data}) => {
  2014. let operatorData = data.row
  2015. let status = operatorData.status
  2016. this.operatorData.operatorName = data.row.operatorName
  2017. // 重置操作员信息状态
  2018. this.operatorData.status = status
  2019. // 判断是否验证通过
  2020. if (status == 'N') {
  2021. this.operatorFlag = false
  2022. } else {
  2023. this.operatorFlag = true
  2024. }
  2025. if (!this.operatorFlag) {
  2026. this.$message.error(this.labels.operatorCantBeUsed)
  2027. }
  2028. })
  2029. // 判断是否检查通过--不通过不在继续
  2030. .then(() => {
  2031. if (!this.operatorFlag) {
  2032. return false
  2033. }
  2034. // 关闭操作员切换功能
  2035. this.operatorData.showFlag = false
  2036. // 打开组件
  2037. this.showReportFlag = true
  2038. // 打开报工操作页面
  2039. this.$nextTick(() => {
  2040. this.$refs.comProduceReportNormal.init(this.currentRow.seqNo, this.operatorData)
  2041. })
  2042. })
  2043. },
  2044. /* 列表方法的回调 */
  2045. getBaseData(val) {
  2046. if (this.tagNo === 95) {
  2047. this.searchData.resourceId = val.ResourceID
  2048. }
  2049. },
  2050. // 获取基础数据列表
  2051. getBaseList(val) {
  2052. this.tagNo = val
  2053. this.$nextTick(() => {
  2054. let strVal = ''
  2055. if (val === 95) {
  2056. strVal = this.searchData.resourceId
  2057. }
  2058. this.$refs.baseList.init(val, strVal, " AND WorkCenterNo <> 'FQC'")
  2059. })
  2060. },
  2061. // 打开页面设置
  2062. userSetting() {
  2063. this.visible = true
  2064. let queryTable = {
  2065. userId: this.$store.state.user.name,
  2066. functionId: this.$route.meta.menuId,
  2067. tableId: '5302Produce',
  2068. languageCode: this.$i18n.locale
  2069. }
  2070. this.$nextTick(() => {
  2071. this.$refs.column.init(queryTable)
  2072. })
  2073. },
  2074. // 获取 用户保存的 格式列
  2075. getTableUserColumn() {
  2076. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  2077. if (data && data.code == 0 && data.rows.length > 0) {
  2078. // this.columnList = []
  2079. this.columnList = data.rows
  2080. } else {
  2081. this.getColumnList()
  2082. }
  2083. })
  2084. },
  2085. // 保存 默认配置 列
  2086. async saveColumnList() {
  2087. // 删除所有的该页面下保存的数据
  2088. if (this.userColumnList) {
  2089. // 删除 user自定义的数据
  2090. await removerUser(this.queryTable)
  2091. }
  2092. // 删除默认配置
  2093. await removerDefault(this.queryTable)
  2094. // 保存页面 table属性
  2095. let sumColumnList = this.columnList// concat(this.columnList1);
  2096. sumColumnList = sumColumnList.map(item => {
  2097. return item = {
  2098. tableId: item.tableId,
  2099. tableName: item.tableName,
  2100. columnProp: item.columnProp,
  2101. columnLabel: item.columnLabel,
  2102. columnHidden: item.columnHidden,
  2103. columnImage: item.columnImage,
  2104. columnSortable: item.columnSortable,
  2105. columnWidth: item.columnWidth,
  2106. format: item.format,
  2107. functionId: this.$route.meta.menuId,
  2108. sortLv: item.sortLv,
  2109. status: true,
  2110. fixed: item.fixed,
  2111. serialNumber: item.serialNumber,
  2112. columnType: item.columnType,
  2113. align: item.align
  2114. }
  2115. })
  2116. await saveTableDefaultList(sumColumnList)
  2117. // 保存页面 button label title 属性
  2118. /* let buttons = this.buttonList.map(item => {
  2119. return item = {
  2120. functionId: this.$route.meta.menuId,
  2121. languageValue: item.languageValue,
  2122. objectId: item.objectId,
  2123. objectType: item.objectType,
  2124. tableId: item.tableId
  2125. }
  2126. })
  2127. await saveButtonList(buttons) */
  2128. this.getFunctionButtonList()
  2129. this.getColumnList()
  2130. },
  2131. // 获取 tableDefault 列
  2132. getColumnList() {
  2133. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  2134. if (data && data.code == 0) {
  2135. // this.showDefault = false
  2136. this.columnList = data.rows
  2137. } else {
  2138. // this.showDefault = true
  2139. }
  2140. })
  2141. },
  2142. //获取按钮的权限数据
  2143. getButtonAuthData() {
  2144. let updateFlag = this.isAuth(this.menuId + ":revise");
  2145. let fullControFlag = this.isAuth(this.menuId + ":fullContro");
  2146. let deleteFlag = this.isAuth(this.menuId + ":remove");
  2147. //处理页面的权限数据
  2148. this.authEdit = !updateFlag && !fullControFlag;
  2149. this.authAdd = !fullControFlag;
  2150. this.authDelete = !deleteFlag;
  2151. },
  2152. //获取多语言的信息
  2153. getMultiLanguageList() {
  2154. //首先查询当前按钮的多语言
  2155. searchFunctionButtonList(this.queryButton).then(({data}) => {
  2156. if (data && data.code == 0) {
  2157. this.buttons = data.data
  2158. } else {
  2159. // saveButtonList(this.buttonList).then(({data}) => {
  2160. // })
  2161. }
  2162. });
  2163. //其次查询当前标签的多语言
  2164. searchFunctionButtonList(this.queryLabel).then(({data}) => {
  2165. if (data && data.code == 0) {
  2166. this.labels = data.data
  2167. } else {
  2168. // saveButtonList(this.buttonList).then(({data}) => {
  2169. // })
  2170. }
  2171. });
  2172. },
  2173. fields() {
  2174. let json = "{"
  2175. this.columnList.forEach((item, index) => {
  2176. if (index == this.columnList.length - 1) {
  2177. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  2178. } else {
  2179. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  2180. }
  2181. })
  2182. json += "}"
  2183. let s = eval("(" + json + ")")
  2184. return s
  2185. },
  2186. //导出excel
  2187. async createExportData() {
  2188. // 校验:派工单号、机台、生产订单号必须填一个
  2189. const hasResourceId = this.searchData.resourceId && this.searchData.resourceId.trim() !== ''
  2190. const hasSeqNo = this.searchData.seqNo && this.searchData.seqNo.trim() !== ''
  2191. const hasOrderNo = this.searchData.orderNo && this.searchData.orderNo.trim() !== ''
  2192. if (!hasResourceId && !hasSeqNo && !hasOrderNo) {
  2193. this.$message.warning('派工单号、机台、生产订单号必须填一个!')
  2194. return []
  2195. }
  2196. // 开始真的查询;
  2197. this.searchData.searchFlag = true;
  2198. this.searchData.exportFlag = "Y";
  2199. await getProduceScheduleList(this.searchData).then(({data}) => {
  2200. // 设置查询数据
  2201. this.exportList = data.rows
  2202. })
  2203. //重置判断是否是导出的sql
  2204. this.searchData.exportFlag = "N";
  2205. return this.exportList;
  2206. },
  2207. startDownload() {
  2208. this._exportLoading = this.$loading({
  2209. lock: true,
  2210. text: '正在导出数据,请稍候...',
  2211. spinner: 'el-icon-loading',
  2212. background: 'rgba(0, 0, 0, 0.7)'
  2213. })
  2214. },
  2215. finishDownload() {
  2216. if (this._exportLoading) {
  2217. this._exportLoading.close()
  2218. this._exportLoading = null
  2219. }
  2220. },
  2221. },
  2222. created() {
  2223. // 根据登陆人员的username 查询机台授权表中的权限,筛选出对应的机台(默认第一个)
  2224. let tempData = {
  2225. username: this.$store.state.user.name,
  2226. }
  2227. getResourceByUser(tempData).then(({data}) => {
  2228. if (data.code === 0) {
  2229. if (data.rows.length > 0) {
  2230. this.searchData.resourceId = data.rows[0].resourceID
  2231. }
  2232. }
  2233. // 等待getResourceByUser执行完成后,再查询生产排程列表
  2234. // 只有当机台编号、派工单号或生产订单号有值时才查询
  2235. const hasResourceId = this.searchData.resourceId && this.searchData.resourceId.trim() !== ''
  2236. const hasSeqNo = this.searchData.seqNo && this.searchData.seqNo.trim() !== ''
  2237. const hasOrderNo = this.searchData.orderNo && this.searchData.orderNo.trim() !== ''
  2238. if (hasResourceId || hasSeqNo || hasOrderNo) {
  2239. this.searchData.searchFlag = true;
  2240. getProduceScheduleList(this.searchData).then(({data}) => {
  2241. // 设置查询数据
  2242. this.searchData.exportFlag = 'N';
  2243. this.produceScheduleList = data.rows
  2244. })
  2245. }
  2246. })
  2247. /* 获取报工的特殊权限 */
  2248. getScheduleMultiReportSpecialAuth(this.searchData).then(({data}) => {
  2249. let authMap = data.authMap
  2250. // 区分是否打开按钮
  2251. if (authMap.normalReportFlag === 'Y') {
  2252. this.reportButton.normalReportButton = false
  2253. } else {
  2254. this.reportButton.normalReportButton = true
  2255. }
  2256. if (authMap.fqcReportFlag === 'Y') {
  2257. this.reportButton.fqcReportButton = false
  2258. } else {
  2259. this.reportButton.fqcReportButton = true
  2260. }
  2261. if (authMap.reworkReportFlag === 'Y') {
  2262. this.reportButton.reworkReportButton = false
  2263. } else {
  2264. this.reportButton.reworkReportButton = true
  2265. }
  2266. if (authMap.packReportFlag === 'Y') {
  2267. this.reportButton.packReportButton = false
  2268. } else {
  2269. this.reportButton.packReportButton = true
  2270. }
  2271. if (authMap.fqcSegmentReportFlag === 'Y') {
  2272. this.reportButton.fqcSegmentReportButton = false
  2273. } else {
  2274. this.reportButton.fqcSegmentReportButton = true
  2275. }
  2276. if (authMap.slitReportFlag === 'Y') {
  2277. this.reportButton.slitReportButton = false
  2278. } else {
  2279. this.reportButton.slitReportButton = true
  2280. }
  2281. })
  2282. // 获取动态表头的信息
  2283. // this.getTableUserColumn()
  2284. //获取按钮的权限
  2285. this.getButtonAuthData();
  2286. //
  2287. // this.getMultiLanguageList(); //刷新多语言的信息
  2288. }
  2289. }
  2290. </script>
  2291. <style>
  2292. .el-textarea__inner {
  2293. padding: 5px 5px;
  2294. }
  2295. </style>
  2296. <!--当前页面的标签样式-->
  2297. <style scoped lang="scss">
  2298. /*针对el-card*/
  2299. .customer-card .el-form-item__content {
  2300. margin-top: -15px;
  2301. }
  2302. .customer-card .el-form-item {
  2303. height: 22px;
  2304. }
  2305. .customer-border .el-form-item__content {
  2306. margin-top: -30px;
  2307. }
  2308. /*全局年与日类型 宽度*/
  2309. div.el-time-width {
  2310. width: 110px !important;
  2311. }
  2312. /* 全局时间右边框*/
  2313. .customer-css input.el-input__inner {
  2314. height: 22px !important;
  2315. padding-right: 0px !important;
  2316. }
  2317. /* 控制el-card标签的数据*/
  2318. div.customer-el-card {
  2319. margin-left: 110px;
  2320. margin-top: -15px;
  2321. height: 20px;
  2322. width: 60px;
  2323. }
  2324. /* 颜色控制 */
  2325. div.customer-el-card-pink {
  2326. background: #FF00FF;
  2327. }
  2328. div.customer-el-card-orange {
  2329. background: #FFD700;
  2330. }
  2331. div.customer-el-card-blue {
  2332. background: #0000CD;
  2333. }
  2334. /*清掉样式*/
  2335. .el-radio + .el-radio {
  2336. margin-left: 0px;
  2337. }
  2338. /*当前按钮的通用样式*/
  2339. .customer-css .customer-bun-mid {
  2340. width: 65px;
  2341. text-align: center;
  2342. }
  2343. /*当前按钮的通用样式*/
  2344. .customer-css .el-button--medium {
  2345. padding: 5px 5px;
  2346. }
  2347. /*添加主菜单和明细菜单的样式*/
  2348. .customer-css .customer-dropdown .el-button--primary {
  2349. padding: 2px;
  2350. font-size: 12px;
  2351. }
  2352. .el-dropdown-menu--medium .el-dropdown-menu__item {
  2353. line-height: 18px;
  2354. padding: 0 17px;
  2355. font-size: 12px;
  2356. }
  2357. hr {
  2358. margin-top: 0px;
  2359. }
  2360. /*控制上下间距*/
  2361. </style>