Zhouzhendong 5 лет назад
Родитель
Сommit
15033e412e

+ 3 - 3
app/Owner.php

@@ -102,7 +102,7 @@ class Owner extends Model
     }
     public function ownerStoragePriceModels()
     {   //仓储计费
-        $query = OwnerPriceExpress::query()->select("target_id")
+        $query = OwnerStoragePriceModel::query()->select("target_id")
             ->whereNotNull("operation")->where("operation","!=","")
             ->whereNotNull("target_id")->where("target_id","!=","");
         return $this->belongsToMany(OwnerStoragePriceModel::class,"owner_storage_price_model_owner","owner_id","owner_storage_price_model_id")
@@ -132,7 +132,7 @@ class Owner extends Model
     }
     public function ownerPriceLogistics()
     {   //物流计费
-        $query = OwnerPriceExpress::query()->select("target_id")
+        $query = OwnerPriceLogistic::query()->select("target_id")
             ->whereNotNull("operation")->where("operation","!=","")
             ->whereNotNull("target_id")->where("target_id","!=","");
         return $this->belongsToMany(OwnerPriceLogistic::class,"owner_price_logistic_owner","owner_id","owner_price_logistic_id")
@@ -142,7 +142,7 @@ class Owner extends Model
     }
     public function ownerPriceDirectLogistics()
     {   //直发车计费
-        $query = OwnerPriceExpress::query()->select("target_id")
+        $query = OwnerPriceDirectLogistic::query()->select("target_id")
             ->whereNotNull("operation")->where("operation","!=","")
             ->whereNotNull("target_id")->where("target_id","!=","");
         return $this->belongsToMany(OwnerPriceDirectLogistic::class,"owner_price_direct_logistic_owner","owner_id","owner_price_direct_logistic_id")

+ 24 - 27
resources/views/customer/project/create.blade.php

@@ -201,10 +201,7 @@
                 searchItem:{},//搜索子项集
                 searchBase:5,//搜索基数
                 hover:{},//可悬浮列表
-                audit:{},
-                filterCustomers:[],
-                filterOwnerGroups:[],
-                filterUserGroups:[],
+                audit:{},//审核按钮
             },
             created(){
                 this.filterCustomers = JSON.parse(JSON.stringify(this.customers));
@@ -1838,33 +1835,33 @@
                 },
                 filterCustomer(e){
                     let value = e.target.value;
-                    if (value===""){
-                        this.filterCustomers=JSON.parse(JSON.stringify(this.customers));
-                        return;
-                    }
-                    this.filterCustomers = this.customers.filter(function(item){
-                        return item.name.includes(value);
-                    })
+                    if (!value)this.owner.customer_id = "";
+                    this.customers.some(customer=>{
+                        if (customer.name.indexOf(value)!==-1){
+                            this.owner.customer_id = customer.id;
+                            return true;
+                        }
+                    });
                 },
                 filterOwnerGroup(e){
-                    let value = $(e.target).val();
-                    if (value===""){
-                        this.filterOwnerGroups=JSON.parse(JSON.stringify(this.ownerGroups));
-                        return;
-                    }
-                    this.filterOwnerGroups = this.ownerGroups.filter(function(item){
-                        return item.name.includes(value);
-                    })
+                    let value = e.target.value;
+                    if (!value)this.owner.owner_group_id = "";
+                    this.ownerGroups.some(ownerGroup=>{
+                        if (ownerGroup.name.indexOf(value)!==-1){
+                            this.owner.owner_group_id = ownerGroup.id;
+                            return true;
+                        }
+                    });
                 },
                 filterUserGroup(e){
-                    let value = $(e.target).val();
-                    if (value===""){
-                        this.filterCustomers=JSON.parse(JSON.stringify(this.customers));
-                        return;
-                    }
-                    this.filterCustomers = this.customers.filter(function(item){
-                        return item.name.includes(value);
-                    })
+                    let value = e.target.value;
+                    if (!value)this.owner.user_workgroup_id = "";
+                    this.userGroups.some(userGroup=>{
+                        if (userGroup.name.indexOf(value)!==-1){
+                            this.owner.user_workgroup_id = userGroup.id;
+                            return true;
+                        }
+                    });
                 },
             },
         });

+ 5 - 5
resources/views/customer/project/part/_two.blade.php

@@ -1,9 +1,9 @@
 <div class="row mt-3">
     <label for="customer_id" class="col-2 text-info">客户</label>
     <select id="customer_id" v-model="owner.customer_id" @change="selectOwner()" class="form-control form-control-sm col-4 mb-0" :class="errors.customer_id ? 'is-invalid' : ''">
-        <option v-for="customer in filterCustomers" :value="customer.id">@{{ customer.name }}</option>
+        <option v-for="customer in customers" :value="customer.id">@{{ customer.name }}</option>
     </select>
-    <label class="col-2"><input type="text" class="form-control form-control-sm rounded-pill" placeholder="输入关键字定位客户" @change="filterCustomer($event)"></label>
+    <label class="col-2"><input type="text" class="form-control form-control-sm rounded-pill" placeholder="输入关键字定位客户" @input="filterCustomer($event)"></label>
     <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.customer_id">
         <strong>@{{ errors.customer_id[0] }}</strong>
     </span>
@@ -11,9 +11,9 @@
 <div class="row mt-3">
     <label for="owner_group_id" class="col-2 text-info">项目小组</label>
     <select id="owner_group_id" v-model="owner.owner_group_id" @change="selectGroup()" class="form-control form-control-sm col-4 mb-0" :class="errors.owner_group_id ? 'is-invalid' : ''" >
-        <option v-for="ownerGroup in filterOwnerGroups" :value="ownerGroup.id">@{{ ownerGroup.name }}</option>
+        <option v-for="ownerGroup in ownerGroups" :value="ownerGroup.id">@{{ ownerGroup.name }}</option>
     </select>
-    <label class="col-2"><input type="text" class="form-control form-control-sm rounded-pill" placeholder="输入关键字项目小组" @change="filterOwnerGroup($event)"></label>
+    <label class="col-2"><input type="text" class="form-control form-control-sm rounded-pill" placeholder="输入关键字项目小组" @input="filterOwnerGroup($event)"></label>
     <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.owner_group_id">
         <strong>@{{ errors.owner_group_id[0] }}</strong>
     </span>
@@ -30,7 +30,7 @@
 <div class="row mt-3">
     <label for="user_workgroup_id" class="col-2 text-info">仓库小组</label>
     <select id="user_workgroup_id" v-model="owner.user_workgroup_id" @change="selectGroup()" class="form-control form-control-sm col-4 mb-0" :class="errors.user_workgroup_id ? 'is-invalid' : ''" >
-        <option v-for="userGroup in filterUserGroups" :value="userGroup.id" v-if="userGroup.warehouse_id == owner.warehouse_id">@{{ userGroup.name }}</option>
+        <option v-for="userGroup in userGroups" :value="userGroup.id" v-if="userGroup.warehouse_id == owner.warehouse_id">@{{ userGroup.name }}</option>
     </select>
     <label class="col-2"><input type="text" class="form-control form-control-sm rounded-pill" placeholder="输入关键字项目小组" @change="filterUserGroup($event)"></label>
     <span class="invalid-feedback offset-2 mt-0" role="alert" v-if="errors.user_workgroup_id">