123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001 |
- // 创建出入库任务
- <template>
- <div class="container">
- <el-row>
- <el-col :span="12">
- <h2 class="bg-left title">创建出入库任务</h2>
- </el-col>
- <el-col :span="12" class="bg-right">
- <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">
- <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
- src="../../../public/img/lujing.png" alt />返回
- </el-button>
- </el-col>
- </el-row>
- <div class="basicInformation">
- <div class="annu">
- <el-radio-group @change="tasktypechange" v-model="dataList.taskTypeKey">
- <el-radio label="1" class="a">出库</el-radio>
- <el-radio label="2" class="a">入库</el-radio>
- <el-radio label="3" class="a">移库</el-radio>
- <el-radio label="4" class="a">退库并出库</el-radio>
- </el-radio-group>
- </div>
- <div class="ding"></div>
- <div v-if="dataList.taskTypeKey != 2 && dataList.taskTypeKey != 4" class="center1">
- <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
- src="../../../public/img/cangku.png" alt />
- <!--出库=-->
- <div class="small-title">
- <h3>出库任务({{ inOutTaskNo }})</h3>
- </div>
- <el-form ref="dataList" :model="dataList" label-width="140px" input-width="300px">
- <!-- 仓库名 -->
- <el-form-item label="仓库名">
- <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect" filterable clearable
- @change="selectwarehouseName">
- <el-option v-for="item in warehouseNameList" :key="item.constKey"
- :label="item.warehouseName" :value="item.id" />
- </el-select>
- </el-form-item>
- <!-- 出库类型 -->
- <el-form-item label="出库类型">
- <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.inOutType" placeholder="请选择出库类型" class="typeselect"
- @change="selectstorageType" filterable clearable>
- <el-option v-for="item in storageType" :key="item.constKey" v-if="
- (dataList.taskTypeKey == 1 &&
- item.constValue != '移库出库') ||
- (dataList.taskTypeKey == 3 &&
- item.constValue == '移库出库') ||
- (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
- " :label="item.constValue" :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!-- 合同编号 -->
- <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
- <el-select filterable @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号" class="typeselect" filterable clearable>
- <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
- <el-input @input="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号"
- class="typeselect">
- <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-input>
- </el-form-item>
- <!-- 货名 -->
- <el-form-item label="货源" class="huom">
- <el-input disabled v-model="goods" placeholder="请选择货源"
- maxlength="120" size="small" class="huom" />
- <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
- </el-form-item>
- <!--重量(吨)-->
- <el-form-item label="重量(吨)">
- <el-input disabled @input="weightchange1" v-model="dataList.weight" placeholder="请输入重量(吨)"
- maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!-- 品级 -->
- <el-form-item label="品级">
- <el-select :disabled='gradestatus' v-model="dataList.grade" placeholder class="typeselect"
- @change="selectpackingMethod" filterable clearable>
- <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!--容重(克/升)>=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=" span="1">
- <el-input disabled @input="bulkDensitychange" v-model="dataList.bulkDensity" placeholder="请输入容重"
- maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!--水分(%)<=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
- <el-input disabled @input="waterContentchange" v-model="dataList.waterContent"
- placeholder="请输入水分占比" maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!--单价(元/吨)-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" v-show="Pricetype">
- <el-input disabled @input="unitPricechange" v-model="dataList.unitPrice" placeholder="请输入单价"
- maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!--预计出库日期-->
- <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
- <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
- value-format="yyyy-MM-dd" />
- </el-form-item>
- <!--预估运费(元/吨)-->
- <!-- <el-form-item label="预估运费(元/吨)" span="1">
- <el-input v-model="dataList.estimatedFreight" placeholder="请输入预估运费"
- maxlength="20" size="small" type="number"/>
- </el-form-item> -->
- <!--经办人-->
- <el-form-item label="发货人">
- <el-select v-model="dataList.agent" placeholder="请选择发货人" filterable clearable
- @change="selectstaff">
- <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
- </el-select>
- </el-form-item>
- <!--业务描述=-->
- <el-form-item v-if="dataList.taskTypeKey != 3" label="业务描述" span="20">
- <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
- maxlength="150" size="large" />
- </el-form-item>
- </el-form>
- </div>
- <div v-show="dataList.taskTypeKey != 1" class="center1">
- <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
- src="../../../public/img/cangku.png" alt />
- <div class="small-title">
- <h3>入库任务({{ inOutTaskNo1 }} )</h3>
- </div>
- <el-form v-if="!deletetask" ref="form" :model="form" label-width="140px">
- <!-- 仓库名 -->
- <el-form-item label="仓库名">
- <el-select v-model="dataList1.warehouseName" placeholder="请选择仓库名" class="typeselect" filterable clearable
- @change="selectwarehouseName1">
- <el-option v-for="item in warehouseNameList" :key="item.constKey"
- :label="item.warehouseName" :value="item.id" />
- </el-select>
- </el-form-item>
- <!-- 入库类型 -->
- <el-form-item label="入库类型">
- <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList1.inOutType" placeholder="请选择入库类型" class="typeselect"
- @change="selectstorageType1" filterable clearable>
- <el-option v-for="item in storageType1" :key="item.constKey" v-if="
- (dataList1.taskTypeKey == 2 &&
- item.constValue != '移库入库') ||
- (dataList1.taskTypeKey == 3 &&
- item.constValue == '移库入库') ||
- (dataList1.taskTypeKey == 4 && item.constValue == '退库')
- " :label="item.constValue" :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!-- 合同编号 -->
- <el-form-item v-if="dataList1.taskTypeKey == 2" label="合同编号">
- <el-select @change="changecontract1" v-model="dataList1.contractNo" placeholder="请输入合同编号"
- class="typeselect" filterable clearable>
- <el-option v-for="item in contractNoList1" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="dataList1.taskTypeKey == 4" label="移库任务编号">
- <el-select v-model="dataList1.contractNo" filterable clearable placeholder="请输入移库任务编号" class="typeselect">
- <el-option v-for="item in contractNoList1" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="dataList1.taskTypeKey == 3" label="移库任务编号">
- <el-select disabled v-model="dataList1.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
- <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <!-- 货名 -->
- <el-form-item v-if='dataList1.inOutType!="退库"&&dataList1.taskTypeKey == 2' label="货名" class="huom">
- <el-select disabled v-model="dataList1.goodsName" placeholder="货名" class="huom" @change="selectgoodsName1"
- filterable clearable>
- <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-else label="货源" class="huom">
- <el-input disabled v-model="goods" placeholder="请选择货源"
- maxlength="120" size="small" class="huom" />
- <el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
- </el-form-item>
- <!--重量(吨)-->
- <el-form-item label="重量(吨)">
- <el-input disabled @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)"
- maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!-- 品级 -->
- <el-form-item label="品级">
- <el-select :disabled="dataList.taskTypeKey == 3" v-model="dataList1.grade" placeholder
- class="typeselect" @change="selectpackingMethod1" filterable clearable>
- <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!--容重(克/升)>=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=">
- <el-input @input="bulkDensitychange" :disabled="dataList.taskTypeKey == 3"
- v-model="dataList1.bulkDensity" placeholder="请输入容重" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--水分(%)<=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
- <el-input @input="waterContentchange" :disabled="dataList.taskTypeKey == 3"
- v-model="dataList1.waterContent" placeholder="请输入水分占比" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--单价(元/吨)-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" v-show="Pricetype">
- <el-input @input="unitPricechange" :disabled="dataList.taskTypeKey == 3"
- v-model="dataList1.unitPrice" placeholder="请输入单价" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--预计出库日期-->
- <el-form-item label="预计入库日期" span="1" prop="predictDate" class="deliverydate">
- <el-date-picker v-model="dataList1.predictDate" type="date" placeholder="请选择预计入库日期"
- value-format="yyyy-MM-dd" />
- </el-form-item>
- <!--预估运费(元/吨)-->
- <!-- <el-form-item label="预估运费(元/吨)" span="1" >
- <el-input v-model="dataList1.estimatedFreight" placeholder="请输入预估运费"
- maxlength="20" size="small" type="number" />
- </el-form-item> -->
- <!-- 经办人-->
- <el-form-item label="收货人">
- <el-select v-model="dataList1.agent" placeholder="请选择收货人" filterable clearable :filter-method="dataFilter1"
- @change="selectstaff1">
- <el-option v-for="item in options1" :key="item.value" :label="item.staffName" :value="item.staffName" />
- </el-select>
- </el-form-item>
- <!--业务描述=-->
- <el-form-item v-if="dataList.taskTypeKey != 4" label="业务描述">
- <el-input v-model="dataList1.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
- maxlength="150" size="large" />
- </el-form-item>
- </el-form>
- </div>
- <div v-if="dataList.taskTypeKey == 4" class="center1">
- <!--出库=-->
- <div class="small-title">
- <img style="position: relative; top: 40px; left: -22px" width="19" height="19"
- src="../../../public/img/cangku.png" alt />
- <h3>出库任务({{ inOutTaskNo }})</h3>
- </div>
- <el-form ref="dataList" :model="dataList" label-width="140px">
- <!-- 仓库名 -->
- <el-form-item label="仓库名">
- <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect" filterable clearable
- @change="selectwarehouseName">
- <el-option v-for="item in warehouseNameList" :key="item.constKey"
- :label="item.warehouseName" :value="item.id" />
- </el-select>
- </el-form-item>
- <!-- 出库类型 -->
- <el-form-item label="出库类型">
- <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.inOutType" placeholder="请选择出库类型" class="typeselect"
- @change="selectstorageType1" filterable clearable>
- <el-option v-for="item in storageType" :key="item.constKey" v-if="
- (dataList.taskTypeKey == 1 &&
- item.constValue != '移库出库') ||
- (dataList.taskTypeKey == 3 &&
- item.constValue == '移库出库') ||
- (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
- " :label="item.constValue" :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!-- 合同编号 -->
- <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
- <el-select @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号"
- class="typeselect" filterable clearable>
- <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
- <el-select @change="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号"
- class="typeselect" filterable clearable>
- <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
- :value="item.contractNo"></el-option>
- </el-select>
- </el-form-item>
- <!-- 货名 -->
- <el-form-item label="货源" class="huom">
- <el-input disabled v-model="goods" placeholder="请选择货源"
- maxlength="120" size="small" class="huom" />
- <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">选择货源</el-button>
- </el-form-item>
- <!--重量(吨)-->
- <el-form-item label="重量(吨)">
- <el-input disabled v-model="dataList.weight" placeholder="请输入重量(吨)"
- maxlength="120" size="small" class="huom" />
- </el-form-item>
- <!-- 品级 -->
- <el-form-item label="品级">
- <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.grade" placeholder class="typeselect" @change="selectpackingMethod" filterable clearable>
- <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
- :value="item.constValue" />
- </el-select>
- </el-form-item>
- <!--容重(克/升)>=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=">
- <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.bulkDensity" placeholder="请输入容重" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--水分(%)<=-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
- <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.waterContent" placeholder="请输入水分占比" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--单价(元/吨)-->
- <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" v-show="Pricetype">
- <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
- v-model="dataList.unitPrice" placeholder="请输入单价" maxlength="120" size="small"
- class="huom" />
- </el-form-item>
- <!--预计出库日期-->
- <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
- <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
- value-format="yyyy-MM-dd" />
- </el-form-item>
- <!--预估运费(元/吨)-->
- <!-- <el-form-item label="预估运费(元/吨)" span="1" >
- <el-input v-model="dataList.estimatedFreight" placeholder="请输入预估运费"
- maxlength="20" size="small" type="number" />
- </el-form-item> -->
- <!--发货人-->
- <el-form-item label="发货人">
- <el-select v-model="dataList.agent" placeholder="请选择发货人" filterable clearable
- @change="selectstaff">
- <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
- </el-select>
- </el-form-item>
- <!--业务描述=-->
- <el-form-item label="业务描述">
- <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
- maxlength="150" size="large" />
- </el-form-item>
- </el-form>
- </div>
- </div>
- <!-- 提交 -->
- <div style="text-align: center; padding: 10px">
- <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交</el-button>
- </div>
- </div>
- </template>
- <script>
- import {
- getwarehousename,
- xialaNo,
- addoreditoutput,
- getGoodsName
- } from '@/model/tasksport/index'
- import {
- mapGetters
- } from 'vuex'
- import {
- pullDown,
- getstaff
- } 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: {
- // vesselId(val) {
- // this.getList()
- // },
- isShow(val) {
- this.showType = val
- },
- flag(val) {
- xialaNo({
- compId: this.compId,
- flag: val
- })
- .toPromise()
- .then(response => {
- if (
- this.dataList1.taskTypeKey == 2 ||
- this.dataList1.taskTypeKey == 4
- ) {
- this.contractNoList1 = response
- if (this.dataList1.taskTypeKey == 2) {
- this.contractNoList = response
- }
- } else {
- this.contractNoList = response
- }
- })
- }
- },
- computed: {
- ...mapGetters(['deptBudgetList'])
- },
- data() {
- return {
- gradestatus:true,
- flag: 1,
- //弹出框
- dialogViewSpareMoney: false,
- dialogApproveFormVisible: false,
- // 船舶类型
- monetaryKey: null,
- // 表格显示数据
- tableDate: [],
- // 是否显示
- showType: true,
- disabled: false,
- // 年
- year: '',
- inOutType:'',
- contractNoList: [],
- contractNoList1: [],
- deptBudgetTotal: 0,
- readonly: true,
- currentPage: 1,
- pageSize: 10,
- searchType: 1,
- searchKeyWord: '',
- radio: '1',
- contractType: 2,
- startDate: null,
- endDate: null,
- goodnameList: [],
- checked: true,
- form: {},
- staffList: [],
- staffList1: [],
- options: [],
- options1: [],
- storageType: [],
- storageType1: [],
- outContractNo: [],
- // 提交类型
- submitType: true,
- status: [],
- warehouseNameList: [],
- warehouseNameList1: [],
- appendixIdsAdd: '',
- uploadSuccess: {},
- baseId:'',
- deletetask: false,
- warehouseInOutDetail: {},
- onChange: {},
- deptBudgetList1: [],
- gradeList: [],
- rules: {
- netWeight: [{
- required: true,
- type: 'number',
- message: '请输入活动名称',
- trigger: 'blur'
- }]
- },
- size: 10,
- goods:'',
- compId: localStorage.getItem('ws-pf_compId'),
- deptCircularPage: {},
- packtypeList: {},
- date: {
- year: dayjs().format('YYYY'),
- month: dayjs().format('MM')
- },
- contractList: [],
- inOutTaskNo: '',
- inOutTaskNo1: '',
- sourceId:'',
- dataList: {
- taskTypeKey: '1',
- weight:0,
- },
- dataList1: {
- taskTypeKey: '1',
- inOutType: '',
- weight:0,
- },
- historyList: [],
- pickerBeginDateBefore: {
- disabledDate: time => {
- return time.getTime() > Date.now()
- }
- },
- accessoryTFs: false,
- Pricetype:true,//价格类型为随行就市隐藏单价
- }
- },
- activated() {
- this.getList()
- var num=0
- this.goods=''
- this.sourceId=''
- this.dataList.weight=0
- this.dataList1.weight=0
- if(localStorage.getItem("taskTypeKey")){
- this.dataList.taskTypeKey=localStorage.getItem("taskTypeKey")
- this.dataList1.taskTypeKey=localStorage.getItem("taskTypeKey")
- if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){
- this.dataList.warehouseName=localStorage.getItem("warehouse")
- this.dataList.contractNo=localStorage.getItem("contractNo")
- }
- else if(this.dataList.taskTypeKey==2||this.dataList.taskTypeKey==4){
- this.dataList1.warehouseName=localStorage.getItem("warehouse")
- this.dataList1.contractNo=localStorage.getItem("contractNo")
- }
- }
- if(localStorage.getItem("supplygoods1")){
- if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=="退库"||this.dataList.taskTypeKey==4){
- var supplygoods=JSON.parse(localStorage.getItem("supplygoods1"))
- for (let i = 0; i < supplygoods.length; i++) {
- if(supplygoods[i].sourceRelationInfoList){
- if(localStorage.getItem("supplygoodsstatus")&&localStorage.getItem("supplygoodsstatus")==1){
- for (let q = 0; q < supplygoods[i].sourceRelationInfoList.length; q++) {
-
- if(this.goods.indexOf(supplygoods[i].sourceRelationInfoList[q].goodsName)==-1){
- this.goods=this.goods!=''?this.goods+',':''+supplygoods[i].sourceRelationInfoList[q].goodsName
- }
- this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].sourceRelationInfoList[q].surplusWeight)
- this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].sourceRelationInfoList[q].surplusWeight)
- }
- }
- }
- console.log(this.goods)
- }
- }else if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){
- var supplygoods=JSON.parse(localStorage.getItem("supplygoods1"))
- if(localStorage.getItem("supplygoodsstatus")&&localStorage.getItem("supplygoodsstatus")==0){
- for (let i = 0; i < supplygoods.length; i++) {
- this.goods=this.goods!=''?this.goods+',':''+supplygoods[i].goodsName
- this.dataList1.weight=Number(this.dataList1.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
- this.dataList.weight=Number(this.dataList.weight)+Number(supplygoods[i].estimateOutWarehouseWeight)
- }
- }
-
- }
-
- }
-
- },
- methods: {
- //返回按钮
- revert() {
- this.$router.go(-1)
- },
- supplygoods(){
- if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){
- if(this.dataList.warehouseName){
- localStorage.setItem("warehouse",this.dataList.warehouseName);
- localStorage.setItem("contractNo",this.dataList.contractNo);
- localStorage.setItem("taskTypeKey",this.dataList.taskTypeKey);
- this.$router.push({name:'supplyofgoods',query:{baseId:this.baseId}})
- }else{
- this.$message({
- message: '请先选择仓库',
- type: 'warning'
- });
- }
- }else if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=="退库"||this.dataList1.taskTypeKey==4){
- if(this.dataList1.moveTaskNo||this.dataList1.contractNo){
- localStorage.setItem("warehouse",this.dataList1.warehouseName);
- localStorage.setItem("contractNo",this.dataList1.contractNo);
- localStorage.setItem("taskTypeKey",this.dataList1.taskTypeKey);
- this.$router.push({name:'outsupplyofgoods',query:{contractNo:this.dataList1.contractNo,taskTypeKey:this.dataList1.taskTypeKey}})
- }else{
- this.$message({
- message: '请先选择合同/移库编号',
- type: 'warning'
- });
- }
- }
- },
- returnsales() {
- this.dataList = {
- taskTypeKey: 1
- }
- localStorage.removeItem('supplygoods1')
- this.$router.go(-1)
- },
- // 获取当前年月日
- getdate() {
- var date = new Date()
- var year = date.getFullYear() //获取完整的年份(4位)
- var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
- var datetime = date.getDate() //获取当前日(1-31)
- var hour = date.getHours()
- var minutes = date.getMinutes()
- var seconds = date.getSeconds()
- if (mouth < 10) {
- mouth = '0' + mouth
- }
- if (datetime < 10) {
- datetime = '0' + datetime
- }
- if (hour < 10) {
- hour = '0' + hour
- }
- if (minutes < 10) {
- minutes = '0' + minutes
- }
- if (seconds < 10) {
- seconds = '0' + seconds
- }
- return year + '' + mouth + datetime + hour + minutes + seconds
- },
- // 随机验证码
- verifyinit() {
- var arr = []
- for (var i = 48; i < 57; i++) {
- arr.push(String.fromCharCode(i))
- }
- arr.sort(function() {
- return Math.random() - 0.5
- })
- arr.length = 4
- return arr.join('')
- },
- MathRand() {
- var Num = ''
- for (var i = 0; i < 4; i++) {
- Num += Math.floor(Math.random() * 10)
- }
- return Num
- },
- selectTaskNo(e) {
- if (this.dataList.taskTypeKey == 3) {
- this.$set(this.dataList1, 'moveTaskNo', e)
- }
- },
- 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
- }
- },
- dataFilter1(val) {
- // console.log(val,"名")
- this.deptBudgetList.staffList1 = val
- if (val) {
- //val存在
- this.options = this.staffList1.filter(item => {
- if (
- !!~item.staffName.indexOf(val) ||
- !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
- ) {
- return true
- }
- })
- } else {
- //val为空时,还原数组
- this.options1 = this.staffList1
- }
- },
- weightchange(e) {
- if (this.dataList.taskTypeKey == 4) {
- this.$set(this.dataList, 'weight', e)
- }else if (this.dataList.taskTypeKey == 2) {
- this.$set(this.dataList1, 'weight', e)
- }
- },
- weightchange1(e) {
- if (this.dataList.taskTypeKey == 3) {
- this.$set(this.dataList1, 'weight', e)
- }
- },
- bulkDensitychange(e) {
- if (this.dataList.taskTypeKey == 4) {
- this.$set(this.dataList, 'bulkDensity', e)
- } else if (this.dataList1.taskTypeKey == 3) {
- this.$set(this.dataList1, 'bulkDensity', e)
- }
- },
- waterContentchange(e) {
- if (this.dataList.taskTypeKey == 4) {
- this.$set(this.dataList, 'waterContent', e)
- } else if (this.dataList1.taskTypeKey == 3) {
- this.$set(this.dataList1, 'waterContent', e)
- }
- },
- unitPricechange(e) {
- if (this.dataList.taskTypeKey == 4) {
- this.$set(this.dataList, 'unitPrice', e)
- } else if (this.dataList1.taskTypeKey == 3) {
- this.$set(this.dataList1, 'unitPrice', e)
- }
- },
- changecontract(e) {
-
- if (this.dataList.taskTypeKey != 3) {
- for (let i = 0; i < this.contractNoList.length; i++) {
- if (this.contractNoList[i].contractNo == e) {
- console.log(this.contractNoList[i],11222)
- this.inOutType=this.contractNoList[i].inOutType
- if(this.contractNoList[i].priceType == '随行就市'){
- this.Pricetype = false
- }else{
- this.Pricetype = true
- }
- getGoodsName({
- contractId: this.contractNoList[i].id,
- contractNo: this.contractNoList[i].contractNo
- })
- .toPromise()
- .then(response => {
- this.$set(this.dataList, 'goodsName', response.goodsName)
- this.$set(this.dataList, 'goodsNameKey', response.goodsNameKey)
- this.$set(this.dataList, 'grade', response.grade)
- this.$set(this.dataList, 'gradeKey', response.gradeKey)
- this.$set(this.dataList, 'waterContent', response.waterContent)
- this.$set(this.dataList, 'bulkDensity', response.bulkDensity)
- // this.$set(this.dataList, 'weight', response.weight)
- this.$set(
- this.dataList,
- 'unitPrice',
- response.unitContractPrice
- )
- })
- }
- }
- }
- },
- selectwarehouseName(e) {
- this.baseId=e
- if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==2||this.dataList.taskTypeKey==3){
- this.goods=''
- localStorage.removeItem('supplygoods1')
- }
- for (var i = 0; i < this.warehouseNameList.length; i++) {
- if (this.warehouseNameList[i].id == e) {
- this.dataList.warehouseName = this.warehouseNameList[i].warehouseName
- if(this.dataList.taskTypeKey==3||this.dataList1.taskTypeKey==3){
- if(this.warehouseNameList[i].warehouseType==2){
- this.$set(this.dataList, 'goodsName', this.warehouseNameList[i].goodsName)
- this.$set(this.dataList, 'grade', this.warehouseNameList[i].grade)
- this.$set(this.dataList1, 'goodsName', this.warehouseNameList[i].goodsName)
- this.$set(this.dataList1, 'grade', this.warehouseNameList[i].grade)
- this.gradestatus=true
- }else{
- this.gradestatus=false
- }
- }
- console.log(this.warehouseNameList[i])
- //经办人
- getstaff({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseId: e
- })
- .toPromise()
- .then(response => {
- this.options = response
- this.staffList = response
- // this.agent = response
- })
- }
- }
- },
- selectwarehouseName1(e) {
- if(this.dataList1.taskTypeKey==4){
- this.goods=''
- localStorage.removeItem('supplygoods1')
- }
- for (var i = 0; i < this.warehouseNameList.length; i++) {
- if (this.warehouseNameList[i].id == e) {
- this.dataList1.warehouseName = this.warehouseNameList[i].warehouseName
- //经办人
- getstaff({
- compId: localStorage.getItem('ws-pf_compId'),
- warehouseId: e
- })
- .toPromise()
- .then(response => {
- this.options1 = response
- this.staffList1 = response
- // this.agent = response
- })
- }
- }
- },
- changecontract1(e) {
- if (this.dataList1.taskTypeKey != 3) {
- for (let i = 0; i < this.contractNoList1.length; i++) {
- if (this.contractNoList1[i].contractNo == e) {
- this.inOutType=this.contractNoList1[i].inOutType
- if(this.contractNoList1[i].priceType == '随行就市'){
- this.Pricetype = false
- }else{
- this.Pricetype = true
- }
- getGoodsName({
- contractId: this.contractNoList1[i].id,
- contractNo: this.contractNoList1[i].contractNo
- })
- .toPromise()
- .then(response => {
- this.$set(this.dataList1, 'goodsName', response.goodsName)
- this.$set(this.dataList1, 'goodsNameKey', response.goodsNameKey)
- this.$set(this.dataList1, 'grade', response.grade)
- this.$set(this.dataList1, 'gradeKey', response.gradeKey)
- this.$set(this.dataList1, 'waterContent', response.waterContent)
- this.$set(this.dataList1, 'bulkDensity', response.bulkDensity)
- if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=="退库"){
- this.goods=''
- this.dataList1.weight=0
- }else{
- this.$set(this.dataList1, 'weight', response.weight)
- }
- this.$set(
- this.dataList1,
- 'unitPrice',
- response.unitContractPrice
- )
- })
- }
- }
- }
- },
- selectstaff(e) {
- for (var i = 0; i < this.staffList.length; i++) {
- if (this.staffList[i].staffName == e) {
- this.dataList.agentKey = this.staffList[i].staffId
- }
- }
- },
- selectstaff1(e) {
- for (var i = 0; i < this.staffList1.length; i++) {
- if (this.staffList1[i].staffName == e) {
- this.dataList1.agentKey = this.staffList1[i].staffId
- }
- }
- },
- requestadd(list, status) {
- localStorage.removeItem('supplygoods1')
- list.compId = localStorage.getItem('ws-pf_compId')
- list.publisher =
- localStorage.getItem('ws-pf_roleName') +
- localStorage.getItem('ws-pf_staffName')
- addoreditoutput(list)
- .toPromise()
- .then(response => {
- var that = this
- this.$message.success('添加成功')
- setTimeout(function() {
- that.dataList = {
- taskTypeKey: 1
- }
- that.dataList1 = {}
- that.$router.push({
- path: 'tranManagementWarehouseInOuttask'
- })
- }, 2000)
- })
- },
- //提交按钮
- submit() {
- if (this.dataList.taskTypeKey == 1) {
- if (!this.dataList.warehouseName) {
- this.$message({
- message: '仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList.contractNo) {
- this.$message({
- message: '合同编号不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList.weight) {
- this.$message({
- message: '重量(吨)不能为空!',
- type: 'warning'
- })
- return
- }
- if (
- isNaN(this.dataList.weight) ||
- (String(this.dataList.weight).indexOf('.') != -1 &&
- String(this.dataList.weight).length -
- (String(this.dataList.weight).indexOf('.') + 1) >
- 2) ||
- this.dataList.weight < 0 ||
- this.dataList.weight > 200000
- ) {
- this.$message({
- message: '重量(吨)输入有误!',
- type: 'warning'
- })
- return
- }
- // if (!this.dataList.bulkDensity) {
- // this.$message({
- // message: '容重不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // this.dataList.bulkDensity < 0 ||
- // this.dataList.bulkDensity > 1000
- // ) {
- // this.$message({
- // message: '容重输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList.bulkDensity).indexOf('.') != -1 &&
- // String(this.dataList.bulkDensity).length -
- // (String(this.dataList.bulkDensity).indexOf('.') + 1) >
- // 0
- // ) {
- // this.$message({
- // message: '容重需输入整数',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList.waterContent) {
- // this.$message({
- // message: '水分不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (this.dataList.waterContent < 0 || this.dataList.waterContent > 40) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList.waterContent).indexOf('.') != -1 &&
- // String(this.dataList.waterContent).length -
- // (String(this.dataList.waterContent).indexOf('.') + 1) >
- // 1
- // ) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if(this.Pricetype){
- // if (!this.dataList.unitPrice) {
- // this.$message({
- // message: '单价不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // (this.dataList.unitPrice &&
- // String(this.dataList.unitPrice).indexOf('.') != -1 &&
- // String(this.dataList.unitPrice).length -
- // (String(this.dataList.unitPrice).indexOf('.') + 1) >
- // 2) ||
- // this.dataList.unitPrice > 100000 ||
- // this.dataList.unitPrice < 1
- // ) {
- // this.$message({
- // message: '单价输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // }
- if (!this.dataList.predictDate) {
- this.$message({
- message: '预计出库日期不能为空!',
- type: 'warning'
- })
- return
- }
- // if (isNaN(this.dataList.estimatedFreight)) {
- // this.$message({
- // message: '预估运费输入错误!',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList.agent) {
- // this.$message({
- // message: '出库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- if (!this.dataList.businessDescribe) {
- this.$message({
- message: '业务描述不能为空!',
- type: 'warning'
- })
- return
- }
- }
- if (this.dataList.taskTypeKey == 2) {
- if (!this.dataList1.warehouseName) {
- this.$message({
- message: '仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.contractNo) {
- this.$message({
- message: '合同编号不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.weight) {
- this.$message({
- message: '重量(吨)不能为空!',
- type: 'warning'
- })
- return
- }
- if (
- isNaN(this.dataList1.weight) ||
- (String(this.dataList1.weight).indexOf('.') != -1 &&
- String(this.dataList1.weight).length -
- (String(this.dataList1.weight).indexOf('.') + 1) >
- 2) ||
- this.dataList1.weight < 0 ||
- this.dataList1.weight > 200000
- ) {
- this.$message({
- message: '重量(吨)输入有误!',
- type: 'warning'
- })
- return
- }
- // if (!this.dataList1.bulkDensity) {
- // this.$message({
- // message: '容重不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // this.dataList1.bulkDensity < 500 ||
- // this.dataList1.bulkDensity > 1000
- // ) {
- // this.$message({
- // message: '容重输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
- // String(this.dataList1.bulkDensity).length -
- // (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
- // 0
- // ) {
- // this.$message({
- // message: '容重需输入整数',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList1.waterContent) {
- // this.$message({
- // message: '水分不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // this.dataList1.waterContent < 0 ||
- // this.dataList1.waterContent > 40
- // ) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList1.waterContent).indexOf('.') != -1 &&
- // String(this.dataList1.waterContent).length -
- // (String(this.dataList1.waterContent).indexOf('.') + 1) >
- // 1
- // ) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if(this.Pricetype){
- // if (!this.dataList1.unitPrice) {
- // this.$message({
- // message: '单价不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // (this.dataList1.unitPrice &&
- // String(this.dataList1.unitPrice).indexOf('.') != -1 &&
- // String(this.dataList1.unitPrice).length -
- // (String(this.dataList1.unitPrice).indexOf('.') + 1) >
- // 2) ||
- // this.dataList1.unitPrice > 100000 ||
- // this.dataList1.unitPrice < 1
- // ) {
- // this.$message({
- // message: '单价输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // }
- if (!this.dataList1.predictDate) {
- this.$message({
- message: '预计入库日期不能为空!',
- type: 'warning'
- })
- return
- }
- // if (isNaN(this.dataList1.estimatedFreight)) {
- // this.$message({
- // message: '预估运费输入错误!',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList1.agent) {
- // this.$message({
- // message: '入库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- if (!this.dataList1.businessDescribe) {
- this.$message({
- message: '业务描述不能为空!',
- type: 'warning'
- })
- return
- }
- }
- if (this.dataList.taskTypeKey == 3) {
- if (!this.dataList.warehouseName) {
- this.$message({
- message: '出库仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.warehouseName) {
- this.$message({
- message: '入库仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- this.dataList1.contractNo=''
- if (!this.dataList1.moveTaskNo) {
- this.$message({
- message: '移库任务编号不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.weight) {
- this.$message({
- message: '重量(吨)不能为空!',
- type: 'warning'
- })
- return
- }
- if (
- isNaN(this.dataList1.weight) ||
- (String(this.dataList1.weight).indexOf('.') != -1 &&
- String(this.dataList1.weight).length -
- (String(this.dataList1.weight).indexOf('.') + 1) >
- 2) ||
- this.dataList1.weight < 0 ||
- this.dataList1.weight > 200000
- ) {
- this.$message({
- message: '重量(吨)输入有误!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList.predictDate) {
- this.$message({
- message: '预计出库日期不能为空!',
- type: 'warning'
- })
- return
- }
- // if (isNaN(this.dataList1.estimatedFreight)) {
- // this.$message({
- // message: '预估运费输入错误!',
- // type: 'warning'
- // })
- // return
- // }
- if (!this.dataList1.predictDate) {
- this.$message({
- message: '预计入库日期不能为空!',
- type: 'warning'
- })
- return
- }
- // if (!this.dataList.agent) {
- // this.$message({
- // message: '出库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList1.agent) {
- // this.$message({
- // message: '入库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- if (!this.dataList1.businessDescribe) {
- this.$message({
- message: '业务描述不能为空!',
- type: 'warning'
- })
- return
- }
- }
- if (this.dataList1.taskTypeKey == 4) {
- if (!this.dataList.warehouseName) {
- this.$message({
- message: '出库仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.warehouseName) {
- this.$message({
- message: '入库仓库名不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.contractNo) {
- this.$message({
- message: '合同编号不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList.contractNo) {
- this.$message({
- message: '合同编号不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.weight) {
- this.$message({
- message: '重量(吨)不能为空!',
- type: 'warning'
- })
- return
- }
- if (
- isNaN(this.dataList1.weight) ||
- (String(this.dataList1.weight).indexOf('.') != -1 &&
- String(this.dataList1.weight).length -
- (String(this.dataList1.weight).indexOf('.') + 1) >
- 2) ||
- this.dataList1.weight < 0 ||
- this.dataList1.weight > 200000
- ) {
- this.$message({
- message: '重量(吨)输入有误!',
- type: 'warning'
- })
- return
- }
- // if (!this.dataList1.bulkDensity) {
- // this.$message({
- // message: '容重不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // this.dataList1.bulkDensity < 500 ||
- // this.dataList1.bulkDensity > 1000
- // ) {
- // this.$message({
- // message: '容重输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
- // String(this.dataList1.bulkDensity).length -
- // (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
- // 0
- // ) {
- // this.$message({
- // message: '容重需输入整数',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList1.waterContent) {
- // this.$message({
- // message: '水分不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // this.dataList1.waterContent < 0 ||
- // this.dataList1.waterContent > 40
- // ) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // String(this.dataList1.waterContent).indexOf('.') != -1 &&
- // String(this.dataList1.waterContent).length -
- // (String(this.dataList1.waterContent).indexOf('.') + 1) >
- // 1
- // ) {
- // this.$message({
- // message: '水分输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // if(this.Pricetype){
- // if (!this.dataList1.unitPrice) {
- // this.$message({
- // message: '单价不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (
- // (this.dataList1.unitPrice &&
- // String(this.dataList1.unitPrice).indexOf('.') != -1 &&
- // String(this.dataList1.unitPrice).length -
- // (String(this.dataList1.unitPrice).indexOf('.') + 1) >
- // 2) ||
- // this.dataList1.unitPrice > 100000 ||
- // this.dataList1.unitPrice < 1
- // ) {
- // this.$message({
- // message: '单价输入错误',
- // type: 'warning'
- // })
- // return
- // }
- // }
- if (!this.dataList.predictDate) {
- this.$message({
- message: '预计出库日期不能为空!',
- type: 'warning'
- })
- return
- }
- if (!this.dataList1.predictDate) {
- this.$message({
- message: '预计入库日期不能为空!',
- type: 'warning'
- })
- return
- }
- // if (isNaN(this.dataList1.estimatedFreight)) {
- // this.$message({
- // message: '预估运费输入错误!',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList.agent) {
- // this.$message({
- // message: '出库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- // if (!this.dataList1.agent) {
- // this.$message({
- // message: '入库经办人不能为空!',
- // type: 'warning'
- // })
- // return
- // }
- if (!this.dataList.businessDescribe) {
- this.$message({
- message: '业务描述不能为空!',
- type: 'warning'
- })
- return
- }
- }
- localStorage.removeItem("warehouse")
- localStorage.removeItem("contractNo");
- localStorage.removeItem("taskTypeKey");
- // this.dataList.goodsNameKey =
- // this.dataList.positionId =
- // this.dataList.baseId =
- this.dataList.inOutFlag = 1
- this.dataList1.inOutFlag = 2
- var data=JSON.parse(localStorage.getItem("supplygoods"))
- if(data){
- for (let i = 0; i < data.length; i++) {
- data[i].sourceId=data[i].id
- }
- }else{
- if(this.dataList.taskTypeKey == 1||this.dataList.taskTypeKey == 3||this.dataList.taskTypeKey == 4||this.dataList1.taskTypeKey == 2&&this.dataList1.inOutType){
- this.$message({
- message: '请选择货源!',
- type: 'warning'
- })
- return
- }
-
- }
- var supplygoods=data
- this.dataList.sourceId=this.goods
- this.dataList1.sourceId=this.goods
- if (this.dataList.taskTypeKey == 1) {
- this.dataList.inOutTaskNo = this.inOutTaskNo
- this.dataList.sourceRelationInfoList=supplygoods
- this.requestadd(this.dataList)
- } else if (this.dataList1.taskTypeKey == 2) {
- this.dataList1.inOutTaskNo = this.inOutTaskNo1
- this.dataList1.sourceRelationInfoList=supplygoods
- this.requestadd(this.dataList1)
- } else if (
- this.dataList.taskTypeKey == 3 ||
- this.dataList.taskTypeKey == 4
- ) {
- this.dataList.inOutTaskNo = this.inOutTaskNo
- this.dataList.relevanceId = this.GetRandomNum(100000, 999999)
- this.dataList.sourceRelationInfoList=supplygoods
- this.dataList1.sourceRelationInfoList=supplygoods
- if (this.dataList.taskTypeKey == 3) {
- this.dataList.sendWarehouse=this.dataList.warehouseName
- this.dataList.receiveWarehouse=this.dataList1.warehouseName
- this.dataList1.sendWarehouse=this.dataList.warehouseName
- this.dataList1.receiveWarehouse=this.dataList1.warehouseName
- this.dataList.businessDescribe = this.dataList1.businessDescribe
- } else {
- this.dataList1.businessDescribe = this.dataList.businessDescribe
- }
- this.requestadd(this.dataList, 'repetition')
- this.dataList1.inOutTaskNo = this.inOutTaskNo1
- this.dataList1.relevanceId = this.dataList.relevanceId
- this.dataList1.goodsName = this.dataList.goodsName
- this.requestadd(this.dataList1, 'repetition')
- }
- },
- tarechange(e) {
- if (this.dataList.grossWeight && this.dataList.tare) {
- this.dataList.netWeight = Number(
- this.dataList.grossWeight - this.dataList.tare
- )
- }
- },
- grossWeightchange(e) {
- if (this.dataList.grossWeight && this.dataList.tare) {
- this.dataList.netWeight = Number(
- this.dataList.grossWeight - this.dataList.tare
- )
- }
- },
- selectgoodsName(e) {
- for (var i = 0; i < this.goodnameList.length; i++) {
- if (this.goodnameList[i].constValue == e) {
- this.dataList.goodsNameKey = this.goodnameList[i].constKey
- }
- }
- },
- selectgoodsName1(e) {
- for (var i = 0; i < this.goodnameList.length; i++) {
- if (this.goodnameList[i].constValue == e) {
- this.dataList1.goodsNameKey = this.goodnameList[i].constKey
- }
- }
- },
- selectpackingMethod(e) {
- for (var i = 0; i < this.gradeList.length; i++) {
- if (this.gradeList[i].constValue == e) {
- this.dataList.gradeKey = this.gradeList[i].constKey
- if (this.dataList.taskTypeKey == 3) {
- this.$set(this.dataList1, 'grade', e)
- this.$set(this.dataList1, 'gradeKey', this.gradeList[i].constKey)
- }
- }
- }
- },
- selectpackingMethod1(e) {
- for (var i = 0; i < this.gradeList.length; i++) {
- if (this.gradeList[i].constValue == e) {
- this.dataList1.packingMethodKey = this.gradeList[i].constKey
- if (this.dataList1.taskTypeKey == 4) {
- this.$set(this.dataList, 'grade', e)
- this.$set(this.dataList, 'gradeKey', this.gradeList[i].constKey)
- }
- }
- }
- },
- selectstorageType(e) {
- switch (e) {
- case '采购出库':
- this.flag = 0
- break
- case '销售出库':
- this.flag = 1
- break
- }
- for (var i = 0; i < this.storageType.length; i++) {
- if (this.storageType[i].constValue == e) {
- this.dataList.inOutTypeKey = this.storageType[i].constKey
- }
- }
- },
- selectstorageType1(e) {
- switch (e) {
- case '采购入库':
- this.flag = 0
- break
- case '暂存入库':
- this.flag = 0
- break
- case '贸易服务入库':
- this.flag = 0
- break
- case '退库':
- this.flag = 2
- break
- }
- for (var i = 0; i < this.storageType1.length; i++) {
- if (this.storageType1[i].constValue == e) {
- this.dataList1.inOutTypeKey = this.storageType1[i].constKey
- }
- }
- },
- handleClose() {
- this.accessoryTFs = false
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`)
- this.pageSize = val
- this.getList()
- },
- businessDescriptionchange(e) {
- console.log(e)
- },
- handleCurrentChange(val) {
- this.currentPage = val
- console.log(`当前页: ${val}`)
- this.getList()
- },
- tasknumber() {
- if (this.dataList.taskTypeKey == 1) {
- this.inOutTaskNo = 'CK' + this.getdate() + this.MathRand()
- } else if (this.dataList.taskTypeKey == 2) {
- this.inOutTaskNo1 = 'RK' + this.getdate() + this.MathRand()
- } else if (this.dataList.taskTypeKey == 3) {
- var random = this.getdate() + this.MathRand()
- this.inOutTaskNo = 'YKC' + random
- this.inOutTaskNo1 = 'YKR' + random
- // this.dataList.moveTaskNo = 'YKRW' + random
- // this.dataList1.moveTaskNo = 'YKRW' + random
- } else if (this.dataList.taskTypeKey == 4) {
- var random = this.getdate() + this.MathRand()
- this.inOutTaskNo = 'TCC' + random
- this.inOutTaskNo1 = 'TCR' + random
- }
- },
- tasktypechange(e) {
- if (!this.$route.query.relevanceId) {
- this.tasknumber()
- }
- this.dataList1.taskTypeKey = e
- if (this.dataList.taskTypeKey == 1) {
- this.dataList.inOutType = '销售出库'
- this.dataList.inOutTypeKey = '1'
- this.flag = 1
- }
- if (this.dataList1.taskTypeKey == 2) {
- this.dataList1.inOutType = '采购入库'
- this.dataList1.inOutTypeKey = '1'
- this.flag = 8
- } else if (this.dataList1.taskTypeKey == 3) {
- this.disabled = true
- this.gradestatus=false
- this.dataList1.inOutType = '移库入库'
- this.dataList1.inOutTypeKey = '3'
- this.dataList.inOutType = '移库出库'
- this.dataList.inOutTypeKey = '3'
- } else if (this.dataList1.taskTypeKey == 4) {
- this.disabled = true
- this.dataList1.inOutType = '退库'
- this.dataList1.inOutTypeKey = '6'
- this.dataList.inOutType = '销售出库'
- this.flag = 2
- this.dataList.inOutTypeKey = '1'
- }
- },
- GetRandomNum(Min, Max) {
- var Range = Max - Min
- var Rand = Math.random()
- return Min + Math.round(Rand * Range)
- },
- getList() {
- this.tasknumber()
- if(localStorage.getItem("supplygoods1")){
- if(this.dataList.taskTypeKey == 1){
- this.$set(this.dataList, 'inOutType', '销售出库')
- this.$set(this.dataList, 'inOutTypeKey', '1')
- this.$set(this.dataList, 'goodsName', '玉米')
- this.$set(this.dataList, 'goodsNameKey', '1')
- this.$set(this.dataList, 'grade', '一等品')
- this.$set(this.dataList, 'gradeKey', '1')
- this.$set(this.dataList1, 'goodsName', '玉米')
- this.$set(this.dataList1, 'goodsNameKey', '1')
- this.$set(this.dataList1, 'grade', '一等品')
- this.$set(this.dataList1, 'gradeKey', '1')
- }
- }else{
- this.$set(this.dataList, 'inOutType', '销售出库')
- this.$set(this.dataList, 'inOutTypeKey', '1')
- this.$set(this.dataList, 'goodsName', '玉米')
- this.$set(this.dataList, 'goodsNameKey', '1')
- this.$set(this.dataList, 'grade', '一等品')
- this.$set(this.dataList, 'gradeKey', '1')
- this.$set(this.dataList1, 'goodsName', '玉米')
- this.$set(this.dataList1, 'goodsNameKey', '1')
- this.$set(this.dataList1, 'grade', '一等品')
- this.$set(this.dataList1, 'gradeKey', '1')
- }
-
- // 货名
- pullDown({
- constId: 'CON2'
- })
- .toPromise()
- .then(response => {
- this.goodnameList = response
- })
- // 品级
- pullDown({
- constId: 'CON3'
- })
- .toPromise()
- .then(response => {
- this.gradeList = response
- })
- pullDown({
- constId: 'CON6'
- })
- .toPromise()
- .then(response => {
- this.storageType = response
- })
- pullDown({
- constId: 'CON5'
- })
- .toPromise()
- .then(response => {
- this.storageType1 = response
- })
- xialaNo({
- compId: this.compId,
- flag: this.flag
- })
- .toPromise()
- .then(response => {
- this.contractNoList = response
- // this.contractNoList1 = response
- })
- // //临时仓库入库类型
- // pullDown({ constId: 'WARE1' })
- // .toPromise()
- // .then((response) => {
- // this.storageType = respons
- // })
- // //临时仓库出库类型
- // pullDown({ constId: 'WARE2' })
- // .toPromise()
- // .then((response) => {
- // this.deliveryType = response
- // })
- //仓库名
- getwarehousename({
- compId: this.compId,
- warehouseType: 1
- })
- .toPromise()
- .then(response => {
- this.warehouseNameList = response
- getwarehousename({
- compId: this.compId,
- warehouseType: 2
- })
- .toPromise()
- .then(response => {
- console.log('查仓库sss',response)
- for (var i = 0; i < response.length; i++) {
- this.warehouseNameList.push(response[i])
- }
- })
- })
- },
- 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
- }
- })
- },
- // 关闭 dialog时 处理文件url 初始化upload组件
- handleCloe() {
- this.dialogViewSpareMoney = false
- },
- history(row) {
- console.log(row)
- billoperatehis({
- id: row.id
- })
- .toPromise()
- .then(response => {
- this.historyList = response
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/.basicInformation {
- .el-info-table {
- border: none;
- position: relative;
- }
- .el-form-item {
- width: 33.3333%;
- border: none;
- margin: 0;
- .el-form-item__label {
- text-align: left;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- }
- .el-form-item__content {
- padding-left: 0px;
- padding-right: 10px;
- // background: #fff;
- white-space: nowrap;
- height: 40px;
- display: flex;
- -webkit-box-align: center;
- align-items: center;
- text-align: left;
- overflow: hidden;
- }
- }
- }
- /deep/.el-radio {
- color: #606266;
- font-weight: 500;
- line-height: 1;
- cursor: pointer;
- white-space: nowrap;
- outline: 0;
- margin-right: 30px;
- margin-top: 15px;
- }
- /deep/.el-radio__inner {
- border: 1px solid #dcdfe6;
- border-radius: 100%;
- width: 14px;
- height: 14px;
- background-color: #fff;
- cursor: pointer;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- margin-left: 100px;
- }
- /deep/.el-radio__input {
- white-space: nowrap;
- cursor: pointer;
- outline: 0;
- line-height: 1;
- vertical-align: middle;
- margin-top: -1px;
- }
- .title {
- position: relative;
- padding-left: 10px;
- }
- .title::before {
- content: '';
- display: inline-block;
- width: 5px;
- height: 30px;
- background: #5473e8;
- position: absolute;
- left: 0;
- }
- .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%;
- margin: 0 auto;
- margin-right: 180px;
- }
- /deep/.el-form-item__label {
- width: 160px;
- }
- .inspector {
- width: 50%;
- }
- /deep/.el-form-item--small .el-form-item__label,
- .el-form-item--small .el-form-item__content {
- text-align: left;
- }
- /deep/.el-input--small {
- font-size: 13px;
- position: relative;
- display: inline-block;
- }
- .center1 .small-title {
- margin-left: 323px;
- }
- .center1 {
- width: 90%;
- margin: 0 auto;
- margin-left: 10px;
- margin-top: 25px;
- }
- /deep/.el-input--small .el-input__inner {
- height: 32px;
- line-height: 32px;
- }
- /deep/.el-select {
- display: inline-block;
- position: relative;
- width: 100%;
- }
- .annu {
- height: 81px;
- background: #ffffff;
- border-radius: 4px;
- }
- .basicInformation .el-form-item {
- width: 50.3333%;
- border: none;
- margin: 0;
- }
- .huom {
- width: 100%;
- }
- .a {
- margin-left: -32px;
- }
- .ding {
- height: 23px;
- background: #e8ecf6;
- box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
- }
- .el-radio-group {
- font-size: 0;
- margin-top: 20px;
- margin-left: 251px;
- }
- /deep/.el-form {
- padding: 0 15%;
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -ms-flex-wrap: wrap;
- flex-wrap: wrap;
- margin-left: 130px;
- margin-top: 15px;
- width: 100%;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #8890b1;
- line-height: 16px;
- }
- </style>
|