|
|
@@ -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); |
|
|
|