This commit is contained in:
PQZ 2024-08-16 08:28:37 +08:00
commit 8e9a66cd2b
21 changed files with 795 additions and 512 deletions

View File

@ -42,6 +42,15 @@ export function getPropertyPosPage(params) {
params params
}) })
} }
// 获得企业管理-资产存放位置列表
export function getPropertyPosList() {
return request({
url: '/company/property-pos/list',
method: 'get'
})
}
// 导出企业管理-资产存放位置 Excel // 导出企业管理-资产存放位置 Excel
export function exportPropertyPosExcel(params) { export function exportPropertyPosExcel(params) {
return request({ return request({

View File

@ -84,3 +84,11 @@ export function resetPassword(data){
data data
}) })
} }
// 获取角色列表
export function getRoleList(){
return request({
url: '/company/staff/roleList',
method: 'get'
})
}

View File

@ -136,7 +136,10 @@ export const DICT_TYPE = {
COMPANY_PROP_STATUS: 'company_prop_status', COMPANY_PROP_STATUS: 'company_prop_status',
//存放类型 //存放类型
COMPANY_DEPOSIT_TYPE: 'company_deposit_type', COMPANY_DEPOSIT_TYPE: 'company_deposit_type',
//时间周期字典
CYCLE_DICT : 'cycle_dict',
//资产分类
COMPANY_PROPERTY_CATG: 'company_property_catg',
COMPANY_COST_TYPE: 'company_cost_type', COMPANY_COST_TYPE: 'company_cost_type',
} }

View File

@ -22,14 +22,14 @@
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
推广人姓名 推广人姓名
</template> </template>
{{ formData.newUserName }} {{ formData.newUserName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-mobile-phone"></i> <i class="el-icon-mobile-phone"></i>
推广人电话 推广人电话
</template> </template>
{{ formData.newUser.mobile }} {{ formData.newUser.mobile }}
</el-descriptions-item> </el-descriptions-item>

View File

@ -42,7 +42,7 @@
<script> <script>
import * as PropertyPosApi from '@/api/base/property/position'; import * as PropertyPosApi from '@/api/company/property/position';
export default { export default {
name: "PropertyPosForm", name: "PropertyPosForm",
components: { components: {
@ -58,8 +58,6 @@ export default {
// //
formData: { formData: {
id: undefined, id: undefined,
corpId: undefined,
deptId: undefined,
posName: undefined, posName: undefined,
address: undefined, address: undefined,
area: undefined, area: undefined,
@ -120,8 +118,6 @@ export default {
reset() { reset() {
this.formData = { this.formData = {
id: undefined, id: undefined,
corpId: undefined,
deptId: undefined,
posName: undefined, posName: undefined,
address: undefined, address: undefined,
area: undefined, area: undefined,

View File

@ -39,7 +39,7 @@
<el-table-column label="所属企业" align="center" prop="corpName" /> <el-table-column label="所属企业" align="center" prop="corpName" />
<el-table-column label="存放地名称" align="center" prop="posName" /> <el-table-column label="存放地名称" align="center" prop="posName" />
<el-table-column label="存放地地址" align="center" prop="address" /> <el-table-column label="存放地地址" align="center" prop="address" />
<el-table-column label="面积" align="center" prop="area" /> <el-table-column label="面积(㎡)" align="center" prop="area" />
<el-table-column label="存放类型" align="center" prop="depositType"> <el-table-column label="存放类型" align="center" prop="depositType">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.COMPANY_DEPOSIT_TYPE" :value="scope.row.depositType" /> <dict-tag :type="DICT_TYPE.COMPANY_DEPOSIT_TYPE" :value="scope.row.depositType" />
@ -63,7 +63,7 @@
</template> </template>
<script> <script>
import * as PropertyPosApi from '@/api/base/property/position'; import * as PropertyPosApi from '@/api/company/property/position';
import PropertyPosForm from './PropertyPosForm.vue'; import PropertyPosForm from './PropertyPosForm.vue';
export default { export default {
name: "PropertyPos", name: "PropertyPos",
@ -106,6 +106,7 @@ export default {
async getList() { async getList() {
try { try {
this.loading = true; this.loading = true;
const res1 = await PropertyPosApi.getPropertyPosList();
const res = await PropertyPosApi.getPropertyPosPage(this.queryParams); const res = await PropertyPosApi.getPropertyPosPage(this.queryParams);
this.list = res.data.records; this.list = res.data.records;
this.total = res.data.total; this.total = res.data.total;
@ -130,7 +131,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const id = row.id; const id = row.id;
await this.$modal.confirm('是否确认删除企业管理-资产存放位置编号为"' + id + '"的数据?') await this.$modal.confirm('是否确认删除数据?')
try { try {
await PropertyPosApi.deletePropertyPos(id); await PropertyPosApi.deletePropertyPos(id);
await this.getList(); await this.getList();
@ -139,7 +140,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {
await this.$modal.confirm('是否确认导出所有企业管理-资产存放位置数据项?'); await this.$modal.confirm('是否确认导出所有资产存放位置数据项?');
try { try {
this.exportLoading = true; this.exportLoading = true;
const data = await PropertyPosApi.exportPropertyPosExcel(this.queryParams); const data = await PropertyPosApi.exportPropertyPosExcel(this.queryParams);

View File

@ -1,242 +0,0 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="企业id" prop="corpId">
<el-input v-model="formData.corpId" placeholder="请输入企业id" />
</el-form-item>
<el-form-item label="部门id" prop="deptId">
<el-input v-model="formData.deptId" placeholder="请输入部门id" />
</el-form-item>
<el-form-item label="存放位置" prop="posId">
<el-input v-model="formData.posId" placeholder="请输入存放位置" />
</el-form-item>
<el-form-item label="使用人id" prop="userId">
<el-input v-model="formData.userId" placeholder="请输入使用人id" />
</el-form-item>
<el-form-item label="资产编号" prop="propNo">
<el-input v-model="formData.propNo" placeholder="请输入资产编号" />
</el-form-item>
<el-form-item label="资产名称" prop="propName">
<el-input v-model="formData.propName" placeholder="请输入资产名称" />
</el-form-item>
<el-form-item label="资产分类" prop="propCatg">
<el-input v-model="formData.propCatg" placeholder="请输入资产分类" />
</el-form-item>
<el-form-item label="预计使用年限" prop="useYear">
<el-input v-model="formData.useYear" placeholder="请输入预计使用年限" />
</el-form-item>
<el-form-item label="价值类型" prop="costType">
<el-select v-model="formData.costType" placeholder="请选择价值类型">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_COST_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="资产数量" prop="propNum">
<el-input v-model="formData.propNum" placeholder="请输入资产数量" />
</el-form-item>
<el-form-item label="资产原值(元)" prop="costTotal">
<el-input v-model="formData.costTotal" placeholder="请输入资产原值(元)" />
</el-form-item>
<el-form-item label="资产状态" prop="propStatus">
<el-select v-model="formData.propStatus" placeholder="请选择资产状态">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_PROP_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="品牌" prop="brand">
<el-input v-model="formData.brand" placeholder="请输入品牌" />
</el-form-item>
<el-form-item label="规格型号" prop="spec">
<el-input v-model="formData.spec" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="生产厂家" prop="factory">
<el-input v-model="formData.factory" placeholder="请输入生产厂家" />
</el-form-item>
<el-form-item label="出场序列号/编号" prop="serialNo">
<el-input v-model="formData.serialNo" placeholder="请输入出场序列号/编号" />
</el-form-item>
<el-form-item label="数量计量单位" prop="unit">
<el-input v-model="formData.unit" placeholder="请输入数量计量单位" />
</el-form-item>
<el-form-item label="取得日期" prop="getDate">
<el-date-picker clearable v-model="formData.getDate" type="date" value-format="timestamp"
placeholder="选择取得日期" />
</el-form-item>
<el-form-item label="出厂日期" prop="prodDate">
<el-date-picker clearable v-model="formData.prodDate" type="date" value-format="timestamp"
placeholder="选择出厂日期" />
</el-form-item>
<el-form-item label="供应商" prop="supplier">
<el-input v-model="formData.supplier" placeholder="请输入供应商" />
</el-form-item>
<el-form-item label="启用日期" prop="openDate">
<el-date-picker clearable v-model="formData.openDate" type="date" value-format="timestamp"
placeholder="选择启用日期" />
</el-form-item>
<el-form-item label="净值(元)" prop="netValue">
<el-input v-model="formData.netValue" placeholder="请输入净值(元)" />
</el-form-item>
<el-form-item label="凭证号" prop="voucherNo">
<el-input v-model="formData.voucherNo" placeholder="请输入凭证号" />
</el-form-item>
<el-form-item label="维修/保养周期单位" prop="keepCycleType">
<el-input v-model="formData.keepCycleType" placeholder="请选择维修/保养周期单位" />
</el-form-item>
<el-form-item label="维修/保养周期" prop="keepCycle">
<el-input v-model="formData.keepCycle" placeholder="请输入维修/保养周期" />
</el-form-item>
<el-form-item label="上次维修/保养日期" prop="lastKeepDate">
<el-date-picker clearable v-model="formData.lastKeepDate" type="date" value-format="timestamp"
placeholder="选择上次维修/保养日期" />
</el-form-item>
<!-- <el-form-item label="下次维修/保养日期" prop="nextKeepDate">
<el-date-picker clearable v-model="formData.nextKeepDate" type="date" value-format="timestamp"
placeholder="选择下次维修/保养日期" />
</el-form-item> -->
<el-form-item label="附件urls">
<FileUpload v-model="formData.fileUrls" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as PropertyApi from '@/api/base/property/property';
import FileUpload from '@/components/FileUpload';
export default {
name: "PropertyForm",
components: {
FileUpload,
},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
id: undefined,
corpId: undefined,
deptId: undefined,
posId: undefined,
userId: undefined,
propNo: undefined,
propName: undefined,
propCatg: undefined,
useYear: undefined,
costType: undefined,
propNum: undefined,
costTotal: undefined,
propStatus: undefined,
brand: undefined,
spec: undefined,
factory: undefined,
serialNo: undefined,
unit: undefined,
getDate: undefined,
prodDate: undefined,
supplier: undefined,
openDate: undefined,
netValue: undefined,
voucherNo: undefined,
keepCycleType: undefined,
keepCycle: undefined,
lastKeepDate: undefined,
nextKeepDate: undefined,
fileUrls: undefined,
},
//
formRules: {
},
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await PropertyApi.getProperty(id);
this.formData = res.data;
this.title = "修改企业管理-资产";
} finally {
this.formLoading = false;
}
}
this.title = "新增企业管理-资产";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await PropertyApi.updateProperty(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await PropertyApi.createProperty(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
id: undefined,
corpId: undefined,
deptId: undefined,
posId: undefined,
userId: undefined,
propNo: undefined,
propName: undefined,
propCatg: undefined,
useYear: undefined,
costType: undefined,
propNum: undefined,
costTotal: undefined,
propStatus: undefined,
brand: undefined,
spec: undefined,
factory: undefined,
serialNo: undefined,
unit: undefined,
getDate: undefined,
prodDate: undefined,
supplier: undefined,
openDate: undefined,
netValue: undefined,
voucherNo: undefined,
keepCycleType: undefined,
keepCycle: undefined,
lastKeepDate: undefined,
nextKeepDate: undefined,
fileUrls: undefined,
};
this.resetForm("formRef");
}
}
};
</script>

View File

@ -0,0 +1,454 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="145px">
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>入库信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="资产编号" prop="propNo">
<el-input v-model="formData.propNo" placeholder="请输入资产编号"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资产名称" prop="propName">
<el-input v-model="formData.propName" placeholder="请输入资产名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="资产分类" prop="propCatg">
<el-select v-model="formData.propCatg" placeholder="请选择资产分类" class="customerSelectWidth">
<el-option v-for="dict in companyPropertyCatg" :key="dict.code"
:label="dict.name" :value="dict.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="预计使用年限" prop="useYear">
<el-input v-model="formData.useYear" placeholder="请输入预计使用年限" type="number"
class="customerInputWidth"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="价值类型" prop="costType">
<el-select v-model="formData.costType" placeholder="请选择价值类型" class="customerSelectWidth">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_COST_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资产状态" prop="propStatus">
<el-select v-model="formData.propStatus" placeholder="请选择资产状态" class="customerSelectWidth">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_PROP_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="资产数量" prop="propNum">
<el-input v-model="formData.propNum" placeholder="请输入资产数量" type="number" class="customerInputWidth"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资产原值(元)" prop="costTotal">
<el-input v-model="formData.costTotal" placeholder="请输入资产原值(元)" type="number"
class="customerInputWidth"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="品牌" prop="brand">
<el-input v-model="formData.brand" placeholder="请输入品牌"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="spec">
<el-input v-model="formData.spec" placeholder="请输入规格型号"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="生产厂家" prop="factory">
<el-input v-model="formData.factory" placeholder="请输入生产厂家"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出场序列号/编号" prop="serialNo">
<el-input v-model="formData.serialNo" placeholder="请输入出场序列号/编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="数量计量单位" prop="unit">
<el-input v-model="formData.unit" placeholder="请输入数量计量单位"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="取得日期" prop="getDate">
<el-date-picker clearable v-model="formData.getDate" type="date" value-format="timestamp"
placeholder="选择取得日期"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="出厂日期" prop="prodDate">
<el-date-picker clearable v-model="formData.prodDate" type="date" value-format="timestamp"
placeholder="选择出厂日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商" prop="supplier">
<el-input v-model="formData.supplier" placeholder="请输入供应商"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="维修/保养周期单位" prop="keepCycleType">
<el-select v-model="formData.keepCycleType" placeholder="请选择维修/保养周期单位" clearable class="customerSelectWidth">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.CYCLE_DICT)" :key="dict.value"
:label="dict.label" :value="dict.value" @blur="getNextKeepDate"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修/保养周期" prop="keepCycle">
<el-input v-model="formData.keepCycle" placeholder="请输入维修/保养周期" @blur="getNextKeepDate"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="上次维修/保养日期" prop="lastKeepDate">
<el-date-picker @blur="getNextKeepDate" clearable v-model="formData.lastKeepDate" type="date" value-format="timestamp"
placeholder="选择上次维修/保养日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下次维修/保养日期" prop="nextKeepDate">
<el-date-picker disabled clearable v-model="formData.nextKeepDate" type="date" value-format="timestamp"
placeholder="选择下次维修/保养日期"
/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-card>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>出库信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="启用日期" prop="openDate">
<el-date-picker clearable v-model="formData.openDate" type="date" value-format="timestamp"
placeholder="选择启用日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="净值(元)" prop="netValue">
<el-input v-model="formData.netValue" placeholder="请输入净值(元)"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="使用人" prop="userId">
<el-select filterable v-model="formData.userId" placeholder="请选择使用人" clearable class="customerSelectWidth" :filter-method="searchOption">
<el-option v-for="item in options" :key="item.userId" :label="item.name" :value="item.userId">
<div class="options">
<span>姓名:{{ item.name }}</span>
<span>工号:{{ item.workNo }}</span>
<span>手机:{{ item.tel }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="存放位置" prop="posId">
<el-select v-model="formData.posId" clearable filterable placeholder="请选择存放位置" class="customerSelectWidth">
<el-option v-for="item in positionList" :key="item.id" :label="item.posName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="凭证号" prop="voucherNo">
<el-input v-model="formData.voucherNo" placeholder="请输入凭证号"/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-card>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>附件信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-form-item label="附件上传" prop="fileUrls">
<file-upload v-model="formData.fileUrls"/>
</el-form-item>
</div>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as PropertyApi from '@/api/company/property/property'
import FileUpload from '@/components/FileUpload'
export default {
name: 'PropertyForm',
components: {
FileUpload
},
data() {
return {
//
dialogTitle: '',
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
id: undefined,
corpId: undefined,
deptId: undefined,
posId: undefined,
userId: undefined,
propNo: undefined,
propName: undefined,
propCatg: undefined,
useYear: undefined,
costType: undefined,
propNum: undefined,
costTotal: undefined,
propStatus: undefined,
brand: undefined,
spec: undefined,
factory: undefined,
serialNo: undefined,
unit: undefined,
getDate: undefined,
prodDate: undefined,
supplier: undefined,
openDate: undefined,
netValue: undefined,
voucherNo: undefined,
keepCycleType: undefined,
keepCycle: undefined,
lastKeepDate: undefined,
nextKeepDate: undefined,
fileUrls: undefined
},
//
formRules: {
propNo: [{required: true, message: '资产编号不能为空', trigger: 'blur'}],
propName: [{required: true, message: '资产名称不能为空', trigger: 'blur'}],
propCatg: [{required: true, message: '资产分类不能为空', trigger: 'blur'}],
costType: [{required: true, message: '价值类型不能为空', trigger: 'blur'}],
propStatus: [{required: true, message: '资产状态不能为空', trigger: 'blur'}],
openDate: [{required: true, message: '启用日期不能为空', trigger: 'blur'}],
netValue: [{required: true, message: '净值不能为空', trigger: 'blur'}],
voucherNo: [{required: true, message: '凭证号不能为空', trigger: 'blur'}],
userId: [{required: true, message: '使用人不能为空', trigger: 'blur'}],
posId: [{required: true, message: '存放位置不能为空', trigger: 'blur'}],
propNum: [{required: true, message: '资产数量不能为空', trigger: 'blur'}],
costTotal: [{required: true, message: '资产原值不能为空', trigger: 'blur'}],
keepCycleType: [{required: true, message: '维修/保养周期单位不能为空', trigger: 'blur'}],
keepCycle: [{required: true, message: '维修/保养周期不能为空', trigger: 'blur'}],
lastKeepDate: [{required: true, message: '上次维修/保养日期不能为空', trigger: 'blur'}],
nextKeepDate: [{required: true, message: '下次维修/保养日期不能为空', trigger: 'blur'}],
},
companyPropertyCatg: [],
staffList: [],
positionList: [],
options: [],
}
},
methods: {
/** 打开弹窗 */
async open(id, companyPropertyCatg, staffList, positionList) {
this.dialogVisible = true
this.reset()
//
if (id) {
this.formLoading = true
try {
const res = await PropertyApi.getProperty(id)
this.formData = res.data
this.formData.userId = parseInt(this.formData.userId)
this.formData.prodDate = new Date(this.formData.prodDate)
this.formData.lastKeepDate = new Date(this.formData.lastKeepDate)
this.formData.openDate = new Date(this.formData.openDate)
this.formData.nextKeepDate = new Date(this.formData.nextKeepDate)
this.formData.getDate = new Date(this.formData.getDate)
this.dialogTitle = '修改企业管理-资产'
} finally {
this.formLoading = false
}
}
this.dialogTitle = '新增企业管理-资产'
this.companyPropertyCatg = companyPropertyCatg
this.staffList = staffList
this.options = this.staffList
this.positionList = positionList
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs['formRef'].validate()
this.formLoading = true
try {
const data = this.formData
//
if (data.id) {
await PropertyApi.updateProperty(data)
this.$modal.msgSuccess('修改成功')
this.dialogVisible = false
this.$emit('success')
return
}
//
await PropertyApi.createProperty(data)
this.$modal.msgSuccess('新增成功')
this.dialogVisible = false
this.$emit('success')
} finally {
this.formLoading = false
}
},
/** 表单重置 */
reset() {
this.formData = {
id: undefined,
corpId: undefined,
deptId: undefined,
posId: undefined,
userId: undefined,
propNo: undefined,
propName: undefined,
propCatg: undefined,
useYear: undefined,
costType: undefined,
propNum: undefined,
costTotal: undefined,
propStatus: undefined,
brand: undefined,
spec: undefined,
factory: undefined,
serialNo: undefined,
unit: undefined,
getDate: undefined,
prodDate: undefined,
supplier: undefined,
openDate: undefined,
netValue: undefined,
voucherNo: undefined,
keepCycleType: undefined,
keepCycle: undefined,
lastKeepDate: undefined,
nextKeepDate: undefined,
fileUrls: undefined
}
this.resetForm('formRef')
},
//
getNextKeepDate(){
if (!(this.formData.keepCycleType && this.formData.keepCycle && this.formData.lastKeepDate)){
this.$refs.formRef.validateField('keepCycleType');
this.$refs.formRef.validateField('keepCycle');
this.$refs.formRef.validateField('lastKeepDate');
return
}
this.$refs.formRef.validateField('keepCycleType');
const tempDate = new Date(this.formData.lastKeepDate)
const chooseType =this.formData.keepCycleType;
const num = parseInt(this.formData.keepCycle)
switch (chooseType) {
case '01':
tempDate.setFullYear(tempDate.getFullYear() + num);
break;
case '02':
tempDate.setMonth(tempDate.getMonth() + num);
break;
case '03':
tempDate.setDate(tempDate.getDate() + num);
break;
default:
throw new Error('超出预期了,只能是年、月、天');
}
this.formData.nextKeepDate = new Date(tempDate)
},
searchOption(val) {
this.options = this.staffList.filter(item => (
item.name.toLowerCase().includes(val.toLowerCase()) ||
item.workNo.includes(val) ||
item.tel.includes(val)
))
}
}
}
</script>
<style scoped lang="scss">
.customerInputWidth {
width: 50%;
}
.customerSelectWidth {
width: 100%;
}
.box-card {
margin-bottom: 10px;
}
.options{
display: flex;
justify-content: space-between;
}
</style>

View File

@ -1,114 +1,74 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
<!-- <el-form-item label="企业id" prop="corpId"> <el-form-item label="资产名称" prop="propName">
<el-input v-model="queryParams.corpId" placeholder="请输入企业id" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="部门id" prop="deptId">
<el-input v-model="queryParams.deptId" placeholder="请输入部门id" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="存放位置" prop="posId">
<el-input v-model="queryParams.posId" placeholder="请输入存放位置" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="使用人id" prop="userId">
<el-input v-model="queryParams.userId" placeholder="请输入使用人id" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item label="资产编号" prop="propNo" label-width="60">
<el-input v-model="queryParams.propNo" placeholder="请输入资产编号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="资产名称" prop="propName" label-width="60">
<el-input v-model="queryParams.propName" placeholder="请输入资产名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.propName" placeholder="请输入资产名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="资产分类" prop="propCatg" label-width="60"> <el-form-item label="资产编号" prop="propNo">
<el-input v-model="queryParams.propCatg" placeholder="请输入资产分类" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.propNo" placeholder="请输入资产编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<!-- <el-form-item label="预计使用年限" prop="useYear">
<el-input v-model="queryParams.useYear" placeholder="请输入预计使用年限" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item label="价值类型" prop="costType" label-width="60">
<el-select v-model="queryParams.costType" placeholder="请选择价值类型" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_COST_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<!-- <el-form-item label="资产数量" prop="propNum">
<el-input v-model="queryParams.propNum" placeholder="请输入资产数量" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="资产原值(元)" prop="costTotal">
<el-input v-model="queryParams.costTotal" placeholder="请输入资产原值(元)" clearable
@keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item label="资产状态" prop="propStatus" label-width="60">
<el-select v-model="queryParams.propStatus" placeholder="请选择资产状态" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_PROP_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="品牌" prop="brand"> <el-form-item label="品牌" prop="brand">
<el-input v-model="queryParams.brand" placeholder="请输入品牌" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.brand" placeholder="请输入品牌" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="规格型号" prop="spec">
<el-input v-model="queryParams.spec" placeholder="请输入规格型号" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="生产厂家" prop="factory">
<el-input v-model="queryParams.factory" placeholder="请输入生产厂家" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="出场序列号/编号" prop="serialNo">
<el-input v-model="queryParams.serialNo" placeholder="请输入出场序列号/编号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="数量计量单位" prop="unit">
<el-input v-model="queryParams.unit" placeholder="请输入数量计量单位" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="取得日期" prop="getDate">
<el-date-picker v-model="queryParams.getDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item> -->
<!-- <el-form-item label="出厂日期" prop="prodDate">
<el-date-picker v-model="queryParams.prodDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item> -->
<el-form-item label="供应商" prop="supplier"> <el-form-item label="供应商" prop="supplier">
<el-input v-model="queryParams.supplier" placeholder="请输入供应商" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.supplier" placeholder="请输入供应商" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="启用日期" prop="openDate" label-width="60"> <el-form-item label="资产分类" prop="propCatg">
<el-date-picker v-model="queryParams.openDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-select v-model="queryParams.propCatg" placeholder="请选择资产分类" class="customerSelectWidth">
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" <el-option v-for="dict in companyPropertyCatg" :key="dict.code"
:default-time="['00:00:00', '23:59:59']" /> :label="dict.name" :value="dict.code"
/>
</el-select>
</el-form-item>
<el-form-item label="价值类型" prop="costType">
<el-select v-model="queryParams.costType" placeholder="请选择价值类型" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_COST_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="资产状态" prop="propStatus">
<el-select v-model="queryParams.propStatus" placeholder="请选择资产状态" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_PROP_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="净值(元)" prop="netValue">
<el-input v-model="queryParams.netValue" placeholder="请输入净值(元)" clearable @keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item label="凭证号" prop="voucherNo"> <el-form-item label="凭证号" prop="voucherNo">
<el-input v-model="queryParams.voucherNo" placeholder="请输入凭证号" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.voucherNo" placeholder="请输入凭证号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="维修/保养周期单位" prop="keepCycleType"> <el-form-item label="生产厂家" prop="factory">
<el-select v-model="queryParams.keepCycleType" placeholder="请选择维修/保养周期单位" clearable size="small"> <el-input v-model="queryParams.factory" placeholder="请输入生产厂家" clearable @keyup.enter.native="handleQuery"/>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item> -->
<!-- <el-form-item label="维修/保养周期" prop="keepCycle">
<el-input v-model="queryParams.keepCycle" placeholder="请输入维修/保养周期" clearable
@keyup.enter.native="handleQuery" />
</el-form-item> -->
<el-form-item label="上次维修/保养日期" prop="lastKeepDate" label-width="100">
<el-date-picker v-model="queryParams.lastKeepDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="下次维修/保养日期" prop="nextKeepDate"> <el-form-item label="存放位置" prop="posId">
<el-date-picker v-model="queryParams.nextKeepDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-select v-model="queryParams.posId" clearable filterable placeholder="请选择存放位置">
<el-option v-for="item in positionList" :key="item.id" :label="item.posName" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="使用人" prop="userId">
<el-select filterable v-model="queryParams.userId" placeholder="请选择使用人" clearable>
<el-option v-for="item in staffList" :key="item.id" :label="item.name" :value="item.userId">
<div class="options">
<span>姓名:{{ item.name }}</span>
<span>工号:{{ item.workNo }}</span>
<span>手机:{{ item.tel }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="取得日期" prop="getDateArray">
<el-date-picker v-model="queryParams.getDateArray" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" /> :default-time="['00:00:00', '23:59:59']"
</el-form-item> --> />
<!-- <el-form-item label="创建时间" prop="createTime"> </el-form-item>
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-form-item label="启用日期" prop="openDateArray">
<el-date-picker v-model="queryParams.openDateArray" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" /> :default-time="['00:00:00', '23:59:59']"
</el-form-item> --> />
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
@ -119,11 +79,15 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['company:property:create']">新增</el-button> v-hasPermi="['company:property:create']"
>新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
:loading="exportLoading" v-hasPermi="['company:property:export']">导出</el-button> :loading="exportLoading" v-hasPermi="['company:property:export']"
>导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -131,85 +95,93 @@
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" prop="num"> <el-table-column label="序号" align="center" prop="num">
<template slot-scope="scope"> <template slot-scope="scope">
<span style="margin-left: 10px">{{ queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1 <span style="margin-left: 10px">{{
queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="资产名称" align="center" prop="propName" /> <el-table-column :show-overflow-tooltip="true" label="资产名称" align="center" prop="propName" width="150px"/>
<el-table-column label="存放位置" align="center" prop="posId" /> <el-table-column label="存放位置" align="center" prop="posName" width="150px"/>
<el-table-column label="资产编号" align="center" prop="propNo" /> <el-table-column label="资产编号" align="center" prop="propNo" width="150px"/>
<el-table-column label="资产分类" align="center" prop="propCatg" /> <el-table-column label="资产分类" align="center" prop="propCatg" width="150px">
<el-table-column label="价值类型" align="center" prop="costType"> <template v-slot="scope">
{{scope.row.propCatg !== null ? companyPropertyCatg.find(item => item.code === scope.row.propCatg).name : ''}}
</template>
</el-table-column>
<el-table-column label="价值类型" align="center" prop="costType" width="150px">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.COMPANY_COST_TYPE" :value="scope.row.costType"/> <dict-tag :type="DICT_TYPE.COMPANY_COST_TYPE" :value="scope.row.costType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="预计使用年限" align="center" prop="useYear" width="100" /> <el-table-column label="预计使用年限" align="center" prop="useYear" width="150px"/>
<el-table-column label="资产数量" align="center" prop="propNum" width="150px">
<el-table-column label="资产数量" align="center" prop="propNum" >
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.propNum + " " + scope.row.unit }} {{ scope.row.propNum + ' ' + scope.row.unit }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="数量计量单位" align="center" prop="unit" /> --> <el-table-column label="资产原值(元)" align="center" prop="costTotal"width="150px"/>
<el-table-column label="资产状态" align="center" prop="propStatus" width="150px">
<!-- <el-table-column label="资产原值(元)" align="center" prop="costTotal" /> -->
<el-table-column label="资产状态" align="center" prop="propStatus">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.COMPANY_PROP_STATUS" :value="scope.row.propStatus"/> <dict-tag :type="DICT_TYPE.COMPANY_PROP_STATUS" :value="scope.row.propStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="品牌" align="center" prop="brand" /> <el-table-column label="品牌" align="center" prop="brand" width="150px"/>
<el-table-column label="规格型号" align="center" prop="spec" /> <el-table-column label="规格型号" align="center" prop="spec" width="150px"/>
<!-- <el-table-column label="生产厂家" align="center" prop="factory" /> --> <el-table-column :show-overflow-tooltip="true" label="生产厂家" align="center" prop="factory" width="150px"/>
<!-- <el-table-column label="出场序列号/编号" align="center" prop="serialNo" /> --> <el-table-column label="出厂序列号/编号" align="center" prop="serialNo" width="150px"/>
<el-table-column label="取得日期" align="center" prop="getDate" /> <el-table-column label="出厂日期" align="center" prop="prodDate" width="150px">
<!-- <el-table-column label="出厂日期" align="center" prop="prodDate" /> -->
<el-table-column label="供应商" align="center" prop="supplier" />
<el-table-column label="启用日期" align="center" prop="openDate" />
<el-table-column label="净值(元)" align="center" prop="netValue" width="120" />
<el-table-column label="凭证号" align="center" prop="voucherNo" width="120"/>
<!-- <el-table-column label="维修/保养周期单位" align="center" prop="keepCycleType" /> -->
<el-table-column label="上次维修/保养日期" align="center" prop="lastKeepDate" width="130"/>
<el-table-column label="维修/保养周期" align="center" prop="keepCycle" width="120" >
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.keepCycle + " " + scope.row.keepCycleType }} {{ scope.row.prodDate }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用人id" align="center" prop="userId" /> <el-table-column label="取得日期" align="center" prop="getDate" width="150px"/>
<el-table-column label="部门id" align="center" prop="deptId" /> <el-table-column :show-overflow-tooltip="true" label="供应商" align="center" prop="supplier" width="150px"/>
<el-table-column label="企业id" align="center" prop="corpId" /> <el-table-column label="启用日期" align="center" prop="openDate" width="150px"/>
<!-- <el-table-column label="下次维修/保养日期" align="center" prop="nextKeepDate" /> --> <el-table-column label="净值(元)" align="center" prop="netValue" width="150px"/>
<!-- <el-table-column label="附件urls" align="center" prop="fileUrls" /> --> <el-table-column label="凭证号" align="center" prop="voucherNo" width="150px"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="120"> <el-table-column label="上次维修/保养日期" align="center" prop="lastKeepDate" width="150px"/>
<el-table-column label="维修/保养周期" align="center" prop="keepCycle" width="150px">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> {{ scope.row.keepCycle + ' '}}
<dict-tag :type="DICT_TYPE.CYCLE_DICT" :value="scope.row.keepCycleType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200"> <el-table-column label="下次维修/保养日期" align="center" prop="nextKeepDate" width="150px"/>
<el-table-column label="使用人" align="center" prop="staffName" width="150px" />
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="150px">
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)" <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
v-hasPermi="['company:property:update']">修改</el-button> v-hasPermi="['company:property:update']"
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['company:property:delete']">删除</el-button> v-hasPermi="['company:property:delete']"
>删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList"
/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<PropertyForm ref="formRef" @success="getList"/> <PropertyForm ref="formRef" @success="getList"/>
</div> </div>
</template> </template>
<script> <script>
import * as PropertyApi from '@/api/base/property/property'; import * as PropertyApi from '@/api/company/property/property'
import PropertyForm from './PropertyForm.vue'; import PropertyForm from './form/PropertyForm.vue'
import { listCategory } from '@/api/system/category'
import { DICT_TYPE } from '@/utils/dict'
import { getStaffList } from '@/api/company/staff'
import { getPropertyPosList } from '@/api/company/property/position'
export default { export default {
name: "Property", name: 'Property',
components: { components: {
PropertyForm, PropertyForm
}, },
data() { data() {
return { return {
@ -250,71 +222,98 @@ export default {
factory: null, factory: null,
serialNo: null, serialNo: null,
unit: null, unit: null,
getDate: [], getDateArray: [],
prodDate: [], prodDate: [],
supplier: null, supplier: null,
openDate: [], openDateArray: [],
netValue: null, netValue: null,
voucherNo: null, voucherNo: null,
keepCycleType: null, keepCycleType: null,
keepCycle: null, keepCycle: null,
lastKeepDate: [], lastKeepDate: [],
nextKeepDate: [], nextKeepDate: [],
createTime: [], createTime: []
}, },
}; companyPropertyCatg: [],
staffList: [],
positionList: []
}
}, },
created() { created() {
this.getList(); this.getList()
this.getCompanyPropertyCatg()
this.listStaff()
this.listPropertyPos()
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
async getList() { async getList() {
try { try {
this.loading = true; this.loading = true
const res = await PropertyApi.getPropertyPage(this.queryParams); const res = await PropertyApi.getPropertyPage(this.queryParams)
this.list = res.data.records;
this.total = res.data.total; this.list = res.data.records
this.total = res.data.total
} finally { } finally {
this.loading = false; this.loading = false
} }
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
/** 添加/修改操作 */ /** 添加/修改操作 */
openForm(id) { openForm(id) {
this.$refs["formRef"].open(id); this.$refs['formRef'].open(id, this.companyPropertyCatg, this.staffList, this.positionList)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const id = row.id; const id = row.id
await this.$modal.confirm('是否确认删除企业管理-资产编号为"' + id + '"的数据项?') const propNo = row.propNo
await this.$modal.confirm('是否确认删除企业管理-资产编号为"' + propNo + '"的数据项?')
try { try {
await PropertyApi.deleteProperty(id); await PropertyApi.deleteProperty(id)
await this.getList(); await this.getList()
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功')
} catch { } } catch {
}
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {
await this.$modal.confirm('是否确认导出所有企业管理-资产数据项?'); await this.$modal.confirm('是否确认导出所有企业管理-资产数据项?')
try { try {
this.exportLoading = true; this.exportLoading = true
const data = await PropertyApi.exportPropertyExcel(this.queryParams); const data = await PropertyApi.exportPropertyExcel(this.queryParams)
this.$download.excel(data, '企业管理-资产.xls'); this.$download.excel(data, '企业管理-资产.xls')
} catch { } catch {
} finally { } finally {
this.exportLoading = false; this.exportLoading = false
} }
}, },
//
async getCompanyPropertyCatg() {
listCategory().then(res => {
this.companyPropertyCatg = this.handleTree(res.data, 'id', 'pid', 'children', '0').find(item => item.code === DICT_TYPE.COMPANY_PROPERTY_CATG).children
})
},
//
async listStaff() {
getStaffList().then(res => {
this.staffList = res.data
})
},
//
async listPropertyPos() {
getPropertyPosList().then(res => {
this.positionList = res.data
})
}
}
} }
};
</script> </script>

View File

@ -32,7 +32,7 @@
</template> </template>
<script> <script>
import * as PropertyDealApi from '@/api/base/property/propertydeal'; import * as PropertyDealApi from '@/api/company/property/propertydeal';
export default { export default {
name: "PropertyDealForm", name: "PropertyDealForm",

View File

@ -88,7 +88,7 @@
<script> <script>
import * as PropertyDealApi from '@/api/base/property/propertydeal'; import * as PropertyDealApi from '@/api/company/property/propertydeal';
import PropertyDealForm from './PropertyDealForm.vue'; import PropertyDealForm from './PropertyDealForm.vue';
export default { export default {
name: "PropertyDeal", name: "PropertyDeal",

View File

@ -52,7 +52,7 @@
</template> </template>
<script> <script>
import * as PropertyDealItemApi from '@/api/base/property/propertydealitem'; import * as PropertyDealItemApi from '@/api/company/property/propertydealitem';
export default { export default {
name: "PropertyDealItemForm", name: "PropertyDealItemForm",

View File

@ -111,7 +111,7 @@
</template> </template>
<script> <script>
import * as PropertyDealItemApi from '@/api/base/property/propertydealitem'; import * as PropertyDealItemApi from '@/api/company/property/propertydealitem';
import PropertyDealItemForm from './PropertyDealItemForm.vue'; import PropertyDealItemForm from './PropertyDealItemForm.vue';
export default { export default {

View File

@ -26,7 +26,7 @@
</template> </template>
<script> <script>
import * as PropertyKeepApi from '@/api/base/property/propertykeep'; import * as PropertyKeepApi from '@/api/company/property/propertykeep';
import FileUpload from '@/components/FileUpload'; import FileUpload from '@/components/FileUpload';
export default { export default {
name: "PropertyKeepForm", name: "PropertyKeepForm",

View File

@ -71,7 +71,7 @@
</template> </template>
<script> <script>
import * as PropertyKeepApi from '@/api/base/property/propertykeep'; import * as PropertyKeepApi from '@/api/company/property/propertykeep';
import PropertyKeepForm from './PropertyKeepForm.vue'; import PropertyKeepForm from './PropertyKeepForm.vue';
export default { export default {
name: "PropertyKeep", name: "PropertyKeep",

View File

@ -85,8 +85,21 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="家庭住址" prop="address"> <el-form-item label="员工角色" prop="roleIds">
<el-input v-model="formData.address" placeholder="请输入家庭住址"/> <el-select
style="width: 100%"
filterable
clearable
v-model="formData.roleIds" multiple placeholder="请选择员工角色"
>
<el-option
v-for="(item, index) in roleList"
:key="index"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="技能标签" prop="labelsArray"> <el-form-item label="技能标签" prop="labelsArray">
<el-select <el-select
@ -104,6 +117,10 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="家庭住址" prop="address">
<el-input type="textarea"
:autosize="{ minRows: 2, maxRows: 5}" v-model="formData.address" placeholder="请输入家庭住址"/>
</el-form-item>
<el-form-item label="个人简介" prop="content"> <el-form-item label="个人简介" prop="content">
<el-input <el-input
type="textarea" type="textarea"
@ -157,7 +174,7 @@ export default {
workNo: undefined, workNo: undefined,
name: undefined, name: undefined,
tel: undefined, tel: undefined,
sex: "1", sex: '1',
address: undefined, address: undefined,
workDate: undefined, workDate: undefined,
workYear: undefined, workYear: undefined,
@ -169,7 +186,8 @@ export default {
fileUrls: undefined, fileUrls: undefined,
loginAccount: undefined, loginAccount: undefined,
password: undefined, password: undefined,
labelsArray: undefined labelsArray: undefined,
roleIds: undefined
}, },
// //
formRules: { formRules: {
@ -197,7 +215,7 @@ export default {
], ],
password: [ password: [
{ required: true, message: '登录密码不能为空', trigger: 'blur' }, { required: true, message: '登录密码不能为空', trigger: 'blur' },
{ min: 6, max: 20, message: "登录密码长度在6~20个字符", trigger: 'blur'}, { min: 6, max: 20, message: '登录密码长度在6~20个字符', trigger: 'blur' },
{ {
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+{}\[\]:;<>,.?~\\-])\S{6,}$/, pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+{}\[\]:;<>,.?~\\-])\S{6,}$/,
message: '登录密码必须由大小写字母、数字、特殊字符组成', message: '登录密码必须由大小写字母、数字、特殊字符组成',
@ -208,10 +226,16 @@ export default {
joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }] joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }]
}, },
labelOptions: [], labelOptions: [],
nowDate: new Date() nowDate: new Date(),
roleList: []
} }
}, },
methods: { methods: {
//
async listRoles() {
const res = await StaffApi.getRoleList()
this.roleList = res.data
},
/** 获取标签 */ /** 获取标签 */
async listLabels() { async listLabels() {
try { try {
@ -227,10 +251,11 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.dialogTitle = id ? '修改员工信息' : '新增员工信息' this.dialogTitle = id ? '修改员工信息' : '新增员工信息'
await this.listLabels() await this.listLabels()
await this.listRoles()
this.reset() this.reset()
// //
if (id) { if (id) {
this.formData.id = id; this.formData.id = id
this.formLoading = true this.formLoading = true
try { try {
const res = await StaffApi.getStaff(id) const res = await StaffApi.getStaff(id)
@ -278,7 +303,7 @@ export default {
workNo: undefined, workNo: undefined,
name: undefined, name: undefined,
tel: undefined, tel: undefined,
sex: "1", sex: '1',
address: undefined, address: undefined,
workDate: undefined, workDate: undefined,
workYear: undefined, workYear: undefined,
@ -289,17 +314,18 @@ export default {
uniqueCode: undefined, uniqueCode: undefined,
fileIds: undefined, fileIds: undefined,
loginAccount: undefined, loginAccount: undefined,
password: undefined password: undefined,
roleIds: undefined
} }
this.resetForm('formRef') this.resetForm('formRef')
}, },
// //
getWorkYear() { getWorkYear() {
this.formData.workYear = this.getYearsByDate(this.formData.workDate); this.formData.workYear = this.getYearsByDate(this.formData.workDate)
}, },
// //
getJoinedYear() { getJoinedYear() {
this.formData.joinedYear = this.getYearsByDate(this.formData.joinedDate); this.formData.joinedYear = this.getYearsByDate(this.formData.joinedDate)
}, },
// //
getYearsByDate(date) { getYearsByDate(date) {
@ -315,7 +341,7 @@ export default {
years-- years--
} }
return years >= 0 ? years : '0' return years >= 0 ? years : '0'
}, }
} }
} }
</script> </script>

View File

@ -21,8 +21,31 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="家庭住址" prop="address"> <el-form-item label="员工角色" prop="roleIds">
<el-input v-model="queryParams.address" placeholder="请输入家庭住址" clearable @keyup.enter.native="handleQuery"/> <el-select
style="width: 100%"
filterable
clearable
v-model="queryParams.roleIds" multiple placeholder="请选择员工角色"
>
<el-option
v-for="(item, index) in roleList"
:key="index"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="学历" prop="education">
<el-select v-model="queryParams.education" placeholder="请选择学历" clearable size="small">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STAFF_EDU)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="工龄" prop="workYear"> <el-form-item label="工龄" prop="workYear">
<el-input v-model="queryParams.workYear" placeholder="请输入工龄" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.workYear" placeholder="请输入工龄" clearable @keyup.enter.native="handleQuery"/>
@ -30,9 +53,6 @@
<el-form-item label="司龄" prop="joinedYear"> <el-form-item label="司龄" prop="joinedYear">
<el-input v-model="queryParams.joinedYear" placeholder="请输入司龄" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.joinedYear" placeholder="请输入司龄" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </el-form-item>
<el-form-item label="学历" prop="education">
<el-input v-model="queryParams.education" placeholder="请输入学历" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="唯一推广码" prop="uniqueCode"> <el-form-item label="唯一推广码" prop="uniqueCode">
<el-input v-model="queryParams.uniqueCode" placeholder="请输入唯一推广码" clearable <el-input v-model="queryParams.uniqueCode" placeholder="请输入唯一推广码" clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -84,6 +104,7 @@
</el-table-column> </el-table-column>
<el-table-column label="工号" align="center" prop="workNo" width="180"/> <el-table-column label="工号" align="center" prop="workNo" width="180"/>
<el-table-column label="姓名" align="center" prop="name" width="180"/> <el-table-column label="姓名" align="center" prop="name" width="180"/>
<el-table-column label="角色" :show-overflow-tooltip="true" align="center" prop="roleNames" width="180"/>
<el-table-column label="手机号" align="center" prop="tel" width="180"/> <el-table-column label="手机号" align="center" prop="tel" width="180"/>
<el-table-column label="性别" align="center" prop="sex" width="180"> <el-table-column label="性别" align="center" prop="sex" width="180">
<template v-slot="scope"> <template v-slot="scope">
@ -195,14 +216,22 @@ export default {
education: null, education: null,
content: null, content: null,
uniqueCode: null, uniqueCode: null,
fileIds: null fileIds: null,
} roleIds: null,
},
roleList: [],
} }
}, },
created() { created() {
this.getList() this.getList()
this.listRoles()
}, },
methods: { methods: {
//
async listRoles(){
const res = await StaffApi.getRoleList();
this.roleList = res.data
},
// //
handleCommand(command, index, row) { handleCommand(command, index, row) {
switch (command) { switch (command) {