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.

1783 lines
54 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="customer-css">
  3. <!-- 查询时间和产品 -->
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  5. <el-row>
  6. <el-form-item :label=labels.enterDate>
  7. <el-date-picker class="el-time-width"
  8. style=""
  9. v-model="pageData.enterTime1"
  10. value-format="yyyy-MM-dd">
  11. </el-date-picker>
  12. </el-form-item>
  13. <el-form-item :label="''" style="margin-top: -10px;">
  14. <el-date-picker class="el-time-width"
  15. style="margin-top: 30px;"
  16. v-model="pageData.enterTime2"
  17. value-format="yyyy-MM-dd" placeholder="">
  18. </el-date-picker>
  19. </el-form-item>
  20. <el-form-item :label=labels.orderNo>
  21. <el-input v-model="pageData.orderNo" style="width: 120px"></el-input>
  22. </el-form-item>
  23. <el-form-item :label=labels.siteNo>
  24. <el-input v-model="pageData.site" style="width: 120px"></el-input>
  25. </el-form-item>
  26. </el-row>
  27. <el-row>
  28. <el-form-item :label=labels.needDate>
  29. <el-date-picker class="el-time-width"
  30. style=""
  31. v-model="pageData.needTime1"
  32. value-format="yyyy-MM-dd" placeholder="">
  33. </el-date-picker>
  34. </el-form-item>
  35. <el-form-item :label="''" style="margin-top: -10px;">
  36. <el-date-picker class="el-time-width"
  37. style="margin-top: 30px;"
  38. v-model="pageData.needTime2"
  39. value-format="yyyy-MM-dd" placeholder="">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item>
  43. <span slot="label" style="" @click="getBaseList(88)"><a herf="#">{{ labels.resourceId }}</a></span>
  44. <el-input v-model="pageData.resourceId" style="width: 120px"></el-input>
  45. </el-form-item>
  46. <el-form-item>
  47. <span slot="label" style="" @click="getBaseList(24)"><a herf="#">{{ labels.workCenterNo }}</a></span>
  48. <el-input v-model="pageData.workCenterNo" style="width: 120px"></el-input>
  49. </el-form-item>
  50. </el-row>
  51. </el-form>
  52. <!-- 排序规则 -->
  53. <fieldset class="customer-field" style="margin-left: 520px; margin-top: -75px; width: 135px;">
  54. <legend>{{ labels.sortNo }}</legend>
  55. <br>
  56. <el-form :inline="true" style="margin-top: -10px; margin-bottom: 10px;" label-position="top" label-width="100px">
  57. <el-form-item :label="''" style="margin-bottom: 10px;">
  58. <el-radio-group v-model="pageData.sortField">
  59. <el-radio label="needDate">{{ labels.sortNeedDate }}</el-radio>
  60. <el-radio label="orderNo">{{ labels.sortOrderNo }}</el-radio>
  61. <el-radio label="partNo">{{ labels.sortPartNo }}</el-radio>
  62. </el-radio-group>
  63. </el-form-item>
  64. </el-form>
  65. </fieldset>
  66. <!-- 菜单 -->
  67. <el-form :inline="true" label-position="top" label-width="100px"
  68. style="margin-left: 660px; margin-top: -40px;">
  69. <el-row>
  70. <el-col :span="24">
  71. <el-form-item :label="''">
  72. <el-form-item :label="''" style="margin-left: 30px;">
  73. <el-button class="customer-bun-min" type="primary" @click="refreshPageTables"
  74. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.refreshButton }}
  75. </el-button>
  76. <el-button :disabled="dataListSelections.length <= 0" type="primary" @click="scheduleBatchDialog()"
  77. style="margin-left: 10px; margin-bottom: 5px;">{{ buttons.scheduleBatch }}
  78. </el-button>
  79. </el-form-item>
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. </el-form>
  84. <!-- 工单主表信息 -->
  85. <el-main style="margin-top: 25px; padding: 0px; width: 100%;">
  86. <el-form :inline="true" label-position="top" label-width="100px">
  87. <el-form-item :label=labels.primaryRecord>
  88. </el-form-item>
  89. <el-dropdown trigger="click" class="customer-dropdown" size="small" @command="orderHandleCommand">
  90. <el-button type="primary" :disabled="authEdit" @click="controlPrimaryMenuBun">
  91. {{ buttons.primaryMenu }}<i class="el-icon-arrow-down el-icon--right"></i>
  92. </el-button>
  93. <el-dropdown-menu slot="dropdown">
  94. <el-dropdown-item class="customer-li" command="生产工单"
  95. :disabled="primaryMenuButton.shopOrderFlag">{{ buttons.shopOrder }}
  96. </el-dropdown-item>
  97. <hr width="95%"/>
  98. <el-dropdown-item class="customer-li" command="查看物料库存"
  99. :disabled="primaryMenuButton.partStockFlag">{{ buttons.viewPartStock }}
  100. </el-dropdown-item>
  101. </el-dropdown-menu>
  102. </el-dropdown>
  103. <el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button>
  104. </el-form>
  105. <el-table
  106. :height="height"
  107. :data="shopOrderList"
  108. border
  109. ref="routingTable"
  110. highlight-current-row
  111. @selection-change="handleSelectionChange"
  112. @row-click="setCurrentRoutingRow"
  113. :row-class-name="routingRowClassName"
  114. @row-dblclick="startScheduleOperation"
  115. v-loading="dataListLoading"
  116. style="margin-top: -20px; width: 100%;">
  117. <el-table-column
  118. type="selection"
  119. header-align="center"
  120. fixed="left"
  121. align="center"
  122. width="55">
  123. </el-table-column>
  124. <el-table-column
  125. v-for="(item,index) in columnList" :key="index"
  126. :sortable="item.columnSortable"
  127. :prop="item.columnProp"
  128. :header-align="item.headerAlign"
  129. :show-overflow-tooltip="item.showOverflowTooltip"
  130. :align="item.align"
  131. :fixed="item.fixed==''?false:item.fixed"
  132. :width="item.columnWidth"
  133. :label="item.columnLabel">
  134. <template slot-scope="scope">
  135. <span v-if="!item.columnHidden && item.columnProp == 'resourceList'">
  136. <el-select class="table-select-input" v-model="scope.row.resourceId">
  137. <el-option v-for="(item,index) in scope.row.resourceList.split(';')" :key="index"
  138. :value="item.split(':')[0]" :label="item.split(':')[1]">
  139. </el-option>
  140. </el-select>
  141. </span>
  142. <span v-if="!item.columnHidden && item.columnProp == 'qtyToSchedule'">
  143. <el-input v-model="scope.row.qtyToSchedule" type="number">
  144. </el-input>
  145. </span>
  146. <span v-else> {{ scope.row[item.columnProp] }}</span>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. </el-main>
  151. <!--列表的组件-->
  152. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  153. <!-- 物料库存查询 -->
  154. <comPartStock ref="comPartStock" :close-on-click-modal="false"
  155. :visible.sync="showPartStockFlag">
  156. </comPartStock>
  157. <!-- 物料库存查询 -->
  158. <comScheduleOrderExpand ref="comScheduleOrderExpand" :close-on-click-modal="false"
  159. :visible.sync="showScheduleOrderFlag"
  160. @refreshPageTables="refreshPageTables">
  161. </comScheduleOrderExpand>
  162. <!-- 动态列 -->
  163. <column v-if="visible" ref="column" @refreshData="getTableUserColumn" v-drag></column>
  164. <el-dialog
  165. width="702px"
  166. :title="'已选工单'"
  167. :close-on-click-modal="false"
  168. :visible.sync="scheduleVisible">
  169. <el-row>
  170. <el-col :span="24">
  171. <el-form :inline="true" label-position="top" style="height: 60px;"
  172. label-width="80px">
  173. <el-form-item :label=labels.scheduledDate>
  174. <el-date-picker class="el-time-width"
  175. style=""
  176. v-model="scheduleDate"
  177. value-format="yyyy-MM-dd">
  178. </el-date-picker>
  179. </el-form-item>
  180. <el-form-item :label="''" style="margin-top: -5px;">
  181. <el-checkbox v-model="specifiedTime" true-label="Y" false-label="N"
  182. style="margin-top: 28px; margin-right: -20px;"></el-checkbox>
  183. <el-time-picker
  184. format="HH:mm"
  185. style="margin-top: 30px; width: 65px"
  186. v-model="scheduleTime"
  187. value-format="HH:mm">
  188. </el-time-picker>
  189. </el-form-item>
  190. </el-form>
  191. </el-col>
  192. </el-row>
  193. <el-row>
  194. <el-col :span="24">
  195. <el-table
  196. :height="300"
  197. :data="dataListSelections"
  198. border
  199. style="margin-top: -15px; width: 100%;">
  200. <el-table-column
  201. v-for="(item,index) in scheduleColumnList" :key="index"
  202. :sortable="item.columnSortable"
  203. :prop="item.columnProp"
  204. :header-align="item.headerAlign"
  205. :show-overflow-tooltip="item.showOverflowTooltip"
  206. :align="item.align"
  207. :fixed="item.fixed==''?false:item.fixed"
  208. :width="item.columnWidth"
  209. :label="item.columnLabel">
  210. <template slot-scope="scope">
  211. <span v-if="!item.columnHidden">
  212. {{ scope.row[item.columnProp] }}
  213. </span>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. </el-col>
  218. </el-row>
  219. <span slot="footer" class="dialog-footer">
  220. <el-button type="primary" @click="batchScheduleOrderWithExpandStart()">确定</el-button>
  221. <el-button type="primary" @click="scheduleVisible = false">取消</el-button>
  222. </span>
  223. </el-dialog>
  224. </div>
  225. </template>
  226. <script>
  227. import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
  228. import comPartStock from "../common/com_part_stock";/*展示物料库存的组件*/
  229. import comScheduleOrderExpand from '@/views/modules/schedule/com_schedule_order_expand';/*排产扩展 排产单个工单*/
  230. import column from '@/views/modules/common/column';/*动态表头*/
  231. import {
  232. getShopOrderList,
  233. getCurrentWorkCenterNoByResourceId,
  234. batchScheduleOrderWithExpand
  235. } from '@/api/schedule/order_schedule_expand.js';
  236. /*动态表头*/
  237. import {
  238. saveTableDefaultList,
  239. getTableDefaultListLanguage,
  240. getTableUserListLanguage,
  241. removerDefault,
  242. removerUser
  243. } from "@/api/table.js";
  244. import {
  245. searchSysLanguagePackList,
  246. searchSysLanguageParam,
  247. searchFunctionButtonList,
  248. saveButtonList,
  249. searchSysLanguage,
  250. searchLanguageListByLanguageCode,
  251. saveSysLanguageOne,
  252. searchPageLanguageData,
  253. removerLanguage,
  254. saveSysLanguageList
  255. } from "@/api/sysLanguage.js";
  256. var functionId = '104002004';
  257. export default {
  258. data() {
  259. return {
  260. height: 200,
  261. tagNo: '',
  262. authEdit: false,
  263. authAdd: false,
  264. authDelete: false,
  265. scheduleVisible: false,
  266. scheduleDate: this.dayjs().format('YYYY-MM-DD'),
  267. specifiedTime: 'N',
  268. scheduleTime: '08:30',
  269. dataListSelections: [],
  270. scheduleColumnList: [
  271. {
  272. userId: this.$store.state.user.name,
  273. functionId: 5301,
  274. serialNumber: '5301OrderOrderNo',
  275. tableId: "5301Order",
  276. tableName: "工单表",
  277. columnProp: "orderNo",
  278. headerAlign: "center",
  279. align: "center",
  280. columnLabel: "订单号",
  281. columnWidth: 80,
  282. columnHidden: false,
  283. columnImage: false,
  284. columnSortable: true,
  285. sortLv: 0,
  286. status: true,
  287. fixed: false
  288. },
  289. {
  290. userId: this.$store.state.user.name,
  291. functionId: 5301,
  292. serialNumber: '5301OrderItemNo',
  293. tableId: "5301Order",
  294. tableName: "工单表",
  295. columnProp: "itemNo",
  296. headerAlign: "center",
  297. align: "center",
  298. columnLabel: "工序号",
  299. columnWidth: 80,
  300. columnHidden: false,
  301. columnImage: false,
  302. columnSortable: true,
  303. sortLv: 0,
  304. status: true,
  305. fixed: false
  306. },
  307. {
  308. userId: this.$store.state.user.name,
  309. functionId: 5301,
  310. serialNumber: '5301OrderItemDesc',
  311. tableId: "5301Order",
  312. tableName: "工单表",
  313. columnProp: "itemDesc",
  314. headerAlign: "center",
  315. align: "center",
  316. columnLabel: "工序名称",
  317. columnWidth: 100,
  318. columnHidden: false,
  319. columnImage: false,
  320. columnSortable: true,
  321. sortLv: 0,
  322. status: true,
  323. fixed: false
  324. },
  325. {
  326. userId: this.$store.state.user.name,
  327. functionId: 5301,
  328. serialNumber: '5301OrderPartNo',
  329. tableId: "5301Order",
  330. tableName: "工单表",
  331. columnProp: "partNo",
  332. headerAlign: "center",
  333. align: "center",
  334. columnLabel: "产品编码",
  335. columnWidth: 100,
  336. columnHidden: false,
  337. columnImage: false,
  338. columnSortable: true,
  339. sortLv: 0,
  340. status: true,
  341. fixed: false
  342. },
  343. {
  344. userId: this.$store.state.user.name,
  345. functionId: 5301,
  346. serialNumber: '5301OrderQtyToSchedule',
  347. tableId: "5301Order",
  348. tableName: "工单表",
  349. columnProp: "qtyToSchedule",
  350. headerAlign: "center",
  351. align: "center",
  352. columnLabel: "待排产数量",
  353. columnWidth: 120,
  354. columnHidden: false,
  355. columnImage: false,
  356. columnSortable: true,
  357. sortLv: 0,
  358. status: true,
  359. fixed: false
  360. },
  361. {
  362. userId: this.$store.state.user.name,
  363. functionId: 5301,
  364. serialNumber: '5301OrderWorkCenterNo',
  365. tableId: "5301Order",
  366. tableName: "工单表",
  367. columnProp: "workCenterNo",
  368. headerAlign: "center",
  369. align: "center",
  370. columnLabel: "加工中心",
  371. columnWidth: 100,
  372. columnHidden: false,
  373. columnImage: false,
  374. columnSortable: true,
  375. sortLv: 0,
  376. status: true,
  377. fixed: false
  378. },
  379. {
  380. userId: this.$store.state.user.name,
  381. functionId: 5301,
  382. serialNumber: '5301OrderWorkCenterNo',
  383. tableId: "5301Order",
  384. tableName: "工单表",
  385. columnProp: "resourceId",
  386. headerAlign: "center",
  387. align: "center",
  388. columnLabel: "机台",
  389. columnWidth: 100,
  390. columnHidden: false,
  391. columnImage: false,
  392. columnSortable: true,
  393. sortLv: 0,
  394. status: true,
  395. fixed: false
  396. },
  397. ],
  398. menuId: this.$route.meta.menuId,
  399. showDefault: false,
  400. visible: false,
  401. showPartStockFlag: false,
  402. showScheduleOrderFlag: false,
  403. currentRoutingRow: {},
  404. pageData: {
  405. site: this.$store.state.user.site,
  406. username: this.$store.state.user.name,
  407. orderNo: '',
  408. itemNo: '',
  409. seqNo: 0,
  410. resourceId: '',
  411. workCenterNo: '',
  412. enterTime1: '',
  413. enterTime2: '',
  414. needTime1: '',
  415. needTime2: '',
  416. scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
  417. scheduleTime: '08:30',
  418. specifiedTime: 'N',
  419. scheduledQty: 0,
  420. waitTimes: 0,
  421. scheduleSeqNo: 0,
  422. planStartTime: '',
  423. calendarId: '',
  424. calendarDesc: '',
  425. status: 1,
  426. sortField: 'needDate'
  427. },
  428. shopOrderList: [],
  429. dataListLoading: false,
  430. columnList: [
  431. {
  432. userId: this.$store.state.user.name,
  433. functionId: 5301,
  434. serialNumber: '5301OrderOrderNo',
  435. tableId: "5301Order",
  436. tableName: "工单表",
  437. columnProp: "orderNo",
  438. headerAlign: "center",
  439. align: "center",
  440. columnLabel: "订单号",
  441. columnWidth: 80,
  442. columnHidden: false,
  443. columnImage: false,
  444. columnSortable: true,
  445. sortLv: 0,
  446. status: true,
  447. fixed: false
  448. },
  449. {
  450. userId: this.$store.state.user.name,
  451. functionId: 5301,
  452. serialNumber: '5301OrderItemNo',
  453. tableId: "5301Order",
  454. tableName: "工单表",
  455. columnProp: "itemNo",
  456. headerAlign: "center",
  457. align: "center",
  458. columnLabel: "工序号",
  459. columnWidth: 80,
  460. columnHidden: false,
  461. columnImage: false,
  462. columnSortable: true,
  463. sortLv: 0,
  464. status: true,
  465. fixed: false
  466. },
  467. {
  468. userId: this.$store.state.user.name,
  469. functionId: 5301,
  470. serialNumber: '5301OrderItemDesc',
  471. tableId: "5301Order",
  472. tableName: "工单表",
  473. columnProp: "itemDesc",
  474. headerAlign: "center",
  475. align: "center",
  476. columnLabel: "工序名称",
  477. columnWidth: 100,
  478. columnHidden: false,
  479. columnImage: false,
  480. columnSortable: true,
  481. sortLv: 0,
  482. status: true,
  483. fixed: false
  484. },
  485. {
  486. userId: this.$store.state.user.name,
  487. functionId: 5301,
  488. serialNumber: '5301OrderNeedDate',
  489. tableId: "5301Order",
  490. tableName: "工单表",
  491. columnProp: "needDate",
  492. headerAlign: "center",
  493. align: "center",
  494. columnLabel: "要求完工日期",
  495. columnWidth: 100,
  496. columnHidden: false,
  497. columnImage: false,
  498. columnSortable: true,
  499. sortLv: 0,
  500. status: true,
  501. fixed: false
  502. },
  503. {
  504. userId: this.$store.state.user.name,
  505. functionId: 5301,
  506. serialNumber: '5301OrderPartNo',
  507. tableId: "5301Order",
  508. tableName: "工单表",
  509. columnProp: "partNo",
  510. headerAlign: "center",
  511. align: "center",
  512. columnLabel: "产品编码",
  513. columnWidth: 100,
  514. columnHidden: false,
  515. columnImage: false,
  516. columnSortable: true,
  517. sortLv: 0,
  518. status: true,
  519. fixed: false
  520. },
  521. {
  522. userId: this.$store.state.user.name,
  523. functionId: 5301,
  524. serialNumber: '5301OrderCustomerName',
  525. tableId: "5301Order",
  526. tableName: "工单表",
  527. columnProp: "customerName",
  528. headerAlign: "center",
  529. align: "center",
  530. columnLabel: "客户名称",
  531. columnWidth: 80,
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: true,
  535. sortLv: 0,
  536. status: true,
  537. fixed: false
  538. },
  539. {
  540. userId: this.$store.state.user.name,
  541. functionId: 5301,
  542. serialNumber: '5301OrderCustPartNo',
  543. tableId: "5301Order",
  544. tableName: "工单表",
  545. columnProp: "custPartNo",
  546. headerAlign: "center",
  547. align: "center",
  548. columnLabel: "客户产品料号",
  549. columnWidth: 120,
  550. columnHidden: false,
  551. columnImage: false,
  552. columnSortable: true,
  553. sortLv: 0,
  554. status: true,
  555. fixed: false
  556. },
  557. {
  558. userId: this.$store.state.user.name,
  559. functionId: 5301,
  560. serialNumber: '5301OrderPartDesc',
  561. tableId: "5301Order",
  562. tableName: "工单表",
  563. columnProp: "partDesc",
  564. headerAlign: "center",
  565. align: "center",
  566. columnLabel: "产成品名称",
  567. columnWidth: 80,
  568. columnHidden: false,
  569. columnImage: false,
  570. columnSortable: false,
  571. sortLv: 0,
  572. status: true,
  573. fixed: false
  574. },
  575. {
  576. userId: this.$store.state.user.name,
  577. functionId: 5301,
  578. serialNumber: '5301OrderLotSize',
  579. tableId: "5301Order",
  580. tableName: "工单表",
  581. columnProp: "lotSize",
  582. headerAlign: "center",
  583. align: "center",
  584. columnLabel: "订单量",
  585. columnWidth: 80,
  586. columnHidden: false,
  587. columnImage: false,
  588. columnSortable: true,
  589. sortLv: 0,
  590. status: true,
  591. fixed: false
  592. },
  593. {
  594. userId: this.$store.state.user.name,
  595. functionId: 5301,
  596. serialNumber: '5301OrderQtyToSchedule',
  597. tableId: "5301Order",
  598. tableName: "工单表",
  599. columnProp: "qtyToSchedule",
  600. headerAlign: "center",
  601. align: "center",
  602. columnLabel: "待排产数量",
  603. columnWidth: 120,
  604. columnHidden: false,
  605. columnImage: false,
  606. columnSortable: true,
  607. sortLv: 0,
  608. status: true,
  609. fixed: false
  610. },
  611. {
  612. userId: this.$store.state.user.name,
  613. functionId: 5301,
  614. serialNumber: '5301OrderQtyScheduled',
  615. tableId: "5301Order",
  616. tableName: "工单表",
  617. columnProp: "qtyScheduled",
  618. headerAlign: "center",
  619. align: "center",
  620. columnLabel: "已排产数量",
  621. columnWidth: 120,
  622. columnHidden: false,
  623. columnImage: false,
  624. columnSortable: true,
  625. sortLv: 0,
  626. status: true,
  627. fixed: false
  628. },
  629. {
  630. userId: this.$store.state.user.name,
  631. functionId: 5301,
  632. serialNumber: '5301OrderQtyReported',
  633. tableId: "5301Order",
  634. tableName: "工单表",
  635. columnProp: "qtyReported",
  636. headerAlign: "center",
  637. align: "center",
  638. columnLabel: "已报工数量",
  639. columnWidth: 120,
  640. columnHidden: false,
  641. columnImage: false,
  642. columnSortable: true,
  643. sortLv: 0,
  644. status: true,
  645. fixed: false
  646. },
  647. {
  648. userId: this.$store.state.user.name,
  649. functionId: 5301,
  650. serialNumber: '5301OrderSpec',
  651. tableId: "5301Order",
  652. tableName: "工单表",
  653. columnProp: "spec",
  654. headerAlign: "center",
  655. align: "center",
  656. columnLabel: "规格型号",
  657. columnWidth: 80,
  658. columnHidden: false,
  659. columnImage: false,
  660. columnSortable: false,
  661. sortLv: 0,
  662. status: true,
  663. fixed: false
  664. },
  665. {
  666. userId: this.$store.state.user.name,
  667. functionId: 5301,
  668. serialNumber: '5301OrderSite',
  669. tableId: "5301Order",
  670. tableName: "工单表",
  671. columnProp: "site",
  672. headerAlign: "center",
  673. align: "center",
  674. columnLabel: "工厂编号",
  675. columnWidth: 80,
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: false
  682. },
  683. {
  684. userId: this.$store.state.user.name,
  685. functionId: 5301,
  686. serialNumber: '5301OrderWorkCenterNo',
  687. tableId: "5301Order",
  688. tableName: "工单表",
  689. columnProp: "workCenterNo",
  690. headerAlign: "center",
  691. align: "center",
  692. columnLabel: "加工中心",
  693. columnWidth: 100,
  694. columnHidden: false,
  695. columnImage: false,
  696. columnSortable: true,
  697. sortLv: 0,
  698. status: true,
  699. fixed: false
  700. },
  701. {
  702. userId: this.$store.state.user.name,
  703. functionId: 5301,
  704. serialNumber: '5301OrderNextItemNo',
  705. tableId: "5301Order",
  706. tableName: "工单表",
  707. columnProp: "nextItemNo",
  708. headerAlign: "center",
  709. align: "center",
  710. columnLabel: "下道工序",
  711. columnWidth: 100,
  712. columnHidden: false,
  713. columnImage: false,
  714. columnSortable: true,
  715. sortLv: 0,
  716. status: true,
  717. fixed: false
  718. },
  719. {
  720. userId: this.$store.state.user.name,
  721. functionId: 5301,
  722. serialNumber: '5301OrderNextItemDesc',
  723. tableId: "5301Order",
  724. tableName: "工单表",
  725. columnProp: "nextItemDesc",
  726. headerAlign: "center",
  727. align: "center",
  728. columnLabel: "下道工序名称",
  729. columnWidth: 80,
  730. columnHidden: false,
  731. columnImage: false,
  732. columnSortable: false,
  733. sortLv: 0,
  734. status: true,
  735. fixed: false
  736. },
  737. {
  738. userId: this.$store.state.user.name,
  739. functionId: 5301,
  740. serialNumber: '5301OrderNextScheduledFlag',
  741. tableId: "5301Order",
  742. tableName: "工单表",
  743. columnProp: "nextScheduledFlag",
  744. headerAlign: "center",
  745. align: "center",
  746. columnLabel: "下道工序已排产",
  747. columnWidth: 150,
  748. columnHidden: false,
  749. columnImage: false,
  750. columnSortable: true,
  751. sortLv: 0,
  752. status: true,
  753. fixed: false
  754. },
  755. {
  756. userId: this.$store.state.user.name,
  757. functionId: 5301,
  758. serialNumber: '5301OrderPreItemNo',
  759. tableId: "5301Order",
  760. tableName: "工单表",
  761. columnProp: "preItemNo",
  762. headerAlign: "center",
  763. align: "center",
  764. columnLabel: "上道工序",
  765. columnWidth: 80,
  766. columnHidden: false,
  767. columnImage: false,
  768. columnSortable: true,
  769. sortLv: 0,
  770. status: true,
  771. fixed: false
  772. },
  773. {
  774. userId: this.$store.state.user.name,
  775. functionId: 5301,
  776. serialNumber: '5301OrderPreItemDesc',
  777. tableId: "5301Order",
  778. tableName: "工单表",
  779. columnProp: "preItemDesc",
  780. headerAlign: "center",
  781. align: "center",
  782. columnLabel: "上道工序名称",
  783. columnWidth: 80,
  784. columnHidden: false,
  785. columnImage: false,
  786. columnSortable: false,
  787. sortLv: 0,
  788. status: true,
  789. fixed: false
  790. },
  791. {
  792. userId: this.$store.state.user.name,
  793. functionId: 5301,
  794. serialNumber: '5301OrderPreScheduledFlag',
  795. tableId: "5301Order",
  796. tableName: "工单表",
  797. columnProp: "preScheduledFlag",
  798. headerAlign: "center",
  799. align: "center",
  800. columnLabel: "上道工序已排产",
  801. columnWidth: 80,
  802. columnHidden: false,
  803. columnImage: false,
  804. columnSortable: false,
  805. sortLv: 0,
  806. status: true,
  807. fixed: false
  808. },
  809. {
  810. userId: this.$store.state.user.name,
  811. functionId: 5301,
  812. serialNumber: '5301OrderScheduledFlag',
  813. tableId: "5301Order",
  814. tableName: "工单表",
  815. columnProp: "scheduledFlag",
  816. headerAlign: "center",
  817. align: "center",
  818. columnLabel: "是否排产",
  819. columnWidth: 80,
  820. columnHidden: false,
  821. columnImage: false,
  822. columnSortable: true,
  823. sortLv: 0,
  824. status: true,
  825. fixed: false
  826. },
  827. {
  828. userId: this.$store.state.user.name,
  829. functionId: 5301,
  830. serialNumber: '5301OrderAvailResource',
  831. tableId: "5301Order",
  832. tableName: "工单表",
  833. columnProp: "availResource",
  834. headerAlign: "center",
  835. align: "center",
  836. columnLabel: "可用机台",
  837. columnWidth: 80,
  838. columnHidden: false,
  839. columnImage: false,
  840. columnSortable: false,
  841. sortLv: 0,
  842. status: true,
  843. fixed: false
  844. },
  845. {
  846. userId: this.$store.state.user.name,
  847. functionId: 5301,
  848. serialNumber: '5301OrderEnterDate',
  849. tableId: "5301Order",
  850. tableName: "工单表",
  851. columnProp: "enterDate",
  852. headerAlign: "center",
  853. align: "center",
  854. columnLabel: "录入日期",
  855. columnWidth: 125,
  856. columnHidden: false,
  857. columnImage: false,
  858. columnSortable: false,
  859. sortLv: 0,
  860. status: true,
  861. fixed: false
  862. },
  863. {
  864. userId: this.$store.state.user.name,
  865. functionId: 5301,
  866. serialNumber: '5301OrderScheduleToPlanTime',
  867. tableId: "5301Order",
  868. tableName: "工单表",
  869. columnProp: "scheduleToPlanTime",
  870. headerAlign: "center",
  871. align: "center",
  872. columnLabel: "计划时间",
  873. columnWidth: 80,
  874. columnHidden: false,
  875. columnImage: false,
  876. columnSortable: false,
  877. sortLv: 0,
  878. status: true,
  879. fixed: false
  880. },
  881. {
  882. userId: this.$store.state.user.name,
  883. functionId: 5301,
  884. serialNumber: '5301OrderMachRunFactor',
  885. tableId: "5301Order",
  886. tableName: "工单表",
  887. columnProp: "machRunFactor",
  888. headerAlign: "center",
  889. align: "center",
  890. columnLabel: "单位产出",
  891. columnWidth: 80,
  892. columnHidden: false,
  893. columnImage: false,
  894. columnSortable: false,
  895. sortLv: 0,
  896. status: true,
  897. fixed: false
  898. },
  899. {
  900. userId: this.$store.state.user.name,
  901. functionId: 5301,
  902. serialNumber: '5301OrderMachSetupTime',
  903. tableId: "5301Order",
  904. tableName: "工单表",
  905. columnProp: "machSetupTime",
  906. headerAlign: "center",
  907. align: "center",
  908. columnLabel: "调机时间",
  909. columnWidth: 80,
  910. columnHidden: false,
  911. columnImage: false,
  912. columnSortable: false,
  913. sortLv: 0,
  914. status: true,
  915. fixed: false
  916. },
  917. {
  918. userId: this.$store.state.user.name,
  919. functionId: 5301,
  920. serialNumber: '5301OrderFactorUnit',
  921. tableId: "5301Order",
  922. tableName: "工单表",
  923. columnProp: "factorUnit",
  924. headerAlign: "center",
  925. align: "center",
  926. columnLabel: "产出单位",
  927. columnWidth: 80,
  928. columnHidden: false,
  929. columnImage: false,
  930. columnSortable: false,
  931. sortLv: 0,
  932. status: true,
  933. fixed: false
  934. },
  935. {
  936. userId: this.$store.state.user.name,
  937. functionId: 5301,
  938. serialNumber: '5301OrderQtyScheduledPreOps',
  939. tableId: "5301Order",
  940. tableName: "工单表",
  941. columnProp: "qtyScheduledPreOps",
  942. headerAlign: "center",
  943. align: "center",
  944. columnLabel: "前道工序已排产数量",
  945. columnWidth: 80,
  946. columnHidden: false,
  947. columnImage: false,
  948. columnSortable: false,
  949. sortLv: 0,
  950. status: true,
  951. fixed: false
  952. },
  953. {
  954. userId: this.$store.state.user.name,
  955. functionId: 5301,
  956. serialNumber: '5301OrderQtyApprovedPreOps',
  957. tableId: "5301Order",
  958. tableName: "工单表",
  959. columnProp: "qtyApprovedPreOps",
  960. headerAlign: "center",
  961. align: "center",
  962. columnLabel: "前道工序已报合格数",
  963. columnWidth: 80,
  964. columnHidden: false,
  965. columnImage: false,
  966. columnSortable: false,
  967. sortLv: 0,
  968. status: true,
  969. fixed: false
  970. },
  971. {
  972. userId: this.$store.state.user.name,
  973. functionId: 5301,
  974. serialNumber: '5301OrderOriSOOrderNo',
  975. tableId: "5301Order",
  976. tableName: "工单表",
  977. columnProp: "oriSOOrderNo",
  978. headerAlign: "center",
  979. align: "center",
  980. columnLabel: "SAP参考号",
  981. columnWidth: 80,
  982. columnHidden: false,
  983. columnImage: false,
  984. columnSortable: false,
  985. sortLv: 0,
  986. status: true,
  987. fixed: false
  988. },
  989. {
  990. userId: this.$store.state.user.name,
  991. functionId: 5301,
  992. serialNumber: '5301OrderEficiency',
  993. tableId: "5301Order",
  994. tableName: "工单表",
  995. columnProp: "efficiency",
  996. headerAlign: "center",
  997. align: "center",
  998. columnLabel: "效率",
  999. columnWidth: 80,
  1000. columnHidden: false,
  1001. columnImage: false,
  1002. columnSortable: false,
  1003. sortLv: 0,
  1004. status: true,
  1005. fixed: false
  1006. },
  1007. {
  1008. userId: this.$store.state.user.name,
  1009. functionId: 5301,
  1010. serialNumber: '5301OrderCostRollUpFlag',
  1011. tableId: "5301Order",
  1012. tableName: "工单表",
  1013. columnProp: "costRollUpFlag",
  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: false
  1024. },
  1025. {
  1026. userId: this.$store.state.user.name,
  1027. functionId: 5301,
  1028. serialNumber: '5301OrderManualFlag',
  1029. tableId: "5301Order",
  1030. tableName: "工单表",
  1031. columnProp: "manualFlag",
  1032. headerAlign: "center",
  1033. align: "center",
  1034. columnLabel: "刀模已发",
  1035. columnWidth: 80,
  1036. columnHidden: false,
  1037. columnImage: false,
  1038. columnSortable: false,
  1039. sortLv: 0,
  1040. status: true,
  1041. fixed: false
  1042. },
  1043. {
  1044. userId: this.$store.state.user.name,
  1045. functionId: 5301,
  1046. serialNumber: '5301OrderRepairSOFlag',
  1047. tableId: "5301Order",
  1048. tableName: "工单表",
  1049. columnProp: "repairSOFlag",
  1050. headerAlign: "center",
  1051. align: "center",
  1052. columnLabel: "印版已发",
  1053. columnWidth: 80,
  1054. columnHidden: false,
  1055. columnImage: false,
  1056. columnSortable: false,
  1057. sortLv: 0,
  1058. status: true,
  1059. fixed: false
  1060. },
  1061. ],
  1062. calendarOutList: [],
  1063. primaryMenuButton: {
  1064. shopOrderFlag: true,
  1065. partStockFlag: true,
  1066. },
  1067. queryTable: {
  1068. userId: this.$store.state.user.name,
  1069. functionId: this.$route.meta.menuId,
  1070. tableId: "5301Order",
  1071. languageCode: this.$i18n.locale
  1072. },
  1073. // 用户table 查询参数
  1074. queryTableUser: {
  1075. userId: this.$store.state.user.name,
  1076. functionId: this.$route.meta.menuId,
  1077. tableId: "5301Order",
  1078. status: true,
  1079. languageCode: this.$i18n.locale
  1080. },
  1081. // 用户table 配置集合
  1082. userColumnList: [],
  1083. buttons: {
  1084. refreshButton: '刷新',
  1085. primaryMenu: '主菜单',
  1086. shopOrder: '生产订单',
  1087. viewPartStock: '查看物料库存',
  1088. settingTable: '设置列表',
  1089. defaultTable: '设置默认配置',
  1090. scheduleBatch: '批量排产',
  1091. },
  1092. buttonList: [
  1093. {
  1094. functionId: functionId,
  1095. languageValue: '刷新',
  1096. objectId: 'refreshButton',
  1097. objectType: 'button',
  1098. tableId: '*'
  1099. }, {
  1100. functionId: functionId,
  1101. languageValue: '主菜单',
  1102. objectId: 'primaryMenu',
  1103. objectType: 'button',
  1104. tableId: '*'
  1105. }, {
  1106. functionId: functionId,
  1107. languageValue: '生产订单',
  1108. objectId: 'shopOrder',
  1109. objectType: 'button',
  1110. tableId: '*'
  1111. }, {
  1112. functionId: functionId,
  1113. languageValue: '查看物料库存',
  1114. objectId: 'viewPartStock',
  1115. objectType: 'button',
  1116. tableId: '*'
  1117. }, {
  1118. functionId: functionId,
  1119. languageValue: '设置列表',
  1120. objectId: 'settingTable',
  1121. objectType: 'button',
  1122. tableId: '*'
  1123. }, {
  1124. functionId: functionId,
  1125. languageValue: '设置默认配置',
  1126. objectId: 'defaultTable',
  1127. objectType: 'button',
  1128. tableId: '*'
  1129. },
  1130. ],
  1131. queryButton: {
  1132. functionId: functionId,
  1133. table_id: '*',
  1134. languageCode: this.$i18n.locale,
  1135. objectType: 'button'
  1136. },
  1137. labels: {
  1138. enterDate: '录入日期:',
  1139. needDate: '要求完工日期:',
  1140. orderNo: '生产订单号:',
  1141. siteNo: '工厂编号:',
  1142. resourceId: '机台编号:',
  1143. workCenterNo: '加工中心编码:',
  1144. sortNo: '排序',
  1145. sortNeedDate: '要求完工日期',
  1146. sortOrderNo: '订单号',
  1147. sortPartNo: '产品编码',
  1148. primaryRecord: '主记录',
  1149. pleaseSelectOrder: '请选择工单!',
  1150. scheduleBatchWarning: '选中的工单中,包含未选择的机台的工单!',
  1151. scheduledDate: '排产日期',
  1152. pleaseEnterThisScheduleQty: '请输入本次排产数量!',
  1153. thisScheduleQtyMustMoreThanZero: '本次排产数量必须大于零!',
  1154. pleaseSelectAvailableResourceId: '请选择可用机台!',
  1155. scheduleQtyMoreThanZeroWaitScheduleQty: '排产数量超过本次待排产数量!',
  1156. },
  1157. labelsList: [
  1158. {
  1159. functionId: functionId,
  1160. languageValue: '录入日期:',
  1161. objectId: 'enterDate',
  1162. objectType: 'label',
  1163. tableId: '*'
  1164. }, {
  1165. functionId: functionId,
  1166. languageValue: '要求完工日期:',
  1167. objectId: 'needDate',
  1168. objectType: 'label',
  1169. tableId: '*'
  1170. }, {
  1171. functionId: functionId,
  1172. languageValue: '生产订单号:',
  1173. objectId: 'orderNo',
  1174. objectType: 'label',
  1175. tableId: '*'
  1176. }, {
  1177. functionId: functionId,
  1178. languageValue: '工厂编号:',
  1179. objectId: 'siteNo',
  1180. objectType: 'label',
  1181. tableId: '*'
  1182. }, {
  1183. functionId: functionId,
  1184. languageValue: '机台编码:',
  1185. objectId: 'resourceId',
  1186. objectType: 'label',
  1187. tableId: '*'
  1188. }, {
  1189. functionId: functionId,
  1190. languageValue: '加工中心编码:',
  1191. objectId: 'workCenterNo',
  1192. objectType: 'label',
  1193. tableId: '*'
  1194. }, {
  1195. functionId: functionId,
  1196. languageValue: '排序',
  1197. objectId: 'sortNo',
  1198. objectType: 'label',
  1199. tableId: '*'
  1200. }, {
  1201. functionId: functionId,
  1202. languageValue: '要求完工日期',
  1203. objectId: 'sortNeedDate',
  1204. objectType: 'label',
  1205. tableId: '*'
  1206. }, {
  1207. functionId: functionId,
  1208. languageValue: '订单号',
  1209. objectId: 'sortOrderNo',
  1210. objectType: 'label',
  1211. tableId: '*'
  1212. }, {
  1213. functionId: functionId,
  1214. languageValue: '产品编码',
  1215. objectId: 'sortPartNo',
  1216. objectType: 'label',
  1217. tableId: '*'
  1218. }, {
  1219. functionId: functionId,
  1220. languageValue: '主记录',
  1221. objectId: 'primaryRecord',
  1222. objectType: 'label',
  1223. tableId: '*'
  1224. }, {
  1225. functionId: functionId,
  1226. languageValue: '请选择工单!',
  1227. objectId: 'pleaseSelectOrder',
  1228. objectType: 'label',
  1229. tableId: '*'
  1230. },
  1231. ],
  1232. queryLabel: {
  1233. functionId: functionId,
  1234. table_id: '*',
  1235. languageCode: this.$i18n.locale,
  1236. objectType: 'label'
  1237. },
  1238. }
  1239. },
  1240. /*组件*/
  1241. components: {
  1242. Chooselist,/*列表的组件*/
  1243. comPartStock,/*展示物料库存的组件*/
  1244. comScheduleOrderExpand,/*扩展排产 处理多加工中心排产*/
  1245. column,/*动态列*/
  1246. },
  1247. mounted() {
  1248. this.$nextTick(() => {
  1249. this.height = window.innerHeight - 205;
  1250. })
  1251. },
  1252. methods: {
  1253. // 开始排产
  1254. batchScheduleOrderWithExpandStart() {
  1255. let newItemList = []
  1256. for (let i = 0; i < this.dataListSelections.length; i++) {
  1257. let item = this.dataListSelections[i]
  1258. let qtyToSchedule = item.qtyToSchedule;
  1259. if (qtyToSchedule == null || qtyToSchedule == '') {
  1260. this.$message.error(this.labels.pleaseEnterThisScheduleQty)
  1261. return false;
  1262. }
  1263. //判断数量是否超限
  1264. if (item.scheduledQty <= 0) {
  1265. this.$message.error(this.labels.thisScheduleQtyMustMoreThanZero)
  1266. return false;
  1267. }
  1268. //验证可用机台
  1269. let resourceId = item.resourceId;
  1270. if (resourceId == null || resourceId == '' || resourceId == '请选择') {
  1271. this.$message.error(this.labels.pleaseSelectAvailableResourceId)
  1272. return false;
  1273. }
  1274. let scheduledQty = parseFloat(item.scheduledQty);
  1275. if (qtyToSchedule > scheduledQty) {
  1276. this.$message.error(this.labels.scheduleQtyMoreThanZeroWaitScheduleQty)
  1277. return false;
  1278. }
  1279. let newItem = {
  1280. checkFlag: true,
  1281. itemNo: item.itemNo,
  1282. orderNo: item.orderNo,
  1283. qtyToSchedule: item.scheduledQty,
  1284. resourceId: item.resourceId,
  1285. scheduleDate: this.scheduleDate,
  1286. scheduleTime: this.scheduleTime,
  1287. scheduledQty: item.qtyToSchedule,
  1288. site: item.site,
  1289. specifiedTime: this.specifiedTime,
  1290. username: this.$store.state.user.name,
  1291. workCenterNo: item.workCenterNo
  1292. }
  1293. newItemList.push(newItem)
  1294. }
  1295. batchScheduleOrderWithExpand(newItemList).then(({data}) => {
  1296. if (data.code == 200) {
  1297. this.$message.success(data.msg)
  1298. } else if (data.code == 201) {
  1299. this.$confirm(data.msg, '提示', {
  1300. confirmButtonText: this.labels.confirmLabel,
  1301. celButtonText: this.labels.cancelLabel,
  1302. type: 'warning'
  1303. }).then(() => {
  1304. for (let i = 0; i < this.dataListSelections.length; i++) {
  1305. let item = this.dataListSelections[i]
  1306. let newItem = {
  1307. checkFlag: false,
  1308. itemNo: item.itemNo,
  1309. orderNo: item.orderNo,
  1310. qtyToSchedule: item.scheduledQty,
  1311. resourceId: item.resourceId,
  1312. scheduleDate: this.scheduleDate,
  1313. scheduleTime: this.scheduleTime,
  1314. scheduledQty: item.qtyToSchedule,
  1315. site: item.site,
  1316. specifiedTime: this.specifiedTime,
  1317. username: this.$store.state.user.name,
  1318. workCenterNo: item.workCenterNo
  1319. }
  1320. newItemList.push(newItem)
  1321. }
  1322. batchScheduleOrderWithExpand(newItemList).then(({data}) => {
  1323. if (data.code == 200) {
  1324. this.$message.success(data.msg)
  1325. } else if (data.code == 500) {
  1326. this.$message.error(data.msg)
  1327. }
  1328. })
  1329. });
  1330. this.$message.warning(data.msg)
  1331. } else if (data.code == 500) {
  1332. this.$message.error(data.msg)
  1333. }
  1334. })
  1335. },
  1336. // scheduleBatchDialog
  1337. scheduleBatchDialog() {
  1338. if (this.dataListSelections.find(item => item.resourceId == '' || item.resourceId == null)) {
  1339. this.$message.warning(this.labels.scheduleBatchWarning)
  1340. return
  1341. }
  1342. this.scheduleVisible = true
  1343. },
  1344. // 选中记录
  1345. handleSelectionChange(val) {
  1346. this.dataListSelections = val
  1347. },
  1348. /*刷新页面table*/
  1349. refreshPageTables() {
  1350. this.getShopOrderList();
  1351. },
  1352. /*获取工单信息*/
  1353. getShopOrderList() {
  1354. getShopOrderList(this.pageData).then(({data}) => {
  1355. this.shopOrderList = data.rows;
  1356. //清空已经选好的行数据
  1357. this.currentRoutingRow = null;
  1358. })
  1359. },
  1360. /*列表方法的回调*/
  1361. getBaseData(val) {
  1362. if (this.tagNo === 88) {
  1363. this.pageData.resourceId = val.ResourceID;
  1364. } else if (this.tagNo == 24) {
  1365. this.pageData.workCenterNo = val.WorkCenterNo;
  1366. }
  1367. },
  1368. // 获取基础数据列表
  1369. getBaseList(val) {
  1370. this.tagNo = val
  1371. this.$nextTick(() => {
  1372. let strVal = "";
  1373. if (val === 88) {
  1374. strVal = this.pageData.resourceId;
  1375. } else if (val === 24) {
  1376. strVal = this.pageData.workCenterNo;
  1377. }
  1378. this.$refs.baseList.init(val, strVal, " AND WorkCenterNo <> 'FQC'")
  1379. })
  1380. },
  1381. /*区分不同的菜单 调用不同的方法 调用不同的方法*/
  1382. orderHandleCommand(menuName) {
  1383. //区分是哪一个方法调用
  1384. if ('生产工单' === menuName) {
  1385. //判断是否选择好了工单
  1386. if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
  1387. //重置按钮
  1388. this.primaryMenuButton.shopOrderFlag = true;
  1389. //返回错误
  1390. this.$message.error(this.labels.pleaseSelectOrder);
  1391. return false;
  1392. }
  1393. this.$router.push({
  1394. path: '/shopOrder-shopOrder/shopOrder',
  1395. query: {
  1396. site: this.$store.state.user.site,
  1397. order: this.currentRoutingRow.orderNo,
  1398. user: this.$store.state.user.name
  1399. }
  1400. })
  1401. } else if ('查看物料库存' === menuName) {
  1402. //判断是否选择好了工单
  1403. if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
  1404. //重置按钮
  1405. this.primaryMenuButton.partStockFlag = true;
  1406. //返回错误
  1407. this.$message.error(this.labels.pleaseSelectOrder);
  1408. return false;
  1409. }
  1410. let tempData = {'site': this.pageData.site, 'orderNo': this.currentRoutingRow.orderNo};
  1411. //打开组件 需要的数据 展示需要的数据
  1412. this.$nextTick(() => {
  1413. this.showPartStockFlag = true;
  1414. this.$refs.comPartStock.init(tempData);
  1415. })
  1416. }
  1417. },
  1418. /*获取当前的机台对应的加工中心*/
  1419. getCurrentWorkCenterNoByResourceId() {
  1420. getCurrentWorkCenterNoByResourceId(this.pageData).then(({data}) => {
  1421. //区分是否成功
  1422. if (data.code == 500) {
  1423. //this.$message.error(data.msg);
  1424. } else {
  1425. this.pageData.workCenterNo = data.workCenterNo;
  1426. }
  1427. this.pageData.workCenterNo = data.workCenterNo;
  1428. });
  1429. },
  1430. /*设置当前行的下标*/
  1431. routingRowClassName({row, rowIndex}) {
  1432. row.index = rowIndex;
  1433. //判断当前行颜色参数
  1434. if (row.qtyScheduled > 0) {
  1435. return 'customer-row-gray';
  1436. }
  1437. },
  1438. /*设置工艺的行*/
  1439. setCurrentRoutingRow(row, column, event) {
  1440. this.currentRoutingRow = row;
  1441. },
  1442. /*开始排产的操作*/
  1443. startScheduleOperation(row, $event, column) {
  1444. //刷新当前派工单的数据 打开当前工单+工序的排产的
  1445. this.startScheduleOrderModal(row);
  1446. },
  1447. /*刷新当前的页面的显示数据*/
  1448. startScheduleOrderModal(orderRow) {
  1449. //刷新排产的数量
  1450. this.$nextTick(() => {
  1451. this.showScheduleOrderFlag = true;
  1452. this.$refs.comScheduleOrderExpand.init(orderRow);
  1453. });
  1454. },
  1455. /*判断主菜单的样式*/
  1456. controlPrimaryMenuBun() {
  1457. //没有选择行 所有的按钮都是灰色
  1458. if (this.currentRoutingRow == null || this.currentRoutingRow == {}) {
  1459. this.primaryMenuButton.shopOrderFlag = true;
  1460. this.primaryMenuButton.partStockFlag = true;
  1461. } else {
  1462. // 判断是否具有该页面权限
  1463. let menList = JSON.parse(sessionStorage.getItem('dynamicMenuRoutes') || '[]')
  1464. .filter(item => item.path == 'shopOrder-shopOrder/shopOrder')
  1465. if (menList.length > 0) {
  1466. this.primaryMenuButton.shopOrderFlag = false;
  1467. }
  1468. this.primaryMenuButton.partStockFlag = false;
  1469. }
  1470. },
  1471. // 打开页面设置
  1472. userSetting() {
  1473. this.visible = true;
  1474. let queryTable = {
  1475. userId: this.$store.state.user.name,
  1476. functionId: this.$route.meta.menuId,
  1477. tableId: "5301Order",
  1478. languageCode: this.$i18n.locale
  1479. }
  1480. this.$nextTick(() => {
  1481. this.$refs.column.init(queryTable);
  1482. });
  1483. },
  1484. // 获取 用户保存的 格式列
  1485. getTableUserColumn() {
  1486. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1487. if (data.rows.length > 0) {
  1488. //this.columnList = []
  1489. this.columnList = data.rows
  1490. } else {
  1491. this.getColumnList()
  1492. }
  1493. })
  1494. },
  1495. // 保存 默认配置 列
  1496. async saveColumnList() {
  1497. // 删除所有的该页面下保存的数据
  1498. if (this.userColumnList) {
  1499. //删除 user自定义的数据
  1500. await removerUser(this.queryTable)
  1501. }
  1502. // 删除默认配置
  1503. await removerDefault(this.queryTable)
  1504. // 保存页面 table属性
  1505. let sumColumnList = this.columnList;//concat(this.columnList1);
  1506. sumColumnList = sumColumnList.map(item => {
  1507. return item = {
  1508. tableId: item.tableId,
  1509. tableName: item.tableName,
  1510. columnProp: item.columnProp,
  1511. columnLabel: item.columnLabel,
  1512. columnHidden: false,
  1513. columnImage: false,
  1514. columnSortable: item.columnSortable,
  1515. columnWidth: item.columnWidth,
  1516. format: item.format,
  1517. functionId: this.$route.meta.menuId,
  1518. sortLv: item.sortLv,
  1519. status: true,
  1520. fixed: item.fixed,
  1521. serialNumber: item.serialNumber,
  1522. columnType: item.columnType,
  1523. align: item.align
  1524. }
  1525. })
  1526. await saveTableDefaultList(sumColumnList)
  1527. // 保存页面 button label title 属性
  1528. /* let buttons = this.buttonList.map(item => {
  1529. return item = {
  1530. functionId: this.$route.meta.menuId,
  1531. languageValue: item.languageValue,
  1532. objectId: item.objectId,
  1533. objectType: item.objectType,
  1534. tableId: item.tableId
  1535. }
  1536. })
  1537. await saveButtonList(buttons)*/
  1538. this.getFunctionButtonList()
  1539. this.getColumnList()
  1540. },
  1541. // 获取 tableDefault 列
  1542. getColumnList() {
  1543. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1544. if (!data.rows.length == 0) {
  1545. // this.showDefault = false
  1546. this.columnList = data.rows
  1547. } else {
  1548. // this.showDefault = true
  1549. }
  1550. })
  1551. },
  1552. //获取按钮的权限数据
  1553. getButtonAuthData() {
  1554. let updateFlag = this.isAuth(this.menuId + ":revise");
  1555. let fullControFlag = this.isAuth(this.menuId + ":fullContro");
  1556. let deleteFlag = this.isAuth(this.menuId + ":remove");
  1557. //处理页面的权限数据
  1558. this.authEdit = !updateFlag || !fullControFlag;
  1559. this.authAdd = !fullControFlag;
  1560. this.authDelete = !deleteFlag;
  1561. },
  1562. // 保存 默认配置 列
  1563. async saveMultiLanguage() {
  1564. // 保存页面 button label title 属性
  1565. let buttons = this.buttonList;
  1566. let labels = this.labelsList;
  1567. await saveButtonList(buttons)
  1568. await saveButtonList(labels)
  1569. },
  1570. //获取多语言的信息
  1571. getMultiLanguageList() {
  1572. //首先查询当前按钮的多语言
  1573. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1574. if (data && data.code == 0) {
  1575. this.buttons = data.data
  1576. } else {
  1577. // saveButtonList(this.buttonList).then(({data}) => {
  1578. // })
  1579. }
  1580. });
  1581. //其次查询当前标签的多语言
  1582. searchFunctionButtonList(this.queryLabel).then(({data}) => {
  1583. if (data && data.code == 0) {
  1584. this.labels = data.data
  1585. } else {
  1586. // saveButtonList(this.buttonList).then(({data}) => {
  1587. // })
  1588. }
  1589. });
  1590. },
  1591. },
  1592. created() {
  1593. //查询工单的数据
  1594. this.getShopOrderList();
  1595. //初始化动态的表头
  1596. this.getTableUserColumn();
  1597. //获取按钮的权限
  1598. this.getButtonAuthData();
  1599. //判断是否启用多语言
  1600. this.getMultiLanguageList(); //刷新多语言的信息
  1601. },
  1602. /*利用监听器处理大小写*/
  1603. watch: {
  1604. pageData: {
  1605. deep: true,
  1606. handler: function (newV, oldV) {
  1607. this.pageData.resourceId = this.pageData.resourceId.toUpperCase();
  1608. this.pageData.workCenterNo = this.pageData.workCenterNo.toUpperCase();
  1609. }
  1610. }
  1611. },
  1612. }
  1613. </script>
  1614. <!--当前页面的标签样式-->
  1615. <style scoped lang="scss">
  1616. /*针对el-card*/
  1617. .customer-card .el-form-item__content {
  1618. margin-top: -15px;
  1619. }
  1620. .customer-card .el-form-item {
  1621. height: 22px;
  1622. }
  1623. .customer-border .el-form-item__content {
  1624. margin-top: -30px;
  1625. }
  1626. /*全局年与日类型 宽度*/
  1627. div.el-time-width {
  1628. width: 110px !important;
  1629. }
  1630. /* 全局时间右边框*/
  1631. .customer-css input.el-input__inner {
  1632. height: 22px !important;
  1633. padding-right: 0px !important;
  1634. }
  1635. /* 控制el-card标签的数据*/
  1636. div.customer-el-card {
  1637. margin-left: 110px;
  1638. margin-top: -15px;
  1639. height: 20px;
  1640. width: 60px;
  1641. }
  1642. /* 颜色控制 */
  1643. div.customer-el-card-pink {
  1644. background: #FF00FF;
  1645. }
  1646. div.customer-el-card-orange {
  1647. background: #FFD700;
  1648. }
  1649. div.customer-el-card-blue {
  1650. background: #0000CD;
  1651. }
  1652. /*清掉样式*/
  1653. .el-radio + .el-radio {
  1654. margin-left: 0px;
  1655. }
  1656. /*当前按钮的通用样式*/
  1657. .customer-css .customer-bun-mid {
  1658. width: 60px;
  1659. text-align: center;
  1660. }
  1661. .customer-css .customer-bun-min {
  1662. width: 50px;
  1663. text-align: center;
  1664. }
  1665. .customer-css .customer-bun-max {
  1666. width: 80px;
  1667. text-align: center;
  1668. }
  1669. /*当前按钮的通用样式*/
  1670. .customer-css .el-button--medium {
  1671. padding: 5px 5px;
  1672. }
  1673. /*灰色的表格行背景颜色*/
  1674. .customer-css /deep/ tr.customer-row-gray:hover {
  1675. background: #7e819e;
  1676. }
  1677. /*灰色的表格行背景颜色*/
  1678. .customer-css /deep/ tr.customer-row-gray > td {
  1679. background: #7e819e;
  1680. }
  1681. /*去掉悬浮的样式*/
  1682. /*.customer-css /deep/ tr:hover > td{
  1683. background-color: transparent !important;
  1684. }
  1685. .customer-css /deep/ tr.hover-row.current-row > td{
  1686. background-color: transparent !important;
  1687. }
  1688. .customer-css /deep/ tr.hover-row > td{
  1689. background-color: transparent !important;
  1690. }*/
  1691. /*添加主菜单和明细菜单的样式*/
  1692. .customer-css .customer-dropdown .el-button--primary {
  1693. padding: 2px;
  1694. font-size: 12px;
  1695. }
  1696. /*设置间距*/
  1697. .el-dropdown-menu /deep/ li.customer-li {
  1698. font-size: 12px;
  1699. line-height: 16px;
  1700. padding: 4px 8px;
  1701. }
  1702. .el-input /deep/ .el-icon-time {
  1703. display: none;
  1704. }
  1705. /*控制上下间距*/
  1706. hr {
  1707. margin-top: 0px;
  1708. }
  1709. /deep/ .el-table .cell {
  1710. line-height: 20px;
  1711. font-size: 12px;
  1712. height: 20px;
  1713. }
  1714. </style>