tranManagementTransportAdd.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  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 @change='warehouseTypechange' v-model="deptBudgetList.warehouseType">
  92. <el-radio label="1"
  93. >常用仓库发货</el-radio
  94. >
  95. <el-radio label="2"
  96. >临时仓库发货</el-radio
  97. >
  98. </el-radio-group>
  99. <el-select
  100. @change='sendWarehousechange'
  101. v-model="deptBudgetList.sendWarehouse"
  102. placeholder="选择仓库"
  103. class="typeselect"
  104. >
  105. <el-option
  106. v-for="item in warehouseList"
  107. :key="item.constKey"
  108. :label="item.warehouseName"
  109. :value="item.warehouseName"
  110. ></el-option>
  111. </el-select>
  112. </div>
  113. <el-form-item label="始发地" span="1" class="start-address">
  114. <el-cascader
  115. :options="options_"
  116. v-model="selectedOptions"
  117. clearable
  118. size="large"
  119. placeholder="请选择始发地"
  120. @change="handleChange"
  121. />
  122. </el-form-item>
  123. <el-form-item
  124. label="始发地详细地址"
  125. span="1"
  126. prop="startDetailedAddress"
  127. class="bg-right start-address"
  128. >
  129. <el-input
  130. v-model="deptBudgetList.startDetailedAddress"
  131. placeholder="请输入始发地详细地址"
  132. maxlength="20"
  133. size="small"
  134. ></el-input>
  135. </el-form-item>
  136. <el-form-item
  137. label="收货库点"
  138. span="1"
  139. prop="contractNo"
  140. class="start-address"
  141. style="width: 36%"
  142. >
  143. <el-select
  144. v-model="deptBudgetList.receiveWarehouse"
  145. :disabled="warehouse"
  146. placeholder="请输入收货库点"
  147. style="width: 100%"
  148. >
  149. <el-option
  150. v-for="item in warehouseList"
  151. :key="item.constKey"
  152. :label="item.warehouseName"
  153. :value="item.warehouseName"
  154. ></el-option>
  155. </el-select>
  156. </el-form-item>
  157. <el-form-item
  158. label="终到地"
  159. span="1"
  160. prop="contractNo"
  161. class="start-address"
  162. >
  163. <el-cascader
  164. :options="options_"
  165. v-model="selectedOptions1"
  166. clearable
  167. size="large"
  168. placeholder="请选择终到地"
  169. @change="handleChange1"
  170. />
  171. </el-form-item>
  172. <el-form-item
  173. label="终到地详细地址"
  174. span="1"
  175. prop="endDetailedAddress"
  176. class="bg-right start-address"
  177. >
  178. <el-input
  179. v-model="deptBudgetList.endDetailedAddress"
  180. placeholder="请输入终到地详细地址"
  181. maxlength="20"
  182. size="small"
  183. ></el-input>
  184. </el-form-item>
  185. <div class="check-box">
  186. <span class="check-box">运输方式</span>
  187. <el-checkbox-group v-model="checkList" prop="tranType">
  188. <el-checkbox label="汽运"></el-checkbox>
  189. <el-checkbox label="火运"></el-checkbox>
  190. <el-checkbox label="船运"></el-checkbox>
  191. </el-checkbox-group>
  192. </div>
  193. </ws-info-table>
  194. <div
  195. style="width: 100%"
  196. class="position"
  197. v-for="(item, index) in deptBudgetList.tranProcessInfoList"
  198. :key="index"
  199. >
  200. <div class="driver">
  201. <span style='vertical-align: top;'>运输阶段{{ index + 1 }} {{ item.processNo }}</span>
  202. <img v-if='!endflag'
  203. width="22"
  204. height="22"
  205. class="add"
  206. @click="add(index)"
  207. src="../../../public/img/add.png"
  208. alt=""
  209. />
  210. <img
  211. width="22"
  212. height="22"
  213. class="del"
  214. @click="del(index)"
  215. src="../../../public/img/del.png"
  216. alt=""
  217. />
  218. <el-checkbox
  219. @change='engflagchange'
  220. class='endflag'
  221. v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
  222. v-model="item.endFlag"
  223. :label="1"
  224. >最终阶段</el-checkbox
  225. >
  226. </div>
  227. <ws-info-table>
  228. <el-form-item label="运输方式" span="1" prop="waterContent">
  229. <el-select
  230. v-model="item.tranType"
  231. placeholder="运输方式"
  232. @change="
  233. (val) => {
  234. selecttaskwayList(val, index)
  235. }
  236. "
  237. >
  238. <el-option
  239. v-for="item in taskwayList"
  240. :key="item.constKey"
  241. :label="item.constValue"
  242. :value="item.constValue"
  243. ></el-option>
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item label="发货日期" span="1" prop="impurity">
  247. <ws-date-picker
  248. v-model="item.deliveryDateStart"
  249. type="date"
  250. placeholder="请选择发货日期"
  251. value-format="yyyy-MM-dd"
  252. />
  253. </el-form-item>
  254. <el-form-item label="最晚到货日期" span="1" prop="bulkDensity">
  255. <ws-date-picker
  256. v-model="item.deliveryDateEnd"
  257. type="date"
  258. placeholder="请选择最晚到货日期"
  259. value-format="yyyy-MM-dd"
  260. />
  261. </el-form-item>
  262. <!-- 本阶段重量 -->
  263. <el-form-item
  264. label="本阶段运输重量(吨)"
  265. span="1"
  266. prop="bulkDensity"
  267. >
  268. <el-input
  269. v-model="deptBudgetList.weight"
  270. placeholder="请输入本阶段运输重量"
  271. size="small"
  272. ></el-input>
  273. </el-form-item>
  274. </ws-info-table>
  275. <ws-info-table>
  276. <el-form-item label="发货地区" span="1" prop="waterContent">
  277. <el-cascader
  278. :options="options_"
  279. v-model="item.selectedOptions"
  280. clearable
  281. size="large"
  282. placeholder="请选择发货地区"
  283. style="width: 200%"
  284. @change="
  285. (val) => {
  286. handleChange3(val, index)
  287. }
  288. "
  289. />
  290. </el-form-item>
  291. <el-form-item label="发货地详细地址" span="1" prop="impurity">
  292. <el-input
  293. v-model="item.sendDetailedAddress"
  294. placeholder="请输入发货地详细地址"
  295. maxlength="20"
  296. size="small"
  297. ></el-input>
  298. </el-form-item>
  299. <el-form-item label="发货人" span="1" prop="bulkDensity">
  300. <el-input
  301. v-model="item.sender"
  302. placeholder="请输入发货人"
  303. maxlength="20"
  304. size="small"
  305. ></el-input>
  306. </el-form-item>
  307. <el-form-item label="发货人电话" span="1" prop="bulkDensity">
  308. <el-input
  309. v-model="item.senderPhone"
  310. placeholder="请输入发货人电话"
  311. maxlength="20"
  312. size="small"
  313. ></el-input>
  314. </el-form-item>
  315. </ws-info-table>
  316. <ws-info-table>
  317. <el-form-item label="收货地区" span="1" prop="bulkDensity">
  318. <el-cascader
  319. :options="options_"
  320. v-model="item.selectedOptions1"
  321. clearable
  322. size="large"
  323. placeholder="请选择收货地区"
  324. style="width: 200%"
  325. @change="
  326. (val) => {
  327. handleChange4(val, index)
  328. }
  329. "
  330. />
  331. </el-form-item>
  332. <el-form-item label="收货地详细地址" span="1" prop="impurity">
  333. <el-input
  334. v-model="item.receiveDetailedAddress"
  335. placeholder="请输入收货地详细地址"
  336. maxlength="20"
  337. size="small"
  338. ></el-input>
  339. </el-form-item>
  340. <el-form-item label="收货人" span="1" prop="bulkDensity">
  341. <el-input
  342. v-model="item.receiver"
  343. placeholder="请输入收货人"
  344. maxlength="20"
  345. size="small"
  346. ></el-input>
  347. </el-form-item>
  348. <el-form-item label="收货人电话" span="1" prop="bulkDensity">
  349. <el-input
  350. v-model="item.receiverPhone"
  351. placeholder="请输入收货人电话"
  352. maxlength="20"
  353. size="small"
  354. ></el-input>
  355. </el-form-item>
  356. </ws-info-table>
  357. </div>
  358. </el-form>
  359. <!-- 提交 -->
  360. <div style="text-align: right; padding: 10px" class="center">
  361. <el-button
  362. class="bg-bottom"
  363. type="primary"
  364. size="small"
  365. @click="submit(deptBudgetList)"
  366. >提交</el-button
  367. >
  368. </div>
  369. </div>
  370. </template>
  371. <script>
  372. import { packList } from '@/model/contarct/index'
  373. import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
  374. import { addtrantask, getwarehousename, xialaNo } from '@/model/tasksport/index'
  375. import WsUpload from '@/components/WsUpload'
  376. import mapDrag from '@/components/mapdrag/mapdrag'
  377. export default {
  378. name: 'viewSpareMoney',
  379. components: {
  380. WsUpload,
  381. mapDrag,
  382. },
  383. watch: {
  384. vesselId(val) {
  385. this.getVesselData()
  386. },
  387. isShow(val) {
  388. this.showType = val
  389. },
  390. },
  391. data() {
  392. let self = this
  393. return {
  394. flag:2,
  395. checkList: [],
  396. deptBudgetList: {
  397. taskNo: '',
  398. totalStorage: 0,
  399. goodsName: '玉米',
  400. goodsNameKey: 1,
  401. warehouseType: '1',
  402. tranProcessInfoList: [
  403. {
  404. processNo: '',
  405. tranType: '汽运',
  406. tranTypeKey: '1',
  407. deliveryDateStart: '',
  408. deliveryDateEnd: '',
  409. weight: '',
  410. selectedOptions: [],
  411. selectedOptions1: [],
  412. sendPrivate: '',
  413. sendCity: '',
  414. sendArea: '',
  415. receivePrivate: '',
  416. receiveCity: '',
  417. receiveArea: '',
  418. sendDetailedAddress: '',
  419. receiveDetailedAddress: '',
  420. sender: '',
  421. receiver: '',
  422. senderPhone: '',
  423. receiverPhone: '',
  424. endFlag: '0',
  425. },
  426. ],
  427. },
  428. radio: '1',
  429. options_: regionData,
  430. heightData: '600px',
  431. zoom: 7,
  432. endflag:false,
  433. selectedOptions: [],
  434. selectedOptions1: [],
  435. window: '',
  436. district: null,
  437. goodnameList: [],
  438. listDate: { country: '中国', level: 'country', city: '' },
  439. citylist: [],
  440. taskType: [],
  441. taskwayList: [],
  442. contractNoList: [],
  443. compId: sessionStorage.getItem('ws-pf_compId'),
  444. mainReportAdd: {},
  445. appendixIdsAdd: '',
  446. warehouseList: [],
  447. size: 10,
  448. value1: '',
  449. unitList: [],
  450. name: '',
  451. age: '',
  452. }
  453. },
  454. activated() {
  455. this.loaddata()
  456. this.showType = this.isShow
  457. },
  458. computed: {
  459. weight:function(){
  460. var maxStorage = 0
  461. for(var i =0 ; i<this.deptBudgetList.tranProcessInfoList.length;i++){
  462. maxStorage += Number(this.deptBudgetList.tranProcessInfoList[i].weight)
  463. }
  464. return maxStorage
  465. },
  466. warehouse: function () {
  467. if (
  468. this.deptBudgetList.taskType == '销售出库' ||
  469. this.deptBudgetList.taskType == '贸易服务出库' ||
  470. this.deptBudgetList.taskType == '暂存出库'
  471. ) {
  472. return true
  473. } else {
  474. return false
  475. }
  476. },
  477. },
  478. methods: {
  479. sendWarehousechange(e){
  480. for (let i = 0; i < this.warehouseList.length; i++) {
  481. if(this.warehouseList[i].warehouseName==e){
  482. var tmp=[]
  483. tmp[0]=TextToCode[this.warehouseList[i].warehousePrivate].code
  484. tmp[1]=TextToCode[this.warehouseList[i].warehousePrivate][this.warehouseList[i].warehouseCity].code
  485. tmp[2]=TextToCode[this.warehouseList[i].warehousePrivate][this.warehouseList[i].warehouseCity][this.warehouseList[i].warehouseArea].code
  486. this.selectedOptions=tmp
  487. this.deptBudgetList.tranProcessInfoList[0].selectedOptions=tmp
  488. this.deptBudgetList.startDetailedAddress=this.warehouseList[i].detailedAddress
  489. }
  490. }
  491. },
  492. warehouseTypechange(){
  493. getwarehousename({
  494. compId: this.compId,
  495. warehouseType: this.deptBudgetList.warehouseType,
  496. })
  497. .toPromise()
  498. .then((response) => {
  499. this.warehouseList = response
  500. })
  501. },
  502. weightchange(e){
  503. this.deptBudgetList.tranProcessInfoList[0].weight=e
  504. },
  505. engflagchange(e){
  506. this.endflag=e
  507. },
  508. // 获取当前年月日
  509. getdate() {
  510. var date = new Date()
  511. var year = date.getFullYear() //获取完整的年份(4位)
  512. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  513. var datetime = date.getDate() //获取当前日(1-31)
  514. if (mouth < 10) {
  515. mouth = '0' + mouth
  516. }
  517. if (datetime < 10) {
  518. datetime = '0' + datetime
  519. }
  520. return year + mouth + datetime
  521. },
  522. // 随机验证码
  523. verifyinit() {
  524. var arr = []
  525. for (var i = 48; i < 123; i++) {
  526. if (i > 57 && i < 65) continue
  527. if (i > 90 && i < 97) continue
  528. arr.push(String.fromCharCode(i))
  529. }
  530. arr.sort(function () {
  531. return Math.random() - 0.5
  532. })
  533. arr.length = 4
  534. return arr.join('')
  535. },
  536. loaddata() {
  537. this.deptBudgetList.taskNo = 'YS' + this.getdate() + this.verifyinit()
  538. this.deptBudgetList.tranProcessInfoList[0].processNo=this.deptBudgetList.taskNo+'-1'
  539. // 货名
  540. packList({ constId: 'CON2' })
  541. .toPromise()
  542. .then((response) => {
  543. this.goodnameList = response
  544. })
  545. // 任务类型
  546. packList({ constId: 'TRAN3' })
  547. .toPromise()
  548. .then((response) => {
  549. this.taskType = response
  550. })
  551. // 运输方式
  552. packList({ constId: 'TRAN6' })
  553. .toPromise()
  554. .then((response) => {
  555. this.taskwayList = response
  556. })
  557. getwarehousename({
  558. compId: this.compId,
  559. warehouseType: this.deptBudgetList.warehouseType,
  560. })
  561. .toPromise()
  562. .then((response) => {
  563. this.warehouseList = response
  564. })
  565. xialaNo({
  566. compId: this.compId,
  567. flag: this.flag
  568. })
  569. .toPromise()
  570. .then((response) => {
  571. this.contractNoList = response
  572. })
  573. },
  574. confirmPositioncity() {
  575. this.listDate.level = 'city'
  576. this.listDate.country = this.name
  577. },
  578. // 关闭 dialog时 处理文件url 初始化upload组件
  579. handleClose() {
  580. this.dialogViewSpareMoney = false
  581. },
  582. add(index) {
  583. console.log(index)
  584. this.deptBudgetList.tranProcessInfoList.push({
  585. processNo: this.deptBudgetList.taskNo+'-'+(index+2),
  586. tranType: '汽运',
  587. tranTypeKey: '1',
  588. deliveryDateStart: '',
  589. deliveryDateEnd: '',
  590. weight: this.deptBudgetList.tranProcessInfoList[this.deptBudgetList.tranProcessInfoList.length-1].weight,
  591. selectedOptions: [],
  592. selectedOptions1: [],
  593. sendPrivate: '',
  594. sendCity: '',
  595. sendArea: '',
  596. receivePrivate: '',
  597. receiveCity: '',
  598. receiveArea: '',
  599. sendDetailedAddress: '',
  600. receiveDetailedAddress: '',
  601. sender: '',
  602. receiver: '',
  603. senderPhone: '',
  604. receiverPhone: '',
  605. endFlag: '0',
  606. })
  607. },
  608. del(index) {
  609. if (this.deptBudgetList.tranProcessInfoList.length > 1) {
  610. this.deptBudgetList.tranProcessInfoList.splice(index, 1)
  611. }
  612. },
  613. handleChange(value) {
  614. this.selectedOptions = value
  615. this.deptBudgetList.startPrivate = CodeToText[value[0]]
  616. this.deptBudgetList.startCity = CodeToText[value[1]]
  617. this.deptBudgetList.startArea = CodeToText[value[2]]
  618. },
  619. handleChange1(value) {
  620. this.selectedOptions1 = value
  621. this.deptBudgetList.endPrivate = CodeToText[value[0]]
  622. this.deptBudgetList.endCity = CodeToText[value[1]]
  623. this.deptBudgetList.endArea = CodeToText[value[2]]
  624. },
  625. handleChange3(value, index) {
  626. this.deptBudgetList.tranProcessInfoList[index].sendPrivate =
  627. CodeToText[value[0]]
  628. this.deptBudgetList.tranProcessInfoList[index].sendCity =
  629. CodeToText[value[1]]
  630. this.deptBudgetList.tranProcessInfoList[index].sendArea =
  631. CodeToText[value[2]]
  632. },
  633. handleChange4(value, index) {
  634. this.deptBudgetList.tranProcessInfoList[index].receivePrivate =
  635. CodeToText[value[0]]
  636. this.deptBudgetList.tranProcessInfoList[index].receiveCity =
  637. CodeToText[value[1]]
  638. this.deptBudgetList.tranProcessInfoList[index].receiveArea =
  639. CodeToText[value[2]]
  640. },
  641. returnsales() {
  642. this.$router.push({ path: 'tranManagementTransport' })
  643. this.deptBudgetList = {
  644. taskNo: '',
  645. totalStorage: 0,
  646. goodsName: '玉米',
  647. goodsNameKey: 1,
  648. warehouseType: '1',
  649. tranProcessInfoList: [
  650. {
  651. processNo: '',
  652. tranType: '汽运',
  653. deliveryDateStart: '',
  654. deliveryDateEnd: '',
  655. weight: '',
  656. selectedOptions: [],
  657. selectedOptions1: [],
  658. sendPrivate: '',
  659. sendCity: '',
  660. sendArea: '',
  661. receivePrivate: '',
  662. receiveCity: '',
  663. receiveArea: '',
  664. sendDetailedAddress: '',
  665. receiveDetailedAddress: '',
  666. sender: '',
  667. receiver: '',
  668. senderPhone: '',
  669. receiverPhone: '',
  670. },
  671. ],
  672. }
  673. },
  674. selecttaskType(e) {
  675. for (var i = 0; i < this.taskType.length; i++) {
  676. if (this.taskType[i].constValue == e) {
  677. this.deptBudgetList.taskTypeKey = this.taskType[i].constKey
  678. }
  679. }
  680. },
  681. selecttaskwayList(e, index) {
  682. for (var i = 0; i < this.taskwayList.length; i++) {
  683. if (this.taskwayList[i].constValue == e) {
  684. this.deptBudgetList.tranProcessInfoList[index].tranTypeKey =
  685. this.taskwayList[i].constKey
  686. }
  687. }
  688. },
  689. selectgoodsname(e) {
  690. for (var i = 0; i < this.goodnameList.length; i++) {
  691. if (this.goodnameList[i].constValue == e) {
  692. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  693. }
  694. }
  695. },
  696. onChange(files) {
  697. this.fileNum = files
  698. this.$refs.upload.handleSaveBill().then((res) => {
  699. console.log(files)
  700. })
  701. },
  702. submit() {
  703. this.$refs.deptBudgetList.validate((valid) => {
  704. if (valid) {
  705. for (
  706. var i = 0;
  707. i < this.deptBudgetList.tranProcessInfoList.length;
  708. i++
  709. ) {
  710. this.deptBudgetList.tranProcessInfoList[i].processNo =
  711. this.deptBudgetList.taskNo + (i + 1)
  712. }
  713. this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
  714. this.deptBudgetList.tranType = this.checkList.toString()
  715. addtrantask(this.deptBudgetList)
  716. .toPromise()
  717. .then((response) => {
  718. this.$message.success('添加成功')
  719. this.deptBudgetList = {
  720. taskNo: '',
  721. totalStorage: 0,
  722. goodsName: '玉米',
  723. goodsNameKey: 1,
  724. warehouseType: '1',
  725. tranProcessInfoList: [
  726. {
  727. processNo: '',
  728. tranType: '汽运',
  729. deliveryDateStart: '',
  730. deliveryDateEnd: '',
  731. weight: '',
  732. selectedOptions: [],
  733. selectedOptions1: [],
  734. sendPrivate: '',
  735. sendCity: '',
  736. sendArea: '',
  737. receivePrivate: '',
  738. receiveCity: '',
  739. receiveArea: '',
  740. sendDetailedAddress: '',
  741. receiveDetailedAddress: '',
  742. sender: '',
  743. receiver: '',
  744. senderPhone: '',
  745. receiverPhone: '',
  746. },
  747. ],
  748. }
  749. this.$router.push({ path: 'tranManagementTransport' })
  750. })
  751. } else {
  752. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  753. return false
  754. }
  755. })
  756. },
  757. resetForm(deptBudgetList) {
  758. this.$refs[deptBudgetList].resetFields()
  759. },
  760. },
  761. }
  762. </script>
  763. <style lang="scss" scoped>
  764. .position {
  765. position: relative;
  766. border: 1px solid #5473e8;
  767. border-radius: 4px;
  768. margin-top: 20px;
  769. background: #f6f7fc;
  770. border-left: 5px solid #5473e8;
  771. }
  772. /deep/.position .ws-info-table .el-form-item {
  773. width: 25%;
  774. height: 50px;
  775. }
  776. /deep/.position .el-select {
  777. width: 100%;
  778. }
  779. /deep/.position .ws-info-table .el-form-item .el-form-item__label,
  780. /deep/.position .ws-info-table .el-form-item .el-form-item__content {
  781. background: #f6f7fc;
  782. font-size: 14px;
  783. color: #8890b1;
  784. }
  785. .typeselect{
  786. width:42%;
  787. margin-left:32px;
  788. }
  789. .del,
  790. .add {
  791. cursor: pointer;
  792. margin-left: 10px;
  793. }
  794. .el-checkbox-group {
  795. font-size: 0;
  796. float: right;
  797. margin-left: 25px;
  798. }
  799. .check-box {
  800. float: left;
  801. font-size: 14px;
  802. color: #8890B1;
  803. }
  804. .el-checkbox__label{
  805. color: #8890B1;
  806. }
  807. .el-form {
  808. padding: 0 10%;
  809. }
  810. .ws-info-table {
  811. border: none;
  812. }
  813. /deep/.ws-info-table .el-form-item {
  814. border-right: 1px solid #cdd2dc;
  815. border-bottom: 1px solid #cdd2dc;
  816. }
  817. .readonly {
  818. position: relative;
  819. }
  820. .title {
  821. position: relative;
  822. }
  823. .title::before {
  824. content: '';
  825. display: inline-block;
  826. width: 5px;
  827. height: 30px;
  828. background: #5473e8;
  829. position: absolute;
  830. left: 0;
  831. }
  832. //去边框
  833. /deep/.el-form-item {
  834. border-right: 0px;
  835. border-bottom: 0px;
  836. }
  837. .el-form {
  838. margin-top: 50px;
  839. }
  840. .endflag{
  841. vertical-align: top;
  842. }
  843. .el-col {
  844. background: #f6f7fc;
  845. }
  846. .bg-left {
  847. padding-left: 30px;
  848. }
  849. .bg-right {
  850. padding-right: 10px;
  851. text-align: right;
  852. }
  853. .bg-bottom {
  854. margin: 15px 0px;
  855. }
  856. .el-radio,
  857. .el-radio__input {
  858. margin-top: 11px;
  859. margin-left: 11px;
  860. width: 93px;
  861. }
  862. .driver {
  863. margin-top: 10px;
  864. font-weight: bold;
  865. margin-left: 20px;
  866. color: #5473E8;
  867. font-size: 16px;
  868. }
  869. /deep/.nei {
  870. .ws-info-table {
  871. border: none;
  872. }
  873. .el-form-item {
  874. width: 33.3333%;
  875. border: none;
  876. .el-form-item__label {
  877. background: transparent;
  878. border: none;
  879. }
  880. .el-form-item__content {
  881. border: none;
  882. }
  883. }
  884. }
  885. /deep/.el-table--border:after, /deep/.el-table--group:after, /deep/.el-table:before {
  886. background:transparent;
  887. }
  888. //输入框标题
  889. /deep/.ws-info-table .el-form-item .el-form-item__label {
  890. background: #ffffff;
  891. width: min-content;
  892. font-size: 14px;
  893. color: #8890b1;
  894. }
  895. //表单子项
  896. /deep/.ws-info-table .el-form-item {
  897. width: 20%;
  898. border: none;
  899. height: 50px;
  900. }
  901. //输入框
  902. /deep/.ws-info-table .el-form-item .el-form-item__content {
  903. border: none;
  904. font-size: 14px;
  905. color: #8890b1;
  906. }
  907. /deep/ .el-input--small .el-input__inner {
  908. font-size: 14px;
  909. color: #8890b1;
  910. }
  911. .el-form-item.start-address.el-form-item--small {
  912. width: 31.9%;
  913. }
  914. .el-cascader {
  915. width: 100%;
  916. }
  917. .el-form{
  918. height: 73vh;
  919. overflow: scroll;
  920. }
  921. </style>