Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
664c9a46
提交
664c9a46
authored
2月 03, 2023
作者:
袁伟伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 批量订单发货单
上级
f0aea502
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
694 行增加
和
641 行删除
+694
-641
.env.development
.env.development
+3
-3
index.html
index.html
+0
-4
batchOrder.ts
src/api/model/batchOrder.ts
+3
-0
batchOrderDetail.ts
src/api/model/batchOrderDetail.ts
+3
-0
batchWorkOrder.ts
src/api/model/batchWorkOrder.ts
+1
-0
operationOrder.ts
src/api/model/operationOrder.ts
+3
-0
batchWorkOrderApi.ts
src/api/order/batchWorkOrderApi.ts
+11
-13
index.ts
src/hooks/myhooks/index.ts
+3
-1
detail.vue
src/views/order/batch-order/detail.vue
+17
-0
schema.ts
src/views/order/batch-order/schema.ts
+36
-36
detail.vue
src/views/order/batch-work-order/detail.vue
+101
-24
drawer.vue
src/views/order/batch-work-order/drawer.vue
+0
-69
index.vue
src/views/order/batch-work-order/index.vue
+120
-142
modal.vue
src/views/order/batch-work-order/modal.vue
+194
-0
schema.ts
src/views/order/batch-work-order/schema.ts
+119
-315
nav.vue
src/views/store/components/nav.vue
+13
-4
search.vue
src/views/store/components/search.vue
+27
-3
index.vue
src/views/store/goodDetail/index.vue
+5
-0
schema.ts
src/views/store/goodDetail/schema.ts
+22
-22
index.vue
src/views/store/home/index.vue
+10
-5
index.vue
src/views/store/shoppingCart/index.vue
+3
-0
没有找到文件。
.env.development
浏览文件 @
664c9a46
...
...
@@ -13,11 +13,11 @@ VITE_PUBLIC_PATH=/
VITE_DROP_CONSOLE=false
# Basic interface address SPA
VITE_GLOB_API_URL=http://
42.192.95.9:10083
#VITE_GLOB_API_URL=http://
192.168.101.69:8087
VITE_GLOB_API_URL=http://
192.168.101.69:8087
#VITE_GLOB_API_URL=http://
42.192.95.9:10083
# File upload address, optional
VITE_GLOB_UPLOAD_URL=http://
192.168.101.69:8087
/v1/sys/upload
VITE_GLOB_UPLOAD_URL=http://
42.192.95.9:10083
/v1/sys/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
index.html
浏览文件 @
664c9a46
...
...
@@ -162,9 +162,5 @@
</div>
</div>
<script
type=
"module"
src=
"/src/main.ts"
></script>
<script
src=
"/src/assets/lib/easeljs.min.js"
></script>
<script
src=
"/src/assets/lib/eventemitter2.js"
></script>
<script
src=
"/src/assets/lib/roslib.min.js"
></script>
<script
src=
"/src/assets/lib/ros2d.js"
></script>
</body>
</html>
src/api/model/batchOrder.ts
浏览文件 @
664c9a46
...
...
@@ -5,6 +5,7 @@
*/
import
{
BasePageParams
,
PageResult
,
ApiResponse
}
from
'./baseModel'
;
import
{
BatchOrderDetail
}
from
'./batchOrderDetail'
;
export
interface
BatchOrderParams
extends
BasePageParams
{
/**
...
...
@@ -130,6 +131,7 @@ export interface BatchOrderParams extends BasePageParams {
}
export
interface
BatchOrder
{
batchOrderId
:
number
|
undefined
;
/**
* ID系统自动生成
*/
...
...
@@ -138,6 +140,7 @@ export interface BatchOrder {
* ID系统自动生成
*/
batchOrderDetailList
?:
Array
<
BatchOrderDetail
>
;
batchWorkOrderDetailList
?:
Array
<
BatchOrderDetail
>
;
/**
* 经销商id
*/
...
...
src/api/model/batchOrderDetail.ts
浏览文件 @
664c9a46
...
...
@@ -83,6 +83,9 @@ export interface BatchOrderDetailParams extends BasePageParams {
}
export
interface
BatchOrderDetail
{
batchWorkOrderDetailProductDetailList
:
any
;
uuid
:
string
;
batchOrderDetailProductDetailList
:
any
;
/**
* ID系统自动生成
*/
...
...
src/api/model/batchWorkOrder.ts
浏览文件 @
664c9a46
...
...
@@ -5,6 +5,7 @@
*/
import
{
BasePageParams
,
PageResult
,
ApiResponse
}
from
'./baseModel'
;
import
{
BatchOrder
}
from
'./batchOrder'
;
import
{
OperationOrder
}
from
'./operationOrder'
;
export
interface
BatchWorkOrderParams
extends
BasePageParams
{
...
...
src/api/model/operationOrder.ts
浏览文件 @
664c9a46
...
...
@@ -5,6 +5,8 @@
*/
import
{
BasePageParams
,
PageResult
,
ApiResponse
}
from
'./baseModel'
;
import
{
BatchOrder
}
from
'./batchOrder'
;
import
{
BatchOrderDetail
}
from
'./batchOrderDetail'
;
import
{
Hospital
}
from
'./hospital'
;
export
interface
OperationOrderParams
extends
BasePageParams
{
...
...
@@ -275,6 +277,7 @@ export interface OperationOrder {
* update_time
*/
updateTime
?:
Date
;
batchOrderDetailList
:
BatchOrderDetail
[];
}
export
type
OperationOrderPageResult
=
PageResult
<
OperationOrder
>
;
...
...
src/api/order/batchWorkOrderApi.ts
浏览文件 @
664c9a46
...
...
@@ -13,26 +13,24 @@ import {
BatchWorkOrderPageResponse
,
BatchWorkOrderResponse
,
}
from
'../model/batchWorkOrder'
;
import
{
BatchOrder
}
from
'../model/batchOrder'
;
const
baseApi
=
'/v1/order/batch-work-order'
;
/**
* 新增
*/
export
const
add
=
(
entity
:
BatchWorkOrder
)
=>
defHttp
.
post
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
add
=
(
entity
:
BatchWorkOrder
)
=>
defHttp
.
post
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 更新
*/
export
const
update
=
(
entity
:
BatchWorkOrder
)
=>
defHttp
.
put
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
update
=
(
entity
:
BatchWorkOrder
)
=>
defHttp
.
put
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 删除
*/
export
const
remove
=
(
id
:
any
)
=>
defHttp
.
delete
<
Number
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
remove
=
(
id
:
any
)
=>
defHttp
.
delete
<
Number
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 分页查询
...
...
@@ -49,14 +47,12 @@ export const all = (params?: BatchWorkOrderParams) =>
/**
* 通过主键查询
*/
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 单个查询
*/
export
const
getOne
=
(
params
?:
BatchWorkOrderParams
)
=>
defHttp
.
get
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
export
const
getOne
=
(
params
?:
BatchWorkOrderParams
)
=>
defHttp
.
get
<
BatchWorkOrder
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
/**
* 批量删除
...
...
@@ -79,7 +75,9 @@ export const batchUpdate = (entityList: Array<BatchWorkOrder>) =>
/**
* 查询数量
*/
export
const
count
=
(
params
?:
BatchWorkOrderParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
export
const
count
=
(
params
?:
BatchWorkOrderParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
/**
* 新建发货单
*/
export
const
addInvoice
=
(
data
?:
any
)
=>
defHttp
.
post
({
url
:
`
${
baseApi
}
/create/send/order`
,
data
});
src/hooks/myhooks/index.ts
浏览文件 @
664c9a46
...
...
@@ -77,13 +77,15 @@ const getCartList = (productList) => {
item
.
cartProductDetailList
.
forEach
((
product
)
=>
{
product
.
uuid
=
item
.
goodsId
+
'-'
+
product
.
id
;
product
.
t
ype
=
item
.
goods
.
goodsType
;
product
.
goodsT
ype
=
item
.
goods
.
goodsType
;
if
(
item
.
goodsType
===
'KIT'
)
{
product
.
basicQuantity
=
product
.
quantity
/
item
.
quantity
;
}
product
.
name
=
item
.
goods
.
name
;
});
});
productList
.
value
=
res
;
console
.
log
(
res
);
});
};
...
...
src/views/order/batch-order/detail.vue
浏览文件 @
664c9a46
...
...
@@ -23,6 +23,21 @@
rowKey=
"uuid"
:scroll=
"{ y: 450 }"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'total'"
>
{{
record
.
goodsId
?
''
:
record
.
price
*
record
.
quantity
}}
</
template
>
<
template
v-if=
"column.key === 'price'"
>
{{
record
.
goodsId
?
''
:
record
.
price
}}
</
template
>
<
template
v-if=
"column.key === 'quantity'"
>
{{
record
.
goodsId
?
''
:
record
.
quantity
}}
</
template
>
<
template
v-if=
"column.key === 'goodsType'"
>
<span
v-if=
"record.goodsType === 'PRODUCT'"
>
产品
</span>
<span
v-else-if=
"record.goodsType === 'KIT'"
>
套件
</span>
</
template
>
</template>
</a-table>
<div
class=
"btnWrap"
>
<a-button
...
...
@@ -90,8 +105,10 @@
return
BatchOrderApi
.
getById
(
id
.
value
).
then
((
res
:
BatchOrder
)
=>
{
res
.
batchOrderDetailList
?.
forEach
((
item
)
=>
{
item
.
uuid
=
item
.
goodsId
+
''
;
item
.
batchOrderDetailProductDetailList
.
forEach
((
el
)
=>
{
el
.
uuid
=
item
.
goodsId
+
'-'
+
el
.
id
;
el
.
goodsType
=
item
.
goodsType
;
});
});
productList
.
value
=
res
.
batchOrderDetailList
;
...
...
src/views/order/batch-order/schema.ts
浏览文件 @
664c9a46
...
...
@@ -109,12 +109,12 @@ export const schema = {
},
{
field
:
'distributorName'
,
label
:
'
供应商名称
'
,
label
:
'
经销商
'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'
供应商名称
'
,
placeholder
:
'
经销商
'
,
},
colProps
,
component
:
'Input'
,
...
...
@@ -418,7 +418,7 @@ const tableFields = [
'createTime'
,
];
const
descriptionFields
=
[
'id'
,
//
'id',
'orderSn'
,
'exWarehouse'
,
'distributorName'
,
...
...
@@ -489,54 +489,54 @@ export const detailColumns = [
dataIndex
:
'thirdProductId'
,
key
:
'thirdProductId'
,
},
{
title
:
'标识名称'
,
dataIndex
:
'thirdProductId10'
,
key
:
'thirdProductId10'
,
},
//
{
//
title: '标识名称',
//
dataIndex: 'thirdProductId10',
//
key: 'thirdProductId10',
//
},
{
title
:
'产品名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'规格型号'
,
dataIndex
:
'thirdProductId8'
,
key
:
'thirdProductId8'
,
},
{
title
:
'单位'
,
dataIndex
:
'thirdProductId7'
,
key
:
'thirdProductId7'
,
},
//
{
//
title: '规格型号',
//
dataIndex: 'thirdProductId8',
//
key: 'thirdProductId8',
//
},
//
{
//
title: '单位',
//
dataIndex: 'thirdProductId7',
//
key: 'thirdProductId7',
//
},
{
title
:
'类型'
,
dataIndex
:
'
thirdProductId6
'
,
key
:
'
thirdProductId6
'
,
dataIndex
:
'
goodsType
'
,
key
:
'
goodsType
'
,
},
{
title
:
'订购数量'
,
dataIndex
:
'quantity'
,
key
:
'thirdProductId5'
,
},
{
title
:
'取消数量'
,
dataIndex
:
'thirdProductId4'
,
key
:
'thirdProductId4'
,
},
{
title
:
'发货数量'
,
dataIndex
:
'thirdProductId3'
,
key
:
'thirdProductId3'
,
key
:
'quantity'
,
},
// {
// title: '取消数量',
// dataIndex: 'thirdProductId4',
// key: 'thirdProductId4',
// },
// {
// title: '发货数量',
// dataIndex: 'thirdProductId3',
// key: 'thirdProductId3',
// },
{
title
:
'单价'
,
dataIndex
:
'
thirdProductId2
'
,
key
:
'
thirdProductId2
'
,
dataIndex
:
'
price
'
,
key
:
'
price
'
,
},
{
title
:
'行总价'
,
dataIndex
:
'thirdProductId1'
,
key
:
'thirdProductId1'
,
title
:
'总价'
,
key
:
'total'
,
},
];
src/views/order/batch-work-order/detail.vue
浏览文件 @
664c9a46
<
template
>
<Card
:bordered=
"false"
>
<Card
:bordered=
"false"
:loading=
"isLoading"
>
<Descriptions
bordered
:column=
"3"
>
<Descriptions
.
Item
label=
"发货单号"
>
{{
id
}}
</Descriptions
.Item
>
<Descriptions
.
Item
v-for=
"p in displayProps"
:key=
"p.title"
...
...
@@ -8,52 +11,126 @@
:span=
"['avatar'].includes(p.name) ? 3 : 1"
>
<span
v-if=
"p.key === 'avatar'"
>
<
img
:src=
"p.value"
style=
"width: 120px; height
: 120px"
/>
<
ImagePreview
:imageList=
"[p.value]"
style=
"width
: 120px"
/>
</span>
<template
v-else
>
{{
p
.
value
}}
</
template
>
</Descriptions
.Item
>
</Descriptions>
<a-table
:dataSource=
"productList"
:columns=
"detailColumns"
:pagination=
"false"
childrenColumnName=
"batchWorkOrderDetailProductDetailList"
rowKey=
"uuid"
:scroll=
"{ y: 450 }"
>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.key === 'total'"
>
{{
record
.
goodsId
?
''
:
record
.
price
*
record
.
quantity
}}
</
template
>
<
template
v-if=
"column.key === 'price'"
>
{{
record
.
goodsId
?
''
:
record
.
price
}}
</
template
>
<
template
v-if=
"column.key === 'ordered'"
>
{{
record
.
goodsId
?
''
:
record
.
ordered
}}
</
template
>
<
template
v-if=
"column.key === 'quantity'"
>
{{
record
.
goodsId
?
''
:
record
.
quantity
}}
</
template
>
<
template
v-if=
"column.key === 'goodsType'"
>
<span
v-if=
"record.goodsType === 'PRODUCT'"
>
产品
</span>
<span
v-else-if=
"record.goodsType === 'KIT'"
>
套件
</span>
</
template
>
</template>
</a-table>
</Card>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceDetail"
>
import
{
onMounted
,
computed
,
ref
,
reactive
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router
'
;
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
computed
,
ref
}
from
'vue'
;
import
{
Card
,
Descriptions
}
from
'ant-design-vue
'
;
import
{
ComputedRef
}
from
'@vue/reactivity'
;
import
{
Descriptions
,
Card
}
from
'ant-design-vue'
;
import
{
descriptionColumns
}
from
'./schema'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
*
as
BatchWorkOrderApi
from
'/@/api/order/batchWorkOrderApi'
;
import
{
Device
}
from
'/@/api/model/device'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
descriptionColumns
}
from
'/@/views/order/batch-order/schema'
;
import
*
as
BatchOrderApi
from
'/@/api/order/batchOrderApi'
;
import
{
detailColumns
}
from
'/@/views/order/batch-work-order/schema'
;
import
{
BatchOrderDetail
}
from
'/@/api/model/batchOrderDetail'
;
import
{
BatchWorkOrder
}
from
'/@/api/model/batchWorkOrder'
;
const
route
=
useRoute
();
const
id
=
ref
(
route
.
params
?.
id
);
let
data
=
reactive
({
detail
:
{},
isOver
:
false
,
});
const
getDetail
=
()
=>
{
BatchWorkOrderApi
.
getById
(
id
.
value
).
then
((
res
:
Device
)
=>
{
data
.
isOver
=
true
;
data
.
detail
=
res
;
});
};
const
batchOrderId
=
ref
(
route
.
query
?.
order
);
onMounted
(()
=>
{
getDetail
();
const
{
state
:
detail
,
isReady
:
isDetailReady
,
isLoading
,
execute
,
}
=
useAsyncState
(
()
=>
{
return
BatchOrderApi
.
getById
(
batchOrderId
.
value
).
then
((
res
:
BatchOrder
)
=>
{
return
res
;
});
},
null
,
{
immediate
:
false
,
},
);
const
displayProps
:
ComputedRef
<
Array
<
any
>>
=
computed
(()
=>
{
if
(
!
data
.
isOver
)
return
{};
if
(
!
isDetailReady
.
value
)
return
{};
const
display
:
any
=
descriptionColumns
.
map
(({
title
,
dataIndex
=
''
,
customRender
})
=>
({
key
:
dataIndex
,
title
,
value
:
customRender
?
customRender
({
text
:
d
ata
.
detail
[
dataIndex
],
record
:
data
.
detail
})
:
d
ata
.
detail
[
dataIndex
],
?
customRender
({
text
:
d
etail
.
value
[
dataIndex
],
record
:
detail
.
value
})
:
d
etail
.
value
[
dataIndex
],
}));
return
display
;
});
const
productList
=
ref
<
BatchOrderDetail
[]
|
undefined
>
();
const
getOrderWorkDetail
=
()
=>
{
BatchWorkOrderApi
.
getById
(
id
.
value
)
.
then
((
res
:
BatchWorkOrder
)
=>
{
const
thirdProductId
=
{};
res
.
batchOrder
?.
batchOrderDetailList
.
forEach
((
item
)
=>
{
item
.
batchOrderDetailProductDetailList
.
forEach
((
el
)
=>
{
thirdProductId
[
el
.
thirdProductId
]
=
el
.
quantity
;
});
});
res
.
batchWorkOrderDetailList
?.
forEach
((
item
)
=>
{
item
.
uuid
=
item
.
goodsId
+
''
;
item
.
batchWorkOrderDetailProductDetailList
.
forEach
((
el
)
=>
{
el
.
uuid
=
item
.
goodsId
+
'-'
+
el
.
id
;
el
.
ordered
=
thirdProductId
[
el
.
thirdProductId
];
el
.
goodsType
=
item
.
goodsType
;
});
});
productList
.
value
=
res
.
batchWorkOrderDetailList
;
console
.
log
(
res
);
})
.
finally
(()
=>
{
// tableLoading.value = false
});
};
onMounted
(()
=>
{
execute
();
getOrderWorkDetail
();
});
</
script
>
<
style
scoped
></
style
>
<
style
scoped
>
.ant-table-wrapper
{
margin-top
:
20px
;
}
</
style
>
src/views/order/batch-work-order/drawer.vue
deleted
100644 → 0
浏览文件 @
f0aea502
<
template
>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:title=
"getTitle"
width=
"600px"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicDrawer>
</
template
>
<
script
lang=
"ts"
setup
name=
"BatchWorkOrderDrawer"
>
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
formSchema
}
from
'./schema'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
*
as
BatchWorkOrderApi
from
'/@/api/order/batchWorkOrderApi'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
const
entityId
=
ref
(
0
);
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
validate
}]
=
useForm
({
labelWidth
:
120
,
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
});
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
await
resetFields
();
setDrawerProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
entityId
.
value
=
data
?.
record
?.
id
;
if
(
unref
(
isUpdate
))
{
await
setFieldsValue
({
...
data
.
record
,
batchOrderId
:
{
label
:
data
.
record
.
batch_orderName
,
value
:
data
.
record
.
batchOrderId
},
});
}
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增'
:
'编辑'
));
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
setDrawerProps
({
confirmLoading
:
true
});
const
{
batchOrderId
,
...
rest
}
=
values
;
const
action
=
!
unref
(
isUpdate
)
?
BatchWorkOrderApi
.
add
:
BatchWorkOrderApi
.
update
;
const
data
=
!
unref
(
isUpdate
)
?
{
...
rest
,
batchOrderId
:
batchOrderId
.
value
,
batch_orderName
:
batchOrderId
.
label
,
}
:
Object
.
assign
({},
{
...
rest
,
id
:
unref
(
entityId
),
batchOrderId
:
batchOrderId
.
value
,
batch_orderName
:
batchOrderId
.
label
,
},
);
await
action
(
data
);
closeDrawer
();
emit
(
'success'
);
}
finally
{
setDrawerProps
({
confirmLoading
:
false
});
}
}
</
script
>
src/views/order/batch-work-order/index.vue
浏览文件 @
664c9a46
<
template
>
<div>
<BasicTable
@
register=
"registerTable"
>
<template
#
headerTop
>
<a-alert
type=
"info"
show-icon
>
<template
#
message
>
<template
v-if=
"checkedKeys.length > 0"
>
<span>
已选中
{{
checkedKeys
.
length
}}
条记录
</span>
<a-button
type=
"link"
@
click=
"checkedKeys = []"
size=
"small"
>
清空
</a-button>
<a-popconfirm
class=
"ml-4"
title=
"确定要全部删除吗?"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleBatchDelete"
<div
class=
"containe"
>
<div
class=
"queryWrap"
>
<a-form
:model=
"formState"
name=
"basic"
ref=
"formRef"
layout=
"inline"
:label-col=
"
{ span: 8 }"
:wrapper-col="{ span: 16 }"
autocomplete="off"
class="ant-row"
>
<a
href=
"#"
class=
"text-red-500"
>
删除
</a>
</a-popconfirm>
</
template
>
<
template
v-else
>
<span>
未选中任何项目
</span>
</
template
>
</template>
</a-alert>
</template>
<
template
#
toolbar
>
<a-button
v-auth=
"'AUTH_ORDER_BATCH_WORK_ORDER:ADD'"
type=
"primary"
@
click=
"handleCreate"
>
新增
</a-button>
<a-form-item
label=
"创建时间"
>
<a-range-picker
@
change=
"onChangeTime"
:show-time=
"
{ format: 'HH:mm:ss' }"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</a-form-item>
<a-form-item
:wrapper-col=
"
{ offset: 8, span: 16 }">
<a-button
@
click=
"handleReset"
>
重置
</a-button>
<a-button
type=
"primary"
@
click=
"getData"
>
查询
</a-button>
</a-form-item>
</a-form>
</div>
<div
class=
"tableWrap"
>
<div
class=
"titleWrap"
>
<span
class=
"title"
>
发货单列表
</span>
<a-button
type=
"primary"
@
click=
"handleAdd"
>
新增
</a-button>
</div>
<a-table
:dataSource=
"dataSource"
:columns=
"columns"
:pagination=
"pagination"
:loading=
"tableLoading"
:row-class-name=
"(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
bordered
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'status'"
>
{{
StatusEnum
[
record
.
status
]
}}
</
template
>
<
template
#
bodyCell=
"{ column, record, text }"
>
<template
v-if=
"column.dataIndex === 'id'"
>
<a
@
click=
"handleView(record)"
>
{{
record
.
id
}}
</a>
<
template
v-if=
"column.key === 'distributor'"
>
{{
record
.
batchOrder
.
distributorName
}}
</
template
>
<
template
v-if=
"[].includes(column.dataIndex)
"
>
<img
:src=
"text"
class=
"photo"
alt=
"图片"
v-if=
"!!text"
/>
<
template
v-if=
"column.key === 'saleUserName'
"
>
{{
record
.
batchOrder
.
saleUserName
}}
</
template
>
<
template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
:actions=
"[
{
tooltip: '编辑',
icon: 'clarity:note-edit-line',
onClick: handleEdit.bind(null, record),
ifShow: hasPermission('AUTH_ORDER_BATCH_WORK_ORDER:EDIT'),
},
{
tooltip: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
ifShow: hasPermission('AUTH_ORDER_BATCH_WORK_ORDER:DELETE'),
},
]"
/>
<
template
v-if=
"column.key === 'action'"
>
<a-button
type=
"link"
@
click=
"handleView(record)"
>
查看
</a-button>
<!--
<a-button
type=
"link"
@
click=
"handleEdit(record.id)"
>
编辑
</a-button>
<a-popconfirm
title=
"是否确认删除?"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleDelete(record.id)"
v-if=
"hasPermission('AUTH_PRODUCT_GOODS_CATEGORY:DELETE')"
>
<a-button
type=
"link"
>
删除
</a-button>
</a-popconfirm>
-->
</
template
>
</template>
</BasicTable>
<BatchWorkOrderDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</a-table>
</div>
<Modal
ref=
"modalRef"
v-model:editId=
"editId"
@
handleSuccess=
"getData"
></Modal>
</div>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceIndex"
>
import
{
ref
}
from
'vue'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
isObject
}
from
'/@/utils/is'
;
import
moment
from
'moment'
;
<
script
lang=
"ts"
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
'vue'
;
import
{
usePagination
}
from
'/@/hooks/myhooks/index'
;
import
*
as
BatchWorkOrderApi
from
'/@/api/order/batchWorkOrderApi'
;
import
{
useDrawer
}
from
'/@/components/Drawer
'
;
import
componentSetting
from
'/@/settings/componentSetting
'
;
import
BatchWorkOrderDrawer
from
'./drawer.
vue'
;
import
{
columns
,
searchFormSchema
}
from
'.
/schema'
;
import
{
columns
}
from
'./schema
'
;
import
Modal
from
'./modal.vue
'
;
import
{
message
}
from
'ant-design-
vue'
;
import
{
StatusEnum
}
from
'/@/views/order/batch-order
/schema'
;
const
{
hasPermission
}
=
usePermission
()
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
const
go
=
useGo
();
const
{
formConfig
,
showTableSetting
,
bordered
,
showIndexColumn
}
=
componentSetting
.
table
;
const
checkedKeys
=
ref
<
Array
<
string
|
number
>>
([]);
const
onSelectChange
=
(
selectedRowKeys
:
(
string
|
number
)[])
=>
{
checkedKeys
.
value
=
selectedRowKeys
;
};
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'批量订单工单表'
,
api
:
(
params
)
=>
BatchWorkOrderApi
.
search
(
handleParams
(
params
)),
columns
,
formConfig
:
{
labelWidth
:
formConfig
.
labelWidth
,
schemas
:
searchFormSchema
,
showAdvancedButton
:
false
,
},
rowSelection
:
{
type
:
'checkbox'
,
selectedRowKeys
:
checkedKeys
,
onChange
:
onSelectChange
,
},
useSearchForm
:
true
,
showTableSetting
,
bordered
,
showIndexColumn
,
canResize
:
false
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
actionColumn
:
{
width
:
80
,
title
:
'操作'
,
dataIndex
:
'action'
,
const
formRef
=
ref
();
const
modalRef
=
ref
();
const
tableLoading
=
ref
(
false
);
fixed
:
'right'
,
},
const
formState
=
reactive
({
createTimeFrom
:
undefined
,
createTimeTo
:
undefined
,
});
const
handleParams
=
(
params
)
=>
{
const
{
pageNum
,
pageSize
}
=
params
;
const
handledParams
:
any
=
{
pageNum
,
pageSize
};
Object
.
keys
(
params
).
forEach
((
key
)
=>
{
const
schema
=
searchFormSchema
.
find
((
item
)
=>
item
.
field
===
key
);
const
value
=
params
[
key
];
if
(
schema
&&
value
!==
undefined
&&
value
!==
''
)
{
if
(
schema
.
component
===
'Input'
)
{
handledParams
[
key
]
=
`%
${
value
.
trim
()}
%`
;
}
else
if
([
'Select'
,
'ApiSelect'
].
includes
(
schema
.
component
))
{
handledParams
[
key
]
=
isObject
(
value
)
?
value
.
value
:
value
;
}
else
if
(
schema
.
component
===
'RangePicker'
)
{
handledParams
[
`
${
key
}
From`
]
=
moment
(
value
[
0
]).
startOf
(
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
handledParams
[
`
${
key
}
To`
]
=
moment
(
value
[
1
]).
endOf
(
'd'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
else
if
(
schema
.
component
===
'DatePicker'
)
{
handledParams
[
key
]
=
moment
(
value
).
format
((
schema
.
componentProps
as
any
).
format
||
'YYYY-MM-DD'
);
}
else
{
handledParams
[
key
]
=
value
;
}
}
});
return
handledParams
;
};
const
dataSource
=
ref
();
const
editId
=
ref
();
const
handleCreate
=
()
=>
{
openDrawer
(
true
,
{
isUpdate
:
false
,
const
getData
=
()
=>
{
tableLoading
.
value
=
true
;
BatchWorkOrderApi
.
search
(
Object
.
assign
({
pageSize
:
pagination
.
pageSize
,
pageNum
:
pagination
.
current
,
orderMode
:
'SEND_ORDER'
},
formState
),
)
.
then
((
res
)
=>
{
pagination
.
total
=
res
.
total
;
dataSource
.
value
=
res
.
records
;
})
.
finally
(()
=>
{
tableLoading
.
value
=
false
;
});
};
const
handleEdit
=
(
record
:
Recordable
)
=>
{
openDrawer
(
true
,
{
record
,
isUpdate
:
true
,
});
};
const
pagination
=
usePagination
(
getData
);
const
handleDelete
=
(
record
:
Recordable
)
=>
{
BatchWorkOrderApi
.
remove
(
record
.
id
).
then
((
_
)
=>
{
reload
();
});
const
handleReset
=
()
=>
{
formRef
.
value
.
resetFields
();
};
const
handleBatchDelete
=
()
=>
{
BatchWorkOrderApi
.
batchRemove
(
checkedKeys
.
value
).
then
((
_
)
=>
{
reload
();
});
const
handleAdd
=
()
=>
{
modalRef
.
value
.
open
();
};
const
handle
Success
=
(
)
=>
{
reload
(
);
const
handle
View
=
(
record
)
=>
{
go
(
'/main/batch-work-order/detail/'
+
record
.
id
+
`?order=
${
record
.
batchOrderId
}
`
);
};
const
handleView
=
(
record
)
=>
{
go
(
'/order/batch-work-order/'
+
record
.
id
);
const
onChangeTime
=
(
data
)
=>
{
formState
.
createTimeFrom
=
data
&&
data
[
0
];
formState
.
createTimeTo
=
data
&&
data
[
1
];
};
// const handleEdit = (id) => {
// editId.value = id;
// handleAdd();
// };
// const handleDelete = (id) => {
// GoodsPriceApi.remove(id).then((res) => {
// message.success('删除成功');
// getData();
// });
// };
onMounted
(()
=>
{
getData
();
});
</
script
>
<
style
lang=
"less"
scoped
>
@import url('/@/style/index.less');
.ant-table-striped :deep(.table-striped) td {
background-color: #fafafa;
}
</
style
>
src/views/order/batch-work-order/modal.vue
0 → 100644
浏览文件 @
664c9a46
<
template
>
<a-modal
v-model:visible=
"visible"
:title=
"props.editId ? '编辑' : '新增'"
@
ok=
"handleOk"
@
cancel=
"handleCancel"
class=
"myModal"
width=
"1200px"
:confirm-loading=
"okLoading"
>
<div
class=
"wrap"
>
<a-form
:model=
"formData"
name=
"basic"
ref=
"formRef"
layout=
"inline"
:label-col=
"
{ span: 8 }"
:wrapper-col="{ span: 16 }"
autocomplete="off"
class="ant-row"
>
<a-form-item
label=
"经销商"
name=
"changeDistributorId"
>
<a-select
ref=
"select"
v-model:value=
"formData.changeDistributorId"
style=
"width: 200px"
@
change=
"handleChangeDistributor"
>
<a-select-option
:value=
"item.id"
v-for=
"item in distributorList"
>
{{
item
.
name
}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"订单"
name=
"changeOrderId"
>
<a-select
ref=
"select"
v-model:value=
"formData.changeOrderId"
style=
"width: 200px"
@
change=
"handleChangeOrder"
>
<a-select-option
:value=
"item.id"
v-for=
"item in orderList"
>
{{
item
.
orderSn
}}
</a-select-option>
</a-select>
</a-form-item>
</a-form>
</div>
<a-table
:dataSource=
"productList"
:columns=
"detailColumns"
:pagination=
"false"
childrenColumnName=
"batchOrderDetailProductDetailList"
rowKey=
"uuid"
:scroll=
"
{ y: 450 }"
:loading="tableLoading"
>
<template
#
bodyCell=
"
{ column, record }">
<template
v-if=
"column.key === 'total'"
>
{{
record
.
goodsId
?
''
:
record
.
price
*
record
.
quantity
}}
</
template
>
<
template
v-if=
"column.key === 'price'"
>
{{
record
.
goodsId
?
''
:
record
.
price
}}
</
template
>
<
template
v-if=
"column.key === 'ordered'"
>
{{
record
.
goodsId
?
''
:
record
.
ordered
}}
</
template
>
<
template
v-if=
"column.key === 'quantity'"
>
<a-input-number
v-model:value=
"record.quantity"
:min=
"0"
v-if=
"!record.goodsId"
/>
<span
v-else
></span>
</
template
>
<
template
v-if=
"column.key === 'goodsType'"
>
<span
v-if=
"record.goodsType === 'PRODUCT'"
>
产品
</span>
<span
v-else-if=
"record.goodsType === 'KIT'"
>
套件
</span>
</
template
>
</template>
</a-table>
</a-modal>
</template>
<
script
lang=
"ts"
setup
>
import
{
defineExpose
,
ref
,
reactive
,
defineEmits
,
watch
,
defineProps
,
onMounted
}
from
'vue'
;
import
{
detailColumns
}
from
'/@/views/order/batch-work-order/schema'
;
import
*
as
BatchOrderApi
from
'/@/api/order/batchOrderApi'
;
import
*
as
DistributorApi
from
'/@/api/system/distributorApi'
;
import
*
as
BatchWorkOrderApi
from
'/@/api/order/batchWorkOrderApi'
;
import
lodash
from
'lodash'
;
import
{
message
}
from
'ant-design-vue'
;
import
{
BatchOrder
}
from
'/@/api/model/batchOrder'
;
import
{
Distributor
}
from
'/@/api/model/distributor'
;
import
{
BatchOrderDetail
}
from
'/@/api/model/batchOrderDetail'
;
const
props
=
defineProps
([
'editId'
]);
const
emits
=
defineEmits
([
'handleSuccess'
,
'update:editId'
]);
const
visible
=
ref
<
boolean
>
(
false
);
const
okLoading
=
ref
(
false
);
const
tableLoading
=
ref
(
false
);
const
handleOk
=
()
=>
{
const
orderClone
=
lodash
.
cloneDeep
(
order
.
value
);
if
(
orderClone
)
{
orderClone
.
batchWorkOrderDetailList
=
orderClone
.
batchOrderDetailList
;
orderClone
.
batchOrderId
=
orderClone
.
id
;
orderClone
.
status
=
'DELIVERED'
;
delete
orderClone
.
batchOrderDetailList
;
delete
orderClone
.
id
;
orderClone
.
batchWorkOrderDetailList
?.
forEach
((
item
)
=>
{
item
.
batchWorkOrderDetailProductDetailList
=
item
.
batchOrderDetailProductDetailList
;
delete
item
.
batchOrderDetailProductDetailList
;
item
.
batchWorkOrderDetailProductDetailList
.
forEach
((
el
)
=>
{
el
.
batchWorkOrderDetailId
=
el
.
batchOrderDetailId
;
delete
el
.
batchOrderDetailId
;
});
});
okLoading
.
value
=
true
;
BatchWorkOrderApi
.
addInvoice
(
orderClone
)
.
then
(()
=>
{
message
.
success
(
'新建成功'
);
handleCancel
();
})
.
finally
(()
=>
{
okLoading
.
value
=
false
;
});
}
else
{
message
.
warning
(
'请选择订单'
);
}
};
const
handleCancel
=
()
=>
{
distributorList
.
value
=
[];
orderList
.
value
=
[];
productList
.
value
=
[];
formData
.
changeDistributorId
=
formData
.
changeOrderId
=
''
;
visible
.
value
=
false
;
};
const
open
=
()
=>
{
visible
.
value
=
true
;
getDistributorList
();
};
const
distributorList
=
ref
<
Distributor
[]
|
[]
>
([]);
const
orderList
=
ref
<
BatchOrder
[]
|
[]
>
([]);
const
productList
=
ref
<
BatchOrderDetail
[]
|
undefined
>
();
const
order
=
ref
<
BatchOrder
>
();
const
formData
=
reactive
({
changeDistributorId
:
''
,
changeOrderId
:
''
,
});
const
getDistributorList
=
()
=>
{
DistributorApi
.
all
().
then
((
res
)
=>
{
distributorList
.
value
=
res
;
});
};
const
handleChangeDistributor
=
(
id
:
number
)
=>
{
BatchOrderApi
.
search
({
pageNum
:
1
,
pageSize
:
99
,
distributorId
:
id
,
status
:
'PASSED'
}).
then
((
res
)
=>
{
orderList
.
value
=
res
.
records
;
});
};
const
handleChangeOrder
=
(
id
:
number
)
=>
{
tableLoading
.
value
=
true
;
BatchOrderApi
.
getById
(
id
)
.
then
((
res
:
BatchOrder
)
=>
{
res
.
batchOrderDetailList
?.
forEach
((
item
)
=>
{
item
.
uuid
=
item
.
goodsId
+
''
;
item
.
batchOrderDetailProductDetailList
.
forEach
((
el
)
=>
{
el
.
uuid
=
item
.
goodsId
+
'-'
+
el
.
id
;
el
.
ordered
=
el
.
quantity
;
el
.
goodsType
=
item
.
goodsType
;
});
});
order
.
value
=
res
;
productList
.
value
=
res
.
batchOrderDetailList
;
})
.
finally
(()
=>
{
tableLoading
.
value
=
false
;
});
};
defineExpose
({
open
});
</
script
>
<
style
lang=
"less"
scoped
>
.wrap {
margin-bottom: 10px;
}
</
style
>
src/views/order/batch-work-order/schema.ts
浏览文件 @
664c9a46
/**
* 项目:-
* 模型分组:订单管理
* 模型名称:批量订单工单表
* @Author: xiongwei
* @Date: 2022-06-28 11:50:00
*/
import
{
BasicColumn
}
from
'/@/components/Table'
;
import
{
FormSchema
}
from
'/@/components/Table'
;
import
get
from
'lodash.get'
;
import
*
as
OperationOrderApi
from
'/@/api/order/operationOrderApi'
;
export
enum
StatusEnum
{
PENDING_REVIEW
=
'待审核'
,
PASSED
=
'已通过'
,
REJECT
=
'拒绝'
,
FORBIDDEN
=
'禁用'
,
}
export
const
StatusEnumOptions
:
any
[]
=
[];
for
(
const
key
in
StatusEnum
)
{
StatusEnumOptions
.
push
({
value
:
key
,
label
:
StatusEnum
[
key
],
});
}
export
enum
YesNoEnum
{
YES
=
'是'
,
NO
=
'否'
,
}
export
const
YesNoEnumOptions
:
any
[]
=
[];
for
(
const
key
in
YesNoEnum
)
{
YesNoEnumOptions
.
push
({
value
:
key
,
label
:
YesNoEnum
[
key
],
});
}
export
enum
OrderModeEnum
{
SALES_CONFIRM_ORDER
=
'销售确认单'
,
CONSUME_ORDER
=
'消耗单'
,
BACK_ORDER
=
'返货单'
,
}
export
const
OrderModeEnumOptions
:
any
[]
=
[];
for
(
const
key
in
OrderModeEnum
)
{
OrderModeEnumOptions
.
push
({
value
:
key
,
label
:
OrderModeEnum
[
key
],
});
}
const
colProps
=
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
lg
:
{
span
:
8
}
};
const
colPropsInDrawer
=
{
span
:
24
};
export
const
schema
=
{
model
:
'BatchWorkOrder'
,
viewInPage
:
true
,
properties
:
[
export
const
columns
=
[
{
field
:
'id'
,
label
:
'ID系统自动生成'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'ID系统自动生成'
,
},
colProps
,
component
:
'InputNumber'
,
rules
:
[{
required
:
true
,
message
:
'请输入ID系统自动生成!'
}],
},
table
:
{
},
title
:
'发货单号'
,
dataIndex
:
'id'
,
key
:
'id'
,
align
:
'center'
,
width
:
100
,
},
{
field
:
'distributorId'
,
label
:
'经销商id'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'经销商id'
,
},
colProps
,
component
:
'InputNumber'
,
rules
:
[{
required
:
true
,
message
:
'请输入经销商id!'
}],
},
table
:
{
},
},
title
:
'订单编号'
,
dataIndex
:
'orderSn'
,
key
:
'orderSn'
,
align
:
'center'
,
width
:
180
,
},
// {
// title: '出库仓',
// dataIndex: 'exWarehouse',
// key: 'exWarehouse',
// align: 'center',
// },
{
field
:
'batchOrderId'
,
label
:
'手术订单id'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
labelInValue
:
true
,
api
:
OperationOrderApi
.
all
,
params
:
{},
resultField
:
'records'
,
labelField
:
'id'
,
valueField
:
'id'
,
allowClear
:
false
,
placeholder
:
'手术订单id'
,
},
colProps
,
component
:
'ApiSelect'
,
rules
:
[{
required
:
true
,
type
:
'object'
,
message
:
'请输入手术订单id!'
}],
},
table
:
{
customRender
:
({
text
,
record
})
=>
get
(
record
,
'operationOrder.name'
)
||
text
,
},
},
title
:
'经销商'
,
dataIndex
:
'distributor'
,
key
:
'distributor'
,
align
:
'center'
,
},
// {
// title: '自有订单编号',
// dataIndex: 'ownOrderSn',
// key: 'ownOrderSn',
// align: 'center',
// },
{
field
:
'orderSn'
,
label
:
'订单编号'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'订单编号'
,
},
colProps
,
component
:
'Input'
,
rules
:
[{
required
:
true
,
message
:
'请输入订单编号!'
}],
},
table
:
{
},
},
title
:
'业务员名称'
,
dataIndex
:
'saleUserName'
,
key
:
'saleUserName'
,
align
:
'center'
,
},
// {
// title: '开票公司',
// dataIndex: 'invoicingCompany',
// key: 'invoicingCompany',
// align: 'center',
// },
// {
// title: '物流方式',
// dataIndex: 'logisticsMode',
// key: 'logisticsMode',
// align: 'center',
// },
{
field
:
'userId'
,
label
:
'执行人ID'
,
defaultValue
:
0
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'执行人ID'
,
},
colProps
,
component
:
'InputNumber'
,
},
table
:
{
},
title
:
'工单状态'
,
dataIndex
:
'status'
,
key
:
'status'
,
align
:
'center'
,
width
:
100
,
},
{
field
:
'realName'
,
label
:
'执行人姓名'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'执行人姓名'
,
},
colProps
,
component
:
'Input'
,
},
table
:
{
},
title
:
'操作人'
,
dataIndex
:
'editorName'
,
key
:
'editorName'
,
align
:
'center'
,
width
:
100
,
},
{
field
:
'status'
,
label
:
'工单状态'
,
defaultValue
:
'PENDING_REVIEW'
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'工单状态'
,
options
:
StatusEnumOptions
,
},
colProps
,
component
:
'Select'
,
rules
:
[{
required
:
true
,
message
:
'请输入工单状态!'
}],
},
table
:
{
customRender
:
({
text
})
=>
{
const
option
=
StatusEnumOptions
.
find
((
item
)
=>
item
.
value
===
text
)
return
option
?
option
.
label
:
text
;
},
},
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
key
:
'createTime'
,
width
:
200
,
align
:
'center'
,
},
{
field
:
'remark'
,
label
:
'备注'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'备注'
,
},
colProps
,
component
:
'Input'
,
},
table
:
{
},
title
:
'操作'
,
key
:
'action'
,
fixed
:
'right'
,
width
:
100
,
align
:
'center'
,
},
];
export
const
detailColumns
=
[
{
field
:
'endTime'
,
label
:
'返货时间'
,
defaultValue
:
undefined
,
form
:
{
colProps
,
component
:
'DatePicker'
,
componentProps
:
{
allowClear
:
true
,
placeholder
:
'返货时间'
,
format
:
'YYYY-MM-DD HH:mm:ss'
,
showTime
:
true
,
},
},
table
:
{
},
},
title
:
'产品编号'
,
dataIndex
:
'thirdProductId'
,
key
:
'thirdProductId'
,
},
// {
// title: '标识名称',
// dataIndex: 'thirdProductId10',
// key: 'thirdProductId10',
// },
{
field
:
'deleteStatus'
,
label
:
'是否删除'
,
defaultValue
:
'NO'
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'是否删除'
,
options
:
YesNoEnumOptions
,
},
colProps
,
component
:
'Select'
,
},
table
:
{
customRender
:
({
text
})
=>
{
const
option
=
YesNoEnumOptions
.
find
((
item
)
=>
item
.
value
===
text
)
return
option
?
option
.
label
:
text
;
},
},
},
title
:
'产品名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
// {
// title: '规格型号',
// dataIndex: 'thirdProductId8',
// key: 'thirdProductId8',
// },
// {
// title: '单位',
// dataIndex: 'thirdProductId7',
// key: 'thirdProductId7',
// },
{
field
:
'orderMode'
,
label
:
'工单类型'
,
defaultValue
:
'SALES_CONFIRM_ORDER'
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'工单类型'
,
options
:
OrderModeEnumOptions
,
},
colProps
,
component
:
'Select'
,
},
table
:
{
customRender
:
({
text
})
=>
{
const
option
=
OrderModeEnumOptions
.
find
((
item
)
=>
item
.
value
===
text
)
return
option
?
option
.
label
:
text
;
},
},
title
:
'类型'
,
dataIndex
:
'goodsType'
,
key
:
'goodsType'
,
},
{
field
:
'createTime'
,
label
:
'创建时间'
,
defaultValue
:
undefined
,
form
:
{
colProps
,
componentProps
:
{
allowClear
:
false
,
placeholder
:
[
'开始时间'
,
'结束时间'
],
format
:
'YYYY-MM-DD'
,
showTime
:
false
,
},
component
:
'RangePicker'
,
rules
:
[{
required
:
true
,
message
:
'请输入创建时间!'
}],
},
table
:
{
},
title
:
'订购数量'
,
key
:
'ordered'
,
},
// {
// title: '取消数量',
// dataIndex: 'thirdProductId4',
// key: 'thirdProductId4',
// },
// {
// title: '发货数量',
// dataIndex: 'thirdProductId3',
// key: 'thirdProductId3',
// },
{
field
:
'updateTime'
,
label
:
'更新时间'
,
defaultValue
:
undefined
,
form
:
{
colProps
,
componentProps
:
{
allowClear
:
false
,
placeholder
:
[
'开始时间'
,
'结束时间'
],
format
:
'YYYY-MM-DD'
,
showTime
:
false
,
},
component
:
'RangePicker'
,
rules
:
[{
required
:
true
,
message
:
'请输入更新时间!'
}],
title
:
'单价'
,
dataIndex
:
'price'
,
key
:
'price'
,
},
table
:
{
{
title
:
'总价'
,
key
:
'total'
,
},
{
title
:
'发货数量'
,
dataIndex
:
'quantity'
,
key
:
'quantity'
,
},
],
};
const
queryFields
=
[
'id'
,
'distributorId'
,
'batchOrderId'
,
'orderSn'
,
'userId'
,
'realName'
,
'status'
,
'remark'
,
'endTime'
,
'deleteStatus'
,
'orderMode'
,
'createTime'
,
'updateTime'
];
const
editFields
=
[
'distributorId'
,
'batchOrderId'
,
'orderSn'
,
'userId'
,
'realName'
,
'status'
,
'remark'
,
'endTime'
,
'deleteStatus'
,
'orderMode'
];
const
tableFields
=
[
'id'
,
'distributorId'
,
'batchOrderId'
,
'orderSn'
,
'userId'
,
'realName'
,
'status'
,
'remark'
,
'endTime'
,
'deleteStatus'
,
'orderMode'
,
'createTime'
,
'updateTime'
];
const
descriptionFields
=
[
'id'
,
'distributorId'
,
'batchOrderId'
,
'orderSn'
,
'userId'
,
'realName'
,
'status'
,
'remark'
,
'endTime'
,
'deleteStatus'
,
'orderMode'
,
'createTime'
,
'updateTime'
];
export
const
searchFormSchema
:
FormSchema
[]
=
schema
.
properties
.
filter
(
item
=>
queryFields
.
includes
(
item
.
field
))
.
map
(
({
field
,
label
,
form
:
{
rules
=
[],
...
formProps
}
})
=>
({
field
,
label
,
defaultValue
:
undefined
,
rules
:
rules
.
filter
((
r
)
=>
!
r
.
required
),
...
formProps
,
}
as
FormSchema
),
);
export
const
formSchema
:
FormSchema
[]
=
schema
.
properties
.
filter
(
item
=>
editFields
.
includes
(
item
.
field
))
.
map
(
({
field
,
label
,
defaultValue
,
form
})
=>
({
field
,
label
,
defaultValue
,
...
form
,
colProps
:
colPropsInDrawer
,
}
as
FormSchema
),
);
export
const
columns
:
BasicColumn
[]
=
schema
.
properties
.
filter
(
item
=>
tableFields
.
includes
(
item
.
field
))
.
map
(
({
field
,
label
,
table
})
=>
({
dataIndex
:
field
,
title
:
label
,
...
table
,
}
as
BasicColumn
)
);
export
const
descriptionColumns
:
BasicColumn
[]
=
schema
.
properties
.
filter
(
item
=>
descriptionFields
.
includes
(
item
.
field
))
.
map
(
({
field
,
label
,
table
})
=>
({
dataIndex
:
field
,
title
:
label
,
...
table
,
}
as
BasicColumn
),
);
];
src/views/store/components/nav.vue
浏览文件 @
664c9a46
<
template
>
<div
class=
"nav"
>
<ul>
<
li>
产品线
</li
>
<
!--
<li>
产品线
</li>
--
>
<template
v-for=
"(item, index) in navList"
>
<li
v-if=
"index !== 4"
>
|
</li>
<li
class=
"title"
:class=
"
{ active: navActiveKey === item.id || navId === item.id }"
@click="handleChangeNav(item.id)"
>
{{
item
.
name
}}
</li
>
<li
v-if=
"index !== navList.length - 1"
>
|
</li>
</
template
>
</ul>
</div>
...
...
@@ -56,16 +56,25 @@
background: #f7f9fa;
text-align: center;
border-radius: 10px;
height: 50px;
overflow-x: auto;
overflow-y: hidden;
margin-bottom: 15px;
ul {
height: 50px;
padding: 5px;
padding: 5px 15px;
// width: 1200px;
display: flex;
justify-content: space-between;
li {
font-size: 20px;
height: 40px;
line-height: 40px;
display: inline-block;
//
display: inline-block;
margin: 0 15px;
flex-shrink: 0;
}
.active {
...
...
src/views/store/components/search.vue
浏览文件 @
664c9a46
...
...
@@ -7,17 +7,20 @@
size=
"large"
@
search=
"onSearch"
/>
<div
class=
"shoppingCart"
@
click=
"handleGoShoppingCart"
>
<div
class=
"shoppingCart"
@
click=
"handleGoShoppingCart"
title=
"购物车"
>
<a-badge
:count=
"shoppingCartNum"
>
<ShoppingCartOutlined
/>
</a-badge>
</div>
<div
class=
"close"
title=
"关闭商城"
@
click=
"handleClose"
>
<CloseCircleOutlined
/>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
defineProps
,
onMounted
,
watch
}
from
'vue'
;
import
{
ShoppingCartOutlined
}
from
'@ant-design/icons-vue'
;
import
{
ShoppingCartOutlined
,
CloseCircleOutlined
}
from
'@ant-design/icons-vue'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
*
as
CartApi
from
'/@/api/order/cartApi'
;
import
{
useShoppingStoreWithOut
}
from
'/@/store/modules/store'
;
...
...
@@ -37,6 +40,10 @@
});
};
const
handleClose
=
()
=>
{
go
(
'/main/dashboard'
,
true
);
};
watch
(
()
=>
shoppingStore
.
shoppingCartRefresh
,
()
=>
{
...
...
@@ -67,7 +74,7 @@
height: 40px;
text-align: center;
position: absolute;
right:
2
0px;
right:
8
0px;
top: 0;
line-height: 40px;
font-size: 30px;
...
...
@@ -84,5 +91,22 @@
font-size: 30px;
}
}
.close {
width: 40px;
height: 40px;
text-align: center;
position: absolute;
right: 20px;
top: 0;
line-height: 40px;
font-size: 25px;
cursor: pointer;
&:hover {
background: #eee;
border-radius: 50%;
}
}
}
</
style
>
src/views/store/goodDetail/index.vue
浏览文件 @
664c9a46
...
...
@@ -32,6 +32,9 @@
<p
class=
"title"
>
产品明细列表
</p>
<a-table
:dataSource=
"productList"
:columns=
"columns"
:pagination=
"false"
>
<template
#
bodyCell=
"
{ column, record }">
<!--
<template
v-if=
"column.key === 'name'"
>
{{
goodsInfo
?.
name
}}
</
template
>
-->
<
template
v-if=
"column.key === 'quantity'"
>
<a-input-number
v-model:value=
"record.quantity"
:min=
"0"
:disabled=
"isKIT"
/>
</
template
>
...
...
@@ -101,11 +104,13 @@
if
(
isPRODUCT
.
value
)
{
res
.
productList
.
forEach
((
item
)
=>
{
item
.
quantity
=
0
;
item
.
type
=
'产品'
;
});
}
else
if
(
isKIT
.
value
)
{
res
.
productList
.
forEach
((
item
)
=>
{
item
.
basicQuantity
=
item
.
quantity
;
item
.
quantity
=
0
;
item
.
type
=
'套件'
;
});
}
...
...
src/views/store/goodDetail/schema.ts
浏览文件 @
664c9a46
...
...
@@ -4,30 +4,30 @@ export const columns = [
dataIndex
:
'thirdProductId'
,
key
:
'thirdProductId'
,
},
{
title
:
'名称'
,
dataIndex
:
'ag
e'
,
key
:
'ag
e'
,
},
{
title
:
'描述信息'
,
dataIndex
:
'address'
,
key
:
'address'
,
},
{
title
:
'型号'
,
dataIndex
:
'address1'
,
key
:
'address1'
,
},
{
title
:
'包装'
,
dataIndex
:
'address2'
,
key
:
'address2'
,
},
//
{
//
title: '名称',
// dataIndex: 'nam
e',
// key: 'nam
e',
//
},
//
{
//
title: '描述信息',
//
dataIndex: 'address',
//
key: 'address',
//
},
//
{
//
title: '型号',
//
dataIndex: 'address1',
//
key: 'address1',
//
},
//
{
//
title: '包装',
//
dataIndex: 'address2',
//
key: 'address2',
//
},
{
title
:
'类型'
,
dataIndex
:
'
address2
'
,
key
:
'
address2
'
,
dataIndex
:
'
type
'
,
key
:
'
type
'
,
},
{
title
:
'数量'
,
...
...
src/views/store/home/index.vue
浏览文件 @
664c9a46
...
...
@@ -14,7 +14,7 @@
</a-tab-pane>
</a-tabs>
</div>
<di
r
class=
"wrap"
>
<di
v
class=
"wrap"
>
<Nav
v-model:navList=
"navList"
v-model:navActiveKey=
"navActiveKey"
/>
<div
class=
"bannerWrap"
>
<div
class=
"banner"
>
...
...
@@ -67,7 +67,7 @@
</div>
</div>
</div>
</di
r
>
</di
v
>
</div>
<div
class=
"lineList"
>
<div
class=
"line"
v-for=
"item in 3"
:key=
"item"
>
...
...
@@ -132,17 +132,22 @@
const
init
=
(
changeId
?:
number
)
=>
{
let
idx
=
0
;
let
findId
=
changeId
?
changeId
:
id
;
if
(
id
||
changeId
)
{
if
(
!
findId
)
{
findId
=
localStorage
.
getItem
(
'navActiveKey'
);
}
if
(
findId
)
{
idx
=
navList
.
value
.
findIndex
((
item
)
=>
{
return
item
.
id
===
toNumber
(
findId
);
});
if
(
idx
===
-
1
)
idx
=
0
;
}
else
{
}
if
(
navList
.
value
.
length
>
0
)
{
tabList
.
value
=
navList
.
value
[
idx
]?.
children
;
navActiveKey
.
value
=
navList
.
value
[
idx
]?.
id
;
activeTabKey
.
value
=
navList
.
value
[
idx
]?.
children
[
0
]?.
id
;
tabList
.
value
=
navList
.
value
[
idx
]?.
children
||
[];
activeTabKey
.
value
=
tabList
.
value
[
0
]?.
id
||
undefined
;
localStorage
.
setItem
(
'navActiveKey'
,
navActiveKey
.
value
);
}
};
...
...
src/views/store/shoppingCart/index.vue
浏览文件 @
664c9a46
...
...
@@ -28,6 +28,9 @@
<span
v-if=
"record.goodsType === 'PRODUCT'"
>
产品
</span>
<span
v-else-if=
"record.goodsType === 'KIT'"
>
套件
</span>
</
template
>
<
template
v-if=
"column.key === 'name'"
>
<span
v-if=
"!record.name"
>
{{
record
.
goods
.
name
}}
</span>
</
template
>
<
template
v-if=
"column.key === 'quantity'"
>
<a-input-number
v-model:value=
"record.quantity"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论