|
@@ -0,0 +1,288 @@
|
|
|
|
+<template>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="visible"
|
|
|
|
+ :title="`订单详情 ${oData && oData.orderNo ? oData.orderNo : ''}`"
|
|
|
|
+ append-to-body
|
|
|
|
+ width="1200px"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ >
|
|
|
|
+ <div class="flex column" style="padding-bottom:20px;height:600px">
|
|
|
|
+ <div class="flex-1 fit-size">
|
|
|
|
+ <el-table
|
|
|
|
+ ref="table"
|
|
|
|
+ :data="list"
|
|
|
|
+ stripe
|
|
|
|
+ border
|
|
|
|
+ height="100%"
|
|
|
|
+ size="small"
|
|
|
|
+ class="custom-el-table-style"
|
|
|
|
+ :span-method="onMergeCellsMethod"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ type="index"
|
|
|
|
+ label="序号"
|
|
|
|
+ width="60"
|
|
|
|
+ align="center"
|
|
|
|
+ fixed
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="商品编码"
|
|
|
|
+ prop="goodsCode"
|
|
|
|
+ header-align="center"
|
|
|
|
+ min-width="100"
|
|
|
|
+ align="center"
|
|
|
|
+ fixed
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="商品名称"
|
|
|
|
+ min-width="200"
|
|
|
|
+ prop="goodsName"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ fixed
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="物料编码"
|
|
|
|
+ min-width="100"
|
|
|
|
+ prop="materielCode"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="最小包装数量"
|
|
|
|
+ min-width="80"
|
|
|
|
+ prop="minimumPackingNumber"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="计件单位"
|
|
|
|
+ min-width="80"
|
|
|
|
+ prop="minimumPackingUnit"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="数量"
|
|
|
|
+ min-width="80"
|
|
|
|
+ prop="number"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="单价(元)"
|
|
|
|
+ prop="unitPrice"
|
|
|
|
+ align="right"
|
|
|
|
+ min-width="70"
|
|
|
|
+ header-align="right"
|
|
|
|
+ ><template slot-scope="scope">
|
|
|
|
+ {{ parseFloat(scope.row.unitPrice).toFixed(2) }}
|
|
|
|
+ </template></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="费用(元)"
|
|
|
|
+ prop="amount"
|
|
|
|
+ align="right"
|
|
|
|
+ min-width="70"
|
|
|
|
+ header-align="right"
|
|
|
|
+ ><template slot-scope="scope">
|
|
|
|
+ {{ parseFloat(scope.row.amount).toFixed(2) }}
|
|
|
|
+ </template></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="标签类型"
|
|
|
|
+ prop="tagTypeName"
|
|
|
|
+ align="left"
|
|
|
|
+ min-width="120"
|
|
|
|
+ header-align="left"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="申领人"
|
|
|
|
+ min-width="100"
|
|
|
|
+ prop="applicantName"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="收获地址"
|
|
|
|
+ min-width="150"
|
|
|
|
+ prop="address"
|
|
|
|
+ header-align="left"
|
|
|
|
+ align="left"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="联系电话"
|
|
|
|
+ min-width="100"
|
|
|
|
+ prop="phone"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="预期收货日期"
|
|
|
|
+ prop="expectedReceiptDate"
|
|
|
|
+ min-width="100"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ > <template slot-scope="scope">
|
|
|
|
+ {{ scope.row.expectedReceiptDate ? new Date(scope.row.expectedReceiptDate).format('YYYY-MM-DD') : '' }}
|
|
|
|
+ </template></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="发货方式"
|
|
|
|
+ prop="deliveryMethodName"
|
|
|
|
+ align="center"
|
|
|
|
+ min-width="80"
|
|
|
|
+ header-align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="发货单号"
|
|
|
|
+ prop="deliveryOrderNo"
|
|
|
|
+ align="center"
|
|
|
|
+ min-width="120"
|
|
|
|
+ header-align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="提货人姓名"
|
|
|
|
+ prop="recipient"
|
|
|
|
+ align="center"
|
|
|
|
+ min-width="100"
|
|
|
|
+ header-align="center"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="操作栏"
|
|
|
|
+ min-width="130"
|
|
|
|
+ header-align="center"
|
|
|
|
+ align="center"
|
|
|
|
+ width="130"
|
|
|
|
+ fixed="right"
|
|
|
|
+ >
|
|
|
|
+ <template v-slot="{ row }">
|
|
|
|
+ <div class="flex center layout-gap">
|
|
|
|
+ <edit-button :data="row" :on-click="onTagDistributeBtnClick" :disabled="row.isSend" icon="el-icon-share">发放</edit-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <template #footer>
|
|
|
|
+ <div class="flex center dialog-footer">
|
|
|
|
+ <el-button @click="onCloseBtnClick">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="onSaveDistributeBtnClick">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <dialog-tag-distribute
|
|
|
|
+ ref="editor"
|
|
|
|
+ :optionGroup="optionGroup1"
|
|
|
|
+ @saveDistribute="onSaveDistribute"
|
|
|
|
+ ></dialog-tag-distribute>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import BaseCurdList from '@@/utils/BaseCurdList'
|
|
|
|
+import TagDistribute from '@@/entries/TagDistribute'
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'DialogTagDistributeOperate',
|
|
|
|
+ extends: BaseCurdList(TagDistribute),
|
|
|
|
+ props: {
|
|
|
|
+ optionGroup1: {
|
|
|
|
+ required: true,
|
|
|
|
+ type: Object
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data: () => ({
|
|
|
|
+ visible: false,
|
|
|
|
+ oData: null
|
|
|
|
+ }),
|
|
|
|
+ computed: {
|
|
|
|
+ colspanMap () {
|
|
|
|
+ return this.list.reduce((map, item, index) => {
|
|
|
|
+ const key = `${item.address}|${item.applicantName}|${item.phone}|${item.isSend}`
|
|
|
|
+ let data = map[key]
|
|
|
|
+ if (!data) {
|
|
|
|
+ data = map[key] = {
|
|
|
|
+ span: 0,
|
|
|
|
+ index,
|
|
|
|
+ ids: []
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ data.ids.push(item.id)
|
|
|
|
+ data.span++
|
|
|
|
+ return map
|
|
|
|
+ }, {})
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ open (data) {
|
|
|
|
+ this.oData = data
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.list = data.details
|
|
|
|
+ },
|
|
|
|
+ close () {
|
|
|
|
+ this.oData = null
|
|
|
|
+ this.visible = false
|
|
|
|
+ this.list = Object.freeze([])
|
|
|
|
+ },
|
|
|
|
+ // 重写方法否则接口会调用2次
|
|
|
|
+ setOptionGroup () {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onTagDistributeBtnClick (data) {
|
|
|
|
+ this.$refs.editor.open(data)
|
|
|
|
+ },
|
|
|
|
+ onMergeCellsMethod ({ row, column, rowIndex, columnIndex }) {
|
|
|
|
+ let rowspan = 1
|
|
|
|
+
|
|
|
|
+ if (columnIndex === 17) { // 操作栏的列索引
|
|
|
|
+ const spanData = this.colspanMap[`${row.address}|${row.applicantName}|${row.phone}|${row.isSend}`]
|
|
|
|
+ rowspan = -(spanData.index === rowIndex) & spanData.span
|
|
|
|
+ }
|
|
|
|
+ return [rowspan, 1]
|
|
|
|
+ },
|
|
|
|
+ onCloseBtnClick () {
|
|
|
|
+ this.close()
|
|
|
|
+ },
|
|
|
|
+ onSaveDistribute (data) {
|
|
|
|
+ if (data.deliveryMethodId && (data.recipient || data.deliveryOrderNo)) {
|
|
|
|
+ let deliveryMethodName = ''
|
|
|
|
+ if (this.optionGroup1 && this.optionGroup1.DeliveryType) {
|
|
|
|
+ deliveryMethodName = this.optionGroup1.DeliveryType.map[data.deliveryMethodId].name
|
|
|
|
+ }
|
|
|
|
+ const spanData = this.colspanMap[`${data.address}|${data.applicantName}|${data.phone}|${data.isSend}`]
|
|
|
|
+ if (spanData) {
|
|
|
|
+ const ids = new Set(spanData.ids)
|
|
|
|
+ this.list.forEach(item => {
|
|
|
|
+ if (ids.has(item.id)) {
|
|
|
|
+ item.deliveryMethodId = data.deliveryMethodId
|
|
|
|
+ item.deliveryMethodName = deliveryMethodName
|
|
|
|
+ item.recipient = data.recipient
|
|
|
|
+ item.deliveryOrderNo = data.deliveryOrderNo
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.oData.details = this.list
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onSaveDistributeBtnClick () {
|
|
|
|
+ if (this.oData) {
|
|
|
|
+ this.$$request(this.$$api.save, this.oData).then((flag) => {
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: '成功',
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ position: 'bottom-right'
|
|
|
|
+ })
|
|
|
|
+ this.$emit('saveDistribute', this.data)
|
|
|
|
+ this.close()
|
|
|
|
+ }
|
|
|
|
+ }).catch(console.error).finally(() => {})
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss"></style>
|