billsDetails.vue 150 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165
  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" @click="addEdit">新 建
  18. </el-button>
  19. <el-button type="success" size="small" style="margin-right: 8px" @click="CopyDocumentsfun">复制单据
  20. </el-button>
  21. <el-dropdown style="line-height: 0" v-if="
  22. saberTenantId == '409341' || saberTenantId == '607913'
  23. ">
  24. <el-button size="small" type="warning" style="margin-right: 8px"
  25. :disabled="form.status > 0 || showLock || !form.id">
  26. 导入模板<i class="el-icon-arrow-down el-icon--right"></i>
  27. </el-button>
  28. <el-dropdown-menu slot="dropdown">
  29. <el-dropdown-item v-for="item in imporiData" :key="item.id"
  30. @click.native="importData(item.id)">{{ item.name }}
  31. </el-dropdown-item>
  32. </el-dropdown-menu>
  33. </el-dropdown>
  34. <!-- <el-dropdown style="line-height: 0">
  35. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  36. :disabled="!form.id || showLock">
  37. 发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
  38. </el-button>
  39. <el-dropdown-menu slot="dropdown">
  40. <el-dropdown-item v-for="item in ediData_SO" :key="item.id" class="dropdown-max"
  41. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  42. </el-dropdown-item>
  43. </el-dropdown-menu>
  44. </el-dropdown>
  45. <el-dropdown style="line-height: 0">
  46. <el-button size="small" type="success" style="margin-right: 8px" :loading="saveLoading"
  47. :disabled="!form.id || showLock">
  48. 发送 SI EDI<i class="el-icon-arrow-down el-icon--right"></i>
  49. </el-button>
  50. <el-dropdown-menu slot="dropdown">
  51. <el-dropdown-item v-for="item in ediData_SI" :key="item.id" class="dropdown-max"
  52. @click.native="editypesSendingEdifun(item)">{{ item.cnName }}
  53. </el-dropdown-item>
  54. </el-dropdown-menu>
  55. </el-dropdown> -->
  56. <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id"
  57. @click="previewDialogfun">预 览
  58. </el-button>
  59. <el-button v-if="form.id && form.receiveStatus == '录入'" size="small" type="success"
  60. @click.stop="allClick('接收')">接收
  61. </el-button>
  62. <el-button v-if="form.id && form.receiveStatus == '已接收'" size="small" type="danger"
  63. @click.stop="allClick('撤销接收')">撤销接收
  64. </el-button>
  65. <el-button v-if="form.id && form.changeOrdersStatus == '可换单'" size="small" type="warning"
  66. @click.stop="allClick('换单')">换单
  67. </el-button>
  68. <el-button v-if="form.id && form.changeOrdersStatus == '已换单'" size="small" type="danger"
  69. @click.stop="allClick('撤销换单')">撤销换单
  70. </el-button>
  71. <el-button v-if="
  72. form.id && form.returningSecurityMoneyStatus == '可退押'
  73. " size="small" type="info" @click.stop="allClick('退押')">退押
  74. </el-button>
  75. <el-button v-if="
  76. form.id && form.returningSecurityMoneyStatus == '已退押'
  77. " size="small" type="danger" @click.stop="allClick('撤销退押')">撤销退押
  78. </el-button>
  79. <el-button size="small" type="warning" :disabled="!form.id || detailData.seeDisabled || showLock"
  80. v-if="form.status == 1 && form.billType != 'MH'" @click.stop="revokeDocumentApproval">撤销单据请核
  81. </el-button>
  82. <el-button size="small" type="success" :disabled="!form.id || detailData.seeDisabled || showLock" v-if="
  83. form.status == 0 ||
  84. (form.status == 4 && form.billType != 'MH')
  85. " @click.stop="DocumentApproval">单据请核
  86. </el-button>
  87. <el-button size="small" type="primary" style="margin-right: 8px"
  88. :disabled="detailData.seeDisabled || showLock" :loading="saveLoading" @click="editCustomer">保 存
  89. </el-button>
  90. <el-dropdown style="line-height: 0" v-if="form.billType != 'MH'">
  91. <el-button type="warning" :loading="saveLoading" :disabled="!form.id" size="small">
  92. 审 批<i class="el-icon-arrow-down el-icon--right"></i>
  93. </el-button>
  94. <el-dropdown-menu slot="dropdown">
  95. <el-dropdown-item @click.native="
  96. (checkScheduleDialog = true),
  97. (checkId = form.id)
  98. ">审核进度
  99. </el-dropdown-item>
  100. </el-dropdown-menu>
  101. </el-dropdown>
  102. </div>
  103. </div>
  104. <div style="margin-top: 50px">
  105. <el-tabs type="border-card" v-model="bigtabs" @tab-click="bigHandleClick">
  106. <el-tab-pane label="委托信息" name="wt" class="scrollable-container">
  107. <div>
  108. <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm" :disabled="showLock">
  109. <containerTitle title="基础资料"></containerTitle>
  110. <basic-container>
  111. <el-row :gutter="60">
  112. <el-col v-for="(item,
  113. index) in basicData.column" :key="index" :span="8">
  114. <!--数组-->
  115. <div v-if="item instanceof Array"
  116. style="display: flex;align-items: center;justify-content: space-between">
  117. <el-row>
  118. <el-col :span="item[0].span
  119. ? item[0].span
  120. : 12
  121. ">
  122. <el-form-item :label="item[0].label" :prop="item[0].prop"
  123. :rules="item[0].rules" :label-width="item[0].labelWidth
  124. ">
  125. <span slot="label" v-if="item[0].label">
  126. <span v-if="
  127. item[0]
  128. .label ==
  129. 'HB/L NO'
  130. " style="color: #4c9e44;cursor: pointer;text-decoration: underline;"
  131. @click="
  132. applyforfun(
  133. item[0]
  134. .label
  135. )
  136. ">{{
  137. form.hblno
  138. ? "删除"
  139. : "申请"
  140. }}
  141. {{
  142. item[0]
  143. .label
  144. }}
  145. </span>
  146. <span v-else style="color: #1e9fff">{{
  147. item[0]
  148. .label
  149. }}</span>
  150. </span>
  151. <span v-if="
  152. item[0].type ==
  153. 'button'
  154. "></span>
  155. <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
  156. <!-- size="mini" type="success" icon="el-icon-circle-plus" circle-->
  157. <!-- @click="applyforfun(item[0].label)" >-->
  158. <!--</el-button>-->
  159. <search-query v-else-if="
  160. item[0].type ==
  161. 'select'
  162. " :datalist="item[0].dicData
  163. " :selectValue="form[
  164. item[0].prop
  165. ]
  166. " :filterable="true" :allowCreate="item[0]
  167. .allowCreate ||
  168. false
  169. " :remote="true" :disabled="detailData.seeDisabled ||
  170. item[0]
  171. .disabled
  172. " :buttonIf="false" :placeholder="`${item[0]
  173. .text ||
  174. ''}`
  175. " :forParameter="item[0]
  176. .forParameter
  177. " @remoteMethod="
  178. remoteMethod(
  179. $event,
  180. item[0].prop
  181. )
  182. " @corpChange="
  183. corpChange(
  184. $event,
  185. item[0].prop
  186. )
  187. " @corpFocus="
  188. remoteMethod(
  189. $event,
  190. item[0].prop
  191. )
  192. ">
  193. </search-query>
  194. <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]
  195. " size="small" autocomplete="off"
  196. :disabled="detailData.seeDisabled || item[0].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
  197. :placeholder="item[0].text || ''"></el-input>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="item[1].span
  201. ? item[1].span
  202. : 12
  203. ">
  204. <el-form-item :label="item[1].label" :prop="item[1].prop"
  205. :rules="item[1].rules" :label-width="item[1].labelWidth
  206. ">
  207. <span slot="label" v-if="item[1].label">
  208. <span style="color: #1e9fff">{{
  209. item[1]
  210. .label
  211. }}</span>
  212. </span>
  213. <el-date-picker v-if="
  214. item[1].type ==
  215. 'date'
  216. " v-model="form[
  217. item[1].prop
  218. ]
  219. " clearable style="width: 100%;" type="date" size="small"
  220. :disabled="detailData.seeDisabled ||
  221. item[1]
  222. .disabled
  223. " value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  224. </el-date-picker>
  225. <search-query v-else-if="item[1].type == 'select'"
  226. :datalist="item[1].dicData"
  227. :selectValue="form[item[1].prop]" :filterable="true"
  228. :remote="true"
  229. :disabled="detailData.seeDisabled || item[1].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
  230. :buttonIf="false" :placeholder="`${item[1].text || ''}`"
  231. :forParameter="item[1].forParameter"
  232. @remoteMethod="remoteMethod($event, item[1].prop)"
  233. @corpChange="corpChange($event, item[1].prop)"
  234. @corpFocus="remoteMethod($event, item[1].prop)">
  235. </search-query>
  236. <tree-select v-else-if="
  237. item[1].type ==
  238. 'tree'
  239. " v-model="form[
  240. item[1].prop
  241. ]
  242. " :data="item[1].dicData
  243. " :props="item[1]
  244. .forParameter
  245. " nodeKey="title" size="small" :clearable="false"
  246. :disabled="detailData.seeDisabled ||
  247. item[1]
  248. .disabled
  249. " :multiple="false" :placeholder="`${item[1]
  250. .text ||
  251. ''}`
  252. " @input="
  253. corpChange(
  254. $event,
  255. item[1].prop
  256. )
  257. ">
  258. </tree-select>
  259. <el-input v-else type="age" style="width: 100%;" v-model="form[
  260. item[1].prop
  261. ]
  262. " size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  263. item[1]
  264. .disabled
  265. " :placeholder="item[1].text ||
  266. ''
  267. "></el-input>
  268. </el-form-item>
  269. </el-col>
  270. <el-col v-if="item[2]" :span="item[2].span
  271. ? item[2].span
  272. : 12
  273. ">
  274. <el-form-item :label="item[2].label" :prop="item[2].prop"
  275. :rules="item[2].rules" :label-width="item[2].labelWidth
  276. ">
  277. <span slot="label" v-if="item[2].label">
  278. <span style="color: #1e9fff">{{
  279. item[2]
  280. .label
  281. }}</span>
  282. </span>
  283. <search-query v-if="
  284. item[2].type ==
  285. 'select'
  286. " :datalist="item[2].dicData
  287. " :selectValue="form[
  288. item[2].prop
  289. ]
  290. " :filterable="true" :clearable="false" :remote="true"
  291. :disabled="detailData.seeDisabled ||
  292. item[2]
  293. .disabled
  294. " :buttonIf="false" :forParameter="item[2]
  295. .forParameter
  296. " :placeholder="`${item[2]
  297. .text ||
  298. ''}`
  299. " @remoteMethod="
  300. remoteMethod(
  301. $event,
  302. item[2].prop
  303. )
  304. " @corpChange="
  305. corpChange(
  306. $event,
  307. item[2].prop
  308. )
  309. " @corpFocus="
  310. remoteMethod(
  311. $event,
  312. item[2].prop
  313. )
  314. ">
  315. </search-query>
  316. <el-input v-else type="age" style="width: 100%;" v-model="form[
  317. item[2].prop
  318. ]
  319. " size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  320. item[1]
  321. .disabled
  322. " :placeholder="item[2].text ||
  323. ''
  324. "></el-input>
  325. </el-form-item>
  326. </el-col>
  327. </el-row>
  328. </div>
  329. <!--对象-->
  330. <div v-else>
  331. <el-form-item v-if="item.display == true" :label="item.label"
  332. :prop="item.prop" :rules="item.rules">
  333. <span slot="label" v-if="item.label">
  334. <span style="color: #1e9fff">{{ item.label }}</span>
  335. </span>
  336. <search-query v-if="item.type == 'select'" ref="searchQueryRef"
  337. :datalist="item.dicData" :selectValue="form[item.prop]
  338. " :filterable="true" :clearable="false" :remote="true"
  339. :disabled="detailData.seeDisabled || item.disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
  340. :buttonIf="item.buttonIf" :forParameter="item.forParameter
  341. " :placeholder="`${item.text || ''}`
  342. " :joinData="item.joinData" @remoteMethod="
  343. remoteMethod(
  344. $event,
  345. item.prop
  346. )
  347. " @corpChange="
  348. corpChange(
  349. $event,
  350. item.prop
  351. )
  352. " @corpFocus="
  353. remoteMethod(
  354. $event,
  355. item.prop
  356. )
  357. " @eldialogConfirm="
  358. eldialogConfirm(
  359. item.slot
  360. )
  361. ">
  362. <bcorps v-show="item.slot ==
  363. 'bcorps'
  364. " ref="bcorps" :eldialog="true" @selectionChange="
  365. eldialogMultipleChoice(
  366. $event,
  367. item.slot
  368. )
  369. ">
  370. </bcorps>
  371. <bcorpstypedefine v-show="item.slot ==
  372. 'bcorpstypedefine'
  373. ">
  374. </bcorpstypedefine>
  375. </search-query>
  376. <el-input v-else type="age" style="width: 100%;"
  377. v-model="form[item.prop]" size="small" autocomplete="off" :disabled="detailData.seeDisabled ||
  378. item.disabled
  379. " :placeholder="item.text || ''
  380. "></el-input>
  381. </el-form-item>
  382. </div>
  383. </el-col>
  384. </el-row>
  385. </basic-container>
  386. </el-form>
  387. </div>
  388. <div class="customer-main margintop">
  389. <containerTitle title="详细"></containerTitle>
  390. <basic-container :showBtn="true">
  391. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  392. <el-tab-pane label="委托详情" name="first">
  393. <entrustment-lnformation :assemblyForm="form" :saberUserInfo="saberUserInfo"
  394. :detailData="detailData" :disabled="showLock"
  395. :generateBillsfalse="generateBillsfalse" @billsDetailfun="
  396. billsDetailfun(form.id)
  397. ">
  398. </entrustment-lnformation>
  399. </el-tab-pane>
  400. <el-tab-pane label="配箱信息" name="second">
  401. <DistributionBox :assemblyForm="form" :detailData="detailData" :showLock="showLock"
  402. :pleasereviewType="pleasereviewType" @billsAddfun="billsAddfun" @billsDetailfun="
  403. billsDetailfun(form.id)
  404. ">
  405. </DistributionBox>
  406. </el-tab-pane>
  407. <el-tab-pane label="MB/L信息" name="third">
  408. <mbinformation :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  409. </mbinformation>
  410. </el-tab-pane>
  411. <el-tab-pane label="报表管理" name="fourth" v-if="
  412. roleName.indexOf('admin') != -1
  413. ? true
  414. : roleName.indexOf('报表管理') != -1
  415. ? true
  416. : false
  417. ">
  418. <reports :id="form.id" :assemblyForm="form" :disabled="detailData.seeDisabled || showLock
  419. " businessValue="HYJK"></reports>
  420. </el-tab-pane>
  421. <!-- <el-tab-pane label="EDI 及其他" name="sixth">
  422. <edicode :assemblyForm="form" :detailData="detailData" :disabled="showLock">
  423. </edicode>
  424. </el-tab-pane> -->
  425. <el-tab-pane label="文件中心" name="seventh">
  426. <filescenter ref="filescenter" :assemblyForm="form" :pid="form.id"
  427. :detailData="detailData" :showLock="showLock"></filescenter>
  428. </el-tab-pane>
  429. </el-tabs>
  430. </basic-container>
  431. <basic-container :showBtn="true" v-if="
  432. activeName == 'first' || activeName == 'third'
  433. ">
  434. <formbottom :assemblyForm="form" :generateBillsfalse="generateBillsfalse"
  435. :disabled="showLock" :detailData="detailData"></formbottom>
  436. </basic-container>
  437. </div>
  438. </el-tab-pane>
  439. <el-tab-pane label="费用信息" name="fy" class="scrollable-container" v-if="
  440. roleName.indexOf('admin') != -1
  441. ? true
  442. : roleName.indexOf('应收修改') != -1 ||
  443. roleName.indexOf('应付修改') != -1 ||
  444. roleName.indexOf('应收查看') != -1 ||
  445. roleName.indexOf('应付查看') != -1
  446. ">
  447. <feecenter :assemblyForm="form" :copyFormData="copyFormData" :detailData="detailData"
  448. :disabled="detailData.seeDisabled || showLock" :pleasereviewType="pleasereviewType"
  449. :pid="form.id" @billsDetailfun="billsDetailfun(form.id)">
  450. </feecenter>
  451. </el-tab-pane>
  452. <el-tab-pane label="单证中心" name="dz" class="scrollable-container">
  453. <document-center ref="documentCenter" :detailData="detailData" :assemblyForm="form"
  454. :disabled="detailData.seeDisabled || showLock"></document-center>
  455. </el-tab-pane>
  456. <el-tab-pane label="分单列表" name="fd" v-if="form.billType == 'MM'" class="scrollable-container">
  457. <Split-list :detailData="detailData" :assemblyForm="form" :data="billsListAllData"
  458. :disabled="detailData.seeDisabled || showLock"
  459. @billsListAllfun="billsListAllfun(form.id)"></Split-list>
  460. </el-tab-pane>
  461. </el-tabs>
  462. </div>
  463. <!--导入模板-->
  464. <el-dialog title="导入模板" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  465. v-dialog-drag>
  466. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading"
  467. :upload-before="uploadBefore" :upload-after="onSuccess">
  468. </avue-form>
  469. </el-dialog>
  470. <!--审核弹窗-->
  471. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  472. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  473. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  474. </el-dialog>
  475. <!--预览报表弹窗-->
  476. <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
  477. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  478. <business-reports v-if="previewDialog" :id="form.id" :classifycode="getReportTypeByBigHandle()"
  479. :disabled="detailData.seeDisabled"></business-reports>
  480. </el-dialog>
  481. </div>
  482. </template>
  483. <script>
  484. import EntrustmentLnformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue";
  485. import mbinformation from "@/views/iosBasicData/OceanFreightImport/bills/assembly/mbinformation.vue";
  486. import reports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/reports.vue";
  487. import formbottom from "@/views/iosBasicData/OceanFreightImport/bills/assembly/formbottom.vue";
  488. import edicode from "@/views/iosBasicData/OceanFreightImport/bills/assembly/edicode.vue";
  489. import filescenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/filescenter.vue";
  490. import DistributionBox from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DistributionBox.vue";
  491. import feecenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue";
  492. import { getList as userGetList } from "@/api/system/user";
  493. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  494. import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
  495. import bcorps from "@/views/iosBasicData/bcorps/index.vue";
  496. import bcorpstypedefine from "@/views/iosBasicData/bcorps/bcorpstypedefine.vue";
  497. import SplitList from "@/views/iosBasicData/OceanFreightImport/bills/assembly/SplitList.vue";
  498. import { getLazylist } from "@/api/basicData/agreement";
  499. import { getBcorpsList, getBcorpslistByType } from "@/api/iosBasicData/bcorps";
  500. import { getBlocationsList } from "@/api/iosBasicData/blocations";
  501. import { getBcorpsattnList } from "@/api/iosBasicData/bcorpsattn";
  502. import { getWorkDicts } from "@/api/system/dictbiz";
  503. import { getDeptLazyTree, getDeptTree, getLazyList } from "@/api/system/dept";
  504. import {
  505. billsCheckBills,
  506. billsCopyBills,
  507. billsDetail,
  508. billsGetBillNo,
  509. removeHblNo,
  510. billsListAll,
  511. billsRevokeCheckBills,
  512. editypesSendingEdi,
  513. billsSubmit,
  514. billsAdd,
  515. deptGetDetailPol,
  516. postSelectByUser,
  517. receive,
  518. revokeReceive,
  519. changeOrders,
  520. revokeChangeOrders,
  521. returningSecurityMoney,
  522. revokeReturningSecurityMoney
  523. } from "@/api/iosBasicData/bills";
  524. import { dateFormat } from "@/util/date";
  525. import checkSchedule from "@/components/checkH/checkSchedule.vue";
  526. import { getBvesselsList } from "@/api/iosBasicData/bvessels";
  527. import DocumentCenter from "@/views/iosBasicData/OceanFreightImport/bills/assembly/DocumentCenter.vue";
  528. import businessReports from "@/views/iosBasicData/OceanFreightImport/bills/assembly/businessReports.vue";
  529. import { popupReminder } from "@/util/messageReminder";
  530. import editypes from "@/views/iosBasicData/editypes/index.vue";
  531. import { editypesList } from "@/api/iosBasicData/editypes";
  532. import { verifyEnglish, checkFullWidthSymbols } from "@/util/date";
  533. import { contrastObj, contrastList } from "@/util/contrastData";
  534. import { selectListLos } from "@/api/approval/processConfig";
  535. import { isProcurement } from "@/api/basicData/configuration";
  536. import _ from "lodash";
  537. export default {
  538. components: {
  539. checkSchedule,
  540. SearchQuery,
  541. EntrustmentLnformation,
  542. formbottom,
  543. mbinformation,
  544. reports,
  545. edicode,
  546. filescenter,
  547. DistributionBox,
  548. feecenter,
  549. bcorps,
  550. bcorpstypedefine,
  551. SplitList,
  552. TreeSelect,
  553. DocumentCenter,
  554. businessReports,
  555. editypes
  556. },
  557. props: {
  558. detailData: {
  559. type: Object
  560. }
  561. },
  562. data() {
  563. return {
  564. verifySymbolStatus: 0,
  565. showLock: false,
  566. ediData: [], // edi 列表数据
  567. ediData_SO: [], // edi SO 列表数据
  568. ediData_SI: [], // edi SI 列表数据
  569. previewDialog: false, // 预览报表弹窗开启
  570. generateBillsfalse: false, // 如果生成账单就禁用
  571. pleasereviewType: false, // 如果请核就禁用
  572. checkScheduleDialog: false, // 审核弹窗
  573. checkId: "", // 审核需要的id
  574. batchNo: "",
  575. billsListAllData: [], // 分单列表数据
  576. pageLoading: false, // 全屏的动画
  577. saveLoading: false,
  578. copyFormData: {}, // 详情的备份数据
  579. // 详情数据
  580. form: {
  581. branchId: JSON.parse(localStorage.getItem("sysitemData"))
  582. .deptId,
  583. branchName: JSON.parse(localStorage.getItem("sysitemData"))
  584. .deptName,
  585. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  586. operatorName: JSON.parse(localStorage.getItem("saber-userInfo"))
  587. .content.user_name, // OP 默认登录人
  588. operatorId: JSON.parse(localStorage.getItem("saber-userInfo"))
  589. .content.user_id, // OP 默认登录人
  590. businessType: "SI", // 业务类型 默认 海运出口
  591. businessTypes: "海运",
  592. billType: "DD", // 单据类型 默认 直单
  593. accDeptName: "", // 核算部门 默认登录人的部门
  594. issueType: "ORI", // 签单方式 默认 正本提单
  595. mpaymode: "PP", // 主单付费方式 默认PP
  596. hpaymode: "PP", // 分单付费方式 默认 PP
  597. loadType:
  598. JSON.parse(localStorage.getItem("saber-tenantId"))
  599. .content == "409341"
  600. ? "FCL"
  601. : "整箱", // 装箱方式默认整箱
  602. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  603. numberOfObl: "THREE", // 正本份数 默认 THREE
  604. numberOfCopy: "THREE", // 副本份数 默认 THREE
  605. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  606. cargoType: "dry", // 货物类型默认普货
  607. marks: "N/M",
  608. dgPackingLevel: "0", // 危险品包装等级
  609. serviceTerms: "CY-CY", // 服务方式
  610. filesList: [], // 文件中心
  611. feeCenterListD: [], // 收
  612. feeCenterListC: [], // 付
  613. preContainersList: [], // 箱
  614. feeCenterAmendList: [],
  615. containerNumberItemList: [],
  616. placeReceiptName: "",
  617. placeReceiptNamePrint: "",
  618. polEnName: "",
  619. polNamePrint: "",
  620. podEnName: "",
  621. podNamePrint: "",
  622. destinationName: "",
  623. destinationNamePrint: "",
  624. placeDeliveryName: "",
  625. placeDeliveryNamePrint: "",
  626. potEnName: "",
  627. potNamePrint: "",
  628. detail: {},
  629. hmmEdi: {}
  630. },
  631. oldForm: {
  632. branchId: JSON.parse(localStorage.getItem("sysitemData"))
  633. .deptId,
  634. branchName: JSON.parse(localStorage.getItem("sysitemData"))
  635. .deptName,
  636. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00", // 单据日期 默认 当天
  637. operatorName: JSON.parse(localStorage.getItem("saber-userInfo"))
  638. .content.user_name, // OP 默认登录人
  639. operatorId: JSON.parse(localStorage.getItem("saber-userInfo"))
  640. .content.user_id, // OP 默认登录人
  641. businessType: "SI", // 业务类型 默认 海运出口
  642. businessTypes: "海运",
  643. billType: "DD", // 单据类型 默认 直单
  644. accDeptName: "", // 核算部门 默认登录人的部门
  645. issueType: "ORI", // 签单方式 默认 正本提单
  646. mpaymode: "PP", // 主单付费方式 默认PP
  647. hpaymode: "PP", // 分单付费方式 默认 PP
  648. loadType:
  649. JSON.parse(localStorage.getItem("saber-tenantId"))
  650. .content == "409341"
  651. ? "FCL"
  652. : "整箱", // 装箱方式默认整箱
  653. srcType: "OWN", // 业务来源默认公司 来源 内容 默认登录人所属公司
  654. numberOfObl: "THREE", // 正本份数 默认 THREE
  655. numberOfCopy: "THREE", // 副本份数 默认 THREE
  656. seaType: "I", // 进出口 默认出口 E=出口 I=进口"
  657. cargoType: "dry", // 货物类型默认普货
  658. marks: "N/M",
  659. dgPackingLevel: "0", // 危险品包装等级
  660. serviceTerms: "CY-CY", // 服务方式
  661. filesList: [], // 文件中心
  662. feeCenterListD: [], // 收
  663. feeCenterListC: [], // 付
  664. preContainersList: [], // 箱
  665. feeCenterAmendList: [],
  666. containerNumberItemList: [],
  667. placeReceiptName: "",
  668. placeReceiptNamePrint: "",
  669. polEnName: "",
  670. polNamePrint: "",
  671. podEnName: "",
  672. podNamePrint: "",
  673. destinationName: "",
  674. destinationNamePrint: "",
  675. placeDeliveryName: "",
  676. placeDeliveryNamePrint: "",
  677. potEnName: "",
  678. potNamePrint: "",
  679. detail: {},
  680. hmmEdi: {}
  681. },
  682. // 循环的配置
  683. basicData: {
  684. column: [
  685. {
  686. label: "客户简称", // 调往来单位接口
  687. prop: "corpCnName",
  688. text: "请选择客户名称",
  689. type: "select",
  690. dicData: [],
  691. disabled: false,
  692. buttonIf: true,
  693. joinData: true,
  694. slot: "bcorps",
  695. display: true,
  696. forParameter: {
  697. key: "id",
  698. label: "cnName",
  699. value: "cnName",
  700. short: "shortName"
  701. },
  702. rules: [
  703. {
  704. required: true,
  705. message: " ",
  706. trigger: "blur"
  707. }
  708. ]
  709. },
  710. {
  711. label: "booking NO", // 订舱号
  712. text: "请输入booking NO",
  713. prop: "bookingNo",
  714. disabled: false,
  715. display: true
  716. },
  717. {
  718. label: "HB/L NO",
  719. text: "请输入MB/L NO",
  720. prop: "hblno",
  721. disabled: false,
  722. display: false
  723. },
  724. [
  725. {
  726. label: "MB/L NO",
  727. text: "请输入MB/L NO",
  728. prop: "mblno",
  729. span: 18,
  730. disabled: false
  731. },
  732. {
  733. label: "", // MB/L 付款方式 PP=预付, CC=到付, FPA, Other
  734. text: "请选择付款方式",
  735. prop: "mpaymode",
  736. type: "select",
  737. labelWidth: "30px",
  738. disabled: false,
  739. span: 6,
  740. dicData: [],
  741. forParameter: {
  742. key: "dictKey",
  743. label: "dictValue",
  744. value: "dictKey"
  745. }
  746. }
  747. ]
  748. // [
  749. // {
  750. // label: "OP", // 操作id 用户管理下拉 模糊搜索
  751. // text: "请选择OP",
  752. // prop: "operatorName",
  753. // type: 'select',
  754. // dicData: [],
  755. // disabled: false,
  756. // forParameter: {
  757. // key: 'id',
  758. // label: 'name',
  759. // value: 'name',
  760. // },
  761. // rules: [{
  762. // required: true,
  763. // message: " ",
  764. // trigger: "blur"
  765. // }]
  766. // },
  767. // {
  768. // label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
  769. // text: "请选择核算部门",
  770. // prop: "accDeptName",
  771. // type: 'tree',
  772. // dicData: [],
  773. // disabled: false,
  774. // clearable: false,
  775. // forParameter: {
  776. // label: "title",
  777. // children: 'children'
  778. // },
  779. // rules: [{
  780. // required: true,
  781. // message: " ",
  782. // trigger: "blur"
  783. // }]
  784. // },
  785. // ],
  786. ]
  787. },
  788. activeName: "first",
  789. bigtabs: "wt",
  790. saberUserInfo: {}, // 当前登录人信息
  791. roleName: [], // 当前的角色权限
  792. // 需要加判断是否必填的数据
  793. messageData: [
  794. {
  795. name: "客户",
  796. value: "corpCnName"
  797. },
  798. {
  799. name: "业务来源",
  800. value: "srcType"
  801. },
  802. {
  803. name: "MBLNO",
  804. value: "mblno"
  805. },
  806. // {
  807. // name: 'booking NO',
  808. // value: 'bookingNo',
  809. // },
  810. // {
  811. // name: 'REF MBLNO',
  812. // value: 'refno',
  813. // },
  814. {
  815. name: "船名(VSL)",
  816. value: "vesselCnName"
  817. },
  818. {
  819. name: "航次(VOY)",
  820. value: "voyageNo"
  821. },
  822. // {
  823. // name: 'ETD',
  824. // value: 'etd',
  825. // },
  826. {
  827. name: "装货港",
  828. value: "polCnName"
  829. },
  830. {
  831. name: "目的港",
  832. value: "destinationNamePrint"
  833. },
  834. // {
  835. // name: '包装单位',
  836. // value: 'packingUnit',
  837. // },
  838. {
  839. name: "船公司",
  840. value: "carrierCnName"
  841. },
  842. {
  843. name: "场站",
  844. value: "podCyCnName"
  845. }
  846. ],
  847. imporiData: [
  848. {
  849. id: 0,
  850. name: "导入 ONE 模板"
  851. },
  852. {
  853. id: 1,
  854. name: "导入 PIL 订舱模板"
  855. },
  856. {
  857. id: 2,
  858. name: "导入截单格式"
  859. },
  860. {
  861. id: 3,
  862. name: "导入海信提单"
  863. }
  864. ],
  865. excelForm: {},
  866. excelLoading: false,
  867. excelOption: {
  868. submitBtn: false,
  869. emptyBtn: false,
  870. column: [
  871. {
  872. label: "模板上传",
  873. prop: "excelFile",
  874. type: "upload",
  875. drag: true,
  876. loadText: "模板上传中,请稍等",
  877. span: 24,
  878. propsHttp: {
  879. res: "data"
  880. },
  881. tip: "请上传 .xls,.xlsx 标准格式文件",
  882. action: "api/blade-los/templateImport/importOne"
  883. }
  884. ]
  885. },
  886. excelBox: false,
  887. saberTenantId: 0
  888. };
  889. },
  890. watch: {
  891. // 监听业务类型 如果不是分单 可以编辑分单号
  892. "form.billType": {
  893. // 执行方法
  894. handler(oldValue, newValue) {
  895. if (oldValue == "MH") {
  896. this.basicData.column.forEach(item => {
  897. if (item.prop == "bookingNo") {
  898. item.display = false;
  899. }
  900. if (item.prop == "hblno") {
  901. item.display = true;
  902. }
  903. });
  904. } else {
  905. this.basicData.column.forEach(item => {
  906. if (item.prop == "bookingNo") {
  907. item.display = true;
  908. }
  909. if (item.prop == "hblno") {
  910. item.display = false;
  911. }
  912. });
  913. }
  914. // 只有分单不能编辑
  915. // if (oldValue == 'MH') {
  916. // this.columnforfun('hblno').disabled = true
  917. // } else {
  918. // this.columnforfun('hblno').disabled = false
  919. // }
  920. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  921. },
  922. deep: true, // 深度监听
  923. immediate: true // 第一次改变就执行
  924. },
  925. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  926. "form.preContainersList": {
  927. // 执行方法
  928. handler(oldValue, newValue) {
  929. // 判断是否是数组
  930. if (oldValue instanceof Array) {
  931. // 循环 有温度反 true 没有反 false
  932. const arr = oldValue.map(item => {
  933. if (Number(item.temperature)) {
  934. return true;
  935. } else {
  936. return false;
  937. }
  938. });
  939. console.log(arr, 12345);
  940. // 判断是否有温度
  941. if (arr[0]) {
  942. // 判断之前是否是冻货
  943. if (this.form.cargoType == "reefer") return;
  944. this.$message({
  945. message: "箱信息里有温度已将货描切换为冻柜",
  946. type: "warning"
  947. });
  948. this.$set(this.form, "cargoType", "reefer");
  949. }
  950. }
  951. },
  952. deep: true, // 深度监听
  953. immediate: true // 第一次改变就执行,
  954. }
  955. },
  956. created() {
  957. let Obj = JSON.parse(localStorage.getItem("saber-tenantId"));
  958. this.saberTenantId = Obj ? Obj.content : 0;
  959. this.saberUserInfo = JSON.parse(
  960. localStorage.getItem("saber-userInfo")
  961. ).content;
  962. this.roleName = localStorage.getItem("roleName").split(",");
  963. isProcurement({
  964. param: "verify.symbol"
  965. }).then(res => {
  966. this.verifySymbolStatus = res.data.data;
  967. });
  968. if (this.detailData.billType) {
  969. this.form.billType = this.detailData.billType;
  970. }
  971. // 判断是否员id, 有id 就不显示
  972. if (!this.form.id) {
  973. this.deptGetDetailPolfun(); // 收货地 装货港 当前登录人的默认
  974. this.userGetListfun(undefined, true); // 获取用户管理数据
  975. }
  976. this.ownDeptLazyTreefun(); // 获取公司数据
  977. this.getLazylistfun(); // 获取审核数据
  978. this.mpaymodeWorkDictsfun(); // 获取 付款方式字典
  979. this.srcTypeWorkDictsfun();
  980. // 获取EDI 数据
  981. this.editypesListfun();
  982. // 获取所属团队数据
  983. this.postSelectByUserfun();
  984. },
  985. methods: {
  986. inLock() {
  987. this.showLock = true;
  988. const data = {
  989. moduleName: "SI",
  990. tableName: "SI_order",
  991. billId: this.form.id,
  992. no: localStorage.getItem("browserID"),
  993. billNo: this.form.mblno
  994. };
  995. this.inDetailsKey(this.$route.name, {
  996. moduleName: "SI",
  997. tableName: "SI_order",
  998. billId: this.form.id,
  999. billNo: this.form.mblno
  1000. });
  1001. this.checkLock(data).then(res => {
  1002. if (res.data.code == 200) {
  1003. this.onLock(data).then(res => {
  1004. if (res.data.code == 200) {
  1005. this.showLock = false;
  1006. }
  1007. });
  1008. }
  1009. });
  1010. },
  1011. addEdit() {
  1012. if (this.form.billStatus >= 3) {
  1013. this.$emit("toAddEdit");
  1014. } else {
  1015. if (
  1016. contrastObj(this.form, this.oldForm) ||
  1017. contrastList(
  1018. this.form.preContainersList,
  1019. this.oldForm.preContainersList
  1020. ) ||
  1021. contrastList(
  1022. this.form.containersList,
  1023. this.oldForm.containersList
  1024. ) ||
  1025. contrastList(
  1026. this.form.feeCenterListC,
  1027. this.oldForm.feeCenterListC
  1028. ) ||
  1029. contrastList(
  1030. this.form.feeCenterListD,
  1031. this.oldForm.feeCenterListD
  1032. ) ||
  1033. contrastList(this.form.filesList, this.oldForm.filesList) ||
  1034. contrastList(
  1035. this.form.waitingBoxList,
  1036. this.oldForm.waitingBoxList
  1037. )
  1038. ) {
  1039. this.$confirm("是否需要保存?", "提示", {
  1040. confirmButtonText: "确定",
  1041. cancelButtonText: "取消",
  1042. type: "warning"
  1043. })
  1044. .then(() => {
  1045. this.editCustomer("toAddEdit");
  1046. })
  1047. .catch(() => {
  1048. this.$emit("toAddEdit");
  1049. });
  1050. } else {
  1051. this.$emit("toAddEdit");
  1052. }
  1053. }
  1054. },
  1055. CopyDocumentsfun() {
  1056. if (!this.form.id) {
  1057. return this.$message.error("请保存数据");
  1058. }
  1059. this.$DialogForm.show({
  1060. title: "复制单据",
  1061. width: "300px",
  1062. menuPosition: "right",
  1063. data: {
  1064. checkbox: "复制费用,复制箱型箱量"
  1065. },
  1066. option: {
  1067. submitText: "确认",
  1068. emptyText: "取消",
  1069. span: 24,
  1070. column: [
  1071. {
  1072. label: "复制类型",
  1073. prop: "checkbox",
  1074. type: "checkbox",
  1075. dicData: [
  1076. {
  1077. label: "复制费用",
  1078. value: "复制费用"
  1079. },
  1080. {
  1081. label: "复制箱型箱量",
  1082. value: "复制箱型箱量"
  1083. }
  1084. ],
  1085. dataType: "string",
  1086. span: 24
  1087. }
  1088. ]
  1089. },
  1090. beforeClose: done => {
  1091. done();
  1092. },
  1093. callback: res => {
  1094. res.done();
  1095. this.billsCopyBillsfun(this.form.id, res.data.checkbox);
  1096. res.close();
  1097. }
  1098. });
  1099. },
  1100. //文档导入
  1101. importData(row) {
  1102. if (row == 0) {
  1103. this.excelOption.column[0].action = `/api/blade-los/templateImport/importOne?billId=${this.form.id}`;
  1104. } else if (row == 1) {
  1105. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilBooking?billId=${this.form.id}`;
  1106. } else if (row == 2) {
  1107. this.excelOption.column[0].action = `/api/blade-los/templateImport/importPilCutOffOrders?billId=${this.form.id}`;
  1108. } else if (row == 3) {
  1109. this.excelOption.column[0].action = `/api/blade-los/templateImport/importHisenseBill?billId=${this.form.id}`;
  1110. }
  1111. this.excelBox = true;
  1112. },
  1113. uploadBefore(file, done, loading) {
  1114. done();
  1115. loading = true;
  1116. },
  1117. removeEmptyValues(obj) {
  1118. Object.keys(obj).forEach(key => {
  1119. if (
  1120. obj[key] === null ||
  1121. obj[key] === undefined ||
  1122. obj[key] === ""
  1123. ) {
  1124. delete obj[key];
  1125. }
  1126. });
  1127. return obj;
  1128. },
  1129. // 上传成功
  1130. onSuccess(res, done, loading, column) {
  1131. if (Object.keys(res).length) {
  1132. this.$confirm("此操作将覆盖数据, 是否继续?", "提示", {
  1133. confirmButtonText: "确定",
  1134. cancelButtonText: "取消",
  1135. type: "warning"
  1136. })
  1137. .then(() => {
  1138. // this.form = res;
  1139. Object.keys(res).forEach(key => {
  1140. if (res[key]) {
  1141. if (key != "detail") {
  1142. // this.form[key] = res[key]
  1143. this.$set(this.form, key, res[key]);
  1144. }
  1145. if (key == "detail") {
  1146. Object.keys(res.detail).forEach(key => {
  1147. if (res.detail[key]) {
  1148. // this.form.detail[key] = res.detail[key]
  1149. this.$set(
  1150. this.form.detail,
  1151. key,
  1152. res.detail[key]
  1153. );
  1154. }
  1155. });
  1156. }
  1157. }
  1158. });
  1159. this.excelBox = false;
  1160. this.$message.success("导入成功!");
  1161. loading = false;
  1162. done();
  1163. })
  1164. .catch(() => {
  1165. this.excelBox = false;
  1166. loading = false;
  1167. done();
  1168. });
  1169. } else {
  1170. loading = false;
  1171. done();
  1172. }
  1173. },
  1174. allClick(name) {
  1175. if (name == "接收") {
  1176. this.$confirm("是否接收?", "提示", {
  1177. confirmButtonText: "确定",
  1178. cancelButtonText: "取消",
  1179. type: "warning"
  1180. }).then(() => {
  1181. receive(this.form).then(res => {
  1182. this.$message({
  1183. type: "success",
  1184. message: "操作成功!"
  1185. });
  1186. this.billsDetailfun(this.form.id);
  1187. });
  1188. });
  1189. }
  1190. if (name == "撤销接收") {
  1191. this.$confirm("是否撤销接收?", "提示", {
  1192. confirmButtonText: "确定",
  1193. cancelButtonText: "取消",
  1194. type: "warning"
  1195. }).then(() => {
  1196. revokeReceive(this.form).then(res => {
  1197. this.$message({
  1198. type: "success",
  1199. message: "操作成功!"
  1200. });
  1201. this.logisticsDialog = false;
  1202. this.billsDetailfun(this.form.id);
  1203. });
  1204. });
  1205. }
  1206. if (name == "换单") {
  1207. this.$confirm("是否换单?", "提示", {
  1208. confirmButtonText: "确定",
  1209. cancelButtonText: "取消",
  1210. type: "warning"
  1211. }).then(() => {
  1212. changeOrders(this.form).then(res => {
  1213. this.$message({
  1214. type: "success",
  1215. message: "操作成功!"
  1216. });
  1217. this.billsDetailfun(this.form.id);
  1218. });
  1219. });
  1220. }
  1221. if (name == "撤销换单") {
  1222. this.$confirm("是否撤销换单?", "提示", {
  1223. confirmButtonText: "确定",
  1224. cancelButtonText: "取消",
  1225. type: "warning"
  1226. }).then(() => {
  1227. revokeChangeOrders(this.form).then(res => {
  1228. this.$message({
  1229. type: "success",
  1230. message: "操作成功!"
  1231. });
  1232. this.logisticsDialog = false;
  1233. this.billsDetailfun(this.form.id);
  1234. });
  1235. });
  1236. }
  1237. if (name == "退押") {
  1238. this.$confirm("是否退押?", "提示", {
  1239. confirmButtonText: "确定",
  1240. cancelButtonText: "取消",
  1241. type: "warning"
  1242. }).then(() => {
  1243. returningSecurityMoney(this.form).then(res => {
  1244. this.$message({
  1245. type: "success",
  1246. message: "操作成功!"
  1247. });
  1248. this.billsDetailfun(this.form.id);
  1249. });
  1250. });
  1251. }
  1252. if (name == "撤销退押") {
  1253. this.$confirm("是否撤销退押?", "提示", {
  1254. confirmButtonText: "确定",
  1255. cancelButtonText: "取消",
  1256. type: "warning"
  1257. }).then(() => {
  1258. revokeReturningSecurityMoney(this.form).then(res => {
  1259. this.$message({
  1260. type: "success",
  1261. message: "操作成功!"
  1262. });
  1263. this.logisticsDialog = false;
  1264. this.billsDetailfun(this.form.id);
  1265. });
  1266. });
  1267. }
  1268. },
  1269. // 获取EDI列表数据
  1270. editypesListfun() {
  1271. editypesList(1, 1000).then(res => {
  1272. this.ediData = res.data.data.records;
  1273. this.ediData_SO = res.data.data.records.filter(
  1274. r => r.groupName == "SO"
  1275. );
  1276. this.ediData_SI = res.data.data.records.filter(
  1277. r => r.groupName == "SI"
  1278. );
  1279. });
  1280. },
  1281. // 发送edi
  1282. editypesSendingEdifun(row) {
  1283. row.billId = this.form.id;
  1284. let msgsList = [];
  1285. if (
  1286. checkFullWidthSymbols(this.form.detail.hshipperDetails)
  1287. .hasFullWidth
  1288. ) {
  1289. let msg = [];
  1290. for (let item of checkFullWidthSymbols(
  1291. this.form.detail.hshipperDetails
  1292. ).positions) {
  1293. msg.push(`第${item.row}行的"${item.symbol}"`);
  1294. }
  1295. this.$message({
  1296. dangerouslyUseHTMLString: true,
  1297. message: `发货人:<br>${msg.join(
  1298. ";<br>"
  1299. )}<br>存在全角或汉字符号,请确认`,
  1300. type: "error"
  1301. });
  1302. return;
  1303. }
  1304. if (
  1305. checkFullWidthSymbols(this.form.detail.hconsigneeDetails)
  1306. .hasFullWidth
  1307. ) {
  1308. let msg = [];
  1309. for (let item of checkFullWidthSymbols(
  1310. this.form.detail.hconsigneeDetails
  1311. ).positions) {
  1312. msg.push(`第${item.row}行的"${item.symbol}"`);
  1313. }
  1314. this.$message({
  1315. dangerouslyUseHTMLString: true,
  1316. message: `收货人:<br>${msg.join(
  1317. ";<br>"
  1318. )}<br>存在全角或汉字符号,请确认`,
  1319. type: "error"
  1320. });
  1321. return;
  1322. }
  1323. if (
  1324. checkFullWidthSymbols(this.form.detail.hnotifyDetails)
  1325. .hasFullWidth
  1326. ) {
  1327. let msg = [];
  1328. for (let item of checkFullWidthSymbols(
  1329. this.form.detail.hnotifyDetails
  1330. ).positions) {
  1331. msg.push(`第${item.row}行的"${item.symbol}"`);
  1332. }
  1333. this.$message({
  1334. dangerouslyUseHTMLString: true,
  1335. message: `通知人:<br>${msg.join(
  1336. ";<br>"
  1337. )}<br>存在全角或汉字符号,请确认`,
  1338. type: "error"
  1339. });
  1340. return;
  1341. }
  1342. if (
  1343. checkFullWidthSymbols(this.form.detail.mshipperDetails)
  1344. .hasFullWidth
  1345. ) {
  1346. let msg = [];
  1347. for (let item of checkFullWidthSymbols(
  1348. this.form.detail.mshipperDetails
  1349. ).positions) {
  1350. msg.push(`第${item.row}行的"${item.symbol}"`);
  1351. }
  1352. if (msg.length > 0) {
  1353. this.$message({
  1354. dangerouslyUseHTMLString: true,
  1355. message: `MBL 发货人:<br>${msg.join(
  1356. ";<br>"
  1357. )}<br>存在全角或汉字符号,请确认`,
  1358. type: "error"
  1359. });
  1360. return;
  1361. }
  1362. }
  1363. if (
  1364. checkFullWidthSymbols(this.form.detail.mconsigneeDetails)
  1365. .hasFullWidth
  1366. ) {
  1367. let msg = [];
  1368. for (let item of checkFullWidthSymbols(
  1369. this.form.detail.mconsigneeDetails
  1370. ).positions) {
  1371. msg.push(`第${item.row}行的"${item.symbol}"`);
  1372. }
  1373. if (msg.length > 0) {
  1374. this.$message({
  1375. dangerouslyUseHTMLString: true,
  1376. message: `MBL 收货人:<br>${msg.join(
  1377. ";<br>"
  1378. )}<br>存在全角或汉字符号,请确认`,
  1379. type: "error"
  1380. });
  1381. return;
  1382. }
  1383. }
  1384. if (
  1385. checkFullWidthSymbols(this.form.detail.mnotifyDetails)
  1386. .hasFullWidth
  1387. ) {
  1388. let msg = [];
  1389. for (let item of checkFullWidthSymbols(
  1390. this.form.detail.mnotifyDetails
  1391. ).positions) {
  1392. msg.push(`第${item.row}行的"${item.symbol}"`);
  1393. }
  1394. if (msg.length > 0) {
  1395. this.$message({
  1396. dangerouslyUseHTMLString: true,
  1397. message: `MBL 通知人:<br>${msg.join(
  1398. ";<br>"
  1399. )}<br>存在全角或汉字符号,请确认`,
  1400. type: "error"
  1401. });
  1402. return;
  1403. }
  1404. }
  1405. if (checkFullWidthSymbols(this.form.marks).hasFullWidth) {
  1406. let msg = [];
  1407. for (let item of checkFullWidthSymbols(this.form.marks)
  1408. .positions) {
  1409. msg.push(`第${item.row}行的"${item.symbol}"`);
  1410. }
  1411. this.$message({
  1412. dangerouslyUseHTMLString: true,
  1413. message: `唛头:<br>${msg.join(
  1414. ";<br>"
  1415. )}<br>存在全角或汉字符号,请确认`,
  1416. type: "error"
  1417. });
  1418. return;
  1419. }
  1420. if (checkFullWidthSymbols(this.form.commodityDescr).hasFullWidth) {
  1421. let msg = [];
  1422. for (let item of checkFullWidthSymbols(this.form.commodityDescr)
  1423. .positions) {
  1424. msg.push(`第${item.row}行的"${item.symbol}"`);
  1425. }
  1426. this.$message({
  1427. dangerouslyUseHTMLString: true,
  1428. message: `货描:<br>${msg.join(
  1429. ";<br>"
  1430. )}<br>存在全角或汉字符号,请确认`,
  1431. type: "error"
  1432. });
  1433. return;
  1434. }
  1435. if (checkFullWidthSymbols(this.form.forwarding).hasFullWidth) {
  1436. let msg = [];
  1437. for (let item of checkFullWidthSymbols(this.form.forwarding)
  1438. .positions) {
  1439. msg.push(`第${item.row}行的"${item.symbol}"`);
  1440. }
  1441. this.$message({
  1442. dangerouslyUseHTMLString: true,
  1443. message: `FORWARDING:<br>${msg.join(
  1444. ";<br>"
  1445. )}<br>存在全角或汉字符号,请确认`,
  1446. type: "error"
  1447. });
  1448. return;
  1449. }
  1450. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  1451. msgsList.push("发货人");
  1452. }
  1453. if (!verifyEnglish(this.form.detail.hconsigneeDetails)) {
  1454. msgsList.push("收货人");
  1455. }
  1456. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  1457. msgsList.push("通知人");
  1458. }
  1459. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  1460. msgsList.push("MBL 发货人");
  1461. }
  1462. if (!verifyEnglish(this.form.detail.mconsigneeDetails)) {
  1463. msgsList.push("MBL 收货人");
  1464. }
  1465. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  1466. msgsList.push("MBL 通知人");
  1467. }
  1468. if (!verifyEnglish(this.form.marks)) {
  1469. msgsList.push("唛头");
  1470. }
  1471. if (!verifyEnglish(this.form.commodityDescr)) {
  1472. msgsList.push("货描");
  1473. }
  1474. if (!verifyEnglish(this.form.forwarding)) {
  1475. msgsList.push("FORWARDING");
  1476. }
  1477. if (msgsList.length > 0) {
  1478. this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  1479. return;
  1480. }
  1481. this.saveLoading = true;
  1482. editypesSendingEdi(row)
  1483. .then(res => {
  1484. this.saveLoading = false;
  1485. // 判断data是否有值,没有值说明不成功给个弹窗返回
  1486. if (!res.data.data) {
  1487. let text = res.data.msg.replace("\r\n", "<br>");
  1488. console.log(text);
  1489. this.$message({
  1490. type: "warning",
  1491. dangerouslyUseHTMLString: true,
  1492. message: text,
  1493. // 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>`,
  1494. duration: 5000
  1495. });
  1496. } else {
  1497. this.$message.success("操作成功,请去文件中心查看");
  1498. this.billsDetailfun(this.form.id); // 详情接口
  1499. }
  1500. })
  1501. .catch(err => {
  1502. this.saveLoading = false;
  1503. });
  1504. },
  1505. // 报表弹窗
  1506. previewDialogfun() {
  1507. this.getReportTypeByBigHandle("业务");
  1508. this.previewDialog = true;
  1509. },
  1510. //请核关闭
  1511. choceScheduleFun() {
  1512. this.checkScheduleDialog = false;
  1513. },
  1514. // 收货地 装货港 当前登录人的默认
  1515. deptGetDetailPolfun() {
  1516. deptGetDetailPol(this.saberUserInfo.dept_pid.split(",")[0]).then(
  1517. res => {
  1518. // 收货地
  1519. this.form.placeReceiptName = res.data.data.polEnName
  1520. ? res.data.data.polEnName.split(",")[0]
  1521. : null;
  1522. this.form.placeReceiptId = res.data.data.polId
  1523. ? res.data.data.polId.split(",")[0]
  1524. : null;
  1525. this.form.placeReceiptCode = res.data.data.polCode
  1526. ? res.data.data.polCode.split(",")[0]
  1527. : null;
  1528. this.form.placeReceiptNamePrint = res.data.data.polEnName
  1529. ? res.data.data.polEnName.split(",")[0]
  1530. : null;
  1531. // 装货港
  1532. this.form.polCnName = res.data.data.polCnName
  1533. ? res.data.data.polCnName.split(",")[0]
  1534. : null;
  1535. this.form.polEnName = res.data.data.polEnName
  1536. ? res.data.data.polEnName.split(",")[0]
  1537. : null;
  1538. this.form.polId = res.data.data.polId
  1539. ? res.data.data.polId.split(",")[0]
  1540. : null;
  1541. this.form.polCode = res.data.data.polCode
  1542. ? res.data.data.polCode.split(",")[0]
  1543. : null;
  1544. this.form.polNamePrint = res.data.data.polEnName
  1545. ? res.data.data.polEnName.split(",")[0]
  1546. : null;
  1547. // 签单地点 默认 装货港
  1548. this.$set(this.form, "issueAtId", this.form.polId);
  1549. this.$set(this.form, "issueAt", this.form.polEnName);
  1550. // 主单单付费地点 默认 如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
  1551. if (this.form.mpaymode == "PP") {
  1552. this.$set(this.form, "mpayplace", this.form.polEnName);
  1553. }
  1554. // 分单单付费地点 默认 如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
  1555. if (this.form.hpaymode == "PP") {
  1556. this.$set(this.form, "hpayplace", this.form.polEnName);
  1557. }
  1558. }
  1559. );
  1560. },
  1561. // 获取用户管理数据
  1562. userGetListfun(account = undefined, type = false) {
  1563. // userGetList(1, 10, { account }, this.saberUserInfo.dept_pid.split(',')[0]).then(res => {
  1564. // this.columnforfun('operatorName').dicData = res.data.data.records
  1565. // if (type) {
  1566. // // 核算部门 默认登录人的部门
  1567. // for (let item of this.columnforfun('operatorName').dicData) {
  1568. // if (item.name == this.form.operatorName) {
  1569. // this.$set(this.form, 'accDeptName', item.deptName)
  1570. // this.$set(this.form, 'accDept', item.deptId)
  1571. // this.$set(this.form, 'operatorDept', item.deptId.split(',').pop())
  1572. // this.$set(this.form, 'operatorDeptName', item.deptId)
  1573. // }
  1574. // }
  1575. // }
  1576. // })
  1577. },
  1578. // 获取所属岗位数据
  1579. postSelectByUserfun() {
  1580. postSelectByUser(
  1581. JSON.parse(localStorage.getItem("saber-userInfo")).content
  1582. .user_id
  1583. ).then(res => {
  1584. // this.columnforfun('teamName').dicData = res.data.data
  1585. // 判断是否有值,没有的话默认第一个
  1586. if (!this.form.teamName) {
  1587. this.$set(this.form, "teamId", res.data.data[0].id);
  1588. this.$set(this.form, "teamName", res.data.data[0].postName);
  1589. }
  1590. });
  1591. },
  1592. // 获取付款方式字典数据
  1593. mpaymodeWorkDictsfun() {
  1594. getWorkDicts("payment_method_los").then(res => {
  1595. this.columnforfun("mpaymode").dicData = res.data.data;
  1596. // this.columnforfun('hpaymode').dicData = res.data.data
  1597. });
  1598. },
  1599. // 获取核算部分数据 // 机构管理接口
  1600. getLazylistfun() {
  1601. // getDeptTree().then(res => {
  1602. // this.columnforfun('accDeptName').dicData = res.data.data
  1603. // })
  1604. },
  1605. // 获取客户名称数据 往来单位数据
  1606. getBcorpsListfun(cnName) {
  1607. getBcorpsList(1, 20, {
  1608. shortName: cnName,
  1609. status: 0
  1610. }).then(res => {
  1611. this.columnforfun("corpCnName").dicData = res.data.data.records;
  1612. });
  1613. },
  1614. // 获取客户联系人 客户OP
  1615. getBcorpsattnListfun(cname) {
  1616. // getBcorpsattnList(1, 10, { pid: this.form.corpId, cname }).then(res => {
  1617. // this.columnforfun('corpAttnName').dicData = res.data.data.records
  1618. // // if (res.data.data.records.length == 0) {
  1619. // // this.form.corpAttnName = ''
  1620. // // this.form.corpAttnId = ''
  1621. // // this.$set(this.form, 'corpAttnTel', '')
  1622. // // this.$set(this.form, 'corpAttnEmail', '')
  1623. // // return
  1624. // // }
  1625. // // this.form.corpAttnName = res.data.data.records[0].cname
  1626. // // this.form.corpAttnId = res.data.data.records[0].id
  1627. // // this.$set(this.form, 'corpAttnTel', res.data.data.records[0].tel)
  1628. // // this.$set(this.form, 'corpAttnEmail', res.data.data.records[0].email)
  1629. // })
  1630. },
  1631. // 获取地点信息
  1632. getBlocationsListfun(cnName) {
  1633. // getBlocationsList(1, 10, { cnName }).then(res => {
  1634. // this.columnforfun('mPayplace').dicData = res.data.data.records
  1635. // })
  1636. },
  1637. // 获取业务来源数据
  1638. srcTypeWorkDictsfun() {
  1639. // getWorkDicts('src_type_los').then(res => {
  1640. // this.columnforfun('srcType').dicData = res.data.data
  1641. // })
  1642. },
  1643. // 获取业务来源代理数据
  1644. agentBcorpsListfun(cnName) {
  1645. // let corpTypeName = '国内直接客户,国内同行及代理,国外直接客户,国外同行及代理'
  1646. // getBcorpslistByType(1, 20, { cnName, status: 0, corpTypeName }).then(res => {
  1647. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1648. // })
  1649. },
  1650. // 获取业务来源业务员数据
  1651. salesUserGetListfun(account) {
  1652. // if (this.$store.getters.userInfo.tenant_id === "263057") {
  1653. // userGetList(1, 10, { roleId: '业务员' }).then(res => {
  1654. // this.columnforfun('srcCnName').dicData = res.data.data.records
  1655. // })
  1656. // } else {
  1657. // selectListLos('业务员', account).then(res => {
  1658. // this.columnforfun('srcCnName').dicData = res.data.data
  1659. // })
  1660. // }
  1661. },
  1662. // 获取公司名称 用户管理左侧
  1663. ownDeptLazyTreefun() {
  1664. // getDeptLazyTree(0).then(res => {
  1665. // this.columnforfun('srcCnName').dicData = res.data.data
  1666. // // 来源 内容 默认登录人所属公司
  1667. // for (let item of this.columnforfun('srcCnName').dicData) {
  1668. // if (item.id == JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_pid.split(',')[0]) {
  1669. // this.$set(this.form, 'srcId', item.id)
  1670. // this.$set(this.form, 'srcCnName', item.title)
  1671. // this.$set(this.form, 'srcEnName', item.title)
  1672. // }
  1673. // }
  1674. // })
  1675. },
  1676. // 申请B/L NO
  1677. billsGetBillNofun() {
  1678. let billNoFormat = "";
  1679. if (this.form.cargoType == "dry") {
  1680. billNoFormat = "HYJK-PH";
  1681. } else if (this.form.cargoType == "danger") {
  1682. billNoFormat = "HYJK-WXP";
  1683. } else if (this.form.cargoType == "reefer") {
  1684. billNoFormat = "HYJK-DG";
  1685. }
  1686. billsGetBillNo({
  1687. businessTypeCode: "HYJK",
  1688. billNoFormat: billNoFormat
  1689. }).then(res => {
  1690. // this.columnforfun('hpaymode').disabled = false
  1691. this.$set(this.form, "hblno", res.data.data);
  1692. this.billsSubmitfun();
  1693. });
  1694. },
  1695. // 下拉多选弹窗的确认
  1696. eldialogConfirm(name) {
  1697. if (name == "bcorps") {
  1698. if (this.$refs.bcorps[0].isShow) {
  1699. console.log("列表确认");
  1700. this.form.corpCnName = this.$refs.bcorps[0].selectionList[0].cnName;
  1701. this.form.corpEnName = this.$refs.bcorps[0].selectionList[0].enName;
  1702. this.form.corpId = this.$refs.bcorps[0].selectionList[0].id;
  1703. this.form.corpCode = this.$refs.bcorps[0].selectionList[0].code;
  1704. this.form.corpSource = this.$refs.bcorps[0].selectionList[0].corpSource;
  1705. // 获取 客户op数据
  1706. this.getBcorpsattnListfun();
  1707. // 业务来源参数带出
  1708. this.$set(
  1709. this.form,
  1710. "srcType",
  1711. this.$refs.bcorps[0].selectionList[0].sourceType
  1712. );
  1713. this.$set(
  1714. this.form,
  1715. "srcId",
  1716. this.$refs.bcorps[0].selectionList[0].srcId
  1717. );
  1718. this.$set(
  1719. this.form,
  1720. "srcCnName",
  1721. this.$refs.bcorps[0].selectionList[0].srcCnName
  1722. );
  1723. this.$set(
  1724. this.form,
  1725. "srcEnName",
  1726. this.$refs.bcorps[0].selectionList[0].srcEnName
  1727. );
  1728. // this.columnforfun('srcType').disabled = false
  1729. // this.columnforfun('srcCnName').disabled = false
  1730. // 航线带出往来单位的优势航线
  1731. this.$set(
  1732. this.form,
  1733. "lineCnName",
  1734. this.$refs.bcorps[0].selectionList[0].advantageRoute
  1735. );
  1736. // 带出发货人数据
  1737. this.$set(
  1738. this.form.detail,
  1739. "hshipperId",
  1740. this.$refs.bcorps[0].selectionList[0].id
  1741. );
  1742. this.$set(
  1743. this.form.detail,
  1744. "hshipperCnName",
  1745. this.$refs.bcorps[0].selectionList[0].cnName
  1746. );
  1747. this.$set(
  1748. this.form.detail,
  1749. "hshipperEnName",
  1750. this.$refs.bcorps[0].selectionList[0].enName
  1751. );
  1752. this.$set(
  1753. this.form.detail,
  1754. "hshipperCode",
  1755. this.$refs.bcorps[0].selectionList[0].code
  1756. );
  1757. this.$set(
  1758. this.form.detail,
  1759. "hshipperDetails",
  1760. this.$refs.bcorps[0].selectionList[0].details
  1761. );
  1762. this.$set(
  1763. this.form.detail,
  1764. "hshipperCntyName",
  1765. this.$refs.bcorps[0].selectionList[0].cntyName
  1766. );
  1767. this.$set(
  1768. this.form.detail,
  1769. "hshipperCntyCode",
  1770. this.$refs.bcorps[0].selectionList[0].cntyCode
  1771. );
  1772. // this.columnforfun('corpAttnName').disabled = false
  1773. // this.columnforfun('corpAttnTel').disabled = false
  1774. // this.columnforfun('corpAttnEmail').disabled = false
  1775. } else {
  1776. console.log("详情确认");
  1777. console.log(this.$refs.bcorps, 962);
  1778. this.$refs.bcorps[0].$refs.detail.submitForm();
  1779. this.form.corpCnName = this.$refs.bcorps[0].$refs.detail.formData.cnName;
  1780. this.form.corpEnName = this.$refs.bcorps[0].$refs.detail.formData.enName;
  1781. this.form.corpId = this.$refs.bcorps[0].$refs.detail.formData.id;
  1782. this.form.corpCode = this.$refs.bcorps[0].$refs.detail.formData.code;
  1783. this.form.corpSource = this.$refs.bcorps[0].$refs.detail.formData.corpSource;
  1784. // 获取 客户op数据
  1785. this.getBcorpsattnListfun();
  1786. // 业务来源参数带出
  1787. this.$set(
  1788. this.form,
  1789. "srcType",
  1790. this.$refs.bcorps[0].$refs.detail.formData.sourceType
  1791. );
  1792. this.$set(
  1793. this.form,
  1794. "srcId",
  1795. this.$refs.bcorps[0].$refs.detail.formData.srcId
  1796. );
  1797. this.$set(
  1798. this.form,
  1799. "srcCnName",
  1800. this.$refs.bcorps[0].$refs.detail.formData.srcCnName
  1801. );
  1802. this.$set(
  1803. this.form,
  1804. "srcEnName",
  1805. this.$refs.bcorps[0].$refs.detail.formData.srcEnName
  1806. );
  1807. // this.columnforfun('srcType').disabled = false
  1808. // this.columnforfun('srcCnName').disabled = false
  1809. // 航线带出往来单位的优势航线
  1810. this.$set(
  1811. this.form,
  1812. "lineCnName",
  1813. this.$refs.bcorps[0].$refs.detail.formData
  1814. .advantageRoute
  1815. );
  1816. // 带出发货人数据
  1817. this.$set(
  1818. this.form.detail,
  1819. "hshipperId",
  1820. this.$refs.bcorps[0].$refs.detail.formData.id
  1821. );
  1822. this.$set(
  1823. this.form.detail,
  1824. "hshipperCnName",
  1825. this.$refs.bcorps[0].$refs.detail.formData.cnName
  1826. );
  1827. this.$set(
  1828. this.form.detail,
  1829. "hshipperEnName",
  1830. this.$refs.bcorps[0].$refs.detail.formData.enName
  1831. );
  1832. this.$set(
  1833. this.form.detail,
  1834. "hshipperCode",
  1835. this.$refs.bcorps[0].$refs.detail.formData.code
  1836. );
  1837. this.$set(
  1838. this.form.detail,
  1839. "hshipperDetails",
  1840. this.$refs.bcorps[0].$refs.detail.formData.details
  1841. );
  1842. this.$set(
  1843. this.form.detail,
  1844. "hshipperCntyName",
  1845. this.$refs.bcorps[0].$refs.detail.formData.cntyName
  1846. );
  1847. this.$set(
  1848. this.form.detail,
  1849. "hshipperCntyCode",
  1850. this.$refs.bcorps[0].$refs.detail.formData.cntyCode
  1851. );
  1852. // this.columnforfun('corpAttnName').disabled = false
  1853. // this.columnforfun('corpAttnTel').disabled = false
  1854. // this.columnforfun('corpAttnEmail').disabled = false
  1855. }
  1856. }
  1857. this.$refs.searchQueryRef[0].corpVisible = false;
  1858. },
  1859. // 下拉多选弹窗数据多选回调
  1860. eldialogMultipleChoice(list, name) {
  1861. if (name == "bcorps") {
  1862. let arr = [];
  1863. if (list.length > 1) {
  1864. this.$refs.bcorps[0].$refs.crud.toggleSelection(); // 先清空所以选择的数据
  1865. arr = [list[list.length - 1]]; // 获取最新点击的数组
  1866. this.$refs.bcorps[0].$refs.crud.toggleSelection(arr, true); // 把刚点击的数组变成选择状态
  1867. } else {
  1868. arr = list;
  1869. }
  1870. this.$refs.bcorps[0].selectionList = arr;
  1871. }
  1872. },
  1873. /* 远程模糊查询操作用户 */
  1874. remoteMethod(value, name) {
  1875. // if (name == 'operatorName') {
  1876. // this.userGetListfun(value)
  1877. // }
  1878. // else if (name == 'accDeptName') {
  1879. // this.getLazylistfun(value)
  1880. // }
  1881. if (name == "corpCnName") {
  1882. this.getBcorpsListfun(value);
  1883. }
  1884. // else if (name == 'mPayplace') {
  1885. // this.getBlocationsListfun(value)
  1886. // }
  1887. // else if (name == 'corpAttnName') {
  1888. // this.getBcorpsattnListfun(value)
  1889. // }
  1890. // else if (name == 'srcType') {
  1891. // this.srcTypeWorkDictsfun()
  1892. // }
  1893. // else if (name == 'srcCnName') {
  1894. // if (this.form.srcType == 'SALES') {
  1895. // // 业务员
  1896. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  1897. // this.salesUserGetListfun(value)
  1898. // } else if (this.form.srcType == 'AGENT') {
  1899. // // 代理
  1900. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  1901. // this.agentBcorpsListfun(value)
  1902. // } else if (this.form.srcType == 'OWN') {
  1903. // // 公司
  1904. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  1905. // this.ownDeptLazyTreefun()
  1906. // }
  1907. // } else if (name == 'teamName') {
  1908. // this.postSelectByUserfun()
  1909. // }
  1910. },
  1911. // 下拉的监听事件
  1912. corpChange(value, name) {
  1913. // if (name == 'operatorName') {
  1914. // // OP 下拉赋值 用户管理列表
  1915. // for (let item of this.columnforfun('operatorName').dicData) {
  1916. // if (item.name == value) {
  1917. // this.form.operatorName = item.name
  1918. // this.form.operatorId = item.id
  1919. // this.form.operatorDept = item.deptId.split(',').pop()
  1920. // this.form.operatorDeptName = item.deptName
  1921. // }
  1922. // }
  1923. // }
  1924. // else if (name == 'accDeptName') {
  1925. // // OP 下拉赋值 用户管理列表
  1926. // for (let item of this.columnforfun('accDeptName').dicData) {
  1927. // if (item.title == value) {
  1928. // this.form.accDeptName = item.title
  1929. // this.form.accDept = item.id
  1930. // }
  1931. // }
  1932. // }
  1933. if (name == "corpCnName") {
  1934. if (value) {
  1935. // this.columnforfun('corpAttnName').disabled = false
  1936. // this.columnforfun('corpAttnTel').disabled = false
  1937. // this.columnforfun('corpAttnEmail').disabled = false
  1938. } else {
  1939. // this.columnforfun('corpAttnName').disabled = true
  1940. // this.columnforfun('corpAttnTel').disabled = true
  1941. // this.columnforfun('corpAttnEmail').disabled = true
  1942. // 如果点击清空按钮把值赋值为空
  1943. this.form.corpCnName = "";
  1944. this.form.corpEnName = "";
  1945. this.form.corpId = "";
  1946. this.form.corpCode = "";
  1947. this.form.shortName = "";
  1948. this.form.corpSource = "";
  1949. // 清空 客户OP
  1950. // this.form.corpAttnName = ''
  1951. this.form.corpAttnId = "";
  1952. this.$set(this.form, "corpAttnTel", "");
  1953. this.$set(this.form, "corpAttnEmail", "");
  1954. // 清空 业务来源和来源详情
  1955. this.$set(this.form, "srcType", "");
  1956. this.$set(this.form, "srcId", "");
  1957. this.$set(this.form, "srcCnName", "");
  1958. this.$set(this.form, "srcEnName", "");
  1959. }
  1960. // 往来单位
  1961. for (let item of this.columnforfun("corpCnName").dicData) {
  1962. if (item.cnName == value) {
  1963. this.form.corpCnName = item.cnName;
  1964. this.form.corpEnName = item.enName;
  1965. this.form.corpId = item.id;
  1966. this.form.corpCode = item.code;
  1967. this.form.shortName = item.shortName;
  1968. this.form.corpSource = item.corpSource;
  1969. // 获取 客户op数据
  1970. this.getBcorpsattnListfun();
  1971. // 业务来源参数带出
  1972. this.$set(this.form, "srcType", item.sourceType);
  1973. this.$set(this.form, "srcId", item.srcId);
  1974. this.$set(this.form, "srcCnName", item.srcCnName);
  1975. this.$set(this.form, "srcEnName", item.srcEnName);
  1976. this.$set(
  1977. this.form,
  1978. "srcDeptId",
  1979. item.deptId.split(",").pop()
  1980. );
  1981. this.$set(this.form, "srcDeptName", item.deptName);
  1982. this.columnforfun("srcType").disabled = false;
  1983. this.columnforfun("srcCnName").disabled = false;
  1984. // 航线带出往来单位的优势航线
  1985. this.$set(this.form, "lineCnName", item.advantageRoute);
  1986. // 带出发货人数据
  1987. // this.$set(this.form,'hshipperId',item.id)
  1988. // this.$set(this.form,'hshipperCnName',item.cnName)
  1989. // this.$set(this.form,'hshipperEnName',item.enName)
  1990. // this.$set(this.form,'hshipperCode',item.code)
  1991. // this.$set(this.form,'hshipperDetails',item.details)
  1992. // this.$set(this.form,'hshipperCntyName',item.cntyName)
  1993. // this.$set(this.form,'hshipperCntyCode',item.cntyCode)
  1994. }
  1995. }
  1996. }
  1997. // else if (name == 'corpAttnName') {
  1998. // if (this.columnforfun('corpAttnName').dicData.length) {
  1999. // for (let item of this.columnforfun('corpAttnName').dicData) {
  2000. // if (item.cname == value) {
  2001. // this.form.corpAttnName = item.cname
  2002. // this.form.corpAttnId = item.id
  2003. // this.$set(this.form, 'corpAttnTel', item.tel)
  2004. // this.$set(this.form, 'corpAttnEmail', item.email)
  2005. // }
  2006. // }
  2007. // } else {
  2008. // if (value) {
  2009. // this.form.corpAttnName = value
  2010. // this.form.corpAttnId = null
  2011. // }
  2012. // }
  2013. // }
  2014. // else if (name == 'srcType') {
  2015. // if (!value) {
  2016. // this.$set(this.form, 'srcType', '')
  2017. // // this.columnforfun('srcCnName').disabled = true
  2018. // return
  2019. // }
  2020. // this.$set(this.form, 'srcId', '')
  2021. // this.$set(this.form, 'srcCnName', '')
  2022. // this.$set(this.form, 'srcEnName', '')
  2023. // this.form[name] = value
  2024. // if (value == 'OWN') {
  2025. // // 公司
  2026. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'title', value: 'title' }
  2027. // this.ownDeptLazyTreefun()
  2028. // } else if (value == 'AGENT') {
  2029. // // 代理
  2030. // this.columnforfun('srcCnName').type = 'select'
  2031. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'cnName', value: 'cnName' }
  2032. // this.columnforfun('srcCnName').disabled = false
  2033. // this.agentBcorpsListfun()
  2034. // } else if (value == 'SALES') {
  2035. // // 业务员
  2036. // this.columnforfun('srcCnName').type = 'select'
  2037. // this.columnforfun('srcCnName').forParameter = { key: 'id', label: 'name', value: 'name' }
  2038. // this.columnforfun('srcCnName').disabled = false
  2039. // this.salesUserGetListfun()
  2040. // }
  2041. // }
  2042. // else if (name == 'srcCnName') {
  2043. // for (let item of this.columnforfun('srcCnName').dicData) {
  2044. // if (item[this.columnforfun('srcCnName').forParameter.value] == value) {
  2045. // if (this.form.srcType == 'SALES') {
  2046. // // 业务员
  2047. // this.$set(this.form, 'srcId', item.id)
  2048. // this.$set(this.form, 'srcCnName', item.name)
  2049. // this.$set(this.form, 'srcEnName', item.name)
  2050. // this.$set(this.form, 'srcDeptId', item.deptId.split(',').pop())
  2051. // this.$set(this.form, 'srcDeptName', item.deptName)
  2052. // } else if (this.form.srcType == 'AGENT') {
  2053. // // 代理
  2054. // this.$set(this.form, 'srcId', item.id)
  2055. // this.$set(this.form, 'srcCnName', item.cnName)
  2056. // this.$set(this.form, 'srcEnName', item.enName)
  2057. // }
  2058. // }
  2059. // }
  2060. // }
  2061. // else if (name == 'coloaderCnName') {
  2062. // for (let item of this.columnforfun('coloaderCnName').dicData) {
  2063. // if (item.cnName == value) {
  2064. // this.$set(this.form, 'coloaderId', item.id)
  2065. // this.$set(this.form, 'coloaderCnName', item.cnName)
  2066. // this.$set(this.form, 'coloaderEnName', item.enName)
  2067. // }
  2068. // }
  2069. // }
  2070. else if (name == "mpaymode") {
  2071. // 主单付费方式
  2072. this.form[name] = value;
  2073. if (value == "PP") {
  2074. this.$set(
  2075. this.form,
  2076. "mpayplace",
  2077. this.form.polEnName
  2078. ? this.form.polEnName.split(" - ")[0]
  2079. : ""
  2080. );
  2081. } else {
  2082. this.$set(
  2083. this.form,
  2084. "mpayplace",
  2085. this.form.podEnName
  2086. ? this.form.podEnName.split(" - ")[0]
  2087. : ""
  2088. );
  2089. }
  2090. }
  2091. // else if (name == 'hpaymode') {
  2092. // // 分单付费方式
  2093. // this.form[name] = value
  2094. // if (value == 'PP') {
  2095. // this.$set(this.form, 'hpayplace', this.form.polEnName.split(' - ')[0])
  2096. // } else {
  2097. // this.$set(this.form, 'hpayplace', this.form.podEnName.split(' - ')[0])
  2098. // }
  2099. // }
  2100. // else if (name == 'teamName') {
  2101. // if (!value) {
  2102. // this.$set(this.form, 'teamId', '')
  2103. // this.$set(this.form, 'teamName', '')
  2104. // }
  2105. // for (let item of this.columnforfun('teamName').dicData) {
  2106. // if (item.id == value) {
  2107. // this.$set(this.form, 'teamId', item.id)
  2108. // this.$set(this.form, 'teamName', item.postName)
  2109. // }
  2110. // }
  2111. // }
  2112. else {
  2113. this.form[name] = value;
  2114. }
  2115. },
  2116. // 申请B/L NO
  2117. applyforfun(text) {
  2118. if (!this.form.id) {
  2119. this.$message({
  2120. message: "请先保存数据",
  2121. type: "warning"
  2122. });
  2123. return;
  2124. }
  2125. // 如果不是分单
  2126. // 王风刚 2025-02-21 所有分单号都不能手动输入,都可以申请
  2127. // if (this.form.billType != 'MH') {
  2128. // this.$message({
  2129. // message: '只有分单需要申请',
  2130. // type: 'warning'
  2131. // });
  2132. // return
  2133. // }
  2134. if (!this.form.businessType) {
  2135. this.$message({
  2136. message: "请先选择业务类型",
  2137. type: "warning"
  2138. });
  2139. return;
  2140. }
  2141. if (!this.form.corpCnName) {
  2142. this.$message({
  2143. message: "请先选择客户名称",
  2144. type: "warning"
  2145. });
  2146. return;
  2147. }
  2148. if (this.form.hblno) {
  2149. this.$confirm(`确定删除${text}?`, {
  2150. confirmButtonText: "确定",
  2151. cancelButtonText: "取消",
  2152. type: "warning"
  2153. }).then(res => {
  2154. removeHblNo({
  2155. id: this.form.id
  2156. }).then(res => {
  2157. this.form.hblno = null;
  2158. this.billsSubmitfun();
  2159. });
  2160. });
  2161. } else {
  2162. if (!this.form.hblno) {
  2163. // 王风刚 2025-02-21 无需弹窗,直接申请分单号
  2164. // this.$confirm(`确定${text}?`, {
  2165. // confirmButtonText: "确定",
  2166. // cancelButtonText: "取消",
  2167. // type: "warning"
  2168. // }).then(res => {
  2169. // this.billsGetBillNofun()
  2170. // })
  2171. this.billsGetBillNofun();
  2172. }
  2173. }
  2174. },
  2175. // 配置项
  2176. columnforfun(value) {
  2177. for (let item of this.basicData.column) {
  2178. if (item instanceof Array) {
  2179. for (let ite of item) {
  2180. if (value == ite.prop) {
  2181. return ite;
  2182. }
  2183. }
  2184. } else {
  2185. if (value == item.prop) {
  2186. return item;
  2187. }
  2188. }
  2189. }
  2190. },
  2191. //返回列表
  2192. backToList() {
  2193. if (
  2194. contrastObj(this.form, this.oldForm) ||
  2195. contrastList(
  2196. this.form.preContainersList,
  2197. this.oldForm.preContainersList
  2198. ) ||
  2199. contrastList(
  2200. this.form.containersList,
  2201. this.oldForm.containersList
  2202. ) ||
  2203. contrastList(
  2204. this.form.feeCenterListC,
  2205. this.oldForm.feeCenterListC
  2206. ) ||
  2207. contrastList(
  2208. this.form.feeCenterListD,
  2209. this.oldForm.feeCenterListD
  2210. ) ||
  2211. contrastList(this.form.filesList, this.oldForm.filesList) ||
  2212. contrastList(
  2213. this.form.waitingBoxList,
  2214. this.oldForm.waitingBoxList
  2215. )
  2216. ) {
  2217. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  2218. confirmButtonText: "确定",
  2219. cancelButtonText: "取消",
  2220. type: "warning"
  2221. })
  2222. .then(() => {
  2223. this.editCustomer("goBack");
  2224. })
  2225. .catch(() => {
  2226. if (this.form.id) {
  2227. this.unLock({
  2228. moduleName: "SI",
  2229. tableName: "SI_order",
  2230. billId: this.form.id,
  2231. billNo: this.form.mblno
  2232. });
  2233. }
  2234. this.$emit("goBack");
  2235. });
  2236. } else {
  2237. if (this.form.id) {
  2238. this.unLock({
  2239. moduleName: "SI",
  2240. tableName: "SI_order",
  2241. billId: this.form.id,
  2242. billNo: this.form.mblno
  2243. });
  2244. }
  2245. this.$emit("goBack");
  2246. }
  2247. },
  2248. // 单据请核
  2249. DocumentApproval() {
  2250. if (this.form.billType == "MH") {
  2251. this.$message.warning("分单不能提交请核");
  2252. return;
  2253. }
  2254. if (popupReminder(this.form, this.messageData)) {
  2255. this.$confirm(popupReminder(this.form, this.messageData), {
  2256. confirmButtonText: "确定",
  2257. cancelButtonText: "取消",
  2258. type: "warning"
  2259. });
  2260. }
  2261. if (popupReminder(this.form, this.messageData)) {
  2262. return;
  2263. }
  2264. if (
  2265. this.form.feeCenterListC.length == 0 &&
  2266. this.form.feeCenterListD == 0
  2267. ) {
  2268. return this.$message.warning("请添加费用信息");
  2269. }
  2270. this.$confirm("确定要请核数据?", {
  2271. confirmButtonText: "确定",
  2272. cancelButtonText: "取消",
  2273. type: "warning"
  2274. }).then(() => {
  2275. this.pageLoading = true;
  2276. billsCheckBills({
  2277. id: this.form.id,
  2278. url:
  2279. "/iosBasicData/OceanFreightImport/bills/approvalDetails",
  2280. pageStatus: "this.$store.getters.approvalDetails",
  2281. pageLabel: "审批详情(F)"
  2282. })
  2283. .then(res => {
  2284. this.pageLoading = false;
  2285. this.$message({
  2286. type: "success",
  2287. message: "操作成功!"
  2288. });
  2289. // 详情
  2290. this.billsDetailfun(this.form.id);
  2291. })
  2292. .catch(() => {
  2293. this.pageLoading = false;
  2294. });
  2295. });
  2296. },
  2297. // 撤销单据请核
  2298. revokeDocumentApproval() {
  2299. this.$confirm("确定要撤销请核数据?", {
  2300. confirmButtonText: "确定",
  2301. cancelButtonText: "取消",
  2302. type: "warning"
  2303. }).then(() => {
  2304. this.pageLoading = true;
  2305. billsRevokeCheckBills({
  2306. id: this.form.id
  2307. }).then(res => {
  2308. this.pageLoading = false;
  2309. this.$message({
  2310. type: "success",
  2311. message: "操作成功!"
  2312. });
  2313. // 详情
  2314. this.billsDetailfun(this.form.id);
  2315. });
  2316. });
  2317. },
  2318. // 编辑按钮
  2319. editHandle() {
  2320. this.detailData.seeDisabled = false;
  2321. },
  2322. //去除文本框的空格
  2323. getTextTirim(data) {
  2324. if (data) {
  2325. let obj = data.split("\n");
  2326. let res = [];
  2327. obj.forEach(item => {
  2328. res.push(_.trimEnd(item));
  2329. });
  2330. return res.join("\n");
  2331. } else {
  2332. return null;
  2333. }
  2334. },
  2335. // 大保存按钮
  2336. editCustomer(status) {
  2337. this.$refs.form.validate(valid => {
  2338. if (valid) {
  2339. // 判断必填项
  2340. let msgs = [];
  2341. if (!this.form.quantity) {
  2342. msgs.push("件数");
  2343. }
  2344. if (!this.form.packingUnit) {
  2345. msgs.push("包装");
  2346. }
  2347. if (!this.form.grossWeight) {
  2348. msgs.push("毛重");
  2349. }
  2350. if (!this.form.measurement) {
  2351. msgs.push("尺码");
  2352. }
  2353. // if (!this.form.etd) {
  2354. // msgs.push('ETD')
  2355. // }
  2356. // if (!this.form.teamName) {
  2357. // msgs.push('所属团队')
  2358. // }
  2359. for (let item of this.form.preContainersList) {
  2360. if (!item.cntrTypeCode) {
  2361. this.$message.warning("请选择尺码箱型");
  2362. return;
  2363. }
  2364. if (!item.quantity) {
  2365. this.$message.warning("请输入箱量");
  2366. return;
  2367. }
  2368. }
  2369. for (let item of this.form.feeCenterListD) {
  2370. if (!item.corpId || !item.feeId || !item.curCode) {
  2371. msgs.push(
  2372. `应收第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""
  2373. }${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""
  2374. }`
  2375. );
  2376. }
  2377. }
  2378. for (let item of this.form.feeCenterListC) {
  2379. if (!item.corpId || !item.feeId || !item.curCode) {
  2380. msgs.push(
  2381. `应付第${item.$index + 1}行${!item.corpId ? " 往来单位" : ""
  2382. }${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""
  2383. }`
  2384. );
  2385. }
  2386. }
  2387. if (msgs.length > 0) {
  2388. this.$confirm(`请填写下列信息:${msgs.join(" ,")}!`, {
  2389. confirmButtonText: "确定",
  2390. cancelButtonText: "取消",
  2391. type: "warning"
  2392. });
  2393. return;
  2394. }
  2395. if (this.verifySymbolStatus == 1) {
  2396. let msgsList = [];
  2397. if (
  2398. checkFullWidthSymbols(
  2399. this.form.detail.hshipperDetails
  2400. ).hasFullWidth
  2401. ) {
  2402. let msg = [];
  2403. for (let item of checkFullWidthSymbols(
  2404. this.form.detail.hshipperDetails
  2405. ).positions) {
  2406. msg.push(`第${item.row}行的"${item.symbol}"`);
  2407. }
  2408. if (msg.length > 0) {
  2409. this.$message({
  2410. dangerouslyUseHTMLString: true,
  2411. message: `发货人:<br>${msg.join(
  2412. ";<br>"
  2413. )}<br>存在全角或汉字符号,请确认`,
  2414. type: "error"
  2415. });
  2416. return;
  2417. }
  2418. }
  2419. if (
  2420. checkFullWidthSymbols(
  2421. this.form.detail.hconsigneeDetails
  2422. ).hasFullWidth
  2423. ) {
  2424. let msg = [];
  2425. for (let item of checkFullWidthSymbols(
  2426. this.form.detail.hconsigneeDetails
  2427. ).positions) {
  2428. msg.push(`第${item.row}行的"${item.symbol}"`);
  2429. }
  2430. if (msg.length > 0) {
  2431. this.$message({
  2432. dangerouslyUseHTMLString: true,
  2433. message: `收货人:<br>${msg.join(
  2434. ";<br>"
  2435. )}<br>存在全角或汉字符号,请确认`,
  2436. type: "error"
  2437. });
  2438. return;
  2439. }
  2440. }
  2441. if (
  2442. checkFullWidthSymbols(
  2443. this.form.detail.hnotifyDetails
  2444. ).hasFullWidth
  2445. ) {
  2446. let msg = [];
  2447. for (let item of checkFullWidthSymbols(
  2448. this.form.detail.hnotifyDetails
  2449. ).positions) {
  2450. msg.push(`第${item.row}行的"${item.symbol}"`);
  2451. }
  2452. if (msg.length > 0) {
  2453. this.$message({
  2454. dangerouslyUseHTMLString: true,
  2455. message: `通知人:<br>${msg.join(
  2456. ";<br>"
  2457. )}<br>存在全角或汉字符号,请确认`,
  2458. type: "error"
  2459. });
  2460. return;
  2461. }
  2462. }
  2463. if (
  2464. checkFullWidthSymbols(
  2465. this.form.detail.mshipperDetails
  2466. ).hasFullWidth
  2467. ) {
  2468. let msg = [];
  2469. for (let item of checkFullWidthSymbols(
  2470. this.form.detail.mshipperDetails
  2471. ).positions) {
  2472. msg.push(`第${item.row}行的"${item.symbol}"`);
  2473. }
  2474. if (msg.length > 0) {
  2475. this.$message({
  2476. dangerouslyUseHTMLString: true,
  2477. message: `MBL 发货人:<br>${msg.join(
  2478. ";<br>"
  2479. )}<br>存在全角或汉字符号,请确认`,
  2480. type: "error"
  2481. });
  2482. return;
  2483. }
  2484. }
  2485. if (
  2486. checkFullWidthSymbols(
  2487. this.form.detail.mconsigneeDetails
  2488. ).hasFullWidth
  2489. ) {
  2490. let msg = [];
  2491. for (let item of checkFullWidthSymbols(
  2492. this.form.detail.mconsigneeDetails
  2493. ).positions) {
  2494. msg.push(`第${item.row}行的"${item.symbol}"`);
  2495. }
  2496. if (msg.length > 0) {
  2497. this.$message({
  2498. dangerouslyUseHTMLString: true,
  2499. message: `MBL 收货人:<br>${msg.join(
  2500. ";<br>"
  2501. )}<br>存在全角或汉字符号,请确认`,
  2502. type: "error"
  2503. });
  2504. return;
  2505. }
  2506. }
  2507. if (
  2508. checkFullWidthSymbols(
  2509. this.form.detail.mnotifyDetails
  2510. ).hasFullWidth
  2511. ) {
  2512. let msg = [];
  2513. for (let item of checkFullWidthSymbols(
  2514. this.form.detail.mnotifyDetails
  2515. ).positions) {
  2516. msg.push(`第${item.row}行的"${item.symbol}"`);
  2517. }
  2518. if (msg.length > 0) {
  2519. this.$message({
  2520. dangerouslyUseHTMLString: true,
  2521. message: `MBL 通知人:<br>${msg.join(
  2522. ";<br>"
  2523. )}<br>存在全角或汉字符号,请确认`,
  2524. type: "error"
  2525. });
  2526. return;
  2527. }
  2528. }
  2529. if (
  2530. checkFullWidthSymbols(this.form.marks).hasFullWidth
  2531. ) {
  2532. let msg = [];
  2533. for (let item of checkFullWidthSymbols(
  2534. this.form.marks
  2535. ).positions) {
  2536. msg.push(`第${item.row}行的"${item.symbol}"`);
  2537. }
  2538. if (msg.length > 0) {
  2539. this.$message({
  2540. dangerouslyUseHTMLString: true,
  2541. message: `唛头:<br>${msg.join(
  2542. ";<br>"
  2543. )}<br>存在全角或汉字符号,请确认`,
  2544. type: "error"
  2545. });
  2546. return;
  2547. }
  2548. }
  2549. if (
  2550. checkFullWidthSymbols(this.form.commodityDescr)
  2551. .hasFullWidth
  2552. ) {
  2553. let msg = [];
  2554. for (let item of checkFullWidthSymbols(
  2555. this.form.commodityDescr
  2556. ).positions) {
  2557. msg.push(`第${item.row}行的"${item.symbol}"`);
  2558. }
  2559. if (msg.length > 0) {
  2560. this.$message({
  2561. dangerouslyUseHTMLString: true,
  2562. message: `货描:<br>${msg.join(
  2563. ";<br>"
  2564. )}<br>存在全角或汉字符号,请确认`,
  2565. type: "error"
  2566. });
  2567. return;
  2568. }
  2569. }
  2570. if (
  2571. checkFullWidthSymbols(this.form.forwarding)
  2572. .hasFullWidth
  2573. ) {
  2574. let msg = [];
  2575. for (let item of checkFullWidthSymbols(
  2576. this.form.forwarding
  2577. ).positions) {
  2578. msg.push(`第${item.row}行的"${item.symbol}"`);
  2579. }
  2580. if (msg.length > 0) {
  2581. this.$message({
  2582. dangerouslyUseHTMLString: true,
  2583. message: `FORWARDING:<br>${msg.join(
  2584. ";<br>"
  2585. )}<br>存在全角或汉字符号,,请修正后再保存!`,
  2586. type: "error"
  2587. });
  2588. return;
  2589. }
  2590. }
  2591. console.log(this.form.detail);
  2592. if (!verifyEnglish(this.form.detail.hshipperDetails)) {
  2593. msgsList.push("发货人");
  2594. }
  2595. if (
  2596. !verifyEnglish(this.form.detail.hconsigneeDetails)
  2597. ) {
  2598. msgsList.push("收货人");
  2599. }
  2600. if (!verifyEnglish(this.form.detail.hnotifyDetails)) {
  2601. msgsList.push("通知人");
  2602. }
  2603. if (!verifyEnglish(this.form.detail.mshipperDetails)) {
  2604. msgsList.push("MBL 发货人");
  2605. }
  2606. if (
  2607. !verifyEnglish(this.form.detail.mconsigneeDetails)
  2608. ) {
  2609. msgsList.push("MBL 收货人");
  2610. }
  2611. if (!verifyEnglish(this.form.detail.mnotifyDetails)) {
  2612. msgsList.push("MBL 通知人");
  2613. }
  2614. if (!verifyEnglish(this.form.marks)) {
  2615. msgsList.push("唛头");
  2616. }
  2617. if (!verifyEnglish(this.form.commodityDescr)) {
  2618. msgsList.push("货描");
  2619. }
  2620. if (!verifyEnglish(this.form.forwarding)) {
  2621. msgsList.push("FORWARDING");
  2622. }
  2623. if (msgsList.length > 0) {
  2624. // this.$message.error(`请正确输入${msgsList.join(",")}的英文`);
  2625. this.$message.error(
  2626. `${msgsList.join(
  2627. ","
  2628. )}存在非英文字符,如汉字等,请修正后再保存!`
  2629. );
  2630. return;
  2631. }
  2632. }
  2633. this.form.detail.hshipperDetails = this.getTextTirim(
  2634. this.form.detail.hshipperDetails
  2635. );
  2636. this.form.detail.hconsigneeDetails = this.getTextTirim(
  2637. this.form.detail.hconsigneeDetails
  2638. );
  2639. this.form.detail.hnotifyDetails = this.getTextTirim(
  2640. this.form.detail.hnotifyDetails
  2641. );
  2642. this.form.detail.marks = this.getTextTirim(
  2643. this.form.detail.marks
  2644. );
  2645. this.form.detail.commodityDescr = this.getTextTirim(
  2646. this.form.detail.commodityDescr
  2647. );
  2648. this.form.forwarding = this.getTextTirim(
  2649. this.form.forwarding
  2650. );
  2651. // 赋值 ETD 日期
  2652. // this.form.billDate = this.form.etd ? this.form.etd.slice(0, 10) + ' 00:00:00' : null // 单据日期
  2653. // 调用保存接口
  2654. this.billsSubmitfun(status);
  2655. }
  2656. });
  2657. },
  2658. // 主表保存接口大保存
  2659. billsSubmitfun(status) {
  2660. if (this.form.cargoType == "dry") {
  2661. // 普货
  2662. this.form.billNoFormat = "HYJK-PH";
  2663. } else if (this.form.cargoType == "danger") {
  2664. // 危险品
  2665. this.form.billNoFormat = "HYJK-WXP";
  2666. } else if (this.form.cargoType == "reefer") {
  2667. // 冻柜
  2668. this.form.billNoFormat = "HYJK-DG";
  2669. } else {
  2670. this.form.billNoFormat = "HYJK";
  2671. }
  2672. this.form.businessTypeCode = "HYJK";
  2673. delete this.form.extendedData;
  2674. // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
  2675. // this.searchSplit()
  2676. // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
  2677. // 费用 收 赋值数据
  2678. // this.form.shortName=this.form.corpCnName.split('-')[1]
  2679. this.form.feeCenterListD.map((row, index) => {
  2680. row.dc = "D";
  2681. row.sort = Number(index) + 1;
  2682. row.businessType = this.form.businessType; // 业务类型
  2683. row.billType = this.form.billType; // 单据类型
  2684. row.billNo = this.form.billNo; // 单据编号
  2685. row.billDate = this.form.billDate;
  2686. row.billCorpId = this.form.corpId; // 主表客户 id
  2687. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2688. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2689. row.lineId = this.form.lineId; // 航线 id
  2690. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2691. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2692. row.vesselId = this.form.vesselId; // 船名 id
  2693. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2694. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2695. row.voyageNo = this.form.voyageNo; // 航次
  2696. row.mblno = this.form.mblno; // MB/L NO
  2697. row.hblno = this.form.hblno; // HB/L NO
  2698. // row.etd = this.form.etd // 开船日期
  2699. row.eta = this.form.actualEta; // 到港日期
  2700. row.polId = this.form.polId; // 装货港 id
  2701. row.polCode = this.form.polCode; // 装货港代码
  2702. row.polCnName = this.form.polCnName; // 装货港中文名称
  2703. row.polEnName = this.form.polEnName; // 装货港英文名称
  2704. row.podId = this.form.podId; // 卸货港 id
  2705. row.podCode = this.form.podCode; // 卸货港代码
  2706. row.podCnName = this.form.podCnName; // 卸货港中文名称
  2707. row.podEnName = this.form.podEnName; // 卸货港英文名称
  2708. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  2709. // 数量 * 单价 = 净额
  2710. // 总税率 = 税率 + 附件税率
  2711. // 税额 = 净额 * 总税率
  2712. // 含税
  2713. if (row.curCode == this.getLocalCurrency()) {
  2714. row.amount = row.rmbAmount
  2715. ? row.rmbAmount
  2716. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2717. } else {
  2718. row.amount = row.usdAmount
  2719. ? row.usdAmount
  2720. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2721. }
  2722. // 净额
  2723. if (row.curCode == this.getLocalCurrency()) {
  2724. row.amountNet = row.rmbAmountNet
  2725. ? row.rmbAmountNet
  2726. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2727. } else {
  2728. row.amountNet = row.usdAmountNet
  2729. ? row.usdAmountNet
  2730. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2731. }
  2732. });
  2733. // 费用 付 赋值数据
  2734. this.form.feeCenterListC.map((row, index) => {
  2735. row.dc = "C";
  2736. row.sort = Number(index) + 1;
  2737. row.businessType = this.form.businessType; // 业务类型
  2738. row.billType = this.form.billType; // 单据类型
  2739. row.billNo = this.form.billNo; // 单据编号
  2740. row.billDate = this.form.billDate; // 单据日期
  2741. row.billCorpId = this.form.corpId; // 主表客户 id
  2742. row.billCorpCnName = this.form.corpCnName; // 主表客户中文名称
  2743. row.billCorpEnName = this.form.corpEnName; // 主表客户英文名称
  2744. row.lineId = this.form.lineId; // 航线 id
  2745. row.lineCnName = this.form.lineCnName; // 航线中文名称
  2746. row.lineEnName = this.form.lineEnName; // 航线英文名称
  2747. row.vesselId = this.form.vesselId; // 船名 id
  2748. row.vesselCnName = this.form.vesselCnName; // 中文船名
  2749. row.vesselEnName = this.form.vesselEnName; // 英文船名
  2750. row.voyageNo = this.form.voyageNo; // 航次
  2751. row.mblno = this.form.mblno; // MB/L NO
  2752. row.hblno = this.form.hblno; // HB/L NO
  2753. // row.etd = this.form.etd // 开船日期
  2754. row.eta = this.form.actualEta; // 到港日期
  2755. row.polId = this.form.polId; // 装货港 id
  2756. row.polCode = this.form.polCode; // 装货港代码
  2757. row.polCnName = this.form.polCnName; // 装货港中文名称
  2758. row.polEnName = this.form.polEnName; // 装货港英文名称
  2759. row.podId = this.form.podId; // 卸货港 id
  2760. row.podCode = this.form.podCode; // 卸货港代码
  2761. row.podCnName = this.form.podCnName; // 卸货港中文名称
  2762. row.podEnName = this.form.podEnName; // 卸货港英文名称
  2763. row.corpArgreementNo = this.form.corpArgreementNo; // 客户约号
  2764. // 数量 * 单价 = 净额
  2765. // 总税率 = 税率 + 附件税率
  2766. // 税额 = 净额 * 总税率
  2767. // 含税
  2768. if (row.curCode == this.getLocalCurrency()) {
  2769. row.amount = row.rmbAmount
  2770. ? row.rmbAmount
  2771. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2772. } else {
  2773. row.amount = row.usdAmount
  2774. ? row.usdAmount
  2775. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2776. }
  2777. // 净额
  2778. if (row.curCode == this.getLocalCurrency()) {
  2779. row.amountNet = row.rmbAmountNet
  2780. ? row.rmbAmountNet
  2781. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2782. } else {
  2783. row.amountNet = row.usdAmountNet
  2784. ? row.usdAmountNet
  2785. : (Number(row.quantity) * Number(row.price)).toFixed(2);
  2786. }
  2787. });
  2788. this.pageLoading = true;
  2789. billsSubmit(this.form)
  2790. .then(res => {
  2791. this.pageLoading = false;
  2792. if (res.data.code === 601) {
  2793. console.info("11111111111----", res);
  2794. this.billsDetailfun(this.form.id);
  2795. this.$message({
  2796. type: "error",
  2797. message: res.data.msg
  2798. });
  2799. return true;
  2800. }
  2801. this.$message({
  2802. type: "success",
  2803. message: "操作成功!"
  2804. });
  2805. if (status == "goBack") {
  2806. if (this.form.id) {
  2807. this.unLock({
  2808. moduleName: "SI",
  2809. tableName: "SI_order",
  2810. billId: this.form.id,
  2811. billNo: this.form.mblno
  2812. });
  2813. }
  2814. this.$emit("goBack");
  2815. }
  2816. // this.detailData.seeDisabled = true
  2817. this.billsDetailfun(res.data.data.id, status);
  2818. })
  2819. .catch(err => {
  2820. this.pageLoading = false;
  2821. })
  2822. .finally(() => { });
  2823. },
  2824. // 提取箱专用的保存
  2825. billsAddfun() {
  2826. billsAdd(this.form)
  2827. .then(res => {
  2828. this.pageLoading = false;
  2829. this.$message({
  2830. type: "success",
  2831. message: "操作成功!"
  2832. });
  2833. // this.detailData.seeDisabled = true
  2834. this.billsDetailfun(res.data.data.id);
  2835. })
  2836. .catch(err => {
  2837. this.pageLoading = false;
  2838. });
  2839. },
  2840. // 复制单据接口
  2841. async billsCopyBillsfun(id, type,billType) {
  2842. const loading = this.$loading({
  2843. lock: true,
  2844. text: "加载中",
  2845. spinner: "el-icon-loading",
  2846. background: "rgba(255,255,255,0.7)"
  2847. });
  2848. let res = await billsCopyBills({
  2849. id
  2850. });
  2851. loading.close();
  2852. let types = typeof type == "string" ? type.split(",") : [];
  2853. // if (type == '复制费用' || type == '') {
  2854. // res.data.data.preContainersList = []
  2855. // }
  2856. // if (type == '复制箱型箱量' || type == '') {
  2857. // res.data.data.feeCenterListD = []
  2858. // res.data.data.feeCenterListC = []
  2859. // }
  2860. if (types.indexOf("复制箱型箱量") < 0) {
  2861. res.data.data.preContainersList = [];
  2862. }
  2863. if (types.indexOf("复制费用") < 0) {
  2864. res.data.data.feeCenterListD = [];
  2865. res.data.data.feeCenterListC = [];
  2866. }
  2867. res.data.data.billType = billType
  2868. if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
  2869. res.data.data.feeCenterListC = []
  2870. }
  2871. if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
  2872. res.data.data.feeCenterListD = []
  2873. }
  2874. await this.saveLocalCurrency(res.data.data.branchId);
  2875. this.form = res.data.data;
  2876. this.pageLoading = false;
  2877. // this.searchMontage() // 下拉 中文名称和编号拼接
  2878. // 配箱最上面可以编辑
  2879. for (let item of this.form.containersList) {
  2880. item.edit = false;
  2881. }
  2882. // 先把状态改成可以编辑,然后判断是否可以编辑
  2883. this.generateBillsfalse = false;
  2884. // 应收
  2885. for (let item of this.form.feeCenterListD) {
  2886. // 判断是否生成了账单
  2887. if (item.accStatus == 1) {
  2888. this.columnforfun("corpCnName").disabled = true;
  2889. // this.columnforfun('srcType').disabled = true
  2890. this.columnforfun("mblno").disabled = true;
  2891. this.columnforfun("bookingNo").disabled = true;
  2892. // this.columnforfun('refno').disabled = true
  2893. this.generateBillsfalse = true;
  2894. }
  2895. if (item.curCode == this.getLocalCurrency()) {
  2896. this.$set(item, "rmbAmount", item.amount);
  2897. this.$set(item, "usdAmount", "");
  2898. this.$set(item, "rmbAmountNet", item.amountNet);
  2899. this.$set(item, "usdAmountNet", "");
  2900. } else {
  2901. this.$set(item, "usdAmount", item.amount);
  2902. this.$set(item, "rmbAmount", "");
  2903. this.$set(item, "usdAmountNet", item.amountNet);
  2904. this.$set(item, "rmbAmountNet", "");
  2905. }
  2906. item.edit = false;
  2907. }
  2908. // 应付
  2909. for (let item of this.form.feeCenterListC) {
  2910. // 判断是否生成了账单
  2911. if (item.accStatus == 1) {
  2912. this.generateBillsfalse = true;
  2913. this.columnforfun("corpCnName").disabled = true;
  2914. // this.columnforfun('srcType').disabled = true
  2915. this.columnforfun("mblno").disabled = true;
  2916. this.columnforfun("bookingNo").disabled = true;
  2917. // this.columnforfun('refno').disabled = true
  2918. }
  2919. if (item.curCode == this.getLocalCurrency()) {
  2920. this.$set(item, "rmbAmount", item.amount);
  2921. this.$set(item, "usdAmount", "");
  2922. this.$set(item, "rmbAmountNet", item.amountNet);
  2923. this.$set(item, "usdAmountNet", "");
  2924. } else {
  2925. this.$set(item, "usdAmount", item.amount);
  2926. this.$set(item, "rmbAmount", "");
  2927. this.$set(item, "usdAmountNet", item.amountNet);
  2928. this.$set(item, "rmbAmountNet", "");
  2929. }
  2930. item.edit = false;
  2931. }
  2932. // 文件中心
  2933. for (let item of this.form.filesList) {
  2934. this.$set(item, "edit", false);
  2935. }
  2936. },
  2937. // 详情接口
  2938. async billsDetailfun(id, status) {
  2939. const res = await billsDetail(id);
  2940. // this.form = res.data.data;
  2941. if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
  2942. res.data.data.feeCenterListC = []
  2943. }
  2944. if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
  2945. res.data.data.feeCenterListD = []
  2946. }
  2947. this.$set(this, "form", res.data.data);
  2948. this.inLock();
  2949. // console.log('form', this.form)
  2950. // console.log(this.$refs)
  2951. this.copyFormData = JSON.parse(JSON.stringify(res.data.data));
  2952. // 如果已经请核就禁用按钮
  2953. if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
  2954. this.detailData.seeDisabled = true
  2955. } else {
  2956. this.detailData.seeDisabled = false
  2957. }
  2958. // this.columnforfun('teamName').disabled = true
  2959. // this.columnforfun('operatorName').disabled = true
  2960. // this.columnforfun('accDeptName').disabled = true
  2961. if (
  2962. this.form.status == 1 ||
  2963. this.form.status == 2 ||
  2964. this.form.status == 3
  2965. ) {
  2966. this.columnforfun("corpCnName").disabled = true;
  2967. // this.columnforfun('srcType').disabled = true
  2968. this.columnforfun("mblno").disabled = true;
  2969. this.columnforfun("bookingNo").disabled = true;
  2970. // this.columnforfun('refno').disabled = true
  2971. // this.columnforfun('teamId').disabled = true
  2972. this.generateBillsfalse = true;
  2973. this.pleasereviewType = true; // 请核禁用
  2974. } else {
  2975. // 判断是否可以编辑
  2976. this.columnforfun("corpCnName").disabled = false;
  2977. // this.columnforfun('srcType').disabled = false
  2978. this.columnforfun("mblno").disabled = false;
  2979. this.columnforfun("bookingNo").disabled = false;
  2980. // this.columnforfun('refno').disabled = false
  2981. // if (this.saberTenantId == '607913') {
  2982. // this.columnforfun('operatorName').disabled = false
  2983. // this.columnforfun('accDeptName').disabled = false
  2984. // }
  2985. // this.columnforfun('teamId').disabled = false
  2986. this.generateBillsfalse = false;
  2987. this.pleasereviewType = false;
  2988. }
  2989. this.pageLoading = false;
  2990. // this.searchMontage() // 下拉 中文名称和编号拼接
  2991. // 配箱最上面可以编辑
  2992. for (let item of this.form.containersList) {
  2993. item.edit = false;
  2994. }
  2995. // 配箱最下面的
  2996. for (let item of this.form.waitingBoxList) {
  2997. this.$set(item, "editQuantity", item.quantity);
  2998. this.$set(item, "editGrossWeight", item.grossWeight);
  2999. this.$set(item, "editMeasurement", item.measurement);
  3000. this.$set(item, "edit", false);
  3001. }
  3002. // 应收
  3003. for (let item of this.form.feeCenterListD) {
  3004. // 判断是否生成了账单
  3005. if (item.accStatus == 1) {
  3006. this.generateBillsfalse = true;
  3007. this.columnforfun("corpCnName").disabled = true;
  3008. // this.columnforfun('srcType').disabled = true
  3009. this.columnforfun("mblno").disabled = true;
  3010. this.columnforfun("bookingNo").disabled = true;
  3011. // this.columnforfun('refno').disabled = true
  3012. }
  3013. if (item.curCode == this.getLocalCurrency()) {
  3014. this.$set(item, "rmbAmount", item.amount);
  3015. this.$set(item, "usdAmount", "");
  3016. this.$set(item, "rmbAmountNet", item.amountNet);
  3017. this.$set(item, "usdAmountNet", "");
  3018. } else {
  3019. this.$set(item, "usdAmount", item.amount);
  3020. this.$set(item, "rmbAmount", "");
  3021. this.$set(item, "usdAmountNet", item.amountNet);
  3022. this.$set(item, "rmbAmountNet", "");
  3023. }
  3024. item.edit = false;
  3025. }
  3026. // 应付
  3027. for (let item of this.form.feeCenterListC) {
  3028. // 判断是否生成了账单
  3029. if (item.accStatus == 1) {
  3030. this.generateBillsfalse = true;
  3031. this.columnforfun("corpCnName").disabled = true;
  3032. // this.columnforfun('srcType').disabled = true
  3033. this.columnforfun("mblno").disabled = true;
  3034. this.columnforfun("bookingNo").disabled = true;
  3035. // this.columnforfun('refno').disabled = true
  3036. }
  3037. if (item.curCode == this.getLocalCurrency()) {
  3038. this.$set(item, "rmbAmount", item.amount);
  3039. this.$set(item, "usdAmount", "");
  3040. this.$set(item, "rmbAmountNet", item.amountNet);
  3041. this.$set(item, "usdAmountNet", "");
  3042. } else {
  3043. this.$set(item, "usdAmount", item.amount);
  3044. this.$set(item, "rmbAmount", "");
  3045. this.$set(item, "usdAmountNet", item.amountNet);
  3046. this.$set(item, "rmbAmountNet", "");
  3047. }
  3048. item.edit = false;
  3049. }
  3050. // 文件中心
  3051. this.$refs.filescenter.getData(res.data.data);
  3052. for (let item of this.form.filesList) {
  3053. this.$set(item, "edit", false);
  3054. }
  3055. if (status == "toAddEdit") {
  3056. this.$emit(status);
  3057. }
  3058. this.oldForm = this.deepClone(this.form);
  3059. },
  3060. // tbas切换
  3061. handleClick(tba, event) { },
  3062. // 大tbas切换
  3063. bigHandleClick() {
  3064. if (this.bigtabs == "fd") {
  3065. if (this.form.id) {
  3066. this.billsListAllfun(this.form.id);
  3067. }
  3068. }
  3069. if (this.bigtabs == "dz") {
  3070. if (this.form.id) {
  3071. this.$refs.documentCenter.reportslogListfun({
  3072. currentPage: 1,
  3073. pageSize: 10
  3074. });
  3075. }
  3076. this.getReportTypeByBigHandle("单证");
  3077. }
  3078. if (this.bigtabs == "fy") this.getReportTypeByBigHandle("费用");
  3079. },
  3080. getReportTypeByBigHandle(name) {
  3081. return name;
  3082. },
  3083. // 获取不分页的分单列表
  3084. billsListAllfun(masterId) {
  3085. billsListAll({
  3086. masterId
  3087. }).then(res => {
  3088. this.billsListAllData = res.data.data;
  3089. });
  3090. }
  3091. }
  3092. };
  3093. </script>
  3094. <style scoped lang="scss">
  3095. ::v-deep .el-tabs--border-card>.el-tabs__content {
  3096. padding: 4px !important;
  3097. }
  3098. .scrollable-container {
  3099. height: 84vh;
  3100. /* 设置容器高度 */
  3101. overflow-y: auto;
  3102. /* 添加垂直滚动条 */
  3103. }
  3104. .borderless {
  3105. height: 100%;
  3106. box-sizing: border-box;
  3107. }
  3108. .customer-main {
  3109. margin-bottom: 15px;
  3110. }
  3111. .demo-ruleForm {
  3112. font-size: 14px;
  3113. }
  3114. .margintop {
  3115. margin-top: 0px !important;
  3116. }
  3117. ::v-deep.el-form-item {
  3118. margin-bottom: 0;
  3119. }
  3120. ::v-deep .basic-container .el-card__body {
  3121. padding: 6px 20px;
  3122. }
  3123. ::v-deep .el-tabs__header {
  3124. margin: 0 05px;
  3125. }
  3126. .isShow {
  3127. display: none;
  3128. }
  3129. .dropdown-max {
  3130. top: 150px !important;
  3131. max-width: 600px;
  3132. display: flex;
  3133. flex-flow: row wrap;
  3134. li {
  3135. margin-right: 5px;
  3136. white-space: nowrap;
  3137. }
  3138. }
  3139. </style>