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.

233 lines
7.4 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
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="305px" style="height: 680px;" class="customer-dialog">
  5. <el-container style="height: 225px;">
  6. <el-form :inline="true" label-position="top" label-width="80px">
  7. <!-- 扫描工具实例编码 -->
  8. <el-row>
  9. <el-col :span="12">
  10. <el-form-item :label="'工具实例编号:'">
  11. <el-input ref="toolInstanceId" v-model="pageData.toolInstanceId"
  12. @keyup.enter.native="checkToolInstanceIdFun" style="width: 120px"></el-input>
  13. </el-form-item>
  14. </el-col>
  15. </el-row>
  16. <!-- 换刀模 -->
  17. <el-container>
  18. <fieldset class="customer-fieldset" style="width: 280px;">
  19. <legend>换刀模</legend>
  20. <el-row>
  21. <el-col :span="16">
  22. <el-form-item class="customer-item">
  23. <el-checkbox disabled="disabled" true-label="Y" false-label="N"
  24. v-model="pageData.replaceFlag">换刀模</el-checkbox>
  25. </el-form-item>
  26. </el-col>
  27. </el-row>
  28. <!-- 原工具信息 -->
  29. <el-row>
  30. <el-col :span="12">
  31. <el-form-item class="customer-item" label="原工具实例编码:">
  32. <el-input v-model="pageData.oriToolInstanceId" :readonly="readonlyFlag" style="width: 100px;" ></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="12">
  36. <el-form-item class="customer-item" label="本卷生产数量:">
  37. <el-input v-model="pageData.consumeQty" :readonly="readonlyFlag" style="width: 100px;" ></el-input>
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. <el-row>
  42. <el-col :span="12">
  43. <el-form-item class="customer-item" label="之前卷以生产数量:">
  44. <el-input v-model="pageData.oriConsumeQty" :readonly="readonlyFlag" style="width: 100px;" ></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="12">
  48. <el-form-item class="customer-item" label="累计生产数量:">
  49. <el-input v-model="pageData.totalConsumeQty" :readonly="readonlyFlag" style="width: 100px;" ></el-input>
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </fieldset>
  54. </el-container>
  55. </el-form>
  56. </el-container>
  57. <span slot="footer" class="dialog-footer">
  58. <el-button type="primary" @click="addToolInstanceIdFun"> </el-button>
  59. <el-button type="primary" @click="closeDialog">关闭</el-button>
  60. </span>
  61. </el-dialog>
  62. </div>
  63. </template>
  64. <script>
  65. import {
  66. checkToolInstanceId,
  67. addToolInstanceId,
  68. }
  69. from '@/api/yieldReport/com_produce_tool.js';
  70. export default {
  71. name: "com_defect_roll",
  72. data() {
  73. return {
  74. titleCon: '刀模板',
  75. readonlyFlag: true,
  76. scheduleData: {
  77. site: this.$store.state.user.site,
  78. userName: this.$store.state.user.name,
  79. seqNo: '',
  80. orderNo: '',
  81. itemNo: 0,
  82. partNo: '',
  83. workCenterNo: '',
  84. workCenterDesc: '',
  85. resourceDesc: '',
  86. rollNo: '',
  87. partDesc: '',
  88. planStartTime: '',
  89. planFinishTime: '',
  90. qtyRequiredOriginal: 0,
  91. scheduledDate: '',
  92. shiftNo: '',
  93. preItemDesc: '',
  94. nextItemDesc: '',
  95. nextItemNo: 0,
  96. operatorId: '',
  97. functionName: '',
  98. currentRollFlag: false
  99. },
  100. pageData: {
  101. site: this.$store.state.user.site,
  102. userName: this.$store.state.user.name,
  103. orderNo: '',
  104. itemNo: '',
  105. seqNo: '',
  106. rollNo: '',
  107. operatorId: '',
  108. toolInstanceId: '',
  109. oriToolInstanceId: '',
  110. consumeQty: 0,
  111. oriConsumeQty: 0,
  112. totalConsumeQty: 0,
  113. checkFlag: false,
  114. },
  115. operatorData: {
  116. site: this.$store.state.user.site,
  117. username: this.$store.state.user.name,
  118. operatorId: '',
  119. operatorName: '',
  120. status: '',
  121. seqNo: '',
  122. showFlag: false
  123. },
  124. dataListLoading: false,
  125. }
  126. },
  127. methods: {
  128. //初始化组件的参数
  129. init(scheduleData, operatorData, histSeqNo) {
  130. debugger;
  131. //初始化参数
  132. this.scheduleData = scheduleData;
  133. //初始化操作员对象
  134. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  135. //设置参数
  136. this.pageData.orderNo = scheduleData.orderNo;
  137. this.pageData.itemNo = scheduleData.itemNo;
  138. this.pageData.seqNo = scheduleData.seqNo;
  139. this.pageData.rollNo = scheduleData.rollNo;
  140. this.pageData.operatorId = operatorData.operatorId;
  141. //自动获取焦点
  142. this.$nextTick(() => {
  143. this.$refs.toolInstanceId.focus();
  144. });
  145. //区分是否是切换切换的
  146. this.pageData.toolInstanceId = '';
  147. this.pageData.oriToolInstanceId = '';
  148. if(histSeqNo > 0){
  149. this.pageData.consumeQty = 0;
  150. this.pageData.oriConsumeQty = 0;
  151. this.pageData.totalConsumeQty = 0;
  152. this.readonlyFlag = false;
  153. this.replaceFlag = true;
  154. }else{
  155. this.pageData.consumeQty = '';
  156. this.pageData.oriConsumeQty = '';
  157. this.pageData.totalConsumeQty = '';
  158. this.readonlyFlag = true;
  159. this.replaceFlag = false;
  160. }
  161. //重置校验的标记
  162. this.pageData.checkFlag = false;
  163. },
  164. /*关闭modal*/
  165. closeDialog(){
  166. this.$emit('update:visible', false);
  167. },
  168. /*检查新的工具实例信息*/
  169. checkToolInstanceIdFun(){
  170. if(this.pageData.toolInstanceId == null || this.pageData.toolInstanceId == ''){
  171. this.$message.error('请扫描工具实例!');
  172. return false;
  173. }
  174. checkToolInstanceId(this.pageData).then(({data}) => {
  175. //判断是否存在异常
  176. if(data.code == 500){
  177. this.$message.error(data.msg);
  178. }else if (data.resultMap.resultCode == 201){
  179. let msg = data.resultMap.resultMsg;
  180. this.$confirm(msg, '提示', {
  181. confirmButtonText: '确定',
  182. cancelButtonText: '取消',
  183. type: "warning"
  184. }).then(() => {
  185. this.pageData.checkFlag = true;
  186. }).catch(() => {
  187. this.pageData.checkFlag = false;
  188. });
  189. }else{
  190. this.pageData.checkFlag = true;
  191. }
  192. });
  193. },
  194. /*添加刀模记录*/
  195. addToolInstanceIdFun(){
  196. //判断是否校验通过
  197. if(!this.pageData.checkFlag){
  198. this.$message.error('校验失败,请重试!')
  199. return false;
  200. }
  201. addToolInstanceId(this.pageData).then(({data}) => {
  202. if(data.code == 500){
  203. this.$message.error(data.msg);
  204. }else{
  205. //清空数据再次准备
  206. this.pageData.toolInstanceId = '';
  207. this.pageData.oriToolInstanceId = '';
  208. this.pageData.consumeQty = '';
  209. this.pageData.oriConsumeQty = '';
  210. this.pageData.totalConsumeQty = '';
  211. }
  212. });
  213. },
  214. },
  215. created() {
  216. // this.factoryList()
  217. // this.getLanguageList()
  218. }
  219. }
  220. </script>
  221. <style scoped lang="scss">
  222. </style>