light.vue 4.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 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 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 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 160 161 162 163 164 165
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-card>
        <div slot="header" class="card-title">申请泡货优惠-{{queryParams.orderNo||''}}</div>
        <el-form :model="queryParams" ref="queryForms" size="small" :inline="true"  label-width="120px" class="card">
          <el-row >
              <el-form-item label="原泡货标准:" label-width="150px">
                  <span>{{queryParams.orgVWeight}}kg/cbm</span>
              </el-form-item>
          </el-row>
          <el-row :span="8" >
             <el-form-item label="* 现泡货申请标准:" size="medium" label-width="150px">
               <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">
             <el-form-item label="备注:" size="medium" label-width="150px">
               <el-input style="width: 500px;"  type="textarea" v-model="queryParams.orderExceptionHandlerRemark"  />
             </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">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button plain type="primary" @click="$router.back()">取消</el-button>
        <!-- <el-button v-if="orderData.inWarehouseState==207" type="primary" disabled>审核中</el-button> -->
        <!-- <el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="dialogVisible = true">取消审核</el-button> -->
        <!-- <el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="$router.back()">返回</el-button> -->
    </div>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%">
      <span class="cancel_notice">申请泡货优惠正在审核中,你确定取消申请泡货优惠吗?</span>
      <div class="cancel_content">
        <span>取消原因:</span>
        <el-input v-model="reason" placeholder="请输入取消原因"></el-input>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="cancelSplit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {getDictData, getDictDatas,DICT_TYPE} from '@/utils/dict'
import WorkFlow from '@/components/WorkFlow'
import {getOrderSpecial,createOrderSpecial} from '@/api/ecw/order'

export default {
  name: "specialWeight",
  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(){
     createOrderSpecial({
        applyType: this.queryParams.applyType,
        lineId: this.queryParams.lineId,
        vweight: this.queryParams.vweight,
        orderId: this.queryParams.orderId,
        orderNo: this.queryParams.orderNo,
        orderItemId: this.queryParams.orderItemId,
        prodId:this.queryParams.prodId,
         ccIds:this.selectedUsers.join(',')
      }).then(r => {
        this.$message.success(r.msg || '提交成功')
      })
    },
    cancelSplit(){
      let that = this
      if(!that.reason){
        that.$message.error("请输入取消原因");
        return
      }
        cancelApply({orderId:that.queryParams.orderId,reason:that.reason}).then(res=>{
          that.$message.success("取消成功");
          that.$router.back()
        })
    },

  }
}
</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>