Parcourir la source

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

mushencc il y a 4 ans
Parent
commit
0b931cbe16

+ 4 - 4
src/views/BasicSettings/PartSettings/detail.vue

@@ -35,7 +35,7 @@
               clearable
               v-model="formData.process_id"
               style="width: 100px;margin-right:5px"
-              @on-change="(e)=>handleProcessSelected(e,1)"
+              @on-change="(e) => handleProcessSelected(e, 1)"
             >
               <Option
                 v-for="(item, index) in basic_process_list"
@@ -50,7 +50,7 @@
               filterable
               filter-by-label
               clearable
-              @on-change="(e) => handleGetProcessIds(formData.process_id, e,1)"
+              @on-change="(e) => handleGetProcessIds(formData.process_id, e, 1)"
               v-model="formData.type_title"
               style="width: 100px;margin-right:5px"
             >
@@ -144,7 +144,7 @@
         <Table
           :columns="tableColumns"
           border
-          :max-height="500"
+          :max-height="700"
           :data="tableData"
         >
           <template slot="partDetailTitle" slot-scope="{ index }">
@@ -386,7 +386,7 @@ export default {
           }
         });
     },
-    handleGetProcessIds(p_id, type_title,tag) {
+    handleGetProcessIds(p_id, type_title, tag) {
       this.axios
         .get("/api/properties_index", { params: { p_id, type_title } })
         .then((res) => {

+ 16 - 10
src/views/BasicSettings/PartSettings/list.vue

@@ -76,16 +76,22 @@
     </Row>
     <div>
       <div style="height:600px">
-      <Table :columns="tableColumns" border :max-height="600" :data="tableData" >
-        <template slot="setSlot" slot-scope="{ row, index }">
-          <div>
-            <a style="margin:0 5px;" @click="handleSet(row, 1)">复制</a>
-            <a style="margin:0 5px;" @click="handleSet(row, 2)">编辑</a>
-            <a style="margin:0 5px;" @click="handleSet(row, 3)">查看</a>
-            <a style="margin:0 5px;" @click="handleSet(row, 4)">删除</a>
-          </div>
-        </template>
-      </Table></div>
+        <Table
+          :columns="tableColumns"
+          border
+          :max-height="700"
+          :data="tableData"
+        >
+          <template slot="setSlot" slot-scope="{ row, index }">
+            <div>
+              <a style="margin:0 5px;" @click="handleSet(row, 1)">复制</a>
+              <a style="margin:0 5px;" @click="handleSet(row, 2)">编辑</a>
+              <a style="margin:0 5px;" @click="handleSet(row, 3)">查看</a>
+              <a style="margin:0 5px;" @click="handleSet(row, 4)">删除</a>
+            </div>
+          </template>
+        </Table>
+      </div>
       <div class="content_body_page">
         <Page
           :page-size-opts="[10, 20, 30, 40, 100]"

+ 152 - 117
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -339,7 +339,7 @@
           <Input
             v-model="info.fax_price"
             v-if="type != 3"
-            readonly
+            @on-change="handleFaxPriceChange"
             class="auto-width"
             placeholder="自动生成"
           />
@@ -357,7 +357,7 @@
           <Input
             v-model="info.order_price"
             v-if="type != 3"
-            @on-change="handleOrderPriceChange($event, info)"
+            @on-change="handleOrderPriceChange($event)"
             class="auto-width"
             placeholder="自动生成"
           />
@@ -494,6 +494,35 @@
           :edit-config="type == 3 ? {} : { trigger: 'click', mode: 'row' }"
           :data="tableData"
         >
+          <vxe-column title="操作" min-width="200">
+            <template #default="{ row, rowIndex }">
+              <a
+                @click="handleSet(row, rowIndex, 5)"
+                style="margin: 0 5px"
+                v-show="!row.is_metal"
+                >详情</a
+              >
+              <a
+                @click="handleSet(row, rowIndex, 4)"
+                v-show="type != 3"
+                style="margin: 0 5px"
+                >复制</a
+              >
+              <a
+                @click="handleSet(row, rowIndex, 2)"
+                v-show="type != 3 && !row.is_metal"
+                style="margin: 0 5px"
+                >编辑</a
+              >
+
+              <a
+                @click="handleSet(row, rowIndex, 3)"
+                v-show="type != 3"
+                style="margin: 0 5px"
+                >删除</a
+              >
+            </template>
+          </vxe-column>
           <vxe-column type="seq" min-width="45">
             <template #header>
               <span>序号</span>
@@ -1064,35 +1093,6 @@
               {{ row.remark }}
             </template>
           </vxe-column>
-          <vxe-column title="操作" min-width="200">
-            <template #default="{ row, rowIndex }">
-              <a
-                @click="handleSet(row, rowIndex, 5)"
-                style="margin: 0 5px"
-                v-show="!row.is_metal"
-                >详情</a
-              >
-              <a
-                @click="handleSet(row, rowIndex, 4)"
-                v-show="type != 3"
-                style="margin: 0 5px"
-                >复制</a
-              >
-              <a
-                @click="handleSet(row, rowIndex, 2)"
-                v-show="type != 3 && !row.is_metal"
-                style="margin: 0 5px"
-                >编辑</a
-              >
-
-              <a
-                @click="handleSet(row, rowIndex, 3)"
-                v-show="type != 3"
-                style="margin: 0 5px"
-                >删除</a
-              >
-            </template>
-          </vxe-column>
         </vxe-table>
         <!-- <vxe-table resizable border ref="xTree" :data="tableData">
           <vxe-table-column
@@ -2409,6 +2409,8 @@ export default {
       bpp_list: [],
       process_obj: [],
       timeout: null,
+      copiedLinePart: {},
+      mentoubanList: [],
     };
   },
   computed: {
@@ -2421,6 +2423,12 @@ export default {
   created() {
     //获取部件分类
     this.axios.get("/api/basics_parts_index").then((res) => {
+      res.data.data.map((v, k) => {
+        if (v.title == "门头板") {
+          // this.mentoubanList = res.data.data.splice(k, 1)[0];
+        }
+      });
+      console.log(`this.mentoubanList`, this.mentoubanList);
       this.part_type_total = res.data.data;
     });
     // 获取测量字段
@@ -2516,6 +2524,13 @@ export default {
     });
   },
   methods: {
+    handleFaxPriceChange(e) {
+      this.info.fax_price = e.target.value;
+      this.info.order_price = (
+        this.info.predict_price - e.target.value
+      ).toFixed(2);
+      this.$forceUpdate();
+    },
     getSelectedLabel(value, list, valueProp, labelField) {
       const item = list.find((item) => item[valueProp] == value);
       return item ? item[labelField] : null;
@@ -2596,6 +2611,7 @@ export default {
         });
       sendList.length > 0 &&
         sendList.map((element, index) => {
+          element.ext = element.extArray;
           element.part.map((elem) => {
             if (!elem.is_metal) {
               // elem.part_detail = elem.sub_part;
@@ -2836,9 +2852,12 @@ export default {
                 (this.info.predict_price * this.fax) /
                 100
               ).toFixed(2);
-              this.info.fax_price = (
-                this.info.predict_price - this.info.order_price
-              ).toFixed(2);
+              const temp_fax_price =
+                (this.info.predict_price - this.info.order_price).toFixed(2) ||
+                0;
+              if (!this.info.fax_price) {
+                this.info.fax_price = temp_fax_price;
+              }
               this.$forceUpdate();
             });
         }
@@ -3147,15 +3166,18 @@ export default {
         (this.info.predict_price * this.fax) /
         100
       ).toFixed(2);
-      this.info.fax_price = (
-        this.info.predict_price - this.info.order_price
-      ).toFixed(2);
+      // if (this.info.order_price) {
+      //   console.log(`123`, 123);
+      //   this.info.fax_price = (
+      //     this.info.predict_price - this.info.order_price
+      //   ).toFixed(2);
+      // }
+      console.log(`this.info.fax_price `, this.info.fax_price);
     },
     getUsers() {
       this.axios("/api/employee_list").then((res) => (this.users = res.data));
     },
     handleExtraAdd(array, type) {
-      console.log(`array`, array);
       array.push({
         num: 0,
         price: 0,
@@ -3166,11 +3188,13 @@ export default {
         id: "",
         is_metal: true,
       });
+      this.handleCalcCount();
       this.$forceUpdate();
     },
     handleExtraDele(array, row, index, modalData) {
       array.splice(index, 1);
       this.handleTotalPriceCalc(row, modalData);
+      this.handleCalcCount();
       this.$forceUpdate();
     },
     getCoumstList() {
@@ -3546,7 +3570,6 @@ export default {
         custom_id,
         route_id_at_copy,
         then: (subAddProductData, support_remark) => {
-          console.log("subAddProductData :>> ", subAddProductData);
           this.support_remark = Array.from(
             new Set([...support_remark, ...this.support_remark])
           );
@@ -3808,6 +3831,7 @@ export default {
           break;
         case 4:
           obj = this.deepClone(row);
+          obj.isCopied = true;
           if (row.is_metal) {
           } else {
             obj.position = "";
@@ -3822,6 +3846,16 @@ export default {
               JSON.stringify(row.procedure_properties)
             );
           }
+          //复制一条数据,更换了产品之后,
+          //线条的内容要保留(不管更换的这个产品的默认线条是什么,都是只展示复制下来的)
+          //摘自Tower #2004
+          obj.part.map((v) => {
+            if (v.title.indexOf("线条") != -1) {
+              this.copiedLinePart = this.deepClone(v);
+            }
+          });
+          //因为是复制,插件id为_XID会相同导致bug,置空后会自动生成
+          obj._XID = "";
           this.tableData.splice(index + 1, 0, obj);
           this.handleCalcCount();
           break;
@@ -3904,6 +3938,7 @@ export default {
       row.price = element[0].price;
       row.total_price = (row.num * row.price).toFixed(2);
       this.handleTotalPriceCalc(row, item);
+      this.handleCalcCount();
     },
     handleSameProcessDisabled(array, currencyChooseValue, currencyChooseIndex) {
       let matchIds = array.selected_ids;
@@ -3987,7 +4022,7 @@ export default {
       item.position = e.target.value;
       this.$forceUpdate();
     },
-    handleOrderPriceChange(e, info) {
+    handleOrderPriceChange(e) {
       this.info.order_price = e.target.value;
       this.info.fax_price = (this.info.predict_price - e.target.value).toFixed(
         2
@@ -4097,6 +4132,7 @@ export default {
       } else {
         row.ext_id = "";
         row.title = "";
+        this.handleCalcCount();
       }
     },
     changeEditPart(row, part_type, part_detail, e, rowIndex) {
@@ -4115,80 +4151,80 @@ export default {
       }
     },
     handleSelectProductMetail(row, rowIndex, $event, scope) {
-      console.log(`$event`, $event);
-      const arr = $event.tag.split("_");
-      let obj = {};
-      console.log(`arr[1]`, arr[1]);
-      // 分类   1产品   2五金
-      if (arr[1] == "1") {
-        obj = {
-          select_all_id: $event.value,
-          product_id: "",
-          type_name: "", //展示用产品名称
-          position: "", //位置
-          over_price: "", //超标单价
-          unit_price: "", //单价
-          ext_price: "", //附加金额
-          price: "", //总金额
-          remark: "", //备注
-          measurement: "", //测量字段拼接
-          total_num: "", //数量
-          num: "", //核算数量
-          num_formula: "", //核算数量公式
-          url_number: "", //图号
-          url: [], //图纸
-          unit: "", //单位
-          title: "", //产品名
-          process: "", //工艺属性拼接
-          procedure_properties: {}, //工艺属性对象
-          overdraft: [], //超标公式
-          measure: this._measure, //测量字段数组
-          support_remark: this.support_remark, //备注列表
-          is_metal: false,
-          ext: [],
-          extArray: [
-            {
-              num: 0,
-              price: 0,
-              total_price: 0,
-              type: 2,
-              remark: "",
-              title: "",
-              id: "",
-              is_metal: true,
-            },
-          ],
-          process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
-        };
-        obj.process_obj.map(
-          (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
-        );
-      } else {
-        console.log(`2`, 2);
-        obj = {
-          select_all_id: $event.value,
-          type: 1,
-          is_metal: true,
-          material_id: "",
-          product_id: "",
-          title: "",
-          price: 0,
-          single_price: 0,
-          num: 0,
-          unit: "",
-        };
-      }
-      console.log(`arr[0]`, arr[0]);
-      obj.product_id = arr[0];
-      this.tableData.splice(rowIndex, 1, obj);
-      if (arr[1] === "1") {
-        this.changeEditTableData(row, rowIndex, $event, scope);
-      } else {
-        this.changeEditMetal(row, rowIndex, $event, scope);
+      if ($event) {
+        const arr = $event.tag.split("_");
+        let obj = {};
+        // 分类   1产品   2五金
+        if (arr[1] == "1") {
+          obj = {
+            isCopied: row.isCopied,
+            select_all_id: $event.value,
+            product_id: "",
+            type_name: "", //展示用产品名称
+            position: "", //位置
+            over_price: "", //超标单价
+            unit_price: "", //单价
+            ext_price: "", //附加金额
+            price: "", //总金额
+            remark: "", //备注
+            measurement: "", //测量字段拼接
+            total_num: "", //数量
+            num: "", //核算数量
+            num_formula: "", //核算数量公式
+            url_number: "", //图号
+            url: [], //图纸
+            unit: "", //单位
+            title: "", //产品名
+            process: "", //工艺属性拼接
+            procedure_properties: {}, //工艺属性对象
+            overdraft: [], //超标公式
+            measure: this._measure, //测量字段数组
+            support_remark: this.support_remark, //备注列表
+            is_metal: false,
+            ext: [],
+            extArray: [
+              {
+                num: 0,
+                price: 0,
+                total_price: 0,
+                type: 2,
+                remark: "",
+                title: "",
+                id: "",
+                is_metal: true,
+              },
+            ],
+            process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
+          };
+          obj.process_obj.map(
+            (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
+          );
+        } else {
+          obj = {
+            select_all_id: $event.value,
+            type: 1,
+            is_metal: true,
+            material_id: "",
+            product_id: "",
+            title: "",
+            price: 0,
+            single_price: 0,
+            num: 0,
+            unit: "",
+          };
+        }
+        obj.product_id = arr[0];
+        this.tableData.splice(rowIndex, 1, obj);
+        if (arr[1] === "1") {
+          this.changeEditTableData(obj, rowIndex, $event, scope);
+        } else {
+          this.changeEditMetal(obj, rowIndex, $event, scope);
+        }
+        this.HandleAutoCreateNewLine();
       }
-      this.HandleAutoCreateNewLine();
     },
     changeEditTableData(row, rowIndex, $event, scope) {
+      const isCopied = row.isCopied || false;
       if ($event) {
         row.type_name = $event.label;
         row.title = $event.label;
@@ -4255,8 +4291,8 @@ export default {
               });
               if (element.is_null == 1) {
                 element.change_id = "";
-                element.part_title = "";
-                element.title = "";
+                // element.part_title = "";
+                // element.title = "";
               } else {
                 for (const key in this.pre_process_obj) {
                   const item = this.pre_process_obj[key];
@@ -4264,6 +4300,9 @@ export default {
                 }
                 element.change_id = element.change[0].id;
               }
+              if (isCopied && element.title.indexOf("线条") != -1) {
+                element = Object.assign(element, this.copiedLinePart);
+              }
               element.part_detail = element.sub_part;
               //展示非拆分部件
               // 默认替换部件   pre_process_obj
@@ -4309,7 +4348,6 @@ export default {
             element.value = "";
             element.measureCalc = element.e_title;
           });
-          console.log("row :>> ", row);
           this.tableData.splice(rowIndex, 1, row);
           this.handleClearExtInfo(row, this.pre_bp_id, res.data.bp_id);
           row.get_first_data = false;
@@ -5223,9 +5261,7 @@ export default {
           product.num = eval(product.num_formula_temp);
         }
         product.num = Number(product.num).toFixed(2);
-        console.log(`product.over_price`, product.over_price);
         product.over_price = Number(product.over_price).toFixed(2);
-        console.log(`product.over_price1`, product.over_price);
         product.num_temp_save = product.num || 1;
         product.price =
           (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
@@ -5241,7 +5277,6 @@ export default {
     },
     //修改材质/颜色/工艺的
     handleProductProcessChange(e, n, modelData, ele) {
-      console.log("e :>> ", e);
       if (e) {
         this.pre_process_obj[ele.id] = e.value;
         modelData[ele.id] = e.value;

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
   process.env.NODE_ENV == "dev"
     ? "http://121.41.102.225:82"
     : process.env.NODE_ENV == "test-prd"
-    ? "http://121.41.102.225:82" //测试服
+    ? "http://124.71.176.88:882" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";