|
@@ -104,6 +104,31 @@
|
|
|
:data="tableData"
|
|
|
:width="tableWidth"
|
|
|
>
|
|
|
+ <template slot-scope="{ index }" slot="product_id">
|
|
|
+ <div>
|
|
|
+ <Select
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ v-if="type != 3"
|
|
|
+ label-in-value
|
|
|
+ v-model="tableData[index].product_id"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="item of productList"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.title"
|
|
|
+ ></Option>
|
|
|
+ </Select>
|
|
|
+ <span v-else>{{
|
|
|
+ productList.length > 0 && tableData[index].product_id
|
|
|
+ ? productList.filter(
|
|
|
+ (item) => item.id == tableData[index].product_id
|
|
|
+ )[0].title
|
|
|
+ : ""
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template slot-scope="{ index }" slot="spare_parts">
|
|
|
<Input
|
|
|
v-if="type != 3"
|
|
@@ -439,13 +464,20 @@ export default {
|
|
|
label:[{title:'是',id:1},{title:'否',id:0}],
|
|
|
tableColums: [
|
|
|
{
|
|
|
+ title: "产品名称",
|
|
|
+ align: "center",
|
|
|
+ key: "product_id",
|
|
|
+ slot: "product_id",
|
|
|
+ resizable: true,
|
|
|
+ width: 150,
|
|
|
+ },
|
|
|
+ {
|
|
|
title: "零部件名称",
|
|
|
align: "center",
|
|
|
key: "spare_parts",
|
|
|
slot: "spare_parts",
|
|
|
resizable: true,
|
|
|
width: 150,
|
|
|
- fixed: "left",
|
|
|
},
|
|
|
{
|
|
|
title: "物料名称",
|
|
@@ -640,6 +672,8 @@ export default {
|
|
|
],
|
|
|
productTypes: [],
|
|
|
nowSelectObj: {},
|
|
|
+ //产品名称列表
|
|
|
+ productList:[],
|
|
|
// 木板列表
|
|
|
materialWoodList: [],
|
|
|
// 木皮列表
|
|
@@ -671,6 +705,9 @@ export default {
|
|
|
this.axios("/api/material", { params: { sub_type_id: 1 } }).then((res) => {
|
|
|
this.materialWoodList = res.data.data;
|
|
|
});
|
|
|
+ this.axios("/api/product").then(res=>{
|
|
|
+ this.productList = res.data.data
|
|
|
+ });
|
|
|
this.axios("/api/material", { params: { sub_type_id: 2 } }).then((res) => {
|
|
|
this.materialWoodSkinList = res.data.data;
|
|
|
});
|
|
@@ -754,6 +791,9 @@ export default {
|
|
|
: (sendData.top[i] = postInfo[i]);
|
|
|
}
|
|
|
sendData.detail = [...this.tableData, ...this.metalsTableData];
|
|
|
+ sendData.detail.map(v=>{
|
|
|
+ delete v.product_title
|
|
|
+ })
|
|
|
this.axios.post("/api/parts_save", sendData).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.$Message.success(res.msg);
|