123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <div
- class="operator-app-container"
- :style="{
- '--op-border-color': '#d9d9d9',
- '--op-text-color-fff': '#fff',
- }"
- >
- <a-layout class="operator-large-layout">
- <a-layout-header class="operator-header cover">
- <div class="change-shift print-billet-card">
- <a-button
- type="primary"
- style="margin-right: 20px"
- size="large"
- @click="() => openPrintOriginalRecordsModal(true, { ccmNo, queryType: '1', shiftText, curShiftInfo })"
- >
- 原始记录
- </a-button>
- <a-button type="primary" size="large" @click="() => openModal(true, { ccmNo, queryType: '1', shiftText, curShiftInfo })"> 送样卡 </a-button>
- </div>
- <div class="shift-wrapper"> {{ shiftText }} </div>
- <div class="change-shift">
- <a-button type="primary" size="large" danger @click="() => (openJiaobanModal = true)"> 交班 </a-button>
- </div>
- <div class="clock-wrapper">
- <div class="date">{{ clockObj.date }}</div>
- <div class="week">{{ clockObj.week }}</div>
- <div class="time">{{ clockObj.time }}</div>
- </div>
- </a-layout-header>
- <a-layout-content class="operator-content">
- <head-top @onShiftChange="curShiftChange" ref="headTopRef" @lengthChange="(v, auto) => ((lengthList = v), (cuttolength = auto))" />
- <div class="operator-content-wrapper flex">
- <div class="operator-content-left">
- <heat-list
- ref="heatListRef"
- v-if="curShiftInfo.shift && curShiftInfo.shiftGroup"
- :ccmNo="ccmNo"
- :carRef="carRef"
- :lengthList="lengthList"
- :cuttolength="cuttolength"
- @changeLengthSuccess="() => headTopRef && headTopRef.reload()"
- :curShiftInfo="curShiftInfo"
- />
- </div>
- <div class="operator-content-right">
- <car :ccmNo="ccmNo" ref="carRef" />
- </div>
- </div>
- </a-layout-content>
- </a-layout>
- <!-- 打印钢坯送样卡 -->
- <print-billet-sample-card @register="registerPrintModal" />
- <!-- 打印原始数据 -->
- <printOriginalRecords @register="registerPrintOriginalRecordsModal" />
- <!-- 交班 -->
- <a-modal
- v-model:open="openJiaobanModal"
- title="切换牌号"
- centered
- width="400px"
- ok-text="确认"
- :okButtonProps="{ loading: okLoading }"
- cancel-text="取消"
- @ok="confirmChangeShift"
- @cancel="
- () => {
- openJiaobanModal = false;
- newShiftGroup = '';
- }
- "
- >
- <div class="flex justify-center items-center" style="margin: 20px 0">
- <div>选择班组:</div>
- <JSearchSelect type="list" style="width: 277px" v-model:value="newShiftGroup" dict="lg_bz" placeholder="请选择" allowClear />
- </div>
- </a-modal>
- </div>
- </template>
- <script setup lang="ts" name="OperatorRoom">
- import { onMounted, onUnmounted, ref } from 'vue';
- import { getDateTimeWeek } from '/@/utils/dateUtil';
- import { useTimeoutFn } from '/@/hooks/core/useTimeout';
- import headTop from './components/headTop.vue';
- import car from './components/car.vue';
- import heatList from './components/heatList.vue';
- import { getMachineNum, getMachineDict } from '../hotDelivery/common.data';
- import { changeShift } from '../hotDelivery/hotDelivery.api';
- import { useMessage } from '/@/hooks/web/useMessage';
- import { useModal } from '/@/components/Modal';
- import printBilletSampleCard from './components/printBilletSampleCard.vue';
- import printOriginalRecords from './components/printOriginalRecords.vue';
- import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
- const { createConfirm, createMessage } = useMessage();
- // 注册打印送样卡modal
- const [registerPrintModal, { openModal }] = useModal();
- // 注册打印原始记录modal
- const [registerPrintOriginalRecordsModal, { openModal: openPrintOriginalRecordsModal }] = useModal();
- const ccmNo = getMachineNum();
- const carRef = ref();
- const headTopRef = ref();
- const heatListRef = ref();
- // 班次信息
- const shiftText = ref('');
- const curShiftInfo = ref({
- shift: undefined,
- shiftGroup: undefined,
- });
- // 时钟
- const clockObj = ref({
- date: '',
- week: '',
- time: '',
- });
- const lengthList = ref('');
- const cuttolength = ref(2); // 1 手动定尺, 2 自动定尺
- const clock = () => {
- try {
- const dateStr = getDateTimeWeek().split(' ');
- clockObj.value = {
- date: dateStr[0],
- time: dateStr[1],
- week: dateStr[2],
- };
- start();
- } catch (error) {}
- };
- const { start, stop } = useTimeoutFn(clock, 1000);
- // 获取班次信息
- const curShiftChange = (shiftInfo) => {
- if (shiftInfo) {
- const { shift, shiftGroup } = shiftInfo;
- shiftText.value = `${getMachineDict(shift, 'lg_bb')} - ${getMachineDict(shiftGroup, 'lg_bz')}`;
- }
- curShiftInfo.value = shiftInfo;
- };
- // 交班
- const newShiftGroup = ref('');
- const openJiaobanModal = ref(false);
- const okLoading = ref(false);
- const confirmChangeShift = () => {
- if (!newShiftGroup.value) {
- createMessage.error('请选择班组');
- return;
- }
- createConfirm({
- iconType: 'warning',
- title: '交班确认',
- content: '确定要交班吗?',
- onOk: () => {
- return changeShift({
- ccmNo,
- shiftGroup: newShiftGroup.value,
- }).then(() => {
- headTopRef && headTopRef.value.reload();
- carRef && carRef.value.refreshCarList();
- heatListRef && heatListRef.value.reload();
- openJiaobanModal.value = false;
- });
- },
- });
- };
- onMounted(() => {
- start();
- });
- onUnmounted(() => {
- stop();
- });
- </script>
- <style lang="less" scoped>
- @import '/@/assets/less/font.less';
- @import './index.less';
- </style>
|