|
|
@@ -17,12 +17,21 @@ import {
|
|
|
} from '@/api/mainData/index.js';
|
|
|
import {
|
|
|
releaseWorkOrder,
|
|
|
- getcheckLoginUserIsTeamLeader
|
|
|
+ getcheckLoginUserIsTeamLeader,
|
|
|
+ getUserInfo
|
|
|
} from '@/api/workOrder/index.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ isTpye: ''
|
|
|
+ };
|
|
|
},
|
|
|
+
|
|
|
+ created() {
|
|
|
+ // console.log('组件传入的选项:', this.$options.mixinOptions);
|
|
|
+ this.isTpye = this.$options.mixinOptions.type;
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
// 查询班次
|
|
|
getClassesData() {
|
|
|
@@ -89,13 +98,37 @@ export default {
|
|
|
this.form.factoryName = this.current.factoryName;
|
|
|
}
|
|
|
// this.current.taskId || this.current.firstTaskId;
|
|
|
- console.log(id, 'id 查询工作中心');
|
|
|
const res = await listWorkCenter(id);
|
|
|
+ console.log(res, 'ressss');
|
|
|
+ const userData = await getUserInfo(this.$store.state.user.info.userId);
|
|
|
+
|
|
|
this.workCenterList = res;
|
|
|
- console.log(this.workCenterList, 'res 333');
|
|
|
if (res.length > 0) {
|
|
|
// this.form.factoryName = res[0].factoryName;
|
|
|
this.form.workCenterId = res[0].id;
|
|
|
+
|
|
|
+ if (this.isTpye == 'add') {
|
|
|
+ if (userData.centerList.length == 0) {
|
|
|
+ this.form.isDisable = true;
|
|
|
+ return this.$message.warning(
|
|
|
+ `当前登录人没有配置所中心,请先去主数据给该登录人配置所属中心`
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ if (userData.centerList.length != 0) {
|
|
|
+ // centerId
|
|
|
+ if (res.length != 0) {
|
|
|
+ const data = userData.centerList.filter(
|
|
|
+ (it) => it.centerId == res[0].id
|
|
|
+ );
|
|
|
+
|
|
|
+ if (data.length == 0) {
|
|
|
+ this.form.isDisable = true;
|
|
|
+ return this.$message.warning(`当前登录人没有权限给该工单派单`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 查首工序
|
|
|
await this.changeWork(res[0].id); // 选择工作中心
|
|
|
this.getProductionData(res[0].id); // 查询产线
|