|
|
@@ -355,7 +355,8 @@
|
|
|
checkOutsourceMaterial,
|
|
|
listTask,
|
|
|
factoryworkstationPage,
|
|
|
- nextTask
|
|
|
+ nextTask,
|
|
|
+ singleListTask
|
|
|
} from '@/api/produce/index';
|
|
|
|
|
|
export default {
|
|
|
@@ -592,21 +593,47 @@
|
|
|
|
|
|
// 获取工序列表
|
|
|
getTaskList() {
|
|
|
- listTask().then((res) => {
|
|
|
- res.map((v) => {
|
|
|
- v.newName = `${v.workCenterName}-${v.name}`;
|
|
|
+ console.log(
|
|
|
+ localStorage.getItem('singleUserInfo'),
|
|
|
+ 'localStorage.getItem'
|
|
|
+ );
|
|
|
+
|
|
|
+ console.log(this.$store.state.user, 'this.$store.state.user.allInfo');
|
|
|
+ if (localStorage.getItem('singleUserInfo') == '1') {
|
|
|
+ singleListTask(this.$store.state.user.allInfo).then((res) => {
|
|
|
+ res.map((v) => {
|
|
|
+ v.newName = `${v.workCenterName}-${v.name}`;
|
|
|
+ });
|
|
|
+ this.produceTaskList = res;
|
|
|
+ this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
|
|
|
+ //默认选择第一个工序
|
|
|
+ if (this.produceTaskList?.length) {
|
|
|
+ this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.taskListRef.setCurrentKey(
|
|
|
+ this.produceTaskList[0].id
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
- this.produceTaskList = res;
|
|
|
- this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
|
|
|
- //默认选择第一个工序
|
|
|
- if (this.produceTaskList?.length) {
|
|
|
- this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.taskListRef.setCurrentKey(this.produceTaskList[0].id);
|
|
|
+ } else {
|
|
|
+ listTask().then((res) => {
|
|
|
+ res.map((v) => {
|
|
|
+ v.newName = `${v.workCenterName}-${v.name}`;
|
|
|
});
|
|
|
- }
|
|
|
- // newName
|
|
|
- });
|
|
|
+ this.produceTaskList = res;
|
|
|
+ this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
|
|
|
+ //默认选择第一个工序
|
|
|
+ if (this.produceTaskList?.length) {
|
|
|
+ this.$store.commit('user/setTaskObj', this.produceTaskList[0]);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.taskListRef.setCurrentKey(
|
|
|
+ this.produceTaskList[0].id
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 获取工位
|