xubinxcode 3 anni fa
parent
commit
f554aaeceb
3 ha cambiato i file con 186 aggiunte e 75 eliminazioni
  1. +106
    -30
      src/components/HelloWorld.vue
  2. +35
    -16
      src/components/hotel.vue
  3. +45
    -29
      src/components/hotelother.vue

+ 106
- 30
src/components/HelloWorld.vue Vedi File

@@ -88,7 +88,8 @@
<el-row type="flex" justify="end" v-if="type=='add'">
<i class="el-icon-close" @click="delSinHotelOther(index)"></i>
</el-row>
<hotelother :userOpt="userOpt" :dataObj="item" :saleCount="saleCount" :type="type"></hotelother>
<hotelother :userOpt="userOpt" :dataObj="item" :cf_itemOpt="cf_itemOpt" :saleCount="saleCount"
:type="type"></hotelother>
</el-card>
</template>
<el-form-item>
@@ -116,30 +117,30 @@
saleCount: 1,
editSingle: false,
orderMain: {
commissioner: '订单专员',
channel_id: '订单渠道',
channel_order_no: '渠道订单编号',
user_name: '用户姓名',
user_phone: "111111111111",
order_memo: "备注",
commissioner: '',
channel_id: '',
channel_order_no: '',
user_name: '',
user_phone: "",
order_memo: "",
},
orderMainCopy: {},
hotelListObj: {
hotel_id: '酒店名称',
room_id: '房型名称',
plan_id: '价格方案',
hotel_id: '',
room_id: '',
plan_id: '',
check_in_date: '',
check_out_date: '',
customer_name: '出游人姓名',
confirm_no: '123456',
trade_order_number: '123456',
customer_name: '',
confirm_no: '',
trade_order_number: '',
confirm_status: '1',
room_memo: '床型说明',
purchase_user_id: '资源负责人',
plan_memo: '价格方案说明',
total_price: '总金额',
total_cost: '成本价',
profit: '利润',
room_memo: '',
purchase_user_id: '',
plan_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
@@ -152,19 +153,19 @@
},
hotelList: [],
hotelotherListObj: {
item_id: '附加项目类型',
item_name: '附加项目名称',
item_unit: '计价单位',
item_id: '',
item_name: '',
item_unit: '',
check_in_date: '',
customer_name: '出游人姓名',
confirm_no: '123456',
trade_order_number: '123456',
purchase_user_id: '资源负责人',
customer_name: '',
confirm_no: '',
trade_order_number: '',
purchase_user_id: '',
confirm_status: '1',
item_memo: '附加项目说明',
total_price: '总金额',
total_cost: '成本价',
profit: '利润',
item_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
@@ -179,6 +180,8 @@
hotelListOpt: [],
channelListOpt: [],
userOpt: [],
roomPlan: [],
cf_itemOpt: [],
}
},
computed: {
@@ -239,21 +242,89 @@
if (process.env.NODE_ENV !== 'production') {
axios.defaults.baseURL = '/api' //关键代码
}
axios.get("/hotel.php/cf_item/getList").then((res) => {
console.log(res)
this.cf_itemOpt = res.data.list
// this.cf_itemOpt = [{
// "id": 1,
// "name": "附加项目1",
// "item_unit": "件",
// "item_type": 1,
// "item_memo": "说说说",
// "item_type_name": "一日游"
// }, {
// "id": 2,
// "name": "附加项2222",
// "item_unit": "张",
// "item_type": 2,
// "item_memo": "说说说",
// "item_type_name": "交通接驳"
// }]
}).catch((err) => {
console.log(err)
})
axios.get("/hotel.php/auth/admin/getList").then((res) => {
console.log(res)
this.userOpt = res.data.list
// this.userOpt = [{"id": 1, "name": "Admin"}, {"id": 2, "name": "瞿殿斌"}, {
// "id": 3,
// "name": "宋晓明"
// }, {"id": 4, "name": "庄亮"}, {"id": 5, "name": "testlkx"}]
}).catch((err) => {
console.log(err)
})
axios.get("/hotel.php/cf_hotel_info/getHotelList").then((res) => {
console.log(res)
this.hotelListOpt = res.data.list
// this.hotelListOpt = [{"id": 0, "name": "暂无"}, {"id": 1, "name": "111"}, {"id": 2, "name": "222"}]
}).catch((err) => {
console.log(err)
})

console.log(item)
axios.get("/hotel.php/cf_room_plan/getList").then((res) => {
console.log(res)
this.roomPlan = res.data.list
// this.roomPlan = [{"id": 1, "name": "111"}]
}).catch((err) => {
console.log(err)
})
axios.get("/hotel.php/cf_channel_info/getList").then((res) => {
console.log(res)
this.channelListOpt = res.data.list
// this.channelListOpt = [{"id": 1, "name": "测试飞猪", "commission_rate": "10.00"}, {
// "id": 2,
// "name": "【昊瀚】飞猪日历房",
// "commission_rate": "8.00"
// }, {"id": 3, "name": "【昊瀚】飞猪套餐", "commission_rate": "3.50"}, {
// "id": 4,
// "name": "【水汪清】携程",
// "commission_rate": "0.00"
// }, {"id": 5, "name": "【昊瀚】美团大众", "commission_rate": "0.00"}, {
// "id": 6,
// "name": "【守则固】携程",
// "commission_rate": "0.00"
// }, {"id": 7, "name": "【守则固】同程艺龙", "commission_rate": "0.00"}, {
// "id": 8,
// "name": "【守则固】途牛",
// "commission_rate": "0.00"
// }, {"id": 9, "name": "【水汪清】去哪儿", "commission_rate": "0.00"}, {
// "id": 10,
// "name": "【昊瀚】小红书",
// "commission_rate": "0.00"
// }, {"id": 11, "name": "【冲抵】唯途", "commission_rate": "0.00"}, {
// "id": 12,
// "name": "【昊瀚】淘1站",
// "commission_rate": "0.00"
// }, {"id": 13, "name": "【昊瀚】线下", "commission_rate": "0.00"}, {
// "id": 14,
// "name": "【水汪清】浪客行",
// "commission_rate": "0.00"
// }, {"id": 15, "name": "【毛木宁】日历房", "commission_rate": "8.00"}, {
// "id": 16,
// "name": "【毛木宁】套餐",
// "commission_rate": "3.50"
// }]
}).catch((err) => {
console.log(err)
})
@@ -280,3 +351,8 @@
}
}
</script>
<style lang="css">
.left {
text-align: left;
}
</style>

+ 35
- 16
src/components/hotel.vue Vedi File

@@ -12,9 +12,9 @@
<!-- <el-button>增补采购单</el-button>-->
<!-- </el-col>-->
<div>
<el-button @click.stop.prevent="edit" v-show="dataObj.editType=='view'">修改</el-button>
<el-button v-show="dataObj.editType=='edit'" @click.stop.prevent="save">保存</el-button>
<el-button v-show="dataObj.editType=='edit'" @click.stop.prevent="cancel">取消</el-button>
<el-button @click.stop.prevent="edit" v-show="dataObjTemp.editType=='view'">修改</el-button>
<el-button v-show="dataObjTemp.editType=='edit'" @click.stop.prevent="save">保存</el-button>
<el-button v-show="dataObjTemp.editType=='edit'" @click.stop.prevent="cancel">取消</el-button>
</div>
</el-row>
</template>
@@ -27,7 +27,7 @@
<el-select v-model="dataObj.hotel_id" filterable placeholder="请选择" @change="selectChange">
<el-option
v-for="item in hotelListOpt"
:key="item.id"
:key="'hotel_id'+item.id"
:label="item.name"
:value="item.id">
</el-option>
@@ -36,10 +36,10 @@
</el-col>
<el-col :span="8">
<el-form-item label="房型名称">
<el-select v-model="dataObj.room_id" filterable placeholder="请选择" @change="selectChange">
<el-select v-model="dataObj.room_id" filterable placeholder="请选择" @change="roomselectChange">
<el-option
v-for="item in roomListOpt"
:key="item.id"
:key="'room_id'+item.id"
:label="item.name"
:value="item.id">
</el-option>
@@ -48,7 +48,14 @@
</el-col>
<el-col :span="8">
<el-form-item label="价格方案">
<el-input v-model="dataObj.plan_id"></el-input>
<el-select v-model="dataObj.plan_id" filterable placeholder="请选择" @change="selectChange">
<el-option
v-for="item in roomPlan"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@@ -201,7 +208,14 @@
</el-col>
<el-col :span="8">
<el-form-item label="价格方案">
<el-input v-model="dataObj.plan_id"></el-input>
<el-select v-model="dataObj.plan_id" filterable placeholder="请选择" @change="selectChange">
<el-option
v-for="item in roomPlan"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@@ -332,10 +346,10 @@

export default {
name: "hotel",
props: {userOpt: Array,type: String, saleCount: Number, dataObj: Object, hotelListOpt: Array},
props: {roomPlan: Array, userOpt: Array, type: String, saleCount: Number, dataObj: Object, hotelListOpt: Array},
data() {
return {
dataObjCopy: this.$lo.cloneDeep(this.dataObj),
dataObjTemp: this.$lo.cloneDeep(this.dataObj),
confirm_status: '未发单',
roomListOpt: [],
date: [],
@@ -344,13 +358,13 @@
},
computed: {
disable() {
return this.dataObj.editType != 'add'
return this.dataObjTemp.editType != 'add'
}
},
watch: {
dataObj(val) {
console.log('change')
this.dataObjCopy = this.$lo.cloneDeep(this.dataObj)
this.dataObjTemp = this.$lo.cloneDeep(this.dataObj)
},
confirm_status(val) {
let type = '';
@@ -507,16 +521,17 @@
console.log(item)
axios.get("/hotel.php/cf_room_info/getRoomList?hotelId=" + item).then((res) => {
console.log(res)
this.roomListOpt = res.data.list
// this.roomListOpt = res.data.list
this.roomListOpt = [{"id": 1, "name": "111"}]
}).catch((err) => {
console.log(err)
})
},
edit() {
this.$set(this.dataObj, 'editType', 'edit');
this.dataObjTemp.editType = 'edit';
},
save() {
this.$set(this.dataObj, 'editType', 'view');
this.dataObjTemp.editType = 'view';
axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => {
console.log(res)
if (res.flag) {
@@ -530,7 +545,7 @@
},
cancel() {
this.$set(this.dataObj, 'editType', 'view');
this.$set(this, 'dataObj', this.orderMainCopy);
this.$set(this, 'dataObj', this.dataObj);
}
},
mounted() {
@@ -549,4 +564,8 @@
.card /deep/ .el-collapse-item__header {
height: auto;
}

.left {
text-align: left;
}
</style>

+ 45
- 29
src/components/hotelother.vue Vedi File

@@ -12,9 +12,9 @@
<!-- <el-button>增补采购单</el-button>-->
<!-- </el-col>-->
<div>
<el-button @click.stop.prevent="edit" v-show="dataObj.editType=='view'">修改</el-button>
<el-button v-show="dataObj.editType=='edit'" @click.stop.prevent="save">保存</el-button>
<el-button v-show="dataObj.editType=='edit'" @click.stop.prevent="cancel">取消</el-button>
<el-button @click.stop.prevent="edit" v-show="dataObjTemp.editType=='view'">修改</el-button>
<el-button v-show="dataObjTemp.editType=='edit'" @click.stop.prevent="save">保存</el-button>
<el-button v-show="dataObjTemp.editType=='edit'" @click.stop.prevent="cancel">取消</el-button>
</div>
</el-row>
</template>
@@ -23,11 +23,12 @@
<el-row style="margin-top: 25px;padding-right: 20px;">
<el-col :span="8">
<el-form-item label="附加项目类型">
<el-select style="width: 100%" v-model="dataObj.item_id" filterable placeholder="请选择">
<el-select style="width: 100%" v-model="dataObj.item_id" filterable placeholder="请选择"
@change="changeItem">
<el-option
v-for="item in cf_itemOpt"
:key="item.id"
:label="item.name"
:key="'item_id'+item.id"
:label="item.item_type_name"
:value="item.id">
</el-option>
</el-select>
@@ -35,12 +36,16 @@
</el-col>
<el-col :span="8">
<el-form-item label="附加项目名称">
<el-input v-model="dataObj.item_name"></el-input>
<div class="left">
{{dataObjTemp.item_name}}
</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计价单位">
<el-input v-model="dataObj.item_unit"></el-input>
<div class="left">
{{dataObjTemp.item_unit}}
</div>
</el-form-item>
</el-col>
</el-row>
@@ -125,7 +130,7 @@
<el-select style="width: 100%" v-model="dataObj.purchase_user_id" filterable placeholder="请选择">
<el-option
v-for="item in userOpt"
:key="item.id"
:key="'purchase_user_id'+item.id"
:label="item.name"
:value="item.id">
</el-option>
@@ -146,7 +151,7 @@
<el-row>
<el-col :span="24">
<el-form-item label-width="100px" label="附加项目说明">
<span>{{dataObj.item_memo}}</span>
<span>{{dataObjTemp.item_memo}}</span>
</el-form-item>
</el-col>
</el-row>
@@ -161,8 +166,8 @@
<el-select style="width: 100%" v-model="dataObj.item_id" filterable placeholder="请选择">
<el-option
v-for="item in cf_itemOpt"
:key="item.id"
:label="item.name"
:key="'item_id2'+item.id"
:label="item.item_type_name"
:value="item.id">
</el-option>
</el-select>
@@ -170,12 +175,18 @@
</el-col>
<el-col :span="8">
<el-form-item label="附加项目名称">
<el-input v-model="dataObj.item_name"></el-input>
<div class="left">
{{dataObjTemp.item_name}}
</div>
<!-- <el-input v-model="dataObjTemp.item_name"></el-input>-->
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计价单位">
<el-input v-model="dataObj.item_unit"></el-input>
<div class="left">
{{dataObjTemp.item_unit}}
</div>
<!-- <el-input v-model="dataObjTemp.item_unit"></el-input>-->
</el-form-item>
</el-col>
</el-row>
@@ -261,7 +272,7 @@
<el-select style="width: 100%" v-model="dataObj.purchase_user_id" filterable placeholder="请选择">
<el-option
v-for="item in userOpt"
:key="item.id"
:key="'purchase_user_id'+item.id"
:label="item.name"
:value="item.id">
</el-option>
@@ -282,7 +293,7 @@
<el-row>
<el-col :span="24">
<el-form-item label-width="100px" label="附加项目说明">
<span>{{dataObj.item_memo}}</span>
<div class="left">{{dataObjTemp.item_memo}}</div>
</el-form-item>
</el-col>
</el-row>
@@ -296,13 +307,12 @@

export default {
name: "hotelother",
props: {userOpt: Array, type: String, saleCount: Number, dataObj: Object},
props: {cf_itemOpt: Array, userOpt: Array, type: String, saleCount: Number, dataObj: Object},
data() {
return {
dataObjCopy: this.$lo.cloneDeep(this.dataObj),
dataObjTemp: this.$lo.cloneDeep(this.dataObj),
confirm_status: '未发单',
check_in_date: '',
cf_itemOpt: [],
day: []
}
},
@@ -314,7 +324,7 @@
watch: {
dataObj(val) {
console.log('change')
this.dataObjCopy = this.$lo.cloneDeep(this.dataObj)
this.dataObjTemp = this.$lo.cloneDeep(this.dataObj)
},
confirm_status(val) {
let type = '';
@@ -352,6 +362,13 @@
}
},
methods: {
changeItem(id) {
let data = this.cf_itemOpt.find((item) => {
return item.id == id
})
data.item_name = data.name
this.dataObjTemp = Object.assign(this.dataObjTemp, data);
},
changeNum(value) {
if (this.type == 'add') {
this.dataObj.purchasePriceList.forEach((item) => {
@@ -456,10 +473,10 @@
return sums;
},
edit() {
this.$set(this.dataObj, 'editType', 'edit');
this.dataObjTemp.editType = 'edit';
},
save() {
this.$set(this.dataObj, 'editType', 'view');
this.dataObjTemp.editType = 'view';
axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => {
console.log(res)
if (res.flag) {
@@ -473,19 +490,14 @@
},
cancel() {
this.$set(this.dataObj, 'editType', 'view');
this.$set(this, 'dataObj', this.orderMainCopy);
this.$set(this, 'dataObj', this.dataObj);
}
},
mounted() {
if (process.env.NODE_ENV !== 'production') {
axios.defaults.baseURL = '/api' //关键代码
}
axios.get("/hotel.php/cf_item/getList").then((res) => {
console.log(res)
this.cf_itemOpt = res.data.list
}).catch((err) => {
console.log(err)
})

}
}
</script>
@@ -497,4 +509,8 @@
.card /deep/ .el-collapse-item__header {
height: auto;
}

.left {
text-align: left;
}
</style>

Caricamento…
Annulla
Salva