|
@@ -38,7 +38,7 @@
|
|
|
<view class="card-row align_center flex justify_between" v-if="showMore">
|
|
|
<view class="label">货架状态:</view>
|
|
|
<view class="text flex align_center justify_end" @click="showEnableShelf=true">
|
|
|
- <text>启用</text>
|
|
|
+ <text v-if="detailData">{{detailData.state == 'ENABLE'?'启用':'停用'}}</text>
|
|
|
<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -129,8 +129,8 @@
|
|
|
<u-modal v-model="showEnableShelf" :show-cancel-button="true" title="货架状态" @confirm="enbaleShelf">
|
|
|
<view class="slot-content" style="padding: 1rem 1rem 1.5rem;text-align: center;">
|
|
|
<u-radio-group v-model="shelfStatus">
|
|
|
- <u-radio :name="1">启用</u-radio>
|
|
|
- <u-radio :name="0">停用</u-radio>
|
|
|
+ <u-radio name="ENABLE">启用</u-radio>
|
|
|
+ <u-radio name="DISABLED">停用</u-radio>
|
|
|
</u-radio-group>
|
|
|
</view>
|
|
|
</u-modal>
|
|
@@ -150,7 +150,8 @@
|
|
|
modifFinishFlag,
|
|
|
getProductPlace,
|
|
|
getShelfPriceShow,
|
|
|
- updateShelfPriceShow
|
|
|
+ updateShelfPriceShow,
|
|
|
+ shelfModifState
|
|
|
} from '@/api/shelf'
|
|
|
import {
|
|
|
shelfCartNotEmpty
|
|
@@ -191,7 +192,7 @@
|
|
|
showPriceBak: [],
|
|
|
showMore: false,
|
|
|
showEnableShelf: false,
|
|
|
- shelfStatus: 1,
|
|
|
+ shelfStatus: undefined,
|
|
|
showCancelShelf: false
|
|
|
}
|
|
|
},
|
|
@@ -315,11 +316,33 @@
|
|
|
},
|
|
|
// 注销货架
|
|
|
cancelShelf(){
|
|
|
- this.showCancelShelf = false
|
|
|
+ const params = {
|
|
|
+ shelfSn: this.shelfSn,
|
|
|
+ state: 'WRITE_OFF'
|
|
|
+ }
|
|
|
+ shelfModifState(params).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ this.showCancelShelf = false
|
|
|
+ if(res.status == 200){
|
|
|
+ uni.navigateBack()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 启用禁用货架
|
|
|
enbaleShelf(){
|
|
|
- this.showEnableShelf = false
|
|
|
+ const params = {
|
|
|
+ shelfSn: this.shelfSn,
|
|
|
+ state: this.shelfStatus
|
|
|
+ }
|
|
|
+ shelfModifState(params).then(res => {
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ this.showEnableShelf = false
|
|
|
+ if(res.status == 200){
|
|
|
+ this.getShelfDetal()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 设置完成是否
|
|
|
switchChange(v) {
|
|
@@ -524,6 +547,7 @@
|
|
|
if (res.status == 200) {
|
|
|
this.detailData = res.data
|
|
|
this.switchVal = res.data.finishFlag == 1
|
|
|
+ this.shelfStatus = res.data.state
|
|
|
// 价格设置
|
|
|
this.getShelfPriceShow()
|
|
|
} else {
|