Browse Source

资产信息修改处理

develop^2
fuguobin 8 months ago
parent
commit
ac359a3ced
  1. 23
      src/views/model/asset/addParams.vue

23
src/views/model/asset/addParams.vue

@ -475,19 +475,28 @@ const paramSubmit = async (formEl) => {
if (valid) { if (valid) {
const $submitTable = paramsTableRef.value; const $submitTable = paramsTableRef.value;
if ($submitTable) { if ($submitTable) {
const selectParamsList = $submitTable.getCheckboxRecords();
const selectParamsListArr = selectParamsList.map((item) => ({
paramCode: item.paramCode,
flagEnabled: item.flagEnabled,
contrlFlag: item.contrlFlag,
}));
formData.paramsForm.assetParamsDtos = selectParamsListArr;
if (route.query.id != undefined) { if (route.query.id != undefined) {
const selectParamsList = $submitTable.getCheckboxRecords();
console.log(selectParamsList);
const selectParamsListArr = selectParamsList.map((item) => ({
id: item.id,
paramCode: item.paramCode,
flagEnabled: item.flagEnabled,
contrlFlag: item.contrlFlag,
}));
formData.paramsForm.assetParamsDtos = selectParamsListArr;
updateInfo(formData.paramsForm).then((response) => { updateInfo(formData.paramsForm).then((response) => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
}); });
} else { } else {
const selectParamsList = $submitTable.getCheckboxRecords();
const selectParamsListArr = selectParamsList.map((item) => ({
paramCode: item.paramCode,
flagEnabled: item.flagEnabled,
contrlFlag: item.contrlFlag,
}));
formData.paramsForm.assetParamsDtos = selectParamsListArr;
addInfo(formData.paramsForm).then((response) => { addInfo(formData.paramsForm).then((response) => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;

Loading…
Cancel
Save