fix: BUG修复

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

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

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

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

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

@ -51,11 +51,6 @@
autoSearch: false,
page: false,
columns: [
{
type: 'selection',
fixed: 'left',
width: 60,
},
{
label: '订单编号',
prop: 'orderNo',
@ -81,7 +76,13 @@
label: '配送方式',
width: 120,
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;
if (id && id !== state.form.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) => {
return {
...item,
@ -140,15 +149,6 @@
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);
@ -247,6 +247,7 @@
});
if (res) {
sku.values = await store.dispatch('productAttrsValue/search', sku.id);
state.skuValue[index] = null;
} else {
proxy.$message.error('添加属性值失败');
}
@ -282,13 +283,11 @@
attributeSymbolList: item.attributeSymbolList.join(','),
};
});
await store.dispatch('productSkus/save', { id: route.params.id, data });
if (enable) {
let product = await store.dispatch('product/detail', route.params.id);
product.isEnable = true;
await store.dispatch('product/save', product);
await store.dispatch('product/enable', { id: route.params.id, isEnable: true });
}
await handleLoad();
await store.dispatch('productSkus/save', { id: route.params.id, data });
router.push({ name: 'ProductManagement' });
}
state.loading = false;
};

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

@ -23,9 +23,9 @@ export default (configEnv) => {
// target: 'http://192.168.10.109:8090/', // 显雨
// target: 'http://192.168.10.251: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://like-gateway.mashibing.com', // 生产环境
target: 'https://like-gateway.mashibing.com', // 生产环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},

Loading…
Cancel
Save