Przeglądaj źródła

Merge branch 'master' of 121.41.102.225:Nidong/jiufang into hw

mushencc 3 lat temu
rodzic
commit
d1a57a62e6

+ 6 - 4
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="BidSystemProductDeOrderDeorderdetail">
-    <Toptitle :title="type == 1 ? '拆单编辑' : '拆单详情'">
+    <Toptitle
+      :title="type == 1 ? '拆单编辑' : type == 2 ? '拆单详情' : '拆单变更'"
+    >
       <slot name="titleButton">
         <Button
           @click="goback()"
@@ -12,10 +14,10 @@
         <Button
           @click="postData()"
           type="primary"
-          v-if="type == 1"
+          v-if="type != 2"
           ghost
           style="margin-right: 10px"
-          >保存</Button
+          >{{ type == 3 ? "变更完成" : "保存" }}</Button
         >
       </slot>
     </Toptitle>
@@ -1984,7 +1986,7 @@ export default {
       // });
     },
     setRadioChange(parent, child, index, parts, cld) {
-      if (this.type == 1) {
+      if (this.type != 2) {
         cld.forEach((element) => {
           element.list.forEach((elem) => {
             elem.id != child.id && (elem.show = false);

+ 8 - 3
src/views/BidSystem/ProductDeOrder/detail.vue

@@ -160,6 +160,12 @@
               @click="handleSet(row, index, 1)"
               >拆单</a
             >
+            <a
+              :disabled="row.explode_status == 0"
+              style="margin:0 5px"
+              @click="handleSet(row, index, 3)"
+              >变更</a
+            >
             <a style="margin:0 5px" @click="handleSet(row, index, 2)">详情</a>
           </template>
         </Table>
@@ -399,9 +405,8 @@ export default {
           title: "操作",
           key: "name",
           align: "center",
-          width: "120",
           slot: "set",
-          minWidth: 80,
+          minWidth: 170,
           // fixed: "right",
           resizable: true,
         },
@@ -551,7 +556,7 @@ export default {
         // });
       });
     },
-    // 1拆单  2详情
+    // 1拆单  2详情   3变更
     handleSet(row, index, type) {
       this.$router.push({
         path: "/cms/BidSystem/ProductDeOrder/deorderdetail",

+ 7 - 2
src/views/BidSystem/ProductDeOrder/list.vue

@@ -70,6 +70,12 @@
             @click="handleSet(row, index, 2)"
             >拆单</a
           >
+          <a
+            style="margin: 0 5px"
+            :disabled="row.sub_status == 3"
+            @click="handleSet(row, index, 2)"
+            >变更</a
+          >
           <a style="margin: 0 5px" @click="handleSet(row, index, 3)">详情</a>
           <a
             style="margin: 0 5px;"
@@ -253,8 +259,7 @@ export default {
           key: "set",
           slot: "set",
           fixed: "right",
-          minWidth: 300,
-          fixed: "right",
+          minWidth: 320,
         },
       ],
       tableData: [],

+ 209 - 140
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -499,6 +499,7 @@
         <vxe-grid
           border
           resizable
+          ref="grid"
           align="center"
           :edit-config="{ trigger: 'dblclick', mode: 'row', autoClear: false }"
           :columns="tableColumn"
@@ -532,8 +533,9 @@
             </Select>
           </template>
 
-          <template #material_title_default="{ row }">
+          <template #part_default="{ row }">
             <div
+              class="my-part"
               v-for="part_detail in row.part"
               :key="part_detail.order_product_part_id"
               v-show="!part_detail.is_metal"
@@ -542,6 +544,45 @@
               {{ part_detail.title }}
             </div>
           </template>
+          <template #part_edit="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+              style="border-bottom:1px solid #e8eaec;padding:10px 0"
+            >
+              <Select
+                filterable
+                clearable
+                transfer
+                label-in-value
+                v-model="part_detail.change_id"
+              >
+                <Option
+                  v-for="ch in part_detail.change"
+                  :key="ch.id"
+                  :label="ch.part_title"
+                  :value="ch.id"
+                />
+              </Select>
+            </div>
+          </template>
+          <template #material_title_default="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+            >
+              <div
+                v-for="(sub_part_detail, idx) in part_detail.sub_part"
+                :key="idx"
+                v-show="sub_part_detail.title.indexOf('线条') > 0"
+                style="border-bottom:1px solid #e8eaec;padding:10px 0"
+              >
+                {{ sub_part_detail.title }}
+              </div>
+            </div>
+          </template>
           <template #material_title_edit="{ row }">
             <div
               v-for="part_detail in row.part"
@@ -552,6 +593,64 @@
               {{ part_detail.title }}
             </div>
           </template>
+          <template #material_measure_default="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+            >
+              <div
+                v-for="(sub_part_detail, idx) in part_detail.sub_part"
+                :key="idx"
+                v-show="sub_part_detail.title.indexOf('线条') > 0"
+                style="border-bottom:1px solid #e8eaec;padding:10px 0"
+              >
+                {{ sub_part_detail.title }}
+              </div>
+            </div>
+          </template>
+          <template #material_measure_edit="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+              style="border-bottom:1px solid #e8eaec;padding:10px 0"
+            >
+              {{ part_detail.title }}
+            </div>
+          </template>
+
+          <template #material_num_default="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+            >
+              <div
+                v-for="(sub_part_detail, idx) in part_detail.sub_part"
+                :key="idx"
+                v-show="sub_part_detail.title.indexOf('线条') > 0"
+                style="border-bottom:1px solid #e8eaec;padding:10px 0"
+              >
+                {{ sub_part_detail.title }}
+              </div>
+            </div>
+          </template>
+          <template #material_num_edit="{ row }">
+            <div
+              v-for="part_detail in row.part"
+              :key="part_detail.order_product_part_id"
+              v-show="!part_detail.is_metal"
+              style="border-bottom:1px solid #e8eaec;padding:10px 0"
+            >
+              {{ part_detail.title }}
+            </div>
+          </template>
+          <template #remark_default="{ row }">
+            {{ row.remark }}
+          </template>
+          <template #remark_edit="{ row }"> </template>
+
           <template #set_default="{ row,rowIndex }">
             <a @click="handleSet(row, rowIndex, 4)" style="margin: 0 5px"
               >复制</a
@@ -568,7 +667,6 @@
           resizable
           border
           ref="xTree"
-          :edit-config="{ trigger: 'dblclick', mode: 'row' }"
           :data="tableData"
         >
           <vxe-table-column
@@ -576,51 +674,6 @@
             title="位置"
             align="center"
             min-width="80"
-            :edit-render="{
-              name: '$input',
-              props: {
-                clearable: true,
-              },
-              events: { input: handleTablePositionChange },
-            }"
-          ></vxe-table-column>
-          <vxe-table-column
-            field="title"
-            title="产品名称"
-            align="center"
-            min-width="120"
-            :edit-render="{
-              name: '$select',
-              options: productList,
-              props: {
-                clearable: true,
-                optionProps: {
-                  label: 'title',
-                  value: 'id',
-                },
-              },
-              events: { change: handleTableProductSelect },
-            }"
-          ></vxe-table-column>
-          <vxe-table-column
-            v-for="(bpp, idx) in bpp_list"
-            :key="bpp.name"
-            field="procedure_properties"
-            :title="bpp.name"
-            align="center"
-            min-width="120"
-            :edit-render="{
-              name: '$select',
-              options: bpp.cld,
-              props: {
-                clearable: true,
-                optionProps: {
-                  label: 'title',
-                  value: 'id',
-                },
-              },
-              events: { change: handleTableProductSelect },
-            }"
           ></vxe-table-column>
           <vxe-table-column
             field="unit"
@@ -2068,6 +2121,43 @@ export default {
         ...tempHeader,
         ...tempMeasure,
         {
+          title: "部件",
+          align: "center",
+          minWidth: "200",
+          editRender: { autofocus: ".my-part" },
+          slots: {
+            default: "part_default",
+            edit: "part_edit",
+          },
+        },
+        {
+          title: "原材料名称",
+          align: "center",
+          minWidth: "200",
+          slots: {
+            default: "material_title_default",
+            edit: "material_title_edit",
+          },
+        },
+        {
+          title: "原材料规格",
+          align: "center",
+          minWidth: "200",
+          slots: {
+            default: "material_measure_default",
+            edit: "material_measure_edit",
+          },
+        },
+        {
+          title: "原材料数量",
+          align: "center",
+          minWidth: "200",
+          slots: {
+            default: "material_num_default",
+            edit: "material_num_edit",
+          },
+        },
+        {
           field: "total_num",
           title: "数量",
           align: "center",
@@ -2077,7 +2167,6 @@ export default {
             props: {
               clearable: true,
             },
-            // events: { input: this.handleTablePositionChange },
           },
         },
         {
@@ -2087,16 +2176,6 @@ export default {
           minWidth: "70",
         },
         {
-          field: "",
-          title: "原材料名称",
-          align: "center",
-          minWidth: "200",
-          slots: {
-            default: "material_title_default",
-            edit: "material_title_edit",
-          },
-        },
-        {
           field: "num",
           title: "核算数量",
           align: "center",
@@ -2138,11 +2217,10 @@ export default {
           title: "备注",
           align: "center",
           minWidth: "120",
-          editRender: {
-            name: "$input",
-            props: {
-              clearable: true,
-            },
+          editRender: { autofocus: ".my-remark" },
+          slots: {
+            default: "remark_default",
+            edit: "remark_edit",
           },
         },
         {
@@ -2359,18 +2437,6 @@ export default {
         }
       });
     },
-    // 表格的一些方法
-    // 表格选择产品
-    handleTableProductSelect(obj, $event) {
-      console.log("obj :>> ", obj);
-      console.log("$event :>> ", $event);
-      $event.value &&
-        this.axios("/api/order_get_product_detail_new", {
-          params: { product_id: $event.value, custom_id: this.info.custom_id },
-        }).then((res) => {
-          console.log("res :>> ", res);
-        });
-    },
     // 表格位置选择
     handleTablePositionChange(obj, $event) {
       console.log("obj :>> ", obj);
@@ -3318,6 +3384,7 @@ export default {
     },
     handleShowEditProductModal(custom_id, route_id_at_copyrow) {},
     handleSet(row, index, type) {
+      console.log('row :>> ', row);
       let obj;
       // 1 新增 2 编辑 3 删除 4复制  5详情
       switch (type) {
@@ -3783,7 +3850,6 @@ export default {
           row.ext_price = res.data.ext_price || 0;
           row.unit_price = res.data.price || 0;
           row.num = res.data.num || 1;
-          row.num = res.data.num;
           row.over_price = res.data.over_price || 0;
           row.position = res.data.position || "";
           row.unit = res.data.unit || "";
@@ -3807,6 +3873,7 @@ export default {
               // 选择不是线条、或者基础档案中要默认为空的部件
               element.isBP = true;
               element.isChoosed = true;
+              element.title = element.part_title;
               if (element.is_null == 1) {
                 element.change_id = "";
               } else {
@@ -3845,70 +3912,72 @@ export default {
               }
             }
           });
-          //测量字段
-          row.measure = res.data.measure;
-          row.measure.forEach((element) => {
-            element.value = "";
-            element.measureCalc = element.e_title;
-          });
-          //工艺属性
-          row.process = [];
-          this.axios({
-            method: "get",
-            url: "/api/bpp_list",
-          }).then((re) => {
-            re.data.forEach((element) => {
-              for (const key in res.data.process.title) {
-                const ele = res.data.process.title[key];
-                if (element.name == ele) {
-                  const compare = res.data.process.list.filter(
-                    (item) => item.detail[key] == this.pre_process_obj[key]
-                  );
-                  row.procedure_properties = [];
-                  if (compare.length > 0) {
-                    row.procedure_properties.push(
-                      this.pre_process_obj[key] * 1
-                    );
-                    row.process.push({
-                      key: key,
-                      title: ele,
-                      value: this.pre_process_obj[key] * 1,
-                      processList: element.cld,
-                    });
-                  } else {
-                    row.procedure_properties.push("");
-                    row.process.push({
-                      key: key,
-                      title: ele,
-                      value: "",
-                      processList: element.cld,
-                    });
-                  }
-                }
-              }
-            });
-            row.part.forEach((element) => {
-              if (!element.is_metal) {
-                //赋值默认工艺属性
-                element.process = JSON.parse(JSON.stringify(re.data));
-                element.process.forEach((elem, index) => {
-                  for (const key in res.data.process.title) {
-                    const ele = res.data.process.title[key];
-                    if (elem.name == ele) {
-                      elem.procedure_property = this.pre_process_obj[key] * 1;
-                      elem.process_id = key;
-                      if (!element.procedure_properties) {
-                        element.procedure_properties = [];
-                      }
-                      element.procedure_properties[index] =
-                        this.pre_process_obj[key] * 1;
-                    }
-                  }
-                });
-              }
-            });
-            this.$forceUpdate();
-          });
+          // //测量字段
+          // row.measure = res.data.measure;
+          // row.measure.forEach((element) => {
+          //   element.value = "";
+          //   element.measureCalc = element.e_title;
+          // });
+          // //工艺属性
+          // row.process = [];
+          // this.axios({
+          //   method: "get",
+          //   url: "/api/bpp_list",
+          // }).then((re) => {
+          //   re.data.forEach((element) => {
+          //     for (const key in res.data.process.title) {
+          //       const ele = res.data.process.title[key];
+          //       if (element.name == ele) {
+          //         const compare = res.data.process.list.filter(
+          //           (item) => item.detail[key] == this.pre_process_obj[key]
+          //         );
+          //         row.procedure_properties = [];
+          //         if (compare.length > 0) {
+          //           row.procedure_properties.push(
+          //             this.pre_process_obj[key] * 1
+          //           );
+          //           row.process.push({
+          //             key: key,
+          //             title: ele,
+          //             value: this.pre_process_obj[key] * 1,
+          //             processList: element.cld,
+          //           });
+          //         } else {
+          //           row.procedure_properties.push("");
+          //           row.process.push({
+          //             key: key,
+          //             title: ele,
+          //             value: "",
+          //             processList: element.cld,
+          //           });
+          //         }
+          //       }
+          //     }
+          //   });
+          //   row.part.forEach((element) => {
+          //     if (!element.is_metal) {
+          //       //赋值默认工艺属性
+          //       element.process = JSON.parse(JSON.stringify(re.data));
+          //       element.process.forEach((elem, index) => {
+          //         for (const key in res.data.process.title) {
+          //           const ele = res.data.process.title[key];
+          //           if (elem.name == ele) {
+          //             elem.procedure_property = this.pre_process_obj[key] * 1;
+          //             elem.process_id = key;
+          //             if (!element.procedure_properties) {
+          //               element.procedure_properties = [];
+          //             }
+          //             element.procedure_properties[index] =
+          //               this.pre_process_obj[key] * 1;
+          //           }
+          //         }
+          //       });
+          //     }
+          //   });
+          console.log("row :>> ", row);
+          // this.tableData.splice(rowIndex,1,row)
+          // this.$forceUpdate();
+          // });
         });
       }
       // row.part=[]

+ 3 - 3
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue

@@ -16,6 +16,9 @@
       :total="total"
     >
       <div slot="titleButton">
+        <Button @click="back" type="primary" ghost style="margin-right: 10px"
+          >返回</Button
+        >
         <Button
           type="primary"
           ghost
@@ -23,9 +26,6 @@
           @click="openMeasureModal(selects)"
           >修改尺寸</Button
         >
-        <Button @click="back" type="primary" ghost style="margin-right: 10px"
-          >返回</Button
-        >
         <Button
           type="primary"
           ghost