提交修试代码

This commit is contained in:
zhouxian 2023-12-18 18:33:36 +08:00
parent 9716592887
commit b1abc0354d
1 changed files with 125 additions and 72 deletions

View File

@ -1,6 +1,12 @@
<template>
<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-input
v-model="queryParams.paName"
@ -11,8 +17,16 @@
</el-form-item>
<el-form-item>
<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-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>
@ -25,7 +39,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:dept:add']"
>新增</el-button>
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
@ -34,9 +49,13 @@
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
>展开/折叠</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
@ -45,24 +64,40 @@
:data="deptList"
row-key="paId"
: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="unitName" label="计量单位" width="260"></el-table-column>
<el-table-column prop="buyPrice" label="购置价格" width="260"></el-table-column>
<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="remark" label="备注信息" width="200"></el-table-column>
<!-- <el-table-column prop="status" label="状态" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
<!-- <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">
<el-table-column
prop="remark"
label="备注信息"
width="200"
></el-table-column>
<!-- <el-table-column prop="status" label="状态" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
<!-- <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">
<el-button
size="mini"
@ -70,14 +105,15 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dept:edit']"
>修改</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-plus"-->
<!-- @click="handleAdd(scope.row)"-->
<!-- v-hasPermi="['system:dept:add']"-->
<!-- >新增</el-button>-->
>修改</el-button
>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-plus"-->
<!-- @click="handleAdd(scope.row)"-->
<!-- v-hasPermi="['system:dept:add']"-->
<!-- >新增</el-button>-->
<el-button
v-if="scope.row.parentId != 0"
size="mini"
@ -85,7 +121,8 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dept:remove']"
>删除</el-button>
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -96,7 +133,12 @@
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">
<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-col>
</el-row>
@ -116,22 +158,33 @@
<el-row>
<el-col :span="12">
<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-col>
<el-col :span="12">
<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-col>
</el-row>
<el-row>
<el-col :span="12">
<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-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@ -290,7 +343,7 @@ export default {
// });
},
/** 提交按钮 */
submitForm: function() {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.paId != undefined) {
@ -311,12 +364,12 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.paName + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除名称为"' + row.paName + '"的数据项?').then(function () {
return delPartType(row.paId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => { });
}
}
};