1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195 |
- <template>
- <view class="warp">
- <view class="top">
- <view class="top-left">{{warehouseName}}</view>
- <view>{{binNumber}}仓位</view>
- </view>
- <view class="content">
- <view class="row">
- <view class="left">任务编号</view>
- <view @click='inOutShow=true'>{{detailData.inOutTaskNo ? detailData.inOutTaskNo : "暂未获取到任务编号"}}</view>
- <u-picker :range="inOutNoList" range-key="inOutTaskNo" @confirm='inOutChange' v-model="inOutShow"
- mode="selector">
- </u-picker>
- </view>
- <view class="row row-bottom">
- <view class="left">合同编号</view>
- <!-- <view @click='slectcontractNo'>{{detailData.contractNo}}</view> -->
- <input v-model='detailData.contractNo' style="width: 200px;" class="right-bottom" placeholder="暂未获取到合同编号" disabled=""></input>
- </view>
- <view class="row">
- <view class="left" style="width: 100px;">提示</view>
- <view class="right" style="text-align: right;">{{detailData.tips}}</view>
- </view>
- <view class="row">
- <view class="left">货名</view>
- <view class="right">{{detailData.goodsName ? detailData.goodsName : "选择合同,自动获取"}}
- </view>
- </view>
- <view class="row row-bottom" v-if="detailData.inOutType == '销售出库'">
- <view class="left">价格(元/吨)</view>
- <input type="digit" v-model='detailData.cost' class="right-bottom"
- placeholder="输入价格"></input>
- </view>
- <!-- <view class="row">
- <view class="left">类型</view>
- <view @click='show1=true'>{{detailData.type}}</view>
- <u-picker :range="typeList" range-key="type" @confirm='typePicker($event)' v-model="show1"
- mode="selector">
- <view class="">{{detailData.type}}</view>
- </u-picker>
- </view> -->
- <view class="row row-bottom">
- <view class="left">毛重(吨)</view>
- <input type="digit" @input='calculate' v-model='detailData.grossWeight' class="right-bottom"
- placeholder="输入毛重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">皮重(吨)</view>
- <input type="digit" @input='calculate' v-model='detailData.tare' class="right-bottom"
- placeholder="输入皮重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">净重(吨)</view>
- <input v-model='netWeight' disabled class="right-bottom" placeholder="不可编辑,自动计算"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type == '潮粮'">
- <view class="left">扣重比</view>
- <input type="digit" v-model='detailData.buckleWeightRatio' class="right-bottom" placeholder="输入扣重比"
- @input="pureWeightCount"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type == '潮粮'">
- <view class="left">干粮水分(%)</view>
- <input type="digit" v-model='detailData.solidGrainWater' class="right-bottom" placeholder="输入干粮水分占比"
- @input="pureWeightCount"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type == '潮粮'">
- <view class="left">潮粮水分(%)</view>
- <input type="digit" v-model='detailData.tidalGrainWater' class="right-bottom" placeholder="输入潮粮水分占比"
- @input="pureWeightCount"></input>
- </view>
- <view class="row row-bottom" v-if="detailData.type == '潮粮'">
- <view class="left">纯重(吨)</view>
- <input v-model='detailData.pureWeight' class="right-bottom" placeholder="不可编辑,自动计算"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">运费(元/吨)</view>
- <input v-model='detailData.freight' class="right-bottom" placeholder="输入运费"></input>
- </view>
- <view class="row">
- <view class="left">品级</view>
- <view @click='show3=true'>{{detailData.grade}}</view>
- <u-picker :range="pjList" range-key="type" @confirm='pjPicker($event)' v-model="show3" mode="selector">
- </u-picker>
- </view>
- <view class="row">
- <view class="left">经办人</view>
- <view @click='show6=true'>{{detailData.agent}}</view>
- <u-picker :range="handlerList" range-key="staffName" @confirm='handlerPicker($event)' v-model="show6"
- mode="selector">
- </u-picker>
- </view>
- <view class="row">
- <view class="left">出库日期</view>
- <view @click='show7=true'>{{detailData.inOutDate}}</view>
- <u-picker v-model="show7" mode="time" @confirm='dateChange($event)' :params="params">
- </u-picker>
- </view>
- <view class="row row-bottom">
- <view class="left">出库类型</view>
- <input v-model='detailData.inOutType' class="right-bottom" :disabled="isSelectType"
- placeholder="自动获取"></input>
- <!-- <u-picker :range="warehousingTypeList" range-key="constValue" @confirm='warehousingTypePicker($event)'
- v-model="show5" mode="selector">
- </u-picker> -->
- </view>
- <view class="row">
- <view class="left">出库方式</view>
- <view @click='show8=true'>{{detailData.outType?detailData.outType:'汽运'}}</view>
- <u-picker v-model="show8" mode="selector" range-key="name" :range="multiSelector"
- @confirm='outtypeChange($event)'>
- </u-picker>
- </view>
- <view class="row row-bottom" v-if="detailData.outType!='火运' && detailData.outType!='散船'">
- <!-- <view class="left">车牌号</view>
- <input v-if="!isPC" v-model='detailData.carNo' class="right-bottom" placeholder="请输入车牌号"></input>
- <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
- <view class="left">车牌号</view>
- <!-- 他运合同车牌号输入 -->
- <!-- <input v-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true" class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></input> -->
- <view v-show="showCar" @click="carno = true" v-if="detailData.inOutType == '移库出库'|| (showCar&&contractType=='1')"><!-- showCar = true时为自运 carjudge为切换状态 contractType==1 为销售合同-->
- <view v-if="detailData.tranCarNo">
- {{detailData.carNo?detailData.carNo +'('+detailData.tranCarNo+')':"请选择车牌号"}}
- </view>
- <view v-else>
- {{detailData.carNo?detailData.carNo:"请选择车牌号"}}
- </view>
- </view>
- <input v-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true" class="right-bottom" placeholder="请输入车牌号" v-else ></input>
-
- <master-keyboard ref="keyboard" keyboardtype="car" :randomNumber="true" :newCar="false" :defaultValue="detailData.carNo" @keyboardClick="handleClick"></master-keyboard>
- <!-- <view @click='slectCarNo' v-if="isPC">{{detailData.carNo}}</view> -->
- <!-- 自运合同车牌号需下拉 -->
- <u-picker :range="carList" range-key="carNo1" @confirm='carPicker($event)' v-model="carno"
- mode="selector">
- </u-picker>
- <!-- <view type="success" @click="carNoTypeChange" class="carNo_but" v-if="showCar||carjudge" v-show="showCar">{{carChange1}}</view> -->
- </view>
- <view class="row row-bottom" v-if="detailData.outType=='火运'">
- <view class="left">车号</view>
- <input v-model='detailData.carNo' class="right-bottom" placeholder="请输入车号"></input>
- </view>
- <view v-if='detailData.outType=="集装箱船"||!detailData.outType||detailData.outType=="汽运"'
- class="row row-bottom">
- <view class="left">箱号</view>
- <input v-model='detailData.boxNo' class="right-bottom" placeholder="请输入箱号" type="digit"></input>
- <input v-model='detailData.boxNoOther' class="right-bottom" type="digit" placeholder="请输入箱号"></input>
- </view>
- <view v-if='!detailData.outType||detailData.outType=="汽运" || detailData.outType=="集装箱船"'
- class="row row-bottom">
- <view class="left">封号</view>
- <input v-model='detailData.titleNo' class="right-bottom" placeholder="请输入封号" type="digit"></input>
- <input v-model='detailData.titleNoOther' class="right-bottom" placeholder="请输入封号" type="digit"></input>
- </view>
- <view v-if='detailData.outType=="火运"' class="row row-bottom">
- <view class="left">车厢号</view>
- <input v-model='detailData.wingNumber' @input="toUpperCase2" class="right-bottom" placeholder="请输入车厢号"
- type="digit"></input>
- <input v-model='detailData.wingNumberOther' @input="toUpperCase3" class="right-bottom"
- placeholder="请输入车厢号" type="digit"></input>
- </view>
- <view v-if='detailData.outType=="散船"' class="row row-bottom">
- <view class="left">航次</view>
- <input v-model='detailData.shipNumber' class="right-bottom" placeholder="请输入航次"></input>
- </view>
- <view v-if='detailData.outType=="散船"' class="row row-bottom">
- <view class="left">船名</view>
- <input v-model='detailData.shipName' class="right-bottom" placeholder="请输入船名"></input>
- </view>
- </view>
- <view class="content2">
- <view class="left">上传磅单</view>
- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
- :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
- @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
- </view>
- <view class="content1">
- <view class="title">
- 质检数据(选填)
- </view>
- <view class="row row-bottom">
- <view class="left">质检员</view>
- <input v-model='detailData.warehouseInOutDetail.qualityInspector' class="right-bottom"
- placeholder="输入质检员姓名"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">水分(%)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.waterContent' class="right-bottom"
- placeholder="输入水分占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">容重(克/升)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.bulkDensity' class="right-bottom"
- placeholder="输入容重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">热损伤(%)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.jiaorenli' class="right-bottom"
- placeholder="输入热损伤占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">杂质(%)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.impurity' class="right-bottom"
- placeholder="输入杂质占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">霉变粒(%)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.mildewGrain' class="right-bottom"
- placeholder="输入霉变粒占比"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">不完善粒(%)</view>
- <input type="digit" v-model='detailData.warehouseInOutDetail.imperfectGrain' class="right-bottom"
- placeholder="输入不完善粒占比"></input>
- </view>
- </view>
- <u-toast ref="uToast" />
- <view class="bottom-btn">
- <u-button type="primary" class="submit" hover-class="none" @click="submit(1)">暂存</u-button>
- <u-button type="primary" class="submit" hover-class="none" @click="submit(2)">提交</u-button>
- </view>
- <u-popup v-model="isShowPrint" class="popup" @close="close" mode="bottom" border-radius="30" :closeable="true">
- <view class="buns_item">
- <view class="but_css" @click="print">打印小票</view>
- <view class="but_css" @click="close">返回</view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import upload from '@/components/upload.vue';
- import helper from '@/common/helper.js';
- import keyboard from "@/components/master-keyboard/master-keyboard.vue";
- import {
- mapState
- } from 'vuex';
- export default {
- components: {
- upload,
- keyboard
- },
- data() {
- return {
- weightbills: {},
- isShowPrint: false,
- show: false,
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- show5: false,
- show6: false,
- show7: false,
- isPC: true,
- show8: false,
- carno: false,
- usestart: '',
- multiSelector: [{
- name: '汽运',
- value: '0'
- },
- {
- name: '火运',
- value: '1'
- },
- {
- name: '集装箱船',
- value: '2'
- },
- {
- name: '散船',
- value: '3'
- },
- ],
- show9: false,
- multiSelector1: [{
- name: '汽运',
- value: '0'
- },
- {
- name: '火运',
- value: '1'
- },
- {
- name: '集装箱船',
- value: '2'
- },
- {
- name: '散船',
- value: '3'
- },
- ],
- isSelectType: true,
- // contractNoList: [{
- // contractNo: ""
- // }],
- typeList: [{
- type: "干粮"
- },
- {
- type: "潮粮"
- }
- ],
- pjList: [{
- type: "一等品"
- },
- {
- type: "二等品"
- },
- {
- type: "三等品"
- },
- {
- type: "等外"
- }
- ],
- handlerList: [],
- warehousingTypeList: [],
- action: this.$uploadUrl,
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- btnLoading: false, //防止重复点击
- isAdd: true,
- warehouseName: '',
- binNumber: '',
- detailData: {
- outType: '汽运',
- contractNo: "",
- type: "干粮",
- grade: "请输入品级",
- agent: "请选择经办人",
- inOutDate: "请选择出库日期",
- inOutType: "请选择出库类型",
- warehouseInOutDetail: {},
- gradeKey: "",
- grossWeight: "",
- tare: "",
- tips: '',
- cost:'',
- carNo:'',
- selfLoading:"0",
- goodsName:"",
- },
- params: {
- year: true,
- month: true,
- day: true,
- },
- netWeight: "",
- inOutShow: false,
- inOutNoList: [],
- carList: [], //车牌号下拉
- showCar: false,
- carChange1:"手动填写",
- carjudge:false,
- contractType:"",
- contractList:[],
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- watch: {
- netWeight: function(v) {
- this.pureWeightCount()
- },
- },
- onLoad(options) {
- this.id = options.id
- this.cangId = options.cangId
- this.binNumber = helper.erpWarehouse.binNumber
- this.warehouseName = helper.erpWarehouse.warehouseName
- //查看任务编号
- // this.inOutNo()
- },
- onShow() {
- uni.showLoading({
- title:"加载中...",
- mask:true
- })
- // let _data = uni.getStorageSync('erpContractNoCK') == '' ? {} : uni.getStorageSync('erpContractNoCK')
- // if(_data.goodsName){
- // this.detailData.goodsName = _data.goodsName;
- // }
- // this.detailData.inOutType = _data.inOutType ? _data.inOutType : '';
- // if (this.detailData.inOutType == '销售出库') {
- // this.detailData.inOutTypeKey = 1
- // } else if (this.detailData.inOutType == '移库出库') {
- // this.detailData.inOutTypeKey = 3
- // } else if (this.detailData.inOutType == '暂存出库') {
- // this.detailData.inOutTypeKey = 4
- // } else if (this.detailData.inOutType == '贸易服务出库') {
- // this.detailData.inOutTypeKey = 5
- // } else if (this.detailData.inOutType == '采购出库') {
- // this.detailData.inOutTypeKey = 6
- // }
- // if (_data.contractNo) {
- // this.detailData.contractNo = _data.contractNo;
- // }
- // this.detailData.goodsNameKey = _data.goodsNameKey ? _data.goodsNameKey : '';
- // if (!_data.tranCarInfoList) {
- // this.isPC = false
- // _data.tranCarInfoList = []
- // } else {
- // this.isPC = true
- // if (uni.getStorageSync('ContractNoCarCK')) {
- // this.detailData.carNo = uni.getStorageSync('ContractNoCarCK')
- // } else {
- // this.detailData.carNo = _data.tranCarInfoList[0].carNo
- // }
- // }
- // if (this.detailData.carNo) {
- // for (let i = 0; i < uni.getStorageSync('erpContractNoCK').tranCarInfoList.length; i++) {
- // if (uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].carNo == this.detailData.carNo)
- // this.detailData.tranCarNo = uni.getStorageSync('erpContractNoCK').tranCarInfoList[i].tranCarNo
- // }
- // }
- // if (!this.detailData.contractNo) {
- // this.detailData.contractNo = '请选择合同编号'
- // } else {
- // if (_data.tranCarInfoList.length == 0) {
- // this.isPC = false
- // }
- // }
- if (!this.detailData.goodsName) {
- this.detailData.goodsName = '暂无'
- }
- let _day = new Date();
- _day.setTime(_day.getTime());
- this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
- //出库类型
- this.outWarehouse()
- if (helper.erpWarehouse.personCharge) {
- this.detailData.agent = helper.erpWarehouse.personCharge
- }
- //经办人
- this.handler()
- this.inOutNo()
- },
- methods: {
- //切换车牌号输入状态
- carNoTypeChange(){
- this.carjudge = !this.carjudge
- if(!this.carjudge){
- this.detailData.selfLoading = "0"
- this.carChange1="手动填写"
- }else{
- this.detailData.selfLoading = "1"
- this.carChange1="识别下拉"
- }
- },
- print() {
- uni.navigateTo({
- url: '/pages/erpbusiness/exbleConnect'
- })
- },
- close() {
- this.isShowPrint = false
- uni.navigateBack({})
- },
- hidden(){
- this.$refs.keyboard.open(false)
- },
- handleShowKeyboard(){
- if(this.$refs.keyboard.open){
- this.$refs.keyboard.open(true)//true 键盘显示 false 键盘隐藏
- }else{
- this.$refs.keyboard[0].open(true)
- }
- },
- handleClick(e){
- this.detailData.carNo = e.value //键盘输入值
- },
- inOutNo() {
- uni.showLoading({
- title:"加载中...",
- mask:true
- })
- var that=this
- this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
- flag: 1,
- warehouseName: this.warehouseName,
- agentKey: this.userInfo.id
- }).then(res => {
- if(res.data.data.length == 0){
- this.$api.msg('暂无出库任务')
- }else{
- this.inOutNoList = res.data.data
- this.detailData.goodsNameKey = res.data.data[0].goodsNameKey
- this.detailData.inOutTaskNo = this.inOutNoList[0].inOutTaskNo ? this.inOutNoList[0]
- .inOutTaskNo : ''
- this.detailData.agent = this.inOutNoList[0].agent
- if (this.inOutNoList[0].contractNo) {
- this.detailData.contractNo = this.inOutNoList[0].contractNo
- } else {
- this.detailData.contractNo = this.inOutNoList[0].moveTaskNo
- }
- this.detailData.goodsName = this.inOutNoList[0].goodsName
- this.detailData.goodsNameKey = this.inOutNoList[0].goodsNameKey
- this.detailData.grade = this.inOutNoList[0].grade
- this.detailData.inOutType = this.inOutNoList[0].inOutType
- if (this.detailData.inOutType == '销售出库') {
- this.detailData.inOutTypeKey = 1
- } else if (this.detailData.inOutType == '移库出库') {
- this.detailData.inOutTypeKey = 3
- } else if (this.detailData.inOutType == '暂存出库') {
- this.detailData.inOutTypeKey = 4
- } else if (this.detailData.inOutType == '贸易服务出库') {
- this.detailData.inOutTypeKey = 5
- } else if (this.detailData.inOutType == '采购出库') {
- this.detailData.inOutTypeKey = 6
- }
- }
- this.$api.doRequest('get', '/contractManagementInfo/getOutContract', {
- contractNo:this.detailData.contractNo,compId:uni.getStorageSync('pcUserInfo').compId
- }).then(res => {
- if (res.data.code == 200) {
- this.contractList = res.data.data
- // "MYCGYMHLJ2021102401"
- if (this.detailData.inOutType == '销售出库') {
- this.detailData.tips = '买方' + res.data.data.buyer
- if(res.data.data.unitContractPrice){
- this.detailData.cost=res.data.data.unitContractPrice
- }
- } else if (this.detailData.inOutType == '移库出库') {
- this.detailData.tips = '入货库' + this.inOutNoList[0].receiveWarehouse
- }
- if(this.detailData.inOutType != '移库出库'){
- this.contractType = res.data.data.contractType //获取合同类型 用于判断输入车牌号
- }
-
- //如果查到该合同
- // res.data.data[i].deliverType = !res.data.data[i].deliverType?'1':res.data.data[i].deliverType
- if (res.data.data.deliverType == '1') { //判断自运1,他运2合同
- that.showCar = true
- } else {
- that.showCar = false
- }
- if (res.data.data.tranCarInfoList) {
- for(var num = 0 ; num < res.data.data.tranCarInfoList.length; num++){
- res.data.data.tranCarInfoList[num].carNo1 = res.data.data.tranCarInfoList[num].carNo + '('+res.data.data.tranCarInfoList[num].tranCarNo+')'
- }
- this.carList = res.data.data.tranCarInfoList //车牌号下拉列表
- }
- uni.hideLoading()
- }
- })
- })
- // this.$api.doRequest('get', 'warehouseBaseInfo/selectContractNoList', ).then(res => {
- // this.contractNoList = res.data.data
- // for (var i = 0; i < this.contractNoList.length; i++) {
- // if (this.contractNoList[i].contractNo == this.detailData.contractNo) {
- // if (this.detailData.inOutType == '销售出库') {
- // this.detailData.tips = '买方' + this.contractNoList[i].buyer
- // } else if (this.detailData.inOutType == '移库出库') {
- // this.detailData.tips = '入货库' + this.inOutNoList[0].warehouseName
- // }
- // }
- // }
- // })
- },
- inOutChange(e) {
- console.log(e)
- this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
- this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
- this.detailData.goodsName = this.inOutNoList[e[0]].goodsName
- this.detailData.goodsNameKey = this.inOutNoList[e[0]].goodsNameKey
- this.detailData.grade = this.inOutNoList[e[0]].grade
- // this.detailData.inOutType = this.inOutNoList[e[0]].inOutType
- this.weightbills.goodsName = this.inOutNoList[e[0]].goodsName
- // this.contractType = this.inOutNoList[e[0]].contractType //获取合同类型 用于判断输入车牌号
- this.detailData.agent = this.inOutNoList[e[0]].agent
- if (this.inOutNoList[e[0]].contractNo) {
- this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
- } else {
- this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
- }
- this.$api.doRequest('get', '/contractManagementInfo/getOutContract', {
- contractNo:this.detailData.contractNo,compId:uni.getStorageSync('pcUserInfo').compId
- }).then(res => {
- this.contractList=res.data.data
- if(this.detailData.inOutType != '移库出库'){
- this.contractType = this.contractList.contractType //获取合同类型 用于判断输入车牌号
- }
- if (this.contractList.deliverType == '1') { //判断自运1,他运2合同
- this.showCar = true
- } else {
- this.showCar = false
- }
- if (res.data.data.tranCarInfoList) {
- for(var num = 0 ; num < res.data.data.tranCarInfoList.length; num++){
- res.data.data.tranCarInfoList[num].carNo1 = res.data.data.tranCarInfoList[num].carNo + '('+res.data.data.tranCarInfoList[num].tranCarNo+')'
- }
- this.carList = res.data.data.tranCarInfoList //车牌号下拉列表
- }
- else{
- this.carList = []
- }
- if (this.detailData.inOutType == '销售出库') {
- this.detailData.inOutTypeKey=1
- this.weightbills.buyer = this.inOutNoList[e[0]].buyer
- if(uni.getStorageSync('compName1')){
- this.weightbills.seller = uni.getStorageSync('compName1').company
- }
- if (this.contractList.unitContractPrice) {
- this.detailData.tips = '买方' + this.contractList.buyer +
- '( ' +
- this.contractList.unitContractPrice +
- '元/吨)'
- this.detailData.cost=this.contractList.unitContractPrice
- } else {
- this.detailData.tips = '买方' + this.contractList.buyer
- this.detailData.cost=''
- }
- } else if (this.detailData.inOutType == '移库出库') {
- this.detailData.inOutTypeKey=3
- this.weightbills.buyer = this.inOutNoList[e[0]].receiveWarehouse
- if(uni.getStorageSync('compName1')){
- this.weightbills.seller = uni.getStorageSync('compName1').company
- }
- this.detailData.tips = '入货库' + this.inOutNoList[e[0]].receiveWarehouse
- }
- })
-
-
- },
- toUpperCase(val) {
- this.detailData.boxNo = val.detail.value.toUpperCase()
- },
- toUpperCase1(val) {
- this.detailData.boxNoOther = val.detail.value.toUpperCase()
- },
- usestartChange(e) {
- this.usestart = this.multiSelector1[e].name
- },
- //计算纯重
- pureWeightCount() {
- if (this.netWeight && this.detailData.buckleWeightRatio && this.detailData.solidGrainWater && this
- .detailData.tidalGrainWater) {
- // 纯重=净重x[100-(潮粮水分-干粮水分)x扣重比]/100
- this.detailData.pureWeight = 100 - (this.detailData.tidalGrainWater - this.detailData
- .solidGrainWater) * this.netWeight * this.detailData.buckleWeightRatio / 100
- this.detailData.pureWeight = this.detailData.pureWeight.toFixed(3)
- }
- },
- outtypeChange(e) {
- this.detailData.outType = this.multiSelector[e].name
- console.log(e)
- },
- toUpperCase2(val) {
- this.detailData.wingNumber = val.detail.value.toUpperCase()
- },
- toUpperCase3(val) {
- this.detailData.wingNumberOther = val.detail.value.toUpperCase()
- },
- outWarehouse() {
- this.$api.doRequest('get', '/commonSysParameter/getInfo', {
- constId: 'CON6'
- }).then(res => {
- this.warehousingTypeList = res.data.data
- })
- },
- handler() {
- this.$api.doRequest('get', '/staff/query/getStaffListByCompIdAndWarehouseId', {
- compId: helper.erpWarehouse.compId,
- warehouseId: helper.erpWarehouse.warehouseId
- }).then(res => {
- this.handlerList = res.data.data
- })
- },
- contractNopicker(e) {
- },
- typePicker(e) {
- this.detailData.type = this.typeList[e].type
- },
- pjPicker(e) {
- this.detailData.gradeKey = e[0] + 1
- this.detailData.grade = this.pjList[e].type
- },
- handlerPicker(e) {
- this.detailData.agentKey = e[0]
- this.detailData.agent = this.handlerList[e].staffName
- },
- dateChange(e) {
- this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
- },
- warehousingTypePicker(e) {
- this.detailData.inOutType = this.warehousingTypeList[e].constValue
- if (this.detailData.inOutType == '销售出库') {
- this.detailData.inOutTypeKey = 1
- } else if (this.detailData.inOutType == '移库出库') {
- this.detailData.inOutTypeKey = 3
- } else if (this.detailData.inOutType == '暂存出库') {
- this.detailData.inOutTypeKey = 4
- } else if (this.detailData.inOutType == '贸易服务出库') {
- this.detailData.inOutTypeKey = 5
- } else if (this.detailData.inOutType == '采购出库') {
- this.detailData.inOutTypeKey = 6
- }
- },
- filterFileType(index, lists) {
- if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
- lists.splice(index, 1);
- // 当前文件不支持
- uni.showModal({
- title: '暂不支持当前图片类型',
- showCancel: false
- });
- } else {
- this.isAdd = false;
- }
- },
- calculate() {
- if (this.detailData.grossWeight && this.detailData.tare) {
- this.netWeight =(this.detailData.grossWeight - this.detailData.tare).toFixed(3)
- }
- },
- getImgUrl(res) {
- this.detailData.addressUrl = res
- },
- onError(error) {
- console.log('------------error-----------')
- console.log(error)
- },
- binNumberpicker(e) {
- this.detailData.binNumber = this.positionList[e[0]].binNumber
- },
- carPicker(e) {
- // this.detailData.gradeKey = e[0] + 1
- // this.detailData.tranCarNo = this.carList[e].tranCarNo
- this.detailData.carNo = this.carList[e].carNo
- this.detailData.tranCarNo = this.carList[e].tranCarNo
- this.detailData.carId = this.carList[e].id
- },
- onProgress(e) {},
- onRemove() {
- this.detailData.addressUrl = ""
- },
- submit(num) {
- if (!this.detailData.inOutTaskNo) {
- this.$api.msg('暂无出库任务')
- return
- }
- if (!this.detailData.contractNo) {
- this.$api.msg('合同编号不能为空')
- return
- }
- if (!this.detailData.goodsName) {
- this.$api.msg('货名不能为空')
- return
- }
- if (!this.detailData.grossWeight && num == 2) {
- this.$api.msg('毛重不能为空')
- return
- }
- if (isNaN(this.detailData.grossWeight) ||
- (String(this.detailData.grossWeight).indexOf('.') != -1 &&
- String(this.detailData.grossWeight).length -
- (String(this.detailData.grossWeight).indexOf('.') + 1) >
- 3) ||
- this.detailData.grossWeight < 0 ||
- this.detailData.grossWeight > 10000
- ) {
- this.$api.msg('毛重输入错误!')
- return
- }
- if (!this.detailData.tare && num == 2) {
- this.$api.msg('皮重不能为空')
- return
- }
- if (isNaN(this.detailData.tare) ||
- (String(this.detailData.tare).indexOf('.') != -1 &&
- String(this.detailData.tare).length -
- (String(this.detailData.tare).indexOf('.') + 1) >
- 3) ||
- this.detailData.tare < 0 ||
- this.detailData.tare > 10000
- ) {
- this.$api.msg('皮重输入错误!')
- return
- }
- if (Number(this.detailData.tare) > Number(this.detailData.grossWeight)) {
- this.$api.msg('皮重不能大于毛重')
- return
- }
- if (this.netWeight <= 0 && num == 2) {
- this.$api.msg('净重不能小于等于0')
- return
- }
- if (this.detailData.type == "潮粮") {
- if (!this.detailData.buckleWeightRatio && num == 2) {
- this.$api.msg('扣重比不能为空')
- return
- }
- if (isNaN(this.detailData.buckleWeightRatio) ||
- (String(this.detailData.buckleWeightRatio).indexOf('.') != -1 &&
- String(this.detailData.buckleWeightRatio).length -
- (String(this.detailData.buckleWeightRatio).indexOf('.') + 1) >
- 2) ||
- this.detailData.buckleWeightRatio < 0 ||
- this.detailData.buckleWeightRatio > 3
- ) {
- this.$api.msg('扣重比输入错误!')
- return
- }
- if (!this.detailData.solidGrainWater && num == 2) {
- this.$api.msg('干粮水分不能为空')
- return
- }
- if (isNaN(this.detailData.solidGrainWater) ||
- (String(this.detailData.solidGrainWater).indexOf('.') != -1 &&
- String(this.detailData.solidGrainWater).length -
- (String(this.detailData.solidGrainWater).indexOf('.') + 1) >
- 1) ||
- this.detailData.solidGrainWater < 1 ||
- this.detailData.solidGrainWater > 40
- ) {
- this.$api.msg('干粮水分输入错误!')
- return
- }
- if (!this.detailData.tidalGrainWater && num == 2) {
- this.$api.msg('潮粮水分不能为空')
- return
- }
- if (isNaN(this.detailData.tidalGrainWater) ||
- (String(this.detailData.tidalGrainWater).indexOf('.') != -1 &&
- String(this.detailData.tidalGrainWater).length -
- (String(this.detailData.tidalGrainWater).indexOf('.') + 1) >
- 1) ||
- this.detailData.tidalGrainWater < 1 ||
- this.detailData.tidalGrainWater > 40
- ) {
- this.$api.msg('潮粮水分输入错误!')
- return
- }
- if (this.detailData.tidalGrainWater <= this.detailData.solidGrainWater) {
- this.$api.msg('潮粮水分输入错误!')
- return
- }
- if (!this.detailData.pureWeight && num == 2) {
- this.$api.msg('纯重不能为空')
- return
- }
- }
- if (this.detailData.grade == "请输入品级" && num == 2) {
- this.$api.msg('品级不能为空')
- return
- }
- if (!this.detailData.cost && this.detailData.inOutType == '销售出库'&& num == 2) {
- this.$api.msg('价格不能为空')
- return
- }
- if (this.detailData.agent == "请选择经办人") {
- this.$api.msg('经办人不能为空')
- return
- }
- if (this.detailData.inOutDate == "请选择出库日期") {
- this.$api.msg('出库日期不能为空')
- return
- }
- if (this.detailData.inOutType == "请选择出库类型") {
- this.$api.msg('出库类型不能为空')
- return
- }
- if (this.detailData.outType == "集装箱船" || this.detailData.outType == "汽运") {
- if (!this.detailData.carNo && num == 2) {
- this.$api.msg('车牌号不能为空')
- return
- }
- if (this.detailData.carNo.length != 7) {
- this.$api.msg('车牌号输入有误!')
- return
- }
- }
- if (!this.detailData.addressUrl && num == 2) {
- this.$api.msg('请上传磅单')
- return
- }
- if (this.detailData.warehouseInOutDetail.qualityInspector) {
- if (this.detailData.warehouseInOutDetail.qualityInspector.length < 2 || this.detailData.warehouseInOutDetail
- .qualityInspector.length > 10) {
- this.$api.msg('质检员姓名需要2-10个字')
- return
- }
- }
- if (this.detailData.warehouseInOutDetail.waterContent) {
- if (this.detailData.type == "潮粮" && this.detailData.warehouseInOutDetail.waterContent != this
- .detailData.tidalGrainWater) {
- this.$api.msg('水分占比与潮粮水分不一致')
- return
- }
- if (this.detailData.type == "干粮") {
- if (this.detailData.warehouseInOutDetail.waterContent < 0 || this.detailData.warehouseInOutDetail
- .waterContent > 40) {
- this.$api.msg('水分占比输入错误')
- return
- }
- }
- if (String(this.detailData.warehouseInOutDetail.waterContent).indexOf('.') != -1 && String(this
- .detailData.warehouseInOutDetail.waterContent).length - (String(
- this.detailData.warehouseInOutDetail.waterContent).indexOf('.') + 1) > 1) {
- this.$api.msg('水分占比输入错误')
- return
- }
- }
- if (this.detailData.warehouseInOutDetail.bulkDensity) {
- if (this.detailData.warehouseInOutDetail.bulkDensity < 500 || this.detailData.warehouseInOutDetail
- .bulkDensity > 1000) {
- this.$api.msg('容重输入错误')
- return
- }
- if (String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 && String(this
- .detailData.warehouseInOutDetail.bulkDensity).length - (
- String(this.detailData.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) > 0) {
- this.$api.msg('容重输入错误')
- return
- }
- }
- if(this.detailData.goodsName!='小麦'){
- if (this.detailData.warehouseInOutDetail.jiaorenli) {
- if (this.detailData.warehouseInOutDetail.jiaorenli < 0 || this.detailData.warehouseInOutDetail
- .jiaorenli > 40) {
- this.$api.msg('热损伤占比输入错误')
- return
- }
- if (String(this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') != -1 && String(this
- .detailData
- .warehouseInOutDetail.jiaorenli).length - (String(
- this.detailData.warehouseInOutDetail.jiaorenli).indexOf('.') + 1) > 1) {
- this.$api.msg('热损伤占比输入错误')
- return
- }
- }
- }
- if (this.detailData.warehouseInOutDetail.impurity) {
- if (this.detailData.warehouseInOutDetail.impurity < 0 || this.detailData.warehouseInOutDetail
- .impurity > 40) {
- this.$api.msg('杂质占比输入错误')
- return
- }
- if (String(this.detailData.warehouseInOutDetail.impurity).indexOf('.') != -1 && String(this.detailData
- .warehouseInOutDetail.impurity).length - (String(
- this.detailData.warehouseInOutDetail.impurity).indexOf('.') + 1) > 1) {
- this.$api.msg('杂质占比输入错误')
- return
- }
- }
- if (this.detailData.warehouseInOutDetail.mildewGrain) {
- if (this.detailData.warehouseInOutDetail.mildewGrain < 0 || this.detailData.warehouseInOutDetail
- .mildewGrain > 40) {
- this.$api.msg('霉变粒占比输入错误')
- return
- }
- if (String(this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') != -1 && String(this
- .detailData
- .warehouseInOutDetail.mildewGrain).length - (String(
- this.detailData.warehouseInOutDetail.mildewGrain).indexOf('.') + 1) > 1) {
- this.$api.msg('霉变粒占比输入错误')
- return
- }
- }
- if (this.detailData.warehouseInOutDetail.imperfectGrain) {
- if (this.detailData.warehouseInOutDetail.imperfectGrain < 0 || this.detailData.warehouseInOutDetail
- .imperfectGrain > 40) {
- this.$api.msg('不完善粒占比输入错误')
- return
- }
- if (String(this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') != -1 && String(this
- .detailData
- .warehouseInOutDetail.imperfectGrain).length - (String(
- this.detailData.warehouseInOutDetail.imperfectGrain).indexOf('.') + 1) > 1) {
- this.$api.msg('不完善粒占比输入错误')
- return
- }
- }
- if(!this.showCar){//若自运的合同该字段置空
- this.detailData.selfLoading = ""
- }
- if (this.detailData.boxNo) {
- this.detailData.boxNo = this.detailData.boxNo.toUpperCase()
- }
- if (this.detailData.boxNoOther) {
- this.detailData.boxNoOther = this.detailData.boxNoOther.toUpperCase()
- }
- this.detailData.baseId = helper.erpWarehouse.warehouseId
- this.detailData.warehouseName = helper.erpWarehouse.warehouseName
- this.detailData.positionId = helper.erpWarehouse.positionId
- this.detailData.binNumber = this.binNumber
- this.detailData.compId = helper.erpWarehouse.compId
- this.detailData.netWeight = this.netWeight
- this.detailData.inOutFlag = 1
- this.detailData.taskType = "出库任务"
- this.detailData.pcFlag = 0
- let title = ""
- if (num == 1) {
- this.detailData.statusFlag = 1
- this.detailData.backOffice = this.userInfo.userName
- this.detailData.backOfficeId = this.userInfo.id
- title = "暂存成功"
- } else if (num == 2) {
- this.detailData.statusFlag = 3
- this.detailData.backOffice = this.userInfo.userName
- this.detailData.backOfficeId = this.userInfo.id
- title = "提交成功"
- }
- let that = this
- uni.showModal({
- content: "确定提交出库信息?",
- success(res) {
- if (res.confirm) {
- uni.showLoading({
- title: "正在提交",
- mask: true
- })
- that.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse',
- that.detailData).then(res => {
- console.log(res, "报异常")
- if (res.data.code == 200) {
- that.weightbills.carNo = that.detailData.carNo
- that.weightbills.boxNo = that.detailData.boxNo
- that.weightbills.boxNoOther = that.detailData.boxNoOther
- that.weightbills.wingNumber = that.detailData.wingNumber
- that.weightbills.wingNumberOther = that.detailData.wingNumberOther
- that.weightbills.shipName = that.detailData.shipName
- that.weightbills.shipNumber = that.detailData.shipNumber
- that.weightbills.type = that.detailData.type
- that.weightbills.grossWeight = that.detailData.grossWeight
- that.weightbills.tare = that.detailData.tare
- that.weightbills.netWeight = that.detailData.netWeight
- that.weightbills.outType = that.detailData.outType
- that.weightbills.backOffice = that.detailData.outType
- var date = new Date()
- that.weightbills.updateDate = date.getFullYear() + '-' + (date
- .getMonth() + 1) + '-' + date.getDate() + ' ' + date
- .getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
- that.$api.msg(title)
- that.isShowPrint = true
- uni.setStorageSync("exWarehousing_print", that.weightbills)
- // setTimeout(() => {
- // uni.navigateBack()
- // }, 1000)
- } else {
- that.$api.msg(res.data.message)
- }
- uni.hideLoading()
- })
- .catch(res => {
- uni.hideLoading()
- })
- }
- }
- })
- },
- slectcontractNo() {
- uni.navigateTo({
- url: '/pages/erp/exWarehousing/selectContractNo?flag=' + 5
- })
- },
- slectCarNo() {
- uni.navigateTo({
- url: '/pages/erp/exWarehousing/selectCarNo'
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- uni-page-body {
- overflow: hidden;
- }
- .warp {
- margin: 10rpx;
- padding: 20rpx 20rpx 300rpx 20rpx;
- .top {
- display: flex;
- margin-bottom: 20rpx;
- align-items: center;
- .top-left {
- margin-right: 20rpx;
- }
- }
- }
- .content,
- .content1,
- .content2 {
- border-radius: 20rpx;
- background: white;
- padding: 20rpx;
- .title {
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- }
- .row {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
- padding: 21rpx 0;
- .right,
- input {
- font-size: 28rpx;
- color: #333333;
- }
- }
- .row-bottom {
- // border: 0;
- .right-bottom {
- width: 280rpx;
- text-align: right;
- }
- }
- }
- .content1 {
- margin-top: 20rpx;
- }
- .content2 {
- margin-top: 10px;
- // display: flex;
- align-items: center;
- .left {
- margin-right: 20px;
- }
- }
- .submit {
- width: 40%;
- background: #22C572;
- border-radius: 10rpx;
- }
- .edit-btn {
- background: #22C572;
- width: 100rpx;
- height: 50rpx;
- margin: 0;
- color: white;
- }
- .has-btn {
- align-items: center;
- }
- .bottom-btn {
- padding: 30rpx;
- background: #FFFFFF;
- width: 92%;
- position: fixed;
- bottom: 0rpx;
- display: flex;
- z-index: 9999;
- }
- .buns_item {
- display: flex;
- padding: 80rpx 0 50rpx 0;
- justify-content: space-around;
- }
- .but_css {
- background: #22C572;
- width: 40%;
- padding: 20rpx;
- color: #fff;
- text-align: center;
- border-radius: 20rpx;
- }
- .carNo_but{
- // padding: 2rpx 5rpx;
- background: #19be6b;
- line-height: 50rpx;
- text-align: center;
- width: 130rpx!important;
- height: 50rpx;
- color: #FFFFFF;
- border-radius: 10rpx;
- }
- </style>
|