12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187 |
- <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' class="right-bottom" placeholder="未获取到合同编号" disabled></input>
- </view>
- <view class="row">
- <view class="left">提示</view>
- <view class="right">{{detailData.tips}}</view>
- </view>
- <view class="row">
- <view class="left">货名</view>
- <view class="right">{{detailData.goodsName}}</view>
- </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">
- </u-picker>
- </view>
- <view class="row row-bottom">
- <view class="left">毛重(吨)</view>
- <input type="digit" @input='calculate' name="grossWeight" v-model='detailData.grossWeight'
- class="right-bottom" placeholder="输入毛重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">皮重(吨)</view>
- <input type="digit" @input='calculate' name="tare" v-model='detailData.tare' class="right-bottom"
- placeholder="输入皮重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">扣重(吨)</view>
- <input type="digit" @input='calculate' v-model='detailData.deductionWeight' class="right-bottom"
- placeholder="输入扣重"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">净重(吨)</view>
- <input type="number" v-model='netWeight' class="right-bottom" placeholder="不可编辑,自动计算"
- :disabled="true"></input>
- </view>
- <view class="row row-bottom">
- <view class="left">扣款(元/吨)</view>
- <input type="digit" v-model='detailData.deductionAmount' 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 type="digit" @input='calculate' v-model='detailData.pureWeight' class="right-bottom"
- placeholder="不可编辑,自动计算" :disabled="true"></input>
- </view>
- <view class="row">
- <view class="left">品级</view>
- <view @click='show3=true'>{{detailData.grade}}</view>
- <u-picker :range="pjList" range-key="grade" @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='show4=true'>{{detailData.inOutDate}}</view>
- <u-picker v-model="show4" 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" @click="selectType"
- 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-model='detailData.carNo' @click.stop="handleShowKeyboard":disabled="true" class="right-bottom" placeholder="请输入车牌号" v-if="!showCar"></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> -->
- <!-- 自运合同车牌号需下拉 -->
- <view v-show="showCar" @click="carno = true">{{detailData.carNo? detailData.carNo+'('+detailData.tranCarNo+')':"请选择车牌号"}}</view>
- <u-picker :range="carList" range-key="carNo1" @confirm='carPicker($event)' v-model="carno"
- mode="selector">
- </u-picker>
- </view>
- <!-- 移库入库显示入库重量() -->
- <view class="row row-bottom">
- <view class="left">入库重量(吨)</view>
- <input type="digit" name="grossWeight" v-model='detailData.loadNetWeight'
- class="right-bottom" placeholder="请输入入库重量"></input>
- </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 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" placeholder="请输入箱号" type="digit"></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.binNo' class="right-bottom" placeholder="请输入仓位号"></input>
- </view>
- <view class="row row-bottom has-btn">
- <view class="left">成本(元/吨)</view>
- <input type="digit" v-model='detailData.cost' class="right-bottom" placeholder="自动获取"
- :disabled="isEditCB"></input>
- <!-- <input type="number" v-if="detailData.inOutType!='采购入库'" v-model='detailData.cost' class="right-bottom"
- placeholder="自动获取" :disabled="isEditCB"></input> -->
- <u-button class="edit-btn" hover-class="none" @click="editCB">编辑</u-button>
- </view>
- <view class="row row-bottom has-btn">
- <view class="left">运费(元/吨)</view>
- <input type="digit" @input='' v-model='detailData.freight' :disabled="isEditYF" class="right-bottom"
- placeholder="自动获取"></input>
- <u-button class="edit-btn" hover-class="none" @click="editYF">编辑</u-button>
- </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>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- import upload from '@/components/upload.vue';
- import helper from '@/common/helper.js';
- import keyboard from "@/components/master-keyboard/master-keyboard.vue";
- export default {
- components: {
- upload,
- keyboard
- },
- data() {
- return {
- show: false,
- show1: false,
- show2: false,
- show3: false,
- show4: false,
- show5: false,
- show6: false,
- isPC: true,
- carno: false,
- isSelectType: true,
- inOutShow: false,
- params: {
- year: true,
- month: true,
- day: true,
- },
- isEditCB: true,
- isEditYF: true,
- warehouseName: '',
- binNumber: '',
- contractNoList: [],
- multiSelector: [{
- name: '汽运',
- value: '0'
- },
- {
- name: '火运',
- value: '1'
- },
- {
- name: '集装箱船',
- value: '2'
- },
- {
- name: '散船',
- value: '3'
- },
- ],
- typeList: [{
- type: "干粮"
- },
- {
- type: "潮粮"
- }
- ],
- pjList: [{
- grade: "一等品"
- },
- {
- grade: "二等品"
- },
- {
- grade: "三等品"
- },
- {
- grade: "等外"
- }
- ],
- inOutNoList: [],
- show8: false,
- handlerList: [],
- warehousingTypeList: [{
- constValue: '移库入库'
- }, {
- constValue: '退库'
- }],
- action: this.$uploadUrl,
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- btnLoading: false, //防止重复点击
- isAdd: true,
- netWeight: "",
- inOutDate1: "",
- contractNoList: [],
- detailData: {
- contractNo: "请选择合同编号",
- carNo: '',
- type: "干粮",
- goodsName: "",
- inOutDate: '请选择入库日期',
- grade: "一等品",
- agent: '请选择经办人',
- inOutType: '请选择入库类型',
- deductionWeight: '',
- grossWeight: '',
- tare: '',
- deductionAmount: '',
- netWeight: 0,
- cost: 0,
- warehouseInOutDetail: {},
- tips: '',
- carNo:''
- },
- carList: [], //车牌号下拉
- showCar: false,
- }
- },
- onLoad(options) {
- this.binNumber = helper.erpWarehouse.binNumber
- this.warehouseName = helper.erpWarehouse.warehouseName
- this.compId = helper.erpWarehouse.compId
- let _day = new Date();
- _day.setTime(_day.getTime());
- this.detailData.inOutDate = _day.getFullYear() + "-" + (_day.getMonth() + 1) + "-" + _day.getDate();
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- onShow() {
- uni.showLoading({
- title: "加载中...",
- mask: true
- })
- let _data = uni.getStorageSync('erpContractNo') == '' ? {} : uni.getStorageSync('erpContractNo')
- if (helper.erpWarehouse.personCharge)
- this.detailData.agent = helper.erpWarehouse.personCharge
- this.detailData.goodsName = _data.goodsName;
- this.detailData.contractNo = _data.contractNo;
- this.detailData.goodsNameKey = _data.goodsNameKey;
- this.detailData.inOutType = _data.inOutType;
- if (_data.unitContractPrice) {
- this.detailData.cost = _data.unitContractPrice
- }
- if (_data.inOutType == '采购入库') {
- this.detailData.freight = 0
- } else if (_data.inOutType == '移库入库') {
- this.isSelectType = false
- } else {
- this.detailData.freight = uni.getStorageSync('CarFreight')
- this.isSelectType = true
- }
- if (!_data.tranCarInfoList) {
- this.isPC = false
- // this.detailData.carNo = ""
- // this.detailData.cost = ""
- // _data.tranCarInfoList = []
- } else {
- this.isPC = true
- uni.setStorageSync('erpContractNoCarList', _data.tranCarInfoList);
- this.detailData.freight = uni.getStorageSync('erpcarNo').tranPrice
- if (uni.getStorageSync('ContractNoCar')) {
- this.detailData.carNo = uni.getStorageSync('ContractNoCar')
- this.$api.doRequest('get', '/warehouseBaseInfo/selectCost', {
- contractNo: this.detailData.contractNo,
- carNo: this.detailData.carNo
- }).then(res => {
- if (res.data.code == 200) {
- this.detailData.cost = res.data.data
- }
- })
- } else {
- this.detailData.carNo = _data.tranCarInfoList[0].carNo
- }
- }
- if (this.detailData.carNo) {
- var tranCarInfoList = uni.getStorageSync('erpContractNo').tranCarInfoList ? uni.getStorageSync(
- 'erpContractNo').tranCarInfoList : []
- for (let i = 0; i < tranCarInfoList.length; i++) {
- if (tranCarInfoList[i].carNo == this.detailData.carNo)
- this.detailData.tranCarNo = 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 = '货名'
- }
- // 获取任务编号
- this.inOutNo()
- //获取经办人
- this.getPerson()
- },
- watch: {
- netWeight: function(v) {
- this.pureWeightCount()
- },
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- methods: {
- 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() {
- let that = this
- this.$api.doRequest('get', '/inOutWarehouseTask/selectInOutWarehouseNo', {
- flag: 2,
- warehouseName: this.warehouseName,
- agentKey: this.userInfo.id
- }).then(res => {
- if(res.data.data.length == 0){
- this.$api.msg('暂无入库任务')
- }
- this.inOutNoList = res.data.data
- if (this.inOutNoList.length > 0) {
- this.detailData.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', '/warehouseBaseInfo/selectContractNoList', {
- flag: 7,
- compId: helper.erpWarehouse.compId,
- }).then(res => {
- if (res.data.code == 200) {
- for (let i = 0; i < res.data.data.length; i++) {
- // "MYCGYMHLJ2021102401"
- if (res.data.data[i].contractNo == this.detailData
- .contractNo) {
- uni.setStorageSync('erpContractNo',res.data.data[i])//如果查到该合同
- if (res.data.data[i].inOutType == '采购入库') {
- if (res.data.data[i].unitContractPrice) {
- this.detailData.tips = '卖方' + res.data.data[i].seller +
- '( ' +
- res.data.data[i].unitContractPrice +
- '元/吨)'
- } else {
- this.detailData.tips = '卖方' + res.data.data[i].seller
- }
-
- } else if (res.data.data[i].inOutType == '移库入库') {
- this.detailData.tips = '出货库' + this.inOutNoList[0].sendWarehouse
- } else if (res.data.data[i].inOutType == '退库') {
- this.detailData.tips = '出货库' + this.inOutNoList[0].sendWarehouse
- }
- if (res.data.data[i].deliverType == "1") { //判断自运1,他运2合同
- this.showCar = true
- } else {
- this.showCar = false
- }
- if (res.data.data[i].tranCarInfoList) {
- for(var num = 0 ; num < res.data.data[i].tranCarInfoList.length; num++){
- res.data.data[i].tranCarInfoList[num].carNo1 = res.data.data[i].tranCarInfoList[num].carNo + '('+res.data.data[i].tranCarInfoList[num].tranCarNo+')'
- }
- this.carList = res.data.data[i].tranCarInfoList //车牌号下拉列表
- }
- }
- }
- uni.hideLoading()
- }
- })
- }
- })
- },
- inOutChange(e) {
- this.detailData.inOutTaskNo = this.inOutNoList[e[0]].inOutTaskNo
- this.detailData.agent = this.inOutNoList[e[0]].agent
- if (this.inOutNoList[e[0]].contractNo) {
- uni.setStorageSync('erpContractNo',this.inOutNoList[e[0]])
- this.detailData.contractNo = this.inOutNoList[e[0]].contractNo
- } else {
- this.detailData.contractNo = this.inOutNoList[e[0]].moveTaskNo
- }
- 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
- 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].seller + '(' + this.contractNoList[i]
- .unitContractPrice + '元/吨)'
- } else if (this.detailData.inOutType == '移库入库') {
- if (this.contractNoList[i].unitContractPrice) {
- this.detailData.tips = '出货库' + this.inOutNoList[e[0]].sendWarehouse + '(' + this
- .contractNoList[i].unitContractPrice + '元/吨)'
- } else {
- this.detailData.tips = '出货库' + this.inOutNoList[e[0]].sendWarehouse
- }
- } else if (this.detailData.inOutType == '退库') {
- if (this.contractNoList[i].contractNo) {
- this.deptBudgetList.tips = '买方' + this.contractNoList[i].buyer
- } else {
- this.deptBudgetList.tips = '出货库' + this.inOutNoList[e[0]].warehouseName
- }
- }
- }
- }
- },
- toUpperCase(val) {
- this.detailData.boxNo = val.detail.value.toUpperCase()
- },
- toUpperCase2(val) {
- this.detailData.wingNumber = val.detail.value.toUpperCase()
- },
- toUpperCase3(val) {
- this.detailData.wingNumberOther = val.detail.value.toUpperCase()
- },
- toUpperCase1(val) {
- this.detailData.boxNoOther = val.detail.value.toUpperCase()
- },
- usestartChange(e) {
- this.usestart = this.multiSelector1[e].name
- },
- outtypeChange(e) {
- this.detailData.outType = this.multiSelector[e].name
- },
- selectType() {
- if (this.isSelectType) return
- this.show5 = true
- },
- //计算纯重
- 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)
- }
- },
- getPerson() {
- this.$api.doRequest('get', '/staff/query/getStaffListByCompId', {
- compId: this.compId
- }).then(res => {
- this.handlerList = res.data.data
- })
- },
- getrkType() {
- this.$api.doRequest('get', '/commonSysParameter/getInfo', {
- constId: 'CON5'
- }).then(res => {
- this.warehousingTypeList = res.data.data
- })
- },
- contractNopicker(e) {},
- typePicker(e) {
- console.log(e)
- this.detailData.type = this.typeList[e].type
- },
- pjPicker(e) {
- this.detailData.gradeKey = e[0] + 1
- this.detailData.grade = this.pjList[e].grade
- },
- carPicker(e) {
- // this.detailData.gradeKey = e[0] + 1
- this.detailData.carNo = this.carList[e[0]].carNo
- this.detailData.tranCarNo = this.carList[e[0]].tranCarNo
- // this.detailData.carNo = this.carList[e].carNo
- // this.detailData.tranCarNo = this.carList[e].tranCarNo
- this.detailData.carId = this.carList[e[0]].id
- if(this.detailData.inOutType=='移库入库'){
- if(!this.detailData.cost){
- this.detailData.cost=this.carList[e[0]].cost
- }
- this.detailData.loadNetWeight=this.carList[e[0]].loadNetWeight
- }
- },
- handlerPicker(e) {
- console.log(e)
- this.detailData.agent = this.handlerList[e].staffName
- },
- dateChange(e) {
- console.log(e)
- this.detailData.inOutDate = e.year + "-" + e.month + "-" + e.day
- this.inOutDate1 = e.year + "-" + e.month + "-" + e.day + "-" + e.hour + "-" + e.minute + "-" + e.second
- },
- 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
- }
- let _data = uni.getStorageSync('erpContractNo') == '' ? {} : uni.getStorageSync('erpContractNo')
- if (this.detailData.inOutType == '采购入库') {
- this.detailData.freight = 0
- } else {
- this.detailData.freight = uni.getStorageSync('CarFreight')
- }
- },
- 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() {
- const query = uni.createSelectorQuery().in(this);
- query.selectAll('.left')
- console.log(query)
- this.netWeight = (this.detailData.grossWeight - this.detailData.tare - this.detailData.deductionWeight)
- .toFixed(2)
- },
- getImgUrl(res) {
- this.detailData.addressUrl = res
- console.log(res)
- console.log('------------res-----------')
- },
- onError(error) {
- alert(error)
- console.log('------------error-----------')
- console.log(error)
- },
- contractNopicker(e) {
- // this.detailData.goodsName=this.contractNoList[e[0]].goodsName
- // this.detailData.contractNo=this.contractNoList[e[0]].contractNo
- },
- binNumberpicker(e) {
- this.detailData.binNumber = this.positionList[e[0]].binNumber
- },
- getWeighingManagement() {
- this.$api.doRequest('get', '/weighingManagement/getWeighingManagement', {
- id: this.id
- }).then(res => {
- if (res.data.code == 200) {
- console.log(res)
- this.detailData = res.data.data
- }
- })
- this.$api.doRequest('get', '/warehouseBaseInfo/getWarehouse', {
- id: this.cangId
- }).then(res => {
- if (res.data.code == 200) {
- this.positionList = res.data.data.warehousePositionInfoList
- }
- })
- this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
- compId: '',
- flag: 5
- }).then(res => {
- if (res.data.code == 200) {
- this.contractNoList = res.data.data
- }
- })
- },
- onProgress(e) {
- console.log(e)
- },
- onRemove(index) {},
- editCB() {
- this.isEditCB = false
- },
- editYF() {
- this.isEditYF = false
- },
- submit(num) {
- console.log(this.detailData)
- 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 (!this.detailData.deductionWeight && num == 2) {
- this.$api.msg('扣重不能为空')
- return
- }
- if (isNaN(this.detailData.deductionWeight) ||
- (String(this.detailData.deductionWeight).indexOf('.') != -1 &&
- String(this.detailData.deductionWeight).length -
- (String(this.detailData.deductionWeight).indexOf('.') + 1) >
- 3) ||
- this.detailData.deductionWeight < 0 ||
- this.detailData.deductionWeight > 10
- ) {
- 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.deductionAmount) ||
- (String(this.detailData.deductionAmount).indexOf('.') != -1 &&
- String(this.detailData.deductionAmount).length -
- (String(this.detailData.deductionAmount).indexOf('.') + 1) >
- 2) ||
- this.detailData.deductionAmount < 0 ||
- this.detailData.deductionAmount > 10000
- ) {
- this.$api.msg('扣款输入错误!')
- return
- }
- if (!this.detailData.deductionAmount && 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 == "请输入品级") {
- 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.carNo) {
- this.$api.msg('车牌号不能为空')
- return
- }
- if (this.detailData.carNo.length != 7) {
- this.$api.msg('车牌号输入有误!')
- return
- }
- if(this.detailData.moveTaskNo){
- if (this.detailData.loadNetWeight) {
- this.$api.msg('入库重量不能为空!')
- return
- }
- }
-
- if (!this.detailData.addressUrl && num == 2) {
- this.$api.msg('请上传磅单')
- return
- }
- // if(!this.detailData.cost){
- // this.detailData.cost=0
- // }
- // if (!this.detailData.cost && num == 2) {
- // this.$api.msg('未获取到成本,请编辑后提交')
- // return
- // }
- if (String(this.detailData.cost).indexOf('.') != -1 && String(this.detailData
- .cost).length - (String(
- this.detailData.cost).indexOf('.') + 1) > 2) {
- this.$api.msg('成本输入错误')
- return
- }
- if (this.detailData.cost < 0 || this.detailData.cost > 20000) {
- this.$api.msg('成本输入错误')
- return
- }
- if (!this.detailData.freight && num == 2) {
- this.$api.msg('运费不能为空')
- return
- }
- if (this.detailData.warehouseInOutDetail.qualityInspector) {
- if (this.detailData.warehouseInOutDetail.qualityInspector < 2 || this.detailData
- .warehouseInOutDetail
- .qualityInspector > 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
- }
- }
- 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.goodsNameKey = uni.getStorageSync('erpContractNo').goodsNameKey;
- this.detailData.compId = helper.erpWarehouse.compId
- this.detailData.netWeight = this.netWeight
- this.detailData.backOffice = this.userInfo.userName
- this.detailData.backOfficeId = this.userInfo.id
- this.detailData.inOutFlag = 2
- this.detailData.taskType = "入库任务"
- this.detailData.pcFlag = 0
- let title = ""
- if (num == 1) {
- this.detailData.statusFlag = 1
- title = "暂存成功"
- } else if (num == 2) {
- this.detailData.statusFlag = 3
- title = "提交成功"
- }
- let that = this
- uni.showModal({
- content: "确定提交入库信息?",
- success(res) {
- if (res.confirm) {
- that.$api.doRequest('post', '/warehouseInOutInfo/api/newInOutWarehouse',
- that.detailData).then(res => {
- if (res.data.code == 200) {
- that.$api.msg(title)
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- } else {
- that.$api.msg(res.data.message)
- }
- })
- }
- }
- })
- },
- // slectcontractNo() {
- // uni.navigateTo({
- // url: '/pages/erp/warehousing/selectContractNo?compId=' + this.compId
- // })
- // },
- slectCarNo() {
- uni.navigateTo({
- url: '/pages/erp/warehousing/selectCarNo'
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- uni-page-body {
- overflow: hidden;
- }
- .warp {
- margin: 10rpx;
- padding: 20rpx 20rpx 300rpx 20rpx;
- .top {
- border-radius: 20rpx;
- background: white;
- padding: 20rpx;
- 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;
- }
- .left{
- width: 220rpx;
- }
- .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;
- }
- </style>
|