Browse Source

init

master
xubinxcode 3 years ago
parent
commit
9f3dd1c178
3 changed files with 351 additions and 375 deletions
  1. +294
    -289
      src/components/HelloWorld.vue
  2. +33
    -46
      src/components/hotel.vue
  3. +24
    -40
      src/components/hotelother.vue

+ 294
- 289
src/components/HelloWorld.vue View File

@@ -110,299 +110,304 @@


</template> </template>
<script> <script>
import hotel from "./hotel"
import hotelother from "./hotelother"
import axios from "axios"
import hotel from "./hotel"
import hotelother from "./hotelother"
import axios from "axios"


export default {
components: {
hotel,
hotelother
},
data() {
return {
active: '1',
type: window.id ? 'view' : 'add',
saleCount: 1,
editSingle: false,
orderMain: {
commissioner_id: '',
channel_id: '',
channel_order_no: '',
user_name: '',
user_phone: "",
order_memo: "",
},
rules: {
commissioner_id: [
{required: true, message: '请输入', trigger: 'blur'},
],
channel_id: [
{required: true, message: '请输入', trigger: 'blur'},
],
channel_order_no: [
{required: true, message: '请输入', trigger: 'blur'},
],
user_name: [
{required: true, message: '请输入', trigger: 'blur'},
],
user_phone: [
{required: true, message: '请输入', trigger: 'blur'},
],
order_memo: [
{required: true, message: '请输入', trigger: 'blur'},
]
},
orderMainCopy: {},
hotelListObj: {
prod_type: 'hotel',
hotel_id: '',
room_id: '',
plan_id: '',
check_in_date: '',
check_out_date: '',
customer_name: '',
confirm_no: '',
trade_order_number: '',
confirm_status: '1',
room_memo: '',
purchase_user_id: '',
plan_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
count: '',
note: '',
supplier_id: 0
}]
},
hotelList: [],
hotelotherListObj: {
prod_type: 'item',
item_id: '',
item_name: '',
item_unit: '',
check_in_date: '',
customer_name: '',
confirm_no: '',
trade_order_number: '',
purchase_user_id: '',
confirm_status: '1',
item_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
count: '',
note: '',
supplier_id: 0
}]
},
hotelotherList: [],
hotelListOpt: [],
channelListOpt: [],
userOpt: [],
// roomPlan: [],
cf_itemOpt: [],
supplier_idList: [],
}
},
computed: {
disable() {
return !(this.type == 'add' || this.editSingle)
}
},
methods: {
selectChange(val) {
this.saleCount = this.channelListOpt.filter((item) => item.id == val)//佣金比例
this.saleCount = Number(this.saleCount.commission_rate) || 1//佣金比例
console.log(this.saleCount)
},
addHotel() {
this.hotelList.push(JSON.parse(JSON.stringify(this.hotelListObj)))
},
addHotelOther() {
this.hotelotherList.push(JSON.parse(JSON.stringify(this.hotelotherListObj)))
},
delSinHotel(index) {
this.hotelList.splice(index, 1)
},
delSinHotelOther(index) {
this.hotelotherList.splice(index, 1)
},
onSubmit() {
console.log('submit!');
this.$refs['form'].validate((valid) => {
if (valid) {
let data = {}
let subOrderList = [...this.hotelList, ...this.hotelotherList]
data = Object.assign({}, this.orderMain, {'subOrderList': subOrderList})
axios.post("/hotel.php/order_main/save", data).then((res) => {
console.log(res)
}).catch((err) => {
console.log(err)
})
} else {
console.log('error submit!!');
return false;
}
});
// axios.post("/hotel.php/order_main/newAdd?id=1", {}).then((res) => {
export default {
components: {
hotel,
hotelother
},
data() {
return {
active: '1',
type: window.id ? 'view' : 'add',
saleCount: 1,
editSingle: false,
orderMain: {
commissioner_id: '',
channel_id: '',
channel_order_no: '',
user_name: '',
user_phone: "",
order_memo: "",
},
rules: {
commissioner_id: [
{required: true, message: '请输入', trigger: 'blur'},
],
channel_id: [
{required: true, message: '请输入', trigger: 'blur'},
],
channel_order_no: [
{required: true, message: '请输入', trigger: 'blur'},
],
user_name: [
{required: true, message: '请输入', trigger: 'blur'},
],
user_phone: [
{required: true, message: '请输入', trigger: 'blur'},
],
order_memo: [
{required: true, message: '请输入', trigger: 'blur'},
]
},
orderMainCopy: {},
hotelListObj: {
prod_type: 'hotel',
hotel_id: '',
room_id: '',
plan_id: '',
check_in_date: '',
check_out_date: '',
customer_name: '',
confirm_no: '',
trade_order_number: '',
confirm_status: '1',
room_memo: '',
purchase_user_id: '',
plan_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
count: '',
customer_comments: '',
supplier_id: 0
}]
},
hotelList: [],
hotelotherListObj: {
prod_type: 'item',
item_id: '',
item_name: '',
item_unit: '',
check_in_date: '',
customer_name: '',
confirm_no: '',
trade_order_number: '',
purchase_user_id: '',
confirm_status: '1',
item_memo: '',
total_price: '',
total_cost: '',
profit: '',
editType: 'add',
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
count: '',
customer_comments: '',
supplier_id: 0
}]
},
hotelotherList: [],
hotelListOpt: [],
channelListOpt: [],
userOpt: [],
// roomPlan: [],
cf_itemOpt: [],
supplier_idList: [],
}
},
computed: {
disable() {
return !(this.type == 'add' || this.editSingle)
}
},
methods: {
selectChange(val) {
this.saleCount = this.channelListOpt.filter((item) => item.id == val)//佣金比例
this.saleCount = Number(this.saleCount.commission_rate) || 1//佣金比例
console.log(this.saleCount)
},
addHotel() {
this.hotelList.push(JSON.parse(JSON.stringify(this.hotelListObj)))
},
addHotelOther() {
this.hotelotherList.push(JSON.parse(JSON.stringify(this.hotelotherListObj)))
},
delSinHotel(index) {
this.hotelList.splice(index, 1)
},
delSinHotelOther(index) {
this.hotelotherList.splice(index, 1)
},
onSubmit() {
console.log('submit!');
this.$refs['form'].validate((valid) => {
if (valid) {
let data = {}
let subOrderList = [...this.hotelList, ...this.hotelotherList]
data = Object.assign({}, this.orderMain, {'subOrderList': subOrderList})
axios.post("/hotel.php/order_main/save", data).then((res) => {
this.$alert('新增成功', '提示', {
confirmButtonText: '确定',
callback: action => {
Fast.api.close()
}
});
}).catch((err) => {
console.log(err)
})
} else {
console.log('error submit!!');
return false;
}
});
// axios.post("/hotel.php/order_main/newAdd?id=1", {}).then((res) => {


},
save() {
this.editSingle = false;
let data = this.orderMain
axios.post("/hotel.php/order_main/save", data).then((res) => {
console.log(res)
if (res.flag) {
this.$alert('提示', res.msg, {
confirmButtonText: '确定',
});
}
}).catch((err) => {
console.log(err)
})
},
cancel() {
this.editSingle = false;
this.orderMain = this.orderMainCopy
}
},
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
// 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)
})
axios.get("/hotel.php/cf_suplier_info/getList").then((res) => {
console.log(res)
this.supplier_idList = res.data.list //取供应商下拉
// this.hotelListOpt = [{"id": 0, "name": "暂无"}, {"id": 1, "name": "111"}, {"id": 2, "name": "222"}]
}).catch((err) => {
console.log(err)
})
},
save() {
this.editSingle = false;
let data = this.orderMain
axios.post("/hotel.php/order_main/save", data).then((res) => {
if (res.data.flag) {


// 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)
})
console.log(this.type)
if (this.type != 'add') {
axios.post("/hotel.php/order_main/getShowInfo", {id: window.id}).then((res) => {
console.log(res)
if (res.flag) {
let orderMain = this.$lo.cloneDeep(res.data)
delete orderMain.subOrderList
this.orderMain = orderMain
this.orderMainCopy = this.$lo.cloneDeep(orderMain)
res.data.subOrderList.forEach((item) => {
item.editType = 'view'
})
this.hotelList = res.data.subOrderList.filter((item) => item.hotel_id)
this.hotelotherList = res.data.subOrderList.filter((item) => item.item_id)
}
// this.channelListOpt = res.data.list
}).catch((err) => {
console.log(err)
})
}
}
}
}
this.$alert(res.data.msg, '提示', {
confirmButtonText: '确定',
});
}).catch((err) => {
console.log(err)
})
},
cancel() {
this.editSingle = false;
this.orderMain = this.orderMainCopy
}
},
mounted() {
if (process.env.NODE_ENV !== 'production') {
axios.defaults.baseURL = '/api' //关键代码
}
axios.get("/hotel.php/cf_item/getList").then((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) => {
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) => {
this.hotelListOpt = res.data.list //取酒店下拉
// this.hotelListOpt = [{"id": 0, "name": "暂无"}, {"id": 1, "name": "111"}, {"id": 2, "name": "222"}]
}).catch((err) => {
console.log(err)
})
axios.get("/hotel.php/cf_suplier_info/getList").then((res) => {
this.supplier_idList = res.data.list //取供应商下拉
// this.hotelListOpt = [{"id": 0, "name": "暂无"}, {"id": 1, "name": "111"}, {"id": 2, "name": "222"}]
}).catch((err) => {
console.log(err)
})

// 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) => {
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)
})
console.log(this.type)
if (this.type != 'add') {
axios.post("/hotel.php/order_main/getShowInfo", {id: window.id}).then((res) => {
console.log('detailDatas', res.data)
if (res.data.flag) {
let orderMain = this.$lo.cloneDeep(res.data.data)
delete orderMain.subOrderList
this.orderMain = orderMain
this.orderMainCopy = this.$lo.cloneDeep(orderMain)
res.data.data.subOrderList.forEach((item) => { //回显值的处理
item.purchasePriceList.forEach((value) => {
value.supplier_id = item.supplier_id
value.customer_comments = item.customer_comments
})
item.editType = 'view'
})

this.hotelList = res.data.data.subOrderList.filter((item) => item.hotel_id)
this.hotelotherList = res.data.data.subOrderList.filter((item) => item.item_id)
}
// this.channelListOpt = res.data.list
}).catch((err) => {
console.log(err)
})
}
}
}
</script> </script>
<style lang="css"> <style lang="css">
.left {
text-align: left;
}
.left {
text-align: left;
}


.card {
overflow-x: scroll;
}
.card {
overflow-x: scroll;
}
</style> </style>

+ 33
- 46
src/components/hotel.vue View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-collapse v-if="type=='view'">
<el-collapse-item>
<el-collapse v-model="opened" v-if="type=='view'">
<el-collapse-item name="1">
<template slot="title"> <template slot="title">
<el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex" <el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex"
justify="space-between" align="middle"> justify="space-between" align="middle">
@@ -91,6 +91,7 @@
:data="dataObj.purchasePriceList" :data="dataObj.purchasePriceList"
border border
height="500" height="500"
:span-method="arraySpanMethod"
:summary-method="getSummaries" :summary-method="getSummaries"
show-summary show-summary
style="width: 100%;min-width:890px; margin-top: 20px"> style="width: 100%;min-width:890px; margin-top: 20px">
@@ -136,10 +137,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="note"
prop="customer_comments"
label="备注"> label="备注">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="textarea" v-model="scope.row.note"></el-input>
<el-input type="textarea" v-model="scope.row.customer_comments" @change="changeNote"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -147,16 +148,16 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label-width="100px" label="对方订单号"> <el-form-item label-width="100px" label="对方订单号">
<el-input-number size="small" v-model="dataObj.trade_order_number"></el-input-number>
<el-input v-model="dataObj.trade_order_number"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="资源状态"> <el-form-item label="资源状态">
<el-radio-group v-model="confirm_status" size="small" style="min-width: 270px;">
<el-radio-button label="未发单" name="未发单"></el-radio-button>
<el-radio-button label="已发单" name="已发单"></el-radio-button>
<el-radio-button label="已确认" name="已确认"></el-radio-button>
<el-radio-button label="已取消" name="已取消"></el-radio-button>
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<el-radio-button :label="1" name="未发单">未发单</el-radio-button>
<el-radio-button :label="2" name="已发单">已发单</el-radio-button>
<el-radio-button :label="3" name="已确认">已确认</el-radio-button>
<el-radio-button :label="4" name="已取消">已取消</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -309,10 +310,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="note"
prop="customer_comments"
label="备注"> label="备注">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="textarea" v-model="scope.row.note" @change="changeNote"></el-input>
<el-input type="textarea" v-model="scope.row.customer_comments" @change="changeNote"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -325,11 +326,11 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="资源状态"> <el-form-item label="资源状态">
<el-radio-group v-model="confirm_status" size="small" style="min-width: 270px;">
<el-radio-button label="未发单" name="未发单"></el-radio-button>
<el-radio-button label="已发单" name="已发单"></el-radio-button>
<el-radio-button label="已确认" name="已确认"></el-radio-button>
<el-radio-button label="已取消" name="已取消"></el-radio-button>
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<el-radio-button :label="1" name="未发单">未发单</el-radio-button>
<el-radio-button :label="2" name="已发单">已发单</el-radio-button>
<el-radio-button :label="3" name="已确认">已确认</el-radio-button>
<el-radio-button :label="4" name="已取消">已取消</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -380,7 +381,7 @@
data() { data() {
return { return {
dataObjTemp: this.$lo.cloneDeep(this.dataObj), dataObjTemp: this.$lo.cloneDeep(this.dataObj),
confirm_status: '未发单',
opened: '1',
roomListOpt: [], roomListOpt: [],
date: [], date: [],
roomPlan: [], roomPlan: [],
@@ -389,7 +390,7 @@
}, },
computed: { computed: {
disable() { disable() {
return this.dataObjTemp.editType != 'add'
return this.dataObjTemp.editType == 'view'
} }
}, },
watch: { watch: {
@@ -397,24 +398,6 @@
console.log('change') console.log('change')
this.dataObjTemp = this.$lo.cloneDeep(this.dataObj) this.dataObjTemp = this.$lo.cloneDeep(this.dataObj)
}, },
confirm_status(val) {
let type = '';
switch (val) {
case "未发单":
type = '1'
break;
case "已发单":
type = '2'
break;
case "已确认":
type = '3'
break;
case "已取消":
type = '4'
break;
}
this.$set(this.dataObj, "confirm_status", type)
},
date(val) { date(val) {
console.log(val) console.log(val)
this.$set(this.dataObj, "check_in_date", val[0]) this.$set(this.dataObj, "check_in_date", val[0])
@@ -429,7 +412,7 @@
price: '', price: '',
cost: '', cost: '',
count: '', count: '',
note: '',
customer_comments: '',
supplier_id: '' supplier_id: ''
}) })
} }
@@ -451,7 +434,8 @@
this.dataObj.purchasePriceList.forEach((item) => { this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'supplier_id', value) this.$set(item, 'supplier_id', value)
}) })
this.$set(this.dataObj, 'supplier_id', value)
// this.$set(this.dataObj, 'supplier_id', value)
this.dataObj.supplier_id = value;
} }
}, },
changeNote(value) { changeNote(value) {
@@ -459,7 +443,8 @@
this.dataObj.purchasePriceList.forEach((item) => { this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'customer_comments', value) this.$set(item, 'customer_comments', value)
}) })
this.$set(this.dataObj, 'customer_comments', value)
this.dataObj.customer_comments = value;
// this.$set(this.dataObj, 'customer_comments', value)
} }
}, },
arraySpanMethod({row, column, rowIndex, columnIndex}) { arraySpanMethod({row, column, rowIndex, columnIndex}) {
@@ -591,21 +576,23 @@
}, },
edit() { edit() {
this.dataObjTemp.editType = 'edit'; this.dataObjTemp.editType = 'edit';
// this.$set(this.dataObj, 'editType', 'edit');
}, },
save() { save() {
this.dataObjTemp.editType = 'view';
axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => { axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => {
console.log(res)
if (res.flag) {
this.$alert('提示', res.msg, {
confirmButtonText: '确定',
});
console.log(res.data)
if (res.data.flag) {
this.dataObjTemp.editType = 'view';
} }
this.$alert(res.data.msg, '提示', {
confirmButtonText: '确定',
});
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
}, },
cancel() { cancel() {
this.dataObjTemp.editType = 'view';
this.$set(this.dataObj, 'editType', 'view'); this.$set(this.dataObj, 'editType', 'view');
this.$set(this, 'dataObj', this.dataObj); this.$set(this, 'dataObj', this.dataObj);
} }


+ 24
- 40
src/components/hotelother.vue View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-collapse v-if="type=='view'">
<el-collapse-item>
<el-collapse v-model="opened" v-if="type=='view'">
<el-collapse-item name="1">
<template slot="title"> <template slot="title">
<el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex" <el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex"
justify="space-between" align="middle"> justify="space-between" align="middle">
@@ -70,6 +70,7 @@
:data="dataObj.purchasePriceList" :data="dataObj.purchasePriceList"
border border
height="500" height="500"
:span-method="arraySpanMethod"
:summary-method="getSummaries" :summary-method="getSummaries"
show-summary show-summary
style="width: 100%;min-width:890px; margin-top: 20px"> style="width: 100%;min-width:890px; margin-top: 20px">
@@ -118,7 +119,7 @@
prop="customer_comments" prop="customer_comments"
label="备注"> label="备注">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input type="textarea" v-model="scope.row.customer_comments"></el-input>
<el-input type="textarea" v-model="scope.row.customer_comments" @change="changeNote"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -143,11 +144,11 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="资源状态"> <el-form-item label="资源状态">
<el-radio-group v-model="confirm_status" size="small" style="min-width: 270px;">
<el-radio-button label="未发单" name="未发单"></el-radio-button>
<el-radio-button label="已发单" name="已发单"></el-radio-button>
<el-radio-button label="已确认" name="已确认"></el-radio-button>
<el-radio-button label="已取消" name="已取消"></el-radio-button>
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<el-radio-button :label="1" name="未发单">未发单</el-radio-button>
<el-radio-button :label="2" name="已发单">已发单</el-radio-button>
<el-radio-button :label="3" name="已确认">已确认</el-radio-button>
<el-radio-button :label="4" name="已取消">已取消</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -286,11 +287,11 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="资源状态"> <el-form-item label="资源状态">
<el-radio-group v-model="confirm_status" size="small" style="min-width: 270px;">
<el-radio-button label="未发单" name="未发单"></el-radio-button>
<el-radio-button label="已发单" name="已发单"></el-radio-button>
<el-radio-button label="已确认" name="已确认"></el-radio-button>
<el-radio-button label="已取消" name="已取消"></el-radio-button>
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<el-radio-button :label="1" name="未发单">未发单</el-radio-button>
<el-radio-button :label="2" name="已发单">已发单</el-radio-button>
<el-radio-button :label="3" name="已确认">已确认</el-radio-button>
<el-radio-button :label="4" name="已取消">已取消</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -323,14 +324,14 @@
data() { data() {
return { return {
dataObjTemp: this.$lo.cloneDeep(this.dataObj), dataObjTemp: this.$lo.cloneDeep(this.dataObj),
confirm_status: '未发单',
opened: '1',
check_in_date: '', check_in_date: '',
day: [] day: []
} }
}, },
computed: { computed: {
disable() { disable() {
return this.dataObj.editType != 'add'
return this.dataObjTemp.editType == 'view'
} }
}, },
watch: { watch: {
@@ -338,24 +339,6 @@
console.log('change') console.log('change')
this.dataObjTemp = this.$lo.cloneDeep(this.dataObj) this.dataObjTemp = this.$lo.cloneDeep(this.dataObj)
}, },
confirm_status(val) {
let type = '';
switch (val) {
case "未发单":
type = '1'
break;
case "已发单":
type = '2'
break;
case "已确认":
type = '3'
break;
case "已取消":
type = '4'
break;
}
this.$set(this.dataObj, "confirm_status", type)
},
check_in_date(val) { check_in_date(val) {
let time = this.getAllDateCN(val) let time = this.getAllDateCN(val)
console.log(time) console.log(time)
@@ -395,7 +378,7 @@
this.$set(item, 'supplier_id', value) this.$set(item, 'supplier_id', value)
}) })
this.dataObj.supplier_id = value this.dataObj.supplier_id = value
this.$set(this.dataObj, 'supplier_id', value)
// this.$set(this.dataObj, 'supplier_id', value)
} }
}, },
changeNote(value) { changeNote(value) {
@@ -404,7 +387,7 @@
this.$set(item, 'customer_comments', value) this.$set(item, 'customer_comments', value)
}) })
this.dataObj.customer_comments = value this.dataObj.customer_comments = value
this.$set(this.dataObj, 'customer_comments', value)
// this.$set(this.dataObj, 'customer_comments', value)
} }
}, },
arraySpanMethod({row, column, rowIndex, columnIndex}) { arraySpanMethod({row, column, rowIndex, columnIndex}) {
@@ -493,19 +476,20 @@
this.dataObjTemp.editType = 'edit'; this.dataObjTemp.editType = 'edit';
}, },
save() { save() {
this.dataObjTemp.editType = 'view';
axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => { axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => {
console.log(res) console.log(res)
if (res.flag) {
this.$alert('提示', res.msg, {
confirmButtonText: '确定',
});
if (res.data.flag) {
this.dataObjTemp.editType = 'view';
} }
this.$alert(res.data.msg, '提示', {
confirmButtonText: '确定',
});
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}) })
}, },
cancel() { cancel() {
this.dataObjTemp.editType = 'view';
this.$set(this.dataObj, 'editType', 'view'); this.$set(this.dataObj, 'editType', 'view');
this.$set(this, 'dataObj', this.dataObj); this.$set(this, 'dataObj', this.dataObj);
} }


Loading…
Cancel
Save