| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <template>
- <view class="entrapment">
- <view class="entrapment-card">
- <view class="entrapment-card__header" v-if="isShowHeader">
- <view class="entrapment-card__title edit-title">诱捕器</view>
- <!-- <view class="entrapment-card__update">
- <uni-icons type="loop" color="#1B76FF"></uni-icons>
- <text class="text">更新</text>
- </view> -->
- </view>
- <view class="entrapment-card__list">
- <view class="entrapment-card__item" v-for="item in dataSource.trap_record_list" :key="item.id">
- <view class="entrapment-card__text">{{item.trap_number}}<text
- class="status">{{item.report_status?`(${item.report_status})`:''}}</text></view>
- <view class="entrapment-card__btn" v-if="isEdit">
- <u-button v-if="!item.report_status" type="primary" text="填写" size="small"
- @click="handleEditEntrapmentInfo(item)">
- </u-button>
- <view class="entrapment-card__update" v-else @click="handleEditEntrapmentInfo(item)">
- <uni-icons type="loop" color="#1B76FF"></uni-icons>
- <text class="text">更新</text>
- </view>
- </view>
- <view class="entrapment-card__btn" v-else>
- <u-button type="primary" text="查看" size="small" @click="handleEditEntrapmentInfo(item)">
- </u-button>
- </view>
- <!-- -->
- </view>
- </view>
- </view>
- <u-popup :show="show" @close="close" @open="open" :closeOnClickOverlay="true" :safeAreaInsetTop="true">
- <!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
- <PopUpContentComponent :dataSource="entrapmentBaseInfo" @close="close" />
- <!-- <view class="entrapment-form">
- <view class="entrapment-form__header">
- <view class="entrapment-form__card">诱捕器:K2654114</view>
- </view>
- <view class="entrapment-form__form">
- <u--form labelPosition="left" :model="entrapmentFormModel" ref="entrapmentForm">
- <u-form-item label="" prop="userInfo.name" borderBottom ref="item1">
- <view class="entrapment-form__item">
- <view class="entrapment-form__label">
- <image src="@/static/image/task/pest/pest.png" mode="aspectFit" class="icon">
- </image>
- <text class="text">有害生物</text>
- <view class="fill-icon">
- <uni-icons type="arrowright" size="12" color="#fff"></uni-icons>
- </view>
- </view>
- <u--input border="none" type="number" v-model="value">
- <template slot="prefix">
- <image src="@/static/image/task/pest/statistics.png" mode="aspectFit"
- class="icon"></image>
- </template>
- <template slot="suffix">
- <text>头</text>
- </template>
- </u--input>
- <view class="entrapment-form__close">
- <uni-icons type="clear"></uni-icons>
- </view>
- </view>
- </u-form-item>
- </u--form>
- </view>
- <view class="entrapment-form__content">
- <view class="entrapment-form__content__btn">
- <u-button type="primary" :plain="true" icon="plus" text="增加" size="small"></u-button>
- </view>
- <view class="entrapment-form__actions">
- <view class="entrapment-form__action green">
- <image src="@/static/image/task/pest/pest-none.png" mode="aspectFit" class="img"></image>
- <text class="text">无虫</text>
- </view>
- <view class="entrapment-form__action pink">
- <image src="@/static/image/task/pest/bring.png" mode="aspectFit" class="img"></image>
- <text class="text">带回</text>
- </view>
- <view class="entrapment-form__action blue">
- <image src="@/static/image/task/pest/submit.png" mode="aspectFit" class="img"></image>
- <text class="text">提交</text>
- </view>
- </view>
- </view>
- </view> -->
- </u-popup>
- </view>
- </template>
- <script>
- import PopUpContentComponent from './EntrapmentAdd.vue'
- export default {
- props: {
- dataSource: {
- type: Object,
- default: () => ({})
- },
- isEdit: {
- type: Boolean,
- default: false,
- },
- isShowHeader: {
- type: Boolean,
- default: false,
- }
- },
- components: {
- PopUpContentComponent
- },
- data() {
- return {
- show: false,
- entrapmentFormModel: {
- pestList: []
- },
- rules: {},
- currentEditEntrapmentInfo: {},
- entrapmentBaseInfo: {}
- }
- },
- methods: {
- open() {
- console.log('open');
- },
- close() {
- this.show = false
- console.log('close');
- },
- handleEditEntrapmentInfo(row) {
- this.show = true;
- this.currentEditEntrapmentInfo = row;
- this.entrapmentBaseInfo = {
- id: row.id,
- trap_number: row.trap_number,
- comtype: this.isEdit,
- taskStatus:this.dataSource.task_status
- };
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .entrapment {
- width: 100%;
- box-sizing: border-box;
- padding: 40rpx 24rpx;
- .entrapment-card {
- &__header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-weight: 500;
- color: #1B76FF;
- font-size: 12px;
- line-height: 18px;
- margin-bottom: 28rpx;
-
- .edit-title {
- font-size: 14px;
- color: #333;
- line-height: 40rpx;
- padding-bottom: 10rpx;
- @include hairline-bottom(rgba(151, 151, 151, 0.09));
- }
- }
- &__update {
- font-weight: 500;
- color: #1B76FF;
- font-size: 12px;
- line-height: 18px;
- .text {
- margin-left: 10rpx;
- }
- }
- &__list {
- margin-bottom: 36rpx;
- }
- &__item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 24rpx 0;
- font-size: 16px;
- line-height: 22px;
- color: #333;
- font-weight: 400;
- @include hairline-bottom(rgba(151, 151, 151, 0.09));
- &:last-child {
- @include hairline-bottom(transparent);
- }
- }
- &__text {
- .status {
- color: #1B76FF;
- }
- }
- }
- .entrapment-form {
- &__header {
- width: 540rpx;
- height: 144rpx;
- border-radius: 70rpx;
- margin: 0 auto;
- margin-top: -72rpx;
- background-image: url(~@/static/image/task/pest/bg.png);
- background-repeat: no-repeat;
- background-size: 100% 100%;
- overflow: hidden;
- }
- &__card {
- padding: 0 68rpx;
- height: 100%;
- font-size: 14px;
- line-height: 144rpx;
- color: #fff;
- }
- &__form {
- margin-top: -30rpx;
- padding: 76rpx;
- margin-bottom: 20rpx;
- border-bottom: 1px solid rgba(2, 2, 2, 0.3);
- }
- &__item {
- position: relative;
- flex: 1;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx 24rpx;
- background: #F8F8F8;
- margin-bottom: 40rpx;
- .icon {
- width: 38rpx;
- height: 38rpx;
- }
- ::v-deep .u-input__content__field-wrapper {
- border-bottom: 1rpx solid #3183FF;
- }
- }
- &__label {
- display: flex;
- align-items: center;
- margin-right: 100rpx;
- .icon {
- width: 50rpx;
- height: 50rpx;
- }
- .text {
- font-size: 12px;
- line-height: 18px;
- color: #555555;
- margin: 0 24rpx;
- }
- .fill-icon {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 26rpx;
- height: 26rpx;
- background-color: #1B76FF;
- border-radius: 50%;
- line-height: 26rpx;
- }
- }
- &__content {
- padding: 36rpx 76rpx;
- }
- &__actions {
- padding: 140rpx 30rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- &__action {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- background: #4CD964;
- box-shadow: 0px 1px 9px 0px rgba(169, 169, 169, 0.5);
- .img {
- width: 40rpx;
- height: 40rpx;
- }
- .text {
- color: #fff;
- font-size: 12px;
- line-height: 14px;
- }
- }
- &__close {
- position: absolute;
- padding: 20rpx;
- right: -60rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- }
- </style>
|