light.vue 4.93 KB
Newer Older
1 2 3 4
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-card>
我在何方's avatar
我在何方 committed
5
        <div slot="header" class="card-title">{{$t('申请泡货优惠')}}-{{queryParams.orderNo||''}}</div>
6 7
        <el-form :model="queryParams" ref="queryForms" size="small" :inline="true"  label-width="120px" class="card">
          <el-row >
我在何方's avatar
我在何方 committed
8
              <el-form-item :label="$t('原泡货标准:')" label-width="150px">
9 10 11 12
                  <span>{{queryParams.orgVWeight}}kg/cbm</span>
              </el-form-item>
          </el-row>
          <el-row :span="8" >
我在何方's avatar
我在何方 committed
13
             <el-form-item :label="$t('*现泡货申请标准:')" size="medium" label-width="150px">
14 15 16 17 18
               <el-input style="width: 100px;"  type="text" v-model="queryParams.vweight"  />
                <span style="margin-left: 10px;">kg/cbm</span>
             </el-form-item>
          </el-row>
          <el-row :span="8">
我在何方's avatar
我在何方 committed
19
             <el-form-item :label="$t('备注:')" size="medium" label-width="150px">
我在何方's avatar
我在何方 committed
20
               <el-input style="width: 500px;"  type="textarea" v-model="queryParams.remarks"  />
21 22 23 24 25 26
             </el-form-item>
          </el-row>
        </el-form>
    </el-card>
    <work-flow xmlkey="heavy_goods_discount" v-model="selectedUsers" style="margin-top: 20px;"></work-flow>
    <div slot="footer" class="card footer_btn">
我在何方's avatar
我在何方 committed
27 28 29 30 31
        <el-button v-if="queryParams.applyStatus==0" type="primary" @click="submitForm">{{$t('提交')}}</el-button>
        <el-button v-if="queryParams.applyStatus==0" plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('取消')}}</el-button>
       <el-button v-if="queryParams.applyStatus==1" type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+queryParams.formId)">{{$t('审核中')}}</el-button>
       <el-button v-if="queryParams.applyStatus==1" plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button>
       <el-button v-if="queryParams.applyStatus==1" plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button>
32 33
    </div>
    <el-dialog
我在何方's avatar
我在何方 committed
34
      :title="$t('提示')"
35 36
      :visible.sync="dialogVisible"
      width="30%">
我在何方's avatar
我在何方 committed
37
      <span class="cancel_notice">{{$t('申请泡货优惠正在审核中,你确定取消申请泡货优惠吗?')}}</span>
38
      <div class="cancel_content">
我在何方's avatar
我在何方 committed
39 40
        <span>{{$t('取消原因')}}</span>
        <el-input v-model="reason" :placeholder="$t('请输入取消原因')"></el-input>
41 42 43
      </div>

      <span slot="footer" class="dialog-footer">
我在何方's avatar
我在何方 committed
44 45
        <el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
        <el-button type="primary" @click="cancelSplit">{{$t('确定')}}</el-button>
46 47 48 49 50 51 52 53
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {getDictData, getDictDatas,DICT_TYPE} from '@/utils/dict'
import WorkFlow from '@/components/WorkFlow'
我在何方's avatar
我在何方 committed
54
import {getOrderSpecial,createOrderSpecial,cancelOrderSpecial} from '@/api/ecw/order'
55 56

export default {
我在何方's avatar
我在何方 committed
57
  name: "specialLight",
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
  components: {
    WorkFlow
  },
  props: {
    orderId: [String, Number]
  },
  data() {
    return {
      reason:'',
      dialogVisible:false,
      loading:false,
      queryParams:{
        orderId:7,
        lang:0
      },
      selectedUsers:[],
      orderData:{},
    };
  },
  created() {
    if (this.orderId) {
      this.queryParams.orderId = this.orderId
      this.getOrderSpecialData()
    }
    // this.getList()
  },
  computed:{
    getDictData(){
        return (type, value) => getDictData(type, value) || {}
    },
    getDictDatas(){
        return getDictDatas
    }
  },
  methods: {
   getOrderSpecialData(){
     getOrderSpecial(this.queryParams.orderId,5).then(r => {
       this.queryParams = r.data
     })
   },
    submitForm(){
我在何方's avatar
我在何方 committed
99 100 101
      this.queryParams.applyType = 5
      this.queryParams.ccIds = this.selectedUsers.join(',')
     createOrderSpecial(this.queryParams).then(r => {
我在何方's avatar
我在何方 committed
102
        this.$message.success(r.msg || this.$t('提交成功'))
我在何方's avatar
我在何方 committed
103
        this.$store.dispatch('tagsView/delCurrentView')
104 105 106 107 108
      })
    },
    cancelSplit(){
      let that = this
      if(!that.reason){
我在何方's avatar
我在何方 committed
109
        that.$message.error(this.$t("请输入取消原因"));
110 111
        return
      }
我在何方's avatar
我在何方 committed
112
       cancelOrderSpecial(that.queryParams.orderApprovalId,{reason:that.reason}).then(res=>{
我在何方's avatar
我在何方 committed
113
          that.$message.success(this.$t("取消成功"));
我在何方's avatar
我在何方 committed
114
          that.$store.dispatch('tagsView/delCurrentView')
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
        })
    },

  }
}
</script>
<style>
  .card-title{
      font-size: 18px;
      font-weight: bold;
       margin-top: 10px;
  }
  .card-info{
    font-size: 16px;
  }
  .card{
    margin-top: 20px;
  }
  .btn-header{
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
  }
  .red{
    color:#ff3430;
    font-size: 15px;
  }
  .footer_btn{
    padding-bottom: 60px;
  }
  .cancel_notice{
    font-size: 16px;
    font-weight: 600;
  }
  .cancel_content{
    display: flex;
    align-items: center;
    padding-top: 20px;
  }
  .cancel_content span{
    width: 100px;
  }
</style>