|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
<!-- 移动应用程序表单 -->
|
|
|
|
|
<!-- 单位端--我的资产--移动应用程序表单 -->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="L-assets-info">
|
|
|
|
|
<div class="assets-info-top">
|
|
|
|
@ -32,7 +32,7 @@
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="ruleForm.appName"
|
|
|
|
|
placeholder="请输入移动应用名称"
|
|
|
|
|
:disabled="pageType == 'change'"
|
|
|
|
|
:disabled="pageType == 'change' && this.copy === 0"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -357,6 +357,7 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
copy: 0,
|
|
|
|
|
ruleForm: {},
|
|
|
|
|
rules: {
|
|
|
|
|
bfyy: [{ validator: changeSateTetx, trigger: "blur" }],
|
|
|
|
@ -439,6 +440,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
props: ["pageType", "id", "audit", "isModdle", "name", "queryData"],
|
|
|
|
|
mounted() {
|
|
|
|
|
this.copy = Number(this.$route.query.copy) || 0;
|
|
|
|
|
if (this.isModdle) {
|
|
|
|
|
if (this.pageType == "look") {
|
|
|
|
|
this.getInfoTwo(this.id);
|
|
|
|
@ -501,6 +503,10 @@ export default {
|
|
|
|
|
getInfo(id) {
|
|
|
|
|
assetAppInfo(id).then((res) => {
|
|
|
|
|
this.ruleForm = res.data;
|
|
|
|
|
if (this.pageType === "change" && this.copy === 1) {
|
|
|
|
|
this.ruleForm.appName = "";
|
|
|
|
|
this.ruleForm.id = "";
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
|
|
}, 100);
|
|
|
|
@ -509,6 +515,10 @@ export default {
|
|
|
|
|
getInfoTwo(id) {
|
|
|
|
|
AppLookInfo(id).then((res) => {
|
|
|
|
|
this.ruleForm = res.data;
|
|
|
|
|
if (this.pageType === "change" && this.copy === 1) {
|
|
|
|
|
this.ruleForm.appName = "";
|
|
|
|
|
this.ruleForm.id = "";
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
|
|
}, 100);
|
|
|
|
@ -528,32 +538,40 @@ export default {
|
|
|
|
|
cb(results);
|
|
|
|
|
},
|
|
|
|
|
// 新增资产确认按钮
|
|
|
|
|
newAssets() {
|
|
|
|
|
this.$refs["ruleForm"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (this.pageType == "change") {
|
|
|
|
|
assetAppUnitEdit(this.ruleForm).then((res) => {
|
|
|
|
|
// console.log(res,"res");
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$modal.msgSuccess("提交成功,待管理员审核通过后完成修改");
|
|
|
|
|
// this.$router.go(-1);
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.ruleForm.xzType = 1;
|
|
|
|
|
assetApp("post", this.ruleForm).then((res) => {
|
|
|
|
|
// console.log(res,"res");
|
|
|
|
|
this.loading = false;
|
|
|
|
|
// this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.$modal.msgSuccess("提交成功,待管理员审核通过后完成新增");
|
|
|
|
|
newAssets() {
|
|
|
|
|
this.$refs["ruleForm"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 情况 1:新增(add 页面)
|
|
|
|
|
if (this.pageType === "add") {
|
|
|
|
|
this.ruleForm.xzType = 1;
|
|
|
|
|
assetApp("post", this.ruleForm).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$modal.msgSuccess("提交成功,待管理员审核通过后完成新增");
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 情况 2:纯修改(change 页面且 copy=0)
|
|
|
|
|
} else if (this.pageType === "change" && this.copy === 0) {
|
|
|
|
|
assetAppUnitEdit(this.ruleForm).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$modal.msgSuccess("提交成功,待管理员审核通过后完成修改");
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 情况 3:复制新增(change 页面但 copy=1)
|
|
|
|
|
} else if (this.pageType === "change" && this.copy === 1) {
|
|
|
|
|
this.ruleForm.xzType = 1;
|
|
|
|
|
assetApp("post", this.ruleForm).then((res) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$modal.msgSuccess("提交成功,待管理员审核通过后完成新增");
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
sendBack() {
|
|
|
|
|
// this.$router.go(-1);
|
|
|
|
|
this.$router.push({ name: this.name, params: this.queryData });
|
|
|
|
|