Browse Source

测试

zhangyong/milestone-20250913-现金管理
ZhangYong 1 month ago
parent
commit
93cfe4d109
  1. 147
      src/components/previews/PreviewImage.vue
  2. 2
      src/views/moneyManage/executor/executor.vue
  3. 29
      src/views/moneyManage/receiveDetail/receiveDetail.vue
  4. 14
      src/views/moneyManage/refundDetail/refundCharge.vue
  5. 87
      src/views/moneyManage/refundDetail/refundFinance.vue
  6. 12
      src/views/moneyManage/refundDetail/refundHeader.vue
  7. 52
      src/views/moneyManage/refundDetail/refundService.vue

147
src/components/previews/PreviewImage.vue

@ -0,0 +1,147 @@
<!-- 图片预览组件下一期再使用 -->
<template>
<div v-if="showPreview" class="image-preview-overlay" @click="closePreview">
<div class="image-container" @click.stop>
<img :src="currentImageUrl" :alt="altText" class="preview-image" />
<button class="close-button" @click="closePreview">×</button>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
//
const props = defineProps({
// URL
imageUrl: {
type: String,
default: ''
},
//
altText: {
type: String,
default: '预览图片'
},
//
modelValue: {
type: Boolean,
default: false
}
})
//
const emit = defineEmits(['update:modelValue', 'close'])
//
const showPreview = ref(false)
const currentImageUrl = ref('')
//
const openPreview = (url) => {
currentImageUrl.value = url || props.imageUrl
showPreview.value = true
emit('update:modelValue', true)
}
//
const closePreview = () => {
showPreview.value = false
emit('update:modelValue', false)
emit('close')
}
// modelValue
watch(() => props.modelValue, (newVal) => {
showPreview.value = newVal
if (newVal) {
currentImageUrl.value = props.imageUrl
}
})
// imageUrl
watch(() => props.imageUrl, (newUrl) => {
if (showPreview.value) {
currentImageUrl.value = newUrl
}
})
//
defineExpose({
openPreview,
closePreview
})
</script>
<style scoped>
.image-preview-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
overflow: auto;
}
.image-container {
position: relative;
max-width: 90vw;
max-height: 90vh;
display: flex;
justify-content: center;
align-items: center;
}
.preview-image {
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.close-button {
position: absolute;
top: -40px;
right: -40px;
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.9);
border: none;
border-radius: 50%;
font-size: 24px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: #333;
transition: all 0.3s ease;
}
.close-button:hover {
background: rgba(255, 255, 255, 1);
transform: scale(1.1);
}
/* 响应式设计 */
@media (max-width: 768px) {
.image-container {
max-width: 95vw;
max-height: 95vh;
}
.close-button {
top: -30px;
right: -30px;
width: 30px;
height: 30px;
font-size: 20px;
}
}
</style>

2
src/views/moneyManage/executor/executor.vue

@ -140,7 +140,7 @@
</div>
<div class="dialog-item">
<el-text style="width:4vw;">所属地区</el-text>
<el-input v-model="editRow.marketName" style="width:10vw;" disabled />
<el-input v-model="editRow.market" style="width:10vw;" disabled />
</div>
<div class="dialog-item">
<el-text style="width:4vw;">产品名称</el-text>

29
src/views/moneyManage/receiveDetail/receiveDetail.vue

@ -1008,6 +1008,35 @@ const customUpload = async (options) => {
ElMessage.error(`上传失败: ${error.msg || error.message || '网络异常'}`)
}
}
//
const previewImage = (imageUrl) => {
// 使 element-plus el-image
const imageElement = document.createElement('img');
imageElement.src = imageUrl;
imageElement.style.maxWidth = '80vw';
imageElement.style.maxHeight = '80vh';
const viewer = document.createElement('div');
viewer.style.position = 'fixed';
viewer.style.top = '0';
viewer.style.left = '0';
viewer.style.width = '100vw';
viewer.style.height = '100vh';
viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
viewer.style.display = 'flex';
viewer.style.justifyContent = 'center';
viewer.style.alignItems = 'center';
viewer.style.zIndex = '9999';
viewer.style.overflow = 'auto';
viewer.appendChild(imageElement);
document.body.appendChild(viewer);
viewer.addEventListener('click', () => {
document.body.removeChild(viewer);
});
};
//========= 退/ ===============
const refundFormData = ref({

14
src/views/moneyManage/refundDetail/refundCharge.vue

@ -105,18 +105,20 @@
<el-button @click="" class="smallTitle" size="small">退款申请信息</el-button>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款类型</el-text>
<el-input v-model="auditRow.refundModel" placeholder="请输入退款类型" size="small" style="width:10vw;"
clearable></el-input>
<el-select v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
<el-option label="全部退款" :value="0"></el-option>
<el-option label="部分退款" :value="1"></el-option>
</el-select>
</div>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款金额</el-text>
<el-input v-model="auditRow.paymentAmount" placeholder="请输入退款金额" size="small" style="width:10vw;"
clearable></el-input>
clearable disabled></el-input>
</div>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款备注</el-text>
<el-input v-model="auditRow.refundReason" placeholder="请输入退款备注" size="small" style="width:10vw;"
:rows="3" maxlength="100" show-word-limit type="textarea" />
:rows="3" maxlength="100" show-word-limit type="textarea" disabled />
</div>
</div>
<el-button @click="" class="smallTitle" size="small">原订单信息</el-button>
@ -128,7 +130,7 @@
</div>
<div class="center-item">
<el-text style="width:4vw;" size="small">所属地区</el-text>
<el-input v-model="auditRow.marketName" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.market" size="small" style="width:10vw;" disabled />
</div>
<div class="center-item">
<el-text style="width:4vw;" size="small">产品名称</el-text>
@ -814,7 +816,7 @@ onMounted(() => {
.top {
width: 30vw;
height: 17vh;
height: 19vh;
.top-item {
display: flex;

87
src/views/moneyManage/refundDetail/refundFinance.vue

@ -12,8 +12,8 @@
</div>
<div class="item1">
<el-text size="large" style="width:4vw;">所属地区</el-text>
<el-cascader style="width: 9vw;" v-model="searchForm.markets" :options="market"
placeholder="请选择所属地区" clearable @change="handleMarketChange" />
<el-cascader style="width: 9vw;" v-model="searchForm.markets" :options="market" placeholder="请选择所属地区"
clearable @change="handleMarketChange" />
</div>
<div class="item1">
<el-text size="large" style="width:4vw;">产品名称</el-text>
@ -43,7 +43,7 @@
<div class="item2" style="width: 28.5vw;">
<el-text size="large" style="width:4vw;">付款时间</el-text>
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width:22vw;" @change="handleDatePickerChange" clearable
end-placeholder="结束时间" style="width:22vw;" @change="handleDatePickerChange" clearable
:disabled-date="disabledDate" :default-time="defaultTime" />
</div>
<div>
@ -105,11 +105,10 @@
<el-button @click="" class="smallTitle" size="small">退款申请信息</el-button>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款类型</el-text>
<el-input v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
<template #default="scope">
{{ scope.row.refundModel === 0 ? '全部退款' : '部分退款' }}
</template>
</el-input>
<el-select v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
<el-option label="全部退款" :value="0"></el-option>
<el-option label="部分退款" :value="1"></el-option>
</el-select>
</div>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款金额</el-text>
@ -130,7 +129,7 @@
</div>
<div class="center-item">
<el-text style="width:4vw;" size="small">所属地区</el-text>
<el-input v-model="auditRow.marketName" size="small" style="width:10vw;" disabled />
<el-input v-model="auditRow.market" size="small" style="width:10vw;" disabled />
</div>
<div class="center-item">
<el-text style="width:4vw;" size="small">产品名称</el-text>
@ -734,33 +733,33 @@ const productList = [
]
const getMarket = async function () {
try {
const result = await API({
url: '/market/selectMarket',
})
console.log('看看地区树', result)
const transformTree = (nodes) => {
const allChildren = nodes.flatMap(node => node.children || []);
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child])
: null;
try {
const result = await API({
return {
value: child.name,
label: child.name,
children: grandchildren
url: '/market/selectMarket',
})
console.log('看看地区树', result)
const transformTree = (nodes) => {
const allChildren = nodes.flatMap(node => node.children || []);
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child])
: null;
return {
value: child.name,
label: child.name,
children: grandchildren
};
});
};
});
};
market.value = transformTree(result.data)
console.log('转换后的地区树==============', market.value)
} catch (error) {
console.log('请求失败', error)
}
market.value = transformTree(result.data)
console.log('转换后的地区树==============', market.value)
} catch (error) {
console.log('请求失败', error)
}
}
const showStep = function (row) {
if (!hasMenuPermission(menuTree.value, permissionMapping.refundFinanceProgShow)) {
@ -771,27 +770,27 @@ const showStep = function (row) {
currentStep.value = 1;
if (row.status === 41) {
executor.value = row.executorName
console.log('执行人',executor.value)
console.log('执行人', executor.value)
currentStep.value = 6;
} else {
if (row.areaServise !== null && row.areaServise !== '') {
submitterName.value = row.areaServise
console.log('提交人',submitterName.value)
console.log('提交人', submitterName.value)
currentStep.value = 2;
}
if (row.areaFinance !== null && row.areaFinance !== '') {
areaFinance.value = row.areaFinance
console.log('地区财务',areaFinance.value)
console.log('地区财务', areaFinance.value)
currentStep.value = 3;
}
if (row.areaCharge !== null && row.areaCharge !== '') {
areaCharge.value = row.areaCharge
console.log('地区负责人',areaCharge.value)
console.log('地区负责人', areaCharge.value)
currentStep.value = 4;
}
if (row.headFinance !== null && row.headFinance !== '') {
headFinance.value = row.headFinance
console.log('总部财务',headFinance.value)
console.log('总部财务', headFinance.value)
currentStep.value = 5;
}
}
@ -816,12 +815,12 @@ const hideReject = function () {
addForm.value.remark = ''
}
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
]
const disabledDate = (time) => {
const limitDate = new Date(2025, 0, 1);
return time.getTime() < limitDate.getTime();
const limitDate = new Date(2025, 0, 1);
return time.getTime() < limitDate.getTime();
}
onMounted(() => {
console.log('???????????????????', adminData.value)
@ -870,7 +869,7 @@ onMounted(() => {
.top {
width: 30vw;
height: 17vh;
height: 19vh;
.top-item {
display: flex;

12
src/views/moneyManage/refundDetail/refundHeader.vue

@ -104,18 +104,20 @@
<el-button @click="" class="smallTitle" size="small">退款申请信息</el-button>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款类型</el-text>
<el-input v-model="auditRow.refundModel" placeholder="请输入退款类型" size="small" style="width:10vw;"
clearable></el-input>
<el-select v-model="auditRow.refundModel" size="small" style="width:10vw;" disabled>
<el-option label="全部退款" :value="0"></el-option>
<el-option label="部分退款" :value="1"></el-option>
</el-select>
</div>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款金额</el-text>
<el-input v-model="auditRow.paymentAmount" placeholder="请输入退款金额" size="small" style="width:10vw;"
clearable></el-input>
clearable disabled></el-input>
</div>
<div class="top-item">
<el-text style="width:4vw;" size="small">退款备注</el-text>
<el-input v-model="auditRow.refundReason" placeholder="请输入退款备注" size="small" style="width:10vw;"
:rows="3" maxlength="100" show-word-limit type="textarea" />
:rows="3" maxlength="100" show-word-limit type="textarea" disabled />
</div>
</div>
<el-button @click="" class="smallTitle" size="small">原订单信息</el-button>
@ -843,7 +845,7 @@ onMounted(() => {
.top {
width: 30vw;
height: 17vh;
height: 19vh;
.top-item {
display: flex;

52
src/views/moneyManage/refundDetail/refundService.vue

@ -67,12 +67,16 @@
<el-table-column prop="paymentAmount" label="付款金额" width="120" />
<el-table-column prop="payType" label="支付方式" width="140" />
<el-table-column prop="payTime" label="付款时间" width="180" />
<el-table-column prop="voucher" label="转账凭证" width="120" show-overflow-tooltip>
<template #default="scope">
<img v-if="scope.row.voucher" :src="scope.row.voucher" style="width: 40px; height: 40px;" />
<span v-else>无转账凭证</span>
</template>
</el-table-column>
<el-table-column prop="voucher" label="转账凭证" width="110px">
<template #default="scope">
<div v-if="scope.row.voucher"
style="display: flex; justify-content: center; align-items: center; cursor: pointer;"
@click="previewImage(scope.row.voucher)">
<img :src="scope.row.voucher" alt="转账凭证" style="width: auto; height: 40px;">
</div>
<div v-else style="display: flex; justify-content: center; align-items: center; height: 40px;">无转账凭证</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="status" label="订单状态" width="120">
<template #default="scope">
@ -285,12 +289,12 @@ const getRefund = async function () {
payType: searchForm.value.payType,//
startTime: dateRange.value && dateRange.value[0] ? dayjs(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "",
endTime: dateRange.value && dateRange.value[1] ? dayjs(dateRange.value[1]).format('YYYY-MM-DD HH:mm:ss') : "",
submitterId: isKF ? adminData.value.id : null
submitterId: adminData.value.id
}
}
const result = await API({
url: '/Money/select',
url: '/Money/selecta',
method: 'POST',
data: params
})
@ -390,6 +394,38 @@ const getMarket = async function () {
console.log('请求失败', error)
}
}
//
const previewImage = (imageUrl) => {
// 使 element-plus el-image
const imageElement = document.createElement('img');
imageElement.src = imageUrl;
imageElement.style.maxWidth = '80vw';
imageElement.style.maxHeight = '80vh';
const viewer = document.createElement('div');
viewer.style.position = 'fixed';
viewer.style.top = '0';
viewer.style.left = '0';
viewer.style.width = '100vw';
viewer.style.height = '100vh';
viewer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
viewer.style.display = 'flex';
viewer.style.justifyContent = 'center';
viewer.style.alignItems = 'center';
viewer.style.zIndex = '9999';
viewer.style.overflow = 'auto';
viewer.appendChild(imageElement);
document.body.appendChild(viewer);
viewer.addEventListener('click', () => {
document.body.removeChild(viewer);
});
};
const currencies = ref([
{
value: '新币',

Loading…
Cancel
Save