update 更新规格bug
This commit is contained in:
parent
e052c52cae
commit
1b3fdbd75e
@ -339,7 +339,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input_icon {
|
.input_icon {
|
||||||
/deep/ .u-icon__icon {
|
::v-deep .u-icon__icon {
|
||||||
font-size: 36rpx !important;
|
font-size: 36rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -496,7 +496,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input_icon {
|
.input_icon {
|
||||||
/deep/ .u-icon__icon {
|
::v-deep .u-icon__icon {
|
||||||
font-size: 36rpx !important;
|
font-size: 36rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -270,7 +270,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input_icon {
|
.input_icon {
|
||||||
/deep/ .u-icon__icon {
|
::v-deep.u-icon__icon {
|
||||||
font-size: 36rpx !important;
|
font-size: 36rpx !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,9 +108,9 @@
|
|||||||
></u--input>
|
></u--input>
|
||||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="分类排序" prop="category_order" class="form-item">
|
<u-form-item label="分类排序" prop="spec_order" class="form-item">
|
||||||
<u--input
|
<u--input
|
||||||
v-model="form.category_order"
|
v-model="form.spec_order"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="请输入商品排序"
|
placeholder="请输入商品排序"
|
||||||
border="none"
|
border="none"
|
||||||
@ -252,6 +252,39 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup> -->
|
</u-popup> -->
|
||||||
|
<u-popup
|
||||||
|
class="affirm-popup"
|
||||||
|
zIndex="10077"
|
||||||
|
:show="showDelectPopup"
|
||||||
|
mode="center"
|
||||||
|
>
|
||||||
|
<view class="affirm-popup-content">
|
||||||
|
<view class="affirm-popup-title">
|
||||||
|
确认删除"{{ currDelectItem.spec_name }}"规格?
|
||||||
|
</view>
|
||||||
|
<view class="popup-btn-list">
|
||||||
|
<u-button
|
||||||
|
class="btn-item"
|
||||||
|
:hairline="true"
|
||||||
|
:plain="true"
|
||||||
|
shape="circle"
|
||||||
|
@click="showDelectPopup = false"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</u-button>
|
||||||
|
<u-button
|
||||||
|
class="btn-item btn-item-2"
|
||||||
|
:hairline="true"
|
||||||
|
:plain="true"
|
||||||
|
shape="circle"
|
||||||
|
@click="handerDelectClassify"
|
||||||
|
>
|
||||||
|
确认
|
||||||
|
</u-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
<u-toast ref="uToast"></u-toast>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -276,7 +309,6 @@ export default {
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
specificationList: [],
|
specificationList: [],
|
||||||
currDelectItem: {},
|
currDelectItem: {},
|
||||||
currEidtItem: {},
|
|
||||||
showDelectPopup: false,
|
showDelectPopup: false,
|
||||||
showAddAndEditPopup: false,
|
showAddAndEditPopup: false,
|
||||||
form: {
|
form: {
|
||||||
@ -315,7 +347,6 @@ export default {
|
|||||||
let res = await GetCommodityClassify();
|
let res = await GetCommodityClassify();
|
||||||
if (res && res.status == 200) {
|
if (res && res.status == 200) {
|
||||||
const classifyList = res.data;
|
const classifyList = res.data;
|
||||||
|
|
||||||
if (classifyList.length > 0) {
|
if (classifyList.length > 0) {
|
||||||
this.baTreePickerList = classifyList.map((item) => {
|
this.baTreePickerList = classifyList.map((item) => {
|
||||||
// 创建父节点,并保留所有原始字段
|
// 创建父节点,并保留所有原始字段
|
||||||
@ -357,11 +388,50 @@ export default {
|
|||||||
this.currDelectItem = item;
|
this.currDelectItem = item;
|
||||||
this.showDelectPopup = true;
|
this.showDelectPopup = true;
|
||||||
},
|
},
|
||||||
|
handerShowEeditPopup(item){
|
||||||
|
this.isAdd = false
|
||||||
|
item = {
|
||||||
|
spec_category_name: "",
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
this.form = item;
|
||||||
|
|
||||||
|
const findCategory = (categories, targetId) => {
|
||||||
|
for (const category of categories) {
|
||||||
|
// Check current category
|
||||||
|
if (category.category_id === targetId) {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check subcategories if they exist
|
||||||
|
if (category.children && category.children.length > 0) {
|
||||||
|
const foundInSub = findCategory(category.children, targetId);
|
||||||
|
if (foundInSub) return foundInSub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.baTreePickerList.length > 0){
|
||||||
|
const matchedCategory = findCategory(this.baTreePickerList, item.spec_category_id);
|
||||||
|
if (matchedCategory) {
|
||||||
|
this.form.spec_category_name = matchedCategory.category_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.showAddAndEditPopup = true
|
||||||
|
},
|
||||||
hadnerShowClassifyListPopup() {
|
hadnerShowClassifyListPopup() {
|
||||||
this.$refs.tkitree._show();
|
this.$refs.tkitree._show();
|
||||||
},
|
},
|
||||||
handerAddAndEditPopup(isAdd) {
|
handerAddAndEditPopup(isAdd) {
|
||||||
this.isAdd = isAdd;
|
this.isAdd = isAdd;
|
||||||
|
this.form = {
|
||||||
|
spec_name: "",
|
||||||
|
spec_order: "",
|
||||||
|
spec_category_id: "",
|
||||||
|
spec_format: "text",
|
||||||
|
spec_category_name: "",
|
||||||
|
}
|
||||||
this.showAddAndEditPopup = true;
|
this.showAddAndEditPopup = true;
|
||||||
},
|
},
|
||||||
async handerAffirmAddAndEdit() {
|
async handerAffirmAddAndEdit() {
|
||||||
@ -374,10 +444,48 @@ export default {
|
|||||||
type: "succeed",
|
type: "succeed",
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
|
this.showAddAndEditPopup = false
|
||||||
this.getSpecificationList(true);
|
this.getSpecificationList(true);
|
||||||
|
this.form = {
|
||||||
|
spec_name: "",
|
||||||
|
spec_order: "",
|
||||||
|
spec_category_id: "",
|
||||||
|
spec_format: "text",
|
||||||
|
spec_category_name: "",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async handerDelectClassify(){
|
||||||
|
let params = {
|
||||||
|
spec_ids:this.currDelectItem.spec_id
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await DelectSpecification(params)
|
||||||
|
if(res && res.status == 200){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "succeed",
|
||||||
|
duration: 1000,
|
||||||
|
});
|
||||||
|
this.showDelectPopup = false
|
||||||
|
this.getSpecificationList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
treeCancel(){
|
||||||
|
this.$refs.tkitree._hide();
|
||||||
|
|
||||||
|
},
|
||||||
|
treeConfirm(list){
|
||||||
|
console.log(this.form)
|
||||||
|
if(list.length > 1){
|
||||||
|
this.form.spec_category_name = list[1].category_name;
|
||||||
|
this.form.spec_category_id = list[1].category_id;
|
||||||
|
}else{
|
||||||
|
this.form.spec_category_name = list[0].category_name;
|
||||||
|
this.form.spec_category_id = list[0].category_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -456,6 +564,53 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.affirm-popup {
|
||||||
|
::v-deep.u-popup__content {
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.u-fade-enter-to {
|
||||||
|
z-index: 10076 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.affirm-popup-content {
|
||||||
|
width: 600rpx;
|
||||||
|
|
||||||
|
.affirm-popup-title {
|
||||||
|
padding: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.affirm-popup-tips {
|
||||||
|
padding: 0 60rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btn-list {
|
||||||
|
display: flex;
|
||||||
|
margin: 50rpx;
|
||||||
|
|
||||||
|
.btn-item {
|
||||||
|
width: 46%;
|
||||||
|
height: 80rpx;
|
||||||
|
border-color: #909193;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-item-2 {
|
||||||
|
background: $base-color;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.add-popup {
|
.add-popup {
|
||||||
::v-deep.u-popup__content {
|
::v-deep.u-popup__content {
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user