detailsPage.vue 72 KB

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