乐天mes前端
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.

846 lines
27 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
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
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
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: 5px;">
  5. <el-form-item :label="'工厂编号:'">
  6. <el-input v-model="searchData.site" style="width: 85px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料编码:'">
  9. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item >
  12. <span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台编号:</a></span>
  13. <el-input v-model="searchData.resourceId" style="width: 110px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'计划日期:'">
  16. <el-date-picker
  17. style="width: 120px"
  18. v-model="searchData.date1"
  19. type="date"
  20. value-format="yyyy-MM-dd"
  21. placeholder="选择日期">
  22. </el-date-picker>
  23. </el-form-item>
  24. <el-form-item :label="' '">
  25. <el-date-picker
  26. style="width: 120px"
  27. v-model="searchData.date2"
  28. type="date"
  29. value-format="yyyy-MM-dd"
  30. placeholder="选择日期">
  31. </el-date-picker>
  32. </el-form-item>
  33. <el-form-item :label="'生产订单号:'">
  34. <el-input v-model="searchData.orderNo" style="width: 120px" ></el-input>
  35. </el-form-item>
  36. <el-form-item label="客户名称">
  37. <el-input v-model="searchData.customerName" style="width: 120px"></el-input>
  38. </el-form-item>
  39. <el-form-item :label="'是否打印:'">
  40. <el-select filterable v-model="searchData.printFlag" style="width: 80px">
  41. <el-option label="是" value="Y"></el-option>
  42. <el-option label="否" value="N"></el-option>
  43. <el-option label="全部" value=""></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item :label="''" style="margin-left: -5px;">
  47. <el-checkbox style="margin-top: 20px;" true-label="Y" false-label="N" v-model="searchData.closedFlag">显示已关闭计划
  48. </el-checkbox>
  49. </el-form-item>
  50. </el-form>
  51. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
  52. <el-form-item style="margin-left: -9px;">
  53. <el-button type="primary" @click="refreshTables()" class="customer-bun-mid"
  54. style="margin-left: 10px; margin-bottom: 5px;">查询
  55. </el-button>
  56. <download-excel
  57. :fields="fields()"
  58. :data="exportData"
  59. type="xls"
  60. :name="exportName"
  61. :footer="exportFooter"
  62. :fetch="createExportData"
  63. :before-generate="startDownload"
  64. :before-finish="finishDownload"
  65. worksheet="导出信息"
  66. class="el-button el-button--primary el-button--medium">
  67. 导出
  68. </download-excel>
  69. </el-form-item>
  70. <el-form-item :label="'已关闭,已达数量'">
  71. <el-card class="customer-el-card customer-el-card-pink" style="margin-left:100px"></el-card>
  72. </el-form-item>
  73. <el-form-item :label="'已关闭,未达数量'">
  74. <el-card class="customer-el-card customer-el-card-orange" style="margin-left:100px"></el-card>
  75. </el-form-item>
  76. <el-form-item :label="'未关闭,未达数量'">
  77. <el-card class="customer-el-card customer-el-card-blue" style="margin-left:100px"></el-card>
  78. </el-form-item>
  79. <!-- :row-class-name="routingRowClassName2"-->
  80. <div class="mainTable">
  81. <el-table :height="height"
  82. :data="dataList"
  83. border
  84. :row-class-name="routingRowClassName2"
  85. v-loading="dataListLoading"
  86. style="width: 100%;margin-top: -20px">
  87. <el-table-column
  88. prop=""
  89. header-align="center"
  90. align="center"
  91. width="70"
  92. label="操作">
  93. <template slot-scope="scope" class="foo_container">
  94. <a type="text" size="small" @click="printAction(scope.row)">打印标签</a>
  95. <!-- <a type="text" size="small" @click="print(scope.row)">关闭</a>-->
  96. </template>
  97. </el-table-column>
  98. <el-table-column
  99. v-for="(item,index) in columnArray" :key="index"
  100. :sortable="item.columnSortable"
  101. :prop="item.columnProp"
  102. :header-align="item.headerAlign"
  103. :show-overflow-tooltip="item.showOverflowTooltip"
  104. :align="item.align"
  105. :fixed="item.fixed"
  106. :width="item.columnWidth"
  107. :label="item.columnLabel"
  108. >
  109. <template slot-scope="scope">
  110. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  111. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  112. style="width: 100px; height: 80px"/></span>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  117. <span>合计排产数量</span>
  118. <el-input v-model="sum1" readonly style="width: 60px"></el-input>
  119. <span>已完成数量</span>
  120. <el-input v-model="sum2" readonly style="width: 60px"></el-input>
  121. <span>已入库数量</span>
  122. <el-input v-model="sum3" readonly style="width: 60px"></el-input>
  123. </el-form>
  124. </div>
  125. </el-form>
  126. <el-dialog title="打印份数" :close-on-click-modal="false" v-drag :visible.sync="printModalFlag" width="200px">
  127. <el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;">
  128. <el-form-item :label="'打印份数:'">
  129. <el-input v-model="printQty" style="width: 130px;" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
  130. </el-form-item>
  131. </el-form>
  132. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  133. <el-button type="primary" @click="doPrint()">开始打印</el-button>
  134. <el-button type="primary" @click="printModalFlag = false">关闭</el-button>
  135. </el-footer>
  136. </el-dialog>
  137. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  138. </div>
  139. </template>
  140. <script>
  141. import {
  142. printMaterialLabel,
  143. } from "@/views/modules/production/print_serialNo_label.js"
  144. import {
  145. getProduceScheduleList
  146. } from '@/api/production/dailyPlan.js'
  147. import {
  148. printSerialNo,
  149. getScheduleSerialNo,
  150. } from '@/api/production/pallet.js'
  151. import Chooselist from '@/views/modules/common/Chooselist'
  152. export default {
  153. name: 'search_schedule',
  154. components: {
  155. Chooselist
  156. },
  157. data () {
  158. return {
  159. sum1:'',
  160. sum2:'',
  161. sum3:'',
  162. printModalFlag:false,
  163. printQty:'',
  164. // 导出 start
  165. exportData: [],
  166. exportName: "排产日计划清单"+this.dayjs().format('YYYYMMDDHHmmss'),
  167. exportFooter: [],
  168. // 导出 end
  169. height:200,
  170. dataList:[],
  171. dataListLoading: false,
  172. columnArray: [
  173. {
  174. userId: this.$store.state.user.name,
  175. functionId: 5302,
  176. serialNumber: '5302ProduceScheduledDate',
  177. tableId: "5302Produce",
  178. tableName: "待生产工单",
  179. columnProp: "scheduledDate",
  180. headerAlign: "center",
  181. align: "left",
  182. columnLabel: "排产日期",
  183. columnWidth: 80,
  184. columnHidden: false,
  185. columnImage: false,
  186. columnSortable: true,
  187. sortLv: 0,
  188. status: true,
  189. fixed: false
  190. },
  191. {
  192. userId: this.$store.state.user.name,
  193. functionId: 5302,
  194. serialNumber: '5302ProduceItemDesc',
  195. tableId: "5302Produce",
  196. tableName: "待生产工单",
  197. columnProp: "printFlag",
  198. headerAlign: "center",
  199. align: "left",
  200. columnLabel: "是否打印",
  201. columnWidth: 60,
  202. columnHidden: false,
  203. columnImage: false,
  204. columnSortable: false,
  205. sortLv: 0,
  206. status: true,
  207. fixed: false
  208. },
  209. {
  210. userId: this.$store.state.user.name,
  211. functionId: 5302,
  212. serialNumber: '5302ProduceOrderNo',
  213. tableId: "5302Produce",
  214. tableName: "待生产工单",
  215. columnProp: "orderNo",
  216. headerAlign: "center",
  217. align: "left",
  218. columnLabel: "生产订单号",
  219. columnWidth: 120,
  220. columnHidden: false,
  221. columnImage: false,
  222. columnSortable: false,
  223. sortLv: 0,
  224. status: true,
  225. fixed: false
  226. },
  227. {
  228. userId: this.$store.state.user.name,
  229. functionId: 5302,
  230. serialNumber: '5302ProducePartNo',
  231. tableId: "5302Produce",
  232. tableName: "待生产工单",
  233. columnProp: "partNo",
  234. headerAlign: "center",
  235. align: "left",
  236. columnLabel: "产品编码",
  237. columnWidth: 110,
  238. columnHidden: false,
  239. columnImage: false,
  240. columnSortable: true,
  241. sortLv: 0,
  242. status: true,
  243. fixed: false
  244. },
  245. {
  246. userId: this.$store.state.user.name,
  247. functionId: 5302,
  248. serialNumber: '5302ProducePartDesc',
  249. tableId: "5302Produce",
  250. tableName: "待生产工单",
  251. columnProp: "partDesc",
  252. headerAlign: "center",
  253. align: "left",
  254. columnLabel: "产品名称",
  255. columnWidth: 180,
  256. columnHidden: false,
  257. columnImage: false,
  258. columnSortable: false,
  259. sortLv: 0,
  260. status: true,
  261. fixed: false
  262. },
  263. {
  264. userId: this.$store.state.user.name,
  265. functionId: 5302,
  266. serialNumber: '5302ProduceResourceId',
  267. tableId: "5302Produce",
  268. tableName: "待生产工单",
  269. columnProp: "resourceId",
  270. headerAlign: "center",
  271. align: "left",
  272. columnLabel: "机台",
  273. columnWidth: 60,
  274. columnHidden: false,
  275. columnImage: false,
  276. columnSortable: false,
  277. sortLv: 0,
  278. status: true,
  279. fixed: false
  280. },
  281. {
  282. userId: this.$store.state.user.name,
  283. functionId: 5302,
  284. serialNumber: '5302ProduceTimeRequired',
  285. tableId: "5302Produce",
  286. tableName: "待生产工单",
  287. columnProp: "timeRequired",
  288. headerAlign: "center",
  289. align: "right",
  290. columnLabel: "需求时间",
  291. columnWidth: 60,
  292. columnHidden: false,
  293. columnImage: false,
  294. columnSortable: false,
  295. sortLv: 0,
  296. status: true,
  297. fixed: false
  298. },
  299. {
  300. userId: this.$store.state.user.name,
  301. functionId: 5302,
  302. serialNumber: '5302ProduceQtyRequired',
  303. tableId: "5302Produce",
  304. tableName: "待生产工单",
  305. columnProp: "qtyRequired",
  306. headerAlign: "center",
  307. align: "right",
  308. columnLabel: "需求数量",
  309. columnWidth: 60,
  310. columnHidden: false,
  311. columnImage: false,
  312. columnSortable: false,
  313. sortLv: 0,
  314. status: true,
  315. fixed: false
  316. },
  317. {
  318. userId: this.$store.state.user.name,
  319. functionId: 5302,
  320. serialNumber: '5302ProduceQtyApprove',
  321. tableId: "5302Produce",
  322. tableName: "待生产工单",
  323. columnProp: "qtyApprove",
  324. headerAlign: "center",
  325. align: "right",
  326. columnLabel: "已完成数量",
  327. columnWidth: 70,
  328. columnHidden: false,
  329. columnImage: false,
  330. columnSortable: false,
  331. sortLv: 0,
  332. status: true,
  333. fixed: false
  334. },
  335. {
  336. userId: this.$store.state.user.name,
  337. functionId: 5302,
  338. serialNumber: '5302ProduceQtyReported',
  339. tableId: "5302Produce",
  340. tableName: "待生产工单",
  341. columnProp: "qtyReported",
  342. headerAlign: "center",
  343. align: "right",
  344. columnLabel: "已入库数量",
  345. columnWidth: 70,
  346. columnHidden: false,
  347. columnImage: false,
  348. columnSortable: false,
  349. sortLv: 0,
  350. status: true,
  351. fixed: false
  352. },
  353. {
  354. userId: this.$store.state.user.name,
  355. functionId: 5302,
  356. serialNumber: '5302ProduceClosedFlag',
  357. tableId: "5302Produce",
  358. tableName: "待生产工单",
  359. columnProp: "closedFlag",
  360. headerAlign: "center",
  361. align: "left",
  362. columnLabel: "已关闭",
  363. columnWidth: 50,
  364. columnHidden: false,
  365. columnImage: false,
  366. columnSortable: false,
  367. sortLv: 0,
  368. status: true,
  369. fixed: false
  370. },
  371. {
  372. userId: this.$store.state.user.name,
  373. functionId: 5302,
  374. serialNumber: '5302ProduceCustomerId',
  375. tableId: "5302Produce",
  376. tableName: "待生产工单",
  377. columnProp: "customerId",
  378. headerAlign: "center",
  379. align: "left",
  380. columnLabel: "客户编号",
  381. columnWidth: 100,
  382. columnHidden: false,
  383. columnImage: false,
  384. columnSortable: true,
  385. sortLv: 0,
  386. status: true,
  387. fixed: false
  388. },
  389. {
  390. userId: this.$store.state.user.name,
  391. functionId: 5302,
  392. serialNumber: '5302ProduceCustomerName',
  393. tableId: "5302Produce",
  394. tableName: "待生产工单",
  395. columnProp: "customerName",
  396. headerAlign: "center",
  397. align: "left",
  398. columnLabel: "客户名称",
  399. columnWidth: 180,
  400. columnHidden: false,
  401. columnImage: false,
  402. columnSortable: true,
  403. sortLv: 0,
  404. status: true,
  405. fixed: false
  406. },
  407. {
  408. userId: this.$store.state.user.name,
  409. functionId: 5302,
  410. serialNumber: '5302ProduceTechInfo',
  411. tableId: "5302Produce",
  412. tableName: "待生产工单",
  413. columnProp: "techInfo",
  414. headerAlign: "center",
  415. align: "left",
  416. columnLabel: "技术注意事项",
  417. columnWidth: 180,
  418. columnHidden: false,
  419. columnImage: false,
  420. columnSortable: false,
  421. sortLv: 0,
  422. status: true,
  423. fixed: false
  424. },
  425. {
  426. userId: this.$store.state.user.name,
  427. functionId: 5302,
  428. serialNumber: '5302ProduceItemNo',
  429. tableId: "5302Produce",
  430. tableName: "待生产工单",
  431. columnProp: "itemNo",
  432. headerAlign: "center",
  433. align: "right",
  434. columnLabel: "工序号",
  435. columnWidth: 50,
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: false
  442. },
  443. {
  444. userId: this.$store.state.user.name,
  445. functionId: 5302,
  446. serialNumber: '5302ProduceItemDesc',
  447. tableId: "5302Produce",
  448. tableName: "待生产工单",
  449. columnProp: "itemDesc",
  450. headerAlign: "center",
  451. align: "left",
  452. columnLabel: "工序描述",
  453. columnWidth: 80,
  454. columnHidden: false,
  455. columnImage: false,
  456. columnSortable: false,
  457. sortLv: 0,
  458. status: true,
  459. fixed: false
  460. },
  461. {
  462. userId: this.$store.state.user.name,
  463. functionId: 5302,
  464. serialNumber: '5302ProduceSpec',
  465. tableId: "5302Produce",
  466. tableName: "待生产工单",
  467. columnProp: "spec",
  468. headerAlign: "center",
  469. align: "left",
  470. columnLabel: "规格型号",
  471. columnWidth: 80,
  472. columnHidden: false,
  473. columnImage: false,
  474. columnSortable: false,
  475. sortLv: 0,
  476. status: true,
  477. fixed: false
  478. },
  479. {
  480. userId: this.$store.state.user.name,
  481. functionId: 5302,
  482. serialNumber: '5302ProduceScheduledSeqNo',
  483. tableId: "5302Produce",
  484. tableName: "待生产工单",
  485. columnProp: "seqNo",
  486. headerAlign: "center",
  487. align: "right",
  488. columnLabel: "日计划单号",
  489. columnWidth: 100,
  490. columnHidden: false,
  491. columnImage: false,
  492. columnSortable: true,
  493. sortLv: 0,
  494. status: true,
  495. fixed: false
  496. },
  497. {
  498. userId: this.$store.state.user.name,
  499. functionId: 5302,
  500. serialNumber: '5302ProduceScheduledSeqNo',
  501. tableId: "5302Produce",
  502. tableName: "待生产工单",
  503. columnProp: "scheduledSeqNo",
  504. headerAlign: "center",
  505. align: "right",
  506. columnLabel: "次序号",
  507. columnWidth: 80,
  508. columnHidden: false,
  509. columnImage: false,
  510. columnSortable: true,
  511. sortLv: 0,
  512. status: true,
  513. fixed: false
  514. },
  515. {
  516. userId: this.$store.state.user.name,
  517. functionId: 5302,
  518. serialNumber: '5302ProduceRemark',
  519. tableId: "5302Produce",
  520. tableName: "待生产工单",
  521. columnProp: "remark",
  522. headerAlign: "center",
  523. align: "left",
  524. columnLabel: "备注",
  525. columnWidth: 80,
  526. columnHidden: false,
  527. columnImage: false,
  528. columnSortable: false,
  529. sortLv: 0,
  530. status: true,
  531. fixed: false
  532. },
  533. {
  534. userId: this.$store.state.user.name,
  535. functionId: 5302,
  536. serialNumber: '5302ProduceShiftNo',
  537. tableId: "5302Produce",
  538. tableName: "待生产工单",
  539. columnProp: "shiftNo",
  540. headerAlign: "center",
  541. align: "left",
  542. columnLabel: "班次",
  543. columnWidth: 80,
  544. columnHidden: false,
  545. columnImage: false,
  546. columnSortable: false,
  547. sortLv: 0,
  548. status: true,
  549. fixed: false
  550. },
  551. {
  552. userId: this.$store.state.user.name,
  553. functionId: 5302,
  554. serialNumber: '5302ProduceSite',
  555. tableId: "5302Produce",
  556. tableName: "待生产工单",
  557. columnProp: "site",
  558. headerAlign: "center",
  559. align: "left",
  560. columnLabel: "工厂编号",
  561. columnWidth: 80,
  562. columnHidden: false,
  563. columnImage: false,
  564. columnSortable: false,
  565. sortLv: 0,
  566. status: true,
  567. fixed: false
  568. },
  569. // {
  570. // userId: this.$store.state.user.name,
  571. // functionId: 5302,
  572. // serialNumber: '5302ProduceCustomerName',
  573. // tableId: "5302Produce",
  574. // tableName: "待生产工单",
  575. // columnProp: "customerName",
  576. // headerAlign: "center",
  577. // align: "center",
  578. // columnLabel: "客户名称",
  579. // columnWidth: 80,
  580. // columnHidden: false,
  581. // columnImage: false,
  582. // columnSortable: false,
  583. // sortLv: 0,
  584. // status: true,
  585. // fixed: false
  586. // },
  587. // {
  588. // userId: this.$store.state.user.name,
  589. // functionId: 5302,
  590. // serialNumber: '5302ProduceCustPartNo',
  591. // tableId: "5302Produce",
  592. // tableName: "待生产工单",
  593. // columnProp: "custPartNo",
  594. // headerAlign: "center",
  595. // align: "center",
  596. // columnLabel: "客户产品料号",
  597. // columnWidth: 80,
  598. // columnHidden: false,
  599. // columnImage: false,
  600. // columnSortable: false,
  601. // sortLv: 0,
  602. // status: true,
  603. // fixed: false
  604. // },
  605. // {
  606. // userId: this.$store.state.user.name,
  607. // functionId: 5302,
  608. // serialNumber: '5302ProduceQtyRequiredOriginal',
  609. // tableId: "5302Produce",
  610. // tableName: "待生产工单",
  611. // columnProp: "qtyRequiredOriginal",
  612. // headerAlign: "center",
  613. // align: "center",
  614. // columnLabel: "原始派工单需求数量",
  615. // columnWidth: 80,
  616. // columnHidden: false,
  617. // columnImage: false,
  618. // columnSortable: false,
  619. // sortLv: 0,
  620. // status: true,
  621. // fixed: false
  622. // },
  623. {
  624. userId: this.$store.state.user.name,
  625. functionId: 5302,
  626. serialNumber: '5302ProduceClosedBy',
  627. tableId: "5302Produce",
  628. tableName: "待生产工单",
  629. columnProp: "closedBy",
  630. headerAlign: "center",
  631. align: "left",
  632. columnLabel: "关闭人",
  633. columnWidth: 80,
  634. columnHidden: false,
  635. columnImage: false,
  636. columnSortable: false,
  637. sortLv: 0,
  638. status: true,
  639. fixed: false
  640. },
  641. {
  642. userId: this.$store.state.user.name,
  643. functionId: 5302,
  644. serialNumber: '5302ProduceClosedDate',
  645. tableId: "5302Produce",
  646. tableName: "待生产工单",
  647. columnProp: "closedDate",
  648. headerAlign: "center",
  649. align: "left",
  650. columnLabel: "关闭日期",
  651. columnWidth: 80,
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: false
  658. },
  659. ],
  660. searchData:{
  661. printFlag:'',
  662. site:'',
  663. partNo:'',
  664. resourceId:'',
  665. date1:new Date(),
  666. date2:'',
  667. orderNo:'',
  668. closedFlag:'N',
  669. customerName:'',
  670. },
  671. rowData:'',
  672. }
  673. },
  674. mounted () {
  675. this.$nextTick(() => {
  676. this.height = window.innerHeight - 195
  677. })
  678. },
  679. methods: {
  680. getBaseData(val){
  681. if (this.tagNo === 88){
  682. this.searchData.resourceId = val.ResourceID
  683. }
  684. },
  685. // 获取基础数据列表
  686. getBaseList(val){
  687. this.tagNo = val
  688. this.$nextTick(() => {
  689. let strVal = "";
  690. if (val === 88){
  691. strVal = this.searchData.resourceId
  692. }
  693. this.$refs.baseList.init(val,strVal)
  694. })
  695. },
  696. //导出excel
  697. createExportData () {
  698. return this.dataList;
  699. },
  700. startDownload () {
  701. // this.exportData = this.dataList
  702. },
  703. finishDownload () {
  704. },
  705. fields () {
  706. let json = "{"
  707. this.columnArray.forEach((item, index) => {
  708. if (index == this.columnArray.length - 1) {
  709. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  710. } else {
  711. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  712. }
  713. })
  714. json += "}"
  715. let s = eval("(" + json + ")")
  716. return s
  717. },
  718. // 导出 end
  719. refreshTables () {
  720. getProduceScheduleList(this.searchData).then(({data}) => {
  721. //设置查询数据
  722. this.dataList = data.rows;
  723. this.sum1=0;
  724. this.sum2=0;
  725. this.sum3=0;
  726. if(data.rows.length>0){
  727. for (let i = 0; i < data.rows.length; i++) {
  728. this.sum1=Number(this.sum1)+Number(data.rows[i].qtyRequired);
  729. this.sum2=Number(this.sum2)+Number(data.rows[i].qtyApprove);
  730. this.sum3=Number(this.sum3)+Number(data.rows[i].qtyReported);
  731. }
  732. }
  733. })
  734. },
  735. printAction (row) {
  736. this.rowData = row;
  737. this.printQty = 1;
  738. this.printModalFlag = true;
  739. },
  740. doPrint () {
  741. if (this.printQty == "" || this.printQty == 0 || this.printQty == null) {
  742. this.$alert('请输入大于0的打印份数!', '错误', {
  743. confirmButtonText: '确定'
  744. })
  745. return false;
  746. }
  747. if (this.printQty > 20) {
  748. this.$alert('打印份数过大请重新设置!', '错误', {
  749. confirmButtonText: '确定'
  750. })
  751. return false;
  752. }
  753. let array=[];
  754. let data = {
  755. site: this.rowData.site,
  756. orderNo: this.rowData.orderNo,
  757. itemNo: this.rowData.itemNo,
  758. scheduleDate: this.rowData.scheduledDate,
  759. shiftNo: this.rowData.shiftNo,
  760. seqNo: this.rowData.seqNo,
  761. qty: this.printQty,
  762. user: this.$store.state.user.name
  763. }
  764. // array.push(data);
  765. // printSerialNo(array).then(({data}) => {
  766. // if(data.code=="200"){
  767. // this.$message({
  768. // message: '打印成功',
  769. // type: 'success',
  770. // duration: 1500,
  771. // onClose: () => {
  772. // }
  773. // })
  774. // }else {
  775. // this.$alert(data.msg, '错误', {
  776. // confirmButtonText: '确定'
  777. // })
  778. // }
  779. // })
  780. // }
  781. getScheduleSerialNo(data).then(({data}) => {
  782. if (data.code == 0) {
  783. if (data.total == 0) {
  784. this.$alert("该日计划下不存在序列号请联系管理员!", '错误', {
  785. confirmButtonText: '确定'
  786. })
  787. return false;
  788. }else {
  789. for (let i = 0; i <data.total ; i++) {
  790. for(let x=0;x<this.printQty;x++){
  791. let printData={serialNo:data.rows[i].serialNo}
  792. array.push(printData);
  793. }
  794. }
  795. printMaterialLabel(array);
  796. this.refreshTables()
  797. this.printModalFlag = false;
  798. }
  799. } else {
  800. this.$alert(data.msg, '错误', {
  801. confirmButtonText: '确定'
  802. })
  803. }
  804. })
  805. },
  806. routingRowClassName2 ({row, rowIndex}) {
  807. let date = new Date()
  808. let planDate = new Date(row.planFinishTime.replace('-', '/'))
  809. //判断当前行颜色参数
  810. if (row.closedFlag == 'Y' && row.qtyReported >= row.qtyRequired) {
  811. return 'customer-row-1'
  812. } else if (row.closedFlag == 'Y' && row.qtyReported < row.qtyRequired) {
  813. return 'customer-row-2'
  814. } else if (planDate < date) {
  815. return 'customer-row-3'
  816. }
  817. //判断当前行颜色参数
  818. // if (row.printFlag == "Y") {
  819. // return 'customer-row-2';
  820. // }
  821. },
  822. }
  823. }
  824. </script>
  825. <style scoped>
  826. </style>