Preferential.vue 3.83 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1
<template>
dragondean@qq.com's avatar
dragondean@qq.com committed
2
  <el-dialog visible :close-on-click-modal="false" :before-close="closeDialog" :title="title">
3
    <el-form ref="form" :model="form" label-width="120px" :rules="rules">
dragondean@qq.com's avatar
dragondean@qq.com committed
4
      
5 6 7 8 9 10
      <!-- 海运是重货,空运是泡货 -->
      <template v-if="order.transportId === 1 || order.transportId === 2">
        <el-form-item :label="$t('原重货标准')">
          {{form.orgWVolume}} kg/cbm
        </el-form-item>
        <el-form-item :label="$t('现重货标准')" style="width: 400px" prop="clearanceFreight">
11
          <el-input v-model="form.wvolume" type="number" class="w-100" /> kg/cbm
12 13 14 15
        </el-form-item>
      </template>
      <template v-else>
        <el-form-item :label="$t('原泡货标准')">
dragondean@qq.com's avatar
dragondean@qq.com committed
16
          {{form.orgVWeight}} kg
17 18
        </el-form-item>
        <el-form-item :label="$t('现泡货标准')" style="width: 400px" prop="clearanceFreight">
19
          <el-input v-model="form.vweight" type="number" class="w-100" /> kg
20 21
        </el-form-item>
      </template>
dragondean@qq.com's avatar
dragondean@qq.com committed
22
    </el-form>
Marcus's avatar
Marcus committed
23
    <div class="page-title">{{ $t('审批流程') }}</div>
dragondean@qq.com's avatar
dragondean@qq.com committed
24
    <work-flow xmlkey="special_apply" v-model="ccIdArr" />
25
    <div v-if="form.applyStatus != 1">
Marcus's avatar
Marcus committed
26
      <el-button type="primary" @click="handleSubmit">{{ $t('提交') }}</el-button>
dragondean@qq.com's avatar
dragondean@qq.com committed
27 28 29 30 31
    </div>
    <div v-else>
      <el-button type="primary" @click="$router.push('/bpm/process-instance/detail?id=' + form.formId)">
        <dict-tag :type="DICT_TYPE.APPLY_STATUS" :value="form.applyStatus" />
      </el-button>
dragondean@qq.com's avatar
dragondean@qq.com committed
32
      
Marcus's avatar
Marcus committed
33 34
      <el-button type="primary" @click="cancelAudit">{{ $t('取消审核') }}</el-button>
      <el-button type="default" @click="closeDialog">{{ $t('返回') }}</el-button>
dragondean@qq.com's avatar
dragondean@qq.com committed
35 36 37 38 39 40 41 42 43 44 45
    </div>
  </el-dialog>
</template>

<script>
import {createOrderSpecial, getOrderSpecial} from "@/api/ecw/order"
import {getUnitList} from "@/api/ecw/unit"
import {getChannel, getChannelList} from "@/api/ecw/channel"
import { getCurrencyList } from '@/api/ecw/currency'
import { getProductType } from '@/api/ecw/productType'
import WorkFlow from '@/components/WorkFlow'
dragondean@qq.com's avatar
dragondean@qq.com committed
46 47
import {cancelProcessInstance} from '@/api/bpm/processInstance'

dragondean@qq.com's avatar
dragondean@qq.com committed
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
export default {
  name: "OrderSpecialDiscount",
  props: {
    order: Object,
    orderItem: Object,
    applyType: Number // 4是重货优惠5是泡货优惠
  },
  components: {
    WorkFlow
  },
  created() {
    // 查看详情,列表进来的
    this.getOrderSpecial()

  },
  data() {
    return {
      // applyType: 2, //1是优惠申请2是管理折扣3是佣金设置4是重货优惠5是泡货优惠
      ccIdArr: [],
      form: {
        
      },
      rules:{

      },
    }
  },
  watch:{
    ccIdArr(){
      this.$set(this.form, 'ccIds', this.ccIdArr.join(','))
    }
  },
dragondean@qq.com's avatar
dragondean@qq.com committed
80 81 82 83 84
  computed:{
    title(){
      return this.applyType == 4 ? this.$t('重货优惠申请') : this.$t('泡货优惠申请')
    }
  },
dragondean@qq.com's avatar
dragondean@qq.com committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  methods: {
    handleSubmit(){
      this.$refs.form.validate().then(res => {
        createOrderSpecial(Object.assign({}, this.form, {applyType: this.applyType})).then(res => {
          this.$message.success(this.$t('提交成功'))
          this.$emit('success')
        })
      })
    },
    getOrderSpecial(){
      getOrderSpecial(this.order.orderId, this.applyType, {}).then(r => {
        this.form = r.data
      })
    },
    closeDialog(){
      this.$emit('close')
dragondean@qq.com's avatar
dragondean@qq.com committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
    },
    cancelAudit(){
      this.$prompt(this.$t('请输入取消原因?'), this.$t("取消审批"), {
        type: 'warning',
        confirmButtonText: this.$t("确定"),
        cancelButtonText: this.$t("取消"),
        inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, // 判断非空,且非空格
        inputErrorMessage: this.$t("取消原因不能为空"),
      }).then(({ value }) => {
        return cancelProcessInstance(this.form.formId, value);
      }).then(() => {
        this.$modal.msgSuccess(this.$t("取消成功"));
        this.closeDialog()
      })
    },
dragondean@qq.com's avatar
dragondean@qq.com committed
116 117 118
  }
}
</script>