Commit 659aed30 authored by zenglun's avatar zenglun

修改部分代码

parent 3aa0e826
<template>
<div class="category-add">
<h2 class="dialog_add-title">创建副本</h2>
<dialog-input
class="dialog_add-form dialog_add-input_name"
v-model="name"
:errorShowing="isErrorShowing"
placeholder="请输入新的存证名称"
/>
<button class="dialog_add-btn_confirm" @click="checkForm">确定</button>
<button class="dialog_add-btn_cancel" @click="closeDialog">取消</button>
</div>
</template>
<script>
import DialogInput from "@/components/DialogInput.vue";
import { GO_URLS } from "@/config/URLS";
export default {
components: {
DialogInput,
},
data() {
return {
isErrorShowing: false,
isInActive: false,
name: "",
};
},
props: ["Copydetails"],
methods: {
// 关闭弹窗
async closeDialog() {
this.$emit("close", {});
},
// 确认按钮
async checkForm() {
if (this.isInActive) return;
this.isInActive = true;
this.isErrorShowing = true;
// 追加非空验证
if (this.name.trim().length === 0) {
this.$message.error("存证名称不可为空");
this.isInActive = false;
return null;
}
let newNote = JSON.parse(this.Copydetails.note);
let newDetail = JSON.parse(this.Copydetails.detail);
newNote.evidenceName = this.name;
for (let index = 0; index < newDetail.length; index++) {
const element = newDetail[index];
if (element.data && element.data.length === 0) {
newDetail.splice(index, 1);
}
if (element.label === "ext") {
element.data[0].data.value = this.name;
}
}
let params = {
note: JSON.stringify(newNote),
detail: JSON.stringify(newDetail),
name: this.name,
};
const res = await this.$ajax({
type: "post",
url: GO_URLS.add,
params: params,
});
if (res) {
this.$message({
message: "创建副本成功",
type: "success",
});
this.closeDialog();
this.$emit("update");
}
this.isInActive = false;
},
},
};
</script>
<style scoped lang="less">
.category-add {
padding: 34px 50px 0 50px;
height: 245px; /* 325px - 34px */
width: 500px; /* 600px - 100px */
}
.dialog_add-title {
margin: 0;
color: #000;
font-size: 22px;
line-height: 30px;
}
.dialog_add-select_subject {
margin-top: 29px;
}
.dialog_add-input_name {
margin: 42px 0 34px 0;
}
.dialog_add-btn_confirm {
float: right;
width: 120px;
height: 40px;
color: #fff;
font-size: 14px;
outline: none;
background: #0CC399;
border-radius: 4px;
border: none;
cursor: pointer;
}
.dialog_add-btn_cancel {
float: right;
margin-right: 18px; /* 28 - 10 */
border: none;
width: 48px; /* 28 + 增大20 */
height: 40px;
outline: none;
background: #fff;
color: #5c6476;
font-size: 14px;
cursor: pointer;
}
</style>
......@@ -123,7 +123,7 @@ import Increments from "../increment/increment.vue"; // 增量
import AddGoods from "@/components/category/addGoods.vue"; // 添加存证
import deleteGoods from "@/components/category/deleteGoods.vue"; // 删除组件
import Uncertified from "@/components/Uncertified.vue"; // 未认证提示组件
import copyGoods from "@/components/newProductList/copyGoods.vue";
import copyGoods from "../../components/copyGoods/copyGoods.vue";
import prompt from "../prompt/prompt.vue";
export default {
......
......@@ -191,11 +191,11 @@
@cancel="modifyFormsShow = false"
></modify-presentation>
</common-dialog>
<uncertified
<!-- <uncertified
v-if="showUncertified"
@confirm="showUncertified = false"
@cancel="UncertifiedConfirm"
></uncertified>
></uncertified>-->
<common-dialog v-if="ClassificationPopups" @closePopup="ClassificationPopups = false" showMask>
<choose-classification
@successCallback="successCallback"
......@@ -273,7 +273,7 @@ export default class editTemplate extends Vue {
public isShowAddRootDialog: boolean = false;
public displayData: any = [];
public TemplateType: number = 0;
public showUncertified: Boolean = false;
// public showUncertified: Boolean = false;
public ClassificationPopups: boolean = false;
public MemoryCardType: String = ""; //存证类型
// 系统模板>建立个人模板or建立存证
......@@ -691,6 +691,7 @@ export default class editTemplate extends Vue {
}
});
if (res) {
this.personalTemplateId = res.data.id;
this.$message({
message: "创建成功",
type: "success"
......@@ -833,21 +834,21 @@ export default class editTemplate extends Vue {
this.isInActive = false;
}
// 上链
async UpperChain() {
const res = await this.$ajax({
type: "get",
url:
GO_URLS.user +
`/` +
JSON.parse(String(sessionStorage.getItem("user"))).id
});
if (res) {
if (res.data.auth_suc === 1) {
UpperChain() {
// const res = await this.$ajax({
// type: "get",
// url:
// GO_URLS.user +
// `/` +
// JSON.parse(String(sessionStorage.getItem("user"))).id
// });
// if (res) {
// if (res.data.auth_suc === 1) {
this.isShowToChainDialog = true;
} else {
this.showUncertified = true;
}
}
// } else {
// this.showUncertified = true;
// }
// }
}
// 跳转个人中心
UncertifiedConfirm() {
......@@ -1281,7 +1282,7 @@ export default class editTemplate extends Vue {
width: 17px;
height: 69px;
line-height: 69px;
background: #0CC399;
background: #0cc399;
border-radius: 7px 0 0 7px;
cursor: pointer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment