detailPage.vue 100 KB

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