代码更新
This commit is contained in:
@@ -55,4 +55,12 @@ export function getSeries() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, save, queryMaterialParam, getUploadTemplate, getSeries }
|
||||
export function sync(data) {
|
||||
return request({
|
||||
url: 'api/MaterialParameters/sync',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, save, queryMaterialParam, getUploadTemplate, getSeries, sync }
|
||||
|
||||
@@ -214,6 +214,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="碳平衡" prop="c_balance">
|
||||
<el-input-number :precision="3" :step="0.001" :max="100" v-model="formData.c_balance" :controls="false" placeholder="%" style="width: 200px;"/>
|
||||
<el-button type="success" icon="el-icon-refresh" :loading="sync_flg" @click="sync">同步</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -328,6 +329,7 @@ export default {
|
||||
dialogUpload: false,
|
||||
PicDialog: false,
|
||||
serieseList: [],
|
||||
sync_flg: false,
|
||||
prules: {
|
||||
is_auto_open: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
@@ -471,6 +473,22 @@ export default {
|
||||
},
|
||||
submitUpload() {
|
||||
const flag = this.$refs.upload.submit()
|
||||
},
|
||||
sync() {
|
||||
const data = this.formData
|
||||
this.sync_flg = true
|
||||
crudMaterialparameters.sync(data).then(res => {
|
||||
debugger
|
||||
if (res.c_balance === '') {
|
||||
this.crud.notify('同步成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
} else {
|
||||
this.formData.c_balance = res.c_balance
|
||||
this.crud.notify('同步成功,请确认', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}
|
||||
this.sync_flg = false
|
||||
}).catch(() => {
|
||||
this.sync_flg = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user