From ad54c86462c0d8e2ed25943f48ac47ad90353f1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com>
Date: Thu, 20 Apr 2023 18:28:28 +0800
Subject: [PATCH] 4/20
---
src/api/modular/main/SendCar.js | 50 +++++
.../detail/modules/operationArea.vue | 18 +-
src/views/main/SendCar/addForm.vue | 208 +++++++++++++-----
.../main/Taskmanage/TaskmanageList/index.vue | 3 +-
4 files changed, 207 insertions(+), 72 deletions(-)
diff --git a/src/api/modular/main/SendCar.js b/src/api/modular/main/SendCar.js
index 391d2c3..244ea20 100644
--- a/src/api/modular/main/SendCar.js
+++ b/src/api/modular/main/SendCar.js
@@ -129,6 +129,56 @@ export function BookingTruckPullInBookingOrderConta(parameter) {
params: parameter
})
}
+/**
+ * 通过任务主键获取派车详情
+ */
+export function TaskManageTruckGetInfoByTaskId(parameter) {
+ return axios({
+ url: '/TaskManageTruck/GetInfoByTaskId',
+ method: 'get',
+ params: parameter
+ })
+}
+/**
+ * 保存派车
+ */
+export function TaskManageTruckSave(parameter) {
+ return axios({
+ url: '/TaskManageTruck/Save',
+ method: 'post',
+ data: parameter
+ })
+}
+/**
+ * 打印派车
+ */
+export function TaskManageTruckPrint(parameter) {
+ return axios({
+ url: '/TaskManageTruck/Print',
+ method: 'get',
+ params: parameter
+ })
+}
+/**
+ * 取消派车
+ */
+export function TaskManageTruckCancelDispatch(parameter) {
+ return axios({
+ url: '/TaskManageTruck/CancelDispatch',
+ method: 'get',
+ params: parameter
+ })
+}
+/**
+ * 批量派车
+ */
+export function TaskManageTruckSendDispatchBatch(parameter) {
+ return axios({
+ url: '/TaskManageTruck/SendDispatchBatch',
+ method: 'post',
+ data: parameter
+ })
+}
/**
* 添加订舱模板
*
diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue
index 2fcd4ec..fc6d41e 100644
--- a/src/views/main/BookingLedger/detail/modules/operationArea.vue
+++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue
@@ -873,17 +873,13 @@ export default {
FnGoSendCar() {
BookingTruckGetTruckListByBooking({ bookingId: this.id }).then(res => {
console.log(res)
- if (res.data.length) {
- this.$router.push({
- name: 'SendCarAdd',
- query: {
- type: 'Edit',
- BookingId: this.id
- }
- })
- } else {
- this.$message.error('暂无派车数据')
- }
+ this.$router.push({
+ name: 'SendCarAdd',
+ query: {
+ type: 'Edit',
+ BookingId: this.id
+ }
+ })
})
},
// ========== OCR ==========
diff --git a/src/views/main/SendCar/addForm.vue b/src/views/main/SendCar/addForm.vue
index dff0f93..5765f24 100644
--- a/src/views/main/SendCar/addForm.vue
+++ b/src/views/main/SendCar/addForm.vue
@@ -55,10 +55,18 @@
保存
-
+
+ 分拆派车
+
+
提交派车
-
+
派车
+
发单
+
+ 取消派车
+
+
撤销派车
@@ -159,7 +167,7 @@
派车通知详细信息
-
+
@@ -485,7 +493,12 @@ import {
BookingTruckCancel,
BookingTruckGetTruckListByBooking,
apibookingtruck,
- BookingTruckPullInBookingOrderConta
+ BookingTruckPullInBookingOrderConta,
+ TaskManageTruckGetInfoByTaskId,
+ TaskManageTruckSave,
+ TaskManageTruckPrint,
+ TaskManageTruckCancelDispatch,
+ TaskManageTruckSendDispatchBatch
} from '@/api/modular/main/SendCar'
import { GetCtn } from '@/api/modular/main/BookingLedger'
import { GetSysUserPage } from '@/api/modular/main/BookingLedger'
@@ -606,7 +619,8 @@ export default {
if (
this.id == this.$route.query.id &&
this.type == this.$route.query.type &&
- this.BookingId == this.$route.query.BookingId
+ this.BookingId == this.$route.query.BookingId &&
+ this.taskPKId == this.$route.query.taskPKId
) {
console.log(
this.id,
@@ -617,6 +631,7 @@ export default {
this.$route.query.BookingId
)
} else {
+ this.taskPKId = this.$route.query.taskPKId
this.id = this.$route.query.id
this.type = this.$route.query.type
this.BookingId = this.$route.query.BookingId
@@ -628,6 +643,26 @@ export default {
},
mounted() {},
methods: {
+ // 调度派车
+ FnSendCar() {
+ TaskManageTruckSendDispatchBatch([this.WebData.pK_ID]).then(res => {
+ if (res.data.succ) {
+ this.$message.success('派车成功')
+ } else {
+ this.$message.error(`派车失败,${res.data.msg}`)
+ }
+ })
+ },
+ // 调度取消派车
+ CancelSendCar() {
+ TaskManageTruckCancelDispatch({ pkId: this.WebData.pK_ID }).then(res => {
+ if (res.data.succ) {
+ this.$message.success('取消成功')
+ } else {
+ this.$message.error(`取消失败,${res.data.msg}`)
+ }
+ })
+ },
FnDelete() {
apibookingtruck(this.WebData.id).then(res => {
if (res.success) {
@@ -694,13 +729,23 @@ export default {
return Rdata
},
FnPrint() {
- BookingTruckPrint({ id: this.WebData.id }).then(res => {
- if (res.data.succ) {
- this.$message.success('打印成功')
- } else {
- this.$message.error(`打印失败,${res.data.msg}`)
- }
- })
+ if (this.taskPKId) {
+ TaskManageTruckPrint({ pkId: this.WebData.pK_ID }).then(res => {
+ if (res.data.succ) {
+ this.$message.success('打印成功')
+ } else {
+ this.$message.error(`打印失败,${res.data.msg}`)
+ }
+ })
+ } else {
+ BookingTruckPrint({ id: this.WebData.id }).then(res => {
+ if (res.data.succ) {
+ this.$message.success('打印成功')
+ } else {
+ this.$message.error(`打印失败,${res.data.msg}`)
+ }
+ })
+ }
},
FnCancel() {
BookingTruckCancel({ id: this.WebData.id }).then(res => {
@@ -747,9 +792,47 @@ export default {
if (this.BookingId && this.type == 'Edit') {
BookingTruckGetTruckListByBooking({ bookingId: this.BookingId }).then(res => {
this.Bookingdata = res.data
- this.$refs.xTable1.setRadioRow(res.data[0])
- this.SData(res.data[0].id)
+ if (res.data.length) {
+ this.$refs.xTable1.setRadioRow(res.data[0])
+ this.SData(res.data[0].id)
+ } else {
+ this.type = 'Add'
+ }
})
+ } else if (this.taskPKId) {
+ TaskManageTruckGetInfoByTaskId({ taskPkId: this.taskPKId })
+ .then(res => {
+ if (res.data.succ) {
+ if (res.data.ext.contaList) {
+ res.data.ext.contaList.forEach((item, index) => {
+ item.WebKey = index + 1
+ })
+ this.ContactsData = res.data.ext.contaList
+ }
+ setTimeout(() => {
+ this.form.setFieldsValue({ ...res.data.ext })
+ this.WebData = res.data.ext
+ this.ChangetruckId(res.data.ext.truckId)
+ setTimeout(() => {
+ this.Changeattn(res.data.ext.attn)
+ }, 110)
+ this.Changeyardid(res.data.ext.yardid)
+ setTimeout(() => {
+ this.Changeyardcontract(res.data.ext.yardcontract)
+ }, 110)
+ this.ChangeinYardID(res.data.ext.inYardID)
+ setTimeout(() => {
+ this.ChangeinYardContact(res.data.ext.inYardContact)
+ }, 110)
+ }, 100)
+ } else {
+ this.$message.error(`${res.data.msg}`)
+ }
+ this.confirmLoading = false
+ })
+ .catch(() => {
+ this.confirmLoading = false
+ })
}
// this.$data = this.$options.data()
@@ -770,27 +853,6 @@ export default {
})
if (this.type == 'Edit' && this.id) {
this.SData(this.id)
- // BookingTruckGetInfo({ id: this.id }).then(res => {
- // if (res.data.ext.contaList) {
- // this.ContactsData = res.data.ext.contaList
- // }
- // setTimeout(() => {
- // this.form.setFieldsValue({ ...res.data.ext })
- // this.WebData = res.data.ext
- // this.ChangetruckId(res.data.ext.truckId)
- // setTimeout(() => {
- // this.Changeattn(res.data.ext.attn)
- // }, 110)
- // this.Changeyardid(res.data.ext.yardid)
- // setTimeout(() => {
- // this.Changeyardcontract(res.data.ext.yardcontract)
- // }, 110)
- // this.ChangeinYardID(res.data.ext.inYardID)
- // setTimeout(() => {
- // this.ChangeinYardContact(res.data.ext.inYardContact)
- // }, 110)
- // }, 100)
- // })
}
},
FnRctncode(value) {
@@ -952,7 +1014,7 @@ export default {
/**
* 提交表单
*/
- handleSubmit(WebType) {
+ handleSubmit() {
const {
form: { validateFields }
} = this
@@ -961,33 +1023,59 @@ export default {
validateFields((errors, values) => {
if (!errors) {
values.contaList = this.ContactsData
- if (this.type == 'Edit') {
- values.id = this.WebData.id
- }
- if (this.type == 'Add' && this.BookingId) {
- values.bookingId = this.BookingId
- }
- BookingTruckSave({ ...values })
- .then(res => {
- if (res.data.succ) {
- this.$message.success('保存成功')
- if (this.type == 'Add' && !this.BookingId) {
- this.type = 'Edit'
- this.id = res.data.ext
- } else if (this.type == 'Add' && this.BookingId) {
- this.type = 'Edit'
+ if (this.taskPKId) {
+ values.pK_ID = this.WebData.pK_ID
+ TaskManageTruckSave({ ...values })
+ .then(res => {
+ console.log(res.data)
+ if (res.data.succ) {
+ this.$message.success('保存成功')
+ // if (this.type == 'Add' && !this.BookingId) {
+ // this.type = 'Edit'
+ // this.id = res.data.ext
+ // } else if (this.type == 'Add' && this.BookingId) {
+ // this.type = 'Edit'
+ // }
+ this.init()
+ } else {
+ this.$message.error(`保存失败,${res.data.msg}`)
}
+
+ this.confirmLoading = false
+ })
+ .catch(() => {
this.init()
- } else {
- this.$message.error(`保存失败,${res.data.msg}`)
- }
+ this.confirmLoading = false
+ })
+ } else {
+ if (this.type == 'Edit') {
+ values.id = this.WebData.id
+ }
+ if (this.type == 'Add' && this.BookingId) {
+ values.bookingId = this.BookingId
+ }
+ BookingTruckSave({ ...values })
+ .then(res => {
+ if (res.data.succ) {
+ this.$message.success('保存成功')
+ if (this.type == 'Add' && !this.BookingId) {
+ this.type = 'Edit'
+ this.id = res.data.ext
+ } else if (this.type == 'Add' && this.BookingId) {
+ this.type = 'Edit'
+ }
+ this.init()
+ } else {
+ this.$message.error(`保存失败,${res.data.msg}`)
+ }
- this.confirmLoading = false
- })
- .catch(() => {
- this.init()
- this.confirmLoading = false
- })
+ this.confirmLoading = false
+ })
+ .catch(() => {
+ this.init()
+ this.confirmLoading = false
+ })
+ }
} else {
this.confirmLoading = false
}
diff --git a/src/views/main/Taskmanage/TaskmanageList/index.vue b/src/views/main/Taskmanage/TaskmanageList/index.vue
index 638d3e6..fdb11ad 100644
--- a/src/views/main/Taskmanage/TaskmanageList/index.vue
+++ b/src/views/main/Taskmanage/TaskmanageList/index.vue
@@ -913,7 +913,8 @@ export default {
this.$router.push({
name: 'SendCarAdd',
query: {
- type: 'Edit'
+ type: 'Edit',
+ taskPKId: data.pkId
}
})
} else {