Commit 0aa2b8b9 authored by 吴春's avatar 吴春

11

parent c4a50d1f
...@@ -168,6 +168,16 @@ ...@@ -168,6 +168,16 @@
<br /> <br />
<font style="color:red">{{item.BusStateName}}</font> <font style="color:red">{{item.BusStateName}}</font>
</template> </template>
<br />
<el-popover placement="right" width="250" trigger="click">
<div>
<el-checkbox v-model="cancelMsg.isCancelBus">车牌</el-checkbox>
<el-checkbox v-model="cancelMsg.isCancelDriver">司机</el-checkbox>
<el-button size="mini" type="primary" style="margin-left:5px;"
@click="cancelAllBusOrDriver(subItem)">保存</el-button>
</div>
<el-link type="danger" slot="reference">全部取消</el-link>
</el-popover>
</td> </td>
<template v-for="(childItem,childIndex) in subItem"> <template v-for="(childItem,childIndex) in subItem">
<td :key="`d1_`+index+`s1_`+subIndex+`d1`+childIndex" <td :key="`d1_`+index+`s1_`+subIndex+`d1`+childIndex"
...@@ -268,6 +278,7 @@ ...@@ -268,6 +278,7 @@
</div> </div>
</template> </template>
<script> <script>
import ForeignCurrencyHLVue from '../systemManagement/ForeignCurrencyHL/ForeignCurrencyHL.vue';
import editTripPlan from "./editTripPlan"; //新增修改团队用车 import editTripPlan from "./editTripPlan"; //新增修改团队用车
export default { export default {
data() { data() {
...@@ -306,14 +317,60 @@ ...@@ -306,14 +317,60 @@
editTripPlan editTripPlan
}, },
methods: { methods: {
cancelAllBusOrDriver(subItem) {
var that = this;
var tempArray = [];
if (subItem && subItem.length > 0) {
subItem.forEach(item => {
if (item.MainId > 0 && item.OrderId > 0) {
const exists = tempArray.some(t =>
t.MainOrderId === item.MainId && t.OrderId === item.OrderId
);
if (!exists) {
tempArray.push({
MainOrderId: item.MainId,
OrderId: item.OrderId
});
}
}
})
}
if (tempArray && tempArray.length > 0) {
var tipMsg = "是否全部取消派车或司机?";
this.Confirm(tipMsg, function () {
var postMsg = {
OrderList: tempArray,
isCancelBus: that.cancelMsg.isCancelBus ? 1 : 0,
isCancelDriver: that.cancelMsg.isCancelDriver ? 1 : 0
};
that.apipost(
"travel_post_CancelCarOrDriver",
postMsg,
res => {
if (res.data.resultCode == 1) {
that.Success(that.$t('objFill.v101.quxiaoshenhcgo'));
that.cancelMsg.isCancelBus = false;
that.cancelMsg.isCancelDriver = false;
that.getList();
} else {
that.Error(res.data.message);
}
},
null
);
});
}
},
cancelBusOrDriver(item) { cancelBusOrDriver(item) {
var that = this; var that = this;
console.log("item", item)
var tipMsg = "是否取消【" + (item.OrderTCNUM && item.OrderTCNUM != '' ? item.OrderTCNUM : item.TCNUM) + "】用车或司机?"; var tipMsg = "是否取消【" + (item.OrderTCNUM && item.OrderTCNUM != '' ? item.OrderTCNUM : item.TCNUM) + "】用车或司机?";
this.Confirm(tipMsg, function () { this.Confirm(tipMsg, function () {
var postMsg = { var postMsg = {
MainId: item.MainId, OrderList: [{
MainOrderId: item.MainId,
OrderId: item.OrderId, OrderId: item.OrderId,
}],
isCancelBus: that.cancelMsg.isCancelBus ? 1 : 0, isCancelBus: that.cancelMsg.isCancelBus ? 1 : 0,
isCancelDriver: that.cancelMsg.isCancelDriver ? 1 : 0 isCancelDriver: that.cancelMsg.isCancelDriver ? 1 : 0
}; };
......
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