|
|
|
|
@ -95,21 +95,31 @@
|
|
|
|
|
<x-admin-form-input name="position" :title="__('common.sort_order')" :value="old('position', $product->position ?? '0')" />
|
|
|
|
|
|
|
|
|
|
<x-admin::form.row :title="__('admin/product.length_width_height')">
|
|
|
|
|
<div class="d-flex wp-400">
|
|
|
|
|
<input type="text" name="length" placeholder="{{ __('admin/product.length') }}" value="{{ old('weight', $product->length ?? '') }}" class="form-control" style="flex: 0 0 95px" /><div style="width: 40px;line-height: 34px;text-align:center">CM X</div>
|
|
|
|
|
<input type="text" name="width" placeholder="{{ __('admin/product.width') }}" value="{{ old('weight', $product->width ?? '') }}" class="form-control" style="flex: 0 0 95px" /><div style="width: 40px;line-height: 34px;text-align:center">CM X</div>
|
|
|
|
|
<input type="text" name="height" placeholder="{{ __('admin/product.height') }}" value="{{ old('weight', $product->height ?? '') }}" class="form-control" style="flex: 0 0 95px" /><div style="width: 30px;line-height: 34px;text-align:center">CM</div>
|
|
|
|
|
<div class="d-flex wp-500">
|
|
|
|
|
<input type="text" name="length" placeholder="{{ __('admin/product.length') }}" value="{{ old('weight', $product->length ?? '') }}" class="form-control" style="flex: 0 0 95px" />
|
|
|
|
|
<div style="width: 40px;line-height: 34px;text-align:center">CM X</div>
|
|
|
|
|
<input type="text" name="width" placeholder="{{ __('admin/product.width') }}" value="{{ old('weight', $product->width ?? '') }}" class="form-control" style="flex: 0 0 95px" />
|
|
|
|
|
<div style="width: 40px;line-height: 34px;text-align:center">CM X</div>
|
|
|
|
|
<input type="text" name="height" placeholder="{{ __('admin/product.height') }}" value="{{ old('weight', $product->height ?? '') }}" class="form-control" style="flex: 0 0 95px" />
|
|
|
|
|
<div style="width: 30px;line-height: 34px;text-align:center">CM</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
|
|
|
|
|
<x-admin::form.row :title="__('admin/product.weight_text')">
|
|
|
|
|
<div class="d-flex wp-400">
|
|
|
|
|
<div class="d-flex wp-500">
|
|
|
|
|
<input type="text" name="weight" placeholder="{{ __('admin/product.weight_text') }}" value="{{ old('weight', $product->weight ?? '') }}" class="form-control" style="flex: 0 0 260px" />
|
|
|
|
|
<select class="form-select ms-4 bg-white" name="weight_class">
|
|
|
|
|
<select class="form-select ms-4 bg-white wp-100" name="weight_class">
|
|
|
|
|
@foreach ($weight_classes as $item)
|
|
|
|
|
<option value="{{ $item }}" {{ $product->weight_class == $item ? 'selected' : '' }}>{{ __('product.' . $item) }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
|
|
|
|
|
@ -138,6 +148,28 @@
|
|
|
|
|
|
|
|
|
|
{{--计量单位--}}
|
|
|
|
|
<x-admin-form-input-locale :width="600" name="descriptions.*.unit" title="{{ __('product.unit_of_measurement') }}" :value="$descriptions" :required="true" />
|
|
|
|
|
{{--销售方式--}}
|
|
|
|
|
<x-admin::form.row title="{{ __('product.sales_method') }}">
|
|
|
|
|
<div class="mb-1 mt-2">
|
|
|
|
|
<div class="form-check form-check-inline">
|
|
|
|
|
<input v-model="form.sales_method" class="form-check-input" id="sales_method-piece" type="radio" name="sales_method" value="piece">
|
|
|
|
|
<label class="form-check-label" for="sales_method-piece">{{ __('product.sales_method_piece') }}</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-check form-check-inline">
|
|
|
|
|
<input v-model="form.sales_method" class="form-check-input" id="sales_method-batches" type="radio" name="sales_method" value="batches">
|
|
|
|
|
<label class="form-check-label" for="sales_method-batches">{{ __('product.sales_method_batches') }}</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
<template v-if="form.sales_method == 'batches'">
|
|
|
|
|
<x-admin::form.row :title="__('product.one_batch_is_equal_to')" required>
|
|
|
|
|
<div class="d-flex wp-400">
|
|
|
|
|
<input type="number" v-model="form.piece_to_batch" name="piece_to_batch" class="form-control" style="flex: 0 0 95px" />
|
|
|
|
|
<div style="width: 40px;line-height: 34px;text-align:center">{{ __('product.piece') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
{{--状态--}}
|
|
|
|
|
<x-admin::form.row title="{{ __('common.status') }}">
|
|
|
|
|
<div class="mb-1 mt-2">
|
|
|
|
|
@ -183,14 +215,26 @@
|
|
|
|
|
<div class="num">
|
|
|
|
|
<div class="top">
|
|
|
|
|
<div class="title">≧</div>
|
|
|
|
|
<input type="number" :name="'numPrices[' + index + '][num]'" v-model="item.num" value="" placeholder="数量" required="required" class="form-control wp-100">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tip" ><span style="visibility: hidden;">_</span><span v-if="item.num">@{{ item.num }}件</span></div>
|
|
|
|
|
<input type="number" :name="'numPrices[' + index + '][num]'" v-model="item.num" value="" placeholder="数量" required="required" class="form-control wp-100">
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tip" >
|
|
|
|
|
<span style="visibility: hidden;">_</span>
|
|
|
|
|
<span v-if="item.num">@{{ form.sales_method == 'piece' ? item.num : item.num * form.piece_to_batch }}{{ __('product.piece') }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="price">
|
|
|
|
|
<input type="number" :name="'numPrices[' + index + '][price]'" v-model="item.price" value="" placeholder="价格" required="required" step="any" class="form-control wp-100">
|
|
|
|
|
<div class="tip" v-if="item.price">@{{ item.num }}件等于价格:@{{ item.num * item.price }}</div>
|
|
|
|
|
<input type="number" :name="'numPrices[' + index + '][price]'" v-model="item.price" value="" placeholder="价格" required="required" step="any" class="form-control wp-100">
|
|
|
|
|
<div class="tip" v-if="item.price">
|
|
|
|
|
<tmplate v-if="form.sales_method == 'piece'">
|
|
|
|
|
@{{ item.num }}件等于价格:@{{ (item.num * item.price).toFixed(2) }}
|
|
|
|
|
</tmplate>
|
|
|
|
|
<template v-else>
|
|
|
|
|
@{{ item.num }}批含@{{ item.num * form.piece_to_batch }}件商品($@{{ item.price }}/件),@{{ item.num }}批总价$@{{ ((item.num * form.piece_to_batch) * item.price).toFixed(2) }}
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="delete" @click="removeNumPrices(index)"><a style="cursor: pointer;color: #0072ff;">删除</a></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -204,8 +248,10 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="body">
|
|
|
|
|
<div class="item" v-for="(item,index) in form.numPrices">
|
|
|
|
|
<div class="num" v-if="index < form.numPrices.length - 1">@{{ item.num }} ~ @{{ form.numPrices[index + 1].num - 1 }}</div>
|
|
|
|
|
<div class="num" v-else-if="item.num">≧@{{ item.num }}</div>
|
|
|
|
|
<div class="num" v-if="index < form.numPrices.length - 1">
|
|
|
|
|
@{{ form.sales_method == 'piece' ? item.num : item.num * form.piece_to_batch }} ~ @{{ form.sales_method == 'piece' ? (form.numPrices[index + 1].num - 1) : form.numPrices[index + 1].num * form.piece_to_batch - 1 }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="num" v-else-if="item.num">≧@{{ form.sales_method == 'piece' ? item.num : item.num * form.piece_to_batch }}</div>
|
|
|
|
|
<div class="price" v-if="item.price">价格@{{ item.price }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -396,19 +442,31 @@
|
|
|
|
|
{{-- 未开启根据数量设置价格、直接下单产品 --}}
|
|
|
|
|
<template v-if="form.price_setting === 'sku' && form.active == 1">
|
|
|
|
|
<x-admin::form.row :title="__('admin/product.minimum_order')" required>
|
|
|
|
|
<input type="number" name="minimum_order" v-model="form.minimum_order" class="form-control wp-400"/>
|
|
|
|
|
<div class="d-flex wp-500">
|
|
|
|
|
<input type="number" name="minimum_order" v-model="form.minimum_order" class="form-control"/>
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
</template>
|
|
|
|
|
{{-- 未开启根据数量设置价格、非直接下单商品 --}}
|
|
|
|
|
<template v-else-if="form.price_setting === 'sku' && form.active != 1">
|
|
|
|
|
<x-admin::form.row :title="__('admin/product.minimum_order')">
|
|
|
|
|
<input type="number" name="minimum_order" v-model="form.minimum_order" class="form-control wp-400" />
|
|
|
|
|
<div class="d-flex wp-500">
|
|
|
|
|
<input type="number" name="minimum_order" v-model="form.minimum_order" class="form-control"/>
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
</template>
|
|
|
|
|
{{--开启根据数量设置价格 - 数量固定为最小起订量--}}
|
|
|
|
|
<template v-else>
|
|
|
|
|
<x-admin::form.row :title="__('admin/product.minimum_order')" required>
|
|
|
|
|
<input type="number" name="minimum_order" :value="form.numPrices.length !== 0 ? form.numPrices[0].num : 0" class="form-control wp-400" readonly/>
|
|
|
|
|
<div class="d-flex wp-500">
|
|
|
|
|
<input type="number" name="minimum_order" :value="form.numPrices.length !== 0 ? form.numPrices[0].num : 0" class="form-control" readonly/>
|
|
|
|
|
<div v-if="form.sales_method == 'piece'" style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.piece') }}</div>
|
|
|
|
|
<div v-else style="width: 30px;line-height: 34px;text-align:center">/{{ __('product.batches') }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</x-admin::form.row>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -672,6 +730,8 @@
|
|
|
|
|
price_setting: @json(old('price_setting', $product->price_setting) ?? 'sku'),
|
|
|
|
|
numPrices: @json(old('numPrices', $product->numprices) ?? []),
|
|
|
|
|
minimum_order: {{$product->minimum_order ?? 0}},
|
|
|
|
|
sales_method: '{{$product->sales_method ?? 'piece'}}',
|
|
|
|
|
piece_to_batch: {{$product->piece_to_batch ?? 1}}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
variablesBatch: {
|
|
|
|
|
|