Commit 442333ca authored by youjie's avatar youjie

批量上传附件

parent d7ae6b0c
......@@ -478,7 +478,7 @@
</div>
<div class="_explain" v-if="msg.IsUploadPic===1">
<p>{{$t('fnc.scfujian')}}<span class="_addUpload_tips">{{$t('tips.wjdxbncgsz')}}</span></p>
<div class="_addUpload_box clearfix">
<template v-for="(file,fIndex) in saveMsg">
<div v-if="file.Type==3">
......@@ -651,7 +651,8 @@
images: [],
resultCode: 0,
}
},methods:{
},
methods:{
inited (viewer){
this.$viewer = viewer
},
......
......@@ -58,6 +58,7 @@
<input type="button" class="normalBtn" :value="$t('pub.searchBtn')" @click="getList();resetPageIndex()" />
<button class="hollowFixedBtn" @click="method5()">导出</button>
<input type="button" class="normalBtn" value="批量制佣金单" @click="MoreCreateBill()" />
<input type="button" class="normalBtn" value="批量上传附件" @click="UploadAttachment()" />
</li>
</ul>
</div>
......@@ -167,7 +168,7 @@
{{subItem.BName}}
</td>
<td width="70">
{{subItem.TotalMoney}}
{{subItem.TotalMoney}}
</td>
<td> {{(subItem.LeaderCommission+subItem.GuideCommission+subItem.PICCommission+subItem.CompanyCommission).toFixed(2)}}</td>
<td width="80">
......@@ -440,14 +441,14 @@
</div>
</div>
</el-form-item>
<template v-if="IsJapan==1">
<template v-if="IsJapan==1">
<el-form-item label="生成550手续费">
<el-select v-model="nMsg.IsHaveFee">
<el-option label="是" :value="1" :key="1"></el-option>
<el-option label="否" :value="2" :key="2"></el-option>
</el-select>
</el-form-item></template>
</el-col>
</el-row>
</el-form>
......@@ -465,12 +466,22 @@
</template>
</el-dialog>
<!-- 批量上传附件 -->
<attachments :show="isUploadAttachment"
@cancel="isUploadAttachment=false"
@success="isUploadAttachment=false,getList();resetPageIndex()"></attachments>
</div>
</template>
<script>
import attachments from "./components/attachments.vue";
export default {
components: {
attachments
},
data() {
return {
saveUploadMsg: [],
isUploadAttachment: false,
FinanceTypeList: [{
Name: '全部',
Id: 0
......@@ -554,6 +565,10 @@
}
},
methods: {
UploadAttachment(){
this.isUploadAttachment = true
},
GenerateDocuments(outItem, LeaderId, GuideId) {
this.isShowFinaceDailog = true
this.CurrentOutItem = outItem
......@@ -907,10 +922,10 @@
let leaderIds=[];
this.shopDataList.forEach((item) => {
if (item.IsCheck){
leaderIds.push(item.LeaderGuideIds);
leaderIds.push(item.LeaderGuideIds);
}
})
this.loading = true;
this.IsLGCommissionAccount=true;
this.apipost(
......@@ -1060,7 +1075,7 @@
},
method5: function() {
let msg = JSON.parse(JSON.stringify(this.msg));
let userInfo = this.getLocalStorage();
let userInfo = this.getLocalStorage();
msg.EmployeeId = userInfo.EmployeeId;
this.GetLocalFile(
"dmcstatistics_post_GetShopCombinationNumServiceToExcel",
......
<template>
<div>
<el-dialog title="批量上传附件" :visible.sync="isUploadAttachment" width="765px"
:close-on-click-modal="false"
:show-close="true" @close="cancel">
<div class="UploadMsg-box">
<div :class="[saveUploadMsg.length>0?'':'UploadMsgGrow']" style="text-align: center;">
<el-upload
class="upload-demo"
drag
accept="image/jpeg,image/jpg, image/png, image/bmp"
action=""
:http-request="uploadFileBtn"
multiple
:show-file-list="false">
<i class="el-icon-upload" style="font-size: 30px;"></i>
<div class="el-upload__text">文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件</div>
</el-upload>
</div>
<template v-for="(item,index) in saveUploadMsg">
<div class="UploadMsg-list">
<el-image
style="width: 100%; height: 80px;border-radius: 5px;"
:src="item.DMCOPCredentials"
fit="cover"
:initial-index="index"
:preview-src-list="saveUploadMsg.map(x=>{return x.DMCOPCredentials})"></el-image>
<div class="UploadMsg-text">
<el-tooltip class="item" effect="dark" :content="item.TCID" placement="top">
<p>{{item.TCID}}</p>
</el-tooltip>
</div>
<i class="UploadMsg-icon el-icon-circle-close" @click="handleRemove(index)"></i>
</div>
</template>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="hollowFixedBtn" @click="cancel">{{$t('pub.cancelBtn')}}</el-button>
<el-button class="normalBtn" type="primary" @click="saveAttachments" :loading="loading">{{$t('pub.sureBtn')}}</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
props:["show"],
data() {
return {
saveUploadMsg: [],
loading: false,
isUploadAttachment: false
}
},
mounted() {
},
watch: {
show:{
handler(newValue) {
if(newValue==true) this.isUploadAttachment = true
},
deep: false,
immediate: true
}
},
methods: {
saveAttachments() {
if(this.saveUploadMsg.length==0) return this.$message.error('请上传附件');
this.loading = true
this.apipost('ShoppingInfo_Post_ImportShopFile',this.saveUploadMsg, res => {
if(res.data.resultCode == 1) {
this.cancel()
this.$emit('success')
}else{
this.$message.error(res.data.message)
}
this.loading = false
}, err => {})
},
cancel() {
this.saveUploadMsg = []
this.isUploadAttachment = false
this.$emit('cancel')
},
uploadFileBtn(file) { //上传
// if(file.file.size > 1024 * 1024 * 10) {
// this.$message.warning(this.$t('tips.wjdxbncgsz'))
// return
// }
// 1 文档 2 数据 3 图片
let typeArr=[
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:3},
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',type:1},
]
let ft=file.file.name.substring(file.file.name.lastIndexOf('.')+1,file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x=>{
if(x.stringArr.indexOf(ft)!='-1')
{
fileTypeNumber=x.type;
typeOk = true;
}
})
if (!typeOk) return this.$message.error('请上传图');
let newArr = [];
newArr.push(file.file)
let path = "/Upload/RegimentAttachment/"
// this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
let SourceFileName = x.data.SourceFileName.split('.')
this.saveUploadMsg.push({
DMCOPCredentials: this.domainManager().ViittoFileUrl + x.data.FilePath,
TCID: SourceFileName[0]
})
this.$message.success(this.$t('tips.scchenggong'))
});
},
handleRemove(index) {
this.saveUploadMsg.splice(index,1)
},
}
}
</script>
<style scoped>
.UploadMsg-box{
display: flex;
flex-wrap: wrap;
}
.UploadMsg-list{
width: 110px;
/* height: 80px; */
position: relative;
border-radius: 3px;
/* overflow: hidden; */
margin: 0 6px 13px 6px;
}
.UploadMsg-text{
width: 100%;
height: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.UploadMsg-icon{
color: #409eff;
position: absolute;
right: 0;
top: -10px;
z-index: 2;
cursor: pointer;
font-size: 20px;
}
.UploadMsgGrow{
width: 100%;
}
/deep/.UploadMsg-box .el-upload-dragger{
width: 110px;
height: 80px;
padding: 0 5px;
}
/deep/.UploadMsg-box .el-upload-dragger .el-icon-upload{
margin: 0;
}
/deep/.UploadMsg-box .el-upload__tip{
margin-top: 0;
margin-bottom: 7px;
}
/deep/.UploadMsg-box .el-upload-dragger .el-icon-upload{
line-height: 35px;
}
</style>
......@@ -512,7 +512,7 @@
newRlistAll:[],
DomesticLine:{},
IsYearBonus:false,
AnnualBonus:{
AnnualBonus:{//年终奖
type:3,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -521,7 +521,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
OtherProfit:{
OtherProfit:{//其他毛利润
type:2,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -530,7 +530,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
OtherLine:{
OtherLine:{//其他人头奖励
type:1,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -539,7 +539,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
EuropeProfit:{
EuropeProfit:{//欧洲毛利润
type:2,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -548,7 +548,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
EuropeLine:{
EuropeLine:{//欧洲人头奖励
type:1,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -557,7 +557,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
JapaneseProfit:{
JapaneseProfit:{//日本毛利润
type:2,
AvgLureNum:0,
AvfOrderNum:0,
......@@ -566,7 +566,7 @@
CommissionProfit: 0,
CommissionRateList:[]
},
JapaneseLine:{
JapaneseLine:{//日本人头奖励
type:1,
AvgLureNum:0,
AvfOrderNum:0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment