Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ops_2024_vue
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
ops_2024_vue
Commits
f97656c0
Commit
f97656c0
authored
Apr 03, 2024
by
cxr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lmy' of
http://119.78.67.12/git/root/ops_2024_vue
into feature/JiraTML-148/cxr
parents
b1eca428
c1da8356
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1755 additions
and
1806 deletions
+1755
-1806
src/api/regionalSpotManage/index.ts
src/api/regionalSpotManage/index.ts
+52
-24
src/design/ant/index.less
src/design/ant/index.less
+1
-1
src/main.ts
src/main.ts
+1
-1
src/router/routes/modules/product.ts
src/router/routes/modules/product.ts
+2
-1
src/views/regionalSpotManage/components/addProduct.vue
src/views/regionalSpotManage/components/addProduct.vue
+470
-526
src/views/regionalSpotManage/components/downLoadTask.vue
src/views/regionalSpotManage/components/downLoadTask.vue
+72
-74
src/views/regionalSpotManage/components/list.vue
src/views/regionalSpotManage/components/list.vue
+725
-774
src/views/regionalSpotManage/components/platformProBatch.vue
src/views/regionalSpotManage/components/platformProBatch.vue
+275
-275
src/views/regionalSpotManage/components/upLoadTask.vue
src/views/regionalSpotManage/components/upLoadTask.vue
+119
-119
src/views/regionalSpotManage/index.vue
src/views/regionalSpotManage/index.vue
+37
-11
types/global.d.ts
types/global.d.ts
+1
-0
No files found.
src/api/regionalSpotManage/index.ts
View file @
f97656c0
import
{
tmallabHttp
}
from
'
/@/utils/http/axios
'
;
enum
Api
{
List
=
'
/system/productNegotiated/getList
'
,
BrandList
=
'
/regionalSpotManage/commit
'
,
GetStatus
=
'
/system/opsProduct/IsOpsSupplier
'
,
List
=
'
/system/opsProduct/getList
'
,
GroupList
=
'
/system/opsProduct/getTypeList
'
,
BrandList
=
'
/system/supplierBrandQualification/getApproveList
'
,
ProductList
=
'
/system/productNegotiated/getProductList
'
,
GetAreaList
=
'
/system/opsProduct/getAreaList
'
,
OpsAddProduct
=
'
/system/opsProduct/opsAddProduct
'
,
GetGhsAreaList
=
'
/system/opsProduct/getGhsAreaList
'
,
OpsDeleteProduct
=
'
/system/opsProduct/opsDeleteProduct
'
,
OpsEditProduct
=
'
/system/opsProduct/opsEditProduct
'
,
UploadOpsProduct
=
'
/excel/excelNew/uploadOpsProduct
'
,
QueryList
=
'
/system/logProductManager/queryList
'
,
RevokeExcelUpload
=
'
/system/logProductManager/revokeExcelUpload
'
,
PlatformProBatchList
=
'
/system/logNegotiationProductOperate/getList
'
,
PlatformProBatchGetDetail
=
'
/system/logNegotiationProductOperate/get
List
'
,
PlatformProBatchGetDetail
=
'
/system/logNegotiationProductOperate/get
Detail
'
,
}
/**
* @description: 区域现货管理列表
*/
export
const
regionalSpotManageGetStatusApi
=
()
=>
tmallabHttp
.
post
({
url
:
Api
.
GetStatus
});
/**
* @description: 区域现货管理列表
*/
export
const
regionalSpotManageListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
List
,
data
},
{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
List
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 获取品牌列表
*/
export
const
regionalSpotManageBrandListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
BrandList
,
data
},
{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
BrandList
,
data
});
/**
* @description: 获取分组列表
*/
export
const
regionalSpotManageGroupListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
GroupList
,
data
});
/**
* @description: 获取左边穿梭框商品列表
*/
export
const
regionalSpotManageProductListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
ProductList
,
data
});
/**
* @description: 获取现货区域列表
*/
export
const
regionalSpotManageGetAreaListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
GetAreaList
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
GetAreaList
,
data
});
/**
* @description: 新增商品接口
*/
export
const
regionalSpotManageOpsAddProductApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
OpsAddProduct
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
OpsAddProduct
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 获取已开通区域
*/
export
const
regionalSpotManageGetGhsAreaListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
GetGhsAreaList
,
data
}
,{
errorMessageMode
:
'
message
'
}
);
tmallabHttp
.
post
({
url
:
Api
.
GetGhsAreaList
,
data
});
/**
* @description: 单条/批量删除
*/
export
const
regionalSpotManageOpsDeleteProductApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
OpsDeleteProduct
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
OpsDeleteProduct
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 增加区域
*/
export
const
regionalSpotManageOpsEditProductApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
OpsEditProduct
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
OpsEditProduct
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 批量上传
*/
export
const
regionalSpotManageUploadOpsProductApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
UploadOpsProduct
,
data
},{
errorMessageMode
:
'
message
'
});
export
const
regionalSpotManageUploadOpsProductApi
=
(
data
,
file
)
=>
tmallabHttp
.
uploadFile
(
{
url
:
Api
.
UploadOpsProduct
,
method
:
'
POST
'
,
data
,
baseURL
:
import
.
meta
.
env
.
VITE_GLOB_TMALLAB_URL
,
},
{
file
,
data
},
);
/**
* @description: 任务中心获取列表
*/
export
const
taskCenterQueryListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
RevokeExcelUpload
,
data
},{
errorMessageMode
:
'
message
'
});
export
const
taskCenterQueryListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
QueryList
,
data
});
/**
* @description: 撤销
*/
export
const
taskCenterRevokeExcelUploadApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
RevokeExcelUpload
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
RevokeExcelUpload
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 任务中心获取列表--平台商品批量页签
*/
export
const
platformProBatchGetListApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
PlatformProBatchList
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
PlatformProBatchList
,
data
},
{
errorMessageMode
:
'
message
'
});
/**
* @description: 任务中心获取列表--平台商品批量页签--操作记录详情
*/
export
const
platformProBatchGetDetailApi
=
(
data
)
=>
tmallabHttp
.
post
({
url
:
Api
.
PlatformProBatchGetDetail
,
data
},{
errorMessageMode
:
'
message
'
});
tmallabHttp
.
post
({
url
:
Api
.
PlatformProBatchGetDetail
,
data
},
{
errorMessageMode
:
'
message
'
});
src/design/ant/index.less
View file @
f97656c0
...
...
@@ -69,5 +69,5 @@ span.anticon:not(.app-iconify) {
margin-left: 24px;
}
.ant-modal-body {
margin-top: 20px
;
padding: 20px !important
;
}
src/main.ts
View file @
f97656c0
...
...
@@ -41,7 +41,7 @@ async function bootstrap() {
app
.
use
(
Antd
);
app
.
mount
(
'
#app
'
);
app
.
use
(
Antd
)
app
.
use
(
Antd
)
;
}
bootstrap
();
src/router/routes/modules/product.ts
View file @
f97656c0
...
...
@@ -12,6 +12,7 @@ const product: AppRouteModule = {
orderNo
:
500
,
icon
:
'
ion:grid-outline
'
,
title
:
'
商品管理
'
,
roles
:
[
'
supplier
'
],
},
children
:
[
{
...
...
@@ -29,7 +30,7 @@ const product: AppRouteModule = {
meta
:
{
title
:
'
任务中心
'
,
},
}
}
,
],
};
...
...
src/views/regionalSpotManage/components/addProduct.vue
View file @
f97656c0
...
...
@@ -6,18 +6,19 @@
const
emit
=
defineEmits
([
'
close
'
]);
import
{
regionalSpotManageBrandListApi
,
regionalSpotManageProductListApi
,
regionalSpotManageGetAreaListApi
,
regionalSpotManageOpsAddProductApi
,
}
from
'
/@/api/regionalSpotManage
'
;
import
{
getAuthCache
}
from
'
/@/utils/auth
'
;
const
userInfo
:
any
=
getAuthCache
(
'
USER__INFO__
'
);
const
ghsCode
=
userInfo
.
supplier
.
ghsCode
;
let
searchBrand
=
ref
(
''
);
let
searchItemNo
=
ref
(
''
);
let
searchBrandList
=
ref
<
any
[]
>
([]);
const
searchBrand
=
ref
(
''
);
const
searchItemNo
=
ref
(
''
);
const
searchBrandList
=
ref
<
any
[]
>
([]);
const
handleSearch
=
async
(
value
)
=>
{
const
res
=
await
regionalSpotManageBrandListApi
({
brand
:
value
});
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
searchBrandList
.
value
=
res
.
data
;
}
else
{
searchBrandList
.
value
=
[];
...
...
@@ -26,11 +27,11 @@
const
closeModal
=
()
=>
{
emit
(
'
close
'
,
false
);
};
const
leftLoading
=
ref
(
false
);
const
leftData
=
ref
<
any
[]
>
([]);
const
leftColumns
=
[
{
title
:
'
商品名称
'
,
dataIndex
:
'
productName
'
,
key
:
'
productName
'
,
width
:
'
25%
'
,
align
:
'
center
'
,
...
...
@@ -58,53 +59,29 @@
getLeftData
();
},
});
const
getLeftData
=
()
=>
{
leftData
.
value
=
[
{
productName
:
'
测试产品1
'
,
brand
:
'
测试品牌1
'
,
goodsNo
:
'
213651
'
,
spec
:
'
100ml
'
,
sysid
:
'
1
'
,
},
{
productName
:
'
测试产品2
'
,
brand
:
'
测试品牌2
'
,
goodsNo
:
'
213652
'
,
spec
:
'
100ml
'
,
sysid
:
'
2
'
,
},
{
productName
:
'
测试产品3
'
,
brand
:
'
测试品牌3
'
,
goodsNo
:
'
213653
'
,
spec
:
'
100ml
'
,
sysid
:
'
3
'
,
},
{
productName
:
'
测试产品4
'
,
brand
:
'
测试品牌4
'
,
goodsNo
:
'
213654
'
,
spec
:
'
100ml
'
,
sysid
:
'
4
'
,
},
{
productName
:
'
测试产品5
'
,
brand
:
'
测试品牌5
'
,
goodsNo
:
'
213655
'
,
spec
:
'
100ml
'
,
sysid
:
'
5
'
,
choice
:
true
,
},
{
productName
:
'
测试产品6
'
,
brand
:
'
测试品牌6
'
,
goodsNo
:
'
213656
'
,
spec
:
'
100ml
'
,
sysid
:
'
6
'
,
choice
:
true
,
},
];
const
reset
=
()
=>
{
searchBrand
.
value
=
''
;
searchItemNo
.
value
=
''
;
pagination
.
value
.
current
=
1
;
getLeftData
();
};
const
getLeftData
=
async
()
=>
{
const
param
=
{
pageIndex
:
pagination
.
value
.
current
,
pageSize
:
pagination
.
value
.
pageSize
,
ghsCode
:
ghsCode
,
productName
:
''
,
brand
:
searchBrand
.
value
,
goodsNo
:
searchItemNo
.
value
,
};
leftLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageProductListApi
(
param
);
if
(
res
.
success
)
{
leftData
.
value
=
res
.
data
;
}
else
{
leftData
.
value
=
[];
}
leftLoading
.
value
=
false
;
if
(
rightData
.
value
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
rightData
.
value
.
length
;
i
++
)
{
if
(
...
...
@@ -125,8 +102,8 @@
leftData
.
value
=
[...
leftData
.
value
];
pagination
.
value
.
total
=
leftData
.
value
.
length
;
};
let
selectedRowKeys
=
ref
<
any
[]
>
([]);
let
selectedRows
=
ref
<
any
[]
>
([]);
const
selectedRowKeys
=
ref
<
any
[]
>
([]);
const
selectedRows
=
ref
<
any
[]
>
([]);
const
rowSelection
=
computed
(()
=>
{
return
{
selectedRowKeys
:
selectedRowKeys
.
value
,
...
...
@@ -140,7 +117,6 @@
};
});
const
toRight
=
()
=>
{
console
.
log
(
selectedRows
.
value
);
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
selectedRows
.
value
));
rightData
.
value
=
[...
arr
,
...
rightData
.
value
];
for
(
let
i
=
0
;
i
<
selectedRows
.
value
.
length
;
i
++
)
{
...
...
@@ -227,14 +203,14 @@
const
rowClassName
=
()
=>
{
return
'
table-back
'
;
};
let
loading
=
ref
(
false
);
let
addressLoading
=
ref
(
false
);
const
loading
=
ref
(
false
);
const
addressLoading
=
ref
(
false
);
const
goNext
=
async
()
=>
{
if
(
!
rightData
.
value
.
length
)
return
message
.
error
(
'
请先选择商品
'
);
addressVisible
.
value
=
true
;
addressLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageGetAreaListApi
({});
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
areaList
.
value
=
res
.
data
;
}
else
{
areaList
.
value
=
[];
...
...
@@ -245,53 +221,16 @@
const
confirmLoading
=
ref
(
false
);
const
addressVisible
=
ref
(
false
);
const
checkboxValue
=
ref
([]);
const
areaList
=
ref
<
any
[]
>
([
{
id
:
'
0
'
,
provinceId
:
'
0
'
,
province
:
'
北京市
'
,
cityId
:
0
,
city
:
'
市辖区
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
1
'
,
provinceId
:
'
1
'
,
province
:
'
河北省
'
,
cityId
:
1
,
city
:
'
保定市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
2
'
,
provinceId
:
'
2
'
,
province
:
'
河北省
'
,
cityId
:
2
,
city
:
'
石家庄市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
3
'
,
provinceId
:
'
3
'
,
province
:
'
河北省
'
,
cityId
:
3
,
city
:
'
秦皇岛市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
4
'
,
provinceId
:
'
4
'
,
province
:
'
河北省
'
,
cityId
:
3
,
city
:
'
承德市
'
,
creator
:
''
,
creationTime
:
''
,
},
]);
interface
AreaIds
{
city
?:
string
;
cityId
?:
number
;
creationTime
?:
string
;
creator
?:
string
;
id
?:
number
;
province
?:
string
;
provinceId
?:
number
;
}
const
areaList
=
ref
<
AreaIds
[]
>
([]);
const
handleCancel
=
()
=>
{
addressVisibleClose
();
};
...
...
@@ -316,14 +255,13 @@
ghscode
:
ghsCode
,
};
});
param
.
value
.
areas
=
checkboxValue
.
value
.
join
;
console
.
log
(
param
.
value
);
param
.
value
.
areas
=
checkboxValue
.
value
;
confirmLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageOpsAddProductApi
(
param
.
value
);
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
message
.
success
(
'
新增成功
'
);
addressVisibleClose
();
emit
(
'
close
'
,
false
);
emit
(
'
close
'
,
false
,
'
refresh
'
);
}
else
{
message
.
error
(
res
.
message
);
}
...
...
@@ -359,11 +297,11 @@
>
<a-select-option
v-for=
"item in searchBrandList"
:key=
"item.
value"
:label=
"item.
label"
:value=
"item.
value"
:key=
"item.
brand"
:label=
"item.
brand"
:value=
"item.
brand"
>
{{ item.
label }}
{{ item.
brand }}
</a-select-option>
</a-select>
<span
style=
"margin-left: 15px"
>
货号:
</span>
...
...
@@ -373,7 +311,7 @@
placeholder=
"请输入货号"
style=
"width: 200px"
/>
<Button
style=
"margin-left: 10px"
>
重置
</Button>
<Button
@
click=
"reset"
style=
"margin-left: 10px"
>
重置
</Button>
<Button
@
click=
"getLeftData"
type=
"primary"
style=
"margin-left: 10px"
>
查询
</Button>
</div>
<div
class=
"main"
>
...
...
@@ -392,13 +330,13 @@
:rowKey=
"(record) => record.brand + record.goodsNo + record.spec"
:scroll=
"{ x: false, y: 280 }"
:rowClassName=
"rowClassName"
:loading=
"l
oading"
:loading=
"l
eftLoading"
>
<
!-- <template #bodyCell="{ column, record }">
<
template
#bodyCell
="{
column
,
record
}"
>
<template
v-if=
"column.key === 'productName'"
>
<span>
{{
record
.
chineseName
?
record
.
chineseName
:
record
.
englishName
}}
</span>
</
template
>
</template>
-->
</template>
</a-table>
</div>
</div>
...
...
@@ -440,7 +378,13 @@
:scroll=
"{ x: false, y: 280 }"
:rowClassName=
"rowClassName"
:row-selection=
"rightRowSelection"
/>
>
<
template
#bodyCell
="{
column
,
record
}"
>
<template
v-if=
"column.key === 'productName'"
>
<span>
{{
record
.
chineseName
?
record
.
chineseName
:
record
.
englishName
}}
</span>
</
template
>
</template>
</a-table>
</div>
</div>
</div>
...
...
@@ -472,7 +416,7 @@
<a-checkbox-group
v-model:value=
"checkboxValue"
style=
"width: 100%"
>
<a-row>
<a-col
:span=
"6"
v-for=
"(item, index) in areaList"
:key=
"index"
>
<a-checkbox
:value=
"item.
id"
>
{{ item.province }}-{{ item.city }}
</a-checkbox>
<a-checkbox
:value=
"item.
cityId"
>
{{ item.province }}-{{ item.city }}
</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
...
...
src/views/regionalSpotManage/components/downLoadTask.vue
View file @
f97656c0
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
'
vue
'
;
const
config
=
import
.
meta
.
env
import
{
taskCenterQueryListApi
,
}
from
'
/@/api/regionalSpotManage
'
;
onMounted
(
async
()
=>
{
getList
()
});
let
list
=
ref
<
any
[]
>
([])
let
listLoading
=
ref
(
false
)
const
downLoad
=
(
url
)
=>
{
window
.
open
(
config
.
VITE_GLOB_API_URL
+
'
/system/
'
+
url
,
'
_blank
'
)
}
const
getList
=
async
()
=>
{
listLoading
.
value
=
true
const
res
=
await
taskCenterQueryListApi
({
type
:
1
})
if
(
res
.
code
===
20000
)
{
list
.
value
=
res
.
data
import
{
ref
,
onMounted
}
from
'
vue
'
;
const
config
=
import
.
meta
.
env
;
import
{
taskCenterQueryListApi
}
from
'
/@/api/regionalSpotManage
'
;
onMounted
(
async
()
=>
{
getList
();
});
let
list
=
ref
<
any
[]
>
([]);
let
listLoading
=
ref
(
false
);
const
downLoad
=
(
url
)
=>
{
window
.
open
(
config
.
VITE_GLOB_TMALLAB_URL
+
'
/system/
'
+
url
,
'
_blank
'
);
};
const
getList
=
async
()
=>
{
listLoading
.
value
=
true
;
const
res
=
await
taskCenterQueryListApi
({
type
:
1
});
if
(
res
.
success
)
{
list
.
value
=
res
.
data
;
}
else
{
list
.
value
=
[]
list
.
value
=
[];
}
listLoading
.
value
=
false
}
listLoading
.
value
=
false
;
};
</
script
>
<
template
>
...
...
@@ -36,39 +34,39 @@ const getList = async () => {
style=
"margin-top: 15px"
>
<a-table-column
title=
"操作时间"
align=
"center"
:width=
"100"
>
<template
v-slot=
"
{record}">
<template
#default
="
{ record }">
{{
record
.
createTime
}}
</
template
>
</a-table-column>
<a-table-column
title=
"类型"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
type
}}
</
template
>
</a-table-column>
<a-table-column
title=
"导出状态"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<p>
{{
record
.
status
==
0
?
'
待进行
'
:
(
record
.
status
==
1
?
'
进行中
'
:
'
已完成
'
)
}}
</p>
<
template
#default
="{
record
}"
>
<p>
{{
record
.
status
==
0
?
'
待进行
'
:
record
.
status
==
1
?
'
进行中
'
:
'
已完成
'
}}
</p>
</
template
>
</a-table-column>
<a-table-column
title=
"数据量"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
successNum
}}
</
template
>
</a-table-column>
<a-table-column
title=
"操作人"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
createName
}}
</
template
>
</a-table-column>
<a-table-column
title=
"操作"
align=
"center"
:width=
"200"
>
<
template
v-slot=
"{record}"
>
<Button
v-if=
"record.fileUrl"
type=
"link"
@
click=
"downLoad(record.fileUrl)"
>
下载文件
</Button>
<
template
#default
="{
record
}"
>
<a-button
v-if=
"record.fileUrl"
type=
"link"
@
click=
"downLoad(record.fileUrl)"
>
下载文件
</a-button
>
<span
v-else
>
——
</span>
</
template
>
</a-table-column>
</a-table>
</template>
<
style
lang=
"less"
scoped
>
</
style
>
<
style
lang=
"less"
scoped
></
style
>
src/views/regionalSpotManage/components/list.vue
View file @
f97656c0
...
...
@@ -16,6 +16,7 @@
import
{
getAuthCache
}
from
'
/@/utils/auth
'
;
import
{
regionalSpotManageBrandListApi
,
regionalSpotManageGroupListApi
,
regionalSpotManageListApi
,
regionalSpotManageGetAreaListApi
,
regionalSpotManageGetGhsAreaListApi
,
...
...
@@ -27,41 +28,46 @@
const
config
=
import
.
meta
.
env
;
const
userInfo
:
any
=
getAuthCache
(
'
USER__INFO__
'
);
const
ghsCode
=
userInfo
.
supplier
.
ghsCode
;
const
ghsName
=
userInfo
.
supplier
.
ghsName
;
const
router
=
useRouter
();
const
list
=
ref
<
any
[]
>
([]);
onMounted
(
async
()
=>
{
getList
();
getAllAreaList
();
getGroupOption
();
});
const
searchForm
=
ref
<
{
brand
List
:
any
;
brand
s
:
any
;
goodsNo
:
any
;
areaIds
:
any
;
types
:
any
;
}
>
({
brand
List
:
[],
brand
s
:
[],
goodsNo
:
''
,
areaIds
:
[],
types
:
[],
});
const
areaIdsOption
=
ref
([
{
label
:
'
区域1
'
,
value
:
'
区域1
'
},
{
label
:
'
区域2
'
,
value
:
'
区域2
'
},
]);
const
typesOption
=
ref
([
{
label
:
'
组1
'
,
value
:
'
组1
'
},
{
label
:
'
组2
'
,
value
:
'
组2
'
},
]);
let
searchBrandList
=
ref
<
any
[]
>
([]);
interface
AreaIds
{
city
?:
string
;
cityId
?:
number
;
creationTime
?:
string
;
creator
?:
string
;
id
?:
number
;
province
?:
string
;
provinceId
?:
number
;
}
const
areaIdsOption
=
ref
<
AreaIds
[]
>
([]);
const
typesOption
=
ref
([]);
const
searchBrandList
=
ref
<
any
[]
>
([]);
const
handleSearch
=
async
(
value
)
=>
{
const
res
=
await
regionalSpotManageBrandListApi
({
brand
:
value
});
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
searchBrandList
.
value
=
res
.
data
;
}
else
{
searchBrandList
.
value
=
[];
}
};
let
listLoading
=
ref
(
false
);
const
listLoading
=
ref
(
false
);
const
pagination
=
ref
({
pageSize
:
10
,
current
:
1
,
...
...
@@ -93,7 +99,7 @@
param
.
value
.
types
=
param
.
value
.
types
?
param
.
value
.
types
:
[];
listLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageListApi
(
param
.
value
);
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
list
.
value
=
res
.
data
;
pagination
.
value
.
total
=
res
.
data
[
0
].
total
;
}
else
{
...
...
@@ -101,47 +107,32 @@
pagination
.
value
.
total
=
0
;
}
listLoading
.
value
=
false
;
list
.
value
=
[
{
productName
:
'
测试商品
'
,
brand
:
'
测试品牌
'
,
goodsNo
:
'
45641
'
,
spec
:
'
100ml
'
,
productStatus
:
'
上架
'
,
sysid
:
'
1
'
,
},
{
productName
:
'
ffff
'
,
brand
:
'
fff
'
,
goodsNo
:
'
fff
'
,
spec
:
'
ff
'
,
productStatus
:
'
上架
'
,
sysid
:
'
2
'
,
},
];
};
const
onRset
=
()
=>
{
searchForm
.
value
.
brand
List
=
[];
searchForm
.
value
.
brand
s
=
[];
searchForm
.
value
.
goodsNo
=
''
;
searchForm
.
value
.
areaIds
=
[];
searchForm
.
value
.
types
=
[];
getList
();
};
const
onSearch
=
()
=>
{
pagination
.
value
.
pageSize
=
1
;
pagination
.
value
.
current
=
1
;
getList
();
};
let
showModal
=
ref
(
false
);
const
showModal
=
ref
(
false
);
const
addProduct
=
()
=>
{
showModal
.
value
=
true
;
};
// 关闭新增商品弹窗
const
closeVisible
=
(
val
)
=>
{
const
closeVisible
=
(
val
,
action
)
=>
{
showModal
.
value
=
val
;
if
(
action
)
{
onSearch
();
}
};
let
curItem
=
ref
<
{
[
key
:
string
]:
any
}
>
({});
const
curItem
=
ref
<
{
[
key
:
string
]:
any
}
>
({});
// =========查看区域现货 statr ===========
const
loading1
=
ref
(
false
);
...
...
@@ -160,7 +151,6 @@
},
],
});
console
.
log
(
param
.
value
);
loading1
.
value
=
true
;
const
result
=
await
getAreaList
(
param
.
value
);
regionalSpotGoods
.
value
=
result
;
...
...
@@ -168,7 +158,7 @@
};
const
getAreaList
=
async
(
param
)
=>
{
const
res
=
await
regionalSpotManageGetGhsAreaListApi
(
param
);
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
return
res
.
data
;
}
else
{
return
[];
...
...
@@ -176,16 +166,16 @@
};
// ==========查看区域现货 end =============
let
selectedRowKeys
=
ref
([]);
let
selectedRows
=
ref
<
any
[]
>
([]);
const
selectedRowKeys
=
ref
([]);
const
selectedRows
=
ref
<
any
[]
>
([]);
const
onSelectChange
=
(
Keys
,
Rows
)
=>
{
selectedRowKeys
.
value
=
Keys
;
selectedRows
.
value
=
Rows
;
};
// ===============增加区域 start=======================
let
addVisible
=
ref
(
false
);
let
addAreaLoading
=
ref
(
false
);
let
addCheckboxValue
=
ref
([
'
0
'
]);
const
addVisible
=
ref
(
false
);
const
addAreaLoading
=
ref
(
false
);
const
addCheckboxValue
=
ref
<
number
[]
>
([]);
const
addArea
=
async
(
row
)
=>
{
curItem
.
value
=
row
;
addVisible
.
value
=
true
;
...
...
@@ -202,10 +192,10 @@
});
const
result
=
await
getAreaList
(
param
.
value
);
delAreaList
.
value
=
result
;
const
curArr
=
delAreaList
.
value
.
map
((
it
)
=>
it
.
id
);
const
curArr
=
delAreaList
.
value
.
map
((
it
)
=>
it
.
cityCode
);
for
(
const
k
of
allAreaList
.
value
)
{
if
(
curArr
.
includes
(
k
.
id
))
{
addCheckboxValue
.
value
.
push
(
k
.
id
);
if
(
curArr
.
includes
(
k
.
cityId
))
{
addCheckboxValue
.
value
.
push
(
k
.
cityId
);
k
.
disabled
=
true
;
}
}
...
...
@@ -215,7 +205,7 @@
addVisible
.
value
=
false
;
addCheckboxValue
.
value
=
[];
};
let
confirmAddLoading
=
ref
(
false
);
const
confirmAddLoading
=
ref
(
false
);
const
confirmAddArea
=
async
()
=>
{
const
param
=
ref
<
{
[
key
:
string
]:
any
}
>
({
products
:
[
...
...
@@ -226,12 +216,13 @@
ghscode
:
ghsCode
,
},
],
areas
:
addCheckboxValue
.
value
.
join
,
areas
:
addCheckboxValue
.
value
,
});
confirmAddLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageOpsEditProductApi
(
param
.
value
);
if
(
res
.
success
)
{
message
.
success
(
'
添加区域成功
'
);
addVisibleCancel
();
}
else
{
message
.
error
(
res
.
message
);
}
...
...
@@ -240,31 +231,12 @@
// ===============增加区域 end=======================
// ================区域现货商品删除 start=====================
let
delVisible
=
ref
(
false
);
let
delLoading
=
ref
(
false
);
let
deleteNum
=
ref
(
0
);
let
radioValue
=
ref
(
1
);
let
delAreaList
=
ref
<
any
[]
>
([
{
id
:
'
0
'
,
provinceId
:
'
0
'
,
province
:
'
北京市
'
,
cityId
:
0
,
city
:
'
市辖区
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
1
'
,
provinceId
:
'
1
'
,
province
:
'
河北省
'
,
cityId
:
1
,
city
:
'
保定市
'
,
creator
:
''
,
creationTime
:
''
,
},
]);
//已添加的区域
let
delCheckboxValue
=
ref
([]);
const
delVisible
=
ref
(
false
);
const
delLoading
=
ref
(
false
);
const
deleteNum
=
ref
(
0
);
const
radioValue
=
ref
(
1
);
const
delAreaList
=
ref
<
any
[]
>
([]);
//已添加的区域
const
delCheckboxValue
=
ref
([]);
const
del
=
async
(
val
)
=>
{
curItem
.
value
=
val
;
deleteNum
.
value
=
1
;
...
...
@@ -279,11 +251,12 @@
},
],
});
console
.
log
(
param
.
value
);
// delLoading.value = true
// const result = await getAreaList(param.value)
// delAreaList.value = result
// delLoading.value = false
delLoading
.
value
=
true
;
const
res
=
await
getAreaList
(
param
.
value
);
if
(
res
)
{
delAreaList
.
value
=
res
;
}
delLoading
.
value
=
false
;
};
const
delVisibleCancel
=
()
=>
{
delVisible
.
value
=
false
;
...
...
@@ -292,8 +265,9 @@
delCheckboxValue
.
value
=
[];
isBatchDel
.
value
=
false
;
};
let
delConfirLoading
=
ref
(
false
);
const
delConfirLoading
=
ref
(
false
);
const
confirmDel
=
async
()
=>
{
if
(
!
delAreaList
.
value
.
length
)
return
message
.
error
(
'
暂无可删除区域
'
);
if
(
radioValue
.
value
===
2
&&
!
delCheckboxValue
.
value
.
length
)
return
message
.
error
(
'
请选择需要删除的现货区域
'
);
const
param
=
ref
<
{
[
key
:
string
]:
any
}
>
({
...
...
@@ -322,7 +296,7 @@
}
if
(
radioValue
.
value
===
1
)
{
param
.
value
.
isAll
=
true
;
param
.
value
.
areas
=
delAreaList
.
value
.
map
((
v
)
=>
v
.
id
);
param
.
value
.
areas
=
delAreaList
.
value
.
map
((
v
)
=>
v
.
cityCode
);
}
else
if
(
radioValue
.
value
===
2
)
{
param
.
value
.
areas
=
delCheckboxValue
.
value
;
}
...
...
@@ -336,8 +310,8 @@
delConfirLoading
.
value
=
false
;
};
// 批量删除
let
isBatchDel
=
ref
(
false
);
const
batchDel
=
()
=>
{
const
isBatchDel
=
ref
(
false
);
const
batchDel
=
async
()
=>
{
if
(
!
selectedRowKeys
.
value
.
length
)
return
message
.
error
(
'
请勾选商品
'
);
isBatchDel
.
value
=
true
;
deleteNum
.
value
=
selectedRows
.
value
.
length
;
...
...
@@ -353,74 +327,37 @@
ghscode
:
ghsCode
,
};
});
// delLoading.value = true
// const result = await getAreaList(param.value)
// delAreaList.value = result
// delLoading.value = false
delLoading
.
value
=
true
;
const
res
=
await
getAreaList
(
param
.
value
);
if
(
res
.
success
)
{
delAreaList
.
value
=
res
.
data
;
}
delLoading
.
value
=
false
;
};
// ================区域现货商品删除 end=====================
let
allAreaList
=
ref
<
any
[]
>
([
{
id
:
'
0
'
,
provinceId
:
'
0
'
,
province
:
'
北京市
'
,
cityId
:
0
,
city
:
'
市辖区
'
,
creator
:
''
,
creationTime
:
''
,
disabled
:
true
,
},
{
id
:
'
1
'
,
provinceId
:
'
1
'
,
province
:
'
河北省
'
,
cityId
:
1
,
city
:
'
保定市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
2
'
,
provinceId
:
'
2
'
,
province
:
'
河北省
'
,
cityId
:
2
,
city
:
'
石家庄市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
3
'
,
provinceId
:
'
3
'
,
province
:
'
河北省
'
,
cityId
:
3
,
city
:
'
秦皇岛市
'
,
creator
:
''
,
creationTime
:
''
,
},
{
id
:
'
4
'
,
provinceId
:
'
4
'
,
province
:
'
河北省
'
,
cityId
:
3
,
city
:
'
承德市
'
,
creator
:
''
,
creationTime
:
''
,
},
]);
const
allAreaList
=
ref
<
any
[]
>
([]);
const
getAllAreaList
=
async
()
=>
{
const
res
=
await
regionalSpotManageGetAreaListApi
({});
if
(
res
.
success
)
{
allAreaList
.
value
=
res
.
data
;
areaIdsOption
.
value
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
));
}
else
{
allAreaList
.
value
=
[];
}
};
const
getGroupOption
=
async
()
=>
{
const
res
=
await
regionalSpotManageGroupListApi
({});
if
(
res
.
success
)
{
typesOption
.
value
=
res
.
data
;
}
else
{
typesOption
.
value
=
[];
}
};
// =====================批量导入 start=======================
let
productExcelList
=
ref
<
any
[]
>
([]);
let
importVisible
=
ref
(
false
);
const
impotrCheckboxValue
=
ref
([]);
const
productExcelList
=
ref
<
any
[]
>
([]);
const
importVisible
=
ref
(
false
);
const
impotrCheckboxValue
=
ref
<
any
[]
>
([]);
const
batchImport
=
()
=>
{
importVisible
.
value
=
true
;
allAreaList
.
value
.
forEach
((
v
)
=>
{
...
...
@@ -447,22 +384,34 @@
productExcelList
.
value
=
[];
};
const
downLoad
=
()
=>
{
window
.
open
(
config
.
VITE_GLOB_API_URL
,
'
_blank
'
);
window
.
open
(
config
.
VITE_GLOB_TMALLAB_URL
+
'
/system/resources/区域现货商品上传模板.xlsx
'
,
'
_blank
'
,
);
};
let
importLoading
=
ref
(
false
);
const
confirmImport
=
async
()
=>
{
if
(
!
productExcelList
.
value
.
length
)
return
message
.
error
(
'
请上传文件
'
);
if
(
!
impotrCheckboxValue
.
value
.
length
)
return
message
.
error
(
'
请选择现货区域
'
);
const
param
:
FormData
=
new
FormData
();
param
.
append
(
'
ghsCode
'
,
ghsCode
);
param
.
append
(
'
file
'
,
productExcelList
.
value
[
0
]);
param
.
append
(
'
areaIds
'
,
impotrCheckboxValue
.
value
.
join
(
'
,
'
));
// const param: FormData = new FormData();
// param.append('ghsCode', ghsCode);
// param.append('ghsName', ghsName);
// param.append('file', productExcelList.value[0]);
// param.append('areaIds', impotrCheckboxValue.value.join(',') as any);
importLoading
.
value
=
true
;
const
res
=
await
regionalSpotManageUploadOpsProductApi
(
param
);
if
(
res
.
code
===
20000
)
{
const
res
:
any
=
await
regionalSpotManageUploadOpsProductApi
(
{
ghsCode
:
ghsCode
,
ghsName
:
ghsName
,
areaIds
:
impotrCheckboxValue
.
value
,
},
productExcelList
.
value
[
0
],
);
if
(
res
.
data
.
success
)
{
message
.
success
(
'
批量导入成功
'
);
importCancel
();
}
else
{
message
.
error
(
res
.
message
);
message
.
error
(
res
.
data
.
message
);
}
importLoading
.
value
=
false
;
};
...
...
@@ -474,7 +423,7 @@
// =====================批量导入 end=======================
const
goTaskCenter
=
()
=>
{
router
.
push
({
path
:
'
/
taskCenter
'
,
path
:
'
/
product/taskCenter
'
,
});
};
</
script
>
...
...
@@ -491,9 +440,9 @@
<Row
:gutter=
"20"
>
<Col
:xxl=
"4"
:xl=
"6"
:lg=
"8"
:sm=
"12"
:xs=
"24"
>
<FormItem
label=
"品牌名称"
name=
"brandList"
>
<!--
<Input
v-model:value=
"searchForm.brand
List"
allow-clear
placeholder=
"请输入品牌名称"
/>
-->
<!--
<Input
v-model:value=
"searchForm.brand
s"
allow-clear
placeholder=
"请输入品牌名称"
/>
-->
<a-select
v-model:value=
"searchForm.brand
List"
v-model:value=
"searchForm.brand
s"
show-search
mode=
"multiple"
placeholder=
"请输入品牌名称"
...
...
@@ -502,15 +451,16 @@
:show-arrow=
"false"
:filter-option=
"false"
:not-found-content=
"null"
:maxTagCount=
"1"
@
search=
"handleSearch"
>
<a-select-option
v-for=
"item in searchBrandList"
:key=
"item.
value"
:label=
"item.
label"
:value=
"item.
value"
:key=
"item.
brand"
:label=
"item.
brand"
:value=
"item.
brand"
>
{{
item
.
label
}}
{{
item
.
brand
}}
</a-select-option>
</a-select>
</FormItem>
...
...
@@ -527,13 +477,14 @@
allowClear
mode=
"multiple"
placeholder=
"请选择现货区域"
:maxTagCount=
"1"
style=
"width: 100%"
>
<SelectOption
v-for=
"(item, index) in areaIdsOption"
:key=
"index"
:value=
"item.
value"
>
{{
item
.
label
}}
</SelectOption
:value=
"item.
cityId"
>
{{
item
.
province
}}
-
{{
item
.
city
}}
</SelectOption
>
</Select>
</FormItem>
...
...
@@ -545,14 +496,12 @@
allowClear
mode=
"multiple"
placeholder=
"请选择商品分组"
:maxTagCount=
"1"
style=
"width: 100%"
>
<SelectOption
v-for=
"(item, index) in typesOption"
:key=
"index"
:value=
"item.value"
>
{{
item
.
label
}}
</SelectOption
>
<SelectOption
v-for=
"(item, index) in typesOption"
:key=
"index"
:value=
"item"
>
{{
item
}}
</SelectOption>
</Select>
</FormItem>
</Col>
...
...
@@ -573,7 +522,7 @@
:loading=
"listLoading"
bordered
:pagination=
"pagination"
:rowKey=
"(record) => record.
sysid"
:rowKey=
"(record) => record.
brand + record.goodsNo + record.spec"
:row-selection=
"
{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
...
...
@@ -582,32 +531,32 @@
style="margin-top: 15px"
>
<a-table-column
title=
"商品名称"
align=
"center"
:width=
"100"
>
<template
v-slot=
"
{ record }">
<template
#default
="
{ record }">
{{
record
.
productName
}}
</
template
>
</a-table-column>
<a-table-column
title=
"品牌"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
brand
}}
</
template
>
</a-table-column>
<a-table-column
title=
"货号"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
goodsNo
}}
</
template
>
</a-table-column>
<a-table-column
title=
"规格"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
spec
}}
</
template
>
</a-table-column>
<a-table-column
title=
"当前现货区域"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
<Button
type=
"link"
@
click=
"viewCurrent(record)"
>
查看区域现货
</Button>
</
template
>
</a-table-column>
<a-table-column
title=
"上架状态"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
productStatus
}}
</
template
>
</a-table-column>
...
...
@@ -629,7 +578,7 @@
:maskClosable=
"false"
okText=
"提交"
>
<div
style=
"margin-top: -35px"
>
商品名称:{{ curItem.productName }}
</div>
<div
>
商品名称:{{ curItem.productName }}
</div>
<div>
商品品牌:{{ curItem.brand }}
</div>
<div>
商品货号:{{ curItem.goodsNo }}
</div>
<div>
商品规格:{{ curItem.spec }}
</div>
...
...
@@ -642,15 +591,15 @@
style=
"margin-top: 15px"
>
<a-table-column
title=
"区域"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
{{
record
.
provinceName
}}
-
{{
record
.
cityName
}}
</
template
>
<
template
#default
="{
record
}"
>
{{
record
.
provinceName
}}
-
{{
record
.
cityName
}}
</
template
>
</a-table-column>
<a-table-column
title=
"添加时间"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
createTime
}}
</
template
>
</a-table-column>
<a-table-column
title=
"添加人"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{ record }"
>
<
template
#default
="{
record
}"
>
{{
record
.
createName
}}
</
template
>
</a-table-column>
...
...
@@ -685,7 +634,9 @@
>
<a-row>
<a-col
:span=
"6"
v-for=
"(item, index) in delAreaList"
:key=
"index"
>
<a-checkbox
:value=
"item.id"
>
{{ item.province }}-{{ item.city }}
</a-checkbox>
<a-checkbox
:value=
"item.cityCode"
>
{{ item.provinceName }}-{{ item.cityName }}
</a-checkbox
>
</a-col>
</a-row>
</a-checkbox-group>
...
...
@@ -702,7 +653,7 @@
okText=
"提交"
:confirmLoading=
"confirmAddLoading"
>
<div
style=
"margin-top: -35px"
>
商品名称:{{ curItem.productName }}
</div>
<div
>
商品名称:{{ curItem.productName }}
</div>
<div>
商品品牌:{{ curItem.brand }}
</div>
<div>
商品货号:{{ curItem.goodsNo }}
</div>
<div>
商品规格:{{ curItem.spec }}
</div>
...
...
@@ -710,7 +661,7 @@
<a-checkbox-group
v-model:value=
"addCheckboxValue"
style=
"width: 100%"
>
<a-row>
<a-col
:span=
"6"
v-for=
"(item, index) in allAreaList"
:key=
"index"
>
<a-checkbox
:value=
"item.
id"
:disabled=
"item.disabled"
<a-checkbox
:value=
"item.
cityId"
:disabled=
"item.disabled"
>
{{ item.province }}-{{ item.city }}
</a-checkbox
>
</a-col>
...
...
@@ -755,7 +706,7 @@
<a-checkbox-group
v-model:value=
"impotrCheckboxValue"
style=
"width: 100%"
>
<a-row>
<a-col
:span=
"6"
v-for=
"(item, index) in allAreaList"
:key=
"index"
>
<a-checkbox
:value=
"item.
id"
:disabled=
"item.disabled"
<a-checkbox
:value=
"item.
cityId"
:disabled=
"item.disabled"
>
{{ item.province }}-{{ item.city }}
</a-checkbox
>
</a-col>
...
...
src/views/regionalSpotManage/components/platformProBatch.vue
View file @
f97656c0
<
script
lang=
"ts"
setup
>
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
{
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
{
platformProBatchGetListApi
,
platformProBatchGetDetailApi
}
from
'
/@/api/regionalSpotManage
'
;
import
{
message
}
from
'
ant-design-vue
'
;
onMounted
(
async
()
=>
{
getList
()
});
let
list
=
ref
<
any
[]
>
([
{
createTime
:
'
2024/12/12 12:22:22
'
,
operateModule
:
'
平台商品管理-议价商品
'
,
type
:
'
批量导入议价商品
'
,
operateNum
:
8882
,
successNum
:
8882
,
failNum
:
0
,
operateName
:
'
赵欣雨
'
}
])
let
listLoading
=
ref
(
false
)
const
pagination
=
ref
({
platformProBatchGetDetailApi
,
}
from
'
/@/api/regionalSpotManage
'
;
import
{
message
}
from
'
ant-design-vue
'
;
onMounted
(
async
()
=>
{
getList
();
});
let
list
=
ref
<
any
[]
>
([]);
let
listLoading
=
ref
(
false
);
const
pagination
=
ref
({
pageSize
:
10
,
current
:
1
,
total
:
0
,
showTotal
:
total
=>
`共
${
total
}
条`
,
showTotal
:
(
total
)
=>
`共
${
total
}
条`
,
hideOnSinglePage
:
false
,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
'
10
'
,
'
20
'
,
'
30
'
,
'
50
'
,
'
100
'
],
onChange
:
(
current
)
=>
{
pagination
.
value
.
current
=
current
getList
()
pagination
.
value
.
current
=
current
;
getList
();
},
onShowSizeChange
:
(
size
)
=>
{
pagination
.
value
.
pageSize
=
size
getList
()
}
})
const
search
=
()
=>
{
pagination
.
value
.
current
=
1
getList
()
}
const
getList
=
async
()
=>
{
pagination
.
value
.
pageSize
=
size
;
getList
();
},
});
const
search
=
()
=>
{
pagination
.
value
.
current
=
1
;
getList
();
};
const
getList
=
async
()
=>
{
const
param
=
ref
<
{
[
key
:
string
]:
any
}
>
({
currentPage
:
pagination
.
value
.
current
,
pageSize
:
pagination
.
value
.
pageSize
})
listLoading
.
value
=
true
const
res
=
await
platformProBatchGetListApi
(
param
)
if
(
res
.
code
===
20000
)
{
list
.
value
=
res
.
data
pagination
.
value
.
total
=
res
.
data
[
0
].
total
pageSize
:
pagination
.
value
.
pageSize
,
});
listLoading
.
value
=
true
;
const
res
=
await
platformProBatchGetListApi
(
param
.
value
);
if
(
res
.
success
)
{
list
.
value
=
res
.
data
;
pagination
.
value
.
total
=
res
.
data
[
0
].
total
;
}
else
{
list
.
value
=
[]
pagination
.
value
.
total
=
0
list
.
value
=
[];
pagination
.
value
.
total
=
0
;
}
listLoading
.
value
=
false
}
let
curItem
=
ref
<
{
[
key
:
string
]:
any
}
>
({});
let
visible
=
ref
(
false
)
let
operationList
=
ref
<
any
[]
>
([])
let
detailLoading
=
ref
(
false
)
const
viewRecord
=
(
item
)
=>
{
curItem
.
value
=
item
visible
.
value
=
true
getDetails
(
item
)
}
const
getDetails
=
async
(
item
)
=>
{
listLoading
.
value
=
false
;
};
let
curItem
=
ref
<
{
[
key
:
string
]:
any
}
>
({});
let
visible
=
ref
(
false
);
let
operationList
=
ref
<
any
[]
>
([]);
let
detailLoading
=
ref
(
false
);
const
viewRecord
=
(
item
)
=>
{
curItem
.
value
=
item
;
visible
.
value
=
true
;
getDetails
(
item
);
};
const
getDetails
=
async
(
item
)
=>
{
const
param
=
ref
<
{
[
key
:
string
]:
any
}
>
({
currentPage
:
1
,
pageSize
:
10
,
sysid
:
item
.
sysid
,
type
:
''
})
detailLoading
.
value
=
true
const
res
=
await
platformProBatchGetDetailApi
(
param
)
if
(
res
.
code
===
20000
)
{
operationList
.
value
=
res
.
data
type
:
''
,
});
detailLoading
.
value
=
true
;
const
res
=
await
platformProBatchGetDetailApi
(
param
.
value
);
if
(
res
.
success
)
{
operationList
.
value
=
res
.
data
;
}
else
{
operationList
.
value
=
[]
operationList
.
value
=
[];
}
detailLoading
.
value
=
false
}
detailLoading
.
value
=
false
;
};
// =================导出========================
let
exportLoading
=
ref
(
false
)
const
exportExcel
=
async
()
=>
{
handleDownload
([
{
"
brand
"
:
"
生工
"
,
"
category
"
:
""
,
"
createTime
"
:
"
2024-03-29 14:42:35
"
,
"
discount
"
:
null
,
"
expirationDate
"
:
null
,
"
failReason
"
:
"
该商品在商品目录不存在;
"
,
"
identificationType
"
:
"
商品议价
"
,
"
itemNo
"
:
"
G508013-0001
"
,
"
negotiationPrice
"
:
5000
,
"
operateSysid
"
:
13877
,
"
platforms
"
:
[
"
北京协和医院
"
],
"
productName
"
:
"
微孔板迷你离心机,500~3000 rpm
"
,
"
spec
"
:
"
1 /PK
"
,
"
status
"
:
false
,
"
sysid
"
:
83466873
,
"
total
"
:
32
,
"
type
"
:
2
}
])
// =================导出========================
let
exportLoading
=
ref
(
false
);
const
exportExcel
=
async
()
=>
{
const
param
=
ref
<
{
[
key
:
string
]:
any
}
>
({
sysid
:
curItem
.
value
.
sysid
,
type
:
''
})
exportLoading
.
value
=
true
const
res
=
await
platformProBatchGetDetailApi
(
param
)
if
(
res
.
code
===
20000
)
{
handleDownload
(
res
.
data
)
type
:
''
,
});
exportLoading
.
value
=
true
;
const
res
=
await
platformProBatchGetDetailApi
(
param
.
value
);
if
(
res
.
success
)
{
handleDownload
(
res
.
data
);
}
else
{
message
.
error
(
'
暂无数据
'
)
message
.
error
(
'
暂无数据
'
);
}
exportLoading
.
value
=
false
}
const
handleDownload
=
(
list
)
=>
{
import
(
'
/@/vendor/Export2Excel
'
).
then
(
excel
=>
{
let
tHeader
=
[
'
商品名称
'
,
'
品牌
'
,
'
货号
'
,
'
包装规格
'
,
'
平台
'
,
'
状态
'
,
'
失败原因
'
,
'
执行时间
'
]
let
filterVal
=
[
'
productName
'
,
'
brand
'
,
'
itemNo
'
,
'
spec
'
,
'
platforms
'
,
'
status
'
,
'
failReason
'
,
'
createTime
'
]
list
.
forEach
(
item
=>
{
if
(
item
.
status
)
{
item
.
status
=
'
成功
'
exportLoading
.
value
=
false
;
};
const
handleDownload
=
(
list
)
=>
{
import
(
'
/@/vendor/Export2Excel
'
).
then
((
excel
)
=>
{
let
tHeader
=
[
'
商品名称
'
,
'
品牌
'
,
'
货号
'
,
'
包装规格
'
,
'
平台
'
,
'
状态
'
,
'
失败原因
'
,
'
执行时间
'
,
];
let
filterVal
=
[
'
productName
'
,
'
brand
'
,
'
itemNo
'
,
'
spec
'
,
'
platforms
'
,
'
status
'
,
'
failReason
'
,
'
createTime
'
,
];
list
.
forEach
((
item
)
=>
{
if
(
item
.
status
)
{
item
.
status
=
'
成功
'
;
}
else
{
item
.
status
=
'
失败
'
item
.
status
=
'
失败
'
;
}
if
(
item
.
platforms
)
{
item
.
platforms
=
item
.
platforms
.
join
(
'
,
'
)
if
(
item
.
platforms
)
{
item
.
platforms
=
item
.
platforms
.
join
(
'
,
'
);
}
else
{
item
.
platforms
=
''
item
.
platforms
=
''
;
}
});
const
data
=
formatJson
(
filterVal
,
list
)
const
data
=
formatJson
(
filterVal
,
list
);
excel
.
export_json_to_excel
({
header
:
tHeader
as
any
,
data
:
data
as
any
,
filename
:
'
操作记录详情
'
as
any
,
autoWidth
:
true
as
any
,
bookType
:
'
xlsx
'
as
any
,
XlsWidth
:
null
as
any
,
searchList
:
[]
as
any
})
})
}
const
formatJson
=
(
filterVal
,
jsonData
)
=>
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
{
return
v
[
j
]
}))
}
header
:
tHeader
,
data
:
data
,
filename
:
'
操作记录详情
'
,
autoWidth
:
false
,
bookType
:
'
xlsx
'
,
XlsWidth
:
[],
searchList
:
null
,
});
});
};
const
formatJson
=
(
filterVal
,
jsonData
)
=>
{
return
jsonData
.
map
((
v
)
=>
filterVal
.
map
((
j
)
=>
{
return
v
[
j
];
}),
);
};
</
script
>
<
template
>
...
...
@@ -169,45 +158,53 @@ const formatJson = (filterVal, jsonData) => {
style=
"margin-top: 15px"
>
<a-table-column
title=
"操作时间"
align=
"center"
:width=
"100"
>
<template
v-slot=
"
{record}">
<template
#default
="
{ record }">
{{
record
.
createTime
}}
</
template
>
</a-table-column>
<a-table-column
title=
"功能模块"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
operateModule
}}
</
template
>
</a-table-column>
<a-table-column
title=
"类型"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
type
}}
</
template
>
</a-table-column>
<a-table-column
title=
"操作数量"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<a-button
v-if=
"record.operateNum"
type=
"link"
@
click=
"viewRecord(record)"
>
{{
record
.
operateNum
}}
</a-button>
<
template
#default
="{
record
}"
>
<a-button
v-if=
"record.operateNum"
type=
"link"
@
click=
"viewRecord(record)"
>
{{
record
.
operateNum
}}
</a-button>
<span
v-else
>
/
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"解析成功数量"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
<span
v-if=
"record.successNum"
>
{{
record
.
successNum
}}
</span>
<span
v-else
>
/
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"解析失败数量"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
<span
v-if=
"record.failNum"
>
{{
record
.
failNum
}}
</span>
<span
v-else
>
/
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"操作人"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
operateName
}}
</
template
>
</a-table-column>
</a-table>
<a-modal
v-model:visible=
"visible"
title=
"操作记录详情"
:width=
"1200"
:maskClosable=
"false"
:keyboard=
"false"
>
<a-modal
v-model:visible=
"visible"
title=
"操作记录详情"
:width=
"1200"
:maskClosable=
"false"
:keyboard=
"false"
>
<
template
#footer
>
<a-button
type=
"primary"
:loading=
"exportLoading"
@
click=
"exportExcel"
>
导出数据
</a-button>
</
template
>
...
...
@@ -216,46 +213,49 @@ const formatJson = (filterVal, jsonData) => {
:loading=
"detailLoading"
bordered
:rowKey=
"(record) => record.sysid"
style=
"margin-top: -15px"
>
<a-table-column
title=
"商品名称"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
productName
}}
</
template
>
</a-table-column>
<a-table-column
title=
"品牌"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
brand
}}
</
template
>
</a-table-column>
<a-table-column
title=
"货号"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
itemNo
}}
</
template
>
</a-table-column>
<a-table-column
title=
"包装规格"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
spec
}}
</
template
>
</a-table-column>
<a-table-column
title=
"平台"
align=
"center"
:width=
"150"
>
<
template
v-slot=
"{record}"
>
<span
v-if=
"record.platforms && record.platforms.length > 1"
:title=
"record.platforms.join(',')"
>
{{
record
.
platforms
[
0
]
+
'
...
'
}}
</span>
<
template
#default
="{
record
}"
>
<span
v-if=
"record.platforms && record.platforms.length > 1"
:title=
"record.platforms.join(',')"
>
{{
record
.
platforms
[
0
]
+
'
...
'
}}
</span
>
<span
v-else
>
{{
record
.
platforms
?
record
.
platforms
[
0
]
:
''
}}
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"状态"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
status
?
'
成功
'
:
'
失败
'
}}
</
template
>
</a-table-column>
<a-table-column
title=
"失败原因"
:width=
"150"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
<span
class=
"opinionClass"
:title=
"record.failReason"
>
{{
record
.
failReason
}}
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"执行时间"
align=
"center"
:width=
"100"
>
<
template
v-slot=
"{record}"
>
<
template
#default
="{
record
}"
>
{{
record
.
createTime
}}
</
template
>
</a-table-column>
...
...
@@ -264,12 +264,12 @@ const formatJson = (filterVal, jsonData) => {
</template>
<
style
lang=
"less"
scoped
>
.opinionClass {
.opinionClass {
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
}
</
style
>
src/views/regionalSpotManage/components/upLoadTask.vue
View file @
f97656c0
...
...
@@ -12,12 +12,12 @@
let
list
=
ref
<
any
[]
>
([]);
let
listLoading
=
ref
(
false
);
const
downLoad
=
(
url
)
=>
{
window
.
open
(
config
.
VITE_GLOB_
API_URL
+
'
/system/excelFile/
'
+
url
,
'
_blank
'
);
window
.
open
(
config
.
VITE_GLOB_
TMALLAB_URL
+
'
/system/excelFile/
'
+
url
,
'
_blank
'
);
};
const
downloadFail
=
(
record
)
=>
{
if
(
record
.
failNum
===
0
)
return
;
let
href
=
config
.
VITE_GLOB_
API_URL
+
config
.
VITE_GLOB_
TMALLAB_URL
+
'
/excel/excelNew/fail/download?sysid=
'
+
record
.
sysid
+
'
&type=
'
+
...
...
@@ -29,7 +29,7 @@
sysid
:
record
.
sysid
,
});
const
res
=
await
taskCenterRevokeExcelUploadApi
(
param
.
value
);
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
message
.
success
(
'
操作成功
'
);
getList
();
}
else
{
...
...
@@ -39,7 +39,7 @@
const
getList
=
async
()
=>
{
listLoading
.
value
=
true
;
const
res
=
await
taskCenterQueryListApi
({
type
:
0
});
if
(
res
.
code
===
20000
)
{
if
(
res
.
success
)
{
list
.
value
=
res
.
data
;
}
else
{
list
.
value
=
[];
...
...
@@ -84,7 +84,7 @@
</a-table-column>
<a-table-column
title=
"操作数据"
align=
"center"
:width=
"100"
>
<
template
#default
="{
record
}"
>
{{
record
.
sproductNumpec
}}
{{
record
.
productNum
}}
</
template
>
</a-table-column>
<a-table-column
title=
"成功数据"
align=
"center"
:width=
"100"
>
...
...
@@ -104,12 +104,12 @@
</a-table-column>
<a-table-column
title=
"操作"
align=
"center"
:width=
"200"
>
<
template
#default
="{
record
}"
>
<
Button
type=
"link"
@
click=
"downLoad(record.fileUrl)"
>
下载源文件
</Button>
<
Button
type=
"link"
v-if=
"record.failNum"
@
click=
"downloadFail(record)"
>
下载错误数据
</
Button
<
a-button
type=
"link"
@
click=
"downLoad(record.fileUrl)"
>
下载源文件
</a-button>
<
a-button
type=
"link"
v-if=
"record.failNum"
@
click=
"downloadFail(record)"
>
下载错误数据
</
a-button
>
<
Button
type=
"link"
v-if=
"record.status == 0 && !record.isRevoke"
@
click=
"cancel(record)"
>
撤销
</
Button
<
a-button
type=
"link"
v-if=
"record.status == 0 && !record.isRevoke"
@
click=
"cancel(record)"
>
撤销
</
a-button
>
</
template
>
</a-table-column>
...
...
src/views/regionalSpotManage/index.vue
View file @
f97656c0
<
script
lang=
"ts"
setup
>
import
ManageList
from
'
./components/list.vue
'
;
import
{
ref
,
onMounted
}
from
'
vue
'
;
import
{
regionalSpotManageGetStatusApi
}
from
'
/@/api/regionalSpotManage
'
;
import
ManageList
from
'
./components/list.vue
'
;
const
show
=
ref
(
false
);
const
loading
=
ref
(
false
);
onMounted
(
async
()
=>
{
loading
.
value
=
true
;
const
res
=
await
regionalSpotManageGetStatusApi
().
catch
(()
=>
(
loading
.
value
=
false
));
if
(
res
.
success
)
{
show
.
value
=
true
;
}
loading
.
value
=
false
;
});
</
script
>
<
template
>
<ManageList
/>
<div>
<!--
<ManageList
/>
-->
<a-spin
v-if=
"loading"
style=
"height: 150px; width: 100%; line-height: 150px"
/>
<ManageList
v-if=
"show && !loading"
/>
<div
v-if=
"!show && !loading"
class=
"status"
>
<img
src=
"../../assets/images/logo.png"
alt=
""
srcset=
""
/>
</div>
</div>
</
template
>
<
style
lang=
"less"
scoped
>
.status {
height: 100vh;
img {
width: 100%;
height: 100vh;
object-fit: contain;
}
}
</
style
>
types/global.d.ts
View file @
f97656c0
...
...
@@ -56,6 +56,7 @@ declare global {
interface
ImportMeta
{
env
:
{
VITE_GLOB_API_URL
?:
string
;
VITE_GLOB_TMALLAB_URL
?:
string
;
};
}
...
...
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