tranManagementFireFeedback.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  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 class="bg-bottom" type="primary" size="small" @click="revert()">
  10. <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
  11. src="../../../public/img/lujing.png" alt />返回
  12. </el-button>
  13. </el-col>
  14. </el-row>
  15. <ws-form class="position" ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
  16. <div class="small-title" style="font-size: 16px">任务详情</div>
  17. <ws-info-table>
  18. <!--任务编号-->
  19. <ws-form-item label="任务编号" span="1" prop="processNo">{{ deptBudgetList.processNo }}</ws-form-item>
  20. <!--货名-->
  21. <ws-form-item label="货名" span="1" prop="goodsName">{{ deptBudgetList.goodsName }}</ws-form-item>
  22. <!--重量(吨)-->
  23. <ws-form-item label="重量(吨)" span="1" prop="weight">{{ deptBudgetList.weight }}</ws-form-item>
  24. <!--发货地址-->
  25. <ws-form-item label="发货地址" span="1" prop="sendDetailedAddress">
  26. {{ deptBudgetList.sendPrivate }}{{ deptBudgetList.sendCity
  27. }}{{ deptBudgetList.sendArea }}
  28. </ws-form-item>
  29. <!--发货人-->
  30. <ws-form-item label="发货人" span="1" prop="sender" class="readonly">{{ deptBudgetList.sender }}</ws-form-item>
  31. <!--发货人电话-->
  32. <ws-form-item label="发货人电话" span="1" prop="senderPhone" class="readonly">{{ deptBudgetList.senderPhone }}
  33. </ws-form-item>
  34. <!--收货地址-->
  35. <ws-form-item label="收货地址" span="1" prop="receiveDetailedAddress">
  36. {{ deptBudgetList.receivePrivate }}{{ deptBudgetList.receiveCity
  37. }}{{ deptBudgetList.receiveArea }}
  38. </ws-form-item>
  39. <!--收货人-->
  40. <ws-form-item label="收货人" span="1" prop="receiver">{{ deptBudgetList.receiver }}</ws-form-item>
  41. <!--收货人电话-->
  42. <ws-form-item label="收货人电话" span="1" prop="receiverPhone">{{ deptBudgetList.receiverPhone }}</ws-form-item>
  43. <!--发货日期-->
  44. <ws-form-item label="发货日期" span="1" prop="deliveryDateStart">{{ deptBudgetList.deliveryDateStart }}
  45. </ws-form-item>
  46. <!--最晚到货日期-->
  47. <ws-form-item label="最晚到货日期" span="1" prop="deliveryDateEnd">{{ deptBudgetList.deliveryDateEnd }}</ws-form-item>
  48. <!--合同编号-->
  49. <ws-form-item label="合同编号" span="1" prop="contractNo">{{ deptBudgetList.contractNo }}</ws-form-item>
  50. <!-- 运输方式 -->
  51. <ws-form-item label="运输方式" span="1" prop="tranType">{{ deptBudgetList.tranType }}</ws-form-item>
  52. </ws-info-table>
  53. <div class="small-title" style="font-size: 16px">联络员及车次</div>
  54. <div class="lianluoyuan">
  55. <ws-info-table>
  56. <!--姓名-->
  57. <ws-form-item label="姓名:" span="1" prop="driver">
  58. <span>{{ deptBudgetList.driver }}</span>
  59. </ws-form-item>
  60. <!--电话-->
  61. <ws-form-item label="电话:" span="1" prop="driverPhone">
  62. <span>{{ deptBudgetList.driverPhone }}</span>
  63. </ws-form-item>
  64. <!--发车日期-->
  65. <el-form-item label="发车日期:" span="1" prop="sendDateStart">
  66. <ws-date-picker v-model="deptBudgetList.sendDateStart" type="date" style="width: 150px" placeholder="请选择日期"
  67. value-format="yyyy-MM-dd" />
  68. </el-form-item>
  69. <!--预计到站日期-->
  70. <ws-form-item label="预计到站日期:" span="1" prop="receiveDateEnd">
  71. <span>{{ deptBudgetList.receiveDateEnd }}</span>
  72. </ws-form-item>
  73. <!--车型-->
  74. <ws-form-item label="车型:" span="1" prop="caeModel">
  75. <span>{{ deptBudgetList.carModel }}</span>
  76. </ws-form-item>
  77. </ws-info-table>
  78. </div>
  79. <div class="small-title" style="font-size: 16px">装车详情</div>
  80. <!-- 导入 -->
  81. <div style="font-size: 16px; width: 100%; text-align: right;display:flex;justify-content:end;">
  82. <el-link
  83. href="https://taohaoliang.oss-cn-beijing.aliyuncs.com/pcfiles/%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF/%E7%81%AB%E8%BF%90%E8%A3%85%E8%BD%A6%E5%8F%8D%E9%A6%88%E6%A8%A1%E6%9D%BF.xlsx"
  84. style="margin-left: 8px;">
  85. <el-button type="primary">模板下载</el-button>
  86. </el-link>
  87. <el-upload style="margin-left: 8px;" class="upload-demo inline-block margin-right-10" action
  88. :on-change="handleChange" :show-file-list="false"
  89. accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  90. :auto-upload="false">
  91. <el-button type="primary">导入</el-button>
  92. </el-upload>
  93. </div>
  94. <div class="liaison" v-if="file_is_show">
  95. <div style="width: 100%" class="flex position" v-for="(item, index) in freightspace" :key="index">
  96. <ws-info-table>
  97. <!--车厢号-->
  98. <div class="catNos">车厢-{{ index + 1 }}</div>
  99. <ws-form-item label="车厢号:" span="1" prop="boxNo">
  100. <span>{{ item.boxNo }}</span>
  101. </ws-form-item>
  102. <!--装车净重-->
  103. <ws-form-item label="装车净重:" span="1" prop="loadNetWeight">
  104. <ws-input v-if="item.status == '已装车' || item.status == '已送达'" :disabled="readonly"
  105. v-model="item.loadNetWeight" placeholder="请输入装车净重" maxlength="20" size="small" />
  106. <ws-input v-else v-model="item.loadNetWeight" placeholder="请输入装车净重" maxlength="20" size="small" />
  107. </ws-form-item>
  108. <!--磅单-->
  109. <ws-form-item label="磅单:" span="1" prop="loadPoundImg">
  110. <template slot-scope="scope">
  111. <!-- slot-scope="scope" -->
  112. <el-upload :action="global.uploadPath" :show-file-list="false" :on-success="
  113. (res) => {
  114. uploadSuccessHandle1(res, index)
  115. }
  116. " class="avatar-uploader" accept=".jpg, .jpeg, .png, .gif">
  117. <img width="18" height="20" style="vertical-align: text-top; position: relative"
  118. src="../../../public/img/fujian.png" alt />
  119. </el-upload>
  120. <span v-if="item.imgCount > 0">{{item.imgCount}}</span>
  121. <span v-if="item.imgCount == 0">未上传</span>
  122. <el-button v-if="item.imgCount>0" class="bg-bottom-preview" type="primary" size="small" :data-img="item.loadPoundImg" @click="$imgPreview">预览</el-button>
  123. </template>
  124. </ws-form-item>
  125. <!--箱号-->
  126. <!--装车日期-->
  127. <el-form-item label="装车日期:" span="1" prop="loadingDate">
  128. <ws-date-picker v-if="item.status == '已装车' || item.status == '已送达'" :disabled="readonly"
  129. v-model="item.loadingDate" type="date" style="width: 150px" placeholder="请选择日期"
  130. value-format="yyyy-MM-dd" />
  131. <ws-date-picker v-else v-model="item.loadingDate" type="date" style="width: 150px" placeholder="请选择日期"
  132. value-format="yyyy-MM-dd" />
  133. </el-form-item>
  134. <!-- 提交 -->
  135. <span class="servicein" v-show="item.status == '已装车' || item.status == '已送达'">已装车</span>
  136. <span style="text-align: right;" class="noservicein" v-if="
  137. item.status == '' ||
  138. item.status == null ||
  139. item.status == '未装车'
  140. ">
  141. <!-- <div>
  142. <el-button class="bg-bottom" type="primary" size="small" @click="submit(index)">提交</el-button>
  143. </div> -->
  144. 未装车
  145. </span>
  146. <!-- <div
  147. v-show="
  148. item.temporaryDriverFlag == 0 && item.signStatus == '未签合同'
  149. "
  150. class="signStatus"
  151. >
  152. {{ item.signStatus }}
  153. </div>
  154. <div
  155. v-show="
  156. item.temporaryDriverFlag == 0 && item.signStatus == '已签合同'
  157. "
  158. class="signStatus1"
  159. >
  160. {{ item.signStatus }}
  161. </div>-->
  162. <span v-show="item.temporaryDriverFlag != 0" width="22" height="22" class="del" @click="del(index)"
  163. src="../../../public/img/del.png" alt>×</span>
  164. </ws-info-table>
  165. </div>
  166. </div>
  167. <div style="text-align: right; color: #8890b1; font-size: 16px">
  168. 合计(吨):{{ total }}/{{ deptBudgetList.weight }}
  169. <!--阶段状态-->
  170. <span class="noservice" v-show="deptBudgetList.feedbackStatus=='执行中'">未完货</span>
  171. <span class="service" v-show="deptBudgetList.feedbackStatus=='已完货'">
  172. {{
  173. deptBudgetList.feedbackStatus
  174. }}
  175. </span>
  176. </div>
  177. <!-- <el-button class="add bg-bottom" type="primary" size="small" @click="add">
  178. <img width="22" height="22" src="../../../public/img/add.png" alt="" />
  179. <div class="spans">添加临时用车</div></el-button
  180. >-->
  181. </ws-form>
  182. <!-- 完货 -->
  183. <div style="text-align: right; padding: 10px" class="wanhuo">
  184. <el-button class="bg-bottom" type="primary" size="small" @click="submit(index)">提交</el-button>
  185. <el-button class="bg-bottom" type="primary" size="small" @click="finished(deptBudgetList)">完货</el-button>
  186. </div>
  187. </div>
  188. </template>
  189. <script>
  190. import {
  191. regionData
  192. } from 'element-china-area-data'
  193. import {
  194. seeCat,
  195. feedback,
  196. state
  197. } from '@/model/transport/index'
  198. import WsUpload from '@/components/WsUpload'
  199. import mapDrag from '@/components/mapdrag/mapdrag'
  200. export default {
  201. name: 'viewSpareMoney',
  202. components: {
  203. WsUpload,
  204. mapDrag
  205. },
  206. watch: {
  207. vesselId(val) {
  208. this.getVesselData()
  209. },
  210. isShow(val) {
  211. this.showType = val
  212. },
  213. freightspace(newVal) {
  214. this.file_is_show = false
  215. if (true) {
  216. this.$nextTick(() => { // $nextTick 是在 DOM 更新循环结束之后执行延迟回调
  217. this.file_is_show = true
  218. })
  219. }
  220. }
  221. },
  222. data() {
  223. return {
  224. excelFreightspace: [],
  225. index: 0,
  226. file_is_show: true,
  227. deptBudgetList: {
  228. totalStorage: 0
  229. },
  230. options_: regionData,
  231. heightData: '600px',
  232. zoom: 7,
  233. selectedOptions: [],
  234. center: [116.244694, 39.517344],
  235. window: '',
  236. radio: 1,
  237. personCharge: [],
  238. district: null,
  239. driverList: [],
  240. readonly: true,
  241. listDate: {
  242. country: '中国',
  243. level: 'country',
  244. city: ''
  245. },
  246. citylist: [],
  247. compId: localStorage.getItem('ws-pf_compId'),
  248. rules: {
  249. warehouseName: [{
  250. required: true,
  251. message: '请输入仓库名称',
  252. trigger: 'blur'
  253. },
  254. {
  255. min: 2,
  256. max: 20,
  257. message: '仓库名长度不符合要求,请输入2-20字符之内',
  258. trigger: 'blur'
  259. }
  260. ]
  261. },
  262. tranType: 2,
  263. size: 10,
  264. value1: '',
  265. unitList: [],
  266. freightspace1: [{
  267. accountTypeFlag: '1',
  268. payeeName: '',
  269. payeeNumberCard: '',
  270. compName: '',
  271. bankDeposit: '',
  272. addressUrlArray: [],
  273. bankCard: ''
  274. }],
  275. freightspace: [{
  276. boxNo: '',
  277. loadNetWeight: '',
  278. loadPoundImg: '',
  279. loadingDate: '',
  280. imgCount: 0
  281. }
  282. // {loadPoundImg:{}},
  283. ],
  284. name: '',
  285. staffList: [],
  286. options: [],
  287. carModel: [],
  288. fileTemp: {},
  289. tranCarInfoList: {
  290. loadPoundImg: ''
  291. },
  292. // tranCarList: {
  293. // driver: '',
  294. // driverPhone:'',
  295. // sendDateStart:'',
  296. // receiveDateEnd:'',
  297. // carModel:'',
  298. // },
  299. //上传
  300. accessoryTFs: false,
  301. fileList: [],
  302. appendixIdsAdd: '',
  303. }
  304. },
  305. activated() {
  306. this.deptBudgetList.id = this.$route.query.id
  307. this.getList()
  308. },
  309. computed: {
  310. totalStorage: function() {
  311. var maxStorage = 0
  312. for (var i = 0; i < this.freightspace.length; i++) {
  313. maxStorage += Number(this.freightspace[i].maxStorage)
  314. }
  315. return maxStorage.toFixed(2)
  316. },
  317. total: function() {
  318. if (this.deptBudgetList.tranCarInfoList != null) {
  319. var maxStorage = 0
  320. for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
  321. maxStorage += Number(
  322. this.deptBudgetList.tranCarInfoList[i].loadNetWeight
  323. )
  324. }
  325. return maxStorage.toFixed(2)
  326. } else {
  327. return 0
  328. }
  329. }
  330. },
  331. methods: {
  332. handleChange(file, fileList) {
  333. this.fileTemp = file.raw
  334. let fileName = file.raw.name
  335. let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
  336. // 判断上传文件格式
  337. if (this.fileTemp) {
  338. if (fileType == 'xlsx' || fileType == 'xls') {
  339. this.importf(this.fileTemp)
  340. } else {
  341. this.$message({
  342. type: 'warning',
  343. message: '附件格式错误,请删除后重新上传!'
  344. })
  345. }
  346. } else {
  347. this.$message({
  348. type: 'warning',
  349. message: '请上传附件!'
  350. })
  351. }
  352. },
  353. importf(obj) {
  354. this.excelFreightspace = []
  355. this.dialogVisible = true
  356. let _this = this
  357. let inputDOM = this.$refs.inputer // 通过DOM取文件数据
  358. this.file = event.currentTarget.files[0]
  359. var rABS = false //是否将文件读取为二进制字符串
  360. var f = this.file
  361. var reader = new FileReader()
  362. //if (!FileReader.prototype.readAsBinaryString) {
  363. FileReader.prototype.readAsBinaryString = function(f) {
  364. var binary = ''
  365. var rABS = false //是否将文件读取为二进制字符串
  366. var pt = this
  367. var wb //读取完成的数据
  368. var outdata
  369. var reader = new FileReader()
  370. reader.onload = function(e) {
  371. var bytes = new Uint8Array(reader.result)
  372. var length = bytes.byteLength
  373. for (var i = 0; i < length; i++) {
  374. binary += String.fromCharCode(bytes[i])
  375. }
  376. var XLSX = require('xlsx')
  377. if (rABS) {
  378. wb = XLSX.read(btoa(fixdata(binary)), {
  379. //手动转化
  380. type: 'base64'
  381. })
  382. } else {
  383. wb = XLSX.read(binary, {
  384. type: 'binary'
  385. })
  386. }
  387. // outdata就是你想要的东西 excel导入的数据
  388. outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
  389. // excel 数据再处理
  390. let arr = []
  391. outdata.map(v => {
  392. // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
  393. let jsonString = JSON.stringify(v)
  394. .replace(/\//g, '')
  395. .replace(/\s/gi, '')
  396. console.log(jsonString)
  397. v = JSON.parse(jsonString)
  398. let obj = {}
  399. //xxx代表列名
  400. obj.boxNo = v.车厢号
  401. obj.loadNetWeight = v.装车净重
  402. obj.loadingDate = v.装车日期
  403. obj.status = v.状态
  404. obj.loadPoundImg = v.磅单
  405. console.log(obj)
  406. _this.excelFreightspace.push(obj)
  407. })
  408. let _ispushData = true
  409. console.log(arr, _this.freightspace)
  410. for (let i = 0; i < _this.excelFreightspace.length; i++) {
  411. _ispushData = true
  412. for (let k = 0; k < _this.freightspace.length; k++) {
  413. if (_this.excelFreightspace[i].boxNo == _this.freightspace[k].boxNo) {
  414. _this.freightspace[k] = _this.excelFreightspace[i]
  415. if (_this.excelFreightspace[i].loadPoundImg.split(',').length > 0){
  416. _this.freightspace[k].imgCount = _this.excelFreightspace[i].loadPoundImg.split(',').length
  417. }
  418. _ispushData = false
  419. }
  420. }
  421. if (_ispushData) {
  422. if (_this.excelFreightspace[i].loadPoundImg.split(',').length > 0) {
  423. _this.excelFreightspace[i].imgCount = _this.excelFreightspace[i].loadPoundImg.split(',').length
  424. }
  425. _this.freightspace.push(_this.excelFreightspace[i])
  426. _ispushData = true
  427. }
  428. }
  429. _this.$forceUpdate();
  430. }
  431. reader.readAsArrayBuffer(f)
  432. }
  433. if (rABS) {
  434. reader.readAsArrayBuffer(f)
  435. } else {
  436. reader.readAsBinaryString(f)
  437. }
  438. console.log(reader)
  439. },
  440. marker: function(item) {
  441. this.deptBudgetList.warehousePositioning =
  442. item.lnglat.lat + ',' + item.lnglat.lng
  443. },
  444. // 关闭 dialog时 处理文件url 初始化upload组件
  445. handleClose() {
  446. this.dialogViewSpareMoney = false
  447. },
  448. add() {
  449. this.freightspace.push({
  450. driver: '',
  451. driverPhone: '',
  452. carNo: '',
  453. loadNetWeight: ''
  454. })
  455. },
  456. del(index) {
  457. if (this.freightspace.length > 1) {
  458. this.freightspace.splice(index, 1)
  459. }
  460. },
  461. revert() {
  462. this.$router.push({
  463. path: 'tranManagementTransporHairRespond'
  464. })
  465. },
  466. //完货
  467. finished() {
  468. this.$confirm(`完货操作后,装车信息不可修改,是否确定完货?`, {
  469. confirmButtonText: '确定',
  470. cancelButtonText: '取消',
  471. type: 'warning'
  472. })
  473. .then(() => {
  474. this.$refs.deptBudgetList.validate(valid => {
  475. if (valid) {
  476. var tranProcessInfo = {}
  477. tranProcessInfo.id = this.deptBudgetList.id
  478. state(tranProcessInfo)
  479. .toPromise()
  480. .then(response => {
  481. this.$message.success('完货成功')
  482. this.deptBudgetList = {}
  483. this.freightspace = {}
  484. this.selectedOptions = ''
  485. this.$router.push({
  486. path: 'tranManagementTransporHairRespond'
  487. })
  488. })
  489. } else {
  490. return false
  491. }
  492. })
  493. })
  494. .catch(() => {
  495. return false
  496. })
  497. },
  498. validateFunc() {
  499. this.$refs.deptBudgetList.validate(valid => {
  500. if (valid) {
  501. console.log(this.freightspace,"数组")
  502. // this.deptBudgetList.totalStorage = this.totalStorage
  503. // this.tranCarInfoList = this.freightspace
  504. // this.tranCarInfoList.driver = this.deptBudgetList.driver
  505. // this.tranCarInfoList.driverPhone = this.deptBudgetList.driverPhone
  506. // this.tranCarInfoList.tranCarNo = this.deptBudgetList.tranCarNo
  507. // this.tranCarInfoList.carNo = this.deptBudgetList.carNo
  508. // this.tranCarInfoList[0].sendDateStart = this.deptBudgetList.sendDateStart
  509. // this.tranCarInfoList.loadNetWeight = this.deptBudgetList.loadNetWeight
  510. // this.tranCarInfoList.tranType = this.tranType
  511. // this.tranCarInfoList.loadPoundImg = this.deptBudgetList.loadPoundImg
  512. // this.tranCarInfoList.boxNo = this.arr.toString()
  513. // for (var i = 0; i < this.tranCarInfoList.length; i++) {
  514. // this.tranCarInfoList[i].id = this.freightspace[i].id
  515. // if (this.tranCarInfoList[i].temporaryDriverFlag != 0) {
  516. // this.tranCarInfoList[i].temporaryDriverFlag = 1
  517. // this.tranCarInfoList[i].tranType = this.tranType
  518. // }
  519. // }
  520. // var tranProcessInfo = {}
  521. // tranProcessInfo.id = this.deptBudgetList.id
  522. // tranProcessInfo.infoId = this.deptBudgetList.infoId
  523. // tranProcessInfo.processNo = this.deptBudgetList.processNo
  524. // tranProcessInfo.tranPrice = this.deptBudgetList.tranPrice
  525. // tranProcessInfo.tranCarInfoList = this.tranCarInfoList
  526. // dispatchCat({tranCarInfo:{tranCarInfoList:[this.tranCarInfoList],id:this.deptBudgetList.id}
  527. let tranCar = {}
  528. tranCar.infoId = this.deptBudgetList.infoId
  529. tranCar.id = this.deptBudgetList.id
  530. tranCar.infoId = this.deptBudgetList.infoId
  531. tranCar.processNo = this.deptBudgetList.processNo
  532. tranCar.tranPrice = this.deptBudgetList.tranPrice
  533. tranCar.tranCarInfoList = this.freightspace
  534. feedback(tranCar)
  535. .toPromise()
  536. .then(response => {
  537. this.$message.success('提交成功')
  538. this.deptBudgetList = {}
  539. this.freightspace = {}
  540. this.selectedOptions = ''
  541. this.$router.push({
  542. path: 'tranManagementTransporHairRespond'
  543. })
  544. })
  545. } else {
  546. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  547. return false
  548. }
  549. })
  550. },
  551. submit(index) {
  552. for (var i = 0; i < this.freightspace.length; i++) {
  553. // if (!this.freightspace[i].driver) {
  554. // this.$message({
  555. // message: '司机姓名不能为空!',
  556. // type: 'warning'
  557. // })
  558. // return
  559. // }
  560. // if (!this.freightspace[i].driverPhone) {
  561. // this.$message({
  562. // message: '司机电话不能为空!',
  563. // type: 'warning'
  564. // })
  565. // return
  566. // }
  567. // if (!this.freightspace[i].carNo) {
  568. // this.$message({
  569. // message: '车牌号不能为空!',
  570. // type: 'warning'
  571. // })
  572. // return
  573. // }
  574. if (!this.freightspace[i].loadNetWeight) {
  575. this.$message({
  576. message: '装车净重不能为空!',
  577. type: 'warning'
  578. })
  579. return
  580. }
  581. if (
  582. this.freightspace[i].loadNetWeight < 0 ||
  583. this.freightspace[i].loadNetWeight > 10000
  584. ) {
  585. this.$message({
  586. message: '装车净重输入错误!',
  587. type: 'warning'
  588. })
  589. return
  590. }
  591. if (!this.freightspace[i].loadingDate) {
  592. this.$message({
  593. message: '装车日期不能为空!',
  594. type: 'warning'
  595. })
  596. return
  597. }
  598. }
  599. // if (!this.freightspace[index].loadNetWeight) {
  600. // this.$message({
  601. // message: '装车净重不能为空!',
  602. // type: 'warning'
  603. // })
  604. // return
  605. // }
  606. // if (
  607. // this.freightspace[index].loadNetWeight < 0 ||
  608. // this.freightspace[index].loadNetWeight > 10000
  609. // ) {
  610. // this.$message({
  611. // message: '装车净重输入错误!',
  612. // type: 'warning'
  613. // })
  614. // return
  615. // }
  616. // if (!this.freightspace[index].loadingDate) {
  617. // this.$message({
  618. // message: '装车日期不能为空!',
  619. // type: 'warning'
  620. // })
  621. // return
  622. // }
  623. // }
  624. if (localStorage.getItem('sh-msg')) {
  625. this.validateFunc()
  626. } else {
  627. this.$alert(
  628. '<div><strong>提交成功后提醒司机及时签订运输合同,确定提交装车信息?</strong><div style="display:flex;align-items: center;"><input id="noMsg" type="checkbox" onclick="window.noMessege(1)"><span style="margin-left:10px">不在提示</span><div></div>',
  629. '', {
  630. dangerouslyUseHTMLString: true,
  631. distinguishCancelAndClose: true,
  632. showCancelButton: true,
  633. confirmButtonText: '确定',
  634. cancelButtonText: '取消'
  635. }
  636. )
  637. .then(() => {
  638. this.validateFunc()
  639. })
  640. .catch(() => {
  641. return false
  642. })
  643. }
  644. },
  645. getList() {
  646. seeCat({
  647. id: this.deptBudgetList.id
  648. })
  649. .toPromise()
  650. .then(response => {
  651. this.deptBudgetList = response
  652. // this.deptBudgetList.tranCarInfoList = response.tranCarInfoList
  653. if (response.tranCarInfoList[0].driver) {
  654. this.deptBudgetList.driver = response.tranCarInfoList[0].driver
  655. }
  656. this.deptBudgetList.driverPhone =
  657. response.tranCarInfoList[0].driverPhone
  658. this.$set(this.deptBudgetList, 'sendDateStart', response.tranCarInfoList[0].sendDateStart)
  659. this.deptBudgetList.receiveDateEnd =
  660. response.tranCarInfoList[0].receiveDateEnd
  661. this.deptBudgetList.carModel = response.tranCarInfoList[0].carModel
  662. this.freightspace = response.tranCarInfoList
  663. for (var i = 0; i < this.freightspace.length; i++) {
  664. if (!this.freightspace[i].loadNetWeight) {
  665. this.freightspace[i].loadNetWeight = 0
  666. }
  667. if (this.freightspace[i].loadPoundImg) {
  668. this.freightspace[i].imgCount = this.freightspace[i].loadPoundImg.split(",").length
  669. } else {
  670. this.freightspace[i].loadPoundImg = ""
  671. this.freightspace[i].imgCount = 0
  672. }
  673. }
  674. })
  675. },
  676. uploadSuccessHandle1(e, index) {
  677. this.index = index
  678. let that = this;
  679. that.$forceUpdate();
  680. that.freightspace[that.index].imgCount++
  681. if(that.freightspace[that.index].loadPoundImg){
  682. that.freightspace[that.index].loadPoundImg += "," + e.data.url
  683. }else{
  684. that.freightspace[that.index].loadPoundImg += e.data.url
  685. }
  686. }
  687. }
  688. }
  689. </script>
  690. <style lang="scss" scoped>
  691. /deep/.totalStorage .el-input__inner {
  692. color: #afb5cb;
  693. background: #f5f7fa;
  694. }
  695. .small-title {
  696. position: relative;
  697. padding: 10px;
  698. font-weight: 600;
  699. }
  700. .small-title::before {
  701. position: absolute;
  702. content: '';
  703. display: block;
  704. background: #5473e8;
  705. width: 4px;
  706. height: 14px;
  707. left: 0px;
  708. top: 13px;
  709. }
  710. .position {
  711. position: relative;
  712. }
  713. .del {
  714. position: absolute;
  715. right: -38px;
  716. top: 14px;
  717. cursor: pointer;
  718. right: 0;
  719. display: inline-block;
  720. font-size: 26px;
  721. width: 26px;
  722. height: 10px;
  723. line-height: 0px;
  724. }
  725. .amap-page-container {
  726. width: 300px;
  727. height: 300px;
  728. }
  729. .el-form {
  730. padding: 0 10%;
  731. }
  732. /deep/.ws-info-table .el-form-item {
  733. border-right: 1px solid transparent;
  734. border-bottom: 1px solid transparent;
  735. }
  736. .readonly {
  737. position: relative;
  738. }
  739. .readonly:after {
  740. content: '*';
  741. color: #ff2727;
  742. position: absolute;
  743. right: 8px;
  744. z-index: 10;
  745. top: 21%;
  746. font-size: 20px;
  747. }
  748. .title {
  749. position: relative;
  750. }
  751. .title::before {
  752. content: '';
  753. display: inline-block;
  754. width: 5px;
  755. height: 30px;
  756. background: #5473e8;
  757. position: absolute;
  758. left: 0;
  759. }
  760. .el-button--primary {
  761. background-color: #5878e8;
  762. border-color: #5878e8;
  763. }
  764. .el-col {
  765. background: #f6f7fc;
  766. }
  767. /deep/.ws-info-table .el-form-item .el-form-item__content {
  768. padding: 0 25px;
  769. border-left: 1px solid transparent;
  770. background: #fff;
  771. }
  772. /deep/.ws-info-table .el-form-item .el-form-item__label {
  773. width: 100px;
  774. text-align: center;
  775. background: #fff;
  776. // border: 1px solid #cdd2dc;
  777. }
  778. .button-container {
  779. display: flex;
  780. flex-wrap: nowrap;
  781. justify-content: space-between;
  782. align-items: center;
  783. background-color: #fff;
  784. width: 100%;
  785. height: 50px;
  786. padding: 0 10px;
  787. &>div {
  788. margin-left: 10px;
  789. display: flex;
  790. flex-wrap: nowrap;
  791. flex-direction: row;
  792. &>span {
  793. line-height: 50px;
  794. }
  795. }
  796. /deep/.auditFlow-box {
  797. position: unset;
  798. margin-left: 10px;
  799. &/deep/.auditFlow-icon {
  800. width: auto;
  801. padding-right: 30px;
  802. }
  803. &/deep/.auditFlow-main {
  804. position: absolute;
  805. }
  806. }
  807. }
  808. .box-app {
  809. display: inline-block;
  810. float: left;
  811. margin-left: 30px;
  812. line-height: 50px;
  813. }
  814. /deep/.el-dialog {
  815. .el-form-item {
  816. margin-bottom: 0 !important;
  817. .el-input--medium {
  818. textarea {
  819. min-height: 100px !important;
  820. }
  821. }
  822. }
  823. }
  824. .collapse-bottom {
  825. margin-bottom: 20px;
  826. }
  827. .input-main .textarea .el-textarea__inner {
  828. width: 100%;
  829. z-index: 1;
  830. }
  831. .bg-left {
  832. padding-left: 30px;
  833. }
  834. .bg-right {
  835. padding-right: 10px;
  836. text-align: right;
  837. }
  838. .bg-bottom {
  839. margin: 15px 0px;
  840. }
  841. .wenzi {
  842. width: 900px;
  843. margin: 0 auto;
  844. }
  845. .wenzi h3 {
  846. display: inline-block;
  847. left: 10px;
  848. }
  849. .wenzi p {
  850. display: inline-block;
  851. }
  852. // .center {
  853. // width: 900px;
  854. // margin: -70px auto;
  855. // margin-right: 92px;
  856. // }
  857. .wanhuo {
  858. width: 900px;
  859. margin: 0 auto;
  860. }
  861. .el-form-item {
  862. width: 50%;
  863. }
  864. .el-form-item__label {
  865. text-align: center;
  866. }
  867. .ce {
  868. width: 900px;
  869. margin: 0 auto;
  870. }
  871. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  872. /* height: 82px;*/
  873. /*}*/
  874. // 控制select为只读的时候显示样式
  875. .hide-sel {
  876. .el-input__inner {
  877. border: 0px;
  878. }
  879. .el-icon-arrow-up {
  880. display: none;
  881. }
  882. .el-textarea__inner {
  883. background-color: #fff !important;
  884. border: 0;
  885. }
  886. .el-date-editor {
  887. i {
  888. display: none;
  889. }
  890. }
  891. // .is-disabled {
  892. // .el-input__inner:hover {
  893. // background-color: #fff !important;
  894. // border: 0;
  895. // }
  896. // color: #606266;
  897. // .el-input__inner {
  898. // background-color: #fff !important;
  899. // border: 0;
  900. // color: #606266;
  901. // }
  902. // .el-textarea__inner {
  903. // background-color: #fff !important;
  904. // border: 0;
  905. // color: #606266;
  906. // }
  907. // }
  908. }
  909. // 控制select为只读的时候显示样式
  910. /deep/.ws-class-table-col {
  911. height: auto;
  912. padding: 0px 2px;
  913. /deep/.el-input__inner {
  914. padding: 0px 2px;
  915. }
  916. }
  917. // /deep/.is-disabled {
  918. // .el-input__prefix,
  919. // .el-input__suffix {
  920. // display: none;
  921. // }
  922. // .el-input__inner {
  923. // background-color: #fff;
  924. // border-color: #fff !important;
  925. // color: #000 !important;
  926. // font-size: 14px;
  927. // cursor: text;
  928. // padding: 0 !important;
  929. // }
  930. // }
  931. .winseaview-view {
  932. padding: 0 0 20px;
  933. }
  934. .container {
  935. overflow: scroll;
  936. height: 93vh;
  937. }
  938. .ws-info-table .el-form-item {
  939. width: 33.3333%;
  940. }
  941. .readonly:after {
  942. display: none;
  943. }
  944. .el-textarea__inner {
  945. display: none;
  946. }
  947. .el-form {
  948. margin-top: 50px;
  949. }
  950. .readonly {
  951. width: 16%;
  952. }
  953. //去边框
  954. /deep/.el-form-item {
  955. border-right: 0px;
  956. border-bottom: 0px;
  957. }
  958. /deep/.ws-info-table {
  959. border-left: 0px;
  960. border-top: 0px;
  961. }
  962. .ws-info-table .el-form-item .el-form-item__content {
  963. border: none;
  964. }
  965. /deep/.ws-info-table .el-form-item {
  966. border: none;
  967. height: 50px;
  968. }
  969. /deep/.ws-info-table .el-form-item .el-form-item__content {
  970. background: #f5f7fa;
  971. border-radius: 4px;
  972. border: 1px solid #d8dce6;
  973. font-family: PingFangSC-Regular, PingFang SC;
  974. margin-bottom: 5px;
  975. background-color: #fff;
  976. font-size: 14px;
  977. font-weight: 400;
  978. color: #8890b1;
  979. line-height: 16px;
  980. }
  981. /deep/.ws-info-table .el-form-item .el-form-item__label {
  982. background-color: #fff;
  983. font-size: 13px;
  984. font-family: PingFangSC-Regular, PingFang SC;
  985. font-weight: 400;
  986. color: #8890b1;
  987. line-height: 16px;
  988. }
  989. /deep/.ws-info-table .el-form-item .el-form-item__content {
  990. background: #f5f7fa;
  991. border-radius: 4px;
  992. border: 1px solid #d8dce6;
  993. }
  994. /deep/.flex .ws-info-table .el-form-item .el-form-item__content {
  995. border: 0px;
  996. }
  997. .catNos {
  998. width: 5%;
  999. height: 30px;
  1000. margin-top: 10px;
  1001. margin-left: 20px;
  1002. margin-right: -5px;
  1003. font-size: 14px;
  1004. }
  1005. .catNosCor {
  1006. color: #5473e8;
  1007. }
  1008. .add {
  1009. width: 130px;
  1010. height: 34px;
  1011. background: #f6f7fb;
  1012. border-radius: 17px;
  1013. color: #5473e8;
  1014. font-size: 14px;
  1015. border: none;
  1016. }
  1017. .add img {
  1018. display: inline-block;
  1019. margin-top: 3px;
  1020. margin-left: -30px;
  1021. }
  1022. .add .spans {
  1023. display: table-caption;
  1024. width: 56px;
  1025. height: 20px;
  1026. line-height: 18px;
  1027. }
  1028. .signStatus {
  1029. height: 25px;
  1030. border-radius: 3px;
  1031. border: 1px solid #5473e8;
  1032. padding: 0 3px;
  1033. color: #ffffff;
  1034. background: #c4cada;
  1035. line-height: 24px;
  1036. margin-left: 18px;
  1037. }
  1038. .signStatus1 {
  1039. height: 25px;
  1040. background: #e6ebff;
  1041. border-radius: 3px;
  1042. border: 1px solid #5473e8;
  1043. padding: 0 3px;
  1044. margin-left: 18px;
  1045. color: #5473e8;
  1046. line-height: 24px;
  1047. }
  1048. .line {
  1049. height: 26px;
  1050. margin-top: 6px;
  1051. left: 2px;
  1052. }
  1053. //装车详情
  1054. /deep/.liaison .ws-info-table .el-form-item {
  1055. width: 20%;
  1056. }
  1057. /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
  1058. width: 50%;
  1059. background: #f6f7fc;
  1060. }
  1061. /deep/.liaison .flex {
  1062. display: contents;
  1063. }
  1064. /deep/.liaison .ws-info-table {
  1065. background: #f6f7fc;
  1066. border-radius: 4px;
  1067. border: 1px solid #d8dce6;
  1068. margin-top: 20px;
  1069. }
  1070. /deep/.liaison .ws-info-table .el-form-item .el-form-item__content {
  1071. padding: 0px;
  1072. }
  1073. //联络员及车次
  1074. /deep/.lianluoyuan .ws-info-table .el-form-item {
  1075. width: 20%;
  1076. }
  1077. /deep/.lianluoyuan .ws-info-table .el-form-item .el-form-item__label {
  1078. width: 43%;
  1079. background: #f6f7fc;
  1080. padding-right: 0px;
  1081. margin-top: 5px;
  1082. }
  1083. /deep/.lianluoyuan .flex {
  1084. display: contents;
  1085. }
  1086. /deep/.lianluoyuan .ws-info-table {
  1087. background: #f6f7fc;
  1088. border-radius: 4px;
  1089. border: 1px solid #d8dce6;
  1090. margin-top: 20px;
  1091. }
  1092. /deep/.lianluoyuan .ws-info-table .el-form-item .el-form-item__content {
  1093. padding: 0px;
  1094. margin-top: 5px;
  1095. }
  1096. //装车状态
  1097. .noservicein,
  1098. .servicein {
  1099. display: inline-block;
  1100. border-radius: 4px;
  1101. border: 1px solid #d8dce6;
  1102. padding: 2px;
  1103. font-size: 12px;
  1104. background: #e5f1f7;
  1105. color: #50cad4;
  1106. height: 23px;
  1107. margin-top: 11px;
  1108. margin-left: 53px;
  1109. }
  1110. .noservicein {
  1111. color: #ffffff;
  1112. // display: inline-block;
  1113. border: 1px solid #d8dce6;
  1114. padding: 2px;
  1115. font-size: 12px;
  1116. background: #C4CADA;
  1117. }
  1118. .servicedin {
  1119. display: inline-block;
  1120. border-radius: 4px;
  1121. border: 1px solid #d8dce6;
  1122. padding: 2px;
  1123. font-size: 12px;
  1124. background: #e5f1f7;
  1125. color: #50cad4;
  1126. height: 23px;
  1127. margin-top: 11px;
  1128. margin-left: 53px;
  1129. }
  1130. /deep/.el-input--suffix .el-input__inner {
  1131. padding-right: 0px !important;
  1132. }
  1133. //送达/未送达
  1134. .noservice,
  1135. .service {
  1136. display: inline-block;
  1137. border-radius: 4px;
  1138. border: 1px solid #d8dce6;
  1139. padding: 2px;
  1140. font-size: 12px;
  1141. }
  1142. .noservice {
  1143. background: #c4cada;
  1144. color: #ffffff;
  1145. }
  1146. .service {
  1147. background: #e5f1f7;
  1148. color: #50cad4;
  1149. }
  1150. .bg-bottom-preview{
  1151. margin: 0 8px;
  1152. }
  1153. </style>