|
@@ -85,39 +85,120 @@
|
|
|
|
|
|
<div v-show="formType === 'sixth'">
|
|
<div v-show="formType === 'sixth'">
|
|
<div style="margin: 40px 0 30px;">
|
|
<div style="margin: 40px 0 30px;">
|
|
|
|
+ <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<div class="mymain-container">
|
|
<div class="mymain-container">
|
|
<div class="table">
|
|
<div class="table">
|
|
- <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
|
|
+ <el-table v-loading="listLoading" :data="sixthForm" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
|
|
- <el-table-column align="left" label="名称" prop="takerName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="left" label="备注" prop="identity" min-width="170" show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
+ <el-table-column align="left" label="名称" prop="dictCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="left" label="备注" prop="remark" min-width="170" show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" label="操作" prop="caozuo" min-width="160" show-overflow-tooltip fixed="right">
|
|
|
|
- <!-- <template slot-scope="scope">
|
|
|
|
- <el-button type="text" class="textColor">编辑</el-button>
|
|
|
|
- </template> -->
|
|
|
|
|
|
+ <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
|
|
|
|
+ <el-popconfirm @onConfirm="deleFn(scope.row.sysDictId)" v-if="$checkBtnRole('del', $route.meta.roles)" title="这是一段内容确定删除吗?">
|
|
|
|
+ <el-button type="text" class="textColor" slot="reference">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
- <!-- 分页 -->
|
|
|
|
- <div class="fr">
|
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
|
|
|
|
- </el-pagination>
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="formType === 'seventh'">
|
|
|
|
+ <div style="margin: 40px 0 30px;">
|
|
|
|
+ <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <div class="mymain-container">
|
|
|
|
+ <div class="table">
|
|
|
|
+ <el-table v-loading="listLoading" :data="seventhForm" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
+
|
|
|
|
+ <el-table-column align="left" label="名称" prop="dictCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="left" label="备注" prop="remark" min-width="170" show-overflow-tooltip></el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
|
|
|
|
+ <el-popconfirm @onConfirm="deleFn(scope.row.sysDictId)" v-if="$checkBtnRole('del', $route.meta.roles)" title="这是一段内容确定删除吗?">
|
|
|
|
+ <el-button type="text" class="textColor" slot="reference">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div v-show="formType === 'eigth'">
|
|
|
|
+ <div style="margin: 40px 0 30px;">
|
|
|
|
+ <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <div class="mymain-container">
|
|
|
|
+ <div class="table">
|
|
|
|
+ <el-table v-loading="listLoading" :data="eigthForm" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
|
+
|
|
|
|
+ <el-table-column align="left" label="名称" prop="dictCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="left" label="备注" prop="remark" min-width="170" show-overflow-tooltip></el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
|
|
|
|
+ <el-popconfirm @onConfirm="deleFn(scope.row.sysDictId)" v-if="$checkBtnRole('del', $route.meta.roles)" title="这是一段内容确定删除吗?">
|
|
|
|
+ <el-button type="text" class="textColor" slot="reference">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-button type="primary" size="small">确 定</el-button>
|
|
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- //弹窗 -->
|
|
|
|
+ <el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
|
|
|
|
+ <el-form size="mini" ref="addForm" :rules="rules" :model="addForm" label-width="120px">
|
|
|
|
+ <el-form-item label="名称" prop="dictCode">
|
|
|
|
+ <el-input v-model="addForm.dictCode"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
|
+ <el-input v-model="addForm.remark"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button size="mini" @click="cancelFn">取 消</el-button>
|
|
|
|
+ <el-button size="mini" type="primary" @click="addDataFn">确 定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getDictList, editDictList } from "@/api/common";
|
|
|
|
|
|
+import {
|
|
|
|
+ getDictList,
|
|
|
|
+ editDictList,
|
|
|
|
+ addDictList,
|
|
|
|
+ deleDictList,
|
|
|
|
+} from "@/api/common";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ listLoading: false, // 列表加载loading
|
|
|
|
+ rules: {
|
|
|
|
+ dictCode: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
|
|
|
+ },
|
|
|
|
+ addForm: {
|
|
|
|
+ dictCode: "",
|
|
|
|
+ remark: "",
|
|
|
|
+ },
|
|
|
|
+ dialogForm: false,
|
|
|
|
+ title: "新增",
|
|
formType: "first",
|
|
formType: "first",
|
|
firstForm: {
|
|
firstForm: {
|
|
input1: {},
|
|
input1: {},
|
|
@@ -139,12 +220,87 @@ export default {
|
|
fifthForm: {
|
|
fifthForm: {
|
|
input1: {},
|
|
input1: {},
|
|
},
|
|
},
|
|
|
|
+ sixthForm: [],
|
|
|
|
+ seventhForm: [],
|
|
|
|
+ eigthForm: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getDetail("first");
|
|
this.getDetail("first");
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //删除
|
|
|
|
+ async deleFn(id) {
|
|
|
|
+ await deleDictList({ id: id });
|
|
|
|
+ this.$message.success("删除成功");
|
|
|
|
+ this.getDetail(this.formType);
|
|
|
|
+ },
|
|
|
|
+ //编辑
|
|
|
|
+ editFn(value) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.title = "编辑";
|
|
|
|
+ this.addForm.dictCode = value.dictCode;
|
|
|
|
+ this.addForm.remark = value.remark;
|
|
|
|
+ this.addForm.sysDictId = value.sysDictId;
|
|
|
|
+ this.addForm.dictType = value.dictType;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.dialogForm = true;
|
|
|
|
+ },
|
|
|
|
+ //弹窗确定
|
|
|
|
+ async addDataFn() {
|
|
|
|
+ // console.log(this.addForm);
|
|
|
|
+
|
|
|
|
+ await this.$refs.addForm.validate();
|
|
|
|
+
|
|
|
|
+ if (this.addForm.sysDictId) {
|
|
|
|
+ //编辑
|
|
|
|
+ await editDictList([
|
|
|
|
+ {
|
|
|
|
+ ...this.addForm,
|
|
|
|
+ },
|
|
|
|
+ ]);
|
|
|
|
+ this.$message.success("编辑成功");
|
|
|
|
+ } else {
|
|
|
|
+ let type = "";
|
|
|
|
+ if (this.formType == "sixth") {
|
|
|
|
+ type = "MACHINE_TYPE";
|
|
|
|
+ } else if (this.formType == "seventh") {
|
|
|
|
+ type = "SIGN_TYPE";
|
|
|
|
+ } else {
|
|
|
|
+ type = "POWER_CATEGORY";
|
|
|
|
+ }
|
|
|
|
+ await addDictList({
|
|
|
|
+ ...this.addForm,
|
|
|
|
+ dictValue: this.addForm.dictCode,
|
|
|
|
+ dictType: type,
|
|
|
|
+ });
|
|
|
|
+ this.$message.success("新增成功");
|
|
|
|
+ }
|
|
|
|
+ this.getDetail(this.formType);
|
|
|
|
+
|
|
|
|
+ this.addForm = {
|
|
|
|
+ dictCode: "",
|
|
|
|
+ remark: "",
|
|
|
|
+ };
|
|
|
|
+ this.dialogForm = false;
|
|
|
|
+ },
|
|
|
|
+ //cancelFn 弹窗取消
|
|
|
|
+ async cancelFn() {
|
|
|
|
+ await this.$refs.addForm.resetFields();
|
|
|
|
+
|
|
|
|
+ this.addForm = {
|
|
|
|
+ dictCode: "",
|
|
|
|
+ remark: "",
|
|
|
|
+ };
|
|
|
|
+ this.dialogForm = false;
|
|
|
|
+ // this.addForm.dictCode ='';
|
|
|
|
+ },
|
|
|
|
+ //展示新增弹窗
|
|
|
|
+ addShowFn() {
|
|
|
|
+ this.title = "新增";
|
|
|
|
+ this.dialogForm = true;
|
|
|
|
+ },
|
|
// 查询按钮权限
|
|
// 查询按钮权限
|
|
checkBtnRole(value) {
|
|
checkBtnRole(value) {
|
|
// let btnRole = this.$route.meta.roles;
|
|
// let btnRole = this.$route.meta.roles;
|
|
@@ -166,8 +322,8 @@ export default {
|
|
fourth: "STOCK_ORDER",
|
|
fourth: "STOCK_ORDER",
|
|
fifth: "PRINT_PASSWORD",
|
|
fifth: "PRINT_PASSWORD",
|
|
sixth: "MACHINE_TYPE",
|
|
sixth: "MACHINE_TYPE",
|
|
- seventh: "POWER_CATEGORY",
|
|
|
|
- eigth: "SIGN_TYPE",
|
|
|
|
|
|
+ seventh: "SIGN_TYPE",
|
|
|
|
+ eigth: "POWER_CATEGORY",
|
|
};
|
|
};
|
|
getDictList({ sysDictEnum: MAP[type] }).then((res) => {
|
|
getDictList({ sysDictEnum: MAP[type] }).then((res) => {
|
|
let data = res.data.map((item) => {
|
|
let data = res.data.map((item) => {
|
|
@@ -186,6 +342,15 @@ export default {
|
|
this[type + "Form"].input5 = data[4];
|
|
this[type + "Form"].input5 = data[4];
|
|
this[type + "Form"].input6 = data[5];
|
|
this[type + "Form"].input6 = data[5];
|
|
}
|
|
}
|
|
|
|
+ if (type == "sixth") {
|
|
|
|
+ this.sixthForm = res.data;
|
|
|
|
+ }
|
|
|
|
+ if (type == "seventh") {
|
|
|
|
+ this.seventhForm = res.data;
|
|
|
|
+ }
|
|
|
|
+ if (type == "eigth") {
|
|
|
|
+ this.eigthForm = res.data;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|