index.vue 16 KB

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