yangan
2 天以前 a28d0135ee42809b2c5863609da37155d3ecba5b
pages/quality-inspection-page/symbNa-sampling/symbNa-sampling-form/symbNa-sampling-form.vue
@@ -25,18 +25,22 @@
          borderBottom
          ref="item1"
      >
        <u-cell-group>
        <u--input
            v-model="modelForm.bunkerName"
            border="none"
        ></u--input>
<!--        <u-cell-group>
          <u-cell
              value="请选择"
              @click="handleBunkerIdClick">
            <view slot="value" class="u-slot-value">
              <u--input
              <u&#45;&#45;input
                  v-model="modelForm.bunkerName"
                  border="none"
              ></u--input>
              ></u&#45;&#45;input>
            </view>
          </u-cell>
        </u-cell-group>
        </u-cell-group>-->
      </u-form-item>
      <u-form-item
@@ -63,15 +67,27 @@
      </u-form-item>
      <u-form-item
          label="采样人:"
          prop="name"
          prop="samplingPerson"
          borderBottom
          ref="item1"
      >
        <u--input
        <u-cell-group>
          <u-cell
              value="请选择"
              @click.native="handleBunkerIdClick">
            <view slot="value" class="u-slot-value">
              <u--input
                  v-model="modelForm.samplingPerson"
                  border="none"
              ></u--input>
            </view>
          </u-cell>
        </u-cell-group>
<!--        <u&#45;&#45;input
            v-model="modelForm.samplingPerson"
            border="none"
            disabled
        ></u--input>
        ></u&#45;&#45;input>-->
      </u-form-item>
      <u-form-item
          label="采样日期:"
@@ -91,9 +107,13 @@
    </u--form>
    <view class="meicang-box">
      <u-action-sheet
          @select="selectBunker"
          :show="bunkerShow"
          :actions="bunkerList">
          title="选择采样员"
          :closeOnClickOverlay="true"
          :closeOnClickAction="true"
          @select="selectsamplingPerson"
          :show="samplingPersonShow"
          @close="samplingPersonShow = false"
          :actions="samplingPersonList">
      </u-action-sheet>
    </view>
  </view>
@@ -104,6 +124,7 @@
import {getStatesOne} from "../../../../utils/status";
import { BaseUrl } from '@/api/request.js'
const dayjs = require('dayjs')
import { mapGetters } from 'vuex';
export default {
  name: "yanGaiMei-sampling-form",
  components: {
@@ -114,11 +135,11 @@
      customerIdList: [],
      bunkerShow: false,
      bunkerList:[],
      samplingPersonShow: false,
      modelForm: {
        id:'',
        batchNumber:'',
        samplingTime: '', //采集日期
        bunkerId:'',
        bunkerName:'',
        samplingPerson: '',
        exterior:'无色透明粘稠液体',  //外观
@@ -140,15 +161,13 @@
          type: 'string',
          required: true,
          message: '请选择采样地点',
          trigger: ['blur', 'change']
          trigger: ['blur']
        }]
      }
    }
  },
  computed: {
    samplingPerson() {
      return uni.getStorageSync('nameKey');
    }
    ...mapGetters(['samplingPersonList'])
  },
  onReady() {
    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
@@ -164,17 +183,11 @@
        return
      })
    }
    this.modelForm.samplingTime = todayDate('ymd'); //当前时间
    this.modelForm.samplingPerson = uni.getStorageSync('name')
    this.modelForm.samplingTime = todayDate('ymd hm'); //当前时间
    this.deptId = uni.getStorageSync('userInfo').deptIds
    console.log(uni.getStorageSync('userInfo'),'userInfo==========')
    console.log(this.deptId,'deptId==========')
    this.getClaimCustomerList()
    if(uni.getStorageSync('bunkerList')) {  //缓存有数据拿数据
      this.bunkerList = uni.getStorageSync('bunkerList')
    }else {  //没拿到数据调一遍接口
      this.$store.dispatch('getBunkerList')
    }
    this.$store.dispatch('getSamplingPerson')
    // console.log(getStatus('roleType'),'roleType-----')
    // console.log(getStatus('customerId'),'customerId-----')
    // console.log(getStatus('userInfo'),'userInfo-----')
@@ -183,7 +196,7 @@
  },
  methods: {
    getClaimCustomerList() {  //供应商列表  type 类型 0/外部 1/内部(化验单的属于外部客户)
      this.$reqGet('getClaimCustomerList',{type:'0'}).then(res => {
      this.$reqGet('getClaimCustomerList',{personnelType:1,type:0,deptId:this.deptId}).then(res => {
        console.log(res,'供应商那个=====')
        if(res.code == 0) {
          this.customerIdList = res.data.map(item => {
@@ -196,13 +209,13 @@
      })
    },
    handleBunkerIdClick() {  //打开取样地点弹框
      this.bunkerShow = true
      this.samplingPersonShow = true
    },
    selectBunker(v) { //采样地点
    selectsamplingPerson(v) { //采样地点
      console.log(v,'v======')
      this.modelForm.bunkerId = v.id
      this.modelForm.bunkerName = v.name
      this.bunkerShow = false
      this.modelForm.samplingPerson = v.name
      this.modelForm.samplingSignAddress = v.imgPath
      this.samplingPersonShow = false
    },
    handleSubmit() {  //确定
      console.log(this.modelForm,'this.modelForm===')
@@ -210,6 +223,7 @@
        title: '加载中'
      })
      this.$refs.uForm.validate().then(res => {
        this.modelForm.samplingTime = dayjs(this.modelForm.samplingTime).format("YYYY-MM-DD HH:mm:ss")
        this.$reqPost('zjqualitycheck',this.modelForm,'json').then(res => {
          if(res) {
            uni.hideLoading();
@@ -236,6 +250,13 @@
    max-height: 85vh;
    overflow-y: auto;
  }
  .u-icon__icon{
    font-size: 34rpx!important;
    top: 12rpx;
  }
  .inputs{
    width: 100%;
  }
}
@mixin commonBtn($h:62rpx){
  background-image: linear-gradient(to right,#497bfb,#2467fd);
@@ -252,14 +273,13 @@
      transition: all 0.3s;
    }
    .u-action-sheet__item-wrap__item{
      align-items: flex-start;
      text{
        font-size: 28rpx;
      }
    }
    .u-popup__content{
      .u-line{
        border-bottom-width: 0px!important;
        //border-bottom-width: 0px!important;
      }
    }
    .u-form{