index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <view class="app-content">
  3. <view class="header">
  4. <view class="log" @tap="fall"></view>{{ navname }}
  5. <view class="up" v-if="luggageData" @tap="sendData()">完成</view>
  6. </view>
  7. <view class="craids" v-if="!luggageData">
  8. <p>暂无行李信息</p>
  9. <p>请扫描需要操作的行李牌条码</p>
  10. </view>
  11. <view class="content" v-if="luggageData">
  12. <view class="list">
  13. <p>行李编号</p>
  14. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.luggageNum" disabled="true" value=""
  15. 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.flightNo" disabled="true" value=""
  20. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  21. </view>
  22. <view class="list">
  23. <p>航班日期</p>
  24. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.flightDate" disabled="true" value=""
  25. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  26. </view>
  27. <view class="list">
  28. <p>当前节点</p>
  29. <picker @change="bindPickerChange1" :placeholderStyle="placeholderStyle" :value="index1" :range-key="'nodeName'" :range="nodeList">
  30. <view class="uni-input">{{nodeNameList[index]}}</view>
  31. </picker>
  32. <view class="listup"></view>
  33. </view>
  34. <view class="list">
  35. <p>当前位置</p>
  36. <uni-easyinput :inputBorder="false" :placeholderStyle="placeholderStyle" :clearable="false" :styles="style" :disabled="false"
  37. v-model="luggageData.location_describe" type="text" placeholder="操作位置" />
  38. </uni-forms>
  39. <view class="listup"></view>
  40. </view>
  41. <view class="list">
  42. <p>当前状态</p>
  43. <input class="input" name="yonghuming" type="text" v-model.trim="luggageData.currentResult" value=""
  44. placeholder-style="font-size:.8125rem;color:rgb(197, 197, 197);" placeholder="" />
  45. <view class="listup"></view>
  46. </view>
  47. <view class="list">
  48. <p>异常类型</p>
  49. <picker @change="bindPickerChange" :value="index" :range-key="'name'" :range="exceptionList">
  50. <view class="uni-input">{{exceptionNameList[index]}}</view>
  51. </picker>
  52. <view class="listup"></view>
  53. </view>
  54. <view class="picturearea">
  55. <view class="name">图片上传</view>
  56. <!-- <view class="content_list">
  57. <view class="mg">
  58. <view class="mg_lg"></view>
  59. </view>
  60. <view class="mg">
  61. <view class="mg_lg"></view>
  62. </view>
  63. <view class="mg">
  64. <view class="mg_lg"></view>
  65. </view>
  66. </view> -->
  67. <!-- <sunui-upimg :url="upPicUrl" :before-upload="onBeforeUpload" ref="upload3" title="+" @upload="handleLoaded3" @change="handleChange3" :number="3">
  68. <template v-slot:icon>
  69. <text class="s-add-list-btn-icon">+</text>
  70. </template>
  71. </sunui-upimg> -->
  72. <mk-upload :imgList="imgList" @onDelete="onDelete" @onChoose="onChoose" />
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import Nav from '../../components/header/nav.vue'
  79. import mkUpload from "@/components/mk-upload/mk-upload.vue"
  80. export default {
  81. data() {
  82. return {
  83. placeholderStyle: "color:000",
  84. style: {
  85. disableColor: "#fff",
  86. color: "#000"
  87. },
  88. isShow: true,
  89. dataheight: '20.75rem',
  90. scrollTop: 0,
  91. old: {
  92. scrollTop: 0
  93. },
  94. input: '',
  95. main: null,
  96. poll: null,
  97. filter: null,
  98. pusher: null,
  99. intentServer: null,
  100. arr: [],
  101. navname: '异常行李登记',
  102. imgList: [],
  103. luggageNum:null,
  104. luggageData:null,
  105. index:0,
  106. index1:0,
  107. exceptionList:[
  108. {
  109. "type":null,
  110. "name":"非异常行李"
  111. },
  112. {
  113. "type":"DPR",
  114. "name":"破损"
  115. },
  116. {
  117. "type":"AHL",
  118. "name":"少收"
  119. },
  120. {
  121. "type":"OHD",
  122. "name":"多收"
  123. }
  124. ],
  125. exceptionNameList:["非异常行李","破损","少收","多收"],
  126. nodeList:[],
  127. nodeNameList:[]
  128. }
  129. },
  130. created(option) {},
  131. onLoad(option) {
  132. this.luggageNum = option.luggageNum;
  133. this.getNode()
  134. if(this.luggageNum.length>9){
  135. this.getDetial(this.luggageNum)
  136. }
  137. },
  138. onUnload() {
  139. uni.$off("scancodemsg");
  140. },
  141. onShow() {
  142. uni.$on("scancodemsg", (data) => {
  143. if (data.msg.length > 9) {
  144. this.luggageNum = data.msg.trim()
  145. this.getDetial(this.luggageNum)
  146. }
  147. else{
  148. uni.showToast({
  149. icon:'none',
  150. title: "请扫描规范条码",
  151. duration: 5000
  152. });
  153. }
  154. })
  155. },
  156. onHide() {
  157. },
  158. mounted() {},
  159. components: {
  160. Nav,
  161. mkUpload
  162. },
  163. methods: {
  164. async getNode() {
  165. let data = {
  166. "serviceId": 3003,
  167. "dataContent": {},
  168. "event": "0"
  169. }
  170. await this.$http.httpPost('/openApi/query', data).then(res => {
  171. if (res.code == "0") {
  172. this.nodeList = res.returnData;
  173. this.nodeList.map(item => {
  174. this.nodeNameList.push(item.nodeName)
  175. })
  176. }
  177. })
  178. },
  179. async getDetial(num) {
  180. let data = {
  181. "serviceId": 3002,
  182. "page": 1,
  183. "pageSize": 1,
  184. "dataContent": {
  185. "luggageNum": num, //行李号
  186. },
  187. "event": "0"
  188. }
  189. await this.$http.httpPost('/openApi/query', data).then(res => {
  190. if (res.code == "0" && res.returnData.length>0){
  191. this.luggageData = res.returnData[0]
  192. this.nodeList.map((item,index)=>{
  193. if(res.returnData[0].nodeCode == item.nodeCode){
  194. this.index1 = index
  195. }
  196. })
  197. }
  198. else{
  199. uni.showToast({
  200. icon:'none',
  201. title: "未查询到该行李信息",
  202. duration: 5000
  203. });
  204. }
  205. })
  206. },
  207. bindPickerChange(e){
  208. this.index = e.detail.value
  209. this.luggageData.exception_type = this.exceptionList[this.index].type;
  210. },
  211. bindPickerChange1(e){
  212. this.index1 = e.detail.value
  213. this.luggageData.nodeCode = this.nodeList[this.index1].nodeCode;
  214. this.luggageData.location_describe = this.nodeList[this.index1].nodeDescribe;
  215. },
  216. async sendData(){
  217. this.luggageData.sourceAirport = this.$storage.get('airportName');
  218. this.luggageData.ID = null;
  219. this.luggageData.dataType = "BPM";
  220. this.luggageData.agentNumber = this.$storage.getJson("users").user_name;
  221. this.luggageData.device_ID = uni.getDeviceInfo().deviceId;
  222. let data = {
  223. "serviceId": 3005,
  224. "dataContent": [
  225. this.luggageData
  226. ],
  227. "event": "0"
  228. }
  229. await this.$http.httpPost('/openApi/query', data).then(res => {
  230. if (res.code == "0") {
  231. uni.showToast({
  232. icon:'none',
  233. title: "操作成功",
  234. duration: 5000
  235. });
  236. }
  237. else{
  238. uni.showToast({
  239. icon:'none',
  240. title: "操作失败",
  241. duration: 5000
  242. });
  243. }
  244. })
  245. },
  246. fall() {
  247. uni.navigateBack({
  248. delta: 1
  249. })
  250. },
  251. onDelete(index) {
  252. console.log(index)
  253. //删除成功回调后执行 只做演示
  254. uni.showLoading({
  255. title: '删除中'
  256. });
  257. setTimeout(() => {
  258. this.imgList.splice(index, 1);
  259. wx.showToast({
  260. title: '删除成功',
  261. icon: 'success',
  262. duration: 1000
  263. });
  264. }, 1000);
  265. },
  266. onChoose(e) {
  267. console.log(e)
  268. //上传成功后回调执行push 只做演示
  269. uni.showLoading({
  270. title: '上传中'
  271. });
  272. setTimeout(() => {
  273. const tempFilePaths = e.tempFilePaths;
  274. this.imgList.push(tempFilePaths[0]);
  275. uni.hideLoading();
  276. }, 1000);
  277. },
  278. onPreviewTake(index) {
  279. console.log(index)
  280. wx.showActionSheet({
  281. itemList: ['预览图片', '删除图片'],
  282. success(res) {
  283. console.log(res.tapIndex)
  284. },
  285. fail(res) {
  286. console.log(res.errMsg)
  287. }
  288. })
  289. },
  290. },
  291. }
  292. </script>
  293. <style lang="scss" scoped>
  294. .app-content {
  295. >.header {
  296. width: 100%;
  297. height: 4.375rem;
  298. display: flex;
  299. justify-content: center;
  300. align-items: center;
  301. // background: rgba(49,85,99,1);
  302. color: rgb(16, 17, 22);
  303. font-family: Noto Sans SC;
  304. font-size: 1rem;
  305. position: relative;
  306. >.log {
  307. width: .375rem;
  308. height: .75rem;
  309. font-size: .75rem;
  310. position: absolute;
  311. left: 1.5rem;
  312. background: url('../../static/ico@1x.png') no-repeat;
  313. background-size: 100% 100%;
  314. }
  315. >.up {
  316. position: absolute;
  317. right: 1.5rem;
  318. color: rgb(37, 121, 160);
  319. font-family: Noto Sans SC;
  320. font-size: .875rem;
  321. font-weight: 500;
  322. }
  323. }
  324. >.craids{
  325. margin-top:10rem;
  326. height: 5.625rem;
  327. padding: 0 2.5625rem 0 2.5625rem;
  328. display: flex;
  329. justify-content: center;
  330. align-items: center;
  331. >p{
  332. color: rgb(75, 84, 91);
  333. font-family: Noto Sans SC;
  334. font-size: 13px;
  335. font-weight: 500;
  336. }
  337. }
  338. >.content {
  339. margin-left: 1.5rem;
  340. >.list {
  341. height: 3.375rem;
  342. display: flex;
  343. align-items: center;
  344. border-bottom: 1px solid rgb(238, 238, 238);
  345. >p {
  346. color: rgb(0, 0, 0);
  347. font-family: Noto Sans SC;
  348. font-size: .8125rem;
  349. font-weight: 500;
  350. margin-right: 2.1875rem;
  351. }
  352. >.listup {
  353. width: .25rem;
  354. height: .5rem;
  355. background: url('../../static/icos.png') no-repeat;
  356. background-size: 100% 100%;
  357. position: absolute;
  358. right: 1.5rem;
  359. }
  360. }
  361. >.picturearea {
  362. margin-top: 1.875rem;
  363. >.name {
  364. color: rgb(0, 0, 0);
  365. font-family: Noto Sans SC;
  366. font-size: .8125rem;
  367. font-weight: 500;
  368. margin-bottom: 1.25rem;
  369. }
  370. >.content_list {
  371. width: 100%;
  372. display: flex;
  373. margin-top: 1.25rem;
  374. >.mg {
  375. width: 5.5rem;
  376. height: 5.5rem;
  377. background: rgb(197, 207, 211);
  378. display: flex;
  379. align-items: center;
  380. justify-content: center;
  381. margin-right: .625rem;
  382. >.mg_lg {
  383. width: 1.75rem;
  384. height: 1.75rem;
  385. background: url('../../static/shi.png') no-repeat;
  386. background-size: 100% 100%;
  387. }
  388. }
  389. }
  390. }
  391. }
  392. }
  393. </style>