|
@@ -365,8 +365,7 @@
|
|
this.$api.customer.simpleAll().then(res => {
|
|
this.$api.customer.simpleAll().then(res => {
|
|
this.customerOptions = res.data
|
|
this.customerOptions = res.data
|
|
})
|
|
})
|
|
- },
|
|
|
|
- handleAttachmentPreview(file){
|
|
|
|
|
|
+ }, handleAttachmentPreview(file){
|
|
window.open(file.url)
|
|
window.open(file.url)
|
|
},
|
|
},
|
|
handleExceed(files, fileList) {
|
|
handleExceed(files, fileList) {
|
|
@@ -375,9 +374,7 @@
|
|
// 上传
|
|
// 上传
|
|
changeres(res, file) {
|
|
changeres(res, file) {
|
|
if (res.code === 200){
|
|
if (res.code === 200){
|
|
- const date = new Date();
|
|
|
|
this.postForm.contractUrl = res.data.url;
|
|
this.postForm.contractUrl = res.data.url;
|
|
- this.postForm.uploadDate = date.getFullYear() + "-" + (this.getZero(date.getMonth() + 1)) + "-" + this.getZero((date.getDate()));
|
|
|
|
const arr = res.data.url.split("-");
|
|
const arr = res.data.url.split("-");
|
|
this.contractName = arr[1];
|
|
this.contractName = arr[1];
|
|
}else {
|
|
}else {
|
|
@@ -405,6 +402,13 @@
|
|
}
|
|
}
|
|
this.postForm.oaNo = null;
|
|
this.postForm.oaNo = null;
|
|
},
|
|
},
|
|
|
|
+ getZero(num) {
|
|
|
|
+ // 单数前面加0
|
|
|
|
+ if (parseInt(num) < 10) {
|
|
|
|
+ num = '0' + num;
|
|
|
|
+ }
|
|
|
|
+ return num;
|
|
|
|
+ },
|
|
getAllUser() {
|
|
getAllUser() {
|
|
const that = this;
|
|
const that = this;
|
|
that.$api.user.simpleAll().then(data => {
|
|
that.$api.user.simpleAll().then(data => {
|
|
@@ -454,6 +458,12 @@
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (this.postForm.contractUrl){
|
|
|
|
+ const date = new Date();
|
|
|
|
+ this.postForm.uploadDate = date.getFullYear() + "-" + (this.getZero(date.getMonth() + 1)) + "-" + this.getZero((date.getDate()));
|
|
|
|
+ }else {
|
|
|
|
+ this.postForm.uploadDate = null;
|
|
|
|
+ }
|
|
this.$refs.postForm.validate(valid => {
|
|
this.$refs.postForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.dataId) {
|
|
if (this.dataId) {
|