index.vue 15 KB

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