|
|
@@ -179,6 +179,66 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="重量单位" align="center" prop="weightUnit">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="机型"
|
|
|
+ align="center"
|
|
|
+ prop="modelKey"
|
|
|
+ width="240"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ label-width="0px"
|
|
|
+ :prop="'productInfoList.' + scope.$index + '.modelKey'"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ clearable
|
|
|
+ v-model="scope.row.modelKey"
|
|
|
+ multiple
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in modelList"
|
|
|
+ :key="item.label"
|
|
|
+ :value="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="颜色"
|
|
|
+ align="center"
|
|
|
+ prop="colorKey"
|
|
|
+ width="240"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ label-width="0px"
|
|
|
+ :prop="'productInfoList.' + scope.$index + '.colorKey'"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ clearable
|
|
|
+ v-model="scope.row.colorKey"
|
|
|
+ multiple
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in colorList"
|
|
|
+ :key="item.label"
|
|
|
+ :value="item.label"
|
|
|
+ :label="item.label"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="生产编号"
|
|
|
align="center"
|
|
|
@@ -552,6 +612,7 @@
|
|
|
import dayjs from 'dayjs';
|
|
|
import { multiply } from '@/utils/math';
|
|
|
import contactDialog from '@/components/contactDialog/openContactDialog.vue';
|
|
|
+ import { getByCode } from '@/api/system/dictionary-data';
|
|
|
export default {
|
|
|
name: 'CreateOrder',
|
|
|
components: {
|
|
|
@@ -644,7 +705,9 @@
|
|
|
],
|
|
|
selectIndex: 0, // 选择工艺路线的当前数据下标
|
|
|
processingRequired: 0, // 生产类型跟BOM 版本是否必填 1:是 0:否
|
|
|
- sourceSalesOrderId: '' // 源销售订单ID
|
|
|
+ sourceSalesOrderId: '', // 源销售订单ID
|
|
|
+ modelList: [], // 机型数据
|
|
|
+ colorList: [] // 颜色数据
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -693,8 +756,34 @@
|
|
|
mounted() {
|
|
|
this.mandatoryField();
|
|
|
this.getFactoryList();
|
|
|
+ this.getCodeData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取
|
|
|
+ async getCodeData() {
|
|
|
+ let arr1 = await this.getLevelCode('product_model_key');
|
|
|
+ let arr2 = await this.getLevelCode('product_color_key');
|
|
|
+ this.modelList = arr1;
|
|
|
+ this.colorList = arr2;
|
|
|
+ },
|
|
|
+ async getLevelCode(code) {
|
|
|
+ try {
|
|
|
+ const res = await getByCode(code);
|
|
|
+ if (res.code == 0) {
|
|
|
+ let list = Object.values(res.data).map((el) => {
|
|
|
+ let k = Object.keys(el)[0];
|
|
|
+ let v = Object.values(el)[0];
|
|
|
+ return {
|
|
|
+ label: v,
|
|
|
+ value: k
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ this.$message.error(err.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 是否必填
|
|
|
mandatoryField() {
|
|
|
parameterGetByCode({
|
|
|
@@ -786,20 +875,6 @@
|
|
|
});
|
|
|
await Promise.all(promiseProduct);
|
|
|
// // 如果没有bom版本的选择的话
|
|
|
- // this.disabledList.forEach((item, index) => {
|
|
|
- // if (item.bomVersionList && item.bomVersionList.length > 0) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // let productType = item.productType;
|
|
|
- // let list = item.producedList;
|
|
|
- // if (!productType && list && list.length > 0) {
|
|
|
- // productType = list[0].code;
|
|
|
- // }
|
|
|
- // if (!productType) {
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.changeProductType(item, index);
|
|
|
- // });
|
|
|
});
|
|
|
},
|
|
|
// 获取bom信息
|
|
|
@@ -823,13 +898,6 @@
|
|
|
// this.$set(data, 'producedList', arr);
|
|
|
data.producedList = arr;
|
|
|
console.log(arr, 'arr');
|
|
|
- // if (!data.productType || !data.bomCategoryId) {
|
|
|
- // this.$set(data, 'productType', arr[0].code);
|
|
|
- // console.log(333333);
|
|
|
- // this.changeProductType(data, index);
|
|
|
- // }
|
|
|
- // console.log(data, 'data');
|
|
|
- // data.producedList = arr;
|
|
|
},
|
|
|
|
|
|
cancel() {
|
|
|
@@ -963,6 +1031,7 @@
|
|
|
let flag = this.parameterVerification();
|
|
|
// 必填参数校验
|
|
|
if (!flag) return;
|
|
|
+ console.log(this.form, '33333333333');
|
|
|
this.loading = true;
|
|
|
let params = {
|
|
|
...this.form,
|