|
@@ -85,18 +85,23 @@
|
|
|
文档资料
|
|
|
|
|
|
<!-- 上传 模具0 零件1 时 -->
|
|
|
- <el-dropdown trigger="click" style="float:right;" v-show="(activeTab == 0 || activeTab == 1) && update == 1">
|
|
|
+ <el-dropdown trigger="click" style="float:right;" v-show="activeTab == 0 && update == 1">
|
|
|
<el-button size="small" type="primary">
|
|
|
上传
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</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>
|
|
|
+
|
|
|
+ <!-- 上传 模具0 零件1 时 -->
|
|
|
+ <el-button size="small" type="primary" style="float:right;" v-show="activeTab == 1 && update == 1" @click.native="fileType = 0;centerDialog4Visible = true;">
|
|
|
+ 上传
|
|
|
+ </el-button>
|
|
|
|
|
|
<!-- 零件1 新建零件 -->
|
|
|
<el-dropdown trigger="click" style="float:right; margin-right: 10px;" v-show=" activeTab == 1 && update == 1">
|
|
@@ -113,7 +118,7 @@
|
|
|
:show-file-list="false"
|
|
|
:limit="1"
|
|
|
>
|
|
|
- <el-button size="small" type="primary">批量导入</el-button>
|
|
|
+ 批量导入
|
|
|
</el-upload>
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
@@ -187,27 +192,29 @@
|
|
|
<el-tab-pane label="零件文档" name="1">
|
|
|
|
|
|
<el-table
|
|
|
- :data="documents.part"
|
|
|
- highlight-current-row
|
|
|
- v-loading="listLoading"
|
|
|
- style="width: 100%;"
|
|
|
+ :data="documents.part"
|
|
|
+ highlight-current-row
|
|
|
+ v-loading="listLoading"
|
|
|
+ style="width: 100%;"
|
|
|
>
|
|
|
<el-table-column type="index" width="40"></el-table-column>
|
|
|
- <el-table-column label="零件编号" width="200" sortable></el-table-column>
|
|
|
- <el-table-column prop="fileName" label="零件名称" sortable></el-table-column>
|
|
|
- <el-table-column label="寿命次数" width="100" sortable></el-table-column>
|
|
|
- <el-table-column label="易损件" width="100" sortable></el-table-column>
|
|
|
- <el-table-column prop="fileSize" label="大小" width="200" sortable></el-table-column>
|
|
|
- <el-table-column prop="uploadtor" label="上传者" width="200" sortable></el-table-column>
|
|
|
+ <el-table-column prop="partNo" label="零件编号" width="150" sortable></el-table-column>
|
|
|
+ <el-table-column prop="partName" label="零件名称" sortable></el-table-column>
|
|
|
+ <el-table-column prop="partLife" label="寿命次数" width="100" sortable></el-table-column>
|
|
|
+ <el-table-column prop="isVulnerable" label="易损件" width="100" sortable>
|
|
|
+ <template slot-scope="scope">{{scope.row.isVulnerable==0?'否':'是'}}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="part3dFile" label="3D图档" width="200" sortable></el-table-column>
|
|
|
+ <el-table-column prop="part2dFile" label="2D图档" width="200" sortable></el-table-column>
|
|
|
<el-table-column prop="indate" label="上传时间" width="200" sortable></el-table-column>
|
|
|
<el-table-column label="状态" width="120" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.state == -2">生产方审核不通过</span>
|
|
|
- <span v-else-if="scope.row.state == -1">资产方审核不通过</span>
|
|
|
- <span v-else-if="scope.row.state == 0">待双方审核</span>
|
|
|
- <span v-else-if="scope.row.state == 1">待生产方审核</span>
|
|
|
- <span v-else-if="scope.row.state == 2">待资产方审核</span>
|
|
|
- <span v-else-if="scope.row.state == 3">审核通过</span>
|
|
|
+ <span v-if="scope.row.state == -2">生产方审核不通过</span>
|
|
|
+ <span v-else-if="scope.row.state == -1">资产方审核不通过</span>
|
|
|
+ <span v-else-if="scope.row.state == 0">待双方审核</span>
|
|
|
+ <span v-else-if="scope.row.state == 1">待生产方审核</span>
|
|
|
+ <span v-else-if="scope.row.state == 2">待资产方审核</span>
|
|
|
+ <span v-else-if="scope.row.state == 3">审核通过</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="200" sortable>
|
|
@@ -215,9 +222,12 @@
|
|
|
<el-button size="small"
|
|
|
v-if="approve == 1 && (scope.row.state == 0 || (scope.row.state == 1 && user.subordinateType == 1) || (scope.row.state == 2 && user.subordinateType == 0))"
|
|
|
@click="checkOpen(scope.row.id, scope.row.fileName)">审批</el-button>
|
|
|
- <a :href="scope.row.fileUrl" :download="scope.row.fileName" v-if="download == 1 && scope.row.state == 3">
|
|
|
- <el-button size="small" @click="dowloadfile(scope.row.id)">下载</el-button>
|
|
|
- </a>
|
|
|
+ <el-button size="small" @click="dowloadfile(scope.row.id)" v-if="download == 1 && scope.row.state == 3">
|
|
|
+ 修改
|
|
|
+ </el-button>
|
|
|
+ <el-button size="small" @click="dowloadfile(scope.row.id)" v-if="download == 1 && scope.row.state == 3">
|
|
|
+ <a :href="scope.row.fileUrl" :download="scope.row.fileName">下载 </a>
|
|
|
+ </el-button>
|
|
|
<el-button size="small"
|
|
|
v-if="scope.row.uplodtorId == user.id && scope.row.state <= 0"
|
|
|
@click="deleteFile(scope.row.id)" type="danger">删除</el-button>
|
|
@@ -409,6 +419,17 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 零件文档上传弹窗 -->
|
|
|
+ <el-dialog title="零件文档上传" v-if="centerDialog4Visible" :visible.sync="centerDialog4Visible" width="30%" :before-close="clearFileRecord" center>
|
|
|
+ <p style="color:#ccc;">文件命名规则:零件编号+2D/3D 如 LJ001+2D.dwg</p>
|
|
|
+ <el-upload ref="upload4" action="uploadFile" :http-request="uploadPartFile" :show-file-list="true" :before-remove="beforeRemove" multiple>
|
|
|
+ <el-button size="small" type="primary">上传</el-button>
|
|
|
+ </el-upload>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="uploadFilePart">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 单个新增零件弹窗 -->
|
|
|
<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">
|
|
@@ -534,6 +555,7 @@
|
|
|
centerDialogVisible: false, //审批界面
|
|
|
centerDialog2Visible: false, //模具界面
|
|
|
centerDialog3Visible: false, //创建零件界面
|
|
|
+ centerDialog4Visible: false, //零件文档上传界面
|
|
|
|
|
|
listLoading: false,
|
|
|
activeTab: 0,
|
|
@@ -554,7 +576,9 @@
|
|
|
rfid: "",
|
|
|
produceCompanyId: "",
|
|
|
flag: 1
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ files: new FormData()
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -751,8 +775,10 @@
|
|
|
//清理报废文档上传窗口中的文件
|
|
|
clearFileRecord() {
|
|
|
this.centerDialog2Visible = false;
|
|
|
+ this.centerDialog4Visible = false;
|
|
|
this.$refs.upload1.clearFiles();
|
|
|
this.$refs.upload2.clearFiles();
|
|
|
+ this.$refs.upload4.clearFiles();
|
|
|
},
|
|
|
|
|
|
//审批文件
|
|
@@ -930,16 +956,60 @@
|
|
|
},
|
|
|
|
|
|
//零件导入
|
|
|
- uploadPart(file) {
|
|
|
+ uploadPart(params) {
|
|
|
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.importPart, form,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "上传成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.getPartList();
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //零件文档批量
|
|
|
+ beforeRemove(params) {
|
|
|
+ for(var i in this.files){
|
|
|
+ if(this.files[i].uid == params.uid) {
|
|
|
+ this.files.splice(i , 1);
|
|
|
+ }
|
|
|
}
|
|
|
- this.http.uploadFile( this.port.mold.moldFileUpload, form,
|
|
|
+ },
|
|
|
+
|
|
|
+ uploadPartFile(params) {
|
|
|
+ //this.files.push(params.file)
|
|
|
+ this.files.append("file", params.file);
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ uploadFilePart() {
|
|
|
+ // var fileObj = this.files;
|
|
|
+ // var form = new FormData();
|
|
|
+ // for(var i in fileObj){
|
|
|
+ // console.log(fileObj[i])
|
|
|
+ // form.append("file", fileObj[i]);
|
|
|
+ // }
|
|
|
+ var form = this.files;
|
|
|
+ form.append("mouldId", this.detailId);
|
|
|
+ this.http.uploadFile( this.port.mold.partUpload, form,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.$message({
|
|
@@ -947,7 +1017,7 @@
|
|
|
type: "success"
|
|
|
});
|
|
|
this.$refs.upload.clearFiles();
|
|
|
- this.getDocument();
|
|
|
+ this.getPartList();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|