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.

190 lines
5.2 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
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="210px" style="height: 680px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" @submit.native.prevent style="height: 60px;"
  6. label-width="80px">
  7. <!-- 半成品卷卷号 -->
  8. <el-row>
  9. <el-col :span="24" style="margin-left: 35px;">
  10. <el-form-item :label="'半成品卷卷号:'">
  11. <el-input ref="newRollNo" v-model="pageData.newRollNo" style="width: 120px;" ></el-input>
  12. </el-form-item>
  13. </el-col>
  14. </el-row>
  15. </el-form>
  16. <span slot="footer" class="dialog-footer">
  17. <el-button type="primary" @click="switchRollBun"> </el-button>
  18. <el-button type="primary" @click="closeDialog">关闭</el-button>
  19. </span>
  20. </el-dialog>
  21. </div>
  22. </template>
  23. <script>
  24. /*添加组件*/
  25. import comExceptionReason from "./com_exception_reason";//异常远远
  26. /*添加js的方法和请求*/
  27. import {
  28. checkSwitchSfdcRoll,/*校验是否可以切换卷*/
  29. switchSfdcRoll,/*执行切换卷的操作*/
  30. } from '@/api/yieldReport/com_switch_roll.js'
  31. export default {
  32. name: "com_merge_roll",
  33. data() {
  34. return {
  35. titleCon: '切换卷',
  36. scheduleData: {
  37. site: this.$store.state.user.site,
  38. username: this.$store.state.user.name,
  39. seqNo: '',
  40. orderNo: '',
  41. itemNo: 0,
  42. resourceId: '',
  43. scheduledDate: '',
  44. shiftNo: '',
  45. partNo: '',
  46. workCenterNo: '',
  47. workCenterDesc: '',
  48. resourceDesc: '',
  49. rollNo: '',
  50. partDesc: '',
  51. planStartTime: '',
  52. planFinishTime: '',
  53. qtyRequiredOriginal: 0,
  54. preItemDesc: '',
  55. nextItemDesc: '',
  56. nextItemNo: 0,
  57. operatorId: '',
  58. functionName: '',
  59. currentRollFlag: false
  60. },
  61. pageData: {
  62. site: this.$store.state.user.site,
  63. username: this.$store.state.user.name,
  64. seqNo: '',
  65. orderNo: '',
  66. itemNo: '',
  67. newRollNo: '',
  68. operatorId: ''
  69. },
  70. operatorData: {
  71. site: this.$store.state.user.site,
  72. username: this.$store.state.user.name,
  73. operatorId: '',
  74. operatorName: '',
  75. status: '',
  76. seqNo: '',
  77. showFlag: false
  78. },
  79. }
  80. },
  81. components: {
  82. comExceptionReason,/*异常原因的组件*/
  83. },
  84. methods: {
  85. //页面的初始化的方法
  86. init(scheduleData, operatorData) {
  87. //初始化参数
  88. this.scheduleData = scheduleData;
  89. //初始化操作员对象
  90. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  91. //设置对应的参数
  92. this.pageData.orderNo = scheduleData.orderNo;
  93. this.pageData.itemNo = scheduleData.itemNo;
  94. this.pageData.seqNo = scheduleData.seqNo;
  95. this.pageData.operatorId = operatorData.operatorId;
  96. this.pageData.newRollNo = '';
  97. //自动获取焦点
  98. this.$nextTick(() => {
  99. this.$refs.newRollNo.focus();
  100. });
  101. },
  102. /*关闭modal*/
  103. closeDialog(){
  104. //刷新报工的页面
  105. this.$emit('refreshPageData');
  106. //关闭当前的页面
  107. this.$emit('update:visible', false);
  108. },
  109. switchRollBun() {
  110. //人员判断
  111. if (this.pageData.operatorId == '' || this.pageData.operatorId == null) {
  112. this.$message.error('请先切换人员!');
  113. return false;
  114. }
  115. //首先判断数值是否通过判断
  116. let newRollNo = this.pageData.newRollNo;
  117. if (newRollNo == null || newRollNo == '') {
  118. this.$message.error('请输入半成品卷号!');
  119. return false;
  120. }
  121. //校验是否继续
  122. checkSwitchSfdcRoll(this.pageData).then(({data}) => {
  123. //判断是否成功
  124. if (data.code == 500) {
  125. this.$message.error(data.msg);
  126. } else if (data.resultMap.resultCode == '201') {
  127. //打开异常原因录入的界面
  128. this.$confirm(data.resultMap.resultMsg, '提示', {
  129. confirmButtonText: '确认',
  130. celButtonText: '取消',
  131. type: 'warning'
  132. }).then(() => {
  133. //执行切换卷的操作
  134. this.switchRollOperation();
  135. });
  136. } else { //执行切换卷的操作
  137. this.switchRollOperation();
  138. }
  139. });
  140. },
  141. /*执行切换卷的操作*/
  142. switchRollOperation() {
  143. //处理信息
  144. switchSfdcRoll(this.pageData).then(({data}) => {
  145. //判断操作是否成功
  146. if (data.code == 500) {
  147. this.$message.error(data.msg);
  148. } else {
  149. //关闭当前的页面
  150. this.pageData.newRollNo = '';
  151. this.closeDialog();
  152. }
  153. })
  154. },
  155. },
  156. created() {
  157. // this.factoryList()
  158. // this.getLanguageList()
  159. }
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. /*调节页面button和input的上下间距*/
  164. .customer-css .customer-button{
  165. margin-top: 25px;
  166. }
  167. /*调节fieldset下的样式*/
  168. .customer-fieldset .customer-item{
  169. margin-top: -15px;
  170. }
  171. /*fieldset下table的样式*/
  172. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  173. line-height: 16px;
  174. }
  175. /deep/ .customer-tab .el-tabs__content{
  176. padding: 0px !important;
  177. }
  178. </style>