|
|
@@ -135,7 +135,7 @@
|
|
|
<el-select
|
|
|
v-model="form.extInfo.workshopPlanId"
|
|
|
placeholder="请选择"
|
|
|
- @change="getListWorkshopByParentId"
|
|
|
+ @change="getListWorkshopByParentId(false)"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
|
@@ -371,9 +371,8 @@
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
- options_groupId: {}
|
|
|
+ options_groupId: Array
|
|
|
},
|
|
|
-
|
|
|
watch: {
|
|
|
options_groupId(nval) {
|
|
|
this.toTreeData(nval);
|
|
|
@@ -386,6 +385,7 @@
|
|
|
enabled: 1,
|
|
|
extInfo: {
|
|
|
factoryId: '', // 工厂
|
|
|
+ workshopPlanId: '', // 厂房
|
|
|
workshopId: '', // 车间
|
|
|
principalDep: '', // 负责人部门
|
|
|
meterTimeUnit: '时', // 节拍时间单位
|
|
|
@@ -428,6 +428,9 @@
|
|
|
'extInfo.factoryId': [
|
|
|
{ required: true, message: '请输入', trigger: 'change' }
|
|
|
],
|
|
|
+ 'extInfo.workshopPlanId': [
|
|
|
+ { required: true, message: '请输入', trigger: 'change' }
|
|
|
+ ],
|
|
|
'extInfo.principalDep': [
|
|
|
{ required: true, message: '请输入', trigger: 'change' }
|
|
|
],
|
|
|
@@ -523,7 +526,7 @@
|
|
|
created() {
|
|
|
this.getGs();
|
|
|
this.getFactoryList();
|
|
|
- // this.getBasicAreaList()
|
|
|
+ this.getBasicAreaList();
|
|
|
},
|
|
|
methods: {
|
|
|
chooseAsset() {
|
|
|
@@ -574,9 +577,14 @@
|
|
|
}
|
|
|
}
|
|
|
this.getData(row.id);
|
|
|
+
|
|
|
// 请求下拉数据
|
|
|
+ if (this.form.extInfo.factoryId) {
|
|
|
+ this.getlistCf();
|
|
|
+ }
|
|
|
+
|
|
|
if (this.form.extInfo.workshopPlanId) {
|
|
|
- this.getListWorkshopByParentId();
|
|
|
+ this.getListWorkshopByParentId(true);
|
|
|
}
|
|
|
if (this.form.extInfo.workshopId) {
|
|
|
this.getlistFactoryLineByParentId();
|
|
|
@@ -665,7 +673,7 @@
|
|
|
// 格式化公司数据
|
|
|
toTreeData(val) {
|
|
|
this.options.principalDep = this.$util.toTreeData({
|
|
|
- data: val,
|
|
|
+ data: JSON.parse(JSON.stringify(val)),
|
|
|
idField: 'id',
|
|
|
parentIdField: 'parentId'
|
|
|
});
|
|
|
@@ -686,7 +694,15 @@
|
|
|
},
|
|
|
|
|
|
// 获取车间
|
|
|
- getListWorkshopByParentId() {
|
|
|
+ getListWorkshopByParentId(bol) {
|
|
|
+ if (!bol) {
|
|
|
+ this.form.extInfo.workshopId = '';
|
|
|
+
|
|
|
+ this.options.workshopId = [];
|
|
|
+
|
|
|
+ this.form.productionLineId = '';
|
|
|
+ this.options.productionLineId = [];
|
|
|
+ }
|
|
|
listWorkshopByParentId(this.form.extInfo.workshopPlanId).then((res) => {
|
|
|
this.options.workshopId = res;
|
|
|
});
|
|
|
@@ -712,10 +728,16 @@
|
|
|
},
|
|
|
// 选择工厂
|
|
|
change_factoryId() {
|
|
|
+ this.form.extInfo.workshopPlanId = '';
|
|
|
+ this.workshopPlanList = [];
|
|
|
+
|
|
|
this.form.extInfo.workshopId = '';
|
|
|
- this.form.leaderId = '';
|
|
|
+
|
|
|
this.options.workshopId = [];
|
|
|
- this.options.leaderId = [];
|
|
|
+
|
|
|
+ this.form.productionLineId = '';
|
|
|
+ this.options.productionLineId = [];
|
|
|
+
|
|
|
this.getlistCf();
|
|
|
},
|
|
|
getlistCf() {
|