| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526 |
- <template>
- <view :class="[AppTheme]" class="all_box">
- <view class="content_box">
- <view class="content_detail_1">
- <view class="detail_title_1">
- <view class="detail_title_p1">
- <image class="image" :src="soil.soil_cover_pic" mode=""></image>
- </view>
- <view class="detail_title_p2">
- <view class="detail_title_p3">{{soil.soil_name}}</view>
- <view class="detail_title_p4">
- 地块—{{soil.name}} ,面积 {{soil.area}} m²
- </view>
- </view>
- </view>
- <view class="detail_text_p1">
- <view class="detail_text_p2">巡检日期:{{soil.ntime}}</view>
- <view class="detail_text_p2">巡检土地:{{soil.soil_name}}</view>
- <view class="detail_text_p2">巡检地块:{{soil.name}}</view>
- <view class="detail_text_p2">巡检作物:{{soil.seed_name}}</view>
- <view class="detail_text_p2">巡检面积:{{soil.seed_num}} m²</view>
- <view class="detail_text_p2">巡检内容:{{soil.ipqc_name}}</view>
- </view>
- </view>
- <view class="farm_name_4" @click="pkxunzhe">
- <view class="farm_name_5">
- 成熟度
- </view>
- <view class="farm_name_6">
- {{seedname}}
- <u-icon name="arrow-right" :bold="true" color="#999" size="18" ></u-icon>
- </view>
- </view>
- <view class="content_detail">
- <!-- <view class="detail_title">备注说明</view> -->
- <view class="detail_text">
- <textarea v-model="form.describe" class="detail_ipt" type="text" placeholder="请输入巡检备注" />
- </view>
- <view class="content_detail_img">
- <view v-if="detailimg.length!=0" class="detail_img" v-for="(item,index) in detailimg" :key="index"
- @click="preview(item,index)">
- <image class="image" :src="item" mode=""></image>
- <u-icon @click="deleteimg(index)" class="delete_img" name="close-circle" color="#fff" size="20">
- </u-icon>
- </view>
- <view class="detail_img" @click="uploadlogo(2)">
- <u-icon class="icon_plus" name="plus" size="50"></u-icon>
- </view>
- </view>
- </view>
- <view class="submit bg-linear-gradient" @click="submit">记录</view>
- </view>
- <u-picker :show="show" :columns="columns" @cancel='cancel' @confirm='confirm' keyName="label"></u-picker>
- <u-modal :show="show1" :title="title" :content='content' @confirm='confirmmodel'></u-modal>
- </view>
- </template>
- <script>
- import mineApi from "@/api/mine/index.js"
- import {
- pathToBase64
- } from "@/js/pathto64.js"
- export default {
- data() {
- return {
- primary: this.$theme.primary,
- settingFile: getApp().globalData.siteinfo,
- soil: '',
- detailimg: [], //农场描述附加图
- //表单数据
- form: {
- describe: "", //农场描述
- detailimg: [] //农场描述附加图
- },
- columns: [
- [{
- label: '幼苗期',
- id: 6
- }, {
- label: '生长期',
- id: 7
- }, {
- label: '成熟期',
- id: 3
- }, {
- label: '枯萎',
- id: 8
- }]
- ],
- show: false,
- seed_status: '',
- show1: false,
- title: '提示',
- content: '暂无作物信息,无需记录',
- seedname:''
- }
- },
- onLoad(options) {
- console.log(JSON.parse(options.item), 'jsadfjkd')
- this.soil = JSON.parse(options.item)
- console.log(this.soil, 'this.soil')
- this.seedname=this.soil.seed_status
- if(this.soil.seed_status==''){
- this.show1=true
- }
- },
- methods: {
- confirmmodel(){
- this.show1=false
- uni.navigateTo({
- url:'/pagesD/pages/inspection/inspection'
- })
- },
- confirm(e) {
- console.log(e, 'eeeeeee')
- this.show = false
- this.seed_status = e.value[0].id
- this.seedname=e.value[0].label
- // console.log(orderid, 'orderidorderid')
- // this.lookorderbyid(orderid)
- },
- cancel() {
- this.show = false
- },
- pkxunzhe() {
- this.show = true
- },
- preview(url, idx) { //预览图片
- uni.previewImage({
- current: idx,
- urls: this.detailimg,
- success: function(res) {
- console.log(res, '预览')
- },
- fail: function(res) {
- console.log(res, '00000')
- }
- })
- },
- deleteimg(idx) { //图片删除
- this.detailimg.splice(idx, 1)
- this.form.detailimg.splice(idx, 1)
- },
- //提交资料
- submit() {
- let data = {
- id: this.soil.id,
- farm_detail: this.form.describe,
- seed_status: this.seed_status,
- detail_img: this.form.detailimg,
- seedid: this.soil.seedid,
- }
- mineApi.goinspection(data)
- .then(res => {
- if (res.status === 1) {
- uni.showToast({
- title: res.msg,
- icon: "none"
- })
- setTimeout(() => {
- uni.redirectTo({
- url: '/pagesD/pages/inspection/inspection'
- })
- }, 1000)
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none"
- })
- }
- })
- .catch(error => {
- console.log(error, 'error')
- })
- },
- //上传Logo和农场描述附加图
- uploadlogo(num) {
- let that = this
- // #ifdef MP
- uni.chooseImage({
- count: 9,
- success: function(res) {
- res.tempFilePaths.forEach(ele => {
- that.detailimg.push(ele)
- uni.getFileSystemManager().readFile({
- filePath: ele,
- encoding: 'base64',
- success: function(ress) {
- //返回不带data:image/jpeg;base64,'头的base64格式
- let imageurl = 'data:image/jpeg;base64,' + ress
- .data;
- that.form.detailimg.push(imageurl)
- }
- })
- })
- }
- })
- // #endif
- // #ifdef APP||H5
- uni.chooseImage({
- count: 9,
- success: function(res) {
- res.tempFilePaths.forEach(ele => {
- that.detailimg.push(ele)
- pathToBase64(res.tempFilePaths[0]).then(base64 => {
- console.log(base64, "base64")
- that.form.detailimg.push(base64)
- })
- })
- },
- fail: function(res) {
- }
- })
- // #endif
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .all_box {
- // background-color: #ffffff;
- .step_bar {
- padding: 50rpx;
- padding-bottom: 80rpx;
- color: #fff;
- }
- .reason {
- background-color: #f97c00;
- color: #fff;
- line-height: 50rpx;
- padding: 0 20rpx;
- .reason_text {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .content_box {
- padding-bottom: 20rpx;
- .farm_name_4 {
- width: 90%;
- margin-left: 2.5%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx 20rpx;
- background: #fff;
- border-radius: 10upx;
- margin-top: 20rpx;
- .farm_name_5 {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- image {
- width: 45rpx;
- height: 45rpx;
- }
- font-size: 32rpx;
- }
- .farm_name_6 {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- color: #999;
- font-size: 26rpx;
- margin-right: 2vh;
- }
- }
- .content_detail_1 {
- width: 90%;
- margin-left: 2.5%;
- margin-top: 20rpx;
- border-radius: 10upx;
- background-color: #ffffff;
- padding: 20rpx;
- .detail_text_p1 {
- padding: 30rpx 0 0 0;
- // color: #999;
- .detail_text_p2 {
- padding: 20rpx 0;
- }
- }
- .detail_title_1 {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- .detail_title_p1 {
- .image {
- border-radius: 10rpx;
- width: 150rpx;
- height: 150rpx;
- }
- }
- .detail_title_p2 {
- margin-left: 2vh;
- // color: #999;
- .detail_title_p3 {
- padding: 30rpx 0;
- }
- .detail_title_p4 {
- -webkit-line-clamp: 2;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
- }
- // margin: 20rpx;
- .content_detail {
- margin: 15rpx;
- background: #fff;
- border-radius: 10upx;
- .detail_title {
- font-weight: 700;
- font-size: 30rpx;
- color: #999;
- // margin: 15rpx;
- }
- .detail_text {
- // font-size: 25rpx;
- margin-top: 20rpx;
- display: flex;
- .input {
- width: 100%;
- padding-left: 10rpx;
- height: 80rpx;
- border-radius: 5rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- border: 1rpx solid #eae8e9;
- }
- .detail_ipt {
- border: 1rpx solid #eae8e9;
- padding: 15rpx;
- width: 100%;
- .text {
- margin-bottom: 20rpx;
- }
- .detail_logo {
- margin-top: 20rpx;
- .img {
- width: 120rpx;
- height: 120rpx;
- }
- }
- .choose_img {
- margin-top: 20rpx;
- width: 120rpx;
- height: 120rpx;
- text-align: center;
- overflow: hidden;
- border: 1rpx solid #eae8e9;
- .icon_plus {
- margin: 15rpx;
- }
- }
- }
- .detail_ipt1 {
- border: 1rpx solid #eae8e9;
- padding: 15rpx;
- height: 70rpx;
- }
- .icon {
- position: absolute;
- top: 10rpx;
- right: 20rpx;
- z-index: 10;
- }
- }
- .detail_text_address {
- width: 100%;
- margin-top: 20rpx;
- height: 80rpx;
- border-radius: 5rpx;
- border: 1rpx solid #eae8e9;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .input {
- padding-left: 10rpx;
- width: 92%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .icon {}
- }
- .content_detail_img {
- display: flex;
- justify-content: space-between;
- align-items: center;
- flex-wrap: wrap;
- .detail_img {
- position: relative;
- margin-top: 10rpx;
- width: 200rpx;
- height: 200rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- border: 1rpx solid #eae8e9;
- // margin-right: 20rpx;
- .image {
- width: 200rpx;
- height: 200rpx;
- }
- .delete_img {
- position: absolute;
- top: 5rpx;
- right: 5rpx;
- }
- }
- }
- }
- .agree_terms {
- display: flex;
- justify-content: center;
- align-items: center;
- .agree_dot {
- margin-right: 10rpx;
- }
- text {
- color: #2375f4;
- }
- }
- .submit {
- font-size: 30rpx;
- color: #ffffff;
- padding: 25rpx 0;
- border-radius: 35rpx;
- text-align: center;
- width: 90%;
- margin: 20rpx auto;
- margin-bottom: 40rpx;
- }
- }
- .under_review {
- margin-top: 100rpx;
- text-align: center;
- image {
- width: 150rpx;
- height: 150rpx;
- }
- .text {
- margin-top: 20rpx;
- }
- }
- }
- </style>
|