|
@@ -65,7 +65,9 @@
|
|
|
type="date"
|
|
type="date"
|
|
|
:picker-options="pickerOptions"
|
|
:picker-options="pickerOptions"
|
|
|
:class="{'error': !validObj.deadline}"
|
|
:class="{'error': !validObj.deadline}"
|
|
|
- @change="checkDeadline"
|
|
|
|
|
|
|
+ @change="setDeadLineValid"
|
|
|
|
|
+ :editable="false"
|
|
|
|
|
+ :clearable="true"
|
|
|
size="mini">
|
|
size="mini">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</div>
|
|
</div>
|
|
@@ -75,7 +77,18 @@
|
|
|
<div class="publish-upload">
|
|
<div class="publish-upload">
|
|
|
<h1>批量发布</h1>
|
|
<h1>批量发布</h1>
|
|
|
<h2>3秒一键配单采购</h2>
|
|
<h2>3秒一键配单采购</h2>
|
|
|
- <img src="/images/applyPurchase/upload.png" alt="" />
|
|
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <img src="/images/applyPurchase/upload.png" alt="" />
|
|
|
|
|
+ <!--<input type="file" accept="*.xls, *.xlsx" @change="upload">-->
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ drag
|
|
|
|
|
+ action="/seek/importBom"
|
|
|
|
|
+ accept="*.xls, *.xlsx"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ :on-success="onSuccess"
|
|
|
|
|
+ :on-error="onError">
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ </label>
|
|
|
<h3>把Excel格式的BOM拖放到框中</h3>
|
|
<h3>把Excel格式的BOM拖放到框中</h3>
|
|
|
<img class="download-line" src="/images/applyPurchase/download.png" alt="">
|
|
<img class="download-line" src="/images/applyPurchase/download.png" alt="">
|
|
|
<img class="apply-logo" src="/images/applyPurchase/publish-apply.png" alt="">
|
|
<img class="apply-logo" src="/images/applyPurchase/publish-apply.png" alt="">
|
|
@@ -150,8 +163,8 @@
|
|
|
unitPrice: true,
|
|
unitPrice: true,
|
|
|
// encapsulation: true,
|
|
// encapsulation: true,
|
|
|
// produceDate: true,
|
|
// produceDate: true,
|
|
|
- amount: true
|
|
|
|
|
-// deadline: true,
|
|
|
|
|
|
|
+ amount: true,
|
|
|
|
|
+ deadline: true
|
|
|
},
|
|
},
|
|
|
pickerOptions: {
|
|
pickerOptions: {
|
|
|
disabledDate (time) {
|
|
disabledDate (time) {
|
|
@@ -173,6 +186,11 @@
|
|
|
return this.$store.state.option.user
|
|
return this.$store.state.option.user
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted () {
|
|
|
|
|
+ document.getElementsByClassName('el-upload-dragger')[0].onclick = function (event) {
|
|
|
|
|
+ event.stopPropagation()
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
emptyForm: function () {
|
|
emptyForm: function () {
|
|
|
for (let attr in this.applyObj) {
|
|
for (let attr in this.applyObj) {
|
|
@@ -190,6 +208,7 @@
|
|
|
this.$message.success('发布成功')
|
|
this.$message.success('发布成功')
|
|
|
// this.showRemindBox = true
|
|
// this.showRemindBox = true
|
|
|
this.emptyForm()
|
|
this.emptyForm()
|
|
|
|
|
+// this.validObj.deadline = true
|
|
|
this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
|
|
this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
|
|
|
}, error => {
|
|
}, error => {
|
|
|
console.log(error)
|
|
console.log(error)
|
|
@@ -234,12 +253,15 @@
|
|
|
return this.validObj.amount
|
|
return this.validObj.amount
|
|
|
},
|
|
},
|
|
|
checkAll: function () {
|
|
checkAll: function () {
|
|
|
- return this.checkCode() && this.checkBrand() && this.checkUnitPrice() && this.checkAmount() && this.checkDeadline()
|
|
|
|
|
|
|
+ return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
|
|
|
},
|
|
},
|
|
|
checkDeadline: function () {
|
|
checkDeadline: function () {
|
|
|
- this.validObj.deadline = this.applyObj.deadline && this.applyObj.deadline !== ''
|
|
|
|
|
|
|
+ this.validObj.deadline = Boolean(this.applyObj.deadline)
|
|
|
return this.validObj.deadline
|
|
return this.validObj.deadline
|
|
|
},
|
|
},
|
|
|
|
|
+ setDeadLineValid: function () {
|
|
|
|
|
+ this.validObj.deadline = true
|
|
|
|
|
+ },
|
|
|
onUnitPriceInput: function () {
|
|
onUnitPriceInput: function () {
|
|
|
let price = this.applyObj.unitPrice
|
|
let price = this.applyObj.unitPrice
|
|
|
if (price >= 10000) {
|
|
if (price >= 10000) {
|
|
@@ -272,11 +294,35 @@
|
|
|
if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 20) {
|
|
if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 20) {
|
|
|
this.applyObj.brand = this.applyObj.brand.substring(0, this.applyObj.brand.length - 1)
|
|
this.applyObj.brand = this.applyObj.brand.substring(0, this.applyObj.brand.length - 1)
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ onSuccess: function (data) {
|
|
|
|
|
+ window.open('/applyPurchase/' + data.data)
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: function () {
|
|
|
|
|
+ this.$message.error('上传失败')
|
|
|
}
|
|
}
|
|
|
|
|
+// upload: function (e) {
|
|
|
|
|
+// let file = e.target.files[0]
|
|
|
|
|
+// let param = new FormData()
|
|
|
|
|
+// param.append('file', file, file.name)
|
|
|
|
|
+// let config = {
|
|
|
|
|
+// headers: {'Content-Type': file.type}
|
|
|
|
|
+// }
|
|
|
|
|
+// this.$http.post('/seek/importBom', param, config).then(response => {
|
|
|
|
|
+// if (response.data.success) {
|
|
|
|
|
+// window.open('/applyPurchase/' + response.data.data)
|
|
|
|
|
+// } else {
|
|
|
|
|
+// this.$message.error('上传失败')
|
|
|
|
|
+// }
|
|
|
|
|
+// }, err => {
|
|
|
|
|
+// console.log(err)
|
|
|
|
|
+// this.$message.error('系统错误')
|
|
|
|
|
+// })
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
|
+<style lang="scss">
|
|
|
.publish-apply {
|
|
.publish-apply {
|
|
|
background: url('/images/applyPurchase/banner.png') center center/cover no-repeat;
|
|
background: url('/images/applyPurchase/banner.png') center center/cover no-repeat;
|
|
|
height: 583px;
|
|
height: 583px;
|
|
@@ -361,6 +407,11 @@
|
|
|
padding-left: 34px;
|
|
padding-left: 34px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .el-input {
|
|
|
|
|
+ width: 111px;
|
|
|
|
|
+ .el-input__inner {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
input {
|
|
input {
|
|
|
width: 111px;
|
|
width: 111px;
|
|
|
height: 20px;
|
|
height: 20px;
|
|
@@ -410,6 +461,28 @@
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
margin: 20px 0 13px 0;
|
|
margin: 20px 0 13px 0;
|
|
|
}
|
|
}
|
|
|
|
|
+ label {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ /*input {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }*/
|
|
|
|
|
+ > div {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ .el-upload {
|
|
|
|
|
+ input {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ .el-upload-dragger {
|
|
|
|
|
+ width: 66px;
|
|
|
|
|
+ height: 66px;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 17px;
|
|
|
|
|
+ right: -66px;
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.download-line {
|
|
.download-line {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|