detailPage.vue 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back" v-if="!home">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList(0)"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="customer-back" v-else>
  14. <el-button
  15. type="danger"
  16. style="border: none;background: none;color: red"
  17. icon="el-icon-arrow-left"
  18. @click="backToList(1)"
  19. >返回列表
  20. </el-button>
  21. <el-button
  22. type="danger"
  23. v-if="returnButton"
  24. style="border: none;background: none;color: red"
  25. icon="el-icon-arrow-left"
  26. @click="backToList(2)"
  27. >返回首页
  28. </el-button>
  29. <el-button
  30. type="danger"
  31. v-if="!returnButton"
  32. style="border: none;background: none;color: red"
  33. icon="el-icon-arrow-left"
  34. @click="backToList(3)"
  35. >返回台账
  36. </el-button>
  37. </div>
  38. <div>
  39. <div class="el-button&#45;&#45;small-yh add-customer-btn">
  40. <el-button
  41. type="warning"
  42. size="small"
  43. :loading="type"
  44. v-if="goodsForm.status > 0 && roleName.indexOf('admin') !== -1 || roleName.indexOf('业务员') !== -1 || roleName.indexOf('分管调度') !== -1"
  45. :disabled="
  46. !(roleName.indexOf('业务员') !== -1||roleName.indexOf('分管调度') !== -1||roleName.indexOf('经理') !== -1||roleName.indexOf('部门经理') !== -1||roleName.indexOf('总经理') !== -1) && !(roleName.indexOf('admin') !== -1)"
  47. @click="confirmChange"
  48. >变更
  49. </el-button>
  50. <el-button
  51. type="warning"
  52. size="small"
  53. :loading="type"
  54. v-if="goodsForm.status > 3 && ((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('车队') !== -1 || roleName.indexOf('admin') !== -1) && goodsForm.status !== 5"
  55. @click="confirmChangeTwo"
  56. >变更车
  57. </el-button>
  58. <el-button
  59. type="success"
  60. v-if="goodsForm.status === 0 && typeTwo === false"
  61. v-show="roleName.indexOf('admin') !== -1 || roleName.indexOf('业务员') !== -1 || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1)"
  62. size="small"
  63. :loading="type"
  64. @click="submit(true)"
  65. >提交
  66. </el-button>
  67. <el-button
  68. type="success"
  69. v-if="goodsForm.status > 0 && goodsForm.status !== 5"
  70. size="small"
  71. :loading="type"
  72. v-show="
  73. (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1 && goodsForm.status === 1||goodsForm.status === 2)
  74. || (roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
  75. || (roleName.indexOf('司机') !== -1 && goodsForm.status === 3)
  76. || (roleName.indexOf('司机') !== -1 && goodsForm.status === 4)
  77. || (roleName.indexOf('司机') !== -1 && goodsForm.status === 6) || roleName.indexOf('admin') !== -1"
  78. @click="modifyState"
  79. >
  80. {{
  81. goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' : '未知状态:' + goodsForm.status
  82. }}
  83. </el-button>
  84. <el-button
  85. type="warning"
  86. v-if="goodsForm.status === 2 && ((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1)||roleName.indexOf('admin') !== -1) "
  87. size="small"
  88. :loading="type"
  89. @click="cancelScheduling('2')"
  90. >取消调度
  91. </el-button>
  92. <el-button
  93. type="warning"
  94. v-if="goodsForm.status === 3 && ((roleName.indexOf('车队') !== -1 || roleName.indexOf('admin') !== -1) || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1))"
  95. size="small"
  96. :loading="type"
  97. @click="cancelScheduling('1')"
  98. >取消派车
  99. </el-button>
  100. <el-button
  101. type="warning"
  102. v-if="goodsForm.status === 6 && ((roleName.indexOf('司机') !== -1 || roleName.indexOf('admin') !== -1) || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1))"
  103. size="small"
  104. :loading="type"
  105. @click="cancelScheduling('3')"
  106. >取消受理
  107. </el-button>
  108. <el-button
  109. type="success"
  110. v-if="goodsForm.status === 1 && ((roleName.indexOf('客户') !== -1 && roleName.indexOf('业务员') !== -1)||roleName.indexOf('admin') !== -1 || (roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1))"
  111. size="small"
  112. :loading="type"
  113. @click="submit(false)"
  114. >取消提交
  115. </el-button>
  116. <el-button
  117. type="primary"
  118. :disabled="goodsForm.status === 5"
  119. v-show="(roleName.indexOf('客户') !== -1 && roleName.indexOf('业务员') !== -1)||roleName.indexOf('分管调度') !== -1||roleName.indexOf('administrator') !== -1||roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('车队') !== -1 && this.goodsForm.status >3 && goodsForm.status !== 5)"
  120. size="small"
  121. :loading="type"
  122. v-if="!typeTwo"
  123. @click="editCustomer"
  124. >保存
  125. </el-button>
  126. <el-button
  127. type="primary"
  128. :disabled="goodsForm.status === 1"
  129. size="small"
  130. v-else
  131. :loading="type"
  132. @click="changeSaving"
  133. >变更保存
  134. </el-button>
  135. </div>
  136. </div>
  137. </div>
  138. <trade-card title="业务类型" style="margin-top: 50px">
  139. <avue-form v-model="goodsForm" :option="goodsOptionFormC" ref="goodsFormE"></avue-form>
  140. </trade-card>
  141. <trade-card title="委托信息">
  142. <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
  143. <template slot-scope="{}" slot="corpIdLabel">
  144. <e-crop-jump label="公司名称" corp-type="KH" :value="goodsForm.corpName"></e-crop-jump>
  145. </template>
  146. <template slot-scope="scope" slot="corpId">
  147. <!-- <crop-select-->
  148. <!-- :disabled="goodsForm.status !== 0"-->
  149. <!-- v-model="goodsForm.corpId"-->
  150. <!-- @getCorpData="getCorpData"-->
  151. <!-- :corpType="'KH'"-->
  152. <!-- ></crop-select>-->
  153. <e-crop-select
  154. v-model="goodsForm.corpId"
  155. :name.sync="goodsForm.corpName"
  156. corp-type="KH"
  157. :disabled="goodsForm.status !== 0"
  158. @getCropId="getCropId"
  159. />
  160. </template>
  161. <template slot-scope="scope" slot="station">
  162. <port-info
  163. v-model="goodsForm.station"
  164. :disabled="goodsForm.status !== 0"
  165. />
  166. </template>
  167. <template slot-scope="scope" slot="salesman">
  168. <el-select v-model="goodsForm.salesman" filterable clearable placeholder="请选择"
  169. :disabled="goodsForm.status !== 0"
  170. @change="changeSelect">
  171. <el-option
  172. v-for="item in salesmanList"
  173. :key="item.id"
  174. :label="item.realName"
  175. :value="item.id">
  176. </el-option>
  177. </el-select>
  178. </template>
  179. <template slot-scope="scope" slot="agentId">
  180. <crop-select
  181. :disabled="goodsForm.status !== 0"
  182. v-model="goodsForm.agentId"
  183. ></crop-select>
  184. </template>
  185. <template slot-scope="scope" slot="polId">
  186. <port-info
  187. v-model="goodsForm.polId"
  188. :disabled="goodsForm.status !== 0"/>
  189. </template>
  190. <template slot-scope="scope" slot="podId">
  191. <port-info
  192. v-model="goodsForm.podId"
  193. :disabled="goodsForm.status !== 0"/>
  194. </template>
  195. </avue-form>
  196. </trade-card>
  197. <containerTitle v-if="false" title="箱信息"></containerTitle>
  198. <basic-container v-if="goodsForm.status === 0 || !goodsForm.status" v-show="false">
  199. <avue-crud :data="entrustList"
  200. :option="entrustOptionTwo"
  201. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  202. @row-update="rowSave"
  203. ref="crudBox"
  204. v-if="KeyBox>0"
  205. @resetColumn="resetColumnBox"
  206. @saveColumn="saveColumnBox"
  207. @row-del="rowDel">
  208. <template slot="headerSerial" slot-scope="{column}">
  209. <el-tooltip class="item" effect="dark" content="录入明细" placement="top">
  210. <el-button type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
  211. @click="$refs.crudBox.rowCellAdd({arrivalTime:new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 14)+'00:00',landAmountD:0,landWeight:0})"></el-button>
  212. </el-tooltip>
  213. </template>
  214. <template slot="ctnTypeHeader" slot-scope="{column}">
  215. {{ column.label }}<span style="color:#F56C6C">*</span>
  216. </template>
  217. <template slot="ctnQuantityHeader" slot-scope="{column}">
  218. {{ column.label }}<span style="color:#F56C6C">*</span>
  219. </template>
  220. <!-- <template slot="landWeightHeader" slot-scope="{column}">-->
  221. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  222. <!-- </template>-->
  223. <!-- <template slot="landAmountDHeader" slot-scope="{column}">-->
  224. <!-- {{ column.label }}<span style="color:#F56C6C">*</span>-->
  225. <!-- </template>-->
  226. <template slot="arrivalTimeHeader" slot-scope="{column}">
  227. {{ column.label }}<span style="color:#F56C6C">*</span>
  228. </template>
  229. </avue-crud>
  230. </basic-container>
  231. <basic-container v-if="goodsForm.status !== 0 && goodsForm.status" v-show="false">
  232. <avue-crud
  233. :data="entrustList"
  234. :option="entrustOptionTwoT"
  235. ref="crudBoxTwo"
  236. v-if="KeyBoxTwo>0"
  237. @resetColumn="resetColumnBoxTwo"
  238. @saveColumn="saveColumnBoxTwo"
  239. @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
  240. @row-update="rowSaveT">
  241. <template slot="fleetId" slot-scope="{ row, index }">
  242. <crop-select
  243. v-if="row.$cellEdit"
  244. v-model="row.fleetId"
  245. :cropIndex="index"
  246. @getCorpData="(data)=>{getfleetIdT(data,row)}"
  247. ></crop-select>
  248. <span v-else>{{ row.fleetName }}</span>
  249. </template>
  250. </avue-crud>
  251. </basic-container>
  252. <span v-if="false">
  253. <containerTitle title="起止地信息"></containerTitle>
  254. <basic-container>
  255. <el-table
  256. ref="singleTable"
  257. :data="tableData"
  258. size="mini"
  259. :header-cell-style="{color:'#000',background:'#fafafa'}"
  260. style="width: 100%">
  261. <el-table-column
  262. align="center"
  263. v-if="goodsForm.status === 0"
  264. width="40">
  265. <template slot-scope="scope">
  266. <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
  267. placement="top">
  268. <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"></el-button>
  269. </el-tooltip>
  270. </template>
  271. </el-table-column>
  272. <el-table-column
  273. property="date"
  274. align="center"
  275. width="40">
  276. <template slot-scope="scope">
  277. <span v-if="scope.$index == 0">
  278. <el-button type="primary" size="mini" circle>起</el-button>
  279. </span>
  280. <span v-else-if="scope.$index === tableData.length-1">
  281. <el-button type="success" size="mini" circle>止</el-button>
  282. </span>
  283. <span v-else>
  284. <el-button v-if="goodsForm.status !== 0" type="warning" size="mini" circle>途</el-button>
  285. <el-tooltip v-else class="item" effect="dark" content="删除" placement="left">
  286. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  287. @click="deleteAddress(scope)"></el-button>
  288. </el-tooltip>
  289. </span>
  290. </template>
  291. </el-table-column>
  292. <el-table-column
  293. type="index"
  294. label="序号"
  295. align="center"
  296. width="60">
  297. </el-table-column>
  298. <el-table-column
  299. property="corpId"
  300. label="货运地点"
  301. align="center"
  302. :render-header="customTitle"
  303. width="280">
  304. <template slot-scope="scope">
  305. <crop-select
  306. :corpType="'GC'"
  307. :disabled="goodsForm.status !== 0"
  308. v-model="scope.row.corpId"
  309. @clear="clear(scope.row)"
  310. @getCorpData="(row)=>{withAddress(row,scope)}"/>
  311. </template>
  312. </el-table-column>
  313. <!-- <el-table-column-->
  314. <!-- property="province"-->
  315. <!-- label="省市区"-->
  316. <!-- align="center"-->
  317. <!-- width="280">-->
  318. <!-- <template slot-scope="scope">-->
  319. <!-- <el-cascader-->
  320. <!-- size="small"-->
  321. <!-- style="width: 100%;"-->
  322. <!-- :key="scope.row.key"-->
  323. <!-- :disabled="goodsForm.status === 1"-->
  324. <!-- :props="treeOption"-->
  325. <!-- clearable-->
  326. <!-- v-model="scope.row.region"></el-cascader>-->
  327. <!-- </template>-->
  328. <!-- </el-table-column>-->
  329. <el-table-column
  330. property="address"
  331. align="center"
  332. width="150"
  333. label="联系人">
  334. <template slot-scope="scope">
  335. <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
  336. placeholder="请输入内容"></el-input>
  337. </template>
  338. </el-table-column>
  339. <el-table-column
  340. property="address"
  341. align="center"
  342. width="180"
  343. label="电话">
  344. <template slot-scope="scope">
  345. <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
  346. placeholder="请输入内容"></el-input>
  347. </template>
  348. </el-table-column>
  349. <el-table-column
  350. property="address"
  351. align="center"
  352. label="详细地址">
  353. <template slot-scope="scope">
  354. <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
  355. placeholder="请输入内容"></el-input>
  356. </template>
  357. </el-table-column>
  358. <el-table-column
  359. property="remarks"
  360. align="center"
  361. label="备注">
  362. <template slot-scope="scope">
  363. <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
  364. placeholder="请输入内容"></el-input>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. align="center"
  369. width="40">
  370. <template slot-scope="scope">
  371. <div v-if="scope.$index !== tableData.length-1" style="margin: -5px auto">
  372. <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 1">
  373. <div class="single" style="margin-bottom: -5px">
  374. <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-up" size="mini"
  375. @click="moveUp(scope.row,scope.$index)"></el-button>
  376. </div>
  377. </el-tooltip>
  378. <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
  379. v-if="scope.$index > 0 && scope.$index < tableData.length-2">
  380. <div class="single" style="margin-top: -5px">
  381. <el-button type="text" style="margin-right: -0.5rem" icon="el-icon-arrow-down" size="mini"
  382. @click="moveDown(scope.row,scope.$index)"></el-button>
  383. </div>
  384. </el-tooltip>
  385. </div>
  386. </template>
  387. </el-table-column>
  388. </el-table>
  389. </basic-container>
  390. </span>
  391. <trade-card title="装货地点">
  392. <el-table
  393. ref="singleTable"
  394. border="1"
  395. :data="tableData"
  396. size="mini"
  397. :header-cell-style="{color:'#000',background:'#fafafa'}"
  398. style="width: 100%">
  399. <el-table-column
  400. align="center"
  401. fixed
  402. v-if="goodsForm.status === 0"
  403. width="50">
  404. <template slot-scope="scope" slot="header">
  405. <el-tooltip className="item" effect="dark" content="增加途径地址"
  406. placement="top">
  407. <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"></el-button>
  408. </el-tooltip>
  409. </template>
  410. <template slot-scope="scope">
  411. <el-tooltip class="item" effect="dark" content="删除" placement="right">
  412. <el-button type="danger" icon="el-icon-delete" size="mini" circle
  413. @click="deleteAddress(scope)"></el-button>
  414. </el-tooltip>
  415. </template>
  416. </el-table-column>
  417. <el-table-column
  418. type="index"
  419. label="序号"
  420. align="center"
  421. width="60">
  422. </el-table-column>
  423. <el-table-column
  424. property="freightTime"
  425. label="货运日期"
  426. align="center"
  427. width="200">
  428. <template slot-scope="scope">
  429. <el-date-picker
  430. format="yyyy-MM-dd HH:mm"
  431. value-format="yyyy-MM-dd HH:mm:ss"
  432. v-model="scope.row.freightTime"
  433. :disabled="goodsForm.status !== 0"
  434. type="datetime"
  435. style="width: 100%;"
  436. size="small"
  437. placeholder="选择货运日期">
  438. </el-date-picker>
  439. </template>
  440. </el-table-column>
  441. <el-table-column
  442. property="corpId"
  443. label="货运地点"
  444. align="center"
  445. width="280">
  446. <template slot="header" slot-scope="{ column, $index }">
  447. <e-crop-jump :label="column.label" corp-type="GC"></e-crop-jump>
  448. <span style="color:#F56C6C">*</span>
  449. </template>
  450. <template slot-scope="scope">
  451. <crop-select
  452. :corpType="'GC'"
  453. :disabled="goodsForm.status !== 0"
  454. :slot="true"
  455. v-model="scope.row.corpId"
  456. @clear="clear(scope.row)"
  457. @getCorpData="(row)=>{withAddress(row,scope)}">
  458. <template slot="slot">
  459. <el-select
  460. :disabled="goodsForm.status !== 0"
  461. style="width: 100%;"
  462. filterable
  463. clearable
  464. v-model="scope.row.corpId"
  465. size="small" placeholder="请选择"
  466. @change="withAddress({},scope,true)">
  467. <el-option
  468. v-for="item in corpList"
  469. :key="item.id"
  470. :label="item.cname"
  471. :value="item.id">
  472. </el-option>
  473. </el-select>
  474. </template>
  475. </crop-select>
  476. </template>
  477. </el-table-column>
  478. <el-table-column
  479. property="contacts"
  480. align="center"
  481. width="150"
  482. label="联系人">
  483. <template slot-scope="scope">
  484. <el-input v-model="scope.row.contacts" :disabled="goodsForm.status !== 0" size="small"
  485. placeholder="请输入内容"></el-input>
  486. </template>
  487. </el-table-column>
  488. <el-table-column
  489. property="tel"
  490. align="center"
  491. width="180"
  492. label="电话">
  493. <template slot-scope="scope">
  494. <el-input v-model="scope.row.tel" :disabled="goodsForm.status !== 0" size="small"
  495. placeholder="请输入内容"></el-input>
  496. </template>
  497. </el-table-column>
  498. <el-table-column
  499. property="address"
  500. align="center"
  501. width="280"
  502. label="详细地址">
  503. <template slot-scope="scope">
  504. <el-input v-model="scope.row.address" :disabled="goodsForm.status !== 0" size="small"
  505. placeholder="请输入内容"></el-input>
  506. </template>
  507. </el-table-column>
  508. <el-table-column
  509. property="volume"
  510. align="center"
  511. width="180"
  512. label="货物体积">
  513. <template slot-scope="scope">
  514. <el-input-number :controls="false" v-model="scope.row.volume" size="small"
  515. :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"
  516. @change="calculateFreight()"></el-input-number>
  517. </template>
  518. </el-table-column>
  519. <el-table-column
  520. property="packingType"
  521. align="center"
  522. width="180"
  523. label="包装类型">
  524. <template slot-scope="scope">
  525. <el-select v-model="scope.row.packingType" :disabled="goodsForm.status !== 0" placeholder="请选择">
  526. <el-option
  527. v-for="item in packageType"
  528. :key="item.id"
  529. :label="item.dictValue"
  530. :value="item.dictKey">
  531. </el-option>
  532. </el-select>
  533. </template>
  534. </el-table-column>
  535. <el-table-column
  536. property="weight"
  537. align="center"
  538. width="180"
  539. label="重量">
  540. <template slot-scope="scope">
  541. <el-input v-model="scope.row.weight" :disabled="goodsForm.status !== 0" size="small"
  542. placeholder="请输入内容" @input="calculateFreight()"></el-input>
  543. </template>
  544. </el-table-column>
  545. <el-table-column
  546. property="quantity"
  547. align="center"
  548. width="180"
  549. label="件数">
  550. <template slot-scope="scope">
  551. <el-input v-model="scope.row.quantity" :disabled="goodsForm.status !== 0" size="small"
  552. placeholder="请输入内容" @input="calculateFreight()"></el-input>
  553. </template>
  554. </el-table-column>
  555. <el-table-column
  556. property="remarks"
  557. align="center"
  558. width="200"
  559. label="备注">
  560. <template slot-scope="scope">
  561. <el-input v-model="scope.row.remarks" :disabled="goodsForm.status !== 0" size="small"
  562. placeholder="请输入内容"></el-input>
  563. </template>
  564. </el-table-column>
  565. <el-table-column
  566. align="center"
  567. width="40">
  568. <template slot-scope="scope">
  569. <div style="margin: -5px auto">
  570. <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 0">
  571. <div class="single" style="margin-bottom: -5px">
  572. <el-button
  573. type="text"
  574. style="margin-right: -0.5rem"
  575. icon="el-icon-arrow-up"
  576. size="mini"
  577. @click="moveUp(scope.row,scope.$index)"></el-button>
  578. </div>
  579. </el-tooltip>
  580. <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
  581. v-if="scope.$index < tableData.length-1">
  582. <div class="single" style="margin-top: -5px">
  583. <el-button
  584. type="text"
  585. style="margin-right: -0.5rem"
  586. icon="el-icon-arrow-down"
  587. size="mini"
  588. @click="moveDown(scope.row,scope.$index)"></el-button>
  589. </div>
  590. </el-tooltip>
  591. </div>
  592. </template>
  593. </el-table-column>
  594. <el-table-column
  595. fixed="right"
  596. align="center"
  597. label="操作"
  598. width="80">
  599. <template slot-scope="{row, index}">
  600. <el-button type="text" size="small" icon="el-icon-s-order" @click="annexOpen(row, index,true)">附 件
  601. </el-button>
  602. </template>
  603. </el-table-column>
  604. </el-table>
  605. </trade-card>
  606. <trade-card title="卸货地点">
  607. <el-table
  608. border="1"
  609. ref="singleTable"
  610. :data="tableDataTwo"
  611. size="mini"
  612. :header-cell-style="{color:'#000',background:'#fafafa'}"
  613. style="width: 100%">
  614. <el-table-column
  615. align="center"
  616. fixed
  617. v-if="goodsForm.status === 0"
  618. width="50">
  619. <template slot-scope="scope" slot="header">
  620. <el-tooltip
  621. className="item"
  622. effect="dark"
  623. content="增加途径地址"
  624. placement="top">
  625. <el-button
  626. type="primary"
  627. icon="el-icon-plus"
  628. size="mini"
  629. circle
  630. @click="addAddressTwo">
  631. </el-button>
  632. </el-tooltip>
  633. </template>
  634. <template slot-scope="scope">
  635. <el-tooltip class="item" effect="dark" content="删除" placement="right">
  636. <el-button
  637. type="danger"
  638. icon="el-icon-delete"
  639. size="mini"
  640. circle
  641. @click="deleteAddressTwo(scope)"></el-button>
  642. </el-tooltip>
  643. </template>
  644. </el-table-column>
  645. <el-table-column
  646. type="index"
  647. label="序号"
  648. align="center"
  649. width="60">
  650. </el-table-column>
  651. <el-table-column
  652. property="freightTime"
  653. label="货运日期"
  654. align="center"
  655. width="200">
  656. <template slot-scope="scope">
  657. <el-date-picker
  658. format="yyyy-MM-dd HH:mm"
  659. value-format="yyyy-MM-dd HH:mm:ss"
  660. v-model="scope.row.freightTime"
  661. type="datetime"
  662. :disabled="goodsForm.status !== 0"
  663. style="width: 100%;"
  664. size="small"
  665. placeholder="选择货运日期">
  666. </el-date-picker>
  667. </template>
  668. </el-table-column>
  669. <el-table-column
  670. property="corpId"
  671. label="货运地点"
  672. align="center"
  673. width="280">
  674. <template slot="header" slot-scope="{ column, $index }">
  675. <e-crop-jump :label="column.label" corp-type="GC"></e-crop-jump>
  676. <span style="color:#F56C6C">*</span>
  677. </template>
  678. <template slot-scope="scope">
  679. <crop-select
  680. :corpType="'GC'"
  681. :slot="true"
  682. :disabled="goodsForm.status !== 0"
  683. v-model="scope.row.corpId"
  684. @clear="clear(scope.row)"
  685. @getCorpData="(row)=>{withAddressTwo(row,scope)}">
  686. <template slot="slot">
  687. <el-select @change="withAddressTwo({},scope,true)" :disabled="goodsForm.status !== 0" clearable
  688. style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
  689. <el-option
  690. v-for="item in corpList"
  691. :key="item.id"
  692. :label="item.cname"
  693. :value="item.id">
  694. </el-option>
  695. </el-select>
  696. </template>
  697. </crop-select>
  698. </template>
  699. </el-table-column>
  700. <el-table-column
  701. property="contacts"
  702. align="center"
  703. width="150"
  704. label="联系人">
  705. <template slot-scope="scope">
  706. <el-input
  707. v-model="scope.row.contacts"
  708. :disabled="goodsForm.status !== 0"
  709. size="small"
  710. placeholder="请输入内容"></el-input>
  711. </template>
  712. </el-table-column>
  713. <el-table-column
  714. property="tel"
  715. align="center"
  716. width="180"
  717. label="电话">
  718. <template slot-scope="scope">
  719. <el-input
  720. v-model="scope.row.tel"
  721. :disabled="goodsForm.status !== 0"
  722. size="small"
  723. placeholder="请输入内容"></el-input>
  724. </template>
  725. </el-table-column>
  726. <el-table-column
  727. property="address"
  728. align="center"
  729. width="280"
  730. label="详细地址">
  731. <template slot-scope="scope">
  732. <el-input
  733. v-model="scope.row.address"
  734. :disabled="goodsForm.status !== 0"
  735. size="small"
  736. placeholder="请输入内容"></el-input>
  737. </template>
  738. </el-table-column>
  739. <el-table-column
  740. property="volume"
  741. align="center"
  742. width="180"
  743. label="货物体积">
  744. <template slot-scope="scope">
  745. <el-input-number :controls="false" v-model="scope.row.volume" size="small"
  746. :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"
  747. @change="calculateFreight()"></el-input-number>
  748. </template>
  749. </el-table-column>
  750. <el-table-column
  751. property="packingType"
  752. align="center"
  753. width="180"
  754. label="包装类型">
  755. <template slot-scope="scope">
  756. <el-select v-model="scope.row.packingType" :disabled="goodsForm.status !== 0" placeholder="请选择">
  757. <el-option
  758. v-for="item in packageType"
  759. :key="item.id"
  760. :label="item.dictValue"
  761. :value="item.dictKey">
  762. </el-option>
  763. </el-select>
  764. </template>
  765. </el-table-column>
  766. <el-table-column
  767. property="weight"
  768. align="center"
  769. width="180"
  770. label="重量">
  771. <template slot-scope="scope">
  772. <el-input
  773. v-model="scope.row.weight"
  774. :disabled="goodsForm.status !== 0"
  775. size="small"
  776. @input="calculateFreight()"
  777. placeholder="请输入内容"></el-input>
  778. </template>
  779. </el-table-column>
  780. <el-table-column
  781. property="quantity"
  782. align="center"
  783. width="180"
  784. label="件数">
  785. <template slot-scope="scope">
  786. <el-input
  787. v-model="scope.row.quantity"
  788. :disabled="goodsForm.status !== 0"
  789. size="small"
  790. @input="calculateFreight()"
  791. placeholder="请输入内容"></el-input>
  792. </template>
  793. </el-table-column>
  794. <el-table-column
  795. property="remarks"
  796. align="center"
  797. width="200"
  798. label="备注">
  799. <template slot-scope="scope">
  800. <el-input
  801. v-model="scope.row.remarks"
  802. :disabled="goodsForm.status !== 0"
  803. size="small"
  804. placeholder="请输入内容"></el-input>
  805. </template>
  806. </el-table-column>
  807. <el-table-column
  808. align="center"
  809. width="40">
  810. <template slot-scope="scope">
  811. <div style="margin: -5px auto">
  812. <el-tooltip class="item" effect="dark" content="向上移动" placement="right" v-if="scope.$index > 0">
  813. <div class="single" style="margin-bottom: -5px">
  814. <el-button
  815. type="text"
  816. style="margin-right: -0.5rem"
  817. icon="el-icon-arrow-up"
  818. size="mini"
  819. @click="moveUpTwo(scope.row,scope.$index)"></el-button>
  820. </div>
  821. </el-tooltip>
  822. <el-tooltip class="item" effect="dark" content="向下移动" placement="right"
  823. v-if="scope.$index < tableDataTwo.length-1">
  824. <div class="single" style="margin-top: -5px">
  825. <el-button
  826. type="text"
  827. style="margin-right: -0.5rem"
  828. icon="el-icon-arrow-down"
  829. size="mini"
  830. @click="moveDownTwo(scope.row,scope.$index)"></el-button>
  831. </div>
  832. </el-tooltip>
  833. </div>
  834. </template>
  835. </el-table-column>
  836. <el-table-column
  837. fixed="right"
  838. align="center"
  839. label="操作"
  840. width="80">
  841. <template slot-scope="{row, index}">
  842. <el-button type="text" size="small" icon="el-icon-s-order" @click="annexOpen(row, index,true)">附 件
  843. </el-button>
  844. </template>
  845. </el-table-column>
  846. </el-table>
  847. </trade-card>
  848. <trade-card title="车辆信息">
  849. <avue-form :option="goodsOptionFormTwo" v-model="goodsForm"></avue-form>
  850. </trade-card>
  851. <span v-if="false">
  852. <containerTitle title="车辆信息"></containerTitle>
  853. <basic-container>
  854. <avue-crud
  855. :data="vehicleList"
  856. ref="crudContact"
  857. v-if="keyContact>0"
  858. @resetColumn="resetColumnContact"
  859. @saveColumn="saveColumnContact"
  860. :option="vehicleOption">
  861. <template slot="plateNo" slot-scope="{row}">
  862. <span class="el-button--text" style="cursor: pointer"
  863. @click="openTrack(row)">{{ row.plateNo }}</span>
  864. </template>
  865. </avue-crud>
  866. </basic-container>
  867. </span>
  868. <trade-card title="杂费明细"
  869. v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1 || roleName.indexOf('admin') !== -1 || roleName.indexOf('车队') !== -1">
  870. <el-tabs v-model="activeIndex" @tab-click="handleSelect">
  871. <el-tab-pane
  872. label="应收" name="1"
  873. v-if="(roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1 || roleName.indexOf('admin') !== -1) && !(roleName.indexOf('调度中心业务员') !== -1 || roleName.indexOf('调度中心经理') !== -1)"
  874. ></el-tab-pane>
  875. <el-tab-pane
  876. label="应付" name="2"
  877. v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('admin') !== -1 || roleName.indexOf('车队') !== -1"
  878. ></el-tab-pane>
  879. </el-tabs>
  880. <avue-crud
  881. v-if="activeIndex === '1'"
  882. :data="collectionList"
  883. :option="collectionOption"
  884. :key="key"
  885. ref="collection"
  886. @resetColumn="resetColumnCollection"
  887. @saveColumn="saveColumnCollection"
  888. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  889. @row-update="rowSave"
  890. @row-del="makeDel">
  891. <template slot-scope="{row}" slot="corpId">
  892. <crop-select
  893. v-if="row.$cellEdit"
  894. v-model="row.corpId"
  895. :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
  896. @getCorpData="(data)=>{getfleetId(data,row)}"
  897. ></crop-select>
  898. <span v-else>{{ row.corpName }}</span>
  899. </template>
  900. <template slot-scope="{row}" slot="feeId">
  901. <breakdown-select
  902. v-if="row.$cellEdit"
  903. v-model="row.feeId"
  904. :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
  905. @selectValue="(value) => selectValue(value,row)"
  906. :configuration="breakConfiguration">
  907. </breakdown-select>
  908. <span v-else>{{ row.feeName }}</span>
  909. </template>
  910. <template slot-scope="{row,index}" slot="menu">
  911. <el-button
  912. type="text"
  913. size="small"
  914. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  915. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  916. @click="rowCell(row,index)"
  917. >{{ row.$cellEdit ? '保存' : '编辑' }}
  918. </el-button>
  919. <el-button type="text"
  920. icon="el-icon-delete"
  921. size="small"
  922. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  923. @click="$refs.collection.rowDel(row,index)"
  924. >删除
  925. </el-button>
  926. <el-button
  927. size="small"
  928. type="text"
  929. icon="el-icon-s-order"
  930. @click="annexOpen(row, index)"
  931. >附 件
  932. </el-button>
  933. </template>
  934. <template slot="menuLeft">
  935. <el-button
  936. type="primary"
  937. icon="el-icon-plus"
  938. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  939. @click="addRowCollection"
  940. size="small">录入明细
  941. </el-button>
  942. </template>
  943. </avue-crud>
  944. <avue-crud
  945. v-if="activeIndex === '2'"
  946. :data="paymentList"
  947. :option="paymentOption"
  948. :key="key"
  949. ref="payment"
  950. @resetColumn="resetColumnPayment"
  951. @saveColumn="saveColumnPayment"
  952. @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
  953. @row-update="rowSave"
  954. @row-del="feeDel"
  955. >
  956. <template slot-scope="{row}" slot="corpId">
  957. <crop-select
  958. v-if="row.$cellEdit"
  959. v-model="row.corpId"
  960. :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
  961. @getCorpData="(data)=>{getfleetId(data,row)}"
  962. ></crop-select>
  963. <span v-else>{{ row.corpName }}</span>
  964. </template>
  965. <template slot-scope="{row}" slot="feeId">
  966. <breakdown-select
  967. v-if="row.$cellEdit"
  968. v-model="row.feeId"
  969. :disabled="!((roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1)"
  970. @selectValue="(value) => selectValue(value,row)"
  971. :configuration="breakConfiguration"
  972. >
  973. </breakdown-select>
  974. <span v-else>{{ row.feeName }}</span>
  975. </template>
  976. <template slot-scope="{row,index}" slot="menu">
  977. <el-button
  978. type="text"
  979. size="small"
  980. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  981. :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
  982. @click="paymentRowCell(row,index)"
  983. >{{ row.$cellEdit ? '保存' : '编辑' }}
  984. </el-button>
  985. <el-button type="text"
  986. icon="el-icon-delete"
  987. size="small"
  988. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  989. @click="$refs.payment.rowDel(row,index)"
  990. >删除
  991. </el-button>
  992. <el-button
  993. size="small"
  994. type="text"
  995. icon="el-icon-s-order"
  996. @click="annexOpen(row, index)"
  997. >附 件
  998. </el-button>
  999. </template>
  1000. <template slot="menuLeft">
  1001. <el-button
  1002. type="primary"
  1003. icon="el-icon-plus"
  1004. v-if="(roleName.indexOf('平台') !== -1 && roleName.indexOf('分管调度') !== -1) || roleName.indexOf('admin') !== -1"
  1005. @click="addRowPayment"
  1006. size="small">录入明细
  1007. </el-button>
  1008. </template>
  1009. </avue-crud>
  1010. </trade-card>
  1011. <containerTitle title="上传附件"></containerTitle>
  1012. <c-upload
  1013. typeUpload="CD"
  1014. :basic="false"
  1015. deleteUrl="/api/blade-client/common-file/remove"
  1016. :data="orderFilesList"
  1017. display
  1018. :enumerationValue="85.6"
  1019. ></c-upload>
  1020. <el-dialog
  1021. title="附件"
  1022. :visible.sync="enclosure"
  1023. append-to-body
  1024. width="70%">
  1025. <c-upload
  1026. typeUpload="GZ"
  1027. :basic="true"
  1028. deleteUrl="/api/blade-client/common-file/remove"
  1029. :data="orderList"
  1030. :disabled="goodsForm.status !== 0"
  1031. :enumerationValue="85.71"
  1032. ></c-upload>
  1033. <span slot="footer" class="dialog-footer">
  1034. <el-button @click="enclosure = false" size="small">取 消</el-button>
  1035. <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
  1036. </span>
  1037. </el-dialog>
  1038. <track-playback :dialogVisible="dialogVisible" :lineArr="lineArr" ref="playback"></track-playback>
  1039. </div>
  1040. </template>
  1041. <script>
  1042. import {getLazyTree} from "@/api/base/region";
  1043. import {
  1044. saveDelegationList,
  1045. detailDelegationList,
  1046. removeCollection,
  1047. saveSaveList,
  1048. statusBulkLoad,
  1049. addressList, cancelSubmission, getCorp, getSalesman, getFee, changeSubmission, validChange, tRemove, saveFile
  1050. } from "@/api/landTransportation/bulkCargo";
  1051. import {getDeptTree} from "@/api/system/dept";
  1052. import website from "@/config/website";
  1053. import {gaude, location} from "@/api/gaude";
  1054. //地图回放
  1055. import trackPlayback from "@/components/trackPlayback"
  1056. import {fleetList, telephone} from "@/api/landTransportation";
  1057. import {getDictionary} from "@/api/system/dictbiz";
  1058. import {allCropList, customerList} from "@/api/basicData/customerInformation";
  1059. // goodsOptionFormTwo
  1060. export default {
  1061. comments: {
  1062. trackPlayback
  1063. },
  1064. props: {
  1065. id: {
  1066. type: String
  1067. },
  1068. home: {
  1069. type: Boolean
  1070. }
  1071. },
  1072. watch: {
  1073. goodsForm: {
  1074. handler(newValue, oldValue) {
  1075. if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('admin') !== -1) {
  1076. this.findObject(this.goodsOptionForm.column, "remarks").display = true
  1077. } else {
  1078. this.findObject(this.goodsOptionForm.column, "remarks").display = false
  1079. }
  1080. if (this.roleName.indexOf('admin') !== -1 || this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('车队') !== -1 || this.roleName.indexOf('司机') !== -1) {
  1081. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").display = true
  1082. } else {
  1083. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").display = false
  1084. }
  1085. if (!this.typeTwo) {
  1086. // this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 5
  1087. if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('司机') !== -1) {
  1088. this.goodsOptionFormTwo.disabled = true
  1089. } else {
  1090. if (this.goodsForm.status === 0) {
  1091. this.goodsOptionFormTwo.disabled = true
  1092. } else if (this.goodsForm.status === 1) {
  1093. this.goodsOptionFormTwo.disabled = false
  1094. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('admin') !== -1) {
  1095. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
  1096. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
  1097. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
  1098. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
  1099. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
  1100. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
  1101. }
  1102. } else if (this.goodsForm.status === 2) {
  1103. this.goodsOptionFormTwo.disabled = false
  1104. if (this.roleName.indexOf('车队') !== -1 || this.roleName.indexOf('admin') !== -1) {
  1105. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
  1106. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
  1107. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
  1108. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
  1109. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
  1110. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
  1111. } else {
  1112. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
  1113. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
  1114. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
  1115. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
  1116. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
  1117. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = true
  1118. }
  1119. } else {
  1120. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
  1121. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
  1122. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
  1123. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
  1124. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
  1125. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = true
  1126. }
  1127. }
  1128. }
  1129. if (this.roleName.indexOf('调度中心业务员') !== -1 || this.roleName.indexOf('调度中心经理') !== -1) {
  1130. this.findObject(this.goodsOptionForm.column,'freightCollect').display = false
  1131. }
  1132. }
  1133. }
  1134. },
  1135. data() {
  1136. return {
  1137. returnButton: Boolean,
  1138. dialogVisible: false,
  1139. lineArr: [],
  1140. activeIndex: '1',
  1141. KeyBox: 0,
  1142. KeyBoxTwo: 0,
  1143. typeTwo: false,
  1144. type: false,
  1145. enclosure: false,
  1146. orderList: [],
  1147. goodsForm: {},
  1148. corpList: [],
  1149. modelKey: 1,
  1150. orderFilesList: [],
  1151. salesmanList: [],
  1152. vehicleList: [],
  1153. packageType: [],
  1154. breakConfiguration: {
  1155. multipleChoices: false,
  1156. multiple: false,
  1157. disabled: false,
  1158. searchShow: true,
  1159. collapseTags: false,
  1160. clearable: true,
  1161. placeholder: '请点击右边按钮选择',
  1162. dicData: []
  1163. },
  1164. roleName: localStorage.getItem("roleName").split(','),
  1165. advantageProjectData: [],
  1166. keyContact: 0,
  1167. vehicleOptionTwo: {
  1168. align: 'center',
  1169. menuAlign: 'center',
  1170. refreshBtn: false,
  1171. menu: false,
  1172. index: true,
  1173. stripe: true,
  1174. cellBtn: false,
  1175. addBtn: false,
  1176. cancelBtn: false,
  1177. editBtn: false,
  1178. addRowBtn: false,
  1179. delBtn: false,
  1180. showSummary: true,
  1181. // editBtn:false,
  1182. summaryText: "合计",
  1183. sumColumnList: [
  1184. {
  1185. name: 'landWeight',
  1186. type: 'sum',
  1187. decimals: 2
  1188. }, {
  1189. name: 'landAmountC',
  1190. type: 'sum',
  1191. decimals: 2
  1192. }, {
  1193. name: 'landAmountD',
  1194. type: 'sum',
  1195. decimals: 2
  1196. }, {
  1197. name: 'oneFeeD',
  1198. type: 'sum',
  1199. decimals: 2
  1200. }, {
  1201. name: 'twoFeeD',
  1202. type: 'sum',
  1203. decimals: 2
  1204. }, {
  1205. name: 'threeFeeD',
  1206. type: 'sum',
  1207. decimals: 2
  1208. }, {
  1209. name: 'fourFeeD',
  1210. type: 'sum',
  1211. decimals: 2
  1212. }, {
  1213. name: 'fiveFeeD',
  1214. type: 'sum',
  1215. decimals: 2
  1216. }, {
  1217. name: 'oneFeeC',
  1218. type: 'sum',
  1219. decimals: 2
  1220. }, {
  1221. name: 'twoFeeC',
  1222. type: 'sum',
  1223. decimals: 2
  1224. }, {
  1225. name: 'threeFeeC',
  1226. type: 'sum',
  1227. decimals: 2
  1228. }, {
  1229. name: 'fourFeeC',
  1230. type: 'sum',
  1231. decimals: 2
  1232. }, {
  1233. name: 'fiveFeeC',
  1234. type: 'sum',
  1235. decimals: 2
  1236. }, {
  1237. name: 'landAmountD',
  1238. type: 'sum',
  1239. decimals: 2
  1240. }, {
  1241. name: 'ctnQuantity',
  1242. type: 'sum',
  1243. decimals: 0
  1244. }],
  1245. column: [{
  1246. label: '货运日期',
  1247. type: "datetime",
  1248. format: 'yyyy-MM-dd HH:mm',
  1249. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1250. width: 200,
  1251. index: 1,
  1252. prop: 'arrivalTime'
  1253. }, {
  1254. label: '受理日期',
  1255. type: "datetime",
  1256. format: 'yyyy-MM-dd HH:mm',
  1257. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1258. width: 200,
  1259. index: 2,
  1260. prop: 'acceptTime'
  1261. }, {
  1262. label: '实际到厂时间',
  1263. prop: 'realArrivalTime',
  1264. overHidden: true,
  1265. type: "date",
  1266. searchRange: true,
  1267. defaultTime: ['00:00:00', '23:59:59'],
  1268. format: "yyyy-MM-dd HH:mm",
  1269. valueFormat: "yyyy-MM-dd HH:mm:ss",
  1270. index: 3,
  1271. width: 140,
  1272. }, {
  1273. label: '车队',
  1274. width: 150,
  1275. index: 4,
  1276. prop: 'fleetShortName'
  1277. }, {
  1278. label: '车号',
  1279. width: 150,
  1280. index: 4,
  1281. prop: 'plateNo'
  1282. }, {
  1283. label: '司机',
  1284. width: 115,
  1285. index: 5,
  1286. prop: 'driverName'
  1287. }, {
  1288. label: '电话',
  1289. width: 160,
  1290. index: 6,
  1291. prop: 'tel'
  1292. }, {
  1293. label: '完工日期',
  1294. prop: 'finishedTime',
  1295. overHidden: true,
  1296. type: "date",
  1297. searchRange: true,
  1298. defaultTime: ['00:00:00', '23:59:59'],
  1299. format: "yyyy-MM-dd HH:mm",
  1300. valueFormat: "yyyy-MM-dd HH:mm:ss",
  1301. index: 7,
  1302. width: 140,
  1303. }, {
  1304. label: '箱型',
  1305. width: 100,
  1306. slot: true,
  1307. index: 8,
  1308. prop: 'ctnType'
  1309. }, {
  1310. label: '箱量',
  1311. width: 50,
  1312. index: 9,
  1313. prop: 'ctnQuantity'
  1314. }, {
  1315. label: '货物名称',
  1316. overHidden: true,
  1317. width: 160,
  1318. index: 10,
  1319. prop: 'goods'
  1320. }, {
  1321. label: '件数',
  1322. width: 100,
  1323. overHidden: true,
  1324. controls: false,
  1325. cell: true,
  1326. index: 11,
  1327. prop: 'quantity',
  1328. type: 'number',
  1329. precision: 0
  1330. }, {
  1331. label: '重量',
  1332. width: 160,
  1333. prop: 'landWeight',
  1334. controls: false,
  1335. precision: 2,
  1336. index: 12,
  1337. type: 'number'
  1338. }, {
  1339. label: '尺码',
  1340. width: 100,
  1341. overHidden: true,
  1342. index: 13,
  1343. prop: 'size',
  1344. }, {
  1345. label: '委托备注',
  1346. width: 245,
  1347. index: 14,
  1348. prop: 'remarks'
  1349. }, {
  1350. label: '状态',
  1351. width: 100,
  1352. index: 15,
  1353. type: 'select',
  1354. dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
  1355. props: {
  1356. label: "dictValue",
  1357. value: "dictKey"
  1358. },
  1359. dataType: "string",
  1360. prop: 'status'
  1361. }
  1362. // {
  1363. // label: '应付陆运费',
  1364. // cell: true,
  1365. // prop: 'landAmountC'
  1366. // }
  1367. // , {
  1368. // label: '车队备注',
  1369. // width: 245,
  1370. // prop: 'fleetRemarks'
  1371. // }, {
  1372. // label: '司机备注',
  1373. // width: 245,
  1374. // prop: 'driverRemarks'
  1375. // }
  1376. ]
  1377. },
  1378. vehicleOption: {},
  1379. treeOption: {
  1380. label: 'title',
  1381. value: 'id',
  1382. lazy: true,
  1383. lazyLoad(node, resolve) {
  1384. const parentId = node.level === 0 ? '00' : node.data.id;
  1385. getLazyTree(parentId).then(res => {
  1386. resolve(
  1387. res.data.data.map(item => {
  1388. return {
  1389. ...item,
  1390. leaf: !item.hasChildren
  1391. };
  1392. })
  1393. );
  1394. });
  1395. }
  1396. },
  1397. tableData: [],
  1398. tableDataTwo: [],
  1399. entrustListT: [],
  1400. entrustOptionTwoTBackup: {
  1401. align: 'center',
  1402. menuAlign: 'center',
  1403. index: true,
  1404. cellBtn: true,
  1405. menu: false,
  1406. refreshBtn: false,
  1407. addBtn: false,
  1408. addRowBtn: false,
  1409. delBtn: false,
  1410. showSummary: true,
  1411. summaryText: "合计",
  1412. sumColumnList: [
  1413. {
  1414. name: 'landWeight',
  1415. type: 'sum',
  1416. decimals: 2
  1417. }, {
  1418. name: 'landAmountC',
  1419. type: 'sum',
  1420. decimals: 2
  1421. }, {
  1422. name: 'landAmountD',
  1423. type: 'sum',
  1424. decimals: 2
  1425. }, {
  1426. name: 'oneFeeD',
  1427. type: 'sum',
  1428. decimals: 2
  1429. }, {
  1430. name: 'twoFeeD',
  1431. type: 'sum',
  1432. decimals: 2
  1433. }, {
  1434. name: 'threeFeeD',
  1435. type: 'sum',
  1436. decimals: 2
  1437. }, {
  1438. name: 'fourFeeD',
  1439. type: 'sum',
  1440. decimals: 2
  1441. }, {
  1442. name: 'fiveFeeD',
  1443. type: 'sum',
  1444. decimals: 2
  1445. }, {
  1446. name: 'ctnQuantity',
  1447. type: 'sum',
  1448. decimals: 0
  1449. }],
  1450. column: [{
  1451. label: '货运日期',
  1452. type: "datetime",
  1453. format: 'yyyy-MM-dd HH:mm',
  1454. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1455. index: 1,
  1456. cell: true,
  1457. width: 200,
  1458. prop: 'arrivalTime'
  1459. }, {
  1460. label: '箱型',
  1461. width: 100,
  1462. index: 2,
  1463. prop: 'ctnType'
  1464. }, {
  1465. label: '箱量',
  1466. width: 50,
  1467. index: 3,
  1468. prop: 'ctnQuantity'
  1469. }, {
  1470. label: '运费',
  1471. prop: 'landAmountD',
  1472. width: 100,
  1473. precision: 2,
  1474. index: 4,
  1475. controls: false,
  1476. }, {
  1477. label: '件数',
  1478. width: 100,
  1479. index: 5,
  1480. overHidden: true,
  1481. controls: false,
  1482. prop: 'quantity',
  1483. type: 'number',
  1484. precision: 0
  1485. }, {
  1486. label: '重量',
  1487. width: 160,
  1488. index: 6,
  1489. prop: 'landWeight',
  1490. controls: false,
  1491. precision: 2,
  1492. type: 'number'
  1493. }
  1494. // , {
  1495. // label: '包装',
  1496. // width: 100,
  1497. // index: 7,
  1498. // overHidden: true,
  1499. // prop: 'packing',
  1500. // type: 'select',
  1501. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1502. // props: {
  1503. // label: "dictValue",
  1504. // value: "dictValue"
  1505. // },
  1506. // }
  1507. , {
  1508. label: '尺码',
  1509. width: 100,
  1510. index: 8,
  1511. overHidden: true,
  1512. prop: 'size',
  1513. }, {
  1514. label: '货物名称',
  1515. width: 200,
  1516. index: 9,
  1517. overHidden: true,
  1518. prop: 'goods',
  1519. }, {
  1520. label: '备注',
  1521. width: 200,
  1522. index: 10,
  1523. prop: 'remarks'
  1524. }]
  1525. },
  1526. entrustOptionTwoT: {},
  1527. entrustList: [],
  1528. goodsOptionFormC: {
  1529. menuBtn: false,
  1530. disabled: false,
  1531. span: 8,
  1532. column: [{
  1533. label: '业务类型',
  1534. prop: 'businessType',
  1535. type: 'select',
  1536. dicUrl: "/api/blade-system/dict-biz/dictionary?code=business_type",
  1537. props: {
  1538. label: "dictValue",
  1539. value: "dictValue"
  1540. },
  1541. rules: [{
  1542. required: false,
  1543. message: " ",
  1544. trigger: "blur"
  1545. }]
  1546. }, {
  1547. label: '运输方式',
  1548. disabled: true,
  1549. prop: 'shippingMode',
  1550. type: 'select',
  1551. dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
  1552. props: {
  1553. label: "dictValue",
  1554. value: "dictValue"
  1555. }
  1556. }, {
  1557. label: '平台号',
  1558. prop: 'orderNo',
  1559. disabled: true
  1560. }]
  1561. },
  1562. goodsOptionForm: {
  1563. menuBtn: false,
  1564. disabled: false,
  1565. span: 8,
  1566. column: [{
  1567. label: '公司名称',
  1568. formslot: true,
  1569. prop: 'corpId',
  1570. rules: [{
  1571. required: true,
  1572. message: " ",
  1573. trigger: "change"
  1574. }],
  1575. }, {
  1576. label: '所属部门',
  1577. prop: 'salesmanDept',
  1578. type: "tree",
  1579. filter: false,
  1580. dicData: [],
  1581. props: {
  1582. label: "title"
  1583. }
  1584. }, {
  1585. label: '业务员',
  1586. prop: 'salesman',
  1587. rules: [{
  1588. required: true,
  1589. message: " ",
  1590. trigger: "blur"
  1591. }]
  1592. }, {
  1593. label: '物流运输',
  1594. prop: 'dispatchDept',
  1595. span: 6,
  1596. dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
  1597. cascader: ['dispatcher'],
  1598. type: "select",
  1599. props: {
  1600. label: "deptName",
  1601. value: "id"
  1602. },
  1603. rules: [{
  1604. required: true,
  1605. message: " ",
  1606. trigger: "blur"
  1607. }]
  1608. }, {
  1609. label: '运输调度',
  1610. prop: 'dispatcher',
  1611. span: 6,
  1612. type: "select",
  1613. dicUrl: "/api/blade-user/userList?deptPid={{key}}",
  1614. props: {
  1615. label: "realName",
  1616. value: "id"
  1617. }
  1618. }, {
  1619. label: '委托日期',
  1620. prop: 'bsDate',
  1621. type: "datetime",
  1622. span: 6,
  1623. format: 'yyyy-MM-dd HH:mm',
  1624. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1625. }, {
  1626. label: '车型',
  1627. span: 6,
  1628. prop: 'fleetVolum',
  1629. type: 'select',
  1630. dicUrl: "/api/blade-system/dict-biz/dictionary?code=vehicle_type",
  1631. props: {
  1632. label: "dictValue",
  1633. value: "dictKey"
  1634. },
  1635. dataType: "string",
  1636. }, {
  1637. label: '合同号',
  1638. span: 6,
  1639. prop: 'contractNo'
  1640. }, {
  1641. label: '联系电话',
  1642. span: 6,
  1643. prop: 'tel'
  1644. }, {
  1645. label: '派车单号',
  1646. prop: 'dispatchNumber',
  1647. span: 12,
  1648. rules: [{
  1649. required: false,
  1650. message: " ",
  1651. trigger: "blur"
  1652. }],
  1653. }, {
  1654. label: '计价单位',
  1655. span: 6,
  1656. type: "select",
  1657. dicUrl: "/api/blade-system/dict-biz/dictionary?code=count_unit",
  1658. props: {
  1659. label: "dictValue",
  1660. value: "dictKey"
  1661. },
  1662. prop: 'pricingUnit',
  1663. change: (data) => {
  1664. this.goodsForm.pricingUnit = data.value
  1665. this.calculateFreight(data)
  1666. }
  1667. }, {
  1668. label: '装卸货',
  1669. span: 6,
  1670. type: "select",
  1671. prop: 'loadingUnloading',
  1672. props: {
  1673. label: "dictValue",
  1674. value: "dictValue"
  1675. },
  1676. dicData: [{
  1677. dictValue: '装货'
  1678. }, {
  1679. dictValue: '卸货'
  1680. }],
  1681. change: (data) => {
  1682. this.goodsForm.loadingUnloading = data.value
  1683. this.calculateFreight(data)
  1684. }
  1685. }, {
  1686. label: '单价',
  1687. span: 6,
  1688. prop: 'unitPrice',
  1689. change: (data) => {
  1690. this.goodsForm.unitPrice = data.value
  1691. this.calculateFreight(data)
  1692. }
  1693. }, {
  1694. label: '单车运费',
  1695. span: 6,
  1696. type: 'number',
  1697. controls: false,
  1698. precision: 2,
  1699. prop: 'freightCollect'
  1700. }
  1701. // , {
  1702. // label: '场站',
  1703. // prop: 'station',
  1704. // rules: [{
  1705. // required: true,
  1706. // message: " ",
  1707. // trigger: "blur"
  1708. // }],
  1709. // }, {
  1710. // label: '货运日期',
  1711. // type: "datetime",
  1712. // format: 'yyyy-MM-dd HH:mm:ss',
  1713. // valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1714. // prop: 'arrivalTime',
  1715. // rules: [{
  1716. // required: true,
  1717. // message: " ",
  1718. // trigger: "blur"
  1719. // }],
  1720. // }
  1721. , {
  1722. label: '备注',
  1723. span: 24,
  1724. minRows: 2,
  1725. prop: 'remarks',
  1726. type: 'textarea'
  1727. }]
  1728. },
  1729. goodsOptionFormTwoBack: {
  1730. menuBtn: false,
  1731. disabled: false,
  1732. span: 8,
  1733. column: [
  1734. // {
  1735. // label: '所属公司',
  1736. // formslot: true,
  1737. // prop: 'belongCompany',
  1738. // rules: [{
  1739. // required: false,
  1740. // message: " ",
  1741. // trigger: "blur"
  1742. // }],
  1743. // },
  1744. {
  1745. label: '船名航次',
  1746. prop: 'factory',
  1747. rules: [{
  1748. required: false,
  1749. message: " ",
  1750. trigger: "blur"
  1751. }],
  1752. }
  1753. // , {
  1754. // label: '货物名称',
  1755. // prop: 'goods',
  1756. // rules: [{
  1757. // required: false,
  1758. // message: " ",
  1759. // trigger: "blur"
  1760. // }],
  1761. // }
  1762. , {
  1763. label: '开船日期',
  1764. prop: 'etd',
  1765. type: 'date'
  1766. }, {
  1767. label: '预配箱量',
  1768. prop: 'expectCtnQty'
  1769. }, {
  1770. label: '起运港',
  1771. prop: 'polId'
  1772. }, {
  1773. label: '目的港',
  1774. prop: 'podId'
  1775. }, {
  1776. label: '截港日期',
  1777. prop: 'etc',
  1778. type: 'date'
  1779. }, {
  1780. label: '截单日期',
  1781. prop: 'siCutoffDate',
  1782. type: 'date'
  1783. }, {
  1784. label: '订舱代理',
  1785. prop: 'agentId'
  1786. }]
  1787. },
  1788. goodsOptionFormTwo: {
  1789. menuBtn: false,
  1790. disabled: false,
  1791. span: 8,
  1792. column: [{
  1793. label: '车队',
  1794. prop: 'fleetId',
  1795. type: 'select',
  1796. dicUrl: "/api/blade-client/corpsdesc/fleetList",
  1797. cascader: ['plateNo'],
  1798. props: {
  1799. label: "cname",
  1800. value: "id"
  1801. }
  1802. }, {
  1803. label: '车号',
  1804. prop: 'plateNo',
  1805. filterable: true,
  1806. allowCreate: true,
  1807. cascader: ['driverId'],
  1808. type: "select",
  1809. dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
  1810. props: {
  1811. label: "plateNo",
  1812. value: "plateNo"
  1813. },
  1814. }, {
  1815. label: '司机',
  1816. prop: 'driverId',
  1817. type: "select",
  1818. filterable: true,
  1819. allowCreate: true,
  1820. dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
  1821. props: {
  1822. label: "name",
  1823. value: "id"
  1824. }
  1825. }, {
  1826. label: '电话',
  1827. prop: 'driverTel'
  1828. }, {
  1829. label: '应付运费',
  1830. prop: 'freightPay'
  1831. }, {
  1832. label: '备注',
  1833. prop: 'fleetRemarks'
  1834. }]
  1835. },
  1836. entrustOptionTwoBackup: {
  1837. align: 'center',
  1838. menuAlign: 'center',
  1839. refreshBtn: false,
  1840. addBtnText: '录入信息',
  1841. index: true,
  1842. indexSlot: true,
  1843. cellBtn: true,
  1844. addBtn: false,
  1845. addRowBtn: false,
  1846. showSummary: true,
  1847. summaryText: "合计",
  1848. sumColumnList: [
  1849. {
  1850. name: 'landWeight',
  1851. type: 'sum',
  1852. decimals: 2
  1853. }, {
  1854. name: 'landAmountD',
  1855. type: 'sum',
  1856. decimals: 2
  1857. }, {
  1858. name: 'oneFeeD',
  1859. type: 'sum',
  1860. decimals: 2
  1861. }, {
  1862. name: 'twoFeeD',
  1863. type: 'sum',
  1864. decimals: 2
  1865. }, {
  1866. name: 'threeFeeD',
  1867. type: 'sum',
  1868. decimals: 2
  1869. }, {
  1870. name: 'fourFeeD',
  1871. type: 'sum',
  1872. decimals: 2
  1873. }, {
  1874. name: 'fiveFeeD',
  1875. type: 'sum',
  1876. decimals: 2
  1877. }, {
  1878. name: 'ctnQuantity',
  1879. type: 'sum',
  1880. decimals: 0
  1881. }],
  1882. column: [{
  1883. label: '货运日期',
  1884. type: "datetime",
  1885. format: 'yyyy-MM-dd HH:mm',
  1886. valueFormat: 'yyyy-MM-dd HH:mm:ss',
  1887. cell: true,
  1888. width: 200,
  1889. index: 1,
  1890. prop: 'arrivalTime'
  1891. }, {
  1892. // label: '箱型',
  1893. label: '箱型',
  1894. cell: true,
  1895. prop: 'ctnType',
  1896. type: 'select',
  1897. width: 100,
  1898. index: 2,
  1899. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
  1900. props: {
  1901. label: "dictValue",
  1902. value: "dictValue"
  1903. },
  1904. }, {
  1905. label: '箱量',
  1906. cell: true,
  1907. prop: 'ctnQuantity',
  1908. controls: false,
  1909. precision: 0,
  1910. index: 3,
  1911. width: 100,
  1912. maxRows: 999,
  1913. minRows: 1,
  1914. type: 'number'
  1915. }, {
  1916. label: '运费',
  1917. cell: true,
  1918. prop: 'landAmountD',
  1919. controls: false,
  1920. width: 200,
  1921. index: 4,
  1922. precision: 2,
  1923. type: 'number'
  1924. }, {
  1925. label: '件数',
  1926. width: 100,
  1927. index: 5,
  1928. overHidden: true,
  1929. controls: false,
  1930. cell: true,
  1931. prop: 'quantity',
  1932. type: 'number',
  1933. precision: 0
  1934. }, {
  1935. label: '重量(吨)',
  1936. cell: true,
  1937. prop: 'landWeight',
  1938. controls: false,
  1939. width: 200,
  1940. index: 6,
  1941. precision: 2,
  1942. type: 'number'
  1943. }
  1944. // , {
  1945. // label: '包装',
  1946. // width: 100,
  1947. // index: 7,
  1948. // overHidden: true,
  1949. // cell: true,
  1950. // prop: 'packing',
  1951. // type: 'select',
  1952. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=packaging",
  1953. // props: {
  1954. // label: "dictValue",
  1955. // value: "dictValue"
  1956. // },
  1957. // }
  1958. , {
  1959. label: '尺码',
  1960. width: 100,
  1961. index: 8,
  1962. overHidden: true,
  1963. cell: true,
  1964. prop: 'size',
  1965. }, {
  1966. label: '货物名称',
  1967. width: 200,
  1968. index: 9,
  1969. overHidden: true,
  1970. cell: true,
  1971. prop: 'goods',
  1972. }, {
  1973. label: '备注',
  1974. cell: true,
  1975. index: 10,
  1976. width: 200,
  1977. prop: 'remarks'
  1978. }]
  1979. },
  1980. entrustOptionTwo: {},
  1981. collectionList: [],
  1982. collectionOptionBackup: {
  1983. align: 'center',
  1984. menuAlign: 'center',
  1985. refreshBtn: false,
  1986. index: true,
  1987. // menu:false,
  1988. cancelBtn: false,
  1989. editBtn: false,
  1990. delBtn: false,
  1991. cellBtn: false,
  1992. addBtn: false,
  1993. addRowBtn: false,
  1994. showSummary: true,
  1995. addBtnText: '录入明细',
  1996. summaryText: "合计",
  1997. sumColumnList: [{
  1998. name: 'price',
  1999. type: 'sum',
  2000. decimals: 2
  2001. }, {
  2002. name: 'amount',
  2003. type: 'sum',
  2004. decimals: 2
  2005. }, {
  2006. name: 'quantity',
  2007. type: 'sum',
  2008. decimals: 0
  2009. }],
  2010. column: [{
  2011. label: '公司名称',
  2012. slot: true,
  2013. width: 200,
  2014. overHidden: true,
  2015. prop: 'corpId',
  2016. index: 1
  2017. }, {
  2018. label: '车号',
  2019. prop: 'plateNo',
  2020. width: 100,
  2021. index: 2
  2022. }, {
  2023. label: '费用名称',
  2024. slot: true,
  2025. width: 200,
  2026. prop: 'feeId',
  2027. index: 3,
  2028. }, {
  2029. label: '计价单位',
  2030. cell: true,
  2031. prop: 'unit',
  2032. type: "select",
  2033. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  2034. props: {
  2035. label: "dictValue",
  2036. value: "dictKey"
  2037. },
  2038. index: 4,
  2039. }, {
  2040. label: '单价',
  2041. cell: true,
  2042. prop: 'price',
  2043. index: 5
  2044. }, {
  2045. label: '数量',
  2046. cell: true,
  2047. prop: 'quantity',
  2048. index: 6
  2049. }, {
  2050. label: '金额',
  2051. cell: true,
  2052. prop: 'amount',
  2053. index: 7
  2054. }, {
  2055. // label: '税率(默认6)',
  2056. label: '税率',
  2057. cell: true,
  2058. prop: 'taxRate',
  2059. index: 8
  2060. }, {
  2061. label: '币别',
  2062. cell: true,
  2063. prop: 'currency',
  2064. type: "select",
  2065. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  2066. props: {
  2067. label: "dictValue",
  2068. value: "dictKey"
  2069. },
  2070. index: 9
  2071. }]
  2072. },
  2073. paymentList: [],
  2074. key: 0,
  2075. collectionOption: {},
  2076. paymentOption: {},
  2077. paymentOptionBackup: {
  2078. align: 'center',
  2079. menuAlign: 'center',
  2080. index: true,
  2081. cancelBtn: false,
  2082. refreshBtn: false,
  2083. editBtn: false,
  2084. delBtn: false,
  2085. cellBtn: false,
  2086. addBtn: false,
  2087. addRowBtn: false,
  2088. showSummary: true,
  2089. addBtnText: '录入明细',
  2090. summaryText: "合计",
  2091. sumColumnList: [{
  2092. name: 'price',
  2093. type: 'sum',
  2094. decimals: 2
  2095. }, {
  2096. name: 'amount',
  2097. type: 'sum',
  2098. decimals: 2
  2099. }, {
  2100. name: 'quantity',
  2101. type: 'sum',
  2102. decimals: 0
  2103. }],
  2104. column: [{
  2105. label: '客户名称',
  2106. cell: true,
  2107. width: 300,
  2108. prop: 'fleetId',
  2109. type: "select",
  2110. index: 1,
  2111. props: {
  2112. label: "fleetName",
  2113. value: "fleetId"
  2114. }
  2115. }, {
  2116. label: '车号',
  2117. prop: 'plateNo',
  2118. width: 100,
  2119. index: 2
  2120. }, {
  2121. label: '费用名称',
  2122. slot: true,
  2123. width: 200,
  2124. prop: 'feeId',
  2125. index: 3
  2126. }, {
  2127. label: '计价单位',
  2128. width: 100,
  2129. cell: true,
  2130. prop: 'unit',
  2131. type: "select",
  2132. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  2133. props: {
  2134. label: "dictValue",
  2135. value: "dictKey"
  2136. },
  2137. index: 4
  2138. }, {
  2139. label: '数量',
  2140. cell: true,
  2141. prop: 'quantity',
  2142. index: 5
  2143. }, {
  2144. label: '单价',
  2145. cell: true,
  2146. prop: 'price',
  2147. index: 6
  2148. }, {
  2149. label: '金额',
  2150. cell: true,
  2151. prop: 'amount',
  2152. index: 7
  2153. }, {
  2154. // label: '税率(默认6)',
  2155. label: '税率',
  2156. cell: true,
  2157. prop: 'taxRate',
  2158. index: 8
  2159. }, {
  2160. label: '币别',
  2161. cell: true,
  2162. prop: 'currency',
  2163. type: "select",
  2164. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  2165. props: {
  2166. label: "dictValue",
  2167. value: "dictKey"
  2168. },
  2169. index: 9
  2170. }]
  2171. }
  2172. };
  2173. },
  2174. async created() {
  2175. if (this.roleName.indexOf('调度中心业务员') === -1 || this.roleName.indexOf('调度中心经理') === -1) {
  2176. this.activeIndex = this.roleName.indexOf('调度中心业务员') === -1 ? '2' : this.roleName.indexOf('调度中心经理') === -1 ? '2' : '1'
  2177. } else {
  2178. this.activeIndex = this.roleName.indexOf('车队') !== -1 ? '2' : '1'
  2179. }
  2180. console.log(this.activeIndex)
  2181. if (this.roleName.indexOf('客户') !== -1) {
  2182. this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
  2183. }
  2184. if (this.roleName.indexOf('车队') !== -1) {
  2185. this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
  2186. }
  2187. if (this.roleName.indexOf('司机') !== -1) {
  2188. this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
  2189. this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
  2190. }
  2191. allCropList({
  2192. corpType: 'GC'
  2193. }).then(res => {
  2194. this.corpList = res.data.data
  2195. })
  2196. getDictionary({code: 'package_type'}).then(res => {
  2197. this.packageType = res.data.data
  2198. })
  2199. this.findObject(this.goodsOptionFormTwo.column, "plateNo").change = (data) => {
  2200. fleetList({fleetId: this.goodsForm.fleetId}).then(res => {
  2201. for (let item in res.data.data) {
  2202. if (data.value === res.data.data[item].plateNo) {
  2203. this.goodsForm.driverId = res.data.data[item].driverId
  2204. this.goodsForm.driverName = res.data.data[item].driverName
  2205. this.goodsForm.driverTel = res.data.data[item].tel
  2206. }
  2207. }
  2208. })
  2209. }
  2210. this.findObject(this.goodsOptionFormTwo.column, "driverId").change = (data) => {
  2211. telephone().then(res => {
  2212. for (let item in res.data.data) {
  2213. if (data.value === res.data.data[item].id) {
  2214. this.goodsForm.driverTel = res.data.data[item].tel
  2215. }
  2216. }
  2217. })
  2218. }
  2219. this.entrustOptionTwo = await this.getColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  2220. this.KeyBox++
  2221. this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  2222. this.KeyBoxTwo++
  2223. this.vehicleOption = await this.getColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  2224. this.keyContact++
  2225. this.collectionOption = await this.getColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  2226. this.paymentOption = await this.getColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  2227. this.key++
  2228. if (this.id) {
  2229. if (this.id.slice(0, 4) === 'copy') {
  2230. detailDelegationList({id: this.id.slice(4, this.id.length)}).then(res => {
  2231. this.goodsForm = res.data.data
  2232. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
  2233. this.tableData = res.data.data.loadingAddressList || []
  2234. this.tableDataTwo = res.data.data.unloadedAddressList || []
  2235. this.entrustList = res.data.data.itemList
  2236. this.goodsList = res.data.data.itemList
  2237. this.vehicleList = res.data.data.orderItemList
  2238. this.orderFilesList = res.data.data.fileList || []
  2239. this.goodsForm.status = 0
  2240. if (res.data.data.orderFeeList.length > 0) {
  2241. res.data.data.orderFeeList.forEach(item => {
  2242. if (item.type == 1) {
  2243. this.collectionList.push(item)
  2244. } else {
  2245. this.paymentList.push(item)
  2246. }
  2247. })
  2248. }
  2249. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
  2250. delete this.goodsForm.orderAddressList
  2251. delete this.goodsForm.itemList
  2252. delete this.goodsForm.orderFeeList
  2253. this.goodsForm.id = ''
  2254. this.goodsForm.orderNo = ''
  2255. this.tableData.forEach(item => item.id = '')
  2256. this.tableDataTwo.forEach(item => item.id = '')
  2257. this.entrustList.forEach(item => item.id = '')
  2258. this.goodsList.forEach(item => item.id = '')
  2259. this.vehicleList.forEach(item => item.id = '')
  2260. this.orderFilesList.forEach(item => item.id = '')
  2261. //查询业务员
  2262. this.salesmanQuery()
  2263. if (this.goodsForm.status == 2) {
  2264. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
  2265. this.goodsForm.status = 2
  2266. }
  2267. }
  2268. })
  2269. } else if (this.id.slice(0, 2) === '首页' || this.id.slice(0, 2) === '台账') {
  2270. if (this.id.slice(0, 2) === '首页') {
  2271. this.returnButton = true
  2272. } else {
  2273. this.returnButton = false
  2274. }
  2275. detailDelegationList({id: this.id.slice(2, this.id.length)}).then(res => {
  2276. this.goodsForm = res.data.data
  2277. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
  2278. this.tableData = res.data.data.loadingAddressList || []
  2279. this.tableDataTwo = res.data.data.unloadedAddressList || []
  2280. this.entrustList = res.data.data.itemList
  2281. this.goodsList = res.data.data.itemList
  2282. this.vehicleList = res.data.data.orderItemList
  2283. this.orderFilesList = res.data.data.fileList || []
  2284. if (res.data.data.orderFeeList.length > 0) {
  2285. res.data.data.orderFeeList.forEach(item => {
  2286. if (item.type == 1) {
  2287. this.collectionList.push(item)
  2288. } else {
  2289. this.paymentList.push(item)
  2290. }
  2291. })
  2292. }
  2293. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
  2294. delete this.goodsForm.orderAddressList
  2295. delete this.goodsForm.itemList
  2296. delete this.goodsForm.orderFeeList
  2297. // this.tableData.forEach(item => {
  2298. // if (item.region) item.region = item.region.split(',')
  2299. // })
  2300. //查询业务员
  2301. this.salesmanQuery()
  2302. if (this.goodsForm.status == 2) {
  2303. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
  2304. this.goodsForm.status = 2
  2305. }
  2306. }
  2307. })
  2308. } else {
  2309. detailDelegationList({id: this.id}).then(res => {
  2310. this.goodsForm = res.data.data
  2311. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
  2312. if (this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1 || this.roleName.indexOf('总调度') !== -1) {
  2313. this.goodsForm.status = 5
  2314. }
  2315. this.tableData = res.data.data.loadingAddressList || []
  2316. this.tableDataTwo = res.data.data.unloadedAddressList || []
  2317. this.entrustList = res.data.data.itemList
  2318. this.goodsList = res.data.data.itemList
  2319. this.vehicleList = res.data.data.orderItemList
  2320. this.orderFilesList = res.data.data.fileList || []
  2321. if (res.data.data.orderFeeList.length > 0) {
  2322. res.data.data.orderFeeList.forEach(item => {
  2323. if (item.type == 1) {
  2324. this.collectionList.push(item)
  2325. } else {
  2326. this.paymentList.push(item)
  2327. }
  2328. })
  2329. }
  2330. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
  2331. delete this.goodsForm.orderAddressList
  2332. delete this.goodsForm.itemList
  2333. delete this.goodsForm.orderFeeList
  2334. // this.tableData.forEach(item => {
  2335. // if (item.region) item.region = item.region.split(',')
  2336. // })
  2337. //查询业务员
  2338. this.salesmanQuery()
  2339. if (this.goodsForm.status == 2) {
  2340. if (this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('经理') !== -1 || this.roleName.indexOf('部门经理') !== -1 || this.roleName.indexOf('总经理') !== -1) {
  2341. this.goodsForm.status = 2
  2342. }
  2343. }
  2344. })
  2345. }
  2346. } else {
  2347. this.goodsForm.status = 0
  2348. this.tableData = [{}, {}]
  2349. this.tableDataTwo = [{}, {}]
  2350. getCorp().then(res => {
  2351. this.goodsForm = {
  2352. corpId: res.data.data ? res.data.data.id : '',
  2353. businessType: "内贸",
  2354. shippingMode: "散货",
  2355. status: 0,
  2356. salesman: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
  2357. belongCompany: res.data.data ? res.data.data.belongCompany : '',
  2358. bsDate: new Date((new Date).getTime() + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19)//获取当天时间并格式化
  2359. }
  2360. this.salesmanQuery('', true)
  2361. })
  2362. this.entrustList = []
  2363. }
  2364. // 非租户模式默认加载管理组数据
  2365. if (!website.tenantMode) {
  2366. this.initData(website.tenantId);
  2367. } else {
  2368. this.initData();
  2369. }
  2370. this.findObject(this.collectionOption.column, "price").change = (data) => {
  2371. if (data.row.price && data.row.quantity) {
  2372. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  2373. }
  2374. }
  2375. this.findObject(this.collectionOption.column, "quantity").change = (data) => {
  2376. if (data.row.price && data.row.quantity) {
  2377. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  2378. }
  2379. }
  2380. this.findObject(this.paymentOption.column, "price").change = (data) => {
  2381. if (data.row.price && data.row.quantity) {
  2382. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  2383. }
  2384. }
  2385. this.findObject(this.paymentOption.column, "quantity").change = (data) => {
  2386. if (data.row.price && data.row.quantity) {
  2387. data.row.amount = Number(data.row.price) * Number(data.row.quantity)
  2388. }
  2389. }
  2390. this.$refs.other.show = false
  2391. },
  2392. methods: {
  2393. //单车运费计算
  2394. calculateFreight(data) {
  2395. if (this.goodsForm.pricingUnit && this.goodsForm.loadingUnloading && this.goodsForm.unitPrice) {
  2396. if (this.goodsForm.loadingUnloading == '装货') {
  2397. if (this.goodsForm.pricingUnit == '体积') {
  2398. this.goodsForm.freightCollect = 0
  2399. this.tableData.forEach(item => {
  2400. if (item.volume) {
  2401. this.goodsForm.freightCollect += Number(item.volume) * Number(this.goodsForm.unitPrice)
  2402. }
  2403. })
  2404. // unitPrice
  2405. } else if (this.goodsForm.pricingUnit == '重量') {
  2406. this.goodsForm.freightCollect = 0
  2407. this.tableData.forEach(item => {
  2408. if (item.weight) {
  2409. this.goodsForm.freightCollect += Number(item.weight) * Number(this.goodsForm.unitPrice)
  2410. }
  2411. })
  2412. } else if (this.goodsForm.pricingUnit == '件数') {
  2413. this.goodsForm.freightCollect = 0
  2414. this.tableData.forEach(item => {
  2415. if (item.quantity) {
  2416. this.goodsForm.freightCollect += Number(item.quantity) * Number(this.goodsForm.unitPrice)
  2417. }
  2418. })
  2419. }
  2420. } else {
  2421. if (this.goodsForm.pricingUnit == '体积') {
  2422. this.goodsForm.freightCollect = 0
  2423. this.tableDataTwo.forEach(item => {
  2424. if (item.volume) {
  2425. this.goodsForm.freightCollect += Number(item.volume) * Number(this.goodsForm.unitPrice)
  2426. }
  2427. })
  2428. } else if (this.goodsForm.pricingUnit == '重量') {
  2429. this.goodsForm.freightCollect = 0
  2430. this.tableDataTwo.forEach(item => {
  2431. if (item.weight) {
  2432. this.goodsForm.freightCollect += Number(item.weight) * Number(this.goodsForm.unitPrice)
  2433. }
  2434. })
  2435. } else if (this.goodsForm.pricingUnit == '件数') {
  2436. this.goodsForm.freightCollect = 0
  2437. this.tableDataTwo.forEach(item => {
  2438. if (item.quantity) {
  2439. this.goodsForm.freightCollect += Number(item.quantity) * Number(this.goodsForm.unitPrice)
  2440. }
  2441. })
  2442. }
  2443. }
  2444. }
  2445. },
  2446. openTrack(row) {
  2447. gaude({itemId: row.id, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
  2448. this.lineArr = res.data.data.trackArray
  2449. this.dialogVisible = true
  2450. let this_ = this
  2451. setTimeout(function () {
  2452. this_.$refs.playback.initMap();
  2453. }, 100)
  2454. })
  2455. // location({itemId: row.id,plateNo:'陕YH0008'}).then(res => {
  2456. // // console.log(res.data.data)
  2457. // // console.log(this.lineArr[this.lineArr.length - 1])
  2458. // })
  2459. },
  2460. changeSelect(val) {
  2461. for (let item of this.salesmanList) {
  2462. if (item.id == val) {
  2463. this.goodsForm.salesmanDept = item.deptId.split(',')[0]
  2464. this.goodsForm.tel = item.phone
  2465. }
  2466. }
  2467. },
  2468. initData(tenantId) {
  2469. getDeptTree(tenantId).then(res => {
  2470. console.log(res)
  2471. const column = this.findObject(this.goodsOptionForm.column, "salesmanDept");
  2472. column.dicData = res.data.data;
  2473. });
  2474. },
  2475. //查询业务员
  2476. salesmanQuery(realName, type) {
  2477. getSalesman({realName: realName, userExt: this.goodsForm.corpId}).then(res => {
  2478. this.salesmanList = res.data.data
  2479. if (type) {
  2480. this.changeSelect(this.goodsForm.salesman)
  2481. }
  2482. })
  2483. },
  2484. //自定义列保存
  2485. async saveColumnCollection() {
  2486. /**
  2487. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2488. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2489. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2490. */
  2491. const inSave = await this.saveColumnData(this.getColumnName(85.4), this.collectionOption);
  2492. if (inSave) {
  2493. this.$message.success("保存成功");
  2494. //关闭窗口
  2495. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  2496. }
  2497. },
  2498. //自定义列重置
  2499. async resetColumnCollection() {
  2500. this.collectionOption = this.collectionOptionBackup;
  2501. const inSave = await this.delColumnData(this.getColumnName(85.4), this.collectionOptionBackup);
  2502. if (inSave) {
  2503. this.$message.success("重置成功");
  2504. this.$refs.collection.$refs.dialogColumn.columnBox = false;
  2505. }
  2506. },
  2507. //自定义列保存
  2508. async saveColumnPayment() {
  2509. /**
  2510. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2511. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2512. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2513. */
  2514. const inSave = await this.saveColumnData(this.getColumnName(85.5), this.paymentOption);
  2515. if (inSave) {
  2516. this.$message.success("保存成功");
  2517. //关闭窗口
  2518. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  2519. }
  2520. },
  2521. //自定义列重置
  2522. async resetColumnPayment() {
  2523. this.paymentOption = this.paymentOptionBackup;
  2524. const inSave = await this.delColumnData(this.getColumnName(85.5), this.paymentOptionBackup);
  2525. if (inSave) {
  2526. this.$message.success("重置成功");
  2527. this.$refs.payment.$refs.dialogColumn.columnBox = false;
  2528. }
  2529. },
  2530. //自定义列保存
  2531. async saveColumnBox() {
  2532. /**
  2533. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2534. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2535. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2536. */
  2537. const inSave = await this.saveColumnData(this.getColumnName(85.1), this.entrustOptionTwo);
  2538. if (inSave) {
  2539. this.$message.success("保存成功");
  2540. //关闭窗口
  2541. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  2542. }
  2543. },
  2544. //自定义列重置
  2545. async resetColumnBox() {
  2546. this.entrustOptionTwo = this.entrustOptionTwoBackup;
  2547. const inSave = await this.delColumnData(this.getColumnName(85.1), this.entrustOptionTwoBackup);
  2548. if (inSave) {
  2549. this.$message.success("重置成功");
  2550. this.$refs.crudBox.$refs.dialogColumn.columnBox = false;
  2551. }
  2552. },
  2553. //自定义列保存
  2554. async saveColumnBoxTwo() {
  2555. /**
  2556. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2557. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2558. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2559. */
  2560. const inSave = await this.saveColumnData(this.getColumnName(85.2), this.entrustOptionTwoT);
  2561. if (inSave) {
  2562. this.$message.success("保存成功");
  2563. //关闭窗口
  2564. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  2565. }
  2566. },
  2567. //自定义列重置
  2568. async resetColumnBoxTwo() {
  2569. this.entrustOptionTwoT = this.entrustOptionTwoTBackup;
  2570. const inSave = await this.delColumnData(this.getColumnName(85.2), this.entrustOptionTwoTBackup);
  2571. if (inSave) {
  2572. this.$message.success("重置成功");
  2573. this.$refs.crudBoxTwo.$refs.dialogColumn.columnBox = false;
  2574. }
  2575. },
  2576. //自定义列保存
  2577. async saveColumnContact() {
  2578. /**
  2579. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  2580. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  2581. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  2582. */
  2583. const inSave = await this.saveColumnData(this.getColumnName(85.3), this.vehicleOption);
  2584. if (inSave) {
  2585. this.$message.success("保存成功");
  2586. //关闭窗口
  2587. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  2588. }
  2589. },
  2590. //自定义列重置
  2591. async resetColumnContact() {
  2592. this.vehicleOption = this.vehicleOptionTwo;
  2593. const inSave = await this.delColumnData(this.getColumnName(85.3), this.vehicleOptionTwo);
  2594. if (inSave) {
  2595. this.$message.success("重置成功");
  2596. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  2597. }
  2598. },
  2599. //刷新数据
  2600. refreshData(id) {
  2601. let ids = ''
  2602. if (id) {
  2603. ids = id
  2604. } else {
  2605. ids = this.goodsForm.id
  2606. }
  2607. detailDelegationList({id: ids}).then(res => {
  2608. this.goodsForm = res.data.data
  2609. this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.goodsForm.id
  2610. this.tableData = res.data.data.loadingAddressList
  2611. this.tableDataTwo = res.data.data.unloadedAddressList
  2612. this.entrustList = res.data.data.itemList
  2613. this.goodsList = res.data.data.itemList
  2614. this.vehicleList = res.data.data.orderItemList
  2615. this.orderFilesList = res.data.data.fileList || []
  2616. if (res.data.data.orderFeeList) {
  2617. if (res.data.data.orderFeeList.length > 0) {
  2618. this.collectionList = []
  2619. this.paymentList = []
  2620. res.data.data.orderFeeList.forEach(item => {
  2621. if (item.type == 1) {
  2622. this.collectionList.push(item)
  2623. } else {
  2624. this.paymentList.push(item)
  2625. }
  2626. })
  2627. }
  2628. }
  2629. this.goodsOptionFormC.disabled = true
  2630. this.goodsOptionForm.disabled = true
  2631. this.goodsOptionFormTwo.disabled = true
  2632. this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status >= 1
  2633. delete this.goodsForm.orderAddressList
  2634. delete this.goodsForm.itemList
  2635. delete this.goodsForm.orderFeeList
  2636. // this.tableData.forEach(item => {
  2637. // if (item.region) item.region = item.region.split(',')
  2638. // })
  2639. this.type = false
  2640. })
  2641. },
  2642. //切换收付费
  2643. handleSelect(tab, event) {
  2644. this.activeIndex = tab.name
  2645. this.key++
  2646. },
  2647. //箱信息保存
  2648. rowSaveT(row, index, done, loading) {
  2649. row.$cellEdit = false
  2650. done()
  2651. },
  2652. //箱信息选择车队
  2653. getfleetIdT(data, row) {
  2654. this.$set(row, 'fleetName', data.cname)
  2655. },
  2656. //地址新增
  2657. addAddress() {
  2658. this.tableData.push({})
  2659. },
  2660. //地址新增
  2661. addAddressTwo() {
  2662. this.tableDataTwo.push({})
  2663. },
  2664. moveUp(row, index) {
  2665. this.tableData[index] = this.tableData.splice(index - 1, 1, row)[0]
  2666. },
  2667. moveUpTwo(row, index) {
  2668. this.tableDataTwo[index] = this.tableDataTwo.splice(index - 1, 1, row)[0]
  2669. },
  2670. moveDown(row, index) {
  2671. this.tableData[index] = this.tableData.splice(index + 1, 1, row)[0]
  2672. },
  2673. moveDownTwo(row, index) {
  2674. this.tableDataTwo[index] = this.tableDataTwo.splice(index + 1, 1, row)[0]
  2675. },
  2676. //返回主列表
  2677. backToList(value) {
  2678. if (value === 0) {
  2679. this.goodsForm = {}
  2680. this.$emit('backToList')
  2681. } else if (value === 1) {
  2682. this.goodsForm = {}
  2683. this.$emit('backToList', true)
  2684. } else if (value === 2) {
  2685. this.$router.push({
  2686. path: '/wel/index'
  2687. });
  2688. } else if (value === 3) {
  2689. this.$router.push({
  2690. path: '/landTransportation/bulkReportAnalysis/index'
  2691. });
  2692. }
  2693. },
  2694. //删除途径地址
  2695. deleteAddress(scope) {
  2696. if (scope.row.id) {
  2697. tRemove({ids: scope.row.id}).then(res => {
  2698. this.tableData.splice(scope.$index, 1);
  2699. this.calculateFreight()
  2700. })
  2701. } else {
  2702. this.tableData.splice(scope.$index, 1);
  2703. this.calculateFreight()
  2704. }
  2705. },
  2706. //删除途径地址
  2707. deleteAddressTwo(scope) {
  2708. if (scope.row.id) {
  2709. tRemove({ids: scope.row.id}).then(res => {
  2710. this.tableDataTwo.splice(scope.$index, 1);
  2711. })
  2712. } else {
  2713. this.tableDataTwo.splice(scope.$index, 1);
  2714. }
  2715. },
  2716. //箱信息保存
  2717. rowSave(row, index, done, loading) {
  2718. row.$cellEdit = false
  2719. done()
  2720. },
  2721. rowCell(row, index) {
  2722. this.$refs.collection.rowCell(row, index)
  2723. if (row.$cellEdit == false) {
  2724. this.editCustomer()
  2725. }
  2726. },
  2727. paymentRowCell(row, index) {
  2728. this.$refs.payment.rowCell(row, index)
  2729. if (row.$cellEdit == false) {
  2730. this.editCustomer()
  2731. }
  2732. },
  2733. //箱信息移除
  2734. rowDel(row, index) {
  2735. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  2736. confirmButtonText: '确定',
  2737. cancelButtonText: '取消',
  2738. type: 'warning'
  2739. }).then(() => {
  2740. this.entrustList.splice(index, 1);
  2741. }).catch(() => {
  2742. this.$message({
  2743. type: 'info',
  2744. message: '已取消删除'
  2745. });
  2746. });
  2747. },
  2748. //保存
  2749. editCustomer() {
  2750. this.type = true
  2751. saveSaveList({
  2752. ...this.goodsForm,
  2753. loadingAddressList: this.tableData,
  2754. unloadedAddressList: this.tableDataTwo,
  2755. fileList: this.orderFilesList,
  2756. itemList: this.entrustList,
  2757. orderFeeList: this.collectionList.concat(this.paymentList)
  2758. }).then(res => {
  2759. this.$message.success('保存成功');
  2760. if (!this.goodsForm.id) {
  2761. this.id = res.data.data
  2762. this.refreshData(res.data.data)
  2763. } else {
  2764. this.refreshData()
  2765. }
  2766. })
  2767. },
  2768. //确认变更
  2769. confirmChange() {
  2770. // validChange({id:this.id}).then(res => {
  2771. // if (res.data.data){
  2772. if (this.goodsForm.status === 5) {
  2773. this.goodsOptionFormC.disabled = false
  2774. this.goodsOptionForm.disabled = false
  2775. this.goodsOptionFormTwo.disabled = true
  2776. this.typeTwo = true
  2777. this.goodsForm.status = 0
  2778. if (this.roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)) {
  2779. // this.goodsOptionFormTwo.disabled = true
  2780. this.$set(this.goodsOptionFormTwo, 'disabled', false)
  2781. }
  2782. } else {
  2783. this.goodsOptionFormC.disabled = false
  2784. this.goodsOptionForm.disabled = false
  2785. // this.goodsOptionFormTwo.disabled = false
  2786. this.typeTwo = true
  2787. this.goodsForm.status = 0
  2788. if (this.roleName.indexOf('admin') !== -1 || (this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1)) {
  2789. // this.goodsOptionFormTwo.disabled = false
  2790. this.$set(this.goodsOptionFormTwo, 'disabled', false)
  2791. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
  2792. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
  2793. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
  2794. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
  2795. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
  2796. this.findObject(this.goodsOptionFormTwo.column, "fleetRemarks").disabled = false
  2797. }
  2798. }
  2799. // }else {
  2800. // this.$message.error('不允许变更')
  2801. // }
  2802. // })
  2803. },
  2804. confirmChangeTwo() {
  2805. if (((this.roleName.indexOf('平台') !== -1 && this.roleName.indexOf('分管调度') !== -1) || this.roleName.indexOf('车队') !== -1) || this.roleName.indexOf('admin') !== -1 && this.goodsForm.status > 3) {
  2806. this.goodsOptionFormTwo.disabled = false
  2807. this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
  2808. this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
  2809. this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
  2810. this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
  2811. this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
  2812. }
  2813. },
  2814. //变更保存
  2815. changeSaving() {
  2816. this.$refs['goodsFormE'].validate((valid, doneE) => {
  2817. doneE()
  2818. if (valid) {
  2819. this.$refs['goodsForm'].validate((valid, done) => {
  2820. done();
  2821. if (valid) {
  2822. for (let item in this.tableData) {
  2823. if (item < Number(this.tableData.length) - 1) {
  2824. if (!this.tableData[item].corpId) return this.$message.error('请选择装货地点第' + Number(Number(item) + 1) + '行货运地点');
  2825. // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  2826. // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
  2827. // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
  2828. }
  2829. }
  2830. for (let item in this.tableDataTwo) {
  2831. if (item < Number(this.tableDataTwo.length) - 1) {
  2832. if (!this.tableDataTwo[item].corpId) return this.$message.error('请选择卸货地点第' + Number(Number(item) + 1) + '行货运地点');
  2833. }
  2834. }
  2835. // if (this.tableDataTwo.length === 0) {
  2836. // return this.$message.error('请选择卸货地点')
  2837. // }
  2838. // if (this.tableData.length === 0) {
  2839. // return this.$message.error('请选择卸货地点')
  2840. // }
  2841. this.type = true
  2842. let form = this.goodsForm
  2843. delete this.goodsForm.status
  2844. delete form.orderItemList
  2845. saveSaveList({
  2846. ...form,
  2847. loadingAddressList: this.tableData,
  2848. unloadedAddressList: this.tableDataTwo,
  2849. fileList: this.orderFilesList,
  2850. itemList: this.entrustList,
  2851. orderItemList: [],
  2852. orderFeeList: this.collectionList.concat(this.paymentList)
  2853. }).then(res => {
  2854. this.$message.success('保存成功');
  2855. this.typeTwo = false
  2856. this.refreshData()
  2857. })
  2858. } else {
  2859. return false;
  2860. }
  2861. });
  2862. } else {
  2863. return false;
  2864. }
  2865. })
  2866. },
  2867. modifyState() {
  2868. if (this.goodsForm.status === 1) {
  2869. if (!this.goodsForm.fleetId) return this.$message.error('请选择车队')
  2870. }
  2871. if (this.goodsForm.status === 2) {
  2872. if (!this.goodsForm.plateNo) return this.$message.error('请选择车号')
  2873. if (!this.goodsForm.driverId) return this.$message.error('请选择司机')
  2874. if (!this.goodsForm.driverTel) return this.$message.error('请输入司机电话')
  2875. }
  2876. let value = ''
  2877. if (this.goodsForm.status == 1) value = 2
  2878. if (this.goodsForm.status == 2) value = 3
  2879. if (this.goodsForm.status == 3) value = 6
  2880. if (this.goodsForm.status == 6) value = 4
  2881. if (this.goodsForm.status == 4) value = 5
  2882. this.type = true
  2883. saveSaveList({
  2884. ...this.goodsForm,
  2885. loadingAddressList: this.tableData,
  2886. unloadedAddressList: this.tableDataTwo,
  2887. fileList: this.orderFilesList,
  2888. itemList: this.entrustList,
  2889. orderFeeList: this.collectionList.concat(this.paymentList)
  2890. }).then(res => {
  2891. statusBulkLoad({id: this.goodsForm.id, status: value}).then(res => {
  2892. this.$message.success('操作成功');
  2893. this.refreshData(res.data.data)
  2894. })
  2895. })
  2896. },
  2897. //提交委托
  2898. submit(type) {
  2899. if (type) {
  2900. this.$refs['goodsFormE'].validate((valid, done) => {
  2901. done()
  2902. })
  2903. this.$refs['goodsForm'].validate((valid, done) => {
  2904. done()
  2905. })
  2906. for (let item in this.tableData) {
  2907. if (item < Number(this.tableData.length) - 1) {
  2908. if (!this.tableData[item].corpId) return this.$message.error('请选择装货地点第' + Number(Number(item) + 1) + '行货运地点');
  2909. // if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
  2910. // if (!this.tableData[item].contacts) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行联系人');
  2911. // if (!this.tableData[item].tel) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行电话');
  2912. }
  2913. }
  2914. for (let item in this.tableDataTwo) {
  2915. if (item < Number(this.tableDataTwo.length) - 1) {
  2916. if (!this.tableDataTwo[item].corpId) return this.$message.error('请选择卸货地点第' + Number(Number(item) + 1) + '行货运地点');
  2917. }
  2918. }
  2919. if (this.tableDataTwo.length === 0) {
  2920. return this.$message.error('请选择卸货地点')
  2921. }
  2922. if (this.tableData.length === 0) {
  2923. return this.$message.error('请选择卸货地点')
  2924. }
  2925. this.$refs['goodsFormE'].validate((valid, doneE) => {
  2926. doneE()
  2927. if (valid) {
  2928. this.$refs['goodsForm'].validate((valid, done) => {
  2929. done();
  2930. if (valid) {
  2931. this.entrustList.forEach(item => {
  2932. if (!item.arrivalTime) {
  2933. item.arrivalTime = this.goodsForm.arrivalTime
  2934. }
  2935. })
  2936. this.type = true
  2937. saveSaveList({
  2938. ...this.goodsForm,
  2939. loadingAddressList: this.tableData,
  2940. unloadedAddressList: this.tableDataTwo,
  2941. fileList: this.orderFilesList,
  2942. itemList: this.entrustList,
  2943. orderFeeList: this.collectionList.concat(this.paymentList)
  2944. }).then(res => {
  2945. saveDelegationList({
  2946. id: res.data.data
  2947. }).then(() => {
  2948. this.type = false
  2949. this.$message.success('提交成功');
  2950. this.refreshData(res.data.data)
  2951. }).finally(() => {
  2952. this.type = false
  2953. })
  2954. })
  2955. } else {
  2956. return false;
  2957. }
  2958. });
  2959. } else {
  2960. return false;
  2961. }
  2962. })
  2963. } else {
  2964. statusBulkLoad({id: this.goodsForm.id, status: 0}).then(res => {
  2965. this.$message.success('取消成功');
  2966. this.refreshData()
  2967. })
  2968. }
  2969. },
  2970. //取消调度
  2971. cancelScheduling(type) {
  2972. if (type == '1') {
  2973. statusBulkLoad({id: this.goodsForm.id, status: 2}).then(res => {
  2974. this.$message.success('取消成功');
  2975. this.refreshData()
  2976. })
  2977. } else if (type == '2') {
  2978. statusBulkLoad({id: this.goodsForm.id, status: 1}).then(res => {
  2979. this.$message.success('取消成功');
  2980. this.refreshData()
  2981. })
  2982. } else if (type == '3') {
  2983. statusBulkLoad({id: this.goodsForm.id, status: 3}).then(res => {
  2984. this.$message.success('取消成功');
  2985. this.refreshData()
  2986. })
  2987. }
  2988. },
  2989. //收费新增
  2990. addRowCollection() {
  2991. if (this.goodsForm.plateNo) {
  2992. this.$refs.collection.rowCellAdd({
  2993. currency: '1',
  2994. type: '1',
  2995. $cellEdit: true,
  2996. corpId: this.goodsForm.corpId,
  2997. corpName: this.goodsForm.corpName,
  2998. plateNo: this.goodsForm.plateNo
  2999. });
  3000. } else {
  3001. this.$message.error('请选择车号')
  3002. }
  3003. },
  3004. //付费新增
  3005. addRowPayment() {
  3006. if (this.goodsForm.plateNo) {
  3007. this.$refs.payment.rowCellAdd({
  3008. currency: '1',
  3009. type: '2',
  3010. $cellEdit: true,
  3011. corpId: this.goodsForm.corpId,
  3012. corpName: this.goodsForm.corpName,
  3013. plateNo: this.goodsForm.plateNo
  3014. });
  3015. } else {
  3016. this.$message.error('请选择车号')
  3017. }
  3018. },
  3019. //打开附件
  3020. annexOpen(row, index, type) {
  3021. if (row.id) {
  3022. this.formAnnex = row
  3023. getFee({id: row.id}).then(res => {
  3024. this.orderList = res.data.data
  3025. this.enclosure = true
  3026. })
  3027. } else {
  3028. this.$message.error('请点击顶部【保存】后再操作')
  3029. }
  3030. },
  3031. //保存
  3032. saveAnnex() {
  3033. saveFile({
  3034. id: this.formAnnex.id,
  3035. fileList: this.orderList
  3036. }).then(res => {
  3037. this.$message.success("保存成功");
  3038. this.annexOpen(this.formAnnex)
  3039. })
  3040. },
  3041. //选择费用
  3042. selectValue(value, row) {
  3043. this.$set(row, 'feeName', value.cname)
  3044. },
  3045. //选择客户信息触发
  3046. getfleetId(data, row) {
  3047. this.$set(row, 'corpName', data.cname)
  3048. },
  3049. //收款信息移除
  3050. makeDel(row, index) {
  3051. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  3052. confirmButtonText: '确定',
  3053. cancelButtonText: '取消',
  3054. type: 'warning'
  3055. }).then(() => {
  3056. if (row.id) removeCollection(row.id)
  3057. this.collectionList.splice(index, 1);
  3058. }).catch(() => {
  3059. this.$message({
  3060. type: 'info',
  3061. message: '已取消删除'
  3062. });
  3063. });
  3064. },
  3065. //付款信息移除
  3066. feeDel(row, index) {
  3067. this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
  3068. confirmButtonText: '确定',
  3069. cancelButtonText: '取消',
  3070. type: 'warning'
  3071. }).then(() => {
  3072. if (row.id) removeCollection(row.id)
  3073. this.paymentList.splice(index, 1);
  3074. }).catch(() => {
  3075. this.$message({
  3076. type: 'info',
  3077. message: '已取消删除'
  3078. });
  3079. });
  3080. },
  3081. //选择公司名称带出所属公司
  3082. getCorpData(row) {
  3083. console.log(row.belongCompany)
  3084. this.goodsForm.belongCompany = row.belongCompany
  3085. this.goodsForm.salesman = ''
  3086. //查询业务员
  3087. this.salesmanQuery()
  3088. },
  3089. getCropId(row) {
  3090. if (row) {
  3091. this.goodsForm.corpId = row.id
  3092. this.goodsForm.corpName = row.cname
  3093. this.goodsForm.belongCompany = row.belongCompany
  3094. this.goodsForm.salesman = ''
  3095. //查询业务员
  3096. this.salesmanQuery()
  3097. }
  3098. },
  3099. clear(row) {
  3100. row.corpName = ''
  3101. },
  3102. //选择地址客户带出地址
  3103. withAddress(row, scope, type) {
  3104. if (type) {
  3105. for (let item of this.corpList) {
  3106. if (scope.row.corpId == item.id) {
  3107. this.$set(this.tableData[scope.$index], 'contacts', item.attn)
  3108. this.$set(this.tableData[scope.$index], 'tel', item.tel)
  3109. this.$set(this.tableData[scope.$index], 'address', item.storageAddr)
  3110. if (!scope.row.key) scope.row.key = 0
  3111. this.$set(this.tableData[scope.$index], 'corpName', item.cname)
  3112. if (item.belongtoarea) {
  3113. addressList(item.belongtoarea.split(',')[0]).then(res => {
  3114. this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  3115. scope.row.key++
  3116. })
  3117. }
  3118. }
  3119. }
  3120. } else {
  3121. this.$set(this.tableData[scope.$index], 'contacts', row.attn)
  3122. this.$set(this.tableData[scope.$index], 'tel', row.tel)
  3123. this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
  3124. if (!scope.row.key) scope.row.key = 0
  3125. this.$set(this.tableData[scope.$index], 'corpName', row.cname)
  3126. if (row.belongtoarea) {
  3127. addressList(row.belongtoarea.split(',')[0]).then(res => {
  3128. this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  3129. scope.row.key++
  3130. })
  3131. }
  3132. }
  3133. },
  3134. //选择地址客户带出地址
  3135. withAddressTwo(row, scope, type) {
  3136. if (type) {
  3137. for (let item of this.corpList) {
  3138. if (scope.row.corpId == item.id) {
  3139. this.$set(this.tableDataTwo[scope.$index], 'contacts', item.attn)
  3140. this.$set(this.tableDataTwo[scope.$index], 'tel', item.tel)
  3141. this.$set(this.tableDataTwo[scope.$index], 'address', item.storageAddr)
  3142. // this.tableData[scope.$index].contacts = row.attn
  3143. // this.tableData[scope.$index].tel = row.tel
  3144. // this.tableData[scope.$index].address = row.storageAddr
  3145. if (!scope.row.key) scope.row.key = 0
  3146. this.$set(this.tableDataTwo[scope.$index], 'corpName', item.cname)
  3147. // this.tableData[scope.$index].corpName = row.cname
  3148. if (item.belongtoarea) {
  3149. addressList(item.belongtoarea.split(',')[0]).then(res => {
  3150. this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  3151. scope.row.key++
  3152. })
  3153. }
  3154. }
  3155. }
  3156. } else {
  3157. this.$set(this.tableDataTwo[scope.$index], 'contacts', row.attn)
  3158. this.$set(this.tableDataTwo[scope.$index], 'tel', row.tel)
  3159. this.$set(this.tableDataTwo[scope.$index], 'address', row.storageAddr)
  3160. // this.tableData[scope.$index].contacts = row.attn
  3161. // this.tableData[scope.$index].tel = row.tel
  3162. // this.tableData[scope.$index].address = row.storageAddr
  3163. if (!scope.row.key) scope.row.key = 0
  3164. this.$set(this.tableDataTwo[scope.$index], 'corpName', row.cname)
  3165. // this.tableData[scope.$index].corpName = row.cname
  3166. if (row.belongtoarea) {
  3167. addressList(row.belongtoarea.split(',')[0]).then(res => {
  3168. this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
  3169. scope.row.key++
  3170. })
  3171. }
  3172. }
  3173. },
  3174. //自定义表头
  3175. renderHeader(h) {
  3176. return (
  3177. <div>
  3178. <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
  3179. <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
  3180. style="margin-right: 1.25rem;"></el-button>
  3181. </el-tooltip>
  3182. </div>
  3183. )
  3184. },
  3185. //自定义表头
  3186. customTitle(h, {column, $index}) {
  3187. let text = column.label
  3188. return (
  3189. <div>
  3190. {{text}}<span style="color:#F56C6C">*</span>
  3191. </div>
  3192. )
  3193. }
  3194. }
  3195. }
  3196. </script>
  3197. <style scoped lang="scss">
  3198. ::v-deep .el-form-item {
  3199. margin-bottom: 8px;
  3200. }
  3201. ::v-deep .el-form-item__content {
  3202. line-height: 32px;
  3203. }
  3204. ::v-deep .el-card__body {
  3205. padding: 10px 15px;
  3206. font-size: 14px;
  3207. }
  3208. .single ::v-deep .el-button--mini {
  3209. padding: 0 0 !important;
  3210. }
  3211. </style>