Browse Source

增加修改评级按钮及显隐判断、增加修改弹出框

master
zq 4 weeks ago
parent
commit
94909d004a
  1. 234
      pages/coinsDetail/index.vue
  2. 1
      pages/home/index.vue
  3. 1
      static/images/edit_rate.svg

234
pages/coinsDetail/index.vue

@ -63,23 +63,75 @@
<ListBox v-if="detailItem.remark" leftTitle="备注" :rightTitle="detailItem.remark" />
<!-- 详情页面展示 -->
<ListBox v-if="id" leftTitle="操作人" :rightTitle="detailItem.operator" />
<view class="editRate" v-if="detailItem.status == '1'" @click="onEdit">
<image :src="cssUrl + 'editRate.png'"/>
修改评级
</view>
</view>
<PopUpCommon ref="ratePopup" :showClose="true" zIndex="top">
<view class="popWrap ratePopup" ref="popWrap">
<view class="pop-title PfScMedium">修改评级</view>
<view class="content">
<VisitorInfo :visitorInfo="detailItem" />
<view class="rate-content">
<view class="rate-item" v-if="newDetailItem.rating_department">
<view class="label">评级部门</view>
<input type="text" v-model="newDetailItem.rating_department">
</view>
<view class="rate-item" v-if="newDetailItem.rating_code">
<view class="label">评级编号</view>
<input type="text" v-model="newDetailItem.rating_code">
</view>
<view class="rate-item" v-if="newDetailItem.grade">
<view class="label">分数</view>
<input type="text" v-model="newDetailItem.grade">
</view>
<view class="rate-item" v-if="newDetailItem.materia">
<view class="label">材质</view>
<input type="text" v-model="newDetailItem.material">
</view>
<view class="rate-item" v-if="newDetailItem.deal_with">
<view class="label">处理</view>
<input type="text" v-model="newDetailItem.deal_with">
</view>
<!-- <view class="rate-item" v-if="newDetailItem.pay_for_level">
<view class="label">赔付等级</view>
<input type="text" v-model="newDetailItem.pay_for_levell">
</view>
<view class="rate-item" v-if="newDetailItem.deal_with">
<view class="label">尺寸</view>
<input type="text" v-model="newDetailItem.deal_with">
</view> -->
</view>
</view>
<view class="qrcode_wrap page-bottom-btn-container flex-between">
<view class="bottom-btn cancel" @click="onCancel">取消</view>
<view class="bottom-btn PfScMedium primary" @click="onConfirm">确定修改</view>
</view>
</view>
</PopUpCommon>
</view>
</template>
<script>
import ListBox from '@/components/listBox.vue';
import VisitorInfo from '@/components/visitorInfo.vue';
import PopUpCommon from '@/components/common/popUpCommon.vue';
export default {
name: "coinsDetail",
props: ['scanCodeDetail'],
components: {
VisitorInfo,
ListBox
ListBox,
PopUpCommon
},
data() {
return {
newDetailItem:{
},
textObj:{
0:'进价:',
'1':'售价:',
@ -104,22 +156,29 @@ export default {
watch: {
scanCodeDetail(newVal, oldVal) {
this.detailItem = { ...newVal }//
this.newDetailItem = { ...newVal }//
}
},
mounted() {
if (this.scanCodeDetail && Object.keys(this.scanCodeDetail).length > 0) {
this.detailItem = { ...this.scanCodeDetail }
this.$nextTick(() => {
this.newDetailItem = JSON.parse(JSON.stringify(this.scanCodeDetail))
} )
}
},
onLoad(options) {
// console.log(options,'this.$route.query-=',this.scanCodeDetail);
const { id } = options;
//
if (id) {
this.id = id;
let detailItem = uni.getStorageSync('detail')
if (detailItem) this.detailItem = JSON.parse(detailItem)
let newDetailItem = uni.getStorageSync('detail')
if (detailItem) {
this.detailItem = JSON.parse(detailItem)
this.newDetailItem = JSON.parse(newDetailItem)
}
console.log(this.newDetailItem,'=newDetailItem');
this.price = this.detailItem.price;
// this.price1 = this.detailItem.price1 || ''
this.buying_price = this.detailItem.buying_price;
@ -132,6 +191,13 @@ export default {
// }
},
methods:{
onCancel() {
this.$refs.ratePopup.closePop();
},
onEdit() {
this.$refs.ratePopup.openPop();
},
updatePrice(type){
let params={
scan_code_detail:JSON.stringify({...this.detailItem}),
@ -153,7 +219,19 @@ export default {
}).catch(res => {
});
}
},
async onConfirm() {
const params = {...this.newDetailItem}
console.log('执行了');
// this.$http.req('/api/update_price', {
// ...params
// }, 'POST').then(data => {
// if (data == -1) return
// this.$refs.ratePopup.closePop();
// }).catch(res => {
// });
},
}
};
</script>
@ -314,11 +392,155 @@ export default {
.coinsDetail-wrap {
.list-wrap {
padding: 0 18rpx 20rpx 18rpx;
;
}
.top {
margin-top: 20rpx;
}
}
.editRate{
width: 648rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
padding: 23rpx 10rpx;
box-sizing: border-box;
gap: 10px;
border-radius: 12rpx;
background: #E2E4E7;
font-family: PingFang SC;
font-size: 32rpx;
font-weight: normal;
line-height: 44rpx;
text-align: center;
margin: 0 auto;
margin-top: 58rpx;
letter-spacing: normal;
color: #666666;
image{
width: 42rpx;
height: 42rpx;
}
}
.rate-content{
// padding: 0 24rpx;
}
.popWrap {
display: flex;
flex-direction: column;
max-height: 1100rpx;
height: 70%;
.pop-title {
height: 40rpx;
text-align: center;
padding: 42rpx 0 22rpx 0;
font-size: 36rpx;
font-weight: 500;
line-height: 50rpx;
text-align: center;
letter-spacing: 2rpx;
color: #000000;
background: #fff;
}
.content {
flex: 1;
// padding: 0 24rpx;
background: #fff;
padding-bottom: 94px;
overflow-y: auto;
}
}
.ratePopup :v-deep .user-info{
margin: 0;
}
.rate-content{
padding: 0 24rpx;
.rate-item{
display: flex;
justify-content: space-between;
align-items: center;
padding: 42rpx 24rpx;
box-sizing: border-box;
border-width: 0px 0px 2rpx 0px;
border-style: solid;
border-color: #F0F0F0;
.label{
font-size: 32rpx;
font-weight: 500;
line-height: 44rpx;
letter-spacing: 2rpx;
color: #222222;
}
input{
font-size: 32rpx;
font-weight: normal;
line-height: normal;
text-align: right;
letter-spacing: 0.24rpx;
color: #666666;
}
}
}
.bottom-btn {
height: 92rpx;
width: 100%;
margin: 16rpx 0;
line-height: 92rpx;
text-align: center;
font-size: 32rpx;
border-radius: 16rpx;
border: none;
padding: 0;
&.primary {
background-color: #39D067;
color: #FFFFFF;
}
&.cancel {
background-color: #F1F2F3;
color: #616266;
}
&::after {
border: none;
}
&.disabled {
background-color: #CCCCCC;
opacity: 0.7;
}
}
.page-bottom-btn-container {
box-sizing: border-box;
background-color: #FFFFFF;
padding: 0rpx 54rpx;
box-shadow: 0px -2rpx 6rpx 0rpx rgba(181, 181, 181, 0.1319);
z-index: 9;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
column-gap: 50rpx;
}
.qrcode_wrap {
background: #fff;
height: 166rpx;
position: fixed;
width: 100%;
left: 0;
bottom: 0;
box-shadow: 0px -2rpx 116rpx 0px rgba(181, 181, 181, 0.26);
// img {
// width: 122rpx;
// height: 142rpx;
// position: absolute;
// top: -42rpx;
// left: 50%;
// transform: translateX(-50%);
// }
}
</style>

1
pages/home/index.vue

@ -47,7 +47,6 @@
<!-- <calendar ref="calendar" :departid="selectedHospitalId" v-show="departid>0" @getDate="getDate" @getData="getData"/> -->
<PopUpCommon ref="coinsPopup" :showClose="true" zIndex="top">
<view class="popWrap" ref="popWrap">
<view class="pop-title PfScMedium">{{ titleType[scanCodeDetail.ancient_coin_status] }}</view>

1
static/images/edit_rate.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 17 KiB

Loading…
Cancel
Save