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

318 lines
8.8 KiB

  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. :visible.sync="visible"
  5. width="200px" style="height: 680px;" class="customer-dialog">
  6. <el-form :inline="true" label-position="top" style="height: 100px;"
  7. label-width="80px">
  8. <!-- 半成品卷卷号 -->
  9. <el-row>
  10. <el-col :span="24" style="margin-top: -5px;">
  11. <el-form-item :label=labels.rollQty>
  12. <el-input ref="rollQty" v-model="pageData.rollQty" style="width: 180px;" ></el-input>
  13. </el-form-item>
  14. </el-col>
  15. </el-row>
  16. <el-row>
  17. <el-col :span="24" style="margin-top: -5px;">
  18. <el-form-item :label=labels.rollNums>
  19. <el-input v-model="pageData.rollNums" style="width: 180px;" ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. </el-form>
  24. <span slot="footer" class="dialog-footer">
  25. <el-button type="primary" @click="createSeparateRollFun">{{ buttons.confirmButton }}</el-button>
  26. <el-button type="primary" @click="closeDialog">{{ buttons.closeButton }}</el-button>
  27. </span>
  28. </el-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import {
  33. getSeqStandardRollQty,
  34. createSeparateRoll,/*执行创建分卷的操作*/
  35. } from '@/api/scheduleReport/com_separate_roll.js';
  36. /*打印标签专用的js*/
  37. import {
  38. printSfdcLabel,
  39. } from "@/views/modules/scheduleReport/print_roll_label.js";
  40. var functionId = 'C10000003';
  41. export default {
  42. data() {
  43. return {
  44. titleCon: '创建分卷',
  45. visible: false,
  46. scheduleData: {
  47. site: this.$store.state.user.site,
  48. username: this.$store.state.user.name,
  49. seqNo: '',
  50. orderNo: '',
  51. itemNo: 0,
  52. partNo: '',
  53. workCenterNo: '',
  54. rollNo: '',
  55. functionName: '',
  56. currentRollFlag: false
  57. },
  58. pageData: {
  59. site: this.$store.state.user.site,
  60. username: this.$store.state.user.name,
  61. orderNo: '',
  62. itemNo: '',
  63. seqNo: '',
  64. rollNo: '',
  65. reportDate: '',
  66. reportTime: '',
  67. rollQty: 0,
  68. standardRollQty: 0,
  69. rollNums: 1
  70. },
  71. buttons: {
  72. confirmButton: '确定',
  73. closeButton: '关闭',
  74. },
  75. buttonList: [
  76. {
  77. functionId: functionId,
  78. languageValue: '确定',
  79. objectId: 'confirmButton',
  80. objectType: 'button',
  81. tableId: '*'
  82. }, {
  83. functionId: functionId,
  84. languageValue: '关闭',
  85. objectId: 'closeButton',
  86. objectType: 'button',
  87. tableId: '*'
  88. },
  89. ],
  90. queryButton: {
  91. functionId: functionId,
  92. table_id: '*',
  93. languageCode: this.$i18n.locale,
  94. objectType: 'button'
  95. },
  96. labels: {
  97. titleCon: '创建分卷',
  98. rollQty: '良品数量:',
  99. rollNums: '卷数:',
  100. confirmLabel: '确认',
  101. cancelLabel: '取消',
  102. },
  103. labelsList: [
  104. {
  105. functionId: functionId,
  106. languageValue: '创建分卷',
  107. objectId: 'titleCon',
  108. objectType: 'label',
  109. tableId: '*'
  110. }, {
  111. functionId: functionId,
  112. languageValue: '当前时间:',
  113. objectId: 'currentTime',
  114. objectType: 'label',
  115. tableId: '*'
  116. }, {
  117. functionId: functionId,
  118. languageValue: '良品数量:',
  119. objectId: 'rollQty',
  120. objectType: 'label',
  121. tableId: '*'
  122. }, {
  123. functionId: functionId,
  124. languageValue: '卷数:',
  125. objectId: 'rollNums',
  126. objectType: 'label',
  127. tableId: '*'
  128. }, {
  129. functionId: functionId,
  130. languageValue: '良品数量必须是正整数!',
  131. objectId: 'approvedQtyMustBeInteger',
  132. objectType: 'label',
  133. tableId: '*'
  134. }, {
  135. functionId: functionId,
  136. languageValue: '卷数必须是正整数!',
  137. objectId: 'rollQtyMustBeInteger',
  138. objectType: 'label',
  139. tableId: '*'
  140. }, {
  141. functionId: functionId,
  142. languageValue: '良品数量必须大于零且是整数!',
  143. objectId: 'approvedQtyMustMoreTanZeroAndBeInteger',
  144. objectType: 'label',
  145. tableId: '*'
  146. }, {
  147. functionId: functionId,
  148. languageValue: '卷数必须大于零且是整数!',
  149. objectId: 'rollQtyMustMoreTanZeroAndBeInteger',
  150. objectType: 'label',
  151. tableId: '*'
  152. }, {
  153. functionId: functionId,
  154. languageValue: '请先切换人员!',
  155. objectId: 'pleaseSwitchOperator',
  156. objectType: 'label',
  157. tableId: '*'
  158. }, {
  159. functionId: functionId,
  160. languageValue: '确认',
  161. objectId: 'confirmLabel',
  162. objectType: 'label',
  163. tableId: '*'
  164. }, {
  165. functionId: functionId,
  166. languageValue: '取消',
  167. objectId: 'cancelLabel',
  168. objectType: 'label',
  169. tableId: '*'
  170. },
  171. ],
  172. queryLabel: {
  173. functionId: functionId,
  174. table_id: '*',
  175. languageCode: this.$i18n.locale,
  176. objectType: 'label'
  177. },
  178. }
  179. },
  180. methods: {
  181. //页面初始化是的方法
  182. init(scheduleData) {
  183. //初始化参数
  184. this.scheduleData = scheduleData;
  185. //设置参数
  186. this.pageData.orderNo = scheduleData.orderNo;
  187. this.pageData.itemNo = scheduleData.itemNo;
  188. this.pageData.seqNo = scheduleData.seqNo;
  189. //调用方法 获取标准卷的数量
  190. this.getSeqStandardRollQtyFun();
  191. //清空参数
  192. this.pageData.rollNums = 1;
  193. this.visible = true;
  194. //获取焦点
  195. this.$nextTick(() => {
  196. this.$refs.rollQty.focus();
  197. });
  198. this.titleCon = this.labels.titleCon;//重置标题
  199. },
  200. //调用方法 获取标准卷的数量
  201. getSeqStandardRollQtyFun() {
  202. // 获取标准卷的数量
  203. getSeqStandardRollQty(this.pageData).then(({data}) => {
  204. if (data.code == 200) {
  205. this.pageData.standardRollQty = data.standardRollQty;
  206. this.pageData.rollQty = data.standardRollQty;
  207. }else{
  208. this.$message.error(data.msg);
  209. }
  210. })
  211. },
  212. /*关闭modal*/
  213. closeDialog(){
  214. //刷新报工的页面
  215. this.$emit('refreshPageData');
  216. //关闭当前的页面
  217. this.visible = false;
  218. },
  219. /*检查材料卷号的数据*/
  220. checkValidQty() {
  221. //获取当前是的数量
  222. let rollQty = parseFloat(this.pageData.rollQty);
  223. //判断是否可以修改
  224. if (rollQty <= 0 || !Number.isInteger(rollQty)){
  225. this.$message.error('卷数量无效!');
  226. return false;
  227. }
  228. },
  229. /*检查材料卷号的数据*/
  230. checkRollNums() {
  231. //获取当前是的数量
  232. let rollNums = parseFloat(this.pageData.rollNums);
  233. //判断是否是正整数
  234. if (rollNums <= 0 || !Number.isInteger(rollNums)){
  235. this.$message.error('卷数量无效!');
  236. return false;
  237. }
  238. },
  239. //检查创建
  240. createSeparateRollFun() {
  241. //获取当前是的数量
  242. let rollQty = parseInt(this.pageData.rollQty);
  243. //判断是否可以修改
  244. if (rollQty <= 0 || !Number.isInteger(rollQty)){
  245. this.$message.error('卷数量无效!');
  246. return false;
  247. }
  248. //判断是否是尾数卷
  249. if(rollQty < this.pageData.standardRollQty){
  250. let rollNums = parseInt(this.pageData.rollNums);
  251. if(rollNums > 1){
  252. this.$message.error('当前的工单得尾数卷只能有一卷!');
  253. return false;
  254. }
  255. }
  256. //获取当前是的数量
  257. let rollNums = parseFloat(this.pageData.rollNums);
  258. //判断是否是正整数
  259. if (rollNums <= 0 || !Number.isInteger(rollNums)){
  260. this.$message.error('当前卷数无效!');
  261. return false;
  262. }
  263. //校验是否继续
  264. createSeparateRoll(this.pageData).then(({data}) => {
  265. //判断是否成功
  266. if (data.code == 200) {
  267. this.$message.success(data.msg);
  268. //this.closeDialog();
  269. //清空卷数 重置数据量
  270. this.pageData.rollQty = this.pageData.standardRollQty;
  271. this.pageData.rollNums = 1;
  272. } else {
  273. this.$message.error(data.msg);
  274. }
  275. });
  276. },
  277. },
  278. created() {
  279. // this.factoryList()
  280. // this.getLanguageList()
  281. }
  282. }
  283. </script>
  284. <style scoped lang="scss">
  285. /*调节页面button和input的上下间距*/
  286. .customer-css .customer-button{
  287. margin-top: 25px;
  288. }
  289. /*调节fieldset下的样式*/
  290. .customer-fieldset .customer-item{
  291. margin-top: -15px;
  292. }
  293. /*fieldset下table的样式*/
  294. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  295. line-height: 16px;
  296. }
  297. /deep/ .customer-tab .el-tabs__content{
  298. padding: 0px !important;
  299. }
  300. </style>