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