index.vue 16 KB

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