jinhui.wang

增加特殊规则释放舱位重量提示

......@@ -60,3 +60,15 @@ export function changeStatusById(data) {
data: data
})
}
//特殊规则获取释放仓位重量
/**
* @param id ID *
*/
export function getReleaseWeight(data) {
return request({
url: '/shipperAccount/getReleaseWeight',
method: 'post',
data: data
})
}
\ No newline at end of file
......
......@@ -48,7 +48,7 @@
</template>
<script>
import { queryShipperAccountRule, changeStatusById, queryShipperAccountRuleById } from "@/api/supserAllocation"
import { queryShipperAccountRule, changeStatusById, queryShipperAccountRuleById, getReleaseWeight } from "@/api/supserAllocation"
import Dialog from './dialog.vue';
export default {
......@@ -133,6 +133,8 @@ export default {
},
//删除
del(val) {
getReleaseWeight({ id: val.id }).then(res => {
if (res.code === 200) {
this.$confirm("是否要删除记录!", "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
......@@ -140,7 +142,7 @@ export default {
}).then(() => {
changeStatusById({ id: val.id, status: 2 }).then(res => {
if (res.code === 200) {
this.msgSuccess('删除成功!')
this.msgSuccess(`删除成功!以释放舱位${res.data}`)
this.selection(1)
} else {
this.msgWarning(res.msg)
......@@ -149,6 +151,12 @@ export default {
console.log(err)
})
}).catch(() => { })
} else {
this.msgWarning(res.code)
}
}).catch(err => {
console.log(err)
})
},
//停用启用
changeStatus(val) {
......@@ -161,22 +169,31 @@ export default {
status = 0
tip = '停用'
}
this.$confirm(`是否要${tip}记录!`, "注意!", {
if (tip === "停用") {
getReleaseWeight({ id: val.id }).then(res => {
if (res.code === 200) {
this.$confirm(`预计释放仓位为${res.data},是否确定!`, "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
changeStatusById({ id: val.id, status: status }).then(res => {
if (res.code === 200) {
this.msgSuccess(tip + '成功!')
this.selection(1)
this.statusChange({ id: val.id, status: status, tip: tip })
}).catch(() => { })
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
} else {
this.$confirm(`是否要${tip}记录!`, "注意!", {
confirmButtonText: "确定",
cancelButtonText: '取消',
type: "warning",
}).then(() => {
this.statusChange({ id: val.id, status: status, tip: tip })
}).catch(() => { })
}
},
//复制
copy(val) {
......@@ -185,6 +202,23 @@ export default {
this.ruleData.id = undefined
this.dialogVisible = true
},
//状态修改请求
statusChange(val) {
changeStatusById(val).then(res => {
if (res.code === 200) {
if (val.tip == '停用') {
this.msgSuccess(`${val.tip}成功!以释放${res.data}`)
} else {
this.msgSuccess(`${val.tip}成功!`)
}
this.selection(1)
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
//关闭
close() {
this.dialogVisible = false
......