detailPage.vue 111 KB

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