Browse Source

init

master
xubinxcode 3 years ago
parent
commit
21f9b4cf85
6 changed files with 278 additions and 216 deletions
  1. +1
    -2
      package-lock.json
  2. +1
    -0
      package.json
  3. +49
    -14
      src/components/HelloWorld.vue
  4. +35
    -17
      src/components/hotel.vue
  5. +190
    -182
      src/components/hotelother.vue
  6. +2
    -1
      src/main.js

+ 1
- 2
package-lock.json View File

@@ -5400,8 +5400,7 @@
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.camelcase": {
"version": "4.3.0",


+ 1
- 0
package.json View File

@@ -12,6 +12,7 @@
"dependencies": {
"axios": "^0.23.0",
"element-ui": "^2.15.6",
"lodash": "^4.17.21",
"normalize.css": "^8.0.1",
"vue": "^2.5.2"
},


+ 49
- 14
src/components/HelloWorld.vue View File

@@ -13,7 +13,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="订单渠道">
<el-select style="width: 100%" v-model="orderMain.channel_id" filterable placeholder="请选择">
<el-select style="width: 100%" v-model="orderMain.channel_id" filterable placeholder="请选择"
@change="selectChange">
<el-option
v-for="item in channelListOpt"
:key="item.id"
@@ -56,7 +57,7 @@
<el-row type="flex" justify="end" v-if="type=='add'">
<i class="el-icon-close" @click="delSinHotel(index)"></i>
</el-row>
<hotel :dataObj="item" :hotelListOpt="hotelListOpt"></hotel>
<hotel :dataObj="item" :hotelListOpt="hotelListOpt" :saleCount="saleCount" :type="type"></hotel>
</el-card>

</template>
@@ -70,7 +71,7 @@
<el-row type="flex" justify="end" v-if="type=='add'">
<i class="el-icon-close" @click="delSinHotelOther(index)"></i>
</el-row>
<hotelother :dataObj="item"></hotelother>
<hotelother :dataObj="item" :saleCount="saleCount" :type="type"></hotelother>
</el-card>
</template>
<el-form-item>
@@ -91,7 +92,8 @@
},
data() {
return {
type: window.type,
type: window.id ? 'edit' : 'add',
saleCount: 1,
orderMain: {
commissioner: '订单专员',
channel_id: '订单渠道',
@@ -109,14 +111,14 @@
customer_name: '出游人姓名',
confirm_no: '123456',
trade_order_number: '123456',
confirm_status: '未发单',
confirm_status: '1',
room_memo: '床型说明',
res_person: '资源负责人',
plan_memo: '价格方案说明',
total_price: '总金额',
total_cost: '成本价',
profit: '利润',
tableData: [{
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
@@ -130,17 +132,17 @@
item_type: '附加项目类型',
item_name: '附加项目名称',
item_unit: '计价单位',
use_date: '',
check_in_date: '',
customer_name: '出游人姓名',
confirm_no: '123456',
trade_order_number: '123456',
res_person: '资源负责人',
confirm_status: '未发单',
confirm_status: '1',
item_memo: '附加项目说明',
total_price: '总金额',
total_cost: '成本价',
profit: '利润',
tableData: [{
purchasePriceList: [{
run_date: '请选择日期',
price: '',
cost: '',
@@ -155,6 +157,11 @@
}
},
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)))
},
@@ -170,11 +177,10 @@
onSubmit() {
console.log('submit!');
// axios.post("/hotel.php/order_main/newAdd?id=1", {}).then((res) => {
axios.post("/hotel.php/order_main/newAdd?id=1", {
orderMain: this.orderMain, //基础数据
hotel: this.hotelList, //酒店
item: this.hotelotherList //酒店附加数据
}).then((res) => {
let data = {}
let subOrderList = [...this.hotelList, ...this.hotelotherList]
data = Object.assign({}, this.orderMain, {'subOrderList': subOrderList})
axios.post("/hotel.php/order_main/newAdd?id=1", data).then((res) => {
console.log(res)
}).catch((err) => {
console.log(err)
@@ -194,9 +200,38 @@
axios.get("/hotel.php/cf_channel_info/getList").then((res) => {
console.log(res)
this.channelListOpt = res.data.list
// this.channelListOpt = [{"id": 1, "name": "测试飞猪"}, {"id": 2, "name": "【昊瀚】飞猪日历房"}, {
// "id": 3,
// "name": "【昊瀚】飞猪套餐"
// }, {"id": 4, "name": "【水汪清】携程"}, {"id": 5, "name": "【昊瀚】美团大众"}, {"id": 6, "name": "【守则固】携程"}, {
// "id": 7,
// "name": "【守则固】同程艺龙"
// }, {"id": 8, "name": "【守则固】途牛"}, {"id": 9, "name": "【水汪清】去哪儿"}, {
// "id": 10,
// "name": "【昊瀚】小红书"
// }, {"id": 11, "name": "【冲抵】唯途"}, {"id": 12, "name": "【昊瀚】淘1站"}, {"id": 13, "name": "【昊瀚】线下"}, {
// "id": 14,
// "name": "【水汪清】浪客行"
// }, {"id": 15, "name": "【毛木宁】日历房"}, {"id": 16, "name": "【毛木宁】套餐"}]
}).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.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)
})
}
}
}
</script>

+ 35
- 17
src/components/hotel.vue View File

@@ -76,7 +76,7 @@
</el-row>
<el-form-item>
<el-table
:data="dataObj.tableData"
:data="dataObj.purchasePriceList"
border
height="500"
:summary-method="getSummaries"
@@ -132,7 +132,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="资源状态">
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<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>
@@ -219,7 +219,7 @@
</el-row>
<el-form-item>
<el-table
:data="dataObj.tableData"
:data="dataObj.purchasePriceList"
border
height="500"
:summary-method="getSummaries"
@@ -276,7 +276,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="资源状态">
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<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>
@@ -312,11 +312,29 @@

export default {
name: "hotel",
props: {dataObj: Object, hotelListOpt: Array},
props: {type: String, saleCount: Number, dataObj: Object, hotelListOpt: Array},
data() {
return {type: window.type, roomListOpt: [], date: [], day: []}
return {confirm_status: '未发单', roomListOpt: [], date: [], day: []}
},
watch: {
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) {
console.log(val)
this.$set(this.dataObj, "check_in_date", val[0])
@@ -324,9 +342,9 @@
let date1 = new Date(val[0]);
let date2 = new Date(val[1]);
let day = this.getAllDateCN(date1, date2)
let tableData = [];
let purchasePriceList = [];
for (let item of day) {
tableData.push({
purchasePriceList.push({
run_date: item,
price: '',
cost: '',
@@ -335,29 +353,29 @@
provider: ''
})
}
this.dataObj.tableData = tableData;
this.$set(this.dataObj, 'tableData', tableData)
this.dataObj.purchasePriceList = purchasePriceList;
this.$set(this.dataObj, 'purchasePriceList', purchasePriceList)

}
},
methods: {
changeNum(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'count', value)
})
}
},
changeProvider(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'provider', value)
})
}
},
changeNote(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'note', value)
})
}
@@ -365,11 +383,11 @@
arraySpanMethod({row, column, rowIndex, columnIndex}) {
// console.log({row, column, rowIndex, columnIndex})
if (columnIndex === 3) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else if (columnIndex === 4) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else if (columnIndex === 5) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else {
return [1, 1];
}
@@ -404,7 +422,7 @@
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]));
let sum = data.map(item => (Number(item[columns[1].property]) * this.saleCount - 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);


+ 190
- 182
src/components/hotelother.vue View File

@@ -1,142 +1,23 @@
<template>
<el-form ref="form" :model="dataObj" label-width="100px">
<el-collapse v-if="type=='edit'">
<el-collapse-item>
<template slot="title">
<el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex"
justify="space-between" align="middle">
<el-col :span="2">
{{'附加项目'}}
</el-col>
<!-- <el-col :span="2" :push="3">-->
<!-- <el-button>增补采购单</el-button>-->
<!-- </el-col>-->
<el-col :span="8">
<el-button>修改</el-button>
<el-button>保存</el-button>
<el-button>取消</el-button>
</el-col>
</el-row>
</template>
<el-row style="margin-top: 25px;padding-right: 20px;">
<el-col :span="8">
<el-form-item label="附加项目类型">
<el-input v-model="dataObj.item_type"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附加项目名称">
<el-input v-model="dataObj.item_name"></el-input>
</el-form-item>
<el-form ref="form" :model="dataObj" label-width="100px">
<el-collapse v-if="type=='edit'">
<el-collapse-item>
<template slot="title">
<el-row style="width:100%;margin-top:10px;margin-bottom:10px;padding-right: 20px;" type="flex"
justify="space-between" align="middle">
<el-col :span="2">
{{'附加项目'}}
</el-col>
<!-- <el-col :span="2" :push="3">-->
<!-- <el-button>增补采购单</el-button>-->
<!-- </el-col>-->
<el-col :span="8">
<el-form-item label="计价单位">
<el-input v-model="dataObj.item_unit"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="使用日期">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="dataObj.use_date"
style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="100px" label="出游人姓名">
<el-input v-model="dataObj.customer_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="确认号">
<el-input v-model="dataObj.confirm_no"></el-input>
</el-form-item>
<el-button>修改</el-button>
<el-button>保存</el-button>
<el-button>取消</el-button>
</el-col>
</el-row>
<el-form-item>
<el-table
:data="dataObj.tableData"
border
height="500"
:summary-method="getSummaries"
show-summary
style="width: 100%; margin-top: 20px">
<el-table-column
prop="run_date"
label="日期"
width="180">
</el-table-column>
<el-table-column
prop="price"
label="售卖价">
<template slot-scope="scope">
<el-input-number v-model="scope.row.price"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="cost"
label="成本价">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cost"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="count"
label="数量">
<template slot-scope="scope">
<el-input-number v-model="scope.row.count"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="provider"
label="供应商">
<template slot-scope="scope">
<el-input v-model="scope.row.provider"></el-input>
</template>
</el-table-column>
<el-table-column
prop="note"
label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.note"></el-input>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-row>
<el-col :span="6">
<el-form-item label-width="100px" label="对方订单号">
<el-input v-model="dataObj.trade_order_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="100px" label="资源负责人">
<span>{{dataObj.res_person}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="资源状态">
<el-radio-group v-model="dataObj.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>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label-width="100px" label="附加项目说明">
<span>{{dataObj.item_memo}}</span>
</el-form-item>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
<template v-else>
</template>
<el-row style="margin-top: 25px;padding-right: 20px;">
<el-col :span="8">
<el-form-item label="附加项目类型">
@@ -158,7 +39,7 @@
<el-col :span="10">
<el-form-item label="使用日期">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="dataObj.use_date"
<el-date-picker type="date" placeholder="选择日期" v-model="check_in_date"
style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
@@ -176,11 +57,10 @@
</el-row>
<el-form-item>
<el-table
:data="dataObj.tableData"
:data="dataObj.purchasePriceList"
border
height="500"
:summary-method="getSummaries"
:span-method="arraySpanMethod"
show-summary
style="width: 100%; margin-top: 20px">
<el-table-column
@@ -206,21 +86,21 @@
prop="count"
label="数量">
<template slot-scope="scope">
<el-input-number v-model="scope.row.count" @change="changeNum"></el-input-number>
<el-input-number v-model="scope.row.count"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="provider"
label="供应商">
<template slot-scope="scope">
<el-input v-model="scope.row.provider" @change="changeProvider"></el-input>
<el-input v-model="scope.row.provider"></el-input>
</template>
</el-table-column>
<el-table-column
prop="note"
label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.note" @change="changeNote"></el-input>
<el-input v-model="scope.row.note"></el-input>
</template>
</el-table-column>
</el-table>
@@ -238,7 +118,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="资源状态">
<el-radio-group v-model="dataObj.confirm_status" size="small" style="min-width: 270px;">
<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>
@@ -254,8 +134,128 @@
</el-form-item>
</el-col>
</el-row>
</template>
</el-form>
</el-collapse-item>
</el-collapse>
<template v-else>
<el-row style="margin-top: 25px;padding-right: 20px;">
<el-col :span="8">
<el-form-item label="附加项目类型">
<el-input v-model="dataObj.item_type"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附加项目名称">
<el-input v-model="dataObj.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>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-form-item label="使用日期">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="check_in_date"
style="width: 100%;"></el-date-picker>
</el-col>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="100px" label="出游人姓名">
<el-input v-model="dataObj.customer_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="确认号">
<el-input v-model="dataObj.confirm_no"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-table
:data="dataObj.purchasePriceList"
border
height="500"
:summary-method="getSummaries"
:span-method="arraySpanMethod"
show-summary
style="width: 100%; margin-top: 20px">
<el-table-column
prop="run_date"
label="日期"
width="180">
</el-table-column>
<el-table-column
prop="price"
label="售卖价">
<template slot-scope="scope">
<el-input-number v-model="scope.row.price"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="cost"
label="成本价">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cost"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="count"
label="数量">
<template slot-scope="scope">
<el-input-number v-model="scope.row.count" @change="changeNum"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="provider"
label="供应商">
<template slot-scope="scope">
<el-input v-model="scope.row.provider" @change="changeProvider"></el-input>
</template>
</el-table-column>
<el-table-column
prop="note"
label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.note" @change="changeNote"></el-input>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-row>
<el-col :span="6">
<el-form-item label-width="100px" label="对方订单号">
<el-input v-model="dataObj.trade_order_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="100px" label="资源负责人">
<span>{{dataObj.res_person}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<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>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label-width="100px" label="附加项目说明">
<span>{{dataObj.item_memo}}</span>
</el-form-item>
</el-col>
</el-row>
</template>
</el-form>


</template>
@@ -264,51 +264,64 @@

export default {
name: "hotelother",
props: {dataObj: Object},
props: {type: String, saleCount: Number, dataObj: Object},
data() {
return {type: window.type,date: [], day: []}
return {confirm_status: '未发单', check_in_date: '', day: []}
},
watch: {
date(val) {
console.log(val)
this.$set(this.dataObj, "check_in_date", val[0])
this.$set(this.dataObj, "check_out_date", val[1])
let date1 = new Date(val[0]);
let date2 = new Date(val[1]);
let day = this.getAllDateCN(date1, date2)
let tableData = [];
for (let item of day) {
tableData.push({
run_date: item,
price: '',
cost: '',
count: '',
note: '',
provider: ''
})
confirm_status(val) {
let type = '';
switch (val) {
case "未发单":
type = '1'
break;
case "已发单":
type = '2'
break;
case "已确认":
type = '3'
break;
case "已取消":
type = '4'
break;
}
this.dataObj.tableData = tableData;
this.$set(this.dataObj, 'tableData', tableData)
this.$set(this.dataObj, "confirm_status", type)
},
check_in_date(val) {
let time = this.getAllDateCN(val)
console.log(time)
this.$set(this.dataObj, "check_in_date", time)
let purchasePriceList = [];
purchasePriceList.push({
run_date: time,
price: '',
cost: '',
count: '',
note: '',
provider: ''
})
this.dataObj.purchasePriceList = purchasePriceList;
this.$set(this.dataObj, 'purchasePriceList', purchasePriceList)
}
},
methods: {
changeNum(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'count', value)
})
}
},
changeProvider(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'provider', value)
})
}
},
changeNote(value) {
if (this.type == 'add') {
this.dataObj.tableData.forEach((item) => {
this.dataObj.purchasePriceList.forEach((item) => {
this.$set(item, 'note', value)
})
}
@@ -316,26 +329,21 @@
arraySpanMethod({row, column, rowIndex, columnIndex}) {
// console.log({row, column, rowIndex, columnIndex})
if (columnIndex === 3) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else if (columnIndex === 4) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else if (columnIndex === 5) {
return [this.dataObj.tableData.length, 1];
return [this.dataObj.purchasePriceList.length, 1];
} else {
return [1, 1];
}
},
getAllDateCN(startTime, endTime) {
var date_all = []
var i = 0
while ((endTime.getTime() - startTime.getTime()) > 0) {
var year = startTime.getFullYear()
var month = startTime.getMonth() + 1
var day = startTime.getDate()
date_all[i] = year + '-' + month + '-' + day
startTime.setDate(startTime.getDate() + 1)
i += 1
}
getAllDateCN(Time) {
let date_all = ''
let year = Time.getFullYear()
let month = Time.getMonth() + 1
let day = Time.getDate()
date_all = year + '-' + month + '-' + day
return date_all
},
getSummaries(param) {
@@ -354,7 +362,7 @@
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]));
let sum = data.map(item => (Number(item[columns[1].property]) * this.saleCount - 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);


+ 2
- 1
src/main.js View File

@@ -2,6 +2,7 @@
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import lo from 'lodash'
import {
// Pagination,
// Dialog,
@@ -166,7 +167,7 @@ Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;
Vue.config.productionTip = false
Vue.prototype.$lo = lo
/* eslint-disable no-new */
new Vue({
el: '#app',


Loading…
Cancel
Save