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

581 lines
18 KiB

2 years ago
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="900px" style="height: 415px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" style="height: 265px;"
  6. label-width="80px">
  7. <!-- 菜单信息 -->
  8. <el-row>
  9. <el-col :span="3" >
  10. <el-form-item :label=labels.currentTime>
  11. <el-date-picker style="width: 100px;"
  12. v-model="pageData.reportDate"
  13. format="yyyy-MM-dd"
  14. value-format="yyyy-MM-dd"
  15. placeholder="">
  16. </el-date-picker>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :span="3" style="margin-top: 27px;">
  20. <el-form-item :label="''">
  21. <el-form-item :label="''">
  22. <el-time-picker style="width: 100px;"
  23. v-model="pageData.reportTime"
  24. format="HH:mm:ss"
  25. value-format="HH:mm:ss"
  26. placeholder="">
  27. </el-time-picker>
  28. </el-form-item>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="8">
  32. <el-form-item class="customer-button">
  33. <el-button type="primary" @click="refreshPageData" style="margin-left: 10px; margin-bottom: 5px;">
  34. {{buttons.refreshButton}}</el-button>
  35. </el-form-item>
  36. <el-form-item class="customer-button">
  37. <el-button @click="endTuningAndStartProduceOperation" type="primary" style="margin-left: 10px; margin-bottom: 5px;">
  38. {{buttons.endTuningButton}}</el-button>
  39. </el-form-item>
  40. <el-form-item class="customer-button">
  41. <el-button type="primary" @click="closeDialog" style="margin-left: 10px; margin-bottom: 5px;">
  42. {{buttons.closeButton}}</el-button>
  43. </el-form-item>
  44. <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>
  45. </el-col>
  46. </el-row>
  47. <!-- 主材料 -->
  48. <el-form>
  49. <fieldset class="customer-fieldset" style="width: 830px;">
  50. <legend>{{labels.primaryMaterial}}</legend>
  51. <el-table height="180"
  52. :cell-style="customerCellStyle" :cell-class-name="customerCellClassName"
  53. :data="sfdcMaterialList"
  54. border
  55. v-loading="dataListLoading"
  56. style="width: 100%; margin-top: -5px;">
  57. <el-table-column
  58. v-for="(item,index) in columnMaterialArray" :key="index"
  59. :sortable="item.columnSortable"
  60. :prop="item.columnProp"
  61. :header-align="item.headerAlign"
  62. :show-overflow-tooltip="item.showOverflowTooltip"
  63. :align="item.align"
  64. :fixed="item.fixed==''?false:item.fixed"
  65. :width="item.columnWidth"
  66. :label="item.columnLabel">
  67. <template slot-scope="scope">
  68. <!--<el-input type="number" class="table-input" align="right" @blur="checkValidQty(scope.row)"-->
  69. <el-input type="number" class="table-input" align="right" v-if="item.columnHidden"
  70. v-model="scope.row[item.columnProp]"></el-input>
  71. <span v-else>{{scope.row[item.columnProp]}}</span>
  72. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  73. style="width: 100px; height: 80px"/></span>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </fieldset>
  78. </el-form>
  79. </el-form>
  80. </el-dialog>
  81. </div>
  82. </template>
  83. <script>
  84. import {
  85. getSfdcMaterialByRollNo,
  86. endTuningAndStartProduce,
  87. getSystemTimeData,
  88. } from '@/api/yieldReport/com_end_tuning.js';
  89. import {
  90. searchSysLanguagePackList,
  91. searchSysLanguageParam,
  92. searchFunctionButtonList,
  93. saveButtonList,
  94. searchSysLanguage,
  95. searchLanguageListByLanguageCode,
  96. saveSysLanguageOne,
  97. searchPageLanguageData,
  98. removerLanguage,
  99. saveSysLanguageList
  100. } from "@/api/sysLanguage.js";
  101. var functionId = 'C10000010';
  102. export default {
  103. data() {
  104. return {
  105. titleCon: '',
  106. showDefault: false,
  107. scheduleData: {
  108. site: this.$store.state.user.site,
  109. username: this.$store.state.user.name,
  110. seqNo: '',
  111. orderNo: '',
  112. itemNo: 0,
  113. partNo: '',
  114. workCenterDesc: '',
  115. resourceDesc: '',
  116. rollNo: '',
  117. partDesc: '',
  118. planStartTime: '',
  119. planFinishTime: '',
  120. qtyRequiredOriginal: 0,
  121. scheduledDate: '',
  122. shiftNo: '',
  123. preItemDesc: '',
  124. nextItemDesc: '',
  125. nextItemNo: 0,
  126. currentRollFlag: false
  127. },
  128. pageData: {
  129. site: this.$store.state.user.site,
  130. username: this.$store.state.user.name,
  131. seqNo: '',
  132. orderNo: '',
  133. itemNo: 0,
  134. operatorId: '',
  135. reportDate: '',
  136. reportTime: '',
  137. },
  138. operatorData: {
  139. site: this.$store.state.user.site,
  140. username: this.$store.state.user.name,
  141. operatorId: '',
  142. operatorName: '',
  143. status: '',
  144. seqNo: '',
  145. showFlag: false
  146. },
  147. sfdcMaterialList: [],
  148. columnMaterialArray: [
  149. {
  150. userId: this.$store.state.user.name,
  151. functionId: 5303,
  152. serialNumber: '5303MaterialReportDate',
  153. tableId: "5303Material",
  154. tableName: "派工单材料",
  155. columnProp: "reportDate",
  156. headerAlign: "center",
  157. align: "center",
  158. columnLabel: "报告时间",
  159. columnWidth: 125,
  160. columnHidden: false,
  161. columnImage: false,
  162. columnSortable: false,
  163. sortLv: 0,
  164. status: true,
  165. fixed: false
  166. },
  167. {
  168. userId: this.$store.state.user.name,
  169. functionId: 5305,
  170. serialNumber: '5305MaterialReportedBy',
  171. tableId: "5305Material",
  172. tableName: "派工单材料",
  173. columnProp: "reportedBy",
  174. headerAlign: "center",
  175. align: "center",
  176. columnLabel: "报告人",
  177. columnWidth: 60,
  178. columnHidden: false,
  179. columnImage: false,
  180. columnSortable: false,
  181. sortLv: 0,
  182. status: true,
  183. fixed: false
  184. },
  185. {
  186. userId: this.$store.state.user.name,
  187. functionId: 5305,
  188. serialNumber: '5305MaterialRmRollNo',
  189. tableId: "5305Material",
  190. tableName: "派工单材料",
  191. columnProp: "rmRollNo",
  192. headerAlign: "center",
  193. align: "center",
  194. columnLabel: "材料卷号",
  195. columnWidth: 100,
  196. columnHidden: false,
  197. columnImage: false,
  198. columnSortable: false,
  199. sortLv: 0,
  200. status: true,
  201. fixed: false
  202. },
  203. {
  204. userId: this.$store.state.user.name,
  205. functionId: 5305,
  206. serialNumber: '5305MaterialPartNo',
  207. tableId: "5305Material",
  208. tableName: "派工单材料",
  209. columnProp: "partNo",
  210. headerAlign: "center",
  211. align: "center",
  212. columnLabel: "零部件编码",
  213. columnWidth: 100,
  214. columnHidden: false,
  215. columnImage: false,
  216. columnSortable: false,
  217. sortLv: 0,
  218. status: true,
  219. fixed: false
  220. },
  221. {
  222. userId: this.$store.state.user.name,
  223. functionId: 5305,
  224. serialNumber: '5305MaterialStartDate',
  225. tableId: "5305Material",
  226. tableName: "派工单材料",
  227. columnProp: "startDate",
  228. headerAlign: "center",
  229. align: "center",
  230. columnLabel: "开始使用时间",
  231. columnWidth: 125,
  232. columnHidden: false,
  233. columnImage: false,
  234. columnSortable: false,
  235. sortLv: 0,
  236. status: true,
  237. fixed: false
  238. },
  239. {
  240. userId: this.$store.state.user.name,
  241. functionId: 5305,
  242. serialNumber: '5305MaterialTransQty',
  243. tableId: "5305Material",
  244. tableName: "派工单材料",
  245. columnProp: "transQty",
  246. headerAlign: "center",
  247. align: "right",
  248. columnLabel: "数量",
  249. columnWidth: 80,
  250. columnHidden: false,
  251. columnImage: false,
  252. columnSortable: false,
  253. sortLv: 0,
  254. status: true,
  255. fixed: false
  256. },
  257. {
  258. userId: this.$store.state.user.name,
  259. functionId: 5305,
  260. serialNumber: '5305MaterialNetIssueQty',
  261. tableId: "5305Material",
  262. tableName: "派工单材料",
  263. columnProp: "netIssueQty",
  264. headerAlign: "center",
  265. align: "right",
  266. columnLabel: "本卷调机数量",
  267. columnWidth: 100,
  268. columnHidden: true,
  269. columnImage: false,
  270. columnSortable: false,
  271. sortLv: 0,
  272. status: true,
  273. fixed: false
  274. },
  275. {
  276. userId: this.$store.state.user.name,
  277. functionId: 5305,
  278. serialNumber: '5305MaterialKeyRMFlag',
  279. tableId: "5305Material",
  280. tableName: "派工单材料",
  281. columnProp: "keyRMFlag",
  282. headerAlign: "center",
  283. align: "center",
  284. columnLabel: "是否主材",
  285. columnWidth: 80,
  286. columnHidden: false,
  287. columnImage: false,
  288. columnSortable: false,
  289. sortLv: 0,
  290. status: true,
  291. fixed: false
  292. },
  293. {
  294. userId: this.$store.state.user.name,
  295. functionId: 5305,
  296. serialNumber: '5305MaterialSAPBOMItemNo',
  297. tableId: "5305Material",
  298. tableName: "派工单材料",
  299. columnProp: "sAPBOMItemNo",
  300. headerAlign: "center",
  301. align: "center",
  302. columnLabel: "SAP BOM序号",
  303. columnWidth: 100,
  304. columnHidden: false,
  305. columnImage: false,
  306. columnSortable: false,
  307. sortLv: 0,
  308. status: true,
  309. fixed: false
  310. }
  311. ],
  312. dataListLoading: false,
  313. buttons: {
  314. refreshButton: '刷新',
  315. endTuningButton: '结束调机',
  316. closeButton: '关闭',
  317. },
  318. buttonList: [
  319. {
  320. functionId: functionId,
  321. languageValue: '刷新',
  322. objectId: 'refreshButton',
  323. objectType: 'button',
  324. tableId: '*'
  325. }, {
  326. functionId: functionId,
  327. languageValue: '结束调机',
  328. objectId: 'endTuningButton',
  329. objectType: 'button',
  330. tableId: '*'
  331. }, {
  332. functionId: functionId,
  333. languageValue: '关闭',
  334. objectId: 'closeButton',
  335. objectType: 'button',
  336. tableId: '*'
  337. },
  338. ],
  339. queryButton: {
  340. functionId: functionId,
  341. table_id: '*',
  342. languageCode: this.$i18n.locale,
  343. objectType: 'button'
  344. },
  345. labels: {
  346. titleCon: '卷调机-卷材料结算',
  347. currentTime: '当前时间:',
  348. primaryMaterial: '主材料',
  349. materialConsumedCantBeNull: '材料上本卷耗用数量不能为空!',
  350. materialConsumedMustMoreTanZero: '材料耗用数量必须大于0!',
  351. materialConsumedMoreTanDelivery: '材料耗用数量大于发料数量!',
  352. },
  353. labelsList: [
  354. {
  355. functionId: functionId,
  356. languageValue: '卷调机-卷材料结算',
  357. objectId: 'titleCon',
  358. objectType: 'label',
  359. tableId: '*'
  360. }, {
  361. functionId: functionId,
  362. languageValue: '当前时间:',
  363. objectId: 'currentTime',
  364. objectType: 'label',
  365. tableId: '*'
  366. }, {
  367. functionId: functionId,
  368. languageValue: '主材料',
  369. objectId: 'primaryMaterial',
  370. objectType: 'label',
  371. tableId: '*'
  372. }, {
  373. functionId: functionId,
  374. languageValue: '材料耗用数量大于发料数量!',
  375. objectId: 'materialConsumedMoreTanDelivery',
  376. objectType: 'label',
  377. tableId: '*'
  378. }, {
  379. functionId: functionId,
  380. languageValue: '良品总数量必须大于等于0!',
  381. objectId: 'approvedQtyMustMoreTanZero',
  382. objectType: 'label',
  383. tableId: '*'
  384. }, {
  385. functionId: functionId,
  386. languageValue: '该时间段内没有匹配的班次信息,请联系相关人员!',
  387. objectId: 'noMatchShiftInfo',
  388. objectType: 'label',
  389. tableId: '*'
  390. },
  391. ],
  392. queryLabel: {
  393. functionId: functionId,
  394. table_id: '*',
  395. languageCode: this.$i18n.locale,
  396. objectType: 'label'
  397. },
  398. }
  399. },
  400. methods: {
  401. /*初始化页面参数*/
  402. init(pageData, operatorData) {
  403. //设置参数
  404. this.pageData.orderNo = pageData.orderNo;
  405. this.pageData.itemNo = pageData.itemNo;
  406. this.pageData.seqNo = pageData.seqNo;
  407. this.pageData.rollNo = pageData.rollNo;
  408. this.pageData.operatorId = operatorData.operatorId;
  409. //重置时间
  410. //this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD');
  411. //this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss');
  412. //初始化操作员对象
  413. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  414. this.getMultiLanguageList(); //刷新多语言的信息
  415. //刷新当前的服务器时间
  416. this.refreshSystemTime();
  417. //初始化标题
  418. this.titleCon = this.labels.titleCon;
  419. //刷新当前派工单的信息
  420. this.refreshPageData();
  421. },
  422. /*刷新服务器的时间*/
  423. refreshSystemTime(){
  424. getSystemTimeData().then(({data}) => {
  425. //判断是否操作成功
  426. if(data.code == 200){
  427. //重置系统的时间
  428. this.pageData.reportDate = data.resultMap.sysDate;
  429. this.pageData.reportTime = data.resultMap.sysTime;
  430. }
  431. });
  432. },
  433. /*关闭modal*/
  434. closeDialog(){
  435. this.$emit('update:visible', false);
  436. },
  437. /*刷新当前的页面参数*/
  438. refreshPageData(){
  439. //刷新材料的数据
  440. this.refreshSfdcMaterialTable();
  441. },
  442. //刷新当前卷的时间数据
  443. refreshSfdcMaterialTable(){
  444. getSfdcMaterialByRollNo(this.pageData).then(({data}) => {
  445. this.sfdcMaterialList = data.rows;
  446. });
  447. },
  448. //结束调机和开始生产
  449. endTuningAndStartProduceOperation(){
  450. let requestData = {'pageData': JSON.stringify(this.pageData), 'materialList': JSON.stringify(this.sfdcMaterialList)};
  451. endTuningAndStartProduce(requestData).then(({data}) => {
  452. //判断操作是否成功
  453. if(data.code == 500){
  454. this.$message.error(data.msg);
  455. }else{
  456. //关闭上机dialog的页面
  457. this.$emit('closeDialog');
  458. //关闭当前的页面
  459. this.closeDialog();
  460. }
  461. });
  462. },
  463. /*检查数据是否有效*/
  464. checkValidQty(row){
  465. //判断当前是否为空
  466. if(row.netIssueQty == ''){
  467. this.$message.error(this.labels.materialConsumedCantBeNull);
  468. row.netIssueQty = 0;//重新赋值
  469. return false;
  470. }
  471. //判断当前是否有效
  472. if(row.netIssueQty <= 0){
  473. this.$message.error(this.labels.materialConsumedMustMoreTanZero);
  474. return false;
  475. }
  476. //判断是否超限
  477. if(row.netIssueQty > row.transQty){
  478. this.$message.error(this.materialConsumedMoreTanDelivery);
  479. row.netIssueQty = 0;//重新赋值
  480. return false;
  481. }
  482. },
  483. /*添加定制的css类*/
  484. customerCellClassName({row, column, rowIndex, columnIndex}) {
  485. if(column.property == 'netIssueQty'){
  486. return 'customer-number-cell';
  487. }
  488. },
  489. /*添加定制的cess样式*/
  490. customerCellStyle({row, column, rowIndex, columnIndex}) {
  491. if(column.property == 'netIssueQty'){
  492. return 'padding: 0px 0px;';
  493. }
  494. },
  495. // 保存 默认配置 列
  496. async saveMultiLanguage() {
  497. // 保存页面 button label title 属性
  498. let buttons = this.buttonList;
  499. let labels = this.labelsList;
  500. await saveButtonList(buttons)
  501. await saveButtonList(labels)
  502. },
  503. getMultiLanguageList() {
  504. //首先查询当前按钮的多语言
  505. searchFunctionButtonList(this.queryButton).then(({data}) => {
  506. if (data && data.code == 0 ) {
  507. this.buttons = data.data
  508. } else {
  509. // saveButtonList(this.buttonList).then(({data}) => {
  510. // })
  511. }
  512. });
  513. //其次查询当前标签的多语言
  514. searchFunctionButtonList(this.queryLabel).then(({data}) => {
  515. if (data && data.code == 0 ) {
  516. this.labels = data.data
  517. } else {
  518. // saveButtonList(this.buttonList).then(({data}) => {
  519. // })
  520. }
  521. });
  522. },
  523. },
  524. created() {
  525. }
  526. }
  527. </script>
  528. <style scoped lang="scss">
  529. /*调节页面button和input的上下间距*/
  530. .customer-css .customer-button{
  531. margin-top: 25px;
  532. }
  533. /*调节样式*/
  534. .customer-item{
  535. margin-top: -10px;
  536. }
  537. /*fieldset下table的样式*/
  538. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  539. line-height: 16px;
  540. }
  541. /deep/ .customer-tab .el-tabs__content{
  542. padding: 0px !important;
  543. }
  544. /*table中input 修改样式*/
  545. /deep/ div.table-input {
  546. padding: 0px 0px;
  547. height: 25px !important;
  548. }
  549. /*table中input*/
  550. div.table-input /deep/ input.el-input__inner{
  551. padding: 0px 0px;
  552. height: 23px !important;
  553. text-align: right;
  554. }
  555. </style>