billsDetails.vue 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <!--<el-popover-->
  12. <!-- placement="bottom-end"-->
  13. <!-- width="100"-->
  14. <!-- trigger="hover">-->
  15. <!-- <div>-->
  16. <!-- </div>-->
  17. <!--<el-dropdown style="line-height: 0">-->
  18. <!-- <el-button size="small" type="success" style="margin-right: 8px"-->
  19. <!-- :loading="saveLoading" :disabled="!form.id" >-->
  20. <!-- 发送 EDI<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  21. <!-- </el-button>-->
  22. <!-- <el-dropdown-menu slot="dropdown">-->
  23. <!-- <el-dropdown-item v-for="item in ediData" :key="item.id"-->
  24. <!-- @click.native="editypesSendingEdifun(item)">{{item.cnName}}-->
  25. <!-- </el-dropdown-item>-->
  26. <!-- </el-dropdown-menu>-->
  27. <!--</el-dropdown>-->
  28. <el-button size="small" type="primary" @click="addEdit">新 建
  29. </el-button>
  30. <el-button type="success" size="small" @click="CopyDocumentsfun">复制单据
  31. </el-button>
  32. <el-button size="small" :loading="saveLoading" @click="previewDialogfun">预 览
  33. </el-button>
  34. <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled || showLock"
  35. v-if="form.status == 1" @click.stop="revokeDocumentApproval">撤销单据请核
  36. </el-button>
  37. <el-button size="small" type="success" :disabled="!form.id || detailData.seeDisabled || showLock"
  38. v-if="form.status == 0 || form.status == 4" @click.stop="DocumentApproval">单据请核
  39. </el-button>
  40. <!--<el-button size="small" type="primary" style="margin-right: 8px" v-if="detailData.seeDisabled"-->
  41. <!-- :loading="saveLoading" @click="editHandle">编 辑-->
  42. <!--</el-button>-->
  43. <el-button size="small" type="primary" style="margin-right: 8px"
  44. :disabled="detailData.seeDisabled || showLock" :loading="saveLoading" @click="editCustomer">保 存
  45. </el-button>
  46. <el-dropdown style="line-height: 0">
  47. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  48. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  49. </el-button>
  50. <el-dropdown-menu slot="dropdown">
  51. <!--<el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn && !detailData.check">审批-->
  52. <!--</el-dropdown-item>-->
  53. <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
  54. </el-dropdown-item>
  55. </el-dropdown-menu>
  56. </el-dropdown>
  57. </div>
  58. </div>
  59. <div style="margin-top: 50px">
  60. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  61. <el-tab-pane label="委托信息" name="wt" class="scrollable-container">
  62. <div>
  63. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
  64. <containerTitle title="基础资料"></containerTitle>
  65. <basic-container :showBtn="true">
  66. <el-row :gutter="60">
  67. <el-col v-for="(item, index) in basicData.column" :key="index" :span="8">
  68. <!--数组-->
  69. <div v-if="item instanceof Array"
  70. style="display: flex;align-items: center;justify-content: space-between">
  71. <el-row>
  72. <el-col :span="item[0].span ? item[0].span : 12">
  73. <el-form-item :label="item[0].label" :prop="item[0].prop"
  74. :rules="item[0].rules" :label-width="item[0].labelWidth"
  75. :disabled="showLock">
  76. <span slot="label" v-if="item[0].label">
  77. <span v-if="item[0].label == 'HB/L NO'"
  78. style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  79. @click="applyforfun(item[0].label)">{{ item[0].label }}
  80. </span>
  81. <span v-else style="color: #1e9fff">{{ item[0].label }}</span>
  82. </span>
  83. <span v-if="item[0].type == 'button'"></span>
  84. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  85. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  86. <!-- @click="applyforfun(item[0].label)" >-->
  87. <!--</el-button>-->
  88. <search-query v-else-if="item[0].type == 'select'"
  89. :datalist="item[0].dicData"
  90. :selectValue="form[item[0].prop]" :filterable="true"
  91. :allowCreate="item[0].allowCreate || false"
  92. :clearable="false" :remote="true"
  93. :disabled="detailData.seeDisabled || item[0].disabled || showLock"
  94. :buttonIf="false" :placeholder="`${item[0].text || ''}`"
  95. :forParameter="item[0].forParameter"
  96. @remoteMethod="remoteMethod($event, item[0].prop)"
  97. @corpChange="corpChange($event, item[0].prop)"
  98. @corpFocus="remoteMethod($event, item[0].prop)">
  99. </search-query>
  100. <el-input v-else type="age" style="width: 100%;"
  101. v-model="form[item[0].prop]" size="small" autocomplete="off"
  102. :disabled="detailData.seeDisabled || item[0].disabled || showLock"
  103. :placeholder="item[0].text || ''"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="item[1].span ? item[1].span : 12">
  107. <el-form-item :label="item[1].label" :prop="item[1].prop"
  108. :rules="item[1].rules" :label-width="item[1].labelWidth"
  109. :disabled="showLock">
  110. <span slot="label" v-if="item[1].label">
  111. <span style="color: #1e9fff">{{ item[1].label }}</span>
  112. </span>
  113. <el-date-picker v-if="item[1].type == 'date'"
  114. v-model="form[item[1].prop]" clearable style="width: 100%;"
  115. type="date" size="small"
  116. :disabled="detailData.seeDisabled || item[1].disabled || showLock"
  117. value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  118. </el-date-picker>
  119. <search-query v-else-if="item[1].type == 'select'"
  120. :datalist="item[1].dicData"
  121. :selectValue="form[item[1].prop]" :filterable="true"
  122. :clearable="false" :remote="true"
  123. :disabled="detailData.seeDisabled || item[1].disabled || showLock"
  124. :buttonIf="false" :placeholder="`${item[1].text || ''}`"
  125. :forParameter="item[1].forParameter"
  126. @remoteMethod="remoteMethod($event, item[1].prop)"
  127. @corpChange="corpChange($event, item[1].prop)"
  128. @corpFocus="remoteMethod($event, item[1].prop)">
  129. </search-query>
  130. <tree-select v-else-if="item[1].type == 'tree'"
  131. v-model="form[item[1].prop]" filterable
  132. :data="item[1].dicData" :props="item[1].forParameter"
  133. nodeKey="title" size="small"
  134. :disabled="detailData.seeDisabled || item[1].disabled || showLock"
  135. :multiple="false" :clearable="false"
  136. :placeholder="`${item[1].text || ''}`"
  137. @input="corpChange($event, item[1].prop)">
  138. </tree-select>
  139. <el-input v-else type="age" style="width: 100%;"
  140. v-model="form[item[1].prop]" size="small" autocomplete="off"
  141. :disabled="detailData.seeDisabled || item[1].disabled || showLock"
  142. :placeholder="item[1].text || ''"></el-input>
  143. </el-form-item>
  144. </el-col>
  145. <el-col v-if="item[2]" :span="item[2].span ? item[2].span : 12">
  146. <el-form-item :label="item[2].label" :prop="item[2].prop"
  147. :rules="item[2].rules" :label-width="item[2].labelWidth"
  148. :disabled="detailData.seeDisabled || item[2].disabled || showLock">
  149. <span slot="label" v-if="item[2].label">
  150. <span style="color: #1e9fff">{{ item[2].label }}</span>
  151. </span>
  152. <search-query v-if="item[2].type == 'select'"
  153. :datalist="item[2].dicData"
  154. :selectValue="form[item[2].prop]" :filterable="true"
  155. :clearable="false" :remote="true"
  156. :disabled="detailData.seeDisabled || item[2].disabled || showLock"
  157. :buttonIf="false" :forParameter="item[2].forParameter"
  158. :placeholder="`${item[2].text || ''}`"
  159. @remoteMethod="remoteMethod($event, item[2].prop)"
  160. @corpChange="corpChange($event, item[2].prop)"
  161. @corpFocus="remoteMethod($event, item[2].prop)">
  162. </search-query>
  163. <el-input v-else type="age" style="width: 100%;"
  164. v-model="form[item[2].prop]" size="small" autocomplete="off"
  165. :disabled="detailData.seeDisabled || item[1].disabled || showLock"
  166. :placeholder="item[2].text || ''"></el-input>
  167. </el-form-item>
  168. </el-col>
  169. </el-row>
  170. </div>
  171. <!--对象-->
  172. <div v-else>
  173. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules"
  174. :disabled="showLock">
  175. <span slot="label" v-if="item.label">
  176. <span style="color: #1e9fff">{{ item.label }}</span>
  177. </span>
  178. <search-query v-if="item.type == 'select'" ref="searchQueryRef"
  179. :datalist="item.dicData" :selectValue="form[item.prop]"
  180. :filterable="true" :clearable="false" :remote="true"
  181. :disabled="detailData.seeDisabled || item.disabled || showLock"
  182. :buttonIf="item.buttonIf" :forParameter="item.forParameter"
  183. :joinData="item.joinData" :placeholder="`${item.text || ''}`"
  184. @remoteMethod="remoteMethod($event, item.prop)"
  185. @corpChange="corpChange($event, item.prop)"
  186. @corpFocus="remoteMethod($event, item.prop)"
  187. @eldialogConfirm="eldialogConfirm(item.slot)">
  188. <bcorps v-show="item.slot == 'bcorps'" ref="bcorps" :eldialog="true"
  189. @selectionChange="eldialogMultipleChoice($event, item.slot)">
  190. </bcorps>
  191. <bcorpstypedefine v-show="item.slot == 'bcorpstypedefine'">
  192. </bcorpstypedefine>
  193. </search-query>
  194. <el-input v-else type="age" style="width: 100%;"
  195. v-model="form[item.prop]" size="small" autocomplete="off"
  196. :disabled="detailData.seeDisabled || item.disabled || showLock"
  197. :placeholder="item.text || ''"></el-input>
  198. </el-form-item>
  199. </div>
  200. </el-col>
  201. </el-row>
  202. </basic-container>
  203. </el-form>
  204. </div>
  205. <div class="customer-main margintop">
  206. <containerTitle title="详细"></containerTitle>
  207. <basic-container :showBtn="true">
  208. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  209. <el-tab-pane label="委托详情" name="first">
  210. <entrustment-lnformation :assemblyForm="form" :detailData="detailData"
  211. :disabled="showLock" :generateBillsfalse="generateBillsfalse"
  212. @billsDetailfun="billsDetailfun(form.id)">
  213. </entrustment-lnformation>
  214. </el-tab-pane>
  215. <el-tab-pane label="配箱信息" name="second">
  216. <DistributionBox :assemblyForm="form" :detailData="detailData" :disabled="showLock"
  217. :pleasereviewType="pleasereviewType" @billsDetailfun="billsDetailfun(form.id)">
  218. </DistributionBox>
  219. </el-tab-pane>
  220. <!--<el-tab-pane label="MB/L信息" name="third">-->
  221. <!-- <mbinformation :assemblyForm="form" :detailData="detailData"></mbinformation>-->
  222. <!--</el-tab-pane>-->
  223. <el-tab-pane label="报表管理" name="fourth"
  224. v-if="roleName.indexOf('admin') != -1 ? true : roleName.indexOf('报表管理') != -1 ? true : false">
  225. <reports :id="form.id" :assemblyForm="form"
  226. :disabled="detailData.seeDisabled || showLock" businessValue="HYJK"></reports>
  227. </el-tab-pane>
  228. <!--<el-tab-pane label="EDI CODE" name="sixth">-->
  229. <!-- <edicode :assemblyForm="form" :detailData="detailData"></edicode>-->
  230. <!--</el-tab-pane>-->
  231. <el-tab-pane label="文件中心" name="seventh">
  232. <filescenter ref="filescenter" :assemblyForm="form" :detailData="detailData"
  233. @billsDetailfun="billsDetailfun(form.id)" :disabled="showLock"></filescenter>
  234. </el-tab-pane>
  235. </el-tabs>
  236. </basic-container>
  237. <basic-container :showBtn="true" v-if="activeName == 'first' || activeName == 'third'">
  238. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse"
  239. :disabled="showLock" :detailData="detailData"></formbottom>
  240. </basic-container>
  241. </div>
  242. </el-tab-pane>
  243. <el-tab-pane label="费用信息" name="fy" class="scrollable-container"
  244. v-if="roleName.indexOf('admin') != -1 ? true : roleName.indexOf('应收修改') != -1 || roleName.indexOf('应付修改') != -1 || roleName.indexOf('应收查看') != -1 || roleName.indexOf('应付查看') != -1">
  245. <feecenter :assemblyForm="form" :copyFormData="copyFormData" :detailData="detailData"
  246. :disabled="showLock" :pleasereviewType="pleasereviewType" :pid="form.id"
  247. @billsDetailfun="billsDetailfun(form.id)">
  248. </feecenter>
  249. </el-tab-pane>
  250. <el-tab-pane label="单证中心" name="dz" class="scrollable-container">
  251. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form"
  252. :disabled="showLock"></document-center>
  253. </el-tab-pane>
  254. <el-tab-pane label="分单列表" name="fd" class="scrollable-container" v-if="form.billType == 'MM'">
  255. <Split-list :detailData="detailData" :assemblyForm="form" :data="billsListAllData"
  256. :disabled="showLock" @billsListAllfun="billsListAllfun(form.id)"></Split-list>
  257. </el-tab-pane>
  258. </el-tabs>
  259. </div>
  260. <!--审核弹窗-->
  261. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  262. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  263. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  264. </el-dialog>
  265. <!--预览报表弹窗-->
  266. <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
  267. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  268. <business-reports :id="form.id" :disabled="detailData.seeDisabled"></business-reports>
  269. </el-dialog>
  270. </div>
  271. </template>
  272. <script>
  273. import EntrustmentLnformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue";
  274. import mbinformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/mbinformation.vue";
  275. import reports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/reports.vue";
  276. import formbottom from "@/views/iosBasicData/OceanFreightImport/bills/assembly/formbottom.vue";
  277. import edicode from '@/views/iosBasicData/OceanFreightImport/bills/assembly/edicode.vue'
  278. import filescenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/filescenter.vue";
  279. import DistributionBox from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DistributionBox.vue";
  280. import feecenter from '@/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue'
  281. import { getList as userGetList } from '@/api/system/user'
  282. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  283. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  284. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  285. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  286. import SplitList from "@/views/iosBasicData/OceanFreightImport/bills/assembly/SplitList.vue";
  287. import { getLazylist } from "@/api/basicData/agreement";
  288. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  289. import { getBlocationsList } from "@/api/iosBasicData/blocations";
  290. import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
  291. import { getWorkDicts } from "@/api/system/dictbiz";
  292. import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
  293. import {
  294. billsCheckBills, billsCopyBills,
  295. billsDetail,
  296. billsGetBillNo,
  297. billsListAll, billsRevokeCheckBills, editypesSendingEdi,
  298. billsSubmit,
  299. deptGetDetailPol, postSelectByUser
  300. } from '@/api/iosBasicData/bills'
  301. import { dateFormat } from "@/util/date";
  302. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  303. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  304. import DocumentCenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DocumentCenter.vue";
  305. import businessReports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/businessReports.vue";
  306. import { popupReminder } from "@/util/messageReminder";
  307. import editypes from "@/views/iosBasicData/editypes/index.vue";
  308. import { editypesList } from "@/api/iosBasicData/editypes";
  309. import { verifyEnglish } from "@/util/date";
  310. import { contrastObj, contrastList } from "@/util/contrastData";
  311. import { selectListLos } from "@/api/approval/processConfig";
  312. import _ from "lodash";
  313. export default {
  314. components: {
  315. checkSchedule,
  316. SearchQuery,
  317. EntrustmentLnformation,
  318. formbottom,
  319. mbinformation,
  320. reports,
  321. edicode,
  322. filescenter,
  323. DistributionBox,
  324. feecenter,
  325. bcorps,
  326. bcorpstypedefine,
  327. SplitList,
  328. TreeSelect,
  329. DocumentCenter,
  330. businessReports,
  331. editypes,
  332. },
  333. props: {
  334. detailData: {
  335. type: Object
  336. }
  337. },
  338. data() {
  339. return {
  340. showLock: false,
  341. ediData: [], // edi 列表数据
  342. previewDialog: false, // 预览报表弹窗开启
  343. generateBillsfalse: false, // 如果生成账单就禁用
  344. pleasereviewType: false, // 如果请核就禁用
  345. checkScheduleDialog: false, // 审核弹窗
  346. checkId: '', // 审核需要的id
  347. batchNo: '',
  348. billsListAllData: [], // 分单列表数据
  349. pageLoading: false, // 全屏的动画
  350. saveLoading: false,
  351. copyFormData: {}, // 详情的备份数据
  352. // 详情数据
  353. form: {
  354. billDate: dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
  355. operatorName: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  356. operatorId: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  357. businessType: 'SI', // 业务类型 默认 海运出口
  358. businessTypes:'海运',
  359. seaType: 'I', // 进出口 默认出口 E=出口 I=进口"
  360. billType: 'DD', // 单据类型 默认 直单
  361. accDeptName: '',// 核算部门 默认登录人的部门
  362. issueType: 'ORI', // 签单方式 默认 正本
  363. mpaymode: 'PP', // 主单付费方式 默认PP
  364. hpaymode: 'PP', // 分单付费方式 默认 PP
  365. loadType: 'FCL', // 装箱方式默认整箱
  366. srcType: 'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  367. numberOfObl: 'THREE', // 正本份数 默认 THREE
  368. numberOfCopy: 'THREE', // 副本份数 默认 THREE
  369. cargoType: 'dry', // 货物类型默认普货
  370. marks: 'N/M',
  371. dgPackingLevel: '0', // 危险品包装等级
  372. filesList: [], // 文件中心
  373. feeCenterListD: [], // 收
  374. feeCenterListC: [], // 付
  375. preContainersList: [], // 箱
  376. feeCenterAmendList: [],
  377. placeReceiptName: '',
  378. placeReceiptNamePrint: '',
  379. polEnName: '',
  380. polNamePrint: '',
  381. podEnName: '',
  382. podNamePrint: '',
  383. destinationName: '',
  384. destinationNamePrint: '',
  385. detail: {}
  386. },
  387. oldForm: {
  388. billDate: dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00', // 单据日期 默认 当天
  389. operatorName: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_name, // OP 默认登录人
  390. operatorId: JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id, // OP 默认登录人
  391. businessType: 'SI', // 业务类型 默认 海运出口
  392. businessTypes:'海运',
  393. seaType: 'I', // 进出口 默认出口 E=出口 I=进口"
  394. billType: 'DD', // 单据类型 默认 直单
  395. accDeptName: '',// 核算部门 默认登录人的部门
  396. issueType: 'ORI', // 签单方式 默认 正本
  397. mpaymode: 'PP', // 主单付费方式 默认PP
  398. hpaymode: 'PP', // 分单付费方式 默认 PP
  399. loadType: 'FCL', // 装箱方式默认整箱
  400. srcType: 'OWN', // 业务来源默认公司 来源 内容 默认登录人所属公司
  401. numberOfObl: 'THREE', // 正本份数 默认 THREE
  402. numberOfCopy: 'THREE', // 副本份数 默认 THREE
  403. cargoType: 'dry', // 货物类型默认普货
  404. marks: 'N/M',
  405. dgPackingLevel: '0', // 危险品包装等级
  406. filesList: [], // 文件中心
  407. feeCenterListD: [], // 收
  408. feeCenterListC: [], // 付
  409. preContainersList: [], // 箱
  410. feeCenterAmendList: [],
  411. placeReceiptName: '',
  412. placeReceiptNamePrint: '',
  413. polEnName: '',
  414. polNamePrint: '',
  415. podEnName: '',
  416. podNamePrint: '',
  417. destinationName: '',
  418. destinationNamePrint: '',
  419. detail: {}
  420. },
  421. // 循环的配置
  422. basicData: {
  423. column: [
  424. {
  425. label: "客户名称", // 调往来单位接口
  426. prop: "corpCnName",
  427. text: "请选择客户名称",
  428. type: 'select',
  429. dicData: [],
  430. disabled: false,
  431. buttonIf: true,
  432. joinData: true,
  433. slot: 'bcorps',
  434. forParameter: {
  435. key: 'id',
  436. label: 'cnName',
  437. value: 'cnName',
  438. short: 'shortName'
  439. },
  440. rules: [{
  441. required: true,
  442. message: " ",
  443. trigger: "blur"
  444. }]
  445. },
  446. [
  447. {
  448. label: "客户OP", // 客户联系人姓名 电话和邮箱带出来,可以修改 往来单位接口 需要传一个客户名称的值过去
  449. prop: "corpAttnName",
  450. text: "姓名",
  451. type: 'select',
  452. dicData: [],
  453. span: 10,
  454. disabled: false,
  455. allowCreate: true,
  456. forParameter: {
  457. key: 'id',
  458. label: 'cname',
  459. value: 'cname',
  460. },
  461. },
  462. {
  463. label: "", //客户联系人电话
  464. prop: "corpAttnTel",
  465. text: "电话",
  466. labelWidth: '10px',
  467. disabled: false,
  468. span: 7,
  469. // rules: [{
  470. // required: true,
  471. // message: "",
  472. // trigger: "blur"
  473. // }]
  474. },
  475. {
  476. label: "", // 客户联系人邮箱
  477. prop: "corpAttnEmail",
  478. text: "邮箱",
  479. labelWidth: '10px',
  480. disabled: false,
  481. span: 7,
  482. // rules: [{
  483. // required: true,
  484. // message: " ",
  485. // trigger: "blur"
  486. // }]
  487. },
  488. ],
  489. [
  490. {
  491. label: "业务来源", // OWN=公司 AGENT=代理 SALES=业务员
  492. prop: "srcType",
  493. text: "请选择业务来源",
  494. type: 'select',
  495. disabled: true,
  496. forParameter: {
  497. key: 'dictKey',
  498. label: 'dictValue',
  499. value: 'dictKey',
  500. },
  501. dicData: [],
  502. },
  503. {
  504. label: "",
  505. prop: "srcCnName", // 来源中文 公司不是下拉写死公司两字 业务员调用户管理列表 代理调往来单位四个代理数据
  506. text: "请选择来源",
  507. labelWidth: '30px',
  508. type: 'select',
  509. disabled: true,
  510. dicData: [],
  511. forParameter: {
  512. key: 'id',
  513. label: 'cnName',
  514. value: 'cnName',
  515. },
  516. },
  517. ],
  518. [
  519. {
  520. label: "HB/L NO", //弹窗点击确认还是取消申请 调后台接口获取到一个编号
  521. prop: "HB/L NO",
  522. type: 'button',
  523. span: 4,
  524. disabled: false,
  525. },
  526. {
  527. label: "",
  528. text: "请输入HB/L NO",
  529. prop: "hblno",
  530. labelWidth: '6px',
  531. span: 14,
  532. disabled: true,
  533. },
  534. {
  535. label: "", // HB/L 付款方式 PP=预付, CC=到付, FPA, Other', 申请之后默认 PP
  536. text: "付款方式",
  537. prop: "hpaymode",
  538. labelWidth: '30px',
  539. disabled: false,
  540. type: 'select',
  541. span: 6,
  542. dicData: [],
  543. forParameter: {
  544. key: 'dictKey',
  545. label: 'dictValue',
  546. value: 'dictKey',
  547. },
  548. },
  549. ],
  550. [
  551. {
  552. label: "MB/L NO",
  553. text: "请输入MB/L NO",
  554. prop: "mblno",
  555. span: 18,
  556. disabled: false,
  557. },
  558. {
  559. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  560. text: "付款方式",
  561. prop: "mpaymode",
  562. type: 'select',
  563. labelWidth: '30px',
  564. disabled: false,
  565. span: 6,
  566. dicData: [],
  567. forParameter: {
  568. key: 'dictKey',
  569. label: 'dictValue',
  570. value: 'dictKey',
  571. },
  572. },
  573. ],
  574. {
  575. label: "REF MBLNO", // Co-Loader 中文名称 往来单位 类别
  576. text: "请输入REF MBLNO",
  577. prop: "refno",
  578. disabled: false,
  579. },
  580. [
  581. {
  582. label: "OP", // 操作id 用户管理下拉 模糊搜索
  583. text: "请选择OP",
  584. prop: "operatorName",
  585. type: 'select',
  586. dicData: [],
  587. disabled: false,
  588. forParameter: {
  589. key: 'id',
  590. label: 'name',
  591. value: 'name',
  592. },
  593. rules: [{
  594. required: true,
  595. message: " ",
  596. trigger: "blur"
  597. }]
  598. },
  599. {
  600. label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  601. text: "请选择核算部门",
  602. prop: "accDeptName",
  603. type: 'tree',
  604. dicData: [],
  605. disabled: false,
  606. forParameter: {
  607. label: "title",
  608. children: 'children'
  609. },
  610. rules: [{
  611. required: true,
  612. message: " ",
  613. trigger: "blur"
  614. }]
  615. },
  616. ],
  617. [
  618. {
  619. label: "业务编号",
  620. text: "业务编号",
  621. prop: "billNo",
  622. disabled: true,
  623. },
  624. {
  625. label: "所属团队",
  626. text: "请选择所属团队",
  627. prop: "teamName",
  628. disabled: false,
  629. type: 'select',
  630. dicData: [],
  631. forParameter: {
  632. key: 'id',
  633. label: 'postName',
  634. value: 'id',
  635. },
  636. rules: [{
  637. required: true,
  638. message: " ",
  639. trigger: "blur"
  640. }]
  641. },
  642. ],
  643. ]
  644. },
  645. activeName: 'first',
  646. bigtabs: 'wt',
  647. saberUserInfo: {}, // 当前登录人信息
  648. roleName: [], // 当前的角色权限
  649. // 需要加判断是否必填的数据
  650. messageData: [
  651. {
  652. name: '客户',
  653. value: 'corpCnName',
  654. },
  655. {
  656. name: '业务来源',
  657. value: 'srcType',
  658. },
  659. {
  660. name: 'MBLNO',
  661. value: 'mblno',
  662. },
  663. {
  664. name: '船名(VSL)',
  665. value: 'vesselCnName',
  666. },
  667. {
  668. name: '航次(VOY)',
  669. value: 'voyageNo',
  670. },
  671. // {
  672. // name: 'REF MBLNO',
  673. // value: 'refno',
  674. // },
  675. {
  676. name: 'ETA',
  677. value: 'eta',
  678. },
  679. {
  680. name: '装货港',
  681. value: 'polCnName',
  682. },
  683. {
  684. name: '目的港',
  685. value: 'destinationNamePrint',
  686. },
  687. {
  688. name: '包装单位',
  689. value: 'packingUnit',
  690. },
  691. {
  692. name: '船公司',
  693. value: 'carrierCnName',
  694. },
  695. {
  696. name: '场站',
  697. value: 'cyCnName',
  698. },
  699. ],
  700. }
  701. },
  702. watch: {
  703. // 监听业务类型 如果不是分单 可以编辑分单号
  704. 'form.billType': {
  705. // 执行方法
  706. handler(oldValue, newValue) {
  707. // if (oldValue == 'MM') {
  708. // this.form.hblno = ''
  709. // }
  710. // 只有分单不能编辑
  711. if (oldValue == 'MH') {
  712. this.columnforfun('hblno').disabled = true
  713. } else {
  714. this.columnforfun('hblno').disabled = false
  715. }
  716. },
  717. deep: true, // 深度监听
  718. immediate: true // 第一次改变就执行
  719. },
  720. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  721. 'form.preContainersList': {
  722. // 执行方法
  723. handler(oldValue, newValue) {
  724. // 判断是否是数组
  725. if (oldValue instanceof Array) {
  726. // 循环 有温度反 true 没有反 false
  727. const arr = oldValue.map(item => {
  728. if (Number(item.temperature)) {
  729. return true
  730. } else {
  731. return false
  732. }
  733. })
  734. // 判断是否有温度
  735. if (arr[0]) {
  736. // 判断之前是否是冻货
  737. if (this.form.cargoType == 'reefer') return
  738. this.$message({
  739. message: '箱信息里有温度已将货描切换为冻柜',
  740. type: 'warning'
  741. });
  742. this.$set(this.form, 'cargoType', 'reefer')
  743. }
  744. }
  745. },
  746. deep: true, // 深度监听
  747. immediate: true // 第一次改变就执行
  748. }
  749. },
  750. created() {
  751. this.saberUserInfo = JSON.parse(localStorage.getItem('saber-userInfo')).content
  752. this.roleName = localStorage.getItem('roleName').split(',')
  753. // 判断是否员id, 有id 就不显示
  754. if (!this.form.id) {
  755. this.deptGetDetailPolfun() // 目的地 卸货港 当前登录人的默认
  756. this.userGetListfun(undefined, true) // 获取用户管理数据
  757. }
  758. this.ownDeptLazyTreefun() // 获取公司数据
  759. this.getLazylistfun() // 获取审核数据
  760. this.mpaymodeWorkDictsfun() // 获取 付款方式字典
  761. this.srcTypeWorkDictsfun()
  762. // 获取EDI 数据
  763. this.editypesListfun()
  764. // 获取所属团队数据
  765. this.postSelectByUserfun()
  766. },
  767. methods: {
  768. inLock() {
  769. this.showLock = true;
  770. const data = {
  771. moduleName: "SI",
  772. tableName: "SI_order",
  773. billId: this.form.id,
  774. no: localStorage.getItem("browserID"),
  775. billNo: this.form.mblno
  776. };
  777. this.inDetailsKey(this.$route.name, {
  778. moduleName: "SI",
  779. tableName: "SI_order",
  780. billId: this.form.id,
  781. billNo: this.form.mblno
  782. });
  783. this.checkLock(data).then(res => {
  784. if (res.data.code == 200) {
  785. this.onLock(data).then(res => {
  786. if (res.data.code == 200) {
  787. this.showLock = false
  788. }
  789. });
  790. }
  791. });
  792. },
  793. addEdit() {
  794. if (this.form.billStatus >= 3) {
  795. this.$emit('toAddEdit')
  796. } else {
  797. if (contrastObj(this.form, this.oldForm)
  798. || contrastList(this.form.preContainersList, this.oldForm.preContainersList) || contrastList(this.form.containersList, this.oldForm.containersList)
  799. || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC)
  800. || contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD)
  801. || contrastList(this.form.filesList, this.oldForm.filesList)
  802. || contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  803. ) {
  804. this.$confirm('是否需要保存?', '提示', {
  805. confirmButtonText: '确定',
  806. cancelButtonText: '取消',
  807. type: 'warning'
  808. }).then(() => {
  809. this.editCustomer('toAddEdit')
  810. }).catch(() => {
  811. this.$emit('toAddEdit')
  812. });
  813. } else {
  814. this.$emit('toAddEdit')
  815. }
  816. }
  817. },
  818. // 获取EDI列表数据
  819. editypesListfun() {
  820. editypesList(1, 30).then(res => {
  821. this.ediData = res.data.data.records
  822. })
  823. },
  824. // 发送edi
  825. editypesSendingEdifun(row) {
  826. row.billId = this.form.id
  827. let msgsList = []
  828. if (!verifyEnglish(this.form.hshipperDetails)) {
  829. msgsList.push('发货人')
  830. }
  831. if (!verifyEnglish(this.form.hconsigneeDetails)) {
  832. msgsList.push('收货人')
  833. }
  834. if (!verifyEnglish(this.form.hnotifyDetails)) {
  835. msgsList.push('通知人')
  836. }
  837. if (!verifyEnglish(this.form.marks)) {
  838. msgsList.push('唛头')
  839. }
  840. if (!verifyEnglish(this.form.commodityDescr)) {
  841. msgsList.push('货描')
  842. }
  843. if (msgsList.length > 0) {
  844. this.$message.error(`请正确输入${msgsList.join(",")}的英文和英文符号`);
  845. return;
  846. }
  847. this.saveLoading = true
  848. editypesSendingEdi(row).then(res => {
  849. this.saveLoading = false
  850. this.$message.success('操作成功,请去文件中心查看')
  851. this.billsDetailfun(this.form.id) // 详情接口
  852. })
  853. },
  854. // 报表弹窗
  855. previewDialogfun() {
  856. this.previewDialog = true
  857. },
  858. //请核关闭
  859. choceScheduleFun() {
  860. this.checkScheduleDialog = false
  861. },
  862. // 目的地 卸货港 当前登录人的默认
  863. deptGetDetailPolfun() {
  864. deptGetDetailPol(this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  865. // 目的地
  866. this.form.destinationName = res.data.data.polEnName
  867. this.form.destinationId = res.data.data.polId
  868. this.form.destinationCode = res.data.data.polCode
  869. this.form.destinationNamePrint = res.data.data.polEnName
  870. // 卸货港
  871. this.form.podCnName = res.data.data.polCnName
  872. this.form.podEnName = res.data.data.polEnName
  873. this.form.podId = res.data.data.polId
  874. this.form.podCode = res.data.data.polCode
  875. this.form.podNamePrint = res.data.data.polEnName
  876. })
  877. },
  878. // 获取用户管理数据
  879. userGetListfun(account = undefined, type = false,) {
  880. userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  881. this.columnforfun('operatorName').dicData = res.data.data.records
  882. if (type) {
  883. // 核算部门 默认登录人的部门
  884. for (let item of this.columnforfun('operatorName').dicData) {
  885. if (item.name == this.form.operatorName) {
  886. this.$set(this.form, 'accDeptName', item.deptName)
  887. this.$set(this.form, 'accDept', item.deptId)
  888. }
  889. }
  890. }
  891. })
  892. },
  893. // 获取所属岗位数据
  894. postSelectByUserfun() {
  895. postSelectByUser(JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id).then(res => {
  896. this.columnforfun('teamName').dicData = res.data.data
  897. // 判断是否有值,没有的话默认第一个
  898. if (!this.form.teamName) {
  899. this.$set(this.form, 'teamId', res.data.data[0].id)
  900. this.$set(this.form, 'teamName', res.data.data[0].postName)
  901. }
  902. })
  903. },
  904. // 获取付款方式字典数据
  905. mpaymodeWorkDictsfun() {
  906. getWorkDicts('payment_method_los').then((res) => {
  907. this.columnforfun('mpaymode').dicData = res.data.data
  908. this.columnforfun('hpaymode').dicData = res.data.data
  909. })
  910. },
  911. // 获取核算部分数据 // 机构管理接口
  912. getLazylistfun() {
  913. getDeptTree().then(res => {
  914. this.columnforfun('accDeptName').dicData = res.data.data
  915. })
  916. },
  917. // 获取客户名称数据 往来单位数据
  918. getBcorpsListfun(cnName) {
  919. getBcorpsList(1, 10, { shortName: cnName, status: 0 }).then(res => {
  920. this.columnforfun('corpCnName').dicData = res.data.data.records
  921. })
  922. },
  923. // 获取客户联系人 客户OP
  924. getBcorpsattnListfun(cname) {
  925. getBcorpsattnList(1, 10, { pid: this.form.corpId, cname }).then(res => {
  926. this.columnforfun('corpAttnName').dicData = res.data.data.records
  927. // if (res.data.data.records.length == 0) {
  928. // this.form.corpAttnName = ''
  929. // this.form.corpAttnId = ''
  930. // this.$set(this.form, 'corpAttnTel', '')
  931. // this.$set(this.form, 'corpAttnEmail', '')
  932. // return
  933. // }
  934. // this.form.corpAttnName = res.data.data.records[0].cname
  935. // this.form.corpAttnId = res.data.data.records[0].id
  936. // this.$set(this.form, 'corpAttnTel', res.data.data.records[0].tel)
  937. // this.$set(this.form, 'corpAttnEmail', res.data.data.records[0].email)
  938. })
  939. },
  940. // 获取业务来源数据
  941. srcTypeWorkDictsfun() {
  942. getWorkDicts('src_type_los').then(res => {
  943. this.columnforfun('srcType').dicData = res.data.data
  944. })
  945. },
  946. // 获取业务来源代理数据
  947. agentBcorpsListfun(cnName) {
  948. let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  949. getBcorpslistByType(1, 10, { cnName, status: 0, corpTypeName }).then(res => {
  950. this.columnforfun('srcCnName').dicData = res.data.data.records
  951. })
  952. },
  953. // 获取业务来源业务员数据
  954. salesUserGetListfun(account) {
  955. selectListLos('业务员').then(res => {
  956. this.columnforfun('srcCnName').dicData = res.data.data
  957. })
  958. },
  959. // 获取公司名称 用户管理左侧
  960. ownDeptLazyTreefun() {
  961. getDeptLazyTree(0).then(res => {
  962. this.columnforfun('srcCnName').dicData = res.data.data
  963. // 来源 内容 默认登录人所属公司
  964. for (let item of this.columnforfun('srcCnName').dicData) {
  965. if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid) {
  966. this.$set(this.form, 'srcId', item.id)
  967. this.$set(this.form, 'srcCnName', item.title)
  968. this.$set(this.form, 'srcEnName', item.title)
  969. }
  970. }
  971. })
  972. },
  973. // 申请B/L NO
  974. billsGetBillNofun() {
  975. let billNoFormat = ''
  976. if (this.form.cargoType == 'dry') {
  977. billNoFormat = 'HYJK-PH'
  978. } else if (this.form.cargoType == 'danger') {
  979. billNoFormat = 'HYJK-WXP'
  980. } else if (this.form.cargoType == 'reefer') {
  981. billNoFormat = 'HYJK-DG'
  982. } else { }
  983. billsGetBillNo({
  984. businessTypeCode: 'HYJK',
  985. billNoFormat: billNoFormat
  986. }).then(res => {
  987. this.columnforfun('hpaymode').disabled = false
  988. this.$set(this.form, 'hblno', res.data.data)
  989. this.billsSubmitfun()
  990. })
  991. },
  992. // 下拉多选弹窗的确认
  993. eldialogConfirm(name) {
  994. if (name == 'bcorps') {
  995. if (this.$refs.bcorps[0].isShow) {
  996. console.log('列表确认')
  997. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName
  998. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName
  999. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id
  1000. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code
  1001. this.form.corpSource = this.$refs.bcorps[0].selectionList[0].corpSource
  1002. // 获取 客户op数据
  1003. this.getBcorpsattnListfun()
  1004. // 业务来源参数带出
  1005. this.$set(this.form, 'srcType', this.$refs.bcorps[0].selectionList[0].sourceType)
  1006. this.$set(this.form, 'srcId', this.$refs.bcorps[0].selectionList[0].srcId)
  1007. this.$set(this.form, 'srcCnName', this.$refs.bcorps[0].selectionList[0].srcCnName)
  1008. this.$set(this.form, 'srcEnName', this.$refs.bcorps[0].selectionList[0].srcEnName)
  1009. this.columnforfun('srcType').disabled = false
  1010. this.columnforfun('srcCnName').disabled = false
  1011. // 航线带出往来单位的优势航线
  1012. this.$set(this.form, 'lineCnName', this.$refs.bcorps[0].selectionList[0].advantageRoute)
  1013. // 带出发货人数据
  1014. this.$set(this.form.detail, 'hshipperId', this.$refs.bcorps[0].selectionList[0].id)
  1015. this.$set(this.form.detail, 'hshipperCnName', this.$refs.bcorps[0].selectionList[0].cnName)
  1016. this.$set(this.form.detail, 'hshipperEnName', this.$refs.bcorps[0].selectionList[0].enName)
  1017. this.$set(this.form.detail, 'hshipperCode', this.$refs.bcorps[0].selectionList[0].code)
  1018. this.$set(this.form.detail, 'hshipperDetails', this.$refs.bcorps[0].selectionList[0].details)
  1019. this.$set(this.form.detail, 'hshipperCntyName', this.$refs.bcorps[0].selectionList[0].cntyName)
  1020. this.$set(this.form.detail, 'hshipperCntyCode', this.$refs.bcorps[0].selectionList[0].cntyCode)
  1021. this.columnforfun('corpAttnName').disabled = false
  1022. this.columnforfun('corpAttnTel').disabled = false
  1023. this.columnforfun('corpAttnEmail').disabled = false
  1024. } else {
  1025. console.log('详情确认')
  1026. this.$refs.bcorps[0].$refs.detail.submitForm()
  1027. }
  1028. }
  1029. this.$refs.searchQueryRef[0].corpVisible = false
  1030. },
  1031. // 下拉多选弹窗数据多选回调
  1032. eldialogMultipleChoice(list, name) {
  1033. if (name == 'bcorps') {
  1034. let arr = []
  1035. if (list.length > 1) {
  1036. this.$refs.bcorps[0].$refs.crud.toggleSelection() // 先清空所以选择的数据
  1037. arr = [list[list.length - 1]] // 获取最新点击的数组
  1038. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr, true) // 把刚点击的数组变成选择状态
  1039. } else {
  1040. arr = list
  1041. }
  1042. this.$refs.bcorps[0].selectionList = arr
  1043. } else {
  1044. }
  1045. },
  1046. /* 远程模糊查询操作用户 */
  1047. remoteMethod(value, name) {
  1048. if (name == 'operatorName') {
  1049. this.userGetListfun(value)
  1050. } else if (name == 'accDeptName') {
  1051. this.getLazylistfun(value)
  1052. } else if (name == 'corpCnName') {
  1053. this.getBcorpsListfun(value)
  1054. } else if (name == 'corpAttnName') {
  1055. this.getBcorpsattnListfun(value)
  1056. } else if (name == 'srcType') {
  1057. this.srcTypeWorkDictsfun()
  1058. } else if (name == 'srcCnName') {
  1059. if (this.form.srcType == 'SALES') {
  1060. // 业务员
  1061. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1062. this.salesUserGetListfun(value)
  1063. } else if (this.form.srcType == 'AGENT') {
  1064. // 代理
  1065. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1066. this.agentBcorpsListfun(value)
  1067. } else if (this.form.srcType == 'OWN') {
  1068. // 公司
  1069. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1070. this.ownDeptLazyTreefun()
  1071. } else { }
  1072. } else if (name == 'teamName') {
  1073. this.postSelectByUserfun()
  1074. } else {
  1075. }
  1076. },
  1077. // 下拉的监听事件
  1078. corpChange(value, name) {
  1079. if (name == 'operatorName') {
  1080. // OP 下拉赋值 用户管理列表
  1081. for (let item of this.columnforfun('operatorName').dicData) {
  1082. if (item.name == value) {
  1083. this.form.operatorName = item.name
  1084. this.form.operatorId = item.id
  1085. }
  1086. }
  1087. }
  1088. else if (name == 'accDeptName') {
  1089. // OP 下拉赋值 用户管理列表
  1090. for (let item of this.columnforfun('accDeptName').dicData) {
  1091. if (item.title == value) {
  1092. this.form.accDeptName = item.title
  1093. this.form.accDept = item.id
  1094. }
  1095. }
  1096. }
  1097. else if (name == 'corpCnName') {
  1098. if (value) {
  1099. // this.columnforfun('corpAttnName').disabled = false
  1100. // this.columnforfun('corpAttnTel').disabled = false
  1101. // this.columnforfun('corpAttnEmail').disabled = false
  1102. } else {
  1103. // this.columnforfun('corpAttnName').disabled = true
  1104. // this.columnforfun('corpAttnTel').disabled = true
  1105. // this.columnforfun('corpAttnEmail').disabled = true
  1106. // 如果点击清空按钮把值赋值为空
  1107. this.form.corpCnName = ''
  1108. this.form.corpEnName = ''
  1109. this.form.corpId = ''
  1110. this.form.corpCode = ''
  1111. this.form.shortName = ''
  1112. this.form.corpSource = ""
  1113. // 清空 客户OP
  1114. this.form.corpAttnName = ''
  1115. this.form.corpAttnId = ''
  1116. this.$set(this.form, 'corpAttnTel', '')
  1117. this.$set(this.form, 'corpAttnEmail', '')
  1118. // 清空 业务来源和来源详情
  1119. this.$set(this.form, 'srcType', '')
  1120. this.$set(this.form, 'srcId', '')
  1121. this.$set(this.form, 'srcCnName', '')
  1122. this.$set(this.form, 'srcEnName', '')
  1123. }
  1124. // 往来单位
  1125. for (let item of this.columnforfun('corpCnName').dicData) {
  1126. if (item.cnName == value) {
  1127. this.form.corpCnName = item.cnName
  1128. this.form.corpEnName = item.enName
  1129. this.form.corpId = item.id
  1130. this.form.corpCode = item.code
  1131. this.form.shortName = item.shortName
  1132. this.form.corpSource = item.corpSource
  1133. // 获取 客户op数据
  1134. this.getBcorpsattnListfun()
  1135. // 业务来源参数带出
  1136. this.$set(this.form, 'srcType', item.sourceType)
  1137. this.$set(this.form, 'srcId', item.srcId)
  1138. this.$set(this.form, 'srcCnName', item.srcCnName)
  1139. this.$set(this.form, 'srcEnName', item.srcEnName)
  1140. this.columnforfun('srcType').disabled = false
  1141. this.columnforfun('srcCnName').disabled = false
  1142. // 航线带出往来单位的优势航线
  1143. this.$set(this.form, 'lineCnName', item.advantageRoute)
  1144. // 带出发货人数据
  1145. // this.$set(this.form,'hshipperId',item.id)
  1146. // this.$set(this.form,'hshipperCnName',item.cnName)
  1147. // this.$set(this.form,'hshipperEnName',item.enName)
  1148. // this.$set(this.form,'hshipperCode',item.code)
  1149. // this.$set(this.form,'hshipperDetails',item.details)
  1150. // this.$set(this.form,'hshipperCntyName',item.cntyName)
  1151. // this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  1152. }
  1153. }
  1154. }
  1155. else if (name == 'corpAttnName') {
  1156. if (this.columnforfun('corpAttnName').dicData.length) {
  1157. for (let item of this.columnforfun('corpAttnName').dicData) {
  1158. if (item.cname == value) {
  1159. this.form.corpAttnName = item.cname
  1160. this.form.corpAttnId = item.id
  1161. this.$set(this.form, 'corpAttnTel', item.tel)
  1162. this.$set(this.form, 'corpAttnEmail', item.email)
  1163. }
  1164. }
  1165. } else {
  1166. if (value) {
  1167. this.form.corpAttnName = value
  1168. this.form.corpAttnId = null
  1169. }
  1170. }
  1171. }
  1172. else if (name == 'srcType') {
  1173. if (!value) {
  1174. this.$set(this.form, 'srcType', '')
  1175. // this.columnforfun('srcCnName').disabled = true
  1176. return
  1177. }
  1178. this.$set(this.form, 'srcId', '')
  1179. this.$set(this.form, 'srcCnName', '')
  1180. this.$set(this.form, 'srcEnName', '')
  1181. this.form[name] = value
  1182. if (value == 'OWN') {
  1183. // 公司
  1184. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1185. this.ownDeptLazyTreefun()
  1186. } else if (value == 'AGENT') {
  1187. // 代理
  1188. this.columnforfun('srcCnName').type = 'select'
  1189. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1190. this.columnforfun('srcCnName').disabled = false
  1191. this.agentBcorpsListfun()
  1192. } else if (value == 'SALES') {
  1193. // 业务员
  1194. this.columnforfun('srcCnName').type = 'select'
  1195. this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1196. this.columnforfun('srcCnName').disabled = false
  1197. this.salesUserGetListfun()
  1198. } else { }
  1199. }
  1200. else if (name == 'srcCnName') {
  1201. for (let item of this.columnforfun('srcCnName').dicData) {
  1202. if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  1203. if (this.form.srcType == 'SALES') {
  1204. // 业务员
  1205. this.$set(this.form, 'srcId', item.id)
  1206. this.$set(this.form, 'srcCnName', item.name)
  1207. this.$set(this.form, 'srcEnName', item.name)
  1208. } else if (this.form.srcType == 'AGENT') {
  1209. // 代理
  1210. this.$set(this.form, 'srcId', item.id)
  1211. this.$set(this.form, 'srcCnName', item.cnName)
  1212. this.$set(this.form, 'srcEnName', item.enName)
  1213. } else { }
  1214. }
  1215. }
  1216. }
  1217. else if (name == 'mpaymode') {
  1218. // 主单付费方式
  1219. this.form[name] = value
  1220. }
  1221. else if (name == 'hpaymode') {
  1222. // 分单付费方式
  1223. this.form[name] = value
  1224. }
  1225. else if (name == 'teamName') {
  1226. if (!value) {
  1227. this.$set(this.form, 'teamId', '')
  1228. this.$set(this.form, 'teamName', '')
  1229. }
  1230. for (let item of this.columnforfun('teamName').dicData) {
  1231. if (item.id == value) {
  1232. this.$set(this.form, 'teamId', item.id)
  1233. this.$set(this.form, 'teamName', item.postName)
  1234. }
  1235. }
  1236. }
  1237. else {
  1238. this.form[name] = value
  1239. }
  1240. },
  1241. // 申请B/L NO
  1242. applyforfun(text) {
  1243. if (this.detailData.seeDisabled) {
  1244. return;
  1245. }
  1246. if (!this.form.id) {
  1247. this.$message({
  1248. message: '请先保存数据',
  1249. type: 'warning'
  1250. });
  1251. return
  1252. }
  1253. // 如果不是分单
  1254. if (this.form.billType != 'MH') {
  1255. this.$message({
  1256. message: '只有分单需要申请',
  1257. type: 'warning'
  1258. });
  1259. return
  1260. }
  1261. if (this.form.hblno) {
  1262. this.$message({
  1263. message: 'B/L NO 只能申请一次',
  1264. type: 'warning'
  1265. });
  1266. return
  1267. }
  1268. if (!this.form.businessType) {
  1269. this.$message({
  1270. message: '请先选择业务类型',
  1271. type: 'warning'
  1272. });
  1273. return
  1274. }
  1275. if (!this.form.corpCnName) {
  1276. this.$message({
  1277. message: '请先选择客户名称',
  1278. type: 'warning'
  1279. });
  1280. return
  1281. }
  1282. this.$confirm(`确定${text}?`, {
  1283. confirmButtonText: "确定",
  1284. cancelButtonText: "取消",
  1285. type: "warning"
  1286. }).then(res => {
  1287. this.billsGetBillNofun()
  1288. })
  1289. },
  1290. // 配置项
  1291. columnforfun(value) {
  1292. for (let item of this.basicData.column) {
  1293. if (item instanceof Array) {
  1294. for (let ite of item) {
  1295. if (value == ite.prop) {
  1296. return ite
  1297. }
  1298. }
  1299. } else {
  1300. if (value == item.prop) {
  1301. return item
  1302. }
  1303. }
  1304. }
  1305. },
  1306. //返回列表
  1307. backToList() {
  1308. if (contrastObj(this.form, this.oldForm)
  1309. || contrastList(this.form.preContainersList, this.oldForm.preContainersList)
  1310. || contrastList(this.form.containersList, this.oldForm.containersList)
  1311. || contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC)
  1312. || contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD)
  1313. || contrastList(this.form.filesList, this.oldForm.filesList)
  1314. || contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
  1315. ) {
  1316. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1317. confirmButtonText: "确定",
  1318. cancelButtonText: "取消",
  1319. type: "warning"
  1320. })
  1321. .then(() => {
  1322. this.editCustomer('goBack')
  1323. })
  1324. .catch(() => {
  1325. if (this.form.id) {
  1326. this.unLock({
  1327. moduleName: "SI",
  1328. tableName: "SI_order",
  1329. billId: this.form.id,
  1330. billNo: this.form.mblno
  1331. });
  1332. }
  1333. this.$emit('goBack')
  1334. });
  1335. } else {
  1336. if (this.form.id) {
  1337. this.unLock({
  1338. moduleName: "SI",
  1339. tableName: "SI_order",
  1340. billId: this.form.id,
  1341. billNo: this.form.mblno
  1342. });
  1343. }
  1344. this.$emit('goBack')
  1345. }
  1346. },
  1347. // 单据请核
  1348. DocumentApproval() {
  1349. if (this.form.billType == 'MH') {
  1350. this.$message.warning('分单不能提交请核')
  1351. return
  1352. }
  1353. if (popupReminder(this.form, this.messageData)) {
  1354. this.$confirm(popupReminder(this.form, this.messageData), {
  1355. confirmButtonText: "确定",
  1356. cancelButtonText: "取消",
  1357. type: "warning"
  1358. })
  1359. }
  1360. if (popupReminder(this.form, this.messageData)) {
  1361. return;
  1362. }
  1363. if (this.form.feeCenterListC.length == 0 && this.form.feeCenterListD == 0) {
  1364. return this.$message.warning('请添加费用信息')
  1365. }
  1366. this.$confirm("确定要请核数据?", {
  1367. confirmButtonText: "确定",
  1368. cancelButtonText: "取消",
  1369. type: "warning"
  1370. }).then(() => {
  1371. this.pageLoading = true
  1372. billsCheckBills({
  1373. id: this.form.id,
  1374. url: '/iosBasicData/OceanFreightImport/bills/approvalDetails',
  1375. pageStatus: "this.$store.getters.approvalDetails",
  1376. pageLabel: "审批详情(F)",
  1377. }).then(res => {
  1378. this.pageLoading = false
  1379. this.$message({
  1380. type: "success",
  1381. message: "操作成功!"
  1382. });
  1383. // 详情
  1384. this.billsDetailfun(this.form.id)
  1385. }).catch(() => {
  1386. this.pageLoading = false
  1387. })
  1388. })
  1389. },
  1390. // 撤销单据请核
  1391. revokeDocumentApproval() {
  1392. this.$confirm("确定要撤销请核数据?", {
  1393. confirmButtonText: "确定",
  1394. cancelButtonText: "取消",
  1395. type: "warning"
  1396. }).then(() => {
  1397. this.pageLoading = true
  1398. billsRevokeCheckBills({
  1399. id: this.form.id
  1400. }).then(res => {
  1401. this.pageLoading = false
  1402. this.$message({
  1403. type: "success",
  1404. message: "操作成功!"
  1405. });
  1406. // 详情
  1407. this.billsDetailfun(this.form.id)
  1408. })
  1409. })
  1410. },
  1411. // 编辑按钮
  1412. editHandle() {
  1413. this.detailData.seeDisabled = false
  1414. },
  1415. getTextTirim(data) {
  1416. if (data) {
  1417. let obj = data.split('\n')
  1418. let res = []
  1419. obj.forEach(item => {
  1420. res.push(_.trimEnd(item))
  1421. })
  1422. return res.join('\n')
  1423. } else {
  1424. return null
  1425. }
  1426. },
  1427. // 大保存按钮
  1428. editCustomer(status) {
  1429. this.$refs.form.validate((valid) => {
  1430. if (valid) {
  1431. // 判断必填项
  1432. let msgs = []
  1433. if (!this.form.quantity) {
  1434. msgs.push('件数')
  1435. }
  1436. if (!this.form.packingUnit) {
  1437. msgs.push('包装')
  1438. }
  1439. if (!this.form.grossWeight) {
  1440. msgs.push('毛重')
  1441. }
  1442. if (!this.form.measurement) {
  1443. msgs.push('尺码')
  1444. }
  1445. if (!this.form.eta) {
  1446. msgs.push('ETA')
  1447. }
  1448. if (!this.form.teamName) {
  1449. msgs.push('所属团队')
  1450. }
  1451. for (let item of this.form.preContainersList) {
  1452. if (!item.cntrTypeCode) {
  1453. this.$message.warning('请选择尺码箱型')
  1454. return;
  1455. }
  1456. if (!item.quantity) {
  1457. this.$message.warning('请输入箱量')
  1458. return;
  1459. }
  1460. }
  1461. for (let item of this.form.feeCenterListD) {
  1462. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  1463. msgs.push(`应收第${item.$index + 1}行${!item.corpId ? ' 往来单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`)
  1464. }
  1465. }
  1466. for (let item of this.form.feeCenterListC) {
  1467. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  1468. msgs.push(`应付第${item.$index + 1}行${!item.corpId ? ' 往来单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`)
  1469. }
  1470. }
  1471. if (msgs.length > 0) {
  1472. this.$confirm(`请填写下列信息:${msgs.join(" ,")}!`, {
  1473. confirmButtonText: "确定",
  1474. cancelButtonText: "取消",
  1475. type: "warning"
  1476. })
  1477. return;
  1478. }
  1479. // let msgsList = []
  1480. // if (!verifyEnglish(this.form.hshipperDetails)) {
  1481. // msgsList.push('发货人')
  1482. // }
  1483. // if (!verifyEnglish(this.form.hconsigneeDetails)) {
  1484. // msgsList.push('收货人')
  1485. // }
  1486. // if (!verifyEnglish(this.form.hnotifyDetails)) {
  1487. // msgsList.push('通知人')
  1488. // }
  1489. // if (!verifyEnglish(this.form.marks)) {
  1490. // msgsList.push('唛头')
  1491. // }
  1492. // if (!verifyEnglish(this.form.commodityDescr)) {
  1493. // msgsList.push('货描')
  1494. // }
  1495. // if (msgsList.length > 0) {
  1496. // this.$message.error(`请正确输入${msgsList.join(",")}的英文和英文符号`);
  1497. // return;
  1498. // }
  1499. this.form.detail.hshipperDetails = this.getTextTirim(this.form.detail.hshipperDetails)
  1500. this.form.detail.hconsigneeDetails = this.getTextTirim(this.form.detail.hconsigneeDetails)
  1501. this.form.detail.hnotifyDetails = this.getTextTirim(this.form.detail.hnotifyDetails)
  1502. this.form.detail.marks = this.getTextTirim(this.form.detail.marks)
  1503. this.form.detail.commodityDescr = this.getTextTirim(this.form.detail.commodityDescr)
  1504. this.form.forwarding = this.getTextTirim(this.form.forwarding)
  1505. // 赋值 ETA 日期
  1506. this.form.billDate = this.form.eta ? this.form.eta.slice(0, 10) + ' 00:00:00' : null // 单据日期
  1507. // 调用保存接口
  1508. this.billsSubmitfun(status)
  1509. }
  1510. })
  1511. },
  1512. // 主表保存接口大保存
  1513. billsSubmitfun(status) {
  1514. if (this.form.cargoType == 'dry') {
  1515. // 普货
  1516. this.form.billNoFormat = 'HYJK-PH'
  1517. } else if (this.form.cargoType == 'danger') {
  1518. // 危险品
  1519. this.form.billNoFormat = 'HYJK-WXP'
  1520. } else if (this.form.cargoType == 'reefer') {
  1521. // 冻柜
  1522. this.form.billNoFormat = 'HYJK-DG'
  1523. } else {
  1524. this.form.billNoFormat = 'HYJK'
  1525. }
  1526. this.form.businessTypeCode = 'HYJK'
  1527. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  1528. // this.searchSplit()
  1529. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  1530. // 费用 收 赋值数据
  1531. this.form.feeCenterListD.map((row, index) => {
  1532. row.dc = 'D'
  1533. row.sort = Number(index) + 1
  1534. row.businessType = this.form.businessType // 业务类型
  1535. row.billType = this.form.billType // 单据类型
  1536. row.billNo = this.form.billNo // 单据编号
  1537. row.billDate = this.form.billDate
  1538. row.billCorpId = this.form.corpId // 主表客户 id
  1539. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  1540. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  1541. row.lineId = this.form.lineId // 航线 id
  1542. row.lineCnName = this.form.lineCnName // 航线中文名称
  1543. row.lineEnName = this.form.lineEnName // 航线英文名称
  1544. row.vesselId = this.form.vesselId // 船名 id
  1545. row.vesselCnName = this.form.vesselCnName // 中文船名
  1546. row.vesselEnName = this.form.vesselEnName // 英文船名
  1547. row.voyageNo = this.form.voyageNo // 航次
  1548. row.mblno = this.form.mblno // MB/L NO
  1549. row.hblno = this.form.hblno // HB/L NO
  1550. row.etd = this.form.etd // 开船日期
  1551. row.eta = this.form.eta // 到港日期
  1552. row.polId = this.form.polId // 装货港 id
  1553. row.polCode = this.form.polCode // 装货港代码
  1554. row.polCnName = this.form.polCnName // 装货港中文名称
  1555. row.polEnName = this.form.polEnName // 装货港英文名称
  1556. row.podId = this.form.podId // 卸货港 id
  1557. row.podCode = this.form.podCode // 卸货港代码
  1558. row.podCnName = this.form.podCnName // 卸货港中文名称
  1559. row.podEnName = this.form.podEnName // 卸货港英文名称
  1560. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  1561. // 数量 * 单价 = 净额
  1562. // 总税率 = 税率 + 附件税率
  1563. // 税额 = 净额 * 总税率
  1564. // 含税
  1565. if (row.curCode == 'CNY') {
  1566. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1567. } else {
  1568. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1569. }
  1570. // 净额
  1571. if (row.curCode == 'CNY') {
  1572. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1573. } else {
  1574. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1575. }
  1576. })
  1577. // 费用 付 赋值数据
  1578. this.form.feeCenterListC.map((row, index) => {
  1579. row.dc = 'C'
  1580. row.sort = Number(index) + 1
  1581. row.businessType = this.form.businessType // 业务类型
  1582. row.billType = this.form.billType // 单据类型
  1583. row.billNo = this.form.billNo // 单据编号
  1584. row.billDate = this.form.billDate // 单据日期
  1585. row.billCorpId = this.form.corpId // 主表客户 id
  1586. row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
  1587. row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
  1588. row.lineId = this.form.lineId // 航线 id
  1589. row.lineCnName = this.form.lineCnName // 航线中文名称
  1590. row.lineEnName = this.form.lineEnName // 航线英文名称
  1591. row.vesselId = this.form.vesselId // 船名 id
  1592. row.vesselCnName = this.form.vesselCnName // 中文船名
  1593. row.vesselEnName = this.form.vesselEnName // 英文船名
  1594. row.voyageNo = this.form.voyageNo // 航次
  1595. row.mblno = this.form.mblno // MB/L NO
  1596. row.hblno = this.form.hblno // HB/L NO
  1597. row.etd = this.form.etd // 开船日期
  1598. row.eta = this.form.eta // 到港日期
  1599. row.polId = this.form.polId // 装货港 id
  1600. row.polCode = this.form.polCode // 装货港代码
  1601. row.polCnName = this.form.polCnName // 装货港中文名称
  1602. row.polEnName = this.form.polEnName // 装货港英文名称
  1603. row.podId = this.form.podId // 卸货港 id
  1604. row.podCode = this.form.podCode // 卸货港代码
  1605. row.podCnName = this.form.podCnName // 卸货港中文名称
  1606. row.podEnName = this.form.podEnName // 卸货港英文名称
  1607. row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
  1608. // 数量 * 单价 = 净额
  1609. // 总税率 = 税率 + 附件税率
  1610. // 税额 = 净额 * 总税率
  1611. // 含税
  1612. if (row.curCode == 'CNY') {
  1613. row.amount = row.rmbAmount ? row.rmbAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1614. } else {
  1615. row.amount = row.usdAmount ? row.usdAmount : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1616. }
  1617. // 净额
  1618. if (row.curCode == 'CNY') {
  1619. row.amountNet = row.rmbAmountNet ? row.rmbAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1620. } else {
  1621. row.amountNet = row.usdAmountNet ? row.usdAmountNet : (Number(row.quantity) * Number(row.price)).toFixed(2)
  1622. }
  1623. })
  1624. this.pageLoading = true
  1625. billsSubmit(this.form).then(res => {
  1626. this.pageLoading = false
  1627. this.$message({
  1628. type: "success",
  1629. message: "操作成功!"
  1630. });
  1631. if (status == 'goBack') {
  1632. if (this.form.id) {
  1633. this.unLock({
  1634. moduleName: "SI",
  1635. tableName: "SI_order",
  1636. billId: this.form.id,
  1637. billNo: this.form.mblno
  1638. });
  1639. }
  1640. this.$emit('goBack')
  1641. }
  1642. // this.detailData.seeDisabled = true
  1643. this.billsDetailfun(res.data.data.id, status)
  1644. }).catch(err => {
  1645. this.pageLoading = false
  1646. })
  1647. },
  1648. CopyDocumentsfun() {
  1649. if (!this.form.id) {
  1650. return this.$message.error("请保存数据");
  1651. }
  1652. this.$DialogForm.show({
  1653. title: '复制单据',
  1654. width: '300px',
  1655. menuPosition: 'right',
  1656. data: { checkbox: '复制费用,复制箱型箱量' },
  1657. option: {
  1658. submitText: '确认',
  1659. emptyText: '取消',
  1660. span: 24,
  1661. column: [{
  1662. label: "复制类型",
  1663. prop: "checkbox",
  1664. type: 'checkbox',
  1665. dicData: [{
  1666. label: '复制费用',
  1667. value: '复制费用',
  1668. }, {
  1669. label: '复制箱型箱量',
  1670. value: '复制箱型箱量'
  1671. }],
  1672. dataType: 'string',
  1673. span: 24,
  1674. }]
  1675. },
  1676. beforeClose: (done) => {
  1677. done()
  1678. },
  1679. callback: (res) => {
  1680. res.done()
  1681. this.billsCopyBillsfun(this.form.id,res.data.checkbox)
  1682. res.close()
  1683. }
  1684. })
  1685. },
  1686. // 复制单据接口
  1687. billsCopyBillsfun(id,type) {
  1688. billsCopyBills({ id }).then(res => {
  1689. if (type == '复制费用'||type == '') {
  1690. res.data.data.preContainersList=[]
  1691. }
  1692. if (type == '复制箱型箱量'||type == '') {
  1693. res.data.data.feeCenterListD=[]
  1694. res.data.data.feeCenterListC=[]
  1695. }
  1696. this.form = res.data.data;
  1697. this.pageLoading = false
  1698. // this.searchMontage() // 下拉 中文名称和编号拼接
  1699. // 配箱最上面可以编辑
  1700. for (let item of this.form.containersList) {
  1701. item.edit = false
  1702. }
  1703. // 先把状态改成可以编辑,然后判断是否可以编辑
  1704. this.generateBillsfalse = false
  1705. // 应收
  1706. for (let item of this.form.feeCenterListD) {
  1707. // 判断是否生成了账单
  1708. if (item.accStatus == 1) {
  1709. this.columnforfun('corpCnName').disabled = true
  1710. this.columnforfun('srcType').disabled = true
  1711. this.columnforfun('mblno').disabled = true
  1712. this.columnforfun('teamName').disabled = true
  1713. this.columnforfun('refno').disabled = true
  1714. this.generateBillsfalse = true
  1715. }
  1716. if (item.curCode == 'CNY') {
  1717. this.$set(item, 'rmbAmount', item.amount)
  1718. this.$set(item, 'usdAmount', '')
  1719. this.$set(item, 'rmbAmountNet', item.amountNet)
  1720. this.$set(item, 'usdAmountNet', '')
  1721. } else {
  1722. this.$set(item, 'usdAmount', item.amount)
  1723. this.$set(item, 'rmbAmount', '')
  1724. this.$set(item, 'usdAmountNet', item.amountNet)
  1725. this.$set(item, 'rmbAmountNet', '')
  1726. }
  1727. item.edit = false
  1728. }
  1729. // 应付
  1730. for (let item of this.form.feeCenterListC) {
  1731. // 判断是否生成了账单
  1732. if (item.accStatus == 1) {
  1733. this.generateBillsfalse = true
  1734. this.columnforfun('corpCnName').disabled = true
  1735. this.columnforfun('srcType').disabled = true
  1736. this.columnforfun('mblno').disabled = true
  1737. this.columnforfun('teamName').disabled = true
  1738. this.columnforfun('refno').disabled = true
  1739. }
  1740. if (item.curCode == 'CNY') {
  1741. this.$set(item, 'rmbAmount', item.amount)
  1742. this.$set(item, 'usdAmount', '')
  1743. this.$set(item, 'rmbAmountNet', item.amountNet)
  1744. this.$set(item, 'usdAmountNet', '')
  1745. } else {
  1746. this.$set(item, 'usdAmount', item.amount)
  1747. this.$set(item, 'rmbAmount', '')
  1748. this.$set(item, 'usdAmountNet', item.amountNet)
  1749. this.$set(item, 'rmbAmountNet', '')
  1750. }
  1751. item.edit = false
  1752. }
  1753. // 文件中心
  1754. for (let item of this.form.filesList) {
  1755. this.$set(item, 'edit', false)
  1756. }
  1757. })
  1758. },
  1759. // 详情接口
  1760. async billsDetailfun(id, status) {
  1761. const res = await billsDetail(id)
  1762. this.form = res.data.data;
  1763. this.copyFormData = JSON.parse(JSON.stringify(res.data.data))
  1764. this.inLock()
  1765. // 如果已经请核就禁用按钮
  1766. // if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  1767. // this.detailData.seeDisabled = true
  1768. // }else {
  1769. // this.detailData.seeDisabled = false
  1770. // }
  1771. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  1772. this.columnforfun('corpCnName').disabled = true
  1773. this.columnforfun('srcType').disabled = true
  1774. this.columnforfun('mblno').disabled = true
  1775. this.columnforfun('teamName').disabled = true
  1776. this.columnforfun('refno').disabled = true
  1777. this.generateBillsfalse = true
  1778. this.pleasereviewType = true // 请核禁用
  1779. } else {
  1780. // 判断是否可以编辑
  1781. this.columnforfun('corpCnName').disabled = false
  1782. this.columnforfun('srcType').disabled = false
  1783. this.columnforfun('mblno').disabled = false
  1784. this.columnforfun('teamName').disabled = false
  1785. this.columnforfun('refno').disabled = false
  1786. this.generateBillsfalse = false
  1787. this.pleasereviewType = false
  1788. }
  1789. this.pageLoading = false
  1790. // this.searchMontage() // 下拉 中文名称和编号拼接
  1791. // 配箱最上面可以编辑
  1792. for (let item of this.form.containersList) {
  1793. item.edit = false
  1794. }
  1795. // 配箱最下面的
  1796. for (let item of this.form.waitingBoxList) {
  1797. this.$set(item, 'editQuantity', item.quantity)
  1798. this.$set(item, 'editGrossWeight', item.grossWeight)
  1799. this.$set(item, 'editMeasurement', item.measurement)
  1800. this.$set(item, 'edit', false)
  1801. }
  1802. // 应收
  1803. for (let item of this.form.feeCenterListD) {
  1804. // 判断是否生成了账单
  1805. if (item.accStatus == 1) {
  1806. this.columnforfun('corpCnName').disabled = true
  1807. this.columnforfun('srcType').disabled = true
  1808. this.columnforfun('mblno').disabled = true
  1809. this.columnforfun('teamName').disabled = true
  1810. this.columnforfun('refno').disabled = true
  1811. this.generateBillsfalse = true
  1812. }
  1813. if (item.curCode == 'CNY') {
  1814. this.$set(item, 'rmbAmount', item.amount)
  1815. this.$set(item, 'usdAmount', '')
  1816. this.$set(item, 'rmbAmountNet', item.amountNet)
  1817. this.$set(item, 'usdAmountNet', '')
  1818. } else {
  1819. this.$set(item, 'usdAmount', item.amount)
  1820. this.$set(item, 'rmbAmount', '')
  1821. this.$set(item, 'usdAmountNet', item.amountNet)
  1822. this.$set(item, 'rmbAmountNet', '')
  1823. }
  1824. item.edit = false
  1825. }
  1826. // 应付
  1827. for (let item of this.form.feeCenterListC) {
  1828. // 判断是否生成了账单
  1829. if (item.accStatus == 1) {
  1830. this.generateBillsfalse = true
  1831. this.columnforfun('corpCnName').disabled = true
  1832. this.columnforfun('srcType').disabled = true
  1833. this.columnforfun('mblno').disabled = true
  1834. this.columnforfun('teamName').disabled = true
  1835. this.columnforfun('refno').disabled = true
  1836. }
  1837. if (item.curCode == 'CNY') {
  1838. this.$set(item, 'rmbAmount', item.amount)
  1839. this.$set(item, 'usdAmount', '')
  1840. this.$set(item, 'rmbAmountNet', item.amountNet)
  1841. this.$set(item, 'usdAmountNet', '')
  1842. } else {
  1843. this.$set(item, 'usdAmount', item.amount)
  1844. this.$set(item, 'rmbAmount', '')
  1845. this.$set(item, 'usdAmountNet', item.amountNet)
  1846. this.$set(item, 'rmbAmountNet', '')
  1847. }
  1848. item.edit = false
  1849. }
  1850. // 文件中心
  1851. this.$refs.filescenter.getData(res.data.data)
  1852. for (let item of this.form.filesList) {
  1853. this.$set(item, 'edit', false)
  1854. }
  1855. if (status == 'toAddEdit') {
  1856. this.$emit(status)
  1857. }
  1858. this.oldForm = this.deepClone(this.form);
  1859. },
  1860. // tbas切换
  1861. handleClick(tba, event) {
  1862. },
  1863. // 大tbas切换
  1864. bigHandleClick() {
  1865. if (this.bigtabs == 'fd') {
  1866. if (this.form.id) {
  1867. this.billsListAllfun(this.form.id)
  1868. }
  1869. }
  1870. if (this.bigtabs == 'dz') {
  1871. if (this.form.id) {
  1872. this.$refs.documentCenter.reportslogListfun({ currentPage: 1, pageSize: 10 })
  1873. }
  1874. }
  1875. },
  1876. // 获取不分页的分单列表
  1877. billsListAllfun(masterId) {
  1878. billsListAll({ masterId }).then(res => {
  1879. this.billsListAllData = res.data.data
  1880. })
  1881. },
  1882. },
  1883. }
  1884. </script>
  1885. <style scoped lang="scss">
  1886. ::v-deep .el-tabs--border-card>.el-tabs__content {
  1887. padding: 4px !important;
  1888. }
  1889. .scrollable-container {
  1890. height: 84vh;
  1891. /* 设置容器高度 */
  1892. overflow-y: auto;
  1893. /* 添加垂直滚动条 */
  1894. }
  1895. .borderless {
  1896. height: 100%;
  1897. box-sizing: border-box
  1898. }
  1899. .customer-main {
  1900. margin-bottom: 15px;
  1901. }
  1902. .demo-ruleForm {
  1903. font-size: 14px;
  1904. }
  1905. .margintop {
  1906. margin-top: 0px !important;
  1907. }
  1908. ::v-deep.el-form-item {
  1909. margin-bottom: 0;
  1910. }
  1911. ::v-deep .basic-container .el-card__body {
  1912. padding: 6px 20px;
  1913. }
  1914. ::v-deep .el-tabs__header {
  1915. margin: 0 0 5px;
  1916. }
  1917. .isShow {
  1918. display: none;
  1919. }
  1920. </style>