mushencc před 3 roky
rodič
revize
12af959197

+ 41 - 1
src/views/PartsMannage/edit.vue

@@ -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);

+ 7 - 7
src/views/ProductMannage/index.vue

@@ -178,16 +178,16 @@
             <span style="padding-right:10px"
               >默认部件:{{ defaultPart.title }}</span
             >
-            <span
-              >高:<Input v-model="defaultPart.formula_l" style="width:50px"
+            <span style="margin-right:10px"
+              >高:<Input v-model="defaultPart.formula_l" style="width:50px" disabled
             /></span>
-            <span
-              >宽:<Input v-model="defaultPart.formula_w" style="width:50px"
+            <span style="margin-right:10px"
+              >宽:<Input v-model="defaultPart.formula_w" style="width:50px" disabled
             /></span>
-            <span
-              >厚:<Input v-model="defaultPart.formula_h" style="width:50px"
+            <span style="margin-right:10px"
+              >厚:<Input v-model="defaultPart.formula_h" style="width:50px" disabled
             /></span>
-            <span>是否为空: <vxe-switch v-model="defaultPart.is_null"></vxe-switch> </span>
+            <span>是否为空: <vxe-switch v-model="defaultPart.is_null" disabled></vxe-switch> </span>
           </div>
           <div class="show_modal_content_right_top">
             <Button type="primary" @click="handleAddChangeable"