info.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. },
  161. /**
  162. * 获取当前轮播的的序号用于显示
  163. * @param {*} event
  164. */
  165. getCurrent: function (event) {
  166. this.setData({
  167. setCurrent: event.detail.current + 1
  168. })
  169. },
  170. //查询详情
  171. getInfo: function (id, url) {
  172. //详情
  173. app.request.requestGetApi(url, { 'id': id }, this, function (res, _that) {
  174. let getInfo = res.data.data;
  175. let setImgArr = []
  176. if (getInfo.grossCaptureBody) {
  177. setImgArr.push({
  178. name: '过毛车牌',
  179. url: getInfo.grossCaptureBody
  180. })
  181. }
  182. if (getInfo.grossCaptureHead) {
  183. setImgArr.push({
  184. name: '过毛车辆',
  185. url: getInfo.grossCaptureHead
  186. })
  187. }
  188. if (getInfo.grossCapturePoundRoom) {
  189. setImgArr.push({
  190. name: '过皮车牌',
  191. url: getInfo.grossCapturePoundRoom
  192. })
  193. }
  194. if (getInfo.grossCaptureTail) {
  195. setImgArr.push({
  196. name: '过皮车辆',
  197. url: getInfo.grossCaptureTail
  198. })
  199. }
  200. if (getInfo.grossCaptureWare) {
  201. setImgArr.push({
  202. name: '过皮车辆',
  203. url: getInfo.grossCaptureWare
  204. })
  205. }
  206. if (getInfo.grossLicenseName) {
  207. setImgArr.push({
  208. name: '过皮车辆',
  209. url: getInfo.grossLicenseName
  210. })
  211. }
  212. if (getInfo.grossPlateName) {
  213. setImgArr.push({
  214. name: '过皮车辆',
  215. url: getInfo.grossPlateName
  216. })
  217. }
  218. //
  219. if (getInfo.tareCaptureBody) {
  220. setImgArr.push({
  221. name: '过毛车牌',
  222. url: getInfo.tareCaptureBody
  223. })
  224. }
  225. if (getInfo.tareCaptureHead) {
  226. setImgArr.push({
  227. name: '过毛车辆',
  228. url: getInfo.tareCaptureHead
  229. })
  230. }
  231. if (getInfo.tareCapturePoundRoom) {
  232. setImgArr.push({
  233. name: '过皮车牌',
  234. url: getInfo.tareCapturePoundRoom
  235. })
  236. }
  237. if (getInfo.tareCaptureTail) {
  238. setImgArr.push({
  239. name: '过皮车辆',
  240. url: getInfo.tareCaptureTail
  241. })
  242. }
  243. if (getInfo.tareCaptureWare) {
  244. setImgArr.push({
  245. name: '过皮车辆',
  246. url: getInfo.tareCaptureWare
  247. })
  248. }
  249. if (getInfo.tareLicenseName) {
  250. setImgArr.push({
  251. name: '过皮车辆',
  252. url: getInfo.tareLicenseName
  253. })
  254. }
  255. if (getInfo.tarePlateName) {
  256. setImgArr.push({
  257. name: '过皮车辆',
  258. url: getInfo.tarePlateName
  259. })
  260. }
  261. _that.setData({
  262. info: getInfo,
  263. bannerIMg: setImgArr,
  264. // tareCaptureArr: tareCaptureArr,
  265. // grossCaptureArr:grossCaptureArr
  266. })
  267. //派车方式字典
  268. app.request.requestGetApi(app.API.api.getDispatchType, {}, _that, function (result, _this) {
  269. let resData = result.data.data;
  270. _this.setData({
  271. dispatchTypeArray:resData,
  272. dispatchTypeTxt:app.util.getDicName(resData, getInfo.dispatchType, 'code', 'value')
  273. })
  274. })
  275. //派车状态字典
  276. app.request.requestGetApi(app.API.api.getDispatchStatus, {}, _that, function (result, _this) {
  277. let resData = result.data.data;
  278. _this.setData({
  279. dispatchStatusArray:resData,
  280. dispatchStatusTxt:app.util.getDicName(resData, getInfo.dispatchStatus, 'code', 'value')
  281. })
  282. })
  283. //派车详情
  284. app.request.requestGetApi(app.API.api.dispatchVehicleDetail, { 'id': getInfo.dispatchVehicleId }, _that, function (result, that) {
  285. let getDispatchInfo = result.data.data
  286. that.setData({
  287. dispatchInfo: getDispatchInfo,
  288. dispatchTypeTxt:app.util.getDicName(that.data.dispatchTypeArray, getDispatchInfo.dispatchType, 'code', 'value'),
  289. dispatchStatusTxt:app.util.getDicName(that.data.dispatchStatusArray, getDispatchInfo.dispatchStatus, 'code', 'value')
  290. })
  291. console.log('getDispatchInfo:::',getDispatchInfo)
  292. //进出方式
  293. app.request.requestGetApi(app.API.api.getExitMethod, {}, that, function (getresult, setThat) {
  294. setThat.setData({
  295. exitMethodTxt:app.util.getDicName(getresult.data.data, getDispatchInfo.exitMethod, 'code', 'value')
  296. })
  297. })
  298. })
  299. })
  300. },
  301. // 获取滚动条当前位置
  302. onPageScroll: function (e) {
  303. if (e.scrollTop > 180) {
  304. this.setData({
  305. 'floorstatus': true
  306. });
  307. } else {
  308. this.setData({
  309. 'floorstatus': false
  310. });
  311. }
  312. // app.util.checkOnPageScroll(e, this, 'floorstatus')
  313. },
  314. })