detailsPage.vue 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="goBack()">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small" v-if="editButton"
  11. :disabled="showLock || !(roleName.indexOf('admin') != -1 || roleName.indexOf('允许修改他人业务') != -1 || saberUserInfo.user_id == form.createUser)"
  12. @click="inEdit">编 辑
  13. </el-button>
  14. <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
  15. :disabled="isSaveBtn" @click="submit">保 存
  16. </el-button>
  17. <!-- <el-button v-if="form.status == '审核提交'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
  18. size="small" @click="revokeApplication">撤销单据请核
  19. </el-button> -->
  20. <!-- <el-dropdown style="line-height: 0">
  21. <el-button class="el-button--small-yh" style="margin-left: 6px;" type="warning" :disabled="!form.id"
  22. size="small">
  23. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  24. </el-button>
  25. <el-dropdown-menu slot="dropdown">
  26. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  27. </el-dropdown-item>
  28. </el-dropdown-menu>
  29. </el-dropdown> -->
  30. </div>
  31. </div>
  32. <div style="margin-top: 50px">
  33. <el-tabs type="border-card">
  34. <el-tab-pane label="基础信息">
  35. <trade-card title="基础信息">
  36. <avue-form :option="optionForm" v-model="form" ref="form">
  37. <tempalte slot="purchaseCompanyName">
  38. <dic-select v-model="form.purchaseCompanyName" placeholder="出售方" label="shortName" res="records"
  39. url="/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=箱东" :filterable="true"
  40. :remote="true" dataName="shortName" @selectChange="dicChange('purchaseCompanyName', $event)"
  41. :disabled="editDisabled || form.tradingBoxItemsList.length" :slotRight="true"
  42. rightLabel="code"></dic-select>
  43. </tempalte>
  44. <tempalte slot="addressCname">
  45. <dic-select v-model="form.addressCname" placeholder="港口" label="cnName" res="records"
  46. url="/blade-los/bports/list?status=0&current=1&size=5" :filterable="true" :remote="true"
  47. dataName="cnName" @selectChange="dicChange('addressCname', $event)"
  48. :disabled="editDisabled || form.tradingBoxItemsList.length" :slotRight="true"
  49. rightLabel="code"></dic-select>
  50. </tempalte>
  51. <tempalte slot="stationCname">
  52. <dic-select v-model="form.stationCname" placeholder="场站" :key="updateFormKey" label="cnName"
  53. res="records"
  54. :url="'/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=场站&status=0&ids=' + (form.cyText ? form.cyText : '')"
  55. :filterable="true" :remote="true" dataName="cnName" @selectChange="dicChange('stationCname', $event)"
  56. :disabled="editDisabled || !form.addressId || form.tradingBoxItemsList.length" :slotRight="true"
  57. rightLabel="code"></dic-select>
  58. </tempalte>
  59. </avue-form>
  60. </trade-card>
  61. <trade-card title="箱明细">
  62. <avue-crud :option="option" :data="form.tradingBoxItemsList" id="out-table" ref="crud"
  63. :header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
  64. :cell-style="{ height: '20px', padding: '0px' }" @selection-change="selectionChange"
  65. @select="selectHandle" @row-update="rowUpdate"
  66. @resetColumn="resetColumn('crud', 'option', 'optionBack', 235.1)"
  67. @saveColumn="saveColumn('crud', 'option', 'optionBack', 235.1)">
  68. <template slot="menuLeft">
  69. <el-button type="info" plain size="small" :disabled="editDisabled || !form.id"
  70. @click="allClick('一键保存')">一键保存</el-button>
  71. <el-button type="info" plain size="small"
  72. :disabled="editDisabled || form.tradingBoxItemsList.length == 0"
  73. @click="allClick('一键编辑')">一键编辑</el-button>
  74. <el-button type="danger" plain size="small" :disabled="editDisabled || selectionList.length == 0"
  75. @click="allClick('批量删除')">批量删除</el-button>
  76. <el-button type="success" size="small" @click="allClick('导入')"
  77. :disabled="!form.id || form.whetherEnable == '是'">导入</el-button>
  78. <el-button type="info" size="small" @click="allClick('启用')"
  79. :disabled="selectionList.length == 0">启用</el-button>
  80. <!-- <el-button type="primary" size="small" @click="allClick('卖箱')">卖箱</el-button> -->
  81. <el-button size="small" style="margin-right: 8px" :disabled="!form.id || true"
  82. @click="$refs.print.openDialog()">打印报表
  83. </el-button>
  84. <span style="margin: 0 20px;color:#67C23A;">
  85. 金额合计(CNY):{{ CNYSUM }}
  86. </span>
  87. <span style="margin: 0 20px;color:#F56C6C;">
  88. 金额合计(USD):{{ USDSUM }}
  89. </span>
  90. </template>
  91. <template slot="indexHeader" slot-scope="{row,index}">
  92. <el-button type="primary" size="mini" icon="el-icon-plus"
  93. :disabled="editDisabled || form.whetherEnable == '是'" circle @click="addRow()">
  94. </el-button>
  95. </template>
  96. <template slot="index" slot-scope="{row,index}">
  97. <span>{{ index + 1 }}</span>
  98. </template>
  99. <template slot="boxTypeForm" slot-scope="{ row }">
  100. <dic-select v-if="row.$cellEdit" v-model="row.boxType" key="id" label="cnName" res="records"
  101. url="/blade-los/bcntrtypes/list?status=0&current=1&size=20" :filterable="true" :remote="true"
  102. dataName="cnName" @selectChange="rowDicChange('boxType', $event, row)"></dic-select>
  103. <span v-else>{{ row.boxType }}</span>
  104. </template>
  105. <template slot="currencyForm" slot-scope="{ row }">
  106. <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
  107. :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
  108. @selectChange="rowDicChange('currency', $event, row)"></dic-select>
  109. <span v-else>{{ row.currency }}</span>
  110. </template>
  111. <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
  112. <dic-select v-if="row.$cellEdit" v-model="row.originalBoxEastName" placeholder="箱东" key="id"
  113. label="shortName" res="records"
  114. url="/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=箱东" :filterable="true"
  115. :remote="true" dataName="shortName" @selectChange="rowDicChange('originalBoxEastName', $event, row)"
  116. :slotRight="true" rightLabel="code">
  117. </dic-select>
  118. <span v-else>{{ row.originalBoxEastName }}</span>
  119. </tempalte>
  120. <tempalte slot="stationCnameForm" slot-scope="{ row }">
  121. <dic-select v-if="row.$cellEdit" v-model="row.stationCname" placeholder="场站" key="id" label="cnName"
  122. res="records" url="/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=场站&status=0"
  123. :filterable="true" :remote="true" dataName="cnName"
  124. @selectChange="rowDicChange('stationCname', $event, row)" :slotRight="true"
  125. rightLabel="code"></dic-select>
  126. <span v-else>{{ row.stationCname }}</span>
  127. </tempalte>
  128. <tempalte slot="restrictedPortsNameForm" slot-scope="{ row }">
  129. <dic-select v-show="row.$cellEdit" v-model="row.restrictedPortsName" placeholder="港口" key="id"
  130. label="cnName" url="/blade-los/bports/listAll?status=0" :filterable="true" :multiple="true"
  131. :collapseTags="true" @selectChange="rowDicChange('restrictedPortsName', $event, row)"
  132. dataType="string" :slotRight="true" rightLabel="code"></dic-select>
  133. <span v-show="!row.$cellEdit">{{ row.restrictedPortsName }}</span>
  134. </tempalte>
  135. <tempalte slot="restrictingShippingCompaniesNameForm" slot-scope="{ row }">
  136. <dic-select v-show="row.$cellEdit" v-model="row.restrictingShippingCompaniesName" placeholder="船公司"
  137. key="id" label="cnName" url="/blade-los/bcorps/listAll?corpTypeName=船公司&status=0" :filterable="true"
  138. :multiple="true" :collapseTags="true"
  139. @selectChange="rowDicChange('restrictingShippingCompaniesName', $event, row)" dataType="string"
  140. :slotRight="true" rightLabel="code"></dic-select>
  141. <span v-show="!row.$cellEdit">{{ row.restrictingShippingCompaniesName }}</span>
  142. </tempalte>
  143. </avue-crud>
  144. </trade-card>
  145. <trade-card title="操作记录">
  146. <avue-form :option="optionForm2" v-model="form" ref="form2">
  147. </avue-form>
  148. </trade-card>
  149. </el-tab-pane>
  150. <el-tab-pane label="费用信息">
  151. <el-card
  152. v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
  153. class="box-card" style="margin: 2px 0">
  154. <avue-crud :option="feecOption" :data="form.feeCenterList" id="out-table" ref="crud2"
  155. :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
  156. @selection-change="feecChange" @row-update="rowUpdate"
  157. @resetColumn="resetColumn('crud2', 'feecOption', 'feecOptionBack', 235.2)"
  158. @saveColumn="saveColumn('crud2', 'feecOption', 'feecOptionBack', 235.2)">
  159. <template slot="menuLeft">
  160. <div style="display: inline-block;margin-right: 20px" class="disabledBox meetSize">
  161. <i class="el-icon-coin"></i>
  162. <span>应付费用</span>
  163. </div>
  164. <el-button type="info" plain size="small" :disabled="editDisabled"
  165. @click="allClick('费用一键保存')">一键保存</el-button>
  166. <el-button type="info" plain size="small" :disabled="editDisabled"
  167. @click="allClick('费用一键编辑')">一键编辑</el-button>
  168. <el-button type="danger" plain size="small" :disabled="editDisabled || selectionfeecList.length == 0"
  169. @click="allClick('费用批量删除')">批量删除</el-button>
  170. <el-button type="primary" plain size="small" :disabled="editDisabled || selectionfeecList.length == 0"
  171. @click="allClick('费用申请')">费用申请</el-button>
  172. <!-- <el-button type="primary" plain size="small" @click="$refs.printC.openDialog()">打印账单</el-button> -->
  173. </template>
  174. <template slot="indexHeader" slot-scope="{row,index}">
  175. <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle
  176. @click="feecAddRow()">
  177. </el-button>
  178. </template>
  179. <template slot="index" slot-scope="{row,index}">
  180. <span>{{ index + 1 }}</span>
  181. </template>
  182. <template slot="billTypeForm" slot-scope="{row,index}">
  183. <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  184. v-model="row.billType" key="id" label="cnName" res="records"
  185. url="/blade-los/bcorpstypedefine/list?status=0&current=1&size=20" :filterable="true" :remote="true"
  186. dataName="cnName" @selectChange="rowDicChange('billType', $event, row, index)"></dic-select>
  187. <span v-else>{{ row.billType }}</span>
  188. </template>
  189. <template slot="cntrNoForm" slot-scope="{row,index}">
  190. <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  191. v-model="row.cntrNo" key="id" label="code" :mockData="form.tradingBoxItemsList"
  192. :filterable="true"></dic-select>
  193. <span v-else>{{ row.cntrNo }}</span>
  194. </template>
  195. <template slot="corpCnNameForm" slot-scope="{ row,index }">
  196. <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  197. :key="updateSearchKey" v-model="row.corpCnName" placeholder="付费对象" label="shortName" res="records"
  198. :url="'/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=' + row.billType"
  199. :filterable="true" :remote="true" dataName="shortName"
  200. @selectChange="rowDicChange('corpCnName', $event, row)" :slotRight="true"
  201. rightLabel="code"></dic-select>
  202. <span v-else>{{ row.corpCnName }}</span>
  203. <!-- <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" key="id" placeholder="付费对象" label="cnName"
  204. res="records" url="/blade-los/bcorps/selectList?corpTypeName=船公司&status=0&current=1&size=20"
  205. :filterable="true" :remote="true" dataName="cnName"
  206. @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
  207. <span v-else>{{ row.corpCnName }}</span> -->
  208. </template>
  209. <template slot="feeCnNameForm" slot-scope="{ row }">
  210. <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  211. v-model="row.feeCnName" key="id" placeholder="费用名称" label="cnName" res="records"
  212. url="/blade-los/bfees/list?status=0&current=1&size=20" :filterable="true" :remote="true"
  213. dataName="cnName" @selectChange="rowDicChange('feeCnName', $event, row)"
  214. disabledLabel="押金,租箱费"></dic-select>
  215. <span v-else>{{ row.feeCnName }}</span>
  216. </template>
  217. <template slot="curCodeForm" slot-scope="{ row }">
  218. <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
  219. :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
  220. @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
  221. <span v-else>{{ row.curCode }}</span>
  222. </template>
  223. <template slot="exrateForm" slot-scope="{ row }">
  224. <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  225. v-model="row.exrate" :controls="false" placeholder="请输入 汇率" size="small"
  226. style="width: 100%;"></el-input-number>
  227. <span v-else>{{ row.exrate }}</span>
  228. </template>
  229. <template slot="unitNoForm" slot-scope="{row,index}">
  230. <dic-select v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  231. v-model="row.unitNo" label="cnName" url="/blade-los/bunits/listAll?status=0"
  232. :filterable="true"></dic-select>
  233. <span v-else>{{ row.unitNo }}</span>
  234. </template>
  235. <template slot="priceForm" slot-scope="{ row }">
  236. <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  237. v-model="row.price" :controls="false" placeholder="请输入 成本价" size="small" style="width: 100%;"
  238. :precision="2" @change="countChange(row)"></el-input-number>
  239. <span v-else>{{ row.price }}</span>
  240. </template>
  241. <template slot="quantityForm" slot-scope="{ row }">
  242. <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
  243. v-model="row.quantity" :controls="false" placeholder="请输入 成本价" size="small" style="width: 100%;"
  244. :precision="0" @change="countChange(row)"></el-input-number>
  245. <span v-else>{{ row.quantity }}</span>
  246. </template>
  247. <template slot="menu" slot-scope="{ row, index }">
  248. <el-button size="small" icon="el-icon-delete" type="text" :disabled="editDisabled"
  249. @click="polRowDel(row, index)">删 除</el-button>
  250. </template>
  251. </avue-crud>
  252. </el-card>
  253. </el-tab-pane>
  254. <el-tab-pane label="文件中心">
  255. <containerTitle title="上传附件"></containerTitle>
  256. <c-upload :data="form.tradingBoxFilesList" :enumerationValue="76"
  257. deleteUrl="/api/blade-los/tradingBoxFiles/remove" display :disabled="editButton"></c-upload>
  258. </el-tab-pane>
  259. </el-tabs>
  260. </div>
  261. <business-reports :id="form.id" :itemIds="itemIds" ref="print" businessValue="MYDL" :type="true"></business-reports>
  262. <business-reports :id="form.id" :itemIds="itemCIds" ref="printC" businessValue="MYDL" classifyCode="费用"
  263. groupCode="应付" :selecList="selectionfeecList"></business-reports>
  264. <reports :id="form.id" :assemblyForm="form" businessValue="MYDL" ref="report"></reports>
  265. <!--审核弹窗-->
  266. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  267. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  268. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  269. </el-dialog>
  270. <!-- 启用 -->
  271. <el-dialog append-to-body title="放箱号" :visible.sync="activationDialog" width="30%" :before-close="activationClose"
  272. v-dialog-drag>
  273. <span>
  274. <avue-form ref="form2" v-model="activationForm" :option="activationOption">
  275. <tempalte slot="polCname">
  276. <dic-select v-model="activationForm.polCname" placeholder="港口" key="id" label="cnName" res="records"
  277. url="/blade-los/bports/list?status=0" :filterable="true" :remote="true" dataName="cnName"
  278. @selectChange="dicChange('polCname', $event)"></dic-select>
  279. </tempalte>
  280. <tempalte slot="polStationCname">
  281. <dic-select v-model="activationForm.polStationCname" placeholder="场站" :key="updateStationKey" label="cnName"
  282. res="records" :slotRight="true" rightLabel="code"
  283. :url="'/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=场站&status=0&ids=' + (form.cyTextOne ? form.cyTextOne : '')"
  284. :filterable="true" :remote="true" dataName="cnName" @selectChange="dicChange('polStationCname', $event)"
  285. :disabled="editDisabled || !activationForm.polCname"></dic-select>
  286. </tempalte>
  287. <tempalte slot="podCname">
  288. <dic-select v-model="activationForm.podCname" placeholder="港口" key="id" label="cnName" res="records"
  289. url="/blade-los/bports/list?status=0" :filterable="true" :remote="true" dataName="cnName"
  290. @selectChange="dicChange('podCname', $event)" :disabled="editDisabled"></dic-select>
  291. </tempalte>
  292. </avue-form>
  293. </span>
  294. <span slot="footer" class="dialog-footer">
  295. <el-button @click="activationDialog = false" size="mini">取 消</el-button>
  296. <el-button type="primary" @click.stop="activationSubmit" size="mini">确 定</el-button>
  297. </span>
  298. </el-dialog>
  299. <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  300. v-dialog-drag>
  301. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
  302. :upload-after="onSuccess">
  303. <template slot="excelTemplate">
  304. <el-button type="primary" @click="handleGet">
  305. 点击下载<i class="el-icon-download el-icon--right"></i>
  306. </el-button>
  307. </template>
  308. </avue-form>
  309. <p style="text-align: center;color: #DC0505">
  310. 温馨提示 第一次导入时请先下载模板
  311. </p>
  312. </el-dialog>
  313. </div>
  314. </template>
  315. <script>
  316. import {
  317. detail,
  318. submit,
  319. pleaseCheck,
  320. repealCancel,
  321. tradingBoxItem,
  322. tradingBoxFees,
  323. submitItemList,
  324. submitFeeList,
  325. enable,
  326. copyAgent,
  327. pleaseVerifyCost
  328. } from "@/api/boxManagement/buyContainer/index.js";
  329. import dicSelect from "@/components/dicSelect/main";
  330. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  331. import businessReports from "@/components/tradeAgency/businessReports.vue";
  332. import reports from "@/components/tradeAgency/reports.vue";
  333. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  334. import { getToken } from "@/util/auth";
  335. import _ from "lodash";
  336. import { Header } from "element-ui";
  337. import { fromPairs } from "lodash";
  338. export default {
  339. name: "detailsPage",
  340. data() {
  341. return {
  342. CNYSUM: 0,
  343. USDSUM: 0,
  344. excelBox: false,
  345. excelForm: {},
  346. excelLoading: false,
  347. excelOption: {
  348. submitBtn: false,
  349. emptyBtn: false,
  350. column: [
  351. {
  352. label: "模板下载",
  353. prop: "excelTemplate",
  354. formslot: true,
  355. span: 24
  356. },
  357. {
  358. label: "模板上传",
  359. prop: "excelFile",
  360. type: "upload",
  361. drag: true,
  362. loadText: "模板上传中,请稍等",
  363. span: 24,
  364. propsHttp: {
  365. res: "data"
  366. },
  367. tip: "请上传 .xls,.xlsx 标准格式文件",
  368. action: "/api/blade-los/tradingBoxItem/importBoxItem"
  369. }
  370. ]
  371. },
  372. activationForm: {},
  373. activationOption: {
  374. menuBtn: false,
  375. span: 6,
  376. disabled: false,
  377. column: [
  378. {
  379. label: '放箱号',
  380. prop: 'containerNumber',
  381. span: 24,
  382. rules: [{
  383. required: true,
  384. message: " ",
  385. trigger: "blur"
  386. }],
  387. },
  388. {
  389. label: '起运港',
  390. prop: 'polCname',
  391. span: 24,
  392. rules: [{
  393. required: true,
  394. message: " ",
  395. trigger: "blur"
  396. }],
  397. },
  398. {
  399. label: '起运港场站',
  400. prop: 'polStationCname',
  401. span: 24,
  402. rules: [{
  403. required: true,
  404. message: " ",
  405. trigger: "blur"
  406. }],
  407. },
  408. {
  409. label: '目的港',
  410. prop: 'podCname',
  411. span: 24,
  412. rules: [{
  413. required: true,
  414. message: " ",
  415. trigger: "blur"
  416. }],
  417. },
  418. {
  419. label: '启用日期',
  420. prop: 'activationDate',
  421. span: 24,
  422. type: "date",
  423. format: "yyyy-MM-dd",
  424. valueFormat: "yyyy-MM-dd HH:mm:ss",
  425. rules: [{
  426. required: true,
  427. message: "",
  428. trigger: "blur"
  429. }]
  430. },
  431. ]
  432. },
  433. activationDialog: false,
  434. itemCIds: null,
  435. feeType: null,
  436. selectionList: [],
  437. selectionfeecList: [],
  438. checkId: '', // 审核需要的id
  439. batchNo: '',
  440. checkScheduleDialog: false, // 审核弹窗
  441. editButton: false,
  442. editDisabled: false,
  443. form: {
  444. type: "BUY",
  445. agreement: '到协议场站',
  446. boxCondition: '新',
  447. log: '否',
  448. tradingBoxItemsList: [],
  449. feeCenterList: [],
  450. tradingBoxFilesList: [],
  451. },
  452. oldForm: {},
  453. optionForm: {
  454. menuBtn: false,
  455. span: 6,
  456. disabled: false,
  457. labelWidth: 100,
  458. column: [
  459. {
  460. label: '出售方',
  461. prop: 'purchaseCompanyName',
  462. rules: [{
  463. required: true,
  464. message: " ",
  465. trigger: "blur"
  466. }],
  467. disabled: false
  468. },
  469. {
  470. label: '合同号',
  471. prop: 'contractNo',
  472. rules: [{
  473. required: true,
  474. message: " ",
  475. trigger: "blur"
  476. }],
  477. disabled: false
  478. },
  479. {
  480. label: '购买日期',
  481. prop: 'purchaseDate',
  482. type: "date",
  483. format: "yyyy-MM-dd",
  484. valueFormat: "yyyy-MM-dd HH:mm:ss",
  485. rules: [{
  486. required: true,
  487. message: " ",
  488. trigger: "blur"
  489. }],
  490. disabled: false
  491. },
  492. {
  493. label: '箱型箱量',
  494. prop: 'boxTypeQuantityOne',
  495. disabled: false
  496. },
  497. {
  498. label: '箱型箱量2',
  499. prop: 'boxTypeQuantityTwo',
  500. disabled: false
  501. },
  502. {
  503. label: '提/送箱',
  504. prop: 'agreement',
  505. disabled: false,
  506. type: 'select',
  507. dicUrl: "/api/blade-system/dict-biz/dictionary?code=agreement",
  508. props: {
  509. label: "dictValue",
  510. value: "dictValue"
  511. },
  512. rules: [{
  513. required: true,
  514. message: " ",
  515. trigger: "blur"
  516. }]
  517. },
  518. {
  519. label: '港口',
  520. prop: 'addressCname',
  521. disabled: false,
  522. rules: [{
  523. required: true,
  524. message: " ",
  525. trigger: "blur"
  526. }]
  527. },
  528. {
  529. label: '场站',
  530. prop: 'stationCname',
  531. disabled: false,
  532. },
  533. {
  534. label: '箱况',
  535. prop: 'boxCondition',
  536. disabled: false,
  537. type: 'select',
  538. dicData: [{
  539. label: '新',
  540. value: '新',
  541. }, {
  542. label: '旧',
  543. value: '旧',
  544. }],
  545. rules: [{
  546. required: true,
  547. message: " ",
  548. trigger: "blur"
  549. }]
  550. },
  551. {
  552. label: 'LOGO',
  553. prop: 'log',
  554. disabled: false,
  555. type: 'select',
  556. dicData: [{
  557. label: '是',
  558. value: '是',
  559. }, {
  560. label: '否',
  561. value: '否',
  562. }]
  563. },
  564. {
  565. label: '备注',
  566. prop: 'remarks',
  567. type: 'textarea',
  568. minRows: 2,
  569. span: 6
  570. }]
  571. },
  572. optionForm2: {
  573. menuBtn: false,
  574. span: 5,
  575. disabled: true,
  576. labelWidth: 100,
  577. column: [
  578. {
  579. label: '系统号',
  580. prop: 'sysNo',
  581. disabled: true
  582. },
  583. {
  584. label: '制单人',
  585. prop: "createUserName",
  586. disabled: true,
  587. span: 4,
  588. },
  589. {
  590. label: '制单日期',
  591. prop: "createTime",
  592. disabled: true,
  593. },
  594. {
  595. label: '修改人',
  596. prop: "updateUserName",
  597. disabled: true,
  598. span: 4,
  599. },
  600. {
  601. label: '修改日期',
  602. prop: "updateTime",
  603. disabled: true,
  604. }
  605. ]
  606. },
  607. option: {},
  608. optionBack: {
  609. // height: 'auto',
  610. calcHeight: 30,
  611. menuWidth: 60,
  612. searchMenuSpan: 18,
  613. tip: false,
  614. border: true,
  615. addBtn: false,
  616. viewBtn: false,
  617. editBtn: false,
  618. delBtn: false,
  619. refreshBtn: false,
  620. selection: true,
  621. align: 'center',
  622. menu: false,
  623. column: [
  624. {
  625. label: "index",
  626. prop: "index",
  627. width: "55",
  628. headerslot: true,
  629. },
  630. {
  631. label: "是否启用",
  632. prop: "whetherEnable",
  633. overHidden: true,
  634. },
  635. {
  636. label: '放箱号',
  637. prop: 'containerNumber',
  638. overHidden: true,
  639. width: 100,
  640. },
  641. {
  642. label: '箱号',
  643. prop: 'code',
  644. width: 140,
  645. cell: true,
  646. slot: true,
  647. formslot: true,
  648. overHidden: true,
  649. rules: [{
  650. required: true,
  651. message: "请输入箱号",
  652. trigger: "blur"
  653. }]
  654. },
  655. {
  656. label: '箱型',
  657. prop: 'boxType',
  658. width: 100,
  659. cell: true,
  660. slot: true,
  661. formslot: true,
  662. overHidden: true,
  663. rules: [{
  664. required: true,
  665. message: "请选择箱型",
  666. trigger: "blur"
  667. }]
  668. },
  669. {
  670. label: '箱属',
  671. prop: 'boxBelongsTo',
  672. overHidden: true,
  673. // cell: true,
  674. // width: 100,
  675. // type: 'select',
  676. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxBelongsTo",
  677. // props: {
  678. // label: "dictValue",
  679. // value: "dictValue"
  680. // },
  681. // rules: [{
  682. // required: true,
  683. // message: "请选择箱属",
  684. // trigger: "blur"
  685. // }]
  686. },
  687. {
  688. label: '放箱号类型',
  689. prop: 'boxCategory',
  690. overHidden: true,
  691. cell: true,
  692. width: 100,
  693. type: 'select',
  694. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  695. props: {
  696. label: "dictValue",
  697. value: "dictValue"
  698. },
  699. rules: [{
  700. required: true,
  701. message: "请选择放箱号类型",
  702. trigger: "blur"
  703. }]
  704. },
  705. {
  706. label: '箱况',
  707. prop: 'boxCondition',
  708. overHidden: true,
  709. cell: true,
  710. width: 100,
  711. type: 'select',
  712. dicData: [{
  713. label: '新',
  714. value: '新',
  715. }, {
  716. label: '旧',
  717. value: '旧',
  718. }],
  719. rules: [{
  720. required: true,
  721. message: "请选择箱况",
  722. trigger: "blur"
  723. }]
  724. },
  725. {
  726. label: '箱状态',
  727. prop: 'status',
  728. width: 100,
  729. overHidden: true,
  730. },
  731. {
  732. label: '箱好坏',
  733. prop: 'boxStatus',
  734. width: 100,
  735. overHidden: true,
  736. },
  737. {
  738. label: '箱动态',
  739. prop: 'boxDynamics',
  740. width: 100,
  741. overHidden: true,
  742. },
  743. {
  744. label: '金额',
  745. prop: 'amount',
  746. cell: true,
  747. type: 'number',
  748. controls: false,
  749. overHidden: true,
  750. width: 100,
  751. rules: [{
  752. required: true,
  753. message: "请输入金额",
  754. trigger: "blur"
  755. }]
  756. },
  757. {
  758. label: '币别',
  759. prop: 'currency',
  760. width: 100,
  761. cell: true,
  762. slot: true,
  763. formslot: true,
  764. overHidden: true,
  765. rules: [{
  766. required: true,
  767. message: "请选择币别",
  768. trigger: "blur"
  769. }]
  770. },
  771. {
  772. label: '汇率',
  773. prop: 'exrate',
  774. cell: true,
  775. type: 'number',
  776. controls: false,
  777. overHidden: true,
  778. width: 100,
  779. rules: [{
  780. required: true,
  781. message: "请输入汇率",
  782. trigger: "blur"
  783. }]
  784. },
  785. {
  786. label: '箱东',
  787. prop: 'boxEastName',
  788. overHidden: true,
  789. width: 100,
  790. },
  791. {
  792. label: '原箱东',
  793. prop: 'originalBoxEastName',
  794. cell: true,
  795. slot: true,
  796. formslot: true,
  797. overHidden: true,
  798. width: 100,
  799. },
  800. {
  801. label: '场站',
  802. prop: 'stationCname',
  803. cell: true,
  804. slot: true,
  805. formslot: true,
  806. overHidden: true,
  807. width: 100,
  808. },
  809. {
  810. label: '限制港口',
  811. prop: 'restrictedPortsName',
  812. cell: true,
  813. slot: true,
  814. formslot: true,
  815. overHidden: true,
  816. width: 200,
  817. },
  818. {
  819. label: '限制船公司',
  820. prop: 'restrictingShippingCompaniesName',
  821. cell: true,
  822. slot: true,
  823. formslot: true,
  824. overHidden: true,
  825. width: 200,
  826. },
  827. {
  828. label: '启用日期',
  829. prop: 'activationDate',
  830. // cell: true,
  831. overHidden: true,
  832. type: "date",
  833. format: "yyyy-MM-dd",
  834. valueFormat: "yyyy-MM-dd HH:mm:ss",
  835. },
  836. {
  837. label: "制单人",
  838. prop: "createUserName",
  839. overHidden: true,
  840. },
  841. {
  842. label: "制单日期",
  843. prop: "createTime",
  844. type: "date",
  845. overHidden: true,
  846. width: 120,
  847. format: "yyyy-MM-dd",
  848. valueFormat: "yyyy-MM-dd HH:mm:ss"
  849. },
  850. {
  851. label: "修改人",
  852. prop: "updateUserName",
  853. overHidden: true,
  854. },
  855. {
  856. label: "修改日期",
  857. prop: "updateTime",
  858. type: "date",
  859. overHidden: true,
  860. width: 120,
  861. format: "yyyy-MM-dd",
  862. valueFormat: "yyyy-MM-dd HH:mm:ss"
  863. },
  864. {
  865. label: '备注',
  866. prop: 'remarks',
  867. cell: true,
  868. width: 150,
  869. overHidden: true,
  870. }]
  871. },
  872. feecOption: {},
  873. feecOptionBack: {
  874. // height: 'auto',
  875. calcHeight: 30,
  876. menuWidth: 60,
  877. tip: false,
  878. border: true,
  879. addBtn: false,
  880. viewBtn: false,
  881. editBtn: false,
  882. delBtn: false,
  883. refreshBtn: false,
  884. selection: true,
  885. align: 'center',
  886. menu: false,
  887. summaryText: "合计",
  888. showSummary: true,
  889. sumColumnList: [
  890. {
  891. name: 'amount',
  892. type: 'sum',
  893. decimals: 2
  894. },
  895. {
  896. name: 'amountLoc',
  897. type: 'sum',
  898. decimals: 2
  899. },
  900. {
  901. name: 'appliedInvoiceAmount',
  902. type: 'sum',
  903. decimals: 2
  904. },
  905. {
  906. name: 'uninvoicedAmount',
  907. type: 'sum',
  908. decimals: 2
  909. },
  910. {
  911. name: 'stlTtlAmount',
  912. type: 'sum',
  913. decimals: 2
  914. }
  915. ],
  916. column: [
  917. {
  918. label: "index",
  919. prop: "index",
  920. width: "55",
  921. headerslot: true,
  922. },
  923. {
  924. label: '账单状态',
  925. prop: 'accStatus',
  926. overHidden: true,
  927. width: 80,
  928. type: 'select',
  929. dicData: [{
  930. label: '未生成',
  931. value: 0,
  932. }, {
  933. label: '已生成',
  934. value: 1,
  935. }],
  936. },
  937. {
  938. label: '审核状态',
  939. prop: 'auditStatus',
  940. overHidden: true,
  941. width: 80,
  942. type: 'select',
  943. dicData: [{
  944. label: '录入',
  945. value: '0',
  946. }, {
  947. label: '提交审核',
  948. value: '1',
  949. }, {
  950. label: '审核中',
  951. value: '2',
  952. }, {
  953. label: '审核通过',
  954. value: '4',
  955. }],
  956. },
  957. {
  958. label: "类别",
  959. prop: "billType",
  960. width: 100,
  961. overHidden: true,
  962. cell: true,
  963. slot: true,
  964. formslot: true,
  965. rules: [
  966. {
  967. required: true,
  968. message: '请选择类别',
  969. trigger: 'blur'
  970. }
  971. ]
  972. },
  973. {
  974. label: "付费对象",
  975. prop: "corpCnName",
  976. width: "100",
  977. overHidden: true,
  978. cell: true,
  979. slot: true,
  980. formslot: true,
  981. rules: [
  982. {
  983. required: true,
  984. message: '请选择付费对象',
  985. trigger: 'blur'
  986. }
  987. ]
  988. },
  989. {
  990. label: "箱号",
  991. prop: "cntrNo",
  992. width: "100",
  993. cell: true,
  994. slot: true,
  995. formslot: true,
  996. overHidden: true,
  997. },
  998. {
  999. label: "费用名称",
  1000. prop: "feeCnName",
  1001. width: "100",
  1002. overHidden: true,
  1003. cell: true,
  1004. slot: true,
  1005. formslot: true,
  1006. rules: [
  1007. {
  1008. required: true,
  1009. message: '请选择费用名称',
  1010. trigger: 'blur'
  1011. }
  1012. ]
  1013. },
  1014. {
  1015. label: "计量单位",
  1016. prop: "unitNo",
  1017. width: "100",
  1018. overHidden: true,
  1019. cell: true,
  1020. slot: true,
  1021. formslot: true,
  1022. },
  1023. {
  1024. label: "币别",
  1025. prop: "curCode",
  1026. width: "100",
  1027. overHidden: true,
  1028. cell: true,
  1029. slot: true,
  1030. formslot: true,
  1031. rules: [
  1032. {
  1033. required: true,
  1034. message: '请选择币别',
  1035. trigger: 'blur'
  1036. }
  1037. ]
  1038. },
  1039. {
  1040. label: "汇率",
  1041. prop: "exrate",
  1042. width: "100",
  1043. overHidden: true,
  1044. cell: true,
  1045. slot: true,
  1046. formslot: true
  1047. },
  1048. {
  1049. label: "单价",
  1050. prop: "price",
  1051. width: "100",
  1052. overHidden: true,
  1053. cell: true,
  1054. slot: true,
  1055. formslot: true,
  1056. rules: [
  1057. {
  1058. required: true,
  1059. message: '请输入单价',
  1060. trigger: 'blur'
  1061. }
  1062. ]
  1063. },
  1064. {
  1065. label: "数量",
  1066. prop: "quantity",
  1067. width: "100",
  1068. overHidden: true,
  1069. cell: true,
  1070. slot: true,
  1071. formslot: true,
  1072. rules: [
  1073. {
  1074. required: true,
  1075. message: '请输入数量',
  1076. trigger: 'blur'
  1077. }
  1078. ]
  1079. },
  1080. {
  1081. label: "金额",
  1082. prop: "amount",
  1083. width: "100",
  1084. overHidden: true,
  1085. },
  1086. {
  1087. label: "外币金额",
  1088. prop: "amountLoc",
  1089. width: "100",
  1090. overHidden: true,
  1091. },
  1092. {
  1093. label: "申请发票金额",
  1094. prop: "appliedInvoiceAmount",
  1095. width: "120",
  1096. overHidden: true,
  1097. },
  1098. {
  1099. label: "已开票金额",
  1100. prop: "uninvoicedAmount",
  1101. width: "120",
  1102. overHidden: true,
  1103. },
  1104. {
  1105. label: "已结算金额",
  1106. prop: "stlTtlAmount",
  1107. width: "120",
  1108. overHidden: true,
  1109. },
  1110. {
  1111. label: "制单人",
  1112. prop: "createUserName",
  1113. width: "100",
  1114. overHidden: true
  1115. },
  1116. {
  1117. label: "制单日期",
  1118. prop: "createTime",
  1119. width: "120",
  1120. overHidden: true
  1121. },
  1122. {
  1123. label: "修改人",
  1124. prop: "updateUserName",
  1125. width: "100",
  1126. overHidden: true
  1127. },
  1128. {
  1129. label: "修改日期",
  1130. prop: "updateTime",
  1131. width: "120",
  1132. overHidden: true
  1133. },
  1134. {
  1135. label: "备注",
  1136. prop: "remarks",
  1137. cell: true,
  1138. overHidden: true
  1139. }
  1140. ]
  1141. },
  1142. roleName: [],
  1143. updateSearchKey: new Date().getTime(),
  1144. updateFormKey: new Date().getTime(),
  1145. updateStationKey: new Date().getTime(),
  1146. }
  1147. },
  1148. components: {
  1149. dicSelect,
  1150. checkSchedule,
  1151. businessReports,
  1152. reports
  1153. },
  1154. props: {
  1155. detailData: Object
  1156. },
  1157. async created() {
  1158. this.roleName = localStorage.getItem('roleName').split(',')
  1159. this.option = await this.getColumnData(this.getColumnName(235.1), this.optionBack);
  1160. this.feecOption = await this.getColumnData(this.getColumnName(235.2), this.feecOptionBack);
  1161. if (this.detailData.id) {
  1162. // this.editButton = true
  1163. // this.editDisabled = true
  1164. // this.optionForm.disabled = true
  1165. this.getDetail(this.detailData.id)
  1166. }
  1167. if (this.detailData.copyId) {
  1168. this.getCopydate(this.detailData.copyId)
  1169. }
  1170. },
  1171. methods: {
  1172. countChange(row) {
  1173. if (row.curCode == 'CNY') {
  1174. row.amount = _.round(_.multiply(row.price, row.quantity), 2)
  1175. row.amountLoc = 0
  1176. } else {
  1177. row.amount = 0
  1178. row.amountLoc = _.round(_.multiply(row.price, row.quantity), 2)
  1179. }
  1180. },
  1181. activationSubmit() {
  1182. this.$refs["form2"].validate((valid, done) => {
  1183. done();
  1184. if (valid) {
  1185. let obj = {
  1186. id: this.form.id,
  1187. ...this.activationForm,
  1188. tradingBoxItemsList: this.selectionList
  1189. }
  1190. const loading = this.$loading({
  1191. lock: true,
  1192. text: '加载中',
  1193. spinner: 'el-icon-loading',
  1194. background: 'rgba(255,255,255,0.7)'
  1195. });
  1196. enable(obj).then(res => {
  1197. this.$message.success("操作成功!");
  1198. this.getDetail(this.form.id)
  1199. this.activationDialog = false
  1200. }).finally(() => {
  1201. loading.close();
  1202. })
  1203. } else {
  1204. return false;
  1205. }
  1206. });
  1207. },
  1208. uploadBefore(file, done, loading) {
  1209. done();
  1210. loading = true;
  1211. },
  1212. // 上传成功
  1213. onSuccess(res, done, loading, column) {
  1214. if (res.length > 0) {
  1215. this.$message.success("上传成功!");
  1216. }
  1217. this.excelBox = false;
  1218. // this.$message.success("导入成功!");
  1219. this.getDetail(this.form.id)
  1220. loading = false;
  1221. done();
  1222. },
  1223. // 下载模板
  1224. handleGet() {
  1225. window.open(
  1226. `/api/blade-los/tradingBoxItem/boxItemTemplate?${this.website.tokenHeader
  1227. }=${getToken()}`
  1228. );
  1229. },
  1230. dicChange(name, row) {
  1231. if (name == 'purchaseCompanyName') {
  1232. if (row) {
  1233. this.form.purchaseCompanyId = row.id
  1234. } else {
  1235. this.form.purchaseCompanyId = null
  1236. this.form.purchaseCompanyName = null
  1237. }
  1238. }
  1239. if (name == 'addressCname') {
  1240. if (row) {
  1241. this.form.addressId = row.id
  1242. this.form.addressCode = row.code
  1243. this.form.addressEname = row.enName
  1244. this.form.cyText = row.addressId
  1245. this.form.stationId = null
  1246. this.form.stationCode = null
  1247. this.form.stationCname = null
  1248. this.form.stationEname = null
  1249. this.updateFormKey = new Date().getTime()
  1250. } else {
  1251. this.form.addressId = null
  1252. this.form.addressCode = null
  1253. this.form.addressEname = null
  1254. this.form.addressCname = null
  1255. this.form.cyText = null
  1256. this.form.stationId = null
  1257. this.form.stationCode = null
  1258. this.form.stationCname = null
  1259. this.form.stationEname = null
  1260. }
  1261. }
  1262. if (name == 'stationCname') {
  1263. if (row) {
  1264. this.form.stationId = row.id
  1265. this.form.stationCode = row.code
  1266. this.form.stationEname = row.enName
  1267. } else {
  1268. this.form.stationId = null
  1269. this.form.stationCode = null
  1270. this.form.stationCname = null
  1271. this.form.stationEname = null
  1272. }
  1273. }
  1274. // if (name == 'podCname') {
  1275. // if (row) {
  1276. // this.form.podId = row.id
  1277. // this.form.podCode = row.code
  1278. // this.form.podEname = row.enName
  1279. // } else {
  1280. // this.form.podId = null
  1281. // this.form.podCode = null
  1282. // this.form.podEname = null
  1283. // this.form.podCname = null
  1284. // }
  1285. // }
  1286. if (name == 'polCname') {
  1287. if (row) {
  1288. this.activationForm.polId = row.id
  1289. this.activationForm.polCode = row.code
  1290. this.activationForm.polEname = row.enName
  1291. this.form.cyTextOne = row.addressId
  1292. this.activationForm.polStationId = null
  1293. this.activationForm.polStationCode = null
  1294. this.activationForm.polStationCname = null
  1295. this.activationForm.polStationEname = null
  1296. this.updateStationKey = new Date().getTime()
  1297. } else {
  1298. this.activationForm.polId = null
  1299. this.activationForm.polCode = null
  1300. this.activationForm.polEname = null
  1301. this.activationForm.polCname = null
  1302. this.form.cyTextOne = null
  1303. this.activationForm.polStationId = null
  1304. this.activationForm.polStationCode = null
  1305. this.activationForm.polStationCname = null
  1306. this.activationForm.polStationEname = null
  1307. }
  1308. }
  1309. if (name == 'polStationCname') {
  1310. if (row) {
  1311. this.activationForm.polStationId = row.id
  1312. this.activationForm.polStationCode = row.code
  1313. this.activationForm.polStationEname = row.enName
  1314. } else {
  1315. this.activationForm.polStationId = null
  1316. this.activationForm.polStationCode = null
  1317. this.activationForm.polStationCname = null
  1318. this.activationForm.polStationEname = null
  1319. }
  1320. }
  1321. if (name == 'podCname') {
  1322. if (row) {
  1323. this.activationForm.podId = row.id
  1324. this.activationForm.podCode = row.code
  1325. this.activationForm.podEname = row.enName
  1326. } else {
  1327. this.activationForm.podId = null
  1328. this.activationForm.podCode = null
  1329. this.activationForm.podEname = null
  1330. this.activationForm.podCname = null
  1331. }
  1332. }
  1333. },
  1334. rowDicChange(name, row, el, index) {
  1335. if (name == 'currency') {
  1336. if (row) {
  1337. bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
  1338. res.data.data.forEach(e => {
  1339. if (el.currency == e.code) {
  1340. this.$set(el, 'exrate', e.exrate)
  1341. }
  1342. })
  1343. })
  1344. } else {
  1345. el.exrate = null
  1346. }
  1347. }
  1348. if (name == 'curCode') {
  1349. if (row) {
  1350. bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
  1351. res.data.data.forEach(e => {
  1352. if (el.curCode == e.code) {
  1353. this.$set(el, 'exrate', e.exrate)
  1354. this.countChange(el)
  1355. }
  1356. })
  1357. })
  1358. } else {
  1359. el.exrate = null
  1360. }
  1361. }
  1362. if (name == 'feeCnName') {
  1363. if (row) {
  1364. el.feeId = row.id
  1365. el.feeCode = row.code
  1366. } else {
  1367. el.feeId = null
  1368. el.feeCode = null
  1369. el.feeCnName = null
  1370. }
  1371. }
  1372. if (name == 'boxType') {
  1373. if (row) {
  1374. el.boxTypeId = row.id
  1375. } else {
  1376. el.boxTypeId = null
  1377. el.boxType = null
  1378. }
  1379. }
  1380. if (name == 'stationCname') {
  1381. if (row) {
  1382. el.stationId = row.id
  1383. el.stationCode = row.code
  1384. el.stationEname = row.enName
  1385. } else {
  1386. el.stationId = null
  1387. el.stationCode = null
  1388. el.stationCname = null
  1389. el.stationEname = null
  1390. }
  1391. }
  1392. if (name == 'billType') {
  1393. el.corpId = null
  1394. el.shortName = null
  1395. el.corpCnName = null
  1396. el.corpEnName = null
  1397. this.updateSearchKey = new Date().getTime()
  1398. }
  1399. if (name == 'corpCnName') {
  1400. if (row) {
  1401. el.corpId = row.id
  1402. el.shortName = row.shortName
  1403. el.corpEnName = row.enName
  1404. } else {
  1405. el.corpId = null
  1406. el.shortName = null
  1407. el.corpCnName = null
  1408. el.corpEnName = null
  1409. }
  1410. }
  1411. if (name == 'restrictedPortsName') {
  1412. if (row) {
  1413. el.restrictedPortsIds = row.ids
  1414. el.restrictedPortsName = row.names
  1415. } else {
  1416. el.restrictedPortsIds = null
  1417. el.restrictedPortsName = null
  1418. }
  1419. }
  1420. if (name == 'restrictingShippingCompaniesName') {
  1421. if (row) {
  1422. el.restrictingShippingCompaniesIds = row.ids
  1423. el.restrictingShippingCompaniesName = row.names
  1424. } else {
  1425. el.restrictingShippingCompaniesIds = null
  1426. el.restrictingShippingCompaniesName = null
  1427. }
  1428. }
  1429. if (name == 'originalBoxEastName') {
  1430. if (row) {
  1431. el.originalBoxEastId = row.id
  1432. } else {
  1433. el.originalBoxEastId = null
  1434. el.originalBoxEastName = null
  1435. }
  1436. }
  1437. },
  1438. rowEdit(row) {
  1439. },
  1440. addRow() {
  1441. if (!this.form.id) {
  1442. return this.$message.error("请保存数据");
  1443. }
  1444. this.$refs.crud.dicInit();
  1445. bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
  1446. res.data.data.forEach(e => {
  1447. if (e.code == 'USD') {
  1448. this.form.tradingBoxItemsList.push({
  1449. pid: this.form.id,
  1450. boxBelongsTo: 'SOC',
  1451. boxCategory: '自有箱',
  1452. boxStatus: '好',
  1453. boxCondition: this.form.boxCondition,
  1454. stationId: this.form.stationId,
  1455. stationCode: this.form.stationCode,
  1456. stationCname: this.form.stationCname,
  1457. stationEname: this.form.stationEname,
  1458. currency: 'USD',
  1459. exrate: e.exrate,
  1460. status: '空箱入场',
  1461. $cellEdit: true
  1462. })
  1463. }
  1464. })
  1465. })
  1466. },
  1467. feecAddRow() {
  1468. if (!this.form.id) {
  1469. return this.$message.error("请保存数据");
  1470. }
  1471. this.form.feeCenterList.push({
  1472. pid: this.form.id,
  1473. feesType: 1,
  1474. dc: 'C',
  1475. billType: '箱东',
  1476. corpId: this.form.purchaseCompanyId,
  1477. shortName: this.form.purchaseCompanyName,
  1478. corpCnName: this.form.purchaseCompanyName,
  1479. curCode: 'CNY',
  1480. exrate: 1,
  1481. $cellEdit: true
  1482. })
  1483. },
  1484. selectionChange(list) {
  1485. this.selectionList = list;
  1486. },
  1487. feecChange(list) {
  1488. let ids = []
  1489. list.forEach(e => {
  1490. ids.push(e.id)
  1491. })
  1492. if (ids.length) {
  1493. this.itemCIds = ids.join(',')
  1494. } else {
  1495. this.itemCIds = null
  1496. }
  1497. this.selectionfeecList = list;
  1498. },
  1499. getDetail(id) {
  1500. console.log(1111111111111, id)
  1501. const loading = this.$loading({
  1502. lock: true,
  1503. text: '加载中',
  1504. spinner: 'el-icon-loading',
  1505. background: 'rgba(255,255,255,0.7)'
  1506. });
  1507. detail({ id: id }).then(res => {
  1508. this.form = res.data.data
  1509. this.updateFormKey = new Date().getTime()
  1510. }).finally(() => {
  1511. loading.close()
  1512. })
  1513. },
  1514. getCopydate(id) {
  1515. const loading = this.$loading({
  1516. lock: true,
  1517. text: '加载中',
  1518. spinner: 'el-icon-loading',
  1519. background: 'rgba(255,255,255,0.7)'
  1520. });
  1521. copyAgent({ id: id }).then(res => {
  1522. this.form = res.data.data
  1523. this.updateFormKey = new Date().getTime()
  1524. }).finally(() => {
  1525. loading.close()
  1526. })
  1527. },
  1528. inEdit() {
  1529. this.editButton = false
  1530. if (this.form.status == '录入') {
  1531. this.editDisabled = false
  1532. this.optionForm.disabled = false
  1533. }
  1534. },
  1535. rowDel(row, index) {
  1536. this.$confirm("确定删除数据?", {
  1537. confirmButtonText: "确定",
  1538. cancelButtonText: "取消",
  1539. type: "warning"
  1540. }).then(() => {
  1541. if (row.id) {
  1542. tradingBoxItem({ ids: row.id }).then(res => {
  1543. this.form.tradingBoxItemsList.splice(index, 1);
  1544. this.$message.success("成功删除");
  1545. })
  1546. } else {
  1547. this.form.tradingBoxItemsList.splice(index, 1);
  1548. }
  1549. });
  1550. },
  1551. polRowDel(row, index) {
  1552. this.$confirm("确定删除数据?", {
  1553. confirmButtonText: "确定",
  1554. cancelButtonText: "取消",
  1555. type: "warning"
  1556. }).then(() => {
  1557. if (row.id) {
  1558. tradingBoxFees({ ids: row.id }).then(res => {
  1559. this.form.feeCenterList.splice(index, 1);
  1560. this.$message.success("成功删除");
  1561. })
  1562. } else {
  1563. this.form.feeCenterList.splice(index, 1);
  1564. }
  1565. });
  1566. },
  1567. podRowDel(row, index) {
  1568. this.$confirm("确定删除数据?", {
  1569. confirmButtonText: "确定",
  1570. cancelButtonText: "取消",
  1571. type: "warning"
  1572. }).then(() => {
  1573. if (row.id) {
  1574. tradingBoxFees({ ids: row.id }).then(res => {
  1575. this.podFeeList.splice(index, 1);
  1576. this.$message.success("成功删除");
  1577. })
  1578. } else {
  1579. this.podFeeList.splice(index, 1);
  1580. }
  1581. });
  1582. },
  1583. allClick(name) {
  1584. if (name == '一键保存') {
  1585. if (!this.form.tradingBoxItemsList.length) {
  1586. return this.$message.error("请添加数据");
  1587. }
  1588. for (let row of this.form.tradingBoxItemsList) {
  1589. if (!row.code || !row.boxType || !row.boxCategory || !row.boxStatus || !row.boxCondition || !row.amount || !row.currency || !row.exrate || !row.status) {
  1590. this.$refs.crud.rowCell(row, row.$index)
  1591. return this.$message.error("请完善箱明细信息");
  1592. }
  1593. }
  1594. const loading = this.$loading({
  1595. lock: true,
  1596. text: '加载中',
  1597. spinner: 'el-icon-loading',
  1598. background: 'rgba(255,255,255,0.7)'
  1599. });
  1600. submitItemList(this.form.tradingBoxItemsList).then(res => {
  1601. this.$message.success("保存成功");
  1602. this.form.tradingBoxItemsList = res.data.data
  1603. }).finally(() => {
  1604. loading.close();
  1605. })
  1606. }
  1607. if (name == '一键编辑') {
  1608. for (let row of this.form.tradingBoxItemsList) {
  1609. if (row.whetherEnable != '是') {
  1610. this.$set(row, "$cellEdit", true);
  1611. }
  1612. }
  1613. this.$refs.crud.dicInit();
  1614. }
  1615. if (name == '批量删除') {
  1616. for (let item of this.selectionList) {
  1617. if (item.whetherEnable == '是') {
  1618. return this.$message.error("启用状态不能删除!");
  1619. }
  1620. }
  1621. let multiList = []
  1622. let arr = []
  1623. this.$confirm("确定将选择数据删除?", {
  1624. confirmButtonText: "确定",
  1625. cancelButtonText: "取消",
  1626. type: "warning"
  1627. }).then(() => {
  1628. multiList = this.selectionList
  1629. arr = this.form.tradingBoxItemsList
  1630. // 获取有id 的数据
  1631. const itemsWithId = multiList.filter(item => item.id != null);
  1632. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1633. // 把选中的删除掉
  1634. multiList.forEach((item) => {
  1635. for (let index in arr) {
  1636. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1637. arr.splice(Number(index), 1)
  1638. }
  1639. }
  1640. })
  1641. if (itemsWithId.length != 0) {
  1642. const loading = this.$loading({
  1643. lock: true,
  1644. text: '加载中',
  1645. spinner: 'el-icon-loading',
  1646. background: 'rgba(255,255,255,0.7)'
  1647. });
  1648. tradingBoxItem({ ids: arrIds.join(',') }).then(res => {
  1649. this.$message.success("删除成功");
  1650. }).finally(() => {
  1651. loading.close();
  1652. })
  1653. }
  1654. })
  1655. }
  1656. if (name == '导入') {
  1657. this.excelOption.column.forEach(item => {
  1658. if (item.prop == 'excelFile') {
  1659. item.action = "/api/blade-los/tradingBoxItem/importBoxItem?id=" + this.form.id
  1660. }
  1661. })
  1662. this.excelBox = true
  1663. }
  1664. if (name == '启用') {
  1665. for (let item of this.selectionList) {
  1666. if (item.whetherEnable == '是') {
  1667. return this.$message.error("请勿重复启用");
  1668. }
  1669. }
  1670. this.form.cyTextOne = this.form.cyText
  1671. this.activationForm = {
  1672. containerNumber: null,
  1673. polId: this.form.addressId,
  1674. polCode: this.form.addressCode,
  1675. polEname: this.form.addressEname,
  1676. polCname: this.form.addressCname,
  1677. polStationId: this.form.stationId,
  1678. polStationCode: this.form.stationCode,
  1679. polStationCname: this.form.stationCname,
  1680. polStationEname: this.form.stationEname,
  1681. podId: null,
  1682. podCode: null,
  1683. podEname: null,
  1684. podCname: null,
  1685. activationDate: null,
  1686. }
  1687. this.activationDialog = true
  1688. }
  1689. if (name == '费用一键保存') {
  1690. if (!this.form.feeCenterList.length) {
  1691. return this.$message.error("请添加数据");
  1692. }
  1693. for (let row of this.form.feeCenterList) {
  1694. if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
  1695. this.$refs.crud2.rowCell(row, row.$index)
  1696. return this.$message.error("请完善费用明细");
  1697. }
  1698. }
  1699. const loading = this.$loading({
  1700. lock: true,
  1701. text: '加载中',
  1702. spinner: 'el-icon-loading',
  1703. background: 'rgba(255,255,255,0.7)'
  1704. });
  1705. submitFeeList(this.form.feeCenterList).then(res => {
  1706. this.$message.success("保存成功");
  1707. this.form.feeCenterList = res.data.data
  1708. }).finally(() => {
  1709. loading.close();
  1710. })
  1711. }
  1712. if (name == '费用一键编辑') {
  1713. for (let row of this.form.feeCenterList) {
  1714. if (!row.stlPid && (row.accStatus == 0||row.auditStatus== 0)) {
  1715. this.$set(row, "$cellEdit", true);
  1716. }
  1717. }
  1718. }
  1719. if (name == '费用批量删除') {
  1720. for (let row of this.selectionfeecList) {
  1721. if (row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ') {
  1722. return this.$message.error("押金和租箱费不允许删除");
  1723. }
  1724. if (row.stlPid && row.accStatus != 0) {
  1725. return this.$message.error("已生成账单,不允许删除");
  1726. }
  1727. if (row.stlPid && row.auditStatus != 0) {
  1728. return this.$message.error("已申请费用,不允许删除");
  1729. }
  1730. }
  1731. let multiList = []
  1732. let arr = []
  1733. this.$confirm("确定将选择数据删除?", {
  1734. confirmButtonText: "确定",
  1735. cancelButtonText: "取消",
  1736. type: "warning"
  1737. }).then(() => {
  1738. multiList = this.selectionfeecList
  1739. arr = this.form.feeCenterList
  1740. // 获取有id 的数据
  1741. const itemsWithId = multiList.filter(item => item.id != null);
  1742. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  1743. // 把选中的删除掉
  1744. multiList.forEach((item) => {
  1745. for (let index in arr) {
  1746. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  1747. arr.splice(Number(index), 1)
  1748. }
  1749. }
  1750. })
  1751. if (itemsWithId.length != 0) {
  1752. const loading = this.$loading({
  1753. lock: true,
  1754. text: '加载中',
  1755. spinner: 'el-icon-loading',
  1756. background: 'rgba(255,255,255,0.7)'
  1757. });
  1758. tradingBoxFees({ ids: arrIds.join(',') }).then(res => {
  1759. this.$message.success("删除成功");
  1760. }).finally(() => {
  1761. loading.close();
  1762. })
  1763. }
  1764. })
  1765. }
  1766. if (name == '费用申请') {
  1767. for (let row of this.selectionfeecList) {
  1768. if (row.stlPid && row.accStatus != 0) {
  1769. return this.$message.error("已生成账单,不允许重复申请");
  1770. }
  1771. if (row.stlPid && row.auditStatus != 0) {
  1772. return this.$message.error("已申请费用,不允许重复申请");
  1773. }
  1774. }
  1775. this.$confirm("确定申请费用?", {
  1776. confirmButtonText: "确定",
  1777. cancelButtonText: "取消",
  1778. type: "warning"
  1779. }).then(() => {
  1780. let obj = {}
  1781. obj = {
  1782. srcId: this.form.id,
  1783. srcType: this.form.type,
  1784. feeCenterList: this.selectionfeecList,
  1785. url: '/boxManagement/buyContainer/index',
  1786. pageStatus: '',
  1787. pageLabel: '买箱',
  1788. }
  1789. const loading = this.$loading({
  1790. lock: true,
  1791. text: '加载中',
  1792. spinner: 'el-icon-loading',
  1793. background: 'rgba(255,255,255,0.7)'
  1794. });
  1795. pleaseVerifyCost(obj).then(res => {
  1796. this.$message.success("操作成功");
  1797. this.getDetail(this.form.id)
  1798. }).finally(() => {
  1799. loading.close();
  1800. })
  1801. });
  1802. }
  1803. },
  1804. submit(type) {
  1805. this.$refs["form"].validate((valid, done) => {
  1806. done();
  1807. if (valid) {
  1808. for (let row of this.form.tradingBoxItemsList) {
  1809. if (!row.code || !row.boxType || !row.boxCategory || !row.boxStatus || !row.boxCondition || !row.amount || !row.currency || !row.exrate || !row.status) {
  1810. this.$refs.crud.rowCell(row, row.$index)
  1811. return this.$message.error("请完善箱明细信息");
  1812. }
  1813. }
  1814. for (let row of this.form.feeCenterList) {
  1815. if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
  1816. this.$refs.crud2.rowCell(row, row.$index)
  1817. return this.$message.error("请完善费用明细");
  1818. }
  1819. }
  1820. const loading = this.$loading({
  1821. lock: true,
  1822. text: '加载中',
  1823. spinner: 'el-icon-loading',
  1824. background: 'rgba(255,255,255,0.7)'
  1825. });
  1826. submit(this.form).then(res => {
  1827. this.$message.success("保存成功");
  1828. this.getDetail(res.data.data.id)
  1829. }).finally(() => {
  1830. loading.close();
  1831. })
  1832. } else {
  1833. return false;
  1834. }
  1835. });
  1836. },
  1837. application() {
  1838. this.$confirm("确定请核数据?", {
  1839. confirmButtonText: "确定",
  1840. cancelButtonText: "取消",
  1841. type: "warning"
  1842. }).then(() => {
  1843. let obj = {}
  1844. obj = {
  1845. id: this.form.id,
  1846. url: '/iosBasicData/costcenter/coc/index',
  1847. pageStatus: '',
  1848. pageLabel: '航线成本(COC)',
  1849. }
  1850. const loading = this.$loading({
  1851. lock: true,
  1852. text: '加载中',
  1853. spinner: 'el-icon-loading',
  1854. background: 'rgba(255,255,255,0.7)'
  1855. });
  1856. pleaseCheck(obj).then(res => {
  1857. this.$message.success("请核成功");
  1858. this.getDetail(res.data.data.id)
  1859. }).finally(() => {
  1860. loading.close();
  1861. })
  1862. });
  1863. },
  1864. revokeApplication() {
  1865. this.$confirm("确定撤销请核?", {
  1866. confirmButtonText: "确定",
  1867. cancelButtonText: "取消",
  1868. type: "warning"
  1869. }).then(() => {
  1870. let obj = {}
  1871. obj = {
  1872. id: this.form.id,
  1873. }
  1874. const loading = this.$loading({
  1875. lock: true,
  1876. text: '加载中',
  1877. spinner: 'el-icon-loading',
  1878. background: 'rgba(255,255,255,0.7)'
  1879. });
  1880. repealCancel(obj).then(res => {
  1881. this.$message.success("撤销请核成功");
  1882. this.getDetail(res.data.data.id)
  1883. this.editDisabled = false
  1884. this.optionForm.disabled = false
  1885. }).finally(() => {
  1886. loading.close();
  1887. })
  1888. });
  1889. },
  1890. //请核关闭
  1891. choceScheduleFun() {
  1892. this.checkScheduleDialog = false
  1893. },
  1894. //自定义列保存
  1895. async saveColumn(ref, option, optionBack, code) {
  1896. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1897. if (inSave) {
  1898. this.$message.success("保存成功");
  1899. //关闭窗口
  1900. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1901. }
  1902. },
  1903. //自定义列重置
  1904. async resetColumn(ref, option, optionBack, code) {
  1905. this[option] = this[optionBack];
  1906. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1907. if (inSave) {
  1908. this.$message.success("重置成功");
  1909. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1910. }
  1911. },
  1912. // 更改表格颜色
  1913. headerClassName(tab) {
  1914. //颜色间隔
  1915. let back = ""
  1916. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1917. if (tab.columnIndex % 2 === 0) {
  1918. back = "back-one"
  1919. } else if (tab.columnIndex % 2 === 1) {
  1920. back = "back-two"
  1921. }
  1922. }
  1923. return back;
  1924. },
  1925. goBack(type) {
  1926. this.$emit("goBack");
  1927. },
  1928. },
  1929. watch: {
  1930. // 监听业务类型 如果不是分单 可以编辑分单号
  1931. 'form.tradingBoxItemsList': {
  1932. // 执行方法
  1933. handler(oldValue, newValue) {
  1934. if (this.form.tradingBoxItemsList.length > 0) {
  1935. this.optionForm.column.forEach(item => {
  1936. if (item.prop == 'contractNo' || item.prop == 'purchaseDate' || item.prop == 'boxTypeQuantityOne' || item.prop == 'boxTypeQuantityTwo' || item.prop == 'agreement' || item.prop == 'boxCondition' || item.prop == 'log') {
  1937. item.disabled = true
  1938. }
  1939. })
  1940. } else {
  1941. this.optionForm.column.forEach(item => {
  1942. if (item.prop == 'contractNo' || item.prop == 'purchaseDate' || item.prop == 'boxTypeQuantityOne' || item.prop == 'boxTypeQuantityTwo' || item.prop == 'agreement' || item.prop == 'boxCondition' || item.prop == 'log') {
  1943. item.disabled = false
  1944. }
  1945. })
  1946. }
  1947. this.CNYSUM = 0
  1948. this.USDSUM = 0
  1949. this.form.tradingBoxItemsList.forEach(item => {
  1950. if (item.currency == 'CNY') {
  1951. this.CNYSUM = _.round(_.add(this.CNYSUM ? Number(this.CNYSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
  1952. }
  1953. if (item.currency == 'USD') {
  1954. this.USDSUM = _.round(_.add(this.USDSUM ? Number(this.USDSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
  1955. }
  1956. })
  1957. },
  1958. deep: true, // 深度监听
  1959. immediate: true // 第一次改变就执行
  1960. },
  1961. }
  1962. }
  1963. </script>
  1964. <style lang="scss" scoped>
  1965. ::v-deep .el-form-item__error {
  1966. display: none !important;
  1967. }
  1968. ::v-deep .el-form-item {
  1969. margin-bottom: 8px !important;
  1970. }
  1971. ::v-deep .el-table .cell {
  1972. padding: 0 2px !important;
  1973. .el-form-item {
  1974. margin-bottom: 0px !important;
  1975. }
  1976. }
  1977. ::v-deep .avue-crud .el-table .el-form-item__label {
  1978. left: -1px;
  1979. }
  1980. // ::v-deep#out-table .back-one {
  1981. // background: #ecf5ff !important;
  1982. // }
  1983. // ::v-deep#out-table .back-two {
  1984. // background: #ecf5ff !important;
  1985. // }
  1986. ::v-deep #out-table .back-one {
  1987. background: #ecf5ff !important;
  1988. text-align: center;
  1989. padding: 4px 0;
  1990. }
  1991. ::v-deep #out-table .back-two {
  1992. background: #ecf5ff !important;
  1993. text-align: center;
  1994. padding: 4px 0;
  1995. }
  1996. ::v-deep .el-table--small td,
  1997. .el-table--small th {
  1998. padding: 2px !important;
  1999. }
  2000. ::v-deep .el-card__body {
  2001. padding: 3px 10px;
  2002. }
  2003. ::v-deep .box-card .el-card__body {
  2004. padding: 4px !important;
  2005. }
  2006. .disabledBox {
  2007. display: flex;
  2008. align-items: center;
  2009. }
  2010. .meetSize {
  2011. font-size: 16px;
  2012. color: #54BCBD;
  2013. }
  2014. </style>