修改页面
This commit is contained in:
@@ -99,7 +99,7 @@ export default {
|
||||
if (!this.detail.orderImgUrl) return;
|
||||
const imgIds = this.detail.orderImgUrl.split(',');
|
||||
const res = await this.$u.api.getImageUrl({}, imgIds.join(','));
|
||||
if (res.code == 200 && res.data) this.orderImgUrls = res.data.map(item => item.url);
|
||||
if (res.code == 200 && res.data) this.orderImgUrls = res.data.map(item => this.vuex_config.imgUrl+item.url);
|
||||
},
|
||||
async getHandler() {
|
||||
let handlers = await this.$u.api.getHandler3({}, this.detail.type);
|
||||
|
@@ -32,7 +32,7 @@
|
||||
<text class="label">人脸图片:</text>
|
||||
<image
|
||||
class="face-image"
|
||||
:src="auditsDetail.img || '/static/ic_avg.png'"
|
||||
:src="imgUrl || '/static/ic_avg.png'"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
@@ -69,7 +69,9 @@
|
||||
handleDesc: '',
|
||||
selectedImages: [],
|
||||
realImages: [],
|
||||
infoImages: []
|
||||
infoImages: [],
|
||||
imgUrl:'',
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -83,6 +85,7 @@
|
||||
// 原有方法保持不变...
|
||||
handleApprove() {
|
||||
this.auditsDetail.isAudit=1
|
||||
this.auditsDetail.isAuditState=2
|
||||
this.$u.api.unit.updateEmployee(this.auditsDetail).then(res => {
|
||||
if (res.code == "200") {
|
||||
// 提交逻辑
|
||||
@@ -100,6 +103,7 @@
|
||||
},
|
||||
handleReject() {
|
||||
this.auditsDetail.isAudit=2
|
||||
this.auditsDetail.isAuditState=2
|
||||
this.$u.api.unit.updateEmployee(this.auditsDetail).then(res => {
|
||||
if (res.code == "200") {
|
||||
// 提交逻辑
|
||||
@@ -117,8 +121,15 @@
|
||||
},
|
||||
|
||||
queryEmployee(id){
|
||||
this.$u.api.unit.queryEmployeeById(this.auditsDetail).then(res => {
|
||||
this.auditsDetail = res.data;
|
||||
const _this = this;
|
||||
_this.$u.api.unit.queryEmployeeById(_this.auditsDetail).then(res => {
|
||||
const {data} = res;
|
||||
_this.auditsDetail = data;
|
||||
_this.$u.api.getImageUrl({}, data.img).then(res=>{
|
||||
if (res.code == 200) {
|
||||
_this.imgUrl=_this.vuex_config.imgUrl +res.data[0].url;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<!-- 员工审核卡片 -->
|
||||
<view v-for="(item, index) in employeeList" :key="index" class="employee-card" @click="handleCardClick(item)">
|
||||
<!-- 左侧头像 -->
|
||||
<image class="avatar" :src="item.avatar || '/static/ic_avg.png'"/>
|
||||
<image class="avatar" :src="item.img || '/static/ic_avg.png'"/>
|
||||
|
||||
<!-- 右侧信息 -->
|
||||
<view class="info-container">
|
||||
@@ -52,8 +52,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
employeeList: [
|
||||
], // 员工列表数据
|
||||
employeeList: [], // 员工列表数据
|
||||
pageNum: 1, // 当前页码
|
||||
pageSize: 10, // 每页数量
|
||||
noMore: false, // 是否没有更多数据
|
||||
@@ -86,6 +85,7 @@ export default {
|
||||
let res = await this.$u.api.unit.queryEmployee({
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
unitId: uni.getStorageSync('lifeData').vuex_user.unitId,
|
||||
});
|
||||
if (res.code == "200") {
|
||||
let rows = res.rows || [];
|
||||
@@ -98,6 +98,7 @@ export default {
|
||||
} else {
|
||||
this.employeeList = [...this.employeeList, ...rows];
|
||||
}
|
||||
await this.getImageUrl();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@@ -107,13 +108,46 @@ export default {
|
||||
},
|
||||
// 点击卡片事件
|
||||
handleCardClick(item) {
|
||||
console.log(item.id);
|
||||
if (item.state === 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/sys/workbench/unitManagement/auditsDetail?id=${item.id}`,
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: `/pages/sys/workbench/unitManagement/auditsDetail?id=${item.id}`,
|
||||
});
|
||||
},
|
||||
async getImageUrl() {
|
||||
// 收集所有需要获取链接的图片ID
|
||||
const imgIds = [];
|
||||
const imgIdToIndexMap = []; // 保存图片ID对应的list索引
|
||||
|
||||
for (let i = 0; i < this.employeeList.length; i++) {
|
||||
const item = this.employeeList[i];
|
||||
if (item.img) {
|
||||
imgIds.push(item.img);
|
||||
imgIdToIndexMap.push({
|
||||
id: item.img,
|
||||
index: i
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果有图片ID需要处理,则调用API一次获取所有图片链接
|
||||
if (imgIds.length > 0) {
|
||||
console.log(imgIds);
|
||||
try {
|
||||
const imgRes = await this.$u.api.getImageUrl({}, imgIds.join(','));
|
||||
if (imgRes.code == 200 && imgRes.data) {
|
||||
// 将返回的图片URL映射回对应的list项
|
||||
imgRes.data.forEach(imgItem => {
|
||||
const mapping = imgIdToIndexMap.find(m => m.id === imgItem.ossId);
|
||||
if (mapping) {
|
||||
this.$set(this.employeeList[mapping.index], 'img', this.vuex_config.imgUrl+imgItem.url);
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(this.employeeList);
|
||||
} catch (error) {
|
||||
console.error('获取图片链接失败:', error);
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -196,7 +230,7 @@ export default {
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
width: 26%;
|
||||
text-align:left;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@
|
||||
<text class="label">人脸图片:</text>
|
||||
<image
|
||||
class="face-image"
|
||||
:src="employeeDetail.img || '/static/ic_avg.png'"
|
||||
:src="imgUrl || '/static/ic_avg.png'"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
@@ -84,6 +84,7 @@ export default {
|
||||
return {
|
||||
pageType: 'handle', // 'handle' 或 'detail'
|
||||
employeeDetail: {},
|
||||
imgUrl: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -97,14 +98,19 @@ export default {
|
||||
queryEmployee() {
|
||||
this.$u.api.unit.queryEmployeeById(this.employeeDetail).then(res => {
|
||||
this.employeeDetail = res.data;
|
||||
this.$u.api.getImageUrl({}, this.employeeDetail.img).then(res=>{
|
||||
if (res.code == 200) {
|
||||
this.imgUrl= this.vuex_config.imgUrl +res.data[0].url;
|
||||
}
|
||||
});
|
||||
});
|
||||
console.log(this.employeeDetail);
|
||||
},
|
||||
// 新增状态变更方法
|
||||
changeStatus(newState) {
|
||||
this.employeeDetail.state = newState;
|
||||
},
|
||||
saveInfo() {
|
||||
console.log(this.employeeDetail);
|
||||
this.$u.api.unit.updateEmployee(this.employeeDetail).then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
|
@@ -105,7 +105,9 @@ export default {
|
||||
|
||||
let params = {
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize
|
||||
pageSize: this.pageSize,
|
||||
unitId: uni.getStorageSync('lifeData').vuex_user.unitId,
|
||||
isAudit: 1
|
||||
};
|
||||
|
||||
// 根据输入内容决定使用哪个搜索字段
|
||||
@@ -129,6 +131,7 @@ export default {
|
||||
} else {
|
||||
this.list = [...this.list, ...rows];
|
||||
}
|
||||
await this.getImageUrl();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@@ -138,13 +141,46 @@ export default {
|
||||
},
|
||||
// 点击卡片事件
|
||||
handleCardClick(item) {
|
||||
if (item.state === 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/sys/workbench/unitManagement/employeeEdit?id=${item.id}`
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: `/pages/sys/workbench/unitManagement/employeeEdit?id=${item.id}`
|
||||
});
|
||||
},
|
||||
async getImageUrl() {
|
||||
// 收集所有需要获取链接的图片ID
|
||||
const imgIds = [];
|
||||
const imgIdToIndexMap = []; // 保存图片ID对应的list索引
|
||||
|
||||
for (let i = 0; i < this.list.length; i++) {
|
||||
const item = this.list[i];
|
||||
if (item.img) {
|
||||
imgIds.push(item.img);
|
||||
imgIdToIndexMap.push({
|
||||
id: item.img,
|
||||
index: i
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 如果有图片ID需要处理,则调用API一次获取所有图片链接
|
||||
if (imgIds.length > 0) {
|
||||
console.log(imgIds);
|
||||
try {
|
||||
const imgRes = await this.$u.api.getImageUrl({}, imgIds.join(','));
|
||||
if (imgRes.code == 200 && imgRes.data) {
|
||||
// 将返回的图片URL映射回对应的list项
|
||||
imgRes.data.forEach(imgItem => {
|
||||
const mapping = imgIdToIndexMap.find(m => m.id === imgItem.ossId);
|
||||
if (mapping) {
|
||||
this.$set(this.list[mapping.index], 'img', this.vuex_config.imgUrl+imgItem.url);
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(this.list);
|
||||
} catch (error) {
|
||||
console.error('获取图片链接失败:', error);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 新增搜索方法
|
||||
handleSearch() {
|
||||
this.pageNum = 1;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<view class="unit-header-container">
|
||||
<view class="unit-header">
|
||||
<image class="header-icon" src="/static/ic_enterprise.png" mode="aspectFit"/>
|
||||
<view class="unit-title">南川区******单位(共189人)</view>
|
||||
<view class="unit-title">南川{{unitName}}单位</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
return {
|
||||
showDialog: false,
|
||||
qrSize: 400, // 与CSS中保持一致
|
||||
|
||||
unitName:uni.getStorageSync('lifeData').vuex_user.unitName,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -113,12 +113,15 @@ export default {
|
||||
},
|
||||
// 修改后的makeQRCode方法
|
||||
makeQRCode() {
|
||||
let unitName = uni.getStorageSync('lifeData').vuex_user.unitName
|
||||
var unitId = uni.getStorageSync('lifeData').vuex_user.unitId;
|
||||
var tenantId = uni.getStorageSync('lifeData').vuex_user.tenantId;
|
||||
|
||||
// 获取uQRCode实例
|
||||
var qr = new uQRCode();
|
||||
// 设置二维码内容
|
||||
qr.data = `http://183.230.235.66:11010/parkH5?unitId=${uni.getStorageSync('lifeData').vuex_user.unitId}
|
||||
& unitName=${uni.getStorageSync('lifeData').vuex_user.unitName}
|
||||
& tenantId=${uni.getStorageSync('lifeData').vuex_user.tenantId}`;
|
||||
let data = "http://183.230.235.66:11010/parkH5/#/?unitId=" + unitId + "&unitName=" + unitName + "&tenantId=" + tenantId;
|
||||
qr.data = encodeURI(data)
|
||||
// 设置二维码大小,必须与canvas设置的宽高一致
|
||||
qr.size = 200;
|
||||
// 调用制作二维码方法
|
||||
|
Reference in New Issue
Block a user