index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <view class="app-content">
  3. <view class="header">
  4. <view class="log" @tap="fall"></view> <button type="primary" class="send" size="small" v-if="luggageData" @tap="sendData()">提交</button>
  5. </view>
  6. <!-- <view class="nav">
  7. <view :class="action === index ? 'nav_lists': 'nav_list'" v-for="(item, index) in list" :key="index" @tap="lop(index)">{{item.name}}</view>
  8. </view> -->
  9. <uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
  10. <swiper class="swiper-box" @change="change" style="height:11rem">
  11. <swiper-item v-for="(item ,index) in info" :key="index">
  12. <view class="swiper-item">
  13. <image style="width:100%" src="../../static/bg.png" mode="widthFix"></image>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. </uni-swiper-dot>
  18. <view class="content" :style="{top:dataheight}">
  19. <uni-section title="行李详情" type="line"></uni-section>
  20. <view class="choice" @touchmove="movetran" v-if="luggageData">
  21. <scroll-view scroll-y="true" class="scroll-Y">
  22. <view class="list">
  23. <view class="lable">航班号</view>
  24. <span>{{luggageData.carrierFlights}}</span>
  25. </view>
  26. <view class="list">
  27. <view class="lable">航班日期</view>
  28. <span>{{luggageData.carrierFlightsDate}}</span>
  29. </view>
  30. <view class="list">
  31. <view class="lable">行李牌号</view>
  32. <span>{{luggageData.luggageNum}}</span>
  33. </view>
  34. <view class="list">
  35. <view class="lable">操作时间</view>
  36. <span>{{luggageData.processing_time}}</span>
  37. </view>
  38. <view class="list">
  39. <view class="lable">操作人</view>
  40. <span>{{luggageData.agentNumber}}</span>
  41. </view>
  42. <view class="list">
  43. <view class="lable">操作节点</view>
  44. <picker @change="bindPickerChange" :placeholderStyle="placeholderStyle" :value="index" :range-key="'nodeName'" :range="nodeList">
  45. <view class="uni-input">{{nodeNameList[index]}}</view>
  46. </picker>
  47. <view class="listup"></view>
  48. </view>
  49. <view class="list">
  50. <view class="lable">操作位置</view>
  51. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  52. v-model="luggageData.location_describe" type="text" placeholder="操作位置" />
  53. </uni-forms>
  54. <view class="listup"></view>
  55. </view>
  56. <view class="list">
  57. <view class="lable">发往节点</view>
  58. <picker @change="bindPickerChange2" :placeholderStyle="placeholderStyle" :value="index2" :range-key="'nodeName'" :range="nodeList">
  59. <view class="uni-input">{{nodeNameList[index2]}}</view>
  60. </picker>
  61. <view class="listup"></view>
  62. </view>
  63. <view class="list">
  64. <view class="lable">发往位置</view>
  65. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  66. v-model="luggageData.to_location_describe" type="text" placeholder="发往位置" />
  67. </uni-forms>
  68. <view class="listup"></view>
  69. </view>
  70. <view class="list">
  71. <view class="lable">特殊行李类型</view>
  72. <picker @change="bindPickerChange3" :placeholderStyle="placeholderStyle" :value="index3" :range-key="'specialTypeName'" :range="specialTypeList">
  73. <view class="uni-input">{{specialTypeNameList[index3]}}</view>
  74. </picker>
  75. <view class="listup"></view>
  76. </view>
  77. <view class="list">
  78. <view class="lable">异常类型</view>
  79. <picker @change="bindPickerChange4" :placeholderStyle="placeholderStyle" :value="index4" :range-key="'name'" :range="exceptionList">
  80. <view class="uni-input">{{exceptionNameList[index4]}}</view>
  81. </picker>
  82. <view class="listup"></view>
  83. </view>
  84. <view class="list">
  85. <view class="lable">非正常状态码</view>
  86. <picker @change="bindPickerChange5" :placeholderStyle="placeholderStyle" :value="index5" :range-key="'name'" :range="abnormalList">
  87. <view class="uni-input">{{abnormalNameList[index5]}}</view>
  88. </picker>
  89. <view class="listup"></view>
  90. </view>
  91. <view class="list">
  92. <view class="lable">装载序号</view>
  93. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  94. v-model="luggageData.loadNumber" type="text" placeholder="装载序号" />
  95. </uni-forms>
  96. <view class="listup"></view>
  97. </view>
  98. <view class="list">
  99. <view class="lable">容器编号</view>
  100. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  101. v-model="luggageData.container_ID" type="text" placeholder="容器编号" />
  102. </uni-forms>
  103. <view class="listup"></view>
  104. </view>
  105. <view class="list">
  106. <view class="lable">备注</view>
  107. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  108. v-model="luggageData.luggage_describe" type="text" placeholder="备注" />
  109. </uni-forms>
  110. <view class="listup"></view>
  111. </view>
  112. </scroll-view>
  113. </view>
  114. </view>
  115. <luanqing-date-picker ref="datePickerObj" :isSimple="mode === 'simple'" :isMultiple="mode === 'multiple'"
  116. @finishSelectDate="finishSelectDate" :defaultCheckedList="['2023-03-28','2023-09-25']">
  117. </luanqing-date-picker>
  118. <uv-datetime-picker :show="show" v-model="value1" mode="datetime" @confirm='confirm'
  119. @close='show = false'></uv-datetime-picker>
  120. </view>
  121. </template>
  122. <script>
  123. export default {
  124. data() {
  125. return {
  126. placeholderStyle: "color:000",
  127. style: {
  128. disableColor: "#fff",
  129. color: "#000"
  130. },
  131. dataheight: '10.75rem',
  132. datatime: '2023-06-02',
  133. datacontime: '',
  134. luggageData: null,
  135. luggageDataOld:null,
  136. info: [{
  137. content: '内容 A'
  138. }, {
  139. content: '内容 B'
  140. }, {
  141. content: '内容 C'
  142. }],
  143. current: 0,
  144. mode: 'round',
  145. show: false,
  146. value1: Number(new Date()),
  147. formatter: 'yy',
  148. index:0,
  149. index2:0,
  150. index3:0,
  151. index4:0,
  152. index5:0,
  153. nodeList:[],
  154. nodeNameList:[],
  155. nextNode:null,
  156. luggageNum:null,
  157. specialTypeList:[],
  158. specialTypeNameList:[],
  159. exceptionList:[
  160. {
  161. "type":null,
  162. "name":"非异常行李"
  163. },
  164. {
  165. "type":"DPR",
  166. "name":"破损"
  167. },
  168. {
  169. "type":"AHL",
  170. "name":"少收"
  171. },
  172. {
  173. "type":"OHD",
  174. "name":"多收"
  175. }
  176. ],
  177. exceptionNameList:["非异常行李","破损","少收","多收"],
  178. abnormalList:[
  179. {
  180. "type":null,
  181. "name":"无"
  182. },
  183. {
  184. "type":"NAL",
  185. "name":"未被授权的装载"
  186. },
  187. {
  188. "type":"OFF",
  189. "name":"已卸载"
  190. },
  191. {
  192. "type":"UNS",
  193. "name":"未找到"
  194. },
  195. {
  196. "type":"OND",
  197. "name":"在场未装载,未被授权"
  198. },
  199. {
  200. "type":"ONA",
  201. "name":"在场未装载,已授权"
  202. }
  203. ],
  204. abnormalNameList:["无","未被授权的装载","已卸载","未找到","在场未装载,未被授权","在场未装载,已授权"],
  205. isShow:true,
  206. sourceData:null
  207. }
  208. },
  209. created(option) {
  210. },
  211. onLoad(option) {
  212. this.luggageNum = option.luggageNum
  213. this.getNode()
  214. this.getSpecialTypeList()
  215. this.getDetial(this.luggageNum)
  216. },
  217. onUnload() {
  218. uni.$off("scancodemsg");
  219. },
  220. onShow() {
  221. uni.$on("scancodemsg", (data) => {
  222. if (data.msg.length > 9) {
  223. this.luggageNum = data.msg.trim()
  224. this.getDetial(this.luggageNum)
  225. }
  226. });
  227. },
  228. onHide() {
  229. },
  230. components: {},
  231. methods: {
  232. async getNode() {
  233. let data = {
  234. "serviceId": 3003,
  235. "dataContent": {},
  236. "event": "0"
  237. }
  238. await this.$http.httpPost('/openApi/query', data).then(res => {
  239. if (res.code == "0") {
  240. this.nodeList = res.returnData;
  241. this.nodeList.map(item => {
  242. this.nodeNameList.push(item.nodeName)
  243. })
  244. }
  245. })
  246. },
  247. async getSpecialTypeList(){
  248. let data = {
  249. "serviceId": 16,
  250. "dataContent": {},
  251. "event": "0"
  252. }
  253. await this.$http.httpPost('/openApi/query', data).then(res => {
  254. if (res.code == "0") {
  255. this.specialTypeList = res.returnData;
  256. this.specialTypeList.unshift(
  257. {
  258. "specialType": null,
  259. "specialTypeName": "非特殊行李",
  260. }
  261. )
  262. this.specialTypeList.map(item => {
  263. this.specialTypeNameList.push(item.specialTypeName)
  264. })
  265. }
  266. })
  267. },
  268. async getDetial(num) {
  269. let data = {
  270. "serviceId": 3002,
  271. "page": 1,
  272. "pageSize": 1,
  273. "dataContent": {
  274. "luggageNum": num, //行李号
  275. },
  276. "event": "0"
  277. }
  278. await this.$http.httpPost('/openApi/query', data).then(res => {
  279. this.luggageData = null
  280. if (res.code == "0" && res.returnData.length>0) {
  281. this.luggageData = res.returnData[0]
  282. this.luggageDataOld = JSON.parse(JSON.stringify(res.returnData[0]))
  283. this.nodeList.map((item,index)=>{
  284. if(res.returnData[0].nodeCode == item.nodeCode){
  285. this.index = index
  286. this.index2 = index + 1
  287. }
  288. })
  289. this.specialTypeList.map((item,index)=>{
  290. if(res.returnData[0].specialType == item.specialType){
  291. this.index3 = index
  292. }
  293. })
  294. this.exceptionList.map((item,index)=>{
  295. if(res.returnData[0].exception_type == item.type){
  296. this.index4 = index
  297. }
  298. })
  299. this.abnormalList.map((item,index)=>{
  300. if(res.returnData[0].abnormalState == item.type){
  301. this.index5 = index
  302. }
  303. })
  304. }
  305. else{
  306. uni.showToast({
  307. icon:'none',
  308. title: "未查询到该行李信息",
  309. duration: 5000
  310. });
  311. }
  312. })
  313. },
  314. async sendData(){
  315. this.luggageData.sourceAirport = this.$storage.get('airportName');
  316. this.luggageData.ID = null;
  317. this.luggageData.dataType = "BPM";
  318. this.luggageData.agentNumber = this.$storage.getJson("users").user_name;
  319. this.luggageData.device_ID = uni.getDeviceInfo().deviceId;
  320. // this.sourceData['ID'] = null;
  321. // this.sourceData['dataType'] = "BPM";
  322. // this.sourceData['agentNumber'] = this.luggageData.agentNumber;
  323. // this.sourceData['loadNumber'] = this.luggageData.loadNumber;
  324. // this.sourceData['container_ID'] = this.luggageData.container_ID;
  325. // this.sourceData['luggage_describe'] = this.luggageData.luggage_describe;
  326. // this.sourceData['nodeCode'] = this.luggageData.nodeCode;
  327. // this.sourceData['location_describe'] = this.luggageData.location_describe;
  328. // this.sourceData['to_location_describe'] = this.luggageData.to_location_describe;
  329. // this.sourceData['specialType'] = this.luggageData.specialType;
  330. // this.sourceData['exception_type'] = this.luggageData.exception_type;
  331. // this.sourceData['abnormalState'] = this.luggageData.abnormalState;
  332. // this.luggageData.sourceData = JSON.stringify(this.sourceData);
  333. let data = {
  334. "serviceId": 3005,
  335. "dataContent": [
  336. this.luggageData
  337. ],
  338. "event": "0"
  339. }
  340. await this.$http.httpPost('/openApi/query', data).then(res => {
  341. console.log(res)
  342. if (res.code == "0") {
  343. uni.showToast({
  344. icon:'none',
  345. title: "操作成功",
  346. duration: 5000
  347. });
  348. }
  349. else{
  350. uni.showToast({
  351. icon:'none',
  352. title: "操作失败",
  353. duration: 5000
  354. });
  355. }
  356. })
  357. },
  358. bindPickerChange(e){
  359. this.index = e.detail.value
  360. this.luggageData.nodeCode = this.nodeList[this.index].nodeCode;
  361. this.luggageData.location_describe = this.nodeList[this.index].nodeDescribe;
  362. this.index2 = this.index + 1
  363. this.luggageData.to_location_describe = this.nodeList[this.index2].nodeDescribe;
  364. },
  365. bindPickerChange2(e){
  366. this.index2 = e.detail.value
  367. this.luggageData.to_location_describe = this.nodeList[this.index2].nodeDescribe;
  368. },
  369. bindPickerChange3(e){
  370. this.index3 = e.detail.value
  371. this.luggageData.specialType = this.specialTypeList[this.index3].specialType;
  372. },
  373. bindPickerChange4(e){
  374. this.index4 = e.detail.value
  375. this.luggageData.exception_type = this.exceptionList[this.index4].type;
  376. },
  377. bindPickerChange5(e){
  378. this.index5 = e.detail.value
  379. this.luggageData.abnormalState = this.abnormalList[this.index5].type;
  380. },
  381. confirm(e) {
  382. this.show = false
  383. console.log(e.value)
  384. let timestamp = e.value
  385. // 此处时间戳以毫秒为单位
  386. let date = new Date(parseInt(timestamp));
  387. let Year = date.getFullYear();
  388. let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
  389. let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
  390. let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
  391. let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
  392. let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  393. let GMT = Year + '-' + Moth + '-' + Day + ' ' + Hour + ':' + Minute
  394. this.datacontime = GMT
  395. },
  396. finishSelectDate(e) {
  397. this.datatime = e[0]
  398. console.error("选择了日期:", e);
  399. },
  400. movetran(e) {
  401. let arr = uni.getSystemInfoSync().windowHeight;
  402. this.dataheight = (e.changedTouches[0].clientY / 16) + 'rem'
  403. if (e.changedTouches[0].clientY / 16 > 10.75) {
  404. this.dataheight = 10.75 + 'rem'
  405. } else if (e.changedTouches[0].clientY / 16 < 3.75) {
  406. this.dataheight = 3.75 + 'rem'
  407. }
  408. },
  409. uplist() {
  410. uni.redirectTo({
  411. url: "/pages/loadingdetails/index"
  412. })
  413. },
  414. lop(index) {
  415. this.action = index
  416. },
  417. seach() {
  418. uni.redirectTo({
  419. url: "/pages/search/index"
  420. })
  421. },
  422. fall() {
  423. uni.navigateBack({
  424. delta: 1
  425. })
  426. },
  427. change(e) {
  428. this.current = e.detail.current;
  429. }
  430. },
  431. }
  432. </script>
  433. <style lang="scss" scoped>
  434. .app-content {
  435. >.header {
  436. width: 100%;
  437. height: 4.375rem;
  438. display: flex;
  439. justify-content: space-between;
  440. align-items: center;
  441. // background: rgba(49,85,99,1);
  442. color: rgb(16, 17, 22);
  443. font-family: Noto Sans SC;
  444. font-size: 1rem;
  445. position: fixed;
  446. left: 0;
  447. top: 0;
  448. z-index: 1;
  449. >.log {
  450. width: .375rem;
  451. height: .75rem;
  452. font-size: .75rem;
  453. position: absolute;
  454. left: 1.5rem;
  455. background: url('../../static/ico@1x.png') no-repeat;
  456. background-size: 100% 100%;
  457. }
  458. >.send{
  459. position: absolute;
  460. right: 1.5rem;
  461. height: 1.5rem;
  462. font-size: 1rem;
  463. line-height: 1.5rem;
  464. }
  465. >.up {
  466. width: .8456rem;
  467. height: .8456rem;
  468. position: absolute;
  469. right: 1.5rem;
  470. background: url('../../static/search.png') no-repeat;
  471. background-size: 100% 100%;
  472. // color: rgb(37, 121, 160);
  473. // font-family: Noto Sans SC;
  474. // font-size: .875rem;
  475. // font-weight: 500;
  476. }
  477. }
  478. >.content {
  479. width: 100%;
  480. // height: calc(100vh - 20.9375rem - 4.375rem);
  481. padding-bottom: 0;
  482. position: absolute;
  483. bottom: 0;
  484. top: 10.75rem;
  485. border-radius: 6px 6px 0px 0px;
  486. overflow: hidden;
  487. background: rgb(255, 255, 255);
  488. >.choice {
  489. width: 100%;
  490. // height: 3.75rem;
  491. display: flex;
  492. align-items: center;
  493. padding: 0 0 0 0.8rem;
  494. box-sizing: border-box;
  495. >.scroll-Y {
  496. // height: calc(100% - 2.5rem - 2.75rem - 2.25rem - 2.25rem);
  497. width: 100%;
  498. height: 27.75rem;
  499. .list {
  500. height: 3.375rem;
  501. display: flex;
  502. align-items: center;
  503. border-bottom: 1px solid rgb(238, 238, 238);
  504. position: relative;
  505. color: rgb(0, 0, 0);
  506. font-family: Noto Sans SC;
  507. font-size: 13px;
  508. font-weight: 400;
  509. .uni-input{
  510. width: 200px;
  511. }
  512. >.lable {
  513. color: rgb(0, 0, 0);
  514. font-family: Noto Sans SC;
  515. font-size: 13px;
  516. font-weight: 500;
  517. line-height: 19px;
  518. letter-spacing: 0px;
  519. text-align: left;
  520. width: 6rem;
  521. }
  522. >.listup {
  523. width: .25rem;
  524. height: .5rem;
  525. background: url('../../static/icos.png') no-repeat;
  526. background-size: 100% 100%;
  527. position: absolute;
  528. right: 1.5rem;
  529. }
  530. }
  531. }
  532. }
  533. .but {
  534. width: 20.5625rem;
  535. height: 2.5rem;
  536. background: linear-gradient(179.10deg, rgba(51, 161, 165, 1.00) 11.326%, rgba(59, 111, 142, 1.00) 119.032%, rgba(59, 111, 142, 1.00) 119.032%, rgba(59, 111, 142, 1.00) 119.032%);
  537. border-radius: .25rem;
  538. color: rgb(255, 255, 255);
  539. font-family: Noto Sans SC;
  540. font-size: 1rem;
  541. margin: 0 auto;
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. margin-top: 0.25rem;
  546. margin-bottom: 2.25rem;
  547. }
  548. }
  549. }
  550. </style>