index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="app-content">
  3. <view class="header">
  4. <view class="log" @tap="fall"></view>{{ navname }}
  5. <view class="up" @tap="sendData()">完成</view>
  6. </view>
  7. <view class="content" v-if="luggageData">
  8. <view class="list">
  9. <p>行李编号</p>
  10. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.luggageNum" disabled="true" value=""
  11. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  12. </view>
  13. <view class="list">
  14. <p>当前位置</p>
  15. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.location_describe" disabled="true" value=""
  16. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  17. </view>
  18. <view class="list">
  19. <p>当前状态</p>
  20. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.abnormalState" disabled="true" value=""
  21. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  22. </view>
  23. <view class="list">
  24. <p>航班信息</p>
  25. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.flightNo" disabled="true" value=""
  26. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  27. </view>
  28. <view class="list">
  29. <p>异常类型</p>
  30. <picker @change="bindPickerChange" :value="index" :range-key="'name'" :range="exceptionList">
  31. <view class="uni-input">{{exceptionNameList[index]}}</view>
  32. </picker>
  33. <view class="listup"></view>
  34. </view>
  35. <view class="picturearea">
  36. <view class="name">图片上传</view>
  37. <!-- <view class="content_list">
  38. <view class="mg">
  39. <view class="mg_lg"></view>
  40. </view>
  41. <view class="mg">
  42. <view class="mg_lg"></view>
  43. </view>
  44. <view class="mg">
  45. <view class="mg_lg"></view>
  46. </view>
  47. </view> -->
  48. <!-- <sunui-upimg :url="upPicUrl" :before-upload="onBeforeUpload" ref="upload3" title="+" @upload="handleLoaded3" @change="handleChange3" :number="3">
  49. <template v-slot:icon>
  50. <text class="s-add-list-btn-icon">+</text>
  51. </template>
  52. </sunui-upimg> -->
  53. <mk-upload :imgList="imgList" @onDelete="onDelete" @onChoose="onChoose" />
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import Nav from '../../components/header/nav.vue'
  60. import mkUpload from "@/components/mk-upload/mk-upload.vue"
  61. export default {
  62. data() {
  63. return {
  64. isShow: true,
  65. dataheight: '20.75rem',
  66. scrollTop: 0,
  67. old: {
  68. scrollTop: 0
  69. },
  70. input: '',
  71. main: null,
  72. poll: null,
  73. filter: null,
  74. pusher: null,
  75. intentServer: null,
  76. arr: [],
  77. navname: '异常行李登记',
  78. imgList: [],
  79. luggageNum:null,
  80. luggageData:null,
  81. index:0,
  82. exceptionList:[
  83. {
  84. "type":null,
  85. "name":"非异常行李"
  86. },
  87. {
  88. "type":"DPR",
  89. "name":"破损"
  90. },
  91. {
  92. "type":"AHL",
  93. "name":"少收"
  94. },
  95. {
  96. "type":"OHD",
  97. "name":"多收"
  98. }
  99. ],
  100. exceptionNameList:["非异常行李","破损","少收","多收"],
  101. }
  102. },
  103. created(option) {},
  104. onLoad(option) {
  105. this.luggageNum = option.luggageNum;
  106. this.getDetial(this.luggageNum)
  107. },
  108. onUnload() {},
  109. onShow() {},
  110. mounted() {},
  111. components: {
  112. Nav,
  113. mkUpload
  114. },
  115. methods: {
  116. async getDetial(num) {
  117. let data = {
  118. "serviceId": 3002,
  119. "page": 1,
  120. "pageSize": 1,
  121. "dataContent": {
  122. "luggageNum": num, //行李号
  123. },
  124. "event": "0"
  125. }
  126. await this.$http.httpPost('/openApi/query', data).then(res => {
  127. if (res.code == "0" && res.returnData.length>0){
  128. this.luggageData = res.returnData[0]
  129. }
  130. else{
  131. uni.showToast({
  132. icon:'none',
  133. title: "未查询到该行李信息",
  134. duration: 5000
  135. });
  136. }
  137. })
  138. },
  139. bindPickerChange(e){
  140. this.index = e.detail.value
  141. this.luggageData.exception_type = this.exceptionList[this.index].type;
  142. },
  143. async sendData(){
  144. this.luggageData.sourceAirport = this.$storage.get('airportName');
  145. let data = {
  146. "serviceId": 3005,
  147. "dataContent": [
  148. this.luggageData
  149. ],
  150. "event": "0"
  151. }
  152. await this.$http.httpPost('/openApi/query', data).then(res => {
  153. if (res.code == "0") {
  154. uni.showToast({
  155. icon:'none',
  156. title: "操作成功",
  157. duration: 5000
  158. });
  159. }
  160. else{
  161. uni.showToast({
  162. icon:'none',
  163. title: "操作失败",
  164. duration: 5000
  165. });
  166. }
  167. })
  168. },
  169. fall() {
  170. uni.navigateBack({
  171. delta: 1
  172. })
  173. },
  174. onDelete(index) {
  175. console.log(index)
  176. //删除成功回调后执行 只做演示
  177. uni.showLoading({
  178. title: '删除中'
  179. });
  180. setTimeout(() => {
  181. this.imgList.splice(index, 1);
  182. wx.showToast({
  183. title: '删除成功',
  184. icon: 'success',
  185. duration: 1000
  186. });
  187. }, 1000);
  188. },
  189. onChoose(e) {
  190. console.log(e)
  191. //上传成功后回调执行push 只做演示
  192. uni.showLoading({
  193. title: '上传中'
  194. });
  195. setTimeout(() => {
  196. const tempFilePaths = e.tempFilePaths;
  197. this.imgList.push(tempFilePaths[0]);
  198. uni.hideLoading();
  199. }, 1000);
  200. },
  201. onPreviewTake(index) {
  202. console.log(index)
  203. wx.showActionSheet({
  204. itemList: ['预览图片', '删除图片'],
  205. success(res) {
  206. console.log(res.tapIndex)
  207. },
  208. fail(res) {
  209. console.log(res.errMsg)
  210. }
  211. })
  212. },
  213. },
  214. }
  215. </script>
  216. <style lang="scss" scoped>
  217. .app-content {
  218. >.header {
  219. width: 100%;
  220. height: 4.375rem;
  221. display: flex;
  222. justify-content: center;
  223. align-items: center;
  224. // background: rgba(49,85,99,1);
  225. color: rgb(16, 17, 22);
  226. font-family: Noto Sans SC;
  227. font-size: 1rem;
  228. position: relative;
  229. >.log {
  230. width: .375rem;
  231. height: .75rem;
  232. font-size: .75rem;
  233. position: absolute;
  234. left: 1.5rem;
  235. background: url('../../static/ico@1x.png') no-repeat;
  236. background-size: 100% 100%;
  237. }
  238. >.up {
  239. position: absolute;
  240. right: 1.5rem;
  241. color: rgb(37, 121, 160);
  242. font-family: Noto Sans SC;
  243. font-size: .875rem;
  244. font-weight: 500;
  245. }
  246. }
  247. >.content {
  248. margin-left: 1.5rem;
  249. >.list {
  250. height: 3.375rem;
  251. display: flex;
  252. align-items: center;
  253. border-bottom: 1px solid rgb(238, 238, 238);
  254. >p {
  255. color: rgb(0, 0, 0);
  256. font-family: Noto Sans SC;
  257. font-size: .8125rem;
  258. font-weight: 500;
  259. margin-right: 2.1875rem;
  260. }
  261. >.listup {
  262. width: .25rem;
  263. height: .5rem;
  264. background: url('../../static/icos.png') no-repeat;
  265. background-size: 100% 100%;
  266. position: absolute;
  267. right: 1.5rem;
  268. }
  269. }
  270. >.picturearea {
  271. margin-top: 1.875rem;
  272. >.name {
  273. color: rgb(0, 0, 0);
  274. font-family: Noto Sans SC;
  275. font-size: .8125rem;
  276. font-weight: 500;
  277. margin-bottom: 1.25rem;
  278. }
  279. >.content_list {
  280. width: 100%;
  281. display: flex;
  282. margin-top: 1.25rem;
  283. >.mg {
  284. width: 5.5rem;
  285. height: 5.5rem;
  286. background: rgb(197, 207, 211);
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. margin-right: .625rem;
  291. >.mg_lg {
  292. width: 1.75rem;
  293. height: 1.75rem;
  294. background: url('../../static/shi.png') no-repeat;
  295. background-size: 100% 100%;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. </style>