1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back" v-if="!home">
- <el-button
- type="danger"
- style="border: none;background: none;color: red"
- icon="el-icon-arrow-left"
- @click="backToList(0)"
- >返回列表
- </el-button>
- </div>
- <div class="customer-back" v-else>
- <el-button
- type="danger"
- style="border: none;background: none;color: red"
- icon="el-icon-arrow-left"
- @click="backToList(1)"
- >返回列表
- </el-button>
- <el-button
- type="danger"
- v-if="returnButton"
- style="border: none;background: none;color: red"
- icon="el-icon-arrow-left"
- @click="backToList(2)"
- >返回首页
- </el-button>
- <el-button
- type="danger"
- v-if="!returnButton"
- style="border: none;background: none;color: red"
- icon="el-icon-arrow-left"
- @click="backToList(3)"
- >返回台账
- </el-button>
- </div>
- <div>
- <div class="el-button--small-yh add-customer-btn">
- <el-button
- type="warning"
- size="small"
- :loading="type"
- v-if="goodsForm.status > 0 && roleName.indexOf('admin') !== -1 || roleName.indexOf('业务员') !== -1 || roleName.indexOf('分管调度') !== -1"
- :disabled="
- !(roleName.indexOf('业务员') !== -1||roleName.indexOf('分管调度') !== -1||roleName.indexOf('经理') !== -1||roleName.indexOf('部门经理') !== -1||roleName.indexOf('总经理') !== -1) && !(roleName.indexOf('admin') !== -1)"
- @click="confirmChange"
- >变更
- </el-button>
- <el-button
- type="warning"
- size="small"
- :loading="type"
- v-if="goodsForm.status > 3 && ((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('车队') !== -1 || roleName.indexOf('admin') !== -1) && goodsForm.status !== 5"
- @click="confirmChangeTwo"
- >变更车
- </el-button>
- <el-button
- type="success"
- v-if="goodsForm.status === 0 && typeTwo === false"
- v-show="roleName.indexOf('admin') !== -1 || roleName.indexOf('业务员') !== -1 || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1)"
- size="small"
- :loading="type"
- @click="submit(true)"
- >提交
- </el-button>
- <el-button
- type="success"
- v-if="goodsForm.status > 0 && goodsForm.status !== 5"
- size="small"
- :loading="type"
- v-show="
- (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1 && goodsForm.status === 1||goodsForm.status === 2)
- || (roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
- || (roleName.indexOf('司机') !== -1 && goodsForm.status === 3)
- || (roleName.indexOf('司机') !== -1 && goodsForm.status === 4)
- || (roleName.indexOf('司机') !== -1 && goodsForm.status === 6) || roleName.indexOf('admin') !== -1"
- @click="modifyState"
- >
- {{
- goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' : '未知状态:' + goodsForm.status
- }}
- </el-button>
- <el-button
- type="warning"
- v-if="goodsForm.status === 2 && ((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1)||roleName.indexOf('admin') !== -1) "
- size="small"
- :loading="type"
- @click="cancelScheduling('2')"
- >取消调度
- </el-button>
- <el-button
- type="warning"
- v-if="goodsForm.status === 3 && (roleName.indexOf('车队') !== -1 || roleName.indexOf('admin') !== -1) || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1)"
- size="small"
- :loading="type"
- @click="cancelScheduling('1')"
- >取消派车
- </el-button>
- <el-button
- type="warning"
- v-if="goodsForm.status === 6 && (roleName.indexOf('司机') !== -1 || roleName.indexOf('admin') !== -1 || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1))"
- size="small"
- :loading="type"
- @click="cancelScheduling('3')"
- >取消受理
- </el-button>
- <el-button
- type="success"
- v-if="goodsForm.status === 1 && ((roleName.indexOf('客户') !== -1 && roleName.indexOf('业务员') !== -1)||roleName.indexOf('admin') !== -1 || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1))"
- size="small"
- :loading="type"
- @click="submit(false)"
- >取消提交
- </el-button>
- <el-button
- type="primary"
- :disabled="goodsForm.status === 5"
- v-show="(roleName.indexOf('客户') !== -1 && roleName.indexOf('业务员') !== -1)||roleName.indexOf('分管调度') !== -1||roleName.indexOf('administrator') !== -1||roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('车队') !== -1 && this.goodsForm.status >3 && goodsForm.status !== 5)"
- size="small"
- :loading="type"
- v-if="!typeTwo"
- @click="editCustomer"
- >保存
- </el-button>
- <el-button
- type="primary"
- :disabled="goodsForm.status === 1"
- size="small"
- v-else
- :loading="type"
- @click="changeSaving"
- >变更保存
- </el-button>
- </div>
- </div>
- </div>
- <trade-card title="业务类型" style="margin-top: 50px">
- <avue-form v-model="goodsForm" :option="goodsOptionFormC" ref="goodsFormE"></avue-form>
- </trade-card>
- <trade-card title="委托信息">
- <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
- <template slot-scope="{}" slot="corpIdLabel">
- <e-crop-jump label="公司名称" corp-type="KH" :value="goodsForm.corpName"></e-crop-jump>
- </template>
- <template slot-scope="scope" slot="corpId">
- <!-- <crop-select-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- v-model="goodsForm.corpId"-->
- <!-- @getCorpData="getCorpData"-->
- <!-- :corpType="'KH'"-->
- <!-- ></crop-select>-->
- <e-crop-select
- v-model="goodsForm.corpId"
- :name.sync="goodsForm.corpName"
- corp-type="KH"
- :disabled="goodsForm.status !== 0"
- @getCropId="getCropId"
- />
- </template>
- <template slot-scope="scope" slot="station">
- <port-info
- v-model="goodsForm.station"
- :disabled="goodsForm.status !== 0"
- />
- </template>
- <template slot-scope="scope" slot="salesman">
- <el-select v-model="goodsForm.salesman" filterable clearable placeholder="请选择"
- :disabled="goodsForm.status !== 0"
- @change="changeSelect">
- <el-option
- v-for="item in salesmanList"
- :key="item.id"
- :label="item.realName"
- :value="item.id">
- </el-option>
- </el-select>
- </template>
- <template slot-scope="scope" slot="agentId">
- <crop-select
- :disabled="goodsForm.status !== 0"
- v-model="goodsForm.agentId"
- ></crop-select>
- </template>
- <template slot-scope="scope" slot="polId">
- <port-info
- v-model="goodsForm.polId"
- :disabled="goodsForm.status !== 0"/>
- </template>
- <template slot-scope="scope" slot="podId">
- <port-info
- v-model="goodsForm.podId"
- :disabled="goodsForm.status !== 0"/>
- </template>
- </avue-form>
- </trade-card>
- <containerTitle v-if="false" title="箱信息"></containerTitle>
- <basic-container v-if="goodsForm.status === 0 || !goodsForm.status" v-show="false">
- <avue-crud :data="entrustList"
- :option="entrustOptionTwo"
- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
- @row-update="rowSave"
- ref="crudBox"
- v-if="KeyBox>0"
- @resetColumn="resetColumnBox"
- @saveColumn="saveColumnBox"
- @row-del="rowDel">
- <template slot="headerSerial" slot-scope="{column}">
- <el-tooltip class="item" effect="dark" content="录入明细" placement="top">
- <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
- @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0,landWeight:0})"></el-button>
- </el-tooltip>
- </template>
- <template slot="ctnTypeHeader" slot-scope="{column}">
- {{ column.label }}<span style="color:#F56C6C">*</span>
- </template>
- <template slot="ctnQuantityHeader" slot-scope="{column}">
- {{ column.label }}<span style="color:#F56C6C">*</span>
- </template>
- <!-- <template slot="landWeightHeader" slot-scope="{column}">-->
- <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
- <!-- </template>-->
- <!-- <template slot="landAmountDHeader" slot-scope="{column}">-->
- <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
- <!-- </template>-->
- <template slot="arrivalTimeHeader" slot-scope="{column}">
- {{ column.label }}<span style="color:#F56C6C">*</span>
- </template>
- </avue-crud>
- </basic-container>
- <basic-container v-if="goodsForm.status !== 0 && goodsForm.status" v-show="false">
- <avue-crud
- :data="entrustList"
- :option="entrustOptionTwoT"
- ref="crudBoxTwo"
- v-if="KeyBoxTwo>0"
- @resetColumn="resetColumnBoxTwo"
- @saveColumn="saveColumnBoxTwo"
- @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
- @row-update="rowSaveT">
- <template slot="fleetId" slot-scope="{ row, index }">
- <crop-select
- v-if="row.$cellEdit"
- v-model="row.fleetId"
- :cropIndex="index"
- @getCorpData="(data)=>{getfleetIdT(data,row)}"
- ></crop-select>
- <span v-else>{{ row.fleetName }}</span>
- </template>
- </avue-crud>
- </basic-container>
- <span v-if="false">
- <containerTitle title="起止地信息"></containerTitle>
- <basic-container>
- <el-table
- ref="singleTable"
- :data="tableData"
- size="mini"
- :header-cell-style="{color:'#000',background:'#fafafa'}"
- style="width: 100%">
- <el-table-column
- align="center"
- v-if="goodsForm.status === 0"
- width="40">
- <template slot-scope="scope">
- <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
- placement="top">
- <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column
- property="date"
- align="center"
- width="40">
- <template slot-scope="scope">
- <span v-if="scope.$index == 0">
- <el-button type="primary" size="mini" circle>起</el-button>
- </span>
- <span v-else-if="scope.$index === tableData.length-1">
- <el-button type="success" size="mini" circle>止</el-button>
- </span>
- <span v-else>
- <el-button v-if="goodsForm.status !== 0" type="warning" size="mini" circle>途</el-button>
- <el-tooltip v-else class="item" effect="dark" content="删除" placement="left">
- <el-button type="danger" icon="el-icon-delete" size="mini" circle
- @click="deleteAddress(scope)"></el-button>
- </el-tooltip>
- </span>
- </template>
- </el-table-column>
- <el-table-column
- type="index"
- label="序号"
- align="center"
- width="60">
- </el-table-column>
- <el-table-column
- property="corpId"
- label="货运地点"
- align="center"
- :render-header="customTitle"
- width="280">
- <template slot-scope="scope">
- <crop-select
- :corpType="'GC'"
- :disabled="goodsForm.status !== 0"
- v-model="scope.row.corpId"
- @clear="clear(scope.row)"
- @getCorpData="(row)=>{withAddress(row,scope)}"/>
- </template>
- </el-table-column>
- <!-- <el-table-column-->
- <!-- property="province"-->
- <!-- label="省市区"-->
- <!-- align="center"-->
- <!-- width="280">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-cascader-->
- <!-- size="small"-->
- <!-- style="width: 100%;"-->
- <!-- :key="scope.row.key"-->
- <!-- :disabled="goodsForm.status === 1"-->
- <!-- :props="treeOption"-->
- <!-- clearable-->
- <!-- v-model="scope.row.region"></el-cascader>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column
- property="address"
- align="center"
- width="150"
- label="联系人">
- <template slot-scope="scope">
- <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="address"
- align="center"
- width="180"
- label="电话">
- <template slot-scope="scope">
- <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="address"
- align="center"
- label="详细地址">
- <template slot-scope="scope">
- <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="remarks"
- align="center"
- label="备注">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="40">
- <template slot-scope="scope">
- <div v-if="scope.$index !== tableData.length-1" style="margin: -5px auto">
- <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 1">
- <div class="single" style="margin-bottom: -5px">
- <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-up" size="mini"
- @click="moveUp(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
- v-if="scope.$index > 0 && scope.$index < tableData.length-2">
- <div class="single" style="margin-top: -5px">
- <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-down" size="mini"
- @click="moveDown(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </basic-container>
- </span>
- <trade-card title="装货地点">
- <el-table
- ref="singleTable"
- border="1"
- :data="tableData"
- size="mini"
- :header-cell-style="{color:'#000',background:'#fafafa'}"
- style="width: 100%">
- <el-table-column
- align="center"
- fixed
- v-if="goodsForm.status === 0"
- width="50">
- <template slot-scope="scope" slot="header">
- <el-tooltip className="item" effect="dark" content="增加途径地址"
- placement="top">
- <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"></el-button>
- </el-tooltip>
- </template>
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="删除" placement="right">
- <el-button type="danger" icon="el-icon-delete" size="mini" circle
- @click="deleteAddress(scope)"></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column
- type="index"
- label="序号"
- align="center"
- width="60">
- </el-table-column>
- <el-table-column
- property="freightTime"
- label="货运日期"
- align="center"
- width="200">
- <template slot-scope="scope">
- <el-date-picker
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm:ss"
- v-model="scope.row.freightTime"
- :disabled="goodsForm.status !== 0"
- type="datetime"
- style="width: 100%;"
- size="small"
- placeholder="选择货运日期">
- </el-date-picker>
- </template>
- </el-table-column>
- <el-table-column
- property="corpId"
- label="货运地点"
- align="center"
- width="280">
- <template slot="header" slot-scope="{ column, $index }">
- <e-crop-jump :label="column.label" corp-type="GC"></e-crop-jump><span style="color:#F56C6C">*</span>
- </template>
- <template slot-scope="scope">
- <crop-select
- :corpType="'GC'"
- :disabled="goodsForm.status !== 0"
- :slot="true"
- v-model="scope.row.corpId"
- @clear="clear(scope.row)"
- @getCorpData="(row)=>{withAddress(row,scope)}">
- <template slot="slot">
- <el-select
- :disabled="goodsForm.status !== 0"
- style="width: 100%;"
- filterable
- clearable
- v-model="scope.row.corpId"
- size="small" placeholder="请选择"
- @change="withAddress({},scope,true)">
- <el-option
- v-for="item in corpList"
- :key="item.id"
- :label="item.cname"
- :value="item.id">
- </el-option>
- </el-select>
- </template>
- </crop-select>
- </template>
- </el-table-column>
- <el-table-column
- property="contacts"
- align="center"
- width="150"
- label="联系人">
- <template slot-scope="scope">
- <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="tel"
- align="center"
- width="180"
- label="电话">
- <template slot-scope="scope">
- <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="address"
- align="center"
- width="280"
- label="详细地址">
- <template slot-scope="scope">
- <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="volume"
- align="center"
- width="180"
- label="货物体积">
- <template slot-scope="scope">
- <el-input-number :controls="false" v-model="scope.row.volume" size="small"
- :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"
- @change="calculateFreight()"></el-input-number>
- </template>
- </el-table-column>
- <el-table-column
- property="packingType"
- align="center"
- width="180"
- label="包装类型">
- <template slot-scope="scope">
- <el-select v-model="scope.row.packingType" :disabled="goodsForm.status !== 0" placeholder="请选择">
- <el-option
- v-for="item in packageType"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- property="weight"
- align="center"
- width="180"
- label="重量">
- <template slot-scope="scope">
- <el-input v-model="scope.row.weight" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容" @input="calculateFreight()"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="quantity"
- align="center"
- width="180"
- label="件数">
- <template slot-scope="scope">
- <el-input v-model="scope.row.quantity" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容" @input="calculateFreight()"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="remarks"
- align="center"
- width="200"
- label="备注">
- <template slot-scope="scope">
- <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="40">
- <template slot-scope="scope">
- <div style="margin: -5px auto">
- <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 0">
- <div class="single" style="margin-bottom: -5px">
- <el-button
- type="text"
- style="margin-right: -0.5rem"
- icon="el-icon-arrow-up"
- size="mini"
- @click="moveUp(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
- v-if="scope.$index < tableData.length-1">
- <div class="single" style="margin-top: -5px">
- <el-button
- type="text"
- style="margin-right: -0.5rem"
- icon="el-icon-arrow-down"
- size="mini"
- @click="moveDown(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- align="center"
- label="操作"
- width="80">
- <template slot-scope="{row, index}">
- <el-button type="text" size="small" icon="el-icon-s-order" @click="annexOpen(row, index,true)">附 件
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </trade-card>
- <trade-card title="卸货地点">
- <el-table
- border="1"
- ref="singleTable"
- :data="tableDataTwo"
- size="mini"
- :header-cell-style="{color:'#000',background:'#fafafa'}"
- style="width: 100%">
- <el-table-column
- align="center"
- fixed
- v-if="goodsForm.status === 0"
- width="50">
- <template slot-scope="scope" slot="header">
- <el-tooltip
- className="item"
- effect="dark"
- content="增加途径地址"
- placement="top">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- circle
- @click="addAddressTwo">
- </el-button>
- </el-tooltip>
- </template>
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="删除" placement="right">
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="mini"
- circle
- @click="deleteAddressTwo(scope)"></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column
- type="index"
- label="序号"
- align="center"
- width="60">
- </el-table-column>
- <el-table-column
- property="freightTime"
- label="货运日期"
- align="center"
- width="200">
- <template slot-scope="scope">
- <el-date-picker
- format="yyyy-MM-dd HH:mm"
- value-format="yyyy-MM-dd HH:mm:ss"
- v-model="scope.row.freightTime"
- type="datetime"
- :disabled="goodsForm.status !== 0"
- style="width: 100%;"
- size="small"
- placeholder="选择货运日期">
- </el-date-picker>
- </template>
- </el-table-column>
- <el-table-column
- property="corpId"
- label="货运地点"
- align="center"
- width="280">
- <template slot="header" slot-scope="{ column, $index }">
- <e-crop-jump :label="column.label" corp-type="GC"></e-crop-jump><span style="color:#F56C6C">*</span>
- </template>
- <template slot-scope="scope">
- <crop-select
- :corpType="'GC'"
- :slot="true"
- :disabled="goodsForm.status !== 0"
- v-model="scope.row.corpId"
- @clear="clear(scope.row)"
- @getCorpData="(row)=>{withAddressTwo(row,scope)}">
- <template slot="slot">
- <el-select @change="withAddressTwo({},scope,true)" :disabled="goodsForm.status !== 0" clearable
- style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
- <el-option
- v-for="item in corpList"
- :key="item.id"
- :label="item.cname"
- :value="item.id">
- </el-option>
- </el-select>
- </template>
- </crop-select>
- </template>
- </el-table-column>
- <el-table-column
- property="contacts"
- align="center"
- width="150"
- label="联系人">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.contacts"
- :disabled="goodsForm.status !== 0"
- size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="tel"
- align="center"
- width="180"
- label="电话">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.tel"
- :disabled="goodsForm.status !== 0"
- size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="address"
- align="center"
- width="280"
- label="详细地址">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.address"
- :disabled="goodsForm.status !== 0"
- size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="volume"
- align="center"
- width="180"
- label="货物体积">
- <template slot-scope="scope">
- <el-input-number :controls="false" v-model="scope.row.volume" size="small"
- :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"
- @change="calculateFreight()"></el-input-number>
- </template>
- </el-table-column>
- <el-table-column
- property="packingType"
- align="center"
- width="180"
- label="包装类型">
- <template slot-scope="scope">
- <el-select v-model="scope.row.packingType" :disabled="goodsForm.status !== 0" placeholder="请选择">
- <el-option
- v-for="item in packageType"
- :key="item.id"
- :label="item.dictValue"
- :value="item.dictKey">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- property="weight"
- align="center"
- width="180"
- label="重量">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.weight"
- :disabled="goodsForm.status !== 0"
- size="small"
- @input="calculateFreight()"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="quantity"
- align="center"
- width="180"
- label="件数">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.quantity"
- :disabled="goodsForm.status !== 0"
- size="small"
- @input="calculateFreight()"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- property="remarks"
- align="center"
- width="200"
- label="备注">
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remarks"
- :disabled="goodsForm.status !== 0"
- size="small"
- placeholder="请输入内容"></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- width="40">
- <template slot-scope="scope">
- <div style="margin: -5px auto">
- <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 0">
- <div class="single" style="margin-bottom: -5px">
- <el-button
- type="text"
- style="margin-right: -0.5rem"
- icon="el-icon-arrow-up"
- size="mini"
- @click="moveUpTwo(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
- v-if="scope.$index < tableDataTwo.length-1">
- <div class="single" style="margin-top: -5px">
- <el-button
- type="text"
- style="margin-right: -0.5rem"
- icon="el-icon-arrow-down"
- size="mini"
- @click="moveDownTwo(scope.row,scope.$index)"></el-button>
- </div>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- fixed="right"
- align="center"
- label="操作"
- width="80">
- <template slot-scope="{row, index}">
- <el-button type="text" size="small" icon="el-icon-s-order" @click="annexOpen(row, index,true)">附 件
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </trade-card>
- <trade-card title="车辆信息">
- <avue-form :option="goodsOptionFormTwo" v-model="goodsForm"></avue-form>
- </trade-card>
- <span v-if="false">
- <containerTitle title="车辆信息"></containerTitle>
- <basic-container>
- <avue-crud
- :data="vehicleList"
- ref="crudContact"
- v-if="keyContact>0"
- @resetColumn="resetColumnContact"
- @saveColumn="saveColumnContact"
- :option="vehicleOption">
- <template slot="plateNo" slot-scope="{row}">
- <span class="el-button--text" style="cursor: pointer"
- @click="openTrack(row)">{{ row.plateNo }}</span>
- </template>
- </avue-crud>
- </basic-container>
- </span>
- <trade-card title="杂费明细"
- v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1 || roleName.indexOf('admin') !== -1 || roleName.indexOf('车队') !== -1">
- <el-tabs v-model="activeIndex" @tab-click="handleSelect">
- <el-tab-pane label="应收" name="1"
- v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1 || roleName.indexOf('admin') !== -1"></el-tab-pane>
- <el-tab-pane label="应付" name="2"
- v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('admin') !== -1 || roleName.indexOf('车队') !== -1"></el-tab-pane>
- </el-tabs>
- <avue-crud
- v-if="activeIndex === '1'"
- :data="collectionList"
- :option="collectionOption"
- :key="key"
- ref="collection"
- @resetColumn="resetColumnCollection"
- @saveColumn="saveColumnCollection"
- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
- @row-update="rowSave"
- @row-del="makeDel">
- <template slot-scope="{row}" slot="corpId">
- <crop-select
- v-if="row.$cellEdit"
- v-model="row.corpId"
- :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
- @getCorpData="(data)=>{getfleetId(data,row)}"
- ></crop-select>
- <span v-else>{{ row.corpName }}</span>
- </template>
- <template slot-scope="{row}" slot="feeId">
- <breakdown-select
- v-if="row.$cellEdit"
- v-model="row.feeId"
- :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
- @selectValue="(value) => selectValue(value,row)"
- :configuration="breakConfiguration">
- </breakdown-select>
- <span v-else>{{ row.feeName }}</span>
- </template>
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
- @click="rowCell(row,index)"
- >{{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button type="text"
- icon="el-icon-delete"
- size="small"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- @click="$refs.collection.rowDel(row,index)"
- >删除
- </el-button>
- <el-button
- size="small"
- type="text"
- icon="el-icon-s-order"
- @click="annexOpen(row, index)"
- >附 件
- </el-button>
- </template>
- <template slot="menuLeft">
- <el-button
- type="primary"
- icon="el-icon-plus"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- @click="addRowCollection"
- size="small">录入明细
- </el-button>
- </template>
- </avue-crud>
- <avue-crud
- v-if="activeIndex === '2'"
- :data="paymentList"
- :option="paymentOption"
- :key="key"
- ref="payment"
- @resetColumn="resetColumnPayment"
- @saveColumn="saveColumnPayment"
- @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
- @row-update="rowSave"
- @row-del="feeDel"
- >
- <template slot-scope="{row}" slot="corpId">
- <crop-select
- v-if="row.$cellEdit"
- v-model="row.corpId"
- :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
- @getCorpData="(data)=>{getfleetId(data,row)}"
- ></crop-select>
- <span v-else>{{ row.corpName }}</span>
- </template>
- <template slot-scope="{row}" slot="feeId">
- <breakdown-select
- v-if="row.$cellEdit"
- v-model="row.feeId"
- :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
- @selectValue="(value) => selectValue(value,row)"
- :configuration="breakConfiguration"
- >
- </breakdown-select>
- <span v-else>{{ row.feeName }}</span>
- </template>
- <template slot-scope="{row,index}" slot="menu">
- <el-button
- type="text"
- size="small"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
- @click="paymentRowCell(row,index)"
- >{{ row.$cellEdit ? '保存' : '编辑' }}
- </el-button>
- <el-button type="text"
- icon="el-icon-delete"
- size="small"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- @click="$refs.payment.rowDel(row,index)"
- >删除
- </el-button>
- <el-button
- size="small"
- type="text"
- icon="el-icon-s-order"
- @click="annexOpen(row, index)"
- >附 件
- </el-button>
- </template>
- <template slot="menuLeft">
- <el-button
- type="primary"
- icon="el-icon-plus"
- v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
- @click="addRowPayment"
- size="small">录入明细
- </el-button>
- </template>
- </avue-crud>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload
- typeUpload="CD"
- :basic="false"
- deleteUrl="/api/blade-client/common-file/remove"
- :data="orderFilesList"
- display
- :enumerationValue="85.6"
- ></c-upload>
- <el-dialog
- title="附件"
- :visible.sync="enclosure"
- append-to-body
- width="70%">
- <c-upload
- typeUpload="GZ"
- :basic="true"
- deleteUrl="/api/blade-client/common-file/remove"
- :data="orderList"
- :disabled="goodsForm.status !== 0"
- :enumerationValue="85.71"
- ></c-upload>
- <span slot="footer" class="dialog-footer">
- <el-button @click="enclosure = false" size="small">取 消</el-button>
- <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
- </span>
- </el-dialog>
- <track-playback :dialogVisible="dialogVisible" :lineArr="lineArr" ref="playback"></track-playback>
- </div>
- </template>
- <script>
- import {getLazyTree} from "@/api/base/region";
- import {
- saveDelegationList,
- detailDelegationList,
- removeCollection,
- saveSaveList,
- statusBulkLoad,
- addressList, cancelSubmission, getCorp, getSalesman, getFee, changeSubmission, validChange, tRemove, saveFile
- } from "@/api/landTransportation/bulkCargo";
- import {getDeptTree} from "@/api/system/dept";
- import website from "@/config/website";
- import {gaude, location} from "@/api/gaude";
- //地图回放
- import trackPlayback from "@/components/trackPlayback"
- import {fleetList, telephone} from "@/api/landTransportation";
- import {getDictionary} from "@/api/system/dictbiz";
- import {allCropList, customerList} from "@/api/basicData/customerInformation";
- // goodsOptionFormTwo
- export default {
- comments: {
- trackPlayback
- },
- props: {
- id: {
- type: String
- },
- home: {
- type: Boolean
- }
- },
- watch: {
- goodsForm: {
- handler(newValue, oldValue) {
- if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('admin') !== -1) {
- this.findObject(this.goodsOptionForm.column, "remarks").display = true
- } else {
- this.findObject(this.goodsOptionForm.column, "remarks").display = false
- }
- if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('车队') !== -1 || this.roleName.indexOf('司机') !== -1) {
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").display = true
- } else {
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").display = false
- }
- if (!this.typeTwo) {
- // this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 5
- if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('司机') !== -1) {
- this.goodsOptionFormTwo.disabled = true
- } else {
- if (this.goodsForm.status === 0) {
- this.goodsOptionFormTwo.disabled = true
- } else if (this.goodsForm.status === 1) {
- this.goodsOptionFormTwo.disabled = false
- if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('admin') !== -1) {
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
- }
- } else if (this.goodsForm.status === 2) {
- this.goodsOptionFormTwo.disabled = false
- if (this.roleName.indexOf('车队') !== -1 || this.roleName.indexOf('admin') !== -1) {
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
- } else {
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = true
- }
- } else {
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = true
- }
- }
- }
- }
- }
- },
- data() {
- return {
- returnButton: Boolean,
- dialogVisible: false,
- lineArr: [],
- activeIndex: '1',
- KeyBox: 0,
- KeyBoxTwo: 0,
- typeTwo: false,
- type: false,
- enclosure: false,
- orderList: [],
- goodsForm: {},
- corpList: [],
- modelKey: 1,
- orderFilesList: [],
- salesmanList: [],
- vehicleList: [],
- packageType: [],
- breakConfiguration: {
- multipleChoices: false,
- multiple: false,
- disabled: false,
- searchShow: true,
- collapseTags: false,
- clearable: true,
- placeholder: '请点击右边按钮选择',
- dicData: []
- },
- roleName: localStorage.getItem("roleName").split(','),
- advantageProjectData: [],
- keyContact: 0,
- vehicleOptionTwo: {
- align: 'center',
- menuAlign: 'center',
- refreshBtn: false,
- menu: false,
- index: true,
- stripe: true,
- cellBtn: false,
- addBtn: false,
- cancelBtn: false,
- editBtn: false,
- addRowBtn: false,
- delBtn: false,
- showSummary: true,
- // editBtn:false,
- summaryText: "合计",
- sumColumnList: [
- {
- name: 'landWeight',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'oneFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'twoFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'threeFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fourFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fiveFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'oneFeeC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'twoFeeC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'threeFeeC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fourFeeC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fiveFeeC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'ctnQuantity',
- type: 'sum',
- decimals: 0
- }],
- column: [{
- label: '货运日期',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- width: 200,
- index: 1,
- prop: 'arrivalTime'
- }, {
- label: '受理日期',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- width: 200,
- index: 2,
- prop: 'acceptTime'
- }, {
- label: '实际到厂时间',
- prop: 'realArrivalTime',
- overHidden: true,
- type: "date",
- searchRange: true,
- defaultTime: ['00:00:00', '23:59:59'],
- format: "yyyy-MM-dd HH:mm",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- index: 3,
- width: 140,
- }, {
- label: '车队',
- width: 150,
- index: 4,
- prop: 'fleetShortName'
- }, {
- label: '车号',
- width: 150,
- index: 4,
- prop: 'plateNo'
- }, {
- label: '司机',
- width: 115,
- index: 5,
- prop: 'driverName'
- }, {
- label: '电话',
- width: 160,
- index: 6,
- prop: 'tel'
- }, {
- label: '完工日期',
- prop: 'finishedTime',
- overHidden: true,
- type: "date",
- searchRange: true,
- defaultTime: ['00:00:00', '23:59:59'],
- format: "yyyy-MM-dd HH:mm",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- index: 7,
- width: 140,
- }, {
- label: '箱型',
- width: 100,
- slot: true,
- index: 8,
- prop: 'ctnType'
- }, {
- label: '箱量',
- width: 50,
- index: 9,
- prop: 'ctnQuantity'
- }, {
- label: '货物名称',
- overHidden: true,
- width: 160,
- index: 10,
- prop: 'goods'
- }, {
- label: '件数',
- width: 100,
- overHidden: true,
- controls: false,
- cell: true,
- index: 11,
- prop: 'quantity',
- type: 'number',
- precision: 0
- }, {
- label: '重量',
- width: 160,
- prop: 'landWeight',
- controls: false,
- precision: 2,
- index: 12,
- type: 'number'
- }, {
- label: '尺码',
- width: 100,
- overHidden: true,
- index: 13,
- prop: 'size',
- }, {
- label: '委托备注',
- width: 245,
- index: 14,
- prop: 'remarks'
- }, {
- label: '状态',
- width: 100,
- index: 15,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "string",
- prop: 'status'
- }
- // {
- // label: '应付陆运费',
- // cell: true,
- // prop: 'landAmountC'
- // }
- // , {
- // label: '车队备注',
- // width: 245,
- // prop: 'fleetRemarks'
- // }, {
- // label: '司机备注',
- // width: 245,
- // prop: 'driverRemarks'
- // }
- ]
- },
- vehicleOption: {},
- treeOption: {
- label: 'title',
- value: 'id',
- lazy: true,
- lazyLoad(node, resolve) {
- const parentId = node.level === 0 ? '00' : node.data.id;
- getLazyTree(parentId).then(res => {
- resolve(
- res.data.data.map(item => {
- return {
- ...item,
- leaf: !item.hasChildren
- };
- })
- );
- });
- }
- },
- tableData: [],
- tableDataTwo: [],
- entrustListT: [],
- entrustOptionTwoTBackup: {
- align: 'center',
- menuAlign: 'center',
- index: true,
- cellBtn: true,
- menu: false,
- refreshBtn: false,
- addBtn: false,
- addRowBtn: false,
- delBtn: false,
- showSummary: true,
- summaryText: "合计",
- sumColumnList: [
- {
- name: 'landWeight',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountC',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'oneFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'twoFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'threeFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fourFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fiveFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'ctnQuantity',
- type: 'sum',
- decimals: 0
- }],
- column: [{
- label: '货运日期',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- index: 1,
- cell: true,
- width: 200,
- prop: 'arrivalTime'
- }, {
- label: '箱型',
- width: 100,
- index: 2,
- prop: 'ctnType'
- }, {
- label: '箱量',
- width: 50,
- index: 3,
- prop: 'ctnQuantity'
- }, {
- label: '运费',
- prop: 'landAmountD',
- width: 100,
- precision: 2,
- index: 4,
- controls: false,
- }, {
- label: '件数',
- width: 100,
- index: 5,
- overHidden: true,
- controls: false,
- prop: 'quantity',
- type: 'number',
- precision: 0
- }, {
- label: '重量',
- width: 160,
- index: 6,
- prop: 'landWeight',
- controls: false,
- precision: 2,
- type: 'number'
- }
- // , {
- // label: '包装',
- // width: 100,
- // index: 7,
- // overHidden: true,
- // prop: 'packing',
- // type: 'select',
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
- // props: {
- // label: "dictValue",
- // value: "dictValue"
- // },
- // }
- , {
- label: '尺码',
- width: 100,
- index: 8,
- overHidden: true,
- prop: 'size',
- }, {
- label: '货物名称',
- width: 200,
- index: 9,
- overHidden: true,
- prop: 'goods',
- }, {
- label: '备注',
- width: 200,
- index: 10,
- prop: 'remarks'
- }]
- },
- entrustOptionTwoT: {},
- entrustList: [],
- goodsOptionFormC: {
- menuBtn: false,
- disabled: false,
- span: 8,
- column: [{
- label: '业务类型',
- prop: 'businessType',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- rules: [{
- required: false,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '运输方式',
- disabled: true,
- prop: 'shippingMode',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
- props: {
- label: "dictValue",
- value: "dictValue"
- }
- }, {
- label: '平台号',
- prop: 'orderNo',
- disabled: true
- }]
- },
- goodsOptionForm: {
- menuBtn: false,
- disabled: false,
- span: 8,
- column: [{
- label: '公司名称',
- formslot: true,
- prop: 'corpId',
- rules: [{
- required: true,
- message: " ",
- trigger: "change"
- }],
- }, {
- label: '所属部门',
- prop: 'salesmanDept',
- type: "tree",
- filter: false,
- dicData: [],
- props: {
- label: "title"
- }
- }, {
- label: '业务员',
- prop: 'salesman',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '物流运输',
- prop: 'dispatchDept',
- span: 6,
- dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
- cascader: ['dispatcher'],
- type: "select",
- props: {
- label: "deptName",
- value: "id"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '运输调度',
- prop: 'dispatcher',
- span: 6,
- type: "select",
- dicUrl: "/api/blade-user/userList?deptPid={{key}}",
- props: {
- label: "realName",
- value: "id"
- }
- }, {
- label: '委托日期',
- prop: 'bsDate',
- type: "datetime",
- span: 6,
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- }, {
- label: '车型',
- span: 6,
- prop: 'fleetVolum',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=vehicle_type",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "string",
- }, {
- label: '合同号',
- span: 6,
- prop: 'contractNo'
- }, {
- label: '联系电话',
- span: 6,
- prop: 'tel'
- }, {
- label: '派车单号',
- prop: 'dispatchNumber',
- span: 12,
- rules: [{
- required: false,
- message: " ",
- trigger: "blur"
- }],
- }, {
- label: '计价单位',
- span: 6,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=count_unit",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- prop: 'pricingUnit',
- change: (data) => {
- this.goodsForm.pricingUnit = data.value
- this.calculateFreight(data)
- }
- }, {
- label: '装卸货',
- span: 6,
- type: "select",
- prop: 'loadingUnloading',
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- dicData: [{
- dictValue: '装货'
- }, {
- dictValue: '卸货'
- }],
- change: (data) => {
- this.goodsForm.loadingUnloading = data.value
- this.calculateFreight(data)
- }
- }, {
- label: '单价',
- span: 6,
- prop: 'unitPrice',
- change: (data) => {
- this.goodsForm.unitPrice = data.value
- this.calculateFreight(data)
- }
- }, {
- label: '单车运费',
- span: 6,
- type: 'number',
- controls: false,
- precision: 2,
- prop: 'freightCollect'
- }
- // , {
- // label: '场站',
- // prop: 'station',
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }],
- // }, {
- // label: '货运日期',
- // type: "datetime",
- // format: 'yyyy-MM-dd HH:mm:ss',
- // valueFormat: 'yyyy-MM-dd HH:mm:ss',
- // prop: 'arrivalTime',
- // rules: [{
- // required: true,
- // message: " ",
- // trigger: "blur"
- // }],
- // }
- , {
- label: '备注',
- span: 24,
- minRows: 2,
- prop: 'remarks',
- type: 'textarea'
- }]
- },
- goodsOptionFormTwoBack: {
- menuBtn: false,
- disabled: false,
- span: 8,
- column: [
- // {
- // label: '所属公司',
- // formslot: true,
- // prop: 'belongCompany',
- // rules: [{
- // required: false,
- // message: " ",
- // trigger: "blur"
- // }],
- // },
- {
- label: '船名航次',
- prop: 'factory',
- rules: [{
- required: false,
- message: " ",
- trigger: "blur"
- }],
- }
- // , {
- // label: '货物名称',
- // prop: 'goods',
- // rules: [{
- // required: false,
- // message: " ",
- // trigger: "blur"
- // }],
- // }
- , {
- label: '开船日期',
- prop: 'etd',
- type: 'date'
- }, {
- label: '预配箱量',
- prop: 'expectCtnQty'
- }, {
- label: '起运港',
- prop: 'polId'
- }, {
- label: '目的港',
- prop: 'podId'
- }, {
- label: '截港日期',
- prop: 'etc',
- type: 'date'
- }, {
- label: '截单日期',
- prop: 'siCutoffDate',
- type: 'date'
- }, {
- label: '订舱代理',
- prop: 'agentId'
- }]
- },
- goodsOptionFormTwo: {
- menuBtn: false,
- disabled: false,
- span: 8,
- column: [{
- label: '车队',
- prop: 'fleetId',
- type: 'select',
- dicUrl: "/api/blade-client/corpsdesc/fleetList",
- cascader: ['plateNo'],
- props: {
- label: "cname",
- value: "id"
- }
- }, {
- label: '车号',
- prop: 'plateNo',
- filterable: true,
- allowCreate: true,
- cascader: ['driverId'],
- type: "select",
- dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
- props: {
- label: "plateNo",
- value: "plateNo"
- },
- }, {
- label: '司机',
- prop: 'driverId',
- type: "select",
- filterable: true,
- allowCreate: true,
- dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
- props: {
- label: "name",
- value: "id"
- }
- }, {
- label: '电话',
- prop: 'driverTel'
- }, {
- label: '应付运费',
- prop: 'freightPay'
- }, {
- label: '备注',
- prop: 'fleetRemarks'
- }]
- },
- entrustOptionTwoBackup: {
- align: 'center',
- menuAlign: 'center',
- refreshBtn: false,
- addBtnText: '录入信息',
- index: true,
- indexSlot: true,
- cellBtn: true,
- addBtn: false,
- addRowBtn: false,
- showSummary: true,
- summaryText: "合计",
- sumColumnList: [
- {
- name: 'landWeight',
- type: 'sum',
- decimals: 2
- }, {
- name: 'landAmountD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'oneFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'twoFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'threeFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fourFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'fiveFeeD',
- type: 'sum',
- decimals: 2
- }, {
- name: 'ctnQuantity',
- type: 'sum',
- decimals: 0
- }],
- column: [{
- label: '货运日期',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- cell: true,
- width: 200,
- index: 1,
- prop: 'arrivalTime'
- }, {
- // label: '箱型',
- label: '箱型',
- cell: true,
- prop: 'ctnType',
- type: 'select',
- width: 100,
- index: 2,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- }, {
- label: '箱量',
- cell: true,
- prop: 'ctnQuantity',
- controls: false,
- precision: 0,
- index: 3,
- width: 100,
- maxRows: 999,
- minRows: 1,
- type: 'number'
- }, {
- label: '运费',
- cell: true,
- prop: 'landAmountD',
- controls: false,
- width: 200,
- index: 4,
- precision: 2,
- type: 'number'
- }, {
- label: '件数',
- width: 100,
- index: 5,
- overHidden: true,
- controls: false,
- cell: true,
- prop: 'quantity',
- type: 'number',
- precision: 0
- }, {
- label: '重量(吨)',
- cell: true,
- prop: 'landWeight',
- controls: false,
- width: 200,
- index: 6,
- precision: 2,
- type: 'number'
- }
- // , {
- // label: '包装',
- // width: 100,
- // index: 7,
- // overHidden: true,
- // cell: true,
- // prop: 'packing',
- // type: 'select',
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
- // props: {
- // label: "dictValue",
- // value: "dictValue"
- // },
- // }
- , {
- label: '尺码',
- width: 100,
- index: 8,
- overHidden: true,
- cell: true,
- prop: 'size',
- }, {
- label: '货物名称',
- width: 200,
- index: 9,
- overHidden: true,
- cell: true,
- prop: 'goods',
- }, {
- label: '备注',
- cell: true,
- index: 10,
- width: 200,
- prop: 'remarks'
- }]
- },
- entrustOptionTwo: {},
- collectionList: [],
- collectionOptionBackup: {
- align: 'center',
- menuAlign: 'center',
- refreshBtn: false,
- index: true,
- // menu:false,
- cancelBtn: false,
- editBtn: false,
- delBtn: false,
- cellBtn: false,
- addBtn: false,
- addRowBtn: false,
- showSummary: true,
- addBtnText: '录入明细',
- summaryText: "合计",
- sumColumnList: [{
- name: 'price',
- type: 'sum',
- decimals: 2
- }, {
- name: 'amount',
- type: 'sum',
- decimals: 2
- }, {
- name: 'quantity',
- type: 'sum',
- decimals: 0
- }],
- column: [{
- label: '公司名称',
- slot: true,
- width: 200,
- overHidden: true,
- prop: 'corpId',
- index: 1
- }, {
- label: '车号',
- prop: 'plateNo',
- width: 100,
- index: 2
- }, {
- label: '费用名称',
- slot: true,
- width: 200,
- prop: 'feeId',
- index: 3,
- }, {
- label: '计价单位',
- cell: true,
- prop: 'unit',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index: 4,
- }, {
- label: '单价',
- cell: true,
- prop: 'price',
- index: 5
- }, {
- label: '数量',
- cell: true,
- prop: 'quantity',
- index: 6
- }, {
- label: '金额',
- cell: true,
- prop: 'amount',
- index: 7
- }, {
- // label: '税率(默认6)',
- label: '税率',
- cell: true,
- prop: 'taxRate',
- index: 8
- }, {
- label: '币别',
- cell: true,
- prop: 'currency',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index: 9
- }]
- },
- paymentList: [],
- key: 0,
- collectionOption: {},
- paymentOption: {},
- paymentOptionBackup: {
- align: 'center',
- menuAlign: 'center',
- index: true,
- cancelBtn: false,
- refreshBtn: false,
- editBtn: false,
- delBtn: false,
- cellBtn: false,
- addBtn: false,
- addRowBtn: false,
- showSummary: true,
- addBtnText: '录入明细',
- summaryText: "合计",
- sumColumnList: [{
- name: 'price',
- type: 'sum',
- decimals: 2
- }, {
- name: 'amount',
- type: 'sum',
- decimals: 2
- }, {
- name: 'quantity',
- type: 'sum',
- decimals: 0
- }],
- column: [{
- label: '客户名称',
- cell: true,
- width: 300,
- prop: 'fleetId',
- type: "select",
- index: 1,
- cascader: ['plateNo'],
- props: {
- label: "fleetName",
- value: "fleetId"
- }
- }, {
- label: '车号',
- prop: 'plateNo',
- width: 100,
- index: 2
- }, {
- label: '费用名称',
- slot: true,
- width: 200,
- prop: 'feeId',
- index: 3
- }, {
- label: '计价单位',
- width: 100,
- cell: true,
- prop: 'unit',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index: 4
- }, {
- label: '数量',
- cell: true,
- prop: 'quantity',
- index: 5
- }, {
- label: '单价',
- cell: true,
- prop: 'price',
- index: 6
- }, {
- label: '金额',
- cell: true,
- prop: 'amount',
- index: 7
- }, {
- // label: '税率(默认6)',
- label: '税率',
- cell: true,
- prop: 'taxRate',
- index: 8
- }, {
- label: '币别',
- cell: true,
- prop: 'currency',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- index: 9
- }]
- }
- };
- },
- async created() {
- this.activeIndex = this.roleName.indexOf('车队') !== -1 ? '2' : '1'
- console.log(this.activeIndex)
- if (this.roleName.indexOf('客户') !== -1) {
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
- }
- if (this.roleName.indexOf('车队') !== -1) {
- this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
- }
- if (this.roleName.indexOf('司机') !== -1) {
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
- this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
- }
- allCropList({
- corpType: 'GC'
- }).then(res => {
- this.corpList = res.data.data
- })
- getDictionary({code: 'package_type'}).then(res => {
- this.packageType = res.data.data
- })
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").change = (data) => {
- fleetList({fleetId: this.goodsForm.fleetId}).then(res => {
- for (let item in res.data.data) {
- if (data.value === res.data.data[item].plateNo) {
- this.goodsForm.driverId = res.data.data[item].driverId
- this.goodsForm.driverName = res.data.data[item].driverName
- this.goodsForm.driverTel = res.data.data[item].tel
- }
- }
- })
- }
- this.findObject(this.goodsOptionFormTwo.column, "driverId").change = (data) => {
- telephone().then(res => {
- for (let item in res.data.data) {
- if (data.value === res.data.data[item].id) {
- this.goodsForm.driverTel = res.data.data[item].tel
- }
- }
- })
- }
- this.entrustOptionTwo = await this.getColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
- this.KeyBox++
- this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
- this.KeyBoxTwo++
- this.vehicleOption = await this.getColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
- this.keyContact++
- this.collectionOption = await this.getColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
- this.paymentOption = await this.getColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
- this.key++
- if (this.id) {
- if (this.id.slice(0, 4) === 'copy') {
- detailDelegationList({id: this.id.slice(4, this.id.length)}).then(res => {
- this.goodsForm = res.data.data
- this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
- this.tableData = res.data.data.loadingAddressList || []
- this.tableDataTwo = res.data.data.unloadedAddressList || []
- this.entrustList = res.data.data.itemList
- this.goodsList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList || []
- this.goodsForm.status = 0
- if (res.data.data.orderFeeList.length > 0) {
- res.data.data.orderFeeList.forEach(item => {
- if (item.type == 1) {
- this.collectionList.push(item)
- } else {
- this.paymentList.push(item)
- }
- })
- }
- this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
- delete this.goodsForm.orderAddressList
- delete this.goodsForm.itemList
- delete this.goodsForm.orderFeeList
- this.goodsForm.id = ''
- this.goodsForm.orderNo = ''
- this.tableData.forEach(item => item.id = '')
- this.tableDataTwo.forEach(item => item.id = '')
- this.entrustList.forEach(item => item.id = '')
- this.goodsList.forEach(item => item.id = '')
- this.vehicleList.forEach(item => item.id = '')
- this.orderFilesList.forEach(item => item.id = '')
- //查询业务员
- this.salesmanQuery()
- if (this.goodsForm.status == 2) {
- if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
- this.goodsForm.status = 2
- }
- }
- })
- } else if (this.id.slice(0, 2) === '首页' || this.id.slice(0, 2) === '台账') {
- if (this.id.slice(0, 2) === '首页') {
- this.returnButton = true
- } else {
- this.returnButton = false
- }
- detailDelegationList({id: this.id.slice(2, this.id.length)}).then(res => {
- this.goodsForm = res.data.data
- this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
- this.tableData = res.data.data.loadingAddressList || []
- this.tableDataTwo = res.data.data.unloadedAddressList || []
- this.entrustList = res.data.data.itemList
- this.goodsList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList || []
- if (res.data.data.orderFeeList.length > 0) {
- res.data.data.orderFeeList.forEach(item => {
- if (item.type == 1) {
- this.collectionList.push(item)
- } else {
- this.paymentList.push(item)
- }
- })
- }
- this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
- delete this.goodsForm.orderAddressList
- delete this.goodsForm.itemList
- delete this.goodsForm.orderFeeList
- // this.tableData.forEach(item => {
- // if (item.region) item.region = item.region.split(',')
- // })
- //查询业务员
- this.salesmanQuery()
- if (this.goodsForm.status == 2) {
- if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
- this.goodsForm.status = 2
- }
- }
- })
- } else {
- detailDelegationList({id: this.id}).then(res => {
- this.goodsForm = res.data.data
- this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
- if (this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
- this.goodsForm.status = 5
- }
- this.tableData = res.data.data.loadingAddressList || []
- this.tableDataTwo = res.data.data.unloadedAddressList || []
- this.entrustList = res.data.data.itemList
- this.goodsList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList || []
- if (res.data.data.orderFeeList.length > 0) {
- res.data.data.orderFeeList.forEach(item => {
- if (item.type == 1) {
- this.collectionList.push(item)
- } else {
- this.paymentList.push(item)
- }
- })
- }
- this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
- delete this.goodsForm.orderAddressList
- delete this.goodsForm.itemList
- delete this.goodsForm.orderFeeList
- // this.tableData.forEach(item => {
- // if (item.region) item.region = item.region.split(',')
- // })
- //查询业务员
- this.salesmanQuery()
- if (this.goodsForm.status == 2) {
- if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1) {
- this.goodsForm.status = 2
- }
- }
- })
- }
- } else {
- this.goodsForm.status = 0
- this.tableData = [{}, {}]
- this.tableDataTwo = [{}, {}]
- getCorp().then(res => {
- this.goodsForm = {
- corpId: res.data.data ? res.data.data.id : '',
- businessType: "内贸",
- shippingMode: "散货",
- status: 0,
- salesman: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
- belongCompany: res.data.data ? res.data.data.belongCompany : '',
- bsDate: new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19)//获取当天时间并格式化
- }
- this.salesmanQuery('', true)
- })
- this.entrustList = []
- }
- // 非租户模式默认加载管理组数据
- if (!website.tenantMode) {
- this.initData(website.tenantId);
- } else {
- this.initData();
- }
- this.findObject(this.collectionOption.column, "price").change = (data) => {
- if (data.row.price && data.row.quantity) {
- data.row.amount = Number(data.row.price) * Number(data.row.quantity)
- }
- }
- this.findObject(this.collectionOption.column, "quantity").change = (data) => {
- if (data.row.price && data.row.quantity) {
- data.row.amount = Number(data.row.price) * Number(data.row.quantity)
- }
- }
- this.findObject(this.paymentOption.column, "price").change = (data) => {
- if (data.row.price && data.row.quantity) {
- data.row.amount = Number(data.row.price) * Number(data.row.quantity)
- }
- }
- this.findObject(this.paymentOption.column, "quantity").change = (data) => {
- if (data.row.price && data.row.quantity) {
- data.row.amount = Number(data.row.price) * Number(data.row.quantity)
- }
- }
- this.$refs.other.show = false
- },
- methods: {
- //单车运费计算
- calculateFreight(data) {
- if (this.goodsForm.pricingUnit && this.goodsForm.loadingUnloading && this.goodsForm.unitPrice) {
- if (this.goodsForm.loadingUnloading == '装货') {
- if (this.goodsForm.pricingUnit == '体积') {
- this.goodsForm.freightCollect = 0
- this.tableData.forEach(item => {
- if (item.volume) {
- this.goodsForm.freightCollect += Number(item.volume) * Number(this.goodsForm.unitPrice)
- }
- })
- // unitPrice
- } else if (this.goodsForm.pricingUnit == '重量') {
- this.goodsForm.freightCollect = 0
- this.tableData.forEach(item => {
- if (item.weight) {
- this.goodsForm.freightCollect += Number(item.weight) * Number(this.goodsForm.unitPrice)
- }
- })
- } else if (this.goodsForm.pricingUnit == '件数') {
- this.goodsForm.freightCollect = 0
- this.tableData.forEach(item => {
- if (item.quantity) {
- this.goodsForm.freightCollect += Number(item.quantity) * Number(this.goodsForm.unitPrice)
- }
- })
- }
- } else {
- if (this.goodsForm.pricingUnit == '体积') {
- this.goodsForm.freightCollect = 0
- this.tableDataTwo.forEach(item => {
- if (item.volume) {
- this.goodsForm.freightCollect += Number(item.volume) * Number(this.goodsForm.unitPrice)
- }
- })
- } else if (this.goodsForm.pricingUnit == '重量') {
- this.goodsForm.freightCollect = 0
- this.tableDataTwo.forEach(item => {
- if (item.weight) {
- this.goodsForm.freightCollect += Number(item.weight) * Number(this.goodsForm.unitPrice)
- }
- })
- } else if (this.goodsForm.pricingUnit == '件数') {
- this.goodsForm.freightCollect = 0
- this.tableDataTwo.forEach(item => {
- if (item.quantity) {
- this.goodsForm.freightCollect += Number(item.quantity) * Number(this.goodsForm.unitPrice)
- }
- })
- }
- }
- }
- },
- openTrack(row) {
- gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
- this.lineArr = res.data.data.trackArray
- this.dialogVisible = true
- let this_ = this
- setTimeout(function () {
- this_.$refs.playback.initMap();
- }, 100)
- })
- // location({itemId: row.id,plateNo:'陕YH0008'}).then(res => {
- // // console.log(res.data.data)
- // // console.log(this.lineArr[this.lineArr.length - 1])
- // })
- },
- changeSelect(val) {
- for (let item of this.salesmanList) {
- if (item.id == val) {
- this.goodsForm.salesmanDept = item.deptId.split(',')[0]
- this.goodsForm.tel = item.phone
- }
- }
- },
- initData(tenantId) {
- getDeptTree(tenantId).then(res => {
- console.log(res)
- const column = this.findObject(this.goodsOptionForm.column, "salesmanDept");
- column.dicData = res.data.data;
- });
- },
- //查询业务员
- salesmanQuery(realName, type) {
- getSalesman({realName: realName, userExt: this.goodsForm.corpId}).then(res => {
- this.salesmanList = res.data.data
- if (type) {
- this.changeSelect(this.goodsForm.salesman)
- }
- })
- },
- //自定义列保存
- async saveColumnCollection() {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(85.4), this.collectionOption);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.collection.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnCollection() {
- this.collectionOption = this.collectionOptionBackup;
- const inSave = await this.delColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.collection.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列保存
- async saveColumnPayment() {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(85.5), this.paymentOption);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.payment.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnPayment() {
- this.paymentOption = this.paymentOptionBackup;
- const inSave = await this.delColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.payment.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列保存
- async saveColumnBox() {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(85.1), this.entrustOptionTwo);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnBox() {
- this.entrustOptionTwo = this.entrustOptionTwoBackup;
- const inSave = await this.delColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列保存
- async saveColumnBoxTwo() {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(85.2), this.entrustOptionTwoT);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnBoxTwo() {
- this.entrustOptionTwoT = this.entrustOptionTwoTBackup;
- const inSave = await this.delColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列保存
- async saveColumnContact() {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(85.3), this.vehicleOption);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnContact() {
- this.vehicleOption = this.vehicleOptionTwo;
- const inSave = await this.delColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
- }
- },
- //刷新数据
- refreshData(id) {
- let ids = ''
- if (id) {
- ids = id
- } else {
- ids = this.goodsForm.id
- }
- detailDelegationList({id: ids}).then(res => {
- this.goodsForm = res.data.data
- this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
- this.tableData = res.data.data.loadingAddressList
- this.tableDataTwo = res.data.data.unloadedAddressList
- this.entrustList = res.data.data.itemList
- this.goodsList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList || []
- if (res.data.data.orderFeeList) {
- if (res.data.data.orderFeeList.length > 0) {
- this.collectionList = []
- this.paymentList = []
- res.data.data.orderFeeList.forEach(item => {
- if (item.type == 1) {
- this.collectionList.push(item)
- } else {
- this.paymentList.push(item)
- }
- })
- }
- }
- this.goodsOptionFormC.disabled = true
- this.goodsOptionForm.disabled = true
- this.goodsOptionFormTwo.disabled = true
- this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status >= 1
- delete this.goodsForm.orderAddressList
- delete this.goodsForm.itemList
- delete this.goodsForm.orderFeeList
- // this.tableData.forEach(item => {
- // if (item.region) item.region = item.region.split(',')
- // })
- this.type = false
- })
- },
- //切换收付费
- handleSelect(tab, event) {
- this.activeIndex = tab.name
- this.key++
- },
- //箱信息保存
- rowSaveT(row, index, done, loading) {
- row.$cellEdit = false
- done()
- },
- //箱信息选择车队
- getfleetIdT(data, row) {
- this.$set(row, 'fleetName', data.cname)
- },
- //地址新增
- addAddress() {
- this.tableData.push({})
- },
- //地址新增
- addAddressTwo() {
- this.tableDataTwo.push({})
- },
- moveUp(row, index) {
- this.tableData[index] = this.tableData.splice(index - 1, 1, row)[0]
- },
- moveUpTwo(row, index) {
- this.tableDataTwo[index] = this.tableDataTwo.splice(index - 1, 1, row)[0]
- },
- moveDown(row, index) {
- this.tableData[index] = this.tableData.splice(index + 1, 1, row)[0]
- },
- moveDownTwo(row, index) {
- this.tableDataTwo[index] = this.tableDataTwo.splice(index + 1, 1, row)[0]
- },
- //返回主列表
- backToList(value) {
- if (value === 0) {
- this.goodsForm = {}
- this.$emit('backToList')
- } else if (value === 1) {
- this.goodsForm = {}
- this.$emit('backToList', true)
- } else if (value === 2) {
- this.$router.push({
- path: '/wel/index'
- });
- } else if (value === 3) {
- this.$router.push({
- path: '/landTransportation/bulkReportAnalysis/index'
- });
- }
- },
- //删除途径地址
- deleteAddress(scope) {
- if (scope.row.id) {
- tRemove({ids: scope.row.id}).then(res => {
- this.tableData.splice(scope.$index, 1);
- this.calculateFreight()
- })
- } else {
- this.tableData.splice(scope.$index, 1);
- this.calculateFreight()
- }
- },
- //删除途径地址
- deleteAddressTwo(scope) {
- if (scope.row.id) {
- tRemove({ids: scope.row.id}).then(res => {
- this.tableDataTwo.splice(scope.$index, 1);
- })
- } else {
- this.tableDataTwo.splice(scope.$index, 1);
- }
- },
- //箱信息保存
- rowSave(row, index, done, loading) {
- row.$cellEdit = false
- done()
- },
- rowCell(row, index) {
- this.$refs.collection.rowCell(row, index)
- if (row.$cellEdit == false) {
- this.editCustomer()
- }
- },
- paymentRowCell(row, index) {
- this.$refs.payment.rowCell(row, index)
- if (row.$cellEdit == false) {
- this.editCustomer()
- }
- },
- //箱信息移除
- rowDel(row, index) {
- this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.entrustList.splice(index, 1);
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- //保存
- editCustomer() {
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- loadingAddressList: this.tableData,
- unloadedAddressList: this.tableDataTwo,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- this.$message.success('保存成功');
- if (!this.goodsForm.id) {
- this.id = res.data.data
- this.refreshData()
- } else {
- this.refreshData()
- }
- })
- },
- //确认变更
- confirmChange() {
- // validChange({id:this.id}).then(res => {
- // if (res.data.data){
- if (this.goodsForm.status === 5) {
- this.goodsOptionFormC.disabled = false
- this.goodsOptionForm.disabled = false
- this.goodsOptionFormTwo.disabled = true
- this.typeTwo = true
- this.goodsForm.status = 0
- if (this.roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)) {
- this.goodsOptionFormTwo.disabled = true
- }
- } else {
- this.goodsOptionFormC.disabled = false
- this.goodsOptionForm.disabled = false
- // this.goodsOptionFormTwo.disabled = false
- this.typeTwo = true
- this.goodsForm.status = 0
- if (this.roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)) {
- this.goodsOptionFormTwo.disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
- }
- }
- // }else {
- // this.$message.error('不允许变更')
- // }
- // })
- },
- confirmChangeTwo() {
- if (((this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1) || this.roleName.indexOf('车队') !== -1) || this.roleName.indexOf('admin') !== -1 && this.goodsForm.status > 3) {
- this.goodsOptionFormTwo.disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
- this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
- this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
- }
- },
- //变更保存
- changeSaving() {
- this.$refs['goodsFormE'].validate((valid, doneE) => {
- doneE()
- if (valid) {
- this.$refs['goodsForm'].validate((valid, done) => {
- done();
- if (valid) {
- for (let item in this.tableData) {
- if (item < Number(this.tableData.length) - 1) {
- if (!this.tableData[item].corpId) return this.$message.error('请选择装货地点第' + Number(Number(item) + 1) + '行货运地点');
- // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
- // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
- // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
- }
- }
- for (let item in this.tableDataTwo) {
- if (item < Number(this.tableDataTwo.length) - 1) {
- if (!this.tableDataTwo[item].corpId) return this.$message.error('请选择卸货地点第' + Number(Number(item) + 1) + '行货运地点');
- }
- }
- // if (this.tableDataTwo.length === 0) {
- // return this.$message.error('请选择卸货地点')
- // }
- // if (this.tableData.length === 0) {
- // return this.$message.error('请选择卸货地点')
- // }
- this.type = true
- let form = this.goodsForm
- delete this.goodsForm.status
- delete form.orderItemList
- saveSaveList({
- ...form,
- loadingAddressList: this.tableData,
- unloadedAddressList: this.tableDataTwo,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderItemList: [],
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- this.$message.success('保存成功');
- this.typeTwo = false
- this.refreshData()
- })
- } else {
- return false;
- }
- });
- } else {
- return false;
- }
- })
- },
- modifyState() {
- if (this.goodsForm.status === 1) {
- if (!this.goodsForm.fleetId) return this.$message.error('请选择车队')
- }
- if (this.goodsForm.status === 2) {
- if (!this.goodsForm.plateNo) return this.$message.error('请选择车号')
- if (!this.goodsForm.driverId) return this.$message.error('请选择司机')
- if (!this.goodsForm.driverTel) return this.$message.error('请输入司机电话')
- }
- let value = ''
- if (this.goodsForm.status == 1) value = 2
- if (this.goodsForm.status == 2) value = 3
- if (this.goodsForm.status == 3) value = 6
- if (this.goodsForm.status == 6) value = 4
- if (this.goodsForm.status == 4) value = 5
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- loadingAddressList: this.tableData,
- unloadedAddressList: this.tableDataTwo,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- statusBulkLoad({id: this.goodsForm.id, status: value}).then(res => {
- this.$message.success('操作成功');
- this.refreshData(res.data.data)
- })
- })
- },
- //提交委托
- submit(type) {
- if (type) {
- this.$refs['goodsFormE'].validate((valid, done) => {
- done()
- })
- this.$refs['goodsForm'].validate((valid, done) => {
- done()
- })
- for (let item in this.tableData) {
- if (item < Number(this.tableData.length) - 1) {
- if (!this.tableData[item].corpId) return this.$message.error('请选择装货地点第' + Number(Number(item) + 1) + '行货运地点');
- // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
- // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
- // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
- }
- }
- for (let item in this.tableDataTwo) {
- if (item < Number(this.tableDataTwo.length) - 1) {
- if (!this.tableDataTwo[item].corpId) return this.$message.error('请选择卸货地点第' + Number(Number(item) + 1) + '行货运地点');
- }
- }
- if (this.tableDataTwo.length === 0) {
- return this.$message.error('请选择卸货地点')
- }
- if (this.tableData.length === 0) {
- return this.$message.error('请选择卸货地点')
- }
- this.$refs['goodsFormE'].validate((valid, doneE) => {
- doneE()
- if (valid) {
- this.$refs['goodsForm'].validate((valid, done) => {
- done();
- if (valid) {
- this.entrustList.forEach(item => {
- if (!item.arrivalTime) {
- item.arrivalTime = this.goodsForm.arrivalTime
- }
- })
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- loadingAddressList: this.tableData,
- unloadedAddressList: this.tableDataTwo,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- saveDelegationList({
- id: res.data.data
- }).then(() => {
- this.type = false
- this.$message.success('提交成功');
- this.refreshData(res.data.data)
- }).finally(() => {
- this.type = false
- })
- })
- } else {
- return false;
- }
- });
- } else {
- return false;
- }
- })
- } else {
- statusBulkLoad({id: this.goodsForm.id, status: 0}).then(res => {
- this.$message.success('取消成功');
- this.refreshData()
- })
- }
- },
- //取消调度
- cancelScheduling(type) {
- if (type == '1') {
- statusBulkLoad({id: this.goodsForm.id, status: 2}).then(res => {
- this.$message.success('取消成功');
- this.refreshData()
- })
- } else if (type == '2') {
- statusBulkLoad({id: this.goodsForm.id, status: 1}).then(res => {
- this.$message.success('取消成功');
- this.refreshData()
- })
- } else if (type == '3') {
- statusBulkLoad({id: this.goodsForm.id, status: 3}).then(res => {
- this.$message.success('取消成功');
- this.refreshData()
- })
- }
- },
- //收费新增
- addRowCollection() {
- if (this.goodsForm.plateNo) {
- this.$refs.collection.rowCellAdd({
- currency: '1',
- type: '1',
- $cellEdit: true,
- corpId: this.goodsForm.corpId,
- corpName: this.goodsForm.corpName,
- plateNo: this.goodsForm.plateNo
- });
- } else {
- this.$message.error('请选择车号')
- }
- },
- //付费新增
- addRowPayment() {
- if (this.goodsForm.plateNo) {
- this.$refs.payment.rowCellAdd({
- currency: '1',
- type: '2',
- $cellEdit: true,
- corpId: this.goodsForm.corpId,
- corpName: this.goodsForm.corpName,
- plateNo: this.goodsForm.plateNo
- });
- } else {
- this.$message.error('请选择车号')
- }
- },
- //打开附件
- annexOpen(row, index, type) {
- if (row.id) {
- this.formAnnex = row
- getFee({id: row.id}).then(res => {
- this.orderList = res.data.data
- this.enclosure = true
- })
- } else {
- this.$message.error('请点击顶部【保存】后再操作')
- }
- },
- //保存
- saveAnnex() {
- saveFile({
- id: this.formAnnex.id,
- fileList: this.orderList
- }).then(res => {
- this.$message.success("保存成功");
- this.annexOpen(this.formAnnex)
- })
- },
- //选择费用
- selectValue(value, row) {
- this.$set(row, 'feeName', value.cname)
- },
- //选择客户信息触发
- getfleetId(data, row) {
- this.$set(row, 'corpName', data.cname)
- },
- //收款信息移除
- makeDel(row, index) {
- this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (row.id) removeCollection(row.id)
- this.collectionList.splice(index, 1);
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- //付款信息移除
- feeDel(row, index) {
- this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (row.id) removeCollection(row.id)
- this.paymentList.splice(index, 1);
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- //选择公司名称带出所属公司
- getCorpData(row) {
- console.log(row.belongCompany)
- this.goodsForm.belongCompany = row.belongCompany
- this.goodsForm.salesman = ''
- //查询业务员
- this.salesmanQuery()
- },
- getCropId(row) {
- if (row) {
- this.goodsForm.corpId = row.id
- this.goodsForm.corpName = row.cname
- this.goodsForm.belongCompany = row.belongCompany
- this.goodsForm.salesman = ''
- //查询业务员
- this.salesmanQuery()
- }
- },
- clear(row) {
- row.corpName = ''
- },
- //选择地址客户带出地址
- withAddress(row, scope, type) {
- if (type) {
- for (let item of this.corpList) {
- if (scope.row.corpId == item.id) {
- this.$set(this.tableData[scope.$index], 'contacts', item.attn)
- this.$set(this.tableData[scope.$index], 'tel', item.tel)
- this.$set(this.tableData[scope.$index], 'address', item.storageAddr)
- if (!scope.row.key) scope.row.key = 0
- this.$set(this.tableData[scope.$index], 'corpName', item.cname)
- if (item.belongtoarea) {
- addressList(item.belongtoarea.split(',')[0]).then(res => {
- this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
- scope.row.key++
- })
- }
- }
- }
- } else {
- this.$set(this.tableData[scope.$index], 'contacts', row.attn)
- this.$set(this.tableData[scope.$index], 'tel', row.tel)
- this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
- if (!scope.row.key) scope.row.key = 0
- this.$set(this.tableData[scope.$index], 'corpName', row.cname)
- if (row.belongtoarea) {
- addressList(row.belongtoarea.split(',')[0]).then(res => {
- this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
- scope.row.key++
- })
- }
- }
- },
- //选择地址客户带出地址
- withAddressTwo(row, scope, type) {
- if (type) {
- for (let item of this.corpList) {
- if (scope.row.corpId == item.id) {
- this.$set(this.tableDataTwo[scope.$index], 'contacts', item.attn)
- this.$set(this.tableDataTwo[scope.$index], 'tel', item.tel)
- this.$set(this.tableDataTwo[scope.$index], 'address', item.storageAddr)
- // this.tableData[scope.$index].contacts = row.attn
- // this.tableData[scope.$index].tel = row.tel
- // this.tableData[scope.$index].address = row.storageAddr
- if (!scope.row.key) scope.row.key = 0
- this.$set(this.tableDataTwo[scope.$index], 'corpName', item.cname)
- // this.tableData[scope.$index].corpName = row.cname
- if (item.belongtoarea) {
- addressList(item.belongtoarea.split(',')[0]).then(res => {
- this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
- scope.row.key++
- })
- }
- }
- }
- } else {
- this.$set(this.tableDataTwo[scope.$index], 'contacts', row.attn)
- this.$set(this.tableDataTwo[scope.$index], 'tel', row.tel)
- this.$set(this.tableDataTwo[scope.$index], 'address', row.storageAddr)
- // this.tableData[scope.$index].contacts = row.attn
- // this.tableData[scope.$index].tel = row.tel
- // this.tableData[scope.$index].address = row.storageAddr
- if (!scope.row.key) scope.row.key = 0
- this.$set(this.tableDataTwo[scope.$index], 'corpName', row.cname)
- // this.tableData[scope.$index].corpName = row.cname
- if (row.belongtoarea) {
- addressList(row.belongtoarea.split(',')[0]).then(res => {
- this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
- scope.row.key++
- })
- }
- }
- },
- //自定义表头
- renderHeader(h) {
- return (
- <div>
- <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
- <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
- style="margin-right: 1.25rem;"></el-button>
- </el-tooltip>
- </div>
- )
- },
- //自定义表头
- customTitle(h, {column, $index}) {
- let text = column.label
- return (
- <div>
- {{text}}<span style="color:#F56C6C">*</span>
- </div>
- )
- }
- }
- }
- </script>
- <style scoped lang="scss">
- ::v-deep .el-form-item {
- margin-bottom: 8px;
- }
- ::v-deep .el-form-item__content {
- line-height: 32px;
- }
- ::v-deep .el-card__body {
- padding: 10px 15px;
- font-size: 14px;
- }
- .single ::v-deep .el-button--mini {
- padding: 0 0 !important;
- }
- </style>
|