mushencc 3 rokov pred
rodič
commit
57bcd9d91c

+ 54 - 63
src/views/OrderMannage/BusinessOrderlist/confirm.vue

@@ -280,7 +280,7 @@
                 label-in-value
                 v-model="row.select_all_id"
                 @on-change="
-                  handleSelectProductMaterial($event,rowIndex)
+                  handleSelectProductMaterial($event,rowIndex,row)
                 "
               >
                 <Option
@@ -784,11 +784,11 @@
                 transfer
                 v-model="scope.row.remark"
                 allow-create
-                @on-create="handleRemarkCreate"
+                @on-create="(val)=>handleRemarkCreate(val,scope.rowIndex)"
                 @on-change="changeEditRemark(scope.row)"
               >
                 <Option
-                  v-for="item in support_remark"
+                  v-for="item in scope.row.support_remark"
                   :value="item"
                   :key="item"
                   >{{ item }}</Option
@@ -1006,14 +1006,14 @@
         },
       ],
        tableData:[
-              { id: 10001, name: 'Test1', nickname: 'T1', role: 'Develop', sex: '0', sex2: ['0'], num1: 40, age: 28, address: 'Shenzhen', date12: '', date13: '' ,is_metal:false,extArray:[{ num: 0,
-        price: 0,
-        total_price: 0,
-        type:2,
-        remark: "",
-        title: "",
-        id: "2",
-        is_metal: true,}]},
+        //       { id: 10001, name: 'Test1', nickname: 'T1', role: 'Develop', sex: '0', sex2: ['0'], num1: 40, age: 28, address: 'Shenzhen', date12: '', date13: '' ,is_metal:false,extArray:[{ num: 0,
+        // price: 0,
+        // total_price: 0,
+        // type:2,
+        // remark: "",
+        // title: "",
+        // id: "2",
+        // is_metal: true,}]},
               // { id: 10002, name: 'Test2', nickname: 'T2', role: 'Designer', sex: '1', sex2: ['0', '1'], num1: 20, age: 22, address: 'Guangzhou', date12: '', date13: '2020-08-20' },
               // { id: 10003, name: 'Test3', nickname: 'T3', role: 'Test', sex: '0', sex2: ['1'], num1: 200, age: 32, address: 'Shanghai', date12: '2020-09-10', date13: '' },
               // { id: 10004, name: 'Test4', nickname: 'T4', role: 'Designer', sex: '1', sex2: ['1'], num1: 30, age: 23, address: 'Shenzhen', date12: '', date13: '2020-12-04' }
@@ -1127,53 +1127,35 @@
     this.getProducts();
     },
     methods: {
-      getMaterialName(row){
+getMaterialName(row){
           console.log(row)
       },
-      handleSelectProductMaterial(e,index){//选择产品名称五金
-      this.tableData[index].select_all_title = e.label
-       let obj = {
-          select_all_id: "", //产品五金ID
-          product_id: "", //产品ID
-          type_name: "", //展示用产品名称
-          position: "", //位置
-          over_price: "", //超标单价
-          over_price_total:"",//超标总价
-          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,
-          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)), //工艺属性含选项对象
-        };
-           this.tableData.push(obj);
+handleSelectProductMaterial(e,index,row){//选择产品名称五金 
+      if(e){
+        this.tableData[index].select_all_title = e.label;
+        this.getProductInfo(e,index);
+      }else{
+        this.tableData[index].select_all_title = '';
+      }
+      
+      if(row.is_new){   //如果是新的一条那就加一行
+        this.handleTableAdd();
+      }
       },
-         footerMethod({ columns, data }) {
+getProductInfo(e,index){ //选择产品/五金
+ let product_id = e.value.split('-')[0];
+ this.axios("/api/order_get_product_detail_new", {
+          params: {
+            product_id,
+            custom_id: this.info.custom_id,
+          },
+        }).then((res) => {
+            this.tableData[index].support_remark = res.data.support_remark; //获取每个产品的相应备注
+           this.tableData[index].part = res.data.part;
+           this.tableData[index].is_metal = false;
+        })
+},
+ footerMethod({ columns, data }) {
       return [
         columns.map((column, columnIndex) => {
           if (columnIndex === 0) {
@@ -1198,7 +1180,7 @@
         }),
       ];
     },
-      handleExtraDele(arr,index){
+handleExtraDele(arr,index){
         arr.splice(index,1)
       },
        handleExtraAdd(array, type) {
@@ -1310,11 +1292,16 @@
         );
         this.clientList = JSON.parse(JSON.stringify(this.cus_list));
       }
+      if(this.tableData.length==0){
+  
+        this.handleTableAdd();
+      }
     },
        handleTableAdd() {
       if (this.info.custom_id) {
         this.currentTabIndex = "0";
         let obj = {
+          is_new:true,//标记是新的
           select_all_id: "", //产品五金ID
           product_id: "", //产品ID
           type_name: "", //展示用产品名称
@@ -1351,11 +1338,14 @@
               is_metal: true,
             },
           ],
-          process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
+          // process_obj: JSON.parse(JSON.stringify(this.process_obj)), //工艺属性含选项对象
         };
-        obj.process_obj.map(
-          (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
-        );
+        // obj.process_obj.map(
+        //   (v) => ((obj[v.id] = ""), (obj.procedure_properties[v.id] = ""))
+        // );
+        this.tableData.forEach(v=>{
+          v.is_new = false  //让表格只有一条是新增的
+        })
         this.tableData.push(obj);
         this.$forceUpdate();
       } else {
@@ -1407,11 +1397,12 @@
           }
         });
     },
-      changeEditRemark(){
+      changeEditRemark(e){
 
       },
-      handleRemarkCreate(){
-
+      handleRemarkCreate(val,index){
+        console.log(index)
+       this.tableData[index].support_remark.push(val)
       },
      changeExtPrice(e, product){
 

+ 36 - 38
src/views/leadMatch/MatchList/HXYMatchCheck.vue

@@ -80,29 +80,6 @@
             </Select>
           </span>
         </Col>
-          <Col span="5">
-          <span>区域:</span>
-          <span>
-            <Select
-              filterable
-              multiple
-              filter-by-label
-              clearable
-              transfer
-              v-model="matchedInfo.t_region"
-              :max-tag-count="2"
-              size="small"
-              style="width: 150px"
-            >
-              <Option
-                v-for="(item, index) in regionList"
-                :key="index"
-                :label="item"
-                :value="item"
-              ></Option>
-            </Select>
-          </span>
-        </Col>
         <Col span="2">
           <Button @click="initData" size="small" type="primary">
             搜索
@@ -264,15 +241,40 @@
           </Col>
         </Row>
         <div v-if="matched_info.isCurrenct">
-        
-       
+          <div
+            v-for="(matched_detail, index) in matchedDetailList"
+            :key="index"
+          >
+            <Row type="flex" align="middle">
+              <Col span="10" style="padding:10px 0">
+                <span>匹配信息:</span>
+                <span
+                  v-for="(matched_info, index) in matched_detail.special"
+                  :key="index"
+                >
+                  {{ matched_info.key }}:{{ matched_info.value }}
+                </span>
+               
+              </Col>
+              <Col span="2" offset="12" style="padding:10px 0">
+                <Button
+                  @click="handleHiddenMatchedDetail(matched_detail)"
+                  size="small"
+                  type="text"
+                >
+                  {{ matched_detail.isHidden ? "展开" : "收缩" }}
+                </Button>
+              </Col>
+            </Row>
             <Table
+              v-show="!matched_detail.isHidden"
               :columns="matchedSheetTableColumns"
               border
               :max-height="500"
-              :data="matchedDetailList"
+              :data="matched_detail.detail"
             >
             </Table>
+          </div>
         </div>
       </div>
     </div>
@@ -351,7 +353,6 @@ export default {
     // 这里存放数据
     return {
       delData:{
-        regionList:[],
         user_name:'',
         password:'',
       },
@@ -361,12 +362,11 @@ export default {
       isMatchedSelectAll: false,
       matchedInfo: {
         id: this.$route.query.id,
-        image_number: [],
-        product_name: [],
+        image_number: "",
+        product_name: "",
         region: [],
         number: [],
         part_name: [],
-        t_region:[],
       },
       urlMatchedList: [],
       productMatchedList: [],
@@ -450,7 +450,7 @@ export default {
   },
   methods: {
     important_del(){
-       this.axios.post('/api/delete_cut_order_product_2',{id:[...this.delList],...this.delData}).then(res=>{
+       this.axios.post('/api/delete_cut_order_product',{id:[...this.delList],...this.delData}).then(res=>{
          if(res.code == 200){
            this.$Message.success(res.msg);
            this.delList = [];
@@ -531,7 +531,7 @@ MatchedSelect(row,e){
         this.cut_order_product_ids = this.matchedSelectedList;
        
       }
-     this.axios.post('/api/bst_pull',{type:-1,cut_order_product_ids:this.cut_order_product_ids,order_no:this.$route.query.project_number}).then(res=>{
+     this.axios.post('/api/bst_get_plan_time',{type:-1,id:this.cut_order_product_ids,order_no:this.$route.query.project_number}).then(res=>{
           if(res.code == 200){
            this.processModal = true;
              let time = [];
@@ -576,14 +576,13 @@ MatchedSelect(row,e){
     },
     initData() {
       this.axios
-        .post("/api/bst_matching_on_list_2", 
-        {
+        .get("/api/bst_matching_on_list", {
+          params: {
             id: this.matchedInfo.id,
             image_number: this.matchedInfo.image_number,
             product_name: this.matchedInfo.product_name,
-            region:this.matchedInfo.t_region
           },
-        )
+        })
         .then((res) => {
           this.matchedList = [];
           res.data.list.map((v) => {
@@ -591,7 +590,6 @@ MatchedSelect(row,e){
           });
           this.urlMatchedList = res.data.image_number;
           this.productMatchedList = res.data.product_name;
-          this.regionList = res.data.region;
           // this.matchedList = res.data.list;
           res.data.list.forEach((v, index) => {
             if (v.matching_status == 2) {
@@ -631,7 +629,7 @@ MatchedSelect(row,e){
             this.regionMatchedList = res.data.region;
             this.numberMatchedList = res.data.number;
             this.partNameMatchedList = res.data.part_name;
-            this.matchedDetailList = res.data.list[0].detail;
+            this.matchedDetailList = res.data.list;
           });
     },
   },

+ 24 - 4
src/views/leadMatch/MatchList/NewHXYMatchPage.vue

@@ -513,7 +513,7 @@
           </Row>
           <div
             v-for="matched_info in matchedList"
-            :key="matched_info.number"
+            :key="matched_info.id"
             class="matched-block"
           >
             <Row>
@@ -536,9 +536,9 @@
               </Col>
                <Col span="4">
                         <span>生产通知单号:</span>
-                        <span>{{ url_info.number }}</span>
+                        <span>{{ matched_info.product_no }}</span>
                       </Col>
-              <Col span="2" offset="8">
+              <Col span="2" offset="4">
                 <Button
                   @click="handleMatchedSet(matched_info, -1, 5)"
                   type="primary"
@@ -873,7 +873,7 @@ export default {
          { title: "区域", align: "center", key: "region", minWidth: 60 },
          { title: "户型", align: "center", key: "household", minWidth: 60 },
         { title: "房号", align: "center", key: "number", minWidth: 60 },
-        { title: "生产数量", align: "center", key: "num", minWidth: 60 },
+        { title: "生产数量", align: "center", key: "product_num", minWidth: 60 },
         { title: "备注", align: "center", key: "remark", minWidth: 60 },
       ], //未匹配房间表头
       unmatchedRoomTableColumnsUsed: [],
@@ -1240,6 +1240,26 @@ export default {
         });
     },
     handleHandingMatch() {
+      // if(this.unmatchedSelectedList.every(v=>{
+      //   return v.num>this.currentChooseNumber
+      // })){
+      //   return this.$Message.warning('数量')
+      // }
+      let arr = [];
+      this.unmatchedSelectedList.forEach(v=>{
+        arr.push(v.num)
+      })
+     let sum = arr.reduce((sum,v)=>{
+                if(Number(v)){
+           return sum+num;
+                }else{
+                  return sum
+                }
+      })
+      console.log(sum)
+      if(sum>this.currentChooseNumber){
+        return this.$Message.warning('匹配数量不能超过未匹配数量!')
+      }
       const house = this.unmatchedSelectedList.map((v) => {
         return { cut_order_product_room_id: v.id, num: v.num };
       });

+ 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://hxy_api.qingyaokeji.com" //测试服
     : process.env.NODE_ENV == "prd_other"
     ? "http://121.37.173.82:82" //贝斯特
     : "http://124.71.176.88:882";