资产处置新增
This commit is contained in:
parent
095a1d913a
commit
11be7c8261
5
src/utils/createUUID.js
Normal file
5
src/utils/createUUID.js
Normal file
@ -0,0 +1,5 @@
|
||||
import {v4 as uuidv4} from 'uuid'
|
||||
|
||||
export function createUUID(){
|
||||
return uuidv4().replace(/-/g, '')
|
||||
}
|
15
src/views/company/property/propertyDealChange/index.vue
Normal file
15
src/views/company/property/propertyDealChange/index.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
1
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PropertyDealChange'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,319 @@
|
||||
<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="100px">
|
||||
<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="dealNo">
|
||||
<el-input disabled v-model="formData.dealNo"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="处置时间" prop="dealDate">
|
||||
<el-date-picker clearable v-model="formData.dealDate" type="date" value-format="timestamp"
|
||||
placeholder="选择处置/变动日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="false" label="数据类型" prop="dataType">
|
||||
<el-select v-model="queryParams.dataType" placeholder="请选择处置方式" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PROPERTY_DATA_TYPE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</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>
|
||||
<el-button type="primary" style="float: right" @click="getList">选择资产</el-button>
|
||||
</div>
|
||||
<!-- 卡片内容 -->
|
||||
<div>
|
||||
<el-table :data="formData.propList" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" prop="num">
|
||||
<template #default="{ $index }">
|
||||
{{ $index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资产编号" prop="propNo" align="center" />
|
||||
<el-table-column label="资产名称" prop="propName" align="center" />
|
||||
<el-table-column label="价值类型" align="center" prop="costType" />
|
||||
<el-table-column label="资产原值(元)" align="center" prop="costTotal" />
|
||||
<el-table-column label="净值(元)" align="center" prop="netValue" />
|
||||
<el-table-column label="存放位置" align="center" prop="posName" width="150px"/>
|
||||
<el-table-column label="处置方式" align="center" prop="dealWay">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.dealWay" placeholder="请选择处置方式" clearable size="small">
|
||||
<el-option v-for="dict in getDictDatas(DICT_TYPE.COMPANY_DEAL_WAY)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteProp(scope.$index)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" :disabled="formLoading" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="选择资产" :visible.sync="chooseDisable" width="60%" v-dialogDrag append-to-body>
|
||||
<!-- 搜索工作栏 -->
|
||||
<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="资产编号" prop="propNo">
|
||||
<el-input v-model="queryParams.propNo" placeholder="请输入资产编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</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>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" label="资产名称" align="center" prop="propName" width="150px"/>
|
||||
<el-table-column label="存放位置" align="center" prop="posName" width="150px"/>
|
||||
<el-table-column label="资产编号" align="center" prop="propNo" width="150px"/>
|
||||
<el-table-column label="价值类型" align="center" prop="costType" width="150px">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMPANY_COST_TYPE" :value="scope.row.costType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资产原值(元)" align="center" prop="costTotal"width="150px"/>
|
||||
<el-table-column label="资产状态" align="center" prop="propStatus" width="150px">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMPANY_PROP_STATUS" :value="scope.row.propStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="净值(元)" align="center" prop="netValue" 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">
|
||||
<el-button size="mini" type="text" icon="el-icon-check" @click="chooseProp(scope.row)"
|
||||
>选择
|
||||
</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"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { createUUID } from '@/utils/createUUID'
|
||||
import * as PropertyApi from '@/api/company/property/property'
|
||||
import * as PropertyDealApi from '@/api/company/property/propertydeal'
|
||||
|
||||
export default {
|
||||
name: 'PropertyDealDisposalForm',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 弹出层标题
|
||||
dialogTitle: '',
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
dealNo: undefined,
|
||||
dealDate: undefined,
|
||||
dataType: "02",
|
||||
propList: []
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
dealDate: [{required: true, message: "处置日期不能为空", trigger: 'blur'}],
|
||||
},
|
||||
chooseDisable: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
corpId: null,
|
||||
deptId: null,
|
||||
posId: null,
|
||||
userId: null,
|
||||
propNo: null,
|
||||
propName: null,
|
||||
propCatg: null,
|
||||
useYear: null,
|
||||
costType: null,
|
||||
propNum: null,
|
||||
costTotal: null,
|
||||
propStatus: null,
|
||||
brand: null,
|
||||
spec: null,
|
||||
factory: null,
|
||||
serialNo: null,
|
||||
unit: null,
|
||||
getDateArray: [],
|
||||
prodDate: [],
|
||||
supplier: null,
|
||||
openDateArray: [],
|
||||
netValue: null,
|
||||
voucherNo: null,
|
||||
keepCycleType: null,
|
||||
keepCycle: null,
|
||||
lastKeepDate: [],
|
||||
nextKeepDate: [],
|
||||
},
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
list: [],
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true
|
||||
this.reset()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true
|
||||
try {
|
||||
// const res = await PropertyDealApi.getPropertyDeal(id);
|
||||
// this.formData = res.data;
|
||||
this.dialogTitle = '修改资产处置单'
|
||||
} finally {
|
||||
this.formLoading = false
|
||||
}
|
||||
}
|
||||
this.formData.dealNo = createUUID()
|
||||
this.dialogTitle = '新增资产处置单'
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: undefined,
|
||||
dealNo: undefined,
|
||||
dealDate: undefined,
|
||||
dataType: "02",
|
||||
propList: []
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
this.chooseDisable = true
|
||||
const res = await PropertyApi.getPropertyPage(this.queryParams)
|
||||
this.list = res.data.records
|
||||
this.list = this.list.filter(item => !this.formData.propList.map(i => i.id).includes(item.id))
|
||||
this.total = res.data.total
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
chooseProp(row){
|
||||
this.chooseDisable = false;
|
||||
const newRow = {
|
||||
...row,
|
||||
dealWay: null,
|
||||
}
|
||||
this.formData.propList.push(newRow)
|
||||
},
|
||||
deleteProp(index){
|
||||
this.formData.propList.splice(index, 1)
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
// 校验资产列表
|
||||
const flag = await this.validatePropList();
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
await PropertyDealApi.updatePropertyDeal(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await PropertyDealApi.createPropertyDeal(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
async validatePropList() {
|
||||
const tempList = this.formData.propList
|
||||
if (!tempList || tempList.length === 0) {
|
||||
this.$modal.msgError('资产列表不能为空')
|
||||
return false
|
||||
} else {
|
||||
const hasEmptyDealWay = tempList.some(item => !item.dealWay);
|
||||
if (hasEmptyDealWay) {
|
||||
this.$modal.msgError('处置方式不能为空')
|
||||
return false;
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
152
src/views/company/property/propertyDealDisposal/index.vue
Normal file
152
src/views/company/property/propertyDealDisposal/index.vue
Normal file
@ -0,0 +1,152 @@
|
||||
<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="处置单号" prop="dealNo">
|
||||
<el-input v-model="queryParams.dealNo" placeholder="请输入处置单" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="处置方式" prop="dealWay">
|
||||
<el-select v-model="queryParams.dealWay" placeholder="请选择处置方式" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_DEAL_WAY)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="处置日期" prop="dealDateArray">
|
||||
<el-date-picker v-model="queryParams.dealDateArray" 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 v-show="false" label="数据类型" prop="dataType">
|
||||
<el-select v-model="queryParams.dataType" placeholder="请选择处置方式" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PROPERTY_DATA_TYPE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</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>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<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-deal:create']">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处置单号" align="center" prop="dealNo" />
|
||||
<el-table-column label="处置方式" align="center" prop="dealWay">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMPANY_DEAL_WAY" :value="scope.row.dealWay" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资产编号" align="center" prop="propNo" />
|
||||
<el-table-column label="资产名称" align="center" prop="propName" />
|
||||
<el-table-column label="价值类型" align="center" prop="costType" />
|
||||
<el-table-column label="资产原值(元)" align="center" prop="costTotal" />
|
||||
<el-table-column label="净值(元)" align="center" prop="netValue" />
|
||||
<el-table-column label="处置时间" align="center" prop="dealDate" />
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['company:property-deal:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['company:property-deal: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" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<PropertyDealDisposalForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PropertyDealDisposalForm from '@/views/company/property/propertyDealDisposal/form/PropertyDealDisposalForm'
|
||||
|
||||
export default {
|
||||
name: 'PropertyDealDisposal',
|
||||
components:{
|
||||
PropertyDealDisposalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 企业管理-资产处置子列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
dealNo: undefined,
|
||||
dealDateArray: [],
|
||||
dataType: "02",
|
||||
dealWay: undefined,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
// this.loading = true;
|
||||
// const res = await PropertyDealItemApi.getPropertyDealItemPage(this.queryParams);
|
||||
// this.list = res.data.records;
|
||||
// this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除企业管理-资产处置子编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await PropertyDealItemApi.deletePropertyDealItem(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -1,119 +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(base_company表中的id)" prop="corpId">
|
||||
<el-input v-model="formData.corpId" placeholder="请输入企业id(base_company表中的id)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id(system_dept表中的id,用来做数据权限控制)" prop="deptId">
|
||||
<el-input v-model="formData.deptId" placeholder="请输入部门id(system_dept表中的id,用来做数据权限控制)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据类型" prop="dataType">
|
||||
<el-select v-model="formData.dataType" placeholder="请选择数据类型">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PROPERTY_DATA_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="处置/变动单号" prop="dealNo">
|
||||
<el-input v-model="formData.dealNo" placeholder="请输入处置/变动单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处置/变动日期" prop="dealDate">
|
||||
<el-date-picker clearable v-model="formData.dealDate" type="date" value-format="timestamp"
|
||||
placeholder="选择处置/变动日期" />
|
||||
</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 PropertyDealApi from '@/api/company/property/propertydeal';
|
||||
|
||||
export default {
|
||||
name: "PropertyDealForm",
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
corpId: undefined,
|
||||
deptId: undefined,
|
||||
dataType: undefined,
|
||||
dealNo: undefined,
|
||||
dealDate: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await PropertyDealApi.getPropertyDeal(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 PropertyDealApi.updatePropertyDeal(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await PropertyDealApi.createPropertyDeal(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: undefined,
|
||||
corpId: undefined,
|
||||
deptId: undefined,
|
||||
dataType: undefined,
|
||||
dealNo: undefined,
|
||||
dealDate: undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,182 +0,0 @@
|
||||
<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(base_company表中的id)" prop="corpId">
|
||||
<el-input v-model="queryParams.corpId" placeholder="请输入企业id(base_company表中的id)" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id(system_dept表中的id,用来做数据权限控制)" prop="deptId">
|
||||
<el-input v-model="queryParams.deptId" placeholder="请输入部门id(system_dept表中的id,用来做数据权限控制)" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="数据类型" prop="dataType" label-width="60">
|
||||
<el-select v-model="queryParams.dataType" placeholder="请选择数据类型" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PROPERTY_DATA_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="处置/变动单号" prop="dealNo" label-width="100">
|
||||
<el-input v-model="queryParams.dealNo" placeholder="请输入处置/变动单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处置/变动日期" prop="dealDate" label-width="100">
|
||||
<el-date-picker v-model="queryParams.dealDate" 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" label-width="60">
|
||||
<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>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<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-deal: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-deal:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="企业id(base_company表中的id)" align="center" prop="corpId" />
|
||||
<el-table-column label="部门id(system_dept表中的id,用来做数据权限控制)" align="center" prop="deptId" /> -->
|
||||
<el-table-column label="数据类型" align="center" prop="dataType">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROPERTY_DATA_TYPE" :value="scope.row.dataType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处置/变动单号" align="center" prop="dealNo" />
|
||||
<el-table-column label="处置/变动日期" align="center" prop="dealDate" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['company:property-deal:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['company:property-deal: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" />
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<PropertyDealForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import * as PropertyDealApi from '@/api/company/property/propertydeal';
|
||||
import PropertyDealForm from './PropertyDealForm.vue';
|
||||
export default {
|
||||
name: "PropertyDeal",
|
||||
components: {
|
||||
PropertyDealForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 企业管理-资产处置单/变动单列表
|
||||
list: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 选中行
|
||||
currentRow: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
corpId: null,
|
||||
deptId: null,
|
||||
dataType: null,
|
||||
dealNo: null,
|
||||
dealDate: [],
|
||||
createTime: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await PropertyDealApi.getPropertyDealPage(this.queryParams);
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除企业管理-资产处置单/变动单编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await PropertyDealApi.deletePropertyDeal(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有企业管理-资产处置单/变动单数据项?');
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await PropertyDealApi.exportPropertyDealExcel(this.queryParams);
|
||||
this.$download.excel(data, '企业管理-资产处置单/变动单.xls');
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -141,19 +141,10 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
dealId: null,
|
||||
propertyId: null,
|
||||
dealWay: null,
|
||||
oldCorpId: null,
|
||||
corpId: null,
|
||||
oldDeptId: null,
|
||||
deptId: null,
|
||||
oldPosId: null,
|
||||
posId: null,
|
||||
oldUserId: null,
|
||||
userId: null,
|
||||
remark: null,
|
||||
createTime: [],
|
||||
dealNo: undefined,
|
||||
dealDateArray: [],
|
||||
dateType: undefined,
|
||||
dealWay: undefined,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user