Browse Source

资产信息修改处理

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

11
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) {
if (route.query.id != undefined) {
const selectParamsList = $submitTable.getCheckboxRecords(); const selectParamsList = $submitTable.getCheckboxRecords();
console.log(selectParamsList);
const selectParamsListArr = selectParamsList.map((item) => ({ const selectParamsListArr = selectParamsList.map((item) => ({
id: item.id,
paramCode: item.paramCode, paramCode: item.paramCode,
flagEnabled: item.flagEnabled, flagEnabled: item.flagEnabled,
contrlFlag: item.contrlFlag, contrlFlag: item.contrlFlag,
})); }));
formData.paramsForm.assetParamsDtos = selectParamsListArr; formData.paramsForm.assetParamsDtos = selectParamsListArr;
if (route.query.id != undefined) {
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