| | |
| | | > |
| | | <jp-select-plus |
| | | :isLineFeed="false" |
| | | isLoading |
| | | isSearch |
| | | color="#497bfb" |
| | | placeholder="请选择" |
| | |
| | | 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--input |
| | | v-model="modelForm.bunkerName" |
| | | border="none" |
| | | ></u--input> |
| | | ></u--input> |
| | | </view> |
| | | </u-cell> |
| | | </u-cell-group> |
| | | </u-cell-group>--> |
| | | |
| | | </u-form-item> |
| | | <u-form-item |
| | |
| | | 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--input |
| | | v-model="modelForm.samplingPerson" |
| | | border="none" |
| | | disabled |
| | | ></u--input> |
| | | ></u--input>--> |
| | | </u-form-item> |
| | | <div class="sumbmit-box"> |
| | | <u-button @click="handleSubmit" type="primary" v-if="submitShow">确 定</u-button> |
| | |
| | | </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> |
| | |
| | | import { todayDate } from '@/utils/util.js'; |
| | | import {getStatesOne} from "../../../../utils/status"; |
| | | import { BaseUrl } from '@/api/request.js' |
| | | const dayjs = require('dayjs') |
| | | export default { |
| | | name: "yanGaiMei-sampling-form", |
| | | components: { |
| | |
| | | return { |
| | | submitShow:true, |
| | | customerIdList: [], |
| | | bunkerShow: false, |
| | | bunkerList:[], |
| | | samplingPersonShow: false, |
| | | samplingPersonList:[], |
| | | modelForm: { |
| | | id:'', |
| | | batchNumber:'', |
| | | customerId:'', //供应商 |
| | | customerName:'', //供应商 |
| | | samplingTime: '', //采集日期 |
| | | bunkerId:'', |
| | | // bunkerId:'', |
| | | bunkerName:'', |
| | | samplingPerson: '', |
| | | type: 7, //1 EDC、2 PVC、3 硫酸、4 氢氧化钠 5 液氯 6、原盐钙镁 7、原盐TOC 8、原盐全检 |
| | | samplingSignAddress:'', |
| | | type: 7, //1 EDC、2 聚氯乙烯树脂、3 硫酸、4 氢氧化钠 5 液氯 6、原盐钙镁 7、原盐TOC 8、原盐全检 |
| | | }, |
| | | filedId:'', |
| | | customerIdShow: false, |
| | |
| | | type: 'string', |
| | | required: true, |
| | | message: '请选择采样地点', |
| | | trigger: ['blur'] |
| | | }], |
| | | tonnage:[{ |
| | | type: 'number', |
| | | required: true, |
| | | message: '请输入吨数', |
| | | trigger: ['blur', 'change'] |
| | | }] |
| | | } |
| | |
| | | this.$refs.uForm.setRules(this.rules) |
| | | }, |
| | | onLoad(opt) { |
| | | |
| | | if(opt.params) { //查看 |
| | | this.submitShow = false |
| | | this.modelForm = Object.assign({},JSON.parse(opt.params)) |
| | | console.log(this.modelForm,'接收到上个页面传过来的参数===') |
| | | return |
| | | this.$nextTick(() => { |
| | | this.modelForm = Object.assign({},JSON.parse(opt.params)) |
| | | console.log(this.modelForm,'this.modelForm----------上个页面传过来的数据----') |
| | | if(this.modelForm.samplingTime) { |
| | | this.modelForm.samplingTime = dayjs(this.modelForm.samplingTime).format('YYYY-MM-DD HH:mm') |
| | | } |
| | | return |
| | | }) |
| | | } |
| | | this.modelForm.samplingTime = todayDate(); //当前时间 |
| | | 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') |
| | | this.samplingPersonList = uni.getStorageSync('samplingPersonList') |
| | | }else { //没拿到数据调一遍接口 |
| | | this.$store.dispatch('getBunkerList') |
| | | this.$store.dispatch('getSamplingPerson') |
| | | } |
| | | |
| | | |
| | | // console.log(getStatus('roleType'),'roleType-----') |
| | | // console.log(getStatus('customerId'),'customerId-----') |
| | | // console.log(getStatus('userInfo'),'userInfo-----') |
| | |
| | | }, |
| | | methods: { |
| | | getClaimCustomerList() { //供应商列表 type 类型 0/外部 1/内部(化验单的属于外部客户) |
| | | this.$reqGet('getClaimCustomerList',{type:'0'}).then(res => { |
| | | this.$reqGet('getClaimCustomerPageList',{personnelType:1,type:0,deptId:this.deptId}).then(res => { |
| | | console.log(res,'供应商那个=====') |
| | | if(res.code == 0) { |
| | | this.customerIdList = res.data.map(item => { |
| | |
| | | name: item.name |
| | | } |
| | | }) |
| | | console.log(this.customerIdList,'this.customerIdList===') |
| | | } |
| | | }) |
| | | }, |
| | | 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 |
| | | }, |
| | | toConfirmHandle(v) { //供应商 |
| | | console.log(v,'v====供应商==') |
| | |
| | | title: '加载中' |
| | | }) |
| | | this.$refs.uForm.validate().then(res => { |
| | | this.modelForm.samplingTime = dayjs(this.modelForm.samplingTime).format("YYYY-MM-DD HH:mm:ss") //传参时间要带分 否则报错 |
| | | this.$reqPost('rawSaltsSampling',this.modelForm,'json').then(res => { |
| | | if(res) { |
| | | uni.hideLoading(); |
| | |
| | | |
| | | }, |
| | | inputVal(val) { |
| | | let temp = val.replace(/[^0-9.]+/g,'') |
| | | let temp = val.toString().replace(/[^0-9.]+/g,'') |
| | | this.$nextTick(() => { |
| | | this.modelForm.tonnage = temp |
| | | this.modelForm.tonnage = Number(temp) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep{ |
| | | .u-transition{ |
| | | min-height: 10vh; |
| | | 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); |
| | | height: $h!important; |
| | |
| | | transition: all 0.3s; |
| | | } |
| | | .u-action-sheet__item-wrap__item{ |
| | | padding: 0; |
| | | align-items: flex-start; |
| | | min-height: 160rpx; |
| | | max-height: 600rpx; |
| | | text{ |
| | | font-size: 28rpx; |
| | | } |
| | | } |
| | | .u-popup__content{ |
| | | .u-line{ |
| | | border-bottom-width: 0px!important; |
| | | //border-bottom-width: 0px!important; |
| | | } |
| | | } |
| | | .u-form{ |