diff --git a/anrui-scm/anrui-scm-ui/src/views/anruiscm/scmwarehouse/scmwarehouse.vue b/anrui-scm/anrui-scm-ui/src/views/anruiscm/scmwarehouse/scmwarehouse.vue index 75802f8382..b0fcb2a22b 100644 --- a/anrui-scm/anrui-scm-ui/src/views/anruiscm/scmwarehouse/scmwarehouse.vue +++ b/anrui-scm/anrui-scm-ui/src/views/anruiscm/scmwarehouse/scmwarehouse.vue @@ -15,13 +15,13 @@ - + - + - + @@ -44,18 +44,18 @@
- - - - + + + + - - - - + + + +
@@ -68,9 +68,9 @@ - + - + @@ -106,7 +106,6 @@ export default { size: 10, total: 0, params: { - sids: [], // 用于导出的时候保存已选择SID useOrgSid: '', // 使用组织sid warehouseName: '', // 名称 warehouseAttribute: '', // 存放地点属性 @@ -178,86 +177,38 @@ export default { break } }, - toAdd(row) { - this.viewState = 2 - this.$refs['divadd'].showAdd() - }, - toEdit() { - if (this.multipleSelection.length === 0) { - this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' }) - return - } - if (this.multipleSelection.length > 1) { - this.$message({ showClose: true, type: 'error', message: '只能选择一条记录进行编辑' }) - return - } - this.viewState = 3 - const row = this.multipleSelection[0] - this.$refs['divadd'].showEdit(row) - }, - doDel(row) { - if (this.multipleSelection.length === 0) { - this.$message({showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作'}) - return - } - const sids = [] - this.multipleSelection.forEach(row => { - sids.push(row.sid) - }) - const tip = '请确认是否删除所选 ' + this.multipleSelection.length + ' 条记录?' - this.$confirm(tip, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }) - req.delBySids(sids).then(resp => { - loading.close() - this.$message({ type: 'success', message: resp.msg, showClose: true }) - this.loadList() - }).catch(e => { - loading.close() - }) - }).catch(() => { - }) - }, - toInfo(row) { - this.$refs['divinfo'].showInfo(row) - console.log('详情回显', row) - this.viewState = 4 - }, dosearch() { this.queryParams.current = 1 this.loadList() }, resetQuery() { - this.queryParams.params = { - sids: [], // 用于导出的时候保存已选择SID - useOrgSid: '', - warehouseName: '', // 名称 - warehouseAttribute: '', // 存放地点属性 - warehouseContract: '', // 存放地点负责人 - warehouseGroup: '' // 分组 + this.queryParams = { + current: 1, + size: 10, + total: 0, + params: { + useOrgSid: '', // 使用组织sid + warehouseName: '', // 名称 + warehouseAttribute: '', // 存放地点属性 + warehouseContract: '', // 存放地点负责人 + warehouseGroup: '' // 分组 + } } - this.queryParams.params.sid = '' // sid - this.queryParams.params.name = '' // 登录名 this.dosearch() }, loadList() { - const _this = this this.tableLoading = true - req.listPage(this.queryParams).then(resp => { - _this.tableLoading = false - const data = resp.data - _this.queryParams.total = data.total - _this.dataList = data.records + req.listPage(this.queryParams).then((resp) => { + this.tableLoading = false + if (resp.success) { + this.queryParams.total = resp.data.total + this.dataList = resp.data.records + } else { + this.queryParams.total = 0 + this.dataList = [] + } }).catch(() => { - _this.tableLoading = false + this.tableLoading = false }) }, handleSelectionChange(val) { @@ -294,6 +245,55 @@ export default { var pageindex = index + 1 + pagestart return pageindex }, + toAdd() { + this.viewState = 2 + this.$refs['divAdd'].showAdd() + }, + toEdit() { + if (this.multipleSelection.length === 1) { + this.viewState = 3 + this.$refs['divAdd'].showEdit(this.multipleSelection[0]) + } else { + this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行编辑' }) + } + }, + doDel() { + if (this.multipleSelection.length === 0) { + this.$message({ showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' }) + return + } + const sids = [] + this.multipleSelection.forEach(row => { + sids.push(row.sid) + }) + const tip = '请确认是否删除所选 ' + this.multipleSelection.length + ' 条记录?' + this.$confirm(tip, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.delBySids(sids).then((resp) => { + loading.close() + if (resp.success) { + this.$message({ type: 'success', message: resp.msg, showClose: true }) + this.loadList() + } + }).catch(e => { + loading.close() + }) + }).catch(() => { + }) + }, + toInfo(row) { + this.viewState = 4 + this.$refs['divInfo'].showInfo(row) + }, doClose() { this.$store.dispatch('tagsView/delView', this.$route) this.$router.go(-1)