info.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="app-content">
  3. <view class="header">
  4. <view class="log" @tap="fall"></view>{{ navname }}
  5. </view>
  6. <view class="craids" v-if="!luggageData">
  7. <p>暂无行李信息</p>
  8. <p>请扫描需要操作的行李牌条码</p>
  9. </view>
  10. <view class="content" v-if="luggageData">
  11. <uni-section class="mb-10" title="当前行李" type="line"></uni-section>
  12. <view class="list">
  13. <p>行李编号</p>
  14. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.luggageNum" disabled="true"
  15. value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  16. </view>
  17. <view class="list">
  18. <p>航班信息</p>
  19. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.carrierFlights"
  20. disabled="true" value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);"
  21. placeholder="" />
  22. </view>
  23. <view class="list">
  24. <p>航班日期</p>
  25. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.carrierFlightsDate"
  26. disabled="true" value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);"
  27. placeholder="" />
  28. </view>
  29. <view class="list">
  30. <p>旅客姓名</p>
  31. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.passengerName" disabled="true"
  32. value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  33. </view>
  34. <view class="list">
  35. <p>降落机场</p>
  36. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.landAirport" disabled="true"
  37. value="" placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  38. </view>
  39. <uni-section class="mb-10" title="变更后信息" type="line"></uni-section>
  40. <view class="list">
  41. <p>变更类型</p>
  42. <picker @change="bindPickerChange" style="line-height: 2.375rem;background-color: antiquewhite;" :value="index" :range-key="'name'" :range="expressList">
  43. <view class="uni-input">{{expressList[index].type?expressList[index].name:"无"}}</view>
  44. </picker>
  45. </view>
  46. <view class="list">
  47. <p>行李编号</p>
  48. <uni-easyinput :inputBorder="false" style="line-height: 2.375rem;background-color: antiquewhite;" :placeholderStyle="placeholderStyle" :clearable="false"
  49. :styles="style" :disabled="false" v-model="luggageDataNew.luggageNum" type="text"
  50. placeholder="变更后行李编号" />
  51. </uni-forms>
  52. </view>
  53. <view class="list">
  54. <p>航班信息</p>
  55. <uni-easyinput :inputBorder="false" style="line-height: 2.375rem;background-color: antiquewhite;" :placeholderStyle="placeholderStyle" :clearable="false"
  56. :styles="style" :disabled="false" v-model="luggageDataNew.carrierFlights" type="text"
  57. placeholder="变更后航班号" />
  58. </view>
  59. <view class="list">
  60. <p>航班日期</p>
  61. <uni-datetime-picker style="line-height: 2.375rem;background-color: antiquewhite;" type="date" :clear-icon="false" v-model="luggageDataNew.carrierFlightsDate" @change="maskClick" />
  62. </view>
  63. <view class="list">
  64. <p>降落机场</p>
  65. <uni-easyinput :inputBorder="false" style="line-height: 2.375rem;background-color: antiquewhite;" :placeholderStyle="placeholderStyle" :clearable="false"
  66. :styles="style" :disabled="false" v-model="luggageDataNew.landAirport" type="text"
  67. placeholder="变更后降落机场" />
  68. </view>
  69. </view>
  70. <view class="up" v-if="luggageDataNew.luggageNum && luggageDataNew.carrierFlights && luggageDataNew.carrierFlightsDate && luggageDataNew.landAirport" @tap="sendData()">提交</view>
  71. </view>
  72. </template>
  73. <script>
  74. import Nav from '../../components/header/nav.vue'
  75. import mkUpload from "@/components/mk-upload/mk-upload.vue"
  76. import {
  77. translateapp
  78. } from "@/utils/compress.js"
  79. import {
  80. pathToBase64,
  81. base64ToPath
  82. } from 'image-tools'
  83. export default {
  84. data() {
  85. return {
  86. placeholderStyle: "color:000;",
  87. style: {
  88. disableColor: "#fff",
  89. color: "#000"
  90. },
  91. isShow: true,
  92. dataheight: '20.75rem',
  93. scrollTop: 0,
  94. old: {
  95. scrollTop: 0
  96. },
  97. input: '',
  98. main: null,
  99. poll: null,
  100. filter: null,
  101. pusher: null,
  102. intentServer: null,
  103. arr: [],
  104. navname: '速运/改签',
  105. luggageNum: null,
  106. luggageData: null,
  107. luggageDataNew: null,
  108. index: 0,
  109. index1: 0,
  110. expressList: [{
  111. "type": null,
  112. "name": "无"
  113. },
  114. {
  115. "type": "RUSH",
  116. "name": "速运"
  117. },
  118. {
  119. "type": "REBOOK",
  120. "name": "改签"
  121. }
  122. ],
  123. exceptionNameList: ["无", "速运", "改签"],
  124. nodeNameList: [],
  125. isGet:true
  126. }
  127. },
  128. created(option) {},
  129. onLoad(option) {
  130. this.luggageNum = option.luggageNum;
  131. if (this.luggageNum.length > 9) {
  132. this.getDetial(this.luggageNum)
  133. }
  134. },
  135. onUnload() {
  136. uni.$off("scancodemsg");
  137. },
  138. onShow() {
  139. uni.$off("scancodemsg");
  140. uni.$on("scancodemsg", (data) => {
  141. if (data.msg.length > 9) {
  142. this.luggageNum = data.msg.trim()
  143. if (this.luggageNum.length > 9) {
  144. if(this.isGet==true){
  145. this.getDetial(this.luggageNum);
  146. this.isGet = false;
  147. setTimeout(function(){
  148. this.isGet = true;
  149. },500)
  150. }
  151. }
  152. } else {
  153. uni.showToast({
  154. icon: 'none',
  155. title: "请扫描规范条码",
  156. duration: 5000
  157. });
  158. }
  159. })
  160. },
  161. onHide() {
  162. uni.$off("scancodemsg");
  163. },
  164. mounted() {},
  165. components: {
  166. Nav,
  167. mkUpload
  168. },
  169. methods: {
  170. async getDetial(num) {
  171. let data = {
  172. "serviceId": 3002,
  173. "page": 1,
  174. "pageSize": 1,
  175. "dataContent": {
  176. "luggageNum": num, //行李号
  177. },
  178. "event": "0"
  179. }
  180. await this.$http.httpPost('/openApi/query', data).then(res => {
  181. if (res.code == "0" && res.returnData.length > 0) {
  182. this.luggageData = res.returnData[0]
  183. this.luggageDataNew = _.cloneDeep(res.returnData[0])
  184. this.luggageDataNew.luggageNum = ""
  185. this.luggageDataNew.carrierFlights = ""
  186. this.luggageDataNew.carrierFlightsDate = ""
  187. this.luggageDataNew.landAirport = ""
  188. this.expressList.map((item, index) => {
  189. if (res.returnData[0].specialType == item.type) {
  190. this.index = index
  191. }
  192. })
  193. } else {
  194. this.$scanAudio.src = "../../static/hqxl.mp3"
  195. this.$scanAudio.play()
  196. uni.showToast({
  197. icon: 'none',
  198. title: "未查询到该行李信息",
  199. duration: 5000
  200. });
  201. }
  202. })
  203. },
  204. bindPickerChange(e) {
  205. this.index = e.detail.value
  206. this.luggageDataNew.specialType = this.expressList[this.index].type;
  207. },
  208. async sendData() {
  209. this.luggageDataNew.sourceAirport = this.$storage.get('airportName');
  210. this.luggageDataNew.ID = null;
  211. this.luggageDataNew.dataType = "BPM";
  212. this.luggageDataNew.agentNumber = this.$storage.getJson("users").user_name;
  213. // this.luggageDataNew.agentNumber = "syq";
  214. this.luggageDataNew.device_ID = uni.getDeviceInfo().deviceId;
  215. let data = {
  216. "serviceId": 3005,
  217. "dataContent": [
  218. this.luggageDataNew
  219. ],
  220. "event": "0"
  221. }
  222. await this.$http.httpPost('/openApi/query', data).then(res => {
  223. if (res.code == "0") {
  224. uni.showToast({
  225. icon: 'none',
  226. title: "操作成功",
  227. duration: 5000
  228. });
  229. } else {
  230. this.$scanAudio.src = "../../static/czsb.mp3"
  231. this.$scanAudio.play()
  232. uni.showToast({
  233. icon: 'none',
  234. title: "操作失败",
  235. duration: 5000
  236. });
  237. }
  238. })
  239. },
  240. fall() {
  241. uni.navigateBack({
  242. delta: 1
  243. })
  244. },
  245. maskClick(e){
  246. console.log(e)
  247. }
  248. },
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .app-content {
  253. >.up {
  254. position: fixed;
  255. bottom: 10px;
  256. left: calc((100% - 20.5625rem) / 2);
  257. width: 20.5625rem;
  258. height: 3rem;
  259. 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%);
  260. border-radius: .25rem;
  261. color: rgb(255, 255, 255);
  262. font-family: Noto Sans SC;
  263. font-size: 1rem;
  264. margin: 0 auto;
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. }
  269. >.header {
  270. width: 100%;
  271. height: 4.375rem;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. // background: rgba(49,85,99,1);
  276. color: rgb(16, 17, 22);
  277. font-family: Noto Sans SC;
  278. font-size: 1rem;
  279. position: relative;
  280. >.log {
  281. width: .375rem;
  282. height: .75rem;
  283. font-size: .75rem;
  284. position: absolute;
  285. left: 1.5rem;
  286. background: url('../../static/ico@1x.png') no-repeat;
  287. background-size: 100% 100%;
  288. }
  289. }
  290. >.craids {
  291. margin-top: 10rem;
  292. height: 5.625rem;
  293. padding: 0 2.5625rem 0 2.5625rem;
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. >p {
  298. color: rgb(75, 84, 91);
  299. font-family: Noto Sans SC;
  300. font-size: 13px;
  301. font-weight: 500;
  302. }
  303. }
  304. >.content {
  305. margin-left: 1.5rem;
  306. height: calc(100vh - 8rem);
  307. overflow-x: hidden;
  308. overflow-y: auto;
  309. >.list {
  310. height: 3.375rem;
  311. display: flex;
  312. align-items: center;
  313. border-bottom: 1px solid rgb(238, 238, 238);
  314. .uni-input {
  315. width: 240px;
  316. padding-left: 10px;
  317. }
  318. >p {
  319. color: rgb(0, 0, 0);
  320. font-family: Noto Sans SC;
  321. font-size: .8125rem;
  322. font-weight: 500;
  323. margin-right: 2.1875rem;
  324. }
  325. >.listup {
  326. width: .25rem;
  327. height: .5rem;
  328. background: url('../../static/icos.png') no-repeat;
  329. background-size: 100% 100%;
  330. position: absolute;
  331. right: 1.5rem;
  332. }
  333. }
  334. >.picturearea {
  335. margin-top: 1.875rem;
  336. >.name {
  337. color: rgb(0, 0, 0);
  338. font-family: Noto Sans SC;
  339. font-size: .8125rem;
  340. font-weight: 500;
  341. margin-bottom: 1.25rem;
  342. }
  343. >.content_list {
  344. width: 100%;
  345. display: flex;
  346. margin-top: 1.25rem;
  347. >.mg {
  348. width: 5.5rem;
  349. height: 5.5rem;
  350. background: rgb(197, 207, 211);
  351. display: flex;
  352. align-items: center;
  353. justify-content: center;
  354. margin-right: .625rem;
  355. >.mg_lg {
  356. width: 1.75rem;
  357. height: 1.75rem;
  358. background: url('../../static/shi.png') no-repeat;
  359. background-size: 100% 100%;
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. </style>