代码更新
This commit is contained in:
@@ -292,6 +292,9 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject queryMaterialParam(String material_id) {
|
||||
MaterialbaseDto materDto = materialbaseService.findById(Long.valueOf(material_id));
|
||||
|
||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), material_id, null);
|
||||
|
||||
//根据物料类型判断是原辅料还是半成品
|
||||
String material_type_id = materDto.getMaterial_type_id() + "";
|
||||
String flag = "1";
|
||||
@@ -302,6 +305,12 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
|
||||
flag = "2";
|
||||
}
|
||||
JSONObject json = WQL.getWO("QMD_ME_material_param01").addParam("flag", flag).addParam("material_id", material_id).process().uniqueResult(0);
|
||||
|
||||
if (is_pgf) {
|
||||
json.put("is_sync", "0");
|
||||
} else {
|
||||
json.put("is_sync", "1");
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +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-button type="success" icon="el-icon-refresh" v-if="is_sync" :loading="sync_flg" @click="sync">同步</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -324,6 +324,7 @@ export default {
|
||||
return {
|
||||
headers: { 'Authorization': getToken() },
|
||||
formData: {},
|
||||
is_sync: false,
|
||||
material_id: '',
|
||||
file_name: '',
|
||||
dialogUpload: false,
|
||||
@@ -420,6 +421,11 @@ export default {
|
||||
}
|
||||
crudMaterialparameters.queryMaterialParam(param).then(res => {
|
||||
this.formData = res
|
||||
if (this.formData.is_sync === '0') {
|
||||
this.is_sync = false
|
||||
} else {
|
||||
this.is_sync = true
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user