| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <template>
- <div class="index_box">
- <div class="content_box">
- <Search></Search>
- <ele-split-layout
- space="0px"
- width="45%"
- :resizable="true"
- :min-size="200"
- :max-size="-200"
- :left-style="{
- overflow: 'hidden',
- width: '100%'
- }"
- :right-style="{ overflow: 'hidden' }"
- :responsive="false"
- style="height: calc(100vh - 70px - 50px - 80px)"
- >
- <div class="left_main">
- <div class="top">
- <produceOrder
- @workSelect="workSelect"
- @rowClick="rowClick"
- ></produceOrder>
- </div>
- <!-- <div class="bottom">
- <productionResource :BomObj="BomObj"></productionResource>
- </div> -->
- </div>
- <template v-slot:content>
- <div class="right_main">
- <div v-if="operationType == 'pick'">
- <pickDetails ref="pickListRef" @pickAdd="pickAdd"></pickDetails>
- </div>
- <div v-if="operationType == 'feed'">
- <feeding :workListIds="workListIds"></feeding>
- </div>
- <div v-if="operationType == 'job'">
- <warehousing
- v-if="taskObj.id == -1"
- :workListIds="workListIds"
- ref="wareRef"
- ></warehousing>
- <jobBooking
- v-else
- :workListIds="workListIds"
- ref="jobRef"
- ></jobBooking>
- </div>
- </div>
- </template>
- </ele-split-layout>
- <footBtn @footBtn="footBtn"></footBtn>
- </div>
- <!--领料弹框 -->
- <picking
- v-if="pickingShow"
- @close="pickingClose"
- :workListIds="workListIds"
- ></picking>
- </div>
- </template>
- <script>
- import Search from './components/search.vue';
- import footBtn from './components/footBtn.vue';
- import produceOrder from './components/produceOrder.vue';
- import productionResource from './components/productionResource/index.vue';
- import picking from './components/picking/index.vue';
- import pickDetails from './components/picking/details.vue';
- import feeding from './components/feeding/index.vue';
- import jobBooking from './components/jobBooking/index.vue';
- import warehousing from './components/warehousing/index.vue';
- import { getByTaskId } from '@/api/produce/index';
- export default {
- components: {
- Search,
- footBtn,
- produceOrder,
- productionResource,
- picking,
- pickDetails,
- feeding,
- jobBooking,
- warehousing
- },
- data() {
- return {
- loading: false,
- operationType: null,
- workListIds: [],
- pickingShow: false,
- BomObj: {}
- };
- },
- computed: {
- taskObj() {
- return this.$store.state.user.taskObj;
- }
- },
- created() {
- this.operationType = null;
- this.workListIds = [];
- },
- methods: {
- workSelect(data) {
- this.workListIds = data;
- },
- footBtn(t) {
- this.operationType = t;
- if (
- Object.keys(this.$store.state.user.taskObj).length === 0 &&
- this.$store.state.user.taskObj.constructor === Object
- ) {
- this.$message.warning('请选择工序');
- return false;
- }
- if (['pick', 'feed', 'job'].includes(t)) {
- if (this.workListIds.length == 0) {
- this.$message.warning('请选择工单列表');
- return false;
- }
- }
- if (t == 'pick') {
- this.$nextTick(() => {
- this.$refs.pickListRef.getList(this.workListIds);
- });
-
- }
- if (t == 'feed') {
- }
- },
- pickAdd() {
- this.pickingShow = true;
- },
- pickingClose(val) {
- if (val) {
- this.$nextTick(() => {
- this.$refs.pickListRef.getList(this.workListIds);
- });
- }
- this.pickingShow = false;
- },
- rowClick(row, taskId) {
- if (taskId) {
-
- let params = {
- categoryId: row.categoryId,
- taskId: taskId
- };
- getByTaskId(params).then((res) => {
- this.BomObj = res.data;
- this.$forceUpdate();
-
- });
- }
- }
- },
- mounted() {
- this.$nextTick(() => {
- const targetElements =
- document.getElementsByClassName('ele-admin-tabs');
- if (targetElements.length > 0) {
- // 遍历所有具有 'ele-admin-tabs' 类的元素
- Array.from(targetElements).forEach((element) => {
- // 对每个元素添加 'new-ele-admin-tabs' 类
- element.classList.add('new-ele-admin-tabs');
- });
- }
- });
- },
- destroyed() {
- this.$nextTick(() => {
- const targetElements =
- document.getElementsByClassName('ele-admin-tabs');
- if (targetElements.length > 0) {
- Array.from(targetElements).forEach((element) => {
- element.classList.remove('new-ele-admin-tabs');
- });
- }
- });
- }
- };
- </script>
- <style>
- .new-ele-admin-tabs {
- display: none !important;
- }
- .c_title {
- color: #157a2c;
- font-size: 16px;
- font-weight: bold;
- }
- .tableZ_box {
- border: 1px solid #e3e5e5;
- margin: 6px 0;
- &:last-child {
- border-bottom: none;
- }
- .row {
- width: 100%;
- display: flex;
- }
- .col {
- width: calc(100% / 5);
- display: flex;
- align-items: center;
- min-width: 200px;
- min-height: 32px;
- border-bottom: 1px solid #e3e5e5;
- border-right: 1px solid #e3e5e5;
- &:last-child {
- border-right: none;
- }
- .name {
- display: flex;
- align-items: center;
- padding: 4px;
- width: 80px;
- height: 100%;
- background-color: #d0e4d5;
- color: #000;
- }
- .content {
- padding: 4px 6px;
- color: #000;
- }
- }
- .pd6 {
- padding: 0 6px;
- }
- }
- </style>
- <style lang="scss" scoped>
- .index_box {
- padding: 8px;
- padding-bottom: 0px;
- width: 100%;
- min-width: 1280px !important;
- height: calc(100vh - 60px);
- overflow-x: auto;
- /* 当内容超出宽度时,允许水平滚动 */
- white-space: nowrap;
- /* 防止内部文本换行,确保所有内容都在一行显示 */
- scrollbar-width: thin;
- /* 设置滚动条宽度(浏览器兼容性可能有所不同) */
- scrollbar-color: #40a9ff transparent;
- /* 设置滚动条颜色和轨道颜色(同样,浏览器兼容性) */
- }
- .main {
- width: 100%;
- min-width: 1280px;
- height: calc(100vh - 70px - 50px - 80px);
- display: flex;
- justify-content: space-between;
- }
- .left_main {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- min-width: 640px;
- .top {
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- // .bottom {
- // width: 100%;
- // min-height: calc((100vh - 70px - 50px - 80px - 20px) / 2);
- // overflow: hidden;
- // }
- }
- .right_main {
- min-width: 640px;
- height: calc((100vh - 70px - 50px - 80px - 12px));
- margin-top: 6px;
- background: #f0f3f3;
- }
- </style>
|