detailsPage.vue 84 KB

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