withdrawal.vue 3.21 KB
Newer Older
1
<template>
2 3 4 5 6 7 8 9

  <el-dialog
    :visible.sync="dialogVisible"
    :before-close="()=>{
      $parent.show = false;
    }"
    width="80%">
    <div style="padding: 0 20px">
dcy's avatar
dcy committed
10
      <h1>{{$t('申请退仓')}}-{{orderDetails.orderNo}}</h1>
11 12
      <el-divider></el-divider>
      <el-form label-width="150px">
dcy's avatar
dcy committed
13
        <el-form-item :label="$t('退仓原因')">
14 15 16 17
          <el-input v-model="params.reason" style="width:500px" type="textarea"></el-input>
        </el-form-item>
      </el-form>
      <el-divider></el-divider>
dcy's avatar
dcy committed
18
      <h2>{{$t('审批流程')}}</h2>
19 20 21 22
      <div style="padding: 20px">
        <work-flow xmlkey="retired_warehouse" v-model="params.copyUserId"  />
      </div>
      <div>
dcy's avatar
dcy committed
23 24 25 26
        <el-button v-if="isExamine" @click="submit" type="primary" style="margin-right: 20px;">{{$t('确定退仓')}}</el-button>
        <el-button v-if="!isExamine" @click="$router.push({query:{id:details.formId},path:'/bpm/process-instance/detail'})" type="primary" style="margin-right: 20px;">{{$t('审核中')}}</el-button>
        <el-button  v-if="!isExamine" type="primary" style="margin-right: 20px;" @click="cancellationOfOrder">{{$t('取消审核')}}</el-button>
        <el-button @click="$parent.show = false;">{{$t('不,再考虑考虑')}}</el-button>
27
      </div>
28
    </div>
29
  </el-dialog>
30 31 32
</template>
<!--退仓-->
<script>
dcy's avatar
dcy committed
33 34 35 36 37 38
import {cancelAdjust, getOrder} from "@/api/ecw/order";
import {
  getRollbackApprovalInfo,
  orderWarehouseInDelete,
  warehouseApprovalCancel
} from "@/api/ecw/batchSingleApplication";
dcy's avatar
dcy committed
39
import workFlow from "@/components/WorkFlow";
40 41 42 43

export default {
  name: "withdrawal",
  props:{
44 45
    orderId:Number,
    dialogVisible:Boolean
46
  },
dcy's avatar
dcy committed
47 48 49
  components:{
    workFlow
  },
50 51
  data(){
    return {
52 53 54 55 56
      orderDetails:{},
      params:{
        orderId:undefined,
        orderNo:undefined,
        reason:'',
dcy's avatar
dcy committed
57
        copyUserId:[],
dcy's avatar
dcy committed
58
      },
dcy's avatar
dcy committed
59 60 61 62
      isExamine:true,
      details:{},


63 64 65
    }
  },
  created() {
66
    getOrder(this.orderId).then(r => this.orderDetails = r.data);
dcy's avatar
dcy committed
67 68 69 70 71 72 73 74 75
    getRollbackApprovalInfo({orderId:this.orderId}).then(r => {
      console.log(r)
      if(r.data.status === 1){
          this.details = r.data;
          this.isExamine = false;
          this.params.reason = JSON.parse(this.details.details).reason
      }

    })
76 77 78
  },
  methods:{
    submit(){
79 80 81 82
      this.params.orderId =  this.orderDetails.orderId;
      this.params.orderNo =this.orderDetails.orderNo;
      orderWarehouseInDelete(this.params).then(r => {
       if(r.code === 0){
dcy's avatar
dcy committed
83
         this.$message.success(this.$t('退仓成功'));
84 85
         this.params = {}
         this.$parent.show = false
86
       }
87
      })
dcy's avatar
dcy committed
88 89
    },
    cancellationOfOrder(){
dcy's avatar
dcy committed
90 91 92
      this.$prompt(this.$t('请输入取消审核原因'), this.$t('提示'), {
        confirmButtonText: this.$t('确定'),
        cancelButtonText: this.$t('取消'),
dcy's avatar
dcy committed
93 94 95
      }).then(({ value }) => {
        warehouseApprovalCancel(this.details.id,value) .then(r => {
          if(r.data){
dcy's avatar
dcy committed
96
            this.$message.success(this.$t('取消成功'))
dcy's avatar
dcy committed
97 98 99 100 101 102 103 104
            this.params = {}
            this.$parent.show = false

          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
dcy's avatar
dcy committed
105
          message: this.$t('取消成功')
dcy's avatar
dcy committed
106 107
        });
      });
108 109 110 111 112 113 114 115
    }
  }
}
</script>

<style scoped>

</style>