Commit 48521eca authored by zhengke's avatar zhengke
parents 9bd6ed6c b28adf6d
......@@ -109,6 +109,8 @@
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()" />
&nbsp;
<input type="button" class="normalBtn" :value="$t('pub.addBtn')" @click="outerVisible = true,dialogTitle='新增效期'" />
&nbsp;
<input type="button" class="normalBtn" value="删除" @click="PostDeleteArray()" />
</li>
</ul>
</div>
......@@ -122,7 +124,11 @@
<th>操作</th>
</tr>
<tr v-for="(item,index) in DataList" :key="index">
<td><input type="checkbox" :value="item.ID" /></td>
<td>
<label>
<input :value="item.ID" style="vertical-align: middle;" v-model="DeleteArray" type="checkbox">
</label>
</td>
<td>{{item.FDateStr}}</td>
<td>{{item.Flight_number}}</td>
<td>{{item.CDepartTime}}</td>
......@@ -132,6 +138,9 @@
<el-tooltip class="item" effect="dark" :content="$t('system.table_edit')" placement="top-start">
<el-button type="primary" icon="el-icon-edit" circle @click="outerVisible = true,dialogTitle='修改航班',updateData(item.ID)"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('system.table_edit')" placement="top-start">
<el-button type="primary" icon="el-icon-delete" circle @click="DeleteSingleChild(item)"></el-button>
</el-tooltip>
</el-row>
</td>
</tr>
......@@ -163,18 +172,14 @@
</td>
<td>
<div v-if="PostData.UpdateType==1" class="FweekList" v-for="subItem in dateObj2">
<span>{{subItem.week}}</span>
<el-date-picker clearable class="w135" v-model="subItem.CDepartTime" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('admin.admin_choDate')"></el-date-picker>
<el-date-picker clearable class="w135" v-model="subItem.CArrivalTime" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('admin.admin_choDate')"></el-date-picker>
<span>{{subItem.WeekDayStr}}</span>
<el-input class="w135" v-model="subItem.CDepartTime"></el-input>
<el-input class="w135" v-model="subItem.CArrivalTime"></el-input>
</div>
<div v-if="PostData.UpdateType==2" class="FweekList" v-for="item in dateObj">
<el-input type="text" v-model="item.week" class="w60"></el-input>
<el-date-picker clearable class="w135" v-model="item.CDepartTime" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('admin.admin_choDate')"></el-date-picker>
<el-date-picker clearable class="w135" v-model="item.CArrivalTime" type="date" value-format="yyyy-MM-dd"
:placeholder="$t('admin.admin_choDate')"></el-date-picker>
<div v-if="PostData.UpdateType==2" class="FweekList" v-for="subItem in dateObj">
<el-checkbox @change='changeItem(subItem)' v-model='subItem.CheckStatus'>{{subItem.WeekDayStr}}</el-checkbox>
<el-input class="w135" v-model="subItem.CDepartTime"></el-input>
<el-input class="w135" v-model="subItem.CArrivalTime"></el-input>
</div>
</td>
</tr>
......@@ -210,57 +215,62 @@
FlightId: this.$route.query.id,
//1-全部更新,2,按周一,周二更新
UpdateType: 1,
SubList: [{
CDepartTime: "09:00",
CArrivalTime: "16:40",
//0-全部,1周一...7周日
WeekDay: 0
}]
SubList: []
},
//删除数组
DeleteArray: [],
dialogTitle: '',
dateObj2: [{
week: '全部',
WeekDayStr: '全部',
WeekDay: 0,
CDepartTime: '',
CArrivalTime: '',
}],
dateObj: [{
week: '周一',
WeekDayStr: '周一',
WeekDay: 1,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周二',
WeekDayStr: '周二',
WeekDay: 2,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周三',
WeekDayStr: '周三',
WeekDay: 3,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周四',
WeekDayStr: '周四',
WeekDay: 4,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周五',
WeekDayStr: '周五',
WeekDay: 5,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周六',
WeekDayStr: '周六',
WeekDay: 6,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
},
{
week: '周日',
WeekDayStr: '周日',
WeekDay: 7,
CDepartTime: '',
CArrivalTime: '',
CheckStatus: false
......@@ -269,34 +279,37 @@
beforeCheck: {
disabledDate: time => {
let endTime = new Date(this.msg.QEndDate);
let endTime = new Date(this.PostData.EndDate);
return endTime.getTime() < time.getTime();
}
},
afterCheck: {
disabledDate: time => {
let startTime = new Date(this.msg.QStartDate);
let startTime = new Date(this.PostData.StartDate);
return startTime.getTime() >= time.getTime();
}
},
pickerBeginDateBefore: {
disabledDate: time => {
let endTime = new Date(this.msg.QEndDate)
return endTime.getTime() < time.getTime()
let endTime = new Date(this.msg.QEndDate)
return endTime.getTime() < time.getTime()
}
},
pickerBeginDateAfter: {
disabledDate: time => {
let startTime = new Date(this.msg.QStartDate)
return startTime.getTime() >= time.getTime()
let startTime = new Date(this.msg.QStartDate)
return startTime.getTime() >= time.getTime()
}
},
airlineList: [],
DataList: [],
};
},
methods: {
changeItem(subItem)
{
subItem.CheckStatus=!subItem.CheckStatus;
},
//获取列表数据
getList() {
this.loading = true;
......@@ -307,7 +320,7 @@
this.loading = false;
if (res.data.resultCode == 1) {
this.msg.total = res.data.data.count;
this.noData = !this.total > 0;
this.noData = !this.msg.total > 0;
this.DataList = res.data.data.pageData;
} else {
this.Error(res.data.message);
......@@ -318,13 +331,42 @@
},
//提交创建、修改表单
submitForm(addMsg) {
this.$refs[addMsg].validate(valid => {
if (valid) {
this.addGroupGuide();
} else {
return false;
}
});
this.SaveData();
},
SaveData() {
this.PostData.SubList = [];
if (this.PostData.UpdateType == 1) {
this.PostData.SubList.push(this.dateObj2[0]);
} else {
this.dateObj.forEach(item => {
if (item.CheckStatus) {
this.PostData.SubList.push(item);
}
});
}
this.apipost(
"flight_get_SetFlightChild",
this.PostData,
res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.PostData.StartDate = "";
this.PostData.EndDate = "";
this.PostData.UpdateType = 1;
this.dateObj2[0].CDepartTime = "";
this.dateObj2[0].CArrivalTime = "";
this.dateObj.forEach(item => {
item.CheckStatus = false;
item.CDepartTime = "";
item.CArrivalTime = "";
});
this.getList();
} else {
this.Error(res.data.message);
}
},
err => {}
);
},
//翻页功能按钮
handleCurrentChange(val) {
......@@ -336,6 +378,31 @@
this.msg.pageIndex = 1;
this.msg.currentPage = 1;
},
DeleteSingleChild(item) {
this.DeleteArray = [];
this.DeleteArray.push(item.ID);
this.PostDeleteArray();
},
//删除数组
PostDeleteArray() {
var that = this;
this.Confirm("是否删除", function () {
that.apipost(
"flight_get_RemoveFlightChild",
that.DeleteArray,
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getList();
that.DeleteArray = [];
} else {
that.Error(res.data.message);
}
},
err => {}
);
});
}
},
mounted() {
this.getList();
......
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