|
|
@@ -33,14 +33,14 @@
|
|
|
<td class="">@{{ procurement.created_at }}</td>
|
|
|
<td class=""></td>
|
|
|
<td class=""></td>
|
|
|
- <td class="">@{{ procurement.owner_name }}</td>
|
|
|
- <td class="">@{{ procurement.company_name }}</td>
|
|
|
- <td class="">@{{ procurement.supplier_name }}</td>
|
|
|
- <td class="tooltipTarget" style="max-width: 200px;overflow:hidden">@{{ procurement.material_code }}</td>
|
|
|
- <td class="text-muted">@{{ procurement.material_name }}</td>
|
|
|
- <td class="text-muted">@{{ procurement.size }}</td>
|
|
|
- <td class="text-muted">@{{ procurement.special }}</td>
|
|
|
- <td class="text-muted">@{{ procurement.specification }}</td>
|
|
|
+ <td v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</td>
|
|
|
+ <td v-if="procurement.owner_material.owner.customer">@{{ procurement.owner_material.owner.customer.company_name }}</td>
|
|
|
+ <td v-if="procurement.supplier">@{{ procurement.supplier.name }}</td>
|
|
|
+ <td class="tooltipTarget" style="max-width: 200px;overflow:hidden" v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.code }}</td>
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.name }}</td>
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.size }}</td>
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.special }}</td>
|
|
|
+ <td class="text-muted" v-if="procurement.owner_material">@{{ procurement.owner_material.specification }}</td>
|
|
|
<td>@{{ procurement.quantity }}</td>{{--采购数量--}}
|
|
|
<td>@{{ procurement.amount }}</td> {{--销售数量--}}
|
|
|
<td></td>
|
|
|
@@ -51,10 +51,13 @@
|
|
|
<td><span>@{{ procurement_status[procurement.status] }}</span></td>
|
|
|
<td>
|
|
|
<span class="btn btn-sm btn-outline-danger">锁定</span>
|
|
|
- <span class="btn btn-sm btn-outline-success">修改采购单价</span>
|
|
|
+ <span class="btn btn-sm btn-outline-success" @click="changeCostPrice(procurement.id,procurement.cost_price)">修改采购单价</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
+ @can('采购管理-财务-采购账单')
|
|
|
+ @include('procurement.finance._changeCostPrice')
|
|
|
+ @endcan
|
|
|
<div class="text-info h5 btn btn">{{$procurements->count()}}/@{{ sum }}</div>
|
|
|
<div>{{$procurements->appends($paginateParams)->links()}}</div>
|
|
|
</div>
|
|
|
@@ -67,25 +70,7 @@
|
|
|
let vue = new Vue({
|
|
|
el: '#list',
|
|
|
data: {
|
|
|
- procurements: [
|
|
|
- @foreach($procurements as $procurement)
|
|
|
- {
|
|
|
- id:'{{$procurement->id}}',code:'{{$procurement->code}}',type:'{{$procurement->type}}',created_at:'{{$procurement->created_at}}',
|
|
|
- quantity:'{{$procurement->quantity}}',unit_price:'{{$procurement->unit_price}}',status:'{{$procurement->status}}',cost_price:'{{$procurement->cost_price}}',
|
|
|
- @if($procurement->ownerMaterial)
|
|
|
- owner_id:'{{$procurement->ownerMaterial->owner_id}}',size:'{{$procurement->ownerMaterial->size}}',
|
|
|
- special:'{{$procurement->ownerMaterial->special}}',specification:'{{$procurement->ownerMaterial->specification}}',@endif
|
|
|
- @if($procurement->ownerMaterial->material)
|
|
|
- material_id:'{{$procurement->ownerMaterial->material->id}}',material_code:'{{$procurement->ownerMaterial->material->code}}',
|
|
|
- material_name:'{{$procurement->ownerMaterial->material->name}}',@endif
|
|
|
- @if($procurement->ownerMaterial->owner)owner_name:'{{$procurement->ownerMaterial->owner->name}}',@endif
|
|
|
- @if($procurement->supplier)supplier_name:'{{$procurement->supplier->name}}',@endif
|
|
|
- @if($procurement->ownerMaterial->owner->customer)
|
|
|
- company_name:'{{$procurement->ownerMaterial->owner->customer->company_name}}',customer_id:'{{$procurement->ownerMaterial->owner->customer->id}}',
|
|
|
- phone:'{{$procurement->ownerMaterial->owner->customer->phone}}',@endif
|
|
|
- },
|
|
|
- @endforeach
|
|
|
- ],
|
|
|
+ procurements: {!! $procurements->toJson() !!}['data'],
|
|
|
owners:[
|
|
|
@foreach($owners as $owner)
|
|
|
{name:'{{$owner->id}}',value:'{{$owner->name}}'},
|
|
|
@@ -104,6 +89,7 @@
|
|
|
checkData: [],
|
|
|
sum:{!! $procurements->total() !!},
|
|
|
procurement_status:{!! json_encode(\App\Procurement::status,JSON_UNESCAPED_UNICODE) !!},
|
|
|
+ procurement_id:'',cost_price:'',
|
|
|
|
|
|
},
|
|
|
mounted: function () {
|
|
|
@@ -188,6 +174,32 @@
|
|
|
this.checkData = [];
|
|
|
}
|
|
|
},
|
|
|
+ changeCostPrice(id,cost_price){
|
|
|
+ this.procurement_id=id;
|
|
|
+ this.cost_price=cost_price;
|
|
|
+ $("#change-costPrice").modal('show');
|
|
|
+ },
|
|
|
+ costPrice(){
|
|
|
+ let _this=this;
|
|
|
+ let url='{{url('procurement/finance/costPrice')}}';
|
|
|
+ let param={id:_this.procurement_id,cost_price:_this.cost_price};
|
|
|
+ window.axios.post(url,param).then(function (res) {
|
|
|
+ if (res.data.success){
|
|
|
+ _this.procurements.forEach(function (procurement) {
|
|
|
+ if (procurement.id===res.data.data.id){
|
|
|
+ procurement.cost_price=res.data.data.cost_price;
|
|
|
+ $("#change-costPrice").modal('hide');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show(res.data.message);
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("网络错误:" + err);
|
|
|
+ })
|
|
|
+ },
|
|
|
procurementBillExport(selectAll){
|
|
|
let url = '{{url('procurement/finance/procurementBillExport')}}';
|
|
|
let token='{{ csrf_token() }}';
|