Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
occloud-server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yangjiarong
occloud-server
Commits
66e41a66
Commit
66e41a66
authored
Jul 16, 2022
by
liuliufashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
fd6ab3c7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
166 additions
and
39 deletions
+166
-39
package-lock.json
web-vue-admin/package-lock.json
+0
-0
index.ts
web-vue-admin/src/api/index.ts
+8
-0
index.vue
web-vue-admin/src/views/goods-cabinet/index.vue
+158
-39
No files found.
web-vue-admin/package-lock.json
View file @
66e41a66
This source diff could not be displayed because it is too large. You can
view the blob
instead.
web-vue-admin/src/api/index.ts
View file @
66e41a66
...
@@ -147,6 +147,14 @@ export const onCreateGoodsPay = async(data:any)=>{
...
@@ -147,6 +147,14 @@ export const onCreateGoodsPay = async(data:any)=>{
});
});
}
}
export
const
onUpdateGoods
=
async
(
data
:
any
)
=>
{
return
await
request
({
url
:
`/goods/updateali`
,
method
:
'post'
,
data
});
}
// /goods/creategoodspay
// /goods/creategoodspay
// /goods/select
// /goods/select
...
...
web-vue-admin/src/views/goods-cabinet/index.vue
View file @
66e41a66
...
@@ -3,15 +3,27 @@
...
@@ -3,15 +3,27 @@
<div
class=
"good-search"
v-if=
"!isShowGoods"
>
<div
class=
"good-search"
v-if=
"!isShowGoods"
>
<div>
<div>
<a-radio-group
v-model:value=
"status"
>
<a-radio-group
v-model:value=
"status"
>
<a-radio-button
value=
"0"
class=
"status"
@
click=
"onSearch"
>
全部
</a-radio-button>
<a-radio-button
value=
"0"
class=
"status"
@
click=
"onSearch"
<a-radio-button
value=
"1"
class=
"status"
@
click=
"onSearch"
>
正常
</a-radio-button>
>
全部
</a-radio-button
<a-radio-button
value=
"2"
class=
"status"
@
click=
"onSearch"
>
已下架
</a-radio-button>
>
<a-radio-button
value=
"1"
class=
"status"
@
click=
"onSearch"
>
正常
</a-radio-button
>
<a-radio-button
value=
"2"
class=
"status"
@
click=
"onSearch"
>
已下架
</a-radio-button
>
</a-radio-group>
</a-radio-group>
<a-input-search
v-model:value=
"value"
placeholder=
"请输入商品名称"
style=
"width: 200px; margin-left: 10px"
<a-input-search
@
search=
"onSearch"
/>
v-model:value=
"value"
placeholder=
"请输入商品名称"
style=
"width: 200px; margin-left: 10px"
@
search=
"onSearch"
/>
</div>
</div>
<div
class=
"good-cad"
>
<div
class=
"good-cad"
>
<a-button
type=
"primary"
class=
"mr10"
@
click=
"onGoods(0)"
>
新建商品
</a-button>
<a-button
type=
"primary"
class=
"mr10"
@
click=
"onGoods(0)"
>
新建商品
</a-button
>
<a-button
type=
"primary"
@
click=
"onGoods(1)"
>
新建商品包
</a-button>
<a-button
type=
"primary"
@
click=
"onGoods(1)"
>
新建商品包
</a-button>
</div>
</div>
</div>
</div>
...
@@ -19,25 +31,63 @@
...
@@ -19,25 +31,63 @@
<a-table
:columns=
"columns"
:data-source=
"list"
>
<a-table
:columns=
"columns"
:data-source=
"list"
>
<template
#
bodyCell=
"
{ column, record }">
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'tags'"
>
<template
v-if=
"column.key === 'tags'"
>
<a-button
type=
"primary"
>
编辑
</a-button>
<a-button
type=
"primary"
@
click=
"onEdit(record)"
>
编辑
</a-button>
<a-button
type=
"primary"
style=
"margin-left:20px;"
>
统计
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 20px"
>
统计
</a-button>
<a-button
type=
"primary"
style=
"margin-left:20px;"
>
下架
</a-button>
<a-button
type=
"primary"
style=
"margin-left: 20px"
>
下架
</a-button>
<a-button
type=
"primary"
style=
"margin-left:20px;"
>
删除
</a-button>
<a-popconfirm
title=
"Are you sure delete this task?"
ok-text=
"Yes"
cancel-text=
"No"
@
confirm=
"onDel(record)"
>
<a-button
type=
"primary"
style=
"margin-left: 20px"
>
删除
</a-button>
</a-popconfirm>
</
template
>
</
template
>
</template>
</template>
</a-table>
</a-table>
</div>
</div>
<div
v-if=
"isShowGoods"
>
<div
v-if=
"isShowGoods"
>
<div
style=
"display: flex; align-items: center; justify-content: space-between"
v-if=
"isShowGoods"
>
<div
style=
"
display: flex;
align-items: center;
justify-content: space-between;
"
v-if=
"isShowGoods"
>
<a-button
class=
"small left"
@
click=
"onBack"
>
<a-button
class=
"small left"
@
click=
"onBack"
>
<
template
#
icon
>
<
template
#
icon
>
<LeftOutlined
/>
<LeftOutlined
/>
</
template
>
</
template
>
</a-button>
</a-button>
</div>
</div>
<GoodsBags
:props=
"{ propsData }"
v-if=
"propsData.isCad == 0"
@
onBack=
"onBack"
></GoodsBags>
<GoodsBags
<GoodsBagSubs
:props=
"{ propsData }"
v-else
@
onBack=
"onBack"
>
</GoodsBagSubs>
:props=
"{ propsData }"
v-if=
"propsData.isCad == 0"
@
onBack=
"onBack"
></GoodsBags>
<GoodsBagSubs
:props=
"{ propsData }"
v-else
@
onBack=
"onBack"
>
</GoodsBagSubs>
</div>
</div>
<a-modal
v-model:visible=
"visible"
title=
"编辑"
:confirm-loading=
"confirmLoading"
@
ok=
"handleOk"
>
<a-form
:label-col=
"{ span: 4 }"
:wrapper-col=
"{ span: 14 }"
>
<a-form-item
label=
"商品名称"
v-bind=
"validateInfos.name"
>
<a-input
v-model:value=
"modelRef.subject"
/>
</a-form-item>
<!-- <a-form-item label="mo" v-bind="validateInfos['sub.name']">
<a-input v-model:value="modelRef.sub.name" />
</a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click.prevent="onSubmit">Create</a-button>
<a-button style="margin-left: 10px" @click="reset">Reset</a-button>
</a-form-item> -->
</a-form>
</a-modal>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -45,8 +95,11 @@ import { ref, reactive, defineExpose, onMounted } from "vue";
...
@@ -45,8 +95,11 @@ import { ref, reactive, defineExpose, onMounted } from "vue";
import
{
LeftOutlined
}
from
"@ant-design/icons-vue"
;
import
{
LeftOutlined
}
from
"@ant-design/icons-vue"
;
import
GoodsBags
from
"./components/goods/index.vue"
;
import
GoodsBags
from
"./components/goods/index.vue"
;
import
GoodsBagSubs
from
"./components/goodsubs/index.vue"
;
import
GoodsBagSubs
from
"./components/goodsubs/index.vue"
;
import
{
onSelectGoods
,
onfindby
}
from
'@/api/index'
import
{
onSelectGoods
,
onfindby
,
onUpdateGoods
}
from
"@/api/index"
;
import
{
getUid
}
from
"@/utils/userInfo"
;
import
{
getUid
}
from
"@/utils/userInfo"
;
import
{
Form
}
from
'ant-design-vue'
;
const
useForm
=
Form
.
useForm
;
const
columns
=
[
const
columns
=
[
{
{
title
:
"商品编号"
,
title
:
"商品编号"
,
...
@@ -55,8 +108,8 @@ const columns = [
...
@@ -55,8 +108,8 @@ const columns = [
},
},
{
{
title
:
"商品名称"
,
title
:
"商品名称"
,
dataIndex
:
"s
hortname
"
,
dataIndex
:
"s
ubject
"
,
key
:
"s
hortname
"
,
key
:
"s
ubject
"
,
},
},
{
{
title
:
"商品类型"
,
title
:
"商品类型"
,
...
@@ -92,47 +145,114 @@ const columns = [
...
@@ -92,47 +145,114 @@ const columns = [
interface
props
{
interface
props
{
isCad
:
Number
;
isCad
:
Number
;
}
}
const
list
=
ref
<
Array
<
Object
>>
([])
const
list
=
ref
<
Array
<
Object
>>
([])
;
const
value
=
ref
<
string
>
(
""
);
const
value
=
ref
<
string
>
(
""
);
const
status
=
ref
<
string
>
(
"0"
)
const
status
=
ref
<
string
>
(
"0"
);
let
modelRef
=
ref
({});
const
propsData
=
reactive
<
props
>
({
const
propsData
=
reactive
<
props
>
({
isCad
:
0
,
isCad
:
0
,
});
});
const
isShowGoods
=
ref
<
Boolean
>
(
false
);
const
isShowGoods
=
ref
<
Boolean
>
(
false
);
const
onSearch
=
async
()
=>
{
const
modalText
=
ref
<
string
>
(
"Content of the modal"
);
const
visible
=
ref
<
boolean
>
(
false
);
const
confirmLoading
=
ref
<
boolean
>
(
false
);
const
showModal
=
()
=>
{
visible
.
value
=
true
;
};
const
handleOk
=
()
=>
{
modalText
.
value
=
"The modal will be closed after two seconds"
;
confirmLoading
.
value
=
true
;
setTimeout
(()
=>
{
visible
.
value
=
false
;
confirmLoading
.
value
=
false
;
},
2000
);
};
const
onSearch
=
async
()
=>
{
const
params
=
{
const
params
=
{
status
:
status
.
value
,
status
:
status
.
value
,
name
:
value
.
value
,
name
:
value
.
value
,
uid
:
getUid
()
uid
:
getUid
(),
}
}
;
const
data
=
await
onfindby
(
params
)
const
data
=
await
onfindby
(
params
);
list
.
value
=
data
.
data
list
.
value
=
data
.
data
;
};
};
const
onGoods
=
(
e
:
Number
)
=>
{
const
onGoods
=
(
e
:
Number
)
=>
{
propsData
.
isCad
=
e
;
propsData
.
isCad
=
e
;
isShowGoods
.
value
=
true
;
isShowGoods
.
value
=
true
;
};
};
const
onBack
=
async
(
e
:
Number
)
=>
{
const
onBack
=
async
(
e
:
Number
)
=>
{
isShowGoods
.
value
=
!
isShowGoods
.
value
;
isShowGoods
.
value
=
!
isShowGoods
.
value
;
const
uid
=
getUid
()
const
uid
=
getUid
();
const
data
=
await
onSelectGoods
(
uid
)
const
data
=
await
onSelectGoods
(
uid
);
list
.
value
=
data
.
data
list
.
value
=
data
.
data
;
};
const
onEdit
=
(
e
:
any
)
=>
{
console
.
log
(
e
,
"e"
);
visible
.
value
=
!
visible
.
value
;
modelRef
.
value
=
e
console
.
log
();
};
const
{
resetFields
,
validate
,
validateInfos
}
=
useForm
(
modelRef
,
reactive
({
subject
:
[
{
required
:
true
,
message
:
"请输入商品名称"
,
},
],
})
);
const
onSubmit
=
()
=>
{
validate
()
.
then
((
res
)
=>
{
console
.
log
(
res
,
toRaw
(
modelRef
));
})
.
catch
((
err
)
=>
{
console
.
log
(
"error"
,
err
);
});
};
const
reset
=
()
=>
{
resetFields
();
};
const
onDel
=
async
(
e
:
any
)
=>
{
e
.
status
=
"1"
;
const
data
=
await
onUpdateGoods
(
e
);
console
.
log
(
data
,
"data"
);
await
init
();
};
const
init
=
async
()
=>
{
const
uid
=
getUid
();
const
data
=
await
onSelectGoods
(
uid
);
list
.
value
=
data
.
data
;
};
};
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
const
uid
=
getUid
()
await
init
();
const
data
=
await
onSelectGoods
(
uid
)
});
list
.
value
=
data
.
data
return
list
})
defineExpose
({
defineExpose
({
status
,
status
,
value
,
value
,
columns
,
columns
,
isShowGoods
,
isShowGoods
,
propsData
,
propsData
,
modalText
,
visible
,
confirmLoading
,
validateInfos
,
modelRef
,
reset
,
onSubmit
,
showModal
,
handleOk
,
onBack
,
onBack
,
onSearch
,
onSearch
,
onGoods
,
onGoods
,
onEdit
,
onDel
,
init
,
});
});
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
...
@@ -142,17 +262,16 @@ defineExpose({
...
@@ -142,17 +262,16 @@ defineExpose({
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
.status{
.status
{
margin-right
:
20px
;
margin-right
:
20px
;
width
:
80px
;
width
:
80px
;
border-radius
:
5px
;
border-radius
:
5px
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0.65
);
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0.65
);
}
}
.status
::before
{
.status
::before
{
display
:
none
;
display
:
none
;
}
}
.ant-radio-button-wrapper-checked
{
.ant-radio-button-wrapper-checked
{
border
:
1px
solid
@
primary-color
;
border
:
1px
solid
@
primary-color
;
}
}
.ood-cad
{
.ood-cad
{
...
@@ -190,7 +309,7 @@ defineExpose({
...
@@ -190,7 +309,7 @@ defineExpose({
}
}
</
style
>
</
style
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.ant-layout-content
{
.ant-layout-content
{
overflow-y
:
scroll
;
overflow-y
:
scroll
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment