123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746 |
- // 出库登记
- <template>
- <div class="container">
- <el-row>
- <el-col :span="20">
- <h2 class="bg-left title">{{information}}</h2>
- </el-col>
- <el-col :span="4" class="bg-right">
- <el-button class="bg-bottom" type="primary" size="small" @click="revert()"><img width="6" height="10"
- style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
- </el-button>
- </el-col>
- </el-row>
- <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
- <div class="basicInformation">
- <h2>
- {{ deptBudgetList.warehouseName }}
- <span class="position" v-show="this.deptBudgetList.warehouseType == 1">
- {{ deptBudgetList.binNumber }}仓位
- </span>
- <span v-show="this.deptBudgetList.warehouseType == 2">(临)</span>
- </h2>
- <div class="small-title">基本信息</div>
- <ws-info-table>
- <!--任务编号-->
- <ws-form-item label="任务编号" span="1" prop="inOutTaskNo">
- <el-select filterable clearable v-model="deptBudgetList.inOutTaskNo" placeholder="请选择任务编号"
- class="typeselect" @change="contractNoChange">
- <el-option v-for="item in deptBudgetList1" :key="item.inOutTaskNo" :label="item.inOutTaskNo"
- :value="item.inOutTaskNo" />
- </el-select>
- </ws-form-item>
- <ws-form-item label="合同编号" span="1" prop="contractNo">
- <ws-select disabled v-model="deptBudgetList.contractNo" placeholder="请选择合同编号或移库任务编号" class="typeselect"
- @change='contractNoChange1'>
- <ws-option v-for="item in outContractNo" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="提示" span="1" prop="tips">
- <ws-input disabled v-model="deptBudgetList.tips"
- maxlength="20" size="small" />
- </ws-form-item>
- <!-- 货名 -->
- <ws-form-item label="货名" span="1">
- <ws-select disabled v-model="deptBudgetList.goodsName" placeholder class="typeselect"
- @change="selectgoodsName">
- <ws-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </ws-select>
- </ws-form-item>
- <ws-form-item label="类型" span="1" prop="type">
- <ws-select disabled v-model="deptBudgetList.type" @change="typeChange">
- <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
- </ws-select>
- </ws-form-item>
- <!--毛重(公斤)-->
- <ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
- <ws-input :disabled="allowEdit" @input="grossWeightchange" v-model="deptBudgetList.grossWeight"
- type="number" @mousewheel.native.prevent placeholder="请输入毛重" maxlength="20" size="small" />
- <el-button type="primary" v-if="information == '毛重检斤'" @click="openPort">重新获取</el-button>
- </ws-form-item>
- <!--皮重(公斤)-->
- <ws-form-item label="皮重(公斤)" span="1" prop="tare" class="readonly">
- <ws-input :disabled="allowEdit" @input="tarechange" v-model="deptBudgetList.tare" type="number"
- @mousewheel.native.prevent placeholder="请输入皮重" maxlength="100" size="small" />
- <el-button type="primary" v-if="information == '皮重检斤'" @click="openPort">重新获取</el-button>
- </ws-form-item>
- <!--净重(公斤)-->
- <ws-form-item label="净重(公斤)" span="1" prop="netWeight">
- <ws-input disabled v-model="deptBudgetList.netWeight" placeholder="不可编辑,自动计算" maxlength="120"
- size="small" />
- </ws-form-item>
- <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
- <ws-input @input='pureweight' v-model="deptBudgetList.buckleWeightRatio" type="number"
- @mousewheel.native.prevent placeholder="请输入扣重比" maxlength="100" size="small" />
- </ws-form-item>
- <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater"
- class="readonly">
- <ws-input @input='pureweight' v-model="deptBudgetList.solidGrainWater" type="number"
- @mousewheel.native.prevent placeholder="请输入干粮水分占比" maxlength="100" size="small" />
- </ws-form-item>
- <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater"
- class="readonly">
- <ws-input @input='pureweight' v-model="deptBudgetList.tidalGrainWater" type="number"
- @mousewheel.native.prevent placeholder="请输入潮粮水分占比" maxlength="100" size="small" />
- </ws-form-item>
- <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
- <ws-input disabled v-model="deptBudgetList.pureWeight" type="number" @mousewheel.native.prevent
- placeholder="不可编辑,自动计算" maxlength="100" size="small" />
- </ws-form-item>
- <!-- 品级 -->
- <ws-form-item label="品级" span="1" class="readonly">
- <ws-select v-model="deptBudgetList.grade" placeholder="" class="typeselect" @change="selectpackingMethod">
- <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </ws-select>
- </ws-form-item>
- <!--经办人-->
- <ws-form-item label="经办人" span="1" prop="agent">
- <el-select v-model="deptBudgetList.agent" placeholder="请选择经办人" filterable clearable @change="selectstaff">
- <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
- </el-select>
- </ws-form-item>
- <!--出库日期-->
- <ws-form-item label="出库日期" span="1" prop="inOutDate" class="deliverydate">
- <ws-date-picker v-model="deptBudgetList.inOutDate" type="date" placeholder="请选择出库日期"
- value-format="yyyy-MM-dd" />
- </ws-form-item>
- <!-- 出库类型 -->
- <ws-form-item label="出库类型" span="1">
- <ws-input v-model='deptBudgetList.inOutType' class="right-bottom" :disabled="isSelectType"
- placeholder='暂无' />
- <!-- <ws-select
- v-model="deptBudgetList.deliveryType"
- placeholder=""
- class="typeselect"
- @change="selectstorageType"
- >
- <ws-option
- v-for="item in deliveryType"
- :key="item.constKey"
- :label="item.constValue"
- :value="item.constValue"
- />
- </ws-select> -->
- </ws-form-item>
- <!--车牌号-->
- <ws-form-item label="车牌号" span="1" prop="carNo">
- <ws-input v-if="!carstatus" v-model="deptBudgetList.carNo" placeholder="请输入车牌号" maxlength="7"
- size="small" />
- <el-select v-if="carstatus" filterable clearable :filter-method="dataFilter2" v-model="deptBudgetList.carNo"
- placeholder="请选择车牌号" class="typeselect" @change="carChange">
- <el-option v-for="item in options2" :key="item.constKey" :label="item.carNo + '(' + item.tranCarNo + ')'"
- :value="item.carNo" />
- </el-select>
- </ws-form-item>
- <ws-form-item label="箱号-1" span="1" prop="boxNo">
- <ws-input v-model="deptBudgetList.boxNo" placeholder="请输入箱号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="箱号-2" span="1" prop="boxNoOther">
- <ws-input v-model="deptBudgetList.boxNoOther" placeholder="请输入箱号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="封号-1" span="1" prop="titleNo">
- <ws-input v-model="deptBudgetList.titleNo" placeholder="请输入封号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="封号-2" span="1" prop="titleNoOther">
- <ws-input v-model="deptBudgetList.titleNoOther" placeholder="请输入封号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="车厢号-1" span="1" prop="wingNumber">
- <ws-input v-model="deptBudgetList.wingNumber" placeholder="请输入车厢号" maxlength="20"
- size="small" />
- </ws-form-item>
- <ws-form-item label="车厢号-2" span="1" prop="wingNumberOther">
- <ws-input v-model="deptBudgetList.wingNumberOther" placeholder="请输入车厢号" maxlength="20"
- size="small" />
- </ws-form-item>
- </ws-info-table>
- </div>
- <!-- <div class="small-title">上传磅单照片</div>
- <el-upload
- action="https://www.zthymaoyi.com/upload/admin"
- :show-file-list="false"
- :on-success="
- (res) => {
- uploadSuccessHandle1(res)
- }
- "
- class="avatar-uploader"
- accept=".jpg, .jpeg, .png, .gif"
- ><el-button size="small" type="primary">点击上传</el-button>
- </el-upload>
- <div v-if='deptBudgetList.addressUrl!=""'>
- <img style='width:100px;height:100px;' :src="deptBudgetList.addressUrl" alt="">
- </div> -->
- <div class="small-title">化验数据(选填)</div>
- <div class="inspector">
- <!--自检员-->
- <!-- <ws-form-item label="质检员" span="1" prop="qualityInspector">
- <ws-input
- v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
- placeholder="请输入质检员姓名"
- maxlength="120"
- size="small"
- />
- </ws-form-item> -->
- <ws-form-item label="质检员" span="1" prop="qualityInspector">
- <el-select v-model="deptBudgetList.warehouseInOutDetail.qualityInspector" placeholder="请选择质检员" filterable
- clearable @change="qualityInspectorChange">
- <el-option v-for="item in qualityInspectorList" :key="item.value" :label="item.staffName"
- :value="item.staffName" />
- </el-select>
- </ws-form-item>
- </div>
- <div class="neifor">
- <ws-info-table>
- <!--水分(%)<=-->
- <ws-form-item label="水分(%)" span="1" prop="waterContent">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.waterContent" placeholder="请输入水分占比" maxlength="120"
- type="number" @mousewheel.native.prevent size="small" />
- </ws-form-item>
- <!--杂质(%)<=-->
- <ws-form-item label="杂质(%)" span="1" prop="impurity">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.impurity" placeholder="请输入杂质占比" type="number"
- @mousewheel.native.prevent maxlength="120" size="small" />
- </ws-form-item>
- <!--容重(克/升)>=-->
- <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.bulkDensity" placeholder="请输入容重" type="number"
- @mousewheel.native.prevent maxlength="120" size="small" />
- </ws-form-item>
- <!--霉变粒(%)<=-->
- <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.mildewGrain" placeholder="请输入霉变粒占比" maxlength="120"
- type="number" @mousewheel.native.prevent size="small" />
- </ws-form-item>
- <!--热损伤(%)<=-->
- <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.jiaorenli" placeholder="请输入热损伤占比" type="number"
- @mousewheel.native.prevent maxlength="120" size="small" />
- </ws-form-item>
- <!--不完善粒(%)<=-->
- <ws-form-item label="不完善粒(%)" span="1" prop="imperfectGrain">
- <ws-input v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain" placeholder="请输入不完善粒占比" type="number"
- @mousewheel.native.prevent maxlength="120" size="small" />
- </ws-form-item>
- </ws-info-table>
- </div>
- <div style="text-align: right; padding: 10px">
- <el-button v-if="information == '皮重检斤'" class="bg-bottom-up" size="small" @click="temporaryStorage()">保存
- </el-button>
- <el-button v-if="!allowEdit" class="bg-bottom-up" type="primary" size="small" @click="submit()">提交</el-button>
- </div>
- </ws-form>
- </div>
- </template>
- <script>
- import {
- pullDown,
- addstorageputList,
- goodsname,
- xialaNo,
- getstaff,
- goodsnameXiala,
- getReceiptTaskNo
- } from '@/model/warehouse/index'
- import Pagination from '@/components/Pagination'
- import WsUpload from '@/components/WsUpload'
- // import { dayjs, fmoney, EventBus } from 'base-core-lib'
- import {
- dayjs,
- EventBus
- } from 'base-core-lib'
- export default {
- name: 'viewSpareMoney',
- components: {
- WsUpload,
- Pagination,
- },
- watch: {
- isShow(val) {
- this.showType = val
- },
- },
- data() {
- return {
- deptBudgetList1: [],
- isSelectType: true,
- carstatus: false,
- qualityInspectorList: [],
- //弹出框
- dialogViewSpareMoney: false,
- dialogApproveFormVisible: false,
- // 船舶类型
- monetaryKey: null,
- // 表格显示数据
- tableDate: [],
- // 是否显示
- showType: true,
- readonly: true,
- // 年
- year: '',
- deptBudgetTotal: 0,
- currentPage: 1,
- pageSize: 10,
- searchType: 1,
- searchKeyWord: '',
- contractType: 2,
- startDate: null,
- endDate: null,
- goodnameList: {},
- // 提交类型
- submitType: true,
- deliveryType: [],
- typeList: ['干粮', '潮粮'],
- outContractNo: [],
- appendixIdsAdd: '',
- uploadSuccess: {},
- gradeList: [],
- agent: [],
- staffList: [],
- options: [],
- value: '',
- rules: {
- netWeight: [{
- required: true,
- type: 'number',
- message: '请输入活动名称',
- trigger: 'blur',
- }, ],
- },
- size: 10,
- compId: localStorage.getItem('ws-pf_compId'),
- skinInspector: localStorage.getItem('ws-pf_staffName'),
- deptCircularPage: {},
- packtypeList: {},
- date: {
- year: dayjs().format('YYYY'),
- month: dayjs().format('MM'),
- },
- contractList: [],
- deptBudgetList: {
- type: '干粮',
- addressUrl: '',
- warehouseInOutDetail: {},
- grossWeight: 0,
- tare: 0
- },
- historyList: [],
- pickerBeginDateBefore: {
- disabledDate: (time) => {
- return time.getTime() > Date.now()
- },
- },
- accessoryTFs: false,
- allowEdit: true,
- param: 9600,
- information: '',
- result1: '00'
- }
- },
- mounted() {
- this.information = this.$route.query.information
- if (this.$route.query.allowEdit == 1) {
- this.allowEdit = false
- } else {
- this.allowEdit = true
- }
- this.deptBudgetList.baseId = this.$route.query.baseId
- this.deptBudgetList.positionId = this.$route.query.positionId
- this.deptBudgetList.warehouseName = this.$route.query.warehouseName
- this.deptBudgetList.binNumber = this.$route.query.binNumber
- this.deptBudgetList.warehouseType = this.$route.query.warehouseType
- this.deptBudgetList.warehouseId = this.$route.query.warehouseId
- this.getList()
- getReceiptTaskNo({flag:1}).toPromise()
- .then((response) => {
- console.log(response)
- this.deptBudgetList1 = response
- })
- },
- methods: {
- async closePort() {
- console.log('closePort');
- this.reader.cancel()
- },
- async openPort() {
- console.log('openPort', navigator);
- if ('serial' in navigator) {
- // The Web Serial API is supported.
- console.log('the Web Serial API is supported.');
- console.log(this.param);
- const port = await navigator.serial.requestPort();
- await port.open({
- baudRate: this.param
- }); // set baud rate
- this.reader = port.readable.getReader();
- // 监听来自串行设备的数据
- while (true) {
- const {
- value,
- done
- } = await this.reader.read();
- // console.log("value",value);
- if (done) {
- // 允许稍后关闭串口。
- this.reader.releaseLock();
- break;
- }
- var result = '';
- //2。获取16进制字符串
- // var receData = HexConvert.ByteToString(value);
- // console.log("receData",receData);
- var flag = false;
- var flag1 = false;
- // for (var i = 0; i < value.length; i++) {
- // var tmp = String.fromCharCode(value[i])
- // if (tmp == '+') {
- // flag = true
- // }
- // if (flag && result.length < 6 && tmp != '+') {
- // result += tmp
- // }
- // }
- // if (this.information != '毛重检斤') {
- // if(parseInt(result)){
- // this.deptBudgetList.grossWeight = parseInt(result)
- // }
- // } else {
- // if(parseInt(result)){
- // this.deptBudgetList.tare = parseInt(result)
- // }
- // }
- if (this.deptBudgetList.warehouseName && (this.deptBudgetList.warehouseName == '山东诸城迈饶库' || this
- .deptBudgetList.warehouseName == '克东千红库' || this.deptBudgetList.warehouseName == '鲅鱼圈祥腾库')) {
- for (var i = 0; i < value.length; i++) {
- var tmp = String.fromCharCode(value[i])
- if (tmp == '+') {
- flag = true
- }
- if (flag && result.length < 6 && tmp != '+') {
- result += tmp
- }
- }
- if (this.information == '毛重检斤') {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.grossWeight = parseInt(result)
- }
- } else {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.tare = parseInt(result)
- }
- }
- }
- else if (this.deptBudgetList.warehouseName && (this.deptBudgetList.warehouseName == '顺城粮库'||this.deptBudgetList.warehouseName == '鲅鱼圈金信库')) {
- for (var i = value.length - 1; i >= 0; i--) {
- var tmp = String.fromCharCode(value[i])
- console.log(tmp)
- if (String.fromCharCode(value[0]) == '.') {
- flag = true
- }
- if (flag && result.length < 9 && tmp != '='&& tmp != '.') {
- result += tmp
- }
- }
- if (this.information == '毛重检斤') {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.grossWeight = parseInt(result)
- }
- } else {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.tare = parseInt(result)
- }
- }
- }
- else {
- for (var i = 0; i < value.length; i++) {
- var tmp = String.fromCharCode(value[i])
- if ((value[0] != 49 && value[0] != 2)) {
- if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
- flag1 = true
- } else {
- break
- }
- }
- if (tmp == String.fromCharCode(32)) {
- flag = true
- }
- if (flag && result.length < 7 && tmp != String.fromCharCode(32) && !(value[value.length - 1] == 48 &&
- value[value.length - 2] == 48)) {
- result += tmp
- }
- if (flag1 && tmp != String.fromCharCode(32)) {
- if ((value[value.length - 1] == 48 && value[value.length - 2] == 48)) {
- if (i == 0) {
- this.result1 = tmp + '0'
- }
- }
- }
- }
- if (this.information == '毛重检斤') {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.grossWeight = parseInt(result + this.result1)
- }
- } else {
- if (parseInt(result) || parseInt(result) == 0) {
- this.deptBudgetList.tare = parseInt(result + this.result1)
- }
- }
- }
- // setTimeout(1000)
- // value 是一个 Uint8Array
- }
- await port.close();
- } else {
- console.log('the Web Serial API is not supported.', navigator);
- }
- },
- qualityInspectorChange(e) {
- console.log(e)
- },
- uploadSuccessHandle1(res) {
- this.deptBudgetList.addressUrl = res.url
- },
- //返回按钮
- revert() {
- this.$router.push({
- path: 'warehouseManagementList'
- })
- },
- carChange(e) {
- for (let i = 0; i < this.tranCarInfoList.length; i++) {
- if (this.tranCarInfoList[i].carNo == this.deptBudgetList.carNo) {
- this.deptBudgetList.tranCarNo = this.tranCarInfoList[i].tranCarNo
- }
- }
- },
- typeChange(e) {
- },
- contractNoChange(e) {
- for (let i = 0; i < this.deptBudgetList1.length; i++) {
- if (this.deptBudgetList1[i].inOutTaskNo == e) {
- var data=this.deptBudgetList1[i]
- if(this.deptBudgetList1[i].contractNo){
- this.deptBudgetList.contractNo = this.deptBudgetList1[i].contractNo
- }
- else{
- this.deptBudgetList.contractNo = this.deptBudgetList1[i].moveTaskNo
- }
-
- }
- }
- for (var i = 0; i < this.outContractNo.length; i++) {
- if (this.outContractNo[i].contractNo == this.deptBudgetList.contractNo) {
- if (this.outContractNo[i].inOutType == '销售出库') {
- this.deptBudgetList.tips='买方'+this.outContractNo[i].buyer
- this.deptBudgetList.inOutTypeKey = 1
- } else if (this.outContractNo[i].inOutType == '移库出库') {
- this.deptBudgetList.tips='入货库'+data.receiveWarehouse
- this.deptBudgetList.inOutTypeKey = 3
- } else if (this.outContractNo[i].inOutType == '暂存入库') {
- this.deptBudgetList.inOutTypeKey = 4
- } else if (this.outContractNo[i].inOutType == '贸易服务出库') {
- this.deptBudgetList.inOutTypeKey = 5
- } else if (this.outContractNo[i].inOutType == '采购出库') {
- this.deptBudgetList.inOutTypeKey = 6
- }
- this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
- this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
- this.deptBudgetList.grade = this.outContractNo[i].grade
- this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
- if (this.outContractNo[i].deliverType == '1') {
- this.carstatus = true
- } else {
- this.carstatus = false
- }
- if (this.outContractNo[i].tranCarInfoList) {
- this.options2 = this.outContractNo[i].tranCarInfoList
- this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
- this.carstatus = true
- }
- }
- }
- },
- contractNoChange1(e) {
- for (var i = 0; i < this.outContractNo.length; i++) {
- if (this.outContractNo[i].contractNo == e) {
- if (this.outContractNo[i].inOutType == '销售出库') {
- this.deptBudgetList.inOutTypeKey = 1
- } else if (this.outContractNo[i].inOutType == '移库出库') {
- this.deptBudgetList.inOutTypeKey = 3
- } else if (this.outContractNo[i].inOutType == '暂存入库') {
- this.deptBudgetList.inOutTypeKey = 4
- } else if (this.outContractNo[i].inOutType == '贸易服务出库') {
- this.deptBudgetList.inOutTypeKey = 5
- } else if (this.outContractNo[i].inOutType == '采购出库') {
- this.deptBudgetList.inOutTypeKey = 6
- }
- this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
- this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
- this.deptBudgetList.grade = this.outContractNo[i].grade
- this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
- if (this.outContractNo[i].tranCarInfoList) {
- this.options2 = this.outContractNo[i].tranCarInfoList
- this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
- this.carstatus = true
- }
- }
- }
- },
- dataFilter2(val) {
- this.deptBudgetList.carNo = val
- if (val) {
- //val存在
- this.options1 = this.outContractNo1.filter((item) => {
- if (
- !!~item.carNo.indexOf(val) ||
- !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())
- ) {
- return true
- }
- })
- } else {
- //val为空时,还原数组
- this.options2 = this.tranCarInfoList
- }
- },
- dataFilter(val) {
- // console.log(val,"名")
- this.deptBudgetList.staffList = val
- if (val) {
- //val存在
- this.options = this.staffList.filter((item) => {
- if (
- !!~item.staffName.indexOf(val) ||
- !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
- ) {
- return true
- }
- })
- } else {
- //val为空时,还原数组
- this.options = this.staffList
- }
- },
- selectstaff(e) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == e) {
- this.deptBudgetList.personChargeKey = this.staffList[i].staffId
- }
- }
- },
- pureweight(e) {
- console.log(this.deptBudgetList)
- if (this.deptBudgetList.netWeight && this.deptBudgetList.tidalGrainWater && this.deptBudgetList
- .solidGrainWater && this.deptBudgetList.buckleWeightRatio) {
- this.deptBudgetList.pureWeight = (this.deptBudgetList.netWeight * (100 - (this.deptBudgetList
- .tidalGrainWater - this.deptBudgetList.solidGrainWater) * this.deptBudgetList.buckleWeightRatio)) / 100
- }
- },
- temporaryStorage() {
- if (!this.deptBudgetList.goodsName) {
- this.$message({
- message: '货名不能为空',
- type: 'warning',
- })
- return
- }
- if (this.information == '毛重检斤' && !this.deptBudgetList.grossWeight) {
- this.$message({
- message: '毛重不能为空',
- type: 'warning',
- })
- return
- }
- if (this.information == '毛重检斤' && (
- this.deptBudgetList.grossWeight <= 0 ||
- this.deptBudgetList.grossWeight > 200000 ||
- (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
- String(this.deptBudgetList.grossWeight).length -
- (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
- 3))) {
- this.$message({
- message: '毛重输入错误',
- type: 'warning',
- })
- return
- }
- if (this.information == '皮重检斤' && !this.deptBudgetList.tare) {
- this.$message({
- message: '皮重不能为空',
- type: 'warning',
- })
- return
- }
- if (this.information == '皮重检斤' && (
- this.deptBudgetList.tare < 0 ||
- this.deptBudgetList.tare > 200000 ||
- (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
- String(this.deptBudgetList.tare).length -
- (String(this.deptBudgetList.tare).indexOf('.') + 1) >
- 3))) {
- this.$message({
- message: '皮重输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.carNo) {
- this.$message({
- message: '车牌号不能为空',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.carNo.length > 7) {
- this.$message({
- message: '车牌号输入错误,请输入7个字符之内',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.contractNo) {
- this.$message({
- message: '合同编号不能为空',
- type: 'warning',
- })
- return
- }
- // if (
- // this.deptBudgetList.contractNo.length < 6 ||
- // this.deptBudgetList.contractNo.length > 20
- // ) {
- // this.$message({
- // message: '合同编号长度不符合要求,请输入6-20个字符之内',
- // type: 'warning',
- // })
- // return
- // }
- //自检员
- if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
- if (
- this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
- 2 ||
- this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
- ) {
- this.$message({
- message: '质检员姓名长度错误!',
- type: 'warning',
- })
- return
- }
- }
- if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
- this.$message({
- message: '水分(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
- this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
- (String(
- this.deptBudgetList.warehouseInOutDetail.waterContent
- ).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.waterContent)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.waterContent
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //杂质
- if (this.deptBudgetList.warehouseInOutDetail.impurity) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
- this.$message({
- message: '杂质(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
- this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.impurity
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //霉变
- if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
- this.$message({
- message: '霉变粒(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
- this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.mildewGrain
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //热损伤
- if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
- this.$message({
- message: '热损伤(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
- this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.jiaorenli
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //不完善粒(%)
- if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
- this.$message({
- message: '不完善粒(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
- (String(
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain
- ).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //容重
- if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
- this.$message({
- message: '容重(克/升)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- (this.deptBudgetList.warehouseInOutDetail.bulkDensity &&
- String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
- (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) >
- 2) || this.deptBudgetList.warehouseInOutDetail.bulkDensity > 1000 || this.deptBudgetList
- .warehouseInOutDetail.bulkDensity < 0
- ) {
- this.$message({
- message: '容重输入错误',
- type: 'warning',
- })
- return
- }
- }
- console.log(this.deptBudgetList, '出库!!!!!')
- this.$confirm(`是否保存皮重检斤`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning',
- })
- .then(() => {
- this.$refs.deptBudgetList.validate((valid) => {
- if (valid) {
- this.deptBudgetList.compId = localStorage.getItem('ws-pf_compId')
- this.deptBudgetList.skinInspector = localStorage.getItem('ws-pf_staffName')
- this.deptBudgetList.inOutFlag = 1
- this.deptBudgetList.pcFlag = 1
- this.deptBudgetList.statusFlag = 1
- his.deptBudgetList.grossWeight /= 1000
- this.deptBudgetList.tare /= 1000
- this.deptBudgetList.netWeight = this.deptBudgetList.netWeight.toFixed(2)
- this.deptBudgetList.pureWeight /= 1000
- addstorageputList(this.deptBudgetList)
- .toPromise()
- .then((response) => {
- this.$message.success('保存成功')
- this.$router.push({
- path: 'warehouseManagementList'
- })
- })
- } else {
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- return false
- }
- })
- })
- .catch(() => {
- return false
- })
- },
- //提交按钮
- submit() {
- if (!this.deptBudgetList.goodsName) {
- this.$message({
- message: '货名不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.grossWeight) {
- this.$message({
- message: '毛重不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.grossWeight <= 0 ||
- this.deptBudgetList.grossWeight > 5000000 ||
- (String(this.deptBudgetList.grossWeight).indexOf('.') != -1 &&
- String(this.deptBudgetList.grossWeight).length -
- (String(this.deptBudgetList.grossWeight).indexOf('.') + 1) >
- 3)
- ) {
- this.$message({
- message: '毛重输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.tare) {
- this.$message({
- message: '皮重不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.tare < 0 ||
- this.deptBudgetList.tare > 500000 ||
- (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
- String(this.deptBudgetList.tare).length -
- (String(this.deptBudgetList.tare).indexOf('.') + 1) >
- 3)
- ) {
- this.$message({
- message: '皮重输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.netWeight) {
- this.$message({
- message: '净重不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.netWeight <= 0 ||
- this.deptBudgetList.netWeight >= 5000000
- ) {
- this.$message({
- message: '净重输入错误!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.grade) {
- this.$message({
- message: '品级不能为空!',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.type == '潮粮' && !this.deptBudgetList.buckleWeightRatio) {
- this.$message({
- message: '扣重比不能为空',
- type: 'warning'
- })
- return
- }
- if (
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.buckleWeightRatio < 0 ||
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.buckleWeightRatio > 3 ||
- (this.deptBudgetList.type == '潮粮' && String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
- String(this.deptBudgetList.buckleWeightRatio).length -
- (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
- 2)
- ) {
- this.$message({
- message: '扣重比输入错误',
- type: 'warning'
- })
- return
- }
- if (this.deptBudgetList.type == '潮粮' && !this.deptBudgetList.tidalGrainWater) {
- this.$message({
- message: '潮粮水分不能为空',
- type: 'warning'
- })
- return
- }
- if (
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.tidalGrainWater < 1 ||
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.tidalGrainWater > 40 ||
- (this.deptBudgetList.type == '潮粮' && String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
- String(this.deptBudgetList.tidalGrainWater).length -
- (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
- 2)
- ) {
- this.$message({
- message: '潮粮水分输入错误',
- type: 'warning'
- })
- return
- }
- if (this.deptBudgetList.type == '潮粮' && !this.deptBudgetList.solidGrainWater) {
- this.$message({
- message: '干粮水分不能为空',
- type: 'warning'
- })
- return
- }
- if (
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.solidGrainWater < 1 ||
- this.deptBudgetList.type == '潮粮' && this.deptBudgetList.solidGrainWater > 40 ||
- (this.deptBudgetList.type == '潮粮' && String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
- String(this.deptBudgetList.solidGrainWater).length -
- (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
- 1)
- ) {
- this.$message({
- message: '干粮水分输入错误',
- type: 'warning'
- })
- return
- }
- if (!this.deptBudgetList.agent) {
- this.$message({
- message: '经办人不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.agent.length < 2 ||
- this.deptBudgetList.agent.length > 10
- ) {
- this.$message({
- message: '经办人姓名输入有误!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.inOutDate) {
- this.$message({
- message: '出库日期不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.inOutType) {
- this.$message({
- message: '出库类型不能为空!',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.carNo) {
- this.$message({
- message: '车牌号不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.carNo.length < 6 &&
- this.deptBudgetList.carNo.length <= 8
- ) {
- this.$message({
- message: '车牌号输入有误!',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.boxNo&&this.deptBudgetList.boxNo.length > 20) {
- this.$message({
- message: '箱号-1输入错误',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.boxNoOther&&this.deptBudgetList.boxNoOther.length > 20) {
- this.$message({
- message: '箱号-2输入错误',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.titleNo&&this.deptBudgetList.titleNo.length > 20) {
- this.$message({
- message: '封号-1输入错误',
- type: 'warning',
- })
- return
- }
- if (this.deptBudgetList.titleNoOther&&this.deptBudgetList.titleNoOther.length > 20) {
- this.$message({
- message: '封号-2输入错误',
- type: 'warning',
- })
- return
- }
- if (!this.deptBudgetList.contractNo) {
- this.$message({
- message: '合同编号不能为空!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.contractNo.length < 6 ||
- this.deptBudgetList.contractNo.length > 50
- ) {
- this.$message({
- message: '合同编号输入有误!',
- type: 'warning',
- })
- return
- }
- //自检员
- if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
- if (
- this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
- 2 ||
- this.deptBudgetList.warehouseInOutDetail.qualityInspector.length > 10
- ) {
- this.$message({
- message: '质检员姓名长度错误!',
- type: 'warning',
- })
- return
- }
- }
- if (this.deptBudgetList.warehouseInOutDetail.waterContent) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.waterContent)) {
- this.$message({
- message: '水分(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.waterContent < 1 ||
- this.deptBudgetList.warehouseInOutDetail.waterContent > 40 ||
- (String(
- this.deptBudgetList.warehouseInOutDetail.waterContent
- ).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.waterContent)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.waterContent
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '水分(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //杂质
- if (this.deptBudgetList.warehouseInOutDetail.impurity) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.impurity)) {
- this.$message({
- message: '杂质(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.impurity < 1 ||
- this.deptBudgetList.warehouseInOutDetail.impurity > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.impurity).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.impurity).length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.impurity
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '杂质(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //霉变
- if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
- this.$message({
- message: '霉变粒(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.mildewGrain < 1 ||
- this.deptBudgetList.warehouseInOutDetail.mildewGrain > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.mildewGrain
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '霉变粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //热损伤
- if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
- this.$message({
- message: '热损伤(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.jiaorenli < 1 ||
- this.deptBudgetList.warehouseInOutDetail.jiaorenli > 40 ||
- (String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).indexOf(
- '.'
- ) != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.jiaorenli).length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.jiaorenli
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '热损伤(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //不完善粒(%)
- if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
- this.$message({
- message: '不完善粒(%)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
- (String(
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain
- ).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
- .length -
- (String(
- this.deptBudgetList.warehouseInOutDetail.imperfectGrain
- ).indexOf('.') +
- 1) >
- 2)
- ) {
- this.$message({
- message: '不完善粒(%)输入错误! 取值范围1-40之间且可以保留2小数',
- type: 'warning',
- })
- return
- }
- }
- //容重
- if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
- if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
- this.$message({
- message: '容重(克/升)非数字!',
- type: 'warning',
- })
- return
- }
- if (
- (this.deptBudgetList.warehouseInOutDetail.bulkDensity &&
- String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf('.') != -1 &&
- String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
- (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf('.') + 1) >
- 2) || this.deptBudgetList.warehouseInOutDetail.bulkDensity > 1000 || this.deptBudgetList
- .warehouseInOutDetail.bulkDensity < 0
- ) {
- this.$message({
- message: '容重输入错误',
- type: 'warning',
- })
- return
- }
- }
- this.$confirm(`确定提交出库信息`, {
- cancelButtonText: '取消',
- confirmButtonText: '确定',
- type: 'warning',
- }).then(() => {
- this.$refs.deptBudgetList.validate((valid) => {
- if (valid) {
- this.deptBudgetList.grossWeight /= 1000
- this.deptBudgetList.tare /= 1000
- this.deptBudgetList.netWeight /= 1000
- this.deptBudgetList.pureWeight /= 1000
- this.deptBudgetList.deductionAmount *= 1000
- this.deptBudgetList.deductionWeight /= 1000
- this.deptBudgetList.compId = localStorage.getItem('ws-pf_compId')
- this.deptBudgetList.skinInspector = localStorage.getItem('ws-pf_staffName')
- this.deptBudgetList.inOutFlag = 1
- this.deptBudgetList.statusFlag = 3
- addstorageputList(this.deptBudgetList)
- .toPromise()
- .then((response) => {
- this.$message.success('添加成功')
- this.$router.push({
- path: 'warehouseManagementList'
- })
- }).catch((response) => {
- this.deptBudgetList.grossWeight = Math.round(this.deptBudgetList.grossWeight*1000)
- this.deptBudgetList.tare = Math.round(this.deptBudgetList.tare*1000)
- this.deptBudgetList.netWeight = Math.round(this.deptBudgetList.netWeight*1000)
- this.deptBudgetList.pureWeight = Math.round(this.deptBudgetList.pureWeight*1000)
- this.deptBudgetList.deductionAmount = Math.round(this.deptBudgetList.deductionAmount/1000)
- this.deptBudgetList.deductionWeight = Math.round(this.deptBudgetList.deductionWeight*1000)
- })
- } else {
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
- return false
- }
- })
- })
- },
- tarechange(e) {
- if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
- this.deptBudgetList.netWeight = Number(
- this.deptBudgetList.grossWeight - this.deptBudgetList.tare
- ).toFixed(2)
- }
- },
- grossWeightchange(e) {
- if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
- this.deptBudgetList.netWeight = Number(
- this.deptBudgetList.grossWeight - this.deptBudgetList.tare
- ).toFixed(2)
- }
- },
- selectgoodsName(e) {
- for (var i = 0; i < this.goodnameList.length; i++) {
- if (this.goodnameList[i].goodsName == e) {
- this.deptBudgetList.goodsNameKey = this.goodnameList[i].goodsNameKey
- if(e=='玉米(潮粮)'){
- this.deptBudgetList.type='潮粮'
- }else{
- this.deptBudgetList.type='干粮'
- }
- }
- }
- },
- selectpackingMethod(e) {
- for (var i = 0; i < this.packtypeList.length; i++) {
- if (this.packtypeList[i].constValue == e) {
- this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
- }
- }
- },
- selectstorageType(e) {
- for (var i = 0; i < this.deliveryType.length; i++) {
- if (this.deliveryType[i].constValue == e) {
- this.deptBudgetList.inOutTypeKey = this.deliveryType[i].constKey
- }
- }
- },
- handleClose() {
- this.accessoryTFs = false
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`)
- this.pageSize = val
- this.getList()
- },
- handleCurrentChange(val) {
- this.currentPage = val
- console.log(`当前页: ${val}`)
- this.getList()
- },
- getList() {
- // 品级
- pullDown({
- constId: 'CON3'
- })
- .toPromise()
- .then((response) => {
- this.gradeList = response
- })
- // 类型
- if (this.deptBudgetList.warehouseType == 1) {
- // 货名
- goodsname({
- positionId: this.$route.query.positionId
- })
- .toPromise()
- .then((response) => {
- this.goodnameList = response
- })
- //类型
- pullDown({
- constId: 'CON6'
- })
- .toPromise()
- .then((response) => {
- this.deliveryType = response
- })
- } else if (this.deptBudgetList.warehouseType == 2) {
- goodsnameXiala({
- baseId: this.deptBudgetList.warehouseId
- })
- .toPromise()
- .then((response) => {
- this.goodnameList = response
- })
- pullDown({
- constId: 'WARE2'
- })
- .toPromise()
- .then((response) => {
- this.deliveryType = response
- })
- }
- //合同编号
- xialaNo({
- compId: localStorage.getItem('ws-pf_compId'),
- flag: 5
- })
- .toPromise()
- .then((response) => {
- this.outContractNo = response
- })
- //经办人
- getstaff({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseId: this.deptBudgetList.baseId
- })
- .toPromise()
- .then((response) => {
- // this.agent = response
- this.qualityInspectorList = response
- this.options = response
- this.staffList = response
- })
- },
- selecttaskType(e) {
- for (var i = 0; i < this.taskTypeList.length; i++) {
- if (this.taskTypeList[i].value == e) {
- this.searchType = this.taskTypeList[i].type
- }
- }
- },
- fujian(row) {
- if (
- row.receiveAttachmentPath === null ||
- row.receiveAttachmentPath === ''
- ) {
- EventBus.$emit(
- 'warning',
- this.$t('system.noticeCircular.NoInformation')
- )
- } else {
- this.accessoryTFs = true
- }
- this.appendixIdss = row.receiveAttachmentPath
- },
- handleExamine(row) {
- this.$router.push({
- name: 'salesContractExamine',
- query: {
- id: row.id
- },
- })
- },
- //删除
- approve() {},
- listQuery() {},
- total() {},
- clearfiltQuery() {},
- selectCrtDuty() {},
- },
- }
- </script>
- <style lang="scss" scoped>
- /deep/.basicInformation {
- .ws-info-table {
- border: none;
- }
- .el-form-item {
- width: 33.3333%;
- border: none;
- .el-form-item__label {
- background: transparent;
- border: none;
- }
- .el-form-item__content {
- border: none;
- }
- }
- }
- .el-button--default {
- color: #5473e8;
- border-color: #5473e8;
- }
- .title {
- position: relative;
- padding-left: 10px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .el-form {
- padding: 0 10%;
- }
- .el-button--primary {
- background-color: #5878e8;
- border-color: #5878e8;
- }
- .el-col {
- background: #f6f7fc;
- }
- .bg-right {
- text-align: right;
- padding: 16px 20px;
- }
- .center {
- position: relative;
- top: 50px;
- width: 40%;
- height: 2000px;
- margin: 0 auto;
- }
- //选填
- /deep/.el-form-item {
- width: 50%;
- }
- .container {
- overflow: scroll;
- height: 120vh;
- }
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- text-align: center;
- }
- .deliverydate {
- display: inline-block;
- width: 10%;
- }
- .center {
- margin-top: -60px;
- width: 80%;
- }
- //仓位
- .position {
- background: #afb5cb;
- border-radius: 2px;
- font-size: 12px;
- color: #ffffff;
- line-height: 20px;
- padding: 2px 4px;
- position: relative;
- top: -2px;
- }
- .neifor /deep/.ws-info-table .el-form-item .el-form-item__label {
- background: #f6f7fc;
- }
- .neifor .ws-info-table {
- border-left: 1px solid #cdd2dc;
- border-top: 1px solid #cdd2dc;
- }
- .neifor .ws-info-table .el-form-item {
- border-right: 1px solid #cdd2dc;
- border-bottom: 1px solid #cdd2dc;
- }
- .inspector /deep/.ws-info-table .el-form-item .el-form-item__label {
- width: 59px;
- }
- //表格文字
- /deep/.ws-info-table .el-form-item .el-form-item__label {
- text-align: center;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- line-height: 16px;
- }
- .inspector {
- width: 50%;
- }
- //质检员
- .inspector .el-form-item__content {
- text-align: left;
- margin-left: 0px;
- }
- .small-title {
- position: relative;
- padding: 10px;
- font-weight: 600;
- }
- .small-title::before {
- position: absolute;
- content: '';
- display: block;
- background: #5473e8;
- width: 4px;
- height: 14px;
- left: 0px;
- top: 13px;
- }
- //下面列表
- .neifor {
- width: 80%;
- background-color: #f6f7fc;
- }
- /deep/.neifor .ws-info-table .el-form-item .el-form-item__label {
- width: 35%;
- text-align: center;
- }
- /deep/.neifor .ws-info-table .el-form-item .el-form-item__content {
- width: 60%;
- background-color: #f6f7fc;
- }
- /deep/.neifor .el-input--small .el-input__inner {
- width: 100%;
- }
- </style>
|