Commit 9454a959 authored by xiami's avatar xiami

换藏订单发货

parent 11a4257e
...@@ -53,19 +53,6 @@ ...@@ -53,19 +53,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="申请方藏品图片" min-width="120px" prop="homePageImage">
<template slot-scope="scope">
<div v-if="scope.row.homePageImage && scope.row.homePageImage.length > 0" class="image_preview">
<el-image
:preview-src-list="[scope.row.homePageImage.url]"
:src="scope.row.homePageImage.url"
class="table-td-thumb"
/>
</div>
</template>
</el-table-column> -->
<el-table-column align="center" label="藏品名称" min-width="150px" prop="itemName"> <el-table-column align="center" label="藏品名称" min-width="150px" prop="itemName">
<template slot-scope="scope"> <template slot-scope="scope">
<Line2Hidden :text="scope.row.itemName" /> <Line2Hidden :text="scope.row.itemName" />
...@@ -105,22 +92,17 @@ ...@@ -105,22 +92,17 @@
<span class="tooltip-span">{{ `${scope.row.waybill || '-'}` }}</span> <span class="tooltip-span">{{ `${scope.row.waybill || '-'}` }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="操作" width="300"> <el-table-column align="center" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)" v-if="scope.row.state === 10"
type="primary" type="primary"
size="mini" size="mini"
@click="handleToDetail(scope.row)">编辑 @click="handleToSend(scope.row)">发货
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">删除
</el-button> </el-button>
<span v-if="scope.row.state !== 10" class="tooltip-span">-</span>
</template> </template>
</el-table-column>--> </el-table-column>
</el-table> </el-table>
...@@ -130,14 +112,42 @@ ...@@ -130,14 +112,42 @@
:page.sync="listQuery.page" :page.sync="listQuery.page"
:limit.sync="listQuery.limit" :limit.sync="listQuery.limit"
@pagination="getList" /> @pagination="getList" />
<el-dialog :visible.sync="sendDialogVisible" title="发货">
<el-form
ref="sendFormRef"
:model="sendForm"
:rules="rules"
status-icon
label-position="left"
label-width="130px"
style="width: 600px; margin-left:50px;">
<el-form-item label="请输入快递单号:" prop="waybill" >
<el-select v-model="sendForm.logisticsCode" placeholder="请选择快的公司" class="filter-item" style="width: 200px;">
<el-option
v-for="item in logisticList"
:key="item.name"
:label="item.name"
:value="item.code"
size="mini" />
</el-select>
</el-form-item>
<el-form-item prop="waybill" label="快递单号:" >
<el-input v-model="sendForm.waybill" placeholder="请输入快递单号" style="width: 200px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="sendDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleShowSendDialog">确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { requestOrderList } from '@/api/business/order' import { requestOrderList,requestLogisticsList, requestDelivery } from '@/api/business/order'
export default { export default {
name: 'SaleOrderView', name: 'SaleOrderView',
...@@ -189,19 +199,61 @@ export default { ...@@ -189,19 +199,61 @@ export default {
finishSettlementDialogShow: false, finishSettlementDialogShow: false,
// 取消 // 取消
cancelConsignDialogShow: false, cancelConsignDialogShow: false,
currentSaleId: '' // 发货
sendDialogVisible: false,
currentSaleId: '',
logisticOptions: [{
value: 1,
label: '待付款'
}, {
value: 10,
label: '待发货'
}, {
value: 20,
label: '待收货'
}, {
value: 30,
label: '售后中'
}, {
value: 80,
label: '退款受理中'
}, {
value: 100,
label: '已完成'
}, {
value: 101,
label: '已取消'
}],
sendForm: {},
logisticList: [],
orderId: '',
rules: {
waybill: [{ required: true, message: '请输入物流单号', trigger: 'blur' }],
logisticsCode: [{ required: true, message: '请选择快递公司', trigger: 'blur' }]
}
} }
}, },
created() { created() {
this.getList() this.getList()
this.getLogisticsList()
}, },
methods: { methods: {
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
resetSearchForm() { resetSearchForm() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
limit: 20, limit: 20
typeStr: '2,3,6'
} }
this.getList() this.getList()
}, },
...@@ -231,6 +283,51 @@ export default { ...@@ -231,6 +283,51 @@ export default {
this.total = 0 this.total = 0
this.listLoading = false this.listLoading = false
}) })
},
/**
* 展示发货弹窗
*/
handleShowSendDialog() {
this.$refs.sendFormRef.validate((valid) => {
if (valid) {
this.sendForm.distributionOrderId = this.orderId
requestDelivery(this.sendForm)
.then(response => {
this.$notify.success({
message: '发货成功'
})
this.list = this.list.filter((item) => {
if (item.distributionOrderId === this.orderId) {
item.stateName = '待收货'
item.state = 20
item.waybill = this.sendForm.waybill
this.logisticList.map((logisticItem) => {
if (logisticItem.code === this.sendForm.logisticsCode) {
item.logisticsName = logisticItem.name
}
})
this.orderId = ''
return item
}
return item
})
this.sendDialogVisible = false
})
.catch(response => {
this.$notify.error({
title: '失败',
message: response.data.errmsg
})
})
}
})
},
/**
* 发货
*/
handleToSend(row) {
this.sendDialogVisible = true
this.orderId = row.distributionOrderId
} }
} }
} }
...@@ -255,9 +352,4 @@ export default { ...@@ -255,9 +352,4 @@ export default {
} }
} }
.table-td-thumb {
width: 60px;
height: 60px;
}
</style> </style>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment