| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | @tree-load="treeLoad" |
| | | > |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-setting" |
| | | size="small" |
| | | v-if="permission.api_scope_setting" |
| | | plain |
| | | style="border: 0;background-color: transparent !important;" |
| | | @click.stop="handleDataScope(row)">权限配置 |
| | | </el-button> |
| | | @click.stop="handleDataScope(row)" |
| | | >权限配置</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="source"> |
| | | <div style="text-align:center"> |
| | |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | <el-drawer :title="`[${scopeMenuName}] 接口权限配置`" :visible.sync="drawerVisible" :direction="direction" |
| | | <el-drawer |
| | | :title="`[${scopeMenuName}] 接口权限配置`" |
| | | :visible.sync="drawerVisible" |
| | | :direction="direction" |
| | | append-to-body |
| | | :before-close="handleDrawerClose" size="1000px"> |
| | | :before-close="handleDrawerClose" |
| | | size="1000px" |
| | | > |
| | | <basic-container> |
| | | <avue-crud :option="optionScope" |
| | | <avue-crud |
| | | :option="optionScope" |
| | | :data="dataScope" |
| | | :page="pageScope" |
| | | v-model="formScope" |
| | |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | | @on-load="onLoadScope"> |
| | | @on-load="onLoadScope" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDeleteScope">删 除 |
| | | </el-button> |
| | | @click="handleDeleteScope" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="scopeType"> |
| | | <template slot-scope="{row}" slot="scopeType"> |
| | | <el-tag>{{row.scopeTypeName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | update, |
| | | getLazyMenuList, |
| | | getMenu |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | import { |
| | | addApiScope, |
| | | removeApiScope, |
| | | updateApiScope, |
| | | getListApiScope, |
| | | getMenuApiScope |
| | | } from "@/api/system/scope"; |
| | | import {mapGetters} from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | } from "@/api/system/scope" |
| | | import { mapGetters } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | dataScope: [] |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | scopeIds() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionListScope.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | // 菜单管理模块 |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenu(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | const parentId = tree.id |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | resolve(res.data.data) |
| | | }) |
| | | }, |
| | | // 数据权限模块 |
| | | handleDataScope(row) { |
| | | this.drawerVisible = true; |
| | | this.scopeMenuId = row.id; |
| | | this.scopeMenuName = row.name; |
| | | this.drawerVisible = true |
| | | this.scopeMenuId = row.id |
| | | this.scopeMenuName = row.name |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | handleDrawerClose(hide) { |
| | | hide(); |
| | | hide() |
| | | }, |
| | | rowSaveScope(row, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | addApiScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdateScope(row, index, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | updateApiScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDelScope(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeApiScope(row.id); |
| | | return removeApiScope(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDeleteScope() { |
| | | if (this.selectionListScope.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeApiScope(this.scopeIds); |
| | | return removeApiScope(this.scopeIds) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crudScope.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crudScope.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpenScope(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenuApiScope(this.formScope.id).then(res => { |
| | | this.formScope = res.data.data; |
| | | }); |
| | | this.formScope = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchResetScope() { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | searchChangeScope(params, done) { |
| | | this.onLoadScope(this.pageScope, params); |
| | | done(); |
| | | this.onLoadScope(this.pageScope, params) |
| | | done() |
| | | }, |
| | | selectionChangeScope(list) { |
| | | this.selectionListScope = list; |
| | | this.selectionListScope = list |
| | | }, |
| | | currentChangeScope(currentPage) { |
| | | this.pageScope.currentPage = currentPage; |
| | | this.pageScope.currentPage = currentPage |
| | | }, |
| | | sizeChangeScope(pageSize) { |
| | | this.pageScope.pageSize = pageSize; |
| | | this.pageScope.pageSize = pageSize |
| | | }, |
| | | onLoadScope(page, params = {}) { |
| | | this.scopeLoading = true; |
| | | this.scopeLoading = true |
| | | const values = { |
| | | ...params, |
| | | menuId: this.scopeMenuId, |
| | | } |
| | | getListApiScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageScope.total = data.total; |
| | | this.dataScope = data.records; |
| | | this.selectionListScope = []; |
| | | this.scopeLoading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.pageScope.total = data.total |
| | | this.dataScope = data.records |
| | | this.selectionListScope = [] |
| | | this.scopeLoading = false |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | @tree-load="treeLoad" |
| | | > |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-setting" |
| | | size="small" |
| | | v-if="permission.data_scope_setting" |
| | | plain |
| | | style="border: 0;background-color: transparent !important;" |
| | | @click.stop="handleDataScope(row)">权限配置 |
| | | </el-button> |
| | | @click.stop="handleDataScope(row)" |
| | | >权限配置</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="source"> |
| | | <div style="text-align:center"> |
| | |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction" |
| | | <el-drawer |
| | | :title="`[${scopeMenuName}] 数据权限配置`" |
| | | :visible.sync="drawerVisible" |
| | | :direction="direction" |
| | | append-to-body |
| | | :before-close="handleDrawerClose" size="1000px"> |
| | | :before-close="handleDrawerClose" |
| | | size="1000px" |
| | | > |
| | | <basic-container> |
| | | <avue-crud :option="optionScope" |
| | | <avue-crud |
| | | :option="optionScope" |
| | | :data="dataScope" |
| | | :page="pageScope" |
| | | v-model="formScope" |
| | |
| | | @selection-change="selectionChangeScope" |
| | | @current-change="currentChangeScope" |
| | | @size-change="sizeChangeScope" |
| | | @on-load="onLoadScope"> |
| | | @on-load="onLoadScope" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDeleteScope">删 除 |
| | | </el-button> |
| | | @click="handleDeleteScope" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="scopeType"> |
| | | <template slot-scope="{row}" slot="scopeType"> |
| | | <el-tag>{{row.scopeTypeName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | update, |
| | | getLazyMenuList, |
| | | getMenu |
| | | } from "@/api/system/menu"; |
| | | } from "@/api/system/menu" |
| | | import { |
| | | addDataScope, |
| | | removeDataScope, |
| | | updateDataScope, |
| | | getListDataScope, |
| | | getMenuDataScope |
| | | } from "@/api/system/scope"; |
| | | import {mapGetters} from "vuex"; |
| | | import iconList from "@/config/iconList"; |
| | | import func from "@/util/func"; |
| | | } from "@/api/system/scope" |
| | | import { mapGetters } from "vuex" |
| | | import iconList from "@/config/iconList" |
| | | import func from "@/util/func" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | dataScope: [] |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'formScope.scopeType'() { |
| | | this.initScope(); |
| | | this.initScope() |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.menu_view, false), |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | scopeIds() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionListScope.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | initScope() { |
| | | const scopeType = func.toInt(this.formScope.scopeType); |
| | | const watchMode = this.watchMode; |
| | | let column = "-", name = "暂无"; |
| | | const scopeType = func.toInt(this.formScope.scopeType) |
| | | const watchMode = this.watchMode |
| | | let column = "-", name = "暂无" |
| | | if (scopeType === 1) { |
| | | column = "-"; |
| | | name = "全部可见"; |
| | | column = "-" |
| | | name = "全部可见" |
| | | } else if (scopeType === 2) { |
| | | column = "create_user"; |
| | | name = "本人可见"; |
| | | column = "create_user" |
| | | name = "本人可见" |
| | | } else if (scopeType === 3) { |
| | | column = "create_dept"; |
| | | name = "所在机构可见"; |
| | | column = "create_dept" |
| | | name = "所在机构可见" |
| | | } else if (scopeType === 4) { |
| | | column = "create_dept"; |
| | | name = "所在机构可见及子级可见"; |
| | | column = "create_dept" |
| | | name = "所在机构可见及子级可见" |
| | | } else if (scopeType === 5) { |
| | | column = ""; |
| | | name = "自定义"; |
| | | column = "" |
| | | name = "自定义" |
| | | } |
| | | this.$refs.crudScope.option.column.filter(item => { |
| | | if (watchMode) { |
| | | if (item.prop === "scopeName") { |
| | | this.formScope.scopeName = `${this.scopeMenuName} [${name}]`; |
| | | this.formScope.scopeName = `${this.scopeMenuName} [${name}]` |
| | | } |
| | | if (item.prop === "resourceCode") { |
| | | this.formScope.resourceCode = this.scopeMenuCode; |
| | | this.formScope.resourceCode = this.scopeMenuCode |
| | | } |
| | | if (item.prop === "scopeColumn") { |
| | | this.formScope.scopeColumn = column; |
| | | this.formScope.scopeColumn = column |
| | | } |
| | | } |
| | | if (item.prop === "scopeValue") { |
| | | item.display = scopeType === 5; |
| | | item.display = scopeType === 5 |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | // 菜单管理模块 |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.parentId = 0; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.parentId = 0 |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.parentId = '' |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getMenu(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | beforeClose(done) { |
| | | this.formScope = {}; |
| | | done(); |
| | | this.formScope = {} |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | const parentId = tree.id |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | resolve(res.data.data) |
| | | }) |
| | | }, |
| | | // 数据权限模块 |
| | | handleDataScope(row) { |
| | | this.drawerVisible = true; |
| | | this.scopeMenuId = row.id; |
| | | this.scopeMenuCode = row.code; |
| | | this.scopeMenuName = row.name; |
| | | this.drawerVisible = true |
| | | this.scopeMenuId = row.id |
| | | this.scopeMenuCode = row.code |
| | | this.scopeMenuName = row.name |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | handleDrawerClose(hide) { |
| | | hide(); |
| | | hide() |
| | | }, |
| | | rowSaveScope(row, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | addDataScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdateScope(row, index, done, loading) { |
| | | row = { |
| | | ...row, |
| | | menuId: this.scopeMenuId, |
| | | }; |
| | | } |
| | | updateDataScope(row).then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDelScope(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeDataScope(row.id); |
| | | return removeDataScope(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDeleteScope() { |
| | | if (this.selectionListScope.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeDataScope(this.scopeIds); |
| | | return removeDataScope(this.scopeIds) |
| | | }) |
| | | .then(() => { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crudScope.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crudScope.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpenScope(done, type) { |
| | | if (["add"].includes(type)) { |
| | | this.watchMode = true; |
| | | this.initScope(); |
| | | this.watchMode = true |
| | | this.initScope() |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | this.watchMode = false; |
| | | this.watchMode = false |
| | | getMenuDataScope(this.formScope.id).then(res => { |
| | | this.formScope = res.data.data; |
| | | }); |
| | | this.formScope = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchResetScope() { |
| | | this.onLoadScope(this.pageScope); |
| | | this.onLoadScope(this.pageScope) |
| | | }, |
| | | searchChangeScope(params, done) { |
| | | this.onLoadScope(this.pageScope, params); |
| | | done(); |
| | | this.onLoadScope(this.pageScope, params) |
| | | done() |
| | | }, |
| | | selectionChangeScope(list) { |
| | | this.selectionListScope = list; |
| | | this.selectionListScope = list |
| | | }, |
| | | currentChangeScope(currentPage) { |
| | | this.pageScope.currentPage = currentPage; |
| | | this.pageScope.currentPage = currentPage |
| | | }, |
| | | sizeChangeScope(pageSize) { |
| | | this.pageScope.pageSize = pageSize; |
| | | this.pageScope.pageSize = pageSize |
| | | }, |
| | | onLoadScope(page, params = {}) { |
| | | this.scopeLoading = true; |
| | | this.scopeLoading = true |
| | | const values = { |
| | | ...params, |
| | | menuId: this.scopeMenuId, |
| | | } |
| | | getListDataScope(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.pageScope.total = data.total; |
| | | this.dataScope = data.records; |
| | | this.selectionListScope = []; |
| | | this.scopeLoading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.pageScope.total = data.total |
| | | this.dataScope = data.records |
| | | this.selectionListScope = [] |
| | | this.scopeLoading = false |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.role_delete" |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button size="small" |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-setting" |
| | | @click="handleRole" |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | plain>权限设置 |
| | | </el-button> |
| | | plain |
| | | >权限设置</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="角色权限配置" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="345px"> |
| | | <el-dialog title="角色权限配置" append-to-body :visible.sync="box" width="345px"> |
| | | <el-tabs type="border-card"> |
| | | <el-tab-pane label="菜单权限"> |
| | | <el-tree :data="menuGrantList" |
| | | <el-tree |
| | | :data="menuGrantList" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="treeMenu" |
| | | :default-checked-keys="menuTreeObj" |
| | | :props="props"> |
| | | </el-tree> |
| | | :props="props" |
| | | ></el-tree> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="数据权限"> |
| | | <el-tree :data="dataScopeGrantList" |
| | | <el-tree |
| | | :data="dataScopeGrantList" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="treeDataScope" |
| | | :default-checked-keys="dataScopeTreeObj" |
| | | :props="props"> |
| | | </el-tree> |
| | | :props="props" |
| | | ></el-tree> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="接口权限"> |
| | | <el-tree :data="apiScopeGrantList" |
| | | <el-tree |
| | | :data="apiScopeGrantList" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="treeApiScope" |
| | | :default-checked-keys="apiScopeTreeObj" |
| | | :props="props"> |
| | | </el-tree> |
| | | :props="props" |
| | | ></el-tree> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="box = false">取 消</el-button> |
| | | <el-button type="primary" |
| | | @click="submit">确 定</el-button> |
| | | <el-button type="primary" @click="submit">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role"; |
| | | import {mapGetters} from "vuex"; |
| | | import website from '@/config/website'; |
| | | import { add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update } from "@/api/system/role" |
| | | import { mapGetters } from "vuex" |
| | | import website from '@/config/website' |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.role_view, false), |
| | | delBtn: this.vaildData(this.permission.role_delete, false), |
| | | editBtn: this.vaildData(this.permission.role_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | ids.push(ele.id) |
| | | |
| | | }); |
| | | return ids.join(","); |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | idsArray() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids; |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids |
| | | } |
| | | }, |
| | | methods: { |
| | | initData(roleId){ |
| | | getRoleTreeById(roleId).then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.option.column, "parentId") |
| | | column.dicData = res.data.data |
| | | }) |
| | | }, |
| | | submit() { |
| | | const menuList = this.$refs.treeMenu.getCheckedKeys(); |
| | | const dataScopeList = this.$refs.treeDataScope.getCheckedKeys(); |
| | | const apiScopeList = this.$refs.treeApiScope.getCheckedKeys(); |
| | | const menuList = this.$refs.treeMenu.getCheckedKeys() |
| | | const dataScopeList = this.$refs.treeDataScope.getCheckedKeys() |
| | | const apiScopeList = this.$refs.treeApiScope.getCheckedKeys() |
| | | grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => { |
| | | this.box = false; |
| | | this.box = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["add", "edit"].includes(type)) { |
| | | this.initData(this.form.id); |
| | | this.initData(this.form.id) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | handleRole() { |
| | | if (this.selectionList.length !== 1) { |
| | | this.$message.warning("只能选择一条数据"); |
| | | return; |
| | | this.$message.warning("只能选择一条数据") |
| | | return |
| | | } |
| | | this.menuTreeObj = []; |
| | | this.dataScopeTreeObj = []; |
| | | this.apiScopeTreeObj = []; |
| | | this.menuTreeObj = [] |
| | | this.dataScopeTreeObj = [] |
| | | this.apiScopeTreeObj = [] |
| | | grantTree() |
| | | .then(res => { |
| | | this.menuGrantList = res.data.data.menu; |
| | | this.dataScopeGrantList = res.data.data.dataScope; |
| | | this.apiScopeGrantList = res.data.data.apiScope; |
| | | this.menuGrantList = res.data.data.menu |
| | | this.dataScopeGrantList = res.data.data.dataScope |
| | | this.apiScopeGrantList = res.data.data.apiScope |
| | | getRole(this.ids).then(res => { |
| | | this.menuTreeObj = res.data.data.menu; |
| | | this.dataScopeTreeObj = res.data.data.dataScope; |
| | | this.apiScopeTreeObj = res.data.data.apiScope; |
| | | this.box = true; |
| | | }); |
| | | }); |
| | | this.menuTreeObj = res.data.data.menu |
| | | this.dataScopeTreeObj = res.data.data.dataScope |
| | | this.apiScopeTreeObj = res.data.data.apiScope |
| | | this.box = true |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | this.data = res.data.data |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <el-col :span="15"> |
| | | <basic-container> |
| | | <el-button-group> |
| | | <el-button v-if="permission.region_add" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addChildren">新增下级</el-button> |
| | | <el-button v-if="permission.region_delete" type="primary" size="small" icon="el-icon-delete" @click="handleDelete">删除</el-button> |
| | | <el-button v-if="permission.region_import" type="primary" size="small" icon="el-icon-upload2" @click="handleImport">导入</el-button> |
| | | <el-button v-if="permission.region_export" type="primary" size="small" icon="el-icon-download" @click="handleExport">导出</el-button> |
| | | <el-button v-if="permission.region_debug" type="primary" size="small" icon="el-icon-video-play" @click="handleDebug">调试</el-button> |
| | | <el-button |
| | | v-if="permission.region_add" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="addChildren" |
| | | >新增下级</el-button> |
| | | <el-button |
| | | v-if="permission.region_delete" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删除</el-button> |
| | | <el-button |
| | | v-if="permission.region_import" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-upload2" |
| | | @click="handleImport" |
| | | >导入</el-button> |
| | | <el-button |
| | | v-if="permission.region_export" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-download" |
| | | @click="handleExport" |
| | | >导出</el-button> |
| | | <el-button |
| | | v-if="permission.region_debug" |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-video-play" |
| | | @click="handleDebug" |
| | | >调试</el-button> |
| | | </el-button-group> |
| | | </basic-container> |
| | | <basic-container> |
| | | <avue-form ref="form" :option="regionOption" v-model="regionForm" @submit="handleSubmit"> |
| | | <avue-form |
| | | ref="form" |
| | | :option="regionOption" |
| | | v-model="regionForm" |
| | | @submit="handleSubmit" |
| | | > |
| | | <template slot="code" slot-scope="{}"> |
| | | <el-input placeholder="请输入 区划子编号" v-model="regionForm.subCode"> |
| | | <template slot="prepend">{{regionForm.parentCode}}</template> |
| | | </el-input> |
| | | </template> |
| | | </avue-form> |
| | | <el-dialog title="行政区划数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px"> |
| | | <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
| | | <el-dialog title="行政区划数据导入" append-to-body :visible.sync="excelBox" width="555px"> |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | 点击下载 |
| | | <i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <el-dialog title="行政区划数据调试" |
| | | append-to-body |
| | | :visible.sync="debugBox" |
| | | width="350px"> |
| | | <el-dialog title="行政区划数据调试" append-to-body :visible.sync="debugBox" width="350px"> |
| | | <avue-form :option="debugOption" v-model="debugForm"/> |
| | | </el-dialog> |
| | | </basic-container> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getLazyTree, getDetail, submit, remove} from "@/api/base/region"; |
| | | import {exportBlob} from "@/api/common"; |
| | | import {mapGetters} from "vuex"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import {downloadXls} from "@/util/util"; |
| | | import {dateNow} from "@/util/date"; |
| | | import {getToken} from "@/util/auth"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import { getLazyTree, getDetail, submit, remove } from "@/api/base/region" |
| | | import { exportBlob } from "@/api/common" |
| | | import { mapGetters } from "vuex" |
| | | import { validatenull } from "@/util/validate" |
| | | import { downloadXls } from "@/util/util" |
| | | import { dateNow } from "@/util/date" |
| | | import { getToken } from "@/util/auth" |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | nodeKey: 'id', |
| | | lazy: true, |
| | | treeLoad: function (node, resolve) { |
| | | const parentCode = (node.level === 0) ? "00" : node.data.id; |
| | | const parentCode = (node.level === 0) ? "00" : node.data.id |
| | | getLazyTree(parentCode).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | return { |
| | |
| | | leaf: !item.hasChildren |
| | | } |
| | | })) |
| | | }); |
| | | }) |
| | | }, |
| | | addBtn: false, |
| | | menu: false, |
| | |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'regionForm.subCode'() { |
| | | this.regionForm.code = this.regionForm.parentCode + this.regionForm.subCode; |
| | | this.regionForm.code = this.regionForm.parentCode + this.regionForm.subCode |
| | | }, |
| | | 'excelForm.isCovered'() { |
| | | if (this.excelForm.isCovered !== '') { |
| | | const column = this.findObject(this.excelOption.column, "excelFile"); |
| | | column.action = `/api/blade-system/region/import-region?isCovered=${this.excelForm.isCovered}`; |
| | | const column = this.findObject(this.excelOption.column, "excelFile") |
| | | column.action = `/api/blade-system/region/import-region?isCovered=${this.excelForm.isCovered}` |
| | | } |
| | | } |
| | | }, |
| | |
| | | viewBtn: this.vaildData(this.permission.region_view, false), |
| | | delBtn: this.vaildData(this.permission.region_delete, false), |
| | | editBtn: this.vaildData(this.permission.region_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | initTree() { |
| | | this.treeData = []; |
| | | this.treeData = [] |
| | | getLazyTree(this.topCode).then(res => { |
| | | this.treeData = res.data.data.map(item => { |
| | | return { |
| | |
| | | leaf: !item.hasChildren |
| | | } |
| | | }) |
| | | }); |
| | | }) |
| | | }, |
| | | nodeClick(data) { |
| | | const column = this.findObject(this.regionOption.column, "parentCode"); |
| | | column.disabled = true; |
| | | this.treeCode = data.id; |
| | | this.treeParentCode = data.parentId; |
| | | const column = this.findObject(this.regionOption.column, "parentCode") |
| | | column.disabled = true |
| | | this.treeCode = data.id |
| | | this.treeParentCode = data.parentId |
| | | getDetail(this.treeCode).then(res => { |
| | | this.regionForm = res.data.data; |
| | | this.regionForm.subCode = this.regionForm.code.replace(this.regionForm.parentCode, ''); |
| | | this.regionForm = res.data.data |
| | | this.regionForm.subCode = this.regionForm.code.replace(this.regionForm.parentCode, '') |
| | | }) |
| | | }, |
| | | addChildren() { |
| | | if (validatenull(this.regionForm.code) || validatenull(this.regionForm.name)) { |
| | | this.$message.warning("请先选择一项区划"); |
| | | return; |
| | | this.$message.warning("请先选择一项区划") |
| | | return |
| | | } |
| | | this.regionForm.parentCode = this.regionForm.code; |
| | | this.regionForm.parentName = this.regionForm.name; |
| | | this.regionForm.code = ''; |
| | | this.regionForm.subCode = ''; |
| | | this.regionForm.name = ''; |
| | | this.regionForm.regionLevel = (this.regionForm.regionLevel === 5) ? 5 : this.regionForm.regionLevel + 1; |
| | | this.regionForm.parentCode = this.regionForm.code |
| | | this.regionForm.parentName = this.regionForm.name |
| | | this.regionForm.code = '' |
| | | this.regionForm.subCode = '' |
| | | this.regionForm.name = '' |
| | | this.regionForm.regionLevel = (this.regionForm.regionLevel === 5) ? 5 : this.regionForm.regionLevel + 1 |
| | | }, |
| | | handleSubmit(form, done, loading) { |
| | | const parentCode = form.parentCode === this.topCode ? '' : form.parentCode; |
| | | form.code = parentCode + form.subCode; |
| | | const parentCode = form.parentCode === this.topCode ? '' : form.parentCode |
| | | form.code = parentCode + form.subCode |
| | | submit(form).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.initTree(); |
| | | this.regionForm.subCode = ''; |
| | | this.$refs.form.resetForm(); |
| | | done(); |
| | | }) |
| | | this.initTree() |
| | | this.regionForm.subCode = '' |
| | | this.$refs.form.resetForm() |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (validatenull(this.regionForm.code)) { |
| | | this.$message.warning("请先选择一项区划"); |
| | | return; |
| | | this.$message.warning("请先选择一项区划") |
| | | return |
| | | } |
| | | this.$confirm(`确定将 [${this.regionForm.name}] 数据删除?`, { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.treeCode); |
| | | return remove(this.treeCode) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.initTree(); |
| | | this.regionForm.subCode = ''; |
| | | this.$refs.form.resetForm(); |
| | | }); |
| | | }) |
| | | this.initTree() |
| | | this.regionForm.subCode = '' |
| | | this.$refs.form.resetForm() |
| | | }) |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.initTree(); |
| | | done(); |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.initTree() |
| | | done() |
| | | }, |
| | | handleDebug() { |
| | | this.debugBox = true; |
| | | this.debugBox = true |
| | | }, |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | this.excelBox = true |
| | | }, |
| | | handleExport() { |
| | | this.$confirm("是否导出行政区划数据?", "提示", { |
| | |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | NProgress.start() |
| | | exportBlob(`/api/blade-system/region/export-region?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, `行政区划数据${dateNow()}.xlsx`); |
| | | NProgress.done(); |
| | | downloadXls(res.data, `行政区划数据${dateNow()}.xlsx`) |
| | | NProgress.done() |
| | | }) |
| | | }); |
| | | }) |
| | | }, |
| | | handleTemplate() { |
| | | exportBlob(`/api/blade-system/region/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => { |
| | | downloadXls(res.data, "行政区划模板.xlsx"); |
| | | downloadXls(res.data, "行政区划模板.xlsx") |
| | | }) |
| | | }, |
| | | } |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.notice_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <template slot-scope="{row}" slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, remove, update, add, getNotice} from "@/api/desk/notice"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, remove, update, add, getNotice } from "@/api/desk/notice" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.notice_view, false), |
| | | delBtn: this.vaildData(this.permission.notice_delete, false), |
| | | editBtn: this.vaildData(this.permission.notice_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getNotice(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {releaseTimeRange} = this.query; |
| | | const { releaseTimeRange } = this.query |
| | | let values = { |
| | | ...params, |
| | | ...this.query |
| | | }; |
| | | } |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...values, |
| | | releaseTime_datege: releaseTimeRange[0], |
| | | releaseTime_datelt: releaseTimeRange[1], |
| | | }; |
| | | values.releaseTimeRange = null; |
| | | } |
| | | this.loading = true; |
| | | values.releaseTimeRange = null |
| | | } |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | v-if="permission.farm_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | <!-- 地图插入 --> |
| | | <template slot-scope="{ type, disabled }" slot="lineForm"> |
| | | <getMapDataInThere |
| | | ref="getMapData" |
| | | id="getMapData" |
| | | @setMapData="setMapData" |
| | | ></getMapDataInThere> |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | </template> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | |
| | | type="text" |
| | | size="mini" |
| | | @click="goToFarmDetail(row)" |
| | | :size="size" |
| | | >查看 |
| | | </el-button> |
| | | >查看</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import getMapDataInThere from "./getMapDataInThere.vue"; |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | |
| | | import { getList,add,update, remove,getDetails } from "@/api/farm/farm"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getList, add, update, remove, getDetails } from "@/api/farm/farm" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | } |
| | | ], |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | // this.getRailLazyTree(); |
| | |
| | | viewBtn: this.vaildData(this.permission.farm_delete, false), |
| | | delBtn: this.vaildData(this.permission.farm_delete, false), |
| | | editBtn: this.vaildData(this.permission.farm_delete, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | row['tenantId'] = this.userInfo.tenant_id; |
| | | row['deptId'] = this.userInfo.dept_id; |
| | | row['tenantId'] = this.userInfo.tenant_id |
| | | row['deptId'] = this.userInfo.dept_id |
| | | if (this.polygonsFarm.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygonsFarm; |
| | | let polLength = this.polygonsFarm.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygonsFarm |
| | | let polLength = this.polygonsFarm.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | row.position = usePolygons; |
| | | row.position = usePolygons |
| | | } |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (this.polygonsFarm.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygonsFarm; |
| | | let polLength = this.polygonsFarm.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygonsFarm |
| | | let polLength = this.polygonsFarm.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | row.position = usePolygons; |
| | | row.position = usePolygons |
| | | } |
| | | // 修改 |
| | | update(row).then((res) => { |
| | |
| | | this.$message({ |
| | | message: "操作成功", |
| | | type: "success", |
| | | }); |
| | | this.refreshChange(); |
| | | done(); |
| | | }) |
| | | this.refreshChange() |
| | | done() |
| | | } else { |
| | | this.$message({ |
| | | message: "操作失败", |
| | | type: "warning", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | //先清空面的数据 |
| | | this.$store.commit('clear_polygonsFarm'); |
| | | this.$store.commit('clear_polygonsFarm') |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetails(this.form.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.form = res.data.data; |
| | | this.form = res.data.data |
| | | let usePolygons = this.form.position |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(","); |
| | | .split(",") |
| | | for (let k in usePolygons) { |
| | | usePolygons[k] = { |
| | | lng: +usePolygons[k].split(" ")[0], |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | }; |
| | | } |
| | | this.$refs.getMapData.draw(usePolygons); |
| | | } |
| | | }); |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | } |
| | | done(); |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | //查看农场详情 |
| | | goToFarmDetail(row) { |
| | | this.$router.push({ |
| | | path: `/farm/farmInfoDetail`, |
| | | query: row |
| | | }); |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | .mapClass div label { |
| | | display: none; |
| | | } |
| | |
| | | .mapClassMain { |
| | | padding-left: 5rem !important; |
| | | } |
| | | |
| | | |
| | | #getMapData { |
| | | width: calc(100% + 90px); |
| | |
| | | <!-- 基本信息 --> |
| | | <el-tab-pane label="基本信息" name="tab1"> |
| | | <basic-container> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="objBase" |
| | | :option="optionBase" |
| | | @submit="submitBase" |
| | | > |
| | | <avue-form ref="form" v-model="objBase" :option="optionBase" @submit="submitBase"> |
| | | <!-- 地图插入 --> |
| | | <template slot-scope="{}" slot="position"> |
| | | <getMapDataInThere |
| | |
| | | </el-tab-pane> |
| | | <!-- 检测报告信息 --> |
| | | <el-tab-pane label="检测报告信息" name="tab2"> |
| | | <farmReport |
| | | :farmId="farmId" |
| | | ></farmReport> |
| | | <farmReport :farmId="farmId"></farmReport> |
| | | </el-tab-pane> |
| | | <!-- 认证证书信息 --> |
| | | <el-tab-pane label="认证证书信息" name="tab3"> |
| | | <farmPaper |
| | | :farmId="farmId" |
| | | ></farmPaper> |
| | | <farmPaper :farmId="farmId"></farmPaper> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </template> |
| | | |
| | | <script> |
| | | import getMapDataInThere from "./getMapDataInThere.vue"; |
| | | import farmPaper from "./farmPaper.vue"; |
| | | import farmReport from "./farmReport.vue"; |
| | | import { update, getDetails } from "@/api/farm/farm"; |
| | | import { mapGetters } from "vuex"; |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | import farmPaper from "./farmPaper.vue" |
| | | import farmReport from "./farmReport.vue" |
| | | import { update, getDetails } from "@/api/farm/farm" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission", "polygonsFarm"]), |
| | | }, |
| | | created(){ |
| | | this.farmId = this.$route.query.id; |
| | | this.farmId = this.$route.query.id |
| | | }, |
| | | mounted() { |
| | | var flag = false, |
| | | i = 0, |
| | | ind = null; |
| | | ind = null |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "农场详情信息") { |
| | | if (flag == false) { |
| | | ind = index; |
| | | flag = true; |
| | | ind = index |
| | | flag = true |
| | | } |
| | | i++; |
| | | i++ |
| | | } |
| | | }); |
| | | }) |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1); |
| | | this.$store.state.tags.tagList.splice(ind, 1) |
| | | } |
| | | var that = this; |
| | | var that = this |
| | | //先清空面的数据 |
| | | this.$store.commit('clear_polygonsFarm'); |
| | | this.$store.commit('clear_polygonsFarm') |
| | | this.$nextTick(() => { |
| | | getDetails(this.$route.query.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | that.objBase = res.data.data; |
| | | that.farmId = that.objBase.id; |
| | | that.objBase = res.data.data |
| | | that.farmId = that.objBase.id |
| | | let usePolygons = that.objBase.position |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(","); |
| | | .split(",") |
| | | for (let k in usePolygons) { |
| | | usePolygons[k] = { |
| | | lng: +usePolygons[k].split(" ")[0], |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | }; |
| | | } |
| | | this.$refs.getMapData.draw(usePolygons); |
| | | } |
| | | }); |
| | | }); |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | methods: { |
| | | //农场基本信息提交 |
| | | submitBase(form, loading, done) { |
| | | if (this.polygonsFarm.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygonsFarm; |
| | | let polLength = this.polygonsFarm.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygonsFarm |
| | | let polLength = this.polygonsFarm.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | form.position = usePolygons; |
| | | form.position = usePolygons |
| | | } |
| | | // 修改 |
| | | update(form).then((res) => { |
| | |
| | | this.$message({ |
| | | message: "操作成功", |
| | | type: "success", |
| | | }); |
| | | this.refreshChange(); |
| | | done(); |
| | | }) |
| | | this.refreshChange() |
| | | done() |
| | | } else { |
| | | this.$message({ |
| | | message: "操作失败", |
| | | type: "warning", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | setMapData(val) { |
| | | this.LineData = val[0]; |
| | | this.PointData = val[1]; |
| | | this.LineData = val[0] |
| | | this.PointData = val[1] |
| | | }, |
| | | }, |
| | | watch: {}, |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | props: ["farmId"], |
| | | data() { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() {}, |
| | | computed: { |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row["farmId"] = this.farmId; |
| | | row["type"] = 2; |
| | | row["farmId"] = this.farmId |
| | | row["type"] = 2 |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['type'] = 2; |
| | | params['farmId'] = this.farmId; |
| | | this.loading = true; |
| | | params['type'] = 2 |
| | | params['farmId'] = this.farmId |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | props: ["farmId"], |
| | | data() { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() {}, |
| | | computed: { |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row["farmId"] = this.farmId; |
| | | row["type"] = 1; |
| | | row["farmId"] = this.farmId |
| | | row["type"] = 1 |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | params['type'] = 1; |
| | | params['farmId'] = this.farmId; |
| | | this.loading = true |
| | | params['type'] = 1 |
| | | params['farmId'] = this.farmId |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | update, |
| | | remove, |
| | | save, |
| | | } from "@/api/farm/farmingrecord"; |
| | | import { getLandList } from "@/api/land/land"; |
| | | import { getUserList } from "@/api/system/user"; |
| | | import { selectStockFa } from "@/api/stockfactory/stockfactory"; |
| | | import { mapGetters } from "vuex"; |
| | | } from "@/api/farm/farmingrecord" |
| | | import { getLandList } from "@/api/land/land" |
| | | import { getUserList } from "@/api/system/user" |
| | | import { selectStockFa } from "@/api/stockfactory/stockfactory" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | "form.type": { |
| | | handler(val) { |
| | | var stockIdcolumn = this.findObject(this.option.column, "stockId"); |
| | | var stockIdcolumn = this.findObject(this.option.column, "stockId") |
| | | if (val === "0" || val == 4 || val == 5 || val == 8 || val == 9) { |
| | | stockIdcolumn.display = true; |
| | | stockIdcolumn.display = true |
| | | } else { |
| | | stockIdcolumn.display = false; |
| | | stockIdcolumn.display = false |
| | | } |
| | | }, |
| | | immediate: true, |
| | | } |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | getType(){ |
| | | return this.type; |
| | | return this.type |
| | | }, |
| | | //初始化数据 |
| | | initData() { |
| | | var that = this; |
| | | var that = this |
| | | //获取农地数据 |
| | | getLandList(this.userInfo.dept_id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var landIdcolumn = that.findObject(that.option.column, "landId"); |
| | | that.landList = res.data.data; |
| | | landIdcolumn.dicData = res.data.data; |
| | | var landIdcolumn = that.findObject(that.option.column, "landId") |
| | | that.landList = res.data.data |
| | | landIdcolumn.dicData = res.data.data |
| | | } |
| | | }); |
| | | }) |
| | | //获取操作人 |
| | | const user = { |
| | | tenantId: this.userInfo.tenant_id, |
| | | }; |
| | | } |
| | | getUserList(user).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var operatorcolumn = that.findObject(that.option.column, "operator"); |
| | | operatorcolumn.dicData = res.data.data; |
| | | var operatorcolumn = that.findObject(that.option.column, "operator") |
| | | operatorcolumn.dicData = res.data.data |
| | | } |
| | | }); |
| | | }) |
| | | //获取农资 |
| | | selectStockFa().then((res) => { |
| | | if (res.data.code == 200) { |
| | | var stockIdcolumn = that.findObject(that.option.column, "stockId"); |
| | | stockIdcolumn.dicData = res.data.data; |
| | | var stockIdcolumn = that.findObject(that.option.column, "stockId") |
| | | stockIdcolumn.dicData = res.data.data |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | var datas = this.$route.query.id; |
| | | params.landId=datas; |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | this.loading = true |
| | | var datas = this.$route.query.id |
| | | params.landId = datas |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | if (this.landId) { |
| | | params['landId'] = this.landId |
| | | } |
| | |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <div class="getMapData" :key="Refresh"> |
| | | <MapInThere ref="getMapDataRefs" /> |
| | | <div class="notDatas" v-show="isCheck"> |
| | | <div style="color: red">*</div> |
| | | 未绘画区域 |
| | | <div style="color: red">*</div>未绘画区域 |
| | | </div> |
| | | <div class="controlMapWindowTitle"> |
| | | <el-button-group> |
| | | <el-button type="primary" icon="el-icon-finished" @click="drawFace" |
| | | >绘画区域</el-button |
| | | > |
| | | <el-button type="danger" @click="giveUp" icon="el-icon-close" |
| | | >取消</el-button |
| | | > |
| | | <el-button type="primary" icon="el-icon-finished" @click="drawFace">绘画区域</el-button> |
| | | <el-button type="danger" @click="giveUp" icon="el-icon-close">取消</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from "vuex"; |
| | | import MapInThere from "@/components/map/mainFarm.vue"; |
| | | import { mapGetters } from "vuex" |
| | | import MapInThere from "@/components/map/mainFarm.vue" |
| | | export default { |
| | | name: "getMapData", |
| | | components: { |
| | |
| | | ourDatas: { |
| | | handler(val) { |
| | | this.checkDom("getMapDataRefs", (dom) => { |
| | | dom.onceOnlodad(val); |
| | | }); |
| | | dom.onceOnlodad(val) |
| | | }) |
| | | }, |
| | | deep: true, |
| | | }, |
| | | polygons() { |
| | | if (this.polygonsFarm.length > 0) { |
| | | this.isCheck = false; |
| | | this.isCheck = false |
| | | } |
| | | }, |
| | | }, |
| | |
| | | ourDatas: [], |
| | | nowId: 0, |
| | | isCheck: false, |
| | | }; |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | draw(usePolygons) { |
| | | this.$store.commit("setpolygonsFarm", usePolygons); //用vuex传最终数据 |
| | | this.$store.commit("setpolygonsFarm", usePolygons) //用vuex传最终数据 |
| | | this.doThat(usePolygons) |
| | | }, |
| | | doThat(val) { |
| | | this.checkDom("getMapDataRefs", (dom) => { |
| | | dom.addLines(val); |
| | | dom.addLines(val) |
| | | // 移动位置 |
| | | dom.move(val); |
| | | }); |
| | | dom.move(val) |
| | | }) |
| | | }, |
| | | drawFace() { |
| | | this.$refs.getMapDataRefs.drawStart(); |
| | | this.$refs.getMapDataRefs.drawStart() |
| | | }, |
| | | giveUp() { |
| | | this.$refs.getMapDataRefs.closeDraw(); |
| | | this.$refs.getMapDataRefs.closeDraw() |
| | | }, |
| | | openDrawLineMethod() { |
| | | let id = this.nowId++; |
| | | let id = this.nowId++ |
| | | this.ourDatas.push({ |
| | | label: "路径" + +id, |
| | | value: "", |
| | |
| | | notPath: false, |
| | | isLine: true, |
| | | id: +id, |
| | | }); |
| | | }) |
| | | }, |
| | | openDrawPointMethod() { |
| | | let id = this.nowId++; |
| | | let id = this.nowId++ |
| | | this.ourDatas.push({ |
| | | label: "标点" + +id, |
| | | value: "", |
| | |
| | | notPath: false, |
| | | isLine: false, |
| | | id: +id, |
| | | }); |
| | | }) |
| | | }, |
| | | deleteRowOurs(index) { |
| | | this.ourDatas.splice(index, 1); |
| | | this.ourDatas.splice(index, 1) |
| | | }, |
| | | backMapDataOurData(val, index) { |
| | | if (val == "line") { |
| | | this.ourDatas[index].value = this.rotesData; |
| | | this.ourDatas[index].value = this.rotesData |
| | | } else if (val == "point") { |
| | | this.ourDatas[index].value = this.pointData; |
| | | this.ourDatas[index].value = this.pointData |
| | | } else if (val == "notData") { |
| | | this.ourDatas[index].value = ""; |
| | | this.ourDatas[index].value = "" |
| | | } |
| | | //单个验证 |
| | | this.myRules(index); |
| | | this.myRules(index) |
| | | }, |
| | | //以上是添加数据集方法 |
| | | //选择map数据 |
| | | openMap(val, num, value) { |
| | | this.MapDataShow = true; |
| | | this.openTitle = val; |
| | | this.$refs.getMapDataRefs.init(val, num, value); |
| | | this.MapDataShow = true |
| | | this.openTitle = val |
| | | this.$refs.getMapDataRefs.init(val, num, value) |
| | | }, |
| | | closeOpenedMap() { |
| | | this.MapDataShow = false; |
| | | this.MapDataShow = false |
| | | // this.openTitle = ""; |
| | | }, |
| | | //下面是旧代码 |
| | | editInit(val) { |
| | | //查看情况逆转String成为当页可使用数据,并做动作 |
| | | this.reverseMapData(val); |
| | | this.reverseMapData(val) |
| | | }, |
| | | viewInit(val) { |
| | | //查看情况逆转String成为当页可使用数据,并做动作 |
| | | this.reverseMapData(val); |
| | | this.fromView = true; //查看数据不可改 |
| | | this.reverseMapData(val) |
| | | this.fromView = true //查看数据不可改 |
| | | }, |
| | | reverseMapData(val, label) { |
| | | //解释数据 |
| | | let rname = val[0][0].split(";"), |
| | | r = val[0][1].split(";"), |
| | | pname = val[1][0].split(";"), |
| | | p = val[1][1].split(";"); |
| | | this.ourDatas = []; |
| | | p = val[1][1].split(";") |
| | | this.ourDatas = [] |
| | | for (let k in r) { |
| | | this.ourDatas.push({ |
| | | label: "路径" + (+k + 1), |
| | |
| | | notPath: false, |
| | | isLine: true, |
| | | id: this.ourDatas.length, |
| | | }); |
| | | }) |
| | | } |
| | | for (let k in p) { |
| | | let potion = p[k].split(","); |
| | | let potion = p[k].split(",") |
| | | this.ourDatas.push({ |
| | | label: "标点" + (+k + 1), |
| | | value: [+potion[0], +potion[1]], |
| | |
| | | notPath: false, |
| | | isLine: false, |
| | | id: this.ourDatas.length, |
| | | }); |
| | | }) |
| | | } |
| | | this.nowId = +this.ourDatas.length + 1; |
| | | this.nowId = +this.ourDatas.length + 1 |
| | | }, |
| | | myRules(index) { |
| | | //单个验证 |
| | | if (this.ourDatas[index].name && this.ourDatas[index].value) { |
| | | this.ourDatas[index].notPath = false; |
| | | this.ourDatas[index].notPath = false |
| | | } else { |
| | | this.ourDatas[index].notPath = 2; |
| | | this.ourDatas[index].notPath = 2 |
| | | } |
| | | }, |
| | | //自定义验证 |
| | | myRulesUse() { |
| | | //把一个数组拆开两个来对应之前的数据 |
| | | let ourData = this.ourDatas; |
| | | let lineBefor = []; |
| | | let pointBefor = []; |
| | | let ourData = this.ourDatas |
| | | let lineBefor = [] |
| | | let pointBefor = [] |
| | | for (let o in ourData) { |
| | | if (ourData[o].isLine) { |
| | | lineBefor.push(ourData[o]); |
| | | lineBefor.push(ourData[o]) |
| | | } else { |
| | | pointBefor.push(ourData[o]); |
| | | pointBefor.push(ourData[o]) |
| | | } |
| | | } |
| | | let line = this.changeMapData(lineBefor, "name"); |
| | | let point = this.changeMapData(pointBefor, "name"); |
| | | let line = this.changeMapData(lineBefor, "name") |
| | | let point = this.changeMapData(pointBefor, "name") |
| | | if (line[0] == "namenot" || point[0] == "namenot") { |
| | | //需要显示验证失败合集 |
| | | let errorId = []; |
| | | let errorId = [] |
| | | if (line[0] == "namenot") { |
| | | errorId.push(...line[1]); |
| | | errorId.push(...line[1]) |
| | | } |
| | | if (point[0] == "namenot") { |
| | | errorId.push(...point[1]); |
| | | errorId.push(...point[1]) |
| | | } |
| | | for (let x in this.ourDatas) { |
| | | let flog = true; |
| | | let flog = true |
| | | for (let k in errorId) { |
| | | if (errorId[k] == this.ourDatas[x].id) { |
| | | flog = false; |
| | | flog = false |
| | | } |
| | | } |
| | | if (flog) { |
| | | this.ourDatas[x].notPath = false; |
| | | this.ourDatas[x].notPath = false |
| | | } else { |
| | | this.ourDatas[x].notPath = 2; |
| | | this.ourDatas[x].notPath = 2 |
| | | } |
| | | } |
| | | return false; |
| | | return false |
| | | } else { |
| | | for (let i in this.ourDatas) { |
| | | this.ourDatas[i].notPath = false; |
| | | this.ourDatas[i].notPath = false |
| | | } |
| | | return [line, point]; |
| | | return [line, point] |
| | | } |
| | | }, |
| | | //规则 |
| | | changeMapData(item, names) { |
| | | let name = "", |
| | | value = "", |
| | | notData = []; |
| | | let itemLength = item.length - 1; |
| | | notData = [] |
| | | let itemLength = item.length - 1 |
| | | for (let k in item) { |
| | | let inItem = item[k]; |
| | | let inItem = item[k] |
| | | for (let kin in inItem) { |
| | | if ( |
| | | inItem[kin] == "" && |
| | |
| | | kin != "isLine" && |
| | | kin != "id" |
| | | ) { |
| | | notData.push(inItem.id); |
| | | break; |
| | | notData.push(inItem.id) |
| | | break |
| | | } |
| | | if (kin == names) { |
| | | name += inItem[kin]; |
| | | name += inItem[kin] |
| | | if (k != itemLength) { |
| | | name += ";"; |
| | | name += ";" |
| | | } |
| | | } |
| | | if (kin == "value") { |
| | | value += inItem[kin]; |
| | | value += inItem[kin] |
| | | if (k != itemLength) { |
| | | value += ";"; |
| | | value += ";" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return notData.length > 0 ? [names + "not", notData] : [name, value]; |
| | | return notData.length > 0 ? [names + "not", notData] : [name, value] |
| | | }, |
| | | checkDom(name, fn) { |
| | | // 声明定时器 |
| | | let that = this; |
| | | var timer = null; |
| | | let that = this |
| | | var timer = null |
| | | // 检查dom是否执行完成 |
| | | function checkDom() { |
| | | let dom = that.$refs[name]; |
| | | let dom = that.$refs[name] |
| | | if (dom) { |
| | | // 执行dom加载完成后的操作 |
| | | // 清除定时器 |
| | | if (!timer) { |
| | | clearTimeout(timer); |
| | | clearTimeout(timer) |
| | | } |
| | | if (fn) { |
| | | //回调函数 |
| | | fn(dom); |
| | | return; |
| | | fn(dom) |
| | | return |
| | | } else { |
| | | return dom; |
| | | return dom |
| | | } |
| | | } else { |
| | | // 自我调用 |
| | | timer = setTimeout(checkDom, 100); |
| | | timer = setTimeout(checkDom, 100) |
| | | } |
| | | } |
| | | // 首次执行 |
| | | checkDom(); |
| | | checkDom() |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <<<<<<< HEAD |
| | | <template> |
| | | ======= |
| | | <template> |
| | | >>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356 |
| | | <div> |
| | | <el-dialog |
| | | title="检测报告" |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <<<<<<< HEAD |
| | | |
| | | |
| | | ======= |
| | | |
| | | |
| | | >>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356 |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farm/farmPaper" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | props: ["farmId"], |
| | | data() { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | init(id) { |
| | | this.visible = true; |
| | | this.farmPlantId = id; |
| | | this.onLoad(this.page); |
| | | this.visible = true |
| | | this.farmPlantId = id |
| | | this.onLoad(this.page) |
| | | }, |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row["farmId"] = this.farmPlantId; |
| | | row["farmId"] = this.farmPlantId |
| | | //种养品 |
| | | row["type"] = 3; |
| | | row["type"] = 3 |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | params['type'] = 3; |
| | | params['farmId'] = this.farmPlantId; |
| | | this.loading = true |
| | | params['type'] = 3 |
| | | params['farmId'] = this.farmPlantId |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <<<<<<< HEAD |
| | | |
| | | <style> |
| | | </style> |
| | | ======= |
| | | |
| | | <style> |
| | | </style> |
| | | >>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356 |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant"; |
| | | import { getLandList } from "@/api/land/land"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant" |
| | | import { getLandList } from "@/api/land/land" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | "form.farmType": { |
| | | handler(val) { |
| | | var splantcolumn = this.findObject(this.option.column,"plant"); |
| | | var plantingWaycolumn = this.findObject(this.option.column, "plantingWay"); |
| | | var jobWaycolumn = this.findObject(this.option.column, "jobWay"); |
| | | var transplanTimecolumn = this.findObject(this.option.column, "transplanTime"); |
| | | var recoveryTimecolumn = this.findObject(this.option.column, "recoveryTime"); |
| | | var percolumn = this.findObject(this.option.column, "per"); |
| | | var plantNumbercolumn = this.findObject(this.option.column, "plantNumber"); |
| | | var plantSpacingcolumn = this.findObject(this.option.column, "plantSpacing"); |
| | | var seedingTimecolumn = this.findObject(this.option.column, "seedingTime"); |
| | | var breedcolumn = this.findObject(this.option.column, "breed"); |
| | | var splantcolumn = this.findObject(this.option.column, "plant") |
| | | var plantingWaycolumn = this.findObject(this.option.column, "plantingWay") |
| | | var jobWaycolumn = this.findObject(this.option.column, "jobWay") |
| | | var transplanTimecolumn = this.findObject(this.option.column, "transplanTime") |
| | | var recoveryTimecolumn = this.findObject(this.option.column, "recoveryTime") |
| | | var percolumn = this.findObject(this.option.column, "per") |
| | | var plantNumbercolumn = this.findObject(this.option.column, "plantNumber") |
| | | var plantSpacingcolumn = this.findObject(this.option.column, "plantSpacing") |
| | | var seedingTimecolumn = this.findObject(this.option.column, "seedingTime") |
| | | var breedcolumn = this.findObject(this.option.column, "breed") |
| | | // var landIdcolumn = this.findObject(this.option.column, "landId"); |
| | | // landIdcolumn.dicData = this.landList; |
| | | if (val === '0') { |
| | | //种职业 |
| | | splantcolumn.display = true; |
| | | splantcolumn.label = "种植标准"; |
| | | plantingWaycolumn.display = true; |
| | | plantingWaycolumn.label = "种植方式"; |
| | | splantcolumn.display = true |
| | | splantcolumn.label = "种植标准" |
| | | plantingWaycolumn.display = true |
| | | plantingWaycolumn.label = "种植方式" |
| | | plantingWaycolumn.dicData=[ |
| | | { |
| | | label:"移栽", |
| | |
| | | value:"1" |
| | | }, |
| | | ] |
| | | jobWaycolumn.display = true; |
| | | transplanTimecolumn.display = true; |
| | | transplanTimecolumn.label="移栽时间"; |
| | | recoveryTimecolumn.display = true; |
| | | recoveryTimecolumn.label="预计采收时间"; |
| | | percolumn.display = true; |
| | | percolumn.label = "预计亩产"; |
| | | jobWaycolumn.display = true |
| | | transplanTimecolumn.display = true |
| | | transplanTimecolumn.label = "移栽时间" |
| | | recoveryTimecolumn.display = true |
| | | recoveryTimecolumn.label = "预计采收时间" |
| | | percolumn.display = true |
| | | percolumn.label = "预计亩产" |
| | | percolumn.rules=[ |
| | | { |
| | | required: false, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | plantNumbercolumn.display = true; |
| | | plantSpacingcolumn.display = true; |
| | | seedingTimecolumn.display = false; |
| | | breedcolumn.display = false; |
| | | plantNumbercolumn.display = true |
| | | plantSpacingcolumn.display = true |
| | | seedingTimecolumn.display = false |
| | | breedcolumn.display = false |
| | | } else if(val ==1){ |
| | | //水产业 |
| | | splantcolumn.display = false; |
| | | plantingWaycolumn.display = false; |
| | | jobWaycolumn.display = true; |
| | | transplanTimecolumn.display = false; |
| | | recoveryTimecolumn.display = false; |
| | | percolumn.display = false; |
| | | plantNumbercolumn.display = false; |
| | | plantSpacingcolumn.display = false; |
| | | seedingTimecolumn.display = true; |
| | | breedcolumn.display = true; |
| | | splantcolumn.display = false |
| | | plantingWaycolumn.display = false |
| | | jobWaycolumn.display = true |
| | | transplanTimecolumn.display = false |
| | | recoveryTimecolumn.display = false |
| | | percolumn.display = false |
| | | plantNumbercolumn.display = false |
| | | plantSpacingcolumn.display = false |
| | | seedingTimecolumn.display = true |
| | | breedcolumn.display = true |
| | | }else if(val ==2){ |
| | | //禽畜业 |
| | | splantcolumn.display = true; |
| | | splantcolumn.label = "养殖标准"; |
| | | plantingWaycolumn.display = true; |
| | | plantingWaycolumn.label = "养殖方式"; |
| | | splantcolumn.display = true |
| | | splantcolumn.label = "养殖标准" |
| | | plantingWaycolumn.display = true |
| | | plantingWaycolumn.label = "养殖方式" |
| | | plantingWaycolumn.dicData=[ |
| | | { |
| | | label:"放养", |
| | |
| | | value:"2" |
| | | }, |
| | | ] |
| | | jobWaycolumn.display = true; |
| | | transplanTimecolumn.display = true; |
| | | transplanTimecolumn.label="养殖开始时间"; |
| | | recoveryTimecolumn.display = true; |
| | | recoveryTimecolumn.label="预计出栏时间"; |
| | | percolumn.display = true; |
| | | percolumn.label = "养殖数量"; |
| | | jobWaycolumn.display = true |
| | | transplanTimecolumn.display = true |
| | | transplanTimecolumn.label = "养殖开始时间" |
| | | recoveryTimecolumn.display = true |
| | | recoveryTimecolumn.label = "预计出栏时间" |
| | | percolumn.display = true |
| | | percolumn.label = "养殖数量" |
| | | percolumn.rules=[ |
| | | { |
| | | required: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | plantNumbercolumn.display = false; |
| | | plantSpacingcolumn.display = false; |
| | | seedingTimecolumn.display = false; |
| | | breedcolumn.display = false; |
| | | plantNumbercolumn.display = false |
| | | plantSpacingcolumn.display = false |
| | | seedingTimecolumn.display = false |
| | | breedcolumn.display = false |
| | | }else{ |
| | | splantcolumn.display = false; |
| | | plantingWaycolumn.display = false; |
| | | jobWaycolumn.display = false; |
| | | transplanTimecolumn.display = false; |
| | | recoveryTimecolumn.display = false; |
| | | percolumn.display = false; |
| | | plantNumbercolumn.display = false; |
| | | plantSpacingcolumn.display = false; |
| | | seedingTimecolumn.display = false; |
| | | breedcolumn.display = false; |
| | | splantcolumn.display = false |
| | | plantingWaycolumn.display = false |
| | | jobWaycolumn.display = false |
| | | transplanTimecolumn.display = false |
| | | recoveryTimecolumn.display = false |
| | | percolumn.display = false |
| | | plantNumbercolumn.display = false |
| | | plantSpacingcolumn.display = false |
| | | seedingTimecolumn.display = false |
| | | breedcolumn.display = false |
| | | } |
| | | }, |
| | | immediate: true |
| | | }, |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //初始化数据 |
| | | initData(){ |
| | | var that = this; |
| | | var that = this |
| | | //获取农地数据 |
| | | getLandList(this.userInfo.user_id).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var landIdcolumn = that.findObject(that.option.column,"landId"); |
| | | that.landList = res.data.data; |
| | | landIdcolumn.dicData = res.data.data; |
| | | var landIdcolumn = that.findObject(that.option.column, "landId") |
| | | that.landList = res.data.data |
| | | landIdcolumn.dicData = res.data.data |
| | | } |
| | | }) |
| | | }, |
| | |
| | | rowSave(row, done, loading) { |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | |
| | | :size="size" |
| | | icon="el-icon-money" |
| | | @click="handleDetection(row)" |
| | | >检测报告 |
| | | </el-button> |
| | | >检测报告</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 检测报告 --> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant"; |
| | | import { getStrainList } from "@/api/farmplant/strain"; |
| | | import { getLandList } from "@/api/land/land"; |
| | | import { mapGetters } from "vuex"; |
| | | import detection from "./detection.vue"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/farmplant" |
| | | import { getStrainList } from "@/api/farmplant/strain" |
| | | import { getLandList } from "@/api/land/land" |
| | | import { mapGetters } from "vuex" |
| | | import detection from "./detection.vue" |
| | | export default { |
| | | components: { |
| | | detection |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | // "form.farmType": { |
| | |
| | | }, |
| | | mounted(){ |
| | | if(this.activeName =="tab1"){ |
| | | this.option.height = 520; |
| | | this.option.height = 520 |
| | | } |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | methods: { |
| | | //初始化数据 |
| | | initData(){ |
| | | var that = this; |
| | | var that = this |
| | | //获取农地数据 |
| | | getLandList(this.userInfo.dept_id).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var landIdcolumn = that.findObject(that.option.column,"landId"); |
| | | that.landList = res.data.data; |
| | | landIdcolumn.dicData = res.data.data; |
| | | var landIdcolumn = that.findObject(that.option.column, "landId") |
| | | that.landList = res.data.data |
| | | landIdcolumn.dicData = res.data.data |
| | | } |
| | | }) |
| | | //获取农产品数据 |
| | | getStrainList(0).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var strainId = that.findObject(that.option.column,"strainId"); |
| | | strainId.dicData = res.data.data; |
| | | var strainId = that.findObject(that.option.column, "strainId") |
| | | strainId.dicData = res.data.data |
| | | } |
| | | }) |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> adf4c52344cf6f0ea16d1f01410258648c9f5356 |
| | | }, |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row['farmType'] = 0; |
| | | row['createUser'] = this.userInfo.user_id; |
| | | row['farmType'] = 0 |
| | | row['createUser'] = this.userInfo.user_id |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | this.loading = true; |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | //检测报告 |
| | | handleDetection(row){ |
| | | this.detectionVisible = true; |
| | | this.detectionVisible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.detection.init(row.id); |
| | | }); |
| | | this.$refs.detection.init(row.id) |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | update, |
| | | remove, |
| | | save, |
| | | } from "@/api/farmplant/farmproductstock"; |
| | | import { getStrainList } from "@/api/farmplant/strain"; |
| | | import { mapGetters } from "vuex"; |
| | | } from "@/api/farmplant/farmproductstock" |
| | | import { getStrainList } from "@/api/farmplant/strain" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | |
| | | }, |
| | | computed: { |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | initData(){ |
| | | var that = this; |
| | | var that = this |
| | | //获取农产品数据 |
| | | getStrainList(0).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var strainId = that.findObject(that.option.column,"strainId"); |
| | | strainId.dicData = res.data.data; |
| | | var strainId = that.findObject(that.option.column, "strainId") |
| | | strainId.dicData = res.data.data |
| | | } |
| | | }) |
| | | }, |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row['strainType'] =0; |
| | | row['strainType'] = 0 |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <div class="table"> |
| | | <div class="content"> |
| | | <div class="farm" v-for="(item, index) in data" :key="index"> |
| | | <div class="farm-img"><img :src="item.url" class="img"/></div> |
| | | <div class="farm-img"> |
| | | <img :src="item.url" class="img" /> |
| | | </div> |
| | | <!-- <div class="farm-img"> |
| | | <img src="../../../public/img/map.png" class="img" /> |
| | | </div> --> |
| | | <div class="cai">{{ item.strainName }}</div> |
| | | <div class="area">库存量:<span>{{ item.weight }}</span>公斤</div> |
| | | <div class="btn"> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)"> |
| | | <span style="color: #5abf78">销售</span></el-button |
| | | > |
| | | <el-button style="width: 65px;padding-left:8px" plain size="small" @click="openWindow(1,item)"> |
| | | <span>库存损耗</span> |
| | | </el-button |
| | | > |
| | | <div class="area"> |
| | | 库存量: |
| | | <span>{{ item.weight }}</span>公斤 |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(3,item)" |
| | | ><span style="color: #5abf78">出库</span> |
| | | <el-button |
| | | style="width: 65px;" |
| | | plain |
| | | size="small" |
| | | @click="openWindow(0,item)" |
| | | > |
| | | <span style="color: #5abf78">销售</span> |
| | | </el-button> |
| | | <el-button style="width: 65px;" plain size="small" @click="openWindow(2,item)"> |
| | | 加工 |
| | | <el-button |
| | | style="width: 65px;padding-left:8px" |
| | | plain |
| | | size="small" |
| | | @click="openWindow(1,item)" |
| | | > |
| | | <span>库存损耗</span> |
| | | </el-button> |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button |
| | | style="width: 65px;" |
| | | plain |
| | | size="small" |
| | | @click="openWindow(3,item)" |
| | | > |
| | | <span style="color: #5abf78">出库</span> |
| | | </el-button> |
| | | <el-button |
| | | style="width: 65px;" |
| | | plain |
| | | size="small" |
| | | @click="openWindow(2,item)" |
| | | >加工</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | background |
| | | layout="total, prev, pager, next" |
| | | :total="page.total" |
| | | > |
| | | </el-pagination> |
| | | ></el-pagination> |
| | | </div> |
| | | <!--销售--> |
| | | <el-dialog |
| | |
| | | size="large" |
| | | :options="options" |
| | | @change="handleChange" |
| | | v-model="saleDestination"> |
| | | </el-cascader> |
| | | v-model="saleDestination" |
| | | ></el-cascader> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">可销售量:{{ form.weight }}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="salePrice"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{ formKC.weight }}公斤</div> |
| | | </div> |
| | |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{ formJG.weight }}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="processNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | |
| | | size="large" |
| | | :options="optionck" |
| | | @change="handleChangeck" |
| | | v-model="saleDestination"> |
| | | </el-cascader> |
| | | v-model="saleDestination" |
| | | ></el-cascader> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入出库数量" v-model="formCK.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">可出库量:{{ formCK.weight }}公斤</div> |
| | | </div> |
| | |
| | | </avue-form> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | update, |
| | | remove, |
| | | save, |
| | | } from "@/api/farmplant/farmproductstock"; |
| | | } from "@/api/farmplant/farmproductstock" |
| | | |
| | | import { |
| | | add, addKC |
| | | } from "@/api/sale/sale"; |
| | | } from "@/api/sale/sale" |
| | | |
| | | import { |
| | | addjg |
| | | } from "@/api/process/process"; |
| | | } from "@/api/process/process" |
| | | |
| | | import { |
| | | addck |
| | | } from "@/api/retrieval/retrieval"; |
| | | import {mapGetters} from "vuex"; |
| | | } from "@/api/retrieval/retrieval" |
| | | import { mapGetters } from "vuex" |
| | | import {regionData} from 'element-china-area-data' |
| | | |
| | | export default { |
| | |
| | | }, |
| | | selectionList: [], |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | //初始化列表数据 |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | console.log("submit!"); |
| | | console.log("submit!") |
| | | }, |
| | | //销售 |
| | | submitSole() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | add(this.form).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanData(); |
| | | done(); |
| | | that.cleanData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanData(); |
| | | done(); |
| | | }); |
| | | that.cleanData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //加工产品 |
| | | submitJGloss() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addjg(this.formJG).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanJGData(); |
| | | done(); |
| | | that.cleanJGData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanJGData(); |
| | | done(); |
| | | }); |
| | | that.cleanJGData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //库存消耗 |
| | | submitKCloss() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addKC(this.formKC).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | that.cleanKCData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | }); |
| | | that.cleanKCData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //出库 |
| | | submitCK() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addck(this.formCK).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanCKData(); |
| | | done(); |
| | | that.cleanCKData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanCKData(); |
| | | done(); |
| | | }); |
| | | that.cleanCKData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleChange(value) { |
| | | if (value != null) { |
| | | this.form.saleDestination = value[0]; |
| | | this.form.city = value[1]; |
| | | this.form.county = value[2]; |
| | | this.form.saleDestination = value[0] |
| | | this.form.city = value[1] |
| | | this.form.county = value[2] |
| | | } |
| | | }, |
| | | handleChangeck(value) { |
| | | if (value != null) { |
| | | this.formCK.saleDestination = value[0]; |
| | | this.formCK.city = value[1]; |
| | | this.formCK.county = value[2]; |
| | | this.formCK.saleDestination = value[0] |
| | | this.formCK.city = value[1] |
| | | this.formCK.county = value[2] |
| | | } |
| | | }, |
| | | initData() { |
| | |
| | | }, |
| | | openWindow(index, data) { |
| | | if (index == 0) { |
| | | this.form.name = this.userInfo.nick_name; |
| | | this.form.createUser = this.userInfo.user_id; |
| | | this.form.weight = data.weight; |
| | | this.form.proid = data.id; |
| | | this.form.landId = data.landId; |
| | | this.form.strainId = data.strainId; |
| | | this.form.strainName = data.strainName; |
| | | this.visible = true; |
| | | this.form.name = this.userInfo.nick_name |
| | | this.form.createUser = this.userInfo.user_id |
| | | this.form.weight = data.weight |
| | | this.form.proid = data.id |
| | | this.form.landId = data.landId |
| | | this.form.strainId = data.strainId |
| | | this.form.strainName = data.strainName |
| | | this.visible = true |
| | | } else if (index == 1) { |
| | | this.formKC.name = this.userInfo.nick_name; |
| | | this.formKC.createUser = this.userInfo.user_id; |
| | | this.formKC.weight = data.weight; |
| | | this.formKC.proid = data.id; |
| | | this.formKC.landId = data.landId; |
| | | this.formKC.strainId = data.strainId; |
| | | this.formKC.strainName = data.strainName; |
| | | this.visibleKC = true; |
| | | this.formKC.name = this.userInfo.nick_name |
| | | this.formKC.createUser = this.userInfo.user_id |
| | | this.formKC.weight = data.weight |
| | | this.formKC.proid = data.id |
| | | this.formKC.landId = data.landId |
| | | this.formKC.strainId = data.strainId |
| | | this.formKC.strainName = data.strainName |
| | | this.visibleKC = true |
| | | } else if (index == 2) { |
| | | this.formJG.name = this.userInfo.nick_name; |
| | | this.formJG.createUser = this.userInfo.user_id; |
| | | this.formJG.proid = data.id; |
| | | this.formJG.landId = data.landId; |
| | | this.formJG.weight = data.weight; |
| | | this.formJG.strainId = data.strainId; |
| | | this.formJG.strainName = data.strainName; |
| | | this.visibleJG = true; |
| | | this.formJG.name = this.userInfo.nick_name |
| | | this.formJG.createUser = this.userInfo.user_id |
| | | this.formJG.proid = data.id |
| | | this.formJG.landId = data.landId |
| | | this.formJG.weight = data.weight |
| | | this.formJG.strainId = data.strainId |
| | | this.formJG.strainName = data.strainName |
| | | this.visibleJG = true |
| | | } else if (index == 3) { |
| | | this.formCK.name = this.userInfo.nick_name; |
| | | this.formCK.createUser = this.userInfo.user_id; |
| | | this.formCK.weight = data.weight; |
| | | this.formCK.proid = data.id; |
| | | this.formCK.landId = data.landId; |
| | | this.formCK.strainId = data.strainId; |
| | | this.formCK.strainName = data.strainName; |
| | | this.visibleCK = true; |
| | | this.formCK.name = this.userInfo.nick_name |
| | | this.formCK.createUser = this.userInfo.user_id |
| | | this.formCK.weight = data.weight |
| | | this.formCK.proid = data.id |
| | | this.formCK.landId = data.landId |
| | | this.formCK.strainId = data.strainId |
| | | this.formCK.strainName = data.strainName |
| | | this.visibleCK = true |
| | | } |
| | | }, |
| | | cleanData() { |
| | | var that = this; |
| | | that.form.saleDestination = ""; |
| | | that.$refs.form.resetFields(); |
| | | that.visible = false; |
| | | var that = this |
| | | that.form.saleDestination = "" |
| | | that.$refs.form.resetFields() |
| | | that.visible = false |
| | | }, |
| | | cleanCKData() { |
| | | var that = this; |
| | | that.formCK.saleDestination = ""; |
| | | that.$refs.form.resetFields(); |
| | | that.visibleCK = false; |
| | | var that = this |
| | | that.formCK.saleDestination = "" |
| | | that.$refs.form.resetFields() |
| | | that.visibleCK = false |
| | | }, |
| | | cleanKCData() { |
| | | var that = this; |
| | | that.$refs.form.resetFields(); |
| | | that.visibleKC = false; |
| | | var that = this |
| | | that.$refs.form.resetFields() |
| | | that.visibleKC = false |
| | | }, |
| | | cleanJGData() { |
| | | var that = this; |
| | | that.$refs.form.resetFields(); |
| | | that.visibleJG = false; |
| | | var that = this |
| | | that.$refs.form.resetFields() |
| | | that.visibleJG = false |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.onLoad(this.page); |
| | | this.page.pageSize = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.onLoad(this.page); |
| | | this.page.currentPage = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | .body { |
| | | background-color: #fff; |
| | | width: 98%; |
| | |
| | | text-align: center; |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | ], |
| | | }, |
| | | data:[], |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getInventoryPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{ |
| | | if(res.data.code == 200){ |
| | | this.data = res.data.data.records |
| | | this.page.total = res.data.data.total |
| | | this.loading = false; |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | <div class="table"> |
| | | <div class="content"> |
| | | <div class="farm" v-for="(item, index) in data" :key="index"> |
| | | <div class="farm-img"><img :src="item.tpurl" class="img"/></div> |
| | | <div class="farm-img"> |
| | | <img :src="item.tpurl" class="img" /> |
| | | </div> |
| | | <!-- <div class="farm-img"> |
| | | <img src="../../../public/img/map.png" class="img" /> |
| | | </div> --> |
| | | <div class="cai">{{ item.processName }}</div> |
| | | <div class="area">库存量:<span>{{ item.processNum }}</span>公斤</div> |
| | | <div class="area"> |
| | | 库存量: |
| | | <span>{{ item.processNum }}</span>公斤 |
| | | </div> |
| | | <!-- <div class="btn">--> |
| | | <!-- <el-button style="width: 65px;" plain size="small" @click="openWindow(0,item)">--> |
| | | <!-- <span style="color: #5abf78">销售</span></el-button--> |
| | |
| | | background |
| | | layout="total, prev, pager, next" |
| | | :total="page.total" |
| | | > |
| | | </el-pagination> |
| | | ></el-pagination> |
| | | </div> |
| | | |
| | | <el-dialog |
| | |
| | | size="large" |
| | | :options="options" |
| | | @change="handleChange" |
| | | v-model="saleDestination"> |
| | | </el-cascader> |
| | | v-model="saleDestination" |
| | | ></el-cascader> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入销售数量" v-model="form.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">可销售量:{{ form.weight }}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="salePrice"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | <el-input type="number" placeholder="请输入销售价格" v-model="form.salePrice"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">元/公斤</i> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog |
| | | title="农产品库存损耗" |
| | |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入损耗数量" v-model="formKC.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{ formKC.weight }}公斤</div> |
| | | </div> |
| | |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="saleNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入加工数量" v-model="formJG.saleNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | <div style="text-align: right;color: #ffb218">库存量:{{ formJG.weight }}公斤</div> |
| | | </div> |
| | | </template> |
| | | <template slot-scope="{disabled,size}" slot="processNum"> |
| | | <div style="margin-bottom: -20px"> |
| | | <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"><i slot="suffix" |
| | | style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | <el-input type="number" placeholder="请输入产品数量" v-model="formJG.processNum"> |
| | | <i slot="suffix" style="font-style:normal;margin-right: 5px;">公斤</i> |
| | | </el-input> |
| | | </div> |
| | | </template> |
| | |
| | | </avue-form> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getList, |
| | | } from "@/api/process/process"; |
| | | } from "@/api/process/process" |
| | | |
| | | import { |
| | | add, addKC |
| | | } from "@/api/sale/sale"; |
| | | } from "@/api/sale/sale" |
| | | |
| | | import { |
| | | addjg |
| | | } from "@/api/process/process"; |
| | | import {mapGetters} from "vuex"; |
| | | } from "@/api/process/process" |
| | | import { mapGetters } from "vuex" |
| | | import {regionData} from 'element-china-area-data' |
| | | |
| | | export default { |
| | |
| | | }, |
| | | selectionList: [], |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | //初始化列表数据 |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | console.log("submit!"); |
| | | console.log("submit!") |
| | | }, |
| | | submitSole() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | add(this.form).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanData(); |
| | | done(); |
| | | that.cleanData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanData(); |
| | | done(); |
| | | }); |
| | | that.cleanData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //加工产品 |
| | | submitJGloss() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addjg(this.formJG).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanJGData(); |
| | | done(); |
| | | that.cleanJGData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanJGData(); |
| | | done(); |
| | | }); |
| | | that.cleanJGData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | submitKCloss() { |
| | | var that = this; |
| | | var that = this |
| | | this.$refs.form.validate((vaild, done) => { |
| | | if (vaild) { |
| | | addKC(this.formKC).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }) |
| | | //提交完成,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | that.cleanKCData() |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | window.console.log(error) |
| | | //提交失败,关闭窗口清空数据 |
| | | that.cleanKCData(); |
| | | done(); |
| | | }); |
| | | that.cleanKCData() |
| | | done() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleChange(value) { |
| | | if (value != null) { |
| | | this.form.saleDestination = value[0]; |
| | | this.form.city = value[1]; |
| | | this.form.county = value[2]; |
| | | this.form.saleDestination = value[0] |
| | | this.form.city = value[1] |
| | | this.form.county = value[2] |
| | | |
| | | } |
| | | }, |
| | |
| | | }, |
| | | openWindow(index, data) { |
| | | if (index == 0) { |
| | | this.form.name = this.userInfo.nick_name; |
| | | this.form.createUser = this.userInfo.user_id; |
| | | this.form.weight = data.weight; |
| | | this.form.proid=data.id; |
| | | this.form.landId=data.landId; |
| | | this.form.strainId = data.strainId; |
| | | this.form.strainName = data.strainName; |
| | | this.visible = true; |
| | | this.form.name = this.userInfo.nick_name |
| | | this.form.createUser = this.userInfo.user_id |
| | | this.form.weight = data.weight |
| | | this.form.proid = data.id |
| | | this.form.landId = data.landId |
| | | this.form.strainId = data.strainId |
| | | this.form.strainName = data.strainName |
| | | this.visible = true |
| | | } else if (index == 1) { |
| | | this.formKC.name = this.userInfo.nick_name; |
| | | this.formKC.createUser = this.userInfo.user_id; |
| | | this.formKC.weight = data.weight; |
| | | this.formKC.proid=data.id; |
| | | this.formKC.landId=data.landId; |
| | | this.formKC.strainId = data.strainId; |
| | | this.formKC.strainName = data.strainName; |
| | | this.visibleKC = true; |
| | | this.formKC.name = this.userInfo.nick_name |
| | | this.formKC.createUser = this.userInfo.user_id |
| | | this.formKC.weight = data.weight |
| | | this.formKC.proid = data.id |
| | | this.formKC.landId = data.landId |
| | | this.formKC.strainId = data.strainId |
| | | this.formKC.strainName = data.strainName |
| | | this.visibleKC = true |
| | | } |
| | | else if (index == 2) { |
| | | this.formJG.name = this.userInfo.nick_name; |
| | | this.formJG.createUser = this.userInfo.user_id; |
| | | this.formJG.proid=data.id; |
| | | this.formJG.landId=data.landId; |
| | | this.formJG.weight = data.weight; |
| | | this.formJG.strainId = data.strainId; |
| | | this.formJG.strainName = data.strainName; |
| | | this.visibleJG = true; |
| | | this.formJG.name = this.userInfo.nick_name |
| | | this.formJG.createUser = this.userInfo.user_id |
| | | this.formJG.proid = data.id |
| | | this.formJG.landId = data.landId |
| | | this.formJG.weight = data.weight |
| | | this.formJG.strainId = data.strainId |
| | | this.formJG.strainName = data.strainName |
| | | this.visibleJG = true |
| | | } |
| | | }, |
| | | cleanData() { |
| | | var that = this; |
| | | that.form.saleDestination = ""; |
| | | that.$refs.form.resetFields(); |
| | | that.visible = false; |
| | | var that = this |
| | | that.form.saleDestination = "" |
| | | that.$refs.form.resetFields() |
| | | that.visible = false |
| | | }, |
| | | cleanKCData() { |
| | | var that = this; |
| | | that.$refs.form.resetFields(); |
| | | that.visibleKC = false; |
| | | var that = this |
| | | that.$refs.form.resetFields() |
| | | that.visibleKC = false |
| | | }, |
| | | cleanJGData() { |
| | | var that = this; |
| | | that.$refs.form.resetFields(); |
| | | that.visibleJG = false; |
| | | var that = this |
| | | that.$refs.form.resetFields() |
| | | that.visibleJG = false |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.onLoad(this.page); |
| | | this.page.pageSize = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.onLoad(this.page); |
| | | this.page.currentPage = val |
| | | this.onLoad(this.page) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | .body { |
| | | background-color: #fff; |
| | | width: 98%; |
| | |
| | | text-align: center; |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | text-align: center; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | ], |
| | | }, |
| | | data:[], |
| | | }; |
| | | } |
| | | }, |
| | | methods: { |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{ |
| | | if(res.data.code == 200){ |
| | | this.data = res.data.data.records |
| | | this.page.total = res.data.data.total |
| | | this.loading = false; |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | ], |
| | | }, |
| | | data:[], |
| | | }; |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getPage(page.currentPage,page.pageSize,Object.assign(params, this.query)).then((res)=>{ |
| | | if(res.data.code == 200){ |
| | | this.data = res.data.data.records |
| | | this.page.total = res.data.data.total |
| | | this.loading = false; |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | update, |
| | | remove, |
| | | save, |
| | | } from "@/api/farmplant/strain"; |
| | | import { mapGetters } from "vuex"; |
| | | } from "@/api/farmplant/strain" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() {}, |
| | | computed: { |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row['strainType'] =0; |
| | | row['tenantId'] = this.userInfo.tenant_id; |
| | | row['deptId'] = this.userInfo.dept_id; |
| | | row['strainType'] = 0 |
| | | row['tenantId'] = this.userInfo.tenant_id |
| | | row['deptId'] = this.userInfo.dept_id |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | this.loading = true; |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-form ref="form" :option="option" v-model="form" :upload-before="uploadBefore" :upload-after="uploadAfter"/> |
| | | <avue-form |
| | | ref="form" |
| | | :option="option" |
| | | v-model="form" |
| | | :upload-before="uploadBefore" |
| | | :upload-after="uploadAfter" |
| | | /> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {deployUpload} from "@/api/flow/flow"; |
| | | import {flowCategory} from "@/util/flow"; |
| | | import { deployUpload } from "@/api/flow/flow" |
| | | import { flowCategory } from "@/util/flow" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | 'form.flowMode'() { |
| | | this.$refs.form.option.column.filter(item => { |
| | | if (item.prop === "tenantId") { |
| | | item.display = this.form.flowMode === 2; |
| | | item.display = this.form.flowMode === 2 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | uploadBefore(file, done) { |
| | | this.$message.success('部署开始'); |
| | | this.file = file; |
| | | this.$message.success('部署开始') |
| | | this.file = file |
| | | done() |
| | | }, |
| | | uploadAfter(res, done, loading) { |
| | | if (!this.form.flowCategory) { |
| | | this.$message.warning('清先选择流程类型'); |
| | | this.$message.warning('清先选择流程类型') |
| | | loading() |
| | | return false; |
| | | return false |
| | | } |
| | | if (this.form.flowMode === 2 && !this.form.tenantId) { |
| | | this.$message.warning('清先选择对应租户'); |
| | | loading(); |
| | | return false; |
| | | this.$message.warning('清先选择对应租户') |
| | | loading() |
| | | return false |
| | | } |
| | | if (res.success) { |
| | | deployUpload( |
| | |
| | | (this.form.tenantId) ? this.form.tenantId.join(",") : "", |
| | | [this.file] |
| | | ).then(res => { |
| | | const data = res.data; |
| | | const data = res.data |
| | | if (data.success) { |
| | | done() |
| | | } else { |
| | | this.$message.error(data.msg); |
| | | this.$message.error(data.msg) |
| | | loading() |
| | | } |
| | | }) |
| | | } else { |
| | | this.$message.warning('请上传 bpmn20.xml 标准格式文件'); |
| | | this.$message.warning('请上传 bpmn20.xml 标准格式文件') |
| | | loading() |
| | | return false; |
| | | return false |
| | | } |
| | | }, |
| | | } |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot-scope="{row}" |
| | | slot="suspensionState"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot-scope="{row}" slot="suspensionState"> |
| | | <el-tag>{{row.suspensionState===1?'激活':'挂起'}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="流程删除" |
| | | append-to-body |
| | | :visible.sync="followBox" |
| | | width="20%"> |
| | | <el-form :model="form" |
| | | ref="form" |
| | | label-width="80px"> |
| | | <el-dialog title="流程删除" append-to-body :visible.sync="followBox" width="20%"> |
| | | <el-form :model="form" ref="form" label-width="80px"> |
| | | <el-form-item label="删除理由"> |
| | | <el-input v-model="deleteReason" |
| | | placeholder="请输入删除理由" /> |
| | | <el-input v-model="deleteReason" placeholder="请输入删除理由" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="followBox = false">关 闭</el-button> |
| | | <el-button type="primary" |
| | | @click="handleDelete">确 定</el-button> |
| | | <el-button type="primary" @click="handleDelete">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {mapGetters} from "vuex"; |
| | | import {followList, deleteProcessInstance} from "@/api/flow/flow"; |
| | | import { mapGetters } from "vuex" |
| | | import { followList, deleteProcessInstance } from "@/api/flow/flow" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | delBtn: this.vaildData(this.permission.flow_follow_delete, false), |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowDel(row) { |
| | | this.followBox = true; |
| | | this.selectionId = row.id; |
| | | this.processInstanceId = row.processInstanceId; |
| | | this.followBox = true |
| | | this.selectionId = row.id |
| | | this.processInstanceId = row.processInstanceId |
| | | }, |
| | | handleDelete() { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return deleteProcessInstance({deleteReason: this.deleteReason, processInstanceId: this.processInstanceId}); |
| | | return deleteProcessInstance({ deleteReason: this.deleteReason, processInstanceId: this.processInstanceId }) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.followBox = false; |
| | | this.onLoad(this.page) |
| | | this.followBox = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | followList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-radio-group v-model="mode" size="small"> |
| | | <el-radio-button label="1">通用流程</el-radio-button> |
| | |
| | | </el-radio-group> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | icon="el-icon-refresh" |
| | | v-if="permission.flow_manager_state" |
| | | @click.stop="handleState(scope.row,scope.index)">变更状态 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click.stop="handleState(scope.row,scope.index)" |
| | | >变更状态</el-button> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | icon="el-icon-search" |
| | | v-if="permission.flow_manager_image" |
| | | @click.stop="handleImage(scope.row,scope.index)">流程图 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click.stop="handleImage(scope.row,scope.index)" |
| | | >流程图</el-button> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.flow_manager_remove" |
| | | @click.stop="handleSlotDelete(scope.row,scope.index)">删除 |
| | | </el-button> |
| | | @click.stop="handleSlotDelete(scope.row,scope.index)" |
| | | >删除</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="tenantId"> |
| | | <template slot-scope="{row}" slot="tenantId"> |
| | | <el-tag>{{row.tenantId===''?'通用':row.tenantId}}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="version"> |
| | | <template slot-scope="{row}" slot="version"> |
| | | <el-tag>v{{row.version}}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="suspensionState"> |
| | | <template slot-scope="{row}" slot="suspensionState"> |
| | | <el-tag>{{row.suspensionState===1?'激活':'挂起'}}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <template slot-scope="{row}" slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <flow-design is-dialog :is-display.sync="flowBox" :process-definition-id="processDefinitionId"></flow-design> |
| | | <el-dialog title="流程变更" |
| | | append-to-body |
| | | :visible.sync="stateBox" |
| | | width="20%"> |
| | | <el-form :model="form" |
| | | ref="form" |
| | | label-width="80px"> |
| | | <flow-design |
| | | is-dialog |
| | | :is-display.sync="flowBox" |
| | | :process-definition-id="processDefinitionId" |
| | | ></flow-design> |
| | | <el-dialog title="流程变更" append-to-body :visible.sync="stateBox" width="20%"> |
| | | <el-form :model="form" ref="form" label-width="80px"> |
| | | <el-form-item label="流程状态"> |
| | | <el-select v-model="flowState" placeholder="请选择" value=""> |
| | | <el-select v-model="flowState" placeholder="请选择" value> |
| | | <el-option |
| | | v-for="item in stateOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="stateBox = false">关 闭</el-button> |
| | | <el-button type="primary" |
| | | @click="handleDoState">确 定</el-button> |
| | | <el-button type="primary" @click="handleDoState">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {mapGetters} from "vuex"; |
| | | import {managerList, changeState, deleteDeployment} from "@/api/flow/flow"; |
| | | import {flowCategory} from "@/util/flow"; |
| | | import { mapGetters } from "vuex" |
| | | import { managerList, changeState, deleteDeployment } from "@/api/flow/flow" |
| | | import { flowCategory } from "@/util/flow" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'mode'() { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | permissionList() { |
| | | return { |
| | | delBtn: this.vaildData(this.permission.flow_manager_remove, false), |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | deploymentIds() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.deploymentId); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.deploymentId) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return deleteDeployment(this.deploymentIds); |
| | | return deleteDeployment(this.deploymentIds) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | handleSlotDelete(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return deleteDeployment(row.deploymentId); |
| | | return deleteDeployment(row.deploymentId) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | handleState(row) { |
| | | this.stateBox = true; |
| | | this.selectionId = row.id; |
| | | this.stateBox = true |
| | | this.selectionId = row.id |
| | | }, |
| | | handleDoState() { |
| | | if (!this.flowState) { |
| | | this.$message({ |
| | | type: "warn", |
| | | message: "请先选择流程状态!" |
| | | }); |
| | | return; |
| | | }) |
| | | return |
| | | } |
| | | changeState({processId: this.selectionId, state: this.flowState}).then(res => { |
| | | const data = res.data; |
| | | const data = res.data |
| | | if (data.success) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: data.msg |
| | | }); |
| | | this.stateBox = false; |
| | | this.onLoad(this.page); |
| | | }) |
| | | this.stateBox = false |
| | | this.onLoad(this.page) |
| | | } else { |
| | | this.$message({ |
| | | type: "warn", |
| | | message: data.msg |
| | | }); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleImage(row) { |
| | | this.processDefinitionId = row.id; |
| | | this.flowBox = true; |
| | | this.processDefinitionId = row.id |
| | | this.flowBox = true |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const values = { |
| | | ...params, |
| | | category: (params.category) ? flowCategory(params.category) : null, |
| | | mode: this.mode |
| | | }; |
| | | this.loading = true; |
| | | } |
| | | this.loading = true |
| | | managerList(page.currentPage, page.pageSize, Object.assign(values, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | icon="el-icon-circle-plus" |
| | | v-if="permission.flow_model_create" |
| | | plain |
| | | @click="handleCreate">创 建 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | @click="handleCreate" |
| | | >创 建</el-button> |
| | | <el-button |
| | | type="danger" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | | v-if="permission.flow_model_delete" |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="text" |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | icon="el-icon-setting" |
| | | v-if="permission.flow_model_update" |
| | | @click.stop="handleUpdate(scope.row,scope.index)">配置 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click.stop="handleUpdate(scope.row,scope.index)" |
| | | >配置</el-button> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | icon="el-icon-upload2" |
| | | v-if="permission.flow_model_deploy" |
| | | @click.stop="handleDeploy(scope.row,scope.index)">部署 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click.stop="handleDeploy(scope.row,scope.index)" |
| | | >部署</el-button> |
| | | <el-button |
| | | type="text" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | | v-if="permission.flow_model_delete" |
| | | @click.stop="handleSlotDelete(scope.row,scope.index)">删除 |
| | | </el-button> |
| | | @click.stop="handleSlotDelete(scope.row,scope.index)" |
| | | >删除</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="version"> |
| | | <template slot-scope="{row}" slot="version"> |
| | | <el-tag>v{{ row.version }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="流程配置" |
| | | <el-dialog |
| | | title="流程配置" |
| | | append-to-body |
| | | destroy-on-close |
| | | :visible.sync="flowBox" |
| | | :close-on-press-escape="false" |
| | | :fullscreen="true" |
| | | :before-close="handleNutflowClose" |
| | | custom-class="wf-dialog"> |
| | | <wf-design-base v-if="nutflowOption.step === 1" |
| | | custom-class="wf-dialog" |
| | | > |
| | | <wf-design-base |
| | | v-if="nutflowOption.step === 1" |
| | | class="animated fadeIn" |
| | | style="height: calc(100vh - 108px);" |
| | | ref="wf-design" |
| | | :options="nutflowOption.step1"></wf-design-base> |
| | | <wf-design-base v-if="nutflowOption.step === 2" |
| | | :options="nutflowOption.step1" |
| | | ></wf-design-base> |
| | | <wf-design-base |
| | | v-if="nutflowOption.step === 2" |
| | | class="animated fadeIn" |
| | | style="height: calc(100vh - 108px);" |
| | | ref="wf-design-view" |
| | | :options="nutflowOption.step2"></wf-design-base> |
| | | <span slot="footer" |
| | | class="avue-dialog__footer"> |
| | | <el-button size="small" |
| | | @click="handleNutflowClose(() => {}, true)">取 消</el-button> |
| | | <el-button v-if="nutflowOption.step === 1" |
| | | :options="nutflowOption.step2" |
| | | ></wf-design-base> |
| | | <span slot="footer" class="avue-dialog__footer"> |
| | | <el-button size="small" @click="handleNutflowClose(() => {}, true)">取 消</el-button> |
| | | <el-button |
| | | v-if="nutflowOption.step === 1" |
| | | size="small" |
| | | type="success" |
| | | @click="handleStep(1)">下 一 步</el-button> |
| | | <el-button v-if="nutflowOption.step === 2" |
| | | @click="handleStep(1)" |
| | | >下 一 步</el-button> |
| | | <el-button |
| | | v-if="nutflowOption.step === 2" |
| | | size="small" |
| | | type="success" |
| | | @click="handleStep(-1)">上 一 步</el-button> |
| | | <el-button v-if="nutflowOption.step === 2" |
| | | @click="handleStep(-1)" |
| | | >上 一 步</el-button> |
| | | <el-button |
| | | v-if="nutflowOption.step === 2" |
| | | size="small" |
| | | type="primary" |
| | | @click="handleSubmitModel">确 定</el-button> |
| | | @click="handleSubmitModel" |
| | | >确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="流程部署" |
| | | append-to-body |
| | | :visible.sync="deployBox" |
| | | width="20%"> |
| | | <avue-form ref="form" |
| | | :option="optionDeploy" |
| | | v-model="form" |
| | | @submit="handleSubmit"/> |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <el-dialog title="流程部署" append-to-body :visible.sync="deployBox" width="20%"> |
| | | <avue-form ref="form" :option="optionDeploy" v-model="form" @submit="handleSubmit" /> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deployBox = false">取 消</el-button> |
| | | <el-button type="primary" |
| | | @click="handleDoDeploy" |
| | | :loading="deployLoading">确 定</el-button> |
| | | <el-button type="primary" @click="handleDoDeploy" :loading="deployLoading">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {mapGetters} from "vuex"; |
| | | import {modelList, removeModel, deployModel, submitModel, detail} from "@/api/flow/flow"; |
| | | import {flowCategory} from "@/util/flow"; |
| | | import { mapGetters } from "vuex" |
| | | import { modelList, removeModel, deployModel, submitModel, detail } from "@/api/flow/flow" |
| | | import { flowCategory } from "@/util/flow" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | minimap: true, |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.flowMode'() { |
| | | this.$refs.form.option.column.filter(item => { |
| | | if (item.prop === "tenantId") { |
| | | item.display = this.form.flowMode === 2; |
| | | item.display = this.form.flowMode === 2 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | } |
| | | }, |
| | | handleSubmit(form, done) { |
| | | this.deployLoading = true; |
| | | this.deployLoading = true |
| | | deployModel({ |
| | | modelId: this.selectionId, |
| | | category: flowCategory(form.categoryValue), |
| | | tenantIds: form.tenantId.join(",") |
| | | }).then(res => { |
| | | const data = res.data; |
| | | const data = res.data |
| | | if (data.success) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: data.msg |
| | | }); |
| | | done(); |
| | | this.$refs.form.resetForm(); |
| | | this.deployBox = false; |
| | | this.deployLoading = false; |
| | | }) |
| | | done() |
| | | this.$refs.form.resetForm() |
| | | this.deployBox = false |
| | | this.deployLoading = false |
| | | } else { |
| | | done(); |
| | | this.deployLoading = false; |
| | | done() |
| | | this.deployLoading = false |
| | | this.$message({ |
| | | type: "warn", |
| | | message: data.msg |
| | | }); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeModel(this.ids); |
| | | return removeModel(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | handleCreate() { |
| | | this.flowBox = true; |
| | | this.flowBox = true |
| | | }, |
| | | handleUpdate(row) { |
| | | detail({id: row.id}).then(res => { |
| | |
| | | const {modelEditorXml} = data |
| | | this.$set(this.nutflowOption.step1, 'xml', modelEditorXml) |
| | | this.$set(this.nutflowOption, 'process', data) |
| | | this.flowBox = true; |
| | | this.flowBox = true |
| | | }) |
| | | }, |
| | | handleDeploy(row) { |
| | | this.deployBox = true; |
| | | this.selectionId = row.id; |
| | | this.deployBox = true |
| | | this.selectionId = row.id |
| | | }, |
| | | handleDoDeploy() { |
| | | this.$refs.form.submit(); |
| | | this.$refs.form.submit() |
| | | }, |
| | | handleSlotDelete(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeModel(row.id); |
| | | return removeModel(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.onLoad(this.page); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | this.onLoad(this.page) |
| | | }) |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | modelList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | .wf-dialog { |
| | | .el-dialog__body { |
| | | padding: 5px; |
| | |
| | | icon="el-icon-delete" |
| | | v-if="permission.rail_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | <!-- 地图插入 --> |
| | | <template slot-scope="{ type, disabled }" slot="lineForm"> |
| | | <getMapDataInThere |
| | | ref="getMapData" |
| | | id="getMapData" |
| | | @setMapData="setMapData" |
| | | ></getMapDataInThere> |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | </template> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | |
| | | size="mini" |
| | | @click="start(row)" |
| | | :size="size" |
| | | >农事记录 |
| | | </el-button |
| | | > |
| | | >农事记录</el-button> |
| | | <el-button |
| | | icon="el-icon-circle-plus-outline" |
| | | type="text" |
| | | size="mini" |
| | | @click="startc(row)" |
| | | :size="size" |
| | | >采收记录 |
| | | </el-button |
| | | > |
| | | >采收记录</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, add, update, remove,getDetail} from "@/api/land/land"; |
| | | import getMapDataInThere from "./getMapDataInThere.vue"; |
| | | import { getList, add, update, remove, getDetail } from "@/api/land/land" |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | |
| | | import {mapGetters} from "vuex"; |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | } |
| | | ], |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | // this.getRailLazyTree(); |
| | |
| | | viewBtn: this.vaildData(this.permission.land_view, false), |
| | | delBtn: this.vaildData(this.permission.land_delete, false), |
| | | editBtn: this.vaildData(this.permission.land_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | rowSave(row, done, loading) { |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons; |
| | | let polLength = this.polygons.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygons |
| | | let polLength = this.polygons.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | row.userId = this.userInfo.user_id; |
| | | row.landRange = usePolygons; |
| | | row.userId = this.userInfo.user_id |
| | | row.landRange = usePolygons |
| | | } |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | |
| | | // }); |
| | | getDetail(this.form.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.form = res.data.data; |
| | | this.form = res.data.data |
| | | let usePolygons = this.form.landRange |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(","); |
| | | .split(",") |
| | | for (let k in usePolygons) { |
| | | usePolygons[k] = { |
| | | lng: +usePolygons[k].split(" ")[0], |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | }; |
| | | } |
| | | this.$refs.getMapData.draw(usePolygons); |
| | | } |
| | | }); |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | } |
| | | done(); |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | //农事操作 |
| | | start(row) { |
| | | this.$router.push({ |
| | | path: `/farmingrecord`, |
| | | query: row |
| | | }); |
| | | }) |
| | | }, |
| | | startc(row) { |
| | | this.$router.push({ |
| | | path: `/recovery`, |
| | | query: row |
| | | }); |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | .mapClass div label { |
| | | display: none; |
| | | } |
| | |
| | | .mapClassMain { |
| | | padding-left: 5rem !important; |
| | | } |
| | | |
| | | |
| | | #getMapData { |
| | | width: calc(100% + 90px); |
| | |
| | | <avue-form ref="form" v-model="form" :option="option" @submit="submit"> |
| | | <!-- 地图插入 --> |
| | | <template slot-scope="{ type, disabled }" slot="line"> |
| | | <getMapDataInThere |
| | | ref="getMapData" |
| | | id="getMapData" |
| | | @setMapData="setMapData" |
| | | ></getMapDataInThere> |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | |
| | | import {mapGetters} from "vuex"; |
| | | import {getFarmList} from "@/api/farm/farm"; |
| | | import {getDeptTree} from "@/api/system/dept"; |
| | | import {add} from "@/api/land/land"; |
| | | import website from '@/config/website'; |
| | | import getMapDataInThere from "./getMapDataInThere.vue"; |
| | | import { mapGetters } from "vuex" |
| | | import { getFarmList } from "@/api/farm/farm" |
| | | import { getDeptTree } from "@/api/system/dept" |
| | | import { add } from "@/api/land/land" |
| | | import website from '@/config/website' |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | ], |
| | | }, |
| | | visible: false, |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission", "polygons"]), |
| | | }, |
| | | mounted() { |
| | | this.initData(this.userInfo.tenant_id); |
| | | this.initData(this.userInfo.tenant_id) |
| | | }, |
| | | methods: { |
| | | initData(tenantId) { |
| | |
| | | deptId:this.userInfo.dept_id |
| | | } |
| | | getFarmList(data).then(res => { |
| | | const column = this.findObject(this.option.column, "farmId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | | const column = this.findObject(this.option.column, "farmId") |
| | | column.dicData = res.data.data |
| | | }) |
| | | }, |
| | | //初始化 |
| | | init() { |
| | | //清空面的数据 |
| | | this.$store.commit('clear_polygon'); |
| | | this.$store.commit('clear_polygon') |
| | | //计算当前时间 |
| | | this.visible = true; |
| | | this.visible = true |
| | | }, |
| | | // 表单提交 |
| | | submit(row, loading) { |
| | | row['deptId'] = this.userInfo.dept_id; |
| | | var that = this; |
| | | row['deptId'] = this.userInfo.dept_id |
| | | var that = this |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons; |
| | | let polLength = this.polygons.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygons |
| | | let polLength = this.polygons.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | row.userId = this.userInfo.user_id; |
| | | row.landRange = usePolygons; |
| | | row.userId = this.userInfo.user_id |
| | | row.landRange = usePolygons |
| | | } |
| | | add(row).then(() => { |
| | | that.$emit("refreshOnLoad"); |
| | | that.$refs.form.resetFields(); |
| | | that.visible = false; |
| | | that.$emit("refreshOnLoad") |
| | | that.$refs.form.resetFields() |
| | | that.visible = false |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | setMapData(val) { |
| | | this.LineData = val[0]; |
| | | this.PointData = val[1]; |
| | | this.LineData = val[0] |
| | | this.PointData = val[1] |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | v-if="permission.rail_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | <!-- 地图插入 --> |
| | | <template slot-scope="{ type, disabled }" slot="lineForm"> |
| | | <getMapDataInThere |
| | | ref="getMapData" |
| | | id="getMapData" |
| | | @setMapData="setMapData" |
| | | ></getMapDataInThere> |
| | | <getMapDataInThere ref="getMapData" id="getMapData" @setMapData="setMapData"></getMapDataInThere> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, add, update, remove,getDetail} from "@/api/land/land"; |
| | | import getMapDataInThere from "./getMapDataInThere.vue"; |
| | | import { getList, add, update, remove, getDetail } from "@/api/land/land" |
| | | import getMapDataInThere from "./getMapDataInThere.vue" |
| | | |
| | | import {mapGetters} from "vuex"; |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | } |
| | | ], |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | // this.getRailLazyTree(); |
| | |
| | | viewBtn: this.vaildData(this.permission.land_view, false), |
| | | delBtn: this.vaildData(this.permission.land_delete, false), |
| | | editBtn: this.vaildData(this.permission.land_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | rowSave(row, done, loading) { |
| | | if (this.polygons.length == 0) { |
| | | //没有面的数据 |
| | | this.$refs.getMapData.isCheck = true; |
| | | loading(); |
| | | this.$refs.getMapData.isCheck = true |
| | | loading() |
| | | } else { |
| | | //如果有值,空间坐标转换 |
| | | let pol = this.polygons; |
| | | let polLength = this.polygons.length - 1; |
| | | let usePolygons = ""; |
| | | let pol = this.polygons |
| | | let polLength = this.polygons.length - 1 |
| | | let usePolygons = "" |
| | | for (let k in pol) { |
| | | usePolygons += pol[k].lng + "," + pol[k].lat; |
| | | usePolygons += pol[k].lng + "," + pol[k].lat |
| | | if (k != polLength) { |
| | | usePolygons += ";"; |
| | | usePolygons += ";" |
| | | } |
| | | } |
| | | //设置坐标点 |
| | | row.userId = this.userInfo.user_id; |
| | | row.landRange = usePolygons; |
| | | row.userId = this.userInfo.user_id |
| | | row.landRange = usePolygons |
| | | } |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | |
| | | // }); |
| | | getDetail(this.form.id).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.form = res.data.data; |
| | | this.form = res.data.data |
| | | let usePolygons = this.form.landRange |
| | | .split("POLYGON((")[1] |
| | | .split("))")[0] |
| | | .split(","); |
| | | .split(",") |
| | | for (let k in usePolygons) { |
| | | usePolygons[k] = { |
| | | lng: +usePolygons[k].split(" ")[0], |
| | | lat: +usePolygons[k].split(" ")[1], |
| | | }; |
| | | } |
| | | this.$refs.getMapData.draw(usePolygons); |
| | | } |
| | | }); |
| | | this.$refs.getMapData.draw(usePolygons) |
| | | } |
| | | done(); |
| | | }) |
| | | } |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | |
| | | .mapClass div label { |
| | | display: none; |
| | | } |
| | |
| | | .mapClassMain { |
| | | padding-left: 5rem !important; |
| | | } |
| | | |
| | | |
| | | #getMapData { |
| | | width: calc(100% + 90px); |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.machining_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button type="success" |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleImport">导入 |
| | | </el-button> |
| | | @click="handleImport" |
| | | >导入</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="用户数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px"> |
| | | <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px"> |
| | | <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | 点击下载 |
| | | <i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/machining/machining"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/machining/machining" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.machining_view, false), |
| | | delBtn: this.vaildData(this.permission.machining_delete, false), |
| | | editBtn: this.vaildData(this.permission.machining_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | handleImport() { |
| | | this.excelBox = true; |
| | | this.excelBox = true |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | window.console.log(column) |
| | | this.excelBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | } |
| | | }; |
| | |
| | | </div> |
| | | <div class="out" @click="goToBack"> |
| | | <img src="../../../public/img/out.png" /> |
| | | <span> 退出</span> |
| | | <span> 返回</span> |
| | | </div> |
| | | </div> |
| | | <div class="farm-plant"> |
| | |
| | | </div> |
| | | <div class="land-info"> |
| | | <div class="content"> |
| | | <span>有轮廓的地块:</span> |
| | | <div> |
| | | 有轮廓的地块: |
| | | <span |
| | | style="font-size: 26px;font-weight: bold;color: #5ABF78;" |
| | | > {{landIsAreaStatistic[0]}}</span> |
| | | |
| | | <span>无轮廓的地块:</span> |
| | | >{{landIsAreaStatistic[0]}}</span> |
| | | </div> |
| | | |
| | | <div> |
| | | 无轮廓的地块: |
| | | <span |
| | | style="font-size: 26px;font-weight: bold;color: #E3B745;" |
| | | > {{landIsAreaStatistic[1]}}</span> |
| | | >{{landIsAreaStatistic[1]}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="farm-land"> |
| | |
| | | landList: [], |
| | | farmInfo: {}, |
| | | landAreaInfo: {}, |
| | | landIsAreaStatistic: null, |
| | | landIsAreaStatistic: [0, 0], |
| | | } |
| | | |
| | | }, |
| | |
| | | //获取地块轮廓统计信息 |
| | | getLandIsAreaStatistic () { |
| | | getLandIsAreaStatistic(this.userInfo.farmId).then(res => { |
| | | console.log(res) |
| | | this.landIsAreaStatistic = res.data.data |
| | | }) |
| | | } |
| | |
| | | top: 112px; |
| | | |
| | | .content { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin: auto; |
| | | padding: 0 40px; |
| | | width: 431px; |
| | | height: 56px; |
| | | background: rgba(0, 0, 0, 0.5); |
| | | border-radius: 28px 28px 28px 28px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 16px; |
| | | font-weight: 400; |
| | | color: #ffffff; |
| | | |
| | | & > div { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getApiList, getApiLogs} from "@/api/logs"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getApiList, getApiLogs } from "@/api/logs" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | |
| | | computed: { |
| | |
| | | permissionList() { |
| | | return { |
| | | viewBtn: this.vaildData(this.permission.log_api_view, false) |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getApiLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getApiList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getErrorList, getErrorLogs} from "@/api/logs"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getErrorList, getErrorLogs } from "@/api/logs" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | viewBtn: this.vaildData(this.permission.log_error_view, false) |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getErrorLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getErrorList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | @on-load="onLoad" |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getUsualList, getUsualLogs} from "@/api/logs"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getUsualList, getUsualLogs } from "@/api/logs" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | viewBtn: this.vaildData(this.permission.log_usual_view, false) |
| | | }; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getUsualLogs(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getUsualList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.panorama_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="{ type, disabled }" slot="chouseJdWdForm"> |
| | | <chousePoint @setData="getMapDatas" ref="chousePointRef"></chousePoint> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/panorama/panorama"; |
| | | import {getPage} from "@/api/panorama/panorama"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/panorama/panorama" |
| | | import { getPage } from "@/api/panorama/panorama" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.panorama_view, false), |
| | | delBtn: this.vaildData(this.permission.panorama_delete, false), |
| | | editBtn: this.vaildData(this.permission.panorama_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | getMapDatas(res) { |
| | | this.form["jd"] = res[0]; |
| | | this.form["wd"] = res[1]; |
| | | this.form["addressName"] = res[2]; |
| | | this.form["jd"] = res[0] |
| | | this.form["wd"] = res[1] |
| | | this.form["addressName"] = res[2] |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | this.form = res.data.data |
| | | if (type == "edit") { |
| | | let that = this; |
| | | let that = this |
| | | this.$store.commit("readDom", { |
| | | this: that, |
| | | refName: "chousePointRef", |
| | |
| | | jd: this.form.jd, |
| | | wd: this.form.wd, |
| | | name: this.form.addressName, |
| | | }); |
| | | }) |
| | | }, |
| | | }); |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/recovery"; |
| | | import { getStrainList } from "@/api/farmplant/strain"; |
| | | import { getLandList } from "@/api/land/land"; |
| | | import { getUserList } from "@/api/system/user"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getDetail, getList, update, remove, save } from "@/api/farmplant/recovery" |
| | | import { getStrainList } from "@/api/farmplant/strain" |
| | | import { getLandList } from "@/api/land/land" |
| | | import { getUserList } from "@/api/system/user" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | props:[ |
| | | "type","activeName" |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | if(this.activeName =="tab3"){ |
| | | this.option.height = 520; |
| | | this.option.height = 520 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | // }; |
| | | // }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //初始化数据 |
| | | initData(){ |
| | | var that = this; |
| | | var that = this |
| | | //获取农地数据 |
| | | getLandList(this.userInfo.dept_id).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var landIdcolumn = that.findObject(that.option.column,"landId"); |
| | | that.landList = res.data.data; |
| | | landIdcolumn.dicData = res.data.data; |
| | | var landIdcolumn = that.findObject(that.option.column, "landId") |
| | | that.landList = res.data.data |
| | | landIdcolumn.dicData = res.data.data |
| | | } |
| | | }) |
| | | //获取农产品数据 |
| | | getStrainList(0).then((res)=>{ |
| | | if(res.data.code==200){ |
| | | var strainId = that.findObject(that.option.column,"strainId"); |
| | | strainId.dicData = res.data.data; |
| | | var strainId = that.findObject(that.option.column, "strainId") |
| | | strainId.dicData = res.data.data |
| | | } |
| | | }) |
| | | //获取操作人 |
| | | const user = { |
| | | tenantId: this.userInfo.tenant_id, |
| | | }; |
| | | } |
| | | getUserList(user).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var operatorcolumn = that.findObject(that.option.column, "operator"); |
| | | operatorcolumn.dicData = res.data.data; |
| | | var operatorcolumn = that.findObject(that.option.column, "operator") |
| | | operatorcolumn.dicData = res.data.data |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }, |
| | | //新增 |
| | | rowSave(row, done, loading) { |
| | | row['farmType'] = 0; |
| | | row['createUser'] = this.userInfo.user_id; |
| | | row['farmType'] = 0 |
| | | row['createUser'] = this.userInfo.user_id |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | window.console.log(error); |
| | | loading() |
| | | window.console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //修改 |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | (error) => { |
| | | loading(); |
| | | console.log(error); |
| | | loading() |
| | | console.log(error) |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | //删除 |
| | | rowDel(row) { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | this.loading = true; |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | this.loading = true |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.remote_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/remote/remote"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/remote/remote" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.remote_view, false), |
| | | delBtn: this.vaildData(this.permission.remote_delete, false), |
| | | editBtn: this.vaildData(this.permission.remote_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const {releaseTimeRange} = this.query; |
| | | const { releaseTimeRange } = this.query |
| | | let values = { |
| | | ...params, |
| | | ...this.query |
| | | }; |
| | | } |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...values, |
| | | releaseTime_datege: releaseTimeRange[0], |
| | | releaseTime_datelt: releaseTimeRange[1], |
| | | }; |
| | | values.releaseTimeRange = null; |
| | | } |
| | | this.loading = true; |
| | | values.releaseTimeRange = null |
| | | } |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | |
| | | size="small" |
| | | @click.stop="handleDesign(scope.row.name)" |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | >设计 |
| | | </el-button> |
| | | >设计</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-view" |
| | | size="small" |
| | | @click.stop="handlePreview(scope.row.name)" |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | >预览 |
| | | </el-button> |
| | | >预览</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" slot="name"> |
| | | <el-tag style="cursor:pointer" @click="handlePreview(row.name)">{{ row.name }}</el-tag> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, remove} from "@/api/report/report"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, remove } from "@/api/report/report" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | |
| | | viewBtn: false, |
| | | delBtn: true, |
| | | editBtn: false |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | handlePreview(name) { |
| | | this.$router.push({path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}`}); |
| | | this.$router.push({ path: `/myiframe/urlPath?name=preview-${name}&src=${this.website.reportUrl}/preview?_u=blade-${name}` }) |
| | | }, |
| | | handleDesign(name) { |
| | | this.$router.push({path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.reportUrl}/designer?_u=blade-${name}`}); |
| | | this.$router.push({ path: `/myiframe/urlPath?name=designer-${name}&src=${this.website.reportUrl}/designer?_u=blade-${name}` }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | @click="handleUpload" |
| | | >上 传</el-button> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)">下载 |
| | | </el-button> |
| | | @click="handleDownload(scope.row)" |
| | | >下载</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="attachSize"> |
| | | <template slot-scope="{row}" slot="attachSize"> |
| | | <el-tag>{{`${row.attachSize} KB`}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px"> |
| | | <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter"> |
| | | </avue-form> |
| | | <el-dialog title="附件管理" append-to-body :visible.sync="attachBox" width="555px"> |
| | | <avue-form |
| | | ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter" |
| | | ></avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, remove} from "@/api/resource/attach"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, remove } from "@/api/resource/attach" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | handleUpload() { |
| | | this.attachBox = true; |
| | | this.attachBox = true |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.attachBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | window.console.log(column) |
| | | this.attachBox = false |
| | | this.refreshChange() |
| | | done() |
| | | }, |
| | | handleDownload(row) { |
| | | window.open(`${row.link}`); |
| | | window.open(`${row.link}`) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.oss_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-video-play" |
| | | size="small" |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | @click="handleDebug(scope.row)">调试 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click="handleDebug(scope.row)" |
| | | >调试</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-circle-check" |
| | | size="small" |
| | | v-if="permission.oss_enable" |
| | | @click.stop="handleEnable(scope.row)">启用 |
| | | </el-button> |
| | | @click.stop="handleEnable(scope.row)" |
| | | >启用</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="status"> |
| | | <template slot-scope="{row}" slot="status"> |
| | | <el-tag>{{row.statusName}}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <template slot-scope="{row}" slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="对象存储上传调试" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="550px"> |
| | | <el-dialog title="对象存储上传调试" append-to-body :visible.sync="box" width="550px"> |
| | | <avue-form ref="form" :option="debugOption" v-model="debugForm" @submit="handleSubmit"/> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove, enable} from "@/api/resource/oss"; |
| | | import {mapGetters} from "vuex"; |
| | | import func from "@/util/func"; |
| | | import { getList, getDetail, add, update, remove, enable } from "@/api/resource/oss" |
| | | import { mapGetters } from "vuex" |
| | | import func from "@/util/func" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | }, |
| | | ] |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.category'() { |
| | | const category = func.toInt(this.form.category); |
| | | const category = func.toInt(this.form.category) |
| | | this.$refs.crud.option.column.filter(item => { |
| | | if (item.prop === "appId") { |
| | | item.display = category === 4; |
| | | item.display = category === 4 |
| | | } |
| | | if (item.prop === "region") { |
| | | item.display = category === 4; |
| | | item.display = category === 4 |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | 'debugForm.code'() { |
| | | const column = this.findObject(this.debugOption.column, "backgroundUrl"); |
| | | column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}`; |
| | | const column = this.findObject(this.debugOption.column, "backgroundUrl") |
| | | column.action = `/api/blade-resource/oss/endpoint/put-file?code=${this.debugForm.code}` |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.oss_view), |
| | | delBtn: this.vaildData(this.permission.oss_delete), |
| | | editBtn: this.vaildData(this.permission.oss_edit) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | handleEnable(row) { |
| | | this.$confirm("是否确定启用这条配置?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return enable(row.id); |
| | | return enable(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleDebug(row) { |
| | | this.box = true; |
| | | this.debugForm.code = row.ossCode; |
| | | this.debugForm.backgroundUrl = ''; |
| | | this.box = true |
| | | this.debugForm.code = row.ossCode |
| | | this.debugForm.backgroundUrl = '' |
| | | }, |
| | | handleSubmit(form, done) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: `获取到图片地址:[${form.backgroundUrl}]` |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.sms_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button type="text" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-video-play" |
| | | size="small" |
| | | v-if="userInfo.role_name.includes('admin')" |
| | | @click="handleDebug(scope.row)">调试 |
| | | </el-button> |
| | | <el-button type="text" |
| | | @click="handleDebug(scope.row)" |
| | | >调试</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-circle-check" |
| | | size="small" |
| | | v-if="permission.sms_enable" |
| | | @click.stop="handleEnable(scope.row)">启用 |
| | | </el-button> |
| | | @click.stop="handleEnable(scope.row)" |
| | | >启用</el-button> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="status"> |
| | | <template slot-scope="{row}" slot="status"> |
| | | <el-tag>{{row.statusName}}</el-tag> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="category"> |
| | | <template slot-scope="{row}" slot="category"> |
| | | <el-tag>{{row.categoryName}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="手机短信发送调试" |
| | | append-to-body |
| | | :visible.sync="box" |
| | | width="550px"> |
| | | <el-dialog title="手机短信发送调试" append-to-body :visible.sync="box" width="550px"> |
| | | <avue-form :option="debugOption" v-model="debugForm" @submit="handleSend"/> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove, enable, send} from "@/api/resource/sms"; |
| | | import {mapGetters} from "vuex"; |
| | | import func from "@/util/func"; |
| | | import { getList, getDetail, add, update, remove, enable, send } from "@/api/resource/sms" |
| | | import { mapGetters } from "vuex" |
| | | import func from "@/util/func" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | }, |
| | | ] |
| | | } |
| | | }; |
| | | } |
| | | }, |
| | | watch: { |
| | | 'form.category'() { |
| | | const category = func.toInt(this.form.category); |
| | | const category = func.toInt(this.form.category) |
| | | this.$refs.crud.option.column.filter(item => { |
| | | if (item.prop === "templateId") { |
| | | if (category === 1) { |
| | | item.label = "模版内容"; |
| | | item.label = "模版内容" |
| | | } else { |
| | | item.label = "模版ID"; |
| | | item.label = "模版ID" |
| | | } |
| | | } |
| | | if (item.prop === "accessKey") { |
| | | if (category === 1) { |
| | | item.label = "apiKey"; |
| | | item.label = "apiKey" |
| | | } else if (category === 4) { |
| | | item.label = "appId"; |
| | | item.label = "appId" |
| | | } else { |
| | | item.label = "accessKey"; |
| | | item.label = "accessKey" |
| | | } |
| | | } |
| | | if (item.prop === "secretKey") { |
| | | item.display = category !== 1; |
| | | item.display = category !== 1 |
| | | if (category === 4) { |
| | | item.label = "appKey"; |
| | | item.label = "appKey" |
| | | } else { |
| | | item.label = "secretKey"; |
| | | item.label = "secretKey" |
| | | } |
| | | } |
| | | if (item.prop === "regionId") { |
| | | if (category === 3) { |
| | | item.display = true; |
| | | item.value = "cn-hangzhou"; |
| | | item.display = true |
| | | item.value = "cn-hangzhou" |
| | | } else { |
| | | item.display = false; |
| | | item.display = false |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | viewBtn: this.vaildData(this.permission.sms_view, false), |
| | | delBtn: this.vaildData(this.permission.sms_delete, false), |
| | | editBtn: this.vaildData(this.permission.sms_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleEnable(row) { |
| | | this.$confirm("是否确定启用这条配置?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return enable(row.id); |
| | | return enable(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | handleDebug(row) { |
| | | this.box = true; |
| | | this.debugForm.code = row.smsCode; |
| | | this.box = true |
| | | this.debugForm.code = row.smsCode |
| | | }, |
| | | handleSend(form, done, loading) { |
| | | send(form.code, form.phones, form.params).then((res) => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "发送成功!" |
| | | }); |
| | | done(); |
| | | window.console.log(res); |
| | | this.box = false; |
| | | }) |
| | | done() |
| | | window.console.log(res) |
| | | this.box = false |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | window.console.log(error) |
| | | loading() |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.sale_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/sale/sale"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/sale/sale" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.sale_view, false), |
| | | delBtn: this.vaildData(this.permission.sale_delete, false), |
| | | editBtn: this.vaildData(this.permission.sale_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.soldr_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/soldr/soldr"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove } from "@/api/soldr/soldr" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.soldr_view, false), |
| | | delBtn: this.vaildData(this.permission.soldr_delete, false), |
| | | editBtn: this.vaildData(this.permission.soldr_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | this.loading = true |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.soldrecord_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | @click="handleDelete" |
| | | >删 除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove,getListbg} from "@/api/soldrecord/soldrecord"; |
| | | import {mapGetters} from "vuex"; |
| | | import { getList, getDetail, add, update, remove, getListbg } from "@/api/soldrecord/soldrecord" |
| | | import { mapGetters } from "vuex" |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ] |
| | | }, |
| | | data: [] |
| | | }; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | viewBtn: this.vaildData(this.permission.soldrecord_view, false), |
| | | delBtn: this.vaildData(this.permission.soldrecord_delete, false), |
| | | editBtn: this.vaildData(this.permission.soldrecord_edit, false) |
| | | }; |
| | | } |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | loading() |
| | | window.console.log(error) |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }) |
| | | done() |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | loading() |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | return remove(row.id) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }) |
| | | }) |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | this.$message.warning("请选择至少一条数据") |
| | | return |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | return remove(this.ids) |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.onLoad(this.page) |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }) |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | this.form = res.data.data |
| | | }) |
| | | } |
| | | done(); |
| | | done() |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize){ |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | var datas = this.$route.query; |
| | | params.stockId1=datas.sid; |
| | | this.loading = true |
| | | var datas = this.$route.query |
| | | params.stockId1 = datas.sid |
| | | getListbg(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | }; |
| | |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | > |
| | | </avue-crud> |
| | | ></avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFarmPlantStatistics } from "@/api/farmplant/farmplant"; |
| | | import { getStrainList } from "@/api/farmplant/strain"; |
| | | import { mapGetters } from "vuex"; |
| | | import { getFarmPlantStatistics } from "@/api/farmplant/farmplant" |
| | | import { getStrainList } from "@/api/farmplant/strain" |
| | | import { mapGetters } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | this.initData(); |
| | | this.initData() |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission", "userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | let ids = [] |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | }, |
| | | mounted() { |
| | |
| | | startTime:this.getStartTime(), |
| | | endTime:this.getEndTime() |
| | | } |
| | | this.onLoad(this.page,params); |
| | | this.onLoad(this.page, params) |
| | | }, |
| | | methods: { |
| | | //合计计算 |
| | | getSummaries(param) { |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = "合计"; |
| | | return; |
| | | sums[index] = "合计" |
| | | return |
| | | } |
| | | if (index === 1) { |
| | | const values = data.map((item) => Number(item[column.property])); |
| | | const values = data.map((item) => Number(item[column.property])) |
| | | if (!values.every((value) => isNaN(value))) { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr); |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr; |
| | | return prev + curr |
| | | } else { |
| | | return prev; |
| | | return prev |
| | | } |
| | | }, 0); |
| | | sums[index] += " 亩"; |
| | | }, 0) |
| | | sums[index] += " 亩" |
| | | } else { |
| | | sums[index] = "N/A"; |
| | | sums[index] = "N/A" |
| | | } |
| | | } |
| | | }); |
| | | return sums; |
| | | }) |
| | | return sums |
| | | }, |
| | | getStartTime() { |
| | | var myDate = new Date(); |
| | | var year = myDate.getFullYear(); |
| | | var myDate = new Date() |
| | | var year = myDate.getFullYear() |
| | | //获取当前月份(0-11,0代表1月,所以要加1); |
| | | var month = myDate.getMonth() + 1; |
| | | var month = myDate.getMonth() + 1 |
| | | //获取当前日(1-31) |
| | | var day = myDate.getDate(); |
| | | var day = myDate.getDate() |
| | | if (month < 10) { |
| | | month = "0" + month; |
| | | month = "0" + month |
| | | } |
| | | if (day >= 0 && day <= 9) { |
| | | day = "0" + day; |
| | | day = "0" + day |
| | | } |
| | | var firstDay = year + "-" + month + "-01"; |
| | | var firstDay = year + "-" + month + "-01" |
| | | // this.query['startTime'] = firstDay; |
| | | return firstDay; |
| | | return firstDay |
| | | }, |
| | | getEndTime() { |
| | | var myDate = new Date(); |
| | | var year = myDate.getFullYear(); |
| | | var myDate = new Date() |
| | | var year = myDate.getFullYear() |
| | | //获取当前月份(0-11,0代表1月,所以要加1); |
| | | var month = myDate.getMonth() + 1; |
| | | var month = myDate.getMonth() + 1 |
| | | //获取当前日(1-31) |
| | | var day = myDate.getDate(); |
| | | var day = myDate.getDate() |
| | | if (month < 10) { |
| | | month = "0" + month; |
| | | month = "0" + month |
| | | } |
| | | if (day >= 0 && day <= 9) { |
| | | day = "0" + day; |
| | | day = "0" + day |
| | | } |
| | | var thisDay = year + "-" + month + "-" + day; |
| | | var thisDay = year + "-" + month + "-" + day |
| | | // this.query['endTime'] = thisDay; |
| | | return thisDay; |
| | | return thisDay |
| | | }, |
| | | initData() { |
| | | var that = this; |
| | | var that = this |
| | | //获取农产品数据 |
| | | getStrainList(0).then((res) => { |
| | | if (res.data.code == 200) { |
| | | var strainId = that.findObject(that.option.column, "strainId"); |
| | | strainId.dicData = res.data.data; |
| | | var strainId = that.findObject(that.option.column, "strainId") |
| | | strainId.dicData = res.data.data |
| | | } |
| | | }); |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | this.query = {} |
| | | this.onLoad(this.page) |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | this.query = params |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, params) |
| | | done() |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.selectionList = list |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.selectionList = [] |
| | | this.$refs.crud.toggleSelection() |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page, this.query) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | const { releaseTimeRange } = this.query; |
| | | params['tenantId'] = this.userInfo.tenant_id; |
| | | params['deptId'] = this.userInfo.dept_id; |
| | | this.loading = true |
| | | const { releaseTimeRange } = this.query |
| | | params['tenantId'] = this.userInfo.tenant_id |
| | | params['deptId'] = this.userInfo.dept_id |
| | | let values = { |
| | | ...params, |
| | | }; |
| | | } |
| | | if (releaseTimeRange) { |
| | | values = { |
| | | ...params, |
| | | startTime: releaseTimeRange[0], |
| | | endTime: releaseTimeRange[1], |
| | | ...this.query, |
| | | }; |
| | | values.releaseTimeRange = null; |
| | | } |
| | | values.releaseTimeRange = null |
| | | } |
| | | getFarmPlantStatistics(page.currentPage, page.pageSize, values).then( |
| | | (res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | const data = res.data.data |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.loading = false |
| | | this.selectionClear() |
| | | } |
| | | ); |
| | | ) |
| | | }, |
| | | }, |
| | | }; |