|
@@ -89,15 +89,19 @@
|
|
|
<view v-if="gridList.type == '潮粮'" class="c-row">
|
|
|
<view class="title">净重单价(元/公斤)</view>
|
|
|
<view class="con-list">
|
|
|
- <input v-model='gridList.tidalGrainPrice' disabled placeholder="自动获取,不可编辑" name="input"
|
|
|
+ <input v-model='gridList.tidalGrainPrice' :disabled='pricedisabled' @blur='inputprice' placeholder="自动获取,不可编辑" name="input"
|
|
|
type="digit"></input>
|
|
|
</view>
|
|
|
+ <button class='cu-btn bg-green shadow' @click="changeprice">{{pricetext}}</button>
|
|
|
+
|
|
|
</view>
|
|
|
<view v-if="gridList.type == '干粮'" class="c-row">
|
|
|
<view class="title">干粮单价(元/公斤)</view>
|
|
|
<view class="con-list">
|
|
|
- <input v-model='gridList.dryGrainPrice' placeholder="请输入干粮单价" name="input" type="digit"></input>
|
|
|
+ <input v-model='gridList.dryGrainPrice' :disabled='pricedisabled' @blur='inputprice' placeholder="请输入干粮单价" name="input" type="digit"></input>
|
|
|
</view>
|
|
|
+ <button class='cu-btn bg-green shadow' @click="changeprice">{{pricetext}}</button>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style='padding-bottom:300rpx;'>
|
|
@@ -219,6 +223,7 @@
|
|
|
show2: false,
|
|
|
goodsList: [],
|
|
|
currentPage: 1,
|
|
|
+ pricetext:'锁定',
|
|
|
value:false,
|
|
|
gridBorder: false,
|
|
|
headUrl: "../../static/img/myimg/YongHu@3x.png",
|
|
@@ -251,6 +256,8 @@
|
|
|
showTran: true,
|
|
|
companyId: 1,
|
|
|
current: 4,
|
|
|
+ pricedisabled:false,
|
|
|
+
|
|
|
gradeList: [{
|
|
|
key: 1,
|
|
|
value: '一等品'
|
|
@@ -401,6 +408,21 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ changeprice(){
|
|
|
+ if(this.pricetext='解锁'){
|
|
|
+ this.pricedisabled=false
|
|
|
+ this.pricetext='锁定'
|
|
|
+ }else{
|
|
|
+ this.pricedisabled=true
|
|
|
+ this.pricetext='解锁'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ inputprice(){
|
|
|
+ if(this.pricetext='锁定'){
|
|
|
+ this.pricedisabled=true
|
|
|
+ this.pricetext='解锁'
|
|
|
+ }
|
|
|
+ },
|
|
|
print(){
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/erpbusiness/bleConnect'
|
|
@@ -443,58 +465,58 @@
|
|
|
},
|
|
|
waterContentChange() {
|
|
|
var that = this
|
|
|
- if (this.gridList.goodsName && this.cangid) {
|
|
|
- if (!this.gridList.dryGrainPrice || this.gridList.dryGrainPrice == 0) {
|
|
|
- this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
|
|
|
- warehouseId: this.cangid,
|
|
|
- goodsName: this.gridList.goodsName
|
|
|
- }).then(res => {
|
|
|
- that.gridList.dryGrainPrice = res.data.data
|
|
|
- })
|
|
|
+ if(!this.pricedisabled){
|
|
|
+ if (this.gridList.goodsName && this.cangid) {
|
|
|
+ this.$api.doRequest('get', '/purchasePrice/dryGrainPrice', {
|
|
|
+ warehouseId: this.cangid,
|
|
|
+ goodsName: this.gridList.goodsName
|
|
|
+ }).then(res => {
|
|
|
+ that.gridList.dryGrainPrice = res.data.data
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (this.gridList.goodsName) {
|
|
|
- for (var i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
- if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
|
|
|
- this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
|
|
|
- this.gridList.paramType = this.purchasePriceList[i].paramType
|
|
|
+
|
|
|
+ if (this.gridList.goodsName) {
|
|
|
+ for (var i = 0; i < this.purchasePriceList.length; i++) {
|
|
|
+ if (this.purchasePriceList[i].goodsName == this.gridList.goodsName) {
|
|
|
+ this.gridList.buckleWeightRatio = this.purchasePriceList[i].deductWeight
|
|
|
+ this.gridList.paramType = this.purchasePriceList[i].paramType
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- var numReg = /^[0-9]*$/
|
|
|
- var numRe = new RegExp(numReg)
|
|
|
- //潮粮单价改变事件
|
|
|
- if (
|
|
|
- this.gridList.goodsName &&
|
|
|
- this.gridList.waterContent &&
|
|
|
- this.gridList.grade &&
|
|
|
- numRe.test(this.gridList.waterContent)
|
|
|
- ) {
|
|
|
- this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
|
|
|
- warehouseId: this.cangid,
|
|
|
- goodsName: this.gridList.goodsName,
|
|
|
- waterContent: this.gridList.waterContent,
|
|
|
- grade: this.gridList.grade,
|
|
|
- }).then(res => {
|
|
|
- if (that.gridList.paramType == '1') {
|
|
|
- that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
|
|
|
- .gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
|
|
|
- .dryGrainPrice)).toFixed(4)
|
|
|
- if (!that.gridList.tidalGrainPrice) {
|
|
|
- that.gridList.tidalGrainPrice = ''
|
|
|
- }
|
|
|
- } else {
|
|
|
- if(that.gridList.type == '干粮'){
|
|
|
- that.gridList.dryGrainPrice = res.data.data
|
|
|
- }
|
|
|
- else{
|
|
|
- that.gridList.tidalGrainPrice = res.data.data
|
|
|
+ var numReg = /^[0-9]*$/
|
|
|
+ var numRe = new RegExp(numReg)
|
|
|
+ //潮粮单价改变事件
|
|
|
+ if (
|
|
|
+ this.gridList.goodsName &&
|
|
|
+ this.gridList.waterContent &&
|
|
|
+ this.gridList.grade &&
|
|
|
+ numRe.test(this.gridList.waterContent)
|
|
|
+ ) {
|
|
|
+ this.$api.doRequest('get', '/purchasePrice/tidalGrainPrice', {
|
|
|
+ warehouseId: this.cangid,
|
|
|
+ goodsName: this.gridList.goodsName,
|
|
|
+ waterContent: this.gridList.waterContent,
|
|
|
+ grade: this.gridList.grade,
|
|
|
+ }).then(res => {
|
|
|
+ if (that.gridList.paramType == '1') {
|
|
|
+ that.gridList.tidalGrainPrice = parseFloat(parseFloat(res.data.data) - parseFloat(that
|
|
|
+ .gridList.buckleMiscellaneous) / 100 * parseFloat(that.gridList
|
|
|
+ .dryGrainPrice)).toFixed(4)
|
|
|
+ if (!that.gridList.tidalGrainPrice) {
|
|
|
+ that.gridList.tidalGrainPrice = ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(that.gridList.type == '干粮'){
|
|
|
+ that.gridList.dryGrainPrice = res.data.data
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ that.gridList.tidalGrainPrice = res.data.data
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
gocustomer() {
|
|
|
uni.navigateTo({
|
|
@@ -662,7 +684,9 @@
|
|
|
// this.$set(this.gradeList,'grade',this.gradeList[e[0]].value)
|
|
|
this.gridList.grade = this.gradeList[e[0]].value
|
|
|
this.gridList.gradeKey = this.gradeList[e[0]].key
|
|
|
- this.waterContentChange()
|
|
|
+ if(!this.pricedisabled){
|
|
|
+ this.waterContentChange()
|
|
|
+ }
|
|
|
},
|
|
|
setGoodName(e) {
|
|
|
//
|
|
@@ -917,4 +941,4 @@
|
|
|
text-align: center;
|
|
|
border-radius: 20rpx;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|