|
|
@@ -15,19 +15,19 @@
|
|
|
<div class="user_info">
|
|
|
<div class="user_title">
|
|
|
<div class="user_name">
|
|
|
- <span>深圳优软科技有限公司 <i class="fa fa-angle-down"></i></span>
|
|
|
- <a href="/">进入店铺</a>
|
|
|
+ <span>{{enUser.enName}} <i class="fa fa-angle-down"></i></span>
|
|
|
+ <a :href="/store/+ storeInfo.uuid" target="_blank">进入店铺</a>
|
|
|
</div>
|
|
|
<div class="user_mes">
|
|
|
<div class="mes-list">
|
|
|
<p>
|
|
|
- <span><i class="supplier_icon1"></i>企业执照号:155</span>
|
|
|
- <span><i class="supplier_icon2"></i> 地址:145</span>
|
|
|
+ <span><i class="supplier_icon1"></i>企业执照号:{{enUser.enBussinessCode ? enUser.enBussinessCode : '暂无信息'}}</span>
|
|
|
+ <span><i class="supplier_icon2"></i> 地址:{{enUser.enAddress ? enUser.enAddress : '暂无信息'}}</span>
|
|
|
</p>
|
|
|
<p>
|
|
|
- <span><i class="supplier_icon3"></i> 邮箱:1</span>
|
|
|
- <span><i class="supplier_icon4"></i> 电话:14553</span>
|
|
|
- <span><i class="supplier_icon5"></i> 行业:14444</span>
|
|
|
+ <span><i class="supplier_icon3"></i> 邮箱:{{enUser.enEmail ? enUser.enEmail : '暂无信息'}}</span>
|
|
|
+ <span><i class="supplier_icon4"></i> 电话:{{enUser.enTel ? enUser.enTel : '暂无信息'}}</span>
|
|
|
+ <span><i class="supplier_icon5"></i> 行业:{{enUser.enIndustry ? enUser.enIndustry : '暂无信息'}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -85,7 +85,7 @@
|
|
|
</ul>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <a @click="hasDialog = true" @mouseleave="hasClick = false" @mouseenter="hasClick = true">立即询价</a>
|
|
|
+ <a @click="immediatelyClick(item)" @mouseleave="hasClick = false" @mouseenter="hasClick = true">立即询价</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
@@ -98,29 +98,30 @@
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
title="我要询价"
|
|
|
- :visible.sync="hasDialog ">
|
|
|
+ :visible.sync="hasDialog">
|
|
|
<div class="form_dialog">
|
|
|
<ul class="list-inline">
|
|
|
<li class="form-item">
|
|
|
<span>型号:</span>
|
|
|
- <p>32432</p>
|
|
|
+ <p v-text="applyObj.cmpCode">32432</p>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>类目:</span>
|
|
|
- <p>3244333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333332</p>
|
|
|
+ <p v-text="applyObj.prodName">32</p>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>品牌:</span>
|
|
|
- <p>32432</p>
|
|
|
+ <p v-text="applyObj.brand">32432</p>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>规格:</span>
|
|
|
- <p>32432</p>
|
|
|
+ <p v-text="applyObj.spec">32432</p>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span><i>*</i>截止日期:</span>
|
|
|
<el-date-picker
|
|
|
- v-model="form.name"
|
|
|
+ :class="{'error': !validObj.deadline}"
|
|
|
+ v-model="applyObj.deadline"
|
|
|
type="date"
|
|
|
:picker-options="pickerOptions"
|
|
|
@change="setDeadLineValid"
|
|
|
@@ -131,36 +132,28 @@
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>封装:</span>
|
|
|
- <input type="text" class="form-control" v-model="form.date1"/>
|
|
|
+ <input type="text" class="form-control" v-model="applyObj.encapsulation"/>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>单价预算:</span>
|
|
|
- <select v-model="form.date1" class="form-control" style="width:40px;">
|
|
|
+ <select v-model="applyObj.currency" class="form-control" style="width:40px;">
|
|
|
<option value="RMB">¥</option>
|
|
|
<option value="USD">$</option>
|
|
|
</select>
|
|
|
- <input type="number" class="form-control"/>
|
|
|
+ <input type="number" v-model="applyObj.unitPrice" class="form-control" :class="{'error': !validObj.unitPrice}"/>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>生产日期:</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="form.date2"
|
|
|
- type="date"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- @change="setDeadProduction"
|
|
|
- :editable="false"
|
|
|
- :clearable="true"
|
|
|
- size="mini">
|
|
|
- </el-date-picker>
|
|
|
+ <input type="text" class="form-control" v-model="applyObj.produceDate"/>
|
|
|
</li>
|
|
|
<li class="form-item">
|
|
|
<span>采购数量:</span>
|
|
|
- <input type="number" class="form-control"/>
|
|
|
+ <input type="number" class="form-control" v-model="applyObj.amount" :class="{'error': !validObj.amount}"/>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <a type="button" @click="hasDialog=false">询价提交</a>
|
|
|
+ <a type="button" @click="goPublish">询价提交</a>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -174,6 +167,23 @@
|
|
|
name: 'ResourceView',
|
|
|
data () {
|
|
|
return {
|
|
|
+ applyObj: {
|
|
|
+ cmpCode: '',
|
|
|
+ brand: '',
|
|
|
+ unitPrice: '',
|
|
|
+ currency: 'RMB',
|
|
|
+ prodName: '',
|
|
|
+ spec: '',
|
|
|
+ encapsulation: '',
|
|
|
+ produceDate: '',
|
|
|
+ amount: '',
|
|
|
+ deadline: ''
|
|
|
+ },
|
|
|
+ validObj: {
|
|
|
+ unitPrice: true,
|
|
|
+ amount: true,
|
|
|
+ deadline: true
|
|
|
+ },
|
|
|
pickerOptions: {
|
|
|
disabledDate (time) {
|
|
|
// 大于等于今天 小于三个月后
|
|
|
@@ -182,17 +192,6 @@
|
|
|
},
|
|
|
hasDialog: false,
|
|
|
hasClick: false,
|
|
|
- form: {
|
|
|
- name: '',
|
|
|
- region: '',
|
|
|
- date1: '',
|
|
|
- date2: '',
|
|
|
- delivery: false,
|
|
|
- type: [],
|
|
|
- resource: '',
|
|
|
- desc: ''
|
|
|
- },
|
|
|
- dialogVisible: false,
|
|
|
searchCode: '',
|
|
|
pageParams: {
|
|
|
count: 10,
|
|
|
@@ -206,31 +205,34 @@
|
|
|
computed: {
|
|
|
list () {
|
|
|
return this.$store.state.supplier.material.material.data
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- setDeadProduction () {
|
|
|
- this.form.name = formatDate(this.form.name, 'yyyy-MM-dd hh:mm:ss')
|
|
|
},
|
|
|
- setDeadLineValid: function () {
|
|
|
- this.form.date2 = formatDate(this.form.date2, 'yyyy-MM-dd hh:mm:ss')
|
|
|
- // this.validObj.deadline = true
|
|
|
+ enUser () {
|
|
|
+ return this.$store.state.supplier.material.enUser.data
|
|
|
},
|
|
|
- onSubmit () {
|
|
|
- console.log('submit!')
|
|
|
+ storeInfo () {
|
|
|
+ return this.$store.state.shop.storeInfo.store.data
|
|
|
},
|
|
|
+ user () {
|
|
|
+ return this.$store.state.option.user
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 格式化字符串长度
|
|
|
spliceString (str, length) {
|
|
|
return spliceStr(str, length)
|
|
|
},
|
|
|
+ // 跳转到器件详情页面
|
|
|
jumpDetail (id) {
|
|
|
if (!this.hasClick) {
|
|
|
this.$router.push(this.$route.path + '/' + id)
|
|
|
}
|
|
|
},
|
|
|
+ // 获取分页数据
|
|
|
handleCurrentChange (type) {
|
|
|
this.pageParams.page = type
|
|
|
this.$store.dispatch('supplier/loadMaterialList', {page: type, size: 20, vendUU: this.$route.params.uuid})
|
|
|
},
|
|
|
+ // 根据搜索信息获取数据
|
|
|
goodsSearch (type) {
|
|
|
if (type) {
|
|
|
this.$store.dispatch('supplier/loadMaterialList', {
|
|
|
@@ -240,6 +242,99 @@
|
|
|
keyword: type
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ // 弹出询价界面
|
|
|
+ immediatelyClick (type) {
|
|
|
+ this.hasDialog = true
|
|
|
+ this.applyObj.cmpCode = type.cmpCode
|
|
|
+ this.applyObj.brand = type.brand
|
|
|
+ this.applyObj.spec = type.spec
|
|
|
+ this.applyObj.prodName = type.prodName
|
|
|
+ },
|
|
|
+ // 时间格式化
|
|
|
+ setDeadLineValid: function () {
|
|
|
+ this.applyObj.deadline = formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
|
|
|
+ this.validObj.deadline = true
|
|
|
+ },
|
|
|
+ // 检查单价预算
|
|
|
+ checkUnitPrice () {
|
|
|
+ this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
|
|
|
+ if (!this.validObj.unitPrice && this.applyObj.unitPrice <= 0) {
|
|
|
+ this.$message.error('单价必须是大于0的数字')
|
|
|
+ }
|
|
|
+ return this.validObj.unitPrice
|
|
|
+ },
|
|
|
+ // 检查采购数量
|
|
|
+ checkAmount () {
|
|
|
+ this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
|
|
|
+ return this.validObj.amount
|
|
|
+ },
|
|
|
+ // 检查时间是否有输入
|
|
|
+ checkDeadline () {
|
|
|
+ this.validObj.deadline = Boolean(this.applyObj.deadline)
|
|
|
+ return this.validObj.deadline
|
|
|
+ },
|
|
|
+ // 检查各个字段输入正常数据
|
|
|
+ checkAll () {
|
|
|
+ return this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
|
|
|
+ },
|
|
|
+ emptyForm () {
|
|
|
+ for (let attr in this.applyObj) {
|
|
|
+ this.applyObj[attr] = attr === 'currency' ? 'RMB' : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 请求询价信息
|
|
|
+ goPublish () {
|
|
|
+ if (this.checkAll()) {
|
|
|
+ let inquiry = {}
|
|
|
+ let inquiryItem = {}
|
|
|
+ if (this.user.data.enterprise) {
|
|
|
+ inquiry.enUU = this.user.data.enterprise.uu
|
|
|
+ }
|
|
|
+ let date = new Date()
|
|
|
+ let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
|
|
|
+ inquiry.recorderUU = this.user.data.userUU
|
|
|
+ inquiry.code = 'MALL' + date.getTime()
|
|
|
+ inquiry.date = date
|
|
|
+ inquiry.recorder = this.user.data.userName
|
|
|
+ inquiry.endDate = this.applyObj.deadline
|
|
|
+ inquiry.sourceapp = 'MALL'
|
|
|
+ inquiry.amount = 1
|
|
|
+ inquiryItem.userUU = this.user.data.userUU
|
|
|
+ inquiryItem.source = 'MALL'
|
|
|
+ inquiryItem.userName = this.user.data.userName
|
|
|
+ inquiryItem.userTel = this.user.data.userTel
|
|
|
+ inquiryItem.needquantity = this.applyObj.amount
|
|
|
+ inquiryItem.inbrand = this.applyObj.brand
|
|
|
+ inquiryItem.currency = currency
|
|
|
+ inquiryItem.cmpCode = this.applyObj.cmpCode.toUpperCase()
|
|
|
+ inquiryItem.unitPrice = this.applyObj.unitPrice
|
|
|
+ inquiryItem.produceDate = this.applyObj.produceDate
|
|
|
+ inquiryItem.date = date
|
|
|
+ inquiryItem.endDate = this.applyObj.deadline
|
|
|
+ inquiryItem.encapsulation = this.applyObj.encapsulation
|
|
|
+ inquiryItem.spec = this.applyObj.spec
|
|
|
+ inquiryItem.prodTitle = this.applyObj.prodName
|
|
|
+ let inquiryItems = []
|
|
|
+ inquiryItems.push(inquiryItem)
|
|
|
+ inquiry.inquiryItems = inquiryItems
|
|
|
+ inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
|
|
|
+ this.$http.post('/inquiry/buyer/save', inquiry)
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('发布成功')
|
|
|
+ this.hasDialog = false
|
|
|
+ this.emptyForm()
|
|
|
+ }, error => {
|
|
|
+ console.log(error)
|
|
|
+ this.$message.error('发布失败')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (!this.validObj.deadline) {
|
|
|
+ this.$message.error('截止日期不能为空')
|
|
|
+ } else if (!this.validObj.amount) {
|
|
|
+ this.$message.error('请输入正确的数值')
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -279,6 +374,14 @@
|
|
|
}
|
|
|
}
|
|
|
.form_dialog{
|
|
|
+ .el-date-editor--date{
|
|
|
+ width: 230px;
|
|
|
+ &.error {
|
|
|
+ input {
|
|
|
+ border: 1px solid #f4645f !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
ul{
|
|
|
li{
|
|
|
width:50%;
|