初始化项目 #1
4
pc/.env.development
Normal file
4
pc/.env.development
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
NODE_ENV = 'development'
|
||||||
|
|
||||||
|
# 开发环境API地址
|
||||||
|
VUE_APP_BASE_API = http://192.168.137.3:8080/api
|
4
pc/.env.production
Normal file
4
pc/.env.production
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
NODE_ENV = 'production'
|
||||||
|
|
||||||
|
# 生产环境API地址
|
||||||
|
VUE_APP_BASE_API = http://192.168.137.3:8080/api
|
@ -1,10 +1,11 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询标签模板列表
|
// 查询资产标签列表
|
||||||
export function listLabelTemplates() {
|
export function listLabelTemplates(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/asset/label/template/list',
|
url: '/asset/label/list',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,19 +17,19 @@ export function getLabelTemplate(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加标签模板
|
// 新增资产标签
|
||||||
export function addLabelTemplate(data) {
|
export function addLabelTemplate(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/asset/label/template',
|
url: '/asset/label',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新标签模板
|
// 修改资产标签
|
||||||
export function updateLabelTemplate(data) {
|
export function updateLabelTemplate(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/asset/label/template',
|
url: '/asset/label/' + id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -52,10 +53,42 @@ export function setDefaultTemplate(id) {
|
|||||||
|
|
||||||
// 获取可用的标签字段
|
// 获取可用的标签字段
|
||||||
export function getLabelFields() {
|
export function getLabelFields() {
|
||||||
return request({
|
const fieldData = [
|
||||||
url: '/asset/label/fields',
|
{ id: 1, name: '资产名称' },
|
||||||
method: 'get'
|
{ id: 2, name: '资产分类' },
|
||||||
})
|
{ id: 3, name: '资产编码' },
|
||||||
|
{ id: 4, name: '资产位置' },
|
||||||
|
{ id: 5, name: '品牌' },
|
||||||
|
{ id: 6, name: '型号' },
|
||||||
|
{ id: 7, name: '设备序列号' },
|
||||||
|
{ id: 8, name: '管理员' },
|
||||||
|
{ id: 9, name: '保养到期时间' },
|
||||||
|
{ id: 10, name: '保养说明' },
|
||||||
|
{ id: 11, name: '使用部门' }
|
||||||
|
];
|
||||||
|
|
||||||
|
return Promise.resolve({
|
||||||
|
code: '000000',
|
||||||
|
msg: 'success',
|
||||||
|
data: fieldData
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字段对应的示例值
|
||||||
|
export function getFieldSampleValues() {
|
||||||
|
return {
|
||||||
|
'1': 'ThinkPad笔记本',
|
||||||
|
'2': '电脑/笔记本电脑',
|
||||||
|
'3': 'ASSET-001',
|
||||||
|
'4': '研发部-A区',
|
||||||
|
'5': 'Lenovo',
|
||||||
|
'6': 'X1 Carbon',
|
||||||
|
'7': 'SN12345678',
|
||||||
|
'8': '张三',
|
||||||
|
'9': '2024-12-31',
|
||||||
|
'10': '每季度保养一次',
|
||||||
|
'11': '研发部'
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印标签预览
|
// 打印标签预览
|
||||||
|
@ -84,9 +84,8 @@ export function getBuildingStatistics(id) {
|
|||||||
// 查询楼层列表
|
// 查询楼层列表
|
||||||
export function getFloorList(query) {
|
export function getFloorList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/room/floor/list',
|
url: `/room/floor/list/${query}`,
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params: query
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
pc/src/assets/images/tag_01.png
Normal file
BIN
pc/src/assets/images/tag_01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
pc/src/assets/images/tag_02.png
Normal file
BIN
pc/src/assets/images/tag_02.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
pc/src/assets/images/tag_03.png
Normal file
BIN
pc/src/assets/images/tag_03.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
pc/src/assets/images/tag_04.png
Normal file
BIN
pc/src/assets/images/tag_04.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -4,7 +4,7 @@ import { Message } from 'element-ui'
|
|||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
// baseURL: '/api', // 修改为相对路径,使用代理
|
// baseURL: '/api', // 修改为相对路径,使用代理
|
||||||
baseURL: 'http://192.168.137.3:8080/api', // 接口地址
|
baseURL: process.env.VUE_APP_BASE_API, // 使用环境变量中的接口地址
|
||||||
|
|
||||||
timeout: 10000 // 请求超时时间
|
timeout: 10000 // 请求超时时间
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" v-loading="loading">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>资产标签设置</span>
|
<span>资产标签设置</span>
|
||||||
</div>
|
</div>
|
||||||
@ -14,8 +14,9 @@
|
|||||||
:class="['template-item', selectedTemplateIndex === index ? 'selected' : '']"
|
:class="['template-item', selectedTemplateIndex === index ? 'selected' : '']"
|
||||||
@click="selectTemplate(index)">
|
@click="selectTemplate(index)">
|
||||||
<div class="template-preview">
|
<div class="template-preview">
|
||||||
<div class="qr-preview"></div>
|
<div class="qr-preview">
|
||||||
<div v-if="index <= 1" class="logo-indicator">支持Logo</div>
|
<img :src="template.img" alt="模板预览" class="qr-image">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="template-name">模板{{ index + 1 }}</div>
|
<div class="template-name">模板{{ index + 1 }}</div>
|
||||||
<div class="template-limit">{{ getTemplateLimitText(index) }}</div>
|
<div class="template-limit">{{ getTemplateLimitText(index) }}</div>
|
||||||
@ -31,7 +32,7 @@
|
|||||||
<div class="qr-code-container">
|
<div class="qr-code-container">
|
||||||
<img src="@/assets/images/qrcode.svg" alt="QR Code" class="qr-image" />
|
<img src="@/assets/images/qrcode.svg" alt="QR Code" class="qr-image" />
|
||||||
<div class="asset-info">
|
<div class="asset-info">
|
||||||
<div class="asset-icon" v-if="selectedTemplateIndex <= 1"><i class="el-icon-coin"></i> 资产</div>
|
<!-- <div class="asset-icon"><i class="el-icon-coin"></i> 资产</div> -->
|
||||||
<div class="label-fields">
|
<div class="label-fields">
|
||||||
<div v-for="(field, index) in selectedTemplateFields" :key="index" class="label-field-item">
|
<div v-for="(field, index) in selectedTemplateFields" :key="index" class="label-field-item">
|
||||||
<span class="field-name">{{ field.name }}{{ index === 1 ? field.name.length > 2 ? '' : ' ' : ''
|
<span class="field-name">{{ field.name }}{{ index === 1 ? field.name.length > 2 ? '' : ' ' : ''
|
||||||
@ -42,8 +43,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="label-footer">预览效果:模板{{ selectedTemplateIndex + 1 }}</div>
|
<div class="label-footer">预览效果:模板{{ selectedTemplateIndex + 1 }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -66,21 +65,8 @@
|
|||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section-title" v-if="selectedTemplateIndex <= 1">设置Logo</div>
|
|
||||||
|
|
||||||
<!-- Logo上传组件,仅模板1和2显示 -->
|
<!-- <div class="section-title">打印设置</div>
|
||||||
<div v-if="selectedTemplateIndex <= 1" class="setting-group logo-upload-group">
|
|
||||||
<div class="setting-content">
|
|
||||||
<el-upload class="logo-uploader" action="" :http-request="handleLogoUpload" :show-file-list="false"
|
|
||||||
:before-upload="beforeLogoUpload">
|
|
||||||
<img v-if="logoUrl" :src="logoUrl" class="logo-image">
|
|
||||||
<i v-else class="el-icon-plus logo-uploader-icon"></i>
|
|
||||||
</el-upload>
|
|
||||||
<div class="upload-tip">建议上传尺寸为720*280像素且不大于2M的jpg或png图片</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="section-title">打印设置</div>
|
|
||||||
|
|
||||||
<div class="settings-section">
|
<div class="settings-section">
|
||||||
<div class="setting-group">
|
<div class="setting-group">
|
||||||
@ -106,14 +92,11 @@
|
|||||||
<el-input v-model="labelHeight" type="number" placeholder="请输入高度"></el-input>
|
<el-input v-model="labelHeight" type="number" placeholder="请输入高度"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
<el-button type="primary" @click="saveTemplate">保存</el-button>
|
<el-button type="primary" @click="saveTemplate">保存</el-button>
|
||||||
|
<el-button @click="resetTemplate">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -123,8 +106,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
listLabelTemplates, getLabelTemplate, addLabelTemplate, updateLabelTemplate,
|
listLabelTemplates, addLabelTemplate, updateLabelTemplate,
|
||||||
deleteLabelTemplate, setDefaultTemplate, getLabelFields, previewLabel
|
getLabelFields, getFieldSampleValues
|
||||||
} from '@/api/asset/label'
|
} from '@/api/asset/label'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -133,83 +116,115 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// 模板列表
|
// 模板列表
|
||||||
templates: [
|
templates: [
|
||||||
{ id: 1, name: '模板1', default: true, maxFields: 1, supportLogo: true },
|
{ id: 1, name: '模板1', maxFields: 1, img: require('@/assets/images/tag_01.png') },
|
||||||
{ id: 2, name: '模板2', default: false, maxFields: 2, supportLogo: true },
|
{ id: 2, name: '模板2', maxFields: 2, img: require('@/assets/images/tag_02.png') },
|
||||||
{ id: 3, name: '模板3', default: false, maxFields: 3, supportLogo: false },
|
{ id: 3, name: '模板3', maxFields: 3, img: require('@/assets/images/tag_03.png') },
|
||||||
{ id: 4, name: '模板4', default: false, maxFields: 4, supportLogo: false }
|
{ id: 4, name: '模板4', maxFields: 4, img: require('@/assets/images/tag_04.png') }
|
||||||
],
|
],
|
||||||
// 当前选中的模板索引
|
// 当前选中的模板索引
|
||||||
selectedTemplateIndex: 0,
|
selectedTemplateIndex: 0,
|
||||||
// 可用的字段列表
|
// 可用的字段列表
|
||||||
availableFields: [
|
availableFields: [],
|
||||||
{ id: 'assetNo', name: '资产编号' },
|
|
||||||
{ id: 'deviceNo', name: '设备序列号' },
|
|
||||||
{ id: 'assetName', name: '资产名称' },
|
|
||||||
{ id: 'brand', name: '品牌' },
|
|
||||||
{ id: 'model', name: '规格型号' },
|
|
||||||
{ id: 'manager', name: '管理员' },
|
|
||||||
{ id: 'location', name: '位置' },
|
|
||||||
{ id: 'purchaseTime', name: '购买时间' }
|
|
||||||
],
|
|
||||||
// 当前选中的字段
|
// 当前选中的字段
|
||||||
selectedFields: ['assetNo'],
|
selectedFields: [],
|
||||||
// 当前模板中的字段及预览值
|
// 当前模板中的字段及预览值
|
||||||
selectedTemplateFields: [
|
selectedTemplateFields: [],
|
||||||
{ id: 'assetNo', name: '资产编号', value: 'ASSET-001' }
|
|
||||||
],
|
|
||||||
// 标签设置
|
// 标签设置
|
||||||
paperType: 1,
|
paperType: 3,
|
||||||
labelWidth: 80,
|
labelWidth: 50,
|
||||||
labelHeight: 40,
|
labelHeight: 30,
|
||||||
// Logo URL
|
|
||||||
logoUrl: '',
|
|
||||||
// 字段数量超出标志
|
// 字段数量超出标志
|
||||||
isFieldsLimitExceeded: false,
|
isFieldsLimitExceeded: false,
|
||||||
// 加载状态
|
// 加载状态
|
||||||
loading: false
|
loading: false,
|
||||||
|
// 资产标签记录ID
|
||||||
|
labelId: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getTemplateList()
|
// 先获取可用字段选项,再获取标签设置
|
||||||
this.getFieldOptions()
|
this.getFieldOptions().then(() => {
|
||||||
|
this.getLabelSettings();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取模板列表
|
// 获取标签设置
|
||||||
async getTemplateList() {
|
async getLabelSettings() {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true;
|
||||||
// 实际应用中应从API获取
|
const res = await listLabelTemplates();
|
||||||
// const res = await listLabelTemplates()
|
if (res.code === '000000') {
|
||||||
// this.templates = res.data || []
|
if (res.data) {
|
||||||
this.loading = false
|
const labelData = res.data;
|
||||||
|
this.labelId = labelData.id;
|
||||||
|
|
||||||
|
// 设置模板类型
|
||||||
|
const templateType = parseInt(labelData.templateType || '1');
|
||||||
|
this.selectedTemplateIndex = templateType - 1;
|
||||||
|
|
||||||
|
// 设置选中的字段
|
||||||
|
if (labelData.labelItems) {
|
||||||
|
this.selectedFields = labelData.labelItems.split(',').map(item => parseInt(item.trim()));
|
||||||
|
} else {
|
||||||
|
this.selectedFields = [1]; // 默认选择资产名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置纸张类型和尺寸
|
||||||
|
this.paperType = parseInt(labelData.paperType || '3');
|
||||||
|
if (this.paperType === 1) {
|
||||||
|
this.labelWidth = parseInt(labelData.labelWidth || '50');
|
||||||
|
this.labelHeight = parseInt(labelData.labelHeight || '30');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateTemplateFields();
|
||||||
|
|
||||||
|
console.log("从接口获取的数据: ", {
|
||||||
|
id: this.labelId,
|
||||||
|
templateType,
|
||||||
|
selectedFields: this.selectedFields,
|
||||||
|
paperType: this.paperType,
|
||||||
|
labelWidth: this.labelWidth,
|
||||||
|
labelHeight: this.labelHeight
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 如果没有记录,使用默认设置
|
||||||
|
this.selectTemplate(0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || '获取标签设置失败');
|
||||||
|
// 使用默认设置
|
||||||
|
this.selectTemplate(0);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取模板列表失败', error)
|
console.error('获取标签设置失败', error);
|
||||||
this.loading = false
|
this.loading = false;
|
||||||
|
this.$message.error('获取标签设置失败');
|
||||||
|
// 使用默认设置
|
||||||
|
this.selectTemplate(0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取可用字段选项
|
// 获取可用字段选项
|
||||||
async getFieldOptions() {
|
async getFieldOptions() {
|
||||||
try {
|
try {
|
||||||
// 实际应用中应从API获取
|
const res = await getLabelFields();
|
||||||
// const res = await getLabelFields()
|
if (res.code === '000000') {
|
||||||
// this.availableFields = res.data || []
|
this.availableFields = res.data || [];
|
||||||
|
console.log("获取到的字段选项: ", this.availableFields);
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || '获取字段选项失败');
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取字段选项失败', error)
|
console.error('获取字段选项失败', error);
|
||||||
|
this.$message.error('获取字段选项失败');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取模板限制文字说明
|
// 获取模板限制文字说明
|
||||||
getTemplateLimitText(index) {
|
getTemplateLimitText(index) {
|
||||||
if (index === 0) {
|
const maxFields = this.templates[index].maxFields;
|
||||||
return '支持1个字段';
|
return maxFields === 1 ? '支持1个字段' : `支持最多${maxFields}个字段`;
|
||||||
} else if (index === 1) {
|
|
||||||
return '支持最多2个字段';
|
|
||||||
} else if (index === 2) {
|
|
||||||
return '支持最多3个字段';
|
|
||||||
} else {
|
|
||||||
return '支持最多4个字段';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取当前模板最大字段数
|
// 获取当前模板最大字段数
|
||||||
@ -219,50 +234,48 @@ export default {
|
|||||||
|
|
||||||
// 选择模板
|
// 选择模板
|
||||||
selectTemplate(index) {
|
selectTemplate(index) {
|
||||||
this.selectedTemplateIndex = index
|
this.selectedTemplateIndex = index;
|
||||||
|
|
||||||
// 清空logo(如果切换到不支持logo的模板)
|
// 根据模板类型限制字段数
|
||||||
if (index > 1) {
|
const maxFields = this.templates[index].maxFields;
|
||||||
this.logoUrl = '';
|
if (this.selectedFields.length > maxFields) {
|
||||||
|
this.selectedFields = this.selectedFields.slice(0, maxFields);
|
||||||
|
} else if (this.selectedFields.length === 0) {
|
||||||
|
// 如果没有选择字段,默认选择第一个
|
||||||
|
this.selectedFields = [1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模拟选择模板
|
// 默认纸张类型和尺寸
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
this.selectedFields = this.selectedFields.slice(0, 1); // 限制为1个字段
|
|
||||||
this.paperType = 1;
|
this.paperType = 1;
|
||||||
this.labelWidth = 80;
|
this.labelWidth = 50;
|
||||||
this.labelHeight = 40;
|
|
||||||
} else if (index === 1) {
|
|
||||||
this.selectedFields = this.selectedFields.slice(0, 2); // 限制为2个字段
|
|
||||||
this.paperType = 2;
|
|
||||||
this.labelWidth = 100;
|
|
||||||
this.labelHeight = 50;
|
|
||||||
} else if (index === 2) {
|
|
||||||
this.selectedFields = this.selectedFields.slice(0, 3); // 限制为3个字段
|
|
||||||
this.paperType = 2;
|
|
||||||
this.labelWidth = 90;
|
|
||||||
this.labelHeight = 60;
|
|
||||||
} else {
|
|
||||||
this.selectedFields = this.selectedFields.slice(0, 4); // 限制为4个字段
|
|
||||||
this.paperType = 3;
|
|
||||||
this.labelWidth = 70;
|
|
||||||
this.labelHeight = 30;
|
this.labelHeight = 30;
|
||||||
|
} else if (index === 1) {
|
||||||
|
this.paperType = 1;
|
||||||
|
this.labelWidth = 60;
|
||||||
|
this.labelHeight = 40;
|
||||||
|
} else if (index === 2) {
|
||||||
|
this.paperType = 2;
|
||||||
|
} else {
|
||||||
|
this.paperType = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateTemplateFields()
|
this.updateTemplateFields();
|
||||||
this.checkFieldsLimit()
|
this.checkFieldsLimit();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 更新模板字段
|
// 更新模板字段
|
||||||
updateTemplateFields() {
|
updateTemplateFields() {
|
||||||
|
const sampleValues = getFieldSampleValues();
|
||||||
|
|
||||||
this.selectedTemplateFields = this.selectedFields.map(fieldId => {
|
this.selectedTemplateFields = this.selectedFields.map(fieldId => {
|
||||||
const field = this.availableFields.find(f => f.id === fieldId)
|
const field = this.availableFields.find(f => f.id === fieldId);
|
||||||
return {
|
return {
|
||||||
id: fieldId,
|
id: fieldId,
|
||||||
name: field ? field.name : '',
|
name: field ? field.name : '',
|
||||||
value: this.getFieldSampleValue(fieldId)
|
value: sampleValues[fieldId] || 'XXXXXXXXXX'
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 检查字段数量限制
|
// 检查字段数量限制
|
||||||
@ -282,33 +295,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取字段示例值
|
|
||||||
getFieldSampleValue(fieldId) {
|
|
||||||
const sampleValues = {
|
|
||||||
'assetNo': 'ASSET-001',
|
|
||||||
'deviceNo': 'SN12345678',
|
|
||||||
'assetName': '办公电脑',
|
|
||||||
'brand': 'Dell',
|
|
||||||
'model': 'Latitude 7400',
|
|
||||||
'manager': '张三',
|
|
||||||
'location': '研发部-A区',
|
|
||||||
'purchaseTime': '2023-01-15'
|
|
||||||
}
|
|
||||||
return sampleValues[fieldId] || ''
|
|
||||||
},
|
|
||||||
|
|
||||||
// 纸张类型变更
|
// 纸张类型变更
|
||||||
handlePaperTypeChange(type) {
|
handlePaperTypeChange(type) {
|
||||||
// 根据纸张类型设置默认尺寸
|
// 根据纸张类型设置默认尺寸
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
this.labelWidth = 80
|
this.labelWidth = 50;
|
||||||
this.labelHeight = 40
|
this.labelHeight = 30;
|
||||||
} else if (type === 2) {
|
|
||||||
this.labelWidth = 100
|
|
||||||
this.labelHeight = 50
|
|
||||||
} else if (type === 3) {
|
|
||||||
this.labelWidth = 70
|
|
||||||
this.labelHeight = 30
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -318,36 +310,6 @@ export default {
|
|||||||
this.updateTemplateFields();
|
this.updateTemplateFields();
|
||||||
},
|
},
|
||||||
|
|
||||||
// Logo上传前校验
|
|
||||||
beforeLogoUpload(file) {
|
|
||||||
const isImageType = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
||||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
|
||||||
|
|
||||||
if (!isImageType) {
|
|
||||||
this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isLt2M) {
|
|
||||||
this.$message.error('上传图片大小不能超过 2MB!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 处理Logo上传
|
|
||||||
handleLogoUpload(options) {
|
|
||||||
const file = options.file;
|
|
||||||
// 实际使用时应该调用上传API
|
|
||||||
// 这里使用FileReader模拟文件上传
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
reader.onload = () => {
|
|
||||||
this.logoUrl = reader.result;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
// 保存模板
|
// 保存模板
|
||||||
saveTemplate() {
|
saveTemplate() {
|
||||||
if (this.isFieldsLimitExceeded) {
|
if (this.isFieldsLimitExceeded) {
|
||||||
@ -355,66 +317,49 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const templateData = {
|
if (this.selectedFields.length === 0) {
|
||||||
id: this.templates[this.selectedTemplateIndex].id,
|
this.$message.error('请至少选择一个标签字段');
|
||||||
name: this.templates[this.selectedTemplateIndex].name,
|
return;
|
||||||
paperType: this.paperType,
|
|
||||||
width: this.labelWidth,
|
|
||||||
height: this.labelHeight,
|
|
||||||
fields: this.selectedFields,
|
|
||||||
logoUrl: this.logoUrl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 实际应用中应该调用API保存
|
if (this.paperType === 1 && (!this.labelWidth || !this.labelHeight)) {
|
||||||
// if (templateData.id) {
|
this.$message.error('使用标签专用纸时,请输入标签宽度和高度');
|
||||||
// updateLabelTemplate(templateData).then(res => {
|
return;
|
||||||
// if (res.code === '000000') {
|
}
|
||||||
// this.$message.success('模板保存成功')
|
|
||||||
// } else {
|
|
||||||
// this.$message.error(res.msg || '保存失败')
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// addLabelTemplate(templateData).then(res => {
|
|
||||||
// if (res.code === '000000') {
|
|
||||||
// this.$message.success('模板创建成功')
|
|
||||||
// } else {
|
|
||||||
// this.$message.error(res.msg || '创建失败')
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.$message.success('模板保存成功')
|
const templateData = {
|
||||||
|
templateType: String(this.selectedTemplateIndex + 1),
|
||||||
|
labelItems: this.selectedFields.join(','),
|
||||||
|
paperType: String(this.paperType),
|
||||||
|
labelWidth: this.paperType === 1 ? String(this.labelWidth) : '',
|
||||||
|
labelHeight: this.paperType === 1 ? String(this.labelHeight) : ''
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('保存的数据: ', templateData);
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
const savePromise = addLabelTemplate(templateData);
|
||||||
|
|
||||||
|
savePromise.then(res => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.code === '000000') {
|
||||||
|
this.$message.success('标签设置保存成功');
|
||||||
|
// 重新获取标签设置
|
||||||
|
this.getLabelSettings();
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || '保存失败');
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
console.error('保存标签设置失败', error);
|
||||||
|
this.$message.error('保存标签设置失败');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重置模板
|
// 重置模板
|
||||||
resetTemplate() {
|
resetTemplate() {
|
||||||
this.selectTemplate(this.selectedTemplateIndex)
|
this.getLabelSettings();
|
||||||
this.logoUrl = ''
|
this.$message.info('已重置为原始设置');
|
||||||
this.$message.info('已重置为原始设置')
|
|
||||||
},
|
|
||||||
|
|
||||||
// 打印标签
|
|
||||||
printLabel() {
|
|
||||||
if (this.isFieldsLimitExceeded) {
|
|
||||||
this.$message.error(`字段数量超出限制,当前模板最多支持${this.getMaxFieldsCount()}个字段`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$message.success('打印请求已发送')
|
|
||||||
// 实际应用中应该调用打印API
|
|
||||||
// const printData = {
|
|
||||||
// templateId: this.templates[this.selectedTemplateIndex].id,
|
|
||||||
// assetIds: [], // 这里需要选择具体的资产ID
|
|
||||||
// logoUrl: this.logoUrl
|
|
||||||
// }
|
|
||||||
// printLabel(printData).then(res => {
|
|
||||||
// if (res.code === '000000') {
|
|
||||||
// this.$message.success('打印任务已提交')
|
|
||||||
// } else {
|
|
||||||
// this.$message.error(res.msg || '打印失败')
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -470,60 +415,12 @@ export default {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.qr-preview {
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:before,
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background-color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
top: 8px;
|
|
||||||
left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
top: 8px;
|
|
||||||
right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
bottom: 8px;
|
|
||||||
left: 8px;
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background-color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-indicator {
|
|
||||||
position: absolute;
|
|
||||||
bottom: -5px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
background-color: #409EFF;
|
|
||||||
color: white;
|
|
||||||
font-size: 10px;
|
|
||||||
padding: 1px 6px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.template-name {
|
.template-name {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #606266;
|
font-weight: 500;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.template-limit {
|
.template-limit {
|
||||||
@ -621,9 +518,38 @@ export default {
|
|||||||
|
|
||||||
.edit-area {
|
.edit-area {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
border-left: 1px solid #ebeef5;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fields-section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.limit-warning {
|
||||||
|
color: #E6A23C;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-selection {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
::v-deep .el-checkbox {
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.settings-section {
|
.settings-section {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
@ -632,87 +558,65 @@ export default {
|
|||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
|
||||||
|
|
||||||
.setting-label {
|
.setting-label {
|
||||||
width: 110px;
|
width: 120px;
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
color: #606266;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-content {
|
.setting-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.logo-upload-group {
|
.logo-upload-group {
|
||||||
align-items: flex-start;
|
|
||||||
|
|
||||||
.logo-uploader {
|
.logo-uploader {
|
||||||
.el-upload {
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
border: 1px dashed #d9d9d9;
|
border: 1px dashed #d9d9d9;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border-color: #409EFF;
|
border-color: #409EFF;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.logo-uploader-icon {
|
.logo-uploader-icon {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: #8c939d;
|
color: #8c939d;
|
||||||
width: 120px;
|
|
||||||
height: 60px;
|
|
||||||
line-height: 60px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-image {
|
.logo-image {
|
||||||
width: 120px;
|
width: 100%;
|
||||||
height: 60px;
|
height: 100%;
|
||||||
display: block;
|
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-tip {
|
.upload-tip {
|
||||||
margin-top: 8px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
line-height: 1.4;
|
line-height: 1.5;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.fields-section {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
.limit-warning {
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #E6A23C;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
|
|
||||||
i {
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-selection {
|
|
||||||
margin-top: 10px;
|
|
||||||
|
|
||||||
.el-checkbox-group {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-gap: 10px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
display: flex;
|
text-align: center;
|
||||||
justify-content: end;
|
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
.qr-preview{
|
||||||
|
width: 120px;
|
||||||
|
object-fit: contain;
|
||||||
|
&>img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -133,9 +133,9 @@
|
|||||||
:min-width="col.width"
|
:min-width="col.width"
|
||||||
align="center"
|
align="center"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="250" fixed="right">
|
<el-table-column label="操作" width="200" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
|
<!-- <el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button> -->
|
||||||
<el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
<el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
|
||||||
<el-button size="mini" type="text" @click="handleFloorManage(scope.row)">楼层管理</el-button>
|
<el-button size="mini" type="text" @click="handleFloorManage(scope.row)">楼层管理</el-button>
|
||||||
<el-button size="mini" type="text" style="color: #F56C6C" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button size="mini" type="text" style="color: #F56C6C" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
@ -178,7 +178,9 @@ export default {
|
|||||||
const unitMap = {
|
const unitMap = {
|
||||||
'1': '元/㎡/天',
|
'1': '元/㎡/天',
|
||||||
'2': '元/㎡/月',
|
'2': '元/㎡/月',
|
||||||
'3': '元/月'
|
'3': '元/月',
|
||||||
|
'4': '元/天',
|
||||||
|
'5': '元/年'
|
||||||
}
|
}
|
||||||
return unitMap[this.roomDetail.priceUnit] || ''
|
return unitMap[this.roomDetail.priceUnit] || ''
|
||||||
},
|
},
|
||||||
@ -186,7 +188,9 @@ export default {
|
|||||||
const unitMap = {
|
const unitMap = {
|
||||||
'1': '元/㎡/天',
|
'1': '元/㎡/天',
|
||||||
'2': '元/㎡/月',
|
'2': '元/㎡/月',
|
||||||
'3': '元/月'
|
'3': '元/月',
|
||||||
|
'4': '元/天',
|
||||||
|
'5': '元/年'
|
||||||
}
|
}
|
||||||
return unitMap[this.roomDetail.floorPriceUnit] || ''
|
return unitMap[this.roomDetail.floorPriceUnit] || ''
|
||||||
},
|
},
|
||||||
|
@ -7,17 +7,18 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="项目" prop="projectId">
|
<el-form-item label="项目" prop="projectId">
|
||||||
<el-select v-model="form.projectId" placeholder="请选择项目" style="width: 100%"
|
<el-select v-model="form.projectId" placeholder="请选择项目" style="width: 100%" :disabled="isEdit"
|
||||||
:disabled="isEdit" @change="handleProjectChange">
|
@change="handleProjectChange">
|
||||||
<el-option v-for="item in projectOptions" :key="item.id" :label="item.projectName" :value="item.id" />
|
<el-option v-for="item in projectOptions" :key="item.id" :label="item.projectName" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="楼宇" prop="buildingId">
|
<el-form-item label="楼宇" prop="buildingId">
|
||||||
<el-select v-model="form.buildingId" placeholder="请选择楼宇" style="width: 100%"
|
<el-select v-model="form.buildingId" placeholder="请选择楼宇" style="width: 100%" :disabled="isEdit"
|
||||||
:disabled="isEdit" @change="handleBuildingChange">
|
@change="handleBuildingChange">
|
||||||
<el-option v-for="item in buildingOptions" :key="item.id" :label="item.buildingName" :value="item.id" />
|
<el-option v-for="item in buildingOptions" :key="item.id" :label="item.buildingName"
|
||||||
|
:value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -117,7 +118,8 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="产权性质" prop="propertyNature">
|
<el-form-item label="产权性质" prop="propertyNature">
|
||||||
<el-select v-model="form.propertyNature" placeholder="请选择产权性质" style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.propertyNature" placeholder="请选择产权性质" style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="自持" value="1" />
|
<el-option label="自持" value="1" />
|
||||||
<el-option label="承租" value="2" />
|
<el-option label="承租" value="2" />
|
||||||
<el-option label="自持+承租" value="3" />
|
<el-option label="自持+承租" value="3" />
|
||||||
@ -126,7 +128,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="租赁状态" prop="rentalStatus">
|
<el-form-item label="租赁状态" prop="rentalStatus">
|
||||||
<el-select v-model="form.rentalStatus" placeholder="请选择租赁状态" style="width: 100%" disabled @change="handleInputChange">
|
<el-select v-model="form.rentalStatus" placeholder="请选择租赁状态" style="width: 100%" disabled
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="待租" value="1" />
|
<el-option label="待租" value="1" />
|
||||||
<el-option label="已租" value="2" />
|
<el-option label="已租" value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -134,7 +137,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="房源状态" prop="roomStatus">
|
<el-form-item label="房源状态" prop="roomStatus">
|
||||||
<el-select v-model="form.roomStatus" placeholder="请选择房源状态" style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.roomStatus" placeholder="请选择房源状态" style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="公开" value="1" />
|
<el-option label="公开" value="1" />
|
||||||
<el-option label="关闭" value="2" />
|
<el-option label="关闭" value="2" />
|
||||||
<el-option label="私密" value="3" />
|
<el-option label="私密" value="3" />
|
||||||
@ -143,7 +147,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="房源类型" prop="roomType">
|
<el-form-item label="房源类型" prop="roomType">
|
||||||
<el-select v-model="form.roomType" placeholder="请选择房源类型" style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.roomType" placeholder="请选择房源类型" style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="办公" value="1" />
|
<el-option label="办公" value="1" />
|
||||||
<el-option label="商业" value="2" />
|
<el-option label="商业" value="2" />
|
||||||
<el-option label="仓储" value="3" />
|
<el-option label="仓储" value="3" />
|
||||||
@ -167,21 +172,20 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
<el-form-item label="荷载值" prop="loadValue">
|
<el-row :gutter="20">
|
||||||
<el-input v-model="form.loadValue" placeholder="请输入荷载值" @input="handleInputChange" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="房源标签" prop="tagIds">
|
<el-form-item label="房源标签" prop="tagIds">
|
||||||
<el-select v-model="form.tagIds" placeholder="请选择房源标签" multiple style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.tagIds" placeholder="请选择房源标签" multiple style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option v-for="tag in tagOptions" :key="tag.id" :label="tag.tagName" :value="tag.id" />
|
<el-option v-for="tag in tagOptions" :key="tag.id" :label="tag.tagName" :value="tag.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="招商状态" prop="businessStatus">
|
<el-form-item label="招商状态" prop="businessStatus">
|
||||||
<el-select v-model="form.businessStatus" placeholder="请选择招商状态" style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.businessStatus" placeholder="请选择招商状态" style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="招商" value="1" />
|
<el-option label="招商" value="1" />
|
||||||
<el-option label="不招商" value="2" />
|
<el-option label="不招商" value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -189,12 +193,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="可租日期" prop="availableDate">
|
<el-form-item label="可租日期" prop="availableDate">
|
||||||
<el-date-picker v-model="form.availableDate" type="date" placeholder="请选择可租日期" style="width: 100%" @change="handleInputChange" />
|
<el-date-picker v-model="form.availableDate" type="date" placeholder="请选择可租日期" style="width: 100%"
|
||||||
|
@change="handleInputChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="装修情况" prop="decorationStatus">
|
<el-form-item label="装修情况" prop="decorationStatus">
|
||||||
<el-select v-model="form.decorationStatus" placeholder="请选择装修情况" style="width: 100%" @change="handleInputChange">
|
<el-select v-model="form.decorationStatus" placeholder="请选择装修情况" style="width: 100%"
|
||||||
|
@change="handleInputChange">
|
||||||
<el-option label="精装" value="1" />
|
<el-option label="精装" value="1" />
|
||||||
<el-option label="简装" value="2" />
|
<el-option label="简装" value="2" />
|
||||||
<el-option label="毛坯" value="3" />
|
<el-option label="毛坯" value="3" />
|
||||||
@ -206,16 +214,36 @@
|
|||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="报价" prop="price">
|
<el-form-item label="报价" prop="price">
|
||||||
<el-input v-model="form.price" placeholder="请输入报价" @input="handleInputChange" />
|
<el-input v-model="form.price" placeholder="请输入报价" @input="handleInputChange">
|
||||||
|
<el-select slot="append" v-model="form.priceUnit" style="width: 100px" @change="handleInputChange">
|
||||||
|
<el-option label="元/㎡/天" value="1" />
|
||||||
|
<el-option label="元/㎡/月" value="2" />
|
||||||
|
<el-option label="元/月" value="3" />
|
||||||
|
<el-option label="元/天" value="4" />
|
||||||
|
<el-option label="元/年" value="5" />
|
||||||
|
</el-select>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="底价" prop="floorPrice">
|
<el-form-item label="底价" prop="floorPrice">
|
||||||
<el-input v-model="form.floorPrice" placeholder="请输入底价" @input="handleInputChange" />
|
<el-input v-model="form.floorPrice" placeholder="请输入底价" @input="handleInputChange">
|
||||||
|
<el-select slot="append" v-model="form.floorPriceUnit" style="width: 100px" @change="handleInputChange">
|
||||||
|
<el-option label="元/㎡/天" value="1" />
|
||||||
|
<el-option label="元/㎡/月" value="2" />
|
||||||
|
<el-option label="元/月" value="3" />
|
||||||
|
<el-option label="元/天" value="4" />
|
||||||
|
<el-option label="元/年" value="5" />
|
||||||
|
</el-select>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="荷载值" prop="loadValue">
|
||||||
|
<el-input v-model="form.loadValue" placeholder="请输入荷载值" @input="handleInputChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="房源招商编号" prop="businessNumber">
|
<el-form-item label="房源招商编号" prop="businessNumber">
|
||||||
@ -231,14 +259,8 @@
|
|||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="房源图片" prop="imageUrls">
|
<el-form-item label="房源图片" prop="imageUrls">
|
||||||
<el-upload
|
<el-upload :action="uploadUrl" list-type="picture-card" :headers="uploadHeaders" :file-list="imageList"
|
||||||
:action="uploadUrl"
|
:on-preview="handlePictureCardPreview" :on-success="handleImageSuccess" :on-remove="handleImageRemove"
|
||||||
list-type="picture-card"
|
|
||||||
:headers="uploadHeaders"
|
|
||||||
:file-list="imageList"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:on-success="handleImageSuccess"
|
|
||||||
:on-remove="handleImageRemove"
|
|
||||||
multiple>
|
multiple>
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@ -281,30 +303,27 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工位数量下限" prop="workstationMin">
|
<el-form-item label="工位数量下限" prop="workstationMin">
|
||||||
<el-input-number v-model="form.workstationMin" :min="0" :controls="false" placeholder="请输入最少工位数量" @change="handleInputChange" />
|
<el-input-number v-model="form.workstationMin" :min="0" :controls="false" placeholder="请输入最少工位数量"
|
||||||
|
@change="handleInputChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工位数量上限" prop="workstationMax">
|
<el-form-item label="工位数量上限" prop="workstationMax">
|
||||||
<el-input-number v-model="form.workstationMax" :min="0" :controls="false" placeholder="请输入最多工位数量" @change="handleInputChange" />
|
<el-input-number v-model="form.workstationMax" :min="0" :controls="false" placeholder="请输入最多工位数量"
|
||||||
|
@change="handleInputChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-form-item label="户型图说明" prop="floorPlanDesc">
|
<el-form-item label="户型图说明" prop="floorPlanDesc">
|
||||||
<el-input v-model="form.floorPlanDesc" type="textarea" :rows="3" placeholder="请输入户型图说明" @input="handleInputChange" />
|
<el-input v-model="form.floorPlanDesc" type="textarea" :rows="3" placeholder="请输入户型图说明"
|
||||||
|
@input="handleInputChange" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="户型图" prop="floorPlanImageUrls">
|
<el-form-item label="户型图" prop="floorPlanImageUrls">
|
||||||
<el-upload
|
<el-upload :action="uploadUrl" list-type="picture-card" :headers="uploadHeaders"
|
||||||
:action="uploadUrl"
|
:file-list="floorPlanImageList" :on-preview="handlePictureCardPreview"
|
||||||
list-type="picture-card"
|
:on-success="handleFloorPlanImageSuccess" :on-remove="handleFloorPlanImageRemove" multiple>
|
||||||
:headers="uploadHeaders"
|
|
||||||
:file-list="floorPlanImageList"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:on-success="handleFloorPlanImageSuccess"
|
|
||||||
:on-remove="handleFloorPlanImageRemove"
|
|
||||||
multiple>
|
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
@ -325,7 +344,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getRoom, addRoom, updateRoom, listProjects, listBuildings, listFloors, listRoomTags, listOwners } from '@/api/room'
|
import { getRoom, addRoom, updateRoom, listProjects, listBuildings, listFloors, listRoomTags, listOwners } from '@/api/room'
|
||||||
import { getProjectList } from '@/api/project'
|
import { getProjectList } from '@/api/project'
|
||||||
import { getBuildingList,getFloorList } from '@/api/building'
|
import { getBuildingList, getFloorList,getFloorListByBuilding} from '@/api/building'
|
||||||
export default {
|
export default {
|
||||||
name: 'RoomForm',
|
name: 'RoomForm',
|
||||||
props: {
|
props: {
|
||||||
@ -365,7 +384,7 @@ export default {
|
|||||||
// 户型图列表
|
// 户型图列表
|
||||||
floorPlanImageList: [],
|
floorPlanImageList: [],
|
||||||
// 上传URL
|
// 上传URL
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + '/park/common/upload',
|
uploadUrl: process.env.VUE_APP_BASE_API + '/room/upload',
|
||||||
// 上传请求头
|
// 上传请求头
|
||||||
uploadHeaders: {},
|
uploadHeaders: {},
|
||||||
// 表单对象
|
// 表单对象
|
||||||
@ -628,9 +647,9 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
if (buildingId) {
|
if (buildingId) {
|
||||||
getFloorList(buildingId).then(response => {
|
getFloorListByBuilding(buildingId).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === '000000') {
|
||||||
this.floorOptions = response.data.list || []
|
this.floorOptions = response.data || []
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg || '获取楼层列表失败')
|
this.$message.error(response.msg || '获取楼层列表失败')
|
||||||
}
|
}
|
||||||
@ -819,6 +838,28 @@ export default {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .el-form-item__label {
|
||||||
|
width: 120px !important;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select .el-input.is-focus .el-input__inner {
|
||||||
|
border-color: #409EFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input-group__append {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.el-select {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select .el-input__inner {
|
||||||
|
border: none;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .el-upload-list--picture-card .el-upload-list__item {
|
::v-deep .el-upload-list--picture-card .el-upload-list__item {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
|
@ -97,10 +97,7 @@
|
|||||||
<el-table-column label="楼层" prop="floorName" min-width="80" />
|
<el-table-column label="楼层" prop="floorName" min-width="80" />
|
||||||
<el-table-column label="房号" prop="roomNumber" min-width="100" />
|
<el-table-column label="房号" prop="roomNumber" min-width="100" />
|
||||||
<el-table-column label="计租面积(㎡)" prop="rentalArea" min-width="110" />
|
<el-table-column label="计租面积(㎡)" prop="rentalArea" min-width="110" />
|
||||||
<el-table-column label="报价" min-width="120">
|
<el-table-column label="报价" align="center" prop="price" width="150">
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.price }} {{ scope.row.priceUnit === 1 ? '元/㎡/天' : scope.row.priceUnit === 2 ? '元/㎡/月' : '元/月' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="租赁状态" min-width="100">
|
<el-table-column label="租赁状态" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -163,7 +160,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- 导入对话框 -->
|
<!-- 导入对话框 -->
|
||||||
<el-dialog :title="importTitle" :visible.sync="importOpen" width="500px" append-to-body>
|
<el-dialog :title="importTitle" :visible.sync="importOpen" width="400px" append-to-body>
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="upload"
|
ref="upload"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
@ -194,7 +191,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 添加/修改房源对话框 -->
|
<!-- 添加/修改房源对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
|
||||||
<room-form
|
<room-form
|
||||||
v-if="open"
|
v-if="open"
|
||||||
ref="roomForm"
|
ref="roomForm"
|
||||||
@ -210,7 +207,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listRoom, exportRoom, downloadTemplate, importRoom, listRoomTags, listProjects, listBuildings, listFloors, delRoom } from '@/api/room'
|
import { listRoom, exportRoom, downloadTemplate, importRoom, listRoomTags, listProjects, listBuildings, listFloors, delRoom } from '@/api/room'
|
||||||
import { getProjectList } from '@/api/project'
|
import { getProjectList } from '@/api/project'
|
||||||
import { getBuildingList,getFloorList } from '@/api/building'
|
import { getBuildingList,getFloorList,getFloorListByBuilding } from '@/api/building'
|
||||||
|
|
||||||
import DetailView from './components/DetailView'
|
import DetailView from './components/DetailView'
|
||||||
import RoomForm from './components/RoomForm'
|
import RoomForm from './components/RoomForm'
|
||||||
@ -285,7 +282,7 @@ export default {
|
|||||||
// 设置上传的请求头部
|
// 设置上传的请求头部
|
||||||
headers: { },
|
headers: { },
|
||||||
// 上传的URL
|
// 上传的URL
|
||||||
url: process.env.VUE_APP_BASE_API + '/room/import'
|
url: process.env.VUE_APP_BASE_API + '/room/template/import'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -421,9 +418,9 @@ export default {
|
|||||||
this.floorOptions = []
|
this.floorOptions = []
|
||||||
|
|
||||||
if (buildingId) {
|
if (buildingId) {
|
||||||
getFloorList(buildingId).then(response => {
|
getFloorListByBuilding(buildingId).then(response => {
|
||||||
if (response.code === '000000') {
|
if (response.code === '000000') {
|
||||||
this.floorOptions = response.data.list || []
|
this.floorOptions = response.data || []
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg || '获取楼层列表失败')
|
this.$message.error(response.msg || '获取楼层列表失败')
|
||||||
}
|
}
|
||||||
@ -522,10 +519,10 @@ export default {
|
|||||||
this.$refs.upload.clearFiles()
|
this.$refs.upload.clearFiles()
|
||||||
this.importOpen = false
|
this.importOpen = false
|
||||||
if (response.code === '000000') {
|
if (response.code === '000000') {
|
||||||
this.$alert('导入成功' + (response.data ? response.data.successCount || 0 : 0) + '条数据', '导入结果', { type: 'success' })
|
this.$alert(`response.data.message `, { type: 'success' })
|
||||||
this.getList()
|
this.getList()
|
||||||
} else {
|
} else {
|
||||||
this.$alert(response.msg || '导入失败', '导入结果', { type: 'error' })
|
this.$alert(response.msg || '导入失败,正在下载错误文件', '导入结果', { type: 'error' })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -586,6 +583,19 @@ export default {
|
|||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.queryParams.pageNum = val
|
this.queryParams.pageNum = val
|
||||||
this.getList()
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 获取价格单位文本 */
|
||||||
|
getPriceUnitText(unitType) {
|
||||||
|
if (!unitType) return '';
|
||||||
|
const unitMap = {
|
||||||
|
'1': '元/㎡/天',
|
||||||
|
'2': '元/㎡/月',
|
||||||
|
'3': '元/月',
|
||||||
|
'4': '元/天',
|
||||||
|
'5': '元/年'
|
||||||
|
};
|
||||||
|
return unitMap[unitType] || '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
pc/web (2).zip
Normal file
BIN
pc/web (2).zip
Normal file
Binary file not shown.
BIN
pc/web.zip
Normal file
BIN
pc/web.zip
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user