| | |
| | | :data="opticalProject" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | @row-click="rowClickOptical" |
| | | @select="selectOpticalProject" |
| | | @select-all="selectAllOptical" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | style="width: 100%"> |
| | | <el-table-column prop="date" label="温度点(℃)" width="120px"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="small" v-model="scope.row.temperaturePoint" clearable placeholder="请输入"></el-input> |
| | | <el-input size="small" v-model="scope.row.temperaturePoint" clearable placeholder="请输入" @change="changeTemperature"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="要求(dB/Km)"> |
| | | <template slot-scope="scope"> |
| | | <span>x</span> |
| | | <el-select v-model="scope.row.askSymbol" placeholder="请选择" size="small" style="width: 120px"> |
| | | <el-select v-model="scope.row.askSymbol" placeholder="请选择" size="small" style="width: 120px" @change="changeTemperature"> |
| | | <el-option v-for="item in temperatureDataList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input size="small" v-model="scope.row.askNum" clearable placeholder="请输入" style="width: 120px"></el-input> |
| | | <el-input size="small" v-model="scope.row.askNum" clearable placeholder="请输入" style="width: 120px" @change="changeTemperature"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | this.$message.error('请填写完整数据') |
| | | return |
| | | } |
| | | |
| | | // 拼接要求值ask |
| | | const opticalProjectList = JSON.parse(JSON.stringify(this.opticalProjectList)) |
| | | opticalProjectList.forEach(o => { |
| | | o.temperatureData.forEach(t => { |
| | | if (!t.temperaturePoint || !t.askSymbol || !t.askNum) { |
| | | throw this.$message.error('请填写完整数据') |
| | | } |
| | | }) |
| | | }) |
| | | let entrustTime = this.circulateForm.entrustTime |
| | | let entrustNum = this.circulateForm.entrustNum |
| | | let temperaturePoint1 = JSON.parse(JSON.stringify(this.temperatureData)) |
| | | temperaturePoint1.forEach(t => { |
| | | if (!t.temperaturePoint || !t.askSymbol || !t.askNum) { |
| | | throw this.$message.error('请填写完整数据') |
| | | } |
| | | }) |
| | | let temperaturePoint = JSON.parse(JSON.stringify(this.temperatureData)) |
| | | temperaturePoint.unshift({temperaturePoint: 20}) |
| | | let opticalProjectList2 = JSON.parse(JSON.stringify(this.opticalProjectList)) |
| | | let askArr = [] |
| | | let opticalProjectArr = [] |
| | | // 拼接要求值ask |
| | | opticalProjectList.forEach(o => { |
| | | opticalProjectArr.push(o.value) |
| | | temperaturePoint.forEach(t => { |
| | | o.temperatureData.unshift({temperaturePoint: 20}) |
| | | o.temperatureData.forEach(t => { |
| | | if (!t.askSymbol) { |
| | | const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + null |
| | | askArr.push(askObj) |
| | | } else { |
| | | const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + t.askSymbol + t.askNum |
| | | askArr.push(askObj) |
| | | } |
| | | const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + null |
| | | askArr.push(askObj) |
| | | } else { |
| | | const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + t.askSymbol + t.askNum |
| | | askArr.push(askObj) |
| | | } |
| | | }) |
| | | }) |
| | | askArr.push(this.circulateForm.entrustNum) |
| | |
| | | let temperaturePointList2 = [] |
| | | entrustTime = entrustTime + 'h' |
| | | entrustNum = entrustNum + '次' |
| | | temperaturePoint.forEach(t => { |
| | | t.temperaturePoint = t.temperaturePoint + '℃' |
| | | temperaturePointList.push(t.temperaturePoint) |
| | | opticalProjectList2.forEach(o => { |
| | | o.temperatureData.forEach(t => { |
| | | t.temperaturePoint = t.temperaturePoint + '℃' |
| | | temperaturePointList2.push(t.temperaturePoint) |
| | | temperaturePointList.push(t.temperaturePoint) |
| | | askNum.push(t.askSymbol + t.askNum + 'dB/Km') |
| | | }) |
| | | }) |
| | | temperaturePoint1.forEach(t => { |
| | | t.temperaturePoint = t.temperaturePoint + '℃' |
| | | askNum.push(t.askSymbol + t.askNum + 'dB/Km') |
| | | temperaturePointList2.push(t.temperaturePoint) |
| | | }) |
| | | temperaturePointList = Array.from(new Set(temperaturePointList)) |
| | | temperaturePointList2 = Array.from(new Set(temperaturePointList2)) |
| | | temperaturePointList2.unshift(20 + '℃') |
| | | let additionArr = [] |
| | | askNum.forEach(a => { |
| | | additionArr.push(temperaturePointList2.join(',') + a) |
| | | additionArr.push(temperaturePointList.join(',') + a) |
| | | }) |
| | | temperaturePointList2.unshift(20 + '℃') |
| | | additionArr = Array.from(new Set(additionArr)) |
| | | const tell = '温度范围:' + temperaturePointList2.join(',') + ';' + '保温时间:' + entrustTime + ';' + '循环次数:' |
| | | + entrustNum + ';' + '光纤(' + opticalProjectArr.join(',') + ')' + '附加衰减绝对值:' + additionArr.join(';') |
| | | this.productList.forEach(item => { |
| | |
| | | handleSelectionChange(val) { |
| | | this.opticalProjectList = val; |
| | | }, |
| | | selectAllOptical (val) { |
| | | if (val.length > 0) { |
| | | if (val[val.length-1].temperatureData) { |
| | | this.temperatureData = this.HaveJson(val.temperatureData) |
| | | } else { |
| | | this.temperatureData = [] |
| | | } |
| | | } else { |
| | | this.temperatureData = [] |
| | | } |
| | | this.circulateForm.entrustPoint = this.temperatureData.length |
| | | }, |
| | | selectOpticalProject (val) { |
| | | if (val.temperatureData) { |
| | | this.temperatureData = this.HaveJson(val.temperatureData) |
| | | } else { |
| | | this.temperatureData = [] |
| | | } |
| | | this.circulateForm.entrustPoint = this.temperatureData.length |
| | | }, |
| | | rowClickOptical (val) { |
| | | const index = this.opticalProjectList.findIndex(item => item.value === val.value) |
| | | if (index > -1 && val.temperatureData) { |
| | | this.temperatureData = this.HaveJson(val.temperatureData) |
| | | } |
| | | this.circulateForm.entrustPoint = this.temperatureData.length |
| | | }, |
| | | changeTemperature () { |
| | | this.opticalProjectList.forEach(item => { |
| | | item.temperatureData = this.HaveJson(this.temperatureData) |
| | | }) |
| | | }, |
| | | addTemperatureData () { |
| | | const obj = {} |
| | | this.temperatureData.push(obj) |
| | | this.circulateForm.entrustPoint = this.temperatureData.length |
| | | }, |
| | | deleteTemperatureData () { |
| | | if (this.temperatureData.length > 0) { |
| | | this.temperatureData = this.temperatureData.slice(0,-1) |
| | | } |
| | | this.circulateForm.entrustPoint = this.temperatureData.length |
| | | }, |
| | | changeTemperatureData () { |
| | | const length = this.temperatureData.length |