review.vue 1.36 KB
Newer Older
huhaiqing's avatar
huhaiqing committed
1 2 3 4
<template>
  <div>
    <el-form ref="reviewForm" :model="reviewObj" label-width="120px">
      <el-form-item label="申请理由">
huhaiqing's avatar
huhaiqing committed
5
        <el-input v-model="reviewObj.applyReason" type="textarea" rows="2" placeholder="请输入申请理由"></el-input>
huhaiqing's avatar
huhaiqing committed
6 7 8 9 10 11 12 13 14 15
      </el-form-item>
    </el-form>
    <el-row class="operate-button">
      <el-button type="success" @click="onSubmit">发起申请</el-button>
      <el-button @click="cancel">关闭</el-button>
    </el-row>
  </div>
</template>

<script>
huhaiqing's avatar
huhaiqing committed
16
import { approvalCreate, serviceMsg } from "@/api/ecw/boxSea";
huhaiqing's avatar
huhaiqing committed
17 18

/**
19
 * 反审
huhaiqing's avatar
huhaiqing committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
 */
export default {
  name: "review",
  inheritAttrs: false,
  data() {
    return {
      // 反审对象
      reviewObj: {},
    };
  },
  methods: {
    /** 提交 */
    onSubmit() {
      this.$refs["reviewForm"].validate((valid) => {
        if (valid) {
35
          const { currNode, shipmentObj } = this.$attrs;
huhaiqing's avatar
huhaiqing committed
36
          approvalCreate({
37
            shipmentId: shipmentObj.id,
huhaiqing's avatar
huhaiqing committed
38
            ...this.reviewObj,
39
            approvalStatus: 0,
40
            approvalType: currNode.type === "preinstall" ? 4 : 7, // 4预装反审 7卸柜反审核
huhaiqing's avatar
huhaiqing committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
          }).then((res) => {
            serviceMsg(res, this).then(() => {
              this.cancel("submit");
            });
          });
        }
      });
    },
    /** 取消 */
    cancel(type) {
      this.$emit("closeDialog", type);
    },
  },
};
</script>