src/views/overview/AddOverviewDialog.vue
@@ -37,8 +37,10 @@
            :isValidateClick="isValidateClick"
            :isDelClick="isDelClick"
            :list="list"
            :showCancel="showCancel"
            @delClick="delClick"
            @validateClick="validateClick"
            @btnCancel="btnCancel"
          />
        </div>
        <div class="basic-info">
@@ -225,6 +227,7 @@
            <el-tabs v-model="activeName" type="card">
              <!-- <el-tab-pane v-if="workType !== 1" label="详情" name="detail"> </el-tab-pane> -->
              <el-tab-pane label="产品" name="first"> </el-tab-pane>
              <el-tab-pane label="发货信息" name="two"></el-tab-pane>
            </el-tabs>
            <!-- 操作 -->
            <div v-if="activeName === 'first'">
@@ -244,6 +247,30 @@
                  </el-table-column>
                </template>
              </CommonFormTableView>
            </div>
            <!-- 发货信息 -->
            <div v-if="activeName==='two'">
              <el-form label-position="left" label-width="80px" :model="shipmentsInfo">
                <el-form-item label="承运商"  style="width: 50%;">
                  <el-select :disabled="!showFooter" v-model="editConfig.infomation.logisticCompanyId" placeholder="请选择" style="width: 100%;">
                    <el-option
                      v-for="item in shipmentsInfo.carrier"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="运单号" style="width: 50%;">
                  <el-input :disabled="!showFooter" v-model="editConfig.infomation.waybillNumber"></el-input>
                </el-form-item>
                <el-form-item label="重量" style="width: 50%;">
                  <el-input :disabled="!showFooter" v-model="editConfig.infomation.weight"></el-input>
                </el-form-item>
                <el-form-item label="物流重量" style="width: 50%;">
                  <el-input :disabled="!showFooter" v-model="editConfig.infomation.logisticWeight"></el-input>
                </el-form-item>
              </el-form>
            </div>
            <!-- 详情 -->
            <!-- <div v-if="activeName === 'detail'">
@@ -284,8 +311,10 @@
  addOperation,
  updateOperation,
  updateStatus,
  stateCancel,
  deleteOperation,
  getListTransfer
  getListTransfer,
  getLogisticCompanyList
} from "@/api/overview/overview"
import { getCompanyList } from "@/api/common/other"
export default {
@@ -335,7 +364,8 @@
        { label: "草稿", status: "todo", value: 1 },
        { label: "正在等待", status: "todo", value: 2 },
        { label: "就绪", status: "todo", value: 3 },
        { label: "完成", status: "todo", value: 4 }
        { label: "完成", status: "todo", value: 4 },
        { label: "已取消", status: "todo", value: 5 }
      ],
      showButton: true,
      activeName: "first",
@@ -356,7 +386,14 @@
      companyObj: {},
      contacterObj: {},
      isValidateClick: false, // 验证是否显示
      operationTypeOptions: [] // 入库类型列表
      operationTypeOptions: [], // 入库类型列表
      shipmentsInfo: {
        carrier:[],
        waybillNumber:'',
        weight:0,
        logisticWeight:0,
      },
      showCancel:false, // 取消是否可以显示
    }
  },
  created() {
@@ -369,6 +406,7 @@
    if (this.showOperationType) {
      this.getListTransfer()
    }
    this.getLogisticCompanyList()
  },
  methods: {
    // 获取公司列表
@@ -433,8 +471,12 @@
        this.showFooter = false
        if (this.editConfig.infomation.status === "完成") {
          this.isValidateClick = false
        } else {
        }else if(this.editConfig.infomation.status === 3){
          this.isValidateClick = true
          this.showCancel=true
        }else{
          this.isValidateClick = true
        }
      } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "完成") {
        this.showButton = true
@@ -453,6 +495,7 @@
        this.showEdit = true
        this.showFooter = false
        this.isValidateClick = true
        this.showCancel=true
      }
      if (this.editConfig.title === "新建") {
        this.list[0].status = "active"
@@ -477,6 +520,13 @@
      this.showButton = false
      this.showFooter = true
      this.setTableForm()
    },
    async getLogisticCompanyList(){
      await getLogisticCompanyList().then((res) => {
        if(res.code===200){
          this.shipmentsInfo.carrier=res.data
        }
      })
    },
    // 保存
    saveClick(formName) {
@@ -542,7 +592,11 @@
        operationTypeName: this.receiptType,
        sourceNumber: data.sourceNumber || "",
        status: 3,
        toLocationId: data.toLocationId || 0
        toLocationId: data.toLocationId || 0,
        waybillNumber:data.waybillNumber||'',
        weight:data.weight||0,
        logisticWeight:data.logisticWeight||0,
        logisticCompanyId:data.logisticCompanyId,
      }
      return params
    },
@@ -708,6 +762,32 @@
          this.$parent.getData()
        }
      })
    },
    // 取消
    btnCancel(){
      this.$confirm('确定取消吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        stateCancel(this.editConfig.infomation.id).then((res) => {
          console.log(res)
          this.editConfig.visible = false
          if (res.code === 200) {
            this.$message.success("取消调拨")
            this.$parent.getData()
          }
        })
        this.list.map((item) => {
          if (item.label==="已取消") {
            item.status = "active"
          } else {
            item.status = "todo"
          }
        })
      }).catch(() => {
      });
    }
  }
}
@@ -771,10 +851,10 @@
  .el-tabs--card > .el-tabs__header {
    border-bottom: none;
  }
  .el-tabs__item.is-active {
    color: #333;
    background: #f1f3f8;
  }
  // .el-tabs__item.is-active {
  //   color: #333;
  //   background: #f1f3f8;
  // }
  .el-tabs__item {
    height: 30px;
    line-height: 30px;
@@ -784,5 +864,18 @@
  .el-tabs__header {
    margin: 0 0 1px;
  }
  .bottom{
    .el-form{
      // border-top: 1px solid #EBEEF5;
    }
    .el-form-item{
      height: 28px;
      .el-input {
        input{
          height: 28px;
        }
      }
    }
  }
}
</style>