batchSingleApplication.vue 7.79 KB
Newer Older
1
<template>
2
  <el-dialog
dcy's avatar
dcy committed
3 4
    :visible.sync="dialogVisible"
    width="80%"
5 6 7 8 9 10 11 12 13
    :before-close="()=>{
      $emit('update:dialogVisible',false)
    }">
    <div class="batch-single-application">
      <h1 class="title">调仓申请</h1>
      <el-table :data="list">
        <el-table-column label="订单编号" prop="orderNo"></el-table-column>
        <el-table-column label="唛头" prop="marks"></el-table-column>
        <el-table-column label="已到箱数/总箱数">
dcy's avatar
dcy committed
14 15
          <template v-slot={row}>
            {{ row.sumQuantity || 0 }}/{{ row.totalNum }}
16 17 18 19 20
          </template>
        </el-table-column>
        <el-table-column label="下单统计">
          <template v-slot="{row}">
            <div v-if="row.costVO">
dcy's avatar
dcy committed
21 22 23
              箱数:{{ row.costVO.totalNum }}
              {{ row.costVO.totalVolume }}
              {{ row.costVO.totalWeight }}kg
24 25 26 27 28
            </div>
          </template>
        </el-table-column>
        <el-table-column label="入仓统计" width="150">
          <template v-slot="{row}">
dcy's avatar
dcy committed
29 30 31
            <div>总箱数:{{ row.sumNum || 0 }}</div>
            <div>体积:{{ row.sumVolume || 0 }}CBM</div>
            <div>重量:{{ row.sumWeight || 0 }}KG</div>
32 33 34
          </template>
        </el-table-column>
        <el-table-column label="入仓时间">
35

36 37
        </el-table-column>
        <el-table-column label="运输方式">
dcy's avatar
dcy committed
38
          <template v-slot={row}>
39 40 41 42
            <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId"></dict-tag>
          </template>
        </el-table-column>
        <el-table-column label="出货渠道">
43

44 45 46
        </el-table-column>
        <!--      <el-table-column label="始发仓" prop="startWarehouseName"></el-table-column>-->
        <el-table-column label="目的地" prop="objectiveName"></el-table-column>
dcy's avatar
dcy committed
47 48
        <el-table-column label="始发仓" prop="startWarehouseName">
        </el-table-column>
49 50 51 52 53
        <el-table-column label="发货人">
          <template v-slot="{row}">
            <div>
              <div>
                <p>
dcy's avatar
dcy committed
54
                  {{ row.consignorName }}
55 56
                </p>
                <p>
dcy's avatar
dcy committed
57
                  {{row.consignorPhone}}
58 59 60 61 62 63 64 65 66
                </p>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="收货人">
          <template v-slot="{row}">
            <div>
              <p>
dcy's avatar
dcy committed
67
                {{ row.consigneeName }}
68 69
              </p>
              <p>
dcy's avatar
dcy committed
70
                {{ row.consigneePhone}}
71 72 73 74 75
              </p>
            </div>
          </template>
        </el-table-column>
      </el-table>
dcy's avatar
dcy committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89
      <el-row style="margin-top: 30px">
        <el-col :span="8">
          <div style="text-align: right;">
            {{ list[0] && list[0].adjustToStartWarehouseName ? list[0].adjustToStartWarehouseName : list[0] && list[0].startWarehouseName ? list[0].startWarehouseName : '' }}
          </div>
        </el-col>
        <el-col :span="3"><div style="text-align:center">
          调至
        </div></el-col>
        <el-col :span="8"><el-select v-model="params.warehouseInId">
          <el-option v-for="(item ,index) in availableWarehouse" :value="item.id" :label="item.titleZh"
                     :key="index"></el-option>
        </el-select></el-col>
      </el-row>
90 91
      <div style="display: flex;justify-content:center; margin-top: 20px">
        <div style="width: 200px; margin: 0 10px">
dcy's avatar
dcy committed
92 93 94
        </div>
        <div>

95 96
        </div>
        <div style="width: 200px;">
dcy's avatar
dcy committed
97

98
        </div>
99
      </div>
100 101 102 103 104
      <el-divider></el-divider>
      <h1 class="title">
        审批流程
      </h1>
      <div style="padding: 20px">
dcy's avatar
dcy committed
105
        <work-flow xmlkey="warehouse_transfer" v-model="params.copyUserId"/>
106
      </div>
dcy's avatar
dcy committed
107 108
      <div style="text-align: center" v-if="!adjustmentBol">
        <el-button style="margin-right: 50px" @click="submit">提交申请</el-button>
109 110
        <el-button @click="$emit('update:dialogVisible',false)">取消</el-button>
      </div>
dcy's avatar
dcy committed
111 112 113 114 115 116 117
      <div style="text-align: center" v-else>
        <el-button @click="()=>{
          $router.push({path:'/bpm/process-instance/detail',query:{id:this.applyStatus.orderWarehouseApprovalBackVO.formId}})
        }">审核中</el-button>
        <el-button @click="cancellationOfOrder" >取消审核</el-button>
        <el-button @click="$emit('update:dialogVisible',false)" >取消</el-button>
      </div>
118
    </div>
119
  </el-dialog>
120 121 122
</template>

<script>
123 124
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {
dcy's avatar
dcy committed
125
  adjustApplyStatus, adjustLastWithStatus, cancelAdjustApply,
126 127
  ecwOrderList,
  orderWarehouseInAdjustApply,
dcy's avatar
dcy committed
128
  warehouseAdjustmentList, warehouseApprovalCancel,
129
} from "@/api/ecw/batchSingleApplication";
130 131
import {getProcessDefinitionBpmnXMLByKey} from "@/api/bpm/definition";
import warehouseDetails from "@/views/ecw/order/components/warehouseDetails";
dcy's avatar
dcy committed
132
import {getOrderPage} from "@/api/ecw/order";
dcy's avatar
dcy committed
133
import workFlow from "@/components/WorkFlow";
134
import Template from "@/views/cms/template";
dcy's avatar
dcy committed
135

136
export default {
137
  name: "batchSingleApplication",
dcy's avatar
dcy committed
138 139 140 141 142
  props: {
    orderList: [String, Number],
    dialogVisible: {
      type: Boolean,
      default: false,
143
    }
144
  },
dcy's avatar
dcy committed
145
  components: {
146
    Template,
dcy's avatar
dcy committed
147 148
    warehouseDetails,
    workFlow
149
  },
dcy's avatar
dcy committed
150 151 152 153 154 155 156 157 158 159 160 161
  watch: {
    dialogVisible(val) {
      if (val) {
        this.getOrderListFn()
      } else {
        this.params = {
          orderIds: undefined,
          warehouseInId: undefined,
          warehouseOutId: undefined,
          copyUserId: [],
        }
      }
162
    }
163
  },
dcy's avatar
dcy committed
164 165
  computed: {
    adjustmentBol() {
dcy's avatar
dcy committed
166
      return this.applyStatus?.orderWarehouseAdjustBackVO?.status === 1
167
    }
168
  },
dcy's avatar
dcy committed
169
  data() {
170
    return {
dcy's avatar
dcy committed
171 172 173
      list: [],
      selectedUsers: [],
      availableWarehouse: [],
174
      DICT_TYPE,
dcy's avatar
dcy committed
175 176 177 178 179
      departureWarehouse: undefined,
      adjustment: undefined,
      params: {
        orderIds: undefined,
        warehouseInId: undefined,
dcy's avatar
dcy committed
180
        warehouseOutId: undefined,
dcy's avatar
dcy committed
181
        copyUserId: [],
182
      },
dcy's avatar
dcy committed
183 184
      applyStatus:{}//调仓-查看状态

185 186
    }
  },
dcy's avatar
dcy committed
187 188 189 190 191
  methods: {
    getOrderListFn() {
      getOrderPage({orderIdList: this.orderList}).then(r => {
        this.list = r.data.list
        warehouseAdjustmentList({id: this.list[0].startWarehouseId}).then(r => this.availableWarehouse = r.data)
dcy's avatar
dcy committed
192 193 194 195 196 197
        adjustLastWithStatus({orderId:this.list[0].orderId,lang:0}).then(r =>{
          this.applyStatus = r.data
          if(r.data?.orderWarehouseAdjustBackVO?.status === 1){
            this.params.warehouseInId = r.data.orderWarehouseAdjustBackVO?.warehouseInId
          }
        })
dcy's avatar
dcy committed
198 199 200
      })
    },
    submit() {
201 202
      let p = this.list.map(e => e.orderId).join(',');
      this.params.orderIds = p;
dcy's avatar
dcy committed
203
      this.params.warehouseOutId = this.list[0].adjustToStartWarehouseId ? this.list[0].adjustToStartWarehouseId : this.list[0].startWarehouseId;
204
      this.params.orderNo = this.list[0].orderNo
dcy's avatar
dcy committed
205 206 207
      orderWarehouseInAdjustApply(this.params).then(r => {
        if (r.code === 0) {
          this.$emit('update:dialogVisible', false)
208 209 210
          this.$message.success('调仓成功');
        }
      })
dcy's avatar
dcy committed
211
    },
dcy's avatar
dcy committed
212 213 214 215 216 217 218 219 220
    cancellationOfOrder(){
      this.$prompt('请输入审核调仓原因', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(({ value }) => {
        warehouseApprovalCancel(this.applyStatus.orderWarehouseApprovalBackVO.id,value) .then(r => {
          if(r.data){
            this.$message.success('取消调仓成功')
            this.$emit('update:dialogVisible',false)
dcy's avatar
dcy committed
221

dcy's avatar
dcy committed
222 223 224 225 226 227
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消成功'
dcy's avatar
dcy committed
228
        });
dcy's avatar
dcy committed
229 230
      });
    }
231
  }
232 233 234 235
}
</script>

<style scoped lang="scss">
dcy's avatar
dcy committed
236
.batch-single-application {
237 238
  padding: 20px;
  box-sizing: border-box;
dcy's avatar
dcy committed
239 240 241 242 243

  .title {
    font-weight: 600;
    text-align: left;
  }
244
}
dcy's avatar
dcy committed
245

246 247 248 249 250 251 252 253
.my-process-designer {
  height: calc(100vh - 200px);
}

.box-card {
  width: 100%;
  margin-bottom: 20px;
}
254
</style>