|
|
@@ -87,11 +87,13 @@
|
|
|
|
|
|
<tui-list-cell class="line-cell" :arrow="true">
|
|
|
<view class="tui-title">分类</view>
|
|
|
- <picker mode="selector" :value="form.classId" :range="itemClassData" range-key="name" @change="changeItemClassFn" class="tui-input" >
|
|
|
- <input v-model="form.classId" name="classId" type="text" hidden />
|
|
|
- <view v-if="form.classId" style="height:45upx;" >{{ itemClassSelectedData.name }}</view>
|
|
|
- <view class="tui-placeholder" style="height:45upx;" v-else>请选择</view>
|
|
|
- </picker>
|
|
|
+ <input v-model="form.classId" name="classId" type="text" hidden />
|
|
|
+ <view style="color:#CCCCCC;width:450upx;height:45upx;" @click.stop="changeClass()" v-if="form.classId == 0">
|
|
|
+ 请选择分类
|
|
|
+ </view>
|
|
|
+ <view @click.stop="changeClass()" style="width:450upx;height:45upx;" v-else>
|
|
|
+ {{form.className}}
|
|
|
+ </view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
@@ -252,6 +254,16 @@
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
|
|
|
+ <uni-popup ref="classRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
+ <view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择分类:</view>
|
|
|
+ <view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
|
|
|
+ <view v-for="(item, index) in itemClassData" :key="index" @tap.stop="setThisClass(item)" style="margin-bottom:20upx;margin-left:3upx;">
|
|
|
+ <image :src="item.cover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
|
|
|
+ <view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.name}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -290,6 +302,7 @@ export default {
|
|
|
bigUnitId:1,
|
|
|
smallUnitId:2,
|
|
|
classId:'',
|
|
|
+ className:'',
|
|
|
price:'',
|
|
|
skPrice:'',
|
|
|
hjPrice:'',
|
|
|
@@ -313,7 +326,6 @@ export default {
|
|
|
ratioType:0,
|
|
|
inTurn:100
|
|
|
},
|
|
|
- itemClassSelectedData:{},
|
|
|
itemClassData:[],
|
|
|
unitData:[],
|
|
|
smallUnitSelectedData:{},
|
|
|
@@ -356,6 +368,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeClass(item){
|
|
|
+ this.$refs.classRef.open('center')
|
|
|
+ },
|
|
|
+ setThisClass(info){
|
|
|
+ this.$refs.classRef.close()
|
|
|
+ this.form.classId = info.id ? info.id : 0
|
|
|
+ this.form.className = info.name ? info.name : ''
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
showChangeOnStock(item){
|
|
|
let that = this
|
|
|
that.$util.confirmModal({content:'了解修改后的影响,确认要修改?'},() => {
|
|
|
@@ -580,11 +601,6 @@ export default {
|
|
|
this.smallUnitSelectedData = this.unitData[e.detail.value];
|
|
|
this.form.smallUnitId = this.smallUnitSelectedData.id;
|
|
|
},
|
|
|
- changeItemClassFn(e) {
|
|
|
- this.itemClassSelectedData = this.itemClassData[e.detail.value];
|
|
|
- this.form.classId = this.itemClassSelectedData.id;
|
|
|
- },
|
|
|
- //从平台选择花材 shish 20210826
|
|
|
getPtItemInfo(ptItemId){
|
|
|
getPtItemDetail({id:ptItemId}).then(res=>{
|
|
|
|
|
|
@@ -632,9 +648,11 @@ export default {
|
|
|
|
|
|
this.form.price = res.data.prePrice
|
|
|
|
|
|
- this.itemClassSelectedData = this.itemClassData.filter(
|
|
|
+ let currentClass = this.itemClassData.filter(
|
|
|
e => this.form.classId == e.id
|
|
|
)[0];
|
|
|
+ this.form.className = currentClass.name ? currentClass.name : ''
|
|
|
+
|
|
|
this.smallUnitSelectedData = this.unitData.filter(
|
|
|
e => this.form.smallUnitId == e.id
|
|
|
)[0];
|
|
|
@@ -642,8 +660,7 @@ export default {
|
|
|
e => this.form.bigUnitId == e.id
|
|
|
)[0];
|
|
|
this.productData = res.data
|
|
|
- this.cost = res.data.cost || 0
|
|
|
-
|
|
|
+ this.cost = res.data.cost ? res.data.cost : 0
|
|
|
});
|
|
|
},
|
|
|
imgUploadSuccess(res) {
|