提交修试代码
This commit is contained in:
parent
9716592887
commit
b1abc0354d
|
|
@ -1,91 +1,128 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
>
|
||||||
<el-form-item label="关键字" prop="paName">
|
<el-form-item label="关键字" prop="paName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.paName"
|
v-model="queryParams.paName"
|
||||||
placeholder="请输入关键字"
|
placeholder="请输入关键字"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:dept:add']"
|
v-hasPermi="['system:dept:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="info"
|
type="info"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-sort"
|
icon="el-icon-sort"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="toggleExpandAll"
|
@click="toggleExpandAll"
|
||||||
>展开/折叠</el-button>
|
>展开/折叠</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>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
v-if="refreshTable"
|
v-if="refreshTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="deptList"
|
:data="deptList"
|
||||||
row-key="paId"
|
row-key="paId"
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="isExpandAll"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
>
|
>
|
||||||
<el-table-column prop="paName" label="名称" width="260"></el-table-column>
|
<el-table-column prop="paName" label="名称" width="260"></el-table-column>
|
||||||
<el-table-column prop="unitName" label="计量单位" width="260"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column prop="buyPrice" label="购置价格" width="260"></el-table-column>
|
prop="unitName"
|
||||||
|
label="计量单位"
|
||||||
|
width="260"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="buyPrice"
|
||||||
|
label="购置价格"
|
||||||
|
width="260"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column prop="num" label="数量" width="200"></el-table-column>
|
<el-table-column prop="num" label="数量" width="200"></el-table-column>
|
||||||
<el-table-column prop="remark" label="备注信息" width="200"></el-table-column>
|
<el-table-column
|
||||||
<!-- <el-table-column prop="status" label="状态" width="100">-->
|
prop="remark"
|
||||||
<!-- <template slot-scope="scope">-->
|
label="备注信息"
|
||||||
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
width="200"
|
||||||
<!-- </template>-->
|
></el-table-column>
|
||||||
<!-- </el-table-column>-->
|
<!-- <el-table-column prop="status" label="状态" width="100">-->
|
||||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
|
||||||
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
<!-- </template>-->
|
||||||
<!-- </template>-->
|
<!-- </el-table-column>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['system:dept:edit']"
|
v-hasPermi="['system:dept:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
<!-- <el-button-->
|
>
|
||||||
<!-- size="mini"-->
|
<!-- <el-button-->
|
||||||
<!-- type="text"-->
|
<!-- size="mini"-->
|
||||||
<!-- icon="el-icon-plus"-->
|
<!-- type="text"-->
|
||||||
<!-- @click="handleAdd(scope.row)"-->
|
<!-- icon="el-icon-plus"-->
|
||||||
<!-- v-hasPermi="['system:dept:add']"-->
|
<!-- @click="handleAdd(scope.row)"-->
|
||||||
<!-- >新增</el-button>-->
|
<!-- v-hasPermi="['system:dept:add']"-->
|
||||||
|
<!-- >新增</el-button>-->
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.parentId != 0"
|
v-if="scope.row.parentId != 0"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['system:dept:remove']"
|
v-hasPermi="['system:dept:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -96,7 +133,12 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" v-if="form.parentId !== 0">
|
<el-col :span="24" v-if="form.parentId !== 0">
|
||||||
<el-form-item label="上级" prop="parentId">
|
<el-form-item label="上级" prop="parentId">
|
||||||
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级" />
|
<treeselect
|
||||||
|
v-model="form.parentId"
|
||||||
|
:options="deptOptions"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
placeholder="选择上级"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -116,22 +158,33 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="购置价格" prop="buyPrice">
|
<el-form-item label="购置价格" prop="buyPrice">
|
||||||
<el-input v-model="form.buyPrice" placeholder="请输入购置价格" maxlength="20" />
|
<el-input
|
||||||
|
v-model="form.buyPrice"
|
||||||
|
placeholder="请输入购置价格"
|
||||||
|
maxlength="20"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="数量" prop="num">
|
<el-form-item label="数量" prop="num">
|
||||||
<el-input v-model="form.num" placeholder="请输入数量" maxlength="20" />
|
<el-input
|
||||||
|
v-model="form.num"
|
||||||
|
placeholder="请输入数量"
|
||||||
|
maxlength="20"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="备注信息" prop="remark">
|
<el-form-item label="备注信息" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
maxlength="50"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
@ -281,16 +334,16 @@ export default {
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
// getDept(row.paId).then(response => {
|
// getDept(row.paId).then(response => {
|
||||||
this.form = row;
|
this.form = row;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改部门";
|
this.title = "修改部门";
|
||||||
// });
|
// });
|
||||||
// listDeptExcludeChild(row.paId).then(response => {
|
// listDeptExcludeChild(row.paId).then(response => {
|
||||||
// this.deptOptions = this.handleTree(response.data, "paId");
|
// this.deptOptions = this.handleTree(response.data, "paId");
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function () {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.paId != undefined) {
|
if (this.form.paId != undefined) {
|
||||||
|
|
@ -311,12 +364,12 @@ export default {
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除名称为"' + row.paName + '"的数据项?').then(function() {
|
this.$modal.confirm('是否确认删除名称为"' + row.paName + '"的数据项?').then(function () {
|
||||||
return delPartType(row.paId);
|
return delPartType(row.paId);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue