资产管理
This commit is contained in:
parent
e142f11344
commit
dcf8442ce7
@ -136,7 +136,10 @@ export const DICT_TYPE = {
|
||||
COMPANY_PROP_STATUS: 'company_prop_status',
|
||||
//存放类型
|
||||
COMPANY_DEPOSIT_TYPE: 'company_deposit_type',
|
||||
|
||||
//时间周期字典
|
||||
CYCLE_DICT : 'cycle_dict',
|
||||
//资产分类
|
||||
COMPANY_PROPERTY_CATG: 'company_property_catg',
|
||||
COMPANY_COST_TYPE: 'company_cost_type',
|
||||
}
|
||||
|
||||
|
@ -22,14 +22,14 @@
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
推广人姓名
|
||||
被推广人姓名
|
||||
</template>
|
||||
{{ formData.newUserName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
推广人电话
|
||||
被推广人电话
|
||||
</template>
|
||||
{{ formData.newUser.mobile }}
|
||||
</el-descriptions-item>
|
||||
|
@ -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,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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>
|
436
src/views/company/property/property/form/PropertyForm.vue
Normal file
436
src/views/company/property/property/form/PropertyForm.vue
Normal file
@ -0,0 +1,436 @@
|
||||
<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">
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="存放位置" prop="posId">
|
||||
<el-input v-model="formData.posId" placeholder="请输入存放位置"/>
|
||||
</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="附件上传">
|
||||
<FileUpload 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/base/property/property'
|
||||
import FileUpload from '@/components/FileUpload'
|
||||
import {getStaffList} from '@/api/company/staff'
|
||||
|
||||
export default {
|
||||
name: 'PropertyForm',
|
||||
components: {
|
||||
FileUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: '',
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id, companyPropertyCatg, staffList) {
|
||||
this.dialogVisible = true
|
||||
this.reset()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true
|
||||
try {
|
||||
const res = await PropertyApi.getProperty(id)
|
||||
this.formData = res.data
|
||||
this.dialogTitle = '修改企业管理-资产'
|
||||
} finally {
|
||||
this.formLoading = false
|
||||
}
|
||||
}
|
||||
this.dialogTitle = '新增企业管理-资产'
|
||||
this.companyPropertyCatg = companyPropertyCatg
|
||||
this.staffList = staffList
|
||||
},
|
||||
/** 提交按钮 */
|
||||
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 = tempDate
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.customerInputWidth {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.customerSelectWidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.options{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
@ -1,114 +1,72 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="企业id" prop="corpId">
|
||||
<el-input v-model="queryParams.corpId" placeholder="请输入企业id" clearable @keyup.enter.native="handleQuery" />
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="88px">
|
||||
<el-form-item label="资产名称" prop="propName">
|
||||
<el-input v-model="queryParams.propName" placeholder="请输入资产名称" 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-form-item>
|
||||
<el-form-item label="资产分类" prop="propCatg" label-width="60">
|
||||
<el-input v-model="queryParams.propCatg" 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 label="资产编号" prop="propNo">
|
||||
<el-input v-model="queryParams.propNo" placeholder="请输入资产编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<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 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-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 label="启用日期" prop="openDate" label-width="60">
|
||||
<el-date-picker v-model="queryParams.openDate" 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="netValue">
|
||||
<el-input v-model="queryParams.netValue" placeholder="请输入净值(元)" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="凭证号" prop="voucherNo">
|
||||
<el-input v-model="queryParams.voucherNo" placeholder="请输入凭证号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="维修/保养周期单位" prop="keepCycleType">
|
||||
<el-select v-model="queryParams.keepCycleType" placeholder="请选择维修/保养周期单位" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
<el-form-item label="资产分类" prop="propCatg">
|
||||
<el-select v-model="queryParams.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-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 label="下次维修/保养日期" prop="nextKeepDate">
|
||||
<el-date-picker v-model="queryParams.nextKeepDate" 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="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" 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="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 label="凭证号" prop="voucherNo">
|
||||
<el-input v-model="queryParams.voucherNo" 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="posId">
|
||||
<el-input v-model="queryParams.posId" placeholder="请输入存放位置" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用人" prop="userId">
|
||||
<el-select filterable v-model="queryParams.userId" placeholder="请选择使用人" clearable class="customerSelectWidth">
|
||||
<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="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="openDate">
|
||||
<el-date-picker v-model="queryParams.openDate" 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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
@ -119,11 +77,15 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<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 :span="1.5">
|
||||
<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>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@ -131,85 +93,87 @@
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" prop="num">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资产名称" align="center" prop="propName" />
|
||||
<el-table-column label="存放位置" align="center" prop="posId" />
|
||||
<el-table-column label="资产编号" align="center" prop="propNo" />
|
||||
<el-table-column label="资产分类" align="center" prop="propCatg" />
|
||||
<el-table-column label="资产名称" align="center" prop="propName"/>
|
||||
<el-table-column label="存放位置" align="center" prop="posId"/>
|
||||
<el-table-column label="资产编号" align="center" prop="propNo"/>
|
||||
<el-table-column label="资产分类" align="center" prop="propCatg"/>
|
||||
<el-table-column label="价值类型" align="center" prop="costType">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="预计使用年限" align="center" prop="useYear" width="100" />
|
||||
|
||||
<el-table-column label="资产数量" align="center" prop="propNum" >
|
||||
<el-table-column label="预计使用年限" align="center" prop="useYear" width="110px"/>
|
||||
<el-table-column label="资产数量" align="center" prop="propNum">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.propNum + " " + scope.row.unit }}
|
||||
{{ scope.row.propNum + ' ' + scope.row.unit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="数量计量单位" align="center" prop="unit" /> -->
|
||||
|
||||
<!-- <el-table-column label="资产原值(元)" align="center" prop="costTotal" /> -->
|
||||
<el-table-column label="资产原值(元)" align="center" prop="costTotal" width="120px"/>
|
||||
<el-table-column label="资产状态" align="center" prop="propStatus">
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="品牌" align="center" prop="brand" />
|
||||
<el-table-column label="规格型号" align="center" prop="spec" />
|
||||
<!-- <el-table-column label="生产厂家" align="center" prop="factory" /> -->
|
||||
<!-- <el-table-column label="出场序列号/编号" align="center" prop="serialNo" /> -->
|
||||
<el-table-column label="取得日期" align="center" prop="getDate" />
|
||||
<!-- <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" >
|
||||
<el-table-column label="品牌" align="center" prop="brand"/>
|
||||
<el-table-column label="规格型号" align="center" prop="spec"/>
|
||||
<el-table-column label="生产厂家" align="center" prop="factory"/>
|
||||
<el-table-column label="出厂序列号/编号" align="center" prop="serialNo" width="130px"/>
|
||||
<el-table-column label="出厂日期" align="center" prop="prodDate">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.keepCycle + " " + scope.row.keepCycleType }}
|
||||
{{ scope.row.prodDate }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用人id" align="center" prop="userId" />
|
||||
<el-table-column label="部门id" align="center" prop="deptId" />
|
||||
<el-table-column label="企业id" align="center" prop="corpId" />
|
||||
<!-- <el-table-column label="下次维修/保养日期" align="center" prop="nextKeepDate" /> -->
|
||||
<!-- <el-table-column label="附件urls" align="center" prop="fileUrls" /> -->
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="120">
|
||||
<el-table-column label="取得日期" align="center" prop="getDate"/>
|
||||
<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="90px"/>
|
||||
<el-table-column label="凭证号" align="center" prop="voucherNo"/>
|
||||
<el-table-column label="上次维修/保养日期" align="center" prop="lastKeepDate" width="130px"/>
|
||||
<el-table-column label="维修/保养周期" align="center" prop="keepCycle" width="120px">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
{{ scope.row.keepCycle + ' ' + scope.row.keepCycleType }}
|
||||
</template>
|
||||
</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="130px"/>
|
||||
<el-table-column label="使用人" align="center" prop="userId"/>
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<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)"
|
||||
v-hasPermi="['company:property:delete']">删除</el-button>
|
||||
v-hasPermi="['company:property:delete']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as PropertyApi from '@/api/base/property/property';
|
||||
import PropertyForm from './PropertyForm.vue';
|
||||
import * as PropertyApi from '@/api/base/property/property'
|
||||
import PropertyForm from './form/PropertyForm.vue'
|
||||
import { listCategory } from '@/api/system/category'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { getStaffList } from '@/api/company/staff'
|
||||
|
||||
export default {
|
||||
name: "Property",
|
||||
name: 'Property',
|
||||
components: {
|
||||
PropertyForm,
|
||||
PropertyForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -262,59 +226,76 @@ export default {
|
||||
nextKeepDate: [],
|
||||
createTime: [],
|
||||
},
|
||||
};
|
||||
companyPropertyCatg: [],
|
||||
staffList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
this.getCompanyPropertyCatg()
|
||||
this.listStaff()
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await PropertyApi.getPropertyPage(this.queryParams);
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
this.loading = true
|
||||
const res = await PropertyApi.getPropertyPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
} finally {
|
||||
this.loading = false;
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
this.$refs['formRef'].open(id, this.companyPropertyCatg, this.staffList)
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
const id = row.id
|
||||
await this.$modal.confirm('是否确认删除企业管理-资产编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await PropertyApi.deleteProperty(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
await PropertyApi.deleteProperty(id)
|
||||
await this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有企业管理-资产数据项?');
|
||||
await this.$modal.confirm('是否确认导出所有企业管理-资产数据项?')
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await PropertyApi.exportPropertyExcel(this.queryParams);
|
||||
this.$download.excel(data, '企业管理-资产.xls');
|
||||
this.exportLoading = true
|
||||
const data = await PropertyApi.exportPropertyExcel(this.queryParams)
|
||||
this.$download.excel(data, '企业管理-资产.xls')
|
||||
} catch {
|
||||
} 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
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
@ -101,9 +101,6 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="家庭住址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入家庭住址"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="技能标签" prop="labelsArray">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
@ -120,6 +117,10 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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-input
|
||||
type="textarea"
|
||||
|
Loading…
Reference in New Issue
Block a user