index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <view>
  3. <view class="ordertop">
  4. <view>
  5. <view class="iconblue"></view>
  6. <text class="license">基础信息</text>
  7. </view>
  8. <view class="line">
  9. <u-line color="#ccc" border-style='dashed' />
  10. </view>
  11. <view class="basic">
  12. <view>货主</view>
  13. <view>{{form.corpName}}</view>
  14. </view>
  15. <view class="basic">
  16. <view>提单号</view>
  17. <view>{{form.fMblno}}</view>
  18. </view>
  19. <view class="basic">
  20. <view>箱型</view>
  21. <view>{{form.cntrtypes}}</view>
  22. </view>
  23. <view class="basic">
  24. <view>箱量</view>
  25. <view>{{form.cntqty}}</view>
  26. </view>
  27. <view class="basic">
  28. <view>箱号</view>
  29. <view>{{form.cntrno}}</view>
  30. </view>
  31. <!-- <view class="basic">
  32. <view>出库日期</view>
  33. <view>{{form.bsdate}}</view>
  34. </view> -->
  35. <view class="basic">
  36. <view>出库状态</view>
  37. <view>{{form.billstatus}}</view>
  38. </view>
  39. <view class="basic">
  40. <view>品名</view>
  41. <view>{{form.goodsName}}</view>
  42. </view>
  43. <view class="basic">
  44. <view>车号</view>
  45. <view>{{form.fTruckno}}</view>
  46. </view>
  47. <view class="basic">
  48. <view>司机</view>
  49. <view>{{form.fDriverName}}</view>
  50. </view>
  51. <view class="basic">
  52. <view>司机电话</view>
  53. <view>{{form.fDriverTel}}</view>
  54. </view>
  55. <view class="basic">
  56. <view>货物属性</view>
  57. <view>{{form.businessType}}</view>
  58. </view>
  59. <!-- <view class="basic">
  60. <view>货物名称</view>
  61. <view>{{form.fMarks}}</view>
  62. </view> -->
  63. <view class="basic">
  64. <view>属性详情</view>
  65. <view>{{form.marks}}</view>
  66. </view>
  67. <!-- <view class="basic">
  68. <view>库区</view>
  69. <view>{{form.fWarehouseInformation}}</view>
  70. </view> -->
  71. <view class="basic">
  72. <view>劳务公司</view>
  73. <view>{{form.labour}}</view>
  74. </view>
  75. </view>
  76. <view class="ordertop">
  77. <view>
  78. <view class="iconblue"></view>
  79. <text class="license">可编辑</text>
  80. </view>
  81. <view class="line">
  82. <u-line color="#ccc" border-style='dashed' />
  83. </view>
  84. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  85. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="件数:">
  86. <u-input type="digit" :clearable="false" v-model="form.fQty" />
  87. </u-form-item>
  88. </view>
  89. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  90. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="毛重:">
  91. <u-input type="digit" :clearable="false" v-model="form.fGrossweight" />
  92. </u-form-item>
  93. </view>
  94. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  95. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="净重:">
  96. <u-input type="digit" :clearable="false" v-model="form.fNetweight" />
  97. </u-form-item>
  98. </view>
  99. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  100. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="库区:">
  101. <u-select v-model="formation" mode="mutil-column-auto" :list="list" @confirm="mation"
  102. label-name="label" value-name="id" child-name="children"></u-select>
  103. <u-input type="type" :clearable="false" v-model="warehouseInformation" placeholder="请选择库区" disabled
  104. @click="formation = !formation" />
  105. </u-form-item>
  106. </view>
  107. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  108. <u-form-item style="width: 100%;" :border-bottom="false" label-width="160rpx" label="出库日期:">
  109. <u-calendar v-model="show_bsdate" mode="date" max-date="2050" @change="changeBsdate"></u-calendar>
  110. <u-input type="type" :clearable="false" v-model="form.bsdate" placeholder="请选择日期" disabled @click="show_bsdate = !show_bsdate"/>
  111. </u-form-item>
  112. </view>
  113. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  114. <u-form-item style="width: 100%;" :border-bottom="false" label-width="130rpx" label="装卸工:">
  115. <u-input type="type" :clearable="false" v-model="form.fStevedore" />
  116. </u-form-item>
  117. </view>
  118. <view class="basic" style="margin: 0 auto;">
  119. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="备注:">
  120. <u-input type="textarea" height="20rpx" :clearable="false" v-model="form.remark" />
  121. </u-form-item>
  122. </view>
  123. </view>
  124. <view class="ordertop" v-if="form.billstatus == '出库中'" style="margin-bottom: 60rpx;">
  125. <view>
  126. <view class="iconblue"></view>
  127. <text class="license">附件上传</text>
  128. <view class="various" @click="attachmentP">保存附件</view>
  129. </view>
  130. <view class="line">
  131. <u-line color="#ccc" border-style='dashed' />
  132. </view>
  133. <view style="width: 94%;margin: 0 auto;">
  134. <u-upload ref="uUpload" :deletable="false" @on-remove="onRemove" :action="action" :header="headers"
  135. @on-success="success" :file-list="fileList">
  136. </u-upload>
  137. </view>
  138. </view>
  139. <br>
  140. <view
  141. style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;">
  142. <u-button type="primary" @click="appCheckCode" v-if="entryPrinting != 0?form.billstatus == '出库中'||form.billstatus == '计划'||form.billstatus == '待出库':form.billstatus == '出库中'">出库确认</u-button>
  143. <u-button type="primary" @click="appCheckCode" v-else-if="entryPrinting == 0?form.billstatus == '计划'||form.billstatus == '待出库':false">叫车进场</u-button>
  144. </view>
  145. <u-modal v-model="submIt" @confirm="submit" :content="content" @cancel="submIt = false"
  146. :show-cancel-button="true" />
  147. <u-modal v-model="CheckStatus" @confirm="getForm" :content="content2" @cancel="CheckStatus = false"
  148. :show-cancel-button="true" />
  149. </view>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. urldata: "",
  156. CheckStatus: false,
  157. title: '', //标题
  158. formation: false,
  159. show_bsdate:false,
  160. list: [],
  161. action: this.$u.http.config.baseUrl + '/common/upload',
  162. // action: 'https://test.tms.tubaosoft.com/prod-api/common/upload',
  163. headers: {
  164. Authorization: 'Bearer ' + this.$store.state.vuex_token
  165. },
  166. warehouseInformation: '',
  167. content: '是否确认提交',
  168. content2: "数据发生变化,是否需要更新一下?",
  169. fileList: [],
  170. submIt: false,
  171. operationType: '',
  172. lists: [],
  173. warehouseBills: {},
  174. form: {
  175. mblno: '', //提单号
  176. carregNo: '', //车号
  177. transUserId: '', //调度员*
  178. driverUserId: '', //驾驶员*
  179. goodsId: '', //装货品名
  180. cntrQty: '', //调度数量
  181. ysl: '', //船名
  182. voy: '', //航次
  183. loadAddr: '', //提箱地点
  184. loadDate: '', //提箱时间
  185. loadAttntel: '', //提箱联系
  186. mdLoadAddr: '', //装卸地点
  187. mdLoadDate: '', //装卸时间
  188. mdLoadAttnTel: '', //装卸联系
  189. unLoadAddrL: '', //卸车地点
  190. unLadDate: '', //卸车时间
  191. unLoadAttnTel: '' //卸车联系
  192. },
  193. entryPrinting:1,
  194. }
  195. },
  196. onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
  197. this.$u.get('/system/config/configKey/entry.printing').then(res =>{
  198. // console.log(res)
  199. this.entryPrinting = res.msg
  200. })
  201. // console.log(option); //打印出上个页面传递的参数.
  202. let listi = {
  203. fId: JSON.parse(decodeURIComponent(option.item)).fId
  204. }
  205. this.$u.get('/warehouseBusiness/applets/appWarehouseItemDataById', listi).then(res => {
  206. // console.log(res)
  207. this.form = res.data.item
  208. this.warehouseInformation = this.form.warehouseInformation
  209. this.warehouseBills = res.data.warehouseBills
  210. this.form.fWarehouseInformation = res.data.item.warehouseInformation
  211. }).catch(err => {
  212. console.log(err)
  213. })
  214. for (let item in this.form.enclosure) {
  215. this.fileList.push({
  216. url: this.form.enclosure[item].fUrl,
  217. response: {
  218. fileName: this.form.enclosure[item].fName,
  219. url: this.form.enclosure[item].fUrl
  220. }
  221. })
  222. }
  223. for (let item in this.form.enclosure) {
  224. this.fileList.push({
  225. url: this.form.enclosure[item].fUrl,
  226. response: {
  227. fileName: this.form.enclosure[item].fName,
  228. url: this.form.enclosure[item].fUrl
  229. }
  230. })
  231. }
  232. console.log(this.fileList)
  233. uni.showLoading({
  234. title: '加载中'
  235. });
  236. setTimeout(function() {
  237. uni.hideLoading();
  238. }, 1000);
  239. },
  240. methods: {
  241. changeBsdate(e){
  242. this.form.bsdate = e.result
  243. },
  244. getForm() {
  245. this.$u.get('/warehouseBusiness/applets/appWarehouseItemDataById', {
  246. fId: this.form.fId
  247. }).then(res => {
  248. this.form = res.data.item
  249. this.warehouseInformation = this.form.warehouseInformation
  250. this.warehouseBills = res.data.warehouseBills
  251. }).catch(err => {
  252. console.log(err)
  253. })
  254. },
  255. appCheckCode() {
  256. if (this.form.fWarehouseInformation) {
  257. this.$u.get('/warehouseBusiness/applets/appCheckCode', {
  258. fId: this.warehouseBills.fId,
  259. fType: "warehouse",
  260. codeVal: this.warehouseBills.fDateChanged,
  261. }).then(res => {
  262. if (!res.data) {
  263. this.CheckStatus = true
  264. } else {
  265. this.submIt = true
  266. }
  267. }).catch(err => {
  268. uni.showToast({
  269. icon: 'none',
  270. title: '网络繁忙请稍后再试',
  271. position: "bottom"
  272. })
  273. })
  274. } else {
  275. uni.showToast({
  276. icon: 'none',
  277. title: '请选择库区',
  278. position: "bottom"
  279. })
  280. }
  281. },
  282. mation(e) {
  283. // console.log(e)
  284. let res = ''
  285. let id = ''
  286. for (let item in e) {
  287. id = e[item].value
  288. res += e[item].label + '/'
  289. }
  290. this.form.fWarehouseInformation = res.substr(0, res.length - 1)
  291. this.form.fWarehouselocid = id
  292. this.warehouseInformation = res.substr(0, res.length - 1)
  293. },
  294. receiving(id, i) {
  295. // 获取当前时间
  296. let date = new Date();
  297. let dateYear = date.getFullYear(); //获取年 
  298. let dateMonth = date.getMonth(); //获取月  
  299. let dateDate = date.getDate(); //获取当日
  300. uni.setNavigationBarTitle({
  301. title: this.title
  302. })
  303. this.$u.post('/fleet/ftmsorderbillscars/selectDriver', {
  304. id: id
  305. }).then(res => {
  306. console.log(res)
  307. this.form = res.data.cars
  308. switch (i) {
  309. case 1:
  310. this.form.acceptDate = dateYear + '-' + dateMonth + '-' + dateDate
  311. break
  312. case 3:
  313. this.form.loadDate = dateYear + '-' + dateMonth + '-' + dateDate
  314. break
  315. case 4:
  316. this.form.mdLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
  317. break
  318. case 5:
  319. this.form.unLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
  320. break
  321. default:
  322. uni.showToast({
  323. icon: 'none',
  324. title: '未知错误状态=' + i,
  325. position: "bottom"
  326. })
  327. break
  328. }
  329. if (this.form.acceptDate) {
  330. this.form.acceptDate = this.form.acceptDate.slice(0, 10)
  331. }
  332. if (this.form.loadDate) {
  333. this.form.loadDate = this.form.loadDate.slice(0, 10)
  334. }
  335. if (this.form.mdLoadDate) {
  336. this.form.mdLoadDate = this.form.mdLoadDate.slice(0, 10)
  337. }
  338. if (this.form.unLoadDate) {
  339. this.form.unLoadDate = this.form.unLoadDate.slice(0, 10)
  340. }
  341. }).catch(err => {
  342. uni.showToast({
  343. icon: 'none',
  344. title: '网络繁忙请稍后再试',
  345. position: "bottom"
  346. })
  347. })
  348. },
  349. success(data, index, lists, name) {
  350. // console.log(data)
  351. // console.log(index)
  352. // console.log(lists)
  353. // console.log(name)
  354. // console.log(this.fileList)
  355. },
  356. attachmentP() {
  357. this.lists = []
  358. console.log(this.fileList)
  359. console.log(this.$refs.uUpload.lists)
  360. let lists = this.$refs.uUpload.lists
  361. if (lists.length != 0) {
  362. for (let item in this.$refs.uUpload.lists) {
  363. console.log(this.$refs.uUpload.lists[item].response)
  364. if (this.$refs.uUpload.lists[item].response) {
  365. this.lists.push({
  366. fUrl: this.$refs.uUpload.lists[item].response.url,
  367. fName: this.$refs.uUpload.lists[item].response.fileName
  368. })
  369. }
  370. }
  371. }
  372. let fileList = []
  373. console.log(this.fileList)
  374. if (this.fileList.length != 0) {
  375. for (let item in this.fileList) {
  376. fileList.push({
  377. fUrl: this.fileList[item].response.url,
  378. fName: this.fileList[item].response.fileName
  379. })
  380. }
  381. }
  382. this.lists = this.lists.concat(fileList)
  383. console.log(this.lists)
  384. this.$u.post('/warehouseBusiness/applets/appSubmitWarehouse', {
  385. item: this.form,
  386. attachs: this.lists
  387. }).then(res => {
  388. console.log(res)
  389. if (res.data.code == 500) {
  390. if (res.data.msg == 'parseDecimal error, field : oilAmt') {
  391. uni.showToast({
  392. icon: 'none',
  393. title: '数字不正确,请检查后再提交',
  394. position: "bottom"
  395. })
  396. } else {
  397. uni.showToast({
  398. icon: 'none',
  399. title: res.data.msg,
  400. position: "bottom"
  401. })
  402. }
  403. } else if (res.data.code == 200) {
  404. // uni.navigateBack();
  405. uni.showToast({
  406. icon: 'none',
  407. title: '保存成功',
  408. position: "bottom"
  409. })
  410. }
  411. }).catch(err => {
  412. uni.showToast({
  413. icon: 'none',
  414. title: '网络繁忙请稍后再试',
  415. position: "bottom"
  416. })
  417. })
  418. },
  419. //提交
  420. submit() {
  421. if (this.form.billstatus == '出库中') {
  422. this.lists = []
  423. console.log(this.fileList)
  424. console.log(this.$refs.uUpload.lists)
  425. let lists = this.$refs.uUpload.lists
  426. if (lists.length != 0) {
  427. for (let item in this.$refs.uUpload.lists) {
  428. console.log(this.$refs.uUpload.lists[item].response)
  429. if (this.$refs.uUpload.lists[item].response) {
  430. this.lists.push({
  431. fUrl: this.$refs.uUpload.lists[item].response.url,
  432. fName: this.$refs.uUpload.lists[item].response.fileName
  433. })
  434. }
  435. }
  436. }
  437. let fileList = []
  438. console.log(this.fileList)
  439. if (this.fileList.length != 0) {
  440. for (let item in this.fileList) {
  441. fileList.push({
  442. fUrl: this.fileList[item].response.url,
  443. fName: this.fileList[item].response.fileName
  444. })
  445. }
  446. }
  447. this.lists = this.lists.concat(fileList)
  448. this.$u.post('/warehouseBusiness/applets/appOperationConfirmation', {
  449. item: this.form,
  450. attachs: this.lists
  451. }).then(res => {
  452. console.log(res)
  453. if (res.data.code == 500) {
  454. if (res.data.msg == 'parseDecimal error, field : oilAmt') {
  455. uni.showToast({
  456. icon: 'none',
  457. title: '数字不正确,请检查后再提交',
  458. position: "bottom"
  459. })
  460. } else {
  461. uni.showToast({
  462. icon: 'none',
  463. title: res.data.msg,
  464. position: "bottom"
  465. })
  466. }
  467. } else if (res.data.code == 200) {
  468. uni.navigateBack();
  469. }
  470. }).catch(err => {
  471. uni.showToast({
  472. icon: 'none',
  473. title: '网络繁忙请稍后再试',
  474. position: "bottom"
  475. })
  476. })
  477. } else {
  478. this.$u.post('/warehouseBusiness/applets/appWarehouseOperation', {
  479. item: this.form,
  480. attachs: []
  481. }).then(res => {
  482. console.log(res)
  483. if (res.data.code == 500) {
  484. if (res.data.msg == 'parseDecimal error, field : oilAmt') {
  485. uni.showToast({
  486. icon: 'none',
  487. title: '数字不正确,请检查后再提交',
  488. position: "bottom"
  489. })
  490. } else {
  491. uni.showToast({
  492. icon: 'none',
  493. title: res.data.msg,
  494. position: "bottom"
  495. })
  496. }
  497. } else if (res.data.code == 200) {
  498. uni.redirectTo({
  499. url: '../index'
  500. });
  501. uni.makePhoneCall({
  502. phoneNumber: '' + this.form.fDriverTel, // 手机号
  503. });
  504. }
  505. }).catch(err => {
  506. uni.showToast({
  507. icon: 'none',
  508. title: '网络繁忙请稍后再试',
  509. position: "bottom"
  510. })
  511. })
  512. }
  513. }
  514. }
  515. };
  516. </script>
  517. <style scoped lang="scss">
  518. .basic {
  519. width: 94%;
  520. margin: 10rpx auto;
  521. display: flex;
  522. justify-content: space-between;
  523. }
  524. .basic>view {
  525. margin-bottom: 10rpx;
  526. }
  527. .basic>view:nth-child(1) {
  528. color: #797979;
  529. }
  530. .license {
  531. float: left;
  532. font-size: 32rpx;
  533. }
  534. .ordertop {
  535. width: 96%;
  536. background-color: #fff;
  537. margin: 20rpx auto;
  538. border-radius: 20rpx;
  539. padding-top: 20rpx;
  540. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  541. padding-bottom: 10rpx;
  542. }
  543. .ordertop>view:nth-child(1) {
  544. width: 98%;
  545. margin-bottom: 60rpx;
  546. }
  547. .iconblue {
  548. width: 10rpx;
  549. height: 45rpx;
  550. float: left;
  551. background-color: #3a63cf;
  552. margin-right: 10rpx;
  553. }
  554. .various {
  555. float: right;
  556. width: 150rpx;
  557. border: 2rpx solid #3a63cf;
  558. text-align: center;
  559. border-radius: 100rpx;
  560. color: #3a63cf;
  561. }
  562. .line {
  563. width: 92%;
  564. margin: 0 auto;
  565. }
  566. </style>