|
@@ -1,122 +1,89 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
-
|
|
|
- <el-form-item label="统一社会信用代码" prop="tyshxydm">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.tyshxydm"
|
|
|
- placeholder="请输入统一社会信用代码"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="单位名称" prop="jgmc">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.jgmc"
|
|
|
- placeholder="请输入单位名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设施设备名称" prop="sssbmc">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.sssbmc"
|
|
|
- placeholder="请输入设施设备名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="设施设备类型" prop="sssblx">
|
|
|
- <el-select v-model="queryParams.sssblx" placeholder="请选择设施设备类型" clearable>
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.CH002"
|
|
|
- :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" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @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="handleAdd"-->
|
|
|
-<!-- >新增</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-
|
|
|
- <el-table v-loading="loading" :data="sssbList" >
|
|
|
- <el-table-column label="序号" align="center">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
+ <dept-tree :userId="user.userData.dept.parentId" @handleNodeClick="handleNodeClick">
|
|
|
+ </dept-tree>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="20" :xs="24">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
+ label-width="125px">
|
|
|
+ <el-form-item label="统一社会信用代码" prop="tyshxydm">
|
|
|
+ <el-input v-model="queryParams.tyshxydm" placeholder="请输入统一社会信用代码" clearable
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="单位名称" prop="jgmc">
|
|
|
+ <el-input v-model="queryParams.jgmc" placeholder="请输入单位名称" clearable @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设施设备名称" prop="sssbmc">
|
|
|
+ <el-input v-model="queryParams.sssbmc" placeholder="请输入设施设备名称" clearable
|
|
|
+ @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设施设备类型" prop="sssblx">
|
|
|
+ <el-select v-model="queryParams.sssblx" placeholder="请选择设施设备类型" clearable>
|
|
|
+ <el-option v-for="dict in dict.type.CH002" :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" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table v-loading="loading" :data="sssbList">
|
|
|
+ <el-table-column label="序号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="统一社会信用代码" align="center" prop="tyshxydm" />
|
|
|
+ <el-table-column label="单位名称" align="center" prop="jgmc" />
|
|
|
+ <!-- <el-table-column label="单位所在行政区" align="center" prop="szxzqhName" />-->
|
|
|
+ <el-table-column label="设施设备名称" align="center" prop="sssbmc" />
|
|
|
+ <el-table-column label="设施设备类型" align="center" prop="sssblx">
|
|
|
<template slot-scope="scope">
|
|
|
- {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
|
|
|
+ <dict-tag :options="dict.type.CH002" :value="scope.row.sssblx" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="统一社会信用代码" align="center" prop="tyshxydm" />
|
|
|
- <el-table-column label="单位名称" align="center" prop="jgmc" />
|
|
|
-<!-- <el-table-column label="单位所在行政区" align="center" prop="szxzqhName" />-->
|
|
|
- <el-table-column label="设施设备名称" align="center" prop="sssbmc" />
|
|
|
- <el-table-column label="设施设备类型" align="center" prop="sssblx">
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.CH002" :value="scope.row.sssblx"/>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="设施设备数量" align="center" prop="sssbsl" />
|
|
|
-<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- icon="el-icon-edit"-->
|
|
|
-<!-- @click="handleUpdate(scope.row)"-->
|
|
|
-<!-- v-hasPermi="['organization:sssb:edit']"-->
|
|
|
-<!-- >修改</el-button>-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- icon="el-icon-delete"-->
|
|
|
-<!-- @click="handleDelete(scope.row,(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1,scope.$index)"-->
|
|
|
-<!-- v-hasPermi="['organization:sssb:remove']"-->
|
|
|
-<!-- >删除</el-button>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- </el-table>
|
|
|
+ <el-table-column label="设施设备数量" align="center" prop="sssbsl" />
|
|
|
+ <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- size="mini"-->
|
|
|
+ <!-- type="text"-->
|
|
|
+ <!-- icon="el-icon-edit"-->
|
|
|
+ <!-- @click="handleUpdate(scope.row)"-->
|
|
|
+ <!-- v-hasPermi="['organization:sssb:edit']"-->
|
|
|
+ <!-- >修改</el-button>-->
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- size="mini"-->
|
|
|
+ <!-- type="text"-->
|
|
|
+ <!-- icon="el-icon-delete"-->
|
|
|
+ <!-- @click="handleDelete(scope.row,(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1,scope.$index)"-->
|
|
|
+ <!-- v-hasPermi="['organization:sssb:remove']"-->
|
|
|
+ <!-- >删除</el-button>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
<!-- 添加或修改设施设备对话框 -->
|
|
|
<el-dialog v-dialog-drag :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
|
|
<el-form-item label="设施设备类型" prop="sssblx">
|
|
|
<el-select v-model="form.sssblx" placeholder="请选择设施设备类型">
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.CH002"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
-:value="dict.value"
|
|
|
- ></el-option>
|
|
|
+ <el-option v-for="dict in dict.type.CH002" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设施设备名称" prop="sssbmc">
|
|
|
<el-input v-model="form.sssbmc" placeholder="请输入设施设备名称" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设施设备数量" prop="sssbsl">
|
|
|
- <number v-model.sync="form.sssbsl" placeholder="设施设备数量" :min="1" :max="99999999" :precision="0"/>
|
|
|
+ <number v-model.sync="form.sssbsl" placeholder="设施设备数量" :min="1" :max="99999999" :precision="0" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -129,6 +96,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { listSssb, getSssb, delSssb, addSssb, updateSssb } from "@/api/business/fwjggl/sssb";
|
|
|
+import { mapState } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: "Sssb",
|
|
@@ -140,7 +108,7 @@ export default {
|
|
|
submitFormLoading: false,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
- items : [],
|
|
|
+ items: [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
@@ -173,7 +141,7 @@ export default {
|
|
|
],
|
|
|
sssbmc: [
|
|
|
{ required: true, message: "设施设备名称不能为空", trigger: "blur" },
|
|
|
- { max: 100, message:"字段最大长度为100", trigger:"blur"}
|
|
|
+ { max: 100, message: "字段最大长度为100", trigger: "blur" }
|
|
|
],
|
|
|
sssbsl: [
|
|
|
{ required: true, message: "设施设备数量不能为空", trigger: "blur" }
|
|
@@ -183,8 +151,19 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ is_Component() {
|
|
|
+ return this.isComponent
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 节点单击事件
|
|
|
+ handleNodeClick(data) {
|
|
|
+ this.queryParams.xzqhId = data.code
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
/** 查询设施设备列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -201,7 +180,7 @@ export default {
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
- this.submitFormLoading =false;
|
|
|
+ this.submitFormLoading = false;
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
sssblx: null,
|
|
@@ -244,7 +223,7 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getSssb(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
- this.copyForm=this.deepCopy(response.data)
|
|
|
+ this.copyForm = this.deepCopy(response.data)
|
|
|
this.open = true;
|
|
|
this.title = "修改设施设备";
|
|
|
});
|
|
@@ -255,58 +234,56 @@ export default {
|
|
|
if (valid) {
|
|
|
this.submitFormLoading = true;
|
|
|
if (this.form.id != null) {
|
|
|
- let formData=this.comparisonObject(this.form,this.copyForm)
|
|
|
- if(formData)
|
|
|
- {
|
|
|
- updateSssb({...formData,id:this.form.id}).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.sssbList=this.dataReplacement(this.sssbList,this.form.id,formData);
|
|
|
- }).finally(()=>this.submitFormLoading =false);
|
|
|
- }else {
|
|
|
+ let formData = this.comparisonObject(this.form, this.copyForm)
|
|
|
+ if (formData) {
|
|
|
+ updateSssb({ ...formData, id: this.form.id }).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
- this.submitFormLoading = false;
|
|
|
- }
|
|
|
+ this.sssbList = this.dataReplacement(this.sssbList, this.form.id, formData);
|
|
|
+ }).finally(() => this.submitFormLoading = false);
|
|
|
+ } else {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.submitFormLoading = false;
|
|
|
+ }
|
|
|
} else {
|
|
|
addSssb(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
- if (this.queryParams.pageSize===this.sssbList.length)
|
|
|
- {
|
|
|
- this.sssbList.pop();
|
|
|
- }
|
|
|
- this.sssbList.unshift({...this.form,id:response.data});
|
|
|
- this.total++;
|
|
|
- }).finally(()=>this.submitFormLoading =false);
|
|
|
+ if (this.queryParams.pageSize === this.sssbList.length) {
|
|
|
+ this.sssbList.pop();
|
|
|
+ }
|
|
|
+ this.sssbList.unshift({ ...this.form, id: response.data });
|
|
|
+ this.total++;
|
|
|
+ }).finally(() => this.submitFormLoading = false);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
- handleDelete(row,index,ind) {
|
|
|
+ handleDelete(row, index, ind) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('确认删除' + this.changeDelData(row,'sssbmc','设备设施名称',index) + '的记录?').then(function() {
|
|
|
+ this.$modal.confirm('确认删除' + this.changeDelData(row, 'sssbmc', '设备设施名称', index) + '的记录?').then(function () {
|
|
|
return delSssb(ids);
|
|
|
}).then(() => {
|
|
|
- this.sssbList.splice(ind,1);
|
|
|
- if(this.sssbList.length===0)
|
|
|
- {
|
|
|
- this.getList();
|
|
|
- }else {
|
|
|
- this.total--;
|
|
|
- }
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.sssbList.splice(ind, 1);
|
|
|
+ if (this.sssbList.length === 0) {
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.total--;
|
|
|
+ }
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => { });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
-.el-select{
|
|
|
+.el-select {
|
|
|
width: 100%;
|
|
|
}
|
|
|
-.el-date-editor.el-input{
|
|
|
+
|
|
|
+.el-date-editor.el-input {
|
|
|
width: 100%;
|
|
|
}
|
|
|
</style>
|