123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- // 分派计划
- <template>
- <div class="steel_inbound">
- <div class="sache">
- <el-input placeholder="请输入内容" v-model="inputText" clearable>
- </el-input>
- <el-button type="primary" class="btn">
- <i class="el-icon-search"></i>查询
- </el-button>
- <el-button
- type="primary"
- class="btn"
- @click="dispatch"
- v-if="activeName == 'first'"
- >
- <i class="el-icon-download"></i>分派</el-button
- >
- </div>
- <template>
- <div>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="未分派" name="first">
- <dilTable v-bind.sync="first" @selection-change="selectionChange">
- </dilTable>
- </el-tab-pane>
- <el-tab-pane label="已分派" name="second">
- <dilTable v-bind.sync="second"> </dilTable>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- inputText: "",
- first: {
- // first请求数据的地址
- requestUrl:
- "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=40",
- selectionType: "select",
- mapList: [],
- },
- second: {
- // second请求数据的地址
- requestUrl:
- "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=40",
- },
- activeName: "first",
- };
- },
- methods: {
- selectionChange(selection) {
- this.first.mapList = selection
- },
- dispatch() {
- if(this.first.mapList.length == 0){
- this.$alert('请选择订单')
- return
- }
- this.$confirm("是否分派", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- center: true,
- })
- .then(() => {
- this.axios
- .post("/api/v1/oms/apportionInwardOrder", this.first.mapList)
- .then((res) => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "分派成功!",
- });
- this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=40&test=1"
- this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=40&test=1"
- this.activeName = 'second'
- this.first.mapList = []
- } else {
- this.$message({
- message: "分派失败",
- type: "warning",
- });
- }
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "分派操作已取消!",
- });
- });
- },
- deletePlan(scope) {
- this.$confirm("是否删除", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- center: true,
- })
- .then(() => {
- this.axios
- .post(
- "/api/v1/bms/deleteTrainSettlement/" + scope.row.requirementId
- )
- .then((res) => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- this.$router.go(0);
- } else {
- this.$message({
- message: "删除失败",
- type: "warning",
- });
- }
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "删除操作已取消!",
- });
- });
- },
- },
- };
- </script>
- <style lang="scss">
- .steel_inbound{
- .sache{
- padding: 1.25rem 0.375rem;
- .el-input {
- width: 20%;
- margin-right: 1.25rem;
- }
- }
- }
- </style>
|