|
@@ -86,7 +86,7 @@
|
|
|
|
|
|
<!-- 上传 模具0 时 -->
|
|
|
<el-dropdown trigger="click" style="float: right;" v-show="activeTab == 0 && update == 1">
|
|
|
- <el-button size="mini" type="primary" :loading="uploading[0]">
|
|
|
+ <el-button size="mini" type="primary" :loading="uploading">
|
|
|
上传
|
|
|
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
@@ -112,7 +112,12 @@
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item @click.native="centerDialog3Visible = true">单个新建</el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
|
- <el-upload ref="upload" action="customize" :http-request="uploadPart" :show-file-list="false" :limit="1">
|
|
|
+ <a class="download" href="/upload/零件信息导入模板示例.xlsx" download="零件信息导入模板示例.xlsx">
|
|
|
+ 下载模板
|
|
|
+ </a>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-upload ref="upload" action="customize" :http-request="uploadPart" :show-file-list="false" :limit="1">
|
|
|
批量导入
|
|
|
</el-upload>
|
|
|
</el-dropdown-item>
|
|
@@ -129,7 +134,7 @@
|
|
|
:limit="5"
|
|
|
style="float:right;"
|
|
|
>
|
|
|
- <el-button size="mini" type="primary" :loading="uploading[1]">上传</el-button>
|
|
|
+ <el-button size="mini" type="primary" :loading="uploading">上传</el-button>
|
|
|
</el-upload>
|
|
|
|
|
|
<!-- 更新4 -->
|
|
@@ -370,6 +375,7 @@
|
|
|
<a v-if="download == 1 && scope.row.state == 3" :href="scope.row.fileUrl" :download="scope.row.fileName" @click="dowloadfile(scope.row.id)">
|
|
|
{{scope.row.fileName}}
|
|
|
</a>
|
|
|
+ <span v-else>{{scope.row.fileName}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="fileSize" label="申请单大小" width="130" sortable></el-table-column>
|
|
@@ -378,6 +384,7 @@
|
|
|
<a v-if="download == 1 && scope.row.state == 3" :href="scope.row.fileUrl2" :download="scope.row.fileName2" @click="dowloadfile(scope.row.id)">
|
|
|
{{scope.row.fileName2}}
|
|
|
</a>
|
|
|
+ <span v-else>{{scope.row.fileName2}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="fileSize2" label="报废单大小" width="130" sortable></el-table-column>
|
|
@@ -446,7 +453,7 @@
|
|
|
<div v-if="this.activeFileName != null">
|
|
|
申请单:<a :href="this.fileUrl" :download="this.activeFileName"><el-link type="primary">{{this.activeFileName}}</el-link></a>
|
|
|
</div>
|
|
|
- </br>
|
|
|
+ <br>
|
|
|
<div v-if="this.fileUrl2 != null">
|
|
|
报废单:<a :href="this.fileUrl2" :download="this.fileUrl2Name"><el-link type="primary">{{this.fileUrl2Name}}</el-link></a>
|
|
|
</div>
|
|
@@ -455,7 +462,7 @@
|
|
|
<div v-if="this.part2dFile != null">
|
|
|
2D:<a :href="this.part2dFile.fileUrl" :download="this.part2dFile.fileName"><el-link type="primary">{{this.part2dFile.fileName}}</el-link></a>
|
|
|
</div>
|
|
|
- </br>
|
|
|
+ <br>
|
|
|
<div v-if="this.part2dFile != null">
|
|
|
3D:<a :href="this.part3dFile.fileUrl" :download="this.part3dFile.fileName"><el-link type="primary">{{this.part3dFile.fileName}}</el-link></a>
|
|
|
</div>
|
|
@@ -481,7 +488,7 @@
|
|
|
</el-upload>
|
|
|
</p>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="discardUpload" :loading="uploading[3]">确定</el-button>
|
|
|
+ <el-button @click="discardUpload" :loading="uploading">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -489,10 +496,10 @@
|
|
|
<el-dialog title="零件文档上传" v-if="centerDialog4Visible" :visible.sync="centerDialog4Visible" width="450px" :before-close="clearFileRecord2">
|
|
|
<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" :loading="uploading[2]">上传</el-button>
|
|
|
+ <el-button size="small" type="primary" :loading="uploading">上传</el-button>
|
|
|
</el-upload>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="uploadFilePart">确定</el-button>
|
|
|
+ <el-button @click="uploadFilePart" :loading="uploading">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -581,6 +588,21 @@
|
|
|
import util from "../../common/js/util";
|
|
|
export default {
|
|
|
data() {
|
|
|
+ const checkLife = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ return callback(new Error('请输入零件寿命次数'));
|
|
|
+ } else {
|
|
|
+ if((/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(value) == false){
|
|
|
+ callback(new Error("请填写大于0的数字"));
|
|
|
+ }else{
|
|
|
+ if (value > 100000000) {
|
|
|
+ callback(new Error("请填写小于等于1亿的数字"));
|
|
|
+ }else{
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
detailId: this.$route.params.id,
|
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
@@ -595,7 +617,7 @@
|
|
|
name: "",
|
|
|
life: ""
|
|
|
},
|
|
|
- uploading:[false, false, false, false],
|
|
|
+ uploading: false,
|
|
|
editParts: {
|
|
|
id: 0,
|
|
|
number: "",
|
|
@@ -629,7 +651,8 @@
|
|
|
{ required: true, message: "请输入零件名称", trigger: "blur" }
|
|
|
],
|
|
|
life: [
|
|
|
- { required: true, message: "请输入零件寿命次数", trigger: "blur" }
|
|
|
+ // { required: true, message: "请输入零件寿命次数", trigger: "blur" }
|
|
|
+ { required: true, validator: checkLife, trigger: 'blur'}
|
|
|
],
|
|
|
},
|
|
|
|
|
@@ -1081,6 +1104,7 @@
|
|
|
|
|
|
//文件上传
|
|
|
uploadFile(params) {
|
|
|
+ this.uploading = true;
|
|
|
var fileObj = params.file;
|
|
|
var form = new FormData();
|
|
|
form.append("file", fileObj);
|
|
@@ -1104,12 +1128,14 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
}
|
|
|
+ this.uploading = false;
|
|
|
},
|
|
|
error => {
|
|
|
this.$message({
|
|
|
message: error,
|
|
|
type: "error"
|
|
|
});
|
|
|
+ this.uploading = false;
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -1232,7 +1258,7 @@
|
|
|
if (res.code == "ok") {
|
|
|
this.editPortVisible = false;
|
|
|
this.$message({
|
|
|
- message: "新建成功",
|
|
|
+ message: "修改成功",
|
|
|
type: "success"
|
|
|
});
|
|
|
this.getPartList();
|
|
@@ -1329,6 +1355,7 @@
|
|
|
},
|
|
|
|
|
|
uploadFilePart() {
|
|
|
+ this.uploading = true;
|
|
|
var fileObj = this.files;
|
|
|
var form = new FormData();
|
|
|
for(var i in fileObj){
|
|
@@ -1351,6 +1378,7 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
}
|
|
|
+ this.uploading = false;
|
|
|
},
|
|
|
error => {
|
|
|
this.centerDialog4Visible = false;
|
|
@@ -1358,12 +1386,14 @@
|
|
|
message: error,
|
|
|
type: "error"
|
|
|
});
|
|
|
+ this.uploading = false;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//报废文件上传
|
|
|
discardUpload() {
|
|
|
if (this.files2[0] != null && this.files2[1] != null) {
|
|
|
+ this.uploading = true;
|
|
|
var form = new FormData();
|
|
|
form.append("file", this.files2[0]);
|
|
|
form.append("file2", this.files2[1]);
|
|
@@ -1388,12 +1418,14 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
}
|
|
|
+ this.uploading = false;
|
|
|
},
|
|
|
error => {
|
|
|
this.$message({
|
|
|
message: error,
|
|
|
type: "error"
|
|
|
});
|
|
|
+ this.uploading = false;
|
|
|
});
|
|
|
} else {
|
|
|
console.log(this.files2);
|
|
@@ -1612,6 +1644,10 @@
|
|
|
text-decoration: none;
|
|
|
}
|
|
|
|
|
|
+ a.download {
|
|
|
+ color:#20a0ff;
|
|
|
+ }
|
|
|
+
|
|
|
.toolbar .el-form-item {
|
|
|
font-size: 14px;
|
|
|
vertical-align: middle;
|