1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| import { computed } from 'vue';
| import { defineStore } from 'pinia';
|
| export const useCounterStore = defineStore('enterprise', {
|
| state: () => {
| return {
| companyId: '8',
| departId: '',
| delayNum: 0, // 延期计划数
| deviceNum: 0, // 今日生产设备数
| ingNum: 0, // 执行中计划数
| prouserNum: 0, // 今日生产人数
| unqualifiedRate: 0, // 今日不良品率
| procedureName: '' // 工序名称
| };
| },
|
| actions: {
| // 设置企业id
| setCompanyId(companyId) {
| this.companyId = companyId;
| window.sessionStorage.setItem('companyId', companyId);
| },
| // 设置组织id
| setDepartId(departId) {
| this.departId = departId;
| window.sessionStorage.setItem('departId', departId);
| },
| setNum(num) {
| this.delayNum = num.delayNum
| this.deviceNum = num.deviceNum
| this.ingNum = num.ingNum
| this.prouserNum = num.prouserNum
| this.unqualifiedRate = num.unqualifiedRate
| },
| setProcedureName(title) {
| this.procedureName = title
| }
| }
|
| })
|
|