tranManagementTransportEdit.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. // 编辑运输任务
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">编辑运输任务</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. ><img
  15. width="6"
  16. height="10"
  17. style="vertical-align: bottom; margin-right: 3px"
  18. src="../../../public/img/lujing.png"
  19. alt=""
  20. />返回</el-button
  21. >
  22. </el-col>
  23. </el-row>
  24. <el-form
  25. ref="deptBudgetList"
  26. :rules="mainReportAdd"
  27. :model="deptBudgetList"
  28. >
  29. <ws-info-table class="el-table">
  30. <el-form-item label="任务编号" span="1" prop="taskNo" class="forlist">
  31. <el-input
  32. v-model="deptBudgetList.taskNo"
  33. placeholder="请输入任务编号"
  34. maxlength="20"
  35. size="small"
  36. ></el-input>
  37. </el-form-item>
  38. <el-form-item prop="taskType" label="任务类型" span="1">
  39. <el-select
  40. v-model="deptBudgetList.taskType"
  41. placeholder="请输入任务类型"
  42. @change="selecttaskType"
  43. >
  44. <el-option
  45. v-for="item in taskType"
  46. :key="item.constKey"
  47. :label="item.constValue"
  48. :value="item.constValue"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item prop="contractNo" label="合同编号/移库任务编号" span="1">
  53. <el-select
  54. v-model="deptBudgetList.contractNo"
  55. placeholder="请选择编号"
  56. >
  57. <el-option
  58. v-for="item in contractNoList"
  59. :key="item.constKey"
  60. :label="item.contractNo"
  61. :value="item.contractNo"
  62. ></el-option>
  63. </el-select>
  64. </el-form-item>
  65. <el-form-item prop="goodsName" label="货名" span="1">
  66. <el-select
  67. v-model="deptBudgetList.goodsName"
  68. placeholder="请输入货名"
  69. @change="selectgoodsname"
  70. >
  71. <el-option
  72. v-for="item in goodnameList"
  73. :key="item.constKey"
  74. :label="item.constValue"
  75. :value="item.constValue"
  76. ></el-option>
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item label="重量(吨)" span="1" prop="weight">
  80. <el-input
  81. @input="weightchange"
  82. v-model="deptBudgetList.weight"
  83. placeholder="请输入重量"
  84. maxlength="20"
  85. size="small"
  86. ></el-input>
  87. </el-form-item>
  88. </ws-info-table>
  89. <ws-info-table class="el-table">
  90. <div class="start-address" style="width: 36%">
  91. <el-radio-group
  92. @change="warehouseTypechange"
  93. v-model="deptBudgetList.warehouseType"
  94. >
  95. <el-radio label="1">常用仓库发货</el-radio>
  96. <el-radio label="2">临时仓库发货</el-radio>
  97. </el-radio-group>
  98. <el-select
  99. v-model="deptBudgetList.sendWarehouse"
  100. placeholder="选择仓库"
  101. class="typeselect"
  102. @change="sendWarehousechange"
  103. >
  104. <el-option
  105. v-for="item in warehouseList"
  106. :key="item.constKey"
  107. :label="item.warehouseName"
  108. :value="item.warehouseName"
  109. ></el-option>
  110. </el-select>
  111. </div>
  112. <el-form-item label="始发地" span="1" class="start-address">
  113. <el-cascader
  114. :options="options_"
  115. v-model="selectedOptions"
  116. clearable
  117. size="large"
  118. placeholder="请选择始发地"
  119. @change="handleChange"
  120. />
  121. </el-form-item>
  122. <el-form-item
  123. label="始发地详细地址"
  124. span="1"
  125. prop="startDetailedAddress"
  126. class="bg-right start-address"
  127. >
  128. <el-input
  129. v-model="deptBudgetList.startDetailedAddress"
  130. placeholder="请输入始发地详细地址"
  131. maxlength="20"
  132. size="small"
  133. ></el-input>
  134. </el-form-item>
  135. <el-form-item
  136. label="收货库点"
  137. span="1"
  138. prop="contractNo"
  139. class="start-address"
  140. style="width: 36%"
  141. >
  142. <el-select
  143. v-model="deptBudgetList.receiveWarehouse"
  144. :disabled="warehouse"
  145. placeholder="请输入收货库点"
  146. style="width: 100%"
  147. >
  148. <el-option
  149. v-for="item in warehouseList"
  150. :key="item.constKey"
  151. :label="item.warehouseName"
  152. :value="item.warehouseName"
  153. ></el-option>
  154. </el-select>
  155. </el-form-item>
  156. <el-form-item
  157. label="终到地"
  158. span="1"
  159. prop="contractNo"
  160. class="start-address"
  161. >
  162. <el-cascader
  163. :options="options_"
  164. v-model="selectedOptions1"
  165. clearable
  166. size="large"
  167. placeholder="请选择终到地"
  168. @change="handleChange1"
  169. />
  170. </el-form-item>
  171. <el-form-item
  172. label="终到地详细地址"
  173. span="1"
  174. prop="endDetailedAddress"
  175. class="bg-right start-address"
  176. >
  177. <el-input
  178. v-model="deptBudgetList.endDetailedAddress"
  179. placeholder="请输入终到地详细地址"
  180. maxlength="20"
  181. size="small"
  182. ></el-input>
  183. </el-form-item>
  184. <div class="check-box">
  185. <span class="check-box">运输方式</span>
  186. <el-checkbox-group v-model="checkList" prop="tranType">
  187. <el-checkbox label="汽运" checked></el-checkbox>
  188. <el-checkbox label="火运"></el-checkbox>
  189. <el-checkbox label="船运"></el-checkbox>
  190. </el-checkbox-group>
  191. </div>
  192. </ws-info-table>
  193. <div
  194. style="width: 100%"
  195. class="position"
  196. v-for="(item, index) in deptBudgetList.tranProcessInfoList"
  197. :key="index"
  198. >
  199. <div class="driver">
  200. <span style="vertical-align: top"
  201. >运输阶段{{ index + 1 }} {{ item.processNo }}</span
  202. >
  203. <img
  204. v-if="!endflag"
  205. width="22"
  206. height="22"
  207. class="add"
  208. @click="add(index)"
  209. src="../../../public/img/add.png"
  210. alt=""
  211. />
  212. <img
  213. width="22"
  214. height="22"
  215. class="del"
  216. @click="del(index, item)"
  217. src="../../../public/img/del.png"
  218. alt=""
  219. />
  220. <el-checkbox
  221. @change="engflagchange"
  222. class="endflag"
  223. v-bind:checked="endflag"
  224. v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
  225. v-model="item.endFlag"
  226. :label="1"
  227. >最终阶段</el-checkbox
  228. >
  229. </div>
  230. <ws-info-table>
  231. <el-form-item label="运输方式" span="1" prop="waterContent">
  232. <el-select
  233. v-model="item.tranType"
  234. placeholder="运输方式"
  235. @change="
  236. (val) => {
  237. selecttaskwayList(val, index)
  238. }
  239. "
  240. >
  241. <el-option
  242. v-for="item in taskwayList"
  243. :key="item.constKey"
  244. :label="item.constValue"
  245. :value="item.constValue"
  246. ></el-option>
  247. </el-select>
  248. </el-form-item>
  249. <el-form-item label="发货日期" span="1" prop="impurity">
  250. <ws-date-picker
  251. v-model="item.deliveryDateStart"
  252. type="date"
  253. placeholder="请选择发货日期"
  254. value-format="yyyy-MM-dd"
  255. />
  256. </el-form-item>
  257. <el-form-item label="最晚到货日期" span="1" prop="bulkDensity">
  258. <ws-date-picker
  259. v-model="item.deliveryDateEnd"
  260. type="date"
  261. placeholder="请选择最晚到货日期"
  262. value-format="yyyy-MM-dd"
  263. />
  264. </el-form-item>
  265. <el-form-item
  266. label="本阶段运输重量(吨)"
  267. span="1"
  268. prop="bulkDensity"
  269. >
  270. <el-input
  271. v-model="item.weight"
  272. placeholder="请输入本阶段运输重量"
  273. size="small"
  274. ></el-input>
  275. </el-form-item>
  276. </ws-info-table>
  277. <ws-info-table>
  278. <el-form-item label="发货地区" span="1" prop="waterContent">
  279. <el-cascader
  280. :options="options_"
  281. v-model="item.selectedOptions"
  282. clearable
  283. size="large"
  284. placeholder="请选择发货地区"
  285. style="width: 200%"
  286. @change="
  287. (val) => {
  288. handleChange3(val, index)
  289. }
  290. "
  291. />
  292. </el-form-item>
  293. <el-form-item label="发货地详细地址" span="1" prop="impurity">
  294. <el-input
  295. v-model="item.sendDetailedAddress"
  296. placeholder="请输入发货地详细地址"
  297. maxlength="20"
  298. size="small"
  299. ></el-input>
  300. </el-form-item>
  301. <el-form-item label="发货人" span="1" prop="bulkDensity">
  302. <el-input
  303. v-model="item.sender"
  304. placeholder="请输入发货人"
  305. maxlength="20"
  306. size="small"
  307. ></el-input>
  308. </el-form-item>
  309. <el-form-item label="发货人电话" span="1" prop="bulkDensity">
  310. <el-input
  311. v-model="item.senderPhone"
  312. placeholder="请输入发货人电话"
  313. maxlength="20"
  314. size="small"
  315. ></el-input>
  316. </el-form-item>
  317. </ws-info-table>
  318. <ws-info-table>
  319. <el-form-item label="收货地区" span="1" prop="bulkDensity">
  320. <el-cascader
  321. :options="options_"
  322. v-model="item.selectedOptions1"
  323. clearable
  324. size="large"
  325. placeholder="请选择收货地区"
  326. style="width: 200%"
  327. @change="
  328. (val) => {
  329. handleChange4(val, index)
  330. }
  331. "
  332. />
  333. </el-form-item>
  334. <el-form-item label="收货地详细地址" span="1" prop="impurity">
  335. <el-input
  336. v-model="item.receiveDetailedAddress"
  337. placeholder="请输入收货地详细地址"
  338. maxlength="20"
  339. size="small"
  340. ></el-input>
  341. </el-form-item>
  342. <el-form-item label="收货人" span="1" prop="bulkDensity">
  343. <el-input
  344. v-model="item.receiver"
  345. placeholder="请输入收货人"
  346. maxlength="20"
  347. size="small"
  348. ></el-input>
  349. </el-form-item>
  350. <el-form-item label="收货人电话" span="1" prop="bulkDensity">
  351. <el-input
  352. v-model="item.receiverPhone"
  353. placeholder="请输入收货人电话"
  354. maxlength="20"
  355. size="small"
  356. ></el-input>
  357. </el-form-item>
  358. </ws-info-table>
  359. </div>
  360. </el-form>
  361. <!-- 提交 -->
  362. <div style="text-align: right; padding: 10px" class="center">
  363. <el-button
  364. class="bg-bottom"
  365. type="primary"
  366. size="small"
  367. @click="submit(deptBudgetList)"
  368. >提交</el-button
  369. >
  370. </div>
  371. </div>
  372. </template>
  373. <script>
  374. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  375. import { packList } from '@/model/contarct/index'
  376. import {
  377. edittran,
  378. getwarehousename,
  379. xialaNo,
  380. examinetran,
  381. delhaulagestage,
  382. } from '@/model/tasksport/index'
  383. import WsUpload from '@/components/WsUpload'
  384. import mapDrag from '@/components/mapdrag/mapdrag'
  385. export default {
  386. name: 'viewSpareMoney',
  387. components: {
  388. WsUpload,
  389. mapDrag,
  390. },
  391. watch: {
  392. vesselId(val) {
  393. this.getVesselData()
  394. },
  395. isShow(val) {
  396. this.showType = val
  397. },
  398. },
  399. data() {
  400. let self = this
  401. return {
  402. checkList: [],
  403. deptBudgetList: {},
  404. radio: '1',
  405. endflag: false,
  406. carModelList: [],
  407. carLengthList: [],
  408. warehouseType: '1',
  409. options_: regionData,
  410. heightData: '600px',
  411. selectedOptions: [],
  412. selectedOptions1: [],
  413. compId: sessionStorage.getItem('ws-pf_compId'),
  414. mainReportAdd: {},
  415. warehouseList: [],
  416. goodnameList: [],
  417. taskType: [],
  418. size: 10,
  419. unitList: [],
  420. contractNoList: [],
  421. taskwayList: [],
  422. name: '',
  423. age: '',
  424. weight: 0,
  425. number: 2,
  426. }
  427. },
  428. activated() {
  429. this.loaddata()
  430. this.showType = this.isShow
  431. },
  432. computed: {
  433. warehouse: function () {
  434. if (
  435. this.deptBudgetList.taskType == '销售出库' ||
  436. this.deptBudgetList.taskType == '贸易服务出库' ||
  437. this.deptBudgetList.taskType == '暂存出库'
  438. ) {
  439. return true
  440. } else {
  441. return false
  442. }
  443. },
  444. },
  445. methods: {
  446. sendWarehousechange(e) {
  447. for (let i = 0; i < this.warehouseList.length; i++) {
  448. if (this.warehouseList[i].warehouseName == e) {
  449. var tmp = []
  450. tmp[0] = TextToCode[this.warehouseList[i].warehousePrivate].code
  451. tmp[1] =
  452. TextToCode[this.warehouseList[i].warehousePrivate][
  453. this.warehouseList[i].warehouseCity
  454. ].code
  455. tmp[2] =
  456. TextToCode[this.warehouseList[i].warehousePrivate][
  457. this.warehouseList[i].warehouseCity
  458. ][this.warehouseList[i].warehouseArea].code
  459. this.selectedOptions = tmp
  460. this.deptBudgetList.tranProcessInfoList[0].selectedOptions = tmp
  461. this.$set(
  462. this.deptBudgetList,
  463. 'startDetailedAddress',
  464. this.warehouseList[i].detailedAddress
  465. )
  466. this.$set(
  467. this.deptBudgetList.tranProcessInfoList[0],
  468. 'sendDetailedAddress',
  469. this.deptBudgetList.startDetailedAddress
  470. )
  471. }
  472. }
  473. },
  474. warehouseTypechange() {
  475. getwarehousename({
  476. compId: this.compId,
  477. warehouseType: this.deptBudgetList.warehouseType,
  478. })
  479. .toPromise()
  480. .then((response) => {
  481. this.warehouseList = response
  482. })
  483. },
  484. weightchange(e) {
  485. this.deptBudgetList.tranProcessInfoList[0].weight = e
  486. },
  487. engflagchange(e) {
  488. this.endflag = e
  489. if (this.endflag) {
  490. this.deptBudgetList.tranProcessInfoList[
  491. this.deptBudgetList.tranProcessInfoList.length - 1
  492. ].selectedOptions1 = this.selectedOptions1
  493. this.deptBudgetList.tranProcessInfoList[
  494. this.deptBudgetList.tranProcessInfoList.length - 1
  495. ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
  496. } else {
  497. this.deptBudgetList.tranProcessInfoList[
  498. this.deptBudgetList.tranProcessInfoList.length - 1
  499. ].selectedOptions1 = []
  500. this.deptBudgetList.tranProcessInfoList[
  501. this.deptBudgetList.tranProcessInfoList.length - 1
  502. ].receiveDetailedAddress = ''
  503. }
  504. },
  505. loaddata() {
  506. examinetran({ id: this.$route.query.id })
  507. .toPromise()
  508. .then((response) => {
  509. for (var j = 0; j < response.tranProcessInfoList.length; j++) {
  510. if (response.tranProcessInfoList[j].endFlag == 'true') {
  511. this.endflag = true
  512. }
  513. }
  514. this.deptBudgetList = response
  515. this.number = response.tranProcessInfoList.length + 1
  516. if (
  517. response.startPrivate != null &&
  518. response.startCity != null &&
  519. response.startArea != null
  520. ) {
  521. var tmp = []
  522. tmp[0] = TextToCode[response.startPrivate].code
  523. tmp[1] = TextToCode[response.startPrivate][response.startCity].code
  524. tmp[2] =
  525. TextToCode[response.startPrivate][response.startCity][
  526. response.startArea
  527. ].code
  528. this.selectedOptions = tmp
  529. }
  530. if (
  531. response.endPrivate != null &&
  532. response.endCity != null &&
  533. response.endArea != null
  534. ) {
  535. var tmp1 = []
  536. tmp1[0] = TextToCode[response.endPrivate].code
  537. tmp1[1] = TextToCode[response.endPrivate][response.endCity].code
  538. tmp1[2] =
  539. TextToCode[response.endPrivate][response.endCity][
  540. response.endArea
  541. ].code
  542. this.selectedOptions1 = tmp1
  543. }
  544. for (var i = 0; i < response.tranProcessInfoList.length; i++) {
  545. if (
  546. response.tranProcessInfoList[i].sendPrivate != '' &&
  547. response.tranProcessInfoList[i].sendCity != '' &&
  548. response.tranProcessInfoList[i].sendArea != ''
  549. ) {
  550. var tmp2 = []
  551. tmp2[0] =
  552. TextToCode[response.tranProcessInfoList[i].sendPrivate].code
  553. tmp2[1] =
  554. TextToCode[response.tranProcessInfoList[i].sendPrivate][
  555. response.tranProcessInfoList[i].sendCity
  556. ].code
  557. tmp2[2] =
  558. TextToCode[response.tranProcessInfoList[i].sendPrivate][
  559. response.tranProcessInfoList[i].sendCity
  560. ][response.tranProcessInfoList[i].sendArea].code
  561. response.tranProcessInfoList[i].selectedOptions = tmp2
  562. }
  563. if (
  564. response.tranProcessInfoList[i].receivePrivate != '' &&
  565. response.tranProcessInfoList[i].receiveCity != '' &&
  566. response.tranProcessInfoList[i].receiveArea != ''
  567. ) {
  568. var tmp3 = []
  569. tmp3[0] =
  570. TextToCode[response.tranProcessInfoList[i].receivePrivate].code
  571. tmp3[1] =
  572. TextToCode[response.tranProcessInfoList[i].receivePrivate][
  573. response.tranProcessInfoList[i].receiveCity
  574. ].code
  575. tmp3[2] =
  576. TextToCode[response.tranProcessInfoList[i].receivePrivate][
  577. response.tranProcessInfoList[i].receiveCity
  578. ][response.tranProcessInfoList[i].receiveArea].code
  579. response.tranProcessInfoList[i].selectedOptions1 = tmp3
  580. }
  581. this.weight = response.weight
  582. }
  583. this.checkList = response.tranType.split(',')
  584. })
  585. // 货名
  586. packList({ constId: 'CON2' })
  587. .toPromise()
  588. .then((response) => {
  589. this.goodnameList = response
  590. })
  591. // 任务类型
  592. packList({ constId: 'TRAN3' })
  593. .toPromise()
  594. .then((response) => {
  595. this.taskType = response
  596. })
  597. // 运输方式
  598. packList({ constId: 'TRAN6' })
  599. .toPromise()
  600. .then((response) => {
  601. this.taskwayList = response
  602. })
  603. getwarehousename({
  604. compId: this.compId,
  605. warehouseType: this.deptBudgetList.warehouseType,
  606. })
  607. .toPromise()
  608. .then((response) => {
  609. this.warehouseList = response
  610. })
  611. xialaNo({
  612. compId: this.compId,
  613. })
  614. .toPromise()
  615. .then((response) => {
  616. this.contractNoList = response
  617. })
  618. },
  619. selecttaskType(e) {
  620. for (var i = 0; i < this.taskType.length; i++) {
  621. if (this.taskType[i].constValue == e) {
  622. this.deptBudgetList.taskTypeKey = this.taskType[i].constKey
  623. }
  624. }
  625. },
  626. selecttaskwayList(e, index) {
  627. for (var i = 0; i < this.taskwayList.length; i++) {
  628. if (this.taskwayList[i].constValue == e) {
  629. this.deptBudgetList.tranProcessInfoList[index].tranTypeKey =
  630. this.taskwayList[i].constKey
  631. }
  632. }
  633. },
  634. selectgoodsname(e) {
  635. for (var i = 0; i < this.goodnameList.length; i++) {
  636. if (this.goodnameList[i].constValue == e) {
  637. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  638. }
  639. }
  640. },
  641. // 关闭 dialog时 处理文件url 初始化upload组件
  642. handleClose() {
  643. this.dialogViewSpareMoney = false
  644. },
  645. add(index) {
  646. this.deptBudgetList.tranProcessInfoList.push({
  647. processNo: this.deptBudgetList.taskNo + this.number,
  648. sort: 0,
  649. tranType: '汽运',
  650. tranTypeKey: '1',
  651. deliveryDateStart: '',
  652. deliveryDateEnd: '',
  653. weight: this.weight,
  654. selectedOptions: [],
  655. selectedOptions1: [],
  656. sendPrivate: '',
  657. sendCity: '',
  658. sendArea: '',
  659. receivePrivate: '',
  660. receiveCity: '',
  661. receiveArea: '',
  662. sendDetailedAddress: '',
  663. receiveDetailedAddress: '',
  664. sender: '',
  665. receiver: '',
  666. senderPhone: '',
  667. receiverPhone: '',
  668. })
  669. this.number++
  670. },
  671. del(index, row) {
  672. if (row.id) {
  673. this.$confirm('任务阶段删除后不可恢复,是否确定删除?', '提示', {
  674. confirmButtonText: '确定',
  675. cancelButtonText: '取消',
  676. type: 'warning',
  677. }).then(() => {
  678. delhaulagestage({ id: row.id })
  679. .toPromise()
  680. .then((response) => {
  681. this.$message.success('删除成功')
  682. if (this.deptBudgetList.tranProcessInfoList.length > 1) {
  683. this.deptBudgetList.tranProcessInfoList.splice(index, 1)
  684. }
  685. })
  686. })
  687. } else {
  688. if (this.deptBudgetList.tranProcessInfoList.length > 1) {
  689. this.deptBudgetList.tranProcessInfoList.splice(index, 1)
  690. }
  691. }
  692. this.number--
  693. },
  694. handleChange(value) {
  695. this.selectedOptions = value
  696. this.deptBudgetList.startPrivate = CodeToText[value[0]]
  697. this.deptBudgetList.startCity = CodeToText[value[1]]
  698. this.deptBudgetList.startArea = CodeToText[value[2]]
  699. },
  700. handleChange1(value) {
  701. this.selectedOptions1 = value
  702. this.deptBudgetList.endPrivate = CodeToText[value[0]]
  703. this.deptBudgetList.endCity = CodeToText[value[1]]
  704. this.deptBudgetList.endArea = CodeToText[value[2]]
  705. },
  706. handleChange3(value, index) {
  707. this.deptBudgetList.tranProcessInfoList[index].sendPrivate =
  708. CodeToText[value[0]]
  709. this.deptBudgetList.tranProcessInfoList[index].sendCity =
  710. CodeToText[value[1]]
  711. this.deptBudgetList.tranProcessInfoList[index].sendArea =
  712. CodeToText[value[2]]
  713. },
  714. handleChange4(value, index) {
  715. this.deptBudgetList.tranProcessInfoList[index].receivePrivate =
  716. CodeToText[value[0]]
  717. this.deptBudgetList.tranProcessInfoList[index].receiveCity =
  718. CodeToText[value[1]]
  719. this.deptBudgetList.tranProcessInfoList[index].receiveArea =
  720. CodeToText[value[2]]
  721. },
  722. returnsales() {
  723. this.$router.push({ path: 'tranManagementTransport' })
  724. },
  725. submit() {
  726. if (!this.deptBudgetList.taskNo) {
  727. this.$message({
  728. message: '任务编号不能为空!',
  729. type: 'warning',
  730. })
  731. return
  732. }
  733. if (!this.deptBudgetList.taskType) {
  734. this.$message({
  735. message: '任务类型不能为空!',
  736. type: 'warning',
  737. })
  738. return
  739. }
  740. if (!this.deptBudgetList.contractNo) {
  741. this.$message({
  742. message: '合同编号/移库任务编号不能为空!',
  743. type: 'warning',
  744. })
  745. return
  746. }
  747. if (!this.deptBudgetList.goodsName) {
  748. this.$message({
  749. message: '货名不能为空!',
  750. type: 'warning',
  751. })
  752. return
  753. }
  754. if (!this.deptBudgetList.weight) {
  755. this.$message({
  756. message: '重量(吨)不能为空!',
  757. type: 'warning',
  758. })
  759. return
  760. }
  761. if (!this.deptBudgetList.sendWarehouse) {
  762. this.$message({
  763. message: '发货仓库不能为空!',
  764. type: 'warning',
  765. })
  766. return
  767. }
  768. if (this.selectedOptions.length <= 0) {
  769. this.$message({
  770. message: '始发地不能为空!',
  771. type: 'warning',
  772. })
  773. return
  774. }
  775. if (!this.deptBudgetList.startDetailedAddress) {
  776. this.$message({
  777. message: '始发地详细地址不能为空!',
  778. type: 'warning',
  779. })
  780. return
  781. }
  782. if (this.selectedOptions1.length <= 0) {
  783. this.$message({
  784. message: '终到地不能为空!',
  785. type: 'warning',
  786. })
  787. return
  788. }
  789. if (!this.deptBudgetList.endDetailedAddress) {
  790. this.$message({
  791. message: '终到地详细地址不能为空!',
  792. type: 'warning',
  793. })
  794. return
  795. }
  796. if (this.checkList.length <= 0) {
  797. this.$message({
  798. message: '运输方式多选框不能为空!',
  799. type: 'warning',
  800. })
  801. return
  802. }
  803. for (var i = 0; i < this.deptBudgetList.tranProcessInfoList.length; i++) {
  804. this.deptBudgetList.tranProcessInfoList[i].processNo =
  805. this.deptBudgetList.taskNo + (i + 1)
  806. if (
  807. new Date(
  808. this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart
  809. ).getTime() >
  810. new Date(
  811. this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd
  812. ).getTime()
  813. ) {
  814. this.$message({
  815. message: '发货日期不能大于最晚到货日期!',
  816. type: 'warning',
  817. })
  818. return
  819. }
  820. if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart) {
  821. this.$message({
  822. message: '发货日期不能为空!',
  823. type: 'warning',
  824. })
  825. return
  826. }
  827. if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd) {
  828. this.$message({
  829. message: '最晚到货日期不能为空!',
  830. type: 'warning',
  831. })
  832. return
  833. }
  834. if (!this.deptBudgetList.tranProcessInfoList[i].weight) {
  835. this.$message({
  836. message: '重量不能为空!',
  837. type: 'warning',
  838. })
  839. return
  840. }
  841. if (!this.deptBudgetList.tranProcessInfoList[i].sender) {
  842. this.$message({
  843. message: '发货人不能为空!',
  844. type: 'warning',
  845. })
  846. return
  847. }
  848. if (!this.deptBudgetList.tranProcessInfoList[i].senderPhone) {
  849. this.$message({
  850. message: '发货人电话不能为空!',
  851. type: 'warning',
  852. })
  853. return
  854. }
  855. if (!this.deptBudgetList.tranProcessInfoList[i].receiver) {
  856. this.$message({
  857. message: '收货人不能为空!',
  858. type: 'warning',
  859. })
  860. return
  861. }
  862. if (!this.deptBudgetList.tranProcessInfoList[i].receiverPhone) {
  863. this.$message({
  864. message: '收货人电话不能为空!',
  865. type: 'warning',
  866. })
  867. return
  868. }
  869. if (
  870. !this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress
  871. ) {
  872. this.$message({
  873. message: '收获详细地址不能为空!',
  874. type: 'warning',
  875. })
  876. return
  877. }
  878. if (!this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress) {
  879. this.$message({
  880. message: '发货详细地址不能为空!',
  881. type: 'warning',
  882. })
  883. return
  884. }
  885. }
  886. if (this.endflag == false) {
  887. this.$confirm('您还未选择最终阶段,是否确定提交?', '提示', {
  888. confirmButtonText: '确定',
  889. cancelButtonText: '取消',
  890. type: 'warning',
  891. })
  892. .then(() => {
  893. this.$refs.deptBudgetList.validate((valid) => {
  894. if (valid) {
  895. this.deptBudgetList.compId =
  896. sessionStorage.getItem('ws-pf_compId')
  897. this.deptBudgetList.tranType = this.checkList.toString()
  898. this.deptBudgetList.startPrivate =
  899. CodeToText[this.selectedOptions[0]]
  900. this.deptBudgetList.startCity =
  901. CodeToText[this.selectedOptions[1]]
  902. this.deptBudgetList.startArea =
  903. CodeToText[this.selectedOptions[2]]
  904. this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
  905. CodeToText[this.selectedOptions[0]]
  906. this.deptBudgetList.tranProcessInfoList[0].sendCity =
  907. CodeToText[this.selectedOptions[1]]
  908. this.deptBudgetList.tranProcessInfoList[0].sendArea =
  909. CodeToText[this.selectedOptions[2]]
  910. for (
  911. var i = 0;
  912. i < this.deptBudgetList.tranProcessInfoList.length;
  913. i++
  914. ) {
  915. this.deptBudgetList.tranProcessInfoList[i].sort = i
  916. }
  917. edittran(this.deptBudgetList)
  918. .toPromise()
  919. .then((response) => {
  920. this.$message.success('编辑成功')
  921. this.deptBudgetList = {}
  922. this.$router.push({ path: 'tranManagementTransport' })
  923. })
  924. } else {
  925. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  926. return false
  927. }
  928. })
  929. })
  930. .catch(() => {
  931. return false
  932. })
  933. } else {
  934. this.$confirm(
  935. '运输任务提交成功后将派发到物流部门,是否确定提交?',
  936. '提示',
  937. {
  938. confirmButtonText: '确定',
  939. cancelButtonText: '取消',
  940. type: 'warning',
  941. }
  942. )
  943. .then(() => {
  944. this.$refs.deptBudgetList.validate((valid) => {
  945. if (valid) {
  946. this.deptBudgetList.compId =
  947. sessionStorage.getItem('ws-pf_compId')
  948. this.deptBudgetList.tranType = this.checkList.toString()
  949. this.deptBudgetList.startPrivate =
  950. CodeToText[this.selectedOptions[0]]
  951. this.deptBudgetList.startCity =
  952. CodeToText[this.selectedOptions[1]]
  953. this.deptBudgetList.startArea =
  954. CodeToText[this.selectedOptions[2]]
  955. this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
  956. CodeToText[this.selectedOptions[0]]
  957. this.deptBudgetList.tranProcessInfoList[0].sendCity =
  958. CodeToText[this.selectedOptions[1]]
  959. this.deptBudgetList.tranProcessInfoList[0].sendArea =
  960. CodeToText[this.selectedOptions[2]]
  961. this.deptBudgetList.tranProcessInfoList[
  962. this.deptBudgetList.tranProcessInfoList.length - 1
  963. ].receivePrivate = CodeToText[this.selectedOptions1[0]]
  964. this.deptBudgetList.tranProcessInfoList[
  965. this.deptBudgetList.tranProcessInfoList.length - 1
  966. ].receiveCity = CodeToText[this.selectedOptions1[1]]
  967. this.deptBudgetList.tranProcessInfoList[
  968. this.deptBudgetList.tranProcessInfoList.length - 1
  969. ].receiveArea = CodeToText[this.selectedOptions1[2]]
  970. for (
  971. var i = 0;
  972. i < this.deptBudgetList.tranProcessInfoList.length;
  973. i++
  974. ) {
  975. this.deptBudgetList.tranProcessInfoList[i].sort = i
  976. }
  977. edittran(this.deptBudgetList)
  978. .toPromise()
  979. .then((response) => {
  980. this.$message.success('编辑成功')
  981. this.deptBudgetList = {}
  982. this.$router.push({ path: 'tranManagementTransport' })
  983. })
  984. } else {
  985. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  986. alert('失败1')
  987. return false
  988. }
  989. })
  990. })
  991. .catch(() => {
  992. alert('失败2')
  993. return false
  994. })
  995. }
  996. },
  997. resetForm(deptBudgetList) {
  998. this.$refs[deptBudgetList].resetFields()
  999. },
  1000. },
  1001. }
  1002. </script>
  1003. <style lang="scss" scoped>
  1004. .position {
  1005. position: relative;
  1006. border-radius: 5px;
  1007. border: 1px solid #5473e8;
  1008. margin-top: 20px;
  1009. background: #f6f7fc;
  1010. border-left: 5px solid #5473e8;
  1011. }
  1012. .position .ws-info-table .el-form-item {
  1013. width: 25%;
  1014. }
  1015. .typeselect {
  1016. width: 42%;
  1017. margin-left: 32px;
  1018. }
  1019. /deep/.position .ws-info-table .el-form-item .el-form-item__label,
  1020. /deep/.position .ws-info-table .el-form-item .el-form-item__content {
  1021. background: #f6f7fc;
  1022. }
  1023. /deep/.position .el-select {
  1024. width: 100%;
  1025. }
  1026. .del,
  1027. .add {
  1028. cursor: pointer;
  1029. margin-left: 10px;
  1030. }
  1031. .el-checkbox-group {
  1032. font-size: 0;
  1033. float: right;
  1034. margin-left: 24px;
  1035. color: #8890b1;
  1036. }
  1037. /deep/.el-checkbox__label {
  1038. color: #8890b1;
  1039. }
  1040. .el-form-item.start-address.el-form-item--small {
  1041. width: 31.9%;
  1042. }
  1043. .check-box {
  1044. margin-top: 10px;
  1045. margin-left: 16px;
  1046. color: #8890b1;
  1047. font-size: 14px;
  1048. }
  1049. /deep/.el-table--border:after,
  1050. /deep/.el-table--group:after,
  1051. /deep/.el-table:before {
  1052. background: transparent;
  1053. }
  1054. .el-form {
  1055. padding: 0 10%;
  1056. }
  1057. .ws-info-table {
  1058. border: none;
  1059. }
  1060. /deep/.ws-info-table .el-form-item {
  1061. border: none;
  1062. height: 50px;
  1063. }
  1064. .readonly {
  1065. position: relative;
  1066. }
  1067. .title {
  1068. position: relative;
  1069. }
  1070. .title::before {
  1071. content: '';
  1072. display: inline-block;
  1073. width: 5px;
  1074. height: 30px;
  1075. background: #5473e8;
  1076. position: absolute;
  1077. left: 0;
  1078. }
  1079. //去边框
  1080. /deep/.el-form-item {
  1081. border-right: 0px;
  1082. border-bottom: 0px;
  1083. }
  1084. .el-form {
  1085. margin-top: 50px;
  1086. }
  1087. .el-col {
  1088. background: #f6f7fc;
  1089. }
  1090. .bg-left {
  1091. padding-left: 30px;
  1092. }
  1093. .bg-right {
  1094. padding-right: 10px;
  1095. text-align: right;
  1096. }
  1097. .bg-bottom {
  1098. margin: 15px 0px;
  1099. background: #5473e8;
  1100. }
  1101. .el-radio,
  1102. .el-radio__input {
  1103. margin-top: 11px;
  1104. margin-left: 11px;
  1105. width: 93px;
  1106. }
  1107. /deep/.ws-info-table .el-form-item {
  1108. width: 20%;
  1109. }
  1110. /deep/.nei {
  1111. .ws-info-table {
  1112. border: none;
  1113. }
  1114. .el-form-item {
  1115. width: 33.3333%;
  1116. border: none;
  1117. .el-form-item__label {
  1118. background: transparent;
  1119. border: none;
  1120. }
  1121. .el-form-item__content {
  1122. border: none;
  1123. }
  1124. }
  1125. }
  1126. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1127. background: #fff;
  1128. text-align: center;
  1129. color: #8890b1;
  1130. font-size: 14px;
  1131. width: -webkit-min-content;
  1132. }
  1133. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1134. border: none;
  1135. }
  1136. .start-address {
  1137. width: 33.333%;
  1138. }
  1139. /deep/.start-address .ws-info-table .el-form-item .el-form-item__content {
  1140. width: 100%;
  1141. color: #8890b1;
  1142. font-size: 14px;
  1143. }
  1144. .driver {
  1145. height: 30px;
  1146. margin-left: 20px;
  1147. margin-top: 10px;
  1148. line-height: 30px;
  1149. font-size: 16px;
  1150. color: #5473e8;
  1151. }
  1152. .el-form {
  1153. height: 73vh;
  1154. overflow: scroll;
  1155. }
  1156. .el-cascader {
  1157. width: 100%;
  1158. }
  1159. </style>