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

311 lines
8.8 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="300px" style="height: 680px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" style="height: 60px;"
  6. label-width="80px">
  7. <!-- 时间 -->
  8. <el-row style="margin-top: -10px;">
  9. <el-col :span="10" >
  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="10" style="margin-top: 26px;">
  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-row>
  32. </el-form>
  33. <span slot="footer" class="dialog-footer">
  34. <el-button type="primary" @click="startProduceFun">{{ buttons.saveButton }}</el-button>
  35. <el-button type="primary" @click="closeDialog">{{ buttons.closeButton }}</el-button>
  36. <el-button v-if="showDefault" @click="saveMultiLanguage()" type="primary">多语言设置</el-button>
  37. </span>
  38. </el-dialog>
  39. <!-- 卷调机-卷材料耗用 -->
  40. <comEndTuning ref="comEndTuning" :close-on-click-modal="false"
  41. :visible.sync="endTuningFlag" @closeDialog="closeDialog">
  42. </comEndTuning>
  43. </div>
  44. </template>
  45. <script>
  46. import {
  47. checkStartProduce,
  48. startProduce,
  49. getSystemTimeData,
  50. }from '@/api/yieldReport//com_start_produce.js';
  51. /*引入组件*/
  52. import comEndTuning from './com_end_tuning';
  53. import {
  54. searchSysLanguagePackList,
  55. searchSysLanguageParam,
  56. searchFunctionButtonList,
  57. saveButtonList,
  58. searchSysLanguage,
  59. searchLanguageListByLanguageCode,
  60. saveSysLanguageOne,
  61. searchPageLanguageData,
  62. removerLanguage,
  63. saveSysLanguageList
  64. } from "@/api/sysLanguage.js";
  65. var functionId = 'C10000009';
  66. /*开始生产时候报告调机的材料的使用数量*/
  67. export default {
  68. data() {
  69. return {
  70. titleCon: '开始生产',
  71. showDefault: false,
  72. endTuningFlag: false,
  73. sfdcTimeList: [],
  74. pageData: {
  75. site: this.$store.state.user.site,
  76. username: this.$store.state.user.name,
  77. seqNo: '',
  78. orderNo: '',
  79. itemNo: 0,
  80. rollNo: '',
  81. operatorId: '',
  82. reportDate: '',
  83. reportTime: '',
  84. },
  85. operatorData: {
  86. site: this.$store.state.user.site,
  87. username: this.$store.state.user.name,
  88. operatorId: '',
  89. operatorName: '',
  90. status: '',
  91. seqNo: '',
  92. showFlag: false
  93. },
  94. dataListLoading: false,
  95. buttons: {
  96. saveButton: '保存',
  97. closeButton: '关闭',
  98. },
  99. buttonList: [
  100. {
  101. functionId: functionId,
  102. languageValue: '保存',
  103. objectId: 'saveButton',
  104. objectType: 'button',
  105. tableId: '*'
  106. }, {
  107. functionId: functionId,
  108. languageValue: '关闭',
  109. objectId: 'closeButton',
  110. objectType: 'button',
  111. tableId: '*'
  112. },
  113. ],
  114. queryButton: {
  115. functionId: functionId,
  116. table_id: '*',
  117. languageCode: this.$i18n.locale,
  118. objectType: 'button'
  119. },
  120. labels: {
  121. titleCon: '开始生产 ',
  122. seqNoName: '派工单号:',
  123. currentTime: '当前时间:',
  124. },
  125. labelsList: [
  126. {
  127. functionId: functionId,
  128. languageValue: '开始生产 ',
  129. objectId: 'titleCon',
  130. objectType: 'label',
  131. tableId: '*'
  132. }, {
  133. functionId: functionId,
  134. languageValue: '派工单号:',
  135. objectId: 'seqNoName',
  136. objectType: 'label',
  137. tableId: '*'
  138. }, {
  139. functionId: functionId,
  140. languageValue: '当前时间:',
  141. objectId: 'currentTime',
  142. objectType: 'label',
  143. tableId: '*'
  144. },
  145. ],
  146. queryLabel: {
  147. functionId: functionId,
  148. table_id: '*',
  149. languageCode: this.$i18n.locale,
  150. objectType: 'label'
  151. },
  152. }
  153. },
  154. components: {
  155. comEndTuning,/*开始生产时 调用结束调机的功能*/
  156. },
  157. methods: {
  158. /*页面的初始化方法*/
  159. init(scheduleData, operatorData) {
  160. //设置参数
  161. this.pageData.orderNo = scheduleData.orderNo;
  162. this.pageData.itemNo = scheduleData.itemNo;
  163. this.pageData.seqNo = scheduleData.seqNo;
  164. this.pageData.rollNo = scheduleData.rollNo;
  165. this.pageData.operatorId = operatorData.operatorId;
  166. //重置时间
  167. //this.pageData.reportDate = this.dayjs(new Date()).format('YYYY-MM-DD');
  168. // this.pageData.reportTime = this.dayjs(new Date()).format('HH:mm:ss');
  169. //判断是否启用多语言
  170. this.getMultiLanguageList(); //刷新多语言的信息
  171. //刷新当前的服务器时间
  172. this.refreshSystemTime();
  173. //初始化操作员对象
  174. this.operatorData = JSON.parse(JSON.stringify(operatorData));
  175. //初始化标题
  176. //初始化标题
  177. this.titleCon = this.labels.titleCon+this.labels.seqNoName+scheduleData.seqNo;
  178. // this.currentRollOps.seqNo = seqNo;
  179. // this.currentRollOps.rollNo = rollNo;
  180. //刷新当前派工单的信息
  181. //this.refreshPageData();
  182. },
  183. /*刷新服务器的时间*/
  184. refreshSystemTime(){
  185. getSystemTimeData().then(({data}) => {
  186. //判断是否操作成功
  187. if(data.code == 200){
  188. //重置系统的时间
  189. this.pageData.reportDate = data.resultMap.sysDate;
  190. this.pageData.reportTime = data.resultMap.sysTime;
  191. }
  192. });
  193. },
  194. /*关闭modal*/
  195. closeDialog(){
  196. //刷新报工的页面
  197. this.$emit('refreshPageData');
  198. //关闭当前的页面
  199. this.$emit('update:visible', false);
  200. },
  201. /*开始生产的方法*/
  202. startProduceFun(){
  203. //首先要检查是否可以开始生产
  204. checkStartProduce(this.pageData).then(({data}) => {
  205. //判断返回的结果 ---》异常
  206. if(data.code == 500){
  207. this.$message.error(data.msg);
  208. //需要跳转到结束调机的功能
  209. }else if (data.resultMap.resultCode == 201){
  210. //需要跳到结束停机的页面
  211. this.comEndTuningModal();
  212. }else{
  213. //需要报告开始生产
  214. this.startProduceOperation();
  215. }
  216. });
  217. },
  218. /*打开结束调机的modal*/
  219. comEndTuningModal(){
  220. //打开当前的页面
  221. this.$nextTick(() => {
  222. //打开modal
  223. this.endTuningFlag = true;
  224. this.$refs.comEndTuning.init(this.pageData, this.operatorData);
  225. });
  226. },
  227. /*打开结束调机的modal*/
  228. startProduceOperation(){
  229. startProduce(this.pageData).then(({data}) => {
  230. //判断操作是否成功
  231. if(data.code == 500){
  232. this.$message.error(data.msg);
  233. }else{
  234. //直接关闭当前的modal
  235. this.closeDialog();
  236. }
  237. });
  238. },
  239. // 保存 默认配置 列
  240. async saveMultiLanguage() {
  241. // 保存页面 button label title 属性
  242. let buttons = this.buttonList;
  243. let labels = this.labelsList;
  244. await saveButtonList(buttons)
  245. await saveButtonList(labels)
  246. },
  247. getMultiLanguageList() {
  248. //首先查询当前按钮的多语言
  249. searchFunctionButtonList(this.queryButton).then(({data}) => {
  250. if (data && data.code == 0 ) {
  251. this.buttons = data.data
  252. } else {
  253. // saveButtonList(this.buttonList).then(({data}) => {
  254. // })
  255. }
  256. });
  257. //其次查询当前标签的多语言
  258. searchFunctionButtonList(this.queryLabel).then(({data}) => {
  259. if (data && data.code == 0 ) {
  260. this.labels = data.data
  261. } else {
  262. // saveButtonList(this.buttonList).then(({data}) => {
  263. // })
  264. }
  265. });
  266. },
  267. },
  268. created() {
  269. // this.factoryList()
  270. // this.getLanguageList()
  271. }
  272. }
  273. </script>
  274. <style scoped lang="scss">
  275. /*调节页面button和input的上下间距*/
  276. .customer-css .customer-button{
  277. margin-top: 25px;
  278. }
  279. /*调节fieldset下的样式*/
  280. .customer-fieldset .customer-item{
  281. margin-top: -15px;
  282. }
  283. /*fieldset下table的样式*/
  284. .customer-fieldset /deep/ .el-table__header th.is-leaf{
  285. line-height: 16px;
  286. }
  287. /deep/ .customer-tab .el-tabs__content{
  288. padding: 0px !important;
  289. }
  290. </style>