Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 35d24f69
authored
Mar 30, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 上传弹框 组件化
1 parent
3377206b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
367 additions
and
1913 deletions
src/components/d2-file-import-dialog/index.vue
src/views/customer/recordList.vue
src/views/financeManage/financeList.vue
src/views/goods/grounding/index.vue
src/views/goods/purchaseOnShelves/index.vue
src/views/goods/shelfManage/components/detailCon/FinanceConfig.vue
src/views/index/components/outputValueDialog.vue
src/views/index/outputValue.vue
src/views/orderManage/carDamage.vue
src/views/orderManage/order.vue
src/views/residentManage/inStorePoints/pointsRecord.vue
src/views/systemConfig/ShopConfig/deliveryQuantity/index.vue
src/views/systemConfig/ShopConfig/index.vue
src/views/systemConfig/ShopConfig/outputValue/index.vue
src/views/systemConfig/ShopConfig/personalConversionRate/index.vue
src/views/systemConfig/ShopConfig/storeGrossProfit/index.vue
src/views/systemConfig/businessSchoolManage/staffList.vue
src/views/systemConfig/downloadReportManage/index.vue
src/components/d2-file-import-dialog/index.vue
View file @
35d24f6
...
@@ -8,11 +8,13 @@
...
@@ -8,11 +8,13 @@
label-width=
"120px"
label-width=
"120px"
:model=
"form"
:model=
"form"
:rules=
"rules"
>
:rules=
"rules"
>
<el-form-item
label=
"导入文件:"
<slot
name=
"prepend"
/>
<el-form-item
:label=
"formItemLabel"
prop=
"fileName"
>
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-col
:span=
"16"
>
<el-input
v-model=
"form.fileName"
<el-input
v-model=
"form.fileName"
readonly
/>
readonly
/>
<slot
name=
"tip"
/>
</el-col>
</el-col>
<el-col
class=
"m-l-md"
<el-col
class=
"m-l-md"
:span=
"4"
>
:span=
"4"
>
...
@@ -61,6 +63,10 @@ export default {
...
@@ -61,6 +63,10 @@ export default {
type
:
String
,
type
:
String
,
default
:
"模版下载"
,
default
:
"模版下载"
,
},
},
formItemLabel
:
{
type
:
String
,
default
:
"导入文件:"
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
...
src/views/customer/recordList.vue
View file @
35d24f6
...
@@ -42,44 +42,11 @@
...
@@ -42,44 +42,11 @@
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
/>
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
/>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
<d2-file-import-dialog
:is-visible=
"fileVisible"
<slot>
title=
"上传文件"
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
@
closeDialog=
"handleImport"
<!--
<el-form-item
v-if=
"userInfo.beSuper"
label=
"园区店:"
prop=
"yqMerchantId"
>
@
confirmDialog=
"handleConfirmImport"
<el-select
v-model=
"fileForm.yqMerchantId"
>
@
downloadTemplate=
"exportTemplate"
/>
<el-option
v-for=
"item in baseData.parkServiceList.filter(i => i.merchantName !== '全部')"
:key=
"item.merchantId"
:value=
"item.merchantId"
:label=
"item.merchantName"
/>
</el-select>
</el-form-item>
-->
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<!--
<el-link
href=
"http://img01.glsx.com.cn/upload/salesexcel/预录订单导入模板.xlsx"
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
>
模版下载
</el-link>
-->
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
<el-form-item
v-show=
"showNum"
>
<span>
导入成功
{{
importNum
.
succNum
}}
条,导入失败
{{
importNum
.
failNum
}}
条
</span>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container>
</d2-container>
</
template
>
</
template
>
...
@@ -97,17 +64,7 @@ export default {
...
@@ -97,17 +64,7 @@ export default {
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
hideVisible
:
false
,
hideVisible
:
false
,
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
total
:
0
,
total
:
0
,
showNum
:
false
,
importNum
:
{
succNum
:
0
,
failNum
:
0
},
fileRules
:
{
yqMerchantId
:
[{
required
:
true
,
message
:
'请选择园区店'
,
trigger
:
'change'
}],
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
tableSearchForm
:
{},
tableSearchForm
:
{},
searchForm
:
{
searchForm
:
{
shopOrYqMerchantId
:
''
,
shopOrYqMerchantId
:
''
,
...
@@ -359,30 +316,7 @@ export default {
...
@@ -359,30 +316,7 @@ export default {
handleShowHide
()
{
handleShowHide
()
{
this
.
hideVisible
=
!
this
.
hideVisible
this
.
hideVisible
=
!
this
.
hideVisible
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过9M'
)
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
},
handleImport
()
{
handleImport
()
{
this
.
fileForm
=
{
fileName
:
''
}
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
exportFailList
(
list
)
{
exportFailList
(
list
)
{
...
@@ -396,27 +330,22 @@ export default {
...
@@ -396,27 +330,22 @@ export default {
formatJson
(
filterVal
,
jsonData
)
{
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
recordUpload
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
recordUpload
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
handleImport
()
}
})
}
}
})
})
},
},
...
@@ -479,29 +408,4 @@ export default {
...
@@ -479,29 +408,4 @@ export default {
margin
:
0
0
;
margin
:
0
0
;
}
}
.record-list
.m-l-md
{
margin-left
:
20px
;
}
.record-list
.import-btn
{
position
:
relative
;
}
.record-list
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.record-list
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/financeManage/financeList.vue
View file @
35d24f6
...
@@ -459,23 +459,10 @@
...
@@ -459,23 +459,10 @@
<download-account-dialog
:account-visible=
"accountVisible"
v-if=
"accountVisible"
:scene=
"searchForm.sceneType"
@
custTmpl=
"handleCustTmpl"
@
handleBill=
"handleBill"
@
accountClose=
"accountClose"
/>
<download-account-dialog
:account-visible=
"accountVisible"
v-if=
"accountVisible"
:scene=
"searchForm.sceneType"
@
custTmpl=
"handleCustTmpl"
@
handleBill=
"handleBill"
@
accountClose=
"accountClose"
/>
<!-- 出库面板 -->
<!-- 出库面板 -->
<warehouse-detail
v-if=
"warehouseVisible"
:warehouse-visible=
"warehouseVisible"
:order-info-id=
"orderId"
@
handleDrawerClose=
"handleDrawerClose"
/>
<warehouse-detail
v-if=
"warehouseVisible"
:warehouse-visible=
"warehouseVisible"
:order-info-id=
"orderId"
@
handleDrawerClose=
"handleDrawerClose"
/>
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
<d2-file-import-dialog
:is-visible=
"fileVisible"
<slot>
title=
"上传文件"
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
@
closeDialog=
"handleImport"
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
@
confirmDialog=
"handleConfirmImport"
/>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
/>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<tmpl-drawer
v-if=
"tmplDrawerVisible"
:tmplDrawerVisible=
"tmplDrawerVisible"
:type=
"tmplInfo.type"
:tmplSelectList=
"tmplInfo.tmplSelectList"
@
handleConfirm=
"handleCustConfirm"
@
handleClose=
"handleCustVisible"
></tmpl-drawer>
<tmpl-drawer
v-if=
"tmplDrawerVisible"
:tmplDrawerVisible=
"tmplDrawerVisible"
:type=
"tmplInfo.type"
:tmplSelectList=
"tmplInfo.tmplSelectList"
@
handleConfirm=
"handleCustConfirm"
@
handleClose=
"handleCustVisible"
></tmpl-drawer>
<system-bill-dialog
v-if=
"billVisible"
:billVisible=
"billVisible"
:billTmplInfo=
"billTmplInfo"
@
handleClose=
"handleBillVisible"
@
handleConfirm=
"handleBillVisible"
></system-bill-dialog>
<system-bill-dialog
v-if=
"billVisible"
:billVisible=
"billVisible"
:billTmplInfo=
"billTmplInfo"
@
handleClose=
"handleBillVisible"
@
handleConfirm=
"handleBillVisible"
></system-bill-dialog>
</div>
</div>
...
@@ -748,10 +735,6 @@ export default {
...
@@ -748,10 +735,6 @@ export default {
/** 根据场景控制页面显示隐藏end */
/** 根据场景控制页面显示隐藏end */
sceneList
:
sceneList
,
sceneList
:
sceneList
,
positionTypeList
:
[],
// 商品部位数据
positionTypeList
:
[],
// 商品部位数据
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}]
},
fileForm
:
{},
fileVisible
:
false
,
fileVisible
:
false
,
tmplDrawerVisible
:
false
,
tmplDrawerVisible
:
false
,
tmplInfo
:
{
tmplInfo
:
{
...
@@ -899,62 +882,30 @@ export default {
...
@@ -899,62 +882,30 @@ export default {
},
},
handleImport
()
{
handleImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
// 上传文件,转码为base64
handleConfirmImport
({
fileName
,
fileData
})
{
importFile
(
e
)
{
var
params
=
{
console
.
log
(
e
)
file
:
fileData
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
(
event
)
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
","
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
e
.
target
.
files
[
0
].
name
.
split
(
"."
)?.
length
-
1
]
+
"@"
+
arrBase64
[
1
]
document
.
getElementById
(
"fileUpload"
).
value
=
""
}
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
)
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
},
api
.
uploadFile
(
params
).
then
((
res
)
=>
{
handleConfirmImport
()
{
if
(
res
)
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
const
list
=
[
if
(
valid
)
{
...
this
.
updateList
,
var
params
=
{
{
file
:
this
.
fileInfo
name
:
fileName
,
}
ifSuccess
:
false
,
api
.
uploadFile
(
params
).
then
((
res
)
=>
{
uuid
:
res
,
if
(
res
)
{
type
:
"upload"
// 异步处理文件上传 把id传入处理轮询
const
list
=
[
...
this
.
updateList
,
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
res
,
type
:
"upload"
}
]
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
})
this
.
notice
.
okTips
(
"上传成功"
)
this
.
handleBatchImport
()
}
}
})
]
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
})
this
.
notice
.
okTips
(
"上传成功"
)
this
.
handleBatchImport
()
}
}
})
})
},
},
handleBatchImport
()
{
handleBatchImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
async
getBaseData
()
{
async
getBaseData
()
{
this
.
baseData
.
channelTypeList
=
await
this
.
get
(
BaseData
.
channelType
)
this
.
baseData
.
channelTypeList
=
await
this
.
get
(
BaseData
.
channelType
)
...
@@ -1527,26 +1478,4 @@ export default {
...
@@ -1527,26 +1478,4 @@ export default {
margin-right
:
5px
;
margin-right
:
5px
;
display
:
inline-block
;
display
:
inline-block
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/goods/grounding/index.vue
View file @
35d24f6
...
@@ -178,39 +178,11 @@
...
@@ -178,39 +178,11 @@
@
handleBatchCopyClose=
"handleBatchCopyClose"
@
handleBatchCopyClose=
"handleBatchCopyClose"
@
handleBatchCopyConfirm=
"handleBatchCopyConfirm"
>
@
handleBatchCopyConfirm=
"handleBatchCopyConfirm"
>
</BatchCopyDialog>
</BatchCopyDialog>
<d2-dialog
:is-visible=
"fileVisible"
<d2-file-import-dialog
:is-visible=
"fileVisible"
title=
"上传文件"
title=
"上传文件"
@
closeDialog=
"handleBatchImport"
@
closeDialog=
"handleBatchImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
<slot>
@
downloadTemplate=
"exportTemplate"
/>
<el-form
ref=
"fileRuleForm"
label-width=
"120px"
:model=
"fileForm"
:rules=
"fileRules"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
v-model=
"fileForm.fileName"
readonly
/>
</el-col>
<el-col
class=
"m-l-md"
:span=
"4"
>
<el-button
class=
"import-btn"
>
导入文件
<input
id=
"fileUpload"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
class=
"import-input"
type=
"file"
@
change=
"importFile($event)"
>
<el-link
class=
"import-template"
icon=
"el-icon-link"
type=
"primary"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 批量修改库存模式弹窗 -->
<!-- 批量修改库存模式弹窗 -->
<BatchModifyInventoryDialog
:selected-data=
"selectedTableData"
<BatchModifyInventoryDialog
:selected-data=
"selectedTableData"
...
@@ -669,11 +641,7 @@ export default {
...
@@ -669,11 +641,7 @@ export default {
batchCopySelectScene
:
""
,
// 批量复制选中的场景值
batchCopySelectScene
:
""
,
// 批量复制选中的场景值
batchCopyVisible
:
false
,
batchCopyVisible
:
false
,
batchCopySelectData
:
[],
// 批量辅助选中的上架数据
batchCopySelectData
:
[],
// 批量辅助选中的上架数据
fileRules
:
{
fileVisible
:
false
,
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}],
},
fileForm
:
{},
fileVisible
:
false
,
batchModifyInventoryVisible
:
false
,
batchModifyInventoryVisible
:
false
,
selectedTableData
:
[],
selectedTableData
:
[],
};
};
...
@@ -843,52 +811,28 @@ export default {
...
@@ -843,52 +811,28 @@ export default {
];
];
this
.
actionSetDownloadList
({
list
,
type
:
"dowloadList"
});
this
.
actionSetDownloadList
({
list
,
type
:
"dowloadList"
});
},
},
handleBatchImport
()
{
handleBatchImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
();
},
},
handleConfirmImport
({
fileName
,
fileData
})
{
// 上传文件,转码为base64
let
params
=
{
importFile
(
e
)
{
file
:
fileData
,
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
;
};
if
(
size
<
9
)
{
groundingImport
(
params
).
then
((
res
)
=>
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
);
if
(
res
)
{
// // 转码base64
const
list
=
[...
this
.
updateList
,
{
const
reader
=
new
FileReader
();
name
:
fileName
,
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
]);
ifSuccess
:
false
,
reader
.
onload
=
(
event
)
=>
{
uuid
:
res
,
const
imgFile
=
event
.
target
.
result
;
type
:
"upload"
,
const
arrBase64
=
imgFile
.
split
(
","
);
}];
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
e
.
target
.
files
[
0
].
name
.
split
(
"."
)?.
length
-
1
]
+
"@"
+
arrBase64
[
1
];
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
};
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
);
}
},
handleConfirmImport
()
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
let
params
=
{
file
:
this
.
fileInfo
,
};
groundingImport
(
params
).
then
((
res
)
=>
{
if
(
res
)
{
// 异步处理文件上传 把id传入处理轮询
const
list
=
[...
this
.
updateList
,
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
res
,
type
:
"upload"
,
}];
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
});
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
});
this
.
notice
.
okTips
(
"上传成功"
);
this
.
notice
.
okTips
(
"上传成功"
);
this
.
handleBatchImport
();
this
.
handleBatchImport
();
}
}
});
});
}
},
});
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
upgradeGoodsName
:
""
,
upgradeGoodsName
:
""
,
...
@@ -1181,30 +1125,5 @@ export default {
...
@@ -1181,30 +1125,5 @@ export default {
margin-left
:
8px
;
margin-left
:
8px
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
}
}
</
style
>
</
style
>
src/views/goods/purchaseOnShelves/index.vue
View file @
35d24f6
...
@@ -117,29 +117,11 @@
...
@@ -117,29 +117,11 @@
:selected-scene=
"batchCopySelectScene"
@
handleBatchCopyConfirm=
"handleBatchCopyConfirm"
:selected-scene=
"batchCopySelectScene"
@
handleBatchCopyConfirm=
"handleBatchCopyConfirm"
@
handleBatchCopyClose=
"handleBatchCopyClose"
>
@
handleBatchCopyClose=
"handleBatchCopyClose"
>
</batch-copy-dialog>
</batch-copy-dialog>
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleBatchImport"
<d2-file-import-dialog
:is-visible=
"fileVisible"
@
confirmDialog=
"handleConfirmImport"
>
title=
"上传文件"
<slot>
@
closeDialog=
"handleBatchImport"
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
@
confirmDialog=
"handleConfirmImport"
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
@
downloadTemplate=
"exportTemplate"
/>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container>
</d2-container>
</template>
</template>
<
script
>
<
script
>
...
@@ -520,10 +502,6 @@ export default {
...
@@ -520,10 +502,6 @@ export default {
batchCopySelectScene
:
''
,
// 批量复制选中的场景值
batchCopySelectScene
:
''
,
// 批量复制选中的场景值
batchCopyVisible
:
false
,
batchCopyVisible
:
false
,
batchCopySelectData
:
[],
// 批量辅助选中的上架数据
batchCopySelectData
:
[],
// 批量辅助选中的上架数据
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
fileForm
:
{},
fileVisible
:
false
fileVisible
:
false
}
}
},
},
...
@@ -704,48 +682,23 @@ export default {
...
@@ -704,48 +682,23 @@ export default {
},
},
handleBatchImport
()
{
handleBatchImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
// 上传文件,转码为base64
handleConfirmImport
({
fileName
,
fileData
})
{
importFile
(
e
)
{
var
params
=
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
file
:
fileData
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过9M'
)
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
},
groundingImport
(
params
).
then
(
res
=>
{
handleConfirmImport
()
{
if
(
res
)
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
valid
)
{
name
:
fileName
,
var
params
=
{
ifSuccess
:
false
,
file
:
this
.
fileInfo
uuid
:
res
,
}
type
:
'upload'
groundingImport
(
params
).
then
(
res
=>
{
}]
if
(
res
)
{
// 异步处理文件上传 把id传入处理轮询
const
list
=
[...
this
.
updateList
,
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
res
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleBatchImport
()
this
.
handleBatchImport
()
}
})
}
}
})
})
},
},
...
@@ -982,30 +935,5 @@ export default {
...
@@ -982,30 +935,5 @@ export default {
margin-left
:
8px
;
margin-left
:
8px
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
}
}
</
style
>
</
style
>
src/views/goods/shelfManage/components/detailCon/FinanceConfig.vue
View file @
35d24f6
This diff is collapsed.
Click to expand it.
src/views/index/components/outputValueDialog.vue
View file @
35d24f6
...
@@ -93,52 +93,11 @@
...
@@ -93,52 +93,11 @@
</slot>
</slot>
</d2-dialog>
</d2-dialog>
<!-- 导入门店设置 -->
<d2-file-import-dialog
:is-visible=
"fileVisible"
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleImport"
title=
"上传文件"
@
confirmDialog=
"handleConfirmImport"
width=
"600px"
>
@
closeDialog=
"handleImport"
<slot>
@
confirmDialog=
"handleConfirmImport"
<div>
@
downloadTemplate=
"downLoadTemplate"
/>
<el-form
:model=
"fileForm"
:rules=
"fileRules"
ref=
"fileRuleForm"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
/>
<!-- href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/对账单模版.xlsx" -->
<el-link
type=
"primary"
class=
"import-template"
@
click=
"downLoadTemplate"
icon=
"el-icon-link"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
<span
v-show=
"showNum"
>
<div
class=
"upload-statistics"
>
<div
class=
"quantity"
>
<div
class=
"success"
>
{{ importNum.successCount }}
</div>
<div>
有效数据
</div>
</div>
<div
class=
"line"
></div>
<div
class=
"quantity"
>
<div
class=
"err"
>
{{ importNum.failCount }}
</div>
<div>
异常数据
</div>
</div>
</div>
<div
class=
"abnormal"
>
<p>
数据异常的可能原因:
</p>
<p
class=
"color-33"
>
1. 订单编号不匹配
</p>
</div>
</span>
</div>
</slot>
</d2-dialog>
</div>
</div>
</template>
</template>
...
@@ -162,15 +121,6 @@ export default {
...
@@ -162,15 +121,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
fileVisible
:
false
,
fileVisible
:
false
,
showNum
:
false
,
importNum
:
{
succNum
:
0
,
failNum
:
0
},
fileForm
:
{},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}]
},
pickerOptions
:
{
pickerOptions
:
{
disabledDate
:
(
time
)
=>
{
disabledDate
:
(
time
)
=>
{
const
maxMonth
=
dayjs
().
subtract
(
-
1
,
'months'
).
endOf
(
'month'
)
const
maxMonth
=
dayjs
().
subtract
(
-
1
,
'months'
).
endOf
(
'month'
)
...
@@ -297,109 +247,22 @@ export default {
...
@@ -297,109 +247,22 @@ export default {
result
&&
downLoadFile
(
result
)
result
&&
downLoadFile
(
result
)
})
})
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
console
.
log
(
e
)
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
(
event
)
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
","
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
1
]
+
"@"
+
arrBase64
[
1
]
// orderManage.pictureUpload({ file: this.fileInfo }).then((res) => {
// if (res) {
// this.fileForm.fileUrl = res
// }
// // const refName = "file" + row.id
// // const refName = "file"
// e.target.value = ""
// // this.$refs[refName].value = ""
// })
document
.
getElementById
(
"fileUpload"
).
value
=
""
}
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
)
document
.
getElementById
(
"fileUpload"
).
value
=
""
}
},
handleImport
()
{
handleImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
merchantOutputValueTargetImport
({
file
:
fileData
}).
then
((
result
)
=>
{
if
(
valid
)
{
if
(
result
)
{
// var params = {
const
list
=
[...
this
.
updateList
,
{
// fileUrl: this.fileForm.fileUrl
name
:
fileName
,
// }
ifSuccess
:
false
,
merchantOutputValueTargetImport
({
file
:
this
.
fileInfo
}).
then
((
result
)
=>
{
uuid
:
result
,
if
(
result
)
{
type
:
'upload'
// 异步处理文件上传 把id传入处理轮询
}]
const
list
=
[...
this
.
updateList
,
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
result
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
handleImport
()
}
// console.log(result, 'result')
// const { url, dataList } = result
// console.log(url, 'url')
// if (url) {
// // this.$message.error('上传失败')
// this.$message.error('上传失败')
// downLoadFile(url)
// }
// if (dataList) {
// this.$message.success('上传成功')
// this.fileVisible = false
// this.hasPage = false
// // const listFilter = result.list
// this.tableData = dataList.map((item) => {
// item.dataMonth = this.search.targetDate
// item.isEdit = true
// item.areaSupervision = item.areaSupervision || {}
// item.residentManager = item.residentManager || {}
// item.area = item.area || ''
// // item.residentManagerOptionsList = item.residentManager?{}
// if (item.residentManager) {
// item.residentManagerOptionsList = [{
// userId: item.residentManager.userId,
// userName: item.residentManager.userName,
// userNum: item.residentManager.userNum,
// userType: item.residentManager.userType
// }]
// } else {
// item.residentManagerOptionsList = []
// }
// return item
// })
// // this.tableTotal = result.total
// }
})
// .catch((err) => {
// })
// orderManage.orderEndExportApi(params).then((res) => {
// if (res) {
// this.showNum = true
// this.importNum = {
// successCount: res.successCount,
// failCount: res.failCount
// }
// this.$message.success('上传成功')
// // this.handleImport()
// }
// })
}
}
})
})
},
},
...
@@ -602,66 +465,4 @@ export default {
...
@@ -602,66 +465,4 @@ export default {
margin-top
:
94px
;
margin-top
:
94px
;
}
}
.upload-wrap
{
display
:
flex
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
.m-l-md
{
margin-left
:
20px
;
}
.upload-statistics
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin
:
30px
70px
;
.quantity
{
font-size
:
14px
;
color
:
#333333
;
text-align
:
center
;
.success
{
font-size
:
26px
;
color
:
#2cca74
;
text-align
:
center
;
margin-bottom
:
4px
;
}
.err
{
font-size
:
26px
;
color
:
#eb4e4e
;
text-align
:
center
;
margin-bottom
:
4px
;
}
}
.line
{
width
:
1px
;
height
:
56px
;
background
:
#e8e8ea
;
}
}
</
style
>
</
style
>
src/views/index/outputValue.vue
View file @
35d24f6
...
@@ -24,26 +24,11 @@
...
@@ -24,26 +24,11 @@
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
/>
<auth-button
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
/>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
<d2-file-import-dialog
:is-visible=
"fileVisible"
<slot>
title=
"上传文件"
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
@
closeDialog=
"handleImport"
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
@
confirmDialog=
"handleConfirmImport"
<el-col
:span=
"16"
>
@
downloadTemplate=
"exportTemplate"
/>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
href=
"http://img01.glsx.com.cn/upload/salesexcel/企微推送对象导入模板.xlsx"
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<d2-dialog
:title=
"chooseType"
@
closeDialog=
"handleObject"
@
confirmDialog=
"handleConfirmObject"
<d2-dialog
:title=
"chooseType"
@
closeDialog=
"handleObject"
@
confirmDialog=
"handleConfirmObject"
:is-visible=
"pushVisible"
>
:is-visible=
"pushVisible"
>
<slot>
<slot>
...
@@ -92,9 +77,7 @@ export default {
...
@@ -92,9 +77,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
state
,
state
,
// 上传文件数据
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
// 搜索表格数据
// 搜索表格数据
tableSearchForm
:
{},
tableSearchForm
:
{},
searchForm
:
{
searchForm
:
{
...
@@ -170,9 +153,6 @@ export default {
...
@@ -170,9 +153,6 @@ export default {
}
}
]
]
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
changeList
:
[],
changeList
:
[],
superviseList
:
[],
superviseList
:
[],
residentialList
:
[],
residentialList
:
[],
...
@@ -196,25 +176,6 @@ export default {
...
@@ -196,25 +176,6 @@ export default {
methods
:
{
methods
:
{
...
mapActions
(
'd2admin/user'
,
[
'actionSetDownloadList'
]),
...
mapActions
(
'd2admin/user'
,
[
'actionSetDownloadList'
]),
...
mapMutations
(
'd2admin/user'
,
[
'setUpdateRefesh'
]),
...
mapMutations
(
'd2admin/user'
,
[
'setUpdateRefesh'
]),
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过9M'
)
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
},
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
this
.
tableSearchForm
=
deepClone
(
this
.
searchForm
)
this
.
tableSearchForm
=
deepClone
(
this
.
searchForm
)
...
@@ -224,38 +185,31 @@ export default {
...
@@ -224,38 +185,31 @@ export default {
keyDowmGetList
()
{
keyDowmGetList
()
{
this
.
$refs
.
outputValueTable
.
refreshTable
()
this
.
$refs
.
outputValueTable
.
refreshTable
()
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
importContact
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
importContact
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
// labelText: ''
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
handleImport
()
}
})
}
}
})
})
},
},
handleImport
()
{
handleImport
()
{
// this.fileForm = {
// fileName: ''
// }
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
exportTemplate
()
{
window
.
open
(
'http://img01.glsx.com.cn/upload/salesexcel/企微推送对象导入模板.xlsx'
)
},
merchantData
(
type
)
{
merchantData
(
type
)
{
const
superviseParams
=
{
const
superviseParams
=
{
currentPage
:
1
,
currentPage
:
1
,
...
@@ -401,31 +355,5 @@ export default {
...
@@ -401,31 +355,5 @@ export default {
.outputValue-list
{
.outputValue-list
{
position
:
relative
;
position
:
relative
;
}
}
.outputValue-list
.m-l-md
{
margin-left
:
20px
;
}
.outputValue-list
.import-btn
{
position
:
relative
;
}
.outputValue-list
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.outputValue-list
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/orderManage/carDamage.vue
View file @
35d24f6
...
@@ -605,46 +605,11 @@
...
@@ -605,46 +605,11 @@
@
current
-
change
=
"handleCurrentChange"
@
current
-
change
=
"handleCurrentChange"
@
size
-
change
=
"handleSizeChange"
/>
@
size
-
change
=
"handleSizeChange"
/>
<
/div
>
<
/div
>
<
d2
-
dialog
:
is
-
visible
=
"fileVisible"
<
d2
-
file
-
import
-
dialog
:
is
-
visible
=
"fileVisible"
title
=
"上传文件"
title
=
"上传文件"
@
closeDialog
=
"handleImport"
@
closeDialog
=
"handleImport"
@
confirmDialog
=
"handleConfirmImport"
>
@
confirmDialog
=
"handleConfirmImport"
<
slot
>
@
downloadTemplate
=
"exportTemplate"
/>
<
el
-
form
ref
=
"fileRuleForm"
label
-
width
=
"120px"
:
model
=
"fileForm"
:
rules
=
"fileRules"
>
<
el
-
form
-
item
label
=
"导入文件:"
prop
=
"fileName"
>
<
el
-
col
:
span
=
"16"
>
<
el
-
input
v
-
model
=
"fileForm.fileName"
readonly
/>
<
/el-col
>
<
el
-
col
class
=
"m-l-md"
:
span
=
"4"
>
<
el
-
button
class
=
"import-btn"
>
导入文件
<
input
id
=
"fileUpload"
accept
=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
class
=
"import-input"
type
=
"file"
@
change
=
"importFile($event)"
/>
<
el
-
link
class
=
"import-template"
href
=
"http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx"
icon
=
"el-icon-link"
type
=
"primary"
>
模版下载
<
/el-link
>
<
/el-button
>
<
/el-col
>
<
/el-form-item
>
<
el
-
form
-
item
v
-
show
=
"showNum"
>
<
span
>
导入成功
{{
importNum
.
succNum
}}
条,导入失败
{{
importNum
.
failNum
}}
条
<
/span
>
<
/el-form-item
>
<
/el-form
>
<
/slot
>
<
/d2-dialog
>
<!--
选择分账规则
-->
<!--
选择分账规则
-->
<
ChooseRuleDialog
v
-
if
=
"ruleVisible"
<
ChooseRuleDialog
v
-
if
=
"ruleVisible"
...
@@ -714,15 +679,6 @@ export default {
...
@@ -714,15 +679,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
fileForm
:
{
}
,
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}
],
}
,
showNum
:
false
,
importNum
:
{
succNum
:
0
,
failNum
:
0
,
}
,
fileVisible
:
false
,
fileVisible
:
false
,
waitOrderNum
:
0
,
waitOrderNum
:
0
,
statusOpts
:
{
statusOpts
:
{
...
@@ -1394,73 +1350,32 @@ export default {
...
@@ -1394,73 +1350,32 @@ export default {
}
,
}
,
handleImport
()
{
handleImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
();
}
,
}
,
// 上传文件,转码为base64
handleConfirmImport
({
fileName
,
fileData
}
)
{
importFile
(
e
)
{
let
params
=
{
// console.log(e)
file
:
fileData
,
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
;
}
;
if
(
size
<
9
)
{
orderImport
(
params
).
then
((
res
)
=>
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
);
if
(
res
)
{
// // 转码base64
const
list
=
[
const
reader
=
new
FileReader
();
...
this
.
updateList
,
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
]);
{
reader
.
onload
=
(
event
)
=>
{
name
:
fileName
,
const
imgFile
=
event
.
target
.
result
;
ifSuccess
:
false
,
const
arrBase64
=
imgFile
.
split
(
","
);
uuid
:
res
,
this
.
fileInfo
type
:
"upload"
,
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
1
]
+
"@"
+
arrBase64
[
1
];
}
,
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
];
}
;
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
);
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
}
}
,
handleConfirmImport
()
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
let
params
=
{
// advanceUserId: this.userInfo.detail.uuid,
// advanceUserName: this.userInfo.merchantAccountLevel == 4 ? this.userInfo.detail.userName : this.userInfo.detail.merchantName,
// yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.merchantId,
file
:
this
.
fileInfo
,
}
;
orderImport
(
params
).
then
((
res
)
=>
{
// console.log(res)
if
(
res
)
{
// 异步处理文件上传 把id传入处理轮询
const
list
=
[
...
this
.
updateList
,
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
res
,
type
:
"upload"
,
// labelText: ''
}
,
];
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
}
);
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
}
);
this
.
notice
.
okTips
(
"上传成功"
);
this
.
notice
.
okTips
(
"上传成功"
);
this
.
handleImport
();
this
.
handleImport
();
}
// this.showNum = !!res.failNum
// res.succNum && this.$refs.recordTable.refreshTable()
// if (res.failNum)
{
// this.importNum =
{
// succNum: res.succNum,
// failNum: res.failNum
//
}
// this.exportFailList(res.errorList)
// return true
//
}
// this.handleImport()
// this.notice.okTips('上传成功')
}
);
}
}
}
);
}
);
}
,
}
,
exportTemplate
()
{
window
.
open
(
'http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx'
);
}
,
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
sceneType
:
0
,
sceneType
:
0
,
...
@@ -1999,30 +1914,4 @@ export default {
...
@@ -1999,30 +1914,4 @@ export default {
margin
-
top
:
40
px
;
margin
-
top
:
40
px
;
}
}
.
order
-
list
.
m
-
l
-
md
{
margin
-
left
:
20
px
;
}
// .order-list
.
order
-
list
.
import
-
btn
{
position
:
relative
;
}
.
order
-
list
.
import
-
input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98
px
;
height
:
36
px
;
cursor
:
pointer
;
font
-
size
:
0
;
}
.
order
-
list
.
import
-
template
{
position
:
absolute
;
height
:
20
px
;
top
:
50
px
;
left
:
0
;
}
<
/style
>
<
/style
>
src/views/orderManage/order.vue
View file @
35d24f6
...
@@ -607,63 +607,30 @@
...
@@ -607,63 +607,30 @@
@
current
-
change
=
"handleCurrentChange"
@
current
-
change
=
"handleCurrentChange"
@
size
-
change
=
"handleSizeChange"
/>
@
size
-
change
=
"handleSizeChange"
/>
<
/div
>
<
/div
>
<
d2
-
dialog
:
is
-
visible
=
"fileVisible"
<
d2
-
file
-
import
-
dialog
:
is
-
visible
=
"fileVisible"
title
=
"上传文件"
title
=
"上传文件"
@
closeDialog
=
"handleImport"
@
closeDialog
=
"handleImport"
@
confirmDialog
=
"handleConfirmImport"
>
@
confirmDialog
=
"handleConfirmImport"
<
slot
>
@
downloadTemplate
=
"exportTemplate"
>
<
el
-
form
ref
=
"fileRuleForm"
<
template
#
prepend
>
label
-
width
=
"120px"
<
el
-
form
-
item
label
=
"选择门店:"
>
:
model
=
"fileForm"
<
el
-
select
v
-
model
=
"selectedMerchantId"
:
rules
=
"fileRules"
>
filterable
<
el
-
form
-
item
label
=
"选择门店:"
prop
=
"merchantId"
>
:
loading
=
"loading"
<
el
-
select
v
-
model
=
"fileForm.merchantId"
placeholder
=
"请输入关键字"
filterable
remote
:
loading
=
"loading"
:
remote
-
method
=
"remoteMethod"
placeholder
=
"请输入关键字"
reserve
-
keyword
remote
style
=
"width: 280px"
>
:
remote
-
method
=
"remoteMethod"
<
el
-
option
v
-
for
=
"(opt, optIndex) in options"
reserve
-
keyword
:
key
=
"optIndex"
style
=
"width: 280px"
>
:
label
=
"opt.merchantName"
<
el
-
option
v
-
for
=
"(opt, optIndex) in options"
:
value
=
"opt.merchantId"
>
:
key
=
"optIndex"
<
/el-option
>
:
label
=
"opt.merchantName"
<
/el-select
>
:
value
=
"opt.merchantId"
>
<
/el-form-item
>
<
/el-option
>
<
/template
>
<
/el-select
>
<
/d2-file-import-dialog
>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"导入文件:"
prop
=
"fileName"
>
<
el
-
col
:
span
=
"16"
>
<
el
-
input
v
-
model
=
"fileForm.fileName"
readonly
/>
<
/el-col
>
<
el
-
col
class
=
"m-l-md"
:
span
=
"4"
>
<
el
-
button
class
=
"import-btn"
>
导入文件
<
input
id
=
"fileUpload"
accept
=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
class
=
"import-input"
type
=
"file"
@
change
=
"importFile($event)"
/>
<!--
href
=
"http://img01.glsx.com.cn/upload/salesexcel/园区店客户订单导入模板.xlsx"
-->
<
el
-
link
class
=
"import-template"
icon
=
"el-icon-link"
type
=
"primary"
@
click
=
"exportTemplate"
>
模版下载
<
/el-link
>
<
/el-button
>
<
/el-col
>
<
/el-form-item
>
<
el
-
form
-
item
v
-
show
=
"showNum"
>
<
span
>
导入成功
{{
importNum
.
succNum
}}
条,导入失败
{{
importNum
.
failNum
}}
条
<
/span
>
<
/el-form-item
>
<
/el-form
>
<
/slot
>
<
/d2-dialog
>
<!--
选择分账规则
-->
<!--
选择分账规则
-->
<
ChooseRuleDialog
v
-
if
=
"ruleVisible"
<
ChooseRuleDialog
v
-
if
=
"ruleVisible"
...
@@ -764,16 +731,7 @@ export default {
...
@@ -764,16 +731,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
fileForm
:
{
}
,
selectedMerchantId
:
""
,
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}
],
// merchantId: [
{
required
:
true
,
message
:
'请选择门店'
,
trigger
:
'change'
}
]
}
,
showNum
:
false
,
importNum
:
{
succNum
:
0
,
failNum
:
0
,
}
,
fileVisible
:
false
,
fileVisible
:
false
,
waitOrderNum
:
0
,
waitOrderNum
:
0
,
statusOpts
:
{
statusOpts
:
{
...
@@ -1416,71 +1374,27 @@ export default {
...
@@ -1416,71 +1374,27 @@ export default {
handleImport
()
{
handleImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
();
this
.
selectedMerchantId
=
""
;
}
,
// 上传文件,转码为base64
importFile
(
e
)
{
// console.log(e)
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
;
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
);
// // 转码base64
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
]);
reader
.
onload
=
(
event
)
=>
{
const
imgFile
=
event
.
target
.
result
;
const
arrBase64
=
imgFile
.
split
(
","
);
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
1
]
+
"@"
+
arrBase64
[
1
];
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
}
;
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
);
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
}
}
,
}
,
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
}
)
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
let
params
=
{
if
(
valid
)
{
file
:
fileData
,
let
params
=
{
}
;
// advanceUserId: this.userInfo.detail.uuid,
orderImport
(
params
).
then
((
res
)
=>
{
// advanceUserName: this.userInfo.merchantAccountLevel == 4 ? this.userInfo.detail.userName : this.userInfo.detail.merchantName,
if
(
res
)
{
// yqMerchantId: this.userInfo.beSuper ? this.fileForm.yqMerchantId : this.userInfo.detail.merchantId,
const
list
=
[
file
:
this
.
fileInfo
,
...
this
.
updateList
,
}
;
{
orderImport
(
params
).
then
((
res
)
=>
{
name
:
fileName
,
// console.log(res)
ifSuccess
:
false
,
if
(
res
)
{
uuid
:
res
,
// 异步处理文件上传 把id传入处理轮询
type
:
"upload"
,
const
list
=
[
}
,
...
this
.
updateList
,
];
{
name
:
this
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
res
,
type
:
"upload"
,
// labelText: ''
}
,
];
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
}
);
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
}
);
this
.
notice
.
okTips
(
"上传成功"
);
this
.
notice
.
okTips
(
"上传成功"
);
this
.
handleImport
();
this
.
handleImport
();
}
// this.showNum = !!res.failNum
// res.succNum && this.$refs.recordTable.refreshTable()
// if (res.failNum)
{
// this.importNum =
{
// succNum: res.succNum,
// failNum: res.failNum
//
}
// this.exportFailList(res.errorList)
// return true
//
}
// this.handleImport()
// this.notice.okTips('上传成功')
}
);
}
}
}
);
}
);
}
,
}
,
...
@@ -1926,8 +1840,8 @@ export default {
...
@@ -1926,8 +1840,8 @@ export default {
// 模板下载
// 模板下载
exportTemplate
()
{
exportTemplate
()
{
let
params
=
{
}
;
let
params
=
{
}
;
if
(
this
.
fileForm
.
m
erchantId
)
{
if
(
this
.
selectedM
erchantId
)
{
params
.
merchantId
=
this
.
fileForm
.
m
erchantId
;
params
.
merchantId
=
this
.
selectedM
erchantId
;
}
else
{
}
else
{
this
.
notice
.
warningTips
(
"请选择门店"
);
this
.
notice
.
warningTips
(
"请选择门店"
);
return
;
return
;
...
@@ -2101,31 +2015,6 @@ export default {
...
@@ -2101,31 +2015,6 @@ export default {
margin
-
top
:
40
px
;
margin
-
top
:
40
px
;
}
}
.
order
-
list
.
m
-
l
-
md
{
margin
-
left
:
20
px
;
}
.
order
-
list
.
import
-
btn
{
position
:
relative
;
}
.
order
-
list
.
import
-
input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98
px
;
height
:
36
px
;
cursor
:
pointer
;
font
-
size
:
0
;
}
.
order
-
list
.
import
-
template
{
position
:
absolute
;
height
:
20
px
;
top
:
50
px
;
left
:
0
;
}
.
add
-
dialog
{
.
add
-
dialog
{
// margin: 20px 0;
// margin: 20px 0;
...
...
src/views/residentManage/inStorePoints/pointsRecord.vue
View file @
35d24f6
...
@@ -58,42 +58,11 @@
...
@@ -58,42 +58,11 @@
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'上传文件'"
<d2-file-import-dialog
:is-visible=
"fileVisible"
:is-visible=
"fileVisible"
title=
"上传文件"
@
closeDialog=
"handleBatchImport"
@
closeDialog=
"handleBatchImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
<slot>
@
downloadTemplate=
"exportTemplate"
/>
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增积分记录 -->
<!-- 新增积分记录 -->
<add-dialog
:add-visible=
"addVisible"
<add-dialog
:add-visible=
"addVisible"
...
@@ -300,10 +269,6 @@ export default {
...
@@ -300,10 +269,6 @@ export default {
handleVisible
:
false
,
handleVisible
:
false
,
recordInfo
:
{},
recordInfo
:
{},
params_obj
:
{},
params_obj
:
{},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
fileForm
:
{},
fileVisible
:
false
,
fileVisible
:
false
,
addVisible
:
false
addVisible
:
false
}
}
...
@@ -433,48 +398,16 @@ export default {
...
@@ -433,48 +398,16 @@ export default {
},
},
handleBatchImport
()
{
handleBatchImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
// 上传文件,转码为base64
handleConfirmImport
({
fileName
,
fileData
})
{
importFile
(
e
)
{
var
params
=
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
file
:
fileData
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过9M'
)
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
},
pointImport
(
params
).
then
(
res
=>
{
handleConfirmImport
()
{
if
(
res
)
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
this
.
notice
.
okTips
(
res
)
if
(
valid
)
{
this
.
handleBatchImport
()
var
params
=
{
this
.
$refs
.
detailListTable
.
refreshTable
()
file
:
this
.
fileInfo
}
pointImport
(
params
).
then
(
res
=>
{
if
(
res
)
{
// 异步处理文件上传 把id传入处理轮询
// const list = [...this.updateList, {
// name: this.fileForm.fileName,
// ifSuccess: false,
// uuid: res,
// type: 'upload'
// }]
// this.actionSetDownloadList({ list, type: 'updateList' })
this
.
notice
.
okTips
(
res
)
this
.
handleBatchImport
()
this
.
$refs
.
detailListTable
.
refreshTable
()
}
})
}
}
})
})
},
},
...
@@ -516,28 +449,6 @@ export default {
...
@@ -516,28 +449,6 @@ export default {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.points-record
{
.points-record
{
margin-top
:
40px
;
margin-top
:
40px
;
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
}
}
.more-info
{
.more-info
{
white-space
:
nowrap
;
white-space
:
nowrap
;
...
...
src/views/systemConfig/ShopConfig/deliveryQuantity/index.vue
View file @
35d24f6
...
@@ -87,42 +87,11 @@
...
@@ -87,42 +87,11 @@
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'交付数导入'"
<d2-file-import-dialog
:is-visible=
"fileVisible"
:is-visible=
"fileVisible"
title=
"交付数导入"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
<slot>
@
downloadTemplate=
"exportTemplate"
/>
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增&修改&详情 -->
<!-- 新增&修改&详情 -->
<edit-dialog
:visible
.
sync=
"editVisible"
<edit-dialog
:visible
.
sync=
"editVisible"
v-if=
"editVisible"
v-if=
"editVisible"
...
@@ -251,15 +220,11 @@ export default {
...
@@ -251,15 +220,11 @@ export default {
merchantList
:
[],
merchantList
:
[],
brandList
:
[]
brandList
:
[]
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
recordInfo
:
null
,
recordInfo
:
null
,
operationType
:
"add"
,
operationType
:
"add"
,
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
20
,
pageSize
:
20
,
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
editVisible
:
false
,
editVisible
:
false
,
track_event_code
:
'shopConfig_deliver_list'
,
track_event_code
:
'shopConfig_deliver_list'
,
track_businessParam_key
:
'searchForm'
track_businessParam_key
:
'searchForm'
...
@@ -470,54 +435,27 @@ export default {
...
@@ -470,54 +435,27 @@ export default {
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过10M'
)
}
},
handleImport
()
{
handleImport
()
{
this
.
fileForm
=
{
fileName
:
''
}
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
deliverTargeConfigImport
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
deliverTargeConfigImport
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
handleImport
()
this
.
handleImport
()
}
})
}
}
})
})
},
},
...
@@ -549,27 +487,4 @@ export default {
...
@@ -549,27 +487,4 @@ export default {
margin-top
:
40px
;
margin-top
:
40px
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/systemConfig/ShopConfig/index.vue
View file @
35d24f6
...
@@ -110,49 +110,12 @@
...
@@ -110,49 +110,12 @@
]"
:data=
"scope.scope"
/>
]"
:data=
"scope.scope"
/>
</d2-table>
</d2-table>
</div>
</div>
<!-- 导入门店设置 -->
<d2-file-import-dialog
:is-visible=
"fileVisible"
<d2-dialog
:title=
"'上传文件'"
:is-visible=
"fileVisible"
@
closeDialog=
"handleImport"
title=
"上传文件"
@
confirmDialog=
"handleConfirmImport"
width=
"600px"
>
template-name=
"文件下载"
<slot>
@
closeDialog=
"handleImport"
<div>
@
confirmDialog=
"handleConfirmImport"
<el-form
:model=
"fileForm"
:rules=
"fileRules"
ref=
"fileRuleForm"
label-width=
"120px"
>
@
downloadTemplate=
"downLoadTemplate"
/>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
/>
<el-link
type=
"primary"
class=
"import-template"
@
click=
"downLoadTemplate"
icon=
"el-icon-link"
>
文件下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
<span
v-show=
"showNum"
>
<div
class=
"upload-statistics"
>
<div
class=
"quantity"
>
<div
class=
"success"
>
{{ importNum.successCount }}
</div>
<div>
有效数据
</div>
</div>
<div
class=
"line"
></div>
<div
class=
"quantity"
>
<div
class=
"err"
>
{{ importNum.failCount }}
</div>
<div>
异常数据
</div>
</div>
</div>
<div
class=
"abnormal"
>
<p>
数据异常的可能原因:
</p>
<p
class=
"color-33"
>
1. 订单编号不匹配
</p>
</div>
</span>
</div>
</slot>
</d2-dialog>
<!-- 收款码 -->
<!-- 收款码 -->
<qrcode-dialog
:q-rcode-visible=
"qRcodeVisible"
:info=
"recordInfo"
v-if=
"qRcodeVisible"
<qrcode-dialog
:q-rcode-visible=
"qRcodeVisible"
:info=
"recordInfo"
v-if=
"qRcodeVisible"
...
@@ -667,16 +630,7 @@ export default {
...
@@ -667,16 +630,7 @@ export default {
recordInfo
:
null
,
recordInfo
:
null
,
fileVisible
:
false
,
fileVisible
:
false
,
signVisible
:
false
,
signVisible
:
false
,
showNum
:
false
,
warningVisible
:
false
,
warningVisible
:
false
,
importNum
:
{
succNum
:
0
,
failNum
:
0
},
fileForm
:
{},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}]
},
qRcodeVisible
:
false
,
qRcodeVisible
:
false
,
employeeVisible
:
false
,
employeeVisible
:
false
,
flagVisible
:
false
,
flagVisible
:
false
,
...
@@ -1236,57 +1190,28 @@ export default {
...
@@ -1236,57 +1190,28 @@ export default {
}
}
)
)
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
9
)
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
(
event
)
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
","
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
"."
)[
1
]
+
"@"
+
arrBase64
[
1
]
document
.
getElementById
(
"fileUpload"
).
value
=
""
}
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过9M"
)
document
.
getElementById
(
"fileUpload"
).
value
=
""
}
},
handleImport
()
{
handleImport
()
{
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
const
that
=
this
merchantOutputValueTargetImport
({
file
:
fileData
}).
then
(
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
(
result
)
=>
{
if
(
valid
)
{
if
(
result
)
{
merchantOutputValueTargetImport
({
file
:
this
.
fileInfo
}).
then
(
const
list
=
[
(
result
)
=>
{
...
this
.
updateList
,
if
(
result
)
{
{
// debugger
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[
uuid
:
result
,
...
that
.
updateList
,
type
:
"upload"
{
name
:
that
.
fileForm
.
fileName
,
ifSuccess
:
false
,
uuid
:
result
,
type
:
"upload"
// labelText: ''
}
]
that
.
actionSetDownloadList
({
list
,
type
:
"updateList"
})
that
.
notice
.
okTips
(
"上传成功"
)
that
.
handleImport
()
}
}
}
]
)
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
})
this
.
notice
.
okTips
(
"上传成功"
)
this
.
handleImport
()
}
}
}
}
)
)
},
},
// 收款二维码按钮
// 收款二维码按钮
...
@@ -1623,69 +1548,6 @@ export default {
...
@@ -1623,69 +1548,6 @@ export default {
border
:
0
;
border
:
0
;
}
}
.upload-wrap
{
display
:
flex
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
.m-l-md
{
margin-left
:
20px
;
}
.upload-statistics
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
margin
:
30px
70px
;
.quantity
{
font-size
:
14px
;
color
:
#333333
;
text-align
:
center
;
.success
{
font-size
:
26px
;
color
:
#2cca74
;
text-align
:
center
;
margin-bottom
:
4px
;
}
.err
{
font-size
:
26px
;
color
:
#eb4e4e
;
text-align
:
center
;
margin-bottom
:
4px
;
}
}
.line
{
width
:
1px
;
height
:
56px
;
background
:
#e8e8ea
;
}
}
.points-set-form
{
.points-set-form
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
src/views/systemConfig/ShopConfig/outputValue/index.vue
View file @
35d24f6
...
@@ -93,42 +93,11 @@
...
@@ -93,42 +93,11 @@
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'产值导入'"
<d2-file-import-dialog
:is-visible=
"fileVisible"
:is-visible=
"fileVisible"
title=
"产值导入"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
<slot>
@
downloadTemplate=
"exportTemplate"
/>
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增&修改&详情 -->
<!-- 新增&修改&详情 -->
<edit-dialog
:visible
.
sync=
"editVisible"
<edit-dialog
:visible
.
sync=
"editVisible"
v-if=
"editVisible"
v-if=
"editVisible"
...
@@ -268,15 +237,11 @@ export default {
...
@@ -268,15 +237,11 @@ export default {
},
},
merchantList
:
[]
merchantList
:
[]
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
recordInfo
:
null
,
recordInfo
:
null
,
operationType
:
"add"
,
operationType
:
"add"
,
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
20
,
pageSize
:
20
,
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
editVisible
:
false
,
editVisible
:
false
,
track_event_code
:
'shopConfig_Output_list'
,
track_event_code
:
'shopConfig_Output_list'
,
track_businessParam_key
:
'searchForm'
track_businessParam_key
:
'searchForm'
...
@@ -467,54 +432,27 @@ export default {
...
@@ -467,54 +432,27 @@ export default {
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过10M'
)
}
},
handleImport
()
{
handleImport
()
{
this
.
fileForm
=
{
fileName
:
''
}
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
targeConfigImport
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
targeConfigImport
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
handleImport
()
this
.
handleImport
()
}
})
}
}
})
})
},
},
...
@@ -572,27 +510,4 @@ export default {
...
@@ -572,27 +510,4 @@ export default {
color
:
#43cf7c
;
color
:
#43cf7c
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/systemConfig/ShopConfig/personalConversionRate/index.vue
View file @
35d24f6
...
@@ -93,42 +93,11 @@
...
@@ -93,42 +93,11 @@
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<d2-dialog
:title=
"'成交率导入'"
<d2-file-import-dialog
:is-visible=
"fileVisible"
:is-visible=
"fileVisible"
title=
"成交率导入"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
<slot>
@
downloadTemplate=
"exportTemplate"
/>
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增&修改&详情 -->
<!-- 新增&修改&详情 -->
<edit-dialog
:visible
.
sync=
"editVisible"
<edit-dialog
:visible
.
sync=
"editVisible"
v-if=
"editVisible"
v-if=
"editVisible"
...
@@ -304,15 +273,11 @@ export default {
...
@@ -304,15 +273,11 @@ export default {
2
:
"延保"
2
:
"延保"
},
},
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
recordInfo
:
null
,
recordInfo
:
null
,
operationType
:
"add"
,
operationType
:
"add"
,
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
20
,
pageSize
:
20
,
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
editVisible
:
false
,
editVisible
:
false
,
track_event_code
:
'shopConfig_personalConversion_list'
,
track_event_code
:
'shopConfig_personalConversion_list'
,
track_businessParam_key
:
'searchForm'
track_businessParam_key
:
'searchForm'
...
@@ -534,53 +499,26 @@ export default {
...
@@ -534,53 +499,26 @@ export default {
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过10M'
)
}
},
handleImport
()
{
handleImport
()
{
this
.
fileForm
=
{
fileName
:
''
}
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
personalConfigImport
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
personalConfigImport
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
}]
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
handleImport
()
}
})
}
}
})
})
},
},
...
@@ -612,22 +550,6 @@ export default {
...
@@ -612,22 +550,6 @@ export default {
margin-top
:
40px
;
margin-top
:
40px
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
@mixin
typeBase
{
@mixin
typeBase
{
width
:
52px
;
width
:
52px
;
...
@@ -654,10 +576,4 @@ export default {
...
@@ -654,10 +576,4 @@ export default {
color
:
#43cf7c
;
color
:
#43cf7c
;
}
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
</
style
>
</
style
>
src/views/systemConfig/ShopConfig/storeGrossProfit/index.vue
View file @
35d24f6
...
@@ -85,44 +85,17 @@
...
@@ -85,44 +85,17 @@
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<!-- 导入文件弹框 -->
<d2-file-import-dialog
:is-visible=
"fileVisible"
<d2-dialog
:title=
"'毛利导入'"
title=
"毛利导入"
:is-visible=
"fileVisible"
form-item-label=
"毛利信息表:"
@
closeDialog=
"handleImport"
:max-size=
"10"
@
confirmDialog=
"handleConfirmImport"
>
@
closeDialog=
"handleImport"
<slot>
@
confirmDialog=
"handleConfirmImport"
<el-form
:model=
"fileForm"
@
downloadTemplate=
"exportTemplate"
>
ref=
"fileRuleForm"
<
template
#
tip
>
:rules=
"fileRules"
<p
class=
"tips"
>
请选择需要导入的毛利信息表格
</p>
label-width=
"120px"
>
</
template
>
<el-form-item
label=
"毛利信息表:"
</d2-file-import-dialog>
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
<p
class=
"tips"
>
请选择需要导入的毛利信息表格
</p>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 新增&修改&详情 -->
<!-- 新增&修改&详情 -->
<edit-dialog
:visible
.
sync=
"editVisible"
<edit-dialog
:visible
.
sync=
"editVisible"
v-if=
"editVisible"
v-if=
"editVisible"
...
@@ -269,15 +242,11 @@
...
@@ -269,15 +242,11 @@
4
:
"二手车"
4
:
"二手车"
},
},
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
recordInfo
:
null
,
recordInfo
:
null
,
operationType
:
"add"
,
operationType
:
"add"
,
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
20
,
pageSize
:
20
,
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
editVisible
:
false
,
editVisible
:
false
,
// 保存编辑前的分页状态
// 保存编辑前的分页状态
savedPageState
:
null
,
savedPageState
:
null
,
...
@@ -535,53 +504,26 @@
...
@@ -535,53 +504,26 @@
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
const
size
=
e
.
target
.
files
[
0
].
size
/
1024
/
1024
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
'fileName'
,
e
.
target
.
files
[
0
].
name
)
// // 转码base64
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
e
.
target
.
files
[
0
])
reader
.
onload
=
event
=>
{
const
imgFile
=
event
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
','
)
this
.
fileInfo
=
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)[
e
.
target
.
files
[
0
].
name
.
split
(
'.'
)?.
length
-
1
]
+
'@'
+
arrBase64
[
1
]
document
.
getElementById
(
'fileUpload'
).
value
=
''
}
}
else
{
this
.
notice
.
errorTips
(
'上传文件不可超过10M'
)
}
},
handleImport
()
{
handleImport
()
{
this
.
fileForm
=
{
fileName
:
''
}
this
.
$refs
.
fileRuleForm
&&
this
.
$refs
.
fileRuleForm
.
resetFields
()
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
(
valid
=>
{
var
params
=
{
if
(
valid
)
{
file
:
fileData
var
params
=
{
}
file
:
this
.
fileInfo
importProfit
(
params
).
then
(
res
=>
{
}
if
(
res
)
{
importProfit
(
params
).
then
(
res
=>
{
const
list
=
[...
this
.
updateList
,
{
if
(
res
)
{
name
:
fileName
,
// 异步处理文件上传 把id传入处理轮询
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
this
.
fileForm
.
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
'upload'
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
}]
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
notice
.
okTips
(
'上传成功'
)
this
.
handleImport
()
}
})
}
}
})
})
},
},
...
@@ -613,22 +555,6 @@
...
@@ -613,22 +555,6 @@
margin-top
:
40px
;
margin-top
:
40px
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
@mixin
typeBase
{
@mixin
typeBase
{
width
:
52px
;
width
:
52px
;
...
@@ -660,12 +586,6 @@
...
@@ -660,12 +586,6 @@
color
:
#5850FF
FF
;
color
:
#5850FF
FF
;
}
}
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
.tips
{
.tips
{
color
:
#999999
ff
;
color
:
#999999
ff
;
font-size
:
14px
;
font-size
:
14px
;
...
...
src/views/systemConfig/businessSchoolManage/staffList.vue
View file @
35d24f6
...
@@ -76,43 +76,11 @@
...
@@ -76,43 +76,11 @@
</d2-table>
</d2-table>
</div>
</div>
<!-- 导入 -->
<!-- 导入 -->
<d2-dialog
:title=
"'上传文件'"
<d2-file-import-dialog
:is-visible=
"fileVisible"
:is-visible=
"fileVisible"
title=
"上传文件"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
@
confirmDialog=
"handleConfirmImport"
width=
"530px"
>
@
downloadTemplate=
"exportTemplate"
/>
<slot>
<el-form
:model=
"fileForm"
ref=
"fileRuleForm"
:rules=
"fileRules"
label-width=
"120px"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
readonly
v-model=
"fileForm.fileName"
/>
</el-col>
<el-col
:span=
"4"
class=
"m-l-md"
>
<el-button
class=
"import-btn"
>
导入文件
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@
change=
"importFile($event)"
>
<el-link
type=
"primary"
class=
"import-template"
icon=
"el-icon-link"
@
click=
"exportTemplate"
>
模版下载
</el-link>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<!-- 导出 -->
<!-- 导出 -->
<d2-dialog
:title=
"'员工业绩导出'"
<d2-dialog
:title=
"'员工业绩导出'"
:is-visible=
"exportFileVisible"
:is-visible=
"exportFileVisible"
...
@@ -179,7 +147,6 @@ export default {
...
@@ -179,7 +147,6 @@ export default {
return
date
.
getTime
()
>
Date
.
now
()
-
24
*
60
*
60
*
1000
*
`
${
days
}
`
return
date
.
getTime
()
>
Date
.
now
()
-
24
*
60
*
60
*
1000
*
`
${
days
}
`
}
}
},
},
fileForm
:
{},
exportFileForm
:
{
// 导出条件
exportFileForm
:
{
// 导出条件
exportYqMerchantId
:
[],
exportYqMerchantId
:
[],
exportMonth
:
''
exportMonth
:
''
...
@@ -187,9 +154,6 @@ export default {
...
@@ -187,9 +154,6 @@ export default {
exportFormRules
:
{
exportFormRules
:
{
exportMonth
:
[{
required
:
true
,
message
:
'请选择导出月份'
,
trigger
:
'blur'
}]
exportMonth
:
[{
required
:
true
,
message
:
'请选择导出月份'
,
trigger
:
'blur'
}]
},
},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
'请上传文件'
,
trigger
:
'change'
}]
},
totalNum
:
0
,
// 已启用商学院员工数量
totalNum
:
0
,
// 已启用商学院员工数量
fileVisible
:
false
,
// 导入弹窗
fileVisible
:
false
,
// 导入弹窗
exportFileVisible
:
false
,
// 导出弹窗
exportFileVisible
:
false
,
// 导出弹窗
...
@@ -380,51 +344,25 @@ export default {
...
@@ -380,51 +344,25 @@ export default {
keyDownGetList() {
keyDownGetList() {
this.$refs.staffManageTable.refreshTable()
this.$refs.staffManageTable.refreshTable()
},
},
// 导入员工
handleImport() {
handleImport() {
this.fileVisible = !this.fileVisible
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
},
// 上传文件,转码为base64
handleConfirmImport({ fileName, fileData }) {
importFile(e) {
var params = {
const size = e.target.files[0].size / 1024 / 1024
file: fileData
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
document.getElementById('fileUpload').value = ''
}
}
},
importStaffApi(params).then(res => {
handleConfirmImport() {
if (res) {
this.$refs.fileRuleForm.validate(valid => {
const list = [...this.updateList, {
if (valid) {
name: fileName,
var params = {
ifSuccess: false,
file: this.fileInfo
uuid: res,
}
type: 'upload'
importStaffApi(params).then(res => {
}]
if (res) {
// 异步处理文件上传 把id传入处理轮询
const list = [...this.updateList, {
name: this.fileForm.fileName,
ifSuccess: false,
uuid: res,
type: 'upload'
}]
this.actionSetDownloadList({ list, type: 'updateList' })
this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功')
this.notice.okTips('上传成功')
this.handleImport()
this.handleImport()
}
})
}
}
})
})
},
},
...
@@ -584,31 +522,6 @@ export default {
...
@@ -584,31 +522,6 @@ export default {
color
:
#d9646c
;
color
:
#d9646c
;
}
}
}
}
.staff-list
.m-l-md
{
margin-left
:
20px
;
}
.staff-list
.import-btn
{
position
:
relative
;
}
.staff-list
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.staff-list
.import-template
{
position
:
absolute
;
height
:
20px
;
top
:
50px
;
left
:
0
;
}
::v-deep
.el-tag--info
{
::v-deep
.el-tag--info
{
max-width
:
140px
;
max-width
:
140px
;
overflow
:
hidden
;
overflow
:
hidden
;
...
...
src/views/systemConfig/downloadReportManage/index.vue
View file @
35d24f6
...
@@ -101,36 +101,10 @@
...
@@ -101,36 +101,10 @@
@
dialogClose=
"closePushDialog"
/>
@
dialogClose=
"closePushDialog"
/>
<!-- 导入更新 -->
<!-- 导入更新 -->
<d2-dialog
:is-visible=
"fileVisible"
<d2-file-import-dialog
:is-visible=
"fileVisible"
title=
"导入"
title=
"导入"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
@
confirmDialog=
"handleConfirmImport"
/>
<slot>
<el-form
ref=
"fileRuleForm"
label-width=
"120px"
:model=
"fileForm"
:rules=
"fileRules"
>
<el-form-item
label=
"导入文件:"
prop=
"fileName"
>
<el-col
:span=
"16"
>
<el-input
v-model=
"fileForm.fileName"
readonly
/>
</el-col>
<el-col
class=
"m-l-md"
:span=
"4"
>
<el-button
class=
"import-btn"
>
导入文件
<input
id=
"fileUpload"
accept=
".xlsx,.xls"
class=
"import-input"
type=
"file"
@
change=
"importFile($event)"
>
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
<el-dialog
:close-on-click-modal=
"false"
<el-dialog
:close-on-click-modal=
"false"
:show-close=
"false"
:show-close=
"false"
title=
"提示"
title=
"提示"
...
@@ -280,10 +254,6 @@ export default {
...
@@ -280,10 +254,6 @@ export default {
dateVisible
:
false
,
dateVisible
:
false
,
recordInfo
:
{},
recordInfo
:
{},
fileVisible
:
false
,
fileVisible
:
false
,
fileForm
:
{},
fileRules
:
{
fileName
:
[{
required
:
true
,
message
:
"请上传文件"
,
trigger
:
"change"
}],
},
dialogVisible
:
false
,
dialogVisible
:
false
,
updateStatus
:
""
,
updateStatus
:
""
,
updatePercentage
:
0
,
updatePercentage
:
0
,
...
@@ -410,70 +380,25 @@ export default {
...
@@ -410,70 +380,25 @@ export default {
// this.$refs.recordTable.refreshTable(false, true)
// this.$refs.recordTable.refreshTable(false, true)
},
},
// 上传文件,转码为base64
importFile
(
e
)
{
console
.
log
(
e
,
"e"
);
const
file
=
e
.
target
.
files
[
0
];
console
.
log
(
file
,
"file"
);
if
(
!
file
)
return
;
// 防止取消选择时报错
if
(
!
file
.
name
.
includes
(
".xlsx"
)
&&
!
file
.
name
.
includes
(
".xls"
)
)
{
this
.
$message
({
message
:
"文件格式不支持"
,
type
:
"error"
,
});
return
false
;
}
const
size
=
file
.
size
/
1024
/
1024
;
// 先清空 input,防止下次无法触发 change
document
.
getElementById
(
"fileUpload"
).
value
=
""
;
if
(
size
<
10
)
{
this
.
$set
(
this
.
fileForm
,
"fileName"
,
file
.
name
);
// // 转码base64
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
(
event
)
=>
{
this
.
$set
(
this
.
fileForm
,
"fileInfo"
,
file
,
);
// document.getElementById("fileUpload").value = ""
};
}
else
{
this
.
notice
.
errorTips
(
"上传文件不可超过10M"
);
}
},
handleImport
(
row
)
{
handleImport
(
row
)
{
this
.
recordInfo
=
row
;
this
.
recordInfo
=
row
;
this
.
fileForm
=
{
fileName
:
""
,
};
this
.
fileVisible
=
!
this
.
fileVisible
;
this
.
fileVisible
=
!
this
.
fileVisible
;
},
},
handleConfirmImport
()
{
handleConfirmImport
({
fileName
,
fileData
})
{
this
.
$refs
.
fileRuleForm
.
validate
((
valid
)
=>
{
this
.
dialogVisible
=
true
;
if
(
valid
)
{
const
formData
=
new
FormData
();
this
.
dialogVisible
=
true
;
formData
.
append
(
"file"
,
fileData
);
const
formData
=
new
FormData
();
formData
.
append
(
"key"
,
this
.
recordInfo
.
key
);
formData
.
append
(
"file"
,
this
.
fileForm
.
fileInfo
);
for
(
const
[
key
,
value
]
of
formData
.
entries
())
{
formData
.
append
(
"key"
,
this
.
recordInfo
.
key
);
console
.
log
(
key
,
value
);
// 调试:打印内容
}
for
(
const
[
key
,
value
]
of
formData
.
entries
())
{
importExcel
(
formData
).
then
((
res
)
=>
{
console
.
log
(
key
,
value
);
console
.
log
(
res
,
"res"
);
}
this
.
updateStatus
=
true
;
importExcel
(
formData
).
then
((
res
)
=>
{
if
(
res
.
errId
==
"-7"
)
{
console
.
log
(
res
,
"res"
);
this
.
failNum
=
1
;
this
.
updateStatus
=
true
;
this
.
errMsg
=
res
.
message
;
if
(
res
.
errId
==
"-7"
)
{
this
.
failNum
=
1
;
this
.
errMsg
=
res
.
message
;
}
});
}
}
});
});
},
},
...
@@ -541,22 +466,6 @@ export default {
...
@@ -541,22 +466,6 @@ export default {
font-size
:
14px
;
font-size
:
14px
;
color
:
#999999
;
color
:
#999999
;
}
}
.m-l-md
{
margin-left
:
20px
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
98px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.dialog-content
{
.dialog-content
{
text-align
:
center
;
text-align
:
center
;
.dialog-tips-big
{
.dialog-tips-big
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment