fix: BUG修复

feature/task1.0.0__0514__ch
向文可 3 years ago
parent cb21c08fea
commit e4bd675e09

@ -1,2 +1,2 @@
VITE_BASE_URL=/api VITE_BASE_URL=/api
VITE_REQUEST_TIMEOUT=10000 VITE_REQUEST_TIMEOUT=5000

@ -59,6 +59,12 @@ export const close = (data) => {
data, data,
}); });
}; };
export const searchShip = () => {
return request({
url: '/mall/trade/admin/tradeOrder/logisticsCompany',
method: 'get',
});
};
export const send = (data) => { export const send = (data) => {
return request({ return request({
url: '/mall/trade/admin/tradeOrder/delivery', url: '/mall/trade/admin/tradeOrder/delivery',

@ -15,7 +15,7 @@ export default [
component: () => import('@/views/sales/order/index.vue'), component: () => import('@/views/sales/order/index.vue'),
meta: { meta: {
title: '订单管理', title: '订单管理',
icon: 'barcode-box-fill', icon: 'Checked',
}, },
children: [ children: [
{ {
@ -24,7 +24,7 @@ export default [
component: () => import('@/views/sales/order/detail.vue'), component: () => import('@/views/sales/order/detail.vue'),
meta: { meta: {
title: '订单详情', title: '订单详情',
icon: 'barcode-box-fill', icon: 'Checked',
hidden: true, hidden: true,
}, },
}, },
@ -34,7 +34,7 @@ export default [
component: () => import('@/views/sales/order/ship.vue'), component: () => import('@/views/sales/order/ship.vue'),
meta: { meta: {
title: '批量发货', title: '批量发货',
icon: 'barcode-box-fill', icon: 'Van',
hidden: true, hidden: true,
}, },
}, },
@ -67,7 +67,7 @@ export default [
component: () => import('@/views/sales/category/index.vue'), component: () => import('@/views/sales/category/index.vue'),
meta: { meta: {
title: '商品分类', title: '商品分类',
icon: 'barcode-box-fill', icon: 'TakeawayBox',
}, },
children: [ children: [
{ {
@ -76,7 +76,7 @@ export default [
component: () => import('@/views/sales/category/form.vue'), component: () => import('@/views/sales/category/form.vue'),
meta: { meta: {
title: '创建分类', title: '创建分类',
icon: 'barcode-box-fill', icon: 'TakeawayBox',
hidden: true, hidden: true,
}, },
}, },
@ -86,7 +86,7 @@ export default [
component: () => import('@/views/sales/category/form.vue'), component: () => import('@/views/sales/category/form.vue'),
meta: { meta: {
title: '编辑分类', title: '编辑分类',
icon: 'barcode-box-fill', icon: 'TakeawayBox',
hidden: true, hidden: true,
}, },
}, },
@ -98,7 +98,7 @@ export default [
component: () => import('@/views/sales/product/index.vue'), component: () => import('@/views/sales/product/index.vue'),
meta: { meta: {
title: '商品管理', title: '商品管理',
icon: 'barcode-box-fill', icon: 'MessageBox',
}, },
children: [ children: [
{ {
@ -107,7 +107,7 @@ export default [
component: () => import('@/views/sales/product/form/index.vue'), component: () => import('@/views/sales/product/form/index.vue'),
meta: { meta: {
title: '创建商品', title: '创建商品',
icon: 'barcode-box-fill', icon: 'MessageBox',
hidden: true, hidden: true,
}, },
}, },
@ -117,7 +117,7 @@ export default [
component: () => import('@/views/sales/product/form/index.vue'), component: () => import('@/views/sales/product/form/index.vue'),
meta: { meta: {
title: '编辑商品', title: '编辑商品',
icon: 'barcode-box-fill', icon: 'MessageBox',
hidden: true, hidden: true,
}, },
}, },

@ -34,7 +34,7 @@ const actions = {
load: async ({ commit }) => { load: async ({ commit }) => {
commit('setOpts', { commit('setOpts', {
init: true, init: true,
company: [{ label: '顺丰', value: 'sf' }], company: await api.searchShip(),
}); });
}, },
save: async ({ rootState }, data) => { save: async ({ rootState }, data) => {

@ -51,11 +51,6 @@
autoSearch: false, autoSearch: false,
page: false, page: false,
columns: [ columns: [
{
type: 'selection',
fixed: 'left',
width: 60,
},
{ {
label: '订单编号', label: '订单编号',
prop: 'orderNo', prop: 'orderNo',
@ -81,7 +76,13 @@
label: '配送方式', label: '配送方式',
width: 120, width: 120,
slots: { slots: {
default: ({ row }) => <ElSelect v-model={row.logistics.companyCode} opts={unref(opts).company} />, default: ({ row }) => (
<ElSelect
v-model={row.logistics.companyCode}
opts={unref(opts).company}
config={{ label: 'companyName', value: 'companyCode' }}
/>
),
}, },
}, },
{ {

@ -130,7 +130,16 @@
const id = route.params.id; const id = route.params.id;
if (id && id !== state.form.id) { if (id && id !== state.form.id) {
state.form.id = id; state.form.id = id;
let res = await store.dispatch('productSkus/search', id); let res = await store.dispatch('productAttrsGroup/search', id);
let arr = [];
res.forEach((item) => {
arr.push(
store.dispatch('productAttrsValue/search', item.id).then((res) => (item.values = res))
);
});
await Promise.all(arr);
state.form.attrsGroupList = res;
res = await store.dispatch('productSkus/search', id);
state.form.skuInfos = res.map((item) => { state.form.skuInfos = res.map((item) => {
return { return {
...item, ...item,
@ -140,15 +149,6 @@
stockAfter: item.stock, stockAfter: item.stock,
}; };
}); });
res = await store.dispatch('productAttrsGroup/search', id);
let arr = [];
res.forEach((item) => {
arr.push(
store.dispatch('productAttrsValue/search', item.id).then((res) => (item.values = res))
);
});
await Promise.all(arr);
state.form.attrsGroupList = res;
} }
}; };
onActivated(handleLoad); onActivated(handleLoad);
@ -247,6 +247,7 @@
}); });
if (res) { if (res) {
sku.values = await store.dispatch('productAttrsValue/search', sku.id); sku.values = await store.dispatch('productAttrsValue/search', sku.id);
state.skuValue[index] = null;
} else { } else {
proxy.$message.error('添加属性值失败'); proxy.$message.error('添加属性值失败');
} }
@ -282,13 +283,11 @@
attributeSymbolList: item.attributeSymbolList.join(','), attributeSymbolList: item.attributeSymbolList.join(','),
}; };
}); });
await store.dispatch('productSkus/save', { id: route.params.id, data });
if (enable) { if (enable) {
let product = await store.dispatch('product/detail', route.params.id); await store.dispatch('product/enable', { id: route.params.id, isEnable: true });
product.isEnable = true;
await store.dispatch('product/save', product);
} }
await handleLoad(); await store.dispatch('productSkus/save', { id: route.params.id, data });
router.push({ name: 'ProductManagement' });
} }
state.loading = false; state.loading = false;
}; };

@ -32,8 +32,6 @@
<script setup lang="jsx"> <script setup lang="jsx">
import ElButton from '@/components/extra/ElButton.vue'; import ElButton from '@/components/extra/ElButton.vue';
import ElIcon from '@/components/extra/ElIcon.vue';
import ElImage from '@/components/extra/ElImage.vue';
import ElSwitch from '@/components/extra/ElSwitch.vue'; import ElSwitch from '@/components/extra/ElSwitch.vue';
const router = useRouter(); const router = useRouter();
const store = useStore(); const store = useStore();
@ -93,16 +91,6 @@
store.dispatch('product/remove', [row.id]); store.dispatch('product/remove', [row.id]);
}; };
/* 查看详情 */
const handleDetail = (row) => {
router.push({
name: 'ProductDetail',
params: {
id: row.orderId,
},
});
};
/* SKU */ /* SKU */
const handleSku = (row) => { const handleSku = (row) => {
router.push({ router.push({
@ -171,16 +159,13 @@
{ {
label: '操作', label: '操作',
fixed: 'right', fixed: 'right',
width: 160, width: 120,
slots: { slots: {
default: ({ row }) => ( default: ({ row }) => (
<div> <div>
<ElButton type="text" onClick={() => handleUpdate(row)}> <ElButton type="text" onClick={() => handleUpdate(row)}>
编辑 编辑
</ElButton> </ElButton>
<ElButton type="text" onClick={() => handleDetail(row)}>
预览
</ElButton>
<ElButton type="text" onClick={() => handleRemove(row)}> <ElButton type="text" onClick={() => handleRemove(row)}>
删除 删除
</ElButton> </ElButton>

@ -23,9 +23,9 @@ export default (configEnv) => {
// target: 'http://192.168.10.109:8090/', // 显雨 // target: 'http://192.168.10.109:8090/', // 显雨
// target: 'http://192.168.10.251:8090', // 高玉 // target: 'http://192.168.10.251:8090', // 高玉
// target: 'http://192.168.10.67:8090', // 罗战 // target: 'http://192.168.10.67:8090', // 罗战
target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址 // target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
// target: 'https://gateway.mashibing.cn', // 预发地址 // target: 'https://gateway.mashibing.cn', // 预发地址
// target: 'https://like-gateway.mashibing.com', // 生产环境 target: 'https://like-gateway.mashibing.com', // 生产环境
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
}, },

Loading…
Cancel
Save