Commit 370652ba authored by 黄奎's avatar 黄奎

页面修改

parent c0fa4319
<style> <style>
.CM_look { .CM_look {
padding: 4px !important; padding: 4px !important;
position: relative; position: relative;
top: 1px; top: 1px;
} }
</style> </style>
<template> <template>
<div class="flexOne"> <div class="flexOne">
<div class="query-box"> <div class="query-box">
<ul> <ul>
<li> <li>
<input <input type="button" class="normalBtn" :value="$t('pub.addBtn')"
type="button" @click="(isShow = true), (dialogTitle = $t('ground.xinzengjdgyfs'))" />
class="normalBtn"
:value="$t('pub.addBtn')"
@click="(isShow = true), (dialogTitle = $t('ground.xinzengjdgyfs'))"
/>
</li> </li>
</ul> </ul>
<el-dialog <el-dialog :title="dialogTitle" :visible.sync="isShow" center custom-class="w460">
:title="dialogTitle"
:visible.sync="isShow"
center
custom-class="w460"
>
<el-form :model="addMsg" label-width="100px"> <el-form :model="addMsg" label-width="100px">
<el-form-item :label="$t('hotel.suplier_name')" prop="Name"> <el-form-item :label="$t('hotel.suplier_name')" prop="Name">
{{ SupplierName }} {{ SupplierName }}
</el-form-item> </el-form-item>
<el-form-item :label="$t('hotel.hotel')"> <el-form-item :label="$t('hotel.hotel')">
<el-select <el-select v-model="addMsg.HotelId" filterable :placeholder="$t('pub.pleaseSel')" class="w220">
v-model="addMsg.HotelId"
filterable
:placeholder="$t('pub.pleaseSel')"
class="w220"
>
<el-option :label="$t('pub.pleaseSel')" :value="0"></el-option> <el-option :label="$t('pub.pleaseSel')" :value="0"></el-option>
<el-option <el-option v-for="item in HotelList" :key="item.ID" :label="item.Name" :value="item.ID">
v-for="item in HotelList"
:key="item.ID"
:label="item.Name"
:value="item.ID"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('fnc.fkfangshi')"> <el-form-item :label="$t('fnc.fkfangshi')">
<el-select <el-select v-model="addMsg.SubPayType" filterable :placeholder="$t('pub.pleaseSel')" class="w220">
v-model="addMsg.SubPayType"
filterable
:placeholder="$t('pub.pleaseSel')"
class="w220"
>
<el-option :label="$t('pub.pleaseSel')" :value="0"></el-option> <el-option :label="$t('pub.pleaseSel')" :value="0"></el-option>
<el-option <el-option v-for="item in PayTypeList" :key="item.Id" :label="item.name" :value="item.Id">
v-for="item in PayTypeList"
:key="item.Id"
:label="item.name"
:value="item.Id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('hotel.hotel_StartDate')"> <el-form-item :label="$t('hotel.hotel_StartDate')">
<el-date-picker <el-date-picker class="w220" type="date" v-model="addMsg.StartDate" :picker-options="pickerBeginDateBefore"
class="w220" value-format="yyyy-MM-dd" placeholder></el-date-picker>
type="date"
v-model="addMsg.StartDate"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd"
placeholder
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="$t('hotel.hotel_EndDate')"> <el-form-item :label="$t('hotel.hotel_EndDate')">
<el-date-picker <el-date-picker class="w220" type="date" v-model="addMsg.EndDate" :picker-options="pickerBeginDateAfter"
class="w220" value-format="yyyy-MM-dd" placeholder></el-date-picker>
type="date"
v-model="addMsg.EndDate"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd"
placeholder
></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -95,13 +55,7 @@ ...@@ -95,13 +55,7 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<table <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
class="singeRowTable"
border="0"
cellspacing="0"
cellpadding="0"
v-loading="loading"
>
<tr> <tr>
<th>{{ $t("hotel.hotel") }}</th> <th>{{ $t("hotel.hotel") }}</th>
<th>{{ $t("hotel.hotel_StartDate") }}</th> <th>{{ $t("hotel.hotel_StartDate") }}</th>
...@@ -115,21 +69,12 @@ ...@@ -115,21 +69,12 @@
<td>{{ item.EndDateStr }}</td> <td>{{ item.EndDateStr }}</td>
<td>{{ item.SubPayTypeStr }}</td> <td>{{ item.SubPayTypeStr }}</td>
<td> <td>
<el-tooltip <el-tooltip class="item" effect="dark" :content="$t('system.table_edit')" placement="top-start">
class="item" <el-button type="primary" class="iconfont icon-bianji-smal" @click="
effect="dark"
:content="$t('system.table_edit')"
placement="top-start"
>
<el-button
type="primary"
class="iconfont icon-bianji-smal"
@click="
GetData(item.Id), GetData(item.Id),
(isShow = true), (isShow = true),
(dialogTitle = $t('ground.xinzengjdgyfs')) (dialogTitle = $t('ground.xinzengjdgyfs'))
" "></el-button>
></el-button>
</el-tooltip> </el-tooltip>
</td> </td>
</tr> </tr>
...@@ -138,169 +83,195 @@ ...@@ -138,169 +83,195 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
msg: { msg: {
SupplierId: 0 SupplierId: 0
},
loading: false,
isShow: false, //是否显示新增修改
//供应商名称
SupplierName: "",
dialogTitle: this.$t("ground.xinzengjdgyfs"),
//数据源
dataList: [],
HotelList: [], //酒店列表
//添加修改供应商酒店信息
addMsg: {
Id: 0, //编号
SupplierId: 0, //
HotelId: 0,
StartDate: "",
EndDate: "",
SubPayType: 0
},
//付款方式
PayTypeList: [
{
name: this.$t("ground.xianfu"),
Id: 1
}, },
{ loading: false,
name: this.$t("ground.qiandan"), isShow: false, //是否显示新增修改
Id: 2 //供应商名称
SupplierName: "",
dialogTitle: this.$t("ground.xinzengjdgyfs"),
//数据源
dataList: [],
HotelList: [], //酒店列表
//添加修改供应商酒店信息
addMsg: {
Id: 0, //编号
SupplierId: 0, //
HotelId: 0,
StartDate: "",
EndDate: "",
SubPayType: 0
}, },
{ name: this.$t("ground.yufu"), Id: 4 } //付款方式
], PayTypeList: [{
pickerBeginDateBefore: { name: this.$t("ground.xianfu"),
disabledDate: time => { Id: 1
if (this.addMsg.EndDate == null) { },
return false; {
} else { name: this.$t("ground.qiandan"),
let endTime = new Date(this.addMsg.EndDate); Id: 2
return endTime.getTime() < time.getTime(); },
} {
} name: this.$t("ground.shiwudk"),
}, Id: 3
pickerBeginDateAfter: { },
disabledDate: time => { {
let startTime = new Date(this.addMsg.StartDate); name: this.$t("ground.yufu"),
return startTime.getTime() >= time.getTime(); Id: 4
} },
} {
}; name: this.$t("ground.yufukuandk"),
}, Id: 5
mounted() { },
this.msg.SupplierId = this.$route.query.ID; {
this.addMsg.SupplierId = this.$route.query.ID; name: this.$t("ground.gongsihetzf"),
this.SupplierName = this.$route.query.Name; Id: 6
this.getList(); },
this.getHotelList();
}, {
methods: { name: this.$t("ground.yuejie"),
//初始化数据 Id: 9
initData() { },
this.addMsg.Id = 0; {
this.addMsg.SupplierId = this.$route.query.ID; name: this.$t("ground.lingduidydf"),
this.addMsg.HotelId = 0; Id: 10
this.addMsg.StartDate = ""; },
this.addMsg.EndDate = ""; {
this.addMsg.SubPayType = 0; name: this.$t("ground.shuaka"),
}, Id: 11
SaveData() { },
if (this.addMsg.HotelId <= 0) { ],
this.Info(this.$t("ground.qingxuanzejiud")); pickerBeginDateBefore: {
return; disabledDate: time => {
} if (this.addMsg.EndDate == null) {
if (this.addMsg.SubPayType <= 0) { return false;
this.Info(this.$t("ground.qingxuanzefkfs")); } else {
return; let endTime = new Date(this.addMsg.EndDate);
} return endTime.getTime() < time.getTime();
if (this.addMsg.StartDate == "") { }
this.Info(this.$t("ground.qingxuanzekssjs"));
return;
}
if (this.addMsg.EndDate == "") {
this.Info(this.$t("ground.qingxuanzejssjs"));
return;
}
this.apipost(
"supplier_post_SetSupplierDetailService",
this.addMsg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.initData();
this.isShow = false;
this.getList();
} else {
this.Error(res.data.message);
} }
}, },
null pickerBeginDateAfter: {
); disabledDate: time => {
}, let startTime = new Date(this.addMsg.StartDate);
//根据编号获取实体 return startTime.getTime() >= time.getTime();
GetData(Id) {
this.apipost(
"supplier_post_GetEntityService",
{
Id: Id
},
res => {
this.loading = false;
if (res.data.resultCode == 1) {
var nData = res.data.data;
this.addMsg.Id = nData.Id;
this.addMsg.HotelId = nData.HotelId;
this.addMsg.SubPayType = nData.SubPayType;
this.addMsg.StartDate = nData.StartDateStr;
this.addMsg.EndDate = nData.EndDateStr;
} else {
this.Error(res.data.message);
} }
}, }
null };
);
}, },
//获取数据 mounted() {
getList() { this.msg.SupplierId = this.$route.query.ID;
this.loading = true; this.addMsg.SupplierId = this.$route.query.ID;
this.apipost( this.SupplierName = this.$route.query.Name;
"supplier_get_GetListService", this.getList();
this.msg, this.getHotelList();
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
}
},
null
);
}, },
//获取酒店列表 methods: {
getHotelList() { //初始化数据
this.loading = true; initData() {
this.apipost( this.addMsg.Id = 0;
"hotel_post_GetList", this.addMsg.SupplierId = this.$route.query.ID;
{ this.addMsg.HotelId = 0;
QCountry: 651 this.addMsg.StartDate = "";
}, this.addMsg.EndDate = "";
res => { this.addMsg.SubPayType = 0;
this.loading = false; },
if (res.data.resultCode == 1) { SaveData() {
this.HotelList = res.data.data; if (this.addMsg.HotelId <= 0) {
} else { this.Info(this.$t("ground.qingxuanzejiud"));
this.Error(res.data.message); return;
} }
}, if (this.addMsg.SubPayType <= 0) {
null this.Info(this.$t("ground.qingxuanzefkfs"));
); return;
}
if (this.addMsg.StartDate == "") {
this.Info(this.$t("ground.qingxuanzekssjs"));
return;
}
if (this.addMsg.EndDate == "") {
this.Info(this.$t("ground.qingxuanzejssjs"));
return;
}
this.apipost(
"supplier_post_SetSupplierDetailService",
this.addMsg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.initData();
this.isShow = false;
this.getList();
} else {
this.Error(res.data.message);
}
},
null
);
},
//根据编号获取实体
GetData(Id) {
this.apipost(
"supplier_post_GetEntityService", {
Id: Id
},
res => {
this.loading = false;
if (res.data.resultCode == 1) {
var nData = res.data.data;
this.addMsg.Id = nData.Id;
this.addMsg.HotelId = nData.HotelId;
this.addMsg.SubPayType = nData.SubPayType;
this.addMsg.StartDate = nData.StartDateStr;
this.addMsg.EndDate = nData.EndDateStr;
} else {
this.Error(res.data.message);
}
},
null
);
},
//获取数据
getList() {
this.loading = true;
this.apipost(
"supplier_get_GetListService",
this.msg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
} else {
this.Error(res.data.message);
}
},
null
);
},
//获取酒店列表
getHotelList() {
this.loading = true;
this.apipost(
"hotel_post_GetList", {
QCountry: 651
},
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.HotelList = res.data.data;
} else {
this.Error(res.data.message);
}
},
null
);
}
} }
} };
};
</script> </script>
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