detailPage.vue 83 KB

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