|
@@ -92,8 +92,8 @@
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-upload ref="upload" action="customize" :http-request="uploadFile" :show-file-list="false" multiple :limit="5" style="float:right;">
|
|
|
- <el-dropdown-item @click.native="fileType = 0">2D</el-dropdown-item>
|
|
|
- <el-dropdown-item @click.native="fileType = 1">3D</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="fileType = 0">2D图档</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="fileType = 1">3D图档</el-dropdown-item>
|
|
|
</el-upload>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
@@ -106,7 +106,16 @@
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item @click.native="centerDialog3Visible = true">单个新建</el-dropdown-item>
|
|
|
- <el-dropdown-item>批量新建</el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-upload ref="upload"
|
|
|
+ action="customize"
|
|
|
+ :http-request="uploadPart"
|
|
|
+ :show-file-list="false"
|
|
|
+ :limit="1"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">批量导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
|
|
@@ -404,18 +413,18 @@
|
|
|
<el-dialog title="编辑模具" v-if="centerDialog3Visible" :visible.sync="centerDialog3Visible" :close-on-click-modal="false" customClass="customWidth">
|
|
|
<el-form :model="newParts" label-width="100px" :rules="formRules" ref="newParts" :inline="true" class="demo-form-inline">
|
|
|
<el-form-item label="零件编号" prop="number">
|
|
|
- <el-input v-model="newParts.number" autocomplete="off" placeholder="请输入模具名称"></el-input>
|
|
|
+ <el-input v-model="newParts.number" autocomplete="off" placeholder="请输入零件编号"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="零件名称" prop="name">
|
|
|
- <el-input v-model="newParts.name" autocomplete="off" placeholder="请输入模具编号"></el-input>
|
|
|
+ <el-input v-model="newParts.name" autocomplete="off" placeholder="请输入零件名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="零件寿命" prop="life">
|
|
|
- <el-input v-model="newParts.life" autocomplete="off" placeholder="请输入初始模次"></el-input>
|
|
|
+ <el-input v-model="newParts.life" autocomplete="off" placeholder="请输入零件寿命"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click.native="centerDialog3Visible = false">取消</el-button>
|
|
|
- <el-button type="primary">提交</el-button>
|
|
|
+ <el-button type="primary" @click.native="subPart" :loading="editLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -612,6 +621,7 @@
|
|
|
this.approve = res.data.approve;
|
|
|
|
|
|
this.getDocument();
|
|
|
+ this.getPartList();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -719,7 +729,7 @@
|
|
|
if(num == 0){
|
|
|
this.documents.mould = array;
|
|
|
} else if(num == 1) {
|
|
|
- this.documents.part = array;
|
|
|
+ //this.documents.part = array;
|
|
|
} else if(num == 2) {
|
|
|
this.documents.check = array;
|
|
|
} else if(num == 3) {
|
|
@@ -867,6 +877,93 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //零件新建
|
|
|
+ subPart() {
|
|
|
+ this.editLoading = true;
|
|
|
+ this.http.post( this.port.mold.moulds, {
|
|
|
+ belongCompanyId: this.user.companyId,
|
|
|
+ mouldId: this.detailId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ this.editLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "新建成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.editLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //零件列表
|
|
|
+ getPartList() {
|
|
|
+ this.http.post( this.port.mold.partList, {
|
|
|
+ mouldId: this.detailId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.documents.part = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //零件导入
|
|
|
+ uploadPart(file) {
|
|
|
+ var fileObj = params.file;
|
|
|
+ var form = new FormData();
|
|
|
+ form.append("file", fileObj);
|
|
|
+ form.append("blongType", this.activeTab);
|
|
|
+ form.append("mouldId", this.detailId);
|
|
|
+ if (this.activeTab == 0 || this.activeTab == 1) {
|
|
|
+ form.append("dwgType", this.fileType);
|
|
|
+ }
|
|
|
+ this.http.uploadFile( this.port.mold.moldFileUpload, form,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "上传成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.getDocument();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
//获取操作记录
|
|
|
getOperationRecord(type) {
|
|
|
this.http.post( this.port.mold.moldOperationList, {
|