|
|
@@ -5,6 +5,17 @@
|
|
|
<i class="icon-guanbi iconfont" @click="cancel"></i>
|
|
|
</div>
|
|
|
<div class="publish-seek">
|
|
|
+ <div class="content-line">
|
|
|
+ <span><i>*</i>品牌:</span>
|
|
|
+ <input type="text" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号">
|
|
|
+ <ul class="similar brand-similar-list" v-show="showSimilarBrandList && applyObj.brand">
|
|
|
+ <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="content-line">
|
|
|
+ <span><i>*</i>类目(产品名称):</span>
|
|
|
+ <input type="text" v-model="applyObj.prodTitle" @blur="checkProdTitle" @input="onProdTitleInput">
|
|
|
+ </div>
|
|
|
<div class="content-line">
|
|
|
<span><i>*</i>型号:</span>
|
|
|
<input type="text" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">
|
|
|
@@ -13,11 +24,8 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="content-line">
|
|
|
- <span><i>*</i>品牌:</span>
|
|
|
- <input type="text" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号">
|
|
|
- <ul class="similar brand-similar-list" v-show="showSimilarBrandList && applyObj.brand">
|
|
|
- <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
|
|
|
- </ul>
|
|
|
+ <span>规格:</span>
|
|
|
+ <input type="text" v-model="applyObj.spec" @blur="checkSpec" @input="onSpecInput">
|
|
|
</div>
|
|
|
<div class="content-line">
|
|
|
<span><i>*</i>截止日期:</span>
|
|
|
@@ -55,7 +63,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { formatDate, getRealLen, cutOutString } from '~utils/baseUtils'
|
|
|
+ import { formatDate, getRealLen, cutOutString, checkNullStr } from '~utils/baseUtils'
|
|
|
export default {
|
|
|
props: ['showSayPriceBox'],
|
|
|
data () {
|
|
|
@@ -68,14 +76,16 @@
|
|
|
encapsulation: '',
|
|
|
produceDate: '',
|
|
|
amount: '',
|
|
|
- deadline: ''
|
|
|
+ deadline: '',
|
|
|
+ prodTitle: ''
|
|
|
},
|
|
|
validObj: {
|
|
|
code: true,
|
|
|
brand: true,
|
|
|
unitPrice: true,
|
|
|
amount: true,
|
|
|
- deadline: true
|
|
|
+ deadline: true,
|
|
|
+ prodTitle: true
|
|
|
},
|
|
|
showCurrencyList: false,
|
|
|
showSimilarCodeList: false,
|
|
|
@@ -156,13 +166,14 @@
|
|
|
inquiry.endDate = endDate
|
|
|
inquiry.sourceapp = 'MALL'
|
|
|
inquiry.amount = 1
|
|
|
- inquiryItem.prodTitle = response.data && response.data.length ? response.data : '其他'
|
|
|
+ inquiryItem.prodTitle = response.data && response.data.length ? response.data : this.applyObj.prodTitle
|
|
|
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.spec = this.applyObj.spec
|
|
|
inquiryItem.custCurrency = currency
|
|
|
inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
|
|
|
inquiryItem.unitPrice = this.applyObj.unitPrice
|
|
|
@@ -219,7 +230,7 @@
|
|
|
}
|
|
|
},
|
|
|
checkAll: function () {
|
|
|
- return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkAmount()
|
|
|
+ return this.checkBrand() && this.checkProdTitle() && this.checkCode() && this.checkDeadline() && this.checkSpec() && this.checkAmount()
|
|
|
},
|
|
|
checkCode: function () {
|
|
|
this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
|
|
|
@@ -235,6 +246,22 @@
|
|
|
}
|
|
|
return this.validObj.brand
|
|
|
},
|
|
|
+ checkProdTitle: function () {
|
|
|
+ let prodTitle = this.applyObj.prodTitle.trim()
|
|
|
+ this.validObj.prodTitle = prodTitle && prodTitle !== ''
|
|
|
+ if (!this.validObj.prodTitle) {
|
|
|
+ this.setRemindText('类目不能为空')
|
|
|
+ }
|
|
|
+ return this.validObj.prodTitle
|
|
|
+ },
|
|
|
+ checkSpec: function () {
|
|
|
+ let nullStrFlag = checkNullStr(this.applyObj.spec)
|
|
|
+ this.validObj.spec = nullStrFlag
|
|
|
+ if (!nullStrFlag) {
|
|
|
+ this.setRemindText('规格输入不合法')
|
|
|
+ }
|
|
|
+ return this.validObj.spec
|
|
|
+ },
|
|
|
checkAmount: function () {
|
|
|
this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
|
|
|
return this.validObj.amount
|
|
|
@@ -306,6 +333,16 @@
|
|
|
this.getSimilarBrand()
|
|
|
}
|
|
|
},
|
|
|
+ onProdTitleInput: function () {
|
|
|
+ if (this.applyObj.prodTitle && getRealLen(this.applyObj.prodTitle) > 40) {
|
|
|
+ this.applyObj.prodTitle = cutOutString(this.applyObj.prodTitle, 40)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSpecInput: function () {
|
|
|
+ if (this.applyObj.spec && getRealLen(this.applyObj.spec) > 100) {
|
|
|
+ this.applyObj.spec = cutOutString(this.applyObj.spec, 100)
|
|
|
+ }
|
|
|
+ },
|
|
|
onAmountInput: function () {
|
|
|
if (!(/^[0-9]*$/).test(this.applyObj.amount)) {
|
|
|
let chineseIndex = -1
|
|
|
@@ -377,7 +414,7 @@
|
|
|
}
|
|
|
> span {
|
|
|
display: inline-block;
|
|
|
- width: 1.76rem;
|
|
|
+ width: 2.26rem;
|
|
|
text-align: right;
|
|
|
i {
|
|
|
color: #ff0000;
|
|
|
@@ -402,7 +439,7 @@
|
|
|
z-index: 12;
|
|
|
border: 1px solid #7e7e7e;
|
|
|
border-radius: .05rem;
|
|
|
- left: 1.75rem;
|
|
|
+ left: 2.25rem;
|
|
|
top: .7rem;
|
|
|
background: #fff;
|
|
|
li {
|