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.

250 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
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="270px" style="height: 680px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" style="height: 100px;"
  6. label-width="80px">
  7. <!-- 时间 -->
  8. <el-row style="margin-top: -10px;">
  9. <el-col :span="8">
  10. <el-form-item :label="'当前时间:'">
  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="8" style="margin-left: 20px; margin-top: 27px;">
  20. <el-form-item :label="''">
  21. <el-form-item :label="''">
  22. <el-time-picker style="width: 80px;"
  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-row>
  32. <!-- 半成品卷卷号 -->
  33. <el-row>
  34. <el-col :span="12" style="margin-top: -5px;">
  35. <el-form-item :label="'良品数量:'">
  36. <el-input ref="rollQty" v-model="pageData.rollQty" style="width: 120px;" ></el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="12" style="margin-top: -5px;">
  40. <el-form-item :label="'卷数:'">
  41. <el-input v-model="pageData.rollNums" style="width: 120px;" ></el-input>
  42. </el-form-item>
  43. </el-col>
  44. </el-row>
  45. </el-form>
  46. <span slot="footer" class="dialog-footer">
  47. <el-button type="primary" @click=""> </el-button>
  48. <el-button type="primary" @click="closeDialog">关闭</el-button>
  49. </span>
  50. </el-dialog>
  51. </div>
  52. </template>
  53. <script>
  54. import {
  55. checkCreateSplitSfdcRoll,/*校验是否可以创建分卷*/
  56. createSplitSfdcRoll,/*执行创建分卷的操作*/
  57. } from '@/api/yieldReport/com_separate_roll.js'
  58. export default {
  59. name: "com_separate_roll",
  60. data() {
  61. return {
  62. titleCon: '创建分卷',
  63. scheduleData: {
  64. site: this.$store.state.user.site,
  65. userName: this.$store.state.user.name,
  66. seqNo: '',
  67. orderNo: '',
  68. itemNo: 0,
  69. resourceId: '',
  70. scheduledDate: '',
  71. shiftNo: '',
  72. partNo: '',
  73. workCenterNo: '',
  74. workCenterDesc: '',
  75. resourceDesc: '',
  76. rollNo: '',
  77. partDesc: '',
  78. planStartTime: '',
  79. planFinishTime: '',
  80. qtyRequiredOriginal: 0,
  81. preItemDesc: '',
  82. nextItemDesc: '',
  83. nextItemNo: 0,
  84. operatorId: '',
  85. functionName: '',
  86. currentRollFlag: false
  87. },
  88. pageData: {
  89. site: this.$store.state.user.site,
  90. userName: this.$store.state.user.name,
  91. orderNo: '',
  92. itemNo: '',
  93. seqNo: '',
  94. rollNo: '',
  95. reportDate: '',
  96. reportTime: '',
  97. rollQty: 0,
  98. rollNums: 1
  99. },
  100. operatorData: {
  101. site: this.$store.state.user.site,
  102. username: this.$store.state.user.name,
  103. operatorId: '',
  104. operatorName: '',
  105. status: '',
  106. seqNo: '',
  107. showFlag: false
  108. },
  109. }
  110. },
  111. methods: {
  112. //页面初始化是的方法
  113. init(scheduleData, operatorData) {
  114. //初始化参数
  115. this.scheduleData = scheduleData;
  116. //初始化操作员对象
  117. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  118. //重置时间
  119. this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss');
  120. this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss');
  121. //设置参数
  122. this.pageData.orderNo = scheduleData.orderNo;
  123. this.pageData.itemNo = scheduleData.itemNo;
  124. this.pageData.seqNo = scheduleData.seqNo;
  125. this.pageData.rollNo = scheduleData.rollNo;
  126. //清空参数
  127. this.pageData.rollQty = 0;
  128. this.pageData.rollNums = 1;
  129. //获取焦点
  130. this.$nextTick(() => {
  131. this.$refs.rollQty.focus();
  132. });
  133. },
  134. /*关闭modal*/
  135. closeDialog(){
  136. this.$emit('update:visible', false);
  137. },
  138. /*检查材料卷号的数据*/
  139. checkValidQty() {
  140. //获取当前是的数量
  141. let rollQty = this.pageData.rollQty;
  142. //判断是否可以修改
  143. if (rollQty <= 0 || !Number.isInteger(rollQty)){
  144. this.$message.error('良品数量必须是正整数!');
  145. return false;
  146. }
  147. },
  148. /*检查材料卷号的数据*/
  149. checkRollNums() {
  150. //获取当前是的数量
  151. let rollNums = this.pageData.rollNums;
  152. //判断是否是正整数
  153. if (rollNums <= 0 || !Number.isInteger(rollNums)){
  154. this.$message.error('卷数必须是正整数!');
  155. return false;
  156. }
  157. },
  158. checkCreateSeparateRolllBun() {
  159. //人员判断
  160. if (this.pageData.operatorId == '' || this.pageData.operatorId == null) {
  161. this.$message.error('请先切换人员!');
  162. return false;
  163. }
  164. //获取当前是的数量
  165. let rollQty = this.pageData.rollQty;
  166. //判断是否可以修改
  167. if (rollQty <= 0 || !Number.isInteger(rollQty)){
  168. this.$message.error('良品数量必须大于零且是整数!');
  169. return false;
  170. }
  171. //获取当前是的数量
  172. let rollNums = this.pageData.rollNums;
  173. //判断是否是正整数
  174. if (rollNums <= 0 || !Number.isInteger(rollNums)){
  175. this.$message.error('卷数必须大于零且是整数!');
  176. return false;
  177. }
  178. //校验是否继续
  179. checkCreateSplitSfdcRoll(this.pageData).then(({data}) => {
  180. //判断是否成功
  181. if (data.code == 500) {
  182. this.$message.error(data.msg);
  183. } else if (data.resultMap.resultCode == '201') {
  184. //打开异常原因录入的界面
  185. this.$confirm(data.resultMap.resultMsg, '提示', {
  186. confirmButtonText: '确认',
  187. celButtonText: '取消',
  188. type: 'warning'
  189. }).then(() => {
  190. //执行切换卷的操作
  191. this.createSeparateRolllOperation();
  192. });
  193. } else { //执行切换卷的操作
  194. this.createSeparateRolllOperation();
  195. }
  196. });
  197. },
  198. /*执行创建分卷的操作*/
  199. createSeparateRolllOperation() {
  200. //处理信息
  201. createSplitSfdcRoll(this.pageData).then(({data}) => {
  202. //判断操作是否成功
  203. if (data.code == 500) {
  204. this.$message.error(data.msg);
  205. } else {
  206. //刷新报工的页面
  207. this.$emit('refreshPageData');
  208. //关闭当前的页面
  209. this.closeDialog();
  210. }
  211. })
  212. },
  213. },
  214. created() {
  215. // this.factoryList()
  216. // this.getLanguageList()
  217. }
  218. }
  219. </script>
  220. <style scoped lang="scss">
  221. /*调节页面button和input的上下间距*/
  222. .customer-css .customer-button{
  223. margin-top: 25px;
  224. }
  225. /*调节fieldset下的样式*/
  226. .customer-fieldset .customer-item{
  227. margin-top: -15px;
  228. }
  229. /*fieldset下table的样式*/
  230. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  231. line-height: 16px;
  232. }
  233. /deep/ .customer-tab .el-tabs__content{
  234. padding: 0px !important;
  235. }
  236. </style>