info.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. // pages/weighingRecord/info.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. floorstatus: false,
  9. autoplay: true,
  10. indicatorDots: false,
  11. interval: 5000,
  12. duration: 1000,
  13. bannerIMg: [], //顶部轮播图数组 '/images/carImg.jpeg'
  14. setCurrent: 1, //顶部轮播图的index,用于显示当前播放的是第几张图片
  15. stockTypeArr: [], //出入库类型
  16. storehouseTypeArr: [], //库房确认状态
  17. tareTypeArr: [], //皮重类型
  18. weightOperateTypeArr: [], //称重状态
  19. tareCaptureArr: [], //过皮抓拍照片
  20. grossCaptureArr: [], //过毛抓拍照片
  21. appointmentAtatusStatusArray:[],//预约状态
  22. type: '',
  23. info: {
  24. plateColor: '黄色'
  25. }
  26. },
  27. onClickLeft: function () {
  28. wx.navigateBack()
  29. },
  30. /**
  31. * 生命周期函数--监听页面加载
  32. */
  33. onLoad: function (options) {
  34. //字典数据
  35. let treeData = app.globalData.treeArr
  36. for (const element of treeData) {
  37. let arrStr;
  38. switch (element.dictValue) {
  39. case 'appointment_status':
  40. arrStr = "appointmentAtatusStatusArray";
  41. break;
  42. }
  43. this.setData({
  44. [arrStr]: element.children
  45. })
  46. }
  47. this.setData({
  48. id: options.id
  49. })
  50. //获取详情
  51. var pages = getCurrentPages();
  52. var prevPage = pages[pages.length - 2];
  53. let getInfo = prevPage.data.resData[options.index]
  54. ///司机回签
  55. let unloadImgArray = []
  56. if(getInfo.unloadImg){
  57. let unloadImg = getInfo.unloadImg.split(',')
  58. unloadImg.forEach(element => {
  59. unloadImgArray.push({
  60. url:app.host.BASEIMG_URL+element
  61. })
  62. });
  63. }
  64. let bannerIMg = []
  65. let grossCaptureArr = [] //过毛图片
  66. let tareCaptureArr = [] //过皮图片
  67. if (getInfo.grossPlateName) {
  68. grossCaptureArr.push({
  69. name: '过毛车牌',
  70. url: getInfo.grossPlateName
  71. })
  72. }
  73. if (getInfo.grossLicenseName) {
  74. grossCaptureArr.push({
  75. name: '过毛车辆',
  76. url: getInfo.grossLicenseName
  77. })
  78. }
  79. if (getInfo.grossCaptureHead) {
  80. grossCaptureArr.push({
  81. name: '过毛车辆',
  82. url: getInfo.grossCaptureHead
  83. })
  84. }
  85. if (getInfo.grossCaptureTail) {
  86. grossCaptureArr.push({
  87. name: '过毛车辆',
  88. url: getInfo.grossCaptureTail
  89. })
  90. }
  91. if (getInfo.grossCaptureWare) {
  92. grossCaptureArr.push({
  93. name: '过毛车辆',
  94. url: getInfo.grossCaptureWare
  95. })
  96. }
  97. if (getInfo.grossCaptureBody) {
  98. grossCaptureArr.push({
  99. name: '过毛车辆',
  100. url: getInfo.grossCaptureBody
  101. })
  102. }
  103. if (getInfo.grossCapturePoundRoom) {
  104. grossCaptureArr.push({
  105. name: '过毛车牌',
  106. url: getInfo.grossCapturePoundRoom
  107. })
  108. }
  109. //过皮图片
  110. if (getInfo.tarePlateName) {
  111. tareCaptureArr.push({
  112. name: '过皮车辆',
  113. url: getInfo.tarePlateName
  114. })
  115. }
  116. if (getInfo.tareLicenseName) {
  117. tareCaptureArr.push({
  118. name: '过皮车辆',
  119. url: getInfo.tareLicenseName
  120. })
  121. }
  122. if (getInfo.tareCaptureHead) {
  123. tareCaptureArr.push({
  124. name: '过皮车辆',
  125. url: getInfo.tareCaptureHead
  126. })
  127. }
  128. if (getInfo.tareCaptureTail) {
  129. tareCaptureArr.push({
  130. name: '过皮车辆',
  131. url: getInfo.tareCaptureTail
  132. })
  133. }
  134. if (getInfo.tareCaptureWare) {
  135. tareCaptureArr.push({
  136. name: '过皮车辆',
  137. url: getInfo.tareCaptureWare
  138. })
  139. }
  140. if (getInfo.tareCaptureBody) {
  141. tareCaptureArr.push({
  142. name: '过皮车牌',
  143. url: getInfo.tareCaptureBody
  144. })
  145. }
  146. if (getInfo.tareCapturePoundRoom) {
  147. tareCaptureArr.push({
  148. name: '过皮车牌',
  149. url: getInfo.tareCapturePoundRoom
  150. })
  151. }
  152. bannerIMg = [...grossCaptureArr, ...tareCaptureArr]
  153. this.setData({
  154. info: getInfo,
  155. unloadImgArray:unloadImgArray,//签收图片
  156. bannerIMg, //过毛过皮所有图片
  157. grossCaptureArr,
  158. tareCaptureArr
  159. })
  160. //this.getInfo(options.id)
  161. },
  162. /**
  163. * 获取当前轮播的的序号用于显示
  164. * @param {*} event
  165. */
  166. getCurrent: function (event) {
  167. this.setData({
  168. setCurrent: event.detail.current + 1
  169. })
  170. },
  171. //查询详情
  172. getInfo: function (id, url) {
  173. //详情
  174. app.request.requestGetApi(url, { 'id': id }, this, function (res, _that) {
  175. let getInfo = res.data.data;
  176. let setImgArr = []
  177. if (getInfo.grossCaptureBody) {
  178. setImgArr.push({
  179. name: '过毛车牌',
  180. url: getInfo.grossCaptureBody
  181. })
  182. }
  183. if (getInfo.grossCaptureHead) {
  184. setImgArr.push({
  185. name: '过毛车辆',
  186. url: getInfo.grossCaptureHead
  187. })
  188. }
  189. if (getInfo.grossCapturePoundRoom) {
  190. setImgArr.push({
  191. name: '过皮车牌',
  192. url: getInfo.grossCapturePoundRoom
  193. })
  194. }
  195. if (getInfo.grossCaptureTail) {
  196. setImgArr.push({
  197. name: '过皮车辆',
  198. url: getInfo.grossCaptureTail
  199. })
  200. }
  201. if (getInfo.grossCaptureWare) {
  202. setImgArr.push({
  203. name: '过皮车辆',
  204. url: getInfo.grossCaptureWare
  205. })
  206. }
  207. if (getInfo.grossLicenseName) {
  208. setImgArr.push({
  209. name: '过皮车辆',
  210. url: getInfo.grossLicenseName
  211. })
  212. }
  213. if (getInfo.grossPlateName) {
  214. setImgArr.push({
  215. name: '过皮车辆',
  216. url: getInfo.grossPlateName
  217. })
  218. }
  219. //
  220. if (getInfo.tareCaptureBody) {
  221. setImgArr.push({
  222. name: '过毛车牌',
  223. url: getInfo.tareCaptureBody
  224. })
  225. }
  226. if (getInfo.tareCaptureHead) {
  227. setImgArr.push({
  228. name: '过毛车辆',
  229. url: getInfo.tareCaptureHead
  230. })
  231. }
  232. if (getInfo.tareCapturePoundRoom) {
  233. setImgArr.push({
  234. name: '过皮车牌',
  235. url: getInfo.tareCapturePoundRoom
  236. })
  237. }
  238. if (getInfo.tareCaptureTail) {
  239. setImgArr.push({
  240. name: '过皮车辆',
  241. url: getInfo.tareCaptureTail
  242. })
  243. }
  244. if (getInfo.tareCaptureWare) {
  245. setImgArr.push({
  246. name: '过皮车辆',
  247. url: getInfo.tareCaptureWare
  248. })
  249. }
  250. if (getInfo.tareLicenseName) {
  251. setImgArr.push({
  252. name: '过皮车辆',
  253. url: getInfo.tareLicenseName
  254. })
  255. }
  256. if (getInfo.tarePlateName) {
  257. setImgArr.push({
  258. name: '过皮车辆',
  259. url: getInfo.tarePlateName
  260. })
  261. }
  262. _that.setData({
  263. info: getInfo,
  264. bannerIMg: setImgArr,
  265. // tareCaptureArr: tareCaptureArr,
  266. // grossCaptureArr:grossCaptureArr
  267. })
  268. //派车方式字典
  269. app.request.requestGetApi(app.API.api.getDispatchType, {}, _that, function (result, _this) {
  270. let resData = result.data.data;
  271. _this.setData({
  272. dispatchTypeArray:resData,
  273. dispatchTypeTxt:app.util.getDicName(resData, getInfo.dispatchType, 'code', 'value')
  274. })
  275. })
  276. //派车状态字典
  277. app.request.requestGetApi(app.API.api.getDispatchStatus, {}, _that, function (result, _this) {
  278. let resData = result.data.data;
  279. _this.setData({
  280. dispatchStatusArray:resData,
  281. dispatchStatusTxt:app.util.getDicName(resData, getInfo.dispatchStatus, 'code', 'value')
  282. })
  283. })
  284. //派车详情
  285. app.request.requestGetApi(app.API.api.dispatchVehicleDetail, { 'id': getInfo.dispatchVehicleId }, _that, function (result, that) {
  286. let getDispatchInfo = result.data.data
  287. that.setData({
  288. dispatchInfo: getDispatchInfo,
  289. dispatchTypeTxt:app.util.getDicName(that.data.dispatchTypeArray, getDispatchInfo.dispatchType, 'code', 'value'),
  290. dispatchStatusTxt:app.util.getDicName(that.data.dispatchStatusArray, getDispatchInfo.dispatchStatus, 'code', 'value')
  291. })
  292. console.log('getDispatchInfo:::',getDispatchInfo)
  293. //进出方式
  294. app.request.requestGetApi(app.API.api.getExitMethod, {}, that, function (getresult, setThat) {
  295. setThat.setData({
  296. exitMethodTxt:app.util.getDicName(getresult.data.data, getDispatchInfo.exitMethod, 'code', 'value')
  297. })
  298. })
  299. })
  300. })
  301. },
  302. // 获取滚动条当前位置
  303. onPageScroll: function (e) {
  304. if (e.scrollTop > 180) {
  305. this.setData({
  306. 'floorstatus': true
  307. });
  308. } else {
  309. this.setData({
  310. 'floorstatus': false
  311. });
  312. }
  313. // app.util.checkOnPageScroll(e, this, 'floorstatus')
  314. },
  315. })