|
@@ -18,7 +18,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<orderDetails ref="order" :waybillData="waybillData"></orderDetails>
|
|
|
- <el-dialog title="派单" :visible.sync="sendDialogVisible" width="800px" :close-on-click-modal="false"
|
|
|
+ <el-dialog title="分配订单" :visible.sync="sendDialogVisible" width="800px" :close-on-click-modal="false"
|
|
|
@close="closeDialog">
|
|
|
<forms ref="sendRules" :formNewList="sendRuleList" :ruleForm="sendRuleForm" :formIceTracing="true"
|
|
|
:iceTracing="true" :iceBank="true" labelWidth="80px" @handleScroll="handleScroll" @remoteMethod="remoteMethod"
|
|
@@ -35,7 +35,9 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getWaybill
|
|
|
+ getWaybill,
|
|
|
+ waybillDelivery,
|
|
|
+ putUpdateStatus
|
|
|
} from '@/api/waybill'
|
|
|
import {
|
|
|
getCoolerBox,
|
|
@@ -50,12 +52,12 @@
|
|
|
import {
|
|
|
employee,
|
|
|
sendList
|
|
|
- } from "./uncertain.js";
|
|
|
+ } from "./delivered.js";
|
|
|
import {
|
|
|
getUser
|
|
|
} from '@/api/user'
|
|
|
import {
|
|
|
- WaybillStatus
|
|
|
+ allocationState
|
|
|
} from '@/assets/js/blockSort'
|
|
|
export default {
|
|
|
name: 'OrderManagement',
|
|
@@ -71,7 +73,7 @@
|
|
|
return {
|
|
|
operateList: [{
|
|
|
type: 'sends',
|
|
|
- title: '批量派单',
|
|
|
+ title: '批量分配',
|
|
|
colour: 'success'
|
|
|
}],
|
|
|
formList: [{
|
|
@@ -104,7 +106,7 @@
|
|
|
label: '分配状态',
|
|
|
field: 'status',
|
|
|
placeholder: '请选择分配状态',
|
|
|
- options: WaybillStatus(),
|
|
|
+ options: allocationState(),
|
|
|
}],
|
|
|
searchRuleForm: {
|
|
|
orderNo: '',
|
|
@@ -144,8 +146,12 @@
|
|
|
sendDialogVisible: false,
|
|
|
sendRuleList: sendList(),
|
|
|
sendRuleForm: {
|
|
|
- code: [],
|
|
|
+ fileList: [],
|
|
|
+ deliveryId: null,
|
|
|
coolerBoxId: null,
|
|
|
+ code: [],
|
|
|
+ tamperProofLabelImg: '',
|
|
|
+ tamperProofLabel: '',
|
|
|
},
|
|
|
sendConfirmLoading: false,
|
|
|
page: 1,
|
|
@@ -153,6 +159,7 @@
|
|
|
limitNo: true,
|
|
|
sendOrdersId: 2,
|
|
|
waybillIdList: [],
|
|
|
+ orderId: null,
|
|
|
waybillData: {},
|
|
|
srcList: [],
|
|
|
fileList: [{
|
|
@@ -188,6 +195,7 @@
|
|
|
// 获取运单列表
|
|
|
getList() {
|
|
|
var params = {
|
|
|
+ status: 3,
|
|
|
page: this.Pagination.PageIndex,
|
|
|
pageSize: this.Pagination.PageSize,
|
|
|
...this.searchValue
|
|
@@ -210,6 +218,50 @@
|
|
|
// console.log(type, 87)
|
|
|
this.operationType = type
|
|
|
if (type == 'sends') {
|
|
|
+ const arrID = this.$refs.refWaybill.waybillIds
|
|
|
+ let arrList = []
|
|
|
+ arrID.forEach(item => {
|
|
|
+ arrList.push(item.id)
|
|
|
+ })
|
|
|
+ this.waybillIdList = arrList
|
|
|
+ if (arrList.length != 0) {
|
|
|
+ this.sendDialogVisible = true
|
|
|
+ var arr = await this.getUserList()
|
|
|
+ this.sendRuleList.forEach(item => {
|
|
|
+ if (item.field == 'reCheckId') {
|
|
|
+ item.options = arr
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.sendRuleList.forEach(item => {
|
|
|
+ if (item.field == 'deliveryId') {
|
|
|
+ item.options = arr
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getIncubator(2)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '请先选择需要批量操作的订单',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async buttonData(row, type) {
|
|
|
+ this.operationType = type
|
|
|
+ this.orderId = row.id
|
|
|
+ if (type == 'logs') {
|
|
|
+ this.$refs.order.staffDialogVisible = true
|
|
|
+ this.waybillData = row
|
|
|
+ this.waybillData.coolerBoxName = row.coolerBox.name
|
|
|
+ this.waybillData.courierName = row.delivery.nickName
|
|
|
+ this.waybillData.courierPhone = row.delivery.phone
|
|
|
+ this.waybillData.reCheckName = row.reCheck.nickName
|
|
|
+ this.waybillData.reCheckPhone = row.reCheck.phone
|
|
|
+ } else if (type == 'send') {
|
|
|
+ const urls = this.fileList.map(obj => obj.url)
|
|
|
+ this.srcList = urls
|
|
|
+ this.$refs.picture.prescriptionVisible = true
|
|
|
+ } else if (type == 'sign') {
|
|
|
this.sendDialogVisible = true
|
|
|
var arr = await this.getUserList()
|
|
|
this.sendRuleList.forEach(item => {
|
|
@@ -223,17 +275,27 @@
|
|
|
}
|
|
|
})
|
|
|
this.getIncubator(2)
|
|
|
- }
|
|
|
- },
|
|
|
- buttonData(row, type) {
|
|
|
- this.operationType = type
|
|
|
- if (type == 'logs') {
|
|
|
- this.$refs.order.staffDialogVisible = true
|
|
|
- this.waybillData = row
|
|
|
- } else if (type == 'send') {
|
|
|
- const urls = this.fileList.map(obj => obj.url)
|
|
|
- this.srcList = urls
|
|
|
- this.$refs.picture.prescriptionVisible = true
|
|
|
+ } else if (type == 'delOrder') {
|
|
|
+ this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let arrOrderId = []
|
|
|
+ arrOrderId.push(row.id)
|
|
|
+ putUpdateStatus({
|
|
|
+ id: arrOrderId,
|
|
|
+ status: 8,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
}
|
|
|
},
|
|
|
// 触底事件
|
|
@@ -272,22 +334,30 @@
|
|
|
this.limitNo = true
|
|
|
this.staffName = ''
|
|
|
},
|
|
|
- // 运单派单
|
|
|
+ // 运单分配
|
|
|
sendHandleAdd() {
|
|
|
let flag = this.$refs['sendRules'].validateForm();
|
|
|
if (flag) {
|
|
|
this.sendConfirmLoading = true
|
|
|
let arrID = []
|
|
|
- if (this.operationType == 'send') {
|
|
|
+ if (this.operationType == 'sign') {
|
|
|
arrID.push(this.orderId)
|
|
|
} else if (this.operationType == 'sends') {
|
|
|
arrID = this.waybillIdList
|
|
|
}
|
|
|
const param = {
|
|
|
waybillIds: arrID,
|
|
|
+ deliveryId: Number(this.sendRuleForm.deliveryId),
|
|
|
coolerBoxId: Number(this.sendRuleForm.coolerBoxId),
|
|
|
iceRaftCode: this.sendRuleForm.code,
|
|
|
+ tamperProofLabel: this.sendRuleForm.tamperProofLabel,
|
|
|
+ tamperProofLabelImg: this.sendRuleForm.tamperProofLabelImg,
|
|
|
+ }
|
|
|
+ if (this.sendRuleForm.fileList) {
|
|
|
+ var fileImage = this.picture(this.sendRuleForm.fileList)
|
|
|
+ param.tamperProofLabelImg = fileImage
|
|
|
}
|
|
|
+ console.log(param, 25)
|
|
|
waybillDelivery(param).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({
|
|
@@ -315,6 +385,15 @@
|
|
|
this.$message.error('表单信息不完整,请继续填写完整');
|
|
|
}
|
|
|
},
|
|
|
+ picture(arr) {
|
|
|
+ var imgList = JSON.parse(JSON.stringify(arr))
|
|
|
+ var imgArr = []
|
|
|
+ imgList.forEach((item, index) => {
|
|
|
+ imgArr.push(item.url)
|
|
|
+ })
|
|
|
+ var imgString = imgArr.join()
|
|
|
+ return imgString
|
|
|
+ },
|
|
|
// 获取保温箱列表
|
|
|
getIncubator(type) {
|
|
|
let arrList = []
|