Andy 4 years ago
parent
commit
0d5a9552d5

+ 38 - 9
src/views/BidSystem/ContractList/edit.vue

@@ -10,6 +10,19 @@
       "
     >
       <slot name="titleButton">
+        <Upload
+          style="display:inline"
+          name="your_file"
+          :show-upload-list="false"
+          :headers="headers"
+          :on-error="uploadError"
+          :on-success="uploadSuccess"
+          :action="$store.state.ip + '/api/order_area_simple_import'"
+        >
+          <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
+            >导入</Button
+          >
+        </Upload>
         <Button
           @click="showForms = true"
           type="primary"
@@ -478,7 +491,7 @@
             <a
               style="margin: 0 5px; color: red"
               v-show="$route.query.type != 3"
-              @click="handleSet(row, index, 4, areaItem.product)"
+              @click="handleSet(row, index, 4, areaItem.product, areaIndex)"
               >删除</a
             >
           </template>
@@ -1033,7 +1046,9 @@
         </div>
       </div>
       <div class="modal-footer" slot="footer">
-        <Button @click="showPDTEditModal = false">取消</Button>
+        <Button style="margin-right:10px" @click="showPDTEditModal = false"
+          >取消</Button
+        >
         <Button type="primary" @click="handlePDTEditConfirm">确认</Button>
       </div>
     </el-dialog>
@@ -1518,6 +1533,7 @@ export default {
           title: "备注",
         },
       ],
+      headers: { Authorization: localStorage.getItem("token") },
       productSetTableData: [
         {
           is_show: true,
@@ -2160,12 +2176,10 @@ export default {
           //   }
           // }
           if (this.PDTEdit.type_id) {
-            this.axios("/api/basics_product_index", {
-              params: { type_id: this.PDTEdit.type_id },
+            this.axios("/api/basics_product_detail", {
+              params: { id: this.PDTEdit.type_id },
             }).then((res) => {
-              this.PDTEdit.tempPDTTypeList = res.data.data[0].measure_id.split(
-                ","
-              );
+              this.PDTEdit.tempPDTTypeList = res.data.measure_id;
               this.PDTEdit.tempMeasureList = JSON.parse(
                 JSON.stringify(this.measureList)
               );
@@ -2179,16 +2193,20 @@ export default {
                 // this.PDTEdit[el.e_title] = "";
               });
               this.PDTEdit = JSON.parse(JSON.stringify(this.PDTEdit));
-              this.$forceUpdate();
             });
           }
           this.showPDTEditModal = true;
           break;
         case 4:
+          console.log("table :>> ", table);
+          console.log("index :>> ", index);
           table.splice(index, 1);
-          this.$forceUpdate();
+          this.formData.list[areaIndex].product = JSON.parse(
+            JSON.stringify(table)
+          );
           break;
       }
+      this.$forceUpdate();
     },
     //新增产品复制
     handleAddPDTCopy(item, index) {
@@ -2607,6 +2625,17 @@ export default {
     goback() {
       this.$router.go(-1);
     },
+    uploadSuccess(res) {
+      if (res.code == 200) {
+        this.$Message.success(res.msg || "上传成功");
+      } else {
+        this.$Message.warning(res.msg || "上传失败");
+      }
+      this.getData(this.proxyObj);
+    },
+    uploadError(err) {
+      this.$Message.error(err.msg || "上传失败");
+    },
     looks(img) {
       const array = [{ img_url: img }];
       this.$previewImg({

+ 59 - 45
src/views/BidSystem/DeepeningOrder/detail.vue

@@ -3,7 +3,13 @@
     <Toptitle :title="type == 2 ? '深化单编辑' : '深化单详情'">
       <slot name="titleButton">
         <Button
-          @click="handleFinish()"
+          @click="handleFinish(0)"
+          type="primary"
+          style="margin-right: 10px"
+          >取消完成</Button
+        >
+        <Button
+          @click="handleFinish(1)"
           type="primary"
           style="margin-right: 10px"
           >完成</Button
@@ -230,12 +236,11 @@
                     @click="handleSet(row, index, 2, item)"
                     >详情</a
                   >
-                  <!-- <a
-                style="margin:0 5px"
-                :disabled="isChecked"
-                @click="handleSet(row, index, 3, item)"
-                >删除</a
-              > -->
+                  <a
+                    style="margin:0 5px"
+                    @click="handleSet(row, index, 3, item)"
+                    >删除</a
+                  >
                 </template>
               </Table>
             </div>
@@ -441,7 +446,7 @@
               >
               <a
                 style="margin: 0 5px"
-                @click="handleSet(row, index, 4, formData)"
+                @click="handleSet(row, index, 2, formData)"
                 >详情</a
               >
             </template>
@@ -744,7 +749,9 @@
         </div>
       </div>
       <div class="modal-footer" slot="footer">
-        <Button style="margin-right:10px" @click="showPDTModal = false">取消</Button>
+        <Button style="margin-right:10px" @click="showPDTModal = false"
+          >取消</Button
+        >
         <Button type="primary" @click="handleAddPDTConfirm">确认</Button>
       </div>
     </el-dialog>
@@ -1087,7 +1094,7 @@ export default {
         this.getListData();
       }
     },
-    handleFinish() {
+    handleFinish(status) {
       if (this.selected.length < 1) {
         this.$Message.warning("请选择数据");
       } else {
@@ -1102,6 +1109,7 @@ export default {
               method: "post",
               url: "/api/order_area_product_status",
               data: {
+                status,
                 order_area_product_id,
               },
             }).then((res) => {
@@ -1260,7 +1268,7 @@ export default {
             key: "remark",
             align: "center",
             slot: "set",
-            minWidth: 120,
+            minWidth: 160,
           },
         ];
         // 订单特殊字段
@@ -1507,40 +1515,46 @@ export default {
     },
     // 1深化 2详情
     handleSet(row, index, type, item) {
-      if (type == 3) {
-        this.$Modal.confirm({
-          title: "确认删除?",
-          content: "此操作确认后不可恢复,请确认!",
-          onOk: () => {
-            this.axios({
-              method: "post",
-              url: "/api/order_area_deep_del",
-              data: {
-                id: row.id,
-              },
-            }).then((res) => {
-              if (res.code == 200) {
-                this.$Message.success(res.msg);
-                this.initData(
-                  this.formData.order_no,
-                  this.tempPDTIndex,
-                  this.oa_id
-                );
-              }
-            });
-          },
-          onCancel: () => {},
-        });
-      } else {
-        this.$router.push({
-          path: "/cms/BidSystem/DeepeningOrder/edit",
-          query: {
-            type,
-            order_no: this.formData.order_no,
-            order_area_id: item.id,
-            order_area_product_id: row.id ? row.id : row.order_area_product_id,
-          },
-        });
+      switch (type) {
+        case 1:
+        case 2:
+          this.$router.push({
+            path: "/cms/BidSystem/DeepeningOrder/edit",
+            query: {
+              type,
+              order_no: this.formData.order_no,
+              order_area_id: item.id,
+              order_area_product_id: row.id
+                ? row.id
+                : row.order_area_product_id,
+            },
+          });
+          break;
+        case 3:
+          this.$Modal.confirm({
+            title: "确认删除?",
+            content: "此操作确认后不可恢复,请确认!",
+            onOk: () => {
+              this.axios({
+                method: "post",
+                url: "/api/order_deep_product_del",
+                data: {
+                  order_area_product_id: row.id,
+                },
+              }).then((res) => {
+                if (res.code == 200) {
+                  this.$Message.success(res.msg);
+                  this.initData(
+                    this.formData.order_no,
+                    this.tempPDTIndex,
+                    this.oa_id
+                  );
+                }
+              });
+            },
+            onCancel: () => {},
+          });
+          break;
       }
     },
     // 删除工艺属性

+ 33 - 28
src/views/BidSystem/DeepeningOrder/edit.vue

@@ -284,36 +284,39 @@
                    placeholder="图纸" /> -->
             <div class="product-img">
               <div class="product-add">
-                <div
-                  class="items"
-                  v-for="(_item, _index) of tableData[index].url"
-                  :key="_index"
-                >
+                <div class="items">
                   <img
-                    @click="looks(_item)"
+                    @click="looks(tableData[index].url)"
                     v-for="(el, idx) in tableData[index].url"
                     :key="idx"
                     :src="$store.state.ip + el"
                     alt=""
                   />
+                </div>
+                <template style="flex">
                   <Icon
-                    size="20"
+                    size="50"
                     v-show="type == 1"
-                    @click="delItems(_index, tableData[index].url)"
-                    class="delete-img"
-                    type="ios-close-circle"
+                    @click="
+                      delItems(
+                        tableData[index].url.length - 1,
+                        tableData[index].url
+                      )
+                    "
+                    class="add-items"
+                    type="ios-remove"
                   />
-                </div>
-                <div class="add-items" v-if="type == 1">
-                  <div class="_item">
-                    <Icon size="50" type="ios-add" />
+                  <div class="add-items" v-if="type == 1">
+                    <div class="_item">
+                      <Icon size="50" type="ios-add" />
+                    </div>
+                    <input
+                      @change="changeIpt($event, tableData[index])"
+                      type="file"
+                      class="ipt"
+                    />
                   </div>
-                  <input
-                    @change="changeIpt($event, tableData[index])"
-                    type="file"
-                    class="ipt"
-                  />
-                </div>
+                </template>
               </div>
             </div>
           </template>
@@ -443,7 +446,7 @@ export default {
           title: "楼栋",
           key: "house",
           align: "center",
-          width:80,
+          width: 80,
           slot: "houseSet",
           resizable: true,
         },
@@ -475,7 +478,7 @@ export default {
           title: "产品分类",
           key: "title",
           align: "center",
-         width:140,
+          width: 140,
           slot: "type_titleSet",
           resizable: true,
         },
@@ -735,8 +738,12 @@ export default {
         el.index = index + 1;
       });
     },
-    looks(img) {
-      const array = [{ img_url: img }];
+    looks(arr) {
+      // const array = [{ img_url: img }];
+      const array = arr.map((v) => {
+        return { img_url: v };
+      });
+      console.log("array :>> ", array);
       this.$previewImg({
         list: array,
         baseUrl: this.$store.state.ip,
@@ -759,9 +766,7 @@ export default {
         row.url.push(res.data.url);
       });
     },
-    handleTypeTitleChange(e){
-
-    }
+    handleTypeTitleChange(e) {},
   },
   // 监听属性 类似于data概念
   computed: {},
@@ -818,6 +823,7 @@ export default {
   }
   .product-add {
     display: flex;
+    justify-content: center;
     flex-wrap: wrap;
     .ipt {
       position: absolute;
@@ -861,7 +867,6 @@ export default {
       justify-content: center;
       align-items: center;
       background: #e7e7e7;
-      margin-right: 10px;
       border-radius: 5px;
       position: relative;
       img {

+ 6 - 4
src/views/BidSystem/DeepeningOrder/info.vue

@@ -443,13 +443,13 @@
               ></Option>
             </Select> -->
           </template>
-          <!-- <template slot="supSet" slot-scope="{ row, index }">
-            <a
+          <template slot="supSet" slot-scope="{ row, index }">
+            <!-- <a
               style="margin: 0 5px; color: red"
               @click="handleSupSet(row, index)"
               >删除</a
-            >
-          </template> -->
+            > -->
+          </template>
         </Table>
       </div>
       <div class="modal-footer" slot="footer">
@@ -1499,6 +1499,8 @@ export default {
             order_no: this.$route.query.order_no,
             ...this.searchData,
             type: 2,
+            page_index:this.page_index,
+            page_size:this.page_size,
             oa_id: this.oa_id,
           },
         })

+ 2 - 2
src/views/BidSystem/DeepeningOrder/list.vue

@@ -236,9 +236,9 @@ export default {
           title: "下单日期",
           align: "center",
           key: "crt_time",
-          minWidth: 150,
+          minWidth: 200,
           render: (h, params) =>
-            h("span", {}, this.func.replaceDateNoHMS(params.row.crt_time)),
+            h("span", {}, this.func.replaceDate(params.row.crt_time)),
         },
         {
           title: "操作",

+ 148 - 120
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -192,7 +192,7 @@
               placeholder="请输入单位"
             />
           </FormItem>
-          <FormItem label="工艺组合名称:">
+          <!-- <FormItem label="工艺组合名称:">
             <Select
               v-model="partsItem.processCombination"
               size="small"
@@ -213,8 +213,8 @@
               >
               </Option>
             </Select>
-          </FormItem>
-          <FormItem label="工艺价格:">
+          </FormItem> -->
+          <!-- <FormItem label="工艺价格:">
             <Input
               type="text"
               size="small"
@@ -223,7 +223,7 @@
               style="width: 150px"
               placeholder="请输入工艺价格"
             />
-          </FormItem>
+          </FormItem> -->
           <FormItem label="高:">
             <Input
               type="text"
@@ -268,10 +268,45 @@
               placeholder="请输入产值比"
             />
           </FormItem>
+          <FormItem
+            v-for="item of partsItem.ProcessAttrList"
+            :key="item.id"
+            :label="(item.name || item.title) + ':'"
+          >
+            <Select
+              v-model="item.selected_value"
+              size="small"
+              clearable
+              filterable
+              :disabled="type == 2"
+              @on-change="(e) => handlePartsNameSelect(partsItem, e)"
+              style="width: 150px"
+            >
+              <OptionGroup
+                v-for="OptionGroup in item.cld"
+                :key="OptionGroup.type_title"
+                :label="OptionGroup.type_title"
+              >
+                <Option
+                  v-for="Option in OptionGroup.list"
+                  :value="Option.id"
+                  :key="Option.id"
+                  >{{ Option.title }}</Option
+                >
+              </OptionGroup>
+              <Option
+                v-for="sitem in item.partsNameList"
+                :key="sitem.id"
+                :label="sitem.title"
+                :value="sitem.id"
+              >
+              </Option>
+            </Select>
+          </FormItem>
         </Form>
       </div>
       <div class="parts_content">
-        <span>工艺属性:</span>
+        <!-- <span>工艺属性:</span>
         <div
           class="hierarchy"
           v-for="(item, index) of partsItem.ProcessAttrList"
@@ -283,8 +318,6 @@
             class="radio-g"
             :key="_item.type_title"
           >
-            <!-- v-show="_item.display" -->
-            <!-- v-show="_item.list && _item.list.length > 0" -->
             <div class="tit_box">
               <span :class="['box-us']" @click="setBoxChange(item, _item)">{{
                 _item.type_title
@@ -303,35 +336,24 @@
               </div>
             </div>
           </div>
-          <!-- <div class="radio-g">
-            <div @click="setRadioChange(item, _item, index, partsItem)"
-                 :class="[ 
-                'radio-us',
-                _item.show ? 'radio-us-foc' : '',
-                _item.display ? 'radio-us-none' : '',
-              ]"
-                 v-for="_item of item.cld"
-                 :key="_item.id">
-              {{ _item.title }}
-            </div>
-          </div> -->
-        </div>
-        <div style="padding: 10px 0">
-          <span>工艺路线:</span>
-          <Tooltip max-width="200px">
-            <div
-              slot="content"
-              v-show="!partsItem.isAddProcessRoute || type == 2"
-            >
-              若要编辑工艺路线,请先选择或更改工艺组合
-            </div>
+        </div> -->
+        <div style="display:flex;justify-content: space-between;">
+          <div style="padding: 10px 0">
+            <span>工艺路线:</span>
             <Button
               :disabled="!partsItem.isAddProcessRoute || type == 2"
               @click="editRouter(partsItem, partsIndex)"
               >选择工艺路线</Button
             >
             {{ partsItem.process_name }}
-          </Tooltip>
+          </div>
+          <div style="padding: 10px 0">
+            <Button
+              type="primary"
+              @click="handleProcessLineShow(partsItem, partsIndex)"
+              >{{ partsItem.isShowProcessLine ? "收起" : "展开" }}</Button
+            >
+          </div>
         </div>
 
         <div class="parts_content_lineTable">
@@ -340,18 +362,21 @@
             border
             :data="partsItem.partsProcessLineTableData"
           >
-            <!-- <template slot="processLineSet" slot-scope="{ row, index }">
-              <a
-                :style="
-                  type == 2
-                    ? 'margin: 0 5px; color: #ccc'
-                    : 'margin: 0 5px; color: red'
-                "
-                :disabled="!partsItem.isAddProcessRoute || type == 2"
-                @click="handleProcessLineDele(row, index, partsIndex)"
-                >删除</a
-              >
-            </template> -->
+            <template slot="timeSlot" slot-scope="{ row, index }">
+              <Input
+                v-model="partsItem.partsProcessLineTableData[index].time"
+              />
+            </template>
+            <template slot="wagesSlot" slot-scope="{ row, index }">
+              <Input
+                v-model="partsItem.partsProcessLineTableData[index].wages"
+              />
+            </template>
+            <template slot="capacitySlot" slot-scope="{ row, index }">
+              <Input
+                v-model="partsItem.partsProcessLineTableData[index].capacity"
+              />
+            </template>
           </Table>
         </div>
         <div class="parts_content_part">
@@ -618,7 +643,7 @@
         <FormItem label="产品分类">
           <el-cascader
             clearable
-            v-model="similarProductData.type_name"
+            v-model="similarProductData.type_id"
             size="small"
             style="width: 120px"
             :show-all-levels="false"
@@ -626,12 +651,11 @@
             :props="{
               expandTrigger: 'hover',
               children: 'child',
-              value: 'title',
+              value: 'id',
               label: 'title',
               checkStrictly: true,
               emitPath: false,
             }"
-            @change="(e) => hanndleAddPDTTypeChange(similarProductData, e)"
           ></el-cascader>
           <!-- <Select
             v-model="similarProductData.type_name"
@@ -1059,12 +1083,15 @@ export default {
       processRouteName: "",
       partsProcessLineColumns: [
         { title: "序号", type: "index", minWidth: 30, align: "center" },
-        // { title: "工序分类", key: "type", align: "center" },
         { title: "工序名称", key: "title", align: "center" },
-        { title: "工时", key: "time", align: "center" },
-        { title: "工价", key: "wages", align: "center" },
-        { title: "产能", key: "capacity", align: "center" },
-        // { title: "操作", key: "set", align: "center", slot: "processLineSet" },
+        { title: "工时", key: "time", align: "center", slot: "timeSlot" },
+        { title: "工价", key: "wages", align: "center", slot: "wagesSlot" },
+        {
+          title: "产能",
+          key: "capacity",
+          align: "center",
+          slot: "capacitySlot",
+        },
       ], //工艺路线表头
       partsPartColumns: [
         {
@@ -1204,7 +1231,7 @@ export default {
       ProcessAttrList: [], //工艺属性列表
       partsList: [{ id: "", title: "" }], //部件分类名称列表
       similarProductData: {
-        type_name: "",
+        type_id: "",
         title: "",
         model: "",
         url_number: "",
@@ -1350,17 +1377,17 @@ export default {
       this.temp_info_bps = JSON.parse(JSON.stringify(this.info.bps));
     });
     this.axios("/api/bpp_list_new").then((res) => {
-      res.data.map((v) => {
-        if (v.select) {
-          v.cld.map((z) => {
-            v.select.map((k) => {
-              z.show = k == z.id ? true : false;
-            });
-          });
-        } else {
-          v.cld.map((v) => (v.show = false));
-        }
-      });
+      // res.data.map((v) => {
+      //   if (v.select) {
+      //     v.cld.map((z) => {
+      //       v.select.map((k) => {
+      //         z.show = k == z.id ? true : false;
+      //       });
+      //     });
+      //   } else {
+      //     v.cld.map((v) => (v.show = false));
+      //   }
+      // });
       this.tempProcessAttrList = JSON.parse(JSON.stringify(res.data));
       this.formData.parts.forEach((element) => {
         element.ProcessAttrList = res.data;
@@ -1430,6 +1457,7 @@ export default {
               process_price: "", //工艺价格
               proportion: "", //产值比例
               properties: [], //工艺属性
+              isShowProcessLine: true, //是否展示工艺路线
               ProcessAttrList: JSON.parse(
                 JSON.stringify(this.tempProcessAttrList)
               ), //工艺属性列表
@@ -1537,13 +1565,13 @@ export default {
     handleSimilarProductShow() {
       this.showSimilarProductModal = true;
       this.similarProductLoading = true;
-      this.similarProductData.type_name = "";
+      this.similarProductData.type_id = "";
       this.similarProductData.title = "";
       this.similarProductData.model = "";
       this.similarProductData.url_number = "";
       this.axios("/api/product", {
         params: {
-          type_name: this.similarProductData.type_name,
+          type_id: this.similarProductData.type_id,
           title: this.similarProductData.title,
           model: this.similarProductData.model,
           url_number: this.similarProductData.url_number,
@@ -1580,7 +1608,7 @@ export default {
       this.similarProductLoading = true;
       this.axios("/api/product", {
         params: {
-          type_name: this.similarProductData.type_name,
+          type_id: this.similarProductData.type_id,
           title: this.similarProductData.title,
           model: this.similarProductData.model,
           url_number: this.similarProductData.url_number,
@@ -1640,6 +1668,7 @@ export default {
               element.wide = element.formula_w;
               element.thick = element.formula_h;
               element.long = element.formula_l;
+              element.isShowProcessLine = true;
               element.ProcessAttrList = JSON.parse(
                 JSON.stringify(this.tempProcessAttrList)
               ); //工艺属性列表
@@ -1858,6 +1887,17 @@ export default {
         }
       }
     },
+    handleProcessLineShow(item, index) {
+      item.isShowProcessLine
+        ? (document.getElementsByClassName("parts_content_lineTable")[
+            index
+          ].style.height = "89px")
+        : (document.getElementsByClassName("parts_content_lineTable")[
+            index
+          ].style.height = "auto");
+      item.isShowProcessLine = !item.isShowProcessLine;
+      this.$forceUpdate();
+    },
     //选择工艺路线
     editRouter(item, index) {
       // 重新打开则重新判定是否为新增工艺路线
@@ -2163,13 +2203,6 @@ export default {
       if (atfer_BJ_name.length != BJ_name.length) {
         return this.$Message.error("部件名称存在重复");
       }
-      const GYLX_name = this.formData.parts.map((item) => {
-        return item.processCombination;
-      });
-      const atfer_GYLX_name = Array.from(new Set(GYLX_name));
-      if (GYLX_name.length != atfer_GYLX_name.length) {
-        return this.$Message.error("工艺路线存在重复");
-      }
       if (sum != 100) {
         this.$Message.error("产值比之和须为100");
       } else {
@@ -2181,7 +2214,8 @@ export default {
           element.partsNameList.forEach((ele) => {
             if (element.part_id == ele.id && ele.id == ele.title) {
               flag = true;
-          }});
+            }
+          });
           if (flag) {
             let result = await this.axios({
               method: "post",
@@ -2204,37 +2238,35 @@ export default {
             if (result.code == 200) {
               element.part_id = result.data.id;
               // 工艺路线保存 partsProcessLineTableData
-              let procedure = "";
-              let bool = false;
-              element.partsProcessRouteList.forEach((ele) => {
-                if (
-                  element.processCombination == ele.id &&
-                  ele.id == ele.title
-                ) {
-                  bool = true;
-                }
-              });
-              element.partsProcessLineTableData.forEach(async (el, idx) => {
-                if (idx == element.length - 1) {
-                  procedure += el.id + "";
-                } else {
-                  procedure += el.id + ",";
-                }
+              let bool = true;
+              // element.partsProcessRouteList.forEach((ele) => {
+              //   if (
+              //     element.processCombination == ele.id &&
+              //     ele.id == ele.title
+              //   ) {
+              //     bool = true;
+              //   }
+              // });
+              let properties = element.ProcessAttrList.map((v) => {
+                return { type_id: v.type_id, value: v.selected_value };
               });
+              // element.partsProcessLineTableData.forEach(async (el, idx) => {
+              //   if (idx == element.length - 1) {
+              //     procedure += el.id + "";
+              //   } else {
+              //     procedure += el.id + ",";
+              //   }
+              // });
               if (bool) {
                 let res = await this.axios({
                   method: "post",
                   url: "/api/order_area_explode_process",
                   data: {
-                    parts_id: element.part_id, /////
-                    price: element.process_price,
-                    properties:
-                      typeof element.properties == "string"
-                        ? [element.properties]
-                        : element.properties,
-                    // properties: element.properties,
+                    parts_id: element.part_id,
+                    price: element.process_price || 0,
+                    properties,
                     title: element.processCombination,
-                    procedure,
+                    procedure: element.partsProcessLineTableData,
                     op: "add",
                   },
                 });
@@ -2248,19 +2280,14 @@ export default {
             }
           } else {
             // 工艺路线保存 partsProcessLineTableData
-            let procedure = "";
-            let bool = false;
-            element.partsProcessRouteList.forEach((ele) => {
-              if (element.processCombination == ele.id && ele.id == ele.title) {
-                bool = true;
-              }
-            });
-            element.partsProcessLineTableData.forEach(async (el, idx) => {
-              if (idx == element.length - 1) {
-                procedure += el.id + "";
-              } else {
-                procedure += el.id + ",";
-              }
+            let bool = true;
+            // element.partsProcessRouteList.forEach((ele) => {
+            //   if (element.processCombination == ele.id && ele.id == ele.title) {
+            //     bool = true;
+            //   }
+            // });
+            let properties = element.ProcessAttrList.map((v) => {
+              return { type_id: v.type_id, value: v.selected_value };
             });
             if (bool) {
               let res = await this.axios({
@@ -2268,14 +2295,10 @@ export default {
                 url: "/api/order_area_explode_process",
                 data: {
                   parts_id: element.part_id, /////
-                  price: element.process_price,
-                  properties:
-                    typeof element.properties == "string"
-                      ? [element.properties]
-                      : element.properties,
-                  // properties: element.properties,
-                  title: element.processCombination,
-                  procedure,
+                  price: element.process_price || 0,
+                  properties,
+                  title: element.processCombination || "",
+                  procedure: element.partsProcessLineTableData,
                   op: "add",
                 },
               });
@@ -2290,6 +2313,8 @@ export default {
           }
         }
         this.formData.parts.forEach((element) => {
+          element.processCombination = element.processCombination || "";
+          element.properties = element.processCombination || "";
           element.detail = [
             ...element.partsWoodTableData,
             ...element.partsMetalseData,
@@ -2515,6 +2540,9 @@ export default {
           margin-right: 5px;
         }
       }
+      .parts_content_lineTable {
+        overflow: hidden;
+      }
     }
   }
 }
@@ -2572,8 +2600,8 @@ export default {
         text-align: center;
       }
       .box-us-foc {
-        color:  #fff;
-        background:#3764ff;
+        color: #fff;
+        background: #3764ff;
         border: 1px solid #3764ff;
       }
     }

+ 57 - 42
src/views/BidSystem/ProductDeOrder/detail.vue

@@ -3,7 +3,13 @@
     <Toptitle title="拆单页">
       <slot name="titleButton">
         <Button
-          @click="handleFinish()"
+          @click="handleFinish(0)"
+          type="primary"
+          style="margin-right: 10px"
+          >取消完成</Button
+        >
+        <Button
+          @click="handleFinish(1)"
           type="primary"
           style="margin-right: 10px"
           >完成</Button
@@ -126,7 +132,12 @@
     </div>
     <div class="addArea">
       <div class="addAreaTable">
-        <Table :columns="tableColumns" :data="formData.detail" border @on-selection-change='changeSelection'>
+        <Table
+          :columns="tableColumns"
+          :data="formData.detail"
+          border
+          @on-selection-change="changeSelection"
+        >
           <template slot="set" slot-scope="{ row, index }">
             <a
               :disabled="row.explode_status != 0"
@@ -191,8 +202,8 @@ export default {
   data() {
     // 这里存放数据
     return {
-      selection_check:'',
-      detail_id:[],
+      selection_check: "",
+      detail_id: [],
       showSupModal: false,
       showPDTModal: false,
       formData: {
@@ -234,9 +245,9 @@ export default {
       searchData: {},
       tableColumns: [
         {
-              type: 'selection',
-              width: 60,
-              align: 'center'
+          type: "selection",
+          width: 60,
+          align: "center",
         },
         {
           title: "序号",
@@ -360,14 +371,14 @@ export default {
           },
         },
         {
-          title:"是否下生产",
-          key:'',
-          align:"center",
-          resizable:true,
-          width:80,
-          render:(h,params) =>{
-            return h("span",{},params.status == 0? "否":"是")
-          }
+          title: "是否下生产",
+          key: "",
+          align: "center",
+          resizable: true,
+          width: 80,
+          render: (h, params) => {
+            return h("span", {}, params.row.status == 0 ? "否" : "是");
+          },
         },
         {
           title: "操作",
@@ -437,38 +448,42 @@ export default {
     );
   },
   methods: {
-    changeSelection(e){
+    changeSelection(e) {
       this.selection_check = e;
-      e.forEach(item=>{
-        this.detail_id.push(item.id)
-      })
+      e.forEach((item) => {
+        this.detail_id.push(item.id);
+      });
     },
-     handleFinish() {
+    handleFinish(status) {
       if (this.selection_check.length == 0) {
         this.$Message.warning("请选择数据");
       } else {
-      this.$Modal.confirm({
-        title: "确认完成?",
-        // content: "此操作确认后不可恢复,请确认!",
-        onOk: () => {
-          this.axios({
-            method: "post",
-            url: "/api/order_area_product_status",
-            data: {
-              orders_area_product_detail_id: this.detail_id
-            },
-          }).then((res) => {
-            if (res.code == 200) {
-              this.$Message.success(res.msg);
-               this.initData(
-      this.formData.order_no,
-      this.formData.orders_area_product_detail_id
-    );
-            }
-          });
-        },
-        onCancel: () => {console.log(this.$refs.selection)},
-      });}
+        this.$Modal.confirm({
+          title: "确认完成?",
+          // content: "此操作确认后不可恢复,请确认!",
+          onOk: () => {
+            this.axios({
+              method: "post",
+              url: "/api/order_area_product_status",
+              data: {
+                status,
+                orders_area_product_detail_id: this.detail_id,
+              },
+            }).then((res) => {
+              if (res.code == 200) {
+                this.$Message.success(res.msg);
+                this.initData(
+                  this.formData.order_no,
+                  this.formData.orders_area_product_detail_id
+                );
+              }
+            });
+          },
+          onCancel: () => {
+            console.log(this.$refs.selection);
+          },
+        });
+      }
     },
     //项目辅料新增
     handleAddSup() {

File diff suppressed because it is too large
+ 414 - 354
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue


Some files were not shown because too many files changed in this diff