Showing
2 changed files
with
53 additions
and
7 deletions
| ... | @@ -60,3 +60,15 @@ export function changeStatusById(data) { | ... | @@ -60,3 +60,15 @@ export function changeStatusById(data) { |
| 60 | data: data | 60 | data: data |
| 61 | }) | 61 | }) |
| 62 | } | 62 | } |
| 63 | + | ||
| 64 | +//特殊规则获取释放仓位重量 | ||
| 65 | +/** | ||
| 66 | + * @param id ID * | ||
| 67 | + */ | ||
| 68 | +export function getReleaseWeight(data) { | ||
| 69 | + return request({ | ||
| 70 | + url: '/shipperAccount/getReleaseWeight', | ||
| 71 | + method: 'post', | ||
| 72 | + data: data | ||
| 73 | + }) | ||
| 74 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -48,7 +48,7 @@ | ... | @@ -48,7 +48,7 @@ |
| 48 | </template> | 48 | </template> |
| 49 | 49 | ||
| 50 | <script> | 50 | <script> |
| 51 | -import { queryShipperAccountRule, changeStatusById, queryShipperAccountRuleById } from "@/api/supserAllocation" | 51 | +import { queryShipperAccountRule, changeStatusById, queryShipperAccountRuleById, getReleaseWeight } from "@/api/supserAllocation" |
| 52 | import Dialog from './dialog.vue'; | 52 | import Dialog from './dialog.vue'; |
| 53 | 53 | ||
| 54 | export default { | 54 | export default { |
| ... | @@ -133,6 +133,8 @@ export default { | ... | @@ -133,6 +133,8 @@ export default { |
| 133 | }, | 133 | }, |
| 134 | //删除 | 134 | //删除 |
| 135 | del(val) { | 135 | del(val) { |
| 136 | + getReleaseWeight({ id: val.id }).then(res => { | ||
| 137 | + if (res.code === 200) { | ||
| 136 | this.$confirm("是否要删除记录!", "注意!", { | 138 | this.$confirm("是否要删除记录!", "注意!", { |
| 137 | confirmButtonText: "确定", | 139 | confirmButtonText: "确定", |
| 138 | cancelButtonText: '取消', | 140 | cancelButtonText: '取消', |
| ... | @@ -140,7 +142,7 @@ export default { | ... | @@ -140,7 +142,7 @@ export default { |
| 140 | }).then(() => { | 142 | }).then(() => { |
| 141 | changeStatusById({ id: val.id, status: 2 }).then(res => { | 143 | changeStatusById({ id: val.id, status: 2 }).then(res => { |
| 142 | if (res.code === 200) { | 144 | if (res.code === 200) { |
| 143 | - this.msgSuccess('删除成功!') | 145 | + this.msgSuccess(`删除成功!以释放舱位${res.data}`) |
| 144 | this.selection(1) | 146 | this.selection(1) |
| 145 | } else { | 147 | } else { |
| 146 | this.msgWarning(res.msg) | 148 | this.msgWarning(res.msg) |
| ... | @@ -149,6 +151,12 @@ export default { | ... | @@ -149,6 +151,12 @@ export default { |
| 149 | console.log(err) | 151 | console.log(err) |
| 150 | }) | 152 | }) |
| 151 | }).catch(() => { }) | 153 | }).catch(() => { }) |
| 154 | + } else { | ||
| 155 | + this.msgWarning(res.code) | ||
| 156 | + } | ||
| 157 | + }).catch(err => { | ||
| 158 | + console.log(err) | ||
| 159 | + }) | ||
| 152 | }, | 160 | }, |
| 153 | //停用启用 | 161 | //停用启用 |
| 154 | changeStatus(val) { | 162 | changeStatus(val) { |
| ... | @@ -161,22 +169,31 @@ export default { | ... | @@ -161,22 +169,31 @@ export default { |
| 161 | status = 0 | 169 | status = 0 |
| 162 | tip = '停用' | 170 | tip = '停用' |
| 163 | } | 171 | } |
| 164 | - this.$confirm(`是否要${tip}记录!`, "注意!", { | 172 | + if (tip === "停用") { |
| 173 | + getReleaseWeight({ id: val.id }).then(res => { | ||
| 174 | + if (res.code === 200) { | ||
| 175 | + this.$confirm(`预计释放仓位为${res.data},是否确定!`, "注意!", { | ||
| 165 | confirmButtonText: "确定", | 176 | confirmButtonText: "确定", |
| 166 | cancelButtonText: '取消', | 177 | cancelButtonText: '取消', |
| 167 | type: "warning", | 178 | type: "warning", |
| 168 | }).then(() => { | 179 | }).then(() => { |
| 169 | - changeStatusById({ id: val.id, status: status }).then(res => { | 180 | + this.statusChange({ id: val.id, status: status, tip: tip }) |
| 170 | - if (res.code === 200) { | 181 | + }).catch(() => { }) |
| 171 | - this.msgSuccess(tip + '成功!') | ||
| 172 | - this.selection(1) | ||
| 173 | } else { | 182 | } else { |
| 174 | this.msgWarning(res.msg) | 183 | this.msgWarning(res.msg) |
| 175 | } | 184 | } |
| 176 | }).catch(err => { | 185 | }).catch(err => { |
| 177 | console.log(err) | 186 | console.log(err) |
| 178 | }) | 187 | }) |
| 188 | + } else { | ||
| 189 | + this.$confirm(`是否要${tip}记录!`, "注意!", { | ||
| 190 | + confirmButtonText: "确定", | ||
| 191 | + cancelButtonText: '取消', | ||
| 192 | + type: "warning", | ||
| 193 | + }).then(() => { | ||
| 194 | + this.statusChange({ id: val.id, status: status, tip: tip }) | ||
| 179 | }).catch(() => { }) | 195 | }).catch(() => { }) |
| 196 | + } | ||
| 180 | }, | 197 | }, |
| 181 | //复制 | 198 | //复制 |
| 182 | copy(val) { | 199 | copy(val) { |
| ... | @@ -185,6 +202,23 @@ export default { | ... | @@ -185,6 +202,23 @@ export default { |
| 185 | this.ruleData.id = undefined | 202 | this.ruleData.id = undefined |
| 186 | this.dialogVisible = true | 203 | this.dialogVisible = true |
| 187 | }, | 204 | }, |
| 205 | + //状态修改请求 | ||
| 206 | + statusChange(val) { | ||
| 207 | + changeStatusById(val).then(res => { | ||
| 208 | + if (res.code === 200) { | ||
| 209 | + if (val.tip == '停用') { | ||
| 210 | + this.msgSuccess(`${val.tip}成功!以释放${res.data}`) | ||
| 211 | + } else { | ||
| 212 | + this.msgSuccess(`${val.tip}成功!`) | ||
| 213 | + } | ||
| 214 | + this.selection(1) | ||
| 215 | + } else { | ||
| 216 | + this.msgWarning(res.msg) | ||
| 217 | + } | ||
| 218 | + }).catch(err => { | ||
| 219 | + console.log(err) | ||
| 220 | + }) | ||
| 221 | + }, | ||
| 188 | //关闭 | 222 | //关闭 |
| 189 | close() { | 223 | close() { |
| 190 | this.dialogVisible = false | 224 | this.dialogVisible = false | ... | ... |
-
Please register or login to post a comment