123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- // pages/weighingRecord/info.js
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- floorstatus: false,
- autoplay: true,
- indicatorDots: false,
- interval: 5000,
- duration: 1000,
- bannerIMg: [], //顶部轮播图数组 '/images/carImg.jpeg'
- setCurrent: 1, //顶部轮播图的index,用于显示当前播放的是第几张图片
- stockTypeArr: [], //出入库类型
- storehouseTypeArr: [], //库房确认状态
- tareTypeArr: [], //皮重类型
- weightOperateTypeArr: [], //称重状态
- tareCaptureArr: [], //过皮抓拍照片
- grossCaptureArr: [], //过毛抓拍照片
- appointmentAtatusStatusArray:[],//预约状态
- type: '',
- info: {
- plateColor: '黄色'
- }
- },
- onClickLeft: function () {
- wx.navigateBack()
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- //字典数据
- let treeData = app.globalData.treeArr
- for (const element of treeData) {
- let arrStr;
- switch (element.dictValue) {
- case 'appointment_status':
- arrStr = "appointmentAtatusStatusArray";
- break;
- }
- this.setData({
- [arrStr]: element.children
- })
- }
- this.setData({
- id: options.id
- })
- //获取详情
- var pages = getCurrentPages();
- var prevPage = pages[pages.length - 2];
- let getInfo = prevPage.data.resData[options.index]
- //司机回签
- let unloadImgArray = []
- if(getInfo.unloadImg){
- let unloadImg = getInfo.unloadImg.split(',')
- unloadImg.forEach(element => {
- unloadImgArray.push({
- url:app.host.BASEIMG_URL+element
- })
- });
- }
- let bannerIMg = []
- let grossCaptureArr = [] //过毛图片
- let tareCaptureArr = [] //过皮图片
- if (getInfo.grossPlateName) {
- grossCaptureArr.push({
- name: '过毛车牌',
- url: getInfo.grossPlateName
- })
- }
- if (getInfo.grossLicenseName) {
- grossCaptureArr.push({
- name: '过毛车辆',
- url: getInfo.grossLicenseName
- })
- }
- if (getInfo.grossCaptureHead) {
- grossCaptureArr.push({
- name: '过毛车辆',
- url: getInfo.grossCaptureHead
- })
- }
- if (getInfo.grossCaptureTail) {
- grossCaptureArr.push({
- name: '过毛车辆',
- url: getInfo.grossCaptureTail
- })
- }
- if (getInfo.grossCaptureWare) {
- grossCaptureArr.push({
- name: '过毛车辆',
- url: getInfo.grossCaptureWare
- })
- }
- if (getInfo.grossCaptureBody) {
- grossCaptureArr.push({
- name: '过毛车辆',
- url: getInfo.grossCaptureBody
- })
- }
- if (getInfo.grossCapturePoundRoom) {
- grossCaptureArr.push({
- name: '过毛车牌',
- url: getInfo.grossCapturePoundRoom
- })
- }
- //过皮图片
- if (getInfo.tarePlateName) {
- tareCaptureArr.push({
- name: '过皮车辆',
- url: getInfo.tarePlateName
- })
- }
- if (getInfo.tareLicenseName) {
- tareCaptureArr.push({
- name: '过皮车辆',
- url: getInfo.tareLicenseName
- })
- }
- if (getInfo.tareCaptureHead) {
- tareCaptureArr.push({
- name: '过皮车辆',
- url: getInfo.tareCaptureHead
- })
- }
- if (getInfo.tareCaptureTail) {
- tareCaptureArr.push({
- name: '过皮车辆',
- url: getInfo.tareCaptureTail
- })
- }
- if (getInfo.tareCaptureWare) {
- tareCaptureArr.push({
- name: '过皮车辆',
- url: getInfo.tareCaptureWare
- })
- }
- if (getInfo.tareCaptureBody) {
- tareCaptureArr.push({
- name: '过皮车牌',
- url: getInfo.tareCaptureBody
- })
- }
- if (getInfo.tareCapturePoundRoom) {
- tareCaptureArr.push({
- name: '过皮车牌',
- url: getInfo.tareCapturePoundRoom
- })
- }
- bannerIMg = [...grossCaptureArr, ...tareCaptureArr]
- this.setData({
- info: getInfo,
- unloadImgArray:unloadImgArray,//签收图片
- bannerIMg, //过毛过皮所有图片
- grossCaptureArr,
- tareCaptureArr
- })
- },
- /**
- * 获取当前轮播的的序号用于显示
- * @param {*} event
- */
- getCurrent: function (event) {
- this.setData({
- setCurrent: event.detail.current + 1
- })
- },
- //查询详情
- getInfo: function (id, url) {
- //详情
- app.request.requestGetApi(url, { 'id': id }, this, function (res, _that) {
- let getInfo = res.data.data;
- let setImgArr = []
- if (getInfo.grossCaptureBody) {
- setImgArr.push({
- name: '过毛车牌',
- url: getInfo.grossCaptureBody
- })
- }
- if (getInfo.grossCaptureHead) {
- setImgArr.push({
- name: '过毛车辆',
- url: getInfo.grossCaptureHead
- })
- }
- if (getInfo.grossCapturePoundRoom) {
- setImgArr.push({
- name: '过皮车牌',
- url: getInfo.grossCapturePoundRoom
- })
- }
- if (getInfo.grossCaptureTail) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.grossCaptureTail
- })
- }
- if (getInfo.grossCaptureWare) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.grossCaptureWare
- })
- }
- if (getInfo.grossLicenseName) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.grossLicenseName
- })
- }
- if (getInfo.grossPlateName) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.grossPlateName
- })
- }
- //
- if (getInfo.tareCaptureBody) {
- setImgArr.push({
- name: '过毛车牌',
- url: getInfo.tareCaptureBody
- })
- }
- if (getInfo.tareCaptureHead) {
- setImgArr.push({
- name: '过毛车辆',
- url: getInfo.tareCaptureHead
- })
- }
- if (getInfo.tareCapturePoundRoom) {
- setImgArr.push({
- name: '过皮车牌',
- url: getInfo.tareCapturePoundRoom
- })
- }
- if (getInfo.tareCaptureTail) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.tareCaptureTail
- })
- }
- if (getInfo.tareCaptureWare) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.tareCaptureWare
- })
- }
- if (getInfo.tareLicenseName) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.tareLicenseName
- })
- }
- if (getInfo.tarePlateName) {
- setImgArr.push({
- name: '过皮车辆',
- url: getInfo.tarePlateName
- })
- }
- _that.setData({
- info: getInfo,
- bannerIMg: setImgArr,
- // tareCaptureArr: tareCaptureArr,
- // grossCaptureArr:grossCaptureArr
- })
- //派车方式字典
- app.request.requestGetApi(app.API.api.getDispatchType, {}, _that, function (result, _this) {
- let resData = result.data.data;
- _this.setData({
- dispatchTypeArray:resData,
- dispatchTypeTxt:app.util.getDicName(resData, getInfo.dispatchType, 'code', 'value')
- })
- })
- //派车状态字典
- app.request.requestGetApi(app.API.api.getDispatchStatus, {}, _that, function (result, _this) {
- let resData = result.data.data;
- _this.setData({
- dispatchStatusArray:resData,
- dispatchStatusTxt:app.util.getDicName(resData, getInfo.dispatchStatus, 'code', 'value')
- })
- })
- //派车详情
- app.request.requestGetApi(app.API.api.dispatchVehicleDetail, { 'id': getInfo.dispatchVehicleId }, _that, function (result, that) {
- let getDispatchInfo = result.data.data
- that.setData({
- dispatchInfo: getDispatchInfo,
- dispatchTypeTxt:app.util.getDicName(that.data.dispatchTypeArray, getDispatchInfo.dispatchType, 'code', 'value'),
- dispatchStatusTxt:app.util.getDicName(that.data.dispatchStatusArray, getDispatchInfo.dispatchStatus, 'code', 'value')
- })
- console.log('getDispatchInfo:::',getDispatchInfo)
- //进出方式
- app.request.requestGetApi(app.API.api.getExitMethod, {}, that, function (getresult, setThat) {
- setThat.setData({
- exitMethodTxt:app.util.getDicName(getresult.data.data, getDispatchInfo.exitMethod, 'code', 'value')
- })
- })
- })
- })
- },
- // 获取滚动条当前位置
- onPageScroll: function (e) {
- if (e.scrollTop > 180) {
- this.setData({
- 'floorstatus': true
- });
- } else {
- this.setData({
- 'floorstatus': false
- });
- }
- // app.util.checkOnPageScroll(e, this, 'floorstatus')
- },
- })
|