Browse Source

优化平衡系数表调整中

master
李磊 3 years ago
parent
commit
0e0216cbe4
  1. 16
      src/api/upload.js
  2. 12
      src/service/uploadService.js
  3. 45
      src/views/ysjl/3000/common/index.vue
  4. 15
      src/views/ysjl/3000/dj/common/phxsb.vue

16
src/api/upload.js

@ -0,0 +1,16 @@
import preview from '@/utils/preview'
export default {
/**
* 上传平衡系数Base64图片
* @param data
* @return {AxiosPromise}
*/
uploadPhxsBase64File(data) {
return preview({
url: '/upload/uploadPhxsBase64File',
method: 'post',
data
})
}
}

12
src/service/uploadService.js

@ -0,0 +1,12 @@
import upload from '@/api/upload'
export default {
/**
* 上传平衡系数Base64图片
* @param data
* @return {AxiosPromise}
*/
uploadPhxsBase64File(data) {
return upload.uploadPhxsBase64File(data)
}
}

45
src/views/ysjl/3000/common/index.vue

@ -666,7 +666,7 @@
<Table ref="table2" :tabel-header="arrayGroup[1].header" :table-data.sync="fubiao2" />
</el-tab-pane>
<el-tab-pane v-if="fromType === 1 || fromType === 3" label="附表3" name="six">
<phxsb ref="table3" :table-data.sync="fubiao3" :pic="pic" :ysjl-param.sync="param" />
<phxsb ref="table3" :table-data.sync="fubiao3" :ysjl-param.sync="param" @loadPhxsImage="loadPhxsImage" />
</el-tab-pane>
</template>
</el-tabs>
@ -950,6 +950,13 @@ export default {
this.signNameValue(data)
},
saveYsjl(operation) {
if (operation !== 'add' && this.pic) {
this.uploadPhxsBase64File(operation)
} else {
this.buildSaveData(operation)
}
},
buildSaveData(operation) {
const tableData = []
let fubiao
if (this.fromType === 5) {
@ -975,20 +982,14 @@ export default {
this.save(operation, 'post', tableData, fubiao)
} else if (operation === 'build') {
this.ysjl.baogaobianhao = this.ysjl.jilubianhao
if (
this.ysjl.jilubianhao &&
this.ysjl.jilubianhao.indexOf('COPY') > -1
) {
if (this.ysjl.jilubianhao && this.ysjl.jilubianhao.indexOf('COPY') > -1) {
this.$message({
type: 'error',
message: '请先修改报告编号,不允许携带COPY标志生成报告!'
})
return false
}
if (
this.ysjl.jianyanrenyuan === null ||
this.ysjl.jianyanrenyuan === ''
) {
if (this.ysjl.jianyanrenyuan === null || this.ysjl.jianyanrenyuan === '') {
this.$message({
type: 'error',
message: '请先签名再生成报告!'
@ -997,9 +998,7 @@ export default {
}
for (let i = 0; i < this.bgfyData.length; i++) {
if (!this.bgfyData[i].jianjianyuan || !this.bgfyData[i].querenriqi) {
this.$message.error(
'请将检验项目中的监检人员及监检日期填写完毕,再生成报告!'
)
this.$message.error('请将检验项目中的监检人员及监检日期填写完毕,再生成报告!')
return false
}
}
@ -1008,7 +1007,6 @@ export default {
this.save(operation, 'put', tableData, fubiao)
}
},
save(operation, type, jyxm, fubiao) {
if (this.fromType !== 5) this.ysjl.imagePath = this.$refs.table1.imgPath
@ -1043,6 +1041,7 @@ export default {
this.ysjl.id = data
this.param.ysjlId = data
this.$message({ message: '保存成功', type: 'success' })
this.uploadPhxsBase64File()
//
this.common.reloadViewToUpdateYsjl(this.ysjl)
} else if (operation === 'upd') {
@ -1070,6 +1069,23 @@ export default {
}
},
/**
* 上传平衡系数表
*/
uploadPhxsBase64File(operation) {
if (!this.pic) {
return false
}
this.uploadService.uploadPhxsBase64File({
ysjlId: this.ysjl.id,
base64File: this.pic
}).then(() => {
if (operation !== 'add') {
this.buildSaveData(operation)
}
})
},
/**
* 格式化监检员
*/
@ -1175,6 +1191,9 @@ export default {
},
querySearchGzjz: function(queryString, cb, $index) {
cb([this.dicGzjz[$index]])
},
loadPhxsImage(data) {
this.pic = data
}
}
}

15
src/views/ysjl/3000/dj/common/phxsb.vue

@ -56,10 +56,6 @@ export default {
type: Array,
required: true
},
pic: {
type: String,
required: true
},
ysjlParam: {
type: Object,
required: true
@ -86,7 +82,6 @@ export default {
chart: undefined,
phxsX: [],
phxsY: [],
imgPath: '',
xAxis: ['30', '40', '45', '50', '60'],
chartDataX: [],
chartDataY: []
@ -216,10 +211,12 @@ export default {
]
}
this.chart.setOption(option)
this.imgPath = this.chart.getDataURL({
type: 'png',
pixelRatio: 1,
backgroundColor: '#fff'
this.chart.on('finished', () => {
this.$emit('loadPhxsImage', this.chart.getDataURL({
type: 'png',
pixelRatio: 1,
backgroundColor: '#fff'
}))
})
}
}

Loading…
Cancel
Save