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.

906 lines
35 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
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="920px" style="height: 680px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" style="height: 495px;"
  6. label-width="80px">
  7. <!-- 菜单信息 -->
  8. <el-row>
  9. <el-col :span="24">
  10. <el-form-item :label="'当前时间'">
  11. <el-date-picker disabled="disabled" style="width: 145px;"
  12. v-model="pageData.reportedTime"
  13. format="yyyy-MM-dd HH:mm:ss"
  14. value-format="yyyy-MM-dd HH:mm:ss"
  15. placeholder="">
  16. </el-date-picker>
  17. </el-form-item>
  18. <el-form-item class="customer-button">
  19. <el-button type="primary" style="margin-left: 10px; margin-bottom: 5px;">
  20. 列表</el-button>
  21. </el-form-item>
  22. <el-form-item class="customer-button">
  23. <el-button type="primary" @click="refreshPageData" style="margin-left: 10px; margin-bottom: 5px;">
  24. 刷新</el-button>
  25. </el-form-item>
  26. <el-form-item class="customer-button">
  27. <el-button type="primary" @click="finishRollBun" style="margin-left: 10px; margin-bottom: 5px;">
  28. 保存</el-button>
  29. </el-form-item>
  30. <el-form-item class="customer-button">
  31. <el-button type="primary" @click="closeDialog" style="margin-left: 10px; margin-bottom: 5px;">
  32. 关闭</el-button>
  33. </el-form-item>
  34. </el-col>
  35. </el-row>
  36. <!-- 卷数量统计 班次信息 -->
  37. <el-form>
  38. <fieldset class="customer-fieldset" style="width: 495px;">
  39. <legend>卷数量统计</legend>
  40. <el-form-item class="customer-item">
  41. <el-checkbox disabled="disabled" style="margin-top: 15px;" true-label="Y" false-label="N"
  42. v-model="pageData.reportedFlag">是否报告产量</el-checkbox>
  43. </el-form-item>
  44. <el-form-item class="customer-item" label="总良品数量:" style="margin-top: -10px;">
  45. <el-input v-if="this.preItemNo <= 0"v-model="pageData.approvedQty" type="number" @blur="checkValidApprovedQty"
  46. style="width: 80px;" ></el-input>
  47. <el-input v-if="this.preItemNo > 0" disabled class="customer-input-color-red"
  48. v-model="pageData.approvedQty" @blur="checkValidApprovedQty" type="number" style="width: 80px;" ></el-input>
  49. </el-form-item>
  50. <el-form-item class="customer-item" label="总不良品数量:" style="margin-top: -10px;">
  51. <el-input v-model="pageData.defectedQty" disabled="disabled" style="width: 80px;"></el-input>
  52. </el-form-item>
  53. <el-form-item class="customer-item" label="总数量" style="margin-top: -10px;">
  54. <el-input v-model="pageData.totalQty" disabled="disabled" style="width: 80px;"></el-input>
  55. </el-form-item>
  56. <el-form-item class="customer-item" label="其他卷数量:" style="margin-top: -10px;">
  57. <el-input v-model="pageData.otherRollQty" disabled="disabled" style="width: 80px;"></el-input>
  58. </el-form-item>
  59. </fieldset>
  60. <!-- 操作员信息和班次信息 -->
  61. <fieldset class="customer-fieldset"
  62. style="margin-left: 500px; margin-top: -70px; ;width: 400px;">
  63. <legend>人员排程班次信息</legend>
  64. <el-form-item class="customer-item" label="操作员:">
  65. <el-input v-model="operatorData.operatorId" disabled="disabled" style="width: 80px;" ></el-input>
  66. </el-form-item>
  67. <el-form-item class="customer-item" label="操作员姓名:">
  68. <el-input v-model="operatorData.operatorName" disabled="disabled" style="width: 80px;"></el-input>
  69. </el-form-item>
  70. <el-form-item class="customer-item" label="排产日期:">
  71. <el-input v-model="pageData.scheduledDate" disabled="disabled" style="width: 80px;" ></el-input>
  72. </el-form-item>
  73. <el-form-item class="customer-item" label="班次:">
  74. <el-input v-model="pageData.shiftDesc" disabled="disabled" style="width: 80px;"></el-input>
  75. </el-form-item>
  76. <el-button type="info" :disabled="buttonTags.selectShiftFlag" plain @click="selectSchduleShiftModal"
  77. style="margin-left: -10px; margin-top: 10px; height: 20px; padding: 3px 3px;">
  78. <icon-svg name="ellipsis" style="height: 10px; width: 10px;" ></icon-svg>
  79. </el-button>
  80. </fieldset>
  81. </el-form>
  82. <!-- 卷生产时间统计产量报告 -->
  83. <el-form style="margin-top: 5px;">
  84. <fieldset class="customer-fieldset" style="width: 320px;">
  85. <legend>卷生产时间统计</legend>
  86. <!-- 调机时间 -->
  87. <el-row>
  88. <el-col :span="24">
  89. <el-form-item label="总调机时间:">
  90. <el-input v-model="pageData.totalSetupTime" disabled="disabled" style="width: 80px;" ></el-input>
  91. </el-form-item>
  92. <el-form-item label="总调机过程停机时间:">
  93. <el-input v-model="pageData.totalDowntimeTimeSetup" disabled="disabled" style="width: 100px;"></el-input>
  94. </el-form-item>
  95. <el-form-item label="净调机时间:" >
  96. <el-input v-model="pageData.totalPureSetupTime" disabled="disabled" style="width: 80px;"></el-input>
  97. </el-form-item>
  98. </el-col>
  99. </el-row>
  100. <!-- 生产时间 -->
  101. <el-row>
  102. <el-col :span="24">
  103. <el-form-item label="总生产时间">
  104. <el-input v-model="pageData.totalProdTime" disabled="disabled" style="width: 80px;"></el-input>
  105. </el-form-item>
  106. <el-form-item label="总生产过程停机时间:">
  107. <el-input v-model="pageData.totalDowntimeTimeProd" disabled="disabled" style="width: 100px;"></el-input>
  108. </el-form-item>
  109. <el-form-item label="净生产时间:" >
  110. <el-input v-model="pageData.totalPureProdTime" disabled="disabled" style="width: 80px;"></el-input>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. <!-- 制造时间 -->
  115. <el-row>
  116. <el-col :span="24">
  117. <el-form-item label="总制造时间:">
  118. <el-input v-model="pageData.totalManufactureTime" disabled="disabled" style="width: 80px;"></el-input>
  119. </el-form-item>
  120. <el-form-item label="总制造过程停机时间:">
  121. <el-input v-model="pageData.totalManufactureDowntimeTime" disabled="disabled" style="width: 100px;"></el-input>
  122. </el-form-item>
  123. <el-form-item label="净制造时间:" >
  124. <el-input v-model="pageData.totalPureManufactureTime" disabled="disabled" style="width: 80px;"></el-input>
  125. </el-form-item>
  126. </el-col>
  127. </el-row>
  128. </fieldset>
  129. <!-- 产量报告 -->
  130. <fieldset class="customer-fieldset"
  131. style="margin-left: 325px; margin-top: -165px; width: 575px;">
  132. <legend>产量报告</legend>
  133. <!-- 开工时间 -->
  134. <el-row>
  135. <el-col :span="24">
  136. <el-form-item label="开工时间">
  137. <el-input v-model="pageData.eventTime" disabled="disabled" style="width: 130px;"></el-input>
  138. </el-form-item>
  139. <el-form-item label="完工时间">
  140. <el-input v-model="pageData.tillTime" disabled="disabled" style="width: 130px;"></el-input>
  141. </el-form-item>
  142. <el-form-item label="生产时间" >
  143. <el-input v-model="pageData.sfdcProdTime" disabled="disabled" style="width: 80px;"></el-input>
  144. </el-form-item>
  145. <el-form-item label="调机时间" >
  146. <el-input v-model="pageData.sfdcSetupTime" disabled="disabled" style="width: 80px;"></el-input>
  147. </el-form-item>
  148. <el-form-item label="制造时间" >
  149. <el-input v-model="pageData.sfdcManufactureTime" disabled="disabled" style="width: 80px;"></el-input>
  150. </el-form-item>
  151. </el-col>
  152. </el-row>
  153. <!-- 合格数量 -->
  154. <el-row>
  155. <el-col :span="24">
  156. <el-form-item label="合格数量">
  157. <el-input v-model="pageData.sfdcApprovedQty" disabled="disabled" style="width: 130px;"></el-input>
  158. </el-form-item>
  159. <el-form-item label="不合格数量">
  160. <el-input v-model="pageData.defectedQty" disabled="disabled" style="width: 130px;"></el-input>
  161. </el-form-item>
  162. <el-form-item label="报告数量" >
  163. <el-input v-model="pageData.sfdcReportedQty" disabled="disabled" style="width: 80px;"></el-input>
  164. </el-form-item>
  165. <el-form-item label="调机停机">
  166. <el-input v-model="pageData.sfdcSetupDownTime" style="width: 80px;"></el-input>
  167. </el-form-item>
  168. <el-form-item label="生产调机" >
  169. <el-input v-model="pageData.sfdcProdSetupTime" style="width: 80px;"></el-input>
  170. </el-form-item>
  171. </el-col>
  172. </el-row>
  173. <!-- 备注 -->
  174. <el-row>
  175. <el-col :span="24">
  176. <el-form-item label="remark">
  177. <el-input v-model="pageData.remark" disabled="disabled" style="width: 430px;"></el-input>
  178. </el-form-item>
  179. <el-form-item label="停机时间">
  180. <el-input v-model="pageData.sfdcDownTime" style="width: 80px;"></el-input>
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. </fieldset>
  185. </el-form>
  186. <!-- 主材料 -->
  187. <el-form>
  188. <fieldset class="customer-fieldset" style="width: 830px;">
  189. <legend>主材料</legend>
  190. <el-table
  191. height="180"
  192. :data="sfdcMaterialList"
  193. :cell-style="customerCellStyle" :cell-class-name="customerCellClassName"
  194. border
  195. v-loading="dataListLoading"
  196. style="width: 100%; margin-top: -5px;">
  197. <el-table-column
  198. v-for="(item,index) in columnMaterialArray" :key="index"
  199. :sortable="item.columnSortable"
  200. :prop="item.columnProp"
  201. :header-align="item.headerAlign"
  202. :show-overflow-tooltip="item.showOverflowTooltip"
  203. :align="item.align"
  204. :fixed="item.fixed"
  205. :width="item.columnWidth"
  206. :label="item.columnLabel">
  207. <template slot-scope="scope">
  208. <el-input type="number" class="table-input" align="right" @blur="checkValidQty(scope.row)"
  209. v-if="item.columnHidden" v-model="scope.row[item.columnProp]"></el-input>
  210. <span v-else>{{scope.row[item.columnProp]}}</span>
  211. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  212. style="width: 100px; height: 80px"/></span>
  213. </template>
  214. </el-table-column>
  215. </el-table>
  216. </fieldset>
  217. </el-form>
  218. </el-form>
  219. </el-dialog>
  220. <!-- 异常原因录入的组件 -->
  221. <comExceptionReason ref="comExceptionReason" :close-on-click-modal="false"
  222. :visible.sync="showExceptionFlag"
  223. @initExceptionReason = "initExceptionReason">
  224. </comExceptionReason>
  225. <!-- 班次选择组件 -->
  226. <comSelectShift ref="comSelectShift" :close-on-click-modal="false"
  227. :visible.sync="showShiftFlag"
  228. @initScheduleShift = "initScheduleShift">
  229. </comSelectShift>
  230. </div>
  231. </template>
  232. <script>
  233. /*添加组件*/
  234. import comExceptionReason from "./com_exception_reason";//异常远远
  235. import comSelectShift from "./com_select_shift";//班次选择的组件
  236. import {
  237. getCurrentRollReportedQty,
  238. countSfdcTimeQty,
  239. getScheduleShiftData,
  240. getSfdcTimeMaxAndMinTime,
  241. getSfdcTimeData,
  242. getSfdcReportedData,
  243. getSfdcMaterialByRollNo,
  244. checkFinishPartRollWithNoFqc,
  245. finishPartRollWithNoFqc
  246. } from '@/api/yieldReport/com_finish_part_roll.js';
  247. export default {
  248. data() {
  249. return {
  250. titleCon: '产量报告',
  251. showExceptionFlag: false,
  252. showShiftFlag: false,
  253. preItemNo: 0,
  254. sfdcTimeList: [],
  255. scheduleData: {
  256. site: this.$store.state.user.site,
  257. username: this.$store.state.user.name,
  258. seqNo: '',
  259. orderNo: '',
  260. itemNo: 0,
  261. partNo: '',
  262. workCenterNo: '',
  263. workCenterDesc: '',
  264. resourceDesc: '',
  265. rollNo: '',
  266. partDesc: '',
  267. planStartTime: '',
  268. planFinishTime: '',
  269. qtyRequiredOriginal: 0,
  270. scheduledDate: '',
  271. shiftNo: '',
  272. preItemDesc: '',
  273. nextItemDesc: '',
  274. nextItemNo: 0,
  275. operatorId: '',
  276. functionName: '',
  277. currentRollFlag: false
  278. },
  279. pageData: {
  280. site: this.$store.state.user.site,
  281. username: this.$store.state.user.name,
  282. orderNo: '',
  283. itemNo: 0,
  284. seqNo: '',
  285. rollNo: '',
  286. resourceId: '',
  287. scheduledDate: '',
  288. shiftNo: '',
  289. reportedTime: this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'),
  290. reportedFlag: 'N',
  291. approvedQty: 0,
  292. defectedQty: 0,
  293. totalQty: 0,
  294. editNewRollQty: 0,
  295. otherRollQty: '',
  296. shiftDesc: '',
  297. totalSetupTime: 0,
  298. totalDowntimeTimeSetup: 0,
  299. totalPureSetupTime: 0,
  300. totalProdTime: 0,
  301. totalDowntimeTimeProd: 0,
  302. totalPureProdTime: 0,
  303. totalManufactureTime: 0,
  304. totalManufactureDowntimeTime: 0,
  305. totalPureManufactureTime: 0,
  306. sfdcProdTime: 0,//生产时间
  307. sfdcSetupTime: 0,//调机时间
  308. sfdcManufactureTime: 0,//制造时间
  309. sfdcSetupDownTime: 0,//调机停机时间
  310. sfdcProdSetupTime: 0,//生产调机时间
  311. sfdcDownTime: 0,//停机时间
  312. eventTime: '',
  313. tillTime: '',
  314. sfdcApprovedQty: 0,
  315. sfdcDefectedQty: 0,
  316. sfdcReportedQty: 0,
  317. remark: '',
  318. exceptionFlag: 'N',
  319. exceptionReason: '',
  320. createNewRollFlag: 'N',
  321. },
  322. operatorData: {
  323. site: this.$store.state.user.site,
  324. username: this.$store.state.user.name,
  325. operatorId: '',
  326. operatorName: '',
  327. status: '',
  328. seqNo: '',
  329. showFlag: false
  330. },
  331. sfdcMaterialList: [],
  332. columnMaterialArray: [
  333. {
  334. userId: this.$store.state.user.name,
  335. functionId: 5303,
  336. serialNumber: '5303MaterialReportDate',
  337. tableId: "5303Material",
  338. tableName: "派工单材料",
  339. columnProp: "reportDate",
  340. headerAlign: "center",
  341. align: "center",
  342. columnLabel: "报告时间",
  343. columnWidth: 125,
  344. columnHidden: false,
  345. columnImage: false,
  346. columnSortable: false,
  347. sortLv: 0,
  348. status: true,
  349. fixed: false
  350. },
  351. {
  352. userId: this.$store.state.user.name,
  353. functionId: 5303,
  354. serialNumber: '5303MaterialReportedBy',
  355. tableId: "5303Material",
  356. tableName: "派工单材料",
  357. columnProp: "reportedBy",
  358. headerAlign: "center",
  359. align: "center",
  360. columnLabel: "报告人",
  361. columnWidth: 80,
  362. columnHidden: false,
  363. columnImage: false,
  364. columnSortable: false,
  365. sortLv: 0,
  366. status: true,
  367. fixed: false
  368. },
  369. {
  370. userId: this.$store.state.user.name,
  371. functionId: 5303,
  372. serialNumber: '5303MaterialRmRollNo',
  373. tableId: "5303Material",
  374. tableName: "派工单材料",
  375. columnProp: "rmRollNo",
  376. headerAlign: "center",
  377. align: "center",
  378. columnLabel: "材料卷号",
  379. columnWidth: 100,
  380. columnHidden: false,
  381. columnImage: false,
  382. columnSortable: false,
  383. sortLv: 0,
  384. status: true,
  385. fixed: false
  386. },
  387. {
  388. userId: this.$store.state.user.name,
  389. functionId: 5303,
  390. serialNumber: '5303MaterialPartNo',
  391. tableId: "5303Material",
  392. tableName: "派工单材料",
  393. columnProp: "partNo",
  394. headerAlign: "center",
  395. align: "center",
  396. columnLabel: "零部件编码",
  397. columnWidth: 100,
  398. columnHidden: false,
  399. columnImage: false,
  400. columnSortable: false,
  401. sortLv: 0,
  402. status: true,
  403. fixed: false
  404. },
  405. {
  406. userId: this.$store.state.user.name,
  407. functionId: 5303,
  408. serialNumber: '5303MaterialStartDate',
  409. tableId: "5303Material",
  410. tableName: "派工单材料",
  411. columnProp: "startDate",
  412. headerAlign: "center",
  413. align: "center",
  414. columnLabel: "开始使用时间",
  415. columnWidth: 125,
  416. columnHidden: false,
  417. columnImage: false,
  418. columnSortable: false,
  419. sortLv: 0,
  420. status: true,
  421. fixed: false
  422. },
  423. {
  424. userId: this.$store.state.user.name,
  425. functionId: 5303,
  426. serialNumber: '5303MaterialTransQty',
  427. tableId: "5303Material",
  428. tableName: "派工单材料",
  429. columnProp: "transQty",
  430. headerAlign: "center",
  431. align: "center",
  432. columnLabel: "数量",
  433. columnWidth: 80,
  434. columnHidden: false,
  435. columnImage: false,
  436. columnSortable: false,
  437. sortLv: 0,
  438. status: true,
  439. fixed: false
  440. },
  441. {
  442. userId: this.$store.state.user.name,
  443. functionId: 5303,
  444. serialNumber: '5303MaterialNetIssueQty',
  445. tableId: "5303Material",
  446. tableName: "派工单材料",
  447. columnProp: "netIssueQty",
  448. headerAlign: "center",
  449. align: "center",
  450. columnLabel: "本卷耗用数量",
  451. columnWidth: 100,
  452. columnHidden: true,
  453. columnImage: false,
  454. columnSortable: false,
  455. sortLv: 0,
  456. status: true,
  457. fixed: false
  458. },
  459. {
  460. userId: this.$store.state.user.name,
  461. functionId: 5303,
  462. serialNumber: '5303MaterialKeyRMFlag',
  463. tableId: "5303Material",
  464. tableName: "派工单材料",
  465. columnProp: "keyRMFlag",
  466. headerAlign: "center",
  467. align: "center",
  468. columnLabel: "是否主材",
  469. columnWidth: 80,
  470. columnHidden: false,
  471. columnImage: false,
  472. columnSortable: false,
  473. sortLv: 0,
  474. status: true,
  475. fixed: false
  476. },
  477. {
  478. userId: this.$store.state.user.name,
  479. functionId: 5303,
  480. serialNumber: '5303MaterialSAPBOMItemNo',
  481. tableId: "5303Material",
  482. tableName: "派工单材料",
  483. columnProp: "sAPBOMItemNo",
  484. headerAlign: "center",
  485. align: "center",
  486. columnLabel: "SAP BOM序号",
  487. columnWidth: 100,
  488. columnHidden: false,
  489. columnImage: false,
  490. columnSortable: false,
  491. sortLv: 0,
  492. status: true,
  493. fixed: false
  494. }
  495. ],
  496. dataListLoading: false,
  497. buttonTags:{
  498. selectShiftFlag: true,
  499. },
  500. }
  501. },
  502. components: {
  503. comExceptionReason,/*异常原因的组件*/
  504. comSelectShift,/*班次选择的组件*/
  505. },
  506. methods: {
  507. /*初始化页面参数*/
  508. init(scheduleData, operatorData) {
  509. //初始化参数
  510. this.scheduleData = scheduleData;
  511. //初始化参数
  512. this.pageData.orderNo = scheduleData.orderNo;
  513. this.pageData.itemNo = scheduleData.itemNo;
  514. this.pageData.seqNo = scheduleData.seqNo;
  515. //设置首道工序
  516. this.preItemNo = scheduleData.preItemNo
  517. //特殊处理 判断是否是空的卷号
  518. if(null == scheduleData.rollNo || scheduleData.rollNo == ''){
  519. this.pageData.rollNo = '暂无卷号';
  520. this.scheduleData.rollNo = '暂无卷号';
  521. }else{
  522. this.pageData.rollNo = scheduleData.rollNo;
  523. }
  524. this.pageData.scheduledDate = scheduleData.scheduledDate;
  525. this.pageData.shiftNo = scheduleData.shiftNo;
  526. this.pageData.resourceId = scheduleData.resourceId;
  527. this.pageData.operatorId = operatorData.operatorId;
  528. //重置时间
  529. this.pageData.reportedTime = this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
  530. //初始化操作员对象
  531. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  532. //初始化标题
  533. this.titleCon = '产量报告 \
  534. 派工单号:'+scheduleData.seqNo;
  535. //处理异常的原因
  536. this.pageData.exceptionFlag = 'N';
  537. this.pageData.exceptionReason = '';
  538. //刷新当前派工单的信息
  539. this.refreshPageData();
  540. },
  541. /*关闭modal*/
  542. closeDialog(){
  543. //刷新报工的页面
  544. this.$emit('refreshPageData');
  545. //关闭当前的页面
  546. this.$emit('update:visible', false);
  547. },
  548. /*生产过程的停机组件*/
  549. exceptionReasonModal() {
  550. //1.首先调用菜单判断方式 打开生产过程的停机的页面
  551. //checkProduceButton('produceDownFlag');
  552. //打开生产过程的工具的页面
  553. this.$nextTick(() => {
  554. this.show = true;
  555. this.$refs.comProduceDown.init(this.scheduleData, this.operatorData)
  556. });
  557. },
  558. /*刷新当前的页面参数*/
  559. async refreshPageData(){
  560. //1.刷新当前卷的报工数据
  561. await getCurrentRollReportedQty(this.scheduleData).then(({data}) => {
  562. this.pageData.approvedQty = data.row.approvedQty;
  563. this.pageData.defectedQty = data.row.defectedQty;
  564. this.pageData.totalQty = data.row.totalQty;
  565. this.pageData.otherRollQty = data.row.otherRollQty;
  566. })
  567. //2.刷新当前卷的时间信息
  568. await countSfdcTimeQty(this.scheduleData).then(({data}) => {
  569. this.pageData.totalSetupTime = data.row.totalSetupTime;
  570. this.pageData.totalDowntimeTimeSetup = data.row.totalDowntimeTimeSetup;
  571. this.pageData.totalPureSetupTime = data.row.totalPureSetupTime;
  572. this.pageData.totalProdTime = data.row.totalProdTime;
  573. this.pageData.totalDowntimeTimeProd = data.row.totalDowntimeTimeProd;
  574. this.pageData.totalPureProdTime = data.row.totalPureProdTime;
  575. this.pageData.totalManufactureTime = data.row.totalManufactureTime;
  576. this.pageData.totalManufactureDowntimeTime = data.row.totalManufactureDowntimeTime;
  577. this.pageData.totalPureManufactureTime = data.row.totalPureManufactureTime;
  578. //先预设一些参数 后期方法再计算
  579. //生产时间=总生产时间
  580. this.pageData.sfdcProdTime = this.pageData.totalProdTime;
  581. //调机时间=总调机时间
  582. this.pageData.sfdcSetupTime = this.pageData.totalSetupTime;
  583. //制造时间=总制造时间
  584. this.pageData.sfdcManufactureTime = this.pageData.totalManufactureTime;
  585. //调机停机=总调机过程停机时间
  586. this.pageData.sfdcSetupDownTime = this.pageData.totalDowntimeTimeSetup;
  587. //生产调机=总生产过程停机时间
  588. this.pageData.sfdcProdSetupTime = this.pageData.totalDowntimeTimeProd;
  589. //停机时间=总制造过程停机时间
  590. this.pageData.sfdcDownTime = this.pageData.totalManufactureDowntimeTime;
  591. });
  592. //3.刷新派工单的班次信息
  593. await getScheduleShiftData(this.pageData).then(({data}) => {
  594. let specialAuth = 'N';
  595. //区分是否存在班次
  596. if(data.code == 500){
  597. this.pageData.shiftDesc = '无班次';//重置班次
  598. this.pageData.scheduledDate = '';//重置排产日期
  599. this.pageData.shiftNo = '';
  600. }else{
  601. this.pageData.shiftDesc = data.row.shiftDesc;//重置班次
  602. this.pageData.scheduledDate = data.row.scheduledDate.substring(0, 10);//重置排产日期
  603. this.pageData.shiftNo = data.row.shiftNo;
  604. //设置结果
  605. specialAuth = data.row.specialAuth;
  606. }
  607. //根据不同设置不同的属性
  608. if("Y" === specialAuth){
  609. this.buttonTags.selectShiftFlag = false;
  610. }else{
  611. this.buttonTags.selectShiftFlag = true;
  612. }
  613. });
  614. //4.刷新当前卷的最早和最晚时间
  615. await getSfdcTimeMaxAndMinTime(this.scheduleData).then(({data}) => {
  616. this.pageData.eventTime = data.row.eventTime;
  617. this.pageData.tillTime = data.row.tillTime;
  618. });
  619. //5.刷新当前卷的Sfdc表的时间
  620. await getSfdcTimeData(this.scheduleData).then(({data}) => {
  621. //先判断是否成功查询
  622. if(data.resultCode == 200){
  623. //判断是否操作成功
  624. this.pageData.eventTime = data.row.finishTime;
  625. this.pageData.sfdcProdTime = data.row.sfdcProdTime;
  626. this.pageData.sfdcSetupTime = data.row.sfdcSetupTime;
  627. this.pageData.sfdcManufactureTime = data.row.sfdcManufactureTime;
  628. this.pageData.sfdcDownTime = data.row.sfdcDownTime;
  629. this.pageData.sfdcSetupDownTime = data.row.sfdcSetupDownTime;
  630. this.pageData.sfdcProdSetupTime = data.row.sfdcProdSetupTime;
  631. }else{
  632. //暂时不处理数据
  633. }
  634. });
  635. //6.刷新当前卷的报工数据
  636. await getSfdcReportedData(this.scheduleData).then(({data}) => {
  637. this.pageData.sfdcApprovedQty = this.pageData.approvedQty - 0;
  638. this.pageData.sfdcDefectedQty = this.pageData.defectedQty - 0;
  639. this.pageData.sfdcReportedQty = this.pageData.sfdcApprovedQty + this.pageData.sfdcDefectedQty;
  640. });
  641. //刷新当前卷的时间数据
  642. await getSfdcMaterialByRollNo(this.scheduleData).then(({data}) => {
  643. this.sfdcMaterialList = data.rows;
  644. });
  645. },
  646. /*刷新当前卷的报工数据汇总*/
  647. refreshCurrentRollReportedQty(){
  648. getCurrentRollReportedQty(this.scheduleData).then(({data}) => {
  649. this.pageData.approvedQty = data.row.approvedQty;
  650. this.pageData.defectedQty = data.row.defectedQty;
  651. this.pageData.totalQty = data.row.totalQty;
  652. this.pageData.otherRollQty = data.row.otherRollQty;
  653. })
  654. },
  655. //刷新当前卷的时间信息
  656. refreshCurrentRollTimeQty(){
  657. countSfdcTimeQty(this.scheduleData).then(({data}) => {
  658. this.pageData.totalSetupTime = data.row.totalSetupTime;
  659. this.pageData.totalDowntimeTimeSetup = data.row.totalDowntimeTimeSetup;
  660. this.pageData.totalPureSetupTime = data.row.totalPureSetupTime;
  661. this.pageData.totalProdTime = data.row.totalProdTime;
  662. this.pageData.totalDowntimeTimeProd = data.row.totalDowntimeTimeProd;
  663. this.pageData.totalPureProdTime = data.row.totalPureProdTime;
  664. this.pageData.totalManufactureTime = data.row.totalManufactureTime;
  665. this.pageData.totalManufactureDowntimeTime = data.row.totalManufactureDowntimeTime;
  666. this.pageData.totalPureManufactureTime = data.row.totalPureManufactureTime;
  667. });
  668. },
  669. //刷新派工单的班次信息
  670. refreshScheduleShiftData(){
  671. getScheduleShiftData(this.scheduleData).then(({data}) => {
  672. //区分是否存在班次
  673. if(data.code == 500){
  674. this.pageData.shiftDesc = '无班次';//重置班次
  675. this.pageData.scheduledDate = '';//重置排产日期
  676. this.pageData.shiftNo = '';
  677. }else{
  678. this.pageData.shiftDesc = data.row.shiftDesc;//重置班次
  679. this.pageData.scheduledDate = data.row.scheduledDate.substring(0, 10);//重置排产日期
  680. this.pageData.shiftNo = data.row.shiftNo;
  681. }
  682. });
  683. },
  684. //刷新当前卷的时间信息
  685. refreshCurrentRollMaxAndMinTime(){
  686. getSfdcTimeMaxAndMinTime(this.scheduleData).then(({data}) => {
  687. this.pageData.eventTime = data.row.eventTime;
  688. this.pageData.tillTime = data.row.tillTime;
  689. });
  690. },
  691. //刷新当前卷的Sfdc的信息
  692. refreshSfdcTimeData(){
  693. getSfdcTimeData(this.scheduleData).then(({data}) => {
  694. //判断是否操作成功
  695. this.pageData.eventTime = data.row.finishTime;
  696. this.pageData.sfdcProdTime = data.row.sfdcProdTime;
  697. this.pageData.sfdcSetupTime = data.row.sfdcSetupTime;
  698. this.pageData.sfdcManufactureTime = data.row.sfdcManufactureTime;
  699. this.pageData.sfdcDownTime = data.row.sfdcDownTime;
  700. this.pageData.sfdcSetupDownTime = data.row.sfdcSetupDownTime;
  701. this.pageData.sfdcProdSetupTime = data.row.sfdcProdSetupTime;
  702. });
  703. },
  704. //刷新当前卷的报工数据
  705. refreshSfdcData(){
  706. getSfdcReportedData(this.scheduleData).then(({data}) => {
  707. this.pageData.sfdcApprovedQty = this.pageData.approvedQty - 0;
  708. this.pageData.sfdcDefectedQty = this.pageData.defectedQty - 0;
  709. this.pageData.sfdcReportedQty = this.pageData.sfdcApprovedQty + this.pageData.sfdcDefectedQty;
  710. });
  711. },
  712. //刷新当前卷的时间数据
  713. refreshSfdcMaterialTable(){
  714. getSfdcMaterialByRollNo(this.scheduleData).then(({data}) => {
  715. this.sfdcMaterialList = data.rows;
  716. });
  717. },
  718. /*检查数据是否有效*/
  719. checkValidQty(row){
  720. //判断当前是否为空
  721. if(row.netIssueQty == ''){
  722. this.$message.error('材料上本卷耗用数量不能为空!');
  723. row.netIssueQty = 0;//重新赋值
  724. return false;
  725. }
  726. //判断当前是否有效
  727. if(row.netIssueQty <= 0){
  728. this.$message.error('材料耗用数量必须大于0!');
  729. return false;
  730. }
  731. //判断是否超限
  732. if(row.netIssueQty > row.transQty){
  733. this.$message.error('材料耗用数量大于发料数量!');
  734. row.netIssueQty = 0;//重新赋值
  735. return false;
  736. }
  737. },
  738. /*添加定制的css类*/
  739. customerCellClassName({row, column, rowIndex, columnIndex}) {
  740. if(column.property == 'netIssueQty'){
  741. return 'customer-number-cell';
  742. }
  743. },
  744. /*添加定制的cess样式*/
  745. customerCellStyle({row, column, rowIndex, columnIndex}) {
  746. if(column.property == 'netIssueQty'){
  747. return 'padding: 0px 0px;';
  748. }
  749. },
  750. /*检验良品的总数量*/
  751. checkValidApprovedQty(){
  752. //调用刷新的方法
  753. this.refreshSfdcData();
  754. this.pageData.totalQty = parseFloat(this.pageData.approvedQty) + parseFloat(this.pageData.defectedQty);
  755. },
  756. /*结束当前的操作*/
  757. finishRollBun(){
  758. //首先判断数值是否通过判断
  759. let approvedQty = this.pageData.approvedQty;
  760. if(approvedQty == null || approvedQty == ''){
  761. this.$message.error('请输入良品总数量!');
  762. this.pageData.approvedQty = 0;//重新赋值
  763. return false;
  764. }
  765. if(approvedQty <= 0){
  766. this.$message.error('良品总数量必须大于0!');
  767. this.pageData.approvedQty = 0;//重新赋值
  768. return false;
  769. }
  770. //班次判断
  771. if(this.pageData.shiftDesc == '无班次'){
  772. this.$message.error('该时间段内没有匹配的班次信息,请联系相关人员!!');
  773. return false;
  774. }
  775. //验证通过提交到后台
  776. let postData = {'pageData': JSON.stringify(this.pageData), 'materialList': JSON.stringify(this.sfdcMaterialList)};
  777. //先调用检查方法
  778. checkFinishPartRollWithNoFqc(postData).then(({data}) => {
  779. //判断是否成功
  780. if(data.code == 500){
  781. this.$message.error(data.msg);
  782. }else{
  783. //执行结束卷操作
  784. this.finishPartRollOperation();
  785. }
  786. });
  787. },
  788. /*结束卷的具体操作*/
  789. finishPartRollOperation(){
  790. //验证通过提交到后台
  791. let postData = {'pageData': JSON.stringify(this.pageData), 'materialList': JSON.stringify(this.sfdcMaterialList)};
  792. //处理信息
  793. finishPartRollWithNoFqc(postData).then(({data}) => {
  794. //判断操作是否成功
  795. if(data.code == 500){
  796. this.$message.error(data.msg);
  797. }else{
  798. //关闭当前的页面
  799. this.closeDialog();
  800. }
  801. })
  802. },
  803. /*打开异常原因录入页面*/
  804. showExceptionReasonModal(){
  805. //1.首先调用菜单判断方式 打开生产过程的材料的页面
  806. //checkProduceButton('produceMaterialFlag');
  807. //打开生产过程的工具的页面
  808. this.$nextTick(() => {
  809. this.showExceptionFlag = true;
  810. this.$refs.comExceptionReason.init();
  811. });
  812. },
  813. /*处理异常的原因*/
  814. initExceptionReason(exceptionReason){
  815. //处理异常的原因
  816. this.pageData.exceptionFlag = 'Y';
  817. this.pageData.exceptionReason = exceptionReason;
  818. //然后提交结束卷的数据
  819. this.finishRollOperation();
  820. },
  821. /*打开班次选择页面*/
  822. selectSchduleShiftModal(){
  823. //1.首先调用菜单判断方式 打开生产过程的材料的页面
  824. //checkProduceButton('produceMaterialFlag');
  825. //打开生产过程的工具的页面
  826. this.$nextTick(() => {
  827. this.showShiftFlag = true;
  828. this.$refs.comSelectShift.init(this.pageData);
  829. });
  830. },
  831. /*修改页面的班次和排产的时间*/
  832. initScheduleShift(scheduleDate, shiftDesc, username){
  833. //重置班次和排产的时间
  834. this.pageData.scheduledDate = scheduleDate.substring(0, 10);
  835. this.pageData.shiftDesc = shiftDesc;
  836. this.pageData.remark = username+"更改了班次."
  837. },
  838. },
  839. created() {
  840. // this.factoryList()
  841. // this.getLanguageList()
  842. }
  843. }
  844. </script>
  845. <style scoped lang="scss">
  846. /*调节页面button和input的上下间距*/
  847. .customer-css .customer-button{
  848. margin-top: 25px;
  849. }
  850. /*调节样式*/
  851. .customer-item{
  852. margin-top: -10px;
  853. }
  854. /*fieldset下table的样式*/
  855. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  856. line-height: 16px;
  857. }
  858. /deep/ .customer-tab .el-tabs__content{
  859. padding: 0px !important;
  860. }
  861. /*table中input*/
  862. div.table-input /deep/ input.el-input__inner{
  863. text-align: right;
  864. }
  865. </style>