Andy 3 سال پیش
والد
کامیت
9fbdfc2f6b

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

@@ -25,7 +25,9 @@
       <div><span>产品名称:</span>{{ formData.title }}</div>
       <div><span>数量:</span>{{ formData.num }}</div>
       <div><span>规格:</span>{{ formData.measure }}</div>
-      <div style="width:auto"><span>工艺属性:</span>{{ formData.process_property }}</div>
+      <div style="width:auto">
+        <span>工艺属性:</span>{{ formData.process_property }}
+      </div>
       <div><span>图号:</span>{{ formData.url_number }}</div>
       <div>
         <span>图纸:</span>
@@ -174,7 +176,7 @@
             </template>
           </vxe-table-column>
         </vxe-table> -->
-        <Table :columns="tableColumns" :data="tableData" border>
+        <Table :columns="tableColumns" :data="tableData" :max-height=500 border>
           <template slot="houseSet" slot-scope="{ index }">
             <Input
               type="text"
@@ -342,9 +344,15 @@
           </template>
           <template slot="set" slot-scope="{ index }">
             <a
+              style="margin: 0 5px"
+              v-show="type != 2"
+              @click="handleSet(tableData[index], index, 1)"
+              >复制</a
+            >
+            <a
               style="margin: 0 5px; color: red"
               v-show="type != 2"
-              @click="handleSet(tableData[index], index)"
+              @click="handleSet(tableData[index], index, 2)"
               >删除</a
             >
           </template>
@@ -545,7 +553,7 @@ export default {
               title: "操作",
               key: "set",
               align: "center",
-              minWidth: 80,
+              minWidth: 120,
               fixed: "right",
               slot: "set",
               resizable: true,
@@ -659,12 +667,12 @@ export default {
         this.tableData.forEach((el, index) => {
           el.index = index + 1;
           let tempM = el.measure.split("*");
-          el.measures.map((v,k)=>{
-            el[v.e_title] = tempM[k]
-          })
+          el.measures.map((v, k) => {
+            el[v.e_title] = tempM[k];
+          });
           // tempM.forEach((item) => {
-            // el[item.substring(0, 1)] = item
-            // el[item.substring(0, 1)] = item.substring(1);
+          // el[item.substring(0, 1)] = item
+          // el[item.substring(0, 1)] = item.substring(1);
           // });
           if (!el.type_id) {
             el.type_id = this.formData.type_id;
@@ -678,7 +686,7 @@ export default {
             title: el.title,
             key: el.e_title,
             align: "center",
-            // width: "150",
+            minWidth: 150,
             slot: `formula_${el.e_title}`,
             // resizable: true,
           });
@@ -741,11 +749,21 @@ export default {
         this.$Message.warning(res.msg || "上传失败");
       }
     },
-    handleSet(row, index) {
-      this.tableData.splice(index, 1);
-      this.tableData.forEach((el, index) => {
-        el.index = index + 1;
-      });
+    handleSet(row, index, type) {
+      // 1复制  2删除
+      let obj;
+      switch (type) {
+        case 1:
+          obj = JSON.parse(JSON.stringify(row));
+          this.tableData.splice(index, 0, obj);
+          break;
+        case 2:
+          this.tableData.splice(index, 1);
+          this.tableData.forEach((el, index) => {
+            el.index = index + 1;
+          });
+          break;
+      }
     },
     looks(arr) {
       // const array = [{ img_url: img }];

+ 52 - 58
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -25,7 +25,9 @@
       <div><span>数量:</span>{{ formData.num }}</div>
       <!-- <div><span>价格:</span>{{ formData.price }}</div> -->
       <div><span>规格:</span>{{ formData.measure }}</div>
-      <div style="width:auto"><span>工艺属性:</span>{{ formData.process_property }}</div>
+      <div style="width:auto">
+        <span>工艺属性:</span>{{ formData.process_property }}
+      </div>
       <div style="overflow:hidden;">
         <span>图纸:</span>
         <div>
@@ -370,7 +372,7 @@
             type="primary"
             size="small"
             ghost
-            :disabled="!partsItem.isAddPart || type == 2"
+            :disabled="type == 2"
             style="margin-right: 10px"
             >新增木板</Button
           >
@@ -384,7 +386,7 @@
             <template slot-scope="{ index }" slot="partNameSet">
               <Input
                 placeholder="名称"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].spare_parts"
               />
             </template>
@@ -393,7 +395,7 @@
                 <Select
                   filterable
                   clearable
-                  :disabled="!partsItem.isAddPart || type == 2"
+                  :disabled="type == 2"
                   label-in-value
                   @on-change="changeSe($event, index, partsIndex, row)"
                   v-model="partsItem.partsWoodTableData[index].material_id"
@@ -412,7 +414,7 @@
             <template slot-scope="{ index }" slot="partNumberSet">
               <Input
                 placeholder="数量"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].number"
               />
             </template>
@@ -462,7 +464,7 @@
                 placeholder="工艺要求"
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="
                   partsItem.partsWoodTableData[index]
                     .technological_requirement_id
@@ -481,7 +483,7 @@
                 placeholder="贴面数"
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].sub_num"
               >
                 <Option :value="0" label="0"></Option>
@@ -494,7 +496,7 @@
                 placeholder="贴木皮"
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].veneer_id"
               >
                 <Option
@@ -510,7 +512,7 @@
                 placeholder="油漆"
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].paint_id"
               >
                 <Option
@@ -526,7 +528,7 @@
                 placeholder="标签"
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].label"
               >
                 <Option :value="1" label="小芯片"></Option>
@@ -538,7 +540,7 @@
             <template slot-scope="{ index }" slot="partPrint_numSet">
               <Input
                 placeholder="打印数量"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsWoodTableData[index].print_num"
               />
             </template>
@@ -567,7 +569,7 @@
             @click="handlePartMetalsAdd(partsIndex)"
             type="primary"
             size="small"
-            :disabled="!partsItem.isAddPart || type == 2"
+            :disabled="type == 2"
             ghost
             style="margin-right: 10px"
             >新增五金</Button
@@ -583,7 +585,7 @@
               <Select
                 filterable
                 clearable
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 @on-change="changeMetal($event, index, partsIndex)"
                 label-in-value
                 placeholder="请选择"
@@ -601,14 +603,14 @@
             <template slot-scope="{ index }" slot="metalNumberSet">
               <Input
                 placeholder="数量"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsMetalseData[index].number"
               />
             </template>
             <template slot-scope="{ index }" slot="metalPriceSet">
               <Input
                 placeholder="单价"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 v-model="partsItem.partsMetalseData[index].price"
               />
             </template>
@@ -1025,7 +1027,6 @@ export default {
           //产品列表
           {
             isAddPart: true, //是否为新增部件
-            isAddProcessRoute: true, //是否为新增工艺组合
             long: "",
             width: "",
             thick: "",
@@ -1464,7 +1465,6 @@ export default {
           this.formData.parts = [
             {
               isAddPart: true, //是否为新增部件
-              isAddProcessRoute: true, //是否为新增工艺组合
               long: "",
               wide: "",
               thick: "",
@@ -1749,7 +1749,6 @@ export default {
       if (val && val.value) {
         item.part_title = val.label;
         if (val.label != val.value) {
-          item.isAddPart = false;
           this.axios({
             method: "get",
             url: "/api/parts_detail",
@@ -1776,19 +1775,17 @@ export default {
             );
           });
         } else {
-          item.isAddPart = true;
+          // item.isAddPart = true;
           // item.ProcessAttrList = this.tempProcessAttrList;
           // item.partsWoodTableData = [];
           // item.partsMetalseData = [];
           // item.process_name = "";
         }
       }
-      console.log("item :>> ", item);
     },
     handlePartsNameSelect_test(item, val) {
       if (val && val.value) {
         if (val.label != val.value) {
-          item.isAddPart = false;
           this.axios({
             method: "get",
             url: "/api/parts_detail",
@@ -1820,8 +1817,6 @@ export default {
             item.partsMetalseData = res.data.detail.filter(
               (v) => v.type_id == 5
             );
-            item.isAddPart = true;
-            item.isAddProcessRoute = true;
             item.parts_type = res.data.p_id;
             this.axios({
               method: "get",
@@ -1841,7 +1836,7 @@ export default {
             this.showSimilarProductModal = false;
           });
         } else {
-          item.isAddPart = true;
+          // item.isAddPart = true;
           // item.ProcessAttrList = this.tempProcessAttrList;
           // item.partsWoodTableData = [];
           // item.partsMetalseData = [];
@@ -1852,7 +1847,6 @@ export default {
     // 选择工艺组合名称
     handleProcessRouteSelect(item, val) {
       if (val) {
-        item.isAddProcessRoute = false;
         this.axios({
           method: "get",
           url: "/api/process_route_detail",
@@ -1988,15 +1982,13 @@ export default {
     },
     setRadioChange(parent, child, index, parts, cld) {
       if (this.type == 1) {
-        if (parts.isAddProcessRoute) {
-          cld.forEach((element) => {
-            element.list.forEach((elem) => {
-              elem.id != child.id && (elem.show = false);
-            });
+        cld.forEach((element) => {
+          element.list.forEach((elem) => {
+            elem.id != child.id && (elem.show = false);
           });
-          child.show = !child.show;
-          parts.properties[index] = child.id;
-        }
+        });
+        child.show = !child.show;
+        parts.properties[index] = child.id;
       }
       this.$forceUpdate();
     },
@@ -2081,7 +2073,6 @@ export default {
     handlePartAdd(item, index) {
       let obj = {
         isAddPart: true,
-        isAddProcessRoute: true,
         long: "",
         width: "",
         thick: "",
@@ -2167,23 +2158,22 @@ export default {
       this.formData = formData;
     },
     handlePartWoodCopy(row, index, parentIndex) {
-      this.$nextTick(() => {
-        let obj = JSON.parse(
-          JSON.stringify(
-            this.formData.parts[parentIndex].partsWoodTableData[index]
-          )
-        );
-        this.formData.parts[parentIndex].partsWoodTableData.splice(
-          index + 1,
-          0,
-          obj
-        );
-        // this.formData.parts[parentIndex].partsWoodTableData.push(obj)
-        this.$forceUpdate();
-      });
+      let obj = JSON.parse(
+        JSON.stringify(
+          this.formData.parts[parentIndex].partsWoodTableData[index]
+        )
+      );
+      this.formData.parts[parentIndex].partsWoodTableData.splice(
+        index + 1,
+        0,
+        obj
+      );
+      // this.formData.parts[parentIndex].partsWoodTableData.push(obj)
+      this.formData.parts = JSON.parse(JSON.stringify(this.formData.parts));
     },
     handlePartWoodDele(row, index, parentIndex) {
       this.formData.parts[parentIndex].partsWoodTableData.splice(index, 1);
+      this.formData.parts = JSON.parse(JSON.stringify(this.formData.parts));
     },
     handlePartMetalsAdd(index) {
       let formData = JSON.parse(JSON.stringify(this.formData));
@@ -2207,12 +2197,14 @@ export default {
         0,
         obj
       );
+      this.formData.parts = JSON.parse(JSON.stringify(this.formData.parts));
     },
     handleClose(done) {
       done();
     },
     handlePartMetalsDele(row, index, parentIndex) {
       this.formData.parts[parentIndex].partsMetalseData.splice(index, 1);
+      this.formData.parts = JSON.parse(JSON.stringify(this.formData.parts));
     },
     handleProcessLineSelected() {},
     async postData() {
@@ -2404,16 +2396,18 @@ export default {
       // })
     },
     changeSe(e, n, partsIndex, row) {
-      let event = window.event;
-      let unit = event.target.dataset.unit;
-      // row.company = unit ? unit : ''
-      // row.thick = e.tag
-      // row.title = e.title
-      this.formData.parts[partsIndex].partsWoodTableData[n].company = unit
-        ? unit
-        : "";
-      this.formData.parts[partsIndex].partsWoodTableData[n].thick = e.tag;
-      this.formData.parts[partsIndex].partsWoodTableData[n].title = e.title;
+      if (e) {
+        let event = window.event;
+        let unit = event.target.dataset.unit;
+        // row.company = unit ? unit : ''
+        // row.thick = e.tag
+        // row.title = e.title
+        this.formData.parts[partsIndex].partsWoodTableData[n].company = unit
+          ? unit
+          : "";
+        this.formData.parts[partsIndex].partsWoodTableData[n].thick = e.tag;
+        this.formData.parts[partsIndex].partsWoodTableData[n].title = e.title;
+      }
     },
     changeMetal(e, n, partsIndex) {
       let event = window.event;

+ 16 - 19
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -2899,7 +2899,8 @@ export default {
       // 处理部件
       curData.part.forEach((element, index) => {
         if (!element.is_metal) {
-          modalData.part[index].change_id = element.change_id;
+          console.log('element :>> ', element);
+          // modalData.part[index].change_id = element.change_id;
           modalData.part[index].part_title = element.part_title;
           modalData.part[index].org_part_id = JSON.parse(
             JSON.stringify(modalData.part[index].part_id)
@@ -3044,7 +3045,6 @@ export default {
                 0,
                 element.extra.length - 1
               )));
- 
           });
           this.modalArray.forEach((element) => {
             element.part.forEach((elem) => {
@@ -3076,7 +3076,6 @@ export default {
         case 1:
           this.title_state = 1;
           if (this.info.custom_id) {
-
             this.currentTabIndex = "0";
             // this.showAddProduct = true;
             this.handleShowAddProductModal(
@@ -3774,17 +3773,15 @@ export default {
                   JSON.stringify(element.high || "")
                 );
                 element.part_detail.forEach((elem) => {
-                  elem.org_num = JSON.parse(JSON.stringify(elem.num));
+                  elem.org_num = elem.num;
                   elem.material_detail_id = 0;
                   elem.material_detail_title =
                     elem.material_detail_list[0].title;
                   elem.material_detail_num = elem.num || 0;
-                  elem.material_detail_org_num = JSON.parse(
-                    JSON.stringify(elem.num || 0)
-                  );
-                  elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
-                  elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
-                  elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
+                  elem.material_detail_org_num = elem.num || 0;
+                  elem.longCalc = elem.long || "";
+                  elem.wideCalc = elem.wide || "";
+                  elem.highCalc = elem.high || "";
                   elem.material_detail_list.forEach((el) => {
                     el.long = el.long || "0";
                     el.wide = el.wide || "0";
@@ -3796,7 +3793,7 @@ export default {
             //测量字段
             this.modalData.measure = res.data.measure;
             this.modalData.measure.forEach((element) => {
-              element.measureCalc = JSON.parse(JSON.stringify(element.e_title));
+              element.measureCalc = element.e_title;
             });
             //工艺属性
             this.modalData.process = [];
@@ -3841,20 +3838,20 @@ export default {
       if ($event) {
         let cur = row.change.filter((item) => item.id == row.change_id);
         row.part_title = cur[0].part_title;
-        row.org_part_id = JSON.parse(JSON.stringify(row.part_id));
+        row.org_part_id =row.part_id;
         row.part_id = cur[0].part_id;
         row.high = cur[0].high || 0;
-        row.highCalc = JSON.parse(JSON.stringify(row.high));
+        row.highCalc =row.high;
         row.long = cur[0].long || 0;
-        row.longCalc = JSON.parse(JSON.stringify(row.long));
+        row.longCalc =row.long;
         row.wide = cur[0].wide || 0;
-        row.wideCalc = JSON.parse(JSON.stringify(row.wide));
+        row.wideCalc =row.wide;
         row.part_detail = cur[0].sub_part;
         row.part_detail.forEach((elem) => {
-          elem.longCalc = JSON.parse(JSON.stringify(elem.long || ""));
-          elem.wideCalc = JSON.parse(JSON.stringify(elem.wide || ""));
-          elem.highCalc = JSON.parse(JSON.stringify(elem.high || ""));
-          elem.org_num = JSON.parse(JSON.stringify(elem.num));
+          elem.longCalc =elem.long || "";
+          elem.wideCalc =elem.wide || "";
+          elem.highCalc =elem.high || "";
+          elem.org_num =elem.num;
           elem.material_detail_org_num = JSON.parse(
             JSON.stringify(elem.num || 0)
           );

+ 47 - 11
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue

@@ -1075,26 +1075,62 @@ export default {
       });
       printparamsJsonArray.push({ PTK_SetLabelWidth: 873 });
       contents.map((content) => {
-        const printContent_l1 = `单号:${content.order_no}        型号:${content.product_title} `;
+        // const printContent_l1 = `单号:${content.order_no}        型号:${content.product_title} `;
+        // printparamsJsonArray.push({
+        //   PTK_DrawText_TrueType:
+        //     "100,20,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+        // });
+        // const printContent_l2 = `尺寸:${content.measure}  颜色:${content.color_title} `;
+        // printparamsJsonArray.push({
+        //   PTK_DrawText_TrueType:
+        //     "100,100,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+        // });
+        // const printContent_l3 = `工艺:${content.process_title}    部件:${content.part_title}`;
+        // printparamsJsonArray.push({
+        //   PTK_DrawText_TrueType:
+        //     "100,180,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+        // });
+        const printContent_l1 = `项目名称:${content.client_name}`;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "100,20,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+            "110,30,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
         });
-        const printContent_l2 = `尺寸:${content.measure}  颜色:${content.color_title} `;
+        const printContent_l1_2 = `楼层区域:${content.house}-${content.layer}${content.position}`;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "100,100,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+            "410,30,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
         });
-        const printContent_l3 = `工艺:${content.process_title}    部件:${content.part_title}`;
+        const printContent_l2 = `房号:${content.number_detail}`;
         printparamsJsonArray.push({
           PTK_DrawText_TrueType:
-            "100,180,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+            "110,80,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+        });
+        const printContent_l2_2 = `图号:${content.url_number}`;
+        printparamsJsonArray.push({
+          PTK_DrawText_TrueType:
+            "510,80,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+        });
+        const printContent_l3 = `产品名称:${content.product_title}`;
+        printparamsJsonArray.push({
+          PTK_DrawText_TrueType:
+            "110,130,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+        });
+        const printContent_l3_2 = `木皮:${content.color_title}`;
+        printparamsJsonArray.push({
+          PTK_DrawText_TrueType:
+            "610,130,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+        });
+
+        const printContent_l4 = `部件:${content.part_title}`;
+        printparamsJsonArray.push({
+          PTK_DrawText_TrueType:
+            "110,180,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+        });
+        const printContent_l4_2 = `尺寸:${content.measure}`;
+        printparamsJsonArray.push({
+          PTK_DrawText_TrueType:
+            "710,180,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
         });
-        // const printContent_l4 = `工艺:${content.process_title} `;
-        // printparamsJsonArray.push({
-        //   PTK_DrawText_TrueType:
-        //     "100,170,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
-        // });
         printparamsJsonArray.push({
           PTK_RWRFIDLabel:
             "1,0,0," + content.chip.length / 2 + ",1," + content.chip,