新增商品送货方式

This commit is contained in:
weipengfei 2024-04-02 14:43:54 +08:00
parent 761fef7e32
commit 5bf33c61c0
3 changed files with 30 additions and 15 deletions

View File

@ -156,18 +156,18 @@
<view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value="" <view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value=""
placeholder="不限量" /></view> placeholder="不限量" /></view>
</view> </view>
</view> </view> -->
<view class="radio"> <view class="radio">
<view class="radio_label ">送货方式</view> <view class="radio_label ">送货方式</view>
<checkbox-group class="select_group flex_start"> <checkbox-group class="select_group flex_start" @change="changeDelivery">
<label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value"> <label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value">
<view> <view>
<checkbox :value="val.value" disabled :checked="val.value" /> <checkbox :value="val.value" :checked="setFormData.delivery_way.includes(val.value+'')" />
</view> </view>
<view>{{ val.name }}</view> <view>{{ val.name }}</view>
</label> </label>
</checkbox-group> </checkbox-group>
</view> --> </view>
</block> </block>
</view> </view>
@ -246,7 +246,7 @@
specifica: '', // specifica: '', //
// setSpecificaValue: '', // // setSpecificaValue: '', //
// setSpecificaValue2: '', // setSpecificaValue2: '',
delivery_way: [1, 2], // 1 2 delivery_way: ['1', '2'], // 1 2
delivery_free: '1', // 0 1 delivery_free: '1', // 0 1
temp_id: '', // ID temp_id: '', // ID
tempName: '' ,// tempName: '' ,//
@ -364,6 +364,9 @@
} }
}, },
methods: { methods: {
changeDelivery(e){
this.setFormData.delivery_way = e.detail.value;
},
// //
initDataEditData() { initDataEditData() {
this.setFormData = { this.setFormData = {
@ -413,6 +416,7 @@
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data
.content); .content);
this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null; this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null;
this.setFormData.delivery_way = res.data.delivery_way;
// //
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.commodityRef.setDatas({ this.$refs.commodityRef.setDatas({
@ -615,6 +619,7 @@
if (this.setFormData.spec_type == 0) { if (this.setFormData.spec_type == 0) {
console.log('价格库存', this.$refs.priceRef.singleSpecification); console.log('价格库存', this.$refs.priceRef.singleSpecification);
} }
if(this.setFormData.delivery_way.length==0) return Toast('请至少选择一种送货方式');
let postData = { let postData = {
...this.setFormData, ...this.setFormData,
...this.$refs.commodityRef.addGoodsSecoundData, ...this.$refs.commodityRef.addGoodsSecoundData,

View File

@ -156,18 +156,18 @@
<view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value="" <view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value=""
placeholder="不限量" /></view> placeholder="不限量" /></view>
</view> </view>
</view> </view> -->
<view class="radio"> <view class="radio">
<view class="radio_label ">送货方式</view> <view class="radio_label ">送货方式</view>
<checkbox-group class="select_group flex_start"> <checkbox-group class="select_group flex_start" @change="changeDelivery">
<label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value"> <label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value">
<view> <view>
<checkbox :value="val.value" disabled :checked="val.value" /> <checkbox :value="val.value" :checked="setFormData.delivery_way.includes(val.value+'')" />
</view> </view>
<view>{{ val.name }}</view> <view>{{ val.name }}</view>
</label> </label>
</checkbox-group> </checkbox-group>
</view> --> </view>
</block> </block>
</view> </view>
@ -246,7 +246,7 @@
specifica: '', // specifica: '', //
// setSpecificaValue: '', // // setSpecificaValue: '', //
// setSpecificaValue2: '', // setSpecificaValue2: '',
delivery_way: [1, 2], // 1 2 delivery_way: ['1', '2'], // 1 2 , // 1 2
delivery_free: '1', // 0 1 delivery_free: '1', // 0 1
temp_id: '', // ID temp_id: '', // ID
tempName: '' ,// tempName: '' ,//
@ -364,6 +364,9 @@
} }
}, },
methods: { methods: {
changeDelivery(e){
this.setFormData.delivery_way = e.detail.value;
},
// //
initDataEditData() { initDataEditData() {
this.setFormData = { this.setFormData = {
@ -413,6 +416,7 @@
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(res.data
.content); .content);
this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null; this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null;
this.setFormData.delivery_way = res.data.delivery_way;
// //
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.commodityRef.setDatas({ this.$refs.commodityRef.setDatas({
@ -615,6 +619,7 @@
if (this.setFormData.spec_type == 0) { if (this.setFormData.spec_type == 0) {
console.log('价格库存', this.$refs.priceRef.singleSpecification); console.log('价格库存', this.$refs.priceRef.singleSpecification);
} }
if(this.setFormData.delivery_way.length==0) return Toast('请至少选择一种送货方式');
let postData = { let postData = {
...this.setFormData, ...this.setFormData,
...this.$refs.commodityRef.addGoodsSecoundData, ...this.$refs.commodityRef.addGoodsSecoundData,

View File

@ -169,18 +169,18 @@
<view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value="" <view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value=""
placeholder="不限量" /></view> placeholder="不限量" /></view>
</view> </view>
</view> </view> -->
<view class="radio"> <view class="radio">
<view class="radio_label ">送货方式</view> <view class="radio_label ">送货方式</view>
<checkbox-group class="select_group flex_start"> <checkbox-group class="select_group flex_start" @change="changeDelivery">
<label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value"> <label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value">
<view> <view>
<checkbox :value="val.value" disabled :checked="val.value" /> <checkbox :value="val.value" :checked="setFormData.delivery_way.includes(val.value+'')" />
</view> </view>
<view>{{ val.name }}</view> <view>{{ val.name }}</view>
</label> </label>
</checkbox-group> </checkbox-group>
</view> --> </view>
</block> </block>
</view> </view>
@ -265,7 +265,7 @@
specifica: '', // specifica: '', //
// setSpecificaValue: '', // // setSpecificaValue: '', //
// setSpecificaValue2: '', // setSpecificaValue2: '',
delivery_way: [1, 2], // 1 2 delivery_way: ['1', '2'], // 1 2 , // 1 2
delivery_free: '1', // 0 1 delivery_free: '1', // 0 1
temp_id: '', // ID temp_id: '', // ID
tempName: '' ,// tempName: '' ,//
@ -399,6 +399,9 @@
this.setFormData.attrValue[this.deleteIndex].is_d_show = true; this.setFormData.attrValue[this.deleteIndex].is_d_show = true;
this.showDelete = false; this.showDelete = false;
}, },
changeDelivery(e){
this.setFormData.delivery_way = e.detail.value;
},
// //
initDataEditData() { initDataEditData() {
this.setFormData = { this.setFormData = {
@ -451,6 +454,7 @@
if(res.data.attr.length==1&&res.data.attr[0].value=='规格'){ // if(res.data.attr.length==1&&res.data.attr[0].value=='规格'){ //
this.setFormData.spec_type = 0; this.setFormData.spec_type = 0;
} }
this.setFormData.delivery_way = res.data.delivery_way;
// //
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.commodityRef.setDatas({ this.$refs.commodityRef.setDatas({
@ -654,6 +658,7 @@
// if (this.setFormData.spec_type == 0) { // if (this.setFormData.spec_type == 0) {
// console.log('', this.$refs.priceRef.singleSpecification); // console.log('', this.$refs.priceRef.singleSpecification);
// } // }
if(this.setFormData.delivery_way.length==0) return Toast('请至少选择一种送货方式');
let postData = { let postData = {
...this.setFormData, ...this.setFormData,
...this.$refs.commodityRef.addGoodsSecoundData, ...this.$refs.commodityRef.addGoodsSecoundData,