瀏覽代碼

成本完善,其他款项添加联想功能

yuanrf 11 月之前
父節點
當前提交
aeb2638a55
共有 2 個文件被更改,包括 67 次插入4 次删除
  1. 5 2
      src/components/Finance/Cost.vue
  2. 62 2
      src/components/OP/OpDecreasePayments.vue

+ 5 - 2
src/components/Finance/Cost.vue

@@ -129,7 +129,7 @@
                     <div class="ser-btn-li">
                         <el-button size="small" :type="blackCodeIsTrue ? 'primary' : 'danger'"
                             @click="importBlackCode">导入机票行程数据</el-button>
-                        <el-button size="small" type="primary" @click="PostHotelInquiryPageItem">查看酒店询价价格</el-button>
+                        <el-button size="small" :type="hotelIsTrue ? 'primary' : 'danger'" @click="PostHotelInquiryPageItem">查看酒店询价价格</el-button>
                         <!-- <el-button size="small" type="primary">导入收款账单</el-button> -->
                         <el-button size="small" type="primary" @click="GetPriceCheckWord">生成收款账单</el-button>
                         <el-button size="small" type="primary" @click="GetClientWord">导出客户报表</el-button>
@@ -419,7 +419,7 @@
                                     <el-button @click="handleEdit(scope.$index, scope.row, 4)" size="mini"
                                         type="primary">景
                                         点</el-button>
-                                    <el-button class="history-btn" @click="GetHistoryCarData(scope.$index)" size="mini"
+                                    <el-button style='display:flex' class="history-btn" @click="GetHistoryCarData(scope.$index)" size="mini"
                                         type="primary">历史数据
                                     </el-button>
                                 </el-row>
@@ -2821,6 +2821,7 @@ export default {
             ],
             historyCarSelectObject:{},
             historyCarIndex : -1,
+            hotelIsTrue:false,
         };
     },
     watch: {
@@ -3735,6 +3736,7 @@ export default {
                         }
                     }
 
+                    that.hotelIsTrue = resp.data.data.hotelIsTrue;
                     that.blackCodeIsTrue = resp.data.data.blackCodeIsTrue;
                     that.GivePeopleNumber();
 
@@ -5784,6 +5786,7 @@ export default {
                     that.dialogTableVisibleXJ =true;
                     that.tableDatas = res.data.data;
                     that.checkboxsXJ = [];
+                    that.hotelIsTrue = res.data.data.length > 0 ? true : false;
                     //console.log(res);
                 } else {
                     that.$message.error(res.data.msg);

+ 62 - 2
src/components/OP/OpDecreasePayments.vue

@@ -76,8 +76,17 @@
                     </div>
                     <div style="width: 394px;">
                         <el-form-item label="供应商全称:" prop="supplierName" label-width="160px">
-                            <el-input placeholder="供应商全称" v-model="DecreasePaymentsData.supplierName">
-                            </el-input>
+                            <!-- <el-input placeholder="供应商全称" v-model="DecreasePaymentsData.supplierName">
+                            </el-input> -->
+
+                            <el-autocomplete
+                            style="width: 100%;"
+                            v-model="DecreasePaymentsData.supplierName"
+                            :fetch-suggestions="querySearchAsync"
+                            placeholder="供应商全称"
+                            @select="handleSelect"
+                            ></el-autocomplete>
+                            
                         </el-form-item>
                     </div>
                     <div v-if="eventspd" style="width: 394px;">
@@ -312,6 +321,7 @@ export default {
             supplierRegion:[],
             eventspd:true,
             fullscreenLoading:false,
+            queryArr : [],
         }   
     },
 
@@ -653,6 +663,56 @@ export default {
             })
 
 
+        },
+        handleSelect(item){
+            //console.log('handleSelect',item);
+            var id = item.id;
+            var that = this;
+
+            try {
+                this.queryArr.forEach((item)=>{
+                    if(item.id==id){
+                        that.DecreasePaymentsData.supplierAddress = item.supplierAddress;
+                        that.DecreasePaymentsData.supplierArea = item.supplierArea;
+                        that.DecreasePaymentsData.supplierContact = item.supplierContact;
+                        that.DecreasePaymentsData.supplierContactNumber = item.supplierContactNumber;
+                        that.DecreasePaymentsData.supplierEmail = item.supplierEmail;
+                        that.DecreasePaymentsData.supplierName = item.supplierName;
+                        that.DecreasePaymentsData.supplierSocialAccount = item.supplierSocialAccount;
+                        that.DecreasePaymentsData.supplierTypeId = item.supplierTypeId;
+                        throw new Error('stop');
+                    }
+                })
+            } catch (error) {
+                if(error.message == 'stop'){
+                    return;
+                }else{
+                    console.error(error.message);
+                }
+            }
+
+        },
+        querySearchAsync(queryString, cb) {
+            var url = "/api/Groups/QueryAssociateSupplier"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    "param": queryString
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    cb(res.data.data.map(x=>{return{
+                        value: x.supplierName,
+                        id: x.id
+                    }}));
+                    that.queryArr = res.data.data;
+                }
+            })
         }
 
     },