Browse Source
# Conflicts: # anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/sysstaffinfo/SysStaffinfoMapper.javamaster

71 changed files with 1701 additions and 2026 deletions
@ -0,0 +1,16 @@ |
|||||
|
package com.yxt.anrui.base.api.basedistributor; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 10:21 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PcBaseDistributorQuery implements Query { |
||||
|
private static final long serialVersionUID = -819696590662230234L; |
||||
|
|
||||
|
private String staffSid; |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.yxt.anrui.base.api.basedistributor; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 10:16 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PcBaseDistributorVo implements Vo { |
||||
|
private static final long serialVersionUID = 7712204411963730062L; |
||||
|
|
||||
|
@ApiModelProperty(value = "中介单位") |
||||
|
private String distributorName; |
||||
|
@ApiModelProperty(value = "中介单位联系电话") |
||||
|
private String businessMobile; |
||||
|
@ApiModelProperty(value = "中介单位sid") |
||||
|
private String distributorSid; |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.anrui.buscenter.api.bussalesordersubmit; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 9:20 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusSalesOrderSubmit extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1919809277011946278L; |
||||
|
@ApiModelProperty(value = "销售订单sid") |
||||
|
private String salesOrderSid; |
||||
|
@ApiModelProperty(value = "价格说明") |
||||
|
private String priceRemarks; |
||||
|
|
||||
|
@ApiModelProperty(value = "优惠说明") |
||||
|
private String discountRemarks; |
||||
|
@ApiModelProperty(value = "中介名称") |
||||
|
private String distributorName; |
||||
|
@ApiModelProperty(value = "联系电话") |
||||
|
private String distributorMobile; |
||||
|
|
||||
|
@ApiModelProperty(value = "中介单位sid") |
||||
|
private String distributorSid; |
||||
|
@ApiModelProperty(value = "单车中介服务费") |
||||
|
private BigDecimal distributorPrice; |
||||
|
@ApiModelProperty(value = "返利合计") |
||||
|
private BigDecimal distributorPriceAll; |
||||
|
@ApiModelProperty(value = "内部引荐人") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "内部引荐人sid") |
||||
|
private String userSid; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.anrui.buscenter.api.bussalesordersubmit; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 9:29 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BusSalesOrderSubmitDto implements Dto { |
||||
|
private static final long serialVersionUID = 4276394815492406556L; |
||||
|
|
||||
|
@ApiModelProperty(value = "价格说明") |
||||
|
private String priceRemarks; |
||||
|
|
||||
|
@ApiModelProperty(value = "优惠说明") |
||||
|
private String discountRemarks; |
||||
|
@ApiModelProperty(value = "中介名称") |
||||
|
private String distributorName; |
||||
|
@ApiModelProperty(value = "联系电话") |
||||
|
private String distributorMobile; |
||||
|
|
||||
|
@ApiModelProperty(value = "中介单位sid") |
||||
|
private String distributorSid; |
||||
|
@ApiModelProperty(value = "单车中介服务费") |
||||
|
private String distributorPrice; |
||||
|
@ApiModelProperty(value = "返利合计") |
||||
|
private String distributorPriceAll; |
||||
|
@ApiModelProperty(value = "内部引荐人") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "内部引荐人sid") |
||||
|
private String userSid; |
||||
|
|
||||
|
@ApiModelProperty(value = "数量") |
||||
|
private Integer num; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.anrui.buscenter.biz.bussalesordersubmit; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.yxt.anrui.buscenter.api.bussalesordersubmit.BusSalesOrderSubmit; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 9:35 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BusSalesOrderSubmitMapper extends BaseMapper<BusSalesOrderSubmit> { |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.yxt.anrui.buscenter.biz.bussalesordersubmit; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.buscenter.api.bussalesordersubmit.BusSalesOrderSubmit; |
||||
|
import com.yxt.anrui.buscenter.api.bussalesordersubmit.BusSalesOrderSubmitDto; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 9:31 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BusSalesOrderSubmitService extends MybatisBaseService<BusSalesOrderSubmitMapper, BusSalesOrderSubmit> { |
||||
|
public void saveOrderSubmit(BusSalesOrderSubmitDto busSalesOrderSubmitDto, String businessSid) { |
||||
|
if (busSalesOrderSubmitDto != null) { |
||||
|
BusSalesOrderSubmit busSalesOrderSubmit1 = new BusSalesOrderSubmit(); |
||||
|
BeanUtil.copyProperties(busSalesOrderSubmitDto, busSalesOrderSubmit1, "sid"); |
||||
|
BigDecimal priceBig = new BigDecimal("0"); |
||||
|
BigDecimal priceAll = new BigDecimal("0"); |
||||
|
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPrice())) { |
||||
|
priceBig = new BigDecimal(busSalesOrderSubmitDto.getDistributorPrice()); |
||||
|
busSalesOrderSubmit1.setDistributorPrice(priceBig); |
||||
|
|
||||
|
} |
||||
|
if (StringUtils.isNotBlank(busSalesOrderSubmitDto.getDistributorPriceAll())) { |
||||
|
priceAll = new BigDecimal(busSalesOrderSubmitDto.getDistributorPriceAll()); |
||||
|
busSalesOrderSubmit1.setDistributorPriceAll(priceAll); |
||||
|
} |
||||
|
busSalesOrderSubmit1.setSalesOrderSid(businessSid); |
||||
|
save(busSalesOrderSubmit1); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,253 +1,224 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" |
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" :action="uploadFile" :accept="accept" list-type="picture-card" :limit="limit" :file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" :on-progress="uploadProgrees" :on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
||||
:action="uploadFile" accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card" |
|
||||
:file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" |
|
||||
:on-progress="uploadProgrees" |
|
||||
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
|
||||
<i class="el-icon-plus avatar-uploader-icon"/> |
<i class="el-icon-plus avatar-uploader-icon"/> |
||||
</el-upload> |
</el-upload> |
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
<el-dialog :visible.sync="dialogVisible" title="查看图片"> |
||||
<img width="100%" :src="dialogImageUrl" alt=""> |
<img width="100%" :src="dialogImageUrl" alt=""> |
||||
</el-dialog> |
</el-dialog> |
||||
|
|
||||
<!-- <el-upload list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">--> |
|
||||
<!-- <i class="el-icon-plus"></i>--> |
|
||||
<!-- </el-upload>--> |
|
||||
<!-- <el-dialog :visible.sync="dialogVisible">--> |
|
||||
<!-- <img width="100%" :src="dialogImageUrl" alt="">--> |
|
||||
<!-- </el-dialog>--> |
|
||||
|
|
||||
<!-- <el-upload class="upload-demo" :headers="accessToken" :action="uploadFile" :accept="accept" :data="uploadData" :on-success="uploadImgSuccess_FuJian" :on-remove="handleRemove" :file-list="fileList_FuJian">--> |
|
||||
<!-- <el-button size="small" type="primary">点击上传</el-button>--> |
|
||||
<!-- <!– <el-button v-show="isview" size="small" type="primary" @click="view()">查看</el-button> –>--> |
|
||||
<!-- <!– <div slot="tip" class="el-upload__tip">单个文件大小不允许超过100M,支持上传文件类型:{{ accept }}</div> –>--> |
|
||||
<!-- </el-upload>--> |
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import {uploadFile} from '@/api/Common/Upload.js' |
import { uploadFile } from '@/api/Common/Upload.js' |
||||
import {getStorage} from '@/utils/auth.js' //token |
import { getStorage } from '@/utils/auth.js' |
||||
import {mapGetters} from 'vuex' |
|
||||
|
|
||||
export default { |
export default { |
||||
model: { |
model: { |
||||
prop: 'name', |
prop: 'name', |
||||
event: 'change', |
event: 'change' |
||||
}, |
}, |
||||
props: { |
props: { |
||||
placeholder: { |
placeholder: { |
||||
type: String, |
type: String, |
||||
default: '', |
default: '' |
||||
}, |
|
||||
bucket: { |
|
||||
type: String, |
|
||||
default: 'abc', |
|
||||
}, |
|
||||
// 长度 |
|
||||
width: { |
|
||||
type: String, |
|
||||
default: '270px', |
|
||||
}, |
|
||||
limit: { |
|
||||
type: Number, |
|
||||
default: 1, |
|
||||
}, |
|
||||
accept: { |
|
||||
type: String, |
|
||||
default: |
|
||||
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx', |
|
||||
}, |
|
||||
// 文件名称 |
|
||||
name: { |
|
||||
type: Array, |
|
||||
required: true, |
|
||||
}, |
|
||||
uploadData: { |
|
||||
type: Object, |
|
||||
default: {}, |
|
||||
}, |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
dialogImageUrl: '', |
|
||||
dialogVisible: false, |
|
||||
accessToken: null, |
|
||||
uploadFile: uploadFile, |
|
||||
fileList_FuJian: [], |
|
||||
enclosure: '', |
|
||||
file_add: '', |
|
||||
file_catch: '', |
|
||||
files: [], |
|
||||
files_list: [], |
|
||||
filedUrl: '', |
|
||||
// fileUrl: fileUrl, |
|
||||
// showpicture:false, |
|
||||
isview: false, |
|
||||
nameArr: '', |
|
||||
loadding: false, |
|
||||
} |
|
||||
}, |
}, |
||||
computed: { |
bucket: { |
||||
...mapGetters([ |
type: String, |
||||
'id', |
default: 'abc' |
||||
'departmentCode', |
}, |
||||
'departmentLevel', |
// 长度 |
||||
'departmentType', |
width: { |
||||
'token', |
type: String, |
||||
]), |
default: '270px' |
||||
}, |
}, |
||||
watch: { |
limit: { |
||||
name: { |
type: Number, |
||||
deep: true, |
default: '' |
||||
immediate: true, |
|
||||
handler(newVal, oldVal) { |
|
||||
console.log('aaaa1', newVal) |
|
||||
this.files = newVal |
|
||||
console.log('aaaa2', this.files) |
|
||||
}, |
|
||||
}, |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.$nextTick(() => { |
|
||||
this.Init() |
|
||||
}) |
|
||||
}, |
}, |
||||
created() { |
accept: { |
||||
this.uploadFile = uploadFile // 接口 |
type: String, |
||||
this.accessToken = { |
default: '.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx' |
||||
token: getStorage(), |
}, |
||||
|
// 文件名称 |
||||
|
name: { |
||||
|
type: Array, |
||||
|
required: true |
||||
|
}, |
||||
|
uploadData: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dialogImageUrl: '', |
||||
|
dialogVisible: false, |
||||
|
accessToken: null, |
||||
|
uploadFile: uploadFile, |
||||
|
fileList_FuJian: [], |
||||
|
enclosure: '', |
||||
|
file_add: '', |
||||
|
file_catch: '', |
||||
|
files: [], |
||||
|
files_list: [], |
||||
|
filedUrl: '', |
||||
|
// fileUrl: fileUrl, |
||||
|
// showpicture:false, |
||||
|
isview: false, |
||||
|
nameArr: '', |
||||
|
loadding: false |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
name: { |
||||
|
deep: true, |
||||
|
immediate: true, |
||||
|
handler(newVal, oldVal) { |
||||
|
console.log('aaaa1', newVal) |
||||
|
this.files = newVal |
||||
|
console.log('aaaa2', this.files) |
||||
} |
} |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.$nextTick(() => { |
||||
|
this.Init() |
||||
|
}) |
||||
|
}, |
||||
|
created() { |
||||
|
this.uploadFile = uploadFile // 接口 |
||||
|
this.accessToken = { |
||||
|
token: getStorage() |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
showImg(imgList) { |
||||
|
this.files = imgList |
||||
|
console.log('123123123', this.files) |
||||
}, |
}, |
||||
methods: { |
view() { |
||||
showImg(imgList){ |
// window.open(this.filedUrl) |
||||
this.files = imgList |
}, |
||||
console.log('123123123',this.files) |
// 页面第一次加载 |
||||
}, |
Init() { |
||||
view() { |
if (this.name !== undefined) { |
||||
// window.open(this.filedUrl) |
this.files = [] |
||||
}, |
for (var i = 0; i < this.name.length; i++) { |
||||
// 页面第一次加载 |
|
||||
Init() { |
|
||||
if (this.name !== undefined) { |
|
||||
this.files = [] |
|
||||
for (var i = 0; i < this.name.length; i++) { |
|
||||
this.files.push({ |
|
||||
name: this.name[i], |
|
||||
url: this.name[i], |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
// 上传方案--成功后执行 |
|
||||
uploadImgSuccess_FuJian(response, file, fileList) { |
|
||||
console.log('您选择的file:', file) |
|
||||
if (file.response.code === '200') { |
|
||||
this.loadding = false |
|
||||
// 返显图片 |
|
||||
this.filedUrl = this.fileUrl + file.response.data |
|
||||
// var uid = file.response.data |
|
||||
this.files.push({ |
this.files.push({ |
||||
name: file.response.data.sourceFileName, |
name: this.name[i], |
||||
url: file.response.data.fullUrl, |
url: this.name[i] |
||||
size: file.response.data.size, |
|
||||
}) |
}) |
||||
this.$emit('change', this.files) |
|
||||
this.$emit('eett', this.files) |
|
||||
} |
} |
||||
}, |
} |
||||
|
}, |
||||
|
handlePictureCardPreview(file) { |
||||
|
console.log(this.file) |
||||
|
this.dialogVisible = true |
||||
|
this.dialogImageUrl = file.url |
||||
|
}, |
||||
|
// 上传方案--成功后执行 |
||||
|
uploadImgSuccess_FuJian(response, file, fileList) { |
||||
|
console.log('您选择的file:', file) |
||||
|
if (file.response.code === '200') { |
||||
|
this.loadding = false |
||||
|
// 返显图片 |
||||
|
this.filedUrl = this.fileUrl + file.response.data |
||||
|
// var uid = file.response.data |
||||
|
this.files.push({ |
||||
|
name: file.response.data.sourceFileName, |
||||
|
url: file.response.data.fullUrl, |
||||
|
size: file.response.data.size |
||||
|
}) |
||||
|
this.$emit('change', this.files) |
||||
|
this.$emit('eett', this.files) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
removeImage(file, ImageFileList) { |
removeImage(file, ImageFileList) { |
||||
this.files.splice(this.files.indexOf(file), 1) |
this.files.splice(this.files.indexOf(file), 1) |
||||
const imgFiles = [] |
const imgFiles = [] |
||||
|
|
||||
this.files.forEach((o) => { |
this.files.forEach((o) => { |
||||
imgFiles.push(o.url) |
imgFiles.push(o.url) |
||||
}) |
}) |
||||
this.$emit('fileChange', this.files) |
this.$emit('fileChange', this.files) |
||||
}, |
}, |
||||
handleRemove(file, fileList) { |
handleRemove(file, fileList) { |
||||
console.log('file:' + JSON.stringify(file)) |
console.log('file:' + JSON.stringify(file)) |
||||
console.log('fileList:' + JSON.stringify(fileList)) |
console.log('fileList:' + JSON.stringify(fileList)) |
||||
this.enclosure = '' |
this.enclosure = '' |
||||
// 1. 保存新增文件id(this.file_add) |
// 1. 保存新增文件id(this.file_add) |
||||
this.getNewFileId(fileList) |
this.getNewFileId(fileList) |
||||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
// 2. 保存数据库读取的已有文件id(this.file_catch) |
||||
this.getCatchFileId(file) |
this.getCatchFileId(file) |
||||
// 3. 保存并拼接id |
// 3. 保存并拼接id |
||||
this.getFileId() |
this.getFileId() |
||||
// 4. 返回拼接id |
// 4. 返回拼接id |
||||
this.$emit('change', this.enclosure) |
this.$emit('change', this.enclosure) |
||||
}, |
}, |
||||
// 返回this.file_add(新上传文件的id拼接集合) |
// 返回this.file_add(新上传文件的id拼接集合) |
||||
getNewFileId(fileList) { |
getNewFileId(fileList) { |
||||
// debugger |
// debugger |
||||
this.file_add = '' |
this.file_add = '' |
||||
for (var i = 0; i < fileList.length; i++) { |
for (var i = 0; i < fileList.length; i++) { |
||||
if (fileList[i].response && fileList[i].response.code === '200') { |
if (fileList[i].response && fileList[i].response.code === '200') { |
||||
this.file_add = this.file_add + fileList[i].response.data + ',' |
this.file_add = this.file_add + fileList[i].response.data + ',' |
||||
} |
|
||||
} |
|
||||
if (this.file_add !== '') { |
|
||||
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
|
||||
} |
|
||||
// console.log('1. this.file_add: ' + this.file_add) |
|
||||
}, |
|
||||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|
||||
getCatchFileId(file) { |
|
||||
for (var i = 0; i < this.files_list.length; i++) { |
|
||||
if (this.file_catch !== '') { |
|
||||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|
||||
if (this.files_list[i].name === file.name) { |
|
||||
// 2. 拆开file_catch到fils_arry |
|
||||
var fils_arry = this.file_catch.split(',') |
|
||||
// 3. 从fils_arry去除 this.files_list[i].id |
|
||||
var arry = [] |
|
||||
fils_arry.forEach((element) => { |
|
||||
// 不加载文件里面的 |
|
||||
if (element !== this.files_list[i].id) { |
|
||||
arry.push(element) |
|
||||
} |
|
||||
}) |
|
||||
// 4. 重新拼接成file_catch |
|
||||
this.file_catch = arry.join(',') |
|
||||
} |
|
||||
} |
|
||||
} |
} |
||||
// console.log('2. this.file_catch:' + this.file_catch) |
} |
||||
}, |
if (this.file_add !== '') { |
||||
// 保存并拼接id |
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
||||
getFileId() { |
} |
||||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
// console.log('1. this.file_add: ' + this.file_add) |
||||
|
}, |
||||
|
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
||||
|
getCatchFileId(file) { |
||||
|
for (var i = 0; i < this.files_list.length; i++) { |
||||
if (this.file_catch !== '') { |
if (this.file_catch !== '') { |
||||
if (this.file_add !== '') { |
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
||||
this.enclosure = this.file_catch + ',' + this.file_add |
if (this.files_list[i].name === file.name) { |
||||
} else { |
// 2. 拆开file_catch到fils_arry |
||||
this.enclosure = this.file_catch |
var fils_arry = this.file_catch.split(',') |
||||
|
// 3. 从fils_arry去除 this.files_list[i].id |
||||
|
var arry = [] |
||||
|
fils_arry.forEach((element) => { |
||||
|
// 不加载文件里面的 |
||||
|
if (element !== this.files_list[i].id) { |
||||
|
arry.push(element) |
||||
|
} |
||||
|
}) |
||||
|
// 4. 重新拼接成file_catch |
||||
|
this.file_catch = arry.join(',') |
||||
} |
} |
||||
} else { |
|
||||
this.enclosure = this.file_add |
|
||||
} |
} |
||||
}, |
} |
||||
handlePictureCardPreview(file) { |
// console.log('2. this.file_catch:' + this.file_catch) |
||||
// this.dialogImageUrl = file.url |
}, |
||||
// this.dialogImageUrl = file.fullUrl |
// 保存并拼接id |
||||
this.dialogImageUrl = file.url |
getFileId() { |
||||
// this.showpicture = true |
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
||||
}, |
if (this.file_catch !== '') { |
||||
// 上传失败 |
if (this.file_add !== '') { |
||||
uploadError() { |
this.enclosure = this.file_catch + ',' + this.file_add |
||||
this.loadding = false |
} else { |
||||
}, |
this.enclosure = this.file_catch |
||||
uploadProgrees(event, file, fileList) { |
|
||||
if (Number(event.percent) > 0) { |
|
||||
this.loadding = true |
|
||||
} |
} |
||||
// console.log('event:', event) |
} else { |
||||
}, |
this.enclosure = this.file_add |
||||
|
} |
||||
}, |
}, |
||||
|
// 上传失败 |
||||
|
uploadError() { |
||||
|
this.loadding = false |
||||
|
}, |
||||
|
uploadProgrees(event, file, fileList) { |
||||
|
if (Number(event.percent) > 0) { |
||||
|
this.loadding = true |
||||
|
} |
||||
|
// console.log('event:', event) |
||||
|
} |
||||
} |
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped></style> |
<style lang="scss" scoped></style> |
||||
|
@ -1,270 +1,144 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
<el-upload |
<el-upload ref="imgUpload" class="avatar-uploader" :file-list="files" :headers="accessToken" :accept="accept" :action="uploadFile" :on-success="uploadImgSuccess_FuJian" :show-file-list="false"> |
||||
ref="imgUpload" |
<i v-if="Photo === '' && frontPhoto === ''" class="el-icon-plus avatar-uploader-icon" /> |
||||
v-loading="loadding" |
<img v-else :src="Photo != '' ? Photo : frontPhoto" class="avatar"> |
||||
class="avatar-uploader" |
|
||||
:headers="accessToken" |
|
||||
:action="uploadFile" |
|
||||
accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" |
|
||||
list-type="picture-card" |
|
||||
:file-list="files" |
|
||||
:on-remove="removeImage" |
|
||||
:on-preview="handlePictureCardPreview" |
|
||||
:on-progress="uploadProgrees" |
|
||||
:on-error="uploadError" |
|
||||
:on-success="uploadImgSuccess_FuJian" |
|
||||
> |
|
||||
<i class="el-icon-plus avatar-uploader-icon" /> |
|
||||
</el-upload> |
</el-upload> |
||||
<el-dialog |
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
||||
:visible.sync="dialogVisible" |
|
||||
:append-to-body="true" |
|
||||
title="查看图片" |
|
||||
> |
|
||||
<img width="100%" :src="dialogImageUrl" alt="" /> |
<img width="100%" :src="dialogImageUrl" alt="" /> |
||||
</el-dialog> |
</el-dialog> |
||||
|
|
||||
<!-- <el-upload list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">--> |
|
||||
<!-- <i class="el-icon-plus"></i>--> |
|
||||
<!-- </el-upload>--> |
|
||||
<!-- <el-dialog :visible.sync="dialogVisible">--> |
|
||||
<!-- <img width="100%" :src="dialogImageUrl" alt="">--> |
|
||||
<!-- </el-dialog>--> |
|
||||
|
|
||||
<!-- <el-upload class="upload-demo" :headers="accessToken" :action="uploadFile" :accept="accept" :data="uploadData" :on-success="uploadImgSuccess_FuJian" :on-remove="handleRemove" :file-list="fileList_FuJian">--> |
|
||||
<!-- <el-button size="small" type="primary">点击上传</el-button>--> |
|
||||
<!-- <!– <el-button v-show="isview" size="small" type="primary" @click="view()">查看</el-button> –>--> |
|
||||
<!-- <!– <div slot="tip" class="el-upload__tip">单个文件大小不允许超过100M,支持上传文件类型:{{ accept }}</div> –>--> |
|
||||
<!-- </el-upload>--> |
|
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { uploadFile } from "@/api/Common/Upload.js"; |
import { uploadFile } from '@/api/Common/Upload.js' |
||||
import { getStorage } from "@/utils/auth.js"; //token |
import { getStorage } from '@/utils/auth' |
||||
import { mapGetters } from "vuex"; |
|
||||
|
|
||||
export default { |
export default { |
||||
model: { |
// model: { |
||||
prop: "name", |
// prop: 'name', |
||||
event: "change", |
// event: 'change' |
||||
}, |
// }, |
||||
props: { |
props: { |
||||
placeholder: { |
|
||||
type: String, |
|
||||
default: "", |
|
||||
}, |
|
||||
bucket: { |
|
||||
type: String, |
|
||||
default: "abc", |
|
||||
}, |
|
||||
// 长度 |
|
||||
width: { |
|
||||
type: String, |
|
||||
default: "270px", |
|
||||
}, |
|
||||
limit: { |
limit: { |
||||
type: Number, |
type: Number, |
||||
default: 1, |
default: 1 |
||||
}, |
}, |
||||
accept: { |
accept: { |
||||
type: String, |
type: String, |
||||
default: |
default: '.jpg,.jpeg,.png,.JPG,.JPEG,.PNG' |
||||
".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx", |
|
||||
}, |
}, |
||||
|
frontPhoto: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
} |
||||
// 文件名称 |
// 文件名称 |
||||
name: { |
// name: { |
||||
type: Array, |
// type: Array, |
||||
required: true, |
// required: true |
||||
}, |
// } |
||||
uploadData: { |
|
||||
type: Object, |
|
||||
default: {}, |
|
||||
}, |
|
||||
}, |
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
dialogImageUrl: "", |
dialogImageUrl: '', |
||||
dialogVisible: false, |
dialogVisible: false, |
||||
accessToken: null, |
|
||||
uploadFile: uploadFile, |
uploadFile: uploadFile, |
||||
fileList_FuJian: [], |
|
||||
enclosure: "", |
|
||||
file_add: "", |
|
||||
file_catch: "", |
|
||||
files: [], |
files: [], |
||||
files_list: [], |
|
||||
filedUrl: "", |
|
||||
// fileUrl: fileUrl, |
|
||||
// showpicture:false, |
|
||||
isview: false, |
|
||||
nameArr: "", |
|
||||
loadding: false, |
loadding: false, |
||||
}; |
Photo: '' |
||||
}, |
} |
||||
computed: { |
|
||||
...mapGetters([ |
|
||||
"id", |
|
||||
"departmentCode", |
|
||||
"departmentLevel", |
|
||||
"departmentType", |
|
||||
"token", |
|
||||
]), |
|
||||
}, |
|
||||
watch: { |
|
||||
name: { |
|
||||
deep: true, |
|
||||
immediate: true, |
|
||||
handler(newVal, oldVal) { |
|
||||
console.log("aaaa1", newVal); |
|
||||
this.files = newVal; |
|
||||
if (this.files.length > 1) { |
|
||||
this.files.splice(0, 1); |
|
||||
} |
|
||||
console.log("aaaa2", this.files); |
|
||||
}, |
|
||||
}, |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.$nextTick(() => { |
|
||||
this.Init(); |
|
||||
}); |
|
||||
}, |
}, |
||||
|
// watch: { |
||||
|
// name: { |
||||
|
// deep: true, |
||||
|
// immediate: true, |
||||
|
// handler(newVal, oldVal) { |
||||
|
// console.log('aaaa1', newVal) |
||||
|
// this.files = newVal |
||||
|
// if (this.files.length > 1) { |
||||
|
// this.files.splice(0, 1) |
||||
|
// console.log(111111) |
||||
|
// } |
||||
|
// // this.Photo = this.files[0].url |
||||
|
// console.log('333333', this.Photo, this.files) |
||||
|
// console.log('aaaa2', this.files) |
||||
|
// } |
||||
|
// } |
||||
|
// }, |
||||
|
// mounted() { |
||||
|
// this.$nextTick(() => { |
||||
|
// this.Init() |
||||
|
// }) |
||||
|
// }, |
||||
created() { |
created() { |
||||
this.uploadFile = uploadFile; // 接口 |
this.uploadFile = uploadFile // 接口 |
||||
this.accessToken = { |
this.accessToken = { |
||||
token: getStorage(), |
token: getStorage(), |
||||
}; |
} |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
showImg(imgList) { |
// showImg(imgList) { |
||||
this.files = imgList; |
// this.files = imgList |
||||
console.log("123123123", this.files); |
// console.log('123123123', this.files) |
||||
}, |
// }, |
||||
view() { |
// // 页面第一次加载 |
||||
// window.open(this.filedUrl) |
// Init() { |
||||
}, |
// if (this.name !== undefined) { |
||||
// 页面第一次加载 |
// this.files = [] |
||||
Init() { |
// for (var i = 0; i < this.name.length; i++) { |
||||
if (this.name !== undefined) { |
// this.files.push({ |
||||
this.files = []; |
// name: this.name[i], |
||||
for (var i = 0; i < this.name.length; i++) { |
// url: this.name[i] |
||||
this.files.push({ |
// }) |
||||
name: this.name[i], |
// } |
||||
url: this.name[i], |
// } |
||||
}); |
// }, |
||||
} |
|
||||
} |
|
||||
}, |
|
||||
// 上传方案--成功后执行 |
// 上传方案--成功后执行 |
||||
uploadImgSuccess_FuJian(response, file, fileList) { |
uploadImgSuccess_FuJian(response, file) { |
||||
console.log("您选择的file:", file); |
console.log('您选择的file:', file) |
||||
if (file.response.code === "200") { |
if (file.response.code === '200') { |
||||
this.loadding = false; |
this.loadding = false |
||||
// 返显图片 |
// 返显图片 |
||||
this.filedUrl = this.fileUrl + file.response.data; |
this.Photo = file.response.data.fullUrl |
||||
// var uid = file.response.data |
|
||||
this.files.push({ |
this.files.push({ |
||||
name: file.response.data.sourceFileName, |
name: file.response.data.sourceFileName, |
||||
url: file.response.data.fullUrl, |
url: file.response.data.fullUrl, |
||||
size: file.response.data.size, |
size: file.response.data.size |
||||
}); |
}) |
||||
this.$emit("change", this.files); |
this.$emit('photoAdd', this.Photo) |
||||
this.$emit("eett", this.files); |
this.$emit('eett', this.files) |
||||
} |
} |
||||
}, |
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
removeImage(file, ImageFileList) { |
<style scoped> |
||||
this.files.splice(this.files.indexOf(file), 1); |
.avatar-uploader .el-upload { |
||||
const imgFiles = []; |
border: 1px dashed #d9d9d9; |
||||
|
border-radius: 6px; |
||||
|
cursor: pointer; |
||||
|
position: relative; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
this.files.forEach((o) => { |
.avatar-uploader .el-upload:hover { |
||||
imgFiles.push(o.url); |
border-color: #409eff; |
||||
}); |
} |
||||
this.$emit("fileChange", this.files); |
|
||||
}, |
.avatar-uploader-icon { |
||||
handleRemove(file, fileList) { |
font-size: 28px; |
||||
console.log("file:" + JSON.stringify(file)); |
color: #8c939d; |
||||
console.log("fileList:" + JSON.stringify(fileList)); |
width: 178px; |
||||
this.enclosure = ""; |
height: 178px; |
||||
// 1. 保存新增文件id(this.file_add) |
line-height: 178px; |
||||
this.getNewFileId(fileList); |
text-align: center; |
||||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
} |
||||
this.getCatchFileId(file); |
|
||||
// 3. 保存并拼接id |
|
||||
this.getFileId(); |
|
||||
// 4. 返回拼接id |
|
||||
this.$emit("change", this.enclosure); |
|
||||
}, |
|
||||
// 返回this.file_add(新上传文件的id拼接集合) |
|
||||
getNewFileId(fileList) { |
|
||||
// debugger |
|
||||
this.file_add = ""; |
|
||||
for (var i = 0; i < fileList.length; i++) { |
|
||||
if (fileList[i].response && fileList[i].response.code === "200") { |
|
||||
this.file_add = this.file_add + fileList[i].response.data + ","; |
|
||||
} |
|
||||
} |
|
||||
if (this.file_add !== "") { |
|
||||
this.file_add = this.file_add.substring(0, this.file_add.length - 1); |
|
||||
} |
|
||||
// console.log('1. this.file_add: ' + this.file_add) |
|
||||
}, |
|
||||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|
||||
getCatchFileId(file) { |
|
||||
for (var i = 0; i < this.files_list.length; i++) { |
|
||||
if (this.file_catch !== "") { |
|
||||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|
||||
if (this.files_list[i].name === file.name) { |
|
||||
// 2. 拆开file_catch到fils_arry |
|
||||
var fils_arry = this.file_catch.split(","); |
|
||||
// 3. 从fils_arry去除 this.files_list[i].id |
|
||||
var arry = []; |
|
||||
fils_arry.forEach((element) => { |
|
||||
// 不加载文件里面的 |
|
||||
if (element !== this.files_list[i].id) { |
|
||||
arry.push(element); |
|
||||
} |
|
||||
}); |
|
||||
// 4. 重新拼接成file_catch |
|
||||
this.file_catch = arry.join(","); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
// console.log('2. this.file_catch:' + this.file_catch) |
|
||||
}, |
|
||||
// 保存并拼接id |
|
||||
getFileId() { |
|
||||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
|
||||
if (this.file_catch !== "") { |
|
||||
if (this.file_add !== "") { |
|
||||
this.enclosure = this.file_catch + "," + this.file_add; |
|
||||
} else { |
|
||||
this.enclosure = this.file_catch; |
|
||||
} |
|
||||
} else { |
|
||||
this.enclosure = this.file_add; |
|
||||
} |
|
||||
}, |
|
||||
handlePictureCardPreview(file) { |
|
||||
// this.dialogImageUrl = file.url |
|
||||
// this.dialogImageUrl = file.fullUrl |
|
||||
this.dialogImageUrl = file.url; |
|
||||
// this.showpicture = true |
|
||||
}, |
|
||||
// 上传失败 |
|
||||
uploadError() { |
|
||||
this.loadding = false; |
|
||||
}, |
|
||||
uploadProgrees(event, file, fileList) { |
|
||||
if (Number(event.percent) > 0) { |
|
||||
this.loadding = true; |
|
||||
} |
|
||||
// console.log('event:', event) |
|
||||
}, |
|
||||
}, |
|
||||
}; |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped></style> |
.avatar { |
||||
|
margin-top: 5%; |
||||
|
width: 178px; |
||||
|
height: 178px; |
||||
|
display: block; |
||||
|
} |
||||
|
</style> |
||||
|
File diff suppressed because it is too large
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.anrui.portal.api.sysstaffinfo; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 15:47 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PcSysStaffQuery implements Query { |
||||
|
private static final long serialVersionUID = 1858291601540877140L; |
||||
|
@ApiModelProperty(value = "业务员sid") |
||||
|
private String staffSid; |
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.yxt.anrui.portal.api.sysstaffinfo; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/5/20 15:44 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PcSysStaffVo implements Vo { |
||||
|
private static final long serialVersionUID = -9042032921079833819L; |
||||
|
|
||||
|
private String staffSid; |
||||
|
private String staffName; |
||||
|
} |
Loading…
Reference in new issue