| | |
| | | "dependencies": { |
| | | "axios": "0.18.1", |
| | | "core-js": "3.6.5", |
| | | "dayjs": "^1.11.5", |
| | | "echarts": "^5.3.2", |
| | | "element-ui": "2.13.2", |
| | | "jquery": "^3.6.0", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-popover placement="bottom" |
| | | trigger="hover"> |
| | | <div slot="reference" |
| | | class="plan" |
| | | :style="{'margin-top':0.1*cellHeight+'px',}" |
| | | @click="onClick" |
| | | |
| | | > |
| | | <!-- <div class="runTime"> |
| | | <span>S:{{startToString}}</span> |
| | | <span>E:{{endToString}}</span> |
| | | </div> --> |
| | | <div |
| | | :class="{'hw':true,'SCHEDULEING' : item.type == 'schedule','H_SCHEDULE':item.type=='h_schedule','BM_SCHEDULE':item.type=='bm_schedule'}"> |
| | | <span v-show='item.type == "schedule"'>{{ item.number }}</span> |
| | | <span v-show='item.type == "h_schedule"'>{{ item.number }}</span> |
| | | </div> |
| | | <!-- <div class="passenger"></div> --> |
| | | |
| | | </div> |
| | | |
| | | <div class="detail"> |
| | | <!-- <span>{{data.name}}</span> --> |
| | | <ul v-if="item.type =='h_schedule' || item.type =='schedule'"> |
| | | <li> |
| | | <span>å·¥åç¼å·ï¼</span><span>{{ item.work_order }}</span> |
| | | </li> |
| | | <li> |
| | | <span>产ååç§°ï¼</span><span>{{ item.cl_name }}</span> |
| | | </li> |
| | | <li> |
| | | <span>产åç¼ç ï¼</span><span>{{ item.cl_code }}</span> |
| | | </li> |
| | | <li> |
| | | <span>ç产æ°éï¼</span><span>{{ item.number }}{{ item.STATUS }}</span> |
| | | </li> |
| | | <li> |
| | | <span>ç产设å¤ï¼</span><span>{{ item.id }}</span> |
| | | </li> |
| | | <li> |
| | | <span>å¼å§æ¶é´ï¼</span><span>{{ item.start }}</span> |
| | | </li> |
| | | <li> |
| | | <span>ç»ææ¶é´ï¼</span><span>{{ item.end }}</span> |
| | | </li> |
| | | |
| | | </ul> |
| | | <ul v-if="item.type =='capacity'"> |
| | | <!-- <li> |
| | | <span>产åï¼</span><span>{{item.cl_name}}</span> |
| | | </li> |
| | | <li> |
| | | <span>æ°éï¼</span><span>{{item.number}}个</span> |
| | | </li> --> |
| | | <li> |
| | | <span>ç产设å¤ï¼</span><span>{{ item.id }}</span> |
| | | </li> |
| | | <li> |
| | | <span>å¼å§æ¶é´ï¼</span><span>{{ item.start }}</span> |
| | | </li> |
| | | <li> |
| | | <span>ç»ææ¶é´ï¼</span><span>{{ item.end }}</span> |
| | | </li> |
| | | |
| | | </ul> |
| | | <ul v-if="item.type =='bm_schedule'"> |
| | | <li> |
| | | <span>ç»´ä¿®æ¶é´ï¼</span><span>{{ item.start }} ~ {{ item.end }}</span> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </el-popover> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | |
| | | const NOW_PLAN = '#D5F8EA' |
| | | const FUTHER_PLAN = '#BFF2FE' |
| | | const PAST_PLAN = '#F2F2F2' |
| | | const CAPACITY = '#d1efed' |
| | | const H_SCHEDULE = '#ffc000' |
| | | const SCHEDULEING = '#14b6e7' |
| | | const BM_SCHEDULE = 'FFFF33' |
| | | export default { |
| | | name: 'Test', |
| | | props: { |
| | | data: Object, |
| | | item: Object, |
| | | currentTime: dayjs, |
| | | updateTimeLines: Function, |
| | | cellHeight: Number, |
| | | startTimeOfRenderArea: Number |
| | | }, |
| | | data() { |
| | | return { |
| | | dayjs: dayjs |
| | | } |
| | | }, |
| | | computed: { |
| | | statusColor() { |
| | | let { item, currentTime } = this |
| | | let start = dayjs(item.start) |
| | | let end = dayjs(item.end) |
| | | // if(item.type == 'capacity'){ |
| | | // return CAPACITY |
| | | // }else if(item.type == 'h_schedule'){ |
| | | // return H_SCHEDULE |
| | | // }else if(item.type == 'schedule'){ |
| | | // return SCHEDULEING |
| | | // } |
| | | // if (start.isBefore(currentTime) && end.isAfter(currentTime)) { |
| | | // return NOW_PLAN; // NOW |
| | | // } else if (end.isBefore(currentTime)) { |
| | | // return PAST_PLAN; // PAST |
| | | // } else { |
| | | // return FUTHER_PLAN; // Future |
| | | // } |
| | | }, |
| | | startToString() { |
| | | return dayjs(this.item.start).format('HH:mm') |
| | | }, |
| | | endToString() { |
| | | return dayjs(this.item.end).format('HH:mm') |
| | | } |
| | | }, |
| | | methods: { |
| | | onClick() { |
| | | this.updateTimeLines(this.item.start, this.item.end) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .hw { |
| | | height: 100%; |
| | | width: 100%; |
| | | position: relative; |
| | | z-index: 0; |
| | | // background:rgba(171, 245, 240 , 0.6); |
| | | background: rgba(5, 185, 100, 0.1); |
| | | text-align: center; |
| | | border-radius: 5px; |
| | | |
| | | |
| | | } |
| | | |
| | | .middle { |
| | | flex: 1; |
| | | text-align: center; |
| | | padding-left: 5px; |
| | | } |
| | | |
| | | .runTime { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .plan { |
| | | display: flex; |
| | | align-items: center; |
| | | box-sizing: border-box; |
| | | height: 80%; |
| | | // border: 1px solid #f0f0f0; |
| | | border-radius: 5px; |
| | | color: #333333; |
| | | // padding-left: 5px; |
| | | font-size: 0.8rem; |
| | | // opacity: 0.8; |
| | | } |
| | | |
| | | .capacity { |
| | | background: rgb(209, 239, 237) !important |
| | | |
| | | } |
| | | |
| | | .detail { |
| | | .header { |
| | | text-align: center; |
| | | font-size: 1rem; |
| | | } |
| | | } |
| | | |
| | | .detail ul { |
| | | list-style: none; |
| | | padding: 0px; |
| | | |
| | | li { |
| | | span { |
| | | // display: inline-block; |
| | | width: 135px; |
| | | color: #777; |
| | | font-size: 0.8rem; |
| | | } |
| | | |
| | | span:first-child { |
| | | text-align: center; |
| | | } |
| | | |
| | | span:last-child { |
| | | } |
| | | } |
| | | } |
| | | |
| | | .CAPACITY { |
| | | background: rgba(171, 245, 240, 0.6) |
| | | } |
| | | |
| | | .H_SCHEDULE { |
| | | background: #05b964; |
| | | height: 70%; |
| | | margin-left: 3px; |
| | | border-radius: 5px; |
| | | position: relative; |
| | | z-index: 2; |
| | | color: whitesmoke; |
| | | font-size: 12px; |
| | | line-height: 1.5 |
| | | } |
| | | |
| | | .SCHEDULEING { |
| | | background: #ac96ff; |
| | | height: 70%; |
| | | margin-left: 3px; |
| | | border-radius: 5px; |
| | | position: relative; |
| | | z-index: 2; |
| | | color: whitesmoke; |
| | | font-size: 12px; |
| | | line-height: 1.5 |
| | | } |
| | | |
| | | .BM_SCHEDULE { |
| | | background: #FFFF33; |
| | | height: 70%; |
| | | margin-left: 3px; |
| | | border-radius: 5px; |
| | | position: relative; |
| | | z-index: 2; |
| | | color: whitesmoke; |
| | | font-size: 12px; |
| | | line-height: 1.5 |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- <div class="name" :style="{background:data.colorPair.light}"> --> |
| | | <div> |
| | | <div class="name"> |
| | | <!-- <div class="colorBar" :style="{background:data.colorPair.dark}"/> --> |
| | | <!-- <div class="type">{{data.type}}</div> --> |
| | | <div class="carId"><input type="checkbox" id="label" v-model="ckeckVal" @change="click_box(data)">{{ data.name }} |
| | | </div> |
| | | <div class="speed"> |
| | | <el-tooltip class="item" effect="dark" content="æ¥ç" placement="top"> |
| | | <el-button type="text" size="mini" @click="look(data.id)"> |
| | | <i class="el-icon-document size i-color "></i> |
| | | </el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | </div> |
| | | <el-dialog title="æ¥ç" :visible.sync="showDialog" width="60%"> |
| | | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'TestLeft', |
| | | data() { |
| | | return { |
| | | showDialog: false, |
| | | ckeckVal: true |
| | | } |
| | | }, |
| | | props: { |
| | | data: Object |
| | | }, |
| | | methods: { |
| | | look(id) { |
| | | this.showDialog = true |
| | | console.log(id) |
| | | }, |
| | | click_box(data) { |
| | | console.log(data) |
| | | console.log(this.ckeckVal) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .name { |
| | | display: flex; |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | height: 100%; |
| | | width: 100%; |
| | | padding: 0 5px 0 0; |
| | | border-radius: 8px 0 0 8px; |
| | | align-items: center; |
| | | |
| | | } |
| | | |
| | | .colorBar { |
| | | width: 10px; |
| | | height: 100%; |
| | | } |
| | | |
| | | .carId { |
| | | flex: 1; |
| | | } |
| | | |
| | | .type { |
| | | padding: 0 5px 0 0; |
| | | font-size: 1.2rem; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "presets": [ |
| | | ["env", { |
| | | "modules": false |
| | | }], |
| | | "stage-3" |
| | | ], |
| | | "env": { |
| | | "test": { |
| | | "presets": [ |
| | | ["env"], |
| | | "stage-3" |
| | | ] |
| | | } |
| | | }, |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | .DS_Store |
| | | node_modules |
| | | |
| | | # local env files |
| | | .env.local |
| | | .env.*.local |
| | | |
| | | # Log files |
| | | npm-debug.log* |
| | | yarn-debug.log* |
| | | yarn-error.log* |
| | | |
| | | # Editor directories and files |
| | | .idea |
| | | .vscode |
| | | *.suo |
| | | *.ntvs* |
| | | *.njsproj |
| | | *.sln |
| | | *.sw* |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | MIT License |
| | | |
| | | Copyright (c) 2019 wuchouchou |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy |
| | | of this software and associated documentation files (the "Software"), to deal |
| | | in the Software without restriction, including without limitation the rights |
| | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| | | copies of the Software, and to permit persons to whom the Software is |
| | | furnished to do so, subject to the following conditions: |
| | | |
| | | The above copyright notice and this permission notice shall be included in all |
| | | copies or substantial portions of the Software. |
| | | |
| | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| | | SOFTWARE. |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <p align="center"><img src="https://raw.githubusercontent.com/w1301625107/vue-gantt-chart/master/screenshot/icon.png" alt="logo" width="180"></p> |
| | | <h1 align="center">vue-gantt-chart</h1> |
| | | <p align="center">åºäº Vue å®ç°ç gantt-like å¾è¡¨ ,ç¨äºæçå±ç¤º</p> |
| | | <p align="center"></p> |
| | | |
| | | [](https://www.npmjs.com/package/v-gantt-chart) |
| | |  |
| | | |
| | | ### [Reactçæ¬](https://github.com/w1301625107/React-Gantt-chart) |
| | | |
| | | ### [Demoé¢è§å°å](https://w1301625107.github.io/Vue-Gantt-chart/dist/index) |
| | | |
| | | ## Feature |
| | | |
| | | - èæå表ï¼å¿«é渲æå¯è§åºåï¼æ¯æå¤§éæ°æ®æ¸²æ |
| | | - å¯åæ¶é´è½´ï¼1 åéï¼2 åéï¼3 åéï¼4 åé~~~å°ä¸å¤© |
| | | - å¯ååå
æ ¼ |
| | | - æ 记线 |
| | | - æ¯æèªå®ä¹æè¿°å容å¨å |
| | | |
| | | ## Screenshot |
| | | |
| | |  |
| | | |
| | | ## Install |
| | | [](https://npmjs.org/package/v-gantt-chart) |
| | | |
| | | ``` bash |
| | | npm i v-gantt-chart --save |
| | | ``` |
| | | |
| | | Include plugin in your `main.js` file. |
| | | |
| | | ```js |
| | | import Vue from 'vue' |
| | | |
| | | import vGanttChart from 'v-gantt-chart'; |
| | | |
| | | Vue.use(vGanttChart}); |
| | | ``` |
| | | |
| | | ## Use |
| | | |
| | | ### template code |
| | | |
| | | ```html |
| | | <template> |
| | | <v-gantt-chart :startTime="startTime" |
| | | :endTime="endTime" |
| | | :datas="datas"> |
| | | <template v-slot:block="{data,item}"> |
| | | <!-- ä½ ç容å¨åç»ä»¶ --> |
| | | <Test :data="data" :item="item"></Test> |
| | | </template> |
| | | <template v-slot:left="{data}"> |
| | | <!-- ä½ çè¡åç»ä»¶ --> |
| | | <TestLeft :data="data"></TestLeft> |
| | | </template> |
| | | <template v-slot:title> |
| | | <!-- ä½ ç表头ç»ä»¶ --> |
| | | hola |
| | | </template> |
| | | </v-gantt-chart> |
| | | </template> |
| | | ``` |
| | | |
| | | ### script code |
| | | |
| | | ```js |
| | | import Test from "./test.vue"; //ä½ èªå·±çganttæ¡å®¹å¨ |
| | | import TestLeft from "./test-left.vue"; //ä½ èªå·±çè¡åç§°ç»ä»¶ |
| | | import { mockDatas } from "@src/mock/index.js"; //伪é çæ°æ® |
| | | import dayjs from "dayjs" //æ¶é´åº |
| | | |
| | | export default { |
| | | name: "App", |
| | | components: { Test, TestLeft }, |
| | | data() { |
| | | return { |
| | | startTime: dayjs().toString(),//æ¶é´è½´å¼å§æ¶é´ |
| | | endTime: dayjs() |
| | | .add(2, "d") |
| | | .add(2, "h") |
| | | .add(5, "s").toString(), //æ¶é´ç»ææ¶é´ |
| | | datas: mockDatas(100), // ganttæ°æ® |
| | | }; |
| | | }, |
| | | }; |
| | | ``` |
| | | |
| | | å¨**é»è®¤æ
åµ**ä¸ï¼å³`customGenerateBlocks`为`false`ï¼ç渲æçæ°æ®éè¦**ç¹æ®æ ¼å¼** ï¼ç®åè¦æ±æ°ç»ä¸æ¯ä¸ä¸ªå¼å为对象ï¼ä¸æ`gtAarry`对象æ°ç»è¿ä¸ªå±æ§(é»è®¤å`gtArray`ï¼ä¹å¯ä»¥èªå®ä¹å¤ä¸ªæ°ç»`key`å¼) |
| | | //æ°ç»ä¸æ¯ä¸ä¸ªå¯¹è±¡éæä¸¤ä¸ªå±æ§ï¼`start`å`end`(䏿ä¾çæ
åµï¼åç§»ä¸å®½åº¦å°ä¸º0)ï¼éä¸ºåæ³çæ¶é´å符串.ä¾å¦ |
| | | ```js |
| | | [ |
| | | { |
| | | id:'test', //éå¿
é¡» |
| | | gtArray:[ //é»è®¤çéè¦æ¸²æçæ°ç»çkey |
| | | { |
| | | name:'test', //éå¿
é¡» |
| | | start:'2019-01-11 18:18:18', |
| | | end:'2019-01-11 18:18:18' |
| | | } |
| | | ]ï¼ |
| | | customKey:[ //èªå®ä¹çéè¦æ¸²æçæ°ç»çkey |
| | | { |
| | | id:'test', //éå¿
é¡» |
| | | start:'2019-01-11 18:18:18', |
| | | end:'2019-01-11 18:18:18' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | ``` |
| | | |
| | | ## Slot |
| | | |
| | | ```js |
| | | // åè®¾ä½ ä¼ å
¥çæ°æ®ä¸º |
| | | [ |
| | | { |
| | | id:'test', |
| | | name:'sala', |
| | | gtArray:[ |
| | | { |
| | | name:'test', |
| | | start:'2019-01-11 18:18:18', |
| | | end:'2019-01-11 18:18:18' |
| | | //... |
| | | } |
| | | ]ï¼ |
| | | //... |
| | | } |
| | | //... |
| | | ] |
| | | ``` |
| | | |
| | | ### block 容å¨åslot |
| | | #### `customGenerateBlocks` 为falseï¼é»è®¤å¼ï¼ çæ
åµ |
| | | |
| | | ```html |
| | | <template v-slot:block="{data,item}"> |
| | | <!-- ä½ ç容å¨åç»ä»¶ --> |
| | | <Test :data="data" :item="item"></Test> |
| | | </template> |
| | | ``` |
| | | |
| | | `data` 为 |
| | | ```js |
| | | { |
| | | id:'test', |
| | | name:'sala', |
| | | gtArray:[{...}]ï¼ |
| | | //... |
| | | } |
| | | ``` |
| | | |
| | | `item` 为 |
| | | ```js |
| | | { |
| | | name:'test', |
| | | start:'2019-01-11 18:18:18', |
| | | end:'2019-01-11 18:18:18' |
| | | //... |
| | | } |
| | | ``` |
| | | |
| | | #### `customGenerateBlocks` 为true çæ
åµ |
| | | |
| | | æ¤æ¶`arrayKeys`ï¼`itemkey`å°ä¸å¨çæï¼å¦ä½æ¸²æï¼æ¸²æä»ä¹ï¼å°ç±ä½ èªå·±å³å®ï¼ä¸æ¹æ¯ä¸ä¸ªä¾å |
| | | |
| | | ```html |
| | | <template v-slot:block="{data, |
| | | getPositonOffset, |
| | | getWidthAbout2Times, |
| | | isInRenderingTimeRange}"> |
| | | <div class="myBlockContainer" |
| | | v-for="item in data.gtArray" |
| | | v-if="isInRenderingTimeRange(item.start) |
| | | ||isInRenderingTimeRange(item.end)" |
| | | :key="item.id" |
| | | :style="{position:'absolute', |
| | | left:getPositonOffset(item.start)+'px', |
| | | width:getWidthAbout2Times(item.start,item.end)+'px'}"> |
| | | <Test :data="data" |
| | | :item="item"></Test> |
| | | </div> |
| | | </template> |
| | | ``` |
| | | |
| | | `data` 为 |
| | | ```js |
| | | { |
| | | id:'test', |
| | | name:'sala', |
| | | gtArray:[{...}]ï¼ |
| | | //... |
| | | } |
| | | ``` |
| | | |
| | | `getPositonOffset(time:string):number ` |
| | | å®ä½å½æ°ï¼æ ¹æ®ç»å®å符串形å¼çæ¶é´çæç¸å¯¹æ¶é´è½´èµ·ç¹ççåç§»å¼ |
| | | |
| | | `getWidthAbout2Times(start:string,end:string):number` |
| | | 为宽度计ç®å½æ°ï¼æ ¹æ®ç»å®å符串形å¼çæ¶é´è®¡ç®ä¸¤ä¸ªæ¶é´å·®çå®½åº¦å¼ |
| | | |
| | | `isInRenderingTimeRange(time:string):boolean` |
| | | å¤å®ç»å®çæ¶é´æ¯å¦å¨å±å¹æ¾ç¤ºçæ¶é´è½´èå´ä¹å
|
| | | |
| | | |
| | | ### left è¡åslot |
| | | ```html |
| | | <template v-slot:left="{data}"> |
| | | <!-- ä½ çè¡åç»ä»¶ --> |
| | | <TestLeft :data="data"></TestLeft> |
| | | </template> |
| | | ``` |
| | | |
| | | `data` 为 |
| | | ```js |
| | | { |
| | | id:'test', |
| | | name:'sala', |
| | | gtArray:[{...}]ï¼ |
| | | //... |
| | | } |
| | | ``` |
| | | |
| | | ### title æ é¢slot |
| | | ```html |
| | | <template v-slot:title> |
| | | <!-- ä½ ç表头ç»ä»¶ --> |
| | | hola |
| | | </template> |
| | | ```` |
| | | |
| | | ## API |
| | | |
| | | <style> |
| | | .param table th:first-of-type { |
| | | width: 100px; |
| | | } |
| | | .param table th:nth-of-type(2) { |
| | | width: 100px; |
| | | } |
| | | .param table th:nth-of-type(4) { |
| | | width: 100px; |
| | | } |
| | | </style> |
| | | |
| | | <div class="param"> |
| | | |
| | | ### Param |
| | | |
| | | | param | required | type | default | describe | |
| | | | :-------------- | :------: | :-----: | :----: | :---- | |
| | | | startTime | â | string | å½åæ¶é´ | æ¶é´è½´å¼å§æ¶é´ï¼éä¸ºåæ³çæ¶é´å符串ï¼å¦ï¼`2019-01-11 18:18:18`| |
| | | | endTime | â | string | å½åæ¶é´ | æ¶é´è½´ç»ææ¶é´ï¼éä¸ºåæ³çæ¶é´å符串ï¼å¦ï¼`2019-01-11 18:18:18`| |
| | | | cellWidth | â | number | 50 | æ¶é´åºé´ç宽度 | |
| | | | cellHeight | â | number | 20 | æ¶é´åºé´çé«åº¦ | |
| | | | titleHeight | â | number | 40 | 表头çé«åº¦ | |
| | | | titleWidth | â | number | 200 | 表头åè¡ç宽度 | |
| | | | scale | â | number | 60 | æ¶é´è½´çå»åº¦å¼ãåä½:åéï¼å
许å¼`[1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 120ï¼180,240,360, 720, 1440] ` | |
| | | | datas | â | array | [] | å¨**é»è®¤æ
åµ**ä¸ï¼å³`customGenerateBlocks`为`false`ï¼ç渲æçæ°æ®éè¦**ç¹æ®æ ¼å¼** ï¼ç®åè¦æ±æ°ç»ä¸æ¯ä¸ä¸ªå¼å为对象ï¼ä¸ægtAarry对象æ°ç»è¿ä¸ªå±æ§ï¼gtArray䏿¯ä¸ä¸ªå¯¹è±¡éæä¸¤ä¸ªå±æ§ï¼startåend(䏿ä¾çæ
åµï¼åç§»ä¸å®½åº¦å°ä¸º0)ï¼éä¸ºåæ³çæ¶é´å符串.ä¾å¦```[{id:'test',gtArray:[{start:'2019-01-11 18:18:18',end:'2019-01-11 18:18:18'}]}] ``` å
¶ä»ä¸åéå¶ã | |
| | | | arrayKeys| â | array | ["gtArray"] | éè¦æ¸²æçæ°ç»çkey | |
| | | | dataKey | â | string | -- | 渲æçæ¯ä¸è¡çkey | |
| | | | itemKey | â | string | -- | 渲æçæ¯ä¸ä¸ªgantt容å¨çkey | |
| | | | showCurrentTime | â | boolean | false | æ¾ç¤ºå½åæ¶é´,æ¯ç§éæ´æ° | |
| | | | timelines | â | array | -- | æ¾ç¤ºæ è®°æ¶é´ï¼æç¹æ®æ ¼å¼ ``` [{time:'2019-01-11 18:18:18',color:'#00000'}]``` | |
| | | | scrollToTime | â | string | -- | æ»å¨å°æå®çæ¶é´ï¼éä¸ºåæ³çæ¶é´å符串 | |
| | | | scrollToPostion | â | object | -- | æ»å¨å°æå®çä½ç½® æ ¼å¼ä¸º``` {x:number,y:number}``` | |
| | | | hideHeader | â | boolean | false | éèæ¶é´è½´å表头 | |
| | | | hideXS | â | boolean | false | éèæ¶é´è½´å表头 | |
| | | | hideXScrollBar | â | boolean | false | éèæ¨ªåæ»å¨è½´ | |
| | | | hideYScrollBar | â | boolean | false | éèçºµåæ»å¨è½´ | |
| | | | customGenerateBlocks | â | boolean | false | å¼å¯èªå®ä¹çææ¸²æåï¼å
·ä½ä½¿ç¨è§è¯´æ | |
| | | |
| | | |
| | | </div> |
| | | |
| | | <style> |
| | | .event table th:first-of-type { |
| | | width: 100px; |
| | | } |
| | | .event table th:nth-of-type(2) { |
| | | width: 100px; |
| | | } |
| | | .event table th:nth-of-type(3) { |
| | | width: 300px; |
| | | } |
| | | </style> |
| | | |
| | | <div class="event"> |
| | | |
| | | ### Event |
| | | |
| | | | event | type | describle| |
| | | | :--- |:-----:|:---------| |
| | | | scrollLeft| number | Xè½´çæ»å¨å¼| |
| | | | scrollTop | number | Yè½´çæ»å¨å¼| |
| | | |
| | | </div> |
| | | |
| | | ## Next plan |
| | | - å 快渲æé度 |
| | | |
| | | ## Run Demo |
| | | |
| | | ### 注æé¡¹ç®éè¦ node ç¯å¢ |
| | | |
| | | ```bash |
| | | #clone项ç®ï¼è¿å
¥é¡¹ç®æ ¹ç®å½ |
| | | #å®è£
|
| | | npm i |
| | | # å¯å¨ |
| | | npm run serve |
| | | or |
| | | yarn serve |
| | | #æå¼æµè§å¨å°åæ è¾å
¥localhost:8080å³å¯ |
| | | ``` |
| | | |
| | | ## Caution |
| | | IE éè¦èªå·±å¤çä¸äºployfill |
| | | |
| | | |
| | | ## Update |
| | | 1.3.3 |
| | | - ä¿®å¤æ¶é´è½´çæ¥ææ°åå¨æäºæ
åµä¸æå¼divï¼å¯¼è´æ¶é´è½´ä¸åç¡®çé®é¢ |
| | | |
| | | 1.3.2 |
| | | - ä¿®æ£æ»å¨ç触ååæ»å¨èå´éå¶çé®é¢ |
| | | |
| | | 1.3.1 |
| | | - æ¿æ¢moment 为dayjs |
| | | - 为startTimeï¼endTimeï¼datasæ·»å é»è®¤å¼ |
| | | |
| | | 1.3.0 |
| | | - ä¼å渲æé度 |
| | | - ç¸æ¯ä¹åçèªå®ä¹æ¸²æï¼æ·»å ä¸ä¸ªæ°çslotï¼æ¯æèªå®ä¹çå®ä½å渲æï¼æ´å ççµæ´» |
| | | |
| | | 1.2.6 |
| | | - ä¿®å¤å½æ¶é´çº¿å®½åº¦æ¯æ¸²æå®½åº¦å°çæ
åµä¸çé¨åç½å± |
| | | - ä¿®å¤æ°æ®å·æ°æ¶ä¸éæ°æ¸²æçé®é¢ |
| | | - ä¿®å¤æ»å¨æ¡é¿åº¦è®¡ç®é®é¢å¯¼è´çæ¶é´çº¿é¨å被éè |
| | | - æ ·å¼å¾®è° |
| | | |
| | | 1.2.5 |
| | | - ä¿®å¤cellheight,cellwidth åå¨ä¸ä¸æ»å¨æ¶ï¼æ¸²ææ°æ®èå´ä¸æ£å¸¸çé®é¢ |
| | | - ä¿®æ¹æ ·å¼çåå¨å¤ç |
| | | |
| | | 1.2.4 |
| | | - ä¿®å¤æ»å¨æ¶å䏿»å¨æ¶ä¼ç©ºç½ä¸è¡æ²¡ææ¸²æçé®é¢ |
| | | - ä¿®å¤å·¦ä¾§è¡ååºæ°æ®è¿å°æ¶ï¼æ æ³çä½å
¶åºä¸æ 记线çé®é¢ |
| | | |
| | | 1.2.3 |
| | | - æ·»å Resize Observer api çpolyfill |
| | | |
| | | 1.2.2 |
| | | - éè¿Resize Observer apiæ¥çå¬divçååï¼ç¨ä»¥ä¿®å¤æç¥ä¸å°å®¹å¨å¤§å°ååå¼èµ·çæ¸²ææ°é䏿£å¸¸çé®é¢ |
| | | |
| | | 1.2.1 |
| | | - æ¯æéè¿çå¬scrollLeftåscrollTopè·åæ»å¨å¼ |
| | | - ä¿®å¤é¡µé¢ä¸åå¨2个çç¹å¾æ»å¨é误çé®é¢ |
| | | - ä¿®å¤æ²¡æstartï¼endå¼å¯è½å¼èµ·çé®é¢ï¼å½ä¸åå¨startï¼endæ¶åç§»ä¸å®½åº¦å为0å¼ |
| | | |
| | | 1.2.0 |
| | | - æ¯æéèæ»å¨æ¡ |
| | | - ä¿®å¤ä¸æ¬¡æ»å¨è§¦å2次æ»å¨äºä»¶çé®é¢ |
| | | - ä¿®å¤scrollToPosition æ æ³è®¾ç½®0弿¯é®é¢ |
| | | |
| | | 1.1.3 |
| | | - æ·»å é»è®¤slot |
| | | |
| | | 1.1.2 |
| | | - æ¯æéèè¡¨å¤´åæ¶é´è½´åè½ |
| | | - æ¯æèªå®ä¹éè¦æ¸²æçæ°ç»key |
| | | - ä¿®å¤æ¨ªçº¿æ»å¨è¶çé®é¢ |
| | | #### License |
| | | |
| | | _MIT_ ©wuchouchou |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | module.exports = require('./lib') |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="gantt-blocks" |
| | | :style="{height:blockHeight+'px'}"> |
| | | <div class="gantt-block gantt-block-top-space" |
| | | :style="{height:calTopSpace()+'px'}"> |
| | | </div> |
| | | <div class="gantt-block" |
| | | :style="blockStyle" |
| | | v-for="(data,index) in showDatas" |
| | | :key="dataKey?data[dataKey]:index"> |
| | | |
| | | <template v-if="!customGenerateBlocks"> |
| | | <div class="gantt-block-item" |
| | | v-for="(item,index) in concatArray(data)" |
| | | v-if="isInRenderingTimeRange(item.start)||isInRenderingTimeRange(item.end)" |
| | | :key="itemKey?item[itemKey]:index" |
| | | :style="{left:getPosition(item)+'px',width:getWidth(item)+'px'}"> |
| | | <slot :data="data" |
| | | :item="item"> |
| | | <div class="gantt-block-defaultBlock">need slot</div> |
| | | </slot> |
| | | </div> |
| | | </template> |
| | | |
| | | <template v-else> |
| | | <slot :data="data" |
| | | :getPositonOffset="getPositonOffset" |
| | | :getWidthAbout2Times="getWidthAbout2Times" |
| | | :isInRenderingTimeRange="isInRenderingTimeRange">need slot</slot> |
| | | </template> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dr from "../dynamic-render.js"; |
| | | import { isUndef, warn } from "../../utils/tool.js"; |
| | | |
| | | export default { |
| | | name: "Blocks", |
| | | mixins: [dr], |
| | | props: { |
| | | dataKey: String, |
| | | itemKey: String, |
| | | arrayKeys: { |
| | | type: Array |
| | | }, |
| | | scrollLeft: Number, |
| | | cellWidth: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | scale: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | widthOfRenderAera: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | endTimeOfRenderArea: [Number, null], |
| | | startTimeOfRenderArea: [Number, null], |
| | | getPositonOffset: Function, |
| | | getWidthAbout2Times: Function, |
| | | customGenerateBlocks: Boolean |
| | | }, |
| | | computed: { |
| | | renderAarrys() { |
| | | let { arrayKeys } = this; |
| | | if (arrayKeys.length > 0) { |
| | | return arrayKeys; |
| | | } |
| | | return ["gtArray"]; |
| | | }, |
| | | blockStyle() { |
| | | return { |
| | | backgroundSize: `${this.cellWidth}px ${this.cellHeight}px`, |
| | | height: `${this.cellHeight}px` |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | /** |
| | | * æ ¹æ®renderAarrysæ¼æ¥éè¦æ¸²æçæ°ç» |
| | | * |
| | | * @param {*} data |
| | | * @returns {[]} 该data䏿æéè¦æ¸²æçæ°æ® |
| | | */ |
| | | concatArray(data) { |
| | | return this.renderAarrys.reduce((prev, curr) => { |
| | | if (Array.isArray(data[curr])) { |
| | | return prev.concat(data[curr]); |
| | | } else { |
| | | return prev; |
| | | } |
| | | }, []); |
| | | }, |
| | | /** |
| | | * å¤å®æ°æ®æ¯å¦å¨æ¸²æçæ¶é´èå´å
|
| | | * |
| | | * @param {{time:string}} item |
| | | * @returns {boolean} 该 |
| | | */ |
| | | isInRenderingTimeRange(time) { |
| | | if (this.heightOfRenderAera === 0) { |
| | | return false; |
| | | } |
| | | |
| | | let { startTimeOfRenderArea, endTimeOfRenderArea } = this; |
| | | if (isUndef(startTimeOfRenderArea) || isUndef(endTimeOfRenderArea)) { |
| | | return false; |
| | | } |
| | | |
| | | let timeToMs = new Date(time).getTime(); |
| | | if (startTimeOfRenderArea <= timeToMs && timeToMs <= endTimeOfRenderArea) { |
| | | return true; |
| | | } |
| | | return false; |
| | | }, |
| | | /** |
| | | * è®¡ç®æ¶é´åé¿åº¦ |
| | | * |
| | | * @param {{start:string,end:string}} block |
| | | * @returns {number} |
| | | */ |
| | | getWidth(block) { |
| | | if (isUndef(block.start) || isUndef(block.end)) { |
| | | // warn(`é误ï¼è¯¥æ°æ®é¡¹ä¸å«startå¼ ä¸ end å¼ ${JSON.stringify(block)}ï¼æ æ³è®¡ç®å®½åº¦å¼ã`) |
| | | return 0; |
| | | } |
| | | |
| | | return this.getWidthAbout2Times(block.start, block.end); |
| | | }, |
| | | /** |
| | | * è®¡ç®æ¶é´ååç§» |
| | | * |
| | | * @param {{start:string}} block |
| | | * @returns {number} |
| | | */ |
| | | getPosition(block) { |
| | | if (isUndef(block.start)) { |
| | | warn( |
| | | `é误ï¼è¯¥æ°æ®é¡¹ä¸å«start å¼ ${JSON.stringify( |
| | | block |
| | | )}ï¼æ æ³è®¡ç®åç§»å¼ã` |
| | | ); |
| | | return 0; |
| | | } |
| | | |
| | | return this.getPositonOffset(block.start); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | let dynamicRender = { |
| | | props: { |
| | | scrollTop: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | heightOfRenderAera: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | cellHeight: { |
| | | type: Number, |
| | | required: true |
| | | }, |
| | | datas: { |
| | | type: Array, |
| | | required: true |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | showDatas: [], |
| | | //ä¸ä¸æ¬¡å è½½çèç¹ |
| | | oldCurrentIndex: 0, |
| | | //é¢å è½½çæ°é,æ¯ååé½ä¸º2个 |
| | | preload: 1 // 为 0 æ¶å è½½å
¨é¨è¡ |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | blockHeight() { |
| | | let { |
| | | datas, |
| | | cellHeight |
| | | } = this; |
| | | return datas.length * cellHeight; |
| | | }, |
| | | //计ç®å½å第ä¸ä¸ªæ°æ®çindex |
| | | currentIndex() { |
| | | return Math.ceil(this.scrollTop / this.cellHeight); |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | | currentIndex(val) { |
| | | let { |
| | | oldCurrentIndex, |
| | | preload |
| | | } = this; |
| | | if (preload === 0) { |
| | | this.spliceData(); |
| | | return |
| | | } |
| | | if (oldCurrentIndex === val) { |
| | | return |
| | | } |
| | | // é¢å
å¤å è½½å 个ï¼é¿å
è¿å¤ç触åspliceDataï¼ |
| | | let errorValue = 1 // 为误差å¼ï¼ |
| | | if (val < oldCurrentIndex - (preload - errorValue) || val > |
| | | oldCurrentIndex + (preload - errorValue)) { |
| | | this.oldCurrentIndex = val; |
| | | this.spliceData(); |
| | | } |
| | | }, |
| | | datas() { |
| | | this.spliceData() |
| | | }, |
| | | heightOfRenderAera() { |
| | | this.spliceData() |
| | | }, |
| | | cellHeight() { |
| | | this.spliceData() |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | this.spliceData(); |
| | | }, |
| | | |
| | | methods: { |
| | | /** |
| | | * åå²åºdom䏿¾ç¤ºçæ°æ® |
| | | */ |
| | | spliceData() { |
| | | let { |
| | | heightOfRenderAera, |
| | | currentIndex, |
| | | cellHeight, |
| | | preload |
| | | } = this; |
| | | //没æé«åº¦ï¼ä¸éè¦æ¸²æå
ç´ |
| | | if (heightOfRenderAera === 0 || cellHeight === 0) { |
| | | return [] |
| | | } |
| | | |
| | | if (preload === 0) { |
| | | this.showDatas = this.datas |
| | | return |
| | | } |
| | | |
| | | let end = currentIndex + Math.ceil(heightOfRenderAera / cellHeight) + |
| | | preload; |
| | | let start = currentIndex - preload > 0 ? currentIndex - preload : 0; |
| | | this.showDatas = this.datas.slice(start, end); |
| | | }, |
| | | // |
| | | /** |
| | | * 计ç®ç¬¬ä¸ä¸ªæå¼åç½®é«åº¦ç容å¨åé«åº¦ |
| | | */ |
| | | calTopSpace() { |
| | | let { |
| | | oldCurrentIndex, |
| | | cellHeight, |
| | | preload |
| | | } = this; |
| | | let start = |
| | | oldCurrentIndex - preload >= 0 ? oldCurrentIndex - preload : 0; |
| | | |
| | | return start == 0 ? start * cellHeight : start - 1 * cellHeight |
| | | |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | export default dynamicRender; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="gantt-leftbar"> |
| | | <div class="gantt-leftbar-item " |
| | | :style="{height:calTopSpace()+'px'}"> |
| | | </div> |
| | | <div class="gantt-leftbar-item" |
| | | :style="cellHeightStyle" |
| | | v-for="(data,index) in showDatas" |
| | | :key="dataKey?data[dataKey]:index"> |
| | | <slot :data="data"> |
| | | <div class="gantt-leftbar-defalutItem">need slot</div> |
| | | </slot> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dr from '../dynamic-render.js' |
| | | export default { |
| | | name: "LeftBar", |
| | | mixins:[dr], |
| | | props:{ |
| | | dataKey:String, |
| | | datas: { |
| | | type: Array, |
| | | required: true |
| | | } |
| | | }, |
| | | computed:{ |
| | | cellHeightStyle(){ |
| | | return { |
| | | 'height':`${this.cellHeight}px` |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <mark-line :markLineTime="currentTime" |
| | | :getPositonOffset="getPositonOffset" |
| | | color="rgba(255,0,0,.4)"></mark-line> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import MarkLine from "./index.vue"; |
| | | export default { |
| | | name: "CurrentTime", |
| | | components: { MarkLine }, |
| | | props: { |
| | | getPositonOffset: { |
| | | type: Function, |
| | | required: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | currentTime: dayjs().toString() |
| | | }; |
| | | }, |
| | | created() { |
| | | const timeNow = setInterval(() => { |
| | | this.currentTime = dayjs().toString(); |
| | | }, 1000); |
| | | this.$once("hook:beforeDestroy", () => { |
| | | clearInterval(timeNow); |
| | | }); |
| | | } |
| | | }; |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div v-show="visible" |
| | | class="gantt-markline" |
| | | :style="{'background-color':color,'left':getPosition()+'px'}"> |
| | | <div class="gantt-markline-label" |
| | | :style="{'background-color':color}">{{dayjs(markLineTime).format("HH:mm:ss")}}</div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | export default { |
| | | name: "MarkLine", |
| | | props: { |
| | | markLineTime: { |
| | | validator(date) { |
| | | return dayjs(date).isValid(); |
| | | } |
| | | }, |
| | | color: { |
| | | type: String, |
| | | default: "#00a79d" |
| | | }, |
| | | getPositonOffset: { |
| | | type: Function, |
| | | required: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | dayjs:dayjs |
| | | }; |
| | | }, |
| | | methods: { |
| | | getPosition() { |
| | | if (this.markLineTime == null) { |
| | | this.visible = false; |
| | | return 0; |
| | | } else { |
| | | this.visible = true; |
| | | return this.getPositonOffset(this.markLineTime); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="gantt-timeline" |
| | | :style="{'margin-left':-cellWidth/2+'px'}"> |
| | | <div class="gantt-timeline-block" |
| | | v-for="(day,index) in getDays" :style="{width:getTimeScales(day).length*cellWidth+'px'}" |
| | | :key="index"> |
| | | <div class="gantt-timeline-day " |
| | | :style="heightStyle"> |
| | | {{day.format("YYYY-MM-DD")}} |
| | | {{getDayMy(day.format("YYYY-MM-DD"))}} |
| | | </div> |
| | | <div class="gantt-timeline-scale " |
| | | :style="heightStyle"> |
| | | <div :style="cellWidthStyle" |
| | | v-for="(hour,index) in getTimeScales(day)" |
| | | :key="index"> |
| | | {{hour}} |
| | | <!-- <span v-if="hour !='01' ">{{hour}}</span> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { getBeginTimeOfTimeLine } from "../../utils/timeLineUtils.js"; |
| | | |
| | | const START_DAY = Symbol(); |
| | | const MIDDLE_DAY = Symbol(); |
| | | const END_DAY = Symbol(); |
| | | |
| | | function isSameDay(one, two) { |
| | | return one.isSame(two, "day"); |
| | | } |
| | | |
| | | export default { |
| | | name: "Timeline", |
| | | |
| | | props: { |
| | | start: { |
| | | type: dayjs |
| | | }, |
| | | end: { |
| | | type: dayjs |
| | | }, |
| | | cellWidth: { |
| | | type: Number |
| | | }, |
| | | titleHeight: { |
| | | type: Number |
| | | }, |
| | | scale: { |
| | | type: Number |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | | /** |
| | | * 天å表 |
| | | * @returns {[dayjs]} 该data䏿æéè¦æ¸²æçæ°æ® |
| | | */ |
| | | getDays() { |
| | | let temp = []; |
| | | let { start, end } = this; |
| | | |
| | | for (; !isSameDay(start, end); start = start.add(1, "day")) { |
| | | temp.push(start); |
| | | } |
| | | temp.push(start); |
| | | |
| | | return temp; |
| | | }, |
| | | cellWidthStyle() { |
| | | return { |
| | | width: `${this.cellWidth}px` |
| | | }; |
| | | }, |
| | | heightStyle() { |
| | | return { |
| | | height: this.titleHeight + "px", |
| | | "line-height": this.titleHeight + "px", |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | // ç®åºææ |
| | | getDayMy(day){ |
| | | let weekArray = new Array("æææ¥", "ææä¸", "ææäº", "ææä¸", "ææå", "ææäº", "ææå
"); |
| | | return weekArray[new Date(day).getDay()] |
| | | }, |
| | | /** |
| | | * è·åæ¶é´å»åº¦æ°ç» |
| | | * |
| | | * @param {dayjs} date |
| | | * @returns {[string]} 该data䏿æéè¦æ¸²æçæ°æ® |
| | | */ |
| | | getTimeScales(date) { |
| | | let { start, end } = this; |
| | | if (isSameDay(date, start)) { |
| | | return this.generateTimeScale(START_DAY); |
| | | } else if (isSameDay(date, end)) { |
| | | return this.generateTimeScale(END_DAY); |
| | | } else { |
| | | return this.generateTimeScale(MIDDLE_DAY); |
| | | } |
| | | }, |
| | | /** |
| | | * çææ¶é´å»åº¦æ°ç» |
| | | * |
| | | * @param {Symbol} type |
| | | * @returns {[string]} 该data䏿æéè¦æ¸²æçæ°æ® |
| | | */ |
| | | generateTimeScale(type) { |
| | | let totalblock = []; |
| | | let { start, end, scale } = this; |
| | | let a, b; |
| | | switch (type) { |
| | | case START_DAY: //åstartåä¸å¤© |
| | | a = getBeginTimeOfTimeLine(start, scale); |
| | | //startåendåä¸å¤©ç¹æ®å¤ç |
| | | if (isSameDay(start, end)) { |
| | | b = end; |
| | | } else { |
| | | b = start.endOf("day"); |
| | | } |
| | | break; |
| | | case END_DAY: //åend åä¸å¤© |
| | | a = end.startOf("day"); |
| | | b = end; |
| | | break; |
| | | case MIDDLE_DAY: //startåendä¸é´ç天 |
| | | a = start.startOf("day"); |
| | | b = start.endOf("day"); |
| | | break; |
| | | default: |
| | | throw new TypeError("é误ç计ç®ç±»å"); |
| | | } |
| | | while (!a.isAfter(b)) { |
| | | if (scale >= 60) { |
| | | totalblock.push(a.format("HH")); |
| | | } else { |
| | | totalblock.push(a.format("HH:mm")); |
| | | } |
| | | a = a.add(scale, "minute"); |
| | | } |
| | | |
| | | return totalblock; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .gantt-timeline-day{ |
| | | border-right: 1px solid #ebeef5; |
| | | border-bottom: 1px solid #ebeef5; |
| | | background: rgb(245, 245, 245); |
| | | color: #909399; |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | $gray: #f0f0f0; |
| | | |
| | | $font-gray:#777; |
| | | |
| | | .gantt { |
| | | &-chart { |
| | | position: relative; |
| | | overflow: hidden; |
| | | height: 100%; |
| | | width: 100%; |
| | | outline: 1px solid $gray; |
| | | } |
| | | |
| | | &-container{ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | &-header { |
| | | display: flex; |
| | | background-color: #fff; |
| | | outline: 1px solid $gray; |
| | | |
| | | &-title { |
| | | flex: none; |
| | | width: 100%; |
| | | background: whitesmoke; |
| | | color: #777; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | } |
| | | |
| | | &-timeline { |
| | | overflow: hidden; |
| | | } |
| | | } |
| | | |
| | | &-body { |
| | | position: relative; |
| | | } |
| | | |
| | | &-timeline { |
| | | position: relative; |
| | | text-align: center; |
| | | display: flex; |
| | | |
| | | &-day { |
| | | overflow: hidden; |
| | | font-weight: bold; |
| | | color: $font-gray; |
| | | } |
| | | |
| | | &-scale { |
| | | display: flex; |
| | | |
| | | &>div { |
| | | height: 100%; |
| | | font-size: 0.8rem; |
| | | font-weight: bold; |
| | | color: $font-gray; |
| | | } |
| | | } |
| | | |
| | | // éè第ä¸ä¸ªæ¶é´èç¹ï¼ä¸ç¶ä¼åªæ¾ç¤ºä¸åï¼ä¸å¥½ç |
| | | &-block:first-child &-scale div:first-child { |
| | | visibility: hidden; |
| | | } |
| | | } |
| | | |
| | | &-leftbar { |
| | | width: 100%; |
| | | height: 100%; |
| | | background: #fff; |
| | | color: $font-gray; |
| | | font-size: 0.8rem; |
| | | |
| | | &-wrapper { |
| | | flex: none; |
| | | position: relative; |
| | | overflow: hidden; |
| | | background: #fff; |
| | | outline: 1px solid $gray; |
| | | z-index: 100; |
| | | } |
| | | |
| | | &-item {} |
| | | |
| | | &-defalutItem { |
| | | width: 100%; |
| | | height: 100%; |
| | | outline: 1px solid $gray |
| | | } |
| | | } |
| | | |
| | | &-table { |
| | | display: flex; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | &-markline-area { |
| | | position: absolute; |
| | | z-index: 99; |
| | | } |
| | | |
| | | &-markline { |
| | | position: absolute; |
| | | z-index: 100; |
| | | width: 2px; |
| | | height: 100vh; |
| | | |
| | | &-label { |
| | | padding: 3px; |
| | | float: left; |
| | | color: #fff; |
| | | font-size: 0.7rem; |
| | | } |
| | | } |
| | | |
| | | &-blocks { |
| | | &-wrapper { |
| | | overflow: hidden; |
| | | } |
| | | } |
| | | |
| | | &-block { |
| | | position: relative; |
| | | // background-image: url('./assets/block.png'); |
| | | background-repeat: repeat; |
| | | |
| | | &-container { |
| | | position: relative; |
| | | height: 100%; |
| | | } |
| | | |
| | | &-item { |
| | | position: absolute; |
| | | height: 100%; |
| | | } |
| | | |
| | | &-defaultBlock { |
| | | width: 100%; |
| | | height: 100%; |
| | | outline: 1px solid $gray; |
| | | background: $gray; |
| | | } |
| | | } |
| | | |
| | | &-scroll-y { |
| | | overflow-y: scroll; |
| | | position: absolute; |
| | | z-index: 1000; |
| | | top: 0; |
| | | right: 0; |
| | | height: 100%; |
| | | width: 17px; |
| | | |
| | | &>div { |
| | | width: 17px; |
| | | } |
| | | } |
| | | |
| | | &-scroll-x { |
| | | overflow-x: scroll; |
| | | position: absolute; |
| | | z-index: 1000; |
| | | left: 0; |
| | | bottom: 0; |
| | | width: 100%; |
| | | height: 17px; |
| | | |
| | | &>div { |
| | | height: 17px; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | |
| | | <div class="gantt-chart" |
| | | @wheel="wheelHandle"> |
| | | <div class="gantt-container" |
| | | :style="{height:`calc(100% - ${scrollXBarHeight}px)`,width:`calc(100% - ${scrollYBarWidth}px)`}"> |
| | | <!-- <div class="gantt-container"> --> |
| | | <div v-show="!hideHeader" |
| | | class="gantt-header" |
| | | :style="{width:`calc(100% + ${scrollYBarWidth}px)`}"> |
| | | <div class="gantt-header-title" |
| | | :style="{'line-height':titleHeight+'px',height:titleHeight+'px','width':titleWidth+'px'}"> |
| | | <slot name="title">welcome v-gantt-chart</slot> |
| | | </div> |
| | | <div ref="headerTimeline" |
| | | class="gantt-header-timeline"> |
| | | <div class="gantt-timeline-wrapper" |
| | | :style="{width:(totalWidth+scrollYBarWidth)+'px'}"> |
| | | <timeline :start="start" |
| | | :end="end" |
| | | :cellWidth="cellWidth" |
| | | :titleHeight="titleHeight" |
| | | :scale="scale"> |
| | | </timeline> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="gantt-body" |
| | | :style="{height:`calc(100% - ${actualHeaderHeight}px)`}"> |
| | | <!-- <div class="gantt-body" style="height:500px"> --> |
| | | <div class="gantt-table"> |
| | | <div ref="marklineArea" |
| | | :style="{marginLeft:(titleWidth+50)+'px'}" |
| | | class="gantt-markline-area"> |
| | | <!-- <CurrentTime v-if="showCurrentTime" |
| | | :getPositonOffset="getPositonOffset" /> --> |
| | | <!-- <mark-line v-for="(times,index) in timeLines" |
| | | :key="index" |
| | | :markLineTime="times.time" |
| | | :getPositonOffset="getPositonOffset" |
| | | :color="times.color"></mark-line> --> |
| | | </div> |
| | | <div ref="leftbarWrapper" |
| | | class="gantt-leftbar-wrapper" |
| | | :style="{'width':(titleWidth)+'px',height:`calc(100% + ${scrollXBarHeight}px)`}"> |
| | | <LeftBar :datas="datas" |
| | | :dataKey="dataKey" |
| | | :scrollTop="scrollTop" |
| | | :heightOfRenderAera="heightOfRenderAera" |
| | | :widthOfRenderAera="widthOfRenderAera" |
| | | :cellHeight="cellHeight" |
| | | :style="{height:(totalHeight+scrollXBarHeight)+'px'}"> |
| | | <template slot-scope="{data}"> |
| | | <slot name="left" |
| | | :data="data"> |
| | | </slot> |
| | | </template> |
| | | </LeftBar> |
| | | </div> |
| | | <div ref="blocksWrapper" |
| | | class="gantt-blocks-wrapper"> |
| | | <blocks :scrollTop="scrollTop" |
| | | :scrollLeft="scrollLeft" |
| | | :heightOfRenderAera="heightOfRenderAera" |
| | | :widthOfRenderAera="widthOfRenderAera" |
| | | :arrayKeys="arrayKeys" |
| | | :itemKey="itemKey" |
| | | :dataKey="dataKey" |
| | | :datas="datas" |
| | | :cellWidth="cellWidth" |
| | | :cellHeight="cellHeight" |
| | | :scale="scale" |
| | | :getPositonOffset="getPositonOffset" |
| | | :getWidthAbout2Times="getWidthAbout2Times" |
| | | :customGenerateBlocks="customGenerateBlocks" |
| | | :startTimeOfRenderArea="startTimeOfRenderArea" |
| | | :endTimeOfRenderArea="endTimeOfRenderArea" |
| | | :style="{width:totalWidth+'px'}"> |
| | | |
| | | <!-- <template slot-scope="{data,item}"> |
| | | <slot name="block" |
| | | :data="data" |
| | | :item="item"> |
| | | </slot> |
| | | </template> --> |
| | | |
| | | <template |
| | | slot-scope="{data,item,getPositonOffset,getWidthAbout2Times,isInRenderingTimeRange}"> |
| | | <slot name="block" |
| | | :data="data" |
| | | :item="item" |
| | | :getPositonOffset="getPositonOffset" |
| | | :getWidthAbout2Times="getWidthAbout2Times" |
| | | :isInRenderingTimeRange="isInRenderingTimeRange" |
| | | :startTimeOfRenderArea="startTimeOfRenderArea" |
| | | :endTimeOfRenderArea="endTimeOfRenderArea"></slot> |
| | | </template> |
| | | |
| | | </blocks> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div ref="scrollYBar" |
| | | class="gantt-scroll-y" |
| | | :style="{width:`${scrollYBarWidth}px`, |
| | | height:`calc(100% - ${actualHeaderHeight}px`,marginTop:`${actualHeaderHeight}px`}" |
| | | @scroll="syncScrollY"> |
| | | <div :style="{height:totalHeight+'px'}"></div> |
| | | </div> |
| | | |
| | | <div ref="scrollXBar" |
| | | class="gantt-scroll-x" |
| | | :style="{height:`${scrollXBarHeight}px`, |
| | | width:`calc(100% - ${titleWidth}px )`,marginLeft:titleWidth+'px'}" |
| | | @scroll="syncScrollX"> |
| | | <div :style="{width:totalWidth+'px'}"></div> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import ResizeObserver from "resize-observer-polyfill"; |
| | | import { |
| | | scaleList, |
| | | getBeginTimeOfTimeLine, |
| | | calcScalesAbout2Times |
| | | } from "./utils/timeLineUtils.js"; |
| | | import { isDef, warn } from "./utils/tool.js"; |
| | | import { |
| | | getPositonOffset as _getPositonOffset, |
| | | getWidthAbout2Times as _getWidthAbout2Times |
| | | } from "./utils/gtUtils.js"; |
| | | import throttle from "./utils/throttle.js"; |
| | | import Timeline from "./components/time-line/index.vue"; |
| | | import CurrentTime from "./components/mark-line/current-time.vue"; |
| | | import LeftBar from "./components/left-bar/index.vue"; |
| | | import Blocks from "./components/blocks/index.vue"; |
| | | import MarkLine from "./components/mark-line/index.vue"; |
| | | |
| | | export default { |
| | | name: "Gantt", |
| | | |
| | | components: { Timeline, LeftBar, Blocks, MarkLine, CurrentTime }, |
| | | |
| | | props: { |
| | | startTime: { |
| | | default: () => dayjs(), |
| | | validator(date) { |
| | | let ok = dayjs(date).isValid(); |
| | | if (!ok) warn(`éæ³çå¼å§æ¶é´ ${date}`); |
| | | return ok; |
| | | } |
| | | }, |
| | | endTime: { |
| | | default: () => dayjs(), |
| | | validator(date) { |
| | | let ok = dayjs(date).isValid(); |
| | | if (!ok) warn(`éæ³çç»ææ¶é´ ${date}`); |
| | | return ok; |
| | | } |
| | | }, |
| | | cellWidth: { |
| | | type: Number, |
| | | default: 50 |
| | | }, |
| | | cellHeight: { |
| | | type: Number, |
| | | default: 20 |
| | | }, |
| | | titleHeight: { |
| | | type: Number, |
| | | default: 40 |
| | | }, |
| | | titleWidth: { |
| | | type: Number, |
| | | default: 200 |
| | | }, |
| | | scale: { |
| | | type: Number, |
| | | default: 60, |
| | | validator(value) { |
| | | return scaleList.includes(value); |
| | | } |
| | | }, |
| | | datas: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | dataKey: { |
| | | type: String, |
| | | default: undefined |
| | | }, |
| | | itemKey: { |
| | | type: String, |
| | | default: undefined |
| | | }, |
| | | arrayKeys: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | showCurrentTime: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | timeLines: { |
| | | type: Array |
| | | }, |
| | | scrollToTime: { |
| | | validator(date) { |
| | | return dayjs(date).isValid(); |
| | | } |
| | | }, |
| | | scrollToPostion: { |
| | | validator(obj) { |
| | | let validX = isDef(obj.x) ? !Number.isNaN(obj.x) : true; |
| | | let validY = isDef(obj.y) ? !Number.isNaN(obj.y) : true; |
| | | if (!validX && !validY) { |
| | | warn("scrollToPostion xæy æå¼ä¸ºéNumberç±»å"); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | }, |
| | | hideHeader: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | hideXScrollBar: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | hideYScrollBar: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | customGenerateBlocks: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return { |
| | | //ç¼åèç¹ |
| | | selector: { |
| | | gantt_leftbar: {}, |
| | | gantt_table: {}, |
| | | gantt_scroll_y: {}, |
| | | gantt_timeline: {}, |
| | | gantt_scroll_x: {}, |
| | | gantt_markArea: {} |
| | | }, |
| | | scrollTop: 0, |
| | | scrollLeft: 0, |
| | | //block åºåéè¦æ¸²æçèå´ |
| | | //å
渲æåºç©ºæ¡æ¶ï¼å¨mountedååå¾å°çå®ç渲æèå´ï¼ç¶å卿 ¹æ®èå´æ¸²ææ°æ®ï¼æ¯ä¹å设置ä¸ä¸ªé»è®¤é«åº¦å®½åº¦ï¼é¢å¤çæ¸²ææµªè´¹æ´å°äº |
| | | heightOfRenderAera: 0, |
| | | widthOfRenderAera: 0, |
| | | startTimeOfRenderArea: null, |
| | | endTimeOfRenderArea: null, |
| | | scrollBarWitdh: 17 |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | start() { |
| | | return dayjs(this.startTime); |
| | | }, |
| | | end() { |
| | | let { start, widthOfRenderAera, scale, cellWidth } = this; |
| | | let end = dayjs(this.endTime); |
| | | let totalWidth = calcScalesAbout2Times(start, end, scale) * cellWidth; |
| | | if (start.isAfter(end) || totalWidth <= widthOfRenderAera) { |
| | | end = start.add((widthOfRenderAera / cellWidth) * scale, "minute"); |
| | | } |
| | | return end; |
| | | }, |
| | | totalWidth() { |
| | | let { cellWidth, totalScales } = this; |
| | | return cellWidth * totalScales; |
| | | }, |
| | | totalScales() { |
| | | let { start, end, scale } = this; |
| | | return calcScalesAbout2Times(start, end, scale); |
| | | }, |
| | | totalHeight() { |
| | | let { datas, cellHeight } = this; |
| | | return datas.length * cellHeight; |
| | | }, |
| | | beginTimeOfTimeLine() { |
| | | let value = getBeginTimeOfTimeLine(this.start, this.scale); |
| | | return value; |
| | | }, |
| | | beginTimeOfTimeLineToString() { |
| | | return this.beginTimeOfTimeLine.toString(); |
| | | }, |
| | | avialableScrollLeft() { |
| | | // ä¸åè¿ä¸ª1ï¼æ»å¨å°æ¶é´è½´å°½å¤´åç»§ç»æ»å¨ä¼æ
¢æ
¢çæº¢åº |
| | | let { totalWidth, widthOfRenderAera } = this; |
| | | return totalWidth - widthOfRenderAera - 1; |
| | | }, |
| | | avialableScrollTop() { |
| | | let { totalHeight, heightOfRenderAera } = this; |
| | | return totalHeight - heightOfRenderAera - 1; |
| | | }, |
| | | scrollXBarHeight() { |
| | | return this.hideXScrollBar ? 0 : this.scrollBarWitdh; |
| | | }, |
| | | scrollYBarWidth() { |
| | | return this.hideYScrollBar ? 0 : this.scrollBarWitdh; |
| | | }, |
| | | actualHeaderHeight() { |
| | | return this.hideHeader ? 0 : this.titleHeight; |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | | scrollLeft() { |
| | | this.getTimeRange(); |
| | | }, |
| | | widthOfRenderAera() { |
| | | this.getTimeRange(); |
| | | }, |
| | | cellWidth() { |
| | | this.getTimeRange(); |
| | | }, |
| | | scrollToTime: { |
| | | handler(newV) { |
| | | if (!newV) { |
| | | return; |
| | | } |
| | | let { start, end } = this; |
| | | let time = dayjs(newV); |
| | | if (!(time.isAfter(start) && time.isBefore(end))) { |
| | | warn(`å½åæ»å¨è³${newV}ä¸å¨${start}å${end}çèå´ä¹å
`); |
| | | return; |
| | | } |
| | | |
| | | let offset = this.getPositonOffset(newV); |
| | | // immediate ä¼é ædom è¿æ²¡ææè½½æ¶å°±è¿è¡æä½ï¼æ
éè¦å»¶è¿æ§è¡ |
| | | this.$nextTick(() => |
| | | this.syncScrollX( |
| | | { |
| | | target: { |
| | | scrollLeft: offset |
| | | } |
| | | }, |
| | | true |
| | | ) |
| | | ); |
| | | }, |
| | | immediate: true |
| | | }, |
| | | scrollToPostion: { |
| | | handler(newV) { |
| | | if (!newV) { |
| | | return; |
| | | } |
| | | let x = Number.isNaN(newV.x) ? undefined : newV.x; |
| | | let y = Number.isNaN(newV.y) ? undefined : newV.y; |
| | | this.$nextTick(() => { |
| | | if (isDef(x) && x !== this.scrollLeft) { |
| | | this.syncScrollX({ target: { scrollLeft: x } }, true); |
| | | } |
| | | if (isDef(y) && y !== this.scrollTop) { |
| | | this.syncScrollY({ target: { scrollTop: y } }, true); |
| | | } |
| | | }); |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | this.getSelector(); |
| | | // 计ç®åç¡®çæ¸²æåºåèå´ |
| | | const observeContainer = throttle(entries => { |
| | | entries.forEach(entry => { |
| | | const cr = entry.contentRect; |
| | | this.heightOfRenderAera = cr.height; |
| | | this.widthOfRenderAera = cr.width; |
| | | }); |
| | | }); |
| | | const observer = new ResizeObserver(observeContainer); |
| | | observer.observe(this.$refs.blocksWrapper); |
| | | }, |
| | | |
| | | methods: { |
| | | /** |
| | | * 计ç®éè¦æ¸²æçæ¶é´èå´ |
| | | * |
| | | */ |
| | | getTimeRange() { |
| | | if (this.heightOfRenderAera === 0) { |
| | | return; |
| | | } |
| | | |
| | | let { |
| | | beginTimeOfTimeLine, |
| | | scrollLeft, |
| | | cellWidth, |
| | | scale, |
| | | widthOfRenderAera |
| | | } = this; |
| | | |
| | | this.startTimeOfRenderArea = beginTimeOfTimeLine |
| | | .add((scrollLeft / cellWidth) * scale, "minute") |
| | | .toDate() |
| | | .getTime(); |
| | | this.endTimeOfRenderArea = beginTimeOfTimeLine |
| | | .add(((scrollLeft + widthOfRenderAera) / cellWidth) * scale, "minute") |
| | | .toDate() |
| | | .getTime(); |
| | | }, |
| | | getWidthAbout2Times(start, end) { |
| | | let options = { |
| | | scale: this.scale, |
| | | cellWidth: this.cellWidth |
| | | }; |
| | | return _getWidthAbout2Times(start, end, options); |
| | | }, |
| | | /** |
| | | * 为æ¶é´çº¿è®¡ç®åç§» |
| | | */ |
| | | getPositonOffset(date) { |
| | | let options = { |
| | | scale: this.scale, |
| | | cellWidth: this.cellWidth |
| | | }; |
| | | |
| | | return _getPositonOffset(date, this.beginTimeOfTimeLineToString, options); |
| | | }, |
| | | //ç¼åèç¹ |
| | | getSelector() { |
| | | this.selector.gantt_leftbar = this.$refs.leftbarWrapper; |
| | | this.selector.gantt_table = this.$refs.blocksWrapper; |
| | | this.selector.gantt_scroll_y = this.$refs.scrollYBar; |
| | | this.selector.gantt_timeline = this.$refs.headerTimeline; |
| | | this.selector.gantt_scroll_x = this.$refs.scrollXBar; |
| | | this.selector.gantt_markArea = this.$refs.marklineArea; |
| | | }, |
| | | wheelHandle(event) { |
| | | let { deltaX, deltaY } = event; |
| | | this.$nextTick(() => { |
| | | let { |
| | | scrollTop, |
| | | scrollLeft, |
| | | avialableScrollLeft, |
| | | avialableScrollTop |
| | | } = this; |
| | | |
| | | if (deltaY !== 0) { |
| | | if ( |
| | | scrollTop + deltaY >= avialableScrollTop && |
| | | scrollTop !== avialableScrollTop |
| | | ) { |
| | | this.syncScrollY( |
| | | { target: { scrollTop: avialableScrollTop } }, |
| | | true |
| | | ); |
| | | } else if ( |
| | | scrollTop + deltaY < 0 && |
| | | scrollTop !== 0 /*æ»å¨ä¸º0éå¶*/ |
| | | ) { |
| | | this.syncScrollY({ target: { scrollTop: 0 } }, true); |
| | | } else { |
| | | this.syncScrollY( |
| | | { target: { scrollTop: scrollTop + deltaY } }, |
| | | true |
| | | ); |
| | | } |
| | | } |
| | | if (deltaX !== 0) { |
| | | if ( |
| | | scrollLeft + deltaX >= avialableScrollLeft && |
| | | scrollLeft !== avialableScrollLeft |
| | | ) { |
| | | this.syncScrollX( |
| | | { target: { scrollLeft: avialableScrollLeft } }, |
| | | true |
| | | ); |
| | | } else if ( |
| | | scrollLeft + deltaX < 0 && |
| | | scrollLeft !== 0 /*æ»å¨ä¸º0éå¶*/ |
| | | ) { |
| | | this.syncScrollX({ target: { scrollLeft: 0 } }, true); |
| | | } else { |
| | | this.syncScrollX( |
| | | { target: { scrollLeft: scrollLeft + deltaX } }, |
| | | true |
| | | ); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | //忥fixleftåblockçæ»å¨ |
| | | syncScrollY(event, fake = false) { |
| | | let { gantt_leftbar, gantt_table, gantt_scroll_y } = this.selector; |
| | | let topValue = event.target.scrollTop; |
| | | if (fake) { |
| | | //ä¼è§¦å䏿¬¡ççæ»å¨äºä»¶event, åé¢ç代ç ä¼å¨ç¬¬äºä¸ªäºä»¶ä¸æ§è¡ |
| | | gantt_scroll_y.scrollTop = topValue; |
| | | return; |
| | | } |
| | | gantt_leftbar.scrollTop = topValue; |
| | | gantt_table.scrollTop = topValue; |
| | | this.scrollTop = topValue; |
| | | this.$emit("scrollTop", topValue); |
| | | }, |
| | | syncScrollX(event, fake = false) { |
| | | let { |
| | | gantt_table, |
| | | gantt_timeline, |
| | | gantt_markArea, |
| | | gantt_scroll_x |
| | | } = this.selector; |
| | | let leftValue = event.target.scrollLeft; |
| | | if (fake) { |
| | | //ä¼è§¦å䏿¬¡ççæ»å¨äºä»¶event, åé¢ç代ç ä¼å¨ç¬¬äºä¸ªäºä»¶ä¸æ§è¡ |
| | | gantt_scroll_x.scrollLeft = leftValue; |
| | | return; |
| | | } |
| | | gantt_table.scrollLeft = leftValue; |
| | | gantt_timeline.scrollLeft = leftValue; |
| | | gantt_markArea.style.left = "-" + leftValue + "px"; |
| | | this.scrollLeft = leftValue; |
| | | this.$emit("scrollLeft", leftValue); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | @import "./gantt.scss"; |
| | | .gantt-leftbar-wrapper{ |
| | | // overflow-y: scroll; |
| | | // overflow: visible; |
| | | } |
| | | .gantt-body{ |
| | | // overflow-y: scroll; |
| | | } |
| | | .gantt-leftbar{ |
| | | // overflow-y: scroll; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // gantt.vueåæä»¬çç»ä»¶ |
| | | import gantt from './gantt.vue' |
| | | |
| | | // å®ä¹æä»¬çæä»¶ |
| | | const myPlugin = { |
| | | // 该æä»¶æä¸ä¸ªinstallæ¹æ³ |
| | | // æ¹æ³ç第ä¸ä¸ªåæ°æ¯ä¼ å
¥çVueï¼ç¬¬äºä¸ªåæ°å¯ä»¥æä»¶çèªå®ä¹åæ° |
| | | // eslint-disable-next-line |
| | | install (Vue, options) { |
| | | // å°å
¶æ³¨å为vueçç»ä»¶ï¼'gantt'æ¯ç»ä»¶åï¼keyboardæ¯æä»¬å¼åçç»ä»¶ |
| | | Vue.component('v-gantt-chart', gantt) |
| | | } |
| | | } |
| | | // æ°å¢ |
| | | if (typeof window !== 'undefined' && window.Vue) { |
| | | window.Vue.use(gantt) |
| | | } |
| | | |
| | | // æå尿件坼åºï¼å¹¶å¨main.jsä¸éè¿Vue.use()å³å¯ä½¿ç¨æä»¶ |
| | | export default myPlugin |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | export default function debounce(fn, interval = 500, immediate = false) { |
| | | //fnä¸ºè¦æ§è¡ç彿° |
| | | //interval为çå¾
çæ¶é´ |
| | | //immediate夿æ¯å¦ç«å³æ§è¡ |
| | | var timeout; //宿¶å¨ |
| | | |
| | | return function() { //è¿åä¸ä¸ªéå
|
| | | var context = this, |
| | | args = arguments; //å
æåéç¼å |
| | | var later = function() { //æç¨åè¦æ§è¡ç代ç å°è£
èµ·æ¥ |
| | | timeout = null; //æåè°ç¨åæ¸
é¤å®æ¶å¨ |
| | | if (!immediate) fn.apply(context, args); //ä¸ç«å³æ§è¡æ¶æå¯ä»¥è°ç¨ |
| | | }; |
| | | |
| | | var callNow = immediate && !timeout; //夿æ¯å¦ç«å³è°ç¨ï¼å¹¶ä¸å¦æå®æ¶å¨åå¨ï¼åä¸ç«å³è°ç¨ |
| | | clearTimeout(timeout); //ä¸ç®¡ä»ä¹æ
åµï¼å
æ¸
é¤å®æ¶å¨ï¼è¿æ¯æç¨³å¦¥ç |
| | | timeout = setTimeout(later, interval); //å»¶è¿æ§è¡ |
| | | if (callNow) fn.apply(context, args); //妿æ¯ç¬¬ä¸æ¬¡è§¦åï¼å¹¶ä¸immediate为trueï¼åç«å³æ§è¡ |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // import dayjs from 'dayjs' //æ¿æ¢dayjs å
¼å®¹æ§ä¼å¥½ä¸ç¹ï¼ä½æ¯éåº¦å°±å¾æ
¢äºï¼ä¹åæµäºä¸ä¸ï¼å¤§æ¦å¿«30åï¼æç¹å¿è®°äº |
| | | |
| | | //ç¼å è§£æå¼ï¼å éä¸ç¹ç¹å§ |
| | | |
| | | const cacheParseTime = function () { |
| | | let cacheString = {} |
| | | let cacheValue = {} |
| | | |
| | | return function(timeName, timeString) { |
| | | |
| | | if (cacheString[timeName] !== timeString) { |
| | | cacheString[timeName] = timeString; |
| | | cacheValue[timeName] = parseTime(timeString) |
| | | } |
| | | |
| | | return cacheValue[timeName] |
| | | } |
| | | }() |
| | | |
| | | // pStart å
³äºç¼åè¿ä¸ªå¼æ¯å 为getWidthAbout2TimesågetPositonOffseté常æ¯ååè¿ç»è°ç¨ï¼start å¼ä¼åä¸¤ä¸ªå½æ°ä¸åå«ç¨å°ä¸æ¬¡ |
| | | |
| | | /** |
| | | * æ ¹æ®é
置项计ç®ä¸¤ä¸ªæ¶é´çå¨gantt å¾ä¸çé¿åº¦ |
| | | * æ³¨ï¼æ¶é´ä¸start æ©ï¼ end æ |
| | | * |
| | | * @export |
| | | * @param {string} start |
| | | * @param {string} end |
| | | * @param {{scale:number,cellWidth:number}} arg |
| | | * @returns number |
| | | */ |
| | | export function getWidthAbout2Times(start, end, arg) { |
| | | let { |
| | | scale, |
| | | cellWidth |
| | | } = arg; |
| | | let pStart = cacheParseTime('pStart', start); |
| | | let pEnd = parseTime(end) |
| | | return diffTimeByMinutes(pStart, pEnd) / scale * cellWidth; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é
ç½®é¡¹è®¡ç® ç¸å¯¹äº æ¶é´è½´èµ·å§æ¶é´çè·ç¦» æ¯ getWidthAbout2Times çç¹å |
| | | * æ³¨ï¼æ¶é´ä¸ï¼time æ beginTimeOfTimeLine æ© |
| | | * |
| | | * @export |
| | | * @param {string} time |
| | | * @param {string} beginTimeOfTimeLine |
| | | * @param {{scale:number,cellWidth:number}} arg |
| | | * @returns number |
| | | */ |
| | | export function getPositonOffset(time, beginTimeOfTimeLine, arg) { |
| | | let { |
| | | scale, |
| | | cellWidth, |
| | | } = arg; |
| | | let pTime = cacheParseTime('pStart', time); |
| | | let pBeginTimeOfTimeLine = cacheParseTime('pBeginTimeOfTimeLine', beginTimeOfTimeLine); |
| | | return diffTimeByMinutes(pBeginTimeOfTimeLine, pTime) / scale * cellWidth; |
| | | } |
| | | |
| | | function parseTime(time) { |
| | | return new Date(time) |
| | | } |
| | | /** |
| | | * 计ç®ä¸¤ä¸ªæ¶é´ç¸å·®çåéæ° |
| | | * |
| | | * @param {string} start |
| | | * @param {string} end |
| | | * @returns |
| | | */ |
| | | function diffTimeByMinutes(start, end) { |
| | | let diff = end.getTime() - start.getTime() |
| | | return (diff / 1000 / 60) |
| | | } |
| | | |
| | | |
| | | |
| | | // function parseTime(time){ |
| | | // return dayjs(time) |
| | | // } |
| | | |
| | | // function diffTimeByMinutes(start,end){ |
| | | // return end.diff(start, "m", true) |
| | | // } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | export default function throttle(fn, interval = 100) { //fnä¸ºè¦æ§è¡ç彿°ï¼intervalä¸ºå»¶è¿æ¶é´ |
| | | var _self = fn, //ä¿åéè¦è¢«å»¶è¿æ§è¡ç彿°å¼ç¨ |
| | | timer, //宿¶å¨ |
| | | firstTime = true; //æ¯å¦ç¬¬ä¸æ¬¡è°ç¨ |
| | | return function() { //è¿åä¸ä¸ªå½æ°ï¼å½¢æéå
ï¼æä¹
ååé |
| | | var args = arguments, //ç¼ååé |
| | | _me = this; |
| | | if (firstTime) { //妿æ¯ç¬¬ä¸æ¬¡è°ç¨ï¼ä¸ç¨å»¶è¿æ§è¡ |
| | | _self.apply(_me, args); |
| | | return firstTime = false; |
| | | } |
| | | if (timer) { //妿宿¶å¨è¿å¨ï¼è¯´æä¸ä¸æ¬¡å»¶è¿æ§è¡è¿æ²¡æå®æ |
| | | return false; |
| | | } |
| | | timer = setTimeout(function() { //å»¶è¿ä¸æ®µæ¶é´æ§è¡ |
| | | clearTimeout(timer); |
| | | timer = null; |
| | | _self.apply(_me, args); |
| | | }, interval); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs' |
| | | |
| | | export const scaleList = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60, 120, 180, |
| | | 240, |
| | | 360, 720, 1440 |
| | | ] |
| | | /** |
| | | * éªè¯æ¯å¦åæ³scaleå¼ |
| | | * |
| | | * @export |
| | | * @param {number} scale |
| | | * @returns |
| | | */ |
| | | export function validateScale(scale) { |
| | | if (!scaleList.includes(scale)) { |
| | | throw new RangeError( |
| | | `é误çscaleå¼ï¼è¾å
¥å¼ä¸º${scale},å¯ç¨çscaleå¼ä¸º${scaleList.join(',')}`) |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç»åºçscale å start æ¶é´ 计ç®åºç¨äºè®¡ç®åçæå¾è¡¨çå¯å§æ¶é´ |
| | | * egï¼Start 为10:10å å»åº¦ä¸º60ï¼getBeginTimeOfTimeLine彿°ç»åºçæ¶é´ 为 10:00å |
| | | * å»åº¦ä¸º5ï¼getBeginTimeOfTimeLine彿°ç»åºçæ¶é´ 为 10:10å |
| | | * å»åº¦ä¸º3ï¼getBeginTimeOfTimeLine彿°ç»åºçæ¶é´ 为 10:09å |
| | | * |
| | | * @export |
| | | * @param {dayjs} start |
| | | * @param {number} [scale=60] |
| | | * @returns {dayjs}计ç®çå¯å§æ¶é´ |
| | | */ |
| | | export function getBeginTimeOfTimeLine(start, scale = 60) { |
| | | validateScale(scale) |
| | | let timeBlocks; |
| | | let startClone = start.clone(); |
| | | let rate = scale / 60; |
| | | if (scale > 60) { |
| | | timeBlocks = Math.floor(start.hour() / rate); |
| | | startClone = startClone.hour(timeBlocks * rate).minute(0).second(0); |
| | | } else { |
| | | timeBlocks = Math.floor(start.minute() / scale); |
| | | startClone = startClone.minute(timeBlocks * scale).second(0); |
| | | } |
| | | |
| | | return startClone; |
| | | } |
| | | /** |
| | | * æ ¹æ®æç» scaleè®¡ç® ä¸¤ä¸ªæ¶é´å·®ä¸å
±å¯ä»¥åæå¤å°ä¸ªå»åº¦ |
| | | * 注æï¼ timdStart 并䏿¯å®é
çå¼å§è®¡ç®çæ¶é´ï¼ä¼éè¿getBeginTimeOfTimeLine 彿°è®¡ç®åºåå²å¼å§æ¶é´ |
| | | * |
| | | * @export |
| | | * @param {dayjs} timeStart å¼å§æ¶é´ |
| | | * @param {dayjs} timeEnd ç»ææ¶é´ |
| | | * @param {number} [scale=60] åå²çå»åº¦ |
| | | * @returns æ¶é´åæ°é |
| | | */ |
| | | export function calcScalesAbout2Times(timeStart, timeEnd, scale = 60) { |
| | | if (timeStart.isAfter(timeEnd)) { |
| | | throw new TypeError('é误çåæ°é¡ºåºï¼å½æ°calcScalesAbout2Timesç第ä¸ä¸ªæ¶é´åæ°å¿
须大äºç¬¬äºä¸ªæ¶é´åæ°') |
| | | } |
| | | |
| | | validateScale(scale); |
| | | |
| | | let startBlocksTime = getBeginTimeOfTimeLine(timeStart, scale); |
| | | let count = 0; |
| | | while (!startBlocksTime.isAfter(timeEnd)) { |
| | | count++; |
| | | startBlocksTime = startBlocksTime.add(scale, "minute") |
| | | } |
| | | |
| | | return count; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * æ¯å¦æ²¡æå¼ |
| | | * |
| | | * @export |
| | | * @param {*} v |
| | | * @returns |
| | | */ |
| | | export function isUndef(v){ |
| | | return v === undefined || v === null |
| | | } |
| | | /** |
| | | * æ¯å¦æå¼ |
| | | * |
| | | * @export |
| | | * @param {*} v |
| | | * @returns |
| | | */ |
| | | export function isDef(v){ |
| | | return v !== undefined && v !== null |
| | | } |
| | | |
| | | export function warn(str){ |
| | | // eslint-disable-next-line |
| | | console.warn(str) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "v-gantt-chart", |
| | | "version": "1.3.3", |
| | | "description": "display gantt-like vaule,like use this to order bus schedule.", |
| | | "main": "dist/v-gantt-chart.js", |
| | | "repository": { |
| | | "type": "git", |
| | | "url": "git+https://github.com/w1301625107/Vue-Gantt-chart.git" |
| | | }, |
| | | "bugs": { |
| | | "url": "https://github.com/w1301625107/Vue-Gantt-chart/issues" |
| | | }, |
| | | "homepage": "https://github.com/w1301625107/Vue-Gantt-chart#readme", |
| | | "keywords": [ |
| | | "vue-gantt-chart", |
| | | "gantt", |
| | | "gantt-chart", |
| | | "v-gantt-chart" |
| | | ], |
| | | "author": "wuchouchou", |
| | | "license": "MIT", |
| | | "scripts": { |
| | | "test":" BABEL_ENV=test mocha --require babel-core/register ", |
| | | "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" |
| | | }, |
| | | "dependencies": { |
| | | "dayjs": "^1.8.11", |
| | | "resize-observer-polyfill": "^1.5.1", |
| | | "vue": "^2.5.21" |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | | "last 2 versions", |
| | | "not ie <= 8" |
| | | ], |
| | | "devDependencies": { |
| | | "babel-core": "^6.26.0", |
| | | "babel-loader": "^7.1.2", |
| | | "babel-preset-env": "^1.6.0", |
| | | "babel-preset-stage-3": "^6.24.1", |
| | | "chai": "^4.2.0", |
| | | "cross-env": "^5.0.5", |
| | | "css-loader": "^0.28.7", |
| | | "mocha": "^6.0.2", |
| | | "node-sass": "^4.11.0", |
| | | "sass-loader": "^6.0.6", |
| | | "url-loader": "^1.1.0", |
| | | "vue-loader": "^13.0.5", |
| | | "vue-template-compiler": "^2.5.21", |
| | | "webpack": "^3.6.0" |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var expect = require('chai').expect; |
| | | var func = require('../lib/utils/gtUtils') |
| | | import dayjs from 'dayjs' |
| | | |
| | | describe('æµè¯gtUtils.js', function() { |
| | | |
| | | describe('æµè¯getWidthAbout2Times彿°', function() { |
| | | it('ç¸åæ¶é´ 计ç®ç»æä¸º0', function() { |
| | | expect(func.getWidthAbout2Times(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs( |
| | | '2018-10-10 10:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })) |
| | | .to.be.equal(0); |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯1', function() { |
| | | expect(func.getWidthAbout2Times(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs( |
| | | '2018-10-10 11:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })).to.equal(60) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯2', function() { |
| | | expect(func.getWidthAbout2Times(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs( |
| | | '2018-10-10 01:10:00'), { |
| | | scale: 1, |
| | | cellWidth: 1 |
| | | })).to.equal(70) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯3', function() { |
| | | expect(func.getWidthAbout2Times(dayjs( |
| | | '2018-10-11 10:00:00'), dayjs( |
| | | '2018-10-11 00:00:00'), { |
| | | scale: 10, |
| | | cellWidth: 10 |
| | | })).to.equal(-600) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯4', function() { |
| | | expect(func.getWidthAbout2Times(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs( |
| | | '2018-10-10 10:00:00'), { |
| | | scale: 10, |
| | | cellWidth: 60 |
| | | })).to.equal(3600) |
| | | }); |
| | | }); |
| | | |
| | | describe('æµè¯getPositonOffset彿°', function() { |
| | | it('ç¸åæ¶é´ 计ç®ç»æä¸º0', function() { |
| | | expect(func.getPositonOffset(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs( |
| | | '2018-10-10 10:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })) |
| | | .to.be.equal(0); |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯1', function() { |
| | | expect(func.getPositonOffset(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs( |
| | | '2018-10-10 11:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })).to.equal(-60) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯2', function() { |
| | | expect(func.getPositonOffset(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs( |
| | | '2018-10-10 01:10:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })).to.equal(-70) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯3', function() { |
| | | expect(func.getPositonOffset(dayjs( |
| | | '2018-10-11 10:00:00'), dayjs( |
| | | '2018-10-11 00:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })).to.equal(+600) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯4', function() { |
| | | expect(func.getPositonOffset(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs( |
| | | '2018-10-10 10:00:00'), { |
| | | scale: 60, |
| | | cellWidth: 60 |
| | | })).to.equal(-600) |
| | | }); |
| | | }); |
| | | |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var expect = require('chai').expect; |
| | | var func = require('../lib/utils/timeLineUtils') |
| | | import dayjs from 'dayjs' |
| | | |
| | | describe('æµè¯timeLineUtils.js', function() { |
| | | describe('æµè¯calcScalesAbout2Times彿°', function() { |
| | | it('ç¸åæ¶é´ 计ç®ç»æä¸º1', function() { |
| | | expect(func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs('2018-10-10 10:00:00'), )) |
| | | .to.be.equal(1); |
| | | }); |
| | | |
| | | |
| | | it('start å¨ end ä¹å æ¥é', function() { |
| | | expect(() => func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-12 10:00:00'), dayjs('2018-10-10 10:00:00'), |
| | | 11)).to.throw('é误çåæ°é¡ºåº'); |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯1', function() { |
| | | expect(func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs('2018-10-10 11:00:00'), |
| | | 10)).to.equal(7) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯2', function() { |
| | | expect(func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs('2018-10-10 11:00:00'), |
| | | 60)).to.equal(12) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯3', function() { |
| | | expect(func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-10 10:00:00'), dayjs('2018-10-11 00:00:00'), |
| | | 60)).to.equal(15) |
| | | }); |
| | | |
| | | it('æ°æ®æµè¯4', function() { |
| | | expect(func.calcScalesAbout2Times(dayjs( |
| | | '2018-10-10 00:00:00'), dayjs('2018-10-11 00:00:00'), |
| | | 60)).to.equal(25) |
| | | }); |
| | | |
| | | }); |
| | | |
| | | describe('æµè¯getBeginTimeOfTimeLine彿°', function() { |
| | | it('æµè¯æ°æ®1', function() { |
| | | expect( func.getBeginTimeOfTimeLine(dayjs('2018-10-11 00:00:00')).toString()) |
| | | .to.be.equal(dayjs('2018-10-11 00:00:00').toString()); |
| | | }); |
| | | |
| | | it('æµè¯æ°æ®2', function() { |
| | | expect( func.getBeginTimeOfTimeLine(dayjs('2018-10-11 00:00:00'),3).toString()) |
| | | .to.be.equal(dayjs('2018-10-11 00:00:00').toString()); |
| | | }); |
| | | |
| | | it('æµè¯æ°æ®3', function() { |
| | | expect( func.getBeginTimeOfTimeLine(dayjs('2018-10-11 00:04:00'),3).toString()) |
| | | .to.be.equal(dayjs('2018-10-11 00:03:00').toString()); |
| | | }); |
| | | |
| | | it('æµè¯æ°æ®4', function() { |
| | | expect( func.getBeginTimeOfTimeLine(dayjs('2018-10-11 01:11:00'),10).toString()) |
| | | .to.be.equal(dayjs('2018-10-11 01:10:00').toString()); |
| | | }); |
| | | }); |
| | | |
| | | describe('æµè¯validateScale彿°', function() { |
| | | it('空å¼å¼å¸¸', function() { |
| | | expect(() => func.validateScale()) |
| | | .to.throw(); |
| | | }); |
| | | |
| | | it('null å¼', function() { |
| | | expect(() => func.validateScale(null)) |
| | | .to.throw(); |
| | | }); |
| | | |
| | | it('undefined å¼', function() { |
| | | expect(() => func.validateScale(undefined)) |
| | | .to.throw(); |
| | | }); |
| | | |
| | | it('å¼å¸¸scale 弿¥é', function() { |
| | | expect(() => func.validateScale()) |
| | | .to.throw(); |
| | | }); |
| | | |
| | | it('æ£å¸¸å¼', function() { |
| | | expect(func.validateScale(1)) |
| | | .to.be.true; |
| | | }); |
| | | |
| | | }); |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var path = require('path') |
| | | var webpack = require('webpack') |
| | | |
| | | module.exports = { |
| | | entry: './lib/index.js', |
| | | output: { |
| | | path: path.resolve(__dirname, './dist'), |
| | | publicPath: '/dist/', |
| | | filename: 'v-gantt-chart.js', |
| | | library: 'vGanttChart', |
| | | libraryTarget: 'umd', |
| | | umdNamedDefine: true |
| | | }, |
| | | module: { |
| | | rules: [{ |
| | | test: /\.css$/, |
| | | use: [ |
| | | 'vue-style-loader', |
| | | 'css-loader' |
| | | ], |
| | | }, |
| | | { |
| | | test: /\.scss$/, |
| | | use: [ |
| | | 'vue-style-loader', |
| | | 'css-loader', |
| | | 'sass-loader' |
| | | ], |
| | | }, |
| | | { |
| | | test: /\.sass$/, |
| | | use: [ |
| | | 'vue-style-loader', |
| | | 'css-loader', |
| | | 'sass-loader?indentedSyntax' |
| | | ], |
| | | }, |
| | | { |
| | | test: /\.vue$/, |
| | | loader: 'vue-loader', |
| | | options: { |
| | | loaders: { |
| | | // Since sass-loader (weirdly) has SCSS as its default parse mode, we map |
| | | // the "scss" and "sass" values for the lang attribute to the right configs here. |
| | | // other preprocessors should work out of the box, no loader config like this necessary. |
| | | 'scss': [ |
| | | 'vue-style-loader', |
| | | 'css-loader', |
| | | 'sass-loader' |
| | | ], |
| | | 'sass': [ |
| | | 'vue-style-loader', |
| | | 'css-loader', |
| | | 'sass-loader?indentedSyntax' |
| | | ] |
| | | } |
| | | // other vue-loader options go here |
| | | } |
| | | }, |
| | | { |
| | | test: /\.js$/, |
| | | loader: 'babel-loader', |
| | | exclude: /node_modules/ |
| | | }, |
| | | { |
| | | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, |
| | | loader: 'url-loader', |
| | | options: { |
| | | limit: 10000, |
| | | name: 'img/[name].[hash:7].[ext]' |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | | resolve: { |
| | | alias: { |
| | | 'vue$': 'vue/dist/vue.esm.js' |
| | | }, |
| | | extensions: ['*', '.js', '.vue', '.json'] |
| | | }, |
| | | performance: { |
| | | hints: false |
| | | }, |
| | | devtool: '#eval-source-map' |
| | | } |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | module.exports.devtool = '#source-map' |
| | | // http://vue-loader.vuejs.org/en/workflow/production.html |
| | | module.exports.plugins = (module.exports.plugins || []).concat([ |
| | | new webpack.DefinePlugin({ |
| | | 'process.env': { |
| | | NODE_ENV: '"production"' |
| | | } |
| | | }), |
| | | new webpack.optimize.UglifyJsPlugin({ |
| | | sourceMap: true, |
| | | compress: { |
| | | warnings: false |
| | | } |
| | | }), |
| | | new webpack.LoaderOptionsPlugin({ |
| | | minimize: true |
| | | }) |
| | | ]) |
| | | } |
| | |
| | | <template /> |
| | | <template> |
| | | <div> |
| | | <el-tabs> |
| | | <el-row style="margin-bottom:20px"> |
| | | <!-- <el-col :span="2"> |
| | | <el-input v-model="form.Seach" @keyup.enter.native="SeachKey" placeholder="请è¾å
¥å
³é®è¯" size="small"></el-input> |
| | | </el-col>--> |
| | | <el-col :span="7" :offset="1"> |
| | | <span class="t_size" style="margin-left:7px">æç¨æ¥æ</span> |
| | | <el-date-picker |
| | | v-model="value1" |
| | | type="daterange" |
| | | range-separator="~" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | size="small" |
| | | :picker-options="pickerOptions1" |
| | | /> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <span class="t_size">æç¨æ¹å¼</span> |
| | | <el-select v-model="types" size="small" style="width:120px" @change="changeTypes"> |
| | | <el-option value="N" label="设å¤ä¼å
" /> |
| | | <el-option value="Y" label="æ¶é´ä¼å
" /> |
| | | </el-select> |
| | | </el-col> |
| | | |
| | | <el-col :span="3" :offset="1"> |
| | | <div style="height:32px;"> |
| | | <span class="t_size">æ¶é´å»åº¦</span> |
| | | <select id="scale" v-model.number="scale"> |
| | | <option v-for="i in scaleList" :key="i">{{ i }}</option> |
| | | </select> |
| | | <span class="t_size">åé</span> |
| | | </div> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <div style="height:32px;"> |
| | | <span class="t_size">æ¢åæ¶é´</span> |
| | | <el-input |
| | | id="scale" |
| | | v-model="times" |
| | | type="number" |
| | | size="mini" |
| | | style="display:inline-block;width:80px;" |
| | | @change="no_zero" |
| | | /> |
| | | <span class="t_size">åé</span> |
| | | </div> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <div style="height:32px;line-height: 28px;"> |
| | | <span class="t_size">颿è¿åº¦</span> |
| | | <span> |
| | | <span style="text-decoration:underline;">{{ real_num }}</span> / |
| | | <span style="text-decoration:underline">{{ meter }}</span> |
| | | </span> |
| | | </div> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-document-remove" |
| | | style="margin-left:20px;" |
| | | >颿 |
| | | <!-- @click="click_schedule"--> |
| | | |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-document-checked" |
| | | >æäº¤ |
| | | <!-- @click="click_yes"--> |
| | | |
| | | </el-button> |
| | | <p /> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row /> |
| | | </el-tabs> |
| | | <div class="container"> |
| | | <v-gantt-chart |
| | | :start-time="time_data[0]" |
| | | :end-time="time_data[1]" |
| | | :cell-width="cellWidth" |
| | | :cell-height="cellHeight" |
| | | :time-lines="timeLines" |
| | | :title-height="titleHeight" |
| | | :scale="scale" |
| | | :title-width="titleWidth" |
| | | show-current-time |
| | | :hide-header="hideHeader" |
| | | :data-key="dataKey" |
| | | :array-keys="arrayKeys" |
| | | :scroll-to-postion="positionA" |
| | | :datas="bm_data" |
| | | > |
| | | <!-- @scrollLeft="scrollLeftA"--> |
| | | |
| | | <template slot="block" slot-scope="{data,item}"> |
| | | <Test |
| | | :data="data" |
| | | :update-time-lines="updateTimeLines" |
| | | :cell-height="cellHeight" |
| | | :current-time="currentTime" |
| | | :item="item" |
| | | /> |
| | | </template> |
| | | <template slot="left" slot-scope="{data}"> |
| | | <div class="name"> |
| | | <div class="carId"> |
| | | <el-checkbox |
| | | v-model="data.status" |
| | | style="margin-right:5px;" |
| | | /> |
| | | <!-- @change="click_box(data)"--> |
| | | |
| | | {{ data.id }} {{ data.name }} |
| | | </div> |
| | | <div class="speed"> |
| | | <el-tooltip class="item" effect="dark" content="æ¥ç" placement="top"> |
| | | <el-button type="text" size="mini"> |
| | | <!-- @click="look(data)"--> |
| | | <i class="el-icon-document size i-color" /> |
| | | </el-button> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template slot="title"> |
| | | <span class="tc">å·¥ä½å表</span> |
| | | |
| | | <el-checkbox v-model="all_status" class="box_style" @change="changeLift()" /> |
| | | <input v-model.number="cellWidth" type="range" min="20" max="100" class="box_styles"> |
| | | </template> |
| | | </v-gantt-chart> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | import { mockDatas } from '@/views/sbgl/index1' |
| | | |
| | | export default { |
| | | name: 'Byjl' |
| | | name: 'Byjl', |
| | | data() { |
| | | return { |
| | | show: true, |
| | | pickerOptions1: { |
| | | disabledDate(time) { |
| | | return time.getTime() <= Date.now() - 24 * 60 * 60 * 1000 |
| | | } |
| | | }, |
| | | real_num: 0, |
| | | keep_data: [], |
| | | all_status: true, |
| | | look_data: [], |
| | | look_total: 0, |
| | | cl_name: '', |
| | | cl_code: '', |
| | | work_order: '', |
| | | false_arr: [], |
| | | ckeckVal: true, |
| | | AdvaScheUom: '', |
| | | list: [], |
| | | form: { |
| | | WorkShop: '', |
| | | PartNumber: '', |
| | | PartName: '', |
| | | rows: 10, |
| | | page: 1 |
| | | }, |
| | | showDialog: false, |
| | | time_data: [], |
| | | forms: { |
| | | WorkCode: '', |
| | | WorkShop: '', |
| | | PartNumber: '', |
| | | BotProceCode: '', |
| | | StartTime: '', |
| | | EndTime: '' |
| | | }, |
| | | click_one: 0, |
| | | datasC: [], |
| | | radio: '', |
| | | value1: '', |
| | | types: 'N', |
| | | no: false, |
| | | total: 0, |
| | | mn_data: [], |
| | | bm_data: [], |
| | | facility_data: [], |
| | | end_start: '', |
| | | timeLines: [ |
| | | { |
| | | time: dayjs() |
| | | .add(2, 'hour') |
| | | .toString() |
| | | }, |
| | | { |
| | | time: dayjs() |
| | | .add(5, 'hour') |
| | | .toString(), |
| | | color: '#747e80' |
| | | } |
| | | ], |
| | | formUpdata: { |
| | | WorkCode: '', |
| | | BotProceCode: '', |
| | | json: [] |
| | | }, |
| | | currentTime: dayjs(), |
| | | startTime: dayjs() |
| | | .subtract(5, 'hour') |
| | | .toString(), |
| | | endTime: dayjs() |
| | | .add(2, 'day') |
| | | .add(2, 'hour') |
| | | .toString(), |
| | | cellWidth: 50, |
| | | cellHeight: 30, |
| | | titleHeight: 40, |
| | | titleWidth: 250, |
| | | scale: 60, |
| | | datasNum: 100, |
| | | // datasA: [], |
| | | // datasB: mockDatas(100), |
| | | dataKey: 'id', |
| | | times: 0, |
| | | timeList: timeList, |
| | | scaleList: scaleList, |
| | | scrollToTime: dayjs() |
| | | .add(1, 'day') |
| | | .toString(), |
| | | scrollToPostion: { x: 10000, y: 10000 }, |
| | | hideHeader: false, |
| | | arrayKeys: ['gtArray', 'error'], |
| | | scrollToY: 0, |
| | | positionB: {}, |
| | | positionA: {}, |
| | | meter: 0, // èæ |
| | | title_list: [], |
| | | imp_id: '', |
| | | submit_flag: false, |
| | | search_from: { |
| | | page: 1, |
| | | rows: 10, |
| | | WorkTime: '', |
| | | BotProceName: '' |
| | | }, |
| | | testValue: { |
| | | 'rus': { |
| | | 'statusCode': '', |
| | | 'message': '', |
| | | 'MOD_S': '', |
| | | 'MAR_S': '', |
| | | 'EQP_S': '', |
| | | 'CUT_S': '', |
| | | 'FIXT_S': '', |
| | | 'HouseNumber': '', |
| | | 'navTabId': '', |
| | | 'dialogid': '', |
| | | 'rel': '', |
| | | 'dt': null, |
| | | 'list': {}, |
| | | 'callbackType': '', |
| | | 'forwardUrl': '' |
| | | }, |
| | | 'rows': [ |
| | | { |
| | | 'YearDate': '2022-09-01', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'YearDate': '2022-09-02', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'YearDate': '2022-09-03', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'YearDate': '2022-09-04', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'YearDate': '2022-09-05', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | 'YearDate': '2022-09-06', |
| | | 'children': [ |
| | | { |
| | | 'AdvaDevicNumber': 'LKFDL_SC-PC029', |
| | | 'AdvaDevicName': 'é鼿°æ§è½¦åº029', |
| | | 'AdvaDevicCropMob': '78', |
| | | 'AdvaDevicRhythm': '10', |
| | | 'OneStartDate': '08:00~11:30', |
| | | 'TwoStartDate': '12:30~17:00', |
| | | 'ThreeStartDate': '', |
| | | 'FourStartDate': '', |
| | | 'FiveStartDate': '' |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | 'Cont': null |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.OnclickAdvancedSchedulingDevice() |
| | | }, |
| | | methods: { |
| | | OnclickAdvancedSchedulingDevice() { |
| | | this.facility_top() |
| | | |
| | | // automaticScheduling |
| | | // .OnclickAdvancedSchedulingDevice(this.forms) |
| | | // .then(res => { |
| | | const res = this.testValue |
| | | // if (res.rus.message) { |
| | | // this.$message({ |
| | | // showClose: true, |
| | | // type: 'error', |
| | | // message: res.rus.message |
| | | // }) |
| | | // } |
| | | this.submit_flag = false |
| | | const list = [] |
| | | this.time_all = res |
| | | const cont = res.Cont |
| | | this.real_num = 0 |
| | | for (const i in this.time_all.rows[0].children) { |
| | | const obj = { |
| | | id: '', |
| | | name: '', |
| | | AdvaDevicRhythm: '', |
| | | status: true, |
| | | colorPair: { |
| | | dark: 'rgb(83, 186, 241,0.8)', |
| | | light: 'rgb(83, 186, 241,0.1)', |
| | | light_capacity: 'rgb(209,239,237,0.8)', |
| | | h_schedule: ' rgb(100,255,192,0.8)', |
| | | scheduleing: 'rgb(20,182,231,0.8)' |
| | | }, |
| | | gtArray: [] |
| | | } |
| | | obj.id = this.time_all.rows[0].children[i].AdvaDevicNumber |
| | | obj.name = this.time_all.rows[0].children[i].AdvaDevicName |
| | | obj.AdvaDevicRhythm = this.time_all.rows[0].children[ |
| | | i |
| | | ].AdvaDevicRhythm |
| | | list.push(obj) |
| | | } |
| | | console.log(list, 1) |
| | | for (const i in this.time_all.rows) { |
| | | for (const j in this.time_all.rows[i].children) { |
| | | if (this.time_all.rows[i].children[j].OneStartDate != '') { |
| | | this.time_all.rows[i].children[ |
| | | j |
| | | ].OneStartDate = this.time_all.rows[i].children[ |
| | | j |
| | | ].OneStartDate.split('~') |
| | | this.time_all.rows[i].children[j].OneStartDate[0] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].OneStartDate[0] |
| | | this.time_all.rows[i].children[j].OneStartDate[1] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].OneStartDate[1] |
| | | } |
| | | if (this.time_all.rows[i].children[j].TwoStartDate != '') { |
| | | this.time_all.rows[i].children[ |
| | | j |
| | | ].TwoStartDate = this.time_all.rows[i].children[ |
| | | j |
| | | ].TwoStartDate.split('~') |
| | | this.time_all.rows[i].children[j].TwoStartDate[0] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].TwoStartDate[0] |
| | | this.time_all.rows[i].children[j].TwoStartDate[1] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].TwoStartDate[1] |
| | | } |
| | | if (this.time_all.rows[i].children[j].ThreeStartDate != '') { |
| | | this.time_all.rows[i].children[ |
| | | j |
| | | ].ThreeStartDate = this.time_all.rows[i].children[ |
| | | j |
| | | ].ThreeStartDate.split('~') |
| | | this.time_all.rows[i].children[j].ThreeStartDate[0] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].ThreeStartDate[0] |
| | | this.time_all.rows[i].children[j].ThreeStartDate[1] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].ThreeStartDate[1] |
| | | } |
| | | if (this.time_all.rows[i].children[j].FourStartDate != '') { |
| | | this.time_all.rows[i].children[ |
| | | j |
| | | ].FourStartDate = this.time_all.rows[i].children[ |
| | | j |
| | | ].FourStartDate.split('~') |
| | | this.time_all.rows[i].children[j].FourStartDate[0] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].FourStartDate[0] |
| | | this.time_all.rows[i].children[j].FourStartDate[1] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].FourStartDate[1] |
| | | } |
| | | if (this.time_all.rows[i].children[j].FiveStartDate != '') { |
| | | this.time_all.rows[i].children[ |
| | | j |
| | | ].FiveStartDate = this.time_all.rows[i].children[ |
| | | j |
| | | ].FiveStartDate.split('~') |
| | | this.time_all.rows[i].children[j].FiveStartDate[0] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].FiveStartDate[0] |
| | | this.time_all.rows[i].children[j].FiveStartDate[1] = |
| | | this.time_all.rows[i].YearDate + |
| | | ' ' + |
| | | this.time_all.rows[i].children[j].FiveStartDate[1] |
| | | } |
| | | } |
| | | } |
| | | // ç»åæ°çç»æ |
| | | const newList = [] |
| | | for (const i in this.time_all.rows) { |
| | | for (const j in this.time_all.rows[i].children) { |
| | | if (this.time_all.rows[i].children[j].OneStartDate != '') { |
| | | const data1 = { |
| | | id: '', |
| | | start: '', |
| | | end: '', |
| | | mod: '' |
| | | } |
| | | data1.id = this.time_all.rows[i].children[j].AdvaDevicNumber |
| | | data1.start = this.time_all.rows[i].children[j].OneStartDate[0] |
| | | data1.end = this.time_all.rows[i].children[j].OneStartDate[1] |
| | | data1.mod = |
| | | (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) / |
| | | 100 |
| | | newList.push(data1) |
| | | } |
| | | if (this.time_all.rows[i].children[j].TwoStartDate != '') { |
| | | const data2 = { |
| | | id: '', |
| | | start: '', |
| | | end: '', |
| | | mod: '' |
| | | } |
| | | data2.id = this.time_all.rows[i].children[j].AdvaDevicNumber |
| | | data2.start = this.time_all.rows[i].children[j].TwoStartDate[0] |
| | | data2.end = this.time_all.rows[i].children[j].TwoStartDate[1] |
| | | data2.mod = |
| | | (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) / |
| | | 100 |
| | | newList.push(data2) |
| | | } |
| | | if (this.time_all.rows[i].children[j].ThreeStartDate != '') { |
| | | const data3 = { |
| | | id: '', |
| | | start: '', |
| | | end: '', |
| | | mod: '' |
| | | } |
| | | data3.id = this.time_all.rows[i].children[j].AdvaDevicNumber |
| | | data3.start = this.time_all.rows[i].children[ |
| | | j |
| | | ].ThreeStartDate[0] |
| | | data3.end = this.time_all.rows[i].children[j].ThreeStartDate[1] |
| | | data3.mod = |
| | | (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) / |
| | | 100 |
| | | newList.push(data3) |
| | | } |
| | | if (this.time_all.rows[i].children[j].FourStartDate != '') { |
| | | const data4 = { |
| | | id: '', |
| | | start: '', |
| | | end: '', |
| | | mod: '' |
| | | } |
| | | data4.id = this.time_all.rows[i].children[j].AdvaDevicNumber |
| | | data4.start = this.time_all.rows[i].children[ |
| | | j |
| | | ].FourStartDate[0] |
| | | data4.end = this.time_all.rows[i].children[j].FourStartDate[1] |
| | | data4.mod = |
| | | (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) / |
| | | 100 |
| | | newList.push(data4) |
| | | } |
| | | if (this.time_all.rows[i].children[j].FiveStartDate != '') { |
| | | const data5 = { |
| | | id: '', |
| | | start: '', |
| | | end: '', |
| | | mod: '' |
| | | } |
| | | data5.id = this.time_all.rows[i].children[j].AdvaDevicNumber |
| | | data5.start = this.time_all.rows[i].children[ |
| | | j |
| | | ].FiveStartDate[0] |
| | | data5.end = this.time_all.rows[i].children[j].FiveStartDate[1] |
| | | data5.mod = |
| | | (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) / |
| | | 100 |
| | | newList.push(data5) |
| | | } |
| | | } |
| | | } |
| | | for (const i in list) { |
| | | this.pushTiem(newList, list[i].id, list[i].gtArray) |
| | | } |
| | | this.bm_data = list |
| | | const _this = this |
| | | if (cont != '') { |
| | | for (const i in cont) { |
| | | for (const j in this.bm_data) { |
| | | if (this.bm_data[j].id == cont[i].EQP_CODE) { |
| | | const data = { |
| | | id: cont[i].EQP_CODE, |
| | | number: cont[i].ALLOC_QTY, |
| | | cl_name: cont[i].PART_NAME, |
| | | cl_code: this.cl_code, |
| | | work_order: cont[i].WO_CODE, |
| | | STATUS: _this.AdvaScheUom, |
| | | start: cont[i].TIME_START, |
| | | end: cont[i].TIME_END, |
| | | type: cont[i].STATUS == 'S' ? 'h_schedule' : 'bm_schedule' |
| | | } |
| | | |
| | | this.bm_data[j].flag = 'isCont' |
| | | |
| | | this.bm_data[j].gtArray.unshift(data) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.false_arr != '') { |
| | | for (const j in this.bm_data) { |
| | | if (this.false_arr.indexOf(this.bm_data[j].id) >= 0) { |
| | | this.bm_data[j].gtArray = [] |
| | | this.bm_data[j].status = false |
| | | } |
| | | } |
| | | } |
| | | // }) |
| | | }, |
| | | // 设å¤ä¼å
|
| | | facility_top() { |
| | | // automaticScheduling |
| | | // .OnclickAdvancedSchedulingDevice(this.forms) |
| | | // .then(res => { |
| | | const res = this.testValue |
| | | this.show = true |
| | | const data = res.rows |
| | | const cont = res.Cont |
| | | this.title_list = [] |
| | | for (const i in data[0].children) { |
| | | const obj = { |
| | | id: '', |
| | | name: '', |
| | | status: true, |
| | | AdvaDevicRhythm: '', |
| | | // mod:'', |
| | | colorPair: { |
| | | dark: 'rgb(83, 186, 241,0.8)', |
| | | light: 'rgb(83, 186, 241,0.1)', |
| | | light_capacity: 'rgb(209,239,237,0.8)', |
| | | h_schedule: ' rgb(100,255,192,0.8)', |
| | | scheduleing: 'rgb(20,182,231,0.8)' |
| | | }, |
| | | gtArray: [] |
| | | } |
| | | obj.id = data[0].children[i].AdvaDevicNumber |
| | | obj.name = data[0].children[i].AdvaDevicName |
| | | obj.AdvaDevicRhythm = data[0].children[i].AdvaDevicRhythm |
| | | // obj.mod =data[0].children[i].AdvaDevicCropMob *1 |
| | | |
| | | this.title_list.push(obj) |
| | | } |
| | | for (const i in data) { |
| | | for (const j in data[i].children) { |
| | | if (data[i].children[j].OneStartDate != '') { |
| | | data[i].children[j].OneStartDate = data[i].children[ |
| | | j |
| | | ].OneStartDate.split('~') |
| | | data[i].children[j].OneStartDate[0] = |
| | | data[i].YearDate + ' ' + data[i].children[j].OneStartDate[0] |
| | | data[i].children[j].OneStartDate[1] = |
| | | data[i].YearDate + ' ' + data[i].children[j].OneStartDate[1] |
| | | } |
| | | if (data[i].children[j].TwoStartDate != '') { |
| | | data[i].children[j].TwoStartDate = data[i].children[ |
| | | j |
| | | ].TwoStartDate.split('~') |
| | | data[i].children[j].TwoStartDate[0] = |
| | | data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[0] |
| | | data[i].children[j].TwoStartDate[1] = |
| | | data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[1] |
| | | } |
| | | if (data[i].children[j].ThreeStartDate != '') { |
| | | data[i].children[j].ThreeStartDate = data[i].children[ |
| | | j |
| | | ].ThreeStartDate.split('~') |
| | | data[i].children[j].ThreeStartDate[0] = |
| | | data[i].YearDate + |
| | | ' ' + |
| | | data[i].children[j].ThreeStartDate[0] |
| | | data[i].children[j].ThreeStartDate[1] = |
| | | data[i].YearDate + |
| | | ' ' + |
| | | data[i].children[j].ThreeStartDate[1] |
| | | } |
| | | if (data[i].children[j].FourStartDate != '') { |
| | | data[i].children[j].FourStartDate = data[i].children[ |
| | | j |
| | | ].FourStartDate.split('~') |
| | | data[i].children[j].FourStartDate[0] = |
| | | data[i].YearDate + ' ' + data[i].children[j].FourStartDate[0] |
| | | data[i].children[j].FourStartDate[1] = |
| | | data[i].YearDate + ' ' + data[i].children[j].FourStartDate[1] |
| | | } |
| | | if (data[i].children[j].FiveStartDate != '') { |
| | | data[i].children[j].FiveStartDate = data[i].children[ |
| | | j |
| | | ].FiveStartDate.split('~') |
| | | data[i].children[j].FiveStartDate[0] = |
| | | data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[0] |
| | | data[i].children[j].FiveStartDate[1] = |
| | | data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[1] |
| | | } |
| | | } |
| | | } |
| | | // æ´æ¹æ ¼å¼ |
| | | this.facility_data = [] |
| | | |
| | | for (const i in data) { |
| | | const time = { |
| | | date: data[i].YearDate, |
| | | AdvaDevicRhythm: '', |
| | | gtArray: [] |
| | | } |
| | | if (data[i].children != '') { |
| | | time.AdvaDevicRhythm = data[i].children[0].AdvaDevicRhythm |
| | | } |
| | | for (const j in data[i].children) { |
| | | if (data[i].children[j].OneStartDate != '') { |
| | | const icu1 = { |
| | | name: data[i].children[j].AdvaDevicName, |
| | | id: data[i].children[j].AdvaDevicNumber, |
| | | type: 'capacity', |
| | | rhythm: data[i].children[j].AdvaDevicRhythm, |
| | | start: data[i].children[j].OneStartDate[0], |
| | | end: data[i].children[j].OneStartDate[1], |
| | | mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100 |
| | | } |
| | | time.gtArray.push(icu1) |
| | | } |
| | | if (data[i].children[j].TwoStartDate != '') { |
| | | const icu2 = { |
| | | name: data[i].children[j].AdvaDevicName, |
| | | id: data[i].children[j].AdvaDevicNumber, |
| | | type: 'capacity', |
| | | rhythm: data[i].children[j].AdvaDevicRhythm, |
| | | start: data[i].children[j].TwoStartDate[0], |
| | | end: data[i].children[j].TwoStartDate[1], |
| | | mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100 |
| | | } |
| | | time.gtArray.push(icu2) |
| | | } |
| | | if (data[i].children[j].ThreeStartDate != '') { |
| | | const icu3 = { |
| | | name: data[i].children[j].AdvaDevicName, |
| | | id: data[i].children[j].AdvaDevicNumber, |
| | | type: 'capacity', |
| | | rhythm: data[i].children[j].AdvaDevicRhythm, |
| | | start: data[i].children[j].ThreeStartDate[0], |
| | | end: data[i].children[j].ThreeStartDate[1], |
| | | mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100 |
| | | } |
| | | time.gtArray.push(icu3) |
| | | } |
| | | if (data[i].children[j].FourStartDate != '') { |
| | | const icu4 = { |
| | | name: data[i].children[j].AdvaDevicName, |
| | | id: data[i].children[j].AdvaDevicNumber, |
| | | type: 'capacity', |
| | | rhythm: data[i].children[j].AdvaDevicRhythm, |
| | | start: data[i].children[j].FourStartDate[0], |
| | | end: data[i].children[j].FourStartDate[1], |
| | | mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100 |
| | | } |
| | | time.gtArray.push(icu4) |
| | | } |
| | | if (data[i].children[j].FiveStartDate != '') { |
| | | const icu5 = { |
| | | name: data[i].children[j].AdvaDevicName, |
| | | id: data[i].children[j].AdvaDevicNumber, |
| | | type: 'capacity', |
| | | rhythm: data[i].children[j].AdvaDevicRhythm, |
| | | start: data[i].children[j].FiveStartDate[0], |
| | | end: data[i].children[j].FiveStartDate[1], |
| | | mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100 |
| | | } |
| | | time.gtArray.push(icu5) |
| | | } |
| | | } |
| | | |
| | | this.facility_data.push(time) |
| | | } |
| | | |
| | | if (cont != '') { |
| | | for (const i in cont) { |
| | | const date_time = cont[i].TIME_START.split(' ') |
| | | const cont_date = date_time[0] |
| | | for (const j in this.facility_data) { |
| | | const data = { |
| | | id: cont[i].EQP_CODE, |
| | | date: cont_date, |
| | | number: cont[i].ALLOC_QTY, |
| | | cl_name: cont[i].PART_NAME, |
| | | cl_code: this.cl_code, |
| | | work_order: cont[i].WO_CODE, |
| | | start: cont[i].TIME_START, |
| | | end: cont[i].TIME_END, |
| | | type: 'h_schedule' |
| | | } |
| | | if (this.facility_data[j].date == data.date) { |
| | | this.facility_data[j].gtArray.unshift(data) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // }) |
| | | }, |
| | | updateTimeLines() { |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template /> |
| | | <!--<template>--> |
| | | <!-- <div id="app">--> |
| | | <!-- <div class="app-container">--> |
| | | <!-- <el-tabs>--> |
| | | <!-- <el-form ref="form" :model="form" :rules="rulescx" label-width="100px" size="medium">--> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="6" :offset="1">--> |
| | | <!-- <el-form-item prop="WorkShop" label="ç产车é´">--> |
| | | <!-- <el-select v-model="form.WorkShop" style="width:257px" filterable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in list"--> |
| | | <!-- :key="item.CODE"--> |
| | | <!-- :label="item.NAME"--> |
| | | <!-- :value="item.CODE"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="6" :offset="1">--> |
| | | <!-- <el-form-item prop="PartNumber" label="产åç¼ç ">--> |
| | | <!-- <el-input v-model="form.PartNumber" placeholder="请è¾å
¥" style="width:257px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="5" :offset="1">--> |
| | | <!-- <el-form-item prop="PartName" label="产ååç§°">--> |
| | | <!-- <el-input v-model="form.PartName" placeholder="请è¾å
¥" style="width:257px" />--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'Djjl' |
| | | } |
| | | </script> |
| | | <!-- <el-col :span="3" :offset="1">--> |
| | | <!-- <el-button type="text" class="marginLeft rg color" @click="resetFormcx()">éç½®</el-button>--> |
| | | <!-- <el-button--> |
| | | <!-- class="filter-item marginLeft button_style rg"--> |
| | | <!-- size="medium"--> |
| | | <!-- icon="el-icon-search"--> |
| | | <!-- @click="Search()"--> |
| | | <!-- >æ¥è¯¢--> |
| | | <!-- </el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <!-- </el-form>--> |
| | | <!-- </el-tabs>--> |
| | | <!-- <el-table--> |
| | | <!-- class="table"--> |
| | | <!-- :data="mn_data"--> |
| | | <!-- :header-cell-style="{background:'#f5f5f5'}"--> |
| | | <!-- height="280"--> |
| | | <!-- @sort-change="sortChange"--> |
| | | <!-- >--> |
| | | <!-- <el-table-column width="34" fixed>--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radio"--> |
| | | <!-- :label="scope.$index"--> |
| | | <!-- class="textRadio"--> |
| | | <!-- @change.native="getCurrentRow(scope.row)"--> |
| | | <!-- > --> |
| | | <!-- </el-radio>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="åºå·"--> |
| | | <!-- prop="AdvaScheSeq"--> |
| | | <!-- width="80"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="ä¼å
级"--> |
| | | <!-- prop="AdvaSchePiroQue"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <div v-if="scope.row.AdvaSchePiroQue == 'æ£å¸¸'">--> |
| | | <!-- <span class="icon_true" />--> |
| | | <!-- {{ scope.row.AdvaSchePiroQue }}--> |
| | | <!-- </div>--> |
| | | <!-- <div v-if="scope.row.AdvaSchePiroQue == 'ç´§æ¥'">--> |
| | | <!-- <span class="icon_gz" />--> |
| | | <!-- {{ scope.row.AdvaSchePiroQue }}--> |
| | | <!-- </div>--> |
| | | <!-- <div v-if="scope.row.AdvaSchePiroQue == 'ç¹æ¥'">--> |
| | | <!-- <span class="icon_ty" />--> |
| | | <!-- {{ scope.row.AdvaSchePiroQue }}--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="ç产车é´"--> |
| | | <!-- prop="AdvaScheWorkShop"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="å·¥åç¼å·"--> |
| | | <!-- prop="AdvaScheWorkCode"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="产åç¼ç "--> |
| | | <!-- prop="AdvaSchePartNumber"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="产ååç§°"--> |
| | | <!-- prop="AdvaSchePartName"--> |
| | | <!-- width="150"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="产åè§æ ¼"--> |
| | | <!-- prop="AdvaSchePartSpec"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æ°é"--> |
| | | <!-- prop="AdvaScheQty"--> |
| | | <!-- width="80"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="è¦æ±äº¤ä»æ¶é´"--> |
| | | <!-- prop="AdvaScheEndDate"--> |
| | | <!-- width="200"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="scope">{{ scope.row.AdvaScheEndDate }}</template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <!– <el-table-column label="ç»ææ¥æ" prop="AdvaScheEndDate">--> |
| | | <!-- </el-table-column>–>--> |
| | | <!-- <el-table-column label="交ä»ç¶æ" prop="AdvaScheSpeed" sortable="custom" :sort-orders="['ascending', 'descending']">--> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <div v-if="scope.row.Flag == 'Y' && scope.row.AdvaScheStus != 'NEW'">--> |
| | | <!-- <span class="icon_true" /> æ£å¸¸--> |
| | | <!-- </div>--> |
| | | <!-- <div v-if="scope.row.Flag == 'N' && scope.row.AdvaScheStus != 'NEW'">--> |
| | | <!-- <span v-if="scope.row.Flag == 'N'" class="icon_ty" />å»¶æ--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æç¨å·¥åº"--> |
| | | <!-- prop="AdvaScheBotProcName"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- :sort-orders="['ascending', 'descending']"--> |
| | | <!-- width="160"--> |
| | | <!-- />--> |
| | | <!-- <el-table-column label="计åæç¨æ¶é´" width="200" sortable="custom" :sort-orders="['ascending', 'descending']">--> |
| | | <!-- <template--> |
| | | <!-- slot-scope="scope"--> |
| | | <!-- >{{ scope.row.AdvaSchePCStartDate }} ~ {{ scope.row.AdvaSchePCEndDate }}--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <!-- </el-table>--> |
| | | <!-- <!– <pagination-view–>--> |
| | | <!-- <!– :currentPage="form.page"–>--> |
| | | <!-- <!– :total="total"–>--> |
| | | <!-- <!– @size-change="sizeChange"–>--> |
| | | <!-- <!– @current-change="pageChange"–>--> |
| | | <!-- <!– ></pagination-view>–>--> |
| | | <!-- </div>--> |
| | | |
| | | <style scoped> |
| | | <!-- <el-dialog title="æ¥ç" :visible.sync="showDialog" width="60%">--> |
| | | <!-- <el-table class="table" :data="look_data" :header-cell-style="{background:'#f5f5f5'}">--> |
| | | <!-- <el-table-column label="åºå·" prop="AdvaTaskSeq" width="80" />--> |
| | | <!-- <el-table-column label="å·¥åç¼å·" prop="AdvaTaskWork" />--> |
| | | <!-- <el-table-column label="å·¥åç¶æ" prop="AdvaTaskStatus" />--> |
| | | <!-- <el-table-column label="产åç¼ç " prop="AdvaTaskPartNumber" />--> |
| | | <!-- <el-table-column label="å¼å§æ¶é´" prop="AdvaTaskStartDate" width="160" />--> |
| | | <!-- <el-table-column label="ç»ææ¶é´" prop="AdvaTaskEndDate" width="160" />--> |
| | | <!-- <el-table-column label="ç产æ°é" prop="AdvaTaskQty" />--> |
| | | <!-- <el-table-column label="ç产工åº" prop="AdvaTaskBotProcName" />--> |
| | | <!-- </el-table>--> |
| | | <!-- <div style="overflow: hidden">--> |
| | | <!-- <!– <pagination-view–>--> |
| | | <!-- <!– :currentPage="search_from.page"–>--> |
| | | <!-- <!– :total="look_total"–>--> |
| | | <!-- <!– @size-change="sizeChange_look"–>--> |
| | | <!-- <!– @current-change="pageChange_look"–>--> |
| | | <!-- <!– ></pagination-view>–>--> |
| | | <!-- </div>--> |
| | | <!-- </el-dialog>--> |
| | | |
| | | </style> |
| | | <!-- <el-tabs v-show="show">--> |
| | | <!-- <el-row style="margin-bottom:20px">--> |
| | | <!-- <!– <el-col :span="2">--> |
| | | <!-- <el-input v-model="form.Seach" @keyup.enter.native="SeachKey" placeholder="请è¾å
¥å
³é®è¯" size="small"></el-input>--> |
| | | <!-- </el-col>–>--> |
| | | <!-- <el-col :span="7" :offset="1">--> |
| | | <!-- <span class="t_size" style="margin-left:7px">æç¨æ¥æ</span>--> |
| | | <!-- <el-date-picker--> |
| | | <!-- v-model="value1"--> |
| | | <!-- type="daterange"--> |
| | | <!-- range-separator="~"--> |
| | | <!-- format="yyyy-MM-dd"--> |
| | | <!-- value-format="yyyy-MM-dd"--> |
| | | <!-- start-placeholder="å¼å§æ¥æ"--> |
| | | <!-- end-placeholder="ç»ææ¥æ"--> |
| | | <!-- size="small"--> |
| | | <!-- :picker-options="pickerOptions1"--> |
| | | <!-- @change="change_time"--> |
| | | <!-- />--> |
| | | <!-- </el-col>--> |
| | | |
| | | <!-- <el-col :span="3">--> |
| | | <!-- <span class="t_size">æç¨æ¹å¼</span>--> |
| | | <!-- <el-select v-model="types" size="small" style="width:120px" @change="changeTypes">--> |
| | | <!-- <el-option value="N" label="设å¤ä¼å
" />--> |
| | | <!-- <el-option value="Y" label="æ¶é´ä¼å
" />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <!-- <el-col :span="3" :offset="1">--> |
| | | <!-- <div style="height:32px;">--> |
| | | <!-- <span class="t_size">æ¶é´å»åº¦</span>--> |
| | | <!-- <select id="scale" v-model.number="scale">--> |
| | | <!-- <option v-for="i in scaleList" :key="i">{{ i }}</option>--> |
| | | <!-- </select>--> |
| | | <!-- <span class="t_size">åé</span>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <!-- <el-col :span="3">--> |
| | | <!-- <div style="height:32px;">--> |
| | | <!-- <span class="t_size">æ¢åæ¶é´</span>--> |
| | | <!-- <el-input--> |
| | | <!-- id="scale"--> |
| | | <!-- v-model="times"--> |
| | | <!-- type="number"--> |
| | | <!-- size="mini"--> |
| | | <!-- style="display:inline-block;width:80px;"--> |
| | | <!-- @change="no_zero"--> |
| | | <!-- />--> |
| | | <!-- <span class="t_size">åé</span>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <!-- <el-col :span="3">--> |
| | | <!-- <div style="height:32px;line-height: 28px;">--> |
| | | <!-- <span class="t_size">颿è¿åº¦</span>--> |
| | | <!-- <span>--> |
| | | <!-- <span style="text-decoration:underline;">{{ real_num }}</span> /--> |
| | | <!-- <span style="text-decoration:underline">{{ meter }}</span>--> |
| | | <!-- </span>--> |
| | | <!-- </div>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <!-- <el-col :span="3">--> |
| | | <!-- <el-button--> |
| | | <!-- type="primary"--> |
| | | <!-- size="mini"--> |
| | | <!-- icon="el-icon-document-remove"--> |
| | | <!-- style="margin-left:20px;"--> |
| | | <!-- @click="click_schedule"--> |
| | | <!-- >颿--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button--> |
| | | <!-- type="primary"--> |
| | | <!-- size="mini"--> |
| | | <!-- icon="el-icon-document-checked"--> |
| | | <!-- @click="click_yes"--> |
| | | <!-- >æäº¤--> |
| | | <!-- </el-button>--> |
| | | <!-- <p />--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <!-- <el-row />--> |
| | | <!-- </el-tabs>--> |
| | | <!-- <div v-show="show" class="container">--> |
| | | <!-- <v-gantt-chart--> |
| | | <!-- :start-time="time_data[0]"--> |
| | | <!-- :end-time="time_data[1]"--> |
| | | <!-- :cell-width="cellWidth"--> |
| | | <!-- :cell-height="cellHeight"--> |
| | | <!-- :time-lines="timeLines"--> |
| | | <!-- :title-height="titleHeight"--> |
| | | <!-- :scale="scale"--> |
| | | <!-- :title-width="titleWidth"--> |
| | | <!-- show-current-time--> |
| | | <!-- :hide-header="hideHeader"--> |
| | | <!-- :data-key="dataKey"--> |
| | | <!-- :array-keys="arrayKeys"--> |
| | | <!-- :scroll-to-postion="positionA"--> |
| | | <!-- :datas="bm_data"--> |
| | | <!-- @scrollLeft="scrollLeftA"--> |
| | | <!-- >--> |
| | | <!-- <!– <template v-slot:block="{data,item}"> –>--> |
| | | <!-- <template slot="block" slot-scope="{data,item}">--> |
| | | <!-- <Test--> |
| | | <!-- :data="data"--> |
| | | <!-- :update-time-lines="updateTimeLines"--> |
| | | <!-- :cell-height="cellHeight"--> |
| | | <!-- :current-time="currentTime"--> |
| | | <!-- :item="item"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- <template slot="left" slot-scope="{data}">--> |
| | | <!-- <div class="name">--> |
| | | <!-- <div class="carId">--> |
| | | <!-- <el-checkbox--> |
| | | <!-- v-model="data.status"--> |
| | | <!-- style="margin-right:5px;"--> |
| | | <!-- @change="click_box(data)"--> |
| | | <!-- />--> |
| | | <!-- {{ data.id }} {{ data.name }}--> |
| | | <!-- </div>--> |
| | | <!-- <div class="speed">--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="æ¥ç" placement="top">--> |
| | | <!-- <el-button type="text" size="mini" @click="look(data)">--> |
| | | <!-- <i class="el-icon-document size i-color" />--> |
| | | <!-- </el-button>--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- <template slot="title">--> |
| | | <!-- <span class="tc">å·¥ä½å表</span>--> |
| | | |
| | | <!-- <el-checkbox v-model="all_status" class="box_style" @change="changeLift()" />--> |
| | | <!-- <input v-model.number="cellWidth" type="range" min="20" max="100" class="box_styles">--> |
| | | <!-- </template>--> |
| | | <!-- </v-gantt-chart>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!--</template>--> |
| | | |
| | | <!--<script>--> |
| | | <!--import Test from '@/components/Test'--> |
| | | <!--// import PaginationView from '@/components/PaginationView'--> |
| | | <!--// import TestLeft from '@/components/TestLeft'--> |
| | | <!--import { mockDatas } from './index1.js'--> |
| | | <!--import dayjs from 'dayjs'--> |
| | | <!--import automaticScheduling from '@/api/automaticScheduling'--> |
| | | |
| | | <!--const scaleList = `30,60,240,360`.split(',').map(n => parseInt(n))--> |
| | | <!--const timeList = `0,30,60,120,240,480`.split(',').map(n => parseInt(n))--> |
| | | |
| | | <!--export default {--> |
| | | <!-- components: { Test },--> |
| | | <!-- data() {--> |
| | | <!-- return {--> |
| | | <!-- show: false,--> |
| | | <!-- pickerOptions1: {--> |
| | | <!-- disabledDate(time) {--> |
| | | <!-- return time.getTime() <= Date.now() - 24 * 60 * 60 * 1000--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- real_num: 0,--> |
| | | <!-- keep_data: [],--> |
| | | <!-- all_status: true,--> |
| | | <!-- look_data: [],--> |
| | | <!-- look_total: 0,--> |
| | | <!-- cl_name: '',--> |
| | | <!-- cl_code: '',--> |
| | | <!-- work_order: '',--> |
| | | <!-- false_arr: [],--> |
| | | <!-- ckeckVal: true,--> |
| | | <!-- AdvaScheUom: '',--> |
| | | <!-- list: [],--> |
| | | <!-- form: {--> |
| | | <!-- WorkShop: '',--> |
| | | <!-- PartNumber: '',--> |
| | | <!-- PartName: '',--> |
| | | <!-- rows: 10,--> |
| | | <!-- page: 1--> |
| | | <!-- },--> |
| | | <!-- showDialog: false,--> |
| | | <!-- time_data: [],--> |
| | | <!-- forms: {--> |
| | | <!-- WorkCode: '',--> |
| | | <!-- WorkShop: '',--> |
| | | <!-- PartNumber: '',--> |
| | | <!-- BotProceCode: '',--> |
| | | <!-- StartTime: '',--> |
| | | <!-- EndTime: ''--> |
| | | <!-- },--> |
| | | <!-- click_one: 0,--> |
| | | <!-- datasC: [],--> |
| | | <!-- radio: '',--> |
| | | <!-- value1: '',--> |
| | | <!-- types: 'N',--> |
| | | <!-- no: false,--> |
| | | <!-- total: 0,--> |
| | | <!-- mn_data: [],--> |
| | | <!-- bm_data: [],--> |
| | | <!-- facility_data: [],--> |
| | | <!-- end_start: '',--> |
| | | <!-- timeLines: [--> |
| | | <!-- {--> |
| | | <!-- time: dayjs()--> |
| | | <!-- .add(2, 'hour')--> |
| | | <!-- .toString()--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- time: dayjs()--> |
| | | <!-- .add(5, 'hour')--> |
| | | <!-- .toString(),--> |
| | | <!-- color: '#747e80'--> |
| | | <!-- }--> |
| | | <!-- ],--> |
| | | <!-- formUpdata: {--> |
| | | <!-- WorkCode: '',--> |
| | | <!-- BotProceCode: '',--> |
| | | <!-- json: []--> |
| | | <!-- },--> |
| | | <!-- currentTime: dayjs(),--> |
| | | <!-- startTime: dayjs()--> |
| | | <!-- .subtract(5, 'hour')--> |
| | | <!-- .toString(),--> |
| | | <!-- endTime: dayjs()--> |
| | | <!-- .add(2, 'day')--> |
| | | <!-- .add(2, 'hour')--> |
| | | <!-- .toString(),--> |
| | | <!-- cellWidth: 50,--> |
| | | <!-- cellHeight: 30,--> |
| | | <!-- titleHeight: 40,--> |
| | | <!-- titleWidth: 250,--> |
| | | <!-- scale: 60,--> |
| | | <!-- datasNum: 100,--> |
| | | <!-- datasA: [],--> |
| | | <!-- datasB: mockDatas(100),--> |
| | | <!-- dataKey: 'id',--> |
| | | <!-- times: 0,--> |
| | | <!-- timeList: timeList,--> |
| | | <!-- scaleList: scaleList,--> |
| | | <!-- scrollToTime: dayjs()--> |
| | | <!-- .add(1, 'day')--> |
| | | <!-- .toString(),--> |
| | | <!-- scrollToPostion: { x: 10000, y: 10000 },--> |
| | | <!-- hideHeader: false,--> |
| | | <!-- arrayKeys: ['gtArray', 'error'],--> |
| | | <!-- scrollToY: 0,--> |
| | | <!-- positionB: {},--> |
| | | <!-- positionA: {},--> |
| | | <!-- meter: 0, // èæ--> |
| | | <!-- title_list: [],--> |
| | | <!-- imp_id: '',--> |
| | | <!-- submit_flag: false,--> |
| | | <!-- search_from: {--> |
| | | <!-- page: 1,--> |
| | | <!-- rows: 10,--> |
| | | <!-- WorkTime: '',--> |
| | | <!-- BotProceName: ''--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | |
| | | <!-- watch: {--> |
| | | <!-- datasNum(newV) {--> |
| | | <!-- this.datasA = mockDatas(newV)--> |
| | | <!-- this.datasB = mockDatas(newV)--> |
| | | <!-- },--> |
| | | <!-- scrollToY(val) {--> |
| | | <!-- this.positionA = { x: val }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- created: function() {--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- this.AdvancedSchedulingWorkShop()--> |
| | | <!-- },--> |
| | | |
| | | <!-- methods: {--> |
| | | <!-- AdvancedSchedulingWorkShop() {--> |
| | | <!-- automaticScheduling.AdvancedSchedulingWorkShop().then(res => {--> |
| | | <!-- this.list = res--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- Search() {--> |
| | | <!-- this.form.page = 1--> |
| | | <!-- this.show = false--> |
| | | <!-- this.radio = ''--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- },--> |
| | | <!-- resetFormcx() {--> |
| | | <!-- this.$nextTick(() => {--> |
| | | <!-- this.$refs.form.resetFields()--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- no_zero() {--> |
| | | <!-- if (this.times < 0) {--> |
| | | <!-- this.times = 0--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- sortChange(column, prop, order) {--> |
| | | <!-- this.radio = '';--> |
| | | <!-- (this.form.prop = column.prop), (this.form.order = column.order)--> |
| | | <!-- this.show = false--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- },--> |
| | | <!-- SeachKey() {--> |
| | | <!-- this.form.page = 1--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- this.show = false--> |
| | | <!-- this.radio = ''--> |
| | | <!-- },--> |
| | | <!-- changeLift() {--> |
| | | <!-- if (this.all_status) {--> |
| | | <!-- this.false_arr = []--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- } else {--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- this.bm_data[i].status = false--> |
| | | <!-- this.bm_data[i].gtArray = []--> |
| | | <!-- }--> |
| | | <!-- for (const i in this.facility_data) {--> |
| | | <!-- this.facility_data[i].gtArray = []--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- changeTypes() {--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- },--> |
| | | <!-- change_time() {--> |
| | | <!-- this.time_data[0] = this.value1[0] + ' 00:00'--> |
| | | <!-- this.time_data[1] = this.value1[1] + ' 23:59'--> |
| | | <!-- this.forms.StartTime = this.value1[0]--> |
| | | <!-- this.forms.EndTime = this.value1[1]--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- },--> |
| | | <!-- click_box(val) {--> |
| | | <!-- if (!val.status) {--> |
| | | <!-- for (const i in this.facility_data) {--> |
| | | <!-- const new_arr = []--> |
| | | <!-- for (const j in this.facility_data[i].gtArray) {--> |
| | | <!-- if (this.facility_data[i].gtArray[j].id == val.id) {--> |
| | | <!-- } else {--> |
| | | <!-- new_arr.push(this.facility_data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.facility_data[i].gtArray = new_arr--> |
| | | <!-- }--> |
| | | <!-- } else {--> |
| | | <!-- this.false_arr = []--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- if (!this.bm_data[i].status) {--> |
| | | <!-- this.false_arr.push(this.bm_data[i].id)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- }--> |
| | | |
| | | <!-- if (!val.status) {--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- if (!this.bm_data[i].status) {--> |
| | | <!-- this.bm_data[i].gtArray = []--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- } else {--> |
| | | <!-- this.false_arr = []--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- if (!this.bm_data[i].status) {--> |
| | | <!-- this.false_arr.push(this.bm_data[i].id)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- }--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- const arr = []--> |
| | | <!-- for (const j in this.bm_data[i].gtArray) {--> |
| | | <!-- if (this.bm_data[i].gtArray[j].type != 'schedule') {--> |
| | | <!-- arr.push(this.bm_data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.bm_data[i].gtArray = arr--> |
| | | <!-- }--> |
| | | <!-- this.real_num = 0--> |
| | | <!-- },--> |
| | | <!-- look(data) {--> |
| | | <!-- this.showDialog = true--> |
| | | <!-- this.search_from.DeviceCode = data.id--> |
| | | <!-- this.AdvancedSchedulingEquipmenTask()--> |
| | | <!-- },--> |
| | | <!-- AdvancedSchedulingEquipmenTask() {--> |
| | | <!-- automaticScheduling--> |
| | | <!-- .AdvancedSchedulingEquipmenTask(this.search_from)--> |
| | | <!-- .then(res => {--> |
| | | <!-- this.look_data = res.rows--> |
| | | <!-- this.look_total = res.total--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- sizeChange_look(val) {--> |
| | | <!-- this.search_from.rows = val--> |
| | | <!-- this.AdvancedSchedulingEquipmenTask()--> |
| | | <!-- },--> |
| | | <!-- pageChange_look(val) {--> |
| | | <!-- this.search_from.page = val--> |
| | | <!-- this.AdvancedSchedulingEquipmenTask()--> |
| | | <!-- },--> |
| | | <!-- sizeChange(val) {--> |
| | | <!-- this.form.rows = val--> |
| | | <!-- this.show = false--> |
| | | <!-- this.radio = ''--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- },--> |
| | | <!-- pageChange(val) {--> |
| | | <!-- this.form.page = val--> |
| | | <!-- this.show = false--> |
| | | <!-- this.radio = ''--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- },--> |
| | | <!-- // æ¥è¯¢--> |
| | | <!-- AdvancedSchedulingSearch() {--> |
| | | <!-- automaticScheduling.AdvancedSchedulingSearch(this.form).then(res => {--> |
| | | <!-- this.mn_data = res.rows--> |
| | | <!-- this.total = res.total--> |
| | | <!-- this.oneClick()--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- // ç¹å»å¸¦åºæ°æ®--> |
| | | <!-- OnclickAdvancedSchedulingDevice() {--> |
| | | <!-- this.facility_top()--> |
| | | |
| | | <!-- automaticScheduling--> |
| | | <!-- .OnclickAdvancedSchedulingDevice(this.forms)--> |
| | | <!-- .then(res => {--> |
| | | <!-- if (res.rus.message) {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- type: 'error',--> |
| | | <!-- message: res.rus.message--> |
| | | <!-- })--> |
| | | <!-- }--> |
| | | <!-- this.submit_flag = false--> |
| | | <!-- const list = []--> |
| | | <!-- this.time_all = res--> |
| | | <!-- const cont = res.Cont--> |
| | | <!-- this.real_num = 0--> |
| | | <!-- for (const i in this.time_all.rows[0].children) {--> |
| | | <!-- const obj = {--> |
| | | <!-- id: '',--> |
| | | <!-- name: '',--> |
| | | <!-- AdvaDevicRhythm: '',--> |
| | | <!-- status: true,--> |
| | | <!-- colorPair: {--> |
| | | <!-- dark: 'rgb(83, 186, 241,0.8)',--> |
| | | <!-- light: 'rgb(83, 186, 241,0.1)',--> |
| | | <!-- light_capacity: 'rgb(209,239,237,0.8)',--> |
| | | <!-- h_schedule: ' rgb(100,255,192,0.8)',--> |
| | | <!-- scheduleing: 'rgb(20,182,231,0.8)'--> |
| | | <!-- },--> |
| | | <!-- gtArray: []--> |
| | | <!-- }--> |
| | | <!-- obj.id = this.time_all.rows[0].children[i].AdvaDevicNumber--> |
| | | <!-- obj.name = this.time_all.rows[0].children[i].AdvaDevicName--> |
| | | <!-- obj.AdvaDevicRhythm = this.time_all.rows[0].children[--> |
| | | <!-- i--> |
| | | <!-- ].AdvaDevicRhythm--> |
| | | <!-- list.push(obj)--> |
| | | <!-- }--> |
| | | |
| | | <!-- for (const i in this.time_all.rows) {--> |
| | | <!-- for (const j in this.time_all.rows[i].children) {--> |
| | | <!-- if (this.time_all.rows[i].children[j].OneStartDate != '') {--> |
| | | <!-- this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].OneStartDate = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].OneStartDate.split('~')--> |
| | | <!-- this.time_all.rows[i].children[j].OneStartDate[0] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].OneStartDate[0]--> |
| | | <!-- this.time_all.rows[i].children[j].OneStartDate[1] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].OneStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].TwoStartDate != '') {--> |
| | | <!-- this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].TwoStartDate = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].TwoStartDate.split('~')--> |
| | | <!-- this.time_all.rows[i].children[j].TwoStartDate[0] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].TwoStartDate[0]--> |
| | | <!-- this.time_all.rows[i].children[j].TwoStartDate[1] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].TwoStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].ThreeStartDate != '') {--> |
| | | <!-- this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].ThreeStartDate = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].ThreeStartDate.split('~')--> |
| | | <!-- this.time_all.rows[i].children[j].ThreeStartDate[0] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].ThreeStartDate[0]--> |
| | | <!-- this.time_all.rows[i].children[j].ThreeStartDate[1] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].ThreeStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].FourStartDate != '') {--> |
| | | <!-- this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FourStartDate = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FourStartDate.split('~')--> |
| | | <!-- this.time_all.rows[i].children[j].FourStartDate[0] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].FourStartDate[0]--> |
| | | <!-- this.time_all.rows[i].children[j].FourStartDate[1] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].FourStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].FiveStartDate != '') {--> |
| | | <!-- this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FiveStartDate = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FiveStartDate.split('~')--> |
| | | <!-- this.time_all.rows[i].children[j].FiveStartDate[0] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].FiveStartDate[0]--> |
| | | <!-- this.time_all.rows[i].children[j].FiveStartDate[1] =--> |
| | | <!-- this.time_all.rows[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- this.time_all.rows[i].children[j].FiveStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- // ç»åæ°çç»æ--> |
| | | <!-- const newList = []--> |
| | | <!-- for (const i in this.time_all.rows) {--> |
| | | <!-- for (const j in this.time_all.rows[i].children) {--> |
| | | <!-- if (this.time_all.rows[i].children[j].OneStartDate != '') {--> |
| | | <!-- const data1 = {--> |
| | | <!-- id: '',--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- mod: ''--> |
| | | <!-- }--> |
| | | <!-- data1.id = this.time_all.rows[i].children[j].AdvaDevicNumber--> |
| | | <!-- data1.start = this.time_all.rows[i].children[j].OneStartDate[0]--> |
| | | <!-- data1.end = this.time_all.rows[i].children[j].OneStartDate[1]--> |
| | | <!-- data1.mod =--> |
| | | <!-- (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /--> |
| | | <!-- 100--> |
| | | <!-- newList.push(data1)--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].TwoStartDate != '') {--> |
| | | <!-- const data2 = {--> |
| | | <!-- id: '',--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- mod: ''--> |
| | | <!-- }--> |
| | | <!-- data2.id = this.time_all.rows[i].children[j].AdvaDevicNumber--> |
| | | <!-- data2.start = this.time_all.rows[i].children[j].TwoStartDate[0]--> |
| | | <!-- data2.end = this.time_all.rows[i].children[j].TwoStartDate[1]--> |
| | | <!-- data2.mod =--> |
| | | <!-- (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /--> |
| | | <!-- 100--> |
| | | <!-- newList.push(data2)--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].ThreeStartDate != '') {--> |
| | | <!-- const data3 = {--> |
| | | <!-- id: '',--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- mod: ''--> |
| | | <!-- }--> |
| | | <!-- data3.id = this.time_all.rows[i].children[j].AdvaDevicNumber--> |
| | | <!-- data3.start = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].ThreeStartDate[0]--> |
| | | <!-- data3.end = this.time_all.rows[i].children[j].ThreeStartDate[1]--> |
| | | <!-- data3.mod =--> |
| | | <!-- (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /--> |
| | | <!-- 100--> |
| | | <!-- newList.push(data3)--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].FourStartDate != '') {--> |
| | | <!-- const data4 = {--> |
| | | <!-- id: '',--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- mod: ''--> |
| | | <!-- }--> |
| | | <!-- data4.id = this.time_all.rows[i].children[j].AdvaDevicNumber--> |
| | | <!-- data4.start = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FourStartDate[0]--> |
| | | <!-- data4.end = this.time_all.rows[i].children[j].FourStartDate[1]--> |
| | | <!-- data4.mod =--> |
| | | <!-- (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /--> |
| | | <!-- 100--> |
| | | <!-- newList.push(data4)--> |
| | | <!-- }--> |
| | | <!-- if (this.time_all.rows[i].children[j].FiveStartDate != '') {--> |
| | | <!-- const data5 = {--> |
| | | <!-- id: '',--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- mod: ''--> |
| | | <!-- }--> |
| | | <!-- data5.id = this.time_all.rows[i].children[j].AdvaDevicNumber--> |
| | | <!-- data5.start = this.time_all.rows[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FiveStartDate[0]--> |
| | | <!-- data5.end = this.time_all.rows[i].children[j].FiveStartDate[1]--> |
| | | <!-- data5.mod =--> |
| | | <!-- (this.time_all.rows[i].children[j].AdvaDevicCropMob * 1) /--> |
| | | <!-- 100--> |
| | | <!-- newList.push(data5)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- for (const i in list) {--> |
| | | <!-- this.pushTiem(newList, list[i].id, list[i].gtArray)--> |
| | | <!-- }--> |
| | | <!-- this.bm_data = list--> |
| | | <!-- const _this = this--> |
| | | <!-- if (cont != '') {--> |
| | | <!-- for (const i in cont) {--> |
| | | <!-- for (const j in this.bm_data) {--> |
| | | <!-- if (this.bm_data[j].id == cont[i].EQP_CODE) {--> |
| | | <!-- const data = {--> |
| | | <!-- id: cont[i].EQP_CODE,--> |
| | | <!-- number: cont[i].ALLOC_QTY,--> |
| | | <!-- cl_name: cont[i].PART_NAME,--> |
| | | <!-- cl_code: this.cl_code,--> |
| | | <!-- work_order: cont[i].WO_CODE,--> |
| | | <!-- STATUS: _this.AdvaScheUom,--> |
| | | <!-- start: cont[i].TIME_START,--> |
| | | <!-- end: cont[i].TIME_END,--> |
| | | <!-- type: cont[i].STATUS == 'S' ? 'h_schedule' : 'bm_schedule'--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.bm_data[j].flag = 'isCont'--> |
| | | |
| | | <!-- this.bm_data[j].gtArray.unshift(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- if (this.false_arr != '') {--> |
| | | <!-- for (const j in this.bm_data) {--> |
| | | <!-- if (this.false_arr.indexOf(this.bm_data[j].id) >= 0) {--> |
| | | <!-- this.bm_data[j].gtArray = []--> |
| | | <!-- this.bm_data[j].status = false--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- // æ¢åæ¶é´--> |
| | | <!-- MinutesTest(time) {--> |
| | | <!-- var sdate1 = new Date(time)--> |
| | | <!-- sdate1.setMinutes(sdate1.getMinutes() + this.times * 1)--> |
| | | <!-- var now =--> |
| | | <!-- sdate1.getFullYear() +--> |
| | | <!-- '-' +--> |
| | | <!-- this.add_one(sdate1.getMonth()) +--> |
| | | <!-- '-' +--> |
| | | <!-- sdate1.getDate() +--> |
| | | <!-- ' ' +--> |
| | | <!-- sdate1.getHours() +--> |
| | | <!-- ':' +--> |
| | | <!-- sdate1.getMinutes() +--> |
| | | <!-- ':' +--> |
| | | <!-- sdate1.getSeconds()--> |
| | | <!-- return now--> |
| | | <!-- },--> |
| | | <!-- // +1--> |
| | | <!-- add_one(date) {--> |
| | | <!-- return parseInt(date) + 1--> |
| | | <!-- },--> |
| | | <!-- // æå
¥äº§è½æ¶é´æ®µ--> |
| | | <!-- pushTiem(newList, id, arr) {--> |
| | | <!-- for (const i in newList) {--> |
| | | <!-- if (newList[i].id == id) {--> |
| | | <!-- const data = {--> |
| | | <!-- start: newList[i].start,--> |
| | | <!-- end: newList[i].end,--> |
| | | <!-- id: newList[i].id,--> |
| | | <!-- mod: newList[i].mod,--> |
| | | <!-- type: 'capacity'--> |
| | | <!-- }--> |
| | | <!-- arr.push(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- getNowFormatDate() {--> |
| | | <!-- var date = new Date()--> |
| | | <!-- var seperator1 = '-'--> |
| | | <!-- var year = date.getFullYear()--> |
| | | <!-- var month = date.getMonth() + 1--> |
| | | <!-- // var strDate = date.getDate()+1;--> |
| | | <!-- var strDate = date.getDate()--> |
| | | <!-- if (month >= 1 && month <= 9) {--> |
| | | <!-- month = '0' + month--> |
| | | <!-- }--> |
| | | <!-- if (strDate >= 0 && strDate <= 9) {--> |
| | | <!-- strDate = '0' + strDate--> |
| | | <!-- }--> |
| | | <!-- var currentdate = year + seperator1 + month + seperator1 + strDate--> |
| | | <!-- return currentdate--> |
| | | <!-- },--> |
| | | <!-- getCurrentRow(row) {--> |
| | | <!-- // this.show =true--> |
| | | <!-- this.meter = row.AdvaScheQty * 1 - row.AdvaScheYPQty * 1 // å¯ä»¥å个æ°--> |
| | | <!-- this.value1 = []--> |
| | | <!-- this.cl_name = row.AdvaSchePartName--> |
| | | <!-- this.cl_code = row.AdvaSchePartNumber--> |
| | | <!-- this.AdvaScheUom = row.AdvaScheUom--> |
| | | <!-- this.work_order = row.AdvaScheWorkCode--> |
| | | <!-- this.value1.push(this.getNowFormatDate())--> |
| | | <!-- this.value1.push(row.AdvaScheEndDate)--> |
| | | <!-- if (this.value1 != '') {--> |
| | | <!-- this.time_data[0] = this.value1[0] + ' 00:00'--> |
| | | <!-- this.time_data[1] = this.value1[1] + ' 23:59'--> |
| | | <!-- }--> |
| | | <!-- this.forms.WorkCode = row.AdvaScheWorkCode--> |
| | | <!-- this.forms.WorkShop = row.AdvaScheWorkShopid--> |
| | | <!-- this.forms.PartNumber = row.AdvaSchePartNumber--> |
| | | <!-- this.forms.BotProceCode = row.AdvaScheBotProcid--> |
| | | <!-- this.forms.StartTime = this.getNowFormatDate()--> |
| | | <!-- this.forms.EndTime = row.AdvaScheEndDate--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- this.formUpdata.WorkCode = row.AdvaScheWorkCode--> |
| | | <!-- this.formUpdata.BotProceCode = row.AdvaScheBotProcid--> |
| | | <!-- this.search_from.WorkTime =--> |
| | | <!-- this.getNowFormatDate() + '~' + row.AdvaScheEndDate--> |
| | | <!-- this.search_from.BotProceName = row.AdvaScheBotProcName--> |
| | | <!-- },--> |
| | | <!-- // æäº¤æç¨--> |
| | | <!-- click_yes() {--> |
| | | <!-- if (this.submit_flag) {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- type: 'error',--> |
| | | <!-- message: 'æ°éæªæå®,è¯·è®¾ç½®äº§è½æ¶é´'--> |
| | | <!-- })--> |
| | | <!-- } else {--> |
| | | <!-- const list = [] // æäº¤æ°ç»--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- const arr = []--> |
| | | <!-- for (const j in this.bm_data[i].gtArray) {--> |
| | | <!-- if (this.bm_data[i].gtArray[j].type == 'schedule') {--> |
| | | <!-- arr.push(this.bm_data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- if (arr != '') {--> |
| | | <!-- for (const i in arr) {--> |
| | | <!-- const data = {--> |
| | | <!-- AlreDevicNumber: '',--> |
| | | <!-- AlreStartDate: '',--> |
| | | <!-- AlreEndDate: '',--> |
| | | <!-- AlreQty: ''--> |
| | | <!-- }--> |
| | | <!-- data.AlreDevicNumber = arr[i].id--> |
| | | <!-- data.AlreStartDate = arr[i].start--> |
| | | <!-- data.AlreEndDate = arr[i].end--> |
| | | <!-- data.AlreQty = arr[i].number--> |
| | | <!-- list.push(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- // æç¨ç¸å设å¤è·åå¼å§æ¶é´ ç»ææ¶é´ æ°éçæ»å--> |
| | | <!-- // è¿æ»¤--> |
| | | <!-- let updata = []--> |
| | | <!-- for (const i in list) {--> |
| | | <!-- if (list[i].AlreStartDate != '') {--> |
| | | <!-- updata.push(list[i])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- updata = JSON.stringify(updata)--> |
| | | <!-- this.formUpdata.json = updata--> |
| | | <!-- if (list == '') {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- message: '请å
颿',--> |
| | | <!-- type: 'error'--> |
| | | <!-- })--> |
| | | <!-- return false--> |
| | | <!-- }--> |
| | | <!-- automaticScheduling--> |
| | | <!-- .SubmitAlreadyScheduling(this.formUpdata)--> |
| | | <!-- .then(res => {--> |
| | | <!-- if (res.statusCode == 300) {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- message: res.message,--> |
| | | <!-- type: 'error'--> |
| | | <!-- })--> |
| | | <!-- } else {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- message: res.message,--> |
| | | <!-- type: 'success'--> |
| | | <!-- })--> |
| | | <!-- }--> |
| | | <!-- this.meter = 0--> |
| | | <!-- this.real_num = 0--> |
| | | <!-- this.OnclickAdvancedSchedulingDevice()--> |
| | | <!-- this.AdvancedSchedulingSearch()--> |
| | | <!-- })--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | |
| | | <!-- // æ¶é´/设å¤ä¼å
æç¨--> |
| | | <!-- click_schedule() {--> |
| | | <!-- const timestamp = new Date().toLocaleDateString()--> |
| | | <!-- if (new Date(this.value1[0]) < new Date(timestamp)) {--> |
| | | <!-- this.$message({--> |
| | | <!-- showClose: true,--> |
| | | <!-- type: 'error',--> |
| | | <!-- message: 'æç¨æ¶é´ä¸å¯ä»¥å°äºå½åæ¶é´'--> |
| | | <!-- })--> |
| | | <!-- return false--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.nitialize()--> |
| | | <!-- // 设å¤ä¼å
--> |
| | | <!-- if (this.bm_data != '' && this.types == 'N') {--> |
| | | <!-- this.fun_time()--> |
| | | <!-- this.change_num(this.bm_data)--> |
| | | <!-- } else if (this.facility_data != '' && this.types == 'Y') {--> |
| | | <!-- this.time_nitalize()--> |
| | | <!-- this.fun_facility()--> |
| | | <!-- this.dataTransition()--> |
| | | <!-- this.change_num(this.bm_data)--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- // æå¨è¿æ»¤æææ¶é´å·²æç¨--> |
| | | <!-- time_nitalize() {--> |
| | | <!-- for (const i in this.facility_data) {--> |
| | | <!-- this.facility_data[i].gtArray = this.facility_data[i].gtArray.filter(item => item.type != 'schedule')--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | |
| | | <!-- // æå¨è¿æ»¤ææè®¾å¤å·²æç¨--> |
| | | <!-- nitialize() {--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- const newArr = []--> |
| | | <!-- for (const j in this.bm_data[i].gtArray) {--> |
| | | <!-- if (this.bm_data[i].gtArray[j].type != 'schedule') {--> |
| | | <!-- newArr.push(this.bm_data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.bm_data[i].gtArray = newArr--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | |
| | | <!-- // ç»æç¨æåä¸ä¸ªä¿®æ¹æ°é--> |
| | | <!-- change_num(arr) {--> |
| | | <!-- this.real_num = 0 // çå®å·²ææ°é--> |
| | | <!-- let num = 0 // åæ´å·²ææ°é--> |
| | | <!-- const arr_num = [] // å·²ææ°æ®--> |
| | | <!-- let mend_num = 0--> |
| | | <!-- const len = 0--> |
| | | <!-- for (const i in arr) {--> |
| | | <!-- for (const j in arr[i].gtArray) {--> |
| | | <!-- if (arr[i].gtArray[j].type == 'schedule') {--> |
| | | <!-- arr_num.unshift(arr[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- for (const n in arr_num) {--> |
| | | <!-- this.real_num += arr_num[n].real_number--> |
| | | <!-- num += arr_num[n].number * 1--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.real_num = Math.ceil(this.real_num)--> |
| | | <!-- const y10 = this.meter - this.real_num--> |
| | | <!-- if (y10 <= 10) {--> |
| | | <!-- this.real_num = this.meter--> |
| | | <!-- mend_num = this.meter - num--> |
| | | <!-- } else {--> |
| | | <!-- }--> |
| | | <!-- if (this.real_num * 1 == this.meter * 1) {--> |
| | | <!-- // mend_num = this.meter - num--> |
| | | <!-- } else {--> |
| | | <!-- this.submit_flag = true--> |
| | | <!-- }--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- for (const j in this.bm_data[i].gtArray) {--> |
| | | <!-- if (--> |
| | | <!-- this.bm_data[i].gtArray[j].type == 'schedule' &&--> |
| | | <!-- this.bm_data[i].gtArray[j].end_num--> |
| | | <!-- ) {--> |
| | | <!-- this.bm_data[i].gtArray[j].number =--> |
| | | <!-- this.bm_data[i].gtArray[j].number * 1 + mend_num--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- fun_time() {--> |
| | | <!-- let all_num = this.meter--> |
| | | <!-- const all_time = []--> |
| | | <!-- let flag1 = 0--> |
| | | <!-- const mod = this.bm_data[0].mod--> |
| | | <!-- // let nowTime = this.bm_data[0].AdvaDevicRhythm*all_num--> |
| | | <!-- for (const i in this.bm_data) {--> |
| | | <!-- let end_arr = [] // å·²æç¨çæ°ç»--> |
| | | <!-- let nend_arr = [] // å¾
æç¨çæ°ç»--> |
| | | <!-- const add_arr = [] // å·²æç¨çæ°ç»--> |
| | | <!-- let capacity_arr = [] // è¦æç¨çæ°ç»--> |
| | | <!-- this.bm_data[i].gtArray.sort((a, b) => new Date(a.end).getTime() - new Date(b.end).getTime())--> |
| | | <!-- // let capacity_end = ''--> |
| | | <!-- end_arr = this.bm_data[i].gtArray.filter(item => item.type == 'h_schedule')--> |
| | | <!-- nend_arr = this.bm_data[i].gtArray.filter(item => item.type == 'capacity')--> |
| | | <!-- if (end_arr && end_arr.length > 0) {--> |
| | | <!-- capacity_arr = nend_arr.map(item => {--> |
| | | <!-- // æé¤æå·²ç»æç¨çåå¨hsheduleï¼startï¼endé½ç¸ççæ
åµ--> |
| | | <!-- const schedule = end_arr.filter(schedule => {--> |
| | | <!-- return new Date(item.start).getTime() <= new Date(schedule.start).getTime() &&--> |
| | | <!-- new Date(item.end).getTime() > new Date(schedule.end).getTime()--> |
| | | <!-- })--> |
| | | <!-- if (schedule && schedule.length > 0) {--> |
| | | <!-- item.start = this.MinutesTest(schedule[0]['end'])--> |
| | | <!-- }--> |
| | | |
| | | <!-- const schedule1 = end_arr.filter(schedule => {--> |
| | | <!-- return new Date(item.start).getTime() == new Date(schedule.start).getTime() &&--> |
| | | <!-- new Date(item.end).getTime() == new Date(schedule.end).getTime()--> |
| | | <!-- })--> |
| | | <!-- if (schedule1 && schedule1.length > 0) {--> |
| | | <!-- item.capacity = false--> |
| | | <!-- }--> |
| | | |
| | | <!-- return item--> |
| | | <!-- }).filter(item => item.capacity != false)--> |
| | | <!-- } else {--> |
| | | <!-- capacity_arr = nend_arr--> |
| | | <!-- }--> |
| | | |
| | | <!-- const id_obj = {--> |
| | | <!-- id: '',--> |
| | | <!-- start_time: ''--> |
| | | <!-- }--> |
| | | <!-- if (end_arr != '') {--> |
| | | <!-- (id_obj.id = end_arr[0].id), (id_obj.start_time = end_arr[0].end)--> |
| | | <!-- }--> |
| | | <!-- for (const w in capacity_arr) {--> |
| | | <!-- let end_time = ''--> |
| | | <!-- let mistiming = ''--> |
| | | <!-- const data = {--> |
| | | <!-- id: capacity_arr[w].id,--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- type: 'schedule',--> |
| | | <!-- cl_name: this.cl_name,--> |
| | | <!-- cl_code: this.cl_code,--> |
| | | <!-- work_order: this.work_order,--> |
| | | <!-- number: 0,--> |
| | | <!-- real_number: 0--> |
| | | <!-- }--> |
| | | <!-- if (--> |
| | | <!-- id_obj.start_time != '' &&--> |
| | | <!-- flag1 == 0 &&--> |
| | | <!-- new Date(id_obj.start_time) >= new Date(capacity_arr[w].start)--> |
| | | <!-- ) {--> |
| | | <!-- data.start = this.MinutesTest(id_obj.start_time)--> |
| | | <!-- flag1 = 1--> |
| | | <!-- } else {--> |
| | | <!-- data.start = capacity_arr[w].start--> |
| | | <!-- }--> |
| | | <!-- let nowTime =--> |
| | | <!-- (this.bm_data[i].AdvaDevicRhythm * all_num) / capacity_arr[w].mod--> |
| | | <!-- end_time = this.formSeconds(nowTime, data.start, capacity_arr[w].mod) // æ»å
±çç»ææ¶é´--> |
| | | <!-- data.end = end_time--> |
| | | <!-- mistiming = this.formTime(--> |
| | | <!-- end_time,--> |
| | | <!-- capacity_arr[w].end,--> |
| | | <!-- capacity_arr[w].mod--> |
| | | <!-- ) // æ»å
±çç»ææ¶é´-å½åçç»ææ¶é´ = å©ä¸å¤ä¹
æ¶é´--> |
| | | <!-- if (mistiming >= 0) {--> |
| | | <!-- console.log(--> |
| | | <!-- new Date(data.end) - new Date(data.start),--> |
| | | <!-- capacity_arr[w].mod,--> |
| | | <!-- this.bm_data[i].AdvaDevicRhythm,--> |
| | | <!-- 'é¿æ¯é¡¿åæ¯èè¬'--> |
| | | <!-- )--> |
| | | <!-- data.number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- this.bm_data[i].AdvaDevicRhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.real_number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- this.bm_data[i].AdvaDevicRhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.number = data.number.toFixed(0)--> |
| | | <!-- data.end_num = true--> |
| | | <!-- if (new Date(data.start) >= new Date(data.end)) {--> |
| | | <!-- } else {--> |
| | | <!-- this.bm_data[i].gtArray.push(data)--> |
| | | <!-- }--> |
| | | |
| | | <!-- return false--> |
| | | <!-- } else {--> |
| | | <!-- data.end = capacity_arr[w].end--> |
| | | <!-- data.number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- this.bm_data[i].AdvaDevicRhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.real_number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- this.bm_data[i].AdvaDevicRhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.number = data.number.toFixed(0)--> |
| | | |
| | | <!-- nowTime =--> |
| | | <!-- (all_num - data.real_number) * this.bm_data[i].AdvaDevicRhythm--> |
| | | <!-- all_num = all_num - data.real_number--> |
| | | <!-- if (new Date(data.start) >= new Date(data.end)) {--> |
| | | <!-- } else {--> |
| | | <!-- this.bm_data[i].gtArray.push(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- // è®¾å¤æç¨æ¹æ³--> |
| | | <!-- fun_facility() {--> |
| | | <!-- // æé¤æªå¾é项--> |
| | | <!-- for (const i in this.facility_data) {--> |
| | | <!-- const newArr = []--> |
| | | <!-- for (const j in this.facility_data[i].gtArray) {--> |
| | | <!-- if (this.false_arr.indexOf(this.facility_data[i].gtArray[j].id) < 0) {--> |
| | | <!-- newArr.push(this.facility_data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- this.facility_data[i].gtArray = newArr--> |
| | | <!-- }--> |
| | | <!-- let all_num = this.meter--> |
| | | <!-- const all_time = []--> |
| | | <!-- const flag1 = 0--> |
| | | <!-- // let nowTime = this.facility_data[0].AdvaDevicRhythm*all_num //æ°éOK--> |
| | | |
| | | <!-- for (const i in this.facility_data) {--> |
| | | <!-- let end_arr = []--> |
| | | <!-- let nend_arr = [] // æç¨çæ°ç»--> |
| | | <!-- const add_arr = [] // å·²æç¨çæ°ç»--> |
| | | <!-- let capacity_arr = [] // è¦æç¨çæ°ç»--> |
| | | |
| | | <!-- // this.facility_data[i].gtArray.sort((a,b) => new Date(a.end).getTime() - new Date(b.end).getTime())--> |
| | | <!-- // let capacity_end = ''--> |
| | | <!-- end_arr = this.facility_data[i].gtArray.filter(item => item.type == 'h_schedule')--> |
| | | <!-- nend_arr = this.facility_data[i].gtArray.filter(item => item.type == 'capacity')--> |
| | | <!-- console.log(nend_arr)--> |
| | | <!-- capacity_arr = JSON.parse(JSON.stringify(nend_arr))--> |
| | | <!-- end_arr.forEach(item => {--> |
| | | <!-- for (let i = 0; i < capacity_arr.length; i++) {--> |
| | | <!-- if (new Date(capacity_arr[i].start).getTime() === new Date(item.start).getTime()) {--> |
| | | <!-- console.log(i, capacity_arr[i], 'ååå')--> |
| | | <!-- capacity_arr.splice(i, 1)--> |
| | | <!-- break--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- })--> |
| | | <!-- console.log(capacity_arr, '大西ç')--> |
| | | |
| | | <!-- if (!capacity_arr || capacity_arr.length == 0) break--> |
| | | <!-- // const firstCapacity = capacity_arr[0]--> |
| | | |
| | | <!-- const schedule_arr = end_arr.filter(item => {--> |
| | | <!-- const remain = nend_arr.some(sitem => {--> |
| | | <!-- return new Date(sitem.start).getTime() === new Date(item.start).getTime() &&--> |
| | | <!-- new Date(item.end).getTime() < new Date(sitem.end).getTime()--> |
| | | <!-- })--> |
| | | <!-- return remain--> |
| | | <!-- })--> |
| | | <!-- console.log(schedule_arr)--> |
| | | <!-- if (schedule_arr && schedule_arr.length > 0) {--> |
| | | <!-- const scheduleCan = schedule_arr.map(item => {--> |
| | | <!-- const capcity = nend_arr.filter(sitem => {--> |
| | | <!-- return new Date(sitem.start).getTime() === new Date(item.start).getTime() &&--> |
| | | <!-- new Date(item.end).getTime() < new Date(sitem.end).getTime()--> |
| | | <!-- })[0]--> |
| | | <!-- console.log('capacity', capcity)--> |
| | | <!-- capcity.start = this.MinutesTest(item.end)--> |
| | | <!-- return capcity--> |
| | | <!-- })--> |
| | | <!-- const newSchedule = JSON.parse(JSON.stringify(scheduleCan))--> |
| | | <!-- capacity_arr = newSchedule.concat(capacity_arr)--> |
| | | <!-- }--> |
| | | <!-- console.log(schedule_arr)--> |
| | | <!-- console.log('å¯æç¨æ°ç»', capacity_arr)--> |
| | | <!-- const id_obj = {}--> |
| | | <!-- if (end_arr != '') {--> |
| | | <!-- (id_obj.id = end_arr[0].id), (id_obj.start_time = end_arr[0].end)--> |
| | | <!-- }--> |
| | | |
| | | <!-- for (const w in capacity_arr) {--> |
| | | <!-- let end_time--> |
| | | <!-- let mistiming--> |
| | | <!-- const data = {--> |
| | | <!-- id: capacity_arr[w].id,--> |
| | | <!-- start: '',--> |
| | | <!-- end: '',--> |
| | | <!-- type: 'schedule',--> |
| | | <!-- cl_name: this.cl_name,--> |
| | | <!-- cl_code: this.cl_code,--> |
| | | <!-- work_order: this.work_order,--> |
| | | <!-- number: 0,--> |
| | | <!-- real_number: 0--> |
| | | <!-- }--> |
| | | <!-- // console.log(id_obj.start_time)--> |
| | | <!-- if (--> |
| | | <!-- id_obj &&--> |
| | | <!-- new Date(id_obj.start_time).getTime() >=--> |
| | | <!-- new Date(capacity_arr[w].start).getTime()--> |
| | | <!-- ) {--> |
| | | <!-- if (data.id == id_obj.id) {--> |
| | | <!-- data.start = this.MinutesTest(id_obj.start_time)--> |
| | | <!-- // flag1 =1--> |
| | | <!-- } else {--> |
| | | <!-- data.start = capacity_arr[w].start--> |
| | | <!-- // console.log(data.start)--> |
| | | <!-- // flag1 =1--> |
| | | <!-- }--> |
| | | <!-- } else {--> |
| | | <!-- data.start = capacity_arr[w].start--> |
| | | <!-- }--> |
| | | <!-- // let nowTime = this.facility_data[0].AdvaDevicRhythm*all_num--> |
| | | <!-- let nowTime =--> |
| | | <!-- (capacity_arr[w].rhythm * all_num) / capacity_arr[w].mod--> |
| | | |
| | | <!-- end_time = this.formSeconds(nowTime, data.start)--> |
| | | |
| | | <!-- data.end = end_time--> |
| | | <!-- mistiming = this.formTime(end_time, capacity_arr[w].end)--> |
| | | <!-- if (mistiming >= 0) {--> |
| | | <!-- data.number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- capacity_arr[w].rhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.real_number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- capacity_arr[w].rhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.number = data.number.toFixed(0)--> |
| | | <!-- data.end_num = true--> |
| | | |
| | | <!-- if (new Date(data.start) >= new Date(data.end)) {--> |
| | | <!-- } else {--> |
| | | <!-- this.facility_data[i].gtArray.push(data)--> |
| | | <!-- }--> |
| | | |
| | | <!-- return false--> |
| | | <!-- } else {--> |
| | | <!-- data.end = capacity_arr[w].end--> |
| | | <!-- data.number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- capacity_arr[w].rhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.real_number =--> |
| | | <!-- ((new Date(data.end) - new Date(data.start)) *--> |
| | | <!-- capacity_arr[w].mod) /--> |
| | | <!-- capacity_arr[w].rhythm /--> |
| | | <!-- 1000--> |
| | | <!-- data.number = data.number.toFixed(0)--> |
| | | <!-- nowTime = (all_num - data.real_number) * capacity_arr[w].rhythm--> |
| | | <!-- all_num = all_num - data.real_number--> |
| | | |
| | | <!-- // nowTime = mistiming * -1--> |
| | | <!-- if (new Date(data.start) >= new Date(data.end)) {--> |
| | | <!-- } else {--> |
| | | <!-- this.facility_data[i].gtArray.push(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- // ç»è®¾å¤è½¬æ¢æ ¼å¼--> |
| | | <!-- dataTransition() {--> |
| | | <!-- this.bm_data = []--> |
| | | <!-- const data = this.facility_data--> |
| | | |
| | | <!-- const all = []--> |
| | | <!-- const list = this.title_list--> |
| | | <!-- for (const i in data) {--> |
| | | <!-- for (const j in data[i].gtArray) {--> |
| | | <!-- all.push(data[i].gtArray[j])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- for (const i in list) {--> |
| | | <!-- list[i].gtArray = []--> |
| | | <!-- this.pushTiemsss(all, list[i].id, list[i].gtArray)--> |
| | | <!-- }--> |
| | | |
| | | <!-- for (const n in list) {--> |
| | | <!-- if (list[n].gtArray.length == 0) {--> |
| | | <!-- list[n].status = false--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- // console.log(list)--> |
| | | <!-- this.bm_data = list--> |
| | | <!-- },--> |
| | | <!-- // æå
¥äº§è½æ¶é´æ®µ--> |
| | | <!-- pushTiemsss(newList, id, arr) {--> |
| | | <!-- for (const i in newList) {--> |
| | | <!-- if (newList[i].id == id) {--> |
| | | <!-- arr.push(newList[i])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- },--> |
| | | <!-- // 设å¤ä¼å
--> |
| | | <!-- facility_top() {--> |
| | | <!-- automaticScheduling--> |
| | | <!-- .OnclickAdvancedSchedulingDevice(this.forms)--> |
| | | <!-- .then(res => {--> |
| | | <!-- this.show = true--> |
| | | <!-- const data = res.rows--> |
| | | <!-- const cont = res.Cont--> |
| | | <!-- this.title_list = []--> |
| | | <!-- for (const i in data[0].children) {--> |
| | | <!-- const obj = {--> |
| | | <!-- id: '',--> |
| | | <!-- name: '',--> |
| | | <!-- status: true,--> |
| | | <!-- AdvaDevicRhythm: '',--> |
| | | <!-- // mod:'',--> |
| | | <!-- colorPair: {--> |
| | | <!-- dark: 'rgb(83, 186, 241,0.8)',--> |
| | | <!-- light: 'rgb(83, 186, 241,0.1)',--> |
| | | <!-- light_capacity: 'rgb(209,239,237,0.8)',--> |
| | | <!-- h_schedule: ' rgb(100,255,192,0.8)',--> |
| | | <!-- scheduleing: 'rgb(20,182,231,0.8)'--> |
| | | <!-- },--> |
| | | <!-- gtArray: []--> |
| | | <!-- }--> |
| | | <!-- obj.id = data[0].children[i].AdvaDevicNumber--> |
| | | <!-- obj.name = data[0].children[i].AdvaDevicName--> |
| | | <!-- obj.AdvaDevicRhythm = data[0].children[i].AdvaDevicRhythm--> |
| | | <!-- // obj.mod =data[0].children[i].AdvaDevicCropMob *1--> |
| | | |
| | | <!-- this.title_list.push(obj)--> |
| | | <!-- }--> |
| | | <!-- for (const i in data) {--> |
| | | <!-- for (const j in data[i].children) {--> |
| | | <!-- if (data[i].children[j].OneStartDate != '') {--> |
| | | <!-- data[i].children[j].OneStartDate = data[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].OneStartDate.split('~')--> |
| | | <!-- data[i].children[j].OneStartDate[0] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].OneStartDate[0]--> |
| | | <!-- data[i].children[j].OneStartDate[1] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].OneStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].TwoStartDate != '') {--> |
| | | <!-- data[i].children[j].TwoStartDate = data[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].TwoStartDate.split('~')--> |
| | | <!-- data[i].children[j].TwoStartDate[0] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[0]--> |
| | | <!-- data[i].children[j].TwoStartDate[1] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].TwoStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].ThreeStartDate != '') {--> |
| | | <!-- data[i].children[j].ThreeStartDate = data[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].ThreeStartDate.split('~')--> |
| | | <!-- data[i].children[j].ThreeStartDate[0] =--> |
| | | <!-- data[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- data[i].children[j].ThreeStartDate[0]--> |
| | | <!-- data[i].children[j].ThreeStartDate[1] =--> |
| | | <!-- data[i].YearDate +--> |
| | | <!-- ' ' +--> |
| | | <!-- data[i].children[j].ThreeStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].FourStartDate != '') {--> |
| | | <!-- data[i].children[j].FourStartDate = data[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FourStartDate.split('~')--> |
| | | <!-- data[i].children[j].FourStartDate[0] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].FourStartDate[0]--> |
| | | <!-- data[i].children[j].FourStartDate[1] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].FourStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].FiveStartDate != '') {--> |
| | | <!-- data[i].children[j].FiveStartDate = data[i].children[--> |
| | | <!-- j--> |
| | | <!-- ].FiveStartDate.split('~')--> |
| | | <!-- data[i].children[j].FiveStartDate[0] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[0]--> |
| | | <!-- data[i].children[j].FiveStartDate[1] =--> |
| | | <!-- data[i].YearDate + ' ' + data[i].children[j].FiveStartDate[1]--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- // æ´æ¹æ ¼å¼--> |
| | | <!-- this.facility_data = []--> |
| | | |
| | | <!-- for (const i in data) {--> |
| | | <!-- const time = {--> |
| | | <!-- date: data[i].YearDate,--> |
| | | <!-- AdvaDevicRhythm: '',--> |
| | | <!-- gtArray: []--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children != '') {--> |
| | | <!-- time.AdvaDevicRhythm = data[i].children[0].AdvaDevicRhythm--> |
| | | <!-- }--> |
| | | <!-- for (const j in data[i].children) {--> |
| | | <!-- if (data[i].children[j].OneStartDate != '') {--> |
| | | <!-- const icu1 = {--> |
| | | <!-- name: data[i].children[j].AdvaDevicName,--> |
| | | <!-- id: data[i].children[j].AdvaDevicNumber,--> |
| | | <!-- type: 'capacity',--> |
| | | <!-- rhythm: data[i].children[j].AdvaDevicRhythm,--> |
| | | <!-- start: data[i].children[j].OneStartDate[0],--> |
| | | <!-- end: data[i].children[j].OneStartDate[1],--> |
| | | <!-- mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100--> |
| | | <!-- }--> |
| | | <!-- time.gtArray.push(icu1)--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].TwoStartDate != '') {--> |
| | | <!-- const icu2 = {--> |
| | | <!-- name: data[i].children[j].AdvaDevicName,--> |
| | | <!-- id: data[i].children[j].AdvaDevicNumber,--> |
| | | <!-- type: 'capacity',--> |
| | | <!-- rhythm: data[i].children[j].AdvaDevicRhythm,--> |
| | | <!-- start: data[i].children[j].TwoStartDate[0],--> |
| | | <!-- end: data[i].children[j].TwoStartDate[1],--> |
| | | <!-- mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100--> |
| | | <!-- }--> |
| | | <!-- time.gtArray.push(icu2)--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].ThreeStartDate != '') {--> |
| | | <!-- const icu3 = {--> |
| | | <!-- name: data[i].children[j].AdvaDevicName,--> |
| | | <!-- id: data[i].children[j].AdvaDevicNumber,--> |
| | | <!-- type: 'capacity',--> |
| | | <!-- rhythm: data[i].children[j].AdvaDevicRhythm,--> |
| | | <!-- start: data[i].children[j].ThreeStartDate[0],--> |
| | | <!-- end: data[i].children[j].ThreeStartDate[1],--> |
| | | <!-- mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100--> |
| | | <!-- }--> |
| | | <!-- time.gtArray.push(icu3)--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].FourStartDate != '') {--> |
| | | <!-- const icu4 = {--> |
| | | <!-- name: data[i].children[j].AdvaDevicName,--> |
| | | <!-- id: data[i].children[j].AdvaDevicNumber,--> |
| | | <!-- type: 'capacity',--> |
| | | <!-- rhythm: data[i].children[j].AdvaDevicRhythm,--> |
| | | <!-- start: data[i].children[j].FourStartDate[0],--> |
| | | <!-- end: data[i].children[j].FourStartDate[1],--> |
| | | <!-- mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100--> |
| | | <!-- }--> |
| | | <!-- time.gtArray.push(icu4)--> |
| | | <!-- }--> |
| | | <!-- if (data[i].children[j].FiveStartDate != '') {--> |
| | | <!-- const icu5 = {--> |
| | | <!-- name: data[i].children[j].AdvaDevicName,--> |
| | | <!-- id: data[i].children[j].AdvaDevicNumber,--> |
| | | <!-- type: 'capacity',--> |
| | | <!-- rhythm: data[i].children[j].AdvaDevicRhythm,--> |
| | | <!-- start: data[i].children[j].FiveStartDate[0],--> |
| | | <!-- end: data[i].children[j].FiveStartDate[1],--> |
| | | <!-- mod: (data[i].children[j].AdvaDevicCropMob * 1) / 100--> |
| | | <!-- }--> |
| | | <!-- time.gtArray.push(icu5)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | |
| | | <!-- this.facility_data.push(time)--> |
| | | <!-- }--> |
| | | |
| | | <!-- if (cont != '') {--> |
| | | <!-- for (const i in cont) {--> |
| | | <!-- const date_time = cont[i].TIME_START.split(' ')--> |
| | | <!-- const cont_date = date_time[0]--> |
| | | <!-- for (const j in this.facility_data) {--> |
| | | <!-- const data = {--> |
| | | <!-- id: cont[i].EQP_CODE,--> |
| | | <!-- date: cont_date,--> |
| | | <!-- number: cont[i].ALLOC_QTY,--> |
| | | <!-- cl_name: cont[i].PART_NAME,--> |
| | | <!-- cl_code: this.cl_code,--> |
| | | <!-- work_order: cont[i].WO_CODE,--> |
| | | <!-- start: cont[i].TIME_START,--> |
| | | <!-- end: cont[i].TIME_END,--> |
| | | <!-- type: 'h_schedule'--> |
| | | <!-- }--> |
| | | <!-- if (this.facility_data[j].date == data.date) {--> |
| | | <!-- this.facility_data[j].gtArray.unshift(data)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- })--> |
| | | <!-- },--> |
| | | <!-- // æç¨æ¹æ³--> |
| | | <!-- formSeconds(s1, start, mod) {--> |
| | | <!-- const nowData = new Date(start)--> |
| | | <!-- // ç®åºå½åæç¨çç»ææ¶é´--> |
| | | <!-- return this.transitionTime(--> |
| | | <!-- new Date(nowData.setSeconds(nowData.getSeconds() + s1))--> |
| | | <!-- )--> |
| | | <!-- },--> |
| | | <!-- // è½¬åæ åæ¶é´--> |
| | | <!-- transitionTime(time) {--> |
| | | <!-- const d = new Date(time)--> |
| | | <!-- return (--> |
| | | <!-- d.getFullYear() +--> |
| | | <!-- '-' +--> |
| | | <!-- (d.getMonth() + 1) +--> |
| | | <!-- '-' +--> |
| | | <!-- d.getDate() +--> |
| | | <!-- ' ' +--> |
| | | <!-- d.getHours() +--> |
| | | <!-- ':' +--> |
| | | <!-- d.getMinutes() +--> |
| | | <!-- ':' +--> |
| | | <!-- d.getSeconds()--> |
| | | <!-- )--> |
| | | <!-- },--> |
| | | <!-- // æ¶é´æ¯è¾--> |
| | | <!-- formTime(d1, d2, mod) {--> |
| | | <!-- // d1 æé¤ç»ææ¶é´ d2 å½å产è½ç»ææ¶é´--> |
| | | <!-- const time1 = new Date(d1)--> |
| | | <!-- const time2 = new Date(d2)--> |
| | | <!-- return parseInt(time2 - time1) / 1000--> |
| | | <!-- },--> |
| | | <!-- formatSeconds(value) {--> |
| | | <!-- var secondTime = parseInt(value) // ç§--> |
| | | <!-- var minuteTime = 0 // å--> |
| | | <!-- var hourTime = 0 // å°æ¶--> |
| | | <!-- if (secondTime > 60) {--> |
| | | <!-- // å¦æç§æ°å¤§äº60ï¼å°ç§æ°è½¬æ¢ææ´æ°--> |
| | | <!-- // è·ååéï¼é¤ä»¥60åæ´æ°ï¼å¾å°æ´æ°åé--> |
| | | <!-- minuteTime = parseInt(secondTime / 60)--> |
| | | <!-- // è·åç§æ°ï¼ç§æ°åä½ï¼å¾å°æ´æ°ç§æ°--> |
| | | <!-- secondTime = parseInt(secondTime % 60)--> |
| | | <!-- // 妿åé大äº60ï¼å°åéè½¬æ¢æå°æ¶--> |
| | | <!-- if (minuteTime > 60) {--> |
| | | <!-- // è·åå°æ¶ï¼è·ååéé¤ä»¥60ï¼å¾å°æ´æ°å°æ¶--> |
| | | <!-- hourTime = parseInt(minuteTime / 60)--> |
| | | <!-- // è·åå°æ¶ååä½çåï¼è·ååéé¤ä»¥60åä½çå--> |
| | | <!-- minuteTime = parseInt(minuteTime % 60)--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!-- var result = '' + parseInt(secondTime) + ''--> |
| | | |
| | | <!-- if (minuteTime > 0) {--> |
| | | <!-- result = '' + parseInt(minuteTime) + ':' + result--> |
| | | <!-- }--> |
| | | <!-- if (hourTime > 0) {--> |
| | | <!-- result = '' + parseInt(hourTime) + ':' + result--> |
| | | <!-- }--> |
| | | <!-- return result--> |
| | | <!-- },--> |
| | | <!-- updateTimeLines(timeA, timeB) {--> |
| | | <!-- this.timeLines = [--> |
| | | <!-- {--> |
| | | <!-- time: timeA--> |
| | | <!-- },--> |
| | | <!-- {--> |
| | | <!-- time: timeB,--> |
| | | <!-- color: '#747e80'--> |
| | | <!-- }--> |
| | | <!-- ]--> |
| | | <!-- },--> |
| | | <!-- scrollLeftA(val) {--> |
| | | <!-- this.positionB = { x: val }--> |
| | | <!-- },--> |
| | | <!-- scrollLeftB(val) {--> |
| | | <!-- this.positionA = { x: val }--> |
| | | <!-- },--> |
| | | <!-- // 设置åå§åæ°æ®--> |
| | | <!-- oneClick() {--> |
| | | <!-- // this.getCurrentRow(this.mn_data[0])--> |
| | | <!-- }--> |
| | | <!-- }--> |
| | | <!--}--> |
| | | <!--</script>--> |
| | | |
| | | <!--<style scoped>--> |
| | | <!--body {--> |
| | | <!-- font: 12px;--> |
| | | <!-- margin: 0;--> |
| | | <!-- padding: 0;--> |
| | | <!-- width: 100%;--> |
| | | <!-- height: 100%;--> |
| | | <!--}--> |
| | | |
| | | <!--.box_style {--> |
| | | <!-- position: relative;--> |
| | | <!-- top: 40px;--> |
| | | <!-- left: -75px;--> |
| | | <!--}--> |
| | | |
| | | <!--.box_styles {--> |
| | | <!-- position: relative;--> |
| | | <!-- top: 40px;--> |
| | | <!-- left: 0;--> |
| | | <!--}--> |
| | | |
| | | <!--#app {--> |
| | | <!-- display: flex;--> |
| | | <!-- flex-direction: column;--> |
| | | <!-- padding: 0 10px;--> |
| | | <!-- /* height: calc(100vh - 100px); */--> |
| | | <!--}--> |
| | | |
| | | <!--label {--> |
| | | <!-- margin-left: 10px;--> |
| | | <!--}--> |
| | | |
| | | <!--input {--> |
| | | <!-- width: 40px;--> |
| | | <!-- height: 20px;--> |
| | | <!-- vertical-align: middle;--> |
| | | <!--}--> |
| | | |
| | | <!--input[type="range"] {--> |
| | | <!-- width: 100px;--> |
| | | <!--}--> |
| | | |
| | | <!--.top-bar {--> |
| | | <!-- /* height: 30px; */--> |
| | | <!-- margin-bottom: 20px;--> |
| | | <!--}--> |
| | | |
| | | <!--.container {--> |
| | | <!-- display: flex;--> |
| | | <!-- flex-direction: column;--> |
| | | <!-- flex: 1;--> |
| | | <!--}--> |
| | | |
| | | <!--.main-footer {--> |
| | | <!-- /* height: 30px; */--> |
| | | <!--}--> |
| | | |
| | | <!--.ib {--> |
| | | <!-- display: inline-block;--> |
| | | <!--}--> |
| | | |
| | | <!--.w250 {--> |
| | | <!-- width: 250px;--> |
| | | <!--}--> |
| | | |
| | | <!--.el-slider {--> |
| | | <!-- width: 100px;--> |
| | | <!--}--> |
| | | |
| | | <!--.tc {--> |
| | | <!-- text-align: center;--> |
| | | <!--}--> |
| | | |
| | | <!--.name {--> |
| | | <!-- display: flex;--> |
| | | <!-- box-sizing: border-box;--> |
| | | <!-- overflow: hidden;--> |
| | | <!-- height: 100%;--> |
| | | <!-- width: 100%;--> |
| | | <!-- padding: 0 5px 0 0;--> |
| | | <!-- border-radius: 8px 0 0 8px;--> |
| | | <!-- align-items: center;--> |
| | | <!--}--> |
| | | |
| | | <!--.colorBar {--> |
| | | <!-- width: 10px;--> |
| | | <!-- height: 100%;--> |
| | | <!--}--> |
| | | |
| | | <!--.carId {--> |
| | | <!-- flex: 1;--> |
| | | <!--}--> |
| | | |
| | | <!--.tc {--> |
| | | <!-- color: #909399;--> |
| | | <!-- font-size: 14px;--> |
| | | <!--}--> |
| | | |
| | | <!--.type {--> |
| | | <!-- padding: 0 5px 0 0;--> |
| | | <!-- font-size: 1.2rem;--> |
| | | <!--}--> |
| | | |
| | | <!--.t_size {--> |
| | | <!-- font-size: 14px;--> |
| | | <!--}--> |
| | | |
| | | <!--.icon_true {--> |
| | | <!-- height: 8px;--> |
| | | <!-- display: inline-block;--> |
| | | <!-- width: 8px;--> |
| | | <!-- background: #00a79d;--> |
| | | <!-- margin-right: 7px;--> |
| | | <!-- border-radius: 15px;--> |
| | | <!--}--> |
| | | |
| | | <!--.icon_ty {--> |
| | | <!-- height: 8px;--> |
| | | <!-- display: inline-block;--> |
| | | <!-- width: 8px;--> |
| | | <!-- background: red;--> |
| | | <!-- margin-right: 7px;--> |
| | | <!-- border-radius: 15px;--> |
| | | <!--}--> |
| | | |
| | | <!--.icon_gz {--> |
| | | <!-- height: 8px;--> |
| | | <!-- display: inline-block;--> |
| | | <!-- width: 8px;--> |
| | | <!-- background: yellow;--> |
| | | <!-- margin-right: 7px;--> |
| | | <!-- border-radius: 15px;--> |
| | | <!--}--> |
| | | |
| | | <!--/* .el-col-offset-1 {--> |
| | | <!-- margin-left: 0.5% !important;--> |
| | | <!--} */--> |
| | | <!--.marginLeft {--> |
| | | <!-- margin-left: 15px;--> |
| | | <!--}--> |
| | | |
| | | <!--.button_style {--> |
| | | <!-- background: #00a79d;--> |
| | | <!-- color: #ffff;--> |
| | | <!-- border-color: #00a79d;--> |
| | | <!--}--> |
| | | |
| | | <!--.rg {--> |
| | | <!-- float: right;--> |
| | | <!--}--> |
| | | |
| | | <!--.color {--> |
| | | <!-- color: #909399;--> |
| | | <!--}--> |
| | | <!--</style>--> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs' |
| | | import Mock from 'mockjs' |
| | | |
| | | const colorList = ['(252, 105, 100)', '(247, 167, 71)', '(116, 202, 90)', '(83, 186, 241)', '(208, 142, 2231)'] |
| | | const nameList = '叿å·,é£ç¿¼å·,å
æå·,窥æ¢å·,åç¥å·,è¦å®å·,éªçµæµæå·,å士å·,é¹é³ç«ç¥å·,ç廿å·,叿ä¹å
å·,åæµ·å¿è
å·,ç«éE3å·,å±±ç¥å·,å®å
¨å«å£«å·,éé¤å·,寿æå·,ææå·,ç½æ¼æ¯å¡,欲æå·,é¹é³é·çµå·,æ¶é²å·,æ¬§æ´²ä¹æå·'.split(',') |
| | | |
| | | const typeList = 'ð
,ð,ð'.split(',') |
| | | |
| | | const Random = Mock.Random |
| | | var template = { |
| | | 'id': () => 'JHR' + Random.natural(100, 999) + Random.character('upper') + Random.character('upper'), |
| | | 'name': () => Random.pick(nameList), |
| | | 'type': () => Random.pick(typeList), |
| | | 'colorPair': () => { |
| | | const a = 'rgb' + Random.pick(colorList) |
| | | return { |
| | | dark: a.replace(')', ',0.8)'), |
| | | light: a.replace(')', ',0.1)') |
| | | } |
| | | }, |
| | | 'speed': () => Random.natural(0, 200), |
| | | 'gtArray': () => { |
| | | const temp = [] |
| | | let i = 0 |
| | | const j = Random.natural(1, 9) |
| | | let tempStart = dayjs().subtract(12, 'hour') |
| | | let tempEnd = dayjs().subtract(12, 'hour') |
| | | |
| | | while (i < j) { |
| | | tempStart = tempEnd.add(Random.natural(1, 5), 'hour') |
| | | tempEnd = tempStart.add(Random.natural(1, 5), 'hour') |
| | | temp.push({ |
| | | 'id': 'D' + Random.natural(1000, 9999), |
| | | 'passenger': Random.natural(10, 200), |
| | | 'start': tempStart.toString(), |
| | | 'end': tempEnd.toString() |
| | | }) |
| | | |
| | | i++ |
| | | } |
| | | return temp |
| | | } |
| | | |
| | | } |
| | | |
| | | function mockDatas(nums) { |
| | | const datas = [] |
| | | for (let i = 0, |
| | | j = Random.natural(nums, nums); i < j; i++) { |
| | | datas.push(Mock.mock(template)) |
| | | } |
| | | return datas |
| | | } |
| | | |
| | | export { |
| | | mockDatas |
| | | } |
| | |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="route_name" |
| | | label="å
³èå·¥èºè·¯çº¿" |
| | | min-width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <i v-if="row.route_name" class="el-icon-share" @click="routeClick(row)" /> |
| | | <i v-else style="color:rgb(180 ,181, 185)" class="el-icon-share" @click="routeClick(row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="route_name"--> |
| | | <!-- label="å
³èå·¥èºè·¯çº¿"--> |
| | | <!-- min-width="110"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <i v-if="row.route_name" class="el-icon-share" @click="routeClick(row)" />--> |
| | | <!-- <i v-else style="color:rgb(180 ,181, 185)" class="el-icon-share" @click="routeClick(row)" />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="plan_startdate" |
| | | label="计åå¼å§æ¶é´" |
| | |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="width: 90px">æ«ææ¡ç ï¼</div> |
| | | <!-- oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"--> |
| | | |
| | | <el-input |
| | | id="keyWords" |
| | | v-model="form.orderstepqrcode" |
| | | name="produceCode" |
| | | style="width: 300px" |
| | | @keyup.native="e=>judgeIsScanning(e,'produceCode')" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | |
| | | </div> |
| | | <div v-if="false" style="display: flex;padding-right: 10px"> |
| | | <el-button @click="ZZstart"> |
| | |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelected"--> |
| | | <!-- :label="row.wo"--> |
| | | <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"--> |
| | | <!-- @change.native="getCurrentRow(row.wo)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | |
| | | v-model="WXform.orderstepqrcode" |
| | | name="WXproduceCode" |
| | | style="width: 300px" |
| | | @keyup.native="e=>judgeIsScanning(e,'WXproduceCode')" |
| | | @keyup.enter.native="val=>enterNative(val,'WXproduceCode')" |
| | | /> |
| | | </div> |
| | |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="WXsortChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelected"--> |
| | | <!-- :label="row.wo_code"--> |
| | | <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"--> |
| | | <!-- @change.native="getWXCurrentRow(row.wo_code)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | |
| | | v-model="badForm.orderstepqrcode" |
| | | name="badProduceCode" |
| | | style="width: 300px" |
| | | @keyup.native="e=>judgeIsScanning(e,'badProduceCode')" |
| | | @keyup.enter.native="val=>enterNative(val,'badProduceCode')" |
| | | /> |
| | | </div> |
| | |
| | | }, |
| | | badTableDataDialog: [], // ä¸è¯å¯¹è¯æ¡tableè¡¨æ ¼ |
| | | OperationArr: [], // äººåæ°ç» |
| | | sendButtonIsDisabled: false// ä¸è¾¾æé®æ¯å¦å¯ç¹å» |
| | | sendButtonIsDisabled: false, // ä¸è¾¾æé®æ¯å¦å¯ç¹å» |
| | | judgeIsScanningArr: []// 夿æ¯å¦æ«ç æ°ç» |
| | | } |
| | | }, |
| | | // computed: { |
| | | // qrLink: function() { |
| | | // return this.$store.getters.getPreviewUrl |
| | | // } |
| | | // }, |
| | | // watch: { |
| | | // qrLink: function(newVal, oldNew) { |
| | | // if (newVal !== oldNew) { |
| | | // this.$nextTick(() => { |
| | | // this.bindQRCode(newVal) |
| | | // }) |
| | | // } |
| | | // } |
| | | // }, |
| | | watch: { |
| | | // 'form.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'produceCode')() |
| | | // } |
| | | // }, |
| | | // 'WXform.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'WXproduceCode')() |
| | | // } |
| | | // }, |
| | | // 'badForm.orderstepqrcode': { |
| | | // handler(newValue) { |
| | | // this.form.orderstepqrcode = newValue |
| | | // |
| | | // // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | // this.fnThrottle(this.enterNative, 500, 2000, 'badProduceCode')() |
| | | // } |
| | | // } |
| | | }, |
| | | |
| | | created() { |
| | | this.getMesOrderStepSearch() |
| | | this.tabClick() |
| | |
| | | this.getMesOrderSelectUserAll() // è·åææäººå |
| | | }, |
| | | methods: { |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 鲿 //æ«ç ç¨çæ¯é²æ |
| | | fnThrottle(method, delay, duration, belong) { |
| | | var that = this |
| | | var timer = this.timer |
| | | var begin = new Date().getTime() |
| | | return function() { |
| | | var current = new Date().getTime() |
| | | clearTimeout(timer) |
| | | if (current - begin >= duration) { |
| | | // method() |
| | | // that.VALUE() |
| | | begin = current |
| | | } else { |
| | | that.timer = setTimeout(function() { |
| | | // method() |
| | | if (belong === 'produceCode') { |
| | | that.enterNative(that.form.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'WXproduceCode') { |
| | | that.enterNative(that.WXform.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'badProduceCode') { |
| | | that.enterNative(that.badForm.orderstepqrcode, belong) |
| | | } |
| | | }, delay) |
| | | } |
| | | } |
| | | }, |
| | | // 夿æ¯å¦æ¯æ«ç æªæ«ç |
| | | judgeIsScanning(e, belong) { |
| | | const timenow = e.timeStamp |
| | | let flag = true |
| | | this.judgeIsScanningArr.push(timenow) |
| | | let i |
| | | for (i in this.judgeIsScanningArr) { |
| | | flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 10 |
| | | if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) { |
| | | if (flag) { |
| | | this.fnThrottle(this.enterNative, 500, 2000, belong)() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // æ«ç é®çå车äºä»¶ |
| | | async enterNative(val, belong) { |
| | | console.log(val, belong) |
| | | console.log(val, belong, 89898989) |
| | | // å¼å·¥ï¼code="200" count=0 |
| | | // æ¥å·¥ï¼code="200" count=1 |
| | | // åæï¼code="200" count=2 |
| | |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.form.orderstepqrcode = '' |
| | | this.WXform.orderstepqrcode = '' |
| | | this.badForm.orderstepqrcode = '' |
| | | |
| | | this.dialogForm.wo_code = '', // å·¥åç¼å· |
| | | this.dialogForm.partcode = '', // 产åç¼ç |
| | | this.dialogForm.partname = '', // 产ååç§° |
| | |
| | | if (res.code === '200') { |
| | | this.$message.success('æ¶ææåï¼') |
| | | |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | } |
| | |
| | | if (res.code === '200') { |
| | | this.$message.success('æ¥å·¥æåï¼') |
| | | |
| | | console.log(this.dialogForm.nextstepcode, 1) |
| | | if (this.dialogForm.nextstepcode !== '') { |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}"> |
| | | <el-tabs ref="elTabs" v-model="activeName" type="border-card" @tab-click="tabClick"> |
| | | <el-tab-pane label="ç产å表"> |
| | | <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between"> |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="width: 90px">æ«ææ¡ç ï¼</div> |
| | | <!-- oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"--> |
| | | <el-input |
| | | id="keyWords" |
| | | v-model="form.orderstepqrcode" |
| | | name="produceCode" |
| | | style="width: 300px" |
| | | @keyup.enter.native="val=>enterNative(val,'produceCode')" |
| | | /> |
| | | </div> |
| | | <div v-if="false" style="display: flex;padding-right: 10px"> |
| | | <el-button @click="ZZstart"> |
| | | <svg-icon icon-class="start_time" style="margin-right: 2px" /> |
| | | å¼å§ |
| | | </el-button> |
| | | <el-button @click="ZZreport"> |
| | | <svg-icon icon-class="report_work" style="margin-right: 2px" /> |
| | | æ¥å·¥ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="tableData" |
| | | :height="isIpad? (tableHeight+50):tableHeight" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelected"--> |
| | | <!-- :label="row.wo"--> |
| | | <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"--> |
| | | <!-- @change.native="getCurrentRow(row.wo)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | | label="åºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | width="80" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div> |
| | | <div v-if="row.status==='ALLO'">已派å</div> |
| | | <div v-if="row.status==='START'">å¼å·¥</div> |
| | | <div v-if="row.status==='CLOSED'">å®å·¥</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="å·¥åå·" |
| | | width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | width="160" |
| | | show-tooltip-when-overflow |
| | | label="产ååç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åº" |
| | | show-tooltip-when-overflow |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="descr"--> |
| | | <!-- label="å·¥åºæè¿°"--> |
| | | <!-- min-width="150"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div v-if="row.descr">{{ row.descr }}</div>--> |
| | | <!-- <div v-else>/</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æªæ¥å·¥æ°é" |
| | | width="120" |
| | | > |
| | | <!-- sortable="custom"--> |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | label="å·²æ¥å·¥æ°é" |
| | | sortable="custom" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | width="150" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="bad_qty" |
| | | label="å·²æ¥åºæ°é" |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_startdate" |
| | | label="计åå¼å·¥æ¥æ" |
| | | width="150" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="plan_enddate" |
| | | label="计åå®å·¥æ¥æ" |
| | | width="150" |
| | | sortable="custom" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æä½"--> |
| | | <!-- width="150"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-button type="text" @click="edit('edit',row)">ç¼è¾</el-button>--> |
| | | <!-- <el-button type="text" @click="del(row)">å é¤</el-button>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getMesOrderStepSearch" |
| | | /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="å¤åå表"> |
| | | <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between"> |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="width: 90px;">å¤åç±»åï¼</div> |
| | | <el-select |
| | | v-model="WXSelected" |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in WXSelectArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | <div style="width: 90px;margin-left: 20px">æ«ææ¡ç ï¼</div> |
| | | <el-input |
| | | v-model="WXform.orderstepqrcode" |
| | | name="WXproduceCode" |
| | | style="width: 300px" |
| | | @keyup.enter.native="val=>enterNative(val,'WXproduceCode')" |
| | | /> |
| | | </div> |
| | | <div v-if="false" style="display: flex;padding-right: 10px"> |
| | | <el-button @click="WXsend"> |
| | | <svg-icon icon-class="start_time" style="margin-right: 2px" /> |
| | | åæ |
| | | </el-button> |
| | | <el-button @click="WXback"> |
| | | <svg-icon icon-class="report_work" style="margin-right: 2px" /> |
| | | æ¶æ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="WXtableData" |
| | | :height="isIpad? (tableHeight+50):tableHeight" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="WXsortChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- width="50"--> |
| | | <!-- fixed--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-model="radioSelected"--> |
| | | <!-- :label="row.wo_code"--> |
| | | <!-- style="color: #fff;padding-left: 10px; margin-right: -25px;"--> |
| | | <!-- @change.native="getWXCurrentRow(row.wo_code)"--> |
| | | <!-- />--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | | label="åºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | width="80" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.status==='NEW'">æ°è®¢å</div> |
| | | <div v-if="row.status==='ALLO'">已派å</div> |
| | | <div v-if="row.status==='START'">å·²åæ</div> |
| | | <div v-if="row.status==='CLOSED'">å·²æ¶æ</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="å·¥åå·" |
| | | width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="产ååç§°" |
| | | width="160" |
| | | show-tooltip-when-overflow |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åº" |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="descr"--> |
| | | <!-- label="å·¥åºæè¿°"--> |
| | | <!-- min-width="150"--> |
| | | <!-- sortable="custom"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div v-if="row.descr">{{ row.descr }}</div>--> |
| | | <!-- <div v-else>/</div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æªæ¥å·¥æ°é" |
| | | width="120" |
| | | > |
| | | <!-- sortable="custom"--> |
| | | <template slot-scope="{row}"> |
| | | <div>{{ row.plan_qty - row.good_qty - row.ng_qty }}</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | label="å·²æ¶ææ°é" |
| | | sortable="custom" |
| | | width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | width="150" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="bad_qty" |
| | | label="å·²æ¥åºæ°é" |
| | | min-width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_startdate" |
| | | label="计åå¼å·¥æ¥æ" |
| | | width="150" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="plan_enddate" |
| | | label="计åå®å·¥æ¥æ" |
| | | width="150" |
| | | sortable="custom" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.plan_startdate">{{ row.plan_startdate.substring(0,11) }}</div> |
| | | <div v-else>/</div> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æä½"--> |
| | | <!-- width="150"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-button type="text" @click="edit('edit',row)">ç¼è¾</el-button>--> |
| | | <!-- <el-button type="text" @click="del(row)">å é¤</el-button>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="WXtotal" |
| | | :page.sync="WXform.page" |
| | | :limit.sync="WXform.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getMesOrderStepSearch" |
| | | /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="ä¸è¯å¾
å¤çå表"> |
| | | <div style="margin-left: 10px;margin-top:10px;display: flex;justify-content: space-between"> |
| | | <div style="display: flex;align-items: center"> |
| | | <div style="width: 90px">æ«ææ¡ç ï¼</div> |
| | | <!-- oninput="value=value.replace(/[^0-9a-zA-Z;_]/g,'')"--> |
| | | |
| | | <el-input |
| | | v-model="badForm.orderstepqrcode" |
| | | name="badProduceCode" |
| | | style="width: 300px" |
| | | @keyup.enter.native="val=>enterNative(val,'badProduceCode')" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <el-divider /> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="badTableData" |
| | | :height="isIpad? (tableHeight+50):tableHeight" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="badSortChange" |
| | | > |
| | | <el-table-column |
| | | prop="RowNum" |
| | | width="50" |
| | | label="åºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="wo_code" |
| | | label="å·¥åå·" |
| | | min-width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="产åç¼ç " |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | min-width="160" |
| | | label="产ååç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åº" |
| | | min-width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="good_qty" |
| | | label="å·²æ¥å·¥æ°é" |
| | | sortable="custom" |
| | | min-width="160" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | width="150" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="bad_qty" |
| | | label="å·²æ¥åºæ°é" |
| | | width="120" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button type="text" @click="repairHandle(row)">ç»´ä¿®å¤ç</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="badTotal" |
| | | :page.sync="badForm.page" |
| | | :limit.sync="badForm.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getBadList" |
| | | /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="dialogVisible" |
| | | width="850px" |
| | | class="dialogVisible" |
| | | :top="dialogTitle==='èªå¶æ¥å·¥'?'5vh':'15vh'" |
| | | :close-on-click-modal="false" |
| | | @close="handleClose" |
| | | @closed="handleClose" |
| | | > |
| | | <el-form |
| | | ref="dialogForm" |
| | | inline |
| | | :rules="dialogFormRules" |
| | | :model="dialogForm" |
| | | label-width="110px" |
| | | > |
| | | <el-form-item label="å·¥åç¼å·ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.wo_code }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产åç¼ç ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.partcode }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产åè§æ ¼ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.partspec }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åå·¥åºï¼"> |
| | | <div style="width: 200px">{{ dialogForm.stepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="false" label="å·¥åºæè¿°ï¼"> |
| | | <!-- <el-tooltip class="item" effect="dark" content="åææåæææåæææåææ¶æå¡æ°æ®çå¡" placement="top-start">--> |
| | | <div style="width: 200px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"> |
| | | {{ dialogForm.stepdesc }} |
| | | </div> |
| | | <!-- </el-tooltip>--> |
| | | </el-form-item> |
| | | <el-form-item label="任塿°éï¼"> |
| | | <div style="width: 200px">{{ dialogForm.planqty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogTitle==='èªå¶å¼å§'" label="æªå¼/å·²å¼ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="æªæ¥/å·²æ¥ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='å¤ååæ'" label="æªå/å·²åï¼"> |
| | | <div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='å¤åæ¶æ'" label="æªæ¶/å·²æ¶ï¼"> |
| | | <div style="width: 200px">{{ dialogForm.noreportqty }}/{{ dialogForm.reportqty }}</div> |
| | | </el-form-item> |
| | | <!--èªå¶å¼å§--> |
| | | <el-form-item v-if="dialogTitle==='èªå¶å¼å§'" label="å¼å·¥æ°éï¼"> |
| | | <div style="width: 200px">{{ dialogForm.startqty }}</div> |
| | | <!-- <div style="width: 200px">{{ dialogForm.noreportqty }}</div>--> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶å¼å§'" prop="eqpcode" label="ç产设å¤ï¼"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in ZZeqpArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- èªå¶æ¥å·¥ --> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="ä¸éå·¥åºï¼"> |
| | | <div style="width: 200px">{{ dialogForm.nextstepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" prop="usergroupcode" label="ç产çç»ï¼"> |
| | | <el-select |
| | | v-model="dialogForm.usergroupcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | @change="usergroupChange" |
| | | > |
| | | <el-option |
| | | v-for="item in ZZtreams" |
| | | :key="item.group_code" |
| | | :label="item.group_name" |
| | | :value="item.group_code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="设å¤åç§°ï¼" prop="eqpcode"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in ZZeqpArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="æ¥å·¥æ°éï¼" prop="startqty"> |
| | | <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" /> |
| | | <!-- <el-input v-model="dialogForm.noreportqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" />--> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="ä¸è¯æ°éï¼"> |
| | | <el-input v-model="dialogForm.noputqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="ä¸è¯åå ï¼"> |
| | | <el-select |
| | | v-model="dialogForm.badcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''" |
| | | multiple |
| | | > |
| | | <el-option |
| | | v-for="item in badArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="æ¥å·¥äººåï¼">--> |
| | | <!-- <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="æ¥å·¥äººï¼"> |
| | | <el-select |
| | | v-model="dialogForm.operation" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in OperationArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='èªå¶æ¥å·¥'" label="夿³¨ï¼"> |
| | | <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <div v-if="dialogTitle==='èªå¶æ¥å·¥'"> |
| | | <i class="el-icon-s-operation" style="color:#42b983;" /> 人åå表 |
| | | <el-button type="primary" style="margin: 10px 0" @click="userAdd">å¢è¡</el-button> |
| | | <el-table |
| | | :data="userTableData" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | height="180" |
| | | highlight-current-row |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column |
| | | width="100" |
| | | label="åºå·" |
| | | type="index" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="username" |
| | | label="人ååç§°" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.username }}</div> |
| | | <el-select |
| | | v-if="row.isVisible===1" |
| | | v-model="row.username" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | @change="val=>usernameChange(val,row)" |
| | | > |
| | | <el-option |
| | | v-for="item in ZZuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="RowNum" |
| | | label="æä½" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="row.isVisible===0" type="text" @click="userDel(row)">å é¤</el-button> |
| | | <el-button v-if="row.isVisible===1&&!userIsSave" type="text" @click="userSave(row)">ä¿å</el-button> |
| | | <el-button v-if="row.isVisible===1" type="text" @click="userCancel(row)">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="UserTotal" |
| | | :page.sync="Userform.page" |
| | | :limit.sync="Userform.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getMesOrderStepSearch" |
| | | /> |
| | | </div> |
| | | <!-- å¤ååæ--> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤ååæ'" |
| | | label="å¤å便¹ï¼" |
| | | prop="wxcode" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.wxcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in WXouterprovide" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤ååæ'" |
| | | label="åæäººåï¼" |
| | | prop="outuser" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.outuser" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in WXoutuser" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤ååæ'" |
| | | label="åææ°éï¼" |
| | | prop="fqty" |
| | | > |
| | | <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^0-9.]/g,'')" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <!-- å¤åæ¶æ--> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="ä¸éå·¥åºï¼" |
| | | > |
| | | <div style="width: 200px">{{ dialogForm.nextstepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="å¤å便¹ï¼" |
| | | prop="wxcode" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.wxcode" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in WXouterprovide" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="æ¶æäººåï¼" |
| | | prop="inuser" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.inuser" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in WXoutuser" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="æ¶ææ°éï¼" |
| | | prop="sqty" |
| | | > |
| | | <el-input |
| | | v-model="dialogForm.sqty" |
| | | style="width: 200px" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="ä¸è¯æ°éï¼" |
| | | prop="noputqty" |
| | | > |
| | | <el-input |
| | | v-model="dialogForm.noputqty" |
| | | style="width: 200px" |
| | | oninput="value=value.replace(/[^0-9.]/g,'')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="dialogTitle==='å¤åæ¶æ'" |
| | | label="ä¸è¯åå ï¼" |
| | | > |
| | | <!-- prop="badcode"--> |
| | | <el-select |
| | | v-model="dialogForm.badcode" |
| | | style="width: 200px;" |
| | | multiple |
| | | :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in badArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='å¤åæ¶æ'" label="æ¶æäººï¼"> |
| | | <el-select |
| | | v-model="dialogForm.operation" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in OperationArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='å¤åæ¶æ'" label="夿³¨ï¼"> |
| | | <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button v-if="dialogTitle==='èªå¶å¼å§'" type="primary" @click="dialogVisibleConfirm">å¼ å·¥</el-button> |
| | | <el-button v-if="dialogTitle==='èªå¶æ¥å·¥'" type="primary" @click="dialogVisibleConfirm">æäº¤/æå°</el-button> |
| | | <el-button v-if="dialogTitle==='å¤ååæ'" type="primary" @click="dialogVisibleConfirm">åæ</el-button> |
| | | <el-button v-if="dialogTitle==='å¤åæ¶æ'" type="primary" @click="dialogVisibleConfirm">æ¶æ/æå°</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!--æå°é¢è§é¡µé¢ å°æ ç¾--> |
| | | <el-dialog |
| | | title="é¢è§" |
| | | :visible.sync="dialogVisible2" |
| | | width="1140" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | @close="dialogVisible2Close" |
| | | > |
| | | <!-- è¦æå°çåºå --> |
| | | <div id="printMe2" style="padding: 30px;"> |
| | | <div |
| | | style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | | > |
| | | |
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 90px;border-bottom:1px solid #000; |
| | | justify-content: center;align-items: center;position: relative" |
| | | > |
| | | <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" /> |
| | | </div> |
| | | <div style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"> |
| | | <div style="margin-left: 5px;width: 28px">æ°é:</div> |
| | | {{ qrForm.startqty }} |
| | | </div> |
| | | <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center"> |
| | | <div style="margin-left: 5px;width: 42px">å¤ç人:</div> |
| | | {{ qrForm.operator }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width:190px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">å·¥åç¼å·:</div> |
| | | <div>{{ qrForm.wo_code }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">产åç¼ç :</div> |
| | | <div>{{ qrForm.partcode }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产ååç§°:</div> |
| | | <div>{{ qrForm.partname }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">ä¸éå·¥åº:</div> |
| | | <div>{{ qrForm.nextstepname }}</div> |
| | | </div> |
| | | <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left"> |
| | | <div style="width: 60px;margin-left: 5px;">å¤çæ¶é´:</div> |
| | | <div>{{ qrForm.operatorTime }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="dialogVisible2 = false">å æ¶</el-button> |
| | | <el-button v-print="printObj2" type="primary">ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- ä¸è¯å¤çåè¡¨å¯¹è¯æ¡--> |
| | | <el-dialog |
| | | title="ç»´ä¿®å¤ç" |
| | | :visible.sync="badDialogVisible" |
| | | width="990px" |
| | | class="badDialogVisible" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | @close="handleCloseBad" |
| | | @closed="handleCloseBad" |
| | | > |
| | | <el-form |
| | | inline |
| | | :model="badDialogForm" |
| | | label-width="110px" |
| | | > |
| | | <el-form-item label="å·¥åç¼å·ï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.wo_code }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产åç¼ç ï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.partcode }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°ï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.partname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="产åè§æ ¼ï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.partspec }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åå·¥åºï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.stepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸éå·¥åºï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.nextstepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="任塿°éï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.plan_qty }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥å·¥æ°éï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.good_qty }}</div> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸è¯æ°éï¼"> |
| | | <div style="width: 200px">{{ badDialogForm.ng_qty }}</div> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="维修人åï¼"> |
| | | <el-select |
| | | v-model="badDialogForm.operation" |
| | | style="width: 200px;" |
| | | placeholder="è¯·éæ©" |
| | | > |
| | | <el-option |
| | | v-for="item in OperationArr" |
| | | :key="item.usercode" |
| | | :label="item.username" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <div style="margin-bottom:20px"> |
| | | <i class="el-icon-s-operation" style="color:#42b983;" /> ä¸è¯ä¿¡æ¯æç»ï¼ |
| | | </div> |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | :data="badTableDataDialog" |
| | | :height="isIpad? (tableHeight-350):(tableHeight-400)" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:(tableHeight-400)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | label="åºå·" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="step_code" |
| | | label="å·¥åºç¼ç " |
| | | min-width="80" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="å·¥åºåç§°" |
| | | min-width="80" |
| | | /> |
| | | |
| | | <el-table-column |
| | | prop="plan_qty" |
| | | label="任塿°é" |
| | | width="80" |
| | | /> |
| | | <el-table-column |
| | | label="æ¥å·¥æ°é" |
| | | width="80" |
| | | prop="report_qty" |
| | | /> |
| | | <el-table-column |
| | | prop="ng_qty" |
| | | label="ä¸è¯æ°é" |
| | | width="80" |
| | | /> |
| | | <el-table-column |
| | | prop="badqty" |
| | | label="å·²æ¥åºæ°é" |
| | | width="100" |
| | | /> |
| | | <el-table-column |
| | | prop="defect_name" |
| | | label="ä¸è¯åå " |
| | | show-tooltip-when-overflow |
| | | width="80" |
| | | /> |
| | | <el-table-column |
| | | prop="repair_qty" |
| | | label="ç»´ä¿®åæ ¼æ°é" |
| | | width="110" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <!-- {{ row.repair_qty }}--> |
| | | <div v-if="row.isVisible===0">{{ row.repair_qty }}</div> |
| | | <el-input v-if="row.isVisible===1" v-model="row.repair_qty" oninput="value=value.replace(/[^0-9]/g,'')" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="bad_qty" |
| | | label="æ¥åºæ°é" |
| | | width="90" |
| | | > |
| | | <!-- oninput="value=value.replace(/[0-9]/g,'')"--> |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.isVisible===0">{{ row.bad_qty }}</div> |
| | | <el-input v-if="row.isVisible===1" v-model="row.bad_qty" oninput="value=value.replace(/[^0-9]/g,'')" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="100" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-button v-if="row.isVisible===0" type="text" @click="badEdit(row)">ç¼è¾</el-button> |
| | | <el-button v-if="row.isVisible===0" type="text" @click="badDel(row)">å é¤</el-button> |
| | | |
| | | <el-button v-if="row.isVisible===1" type="text" @click="badSave(row)">确认</el-button> |
| | | <el-button v-if="row.isVisible===1" type="text" @click="badCancel(row)">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button @click="badDialogVisibleCancel">å æ¶</el-button> |
| | | <el-button type="primary" @click="badDialogVisibleConfirm ">ä¿ å/æ å°</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import $ from 'jquery' |
| | | import { |
| | | MesOrderGroupSelectUser, |
| | | MesOrderSelectUser, |
| | | MesOrderStepReportSelectUserGroup, |
| | | MesOrderStepSearch, |
| | | MesOrderStepStart, |
| | | MesOrderStepStartSelectEqp, |
| | | MesOrderWxStepSearch, |
| | | MesOrderStepSelectWX, |
| | | SavaMesOrderStepOut, |
| | | MesOrderStepSelectCause, |
| | | SavaMesOrderStepIn, |
| | | SavaMesOrderStepStart, |
| | | SavaMesOrderStepReport, MesOrderNgStepSearch, MesOrderNgSubStepSearch, EditOrderNgStepSeave |
| | | } from '@/api/scgl' |
| | | import { urlAddRandomNo, webapp_ws_ajax_run, webapp_ws_autoupdate } from '@/utils/grwebapp' |
| | | import QRCode from 'qrcodejs2' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { handleDatetime2 } from '@/utils/global' |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'SCKBG', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | const validateName = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('请è¾å
¥ç¼ç ')) |
| | | } else { |
| | | if (SER_HZ.test(value)) { |
| | | return callback(new Error('ç¼ç ä¸è½ä¸ºä¸æ')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | const validateTypeCode = (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(new Error('è¯·éæ©ä¸çº§')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | isIpad: false, |
| | | // produceCode: '', // å·¥åºç |
| | | // WXproduceCode: '', // å¤åå·¥åºç |
| | | radioSelected: '', // å·¥åºéä¸ |
| | | WXradioSelected: '', // å·¥åºéä¸ |
| | | form: { |
| | | orderstepqrcode: '', // æ«æçäºç»´ç ä¿¡æ¯ |
| | | prop: 'wo_code', // æåºå段 |
| | | order: 'asc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | total: 10, |
| | | tableData: [], |
| | | WXform: { // å¤å表å |
| | | orderstepqrcode: '', // æ«æçäºç»´ç ä¿¡æ¯ |
| | | prop: 'wo_code', // æåºå段z |
| | | order: 'asc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | WXtotal: 10, // å¤åè¡¨åæ»æ° |
| | | WXtableData: [], // å¤å表 |
| | | |
| | | WXSelectArr: [// å¤åç±»å䏿å表 |
| | | { code: 'OUT', name: 'åæ' }, |
| | | { code: 'IN', name: 'æ¶æ' } |
| | | ], |
| | | WXSelected: 'OUT', // å¤å䏿å表éä¸å¼ |
| | | dialogVisible: false, |
| | | dialogTitle: '', // èªå¶å¼å§ãèªå¶æ¥å·¥ãå¤ååæãå¤åæ¶æ |
| | | dialogForm: { |
| | | wo_code: '', // å·¥åç¼å· |
| | | partcode: '', // 产åç¼ç |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | stepseq: '', // å·¥åºåºå· |
| | | stepcode: '', // å·¥åºç¼ç |
| | | stepname: '', // å½åå·¥åºå |
| | | nextstepname: '', // ä¸ä¸éå·¥åºå |
| | | stepdesc: '', // å·¥åºæè¿° |
| | | planqty: '', // 任塿°é |
| | | reportqty: '', // å·²æ¥æ°é |
| | | noreportqty: '', // æªæ¥æ°é |
| | | startqty: '', // å¼(æ¥)å·¥æ°é |
| | | |
| | | wxcode: '', // å¤åä¾åºåç¼ç |
| | | outuser: '', // åæäººå |
| | | taskqty: '', // 任塿°é |
| | | fqty: '', // åææ°é |
| | | |
| | | inuser: '', // æ¶æäººå |
| | | sqty: '', // æ¶ææ°é |
| | | ngqty: '', // ä¸è¯æ°é |
| | | badcode: '', // ä¸è¯åå ç¼ç |
| | | |
| | | noputqty: '', // ä¸è¯æ°é |
| | | |
| | | eqpcode: '', // ç产设å¤ç¼ç |
| | | |
| | | usergroupcode: '', // çç»ç¼ç |
| | | reportuser: '', // æ¥å·¥äººå |
| | | |
| | | startqtySum: '', // ä¸è½è¶
è¿çæ°å¼ |
| | | |
| | | operation: getCookie('navTabId'), // æ¥å·¥äººï¼æ¶æäººï¼ |
| | | remarks: ''// 夿³¨ |
| | | |
| | | }, |
| | | ZZuserArr: [], // èªå¶ç¨æ·ææ |
| | | ZZtreams: [], // èªå¶ç产çç»æ°ç» |
| | | ZZeqpArr: [], // èªå¶è®¾å¤åç§° |
| | | badArr: [], // ä¸è¯åå æ°ç» |
| | | WXouterprovide: [], // å¤å便¹æ°ç» |
| | | WXoutuser: [], // åæäººåæ°ç» |
| | | userTableData: [], // 人åå表 |
| | | UserTotal: 0, |
| | | Userform: {}, |
| | | userIsSave: false, // æ¤äººåæ¯å¦å¯ä¿æ |
| | | dialogFormRules: { |
| | | outuser: [ |
| | | { required: true, message: 'è¯·éæ©åæäººå', trigger: ['blur', 'change'] } |
| | | ], |
| | | fqty: [ |
| | | { required: true, message: '请è¾å
¥åææ°é', trigger: ['blur', 'change'] } |
| | | ], |
| | | wxcode: [ |
| | | { required: true, message: 'è¯·éæ©å¤å便¹', trigger: ['blur', 'change'] } |
| | | ], |
| | | inuser: [ |
| | | { required: true, message: 'è¯·éæ©æ¶æäººå', trigger: ['blur', 'change'] } |
| | | ], |
| | | sqty: [ |
| | | { required: true, message: '请è¾å
¥æ¶ææ°é', trigger: ['blur', 'change'] } |
| | | ], |
| | | // noputqty: [ |
| | | // { required: true, message: '请è¾å
¥ä¸è¯æ°é', trigger: ['blur', 'change'] } |
| | | // ], |
| | | // badcode: [ |
| | | // { required: true, message: 'è¯·éæ©ä¸è¯åå ', trigger: ['blur', 'change'] } |
| | | // ] |
| | | eqpcode: [ |
| | | { required: true, message: 'è¯·éæ©ç产设å¤', trigger: ['blur', 'change'] } |
| | | ], |
| | | usergroupcode: [ |
| | | { required: true, message: 'è¯·éæ©ç产çç»', trigger: ['blur', 'change'] } |
| | | ], |
| | | startqty: [ |
| | | { required: true, message: '请è¾å
¥æ¥å·¥æ°é', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | activeName: '', |
| | | dialogVisible2: false, |
| | | printObj2: { |
| | | id: 'printMe2', |
| | | popTitle: 'æå°æ¨¡æ¿', |
| | | preview: false, |
| | | extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>', |
| | | closeCallback(vue) { // å
³éæå°çåè°äºä»¶ï¼æ æ³ç¡®å®ç¹å»çæ¯ç¡®è®¤è¿æ¯åæ¶ï¼ |
| | | console.log('11212', vue) |
| | | // vue.dialogVisible = false |
| | | vue.dialogVisible2 = false |
| | | vue.dialogVisible = false |
| | | }, |
| | | beforeOpenCallback(vue) { |
| | | vue.printLoading = true |
| | | console.log('æå¼ä¹å') |
| | | console.log() |
| | | }, |
| | | openCallback(vue) { |
| | | vue.printLoading = false |
| | | console.log('æ§è¡äºæå°') |
| | | } |
| | | }, |
| | | qrForm: { // æå°å
容 |
| | | qrvalue: '', |
| | | startqty: '', |
| | | wo_code: '', |
| | | partcode: '', |
| | | partname: '', |
| | | nextstepname: '', |
| | | operator: '', // æä½äºº |
| | | operatorTime: ''// æä½æ¶é´ |
| | | }, |
| | | badForm: { |
| | | orderstepqrcode: '', // æ«æçäºç»´ç |
| | | prop: 'wo_code', |
| | | order: 'asc', |
| | | page: 1, |
| | | rows: 20 |
| | | }, |
| | | badTableData: [], // ä¸è¯å¤çå表tableæ°æ® |
| | | badTotal: 0, |
| | | badDialogVisible: false, |
| | | badDialogForm: { |
| | | operation: getCookie('navTabId') |
| | | }, |
| | | badTableDataDialog: [], // ä¸è¯å¯¹è¯æ¡tableè¡¨æ ¼ |
| | | OperationArr: [], // äººåæ°ç» |
| | | sendButtonIsDisabled: false // ä¸è¾¾æé®æ¯å¦å¯ç¹å» |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.orderstepqrcode': { |
| | | handler(newValue) { |
| | | this.form.orderstepqrcode = newValue |
| | | |
| | | // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | this.fnThrottle(this.enterNative, 500, 2000, 'produceCode')() |
| | | } |
| | | }, |
| | | 'WXform.orderstepqrcode': { |
| | | handler(newValue) { |
| | | this.form.orderstepqrcode = newValue |
| | | |
| | | // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | this.fnThrottle(this.enterNative, 500, 2000, 'WXproduceCode')() |
| | | } |
| | | }, |
| | | 'badForm.orderstepqrcode': { |
| | | handler(newValue) { |
| | | this.form.orderstepqrcode = newValue |
| | | |
| | | // å¨è¿éè°ç¨ï¼å¹¶æ§è¡this.fnThrottle(this.search, 500, 2000)(); |
| | | this.fnThrottle(this.enterNative, 500, 2000, 'badProduceCode')() |
| | | } |
| | | } |
| | | }, |
| | | // computed: { |
| | | // qrLink: function() { |
| | | // return this.$store.getters.getPreviewUrl |
| | | // } |
| | | // }, |
| | | // watch: { |
| | | // qrLink: function(newVal, oldNew) { |
| | | // if (newVal !== oldNew) { |
| | | // this.$nextTick(() => { |
| | | // this.bindQRCode(newVal) |
| | | // }) |
| | | // } |
| | | // } |
| | | // }, |
| | | created() { |
| | | this.getMesOrderStepSearch() |
| | | this.tabClick() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | |
| | | this.$nextTick(() => { |
| | | $("input[name='produceCode']")[0].focus() |
| | | // this.bindQRCode('10001;001') |
| | | }) |
| | | // webapp_urlprotocol_startup() |
| | | // webapp_ws_autoupdate(true) |
| | | |
| | | this.getMesOrderSelectUserAll() // è·åææäººå |
| | | }, |
| | | methods: { |
| | | // 鲿 //æ«ç ç¨çæ¯é²æ |
| | | fnThrottle(method, delay, duration, belong) { |
| | | var that = this |
| | | var timer = this.timer |
| | | var begin = new Date().getTime() |
| | | return function() { |
| | | var current = new Date().getTime() |
| | | clearTimeout(timer) |
| | | if (current - begin >= duration) { |
| | | // method() |
| | | // that.VALUE() |
| | | begin = current |
| | | } else { |
| | | that.timer = setTimeout(function() { |
| | | // method() |
| | | if (belong === 'produceCode') { |
| | | that.enterNative(that.form.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'WXproduceCode') { |
| | | that.enterNative(that.WXform.orderstepqrcode, belong) |
| | | } |
| | | if (belong === 'badProduceCode') { |
| | | that.enterNative(that.badForm.orderstepqrcode, belong) |
| | | } |
| | | }, delay) |
| | | } |
| | | } |
| | | }, |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | | }, |
| | | async getMesOrderStepSearch() { |
| | | const res = await MesOrderStepSearch(this.form) |
| | | if (res.code === '200') { |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | } |
| | | }, |
| | | async getMesOrderWxStepSearch() { |
| | | const res = await MesOrderWxStepSearch(this.WXform) |
| | | if (res.code === '200') { |
| | | this.WXtableData = res.data |
| | | } |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getMesOrderStepSearch() |
| | | }, |
| | | // WXæåºæ¹åæ¶ |
| | | WXsortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.WXform.order = order |
| | | this.WXform.prop = prop |
| | | this.getMesOrderWxStepSearch() |
| | | }, |
| | | badSortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.badForm.order = order |
| | | this.badForm.prop = prop |
| | | this.getBadList() |
| | | }, |
| | | // èªå¶é¡µç¾åç¹ç¹å» |
| | | getCurrentRow(val) { |
| | | |
| | | }, |
| | | // å¤å页ç¾åç¹ç¹å» |
| | | getWXCurrentRow(val) { |
| | | console.log(val) |
| | | this.WXradioSelected = val |
| | | }, |
| | | // tabæé®åæ¢é¼ æ èªå¨èç¦ |
| | | tabClick(val, d) { |
| | | if (this.$refs.elTabs.currentName === '0') { |
| | | this.$nextTick(() => { |
| | | this.getMesOrderStepSearch() |
| | | $("input[name='produceCode']")[0].focus() |
| | | this.WXform.orderstepqrcode = '' |
| | | }) |
| | | } |
| | | if (this.$refs.elTabs.currentName === '1') { |
| | | this.$nextTick(() => { |
| | | this.getMesOrderWxStepSearch() |
| | | $("input[name='WXproduceCode']")[0].focus() |
| | | this.form.orderstepqrcode = '' |
| | | }) |
| | | } |
| | | if (this.$refs.elTabs.currentName === '2') { |
| | | this.$nextTick(() => { |
| | | this.getBadList() |
| | | $("input[name='badProduceCode']")[0].focus() |
| | | this.badForm.orderstepqrcode = '' |
| | | }) |
| | | } |
| | | }, |
| | | // æ«ç é®çå车äºä»¶ |
| | | async enterNative(val, belong) { |
| | | console.log(val, belong) |
| | | // å¼å·¥ï¼code="200" count=0 |
| | | // æ¥å·¥ï¼code="200" count=1 |
| | | // åæï¼code="200" count=2 |
| | | // æ¶æï¼code="200" count=3 |
| | | // èµ°åè¡¨å½¢å¼ code="200" count=4 |
| | | if (belong === 'produceCode') { |
| | | const orderstepqrcode = this.form.orderstepqrcode |
| | | const data = { |
| | | OperType: 'ZZ', |
| | | orderstepqrcode: orderstepqrcode, |
| | | SelectType: '' |
| | | } |
| | | const res = await MesOrderStepStart(data) |
| | | if (res.code === '200' && res.count === 0) { |
| | | await this.ZZstart(res.data) |
| | | } |
| | | if (res.code === '200' && res.count === 1) { |
| | | await this.ZZreport(res.data) |
| | | } |
| | | } |
| | | if (belong === 'WXproduceCode') { |
| | | const orderstepqrcode = this.WXform.orderstepqrcode |
| | | const data = { |
| | | OperType: 'WX', |
| | | orderstepqrcode: orderstepqrcode, |
| | | SelectType: this.WXSelected// OUTãIN |
| | | } |
| | | const res = await MesOrderStepStart(data) |
| | | if (res.code === '200' && res.count === 2) { |
| | | await this.WXsend(res.data) |
| | | } |
| | | if (res.code === '200' && res.count === 3) { |
| | | await this.WXback(res.data) |
| | | } |
| | | } |
| | | |
| | | if (belong === 'badProduceCode') { |
| | | // this.badForm.orderstepqrcode= |
| | | await this.getBadList() |
| | | await this.repairHandle(this.badForm.orderstepqrcode) |
| | | this.badDialogVisible = true |
| | | } |
| | | }, |
| | | // æ¥è¯¢ |
| | | search() { |
| | | this.getMesOrderStepSearch() |
| | | }, |
| | | // èªå¶å¼å§ |
| | | async ZZstart(obj) { |
| | | // if (!this.ZZisExecutable) { |
| | | // return this.$message.info('请å
æ«ç å·¥åºäºç»´ç ï¼') |
| | | // } |
| | | this.dialogTitle = 'èªå¶å¼å§' |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepseq = obj.seq |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | // this.dialogForm.startqty = obj.startqty |
| | | this.dialogForm.startqty = obj.noreportqty |
| | | }) |
| | | |
| | | await this.getMesOrderStepStartSelectEqp() |
| | | }, |
| | | // èªå¶æ¥å·¥ |
| | | async ZZreport(obj) { |
| | | // if (!this.ZZisExecutable) { |
| | | // return this.$message.info('请å
æ«ç å·¥åºäºç»´ç ï¼') |
| | | // } |
| | | this.dialogTitle = 'èªå¶æ¥å·¥' |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepseq = obj.seq |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noputqty = obj.noputqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | // this.dialogForm.startqty = obj.startqty |
| | | this.dialogForm.startqty = obj.noreportqty |
| | | |
| | | this.dialogForm.nextstepname = obj.nextstepname |
| | | this.dialogForm.nextstepcode = obj.nextstepcode |
| | | |
| | | this.dialogForm.startqtySum = obj.noreportqty |
| | | }) |
| | | |
| | | await this.getMesOrderStepStartSelectEqp() |
| | | await this.getMesOrderStepReportSelectUserGroup() |
| | | await this.getMesOrderStepSelectCause('ZZ') |
| | | await this.getMesOrderSelectUserZZ() |
| | | }, |
| | | // å¤ååæ |
| | | async WXsend(obj) { |
| | | // if (this.WXradioSelected.length < 1 && obj.length < 1) { |
| | | // return this.$message.info('请å
鿩工åºï¼') |
| | | // } |
| | | // console.log(this.WXform.orderstepqrcode === '', 6) |
| | | // if (this.WXform.orderstepqrcode === '') { |
| | | // return this.$message.info('请å
è¾å
¥å·¥åºï¼') |
| | | // } |
| | | this.dialogTitle = 'å¤ååæ' |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | this.dialogForm.fqty = obj.startqty |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | this.dialogForm.stepseq = obj.seq |
| | | }) |
| | | |
| | | await this.getMesOrderStepSelectWX() |
| | | await this.getMesOrderSelectUser() |
| | | }, |
| | | // å¤åæ¶æ |
| | | async WXback(obj) { |
| | | // if (this.WXform.orderstepqrcode === '') { |
| | | // return this.$message.info('请å
è¾å
¥å·¥åºï¼') |
| | | // } |
| | | this.dialogTitle = 'å¤åæ¶æ' |
| | | this.dialogVisible = true |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.wo_code = obj.wo_code |
| | | this.dialogForm.partcode = obj.partnumber |
| | | this.dialogForm.partname = obj.partname |
| | | this.dialogForm.partspec = obj.partspec |
| | | this.dialogForm.stepname = obj.stepname |
| | | this.dialogForm.stepdesc = obj.stepdesc |
| | | this.dialogForm.planqty = obj.planqty |
| | | this.dialogForm.reportqty = obj.reportqty |
| | | this.dialogForm.noreportqty = obj.noreportqty |
| | | this.dialogForm.stepcode = obj.stepcode |
| | | |
| | | this.dialogForm.nextstepname = obj.nextstepname |
| | | this.dialogForm.nextstepcode = obj.nextstepcode |
| | | |
| | | this.dialogForm.noputqty = obj.noputqty |
| | | this.dialogForm.stepseq = obj.seq |
| | | this.dialogForm.sqty = obj.startqty |
| | | |
| | | this.dialogForm.startqtySum = obj.startqty |
| | | }) |
| | | await this.getMesOrderStepSelectWX() |
| | | await this.getMesOrderSelectUser() |
| | | await this.getMesOrderStepSelectCause('WX') |
| | | }, |
| | | // ç产çç»ä¸ææ¹å |
| | | usergroupChange(val) { |
| | | this.dialogForm.usergroupcode = val |
| | | this.getMesOrderSelectUserZZ2() |
| | | }, |
| | | // è·åèªå¶æ¥å·¥ç产çç»ä¸æå表 |
| | | async getMesOrderStepReportSelectUserGroup() { |
| | | const { data: res } = await MesOrderStepReportSelectUserGroup() |
| | | this.ZZtreams = res |
| | | }, |
| | | // è·åèªå¶æ¥å·¥è¡¨æ ¼userææ |
| | | async getMesOrderSelectUserZZ() { |
| | | const { data: res } = await MesOrderSelectUser({ usercode: this.dialogForm.usergroupcode }) |
| | | this.ZZuserArr = res |
| | | }, |
| | | async getMesOrderSelectUserZZ2() { |
| | | const { data: res } = await MesOrderSelectUser({ usercode: '' }) |
| | | this.ZZuserArr = res |
| | | await this.getUserTableData() |
| | | }, |
| | | // è·åèªå¶ç产设å¤ä¸æ |
| | | async getMesOrderStepStartSelectEqp() { |
| | | const { data: res } = await MesOrderStepStartSelectEqp({ orderstepqrcode: this.form.orderstepqrcode }) |
| | | this.ZZeqpArr = res |
| | | }, |
| | | // è·åWX便¹æ¥å£ |
| | | async getMesOrderStepSelectWX() { |
| | | const { data: res } = await MesOrderStepSelectWX({ orderstepqrcode: this.WXform.orderstepqrcode }) |
| | | this.WXouterprovide = res |
| | | }, |
| | | // è·åæ¶åæäººå䏿æ¥å£ |
| | | async getMesOrderSelectUser() { |
| | | const { data: res } = await MesOrderSelectUser({ usercode: this.dialogForm.outuser }) |
| | | this.WXoutuser = res |
| | | }, |
| | | // è·åæ¶æä¸è¯åå 䏿 |
| | | async getMesOrderStepSelectCause(val) { |
| | | let orderstepqrcode = '' |
| | | if (val === 'WX') { |
| | | orderstepqrcode = this.WXform.orderstepqrcode |
| | | } |
| | | if (val === 'ZZ') { |
| | | orderstepqrcode = this.form.orderstepqrcode |
| | | } |
| | | const { data: res } = await MesOrderStepSelectCause({ orderstepqrcode: orderstepqrcode }) |
| | | this.badArr = res |
| | | }, |
| | | // æ¥å·¥æ¥è¯¢ç¨æ·è¡¨ |
| | | async getUserTableData() { |
| | | const { data: res } = await MesOrderGroupSelectUser({ usergroupcode: this.dialogForm.usergroupcode }) |
| | | this.userTableData = res |
| | | this.userTableData.forEach(item => { |
| | | let number = Math.random() * Math.random()// ä½ä¸ºå 餿¶çæ è¯ç¬¦ |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | item.isVisible = 0 |
| | | item.number = number |
| | | }) |
| | | |
| | | this.ZZuserArr = [...this.ZZuserArr].filter(x => [...this.userTableData].every(y => y.usercode !== x.usercode)) |
| | | }, |
| | | // ç¨æ·æ·»å |
| | | userAdd() { |
| | | let number = Math.random() * Math.random()// ä½ä¸ºå 餿¶çæ è¯ç¬¦ |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | console.log(this.userTableData, 6) |
| | | this.userTableData.unshift({ usercode: '', username: '', isVisible: 1, number: number }) |
| | | }, |
| | | // ç¨æ·å表å é¤ |
| | | userDel(row) { |
| | | this.ZZuserArr.splice(0, 0, { |
| | | usercode: row.usercode, |
| | | username: row.username |
| | | }) |
| | | |
| | | this.userTableData.forEach((item, index) => { |
| | | if (item.number === row.number) { |
| | | this.userTableData.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | // ç¨æ·å表ä¿å |
| | | userSave(row) { |
| | | console.log(row, 123) |
| | | if (row.usercode === '') { |
| | | return this.$message.info('人ååç§°ä¸è½ä¸ºç©ºï¼') |
| | | } |
| | | |
| | | this.ZZuserArr.forEach((item, index) => { |
| | | if (item.usercode === row.usercode) { |
| | | this.ZZuserArr.splice(index, 1) |
| | | } |
| | | }) |
| | | |
| | | this.userTableData.forEach(item => { |
| | | if (item.number === row.number) { |
| | | item.isVisible = 0 |
| | | } |
| | | }) |
| | | }, |
| | | // ç¨æ·åè¡¨åæ¶ |
| | | userCancel(row) { |
| | | this.userTableData.forEach((item, index) => { |
| | | if (item.number === row.number) { |
| | | this.userTableData.splice(index, 1) |
| | | } |
| | | }) |
| | | }, |
| | | // ç¨æ·å表人ååç§°å¼éä¸ |
| | | usernameChange(val, row) { |
| | | this.userTableData.forEach(item => { |
| | | if (item.usercode === val) { |
| | | this.userIsSave = true |
| | | return this.$message.info('æ¤äººåå·²å¨åä¸ï¼') |
| | | } |
| | | if (item.number === row.number) { |
| | | this.userIsSave = false |
| | | item.usercode = val |
| | | item.username = this.ZZuserArr.find(item => item.usercode === val).username |
| | | } |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.form.orderstepqrcode = '' |
| | | this.WXform.orderstepqrcode = '' |
| | | this.badForm.orderstepqrcode = '' |
| | | |
| | | this.dialogForm.wo_code = '', // å·¥åç¼å· |
| | | this.dialogForm.partcode = '', // 产åç¼ç |
| | | this.dialogForm.partname = '', // 产ååç§° |
| | | this.dialogForm.partspec = '', // 产åè§æ ¼ |
| | | this.dialogForm.stepseq = '', // å·¥åºåºå· |
| | | this.dialogForm.stepcode = '', // å·¥åºç¼ç |
| | | this.dialogForm.stepname = '', // å½åå·¥åºå |
| | | this.dialogForm.nextstepname = '', // ä¸ä¸éå·¥åºå |
| | | this.dialogForm.stepdesc = '', // å·¥åºæè¿° |
| | | this.dialogForm.planqty = '', // 任塿°é |
| | | this.dialogForm.reportqty = '', // å·²æ¥æ°é |
| | | this.dialogForm.noreportqty = '', // æªæ¥æ°é |
| | | this.dialogForm.startqty = '', // å¼(æ¥)å·¥æ°é |
| | | |
| | | this.dialogForm.wxcode = '', // å¤åä¾åºåç¼ç |
| | | this.dialogForm.outuser = '', // åæäººå |
| | | this.dialogForm.taskqty = '', // 任塿°é |
| | | this.dialogForm.fqty = '', // åææ°é |
| | | |
| | | this.dialogForm.inuser = '', // æ¶æäººå |
| | | this.dialogForm.sqty = '', // æ¶ææ°é |
| | | this.dialogForm.ngqty = '', // ä¸è¯æ°é |
| | | this.dialogForm.badcode = '', // ä¸è¯åå ç¼ç |
| | | |
| | | this.dialogForm.noputqty = '', // ä¸è¯æ°é |
| | | |
| | | this.dialogForm.eqpcode = '', // ç产设å¤ç¼ç |
| | | |
| | | this.dialogForm.usergroupcode = '', // çç»ç¼ç |
| | | this.dialogForm.reportuser = '', // æ¥å·¥äººå |
| | | |
| | | this.dialogForm.startqtySum = '' // ä¸è½è¶
è¿çæ°å¼ |
| | | |
| | | this.dialogForm.nextstepcode = '' // ä¸éå·¥åºç¼ç |
| | | |
| | | this.dialogForm.remarks = '' // 夿³¨ |
| | | this.dialogForm.operation = getCookie('navTabId') // æ¥å·¥äººï¼æ¶æäººï¼ |
| | | this.userTableData = [] // 人åå表 |
| | | |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | if (this.dialogTitle === 'å¤ååæ') { |
| | | if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) { |
| | | return this.$message.info('åææ°éä¸è½å¤§äºæªåæ°é!') |
| | | } |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // å·¥åç¼å· |
| | | partcode: this.dialogForm.partcode, // 产åç¼ç |
| | | stepseq: this.dialogForm.stepseq, // å·¥åºåºå· ææ¶ç¼º |
| | | stepcode: this.dialogForm.stepcode, // å·¥åºç¼ç |
| | | wxcode: this.dialogForm.wxcode, // å¤åä¾åºåç¼ç |
| | | outuser: this.dialogForm.outuser, // åæäººå |
| | | taskqty: this.dialogForm.planqty, // 任塿°é |
| | | fqty: this.dialogForm.fqty // åææ°é |
| | | } |
| | | SavaMesOrderStepOut(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('åææåï¼') |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | } else { |
| | | this.$message.error('åæå¤±è´¥!') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (this.dialogTitle === 'å¤åæ¶æ') { |
| | | if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('æ¶ææ°éå ä¸è¯æ°éä¸è½å¤§äºäºæªæ¶æ°é!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noputqty) > 0) { |
| | | if (this.dialogForm.badcode.length < 1) { |
| | | return this.$message.info('è¯·éæ©ä¸è¯åå ï¼') |
| | | } |
| | | } |
| | | |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // å·¥åç¼å· |
| | | partcode: this.dialogForm.partcode, // 产åç¼ç |
| | | stepseq: this.dialogForm.stepseq, // å·¥åºåºå· |
| | | stepcode: this.dialogForm.stepcode, // å·¥åºç¼ç |
| | | wxcode: this.dialogForm.wxcode, // å¤åä¾åºåç¼ç |
| | | inuser: this.dialogForm.inuser, // åæäººå |
| | | taskqty: this.dialogForm.planqty, // 任塿°é |
| | | sqty: this.dialogForm.sqty, // æ¶ææ°é |
| | | remarks: this.dialogForm.remarks, // 夿³¨ |
| | | ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // ä¸è¯æ°é |
| | | badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// ä¸è¯åå |
| | | } |
| | | SavaMesOrderStepIn(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('æ¶ææåï¼') |
| | | |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | } |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | } else { |
| | | this.$message.error('æ¶æå¤±è´¥!') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (this.dialogTitle === 'èªå¶å¼å§') { |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // å·¥åç¼å· |
| | | partcode: this.dialogForm.partcode, // 产åç¼ç |
| | | stepseq: this.dialogForm.stepseq, // å·¥åºåºå· ææ¶ç¼º |
| | | stepcode: this.dialogForm.stepcode, // å·¥åºç¼ç |
| | | eqpcode: this.dialogForm.eqpcode, // çäº§è®¾å¤ |
| | | taskqty: this.dialogForm.planqty, // 任塿°é |
| | | startqty: this.dialogForm.startqty// å¼å§æ°é |
| | | } |
| | | SavaMesOrderStepStart(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('å¼å·¥æåï¼') |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | } else { |
| | | this.$message.error('å¼å·¥å¤±è´¥!') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (this.dialogTitle === 'èªå¶æ¥å·¥') { |
| | | if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('æ¥å·¥æ°éå ä¸è¯æ°éä¸è½å¤§äºäºæªæ¥æ°é!') |
| | | } |
| | | if (this.userTableData.length < 1) { |
| | | return this.$message.info('人åå表ä¸è½ä¸ºç©º!') |
| | | } |
| | | |
| | | if (parseFloat(this.dialogForm.noputqty) > 0) { |
| | | if (this.dialogForm.badcode.length < 1) { |
| | | return this.$message.info('è¯·éæ©ä¸è¯åå ï¼') |
| | | } |
| | | } |
| | | // this.userTableData = [...new Set(this.userTableData)]// æ°ç»å»é |
| | | this.userTableData = this.userTableData.filter(item => item.usercode !== '') |
| | | // æ°ç»ä¸å¯¹è±¡ç¸åçå»é |
| | | this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => { |
| | | return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex |
| | | }) |
| | | // console.log(this.userTableData, 1) |
| | | const reportuser = this.userTableData.map(item => item.usercode).join(';') |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // å·¥åç¼å· |
| | | partcode: this.dialogForm.partcode, // 产åç¼ç |
| | | stepseq: this.dialogForm.stepseq, // å·¥åºåºå· |
| | | stepcode: this.dialogForm.stepcode, // å·¥åºç¼ç |
| | | eqpcode: this.dialogForm.eqpcode, // 设å¤ç¼ç |
| | | usergroupcode: this.dialogForm.usergroupcode, // çç»ç¼ç |
| | | reportuser: reportuser, // æ¥å·¥äººå |
| | | taskqty: this.dialogForm.planqty, // 任塿°é |
| | | // startqty: this.dialogForm.startqty, // å¼å·¥æ°é |
| | | startqty: this.dialogForm.reportqty, // å¼å·¥æ°é |
| | | // reportqty: this.dialogForm.reportqty, // æ¥å·¥æ°é |
| | | reportqty: this.dialogForm.startqty, // æ¥å·¥æ°é |
| | | remarks: this.dialogForm.remarks, // 夿³¨ |
| | | ngqty: this.dialogForm.noputqty === '' ? 0 : this.dialogForm.noputqty, // ä¸è¯æ°é |
| | | badcode: this.dialogForm.badcode.length < 1 ? '' : this.dialogForm.badcode.join(';')// ä¸è¯åå |
| | | } |
| | | |
| | | SavaMesOrderStepReport(data).then(res => { |
| | | if (res.code === '200') { |
| | | this.$message.success('æ¥å·¥æåï¼') |
| | | |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | } |
| | | this.dialogVisible = false |
| | | this.tabClick() |
| | | } else { |
| | | this.$message.error('æ¥å·¥å¤±è´¥!') |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // çæäºç»´ç |
| | | bindQRCode(text) { |
| | | new QRCode(this.$refs.qrCodeDiv2, { |
| | | text: text, |
| | | // width: 50, |
| | | width: 60, |
| | | // height: 50, |
| | | height: 60, |
| | | colorDark: '#000', // äºç»´ç é¢è² |
| | | colorLight: '#ffffff', // äºç»´ç èæ¯è² |
| | | correctLevel: QRCode.CorrectLevel.L// 容éçï¼L/M/H |
| | | }) |
| | | }, |
| | | ZZprint2(username) { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |
| | | this.qrForm.startqty = this.dialogForm.startqty |
| | | this.qrForm.wo_code = this.dialogForm.wo_code |
| | | this.qrForm.partcode = this.dialogForm.partcode |
| | | this.qrForm.partname = this.dialogForm.partname |
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | WXprint2(username) { |
| | | this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode |
| | | this.qrForm.startqty = this.dialogForm.sqty |
| | | this.qrForm.wo_code = this.dialogForm.wo_code |
| | | this.qrForm.partcode = this.dialogForm.partcode |
| | | this.qrForm.partname = this.dialogForm.partname |
| | | this.qrForm.nextstepname = this.dialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | dialogVisible2Close() { |
| | | this.qrForm.qrvalue = '' |
| | | this.qrForm.startqty = '' |
| | | this.qrForm.wo_code = '' |
| | | this.qrForm.partcode = '' |
| | | this.qrForm.partname = '' |
| | | this.qrForm.nextstepname = '' |
| | | this.qrForm.operator = '' |
| | | this.qrForm.operatorTime = '' |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | }, |
| | | |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 220 |
| | | this.isIpad = window.innerHeight < 769 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 50 |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // è·åä¸è¯å¤çå表 |
| | | async getBadList() { |
| | | const res = await MesOrderNgStepSearch(this.badForm) |
| | | this.badTableData = res.data |
| | | this.badTotal = res.count |
| | | }, |
| | | badDialogVisibleCancel() { |
| | | this.badDialogVisible = false |
| | | }, |
| | | badDialogVisibleConfirm() { |
| | | const data = { |
| | | Data: this.badTableDataDialog |
| | | } |
| | | EditOrderNgStepSeave(data, this.badDialogForm.operation).then(res => { |
| | | if (res.code === '200' || res.code === '301') { |
| | | this.getBadList() |
| | | this.badDialogVisible = false |
| | | this.badPrint(this.OperationArr.find(item => item.usercode === this.badDialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | return this.$message.success('ä¿åæåï¼') |
| | | } |
| | | }) |
| | | }, |
| | | badPrint(username) { |
| | | this.qrForm.qrvalue = this.badDialogForm.wo_code + ';' + this.badDialogForm.nextstepcode |
| | | this.qrForm.startqty = this.badDialogForm.plan_qty |
| | | this.qrForm.wo_code = this.badDialogForm.wo_code |
| | | this.qrForm.partcode = this.badDialogForm.partcode |
| | | this.qrForm.partname = this.badDialogForm.partname |
| | | this.qrForm.nextstepname = this.badDialogForm.nextstepname |
| | | this.qrForm.operator = username |
| | | this.qrForm.operatorTime = handleDatetime2(new Date()) |
| | | console.log(this.qrForm, 22) |
| | | this.$nextTick(() => { |
| | | this.bindQRCode(this.qrForm.qrvalue) |
| | | }) |
| | | }, |
| | | |
| | | handleCloseBad() { |
| | | this.badDialogForm = {} |
| | | this.badDialogForm.operation = getCookie('navTabId') |
| | | this.badTableDataDialog = [] |
| | | }, |
| | | async getMesOrderSelectUserAll() { |
| | | const { data: res } = await MesOrderSelectUser({ usercode: '' }) |
| | | this.OperationArr = res |
| | | }, |
| | | // ç¹å»ç»´ä¿®å¤çæé® æ æ«ææ¡ç çæ«æå车äºä»¶ |
| | | async repairHandle(row) { |
| | | let data |
| | | if (row.wo_code) { |
| | | data = { |
| | | orderstepqrcode: row.wo_code + ';' + row.stepcode |
| | | } |
| | | } else { |
| | | data = { |
| | | orderstepqrcode: row |
| | | } |
| | | } |
| | | |
| | | const { data: res } = await MesOrderNgSubStepSearch(data) |
| | | |
| | | this.$nextTick(() => { |
| | | this.badDialogForm.wo_code = res.data1.wo_code |
| | | this.badDialogForm.partcode = res.data1.partnumber |
| | | this.badDialogForm.partname = res.data1.partname |
| | | this.badDialogForm.partspec = res.data1.partspec |
| | | this.badDialogForm.stepname = res.data1.stepname |
| | | this.badDialogForm.nextstepcode = res.data1.nextstepcode |
| | | this.badDialogForm.nextstepname = res.data1.nextstepname |
| | | this.badDialogForm.plan_qty = res.data1.planqty |
| | | this.badDialogForm.good_qty = res.data1.noreportqty // æ¥å·¥æ°é |
| | | this.badDialogForm.ng_qty = res.data1.noputqty // ä¸è¯æ°é |
| | | |
| | | this.badTableDataDialog = res.data2 |
| | | |
| | | this.badTableDataDialog.forEach(item => { |
| | | item.repair_qty = 0 |
| | | item.bad_qty = 0 |
| | | item.isVisible = 0 |
| | | // item.defect_code = [...new Set(item.defect_code.split(','))].join(',') |
| | | // item.defect_name = [...new Set(item.defect_name.split(','))].join(',') |
| | | }) |
| | | console.log(this.badTableDataDialog, 321) |
| | | this.badDialogVisible = true |
| | | }) |
| | | }, |
| | | badEdit(row) { |
| | | console.log(row) |
| | | this.badTableDataDialog.forEach((item, index) => { |
| | | if (item.id === row.id && item.m_id === row.m_id) { |
| | | this.badTableDataDialog.splice(index, 1, { |
| | | bad_qty: row.bad_qty, |
| | | repair_qty: row.repair_qty, |
| | | isVisible: 1, |
| | | defect_code: row.defect_code, |
| | | defect_name: row.defect_name, |
| | | badqty: row.badqty, |
| | | id: row.id, |
| | | m_id: row.m_id, |
| | | materiel_code: row.materiel_code, |
| | | ng_qty: row.ng_qty, |
| | | plan_qty: row.plan_qty, |
| | | report_qty: row.report_qty, |
| | | seq: row.seq, |
| | | step_code: row.step_code, |
| | | stepname: row.stepname, |
| | | style: row.style, |
| | | wo_code: row.wo_code |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | badSave(row) { |
| | | if (parseFloat(row.bad_qty) + parseFloat(row.repair_qty) > parseFloat(row.ng_qty)) { |
| | | this.badCancel(row) |
| | | return this.$message.info('ç»´ä¿®æ°é䏿¥åºæ°éä¹åä¸è½å¤§äºä¸è¯æ°éï¼') |
| | | } |
| | | this.badTableDataDialog.forEach((item, index) => { |
| | | if (item.id === row.id && item.m_id === row.m_id) { |
| | | this.badTableDataDialog.splice(index, 1, { |
| | | bad_qty: parseFloat(row.bad_qty), |
| | | repair_qty: parseFloat(row.repair_qty), |
| | | isVisible: 0, |
| | | defect_code: row.defect_code, |
| | | defect_name: row.defect_name, |
| | | id: row.id, |
| | | m_id: row.m_id, |
| | | badqty: row.badqty, |
| | | materiel_code: row.materiel_code, |
| | | ng_qty: row.ng_qty, |
| | | plan_qty: row.plan_qty, |
| | | report_qty: row.report_qty, |
| | | seq: row.seq, |
| | | step_code: row.step_code, |
| | | stepname: row.stepname, |
| | | style: row.style, |
| | | wo_code: row.wo_code |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | badCancel(row) { |
| | | this.badTableDataDialog.forEach((item, index) => { |
| | | if (item.id === row.id && item.m_id === row.m_id) { |
| | | this.badTableDataDialog.splice(index, 1, { |
| | | // bad_qty: row.bad_qty, |
| | | // repair_qty: row.repair_qty, |
| | | bad_qty: 0, |
| | | repair_qty: 0, |
| | | isVisible: 0, |
| | | defect_code: row.defect_code, |
| | | defect_name: row.defect_name, |
| | | id: row.id, |
| | | m_id: row.m_id, |
| | | badqty: row.badqty, |
| | | materiel_code: row.materiel_code, |
| | | ng_qty: row.ng_qty, |
| | | plan_qty: row.plan_qty, |
| | | report_qty: row.report_qty, |
| | | seq: row.seq, |
| | | step_code: row.step_code, |
| | | stepname: row.stepname, |
| | | style: row.style, |
| | | wo_code: row.wo_code |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | badDel(row) { |
| | | this.badTableDataDialog.forEach((item, index) => { |
| | | if (item.id === row.id && item.m_id === row.m_id) { |
| | | this.badTableDataDialog.splice(index, 1) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | $main_color: #42b983; |
| | | .el-button--text { |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .operationClass { |
| | | height: 23px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | ::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered { |
| | | margin: 10px 30px 0px 0; |
| | | } |
| | | |
| | | ::v-deep .el-radio__input.is-checked + .el-radio__label { |
| | | color: $main_color; |
| | | } |
| | | |
| | | ::v-deep .el-radio.is-bordered + .el-radio.is-bordered { |
| | | margin: 10px 30px 0px 0; |
| | | } |
| | | |
| | | //.dialogVisible{ |
| | | ::v-deep .el-select .el-input .el-select__caret { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | //} |
| | | .elTableDiv { |
| | | ::v-deep .el-radio__label { |
| | | display: none; |
| | | } |
| | | } |
| | | </style> |
| | | <style media="print"> |
| | | /*@media print {*/ |
| | | @page { |
| | | size: auto; |
| | | margin: 3mm; |
| | | font-size: 10px; |
| | | } |
| | | |
| | | </style> |
| | | <!--å
Œ
±é¡µé¢æ ·å¼--> |
| | | <style lang="scss" scoped> |
| | | $main_color: #42b983; |
| | | ::v-deep .el-button--text { |
| | | font-size: 14px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-share, .el-icon-delete, .el-icon-edit-outline { |
| | | color: $main_color; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .el-icon-edit-outline { |
| | | margin-right: 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary, .el-button--default, .el-button--info { |
| | | height: 34px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 15px; |
| | | } |
| | | |
| | | ::v-deep .el-button--primary { |
| | | //background-color: $main_color !important; |
| | | } |
| | | |
| | | ::v-deep .el-button--default { |
| | | background-color: #f8f8fa; |
| | | border: none; |
| | | } |
| | | |
| | | ::v-deep .el-input__inner { |
| | | height: 34px; |
| | | line-height: 34px; |
| | | //color: #a7a7a7; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__body { |
| | | padding: 20px 100px !important; |
| | | } |
| | | |
| | | ::v-deep .dialogVisibleRoles .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .importPickerClass .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .badDialogVisible .el-dialog__body { |
| | | padding: 20px 20px !important; |
| | | } |
| | | |
| | | ::v-deep .el-dialog__footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | ::v-deep .el-table .caret-wrapper { |
| | | transform: scale(0.8); |
| | | } |
| | | |
| | | ::v-deep .cell { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | ::v-deep .el-table::before { |
| | | height: 0; |
| | | } |
| | | |
| | | ::v-deep .el-table__body-wrapper { |
| | | background-color: #f8f8fa; |
| | | } |
| | | |
| | | ::v-deep .el-table__body .el-table__row.hover-row td { |
| | | background-color: #eaecef; |
| | | } |
| | | |
| | | ::v-deep .el-form--inline .el-form-item__label { |
| | | color: #a7a7a7; |
| | | } |
| | | |
| | | .body ::v-deep .el-divider { |
| | | border: 1px solid #eee; |
| | | width: 99%; |
| | | margin: 10px auto; |
| | | } |
| | | |
| | | .body ::v-deep .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | </style> |
| | | <style> |
| | | |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |
| | | } |
| | | </style> |
| | |
| | | <el-input |
| | | v-model="form.orderstepqrcode" |
| | | name="GXproduceCode" |
| | | |
| | | style="width: 300px" |
| | | @keyup.native="e=>judgeIsScanning(e,'GXproduceCode')" |
| | | @keyup.enter.native="val=>enterNative(val,'GXproduceCode')" |
| | | /> |
| | | </div> |
| | |
| | | multipleSelection: [], // è¡¨æ ¼å¤éæ¡ |
| | | tabClickIndex: null, // ç¹å»çåå
æ ¼ |
| | | tabClickLabel: '', // å½åç¹å»çåå |
| | | isCancel: false// æ¯å¦ç¹å»åæ¶æé® |
| | | isCancel: false, // æ¯å¦ç¹å»åæ¶æé® |
| | | judgeIsScanningArr: []// 夿æ¯å¦æ«ç æ°ç» |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | row.name = res.name |
| | | row.stepcheckitem_desc = res.descr |
| | | }, |
| | | // 鲿 //æ«ç ç¨çæ¯é²æ |
| | | fnThrottle(method, delay, duration, belong) { |
| | | var that = this |
| | | var timer = this.timer |
| | | var begin = new Date().getTime() |
| | | return function() { |
| | | var current = new Date().getTime() |
| | | clearTimeout(timer) |
| | | if (current - begin >= duration) { |
| | | // method() |
| | | // that.VALUE() |
| | | begin = current |
| | | } else { |
| | | that.timer = setTimeout(function() { |
| | | // method() |
| | | that.enterNative(that.form.orderstepqrcode, belong) |
| | | }, delay) |
| | | } |
| | | } |
| | | }, |
| | | // 夿æ¯å¦æ¯æ«ç æªæ«ç |
| | | judgeIsScanning(e, belong) { |
| | | const timenow = e.timeStamp |
| | | let flag = true |
| | | this.judgeIsScanningArr.push(timenow) |
| | | let i |
| | | for (i in this.judgeIsScanningArr) { |
| | | flag = Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 1]) - Math.ceil(this.judgeIsScanningArr[this.judgeIsScanningArr.length - 2]) < 10 |
| | | if (i > 0 && this.judgeIsScanningArr.length === parseInt(i) + 1) { |
| | | if (flag) { |
| | | this.fnThrottle(this.enterNative, 500, 2000, belong)() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // æ«ç é®çå车äºä»¶ |
| | | async enterNative(val, belong) { |
| | | if (belong === 'GXproduceCode') { |