分组修改
This commit is contained in:
parent
db05de04a5
commit
c0f03ef9aa
|
|
@ -67,6 +67,16 @@ export default {
|
||||||
{ label: '订单消费出库', type: 'order-out' },
|
{ label: '订单消费出库', type: 'order-out' },
|
||||||
{ label: '损耗出库', type: 'damage-out' },
|
{ label: '损耗出库', type: 'damage-out' },
|
||||||
],
|
],
|
||||||
|
invoicingType: [
|
||||||
|
{ label: '全部', type: '' },
|
||||||
|
{ label: '手动入库', type: 'manual-in' },
|
||||||
|
{ label: '手动出库', type: 'manual-out' },
|
||||||
|
{ label: '盘盈入库', type: 'win-in' },
|
||||||
|
{ label: '盘亏出库', type: 'loss-out' },
|
||||||
|
{ label: '订单退款入库', type: 'other-out' },
|
||||||
|
{ label: '订单消费出库', type: 'order-out' },
|
||||||
|
{ label: '损耗出库', type: 'damage-out' },
|
||||||
|
],
|
||||||
getDiceName(val,key){
|
getDiceName(val,key){
|
||||||
let item = this[key].find(v => v.type == val)
|
let item = this[key].find(v => v.type == val)
|
||||||
return item ? item.label : ''
|
return item ? item.label : ''
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,20 @@ export function updateProdGroup(data, urlType = 'product') {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分组简单修改
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function editProdGroup(data, urlType = 'product') {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/admin/prod/group/update`,
|
||||||
|
method: "PUT",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品分组删除
|
* 商品分组删除
|
||||||
* @returns
|
* @returns
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,19 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="排序方式" required name="name">
|
||||||
|
<view class="u-m-t-24" >
|
||||||
|
<up-radio-group v-model="category.sortMode" placement="row" @change="groupChange">
|
||||||
|
<up-radio shape='circle' :customStyle="{marginBottom: '8px',marginRight: '30rpx'}" v-model:checked="ele.hasPermission"
|
||||||
|
usedAlone v-for="(ele, index) in pageData.sortType" :key="index" :name="ele.value" :label="ele.label"
|
||||||
|
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||||
|
</up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
</view>
|
||||||
|
</uni-forms-item>
|
||||||
<uni-forms-item label="分组排序" required name="name">
|
<uni-forms-item label="分组排序" required name="name">
|
||||||
<view class="u-m-t-24">
|
<view class="u-m-t-24">
|
||||||
<uni-number-box :value="category.sort" />
|
<up-number-box v-model="category.sort" integer></up-number-box>
|
||||||
</view>
|
</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -87,22 +96,29 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
// 构造分类的基础数据
|
// 构造分类的基础数据
|
||||||
const categoryBasicData = {
|
const category = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
status: 1,
|
status: 1,
|
||||||
sort: 0,
|
sort: 1,
|
||||||
useTime: 0,
|
useTime: 0,
|
||||||
saleEndTime:'',
|
saleEndTime:'',
|
||||||
saleStartTime:'',
|
saleStartTime:'',
|
||||||
}
|
sortMode: '0',
|
||||||
|
|
||||||
// 分类列表
|
|
||||||
const category = reactive({
|
|
||||||
...categoryBasicData,
|
|
||||||
childrenList: []
|
childrenList: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const pageData = reactive({
|
||||||
|
sortType: [
|
||||||
|
{label: '默认', value: '0'},
|
||||||
|
{label: '价格从高到低', value: '1'},
|
||||||
|
{label: '价格从低到高', value: '2'},
|
||||||
|
{label: '销量由高到低', value: '3'},
|
||||||
|
{label: '销量由低到高', value: '4'},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// 表单样式
|
// 表单样式
|
||||||
const placeholderStyle = ref('font-size:28rpx;')
|
const placeholderStyle = ref('font-size:28rpx;')
|
||||||
//表单边框
|
//表单边框
|
||||||
|
|
@ -168,6 +184,9 @@
|
||||||
time.val=''
|
time.val=''
|
||||||
time.show=false
|
time.show=false
|
||||||
}
|
}
|
||||||
|
function groupChange (n) {
|
||||||
|
console.log('groupChange ', n);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function returnValidateResult(obj) {
|
function returnValidateResult(obj) {
|
||||||
|
|
@ -212,7 +231,7 @@
|
||||||
if (result.length) {
|
if (result.length) {
|
||||||
return uni.$utils.showToast(result[0].errMeessage)
|
return uni.$utils.showToast(result[0].errMeessage)
|
||||||
}
|
}
|
||||||
|
console.log(category)
|
||||||
if (option.type === 'edit') {
|
if (option.type === 'edit') {
|
||||||
const res = await updateProdGroup({
|
const res = await updateProdGroup({
|
||||||
...category,
|
...category,
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,15 @@
|
||||||
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
|
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="u-m-t-36" >
|
||||||
|
<view>排序方式:</view>
|
||||||
|
<up-radio-group v-model="data.sortMode" placement="row" @change="groupChange">
|
||||||
|
<up-radio shape='circle' :customStyle="{marginBottom: '8px',marginRight: '30rpx'}" v-model:checked="ele.hasPermission"
|
||||||
|
usedAlone v-for="(ele, index) in pageData.sortType" :key="index" :name="ele.value" :label="ele.label"
|
||||||
|
style="margin-right: 40rpx;font-size: 28rpx;">
|
||||||
|
</up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
</view>
|
||||||
<view class="u-m-t-36">
|
<view class="u-m-t-36">
|
||||||
<view>修改排序:</view>
|
<view>修改排序:</view>
|
||||||
<view class="u-m-t-38">
|
<view class="u-m-t-38">
|
||||||
|
|
@ -49,7 +58,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const pageData = reactive({
|
||||||
|
sortType: [
|
||||||
|
{label: '默认', value: '0'},
|
||||||
|
{label: '价格从高到低', value: '1'},
|
||||||
|
{label: '价格从低到高', value: '2'},
|
||||||
|
{label: '销量由高到低', value: '3'},
|
||||||
|
{label: '销量由低到高', value: '4'},
|
||||||
|
],
|
||||||
|
})
|
||||||
const data = ref(props.item)
|
const data = ref(props.item)
|
||||||
const emits = defineEmits(['update:show', 'save'])
|
const emits = defineEmits(['update:show', 'save'])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,14 +39,13 @@
|
||||||
import editSort from './components/edit-sort.vue';
|
import editSort from './components/edit-sort.vue';
|
||||||
import editName from './components/edit-name.vue';
|
import editName from './components/edit-name.vue';
|
||||||
import editTime from './components/edit-time.vue';
|
import editTime from './components/edit-time.vue';
|
||||||
import { getProdGroupPage, addProdGroup, updateProdGroup, delProdGroup } from '@/http/api/product.js'
|
import { getProdGroupPage, addProdGroup, updateProdGroup, delProdGroup,editProdGroup } from '@/http/api/product.js'
|
||||||
|
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
showGoodsDetail: false,
|
showGoodsDetail: false,
|
||||||
query: {
|
query: {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
orderBy: 'create_time desc',
|
|
||||||
},
|
},
|
||||||
totalElements: 0,
|
totalElements: 0,
|
||||||
list: [],
|
list: [],
|
||||||
|
|
@ -165,12 +164,14 @@
|
||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
async function updataGroup(e) {
|
async function updataGroup(e) {
|
||||||
const res = await updateProdGroup(e)
|
console.log(e)
|
||||||
|
const res = await editProdGroup(e)
|
||||||
popup.sort.show = false;
|
popup.sort.show = false;
|
||||||
popup.name.show = false;
|
popup.name.show = false;
|
||||||
popup.time.show = false;
|
popup.time.show = false;
|
||||||
pageData.list[popup.selIndex] = e
|
pageData.list[popup.selIndex] = e
|
||||||
uni.$utils.showToast('更新成功')
|
uni.$utils.showToast('更新成功')
|
||||||
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -178,11 +179,11 @@
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
*/
|
*/
|
||||||
async function isSHowChange(data) {
|
async function isSHowChange(data) {
|
||||||
const res = await updateProdGroup({
|
const res = await editProdGroup({
|
||||||
...data
|
...data
|
||||||
})
|
})
|
||||||
uni.$utils.showToast('修改成功')
|
uni.$utils.showToast('更新成功')
|
||||||
// init()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue