diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue
index 4c44cc5..15b031b 100644
--- a/src/components/HelloWorld.vue
+++ b/src/components/HelloWorld.vue
@@ -51,16 +51,27 @@
添加酒店
-
-
+
+
+
+
+
+
+
+
-
+
添加附加项目
-
-
+
+
+
+
+
+
+
提交订单
@@ -79,7 +90,9 @@
hotelother
},
data() {
+ window.type = 'edit'
return {
+ type: window.type,
orderMain: {
commissioner: '订单专员',
channel_id: '订单渠道',
@@ -105,10 +118,10 @@
total_cost: '成本价',
profit: '利润',
tableData: [{
- date: '请选择日期',
- salePrice: '',
- countPrice: '',
- amount: '',
+ run_date: '请选择日期',
+ price: '',
+ cost: '',
+ count: '',
note: '',
provider: 0
}]
@@ -129,10 +142,10 @@
total_cost: '成本价',
profit: '利润',
tableData: [{
- date: '请选择日期',
- salePrice: '',
- countPrice: '',
- amount: '',
+ run_date: '请选择日期',
+ price: '',
+ cost: '',
+ count: '',
note: '',
provider: 0
}]
@@ -144,10 +157,16 @@
},
methods: {
addHotel() {
- this.hotelList.push(this.hotelListObj)
+ this.hotelList.push(JSON.parse(JSON.stringify(this.hotelListObj)))
},
addHotelOther() {
- this.hotelotherList.push(this.hotelotherListObj)
+ 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!');
diff --git a/src/components/hotel.vue b/src/components/hotel.vue
index 8c3a782..c3f5325 100644
--- a/src/components/hotel.vue
+++ b/src/components/hotel.vue
@@ -1,42 +1,55 @@
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+ {{'酒店'}}
-
-
-
-
-
-
-
+
+ 增补采购单
-
-
-
+ 修改
+ 保存
+ 取消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -70,42 +83,51 @@
show-summary
style="width: 100%; margin-top: 20px">
-
+
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -138,8 +160,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{dataObj.room_memo}}
+
+
+
+
+ {{dataObj.res_person}}
+
+
+
+
+ {{dataObj.priceIntro}}
+
+
+
+
-
@@ -150,7 +313,7 @@
name: "hotel",
props: {dataObj: Object, hotelListOpt: Array},
data() {
- return {roomListOpt: [], date: [], day: []}
+ return {type: window.type, roomListOpt: [], date: [], day: []}
},
watch: {
date(val) {
@@ -163,12 +326,12 @@
let tableData = [];
for (let item of day) {
tableData.push({
- date: item,
- salePrice: '',
- countPrice: '',
- amount: 5,
- note: 5,
- provider: 'q'
+ run_date: item,
+ price: '',
+ cost: '',
+ count: '',
+ note: '',
+ provider: ''
})
}
this.dataObj.tableData = tableData;
@@ -192,6 +355,7 @@
},
getSummaries(param) {
const {columns, data} = param;
+ console.log(param)
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
@@ -202,7 +366,27 @@
sums[index] = '利润';
return;
}
- const values = data.map(item => Number(item[column.property]));
+ if (index === 5) {
+ return;
+ }
+ if (index === 4) {
+ let sum = data.map(item => (Number(item[columns[1].property]) * 1 - Number(item[columns[2].property])) * Number(item[columns[3].property]));
+ if (!sum.every(value => isNaN(value))) {
+ sums[index] = sum.reduce((prev, curr) => {
+ const value = Number(curr);
+ if (!isNaN(value)) {
+ return prev + curr;
+ } else {
+ return prev;
+ }
+ }, 0);
+ sums[index] += ' 元';
+ } else {
+ sums[index] = 'N/A';
+ }
+ return;
+ }
+ const values = data.map(item => Number(item[column.property]) * Number(item[columns[3].property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
diff --git a/src/components/hotelother.vue b/src/components/hotelother.vue
index 863e4bd..3156891 100644
--- a/src/components/hotelother.vue
+++ b/src/components/hotelother.vue
@@ -1,27 +1,40 @@
-
-
+
-
-
-
-
-
+
+
+ {{'附加项目'}}
-
-
-
-
+
+ 增补采购单
-
-
-
+ 修改
+ 保存
+ 取消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -51,35 +64,44 @@
show-summary
style="width: 100%; margin-top: 20px">
-
+
-
+
+
+
+
+
+
+
+
+
+
@@ -96,12 +118,12 @@
-
- 未发单
- 已发单
- 已确认
- 已取消
-
+
+
+
+
+
+
@@ -114,8 +136,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{dataObj.res_person}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{dataObj.item_memo}}
+
+
+
+
-
@@ -126,7 +248,7 @@
name: "hotelother",
props: {dataObj: Object},
data() {
- return {date: [], day: []}
+ return {type: window.type,date: [], day: []}
},
watch: {
date(val) {
@@ -139,14 +261,15 @@
let tableData = [];
for (let item of day) {
tableData.push({
- date: item,
- salePrice: '',
- countPrice: '',
- amount: '',
+ run_date: item,
+ price: '',
+ cost: '',
+ count: '',
note: '',
provider: ''
})
}
+ this.dataObj.tableData = tableData;
this.$set(this.dataObj, 'tableData', tableData)
}
},
@@ -154,7 +277,7 @@
getAllDateCN(startTime, endTime) {
var date_all = []
var i = 0
- while ((endTime.getTime() - startTime.getTime()) >= 0) {
+ while ((endTime.getTime() - startTime.getTime()) > 0) {
var year = startTime.getFullYear()
var month = startTime.getMonth() + 1
var day = startTime.getDate()
@@ -176,7 +299,27 @@
sums[index] = '利润';
return;
}
- const values = data.map(item => Number(item[column.property]));
+ if (index === 5) {
+ return;
+ }
+ if (index === 4) {
+ let sum = data.map(item => (Number(item[columns[1].property]) * 1 - Number(item[columns[2].property])) * Number(item[columns[3].property]));
+ if (!sum.every(value => isNaN(value))) {
+ sums[index] = sum.reduce((prev, curr) => {
+ const value = Number(curr);
+ if (!isNaN(value)) {
+ return prev + curr;
+ } else {
+ return prev;
+ }
+ }, 0);
+ sums[index] += ' 元';
+ } else {
+ sums[index] = 'N/A';
+ }
+ return;
+ }
+ const values = data.map(item => Number(item[column.property]) * Number(item[columns[3].property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
diff --git a/src/main.js b/src/main.js
index e830779..a89d907 100644
--- a/src/main.js
+++ b/src/main.js
@@ -14,7 +14,7 @@ import {
// MenuItem,
// MenuItemGroup,
Input,
- // InputNumber,
+ InputNumber,
// Radio,
RadioGroup,
RadioButton,
@@ -93,7 +93,7 @@ import {
// Vue.use(MenuItem);
// Vue.use(MenuItemGroup);
Vue.use(Input);
-// Vue.use(InputNumber);
+Vue.use(InputNumber);
// Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(RadioButton);