|
@@ -147,15 +147,15 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="行号" align="center" prop="lineNumber">
|
|
<el-table-column label="行号" align="center" prop="lineNumber">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="名称" align="center" prop="productName">
|
|
|
|
|
|
|
+ <el-table-column label="名称" align="center" prop="productName" width="150" show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="编码" align="center" prop="productCode">
|
|
|
|
|
|
|
+ <el-table-column label="编码" align="center" prop="productCode" width="150" show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="牌号" align="center" prop="brandNo">
|
|
<el-table-column label="牌号" align="center" prop="brandNo">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="型号" align="center" prop="model">
|
|
<el-table-column label="型号" align="center" prop="model">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="规格" align="center" prop="specification">
|
|
|
|
|
|
|
+ <el-table-column label="规格" align="center" prop="specification" width="150" show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="单重" align="center" prop="productUnitWeight">
|
|
<el-table-column label="单重" align="center" prop="productUnitWeight">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -262,7 +262,7 @@
|
|
|
:key="scope.$index"
|
|
:key="scope.$index"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item of producedList"
|
|
|
|
|
|
|
+ v-for="item of scope.row.producedList"
|
|
|
:key="scope.$index + item.code"
|
|
:key="scope.$index + item.code"
|
|
|
:label="item.name"
|
|
:label="item.name"
|
|
|
:value="item.code"
|
|
:value="item.code"
|
|
@@ -393,7 +393,7 @@
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="scope.row.factoriesId"
|
|
v-model="scope.row.factoriesId"
|
|
|
:key="scope.row.factoriesId"
|
|
:key="scope.row.factoriesId"
|
|
|
- @change="(e)=>factorChange(e,scope.row)"
|
|
|
|
|
|
|
+ @change="(e) => factorChange(e, scope.row)"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item of factoryList"
|
|
v-for="item of factoryList"
|
|
@@ -524,7 +524,8 @@
|
|
|
getOrderDetail,
|
|
getOrderDetail,
|
|
|
bomListByPlan,
|
|
bomListByPlan,
|
|
|
bomRoutingList,
|
|
bomRoutingList,
|
|
|
- getFactoryList
|
|
|
|
|
|
|
+ getFactoryList,
|
|
|
|
|
+ findBomCategoryByCategoryIds
|
|
|
} from '@/api/saleOrder';
|
|
} from '@/api/saleOrder';
|
|
|
import { parameterGetByCode } from '@/api/mainData/index';
|
|
import { parameterGetByCode } from '@/api/mainData/index';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
@@ -676,11 +677,9 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- factorChange(e,row){
|
|
|
|
|
- let obj = this.factoryList.find(el=>el.id === e);
|
|
|
|
|
- if(obj){
|
|
|
|
|
- console.log(obj,'obj 1234')
|
|
|
|
|
|
|
+ factorChange(e, row) {
|
|
|
|
|
+ let obj = this.factoryList.find((el) => el.id === e);
|
|
|
|
|
+ if (obj) {
|
|
|
row.factoriesIdName = obj.name;
|
|
row.factoriesIdName = obj.name;
|
|
|
}
|
|
}
|
|
|
// factoriesIdName
|
|
// factoriesIdName
|
|
@@ -711,7 +710,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getDetail(code) {
|
|
getDetail(code) {
|
|
|
- getOrderDetail(code).then((res) => {
|
|
|
|
|
|
|
+ getOrderDetail(code).then(async (res) => {
|
|
|
if (res.productInfoList) {
|
|
if (res.productInfoList) {
|
|
|
for (let item of res.productInfoList) {
|
|
for (let item of res.productInfoList) {
|
|
|
if (!item.bomCategoryId) {
|
|
if (!item.bomCategoryId) {
|
|
@@ -730,6 +729,11 @@
|
|
|
item.lackNum = null;
|
|
item.lackNum = null;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ if (res.productInfoList.length > 0) {
|
|
|
|
|
+ let ids = res.productInfoList.map((item) => item.categoryId);
|
|
|
|
|
+ const data = await findBomCategoryByCategoryIds(ids);
|
|
|
|
|
+ this.handleResult(res.productInfoList, data, 'init');
|
|
|
|
|
+ }
|
|
|
this.disabledList = res.productInfoList;
|
|
this.disabledList = res.productInfoList;
|
|
|
this.form = res;
|
|
this.form = res;
|
|
|
});
|
|
});
|
|
@@ -957,7 +961,7 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 确定选择
|
|
// 确定选择
|
|
|
- confirmChoose(list) {
|
|
|
|
|
|
|
+ async confirmChoose(list) {
|
|
|
list.map((el) => (el.selectionRowShow = false));
|
|
list.map((el) => (el.selectionRowShow = false));
|
|
|
list = list
|
|
list = list
|
|
|
.filter(
|
|
.filter(
|
|
@@ -1006,10 +1010,79 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.form.productInfoList = this.form.productInfoList.concat(result);
|
|
|
|
|
|
|
+ if (result.length > 0) {
|
|
|
|
|
+ let ids = result.map((item) => item.categoryId);
|
|
|
|
|
+ const res = await findBomCategoryByCategoryIds(ids);
|
|
|
|
|
+ let datas = JSON.parse(JSON.stringify(result));
|
|
|
|
|
+ datas = await this.handleResult(datas, res);
|
|
|
|
|
+ this.form.productInfoList = this.form.productInfoList.concat(datas);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.productInfoList = this.form.productInfoList.concat(result);
|
|
|
|
|
+ }
|
|
|
this.changeLineNumber();
|
|
this.changeLineNumber();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 计算生产类型数据
|
|
|
|
|
+ calculationType(data) {
|
|
|
|
|
+ let list = [];
|
|
|
|
|
+ let listMap = {
|
|
|
|
|
+ 1: { code: 1, name: 'PBOM' },
|
|
|
|
|
+ 2: { code: 2, name: '加工(MBOM)' },
|
|
|
|
|
+ 3: { code: 3, name: '装配(ABOM)' }
|
|
|
|
|
+ };
|
|
|
|
|
+ data.forEach((el) => {
|
|
|
|
|
+ if (listMap[el.bomType]) {
|
|
|
|
|
+ list.push(listMap[el.bomType]);
|
|
|
|
|
+ delete listMap[el.bomType];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return list;
|
|
|
|
|
+ },
|
|
|
|
|
+ //
|
|
|
|
|
+ async handleResult(result, res, type) {
|
|
|
|
|
+ result.forEach((item) => {
|
|
|
|
|
+ if (!res[item.categoryId]) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let val = res[item.categoryId];
|
|
|
|
|
+ if (!val || val.length == 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let arr = [];
|
|
|
|
|
+ let first = val[0];
|
|
|
|
|
+ arr = val.filter((item) => item.bomType == first.bomType);
|
|
|
|
|
+ item.productType = first.bomType - 0;
|
|
|
|
|
+ let list = this.calculationType(val);
|
|
|
|
|
+ item.producedList = list;
|
|
|
|
|
+ if (!type) {
|
|
|
|
|
+ item.bomVersionList = arr;
|
|
|
|
|
+ // arr.map((el) => (el.bomCategoryId = el.id));
|
|
|
|
|
+ item.bomCategoryId = arr[0].id;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ result.forEach(async (ele) => {
|
|
|
|
|
+ ele = await this.getFindRoutingListByBomId(ele);
|
|
|
|
|
+ console.log(ele, 'ele');
|
|
|
|
|
+ });
|
|
|
|
|
+ return result;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取工艺路线
|
|
|
|
|
+ async getFindRoutingListByBomId(ele) {
|
|
|
|
|
+ let proArr = ele.bomVersionList;
|
|
|
|
|
+ if (!proArr || proArr.length == 0) {
|
|
|
|
|
+ return ele;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(proArr, 'proArr');
|
|
|
|
|
+ const res = await bomRoutingList(proArr[0].id);
|
|
|
|
|
+ let arr = res || [];
|
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
|
+ this.$set(ele, 'routingList', arr);
|
|
|
|
|
+ ele.produceRoutingName = arr[0].name;
|
|
|
|
|
+ this.$set(ele, 'produceRoutingId', arr[0].id);
|
|
|
|
|
+ }
|
|
|
|
|
+ return ele;
|
|
|
|
|
+ },
|
|
|
|
|
+ // // await this.changeBomId(arr[0], 0);
|
|
|
changeLineNumber() {
|
|
changeLineNumber() {
|
|
|
this.form.productInfoList.map((item, index) => {
|
|
this.form.productInfoList.map((item, index) => {
|
|
|
item.lineNumber = 10 * (index + 1);
|
|
item.lineNumber = 10 * (index + 1);
|
|
@@ -1073,23 +1146,23 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 选择BOM
|
|
// 选择BOM
|
|
|
- changeBomId(row, index) {
|
|
|
|
|
- bomRoutingList(row.bomCategoryId).then((res) => {
|
|
|
|
|
- let arr = res || [];
|
|
|
|
|
- // if (arr.length == 0) {
|
|
|
|
|
- // row.produceRoutingId = '';
|
|
|
|
|
- // }
|
|
|
|
|
- if (arr.length > 0) {
|
|
|
|
|
- this.$set(this.form.productInfoList[index], 'routingList', arr);
|
|
|
|
|
- row.produceRoutingName = arr[0].name;
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.form.productInfoList[index],
|
|
|
|
|
- 'produceRoutingId',
|
|
|
|
|
- arr[0].id
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- this.$forceUpdate();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ async changeBomId(row, index) {
|
|
|
|
|
+ const res = await bomRoutingList(row.bomCategoryId);
|
|
|
|
|
+ let arr = res || [];
|
|
|
|
|
+ // if (arr.length == 0) {
|
|
|
|
|
+ // row.produceRoutingId = '';
|
|
|
|
|
+ // }
|
|
|
|
|
+ console.log(arr, 'arr');
|
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
|
+ this.$set(this.form.productInfoList[index], 'routingList', arr);
|
|
|
|
|
+ row.produceRoutingName = arr[0].name;
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'produceRoutingId',
|
|
|
|
|
+ arr[0].id
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
homogeneityInspect(row) {
|
|
homogeneityInspect(row) {
|
|
@@ -1105,8 +1178,8 @@
|
|
|
this.$message.warning('请输入订单数量且订单数量不能为0');
|
|
this.$message.warning('请输入订单数量且订单数量不能为0');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- console.log(row,'row');
|
|
|
|
|
- console.log(this.form,'form +++');
|
|
|
|
|
|
|
+ console.log(row, 'row');
|
|
|
|
|
+ console.log(this.form, 'form +++');
|
|
|
this.$refs.orderHomogeneityInspectDialog.open([row], this.form, 'new');
|
|
this.$refs.orderHomogeneityInspectDialog.open([row], this.form, 'new');
|
|
|
// if (row.productType == 2) {
|
|
// if (row.productType == 2) {
|
|
|
// let data = [];
|
|
// let data = [];
|