| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="goBack()">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small" v-if="editButton"
- :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)"
- @click="inEdit">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSaveBtn" @click="submit">保 存
- </el-button>
- <!-- <el-button v-if="form.status == '审核提交'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
- size="small" @click="revokeApplication">撤销单据请核
- </el-button> -->
- <!-- <el-dropdown style="line-height: 0">
- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
- size="small">
- 审 批<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown> -->
- </div>
- </div>
- <div style="margin-top: 50px">
- <el-tabs type="border-card">
- <el-tab-pane label="基础信息">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <tempalte slot="purchaseCompanyName">
- <dic-select v-model="form.purchaseCompanyName" placeholder="出租方" key="id" label="shortName"
- res="records" url="/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=箱东"
- :filterable="true" :remote="true" dataName="shortName"
- @selectChange="dicChange('purchaseCompanyName', $event)" :slotRight="true" rightLabel="code"
- :disabled="editDisabled || form.tradingBoxItemsList.length"></dic-select>
- </tempalte>
- <tempalte slot="polStationCname">
- <dic-select v-model="form.polStationCname" placeholder="退/还箱地" key="id" label="cnName" res="records"
- url="/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=场站" :filterable="true"
- :remote="true" dataName="cnName" @selectChange="dicChange('polStationCname', $event)"
- :slotRight="true" rightLabel="code"
- :disabled="editDisabled || form.tradingBoxItemsList.length"></dic-select>
- </tempalte>
- <tempalte slot="addressCname">
- <dic-select v-model="form.addressCname" placeholder="港口" key="id" label="cnName" res="records"
- url="/blade-los/bports/list?status=0¤t=1&size=5" :filterable="true" :remote="true"
- dataName="cnName" @selectChange="dicChange('addressCname', $event)" :slotRight="true"
- rightLabel="code" :disabled="editDisabled || form.tradingBoxItemsList.length"></dic-select>
- </tempalte>
- <tempalte slot="stationCname">
- <dic-select v-model="form.stationCname" placeholder="场站" :key="updateFormKey" label="cnName"
- res="records" :slotRight="true" rightLabel="code"
- :url="'/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=场站&ids=' + (form.cyText ? form.cyText : '')"
- :filterable="true" :remote="true" dataName="cnName" @selectChange="dicChange('stationCname', $event)"
- :disabled="editDisabled || !form.addressId || form.tradingBoxItemsList.length"></dic-select>
- </tempalte>
- <tempalte slot="totalAmountC">
- <el-input-number v-model="form.totalAmountC" :min="0" placeholder="请输入 押金" size="small"
- :controls="false" style="width:100%"
- :disabled="editDisabled || form.tradingBoxItemsList.length"></el-input-number>
- </tempalte>
- </avue-form>
- </trade-card>
- <trade-card title="箱型箱量">
- <avue-crud ref="crudBox" :option="boxOption" :data="form.boxTypeList"
- @selection-change="boxSelectionChange">
- <template slot="menuLeft">
- <el-button type="info" plain size="small" :disabled="editDisabled || !form.id || form.buxStaus != '录入'"
- @click="allClick('box一键保存')">一键保存</el-button>
- <el-button type="info" plain size="small"
- :disabled="editDisabled || form.boxTypeList.length == 0 || form.buxStaus != '录入'"
- @click="allClick('box一键编辑')">一键编辑</el-button>
- <el-button type="danger" plain size="small"
- :disabled="editDisabled || boxSelectionList.length == 0 || form.buxStaus != '录入'"
- @click="allClick('box批量删除')">批量删除</el-button>
- </template>
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus"
- :disabled="editDisabled || !form.id || form.buxStaus != '录入'" circle @click="boxAddRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="boxTypeForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.boxType" key="id" label="cnName" res="records"
- url="/blade-los/bcntrtypes/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
- dataName="cnName" @selectChange="rowDicChange('boxType', $event, row)"></dic-select>
- <span v-else>{{ row.boxType }}</span>
- </template>
- </avue-crud>
- </trade-card>
- <trade-card title="箱明细">
- <avue-crud :option="option" :data="form.tradingBoxItemsList" id="out-table" ref="crud"
- :header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
- :cell-style="{ height: '20px', padding: '0px' }" @selection-change="selectionChange"
- @select="selectHandle" @row-update="rowUpdate"
- @resetColumn="resetColumn('crud', 'option', 'optionBack', 473)"
- @saveColumn="saveColumn('crud', 'option', 'optionBack', 473)">
- <template slot="menuLeft">
- <el-button type="info" plain size="small" :disabled="editDisabled || !form.id || form.buxStaus != '录入'"
- @click="allClick('一键保存')">一键保存</el-button>
- <el-button type="info" plain size="small"
- :disabled="editDisabled || form.tradingBoxItemsList.length == 0 || form.buxStaus != '录入'"
- @click="allClick('一键编辑')">一键编辑</el-button>
- <el-button type="danger" plain size="small"
- :disabled="editDisabled || selectionList.length == 0 || form.buxStaus != '录入'"
- @click="allClick('批量删除')">批量删除</el-button>
- <el-button type="primary" plain size="small" @click="allClick('起租')"
- :disabled="form.buxStaus != '录入' || form.tradingBoxItemsList.length == 0">起租</el-button>
- <el-button type="success" plain size="small" @click="allClick('生成租金')"
- :disabled="form.buxStaus != '已启租'">生成租金</el-button>
- <el-button type="danger" plain size="small" @click="allClick('撤销租金')"
- :disabled="form.buxStaus != '已启租'">撤销租金</el-button>
- <el-button type="warning" plain size="small" @click="allClick('退租')"
- :disabled="form.buxStaus != '已启租'">退租</el-button>
- <el-button type="danger" plain size="small" @click="allClick('撤销退租')"
- :disabled="form.buxStaus != '已退租'">撤销退租</el-button>
- <el-button type="success" size="small" @click="allClick('导入')"
- :disabled="!form.id || form.buxStaus != '录入'">导入</el-button>
- <el-button type="info" size="small" @click="allClick('启用')"
- :disabled="selectionList.length == 0 || form.buxStaus != '已启租'">启用</el-button>
- <!-- <el-button type="primary" size="small" @click="allClick('卖箱')">卖箱</el-button> -->
- <el-button size="small" style="margin-right: 8px" :disabled="!form.id || true"
- @click="$refs.print.openDialog()">打印报表
- </el-button>
- </template>
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus"
- :disabled="editDisabled || form.buxStaus != '录入'" circle @click="addRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="boxTypeForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.boxType" key="id" label="cnName" res="records"
- url="/blade-los/bcntrtypes/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
- dataName="cnName" @selectChange="rowDicChange('boxType', $event, row)"></dic-select>
- <span v-else>{{ row.boxType }}</span>
- </template>
- <template slot="currencyForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
- :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
- @selectChange="rowDicChange('currency', $event, row)"></dic-select>
- <span v-else>{{ row.currency }}</span>
- </template>
- <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.originalBoxEastName" placeholder="箱东" key="id"
- label="shortName" res="records"
- url="/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=箱东" :filterable="true"
- :remote="true" dataName="shortName" @selectChange="rowDicChange('originalBoxEastName', $event, row)"
- :slotRight="true" rightLabel="code">
- </dic-select>
- <span v-else>{{ row.originalBoxEastName }}</span>
- </tempalte>
- <tempalte slot="stationCnameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.stationCname" placeholder="场站" key="id" label="cnName"
- res="records" url="/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=场站"
- :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('stationCname', $event, row)" :slotRight="true"
- rightLabel="code"></dic-select>
- <span v-else>{{ row.stationCname }}</span>
- </tempalte>
- <tempalte slot="restrictedPortsNameForm" slot-scope="{ row }">
- <dic-select v-show="row.$cellEdit" v-model="row.restrictedPortsName" placeholder="港口" key="id"
- label="cnName" url="/blade-los/bports/listAll?status=0" :filterable="true" :multiple="true"
- :collapseTags="true" @selectChange="rowDicChange('restrictedPortsName', $event, row)"
- dataType="string" :slotRight="true" rightLabel="code"></dic-select>
- <span v-show="!row.$cellEdit">{{ row.restrictedPortsName }}</span>
- </tempalte>
- <tempalte slot="restrictingShippingCompaniesNameForm" slot-scope="{ row }">
- <dic-select v-show="row.$cellEdit" v-model="row.restrictingShippingCompaniesName" placeholder="船公司"
- key="id" label="cnName" url="/blade-los/bcorps/listAll?status=0&corpTypeName=船公司" :filterable="true"
- :multiple="true" :collapseTags="true" :slotRight="true" rightLabel="code"
- @selectChange="rowDicChange('restrictingShippingCompaniesName', $event, row)"
- dataType="string"></dic-select>
- <span v-show="!row.$cellEdit">{{ row.restrictingShippingCompaniesName }}</span>
- </tempalte>
- </avue-crud>
- </trade-card>
- <trade-card title="操作记录">
- <avue-form :option="optionForm2" v-model="form" ref="form2">
- </avue-form>
- </trade-card>
- </el-tab-pane>
- <el-tab-pane label="费用信息">
- <el-card
- v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
- class="box-card" style="margin: 2px 0">
- <avue-crud :option="feecOption" :data="form.feeCenterList" id="out-table" ref="crud2"
- :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
- @selection-change="feecChange" @row-update="rowUpdate"
- @resetColumn="resetColumn('crud2', 'feecOption', 'feecOptionBack', 235.2)"
- @saveColumn="saveColumn('crud2', 'feecOption', 'feecOptionBack', 235.2)">
- <template slot="menuLeft">
- <div style="display: inline-block;margin-right: 20px" class="disabledBox meetSize">
- <i class="el-icon-coin"></i>
- <span>应付费用</span>
- </div>
- <el-button type="info" plain size="small" :disabled="editDisabled"
- @click="allClick('费用一键保存')">一键保存</el-button>
- <el-button type="info" plain size="small" :disabled="editDisabled"
- @click="allClick('费用一键编辑')">一键编辑</el-button>
- <el-button type="danger" plain size="small" :disabled="editDisabled || selectionfeecList.length == 0"
- @click="allClick('费用批量删除')">批量删除</el-button>
- <el-button type="primary" plain size="small" :disabled="editDisabled || selectionfeecList.length == 0"
- @click="allClick('费用申请')">费用申请</el-button>
- <!-- <el-button type="primary" plain size="small" @click="$refs.printC.openDialog()">打印账单</el-button> -->
- </template>
- <template slot="indexHeader" slot-scope="{row,index}">
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
- @click="feecAddRow()">
- </el-button>
- </template>
- <template slot="index" slot-scope="{row,index}">
- <span>{{ index + 1 }}</span>
- </template>
- <template slot="billTypeForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')" v-model="row.billType"
- key="id" label="cnName" res="records"
- url="/blade-los/bcorpstypedefine/list?status=0¤t=1&size=20" :filterable="true" :remote="true"
- dataName="cnName" @selectChange="rowDicChange('billType', $event, row, index)"></dic-select>
- <span v-else>{{ row.billType }}</span>
- </template>
- <template slot="cntrNoForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')" v-model="row.cntrNo"
- key="id" label="code" :mockData="form.tradingBoxItemsList" :filterable="true"></dic-select>
- <span v-else>{{ row.cntrNo }}</span>
- </template>
- <template slot="corpCnNameForm" slot-scope="{ row,index }">
- <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')" :key="updateSearchKey"
- v-model="row.corpCnName" placeholder="付费对象" label="shortName" res="records" :slotRight="true"
- rightLabel="code"
- :url="'/blade-los/bcorps/selectList?status=0¤t=1&size=5&corpTypeName=' + row.billType"
- :filterable="true" :remote="true" dataName="shortName"
- @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
- <span v-else>{{ row.corpCnName }}</span>
- <!-- <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" key="id" placeholder="付费对象" label="cnName"
- res="records" url="/blade-los/bcorps/selectList?corpTypeName=船公司&status=0¤t=1&size=20"
- :filterable="true" :remote="true" dataName="cnName"
- @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
- <span v-else>{{ row.corpCnName }}</span> -->
- </template>
- <template slot="feeCnNameForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
- v-model="row.feeCnName" key="id" placeholder="费用名称" label="cnName" res="records"
- url="/blade-los/bfees/list?current=1&size=5&status=0¤t=1&size=20" :filterable="true"
- :remote="true" dataName="cnName" disabledLabel="押金,租箱费"
- @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
- <span v-else>{{ row.feeCnName }}</span>
- </template>
- <template slot="curCodeForm" slot-scope="{ row }">
- <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
- :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
- @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
- <span v-else>{{ row.curCode }}</span>
- </template>
- <template slot="exrateForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
- v-model="row.exrate" :controls="false" placeholder="请输入 汇率" size="small"
- style="width: 100%;"></el-input-number>
- <span v-else>{{ row.exrate }}</span>
- </template>
- <template slot="unitNoForm" slot-scope="{row,index}">
- <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')" v-model="row.unitNo"
- label="cnName" url="/blade-los/bunits/listAll?status=0" :filterable="true"></dic-select>
- <span v-else>{{ row.unitNo }}</span>
- </template>
- <template slot="priceForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
- v-model="row.price" :controls="false" placeholder="请输入 成本价" size="small" style="width: 100%;"
- :precision="2" @change="countChange(row)"></el-input-number>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="quantityForm" slot-scope="{ row }">
- <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
- v-model="row.quantity" :controls="false" placeholder="请输入 成本价" size="small" style="width: 100%;"
- :precision="0" @change="countChange(row)"></el-input-number>
- <span v-else>{{ row.quantity }}</span>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button size="small" icon="el-icon-delete" type="text" :disabled="editDisabled"
- @click="polRowDel(row, index)">删 除</el-button>
- </template>
- </avue-crud>
- </el-card>
- </el-tab-pane>
- <el-tab-pane label="文件中心">
- <containerTitle title="上传附件"></containerTitle>
- <c-upload :data="form.tradingBoxFilesList" :enumerationValue="76"
- deleteUrl="/api/blade-los/tradingBoxFiles/remove" display :disabled="editButton"></c-upload>
- </el-tab-pane>
- </el-tabs>
- </div>
- <business-reports :id="form.id" :itemIds="itemIds" ref="print" businessValue="MYDL" :type="true"></business-reports>
- <business-reports :id="form.id" :itemIds="itemCIds" ref="printC" businessValue="MYDL" classifyCode="费用"
- groupCode="应付" :selecList="selectionfeecList"></business-reports>
- <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports>
- <!--审核弹窗-->
- <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
- </el-dialog>
- <!-- 启用 -->
- <el-dialog append-to-body title="放箱号" :visible.sync="activationDialog" width="30%" :before-close="activationClose"
- v-dialog-drag>
- <span>
- <avue-form ref="form2" v-model="activationForm" :option="activationOption">
- <tempalte slot="polCname">
- <dic-select v-model="activationForm.polCname" placeholder="港口" key="id" label="cnName" res="records"
- url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="dicChange('polCname', $event)"></dic-select>
- </tempalte>
- <tempalte slot="polStationCname">
- <dic-select v-model="activationForm.polStationCname" placeholder="场站" :key="updateStationKey" label="cnName"
- res="records" :slotRight="true" rightLabel="code"
- :url="'/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=场站&ids=' + (form.cyTextOne ? form.cyTextOne : '')"
- :filterable="true" :remote="true" dataName="cnName" @selectChange="dicChange('polStationCname2', $event)"
- :disabled="editDisabled || !activationForm.polCname"></dic-select>
- </tempalte>
- <tempalte slot="podCname">
- <dic-select v-model="activationForm.podCname" placeholder="港口" key="id" label="cnName" res="records"
- url="/blade-los/bports/list" :filterable="true" :remote="true" dataName="cnName"
- @selectChange="dicChange('podCname', $event)" :disabled="editDisabled"></dic-select>
- </tempalte>
- </avue-form>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="activationDialog = false" size="mini">取 消</el-button>
- <el-button type="primary" @click.stop="activationSubmit" size="mini">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
- v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
- :upload-after="onSuccess">
- <template slot="excelTemplate">
- <el-button type="primary" @click="handleGet">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- detail,
- submit,
- pleaseCheck,
- repealCancel,
- tradingBoxItem,
- tradingBoxFees,
- submitItemList,
- submitFeeList,
- enable,
- submitBoxList,
- boxRemove,
- startingRent,
- revokeRentingOut,
- rentCalculation,
- revokeRentCalculation,
- copyAgent,
- pleaseVerifyCost
- } from "@/api/boxManagement/buyContainer/index.js";
- import dicSelect from "@/components/dicSelect/main";
- import checkSchedule from "@/components/checkH/checkSchedule.vue";
- import businessReports from "@/components/tradeAgency/businessReports.vue";
- import reports from "@/components/tradeAgency/reports.vue";
- import { dateFormat } from "@/util/date";
- import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
- import { getToken } from "@/util/auth";
- import _ from "lodash";
- import { Header } from "element-ui";
- import { values } from "lodash";
- export default {
- name: "detailsPage",
- data() {
- return {
- boxSelectionList: [],
- rulesList: [],
- rtOption: {
- border: true,
- align: 'center',
- menuWidth: 120,
- // menu: false,
- editBtn: false,
- delBtn: false,
- header: false,
- addBtn: false,
- height: '400px',
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: '起',
- prop: 'riseDays',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- },
- {
- label: '止',
- prop: 'stopDays',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- },
- {
- label: '费率',
- prop: 'rate',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- },
- {
- label: '币别',
- prop: 'curCode',
- cell: true,
- type: 'select',
- dicData: [{
- label: 'CNY',
- value: 'CNY',
- }, {
- label: 'USD',
- value: 'USD',
- }],
- overHidden: true,
- },
- ]
- },
- rtDialog: false,
- boxOption: {
- calcHeight: 30,
- menuWidth: 120,
- menu: false,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- // header: false,
- columnBtn: false,
- refreshBtn: false,
- selection: true,
- align: 'center',
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: "箱型",
- prop: "boxType",
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请选择箱型",
- trigger: "blur"
- }]
- },
- {
- label: "预计箱量",
- prop: "number",
- cell: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入预计箱量",
- trigger: "blur"
- }]
- },
- {
- label: "箱/天",
- prop: "price",
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入箱/天",
- trigger: "blur"
- }]
- },
- ]
- },
- excelBox: false,
- excelForm: {},
- excelLoading: false,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "模板上传",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "模板上传中,请稍等",
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-los/tradingBoxItem/importBoxItem"
- }
- ]
- },
- activationForm: {},
- activationOption: {
- menuBtn: false,
- span: 6,
- disabled: false,
- column: [
- {
- label: '放箱号',
- prop: 'containerNumber',
- span: 24,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- },
- {
- label: '起运港',
- prop: 'polCname',
- span: 24,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- },
- {
- label: '起运港场站',
- prop: 'polStationCname',
- span: 24,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- },
- {
- label: '目的港',
- prop: 'podCname',
- span: 24,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- },
- {
- label: '启用日期',
- prop: 'activationDate',
- span: 24,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: "",
- trigger: "blur"
- }]
- },
- ]
- },
- activationDialog: false,
- itemCIds: null,
- feeType: null,
- selectionList: [],
- selectionfeecList: [],
- checkId: '', // 审核需要的id
- batchNo: '',
- checkScheduleDialog: false, // 审核弹窗
- editButton: false,
- editDisabled: false,
- form: {
- type: "ZR",
- totalAmountC: 0,
- agreement: '到协议场站',
- boxCondition: '新',
- log: '否',
- boxTypeList: [],
- tradingBoxItemsList: [],
- feeCenterList: [],
- tradingBoxFilesList: [],
- },
- oldForm: {},
- optionForm: {
- menuBtn: false,
- span: 6,
- disabled: false,
- labelWidth: 100,
- column: [
- {
- label: '出租方',
- prop: 'purchaseCompanyName',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- disabled: false
- },
- {
- label: '合同号',
- prop: 'contractNo',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- disabled: false
- },
- {
- label: '租入日期',
- prop: 'effectiveDate',
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- disabled: false
- },
- {
- label: '到期日期',
- prop: 'expiryDate',
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }],
- disabled: false
- },
- {
- label: '港口',
- prop: 'addressCname',
- disabled: false,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '场站',
- prop: 'stationCname',
- disabled: false
- },
- {
- label: '租/还箱标准',
- prop: 'standard',
- disabled: false,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=conditions",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '退/还箱地',
- prop: 'polStationCname',
- disabled: false,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- {
- label: '业务状态',
- prop: 'buxStaus',
- disabled: true,
- },
- {
- label: '押金',
- prop: 'totalAmountC',
- disabled: false,
- },
- {
- label: '起租日期',
- prop: 'purchaseDate',
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd 00:00:00",
- disabled: true
- },
- {
- label: '备注',
- prop: 'remarks',
- type: 'textarea',
- minRows: 2,
- span: 6
- }]
- },
- optionForm2: {
- menuBtn: false,
- span: 5,
- disabled: true,
- labelWidth: 100,
- column: [
- {
- label: '系统号',
- prop: 'sysNo',
- disabled: true
- },
- {
- label: '制单人',
- prop: "createUserName",
- disabled: true,
- span: 4,
- },
- {
- label: '制单日期',
- prop: "createTime",
- disabled: true,
- },
- {
- label: '修改人',
- prop: "updateUserName",
- disabled: true,
- span: 4,
- },
- {
- label: '修改日期',
- prop: "updateTime",
- disabled: true,
- }
- ]
- },
- option: {},
- optionBack: {
- // height: 'auto',
- calcHeight: 30,
- menuWidth: 60,
- searchMenuSpan: 18,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- refreshBtn: false,
- selection: true,
- align: 'center',
- menu: false,
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: "是否启用",
- prop: "whetherEnable",
- overHidden: true,
- },
- {
- label: '放箱号',
- prop: 'containerNumber',
- overHidden: true,
- width: 100,
- },
- {
- label: '箱号',
- prop: 'code',
- width: 140,
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入箱号",
- trigger: "blur"
- }]
- },
- {
- label: '箱型',
- prop: 'boxType',
- width: 100,
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请选择箱型",
- trigger: "blur"
- }]
- },
- {
- label: '箱属',
- prop: 'boxBelongsTo',
- overHidden: true,
- // cell: true,
- // width: 100,
- // type: 'select',
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxBelongsTo",
- // props: {
- // label: "dictValue",
- // value: "dictValue"
- // },
- // rules: [{
- // required: true,
- // message: "请选择箱属",
- // trigger: "blur"
- // }]
- },
- {
- label: '放箱号类型',
- prop: 'boxCategory',
- overHidden: true,
- cell: true,
- width: 100,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- rules: [{
- required: true,
- message: "请选择放箱号类型",
- trigger: "blur"
- }]
- },
- {
- label: '箱况',
- prop: 'boxCondition',
- overHidden: true,
- cell: true,
- width: 100,
- type: 'select',
- dicData: [{
- label: '新',
- value: '新',
- }, {
- label: '旧',
- value: '旧',
- }],
- rules: [{
- required: true,
- message: "请选择箱况",
- trigger: "blur"
- }]
- },
- {
- label: '箱状态',
- prop: 'status',
- width: 100,
- overHidden: true,
- },
- {
- label: '箱好坏',
- prop: 'boxStatus',
- width: 100,
- cell: true,
- overHidden: true,
- type: 'select',
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- rules: [{
- required: true,
- message: "请选择箱好坏",
- trigger: "blur"
- }]
- },
- {
- label: '箱动态',
- prop: 'boxDynamics',
- width: 100,
- overHidden: true,
- },
- // {
- // label: '金额',
- // prop: 'amount',
- // cell: true,
- // type: 'number',
- // controls: false,
- // overHidden: true,
- // width: 100,
- // rules: [{
- // required: true,
- // message: "请输入金额",
- // trigger: "blur"
- // }]
- // },
- {
- label: '币别',
- prop: 'currency',
- width: 100,
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请选择币别",
- trigger: "blur"
- }]
- },
- {
- label: '汇率',
- prop: 'exrate',
- cell: true,
- type: 'number',
- controls: false,
- overHidden: true,
- width: 100,
- rules: [{
- required: true,
- message: "请输入汇率",
- trigger: "blur"
- }]
- },
- {
- label: '箱东',
- prop: 'boxEastName',
- overHidden: true,
- width: 100,
- },
- {
- label: '原箱东',
- prop: 'originalBoxEastName',
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- width: 100,
- },
- {
- label: '场站',
- prop: 'stationCname',
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- width: 100,
- rules: [{
- required: true,
- message: "请选择场站",
- trigger: "blur"
- }]
- },
- {
- label: '限制港口',
- prop: 'restrictedPortsName',
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- width: 200,
- },
- {
- label: '限制船公司',
- prop: 'restrictingShippingCompaniesName',
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- width: 200,
- },
- {
- label: '启用日期',
- prop: 'activationDate',
- // cell: true,
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- {
- label: "制单人",
- prop: "createUserName",
- overHidden: true,
- },
- {
- label: "制单日期",
- prop: "createTime",
- type: "date",
- overHidden: true,
- width: 120,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "修改人",
- prop: "updateUserName",
- overHidden: true,
- },
- {
- label: "修改日期",
- prop: "updateTime",
- type: "date",
- overHidden: true,
- width: 120,
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: '备注',
- prop: 'remarks',
- cell: true,
- width: 150,
- overHidden: true,
- }]
- },
- feecOption: {},
- feecOptionBack: {
- // height: 'auto',
- calcHeight: 30,
- menuWidth: 60,
- tip: false,
- border: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- refreshBtn: false,
- selection: true,
- align: 'center',
- menu: false,
- summaryText: "合计",
- showSummary: true,
- sumColumnList: [
- {
- name: 'amount',
- type: 'sum',
- decimals: 2
- },
- {
- name: 'amountLoc',
- type: 'sum',
- decimals: 2
- },
- {
- name: 'appliedInvoiceAmount',
- type: 'sum',
- decimals: 2
- },
- {
- name: 'uninvoicedAmount',
- type: 'sum',
- decimals: 2
- },
- {
- name: 'stlTtlAmount',
- type: 'sum',
- decimals: 2
- }
- ],
- column: [
- {
- label: "index",
- prop: "index",
- width: "55",
- headerslot: true,
- },
- {
- label: '账单状态',
- prop: 'accStatus',
- overHidden: true,
- width: 80,
- type: 'select',
- dicData: [{
- label: '未生成',
- value: 0,
- }, {
- label: '已生成',
- value: 1,
- }],
- },
- {
- label: '审核状态',
- prop: 'auditStatus',
- overHidden: true,
- width: 80,
- type: 'select',
- dicData: [{
- label: '录入',
- value: '0',
- }, {
- label: '提交审核',
- value: '1',
- }, {
- label: '审核中',
- value: '2',
- }, {
- label: '审核通过',
- value: '4',
- }],
- },
- {
- label: "类别",
- prop: "billType",
- width: 100,
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请选择类别',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "付费对象",
- prop: "corpCnName",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请选择付费对象',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "箱号",
- prop: "cntrNo",
- width: 140,
- cell: true,
- slot: true,
- formslot: true,
- overHidden: true,
- },
- {
- label: "费用名称",
- prop: "feeCnName",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请选择费用名称',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "计量单位",
- prop: "unitNo",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- },
- {
- label: "币别",
- prop: "curCode",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请选择币别',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "汇率",
- prop: "exrate",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true
- },
- {
- label: "单价",
- prop: "price",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请输入单价',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "数量",
- prop: "quantity",
- width: "100",
- overHidden: true,
- cell: true,
- slot: true,
- formslot: true,
- rules: [
- {
- required: true,
- message: '请输入数量',
- trigger: 'blur'
- }
- ]
- },
- {
- label: "金额",
- prop: "amount",
- width: "100",
- overHidden: true,
- },
- {
- label: "外币金额",
- prop: "amountLoc",
- width: "100",
- overHidden: true,
- },
- {
- label: "申请发票金额",
- prop: "appliedInvoiceAmount",
- width: "120",
- overHidden: true,
- },
- {
- label: "已开票金额",
- prop: "uninvoicedAmount",
- width: "120",
- overHidden: true,
- },
- {
- label: "已结算金额",
- prop: "stlTtlAmount",
- width: "120",
- overHidden: true,
- },
- {
- label: "租金天数",
- prop: "days",
- width: "80",
- overHidden: true,
- },
- {
- label: "租金起始",
- prop: "storageDate",
- width: "100",
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "租金截止",
- prop: "outboundDate",
- width: "100",
- overHidden: true,
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss"
- },
- {
- label: "制单人",
- prop: "createUserName",
- width: "100",
- overHidden: true
- },
- {
- label: "制单日期",
- prop: "createTime",
- width: "120",
- overHidden: true
- },
- {
- label: "修改人",
- prop: "updateUserName",
- width: "100",
- overHidden: true
- },
- {
- label: "修改日期",
- prop: "updateTime",
- width: "120",
- overHidden: true
- },
- {
- label: "备注",
- prop: "remarks",
- cell: true,
- overHidden: true
- }
- ]
- },
- roleName: [],
- updateSearchKey: new Date().getTime(),
- updateFormKey: new Date().getTime(),
- updateStationKey: new Date().getTime(),
- }
- },
- components: {
- dicSelect,
- checkSchedule,
- businessReports,
- reports
- },
- props: {
- detailData: Object
- },
- async created() {
- this.roleName = localStorage.getItem('roleName').split(',')
- this.option = await this.getColumnData(this.getColumnName(473), this.optionBack);
- this.feecOption = await this.getColumnData(this.getColumnName(235.2), this.feecOptionBack);
- if (this.detailData.id) {
- // this.editButton = true
- // this.editDisabled = true
- // this.optionForm.disabled = true
- this.getDetail(this.detailData.id)
- }
- if (this.$route.query.params) {
- this.getDetail(this.$route.query.params)
- }
- if (this.detailData.copyId) {
- this.getCopydate(this.detailData.copyId)
- }
- },
- methods: {
- openRtDialog(row) {
- this.rulesList = row.rentTermList
- this.rtDialog = true
- },
- rowSave(row, list) {
- console.log(row)
- row.rentTermList = list
- this.rtDialog = false
- },
- countChange(row) {
- if (row.curCode == 'CNY') {
- row.amount = _.round(_.multiply(row.price, row.quantity), 2)
- row.amountLoc = 0
- } else {
- row.amount = 0
- row.amountLoc = _.round(_.multiply(row.price, row.quantity), 2)
- }
- },
- activationSubmit() {
- this.$refs["form2"].validate((valid, done) => {
- done();
- if (valid) {
- let obj = {
- id: this.form.id,
- ...this.activationForm,
- tradingBoxItemsList: this.selectionList
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- enable(obj).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- this.activationDialog = false
- }).finally(() => {
- loading.close();
- })
- } else {
- return false;
- }
- });
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- // 上传成功
- onSuccess(res, done, loading, column) {
- if (res.length>0) {
- this.$message.success("上传成功!");
- }
- this.excelBox = false;
- this.getDetail(this.form.id)
- loading = false;
- done();
- },
- // 下载模板
- handleGet() {
- window.open(
- `/api/blade-los/tradingBoxItem/boxItemTemplate?${this.website.tokenHeader
- }=${getToken()}`
- );
- },
- dicChange(name, row) {
- if (name == 'purchaseCompanyName') {
- if (row) {
- this.form.purchaseCompanyId = row.id
- } else {
- this.form.purchaseCompanyId = null
- this.form.purchaseCompanyName = null
- }
- }
- if (name == 'addressCname') {
- if (row) {
- this.form.addressId = row.id
- this.form.addressCode = row.code
- this.form.addressEname = row.enName
- this.form.cyText = row.addressId
- this.form.stationId = null
- this.form.stationCode = null
- this.form.stationCname = null
- this.form.stationEname = null
- this.updateFormKey = new Date().getTime()
- } else {
- this.form.addressId = null
- this.form.addressCode = null
- this.form.addressEname = null
- this.form.addressCname = null
- this.form.cyText = null
- this.form.stationId = null
- this.form.stationCode = null
- this.form.stationCname = null
- this.form.stationEname = null
- }
- }
- if (name == 'stationCname') {
- if (row) {
- this.form.stationId = row.id
- this.form.stationCode = row.code
- this.form.stationEname = row.enName
- } else {
- this.form.stationId = null
- this.form.stationCode = null
- this.form.stationCname = null
- this.form.stationEname = null
- }
- }
- if (name == 'polStationCname') {
- if (row) {
- this.form.polStationId = row.id
- this.form.polStationCode = row.code
- this.form.polStationEname = row.enName
- } else {
- this.form.polStationId = null
- this.form.polStationCode = null
- this.form.polStationEname = null
- this.form.polStationCname = null
- }
- }
- // if (name == 'podCname') {
- // if (row) {
- // this.form.podId = row.id
- // this.form.podCode = row.code
- // this.form.podEname = row.enName
- // } else {
- // this.form.podId = null
- // this.form.podCode = null
- // this.form.podEname = null
- // this.form.podCname = null
- // }
- // }
- if (name == 'polCname') {
- if (row) {
- this.activationForm.polId = row.id
- this.activationForm.polCode = row.code
- this.activationForm.polEname = row.enName
- this.form.cyTextOne = row.addressId
- this.activationForm.polStationId = null
- this.activationForm.polStationCode = null
- this.activationForm.polStationCname = null
- this.activationForm.polStationEname = null
- this.updateStationKey = new Date().getTime()
- } else {
- this.activationForm.polId = null
- this.activationForm.polCode = null
- this.activationForm.polEname = null
- this.activationForm.polCname = null
- this.form.cyTextOne = null
- this.activationForm.polStationId = null
- this.activationForm.polStationCode = null
- this.activationForm.polStationCname = null
- this.activationForm.polStationEname = null
- }
- }
- if (name == 'polStationCname2') {
- if (row) {
- this.activationForm.polStationId = row.id
- this.activationForm.polStationCode = row.code
- this.activationForm.polStationEname = row.enName
- } else {
- this.activationForm.polStationId = null
- this.activationForm.polStationCode = null
- this.activationForm.polStationCname = null
- this.activationForm.polStationEname = null
- }
- }
- if (name == 'podCname') {
- if (row) {
- this.activationForm.podId = row.id
- this.activationForm.podCode = row.code
- this.activationForm.podEname = row.enName
- } else {
- this.activationForm.podId = null
- this.activationForm.podCode = null
- this.activationForm.podEname = null
- this.activationForm.podCname = null
- }
- }
- },
- rowDicChange(name, row, el, index) {
- if (name == 'currency') {
- if (row) {
- bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
- res.data.data.forEach(e => {
- if (el.currency == e.code) {
- this.$set(el, 'exrate', e.exrate)
- }
- })
- })
- } else {
- el.exrate = null
- }
- }
- if (name == 'curCode') {
- if (row) {
- bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
- res.data.data.forEach(e => {
- if (el.curCode == e.code) {
- this.$set(el, 'exrate', e.exrate)
- this.countChange(el)
- }
- })
- })
- } else {
- el.exrate = null
- }
- }
- if (name == 'feeCnName') {
- if (row) {
- el.feeId = row.id
- el.feeCode = row.code
- } else {
- el.feeId = null
- el.feeCode = null
- el.feeCnName = null
- }
- }
- if (name == 'boxType') {
- if (row) {
- el.boxTypeId = row.id
- } else {
- el.boxTypeId = null
- el.boxType = null
- }
- }
- if (name == 'stationCname') {
- if (row) {
- el.stationId = row.id
- el.stationCode = row.code
- el.stationEname = row.enName
- } else {
- el.stationId = null
- el.stationCode = null
- el.stationCname = null
- el.stationEname = null
- }
- }
- if (name == 'billType') {
- el.corpId = null
- el.shortName = null
- el.corpCnName = null
- el.corpEnName = null
- this.updateSearchKey = new Date().getTime()
- }
- if (name == 'corpCnName') {
- if (row) {
- el.corpId = row.id
- el.shortName = row.shortName
- el.corpEnName = row.enName
- } else {
- el.corpId = null
- el.shortName = null
- el.corpCnName = null
- el.corpEnName = null
- }
- }
- if (name == 'restrictedPortsName') {
- if (row) {
- el.restrictedPortsIds = row.ids
- el.restrictedPortsName = row.names
- } else {
- el.restrictedPortsIds = null
- el.restrictedPortsName = null
- }
- }
- if (name == 'restrictingShippingCompaniesName') {
- console.log(row)
- if (row) {
- el.restrictingShippingCompaniesIds = row.ids
- el.restrictingShippingCompaniesName = row.names
- } else {
- el.restrictingShippingCompaniesIds = null
- el.restrictingShippingCompaniesName = null
- }
- }
- if (name == 'originalBoxEastName') {
- if (row) {
- el.originalBoxEastId = row.id
- } else {
- el.originalBoxEastId = null
- el.originalBoxEastName = null
- }
- }
- },
- rowEdit(row) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowItemEdit(row) {
- if (row.$cellEdit == true) {
- this.$set(row, "$cellEdit", false);
- } else {
- this.$set(row, "$cellEdit", true);
- }
- },
- rowItemDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxItem({ ids: row.id }).then(res => {
- this.rulesList.splice(index, 1);
- this.$message.success("成功删除");
- })
- } else {
- this.rulesList.splice(index, 1);
- }
- });
- },
- boxAddRow() {
- this.form.boxTypeList.push(
- {
- pid: this.form.id ? this.form.id : null,
- $cellEdit: true
- }
- )
- },
- rtAddRow() {
- this.rulesList.push({ curCode: 'CNY', $cellEdit: true })
- },
- addRow() {
- if (!this.form.id) {
- return this.$message.error("请保存数据");
- }
- this.$refs.crud.dicInit();
- bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
- res.data.data.forEach(e => {
- if (e.code == 'USD') {
- this.form.tradingBoxItemsList.push({
- pid: this.form.id,
- boxBelongsTo: 'SOC',
- boxCategory: '自有箱',
- boxStatus: '好',
- boxCondition: this.form.boxCondition,
- stationId: this.form.stationId,
- stationCode: this.form.stationCode,
- stationCname: this.form.stationCname,
- stationEname: this.form.stationEname,
- currency: 'USD',
- exrate: e.exrate,
- status: '空箱入场',
- $cellEdit: true
- })
- }
- })
- })
- },
- feecAddRow() {
- if (!this.form.id) {
- return this.$message.error("请保存数据");
- }
- this.form.feeCenterList.push({
- pid: this.form.id,
- feesType: 1,
- dc: 'C',
- billType: '箱东',
- corpId: this.form.purchaseCompanyId,
- shortName: this.form.purchaseCompanyName,
- corpCnName: this.form.purchaseCompanyName,
- curCode: 'CNY',
- exrate: 1,
- $cellEdit: true
- })
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- boxSelectionChange(list) {
- this.boxSelectionList = list;
- },
- feecChange(list) {
- let ids = []
- list.forEach(e => {
- ids.push(e.id)
- })
- if (ids.length) {
- this.itemCIds = ids.join(',')
- } else {
- this.itemCIds = null
- }
- this.selectionfeecList = list;
- },
- getDetail(id) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- detail({ id: id }).then(res => {
- this.form = res.data.data
- this.updateFormKey = new Date().getTime()
- // if (res.data.data.status != '录入') {
- // this.editButton = true
- // this.editDisabled = true
- // this.optionForm.disabled = true
- // }
- }).finally(() => {
- loading.close()
- })
- },
- getCopydate(id) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- copyAgent({ id: id }).then(res => {
- this.form = res.data.data
- this.updateFormKey = new Date().getTime()
- }).finally(() => {
- loading.close()
- })
- },
- inEdit() {
- this.editButton = false
- if (this.form.status == '录入') {
- this.editDisabled = false
- this.optionForm.disabled = false
- }
- },
- rowDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxItem({ ids: row.id }).then(res => {
- this.form.tradingBoxItemsList.splice(index, 1);
- this.$message.success("成功删除");
- })
- } else {
- this.form.tradingBoxItemsList.splice(index, 1);
- }
- });
- },
- polRowDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxFees({ ids: row.id }).then(res => {
- this.form.feeCenterList.splice(index, 1);
- this.$message.success("成功删除");
- })
- } else {
- this.form.feeCenterList.splice(index, 1);
- }
- });
- },
- podRowDel(row, index) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- tradingBoxFees({ ids: row.id }).then(res => {
- this.podFeeList.splice(index, 1);
- this.$message.success("成功删除");
- })
- } else {
- this.podFeeList.splice(index, 1);
- }
- });
- },
- allClick(name) {
- if (name == 'box一键保存') {
- if (!this.form.boxTypeList.length) {
- return this.$message.error("请添加数据");
- }
- for (let row of this.form.boxTypeList) {
- if (!row.boxType || !row.number || !row.price) {
- this.$refs.crudBox.rowCell(row, row.$index)
- return this.$message.error("请完善箱型箱量");
- }
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitBoxList(this.form.boxTypeList).then(res => {
- this.$message.success("保存成功");
- this.form.boxTypeList = res.data.data
- }).finally(() => {
- loading.close();
- })
- }
- if (name == 'box一键编辑') {
- for (let row of this.form.boxTypeList) {
- this.$set(row, "$cellEdit", true);
- }
- }
- if (name == 'box批量删除') {
- for (let item of this.selectionList) {
- if (item.whetherEnable == '是') {
- return this.$message.error("启用状态不能删除!");
- }
- }
- let multiList = []
- let arr = []
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- multiList = this.boxSelectionList
- arr = this.form.boxTypeList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.id != null);
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- if (itemsWithId.length != 0) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- boxRemove({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("删除成功");
- }).finally(() => {
- loading.close();
- })
- }
- })
- }
- if (name == '一键保存') {
- if (!this.form.tradingBoxItemsList.length) {
- return this.$message.error("请添加数据");
- }
- for (let row of this.form.tradingBoxItemsList) {
- if (!row.code || !row.boxType || !row.boxCategory || !row.boxStatus || !row.boxCondition || !row.currency || !row.exrate || !row.stationCname || !row.status) {
- this.$refs.crud.rowCell(row, row.$index)
- return this.$message.error("请完善箱明细信息");
- }
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitItemList(this.form.tradingBoxItemsList).then(res => {
- this.$message.success("保存成功");
- this.form.tradingBoxItemsList = res.data.data
- }).finally(() => {
- loading.close();
- })
- }
- if (name == '一键编辑') {
- for (let row of this.form.tradingBoxItemsList) {
- if (row.whetherEnable != '是') {
- this.$set(row, "$cellEdit", true);
- }
- }
- this.$refs.crud.dicInit();
- }
- if (name == '批量删除') {
- for (let item of this.selectionList) {
- if (item.whetherEnable == '是') {
- return this.$message.error("启用状态不能删除!");
- }
- }
- let multiList = []
- let arr = []
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- multiList = this.selectionList
- arr = this.form.tradingBoxItemsList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.id != null);
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- if (itemsWithId.length != 0) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- tradingBoxItem({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("删除成功");
- }).finally(() => {
- loading.close();
- })
- }
- })
- }
- if (name == '起租') {
- let _this = this
- this.$DialogForm.show({
- title: '起租',
- width: '30%',
- menuPosition: 'right',
- option: {
- submitText: '确定',
- emptyText: '取消',
- span: 24,
- column: [{
- label: "起租日期",
- prop: "value",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- value: _this.form.effectiveDate,
- pickerOptions: {
- disabledDate(time) {
- return time.getTime() < new Date(_this.form.effectiveDate).getTime();
- },
- },
- rules: [{
- required: true,
- message: "请选择起租日期",
- trigger: "blur",
- }],
- }]
- },
- beforeClose: (done) => {
- done()
- },
- callback: (res) => {
- res.done()
- this.$confirm('是否起租?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let obj = {
- ...this.form,
- rentType: 1,
- rentDate: res.data.value
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- startingRent(obj).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- res.close()
- })
- }
- })
- }
- if (name == '生成租金') {
- let date = new Date(this.form.rentEndDate)
- date.setDate(date.getDate() + 1);
- date = dateFormat(date, 'yyyy-MM-dd') + ' 00:00:00'
- this.$DialogForm.show({
- title: '生成租金',
- width: '30%',
- menuPosition: 'right',
- option: {
- submitText: '确定',
- emptyText: '取消',
- labelWidth: '100',
- span: 24,
- column: [{
- label: "租金截至日期",
- prop: "value",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- value: date,
- pickerOptions: {
- disabledDate(time) {
- const date2 = new Date(date)
- // date.setDate(date.getDate() + 1);
- return time.getTime() < date2.getTime();
- },
- },
- rules: [{
- required: true,
- message: "请选择日期",
- trigger: "blur",
- }],
- }]
- },
- beforeClose: (done) => {
- done()
- },
- callback: (res) => {
- res.done()
- this.$confirm('是否生成租金?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let obj = {
- ...this.form,
- rentDate: res.data.value
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- rentCalculation(obj).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- res.close()
- })
- }
- })
- }
- if (name == '撤销租金') {
- this.$confirm('是否撤销租金?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeRentCalculation(this.form).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- if (name == '退租') {
- let date = new Date(this.form.rentEndDate)
- date.setDate(date.getDate() + 1);
- date = dateFormat(date, 'yyyy-MM-dd') + ' 00:00:00'
- this.$DialogForm.show({
- title: '退租',
- width: '30%',
- menuPosition: 'right',
- option: {
- submitText: '确定',
- emptyText: '取消',
- span: 24,
- column: [{
- label: "退租日期",
- prop: "value",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- value: date,
- pickerOptions: {
- disabledDate(time) {
- const date2 = new Date(date)
- // date.setDate(date.getDate() + 1);
- return time.getTime() < date2.getTime();
- },
- },
- rules: [{
- required: true,
- message: "请选择退租起租日期",
- trigger: "blur",
- }],
- }]
- },
- beforeClose: (done) => {
- done()
- },
- callback: (res) => {
- res.done()
- this.$confirm('是否退租?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let obj = {
- ...this.form,
- rentType: 2,
- rentDate: res.data.value
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- startingRent(obj).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- res.close()
- })
- }
- })
- }
- if (name == '撤销退租') {
- this.$confirm('是否撤销退租?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeRentingOut(this.form).then(res => {
- this.$message.success("操作成功!");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- })
- }
- if (name == '导入') {
- this.excelOption.column.forEach(item => {
- if (item.prop == 'excelFile') {
- item.action = "/api/blade-los/tradingBoxItem/importBoxItem?id=" + this.form.id
- }
- })
- this.excelBox = true
- }
- if (name == '启用') {
- for (let item of this.selectionList) {
- if (item.whetherEnable == '是') {
- return this.$message.error("请勿重复启用");
- }
- }
- this.form.cyTextOne = this.form.cyText
- this.activationForm = {
- containerNumber: null,
- polId: this.form.addressId,
- polCode: this.form.addressCode,
- polEname: this.form.addressEname,
- polCname: this.form.addressCname,
- polStationId: this.form.stationId,
- polStationCode: this.form.stationCode,
- polStationCname: this.form.stationCname,
- polStationEname: this.form.stationEname,
- podId: null,
- podCode: null,
- podEname: null,
- podCname: null,
- activationDate: null,
- }
- this.activationDialog = true
- }
- if (name == '费用一键保存') {
- if (!this.form.feeCenterList.length) {
- return this.$message.error("请添加数据");
- }
- for (let row of this.form.feeCenterList) {
- if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
- this.$refs.crud2.rowCell(row, row.$index)
- return this.$message.error("请完善费用明细");
- }
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submitFeeList(this.form.feeCenterList).then(res => {
- this.$message.success("保存成功");
- this.form.feeCenterList = res.data.data
- }).finally(() => {
- loading.close();
- })
- }
- if (name == '费用一键编辑') {
- for (let row of this.form.feeCenterList) {
- if (!row.stlPid && (row.accStatus == 0||row.auditStatus== 0)) {
- this.$set(row, "$cellEdit", true);
- }
- }
- }
- if (name == '费用批量删除') {
- for (let row of this.selectionfeecList) {
- if (row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ') {
- return this.$message.error("押金和租箱费不允许删除");
- }
- if (row.stlPid && row.accStatus != 0) {
- return this.$message.error("已生成账单,不允许删除");
- }
- if (row.stlPid && row.auditStatus != 0) {
- return this.$message.error("已申请费用,不允许删除");
- }
- }
- let multiList = []
- let arr = []
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- multiList = this.selectionfeecList
- arr = this.form.feeCenterList
- // 获取有id 的数据
- const itemsWithId = multiList.filter(item => item.id != null);
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
- // 把选中的删除掉
- multiList.forEach((item) => {
- for (let index in arr) {
- if (JSON.stringify(item) == JSON.stringify(arr[index])) {
- arr.splice(Number(index), 1)
- }
- }
- })
- if (itemsWithId.length != 0) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- tradingBoxFees({ ids: arrIds.join(',') }).then(res => {
- this.$message.success("删除成功");
- }).finally(() => {
- loading.close();
- })
- }
- })
- }
- if (name == '费用申请') {
- for (let row of this.selectionfeecList) {
- if (row.stlPid && row.accStatus != 0) {
- return this.$message.error("已生成账单,不允许重复申请");
- }
- if (row.stlPid && row.auditStatus != 0) {
- return this.$message.error("已申请费用,不允许重复申请");
- }
- }
- this.$confirm("确定申请费用?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {}
- obj = {
- srcId: this.form.id,
- srcType: this.form.type,
- feeCenterList: this.selectionfeecList,
- url: '/boxManagement/rentalBox/index',
- pageStatus: '',
- pageLabel: '租箱',
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- pleaseVerifyCost(obj).then(res => {
- this.$message.success("操作成功");
- this.getDetail(this.form.id)
- }).finally(() => {
- loading.close();
- })
- });
- }
- },
- submit(type) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- for (let row of this.form.boxTypeList) {
- if (!row.boxType || !row.number || !row.price) {
- this.$refs.crudBox.rowCell(row, row.$index)
- return this.$message.error("请完善箱型箱量");
- }
- }
- for (let row of this.form.tradingBoxItemsList) {
- if (!row.code || !row.boxType || !row.boxCategory || !row.boxStatus || !row.boxCondition || !row.currency || !row.exrate || !row.stationCname || !row.status) {
- this.$refs.crud.rowCell(row, row.$index)
- return this.$message.error("请完善箱明细信息");
- }
- }
- for (let row of this.form.feeCenterList) {
- if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
- this.$refs.crud2.rowCell(row, row.$index)
- return this.$message.error("请完善费用明细");
- }
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit(this.form).then(res => {
- this.$message.success("保存成功");
- this.getDetail(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- } else {
- return false;
- }
- });
- },
- application() {
- this.$confirm("确定请核数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {}
- obj = {
- id: this.form.id,
- url: '/iosBasicData/costcenter/coc/index',
- pageStatus: '',
- pageLabel: '航线成本(COC)',
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- pleaseCheck(obj).then(res => {
- this.$message.success("请核成功");
- this.getDetail(res.data.data.id)
- }).finally(() => {
- loading.close();
- })
- });
- },
- revokeApplication() {
- this.$confirm("确定撤销请核?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- let obj = {}
- obj = {
- id: this.form.id,
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- repealCancel(obj).then(res => {
- this.$message.success("撤销请核成功");
- this.getDetail(res.data.data.id)
- this.editDisabled = false
- this.optionForm.disabled = false
- }).finally(() => {
- loading.close();
- })
- });
- },
- //请核关闭
- choceScheduleFun() {
- this.checkScheduleDialog = false
- },
- //自定义列保存
- async saveColumn(ref, option, optionBack, code) {
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumn(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- // 更改表格颜色
- headerClassName(tab) {
- //颜色间隔
- let back = ""
- if (tab.columnIndex >= 0 && tab.column.level === 1) {
- if (tab.columnIndex % 2 === 0) {
- back = "back-one"
- } else if (tab.columnIndex % 2 === 1) {
- back = "back-two"
- }
- }
- return back;
- },
- goBack(type) {
- this.$emit("goBack");
- },
- },
- watch: {
- // 监听业务类型 如果不是分单 可以编辑分单号
- 'form.tradingBoxItemsList': {
- // 执行方法
- handler(oldValue, newValue) {
- if (this.form.tradingBoxItemsList.length > 0) {
- this.optionForm.column.forEach(item => {
- if (item.prop == 'contractNo' || item.prop == 'effectiveDate' || item.prop == 'expiryDate' || item.prop == 'standard' || item.prop == 'totalAmountC') {
- item.disabled = true
- }
- })
- } else {
- this.optionForm.column.forEach(item => {
- if (item.prop == 'contractNo' || item.prop == 'effectiveDate' || item.prop == 'expiryDate' || item.prop == 'standard' || item.prop == 'totalAmountC') {
- item.disabled = false
- }
- })
- }
- },
- deep: true, // 深度监听
- immediate: true // 第一次改变就执行
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item__error {
- display: none !important;
- }
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- ::v-deep .el-table .cell {
- padding: 0 2px !important;
- .el-form-item {
- margin-bottom: 0px !important;
- }
- }
- ::v-deep .avue-crud .el-table .el-form-item__label {
- left: -1px;
- }
- // ::v-deep#out-table .back-one {
- // background: #ecf5ff !important;
- // }
- // ::v-deep#out-table .back-two {
- // background: #ecf5ff !important;
- // }
- ::v-deep #out-table .back-one {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep #out-table .back-two {
- background: #ecf5ff !important;
- text-align: center;
- padding: 4px 0;
- }
- ::v-deep .el-table--small td,
- .el-table--small th {
- padding: 2px !important;
- }
- ::v-deep .el-card__body {
- padding: 3px 10px;
- }
- ::v-deep .box-card .el-card__body {
- padding: 4px !important;
- }
- .disabledBox {
- display: flex;
- align-items: center;
- }
- .meetSize {
- font-size: 16px;
- color: #54BCBD;
- }
- </style>
|