|
|
@@ -22,9 +22,16 @@
|
|
|
<div class="inputStopDate" v-if="planDateList.length">
|
|
|
<template v-for="(item, index) in planDateList">
|
|
|
<div :key="'inputStopDate_' + index" class="dateTimeDiv">
|
|
|
- <div class="itemTitle" @click="changeTab(item)">施工计划开始时间</div>
|
|
|
- <el-date-picker v-model="item.value" type="date" placeholder="请选择时间"></el-date-picker>
|
|
|
- <div class="removeDiv" @click="removePlanDate(index)">
|
|
|
+ <div class="itemTitle" v-if="index" @click="changeTab(item)">施工调整开始时间</div>
|
|
|
+ <div class="itemTitle" v-else @click="changeTab(item)">施工计划开始时间</div>
|
|
|
+ <el-date-picker
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ v-model="item.value"
|
|
|
+ type="date"
|
|
|
+ placeholder="请选择时间"
|
|
|
+ ></el-date-picker>
|
|
|
+ <div class="removeDiv" @click="removePlanDate(index)" v-if="index">
|
|
|
<i class="removeDate el-icon-remove-outline" style="color: #78b6e7"></i>
|
|
|
</div>
|
|
|
<div class="addFileDiv">
|
|
|
@@ -59,9 +66,12 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
//施工计划时间段
|
|
|
- planDateList: [],
|
|
|
- tableData: [
|
|
|
- ]
|
|
|
+ planDateList: [
|
|
|
+ {
|
|
|
+ value: ''
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableData: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -69,11 +79,29 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ updateFile(f,item, k) {
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append('file', f)
|
|
|
+ formData.append('name', k ? 'construction_data_2' : 'construction_data_1')
|
|
|
+ fetch('http://127.0.0.1:8000/upload-file', {
|
|
|
+ method: 'POST',
|
|
|
+ body: formData
|
|
|
+ })
|
|
|
+ .then((response) => response.json())
|
|
|
+ .then((r) => {
|
|
|
+ if(r && r.code == 1){
|
|
|
+ this.$message.success(k ? '施工调整表格数据上传成功!' : '施工计划表格数据上传成功!')
|
|
|
+ item.file = r.result;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
handleFileChange(event, item, index) {
|
|
|
console.log(event, item)
|
|
|
this.resetState()
|
|
|
const file = event.target.files[0]
|
|
|
if (!file) return
|
|
|
+ this.updateFile(file, item, index);
|
|
|
this.fileName = file.name
|
|
|
this.isLoading = true
|
|
|
const reader = new FileReader()
|
|
|
@@ -117,7 +145,7 @@ export default {
|
|
|
}
|
|
|
item.table = data
|
|
|
if (!index) {
|
|
|
- this.tableData = this.transformData(data);
|
|
|
+ this.tableData = this.transformData(data)
|
|
|
}
|
|
|
console.log('data', data)
|
|
|
} catch (err) {
|
|
|
@@ -136,10 +164,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- changeTab(i){
|
|
|
- if(i.table){
|
|
|
- this.tableData = this.transformData(i.table);
|
|
|
- }
|
|
|
+ changeTab(i) {
|
|
|
+ if (i.table) {
|
|
|
+ this.tableData = this.transformData(i.table)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
resetState() {
|
|
|
@@ -153,20 +181,24 @@ export default {
|
|
|
*添加时间段
|
|
|
*/
|
|
|
addPlanDate() {
|
|
|
- const item = {
|
|
|
- value: ''
|
|
|
+ if (this.planDateList.length < 2) {
|
|
|
+ const item = {
|
|
|
+ value: ''
|
|
|
+ }
|
|
|
+ this.planDateList.push(item)
|
|
|
}
|
|
|
- this.planDateList.push(item)
|
|
|
},
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
*删除时间段
|
|
|
*/
|
|
|
removePlanDate(index) {
|
|
|
- if (index == -1) {
|
|
|
- this.planDateList = []
|
|
|
- } else {
|
|
|
- this.planDateList.splice(index, 1)
|
|
|
+ if (this.planDateList.length > 1) {
|
|
|
+ if (index == -1) {
|
|
|
+ this.planDateList = []
|
|
|
+ } else {
|
|
|
+ this.planDateList.splice(index, 1)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -189,14 +221,14 @@ export default {
|
|
|
.dateTimeDiv .el-date-editor .el-input__prefix .el-input__icon {
|
|
|
line-height: 30px;
|
|
|
}
|
|
|
-.tableBoxRight .el-table th.el-table__cell > .cell{
|
|
|
- background: rgba(43 ,167 ,255,0.16);;
|
|
|
- color: #2BA7FF;
|
|
|
+.tableBoxRight .el-table th.el-table__cell > .cell {
|
|
|
+ background: rgba(43, 167, 255, 0.16);
|
|
|
+ color: #2ba7ff;
|
|
|
}
|
|
|
</style>
|
|
|
<style lang='scss' scoped>
|
|
|
-.tableBox{
|
|
|
- margin-top: 20px;
|
|
|
+.tableBox {
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
|
.removeDiv,
|
|
|
.addFileDiv {
|
|
|
@@ -270,7 +302,7 @@ export default {
|
|
|
height: calc(100% - 1.57292rem - 105px);
|
|
|
width: 2.083333rem /* 400/192 */;
|
|
|
color: #eee;
|
|
|
- overflow: hidden;
|
|
|
+ overflow: hidden;
|
|
|
background: linear-gradient(0deg, rgba(14, 167, 255, 0.24) 0%, rgba(14, 167, 255, 0.05) 100%);
|
|
|
.head {
|
|
|
height: 0.166667rem /* 32/192 */;
|