Commit 45e2d73c by wangweidong

整体优化

parent 1e18d408
......@@ -67,6 +67,7 @@ export default {
https
.post('meter/v1/sample/add_send_entrust', JSON.stringify(data))
.then(res => res),
addSample: data => http.post('meter/v1/sample/', data).then(res => res),
saveSampleEnv: data =>
http
.put('meter/v1/sample/save_sample_env/' + data.ids, data.obj)
......
......@@ -46,10 +46,7 @@
sortable
>
<template v-slot="{ row }">
<div v-if="item.key === 'name'" :style="{color:colorComputed(row.planEndDate)}">
{{row.name}}
</div>
<div v-else-if="item.date">{{row[item.key]?$dateformat(row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-if="item.date">{{row[item.key]?$dateformat(row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='progress'">{{row[item.key].display}}</div>
<div v-else>{{row[item.key]}}</div>
</template>
......@@ -159,15 +156,6 @@ export default {
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
},
colorComputed() {
return function(val) {
return val - new Date().getTime() > this.detectionDate * 86400000
? '#606266'
: val - new Date().getTime() <= 0
? '#eb6877'
: '#f90'
}
}
},
mounted() {
......
......@@ -47,7 +47,7 @@
* 添加编辑环境检测项目包
*/
import ModalFooter from '../../components/base/modalFooter'
import { meterAptitude } from '../../api'
import { meterAptitude, meterSample } from '../../api'
import EditModal from './go-out-test/EditModal'
export default {
......@@ -72,6 +72,7 @@ export default {
modalTitle: '',
formObj: {
verification: '',
aptitudeId: '',
name: '',
spec: '',
factoryNumber: '',
......@@ -110,12 +111,12 @@ export default {
},
_backData(data) {
this.formObj.name = data.name
this.formObj.aptitudeId = data.id
this.formObj.verification = data.code + data.basis
console.log('返回的数据')
console.log(data)
},
_save: async function(data) {
const result = await meterAptitude.save(data)
console.log(data)
const result = await meterSample.addSample(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
......@@ -149,25 +150,11 @@ export default {
if (this.$string(this.id).isEmpty()) {
// 添加
const saveData = this.formObj
console.log(saveData)
// this._save(saveData)
this._save(saveData)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
// if (this.$string(this.id).isEmpty()) {
// // 添加
// this.$store.dispatch('FoodJudgeBasis/add', data).then(() => {
// this._resultChange('添加成功!')
// })
// } else {
// // 编辑
// this.$store
// .dispatch('FoodJudgeBasis/edit', { id: this.id, obj: data })
// .then(() => {
// this._resultChange('编辑成功!')
// })
// }
} else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!')
......
......@@ -46,10 +46,7 @@
sortable
>
<template v-slot="{ row }">
<div v-if="item.key === 'name'" :style="{color:colorComputed(row.planEndDate)}">
{{row.name}}
</div>
<div v-else-if="item.date">{{row[item.key]?$dateformat(row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-if="item.date">{{row[item.key]?$dateformat(row[item.key],'yyyy-mm-dd'):''}}</div>
<div v-else-if="item.key==='progress'">{{row[item.key].display}}</div>
<div v-else>{{row[item.key]}}</div>
</template>
......@@ -166,15 +163,6 @@ export default {
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
},
colorComputed() {
return function(val) {
return val - new Date().getTime() > this.detectionDate * 86400000
? '#606266'
: val - new Date().getTime() <= 0
? '#eb6877'
: '#f90'
}
}
},
mounted() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment