123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448 |
- <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" v-if="!(roleName.indexOf('总经理') !== -1)">
- <el-button
- type="success"
- size="small"
- v-if="goodsForm.id"
- :disabled="
- !((this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)||this.roleName.indexOf('经理') !== -1||this.roleName.indexOf('部门经理') !== -1||this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('admin') !== -1)"
- @click="generateBill"
- >生成账单
- </el-button>
- <el-button
- type="warning"
- size="small"
- v-if="goodsForm.status > 0"
- :disabled="
- !((this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)||this.roleName.indexOf('经理') !== -1||this.roleName.indexOf('部门经理') !== -1||this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('admin') !== -1)"
- @click="confirmChange"
- >变更
- </el-button>
- <el-button
- type="success"
- v-if="goodsForm.status === 0 && typeTwo === false"
- size="small"
- :loading="type"
- @click="submit(true)"
- >提交
- </el-button>
- <el-button
- type="success"
- v-if="goodsForm.status === 1"
- size="small"
- @click="submit(false)"
- >取消提交
- </el-button>
- <el-button
- type="primary"
- :disabled="goodsForm.status >= 1"
- 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="{}" slot="stationLabel">
- <e-crop-jump label="场站" corp-type="DD" :value="goodsForm.station"></e-crop-jump>
- </template>
- <template slot-scope="scope" slot="station">
- <!-- <port-info-->
- <!-- v-model="goodsForm.station"-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- />-->
- <e-crop-select
- v-model="goodsForm.station"
- corp-type="DD"
- :name.sync="goodsForm.station"
- :disabled="goodsForm.status !== 0"
- />
- </template>
- <template slot-scope="scope" slot="salesman">
- <el-select v-model="goodsForm.salesman" 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>
- <trade-card title="其他信息" ref="other">
- <avue-form :option="goodsOptionFormTwo" v-model="goodsForm">
- <template slot-scope="scope" slot="corpId">
- <crop-select
- :disabled="goodsForm.status !== 0"
- v-model="goodsForm.corpId"
- @getCorpData="getCorpData"
- :corpType="'KH'"
- ></crop-select>
- </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" placeholder="请选择" :disabled="goodsForm.status !== 0">
- <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="{}" slot="agentIdLabel">
- <e-crop-jump label="订舱代理" corp-type="KH" :value="goodsForm.agentName"></e-crop-jump>
- </template>
- <template slot-scope="scope" slot="agentId">
- <!-- <crop-select-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- v-model="goodsForm.corpId"-->
- <!-- @getCorpData="getCorpData"-->
- <!-- :corpType="'KH'"-->
- <!-- ></crop-select>-->
- <e-crop-select
- v-model="goodsForm.agentId"
- corp-type="KH"
- :name.sync="goodsForm.agentName"
- :disabled="goodsForm.status !== 0"
- @getCropId="getCropId"
- />
- </template>
- <!-- <template slot-scope="scope" slot="polId">-->
- <!-- <port-info-->
- <!-- :type="'id'"-->
- <!-- v-model="goodsForm.polId"-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- />-->
- <!-- </template>-->
- <template slot-scope="{}" slot="polIdLabel">
- <e-crop-jump label="起运港" corp-type="DD" :value="goodsForm.polName"></e-crop-jump>
- </template>
- <template slot-scope="scope" slot="polId">
- <e-crop-select
- v-model="goodsForm.polId"
- corp-type="DD-ID"
- :name.sync="goodsForm.polName"
- :disabled="goodsForm.status !== 0"
- />
- </template>
- <template slot-scope="{}" slot="podIdLabel">
- <e-crop-jump label="目的港" corp-type="DD" :value="goodsForm.podName"></e-crop-jump>
- </template>
- <template slot-scope="scope" slot="podId">
- <e-crop-select
- v-model="goodsForm.podId"
- corp-type="DD-ID"
- :name.sync="goodsForm.podName"
- :disabled="goodsForm.status !== 0"
- />
- </template>
- <!-- <template slot-scope="scope" slot="podId">-->
- <!-- <port-info-->
- <!-- :type="'id'"-->
- <!-- v-model="goodsForm.podId"-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- />-->
- <!-- </template>-->
- </avue-form>
- </trade-card>
- <trade-card title="箱信息" v-if="goodsForm.status === 0 || !goodsForm.status">
- <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>
- </trade-card>
- <trade-card title="箱信息" v-if="goodsForm.status !== 0 && goodsForm.status">
- <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>
- </trade-card>
- <trade-card title="起止地信息">
- <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"
- style="margin-right: 1.25rem;"></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>
- </trade-card>
- <trade-card title="车辆信息">
- <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>
- <template slot-scope="scope" slot="menu">
- <el-link type="primary" :disabled="vehicleDelete" style="font-size: 1px" @click="vehicleClick(scope.row)">删 除</el-link>
- </template>
- </avue-crud>
- </trade-card>
- <trade-card title="杂费明细">
- <el-tabs v-model="activeIndex" @tab-click="handleSelect">
- <el-tab-pane label="应收" name="1"
- v-if="!(roleName.indexOf('调度中心业务员') !== -1 || roleName.indexOf('调度中心经理') !== -1)"></el-tab-pane>
- <el-tab-pane label="应付" name="2" v-else></el-tab-pane>
- </el-tabs>
- <avue-crud
- v-if="activeIndex === '1'"
- :data="collectionList"
- :option="collectionOption"
- 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="goodsForm.status !== 0"
- @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="goodsForm.status !== 0"
- @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"-->
- <!-- :disabled="goodsForm.status === 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"-->
- <!-- :disabled="goodsForm.status === 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"-->
- <!-- :disabled="goodsForm.status !== 0"-->
- <!-- @click="addRowCollection"-->
- <!-- size="small">录入明细</el-button>-->
- </template>
- </avue-crud>
- <avue-crud
- v-if="activeIndex === '2'"
- :data="paymentList"
- :option="paymentOption"
- 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="goodsForm.status === 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="goodsForm.status !== 0"
- @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"-->
- <!-- :disabled="goodsForm.status === 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"-->
- <!-- :disabled="goodsForm.status === 1"-->
- <!-- @click="$refs.payment.rowDel(row,index)"-->
- <!-- >删除-->
- <!-- </el-button>-->
- <!-- </template>-->
- <!-- <template slot="menuLeft">-->
- <!-- <el-button-->
- <!-- type="primary"-->
- <!-- icon="el-icon-plus"-->
- <!-- :disabled="goodsForm.status === 1"-->
- <!-- @click="addRowPayment"-->
- <!-- size="small">录入明细-->
- <!-- </el-button>-->
- <!-- </template>-->
- </avue-crud>
- </trade-card>
- <containerTitle title="上传附件"></containerTitle>
- <c-upload
- typeUpload="CD"
- 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
- :enumerationValue="76"
- ></c-upload>
- <span slot="footer" class="dialog-footer">
- <el-button @click="enclosure = false" 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 {
- orderitemRemove,
- saveDelegationList,
- detailDelegationList,
- removeCollection,
- saveSaveList,
- addressList, cancelSubmission, getCorp, getSalesman, getFee, changeSubmission, validChange, tRemove, generateBill
- } from "@/api/landTransportation";
- import {getDeptTree} from "@/api/system/dept";
- import website from "@/config/website";
- import {gaude, location} from "@/api/gaude";
- //地图回放
- import trackPlayback from "@/components/trackPlayback"
- import {contrastList, contrastObj} from "@/util/contrastData";
- import { getUserInfo } from "@/api/system/user"
- export default {
- comments: {
- trackPlayback
- },
- props: {
- id: {
- type: String
- },
- home: {
- type: Boolean
- }
- },
- watch:{
- goodsForm(){
- if (this.roleName.indexOf('总经理') !== -1) {
- this.goodsForm.status = 2
- this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
- }
- },
- },
- data() {
- return {
- returnButton: Boolean,
- dialogVisible: false,
- lineArr: [],
- activeIndex: '1',
- KeyBox: 0,
- KeyBoxTwo: 0,
- typeTwo: false,
- type: false,
- // 车辆信息删除权限
- vehicleDelete: true,
- enclosure: false,
- orderList: [],
- goodsForm: {},
- modelKey: 1,
- orderFilesList: [],
- salesmanList: [],
- vehicleList: [],
- 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: [],
- 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: '运输方式',
- prop: 'shippingMode',
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- disabled: true,
- change: (data) => {
- if (data.value === '集装箱') {
- this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
- } else if (!data.value) {
- this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = true
- } else {
- this.findObject(this.goodsOptionForm.column, "billNo").rules[0].required = false
- }
- }
- }, {
- 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',
- 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',
- type: "select",
- dicUrl: "/api/blade-user/deptUserList?deptPid={{key}}",
- props: {
- label: "realName",
- value: "id"
- }
- }, {
- label: '委托日期',
- prop: 'bsDate',
- type: "datetime",
- format: 'yyyy-MM-dd HH:mm',
- valueFormat: 'yyyy-MM-dd HH:mm:ss',
- }, {
- label: '票据号',
- prop: 'receiptNo'
- }, {
- label: '联系电话',
- prop: 'tel'
- }, {
- label: '提单号',
- prop: 'billNo',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- }, {
- 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'
- }]
- },
- goodsOptionFormTwo: {
- 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'
- }]
- },
- 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: 300,
- overHidden: true,
- prop: 'corpId'
- }, {
- label: '车号',
- cell: true,
- prop: 'plateNo',
- type: "select",
- props: {
- label: "label",
- value: "label"
- },
- }, {
- label: '费用名称',
- slot: true,
- width: 200,
- prop: 'feeId'
- }, {
- label: '计价单位',
- cell: true,
- prop: 'unit',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '单价',
- cell: true,
- prop: 'price'
- }, {
- label: '数量',
- cell: true,
- prop: 'quantity'
- }, {
- label: '金额',
- cell: true,
- prop: 'amount'
- }, {
- // label: '税率(默认6)',
- label: '税率',
- cell: true,
- prop: 'taxRate'
- }, {
- label: '币别',
- cell: true,
- prop: 'currency',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- }
- ]
- },
- paymentList: [],
- collectionOption: {},
- paymentOption: {},
- paymentOptionBackup: {
- align: 'center',
- menuAlign: 'center',
- index: true,
- menu: false,
- 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: '公司名称',
- width: 200,
- slot: true,
- overHidden: true,
- prop: 'corpId'
- }, {
- label: '费用名称',
- slot: true,
- prop: 'feeId'
- }, {
- label: '计价单位',
- cell: true,
- prop: 'unit',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }, {
- label: '数量',
- cell: true,
- prop: 'quantity'
- }, {
- label: '单价',
- cell: true,
- prop: 'price'
- }, {
- label: '金额',
- cell: true,
- prop: 'amount'
- }, {
- // label: '税率(默认6)',
- label: '税率',
- cell: true,
- prop: 'taxRate'
- }, {
- label: '币别',
- cell: true,
- prop: 'currency',
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
- props: {
- label: "dictValue",
- value: "dictKey"
- }
- }]
- },
- oldgoodsForm:{},
- oldtableData:{},
- oldentrustList:{},
- oldgoodsList:{},
- oldvehicleList:{},
- oldorderFilesList:{},
- };
- },
- async created() {
- this.activeIndex = this.roleName.indexOf('调度中心业务员') !== -1 ? '2' : this.roleName.indexOf('调度中心经理') !== -1 ? '2' : '1'
- 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);
- if (this.id) {
- if (this.id.slice(0, 4) === 'copy') {
- detailDelegationList({id: this.id.slice(4, this.id.length), kind: '1'}).then(res => {
- this.goodsForm = res.data.data
- this.tableData = res.data.data.orderAddressList
- this.entrustList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList
- this.oldgoodsForm = res.data.data
- this.oldtableData = this.deepClone(res.data.data.orderAddressList)
- this.oldentrustList = this.deepClone(res.data.data.itemList)
- this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
- this.oldorderFilesList = this.deepClone(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.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
- delete this.goodsForm.orderAddressList
- delete this.goodsForm.itemList
- delete this.goodsForm.orderFeeList
- this.goodsForm.id = ''
- this.tableData.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), kind: '1'}).then(res => {
- this.goodsForm = res.data.data
- this.tableData = res.data.data.orderAddressList
- this.entrustList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList
- this.oldgoodsForm = res.data.data
- this.oldtableData = this.deepClone(res.data.data.orderAddressList)
- this.oldentrustList = this.deepClone(res.data.data.itemList)
- this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
- this.oldorderFilesList = this.deepClone(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.collectionOption.disabled = this.paymentOption.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, kind: '1'}).then(res => {
- this.goodsForm = res.data.data
- this.tableData = res.data.data.orderAddressList
- this.entrustList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList
- this.oldgoodsForm = res.data.data
- this.oldtableData = this.deepClone(res.data.data.orderAddressList)
- this.oldentrustList = this.deepClone(res.data.data.itemList)
- this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
- this.oldorderFilesList = this.deepClone(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.collectionOption.disabled = this.paymentOption.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.tableData = [{}, {}]
- 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 = []
- this.oldgoodsForm = this.goodsForm
- this.oldtableData = this.deepClone(this.tableData)
- this.oldentrustList = this.deepClone(this.entrustList)
- this.oldvehicleList = this.deepClone(this.vehicleList)
- this.oldorderFilesList = this.deepClone(this.orderFilesList)
- }
- // 非租户模式默认加载管理组数据
- if (!website.tenantMode) {
- this.initData(website.tenantId);
- } else {
- this.initData();
- }
- if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1) {
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").showColumn = false
- this.findObject(this.entrustOptionTwo.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwo.column, "landAmountD").showColumn = false
- }
- this.$refs.other.show = false
- },
- methods: {
- 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])
- // })
- },
- vehicleClick(row) {
- if (row.plateNo == null || row.plateNo == '') {
- this.vehicleList.splice(row.$index, 1);
- }
- },
- getCropId(row) {
- if (row) {
- this.goodsForm.corpId = row.id
- this.goodsForm.corpName = row.cname
- this.goodsForm.belongCompany = row.belongCompany
- this.goodsForm.salesman = ''
- //查询业务员
- this.salesmanQuery()
- }
- },
- 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 => {
- 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;
- if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1) {
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").showColumn = false
- this.findObject(this.entrustOptionTwo.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwo.column, "landAmountD").showColumn = 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;
- if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1) {
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwoT.column, "landAmountD").showColumn = false
- this.findObject(this.entrustOptionTwo.column, "landAmountD").hide = true
- this.findObject(this.entrustOptionTwo.column, "landAmountD").showColumn = 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.id
- }
- detailDelegationList({id: ids, kind: '1'}).then(res => {
- this.goodsForm = res.data.data
- this.tableData = res.data.data.orderAddressList
- this.entrustList = res.data.data.itemList
- this.vehicleList = res.data.data.orderItemList
- this.orderFilesList = res.data.data.fileList
- this.oldgoodsForm = res.data.data
- this.oldtableData = this.deepClone(res.data.data.orderAddressList)
- this.oldentrustList = this.deepClone(res.data.data.itemList)
- this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
- this.oldorderFilesList = this.deepClone(res.data.data.fileList)
- 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.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.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
- },
- //箱信息保存
- rowSaveT(row, index, done, loading) {
- row.$cellEdit = false
- done()
- },
- //箱信息选择车队
- getfleetIdT(data, row) {
- this.$set(row, 'fleetName', data.cname)
- },
- //地址新增
- addAddress() {
- this.tableData.splice(this.tableData.length - 1, 0, {})
- },
- moveUp(row, index) {
- this.tableData[index] = this.tableData.splice(index - 1, 1, row)[0]
- },
- moveDown(row, index) {
- this.tableData[index] = this.tableData.splice(index + 1, 1, row)[0]
- },
- //返回主列表
- backToList(value) {
- if (
- contrastObj(this.goodsForm, this.oldgoodsForm)
- || contrastList(this.tableData, this.oldtableData)
- || contrastList(this.entrustList, this.oldentrustList)
- || contrastList(this.vehicleList, this.oldvehicleList)
- || contrastList(this.orderFilesList, this.oldorderFilesList)
- ) {
- this.$confirm("数据发生变化未有保存记录, 是否保存?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let data = JSON.parse(JSON.stringify(this.tableData))
- data.forEach((item, index) => {
- item.sort = index + 1
- })
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- kind: '1',
- orderAddressList: data,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- this.$message.success('保存成功');
- 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/reportAnalysis/index'
- });
- }
- })
- }).catch(() => {
- 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/reportAnalysis/index'
- });
- }
- });
- }else {
- 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/reportAnalysis/index'
- });
- }
- }
- },
- //删除途径地址
- deleteAddress(scope) {
- if (scope.row.id) {
- tRemove({ids: scope.row.id}).then(res => {
- this.tableData.splice(scope.$index, 1);
- })
- } else {
- this.tableData.splice(scope.$index, 1);
- }
- },
- //箱信息保存
- rowSave(row, index, done, loading) {
- row.$cellEdit = false
- done()
- },
- rowCell(row, index) {
- this.$refs.collection.rowCell(row, index)
- },
- paymentRowCell(row, index) {
- this.$refs.payment.rowCell(row, index)
- },
- //箱信息移除
- rowDel(row, index) {
- this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- if (row.id) {
- // 删除接口
- orderitemRemove({ids:row.id}).then(res=>{
- this.$message({
- type: 'success',
- message: '删除成功'
- });
- })
- }
- this.entrustList.splice(index, 1);
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- //保存
- editCustomer() {
- let data = JSON.parse(JSON.stringify(this.tableData))
- data.forEach((item, index) => {
- item.sort = index + 1
- })
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- kind: '1',
- orderAddressList: data,
- 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()
- }
- })
- },
- //生成账单
- generateBill(){
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- generateBill({id:this.goodsForm.id}).then(res=>{
- this.$message.success("生成账单成功")
- loading.close();
- }).catch(()=>{
- loading.close();
- })
- },
- //确认变更
- confirmChange() {
- // validChange({id:this.id}).then(res => {
- // if (res.data.data){
- this.goodsForm.status = 0
- this.goodsOptionFormC.disabled = false
- this.goodsOptionForm.disabled = false
- this.goodsOptionFormTwo.disabled = false
- this.typeTwo = true
- getUserInfo().then(res => {
- var user = res.data.data;
- let postName = user.account;
- console.log(user)
- let postNameList = postName.split(",");
- for (const iterator of postNameList) {
- if (iterator == 'admin') {
- this.vehicleDelete = false
- }
- }
- })
- // }else {
- // this.$message.error('不允许变更')
- // }
- // })
- },
- //变更保存
- 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.entrustList) {
- if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行箱型');
- if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
- if (!this.entrustList[item].arrivalTime) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行货运日期');
- // if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '运费');
- }
- if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
- let data = JSON.parse(JSON.stringify(this.tableData))
- data.forEach((item, index) => {
- item.sort = index + 1
- })
- this.type = true
- let form = this.goodsForm
- delete this.goodsForm.status
- delete form.orderItemList
- changeSubmission({
- ...form,
- kind: '1',
- orderAddressList: data,
- fileList: this.orderFilesList,
- itemList: this.entrustList,
- orderItemList: this.vehicleList,
- orderFeeList: this.collectionList.concat(this.paymentList)
- }).then(res => {
- this.$message.success('保存成功');
- this.vehicleDelete = true
- this.typeTwo = false
- this.refreshData()
- })
- } else {
- return false;
- }
- });
- } else {
- return false;
- }
- })
- },
- //提交委托
- 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.entrustList) {
- if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行箱型');
- if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
- if (!this.entrustList[item].arrivalTime) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行货运日期');
- // if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '运费');
- }
- if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
- this.$refs['goodsFormE'].validate((valid, doneE) => {
- doneE()
- if (valid) {
- this.$refs['goodsForm'].validate((valid, done) => {
- done();
- if (valid) {
- let data = JSON.parse(JSON.stringify(this.tableData))
- data.forEach((item, index) => {
- item.sort = index + 1
- // if (item.region.length !== 0) {
- // item.region = item.region.join(',')
- // } else {
- // item.region = ''
- // }
- })
- this.entrustList.forEach(item => {
- if (!item.arrivalTime) {
- item.arrivalTime = this.goodsForm.arrivalTime
- }
- })
- this.type = true
- saveSaveList({
- ...this.goodsForm,
- kind: '1',
- orderAddressList: data,
- 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 {
- cancelSubmission({
- id: this.goodsForm.id
- }).then(res => {
- this.$message.success('取消成功');
- this.refreshData()
- })
- }
- },
- //收费新增
- addRowCollection() {
- this.$refs.collection.rowCellAdd({
- currency: '1',
- type: '1',
- $cellEdit: true
- });
- },
- //打开附件
- annexOpen(row, index) {
- this.enclosure = true
- getFee({id: row.id}).then(res => {
- this.orderList = res.data.data
- })
- },
- //付费新增
- addRowPayment() {
- this.$refs.payment.rowCellAdd({
- currency: '1',
- type: '2',
- $cellEdit: true
- });
- },
- //选择费用
- 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) {
- this.goodsForm.belongCompany = row.belongCompany
- this.goodsForm.salesman = ''
- //查询业务员
- this.salesmanQuery()
- },
- clear(row) {
- row.corpName = ''
- },
- //选择地址客户带出地址
- withAddress(row, scope) {
- 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)
- // 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.tableData[scope.$index], 'corpName', row.cname)
- // 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++
- })
- }
- },
- //自定义表头
- 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>
|