billsDetails.vue 101 KB

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