zhangback
2025-12-18 1144bd16c66703e2d5d0c7c95caf4cfd23c65d02
ui/car_wx_app/unpackage/dist/build/mp-weixin/pages/examine/index.js
@@ -1 +1 @@
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/examine/index"],{1972:function(e,t,i){"use strict";i.r(t);var n=i("fc6c"),r=i("75b0");for(var a in r)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(a);i("88e6");var o=i("828b"),u=Object(o["a"])(r["default"],n["b"],n["c"],!1,null,"4a905164",null,!1,n["a"],void 0);t["default"]=u.exports},3560:function(e,t,i){"use strict";(function(e,n){var r=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(i("7eb4")),o=r(i("7ca3")),u=r(i("ee10")),s=i("c8e5"),c=r(i("8dcb")),l=r(i("3500")),m=r(i("da42"));function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){(0,o.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function p(e,t){return e.reduce((function(e,i){var n=String(i[t]);return(e[n]||(e[n]=[])).push(i),e}),{})}var h={data:function(){return{show:!1,showOdometerPopup:!1,showPopup:!1,activeTab:"upload",formData:{name:"",router:"",id:"",tripTime:""},uploadAreas:[{name:"血压酒精",imageUrl:"",required:!0},{name:"登记表",imageUrl:"",required:!0}],mapApiKey:"fdb2d2e64ffc9254045935d3227d5cd9",amapPlugin:null,fileList:[],range:[],historyList:[],currencyRange:[],feeTypeList:[],currencyList:[],ishowDisplay:!1,emptyNameStr:"",cleanedForm:{},newForm:{},selectedAction:"",infoList:[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"当前状态",value:"待发车",status:!0},{label:"要求最晚发车时间",value:""}],actionButtonRows:[],actionButtonArray:[],tmsTripTables:[],form:{address:"",tripTime:"",odometer:0,tripType:""},rules:{address:[{required:!0,message:"请输入地址",trigger:"blur"}],tripTime:[{required:!0,message:"请选择时间",trigger:"change"}],feeType:[{required:!0,message:"请选择费用类型",trigger:"change"}],currency:[{required:!0,message:"请选择币制",trigger:"change"}]},mapList:{},activeActive:{}}},onLoad:function(e){this.formData=e,"查看行程历史"==e.name?this.ishowDisplay=!1:"上传行程"==e.name&&(this.ishowDisplay=!0),this.amapPlugin=new l.default.AMapWX({key:this.mapApiKey}),e.id&&(this.getDispatch(),this.getDictList(),this.form.tripTime=this.getCurrentDateTime())},created:function(){},methods:{getBtnDisabled:function(e){if(1==e.dictValue&&e.count>0)return!0;if(0==e.dictValue){if(this.mapList["1"]&&0==this.mapList["1"].length)return!0;if(e.count>0)return!0}else if(this.mapList["0"]&&0==this.mapList["0"].length)return!0;return!1},getBtnSuccess:function(e){return 1==e.dictValue&&e.count>0||(0==e.dictValue&&e.count>0||(4==e.dictValue&&e.count>0||(5==e.dictValue&&e.count>0||(8==e.dictValue&&e.count>0||100==e.dictValue&&e.count>0))))},getDictList:function(){var e=this;return(0,u.default)(a.default.mark((function t(){var i,n,r,o,u;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,s.getcarType)("fee_type");case 2:return i=t.sent,e.range=i.map((function(e){return{value:e.dictValue,text:e.dictLabel}})),t.next=6,(0,s.getcarType)("sys_currency");case 6:return n=t.sent,e.currencyRange=n.map((function(e){return{value:e.dictValue,text:e.dictLabel}})),t.next=10,(0,s.getcarType)("trip_type");case 10:return r=t.sent,e.actionButtonRows=r||[],t.next=14,(0,s.tmsTripList)(e.formData.id);case 14:if(t.t0=t.sent,t.t0){t.next=17;break}t.t0=[];case 17:o=t.t0,u=p(o,"tripType"),e.actionButtonRows.forEach((function(e){e.count=u[e.dictValue]?u[e.dictValue].length:0})),e.$forceUpdate(),e.mapList=u,e.tmsTripTables=o;case 23:case"end":return t.stop()}}),t)})))()},getDispatch:function(){var e=this,t=[];this.ishowDisplay?(this.infoList=[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"当前状态",value:"待发车",status:!0},{label:"要求最晚发车时间",value:""},{label:"装货地",value:""},{label:"卸货地",value:""}],t={dispatchNo:"调度单号",licensePlate:"运输工具号码",transportLine:"路线",customerName:"客户",statusStr:"当前状态",latestDeparture:"要求最晚发车时间",shipperAddress:"装货地",receiverAddress:"卸货地"}):(this.infoList=[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"完成时间",value:""},{label:"装货地",value:""},{label:"卸货地",value:""}],t={dispatchNo:"调度单号",licensePlate:"运输工具号码",transportLine:"路线",customerName:"客户",okTime:"完成时间",shipperAddress:"装货地",receiverAddress:"卸货地"}),(0,s.getcarDispatch)(this.formData.id).then((function(i){e.newForm=i,e.infoList=e.infoList.map((function(e){var n=Object.keys(t).find((function(i){return t[i]===e.label}));return n&&void 0!==i[n]?f(f({},e),{},{value:i[n]}):e}))})).catch((function(e){console.error("获取调度信息失败:",e)}))},getCurrentDateTime:function(){var e=new Date,t=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0");return t+"-"+i+"-"+n+" "+r+":"+a+":"+o},goThistory:function(){var t=this;setTimeout((function(){e.$u.route("/pages/travelItinerary/index?id="+t.formData.id+"&name=行程历史&statusStr="+t.formData.statusStr+"&router=/pages/examine/index")}),1e3)},getList:function(){var e=this;(0,s.getcarType)("trip_type").then((function(t){e.actionButtonRows=t,t.length>0&&(0,s.tmsTripList)(e.formData.id).then((function(t){e.historyList=t,console.log(e.historyList,"this.historyList"),e.historyList.forEach((function(t){var i=e.actionButtonArray.find((function(e){return e.dictValue==t.tripType}));t.statusStr=i?i.dictLabel:""}))})).catch((function(e){console.error("获取调度信息失败:",e)}))})).catch((function(e){})),(0,s.getcarType)("fee_type").then((function(t){e.feeTypeList=t,e.range=t.map((function(e){return{value:e.dictValue,text:e.dictLabel}}))})).catch((function(e){})),(0,s.getcarType)("sys_currency").then((function(t){e.currencyList=t,e.currencyRange=t.map((function(e){return{value:e.dictValue,text:e.dictLabel}}))})).catch((function(e){}))},getLocation:function(){var e=this;n.getLocation({type:"gcj02",success:function(t){var i=t.latitude,n=t.longitude;e.getAddress(i,n)},fail:function(e){console.error("获取位置失败:",e),n.showToast({title:"获取位置失败"+e,icon:"none"})}})},getAddress:function(e,t){var i=this;this.amapPlugin.getRegeo({location:"".concat(t,",").concat(e),success:function(e){i.form.address=e[0].name},fail:function(i){console.error("SDK调用失败:",i),n.showToast({title:"地址解析失败"+JSON.stringify(i)+e+t,icon:"none"})}})},switchTab:function(e){this.activeTab=e,this.form={address:"",tripTime:"",odometer:0,tripType:"",actualFeeAmount:0},this.fileList=[],this.selectedAction=""},closeAction:function(){this.show=!1},selectAction:function(e){var t=this;if(this.getBtnSuccess(e))return this.activeActive=this.mapList[e.dictValue][0],this.activeActive.voucherUrl?this.activeActive.feeVoucherUrl=this.activeActive.voucherUrl.split(",").filter((function(e){return""!==e.trim()})):this.activeActive.feeVoucherUrl=[],void(this.show=!0);if(!this.getBtnDisabled(e)){var i=e.dictValue;if(this.selectedAction=i,console.log(i),this.uploadAreas="0"==i?[{name:"仪表盘",imageUrl:"",required:!0},{name:"左前方",imageUrl:"",required:!0},{name:"右前方",imageUrl:"",required:!0},{name:"后方",imageUrl:"",required:!0},{name:"开箱检查",imageUrl:"",required:!0}]:"1"==i?[{name:"血压酒精",imageUrl:"",required:!0},{name:"登记表",imageUrl:"",required:!0}]:"2"==i||"6"==i?[{name:"车头",imageUrl:"",required:!0},{name:"车尾(非必填)",imageUrl:"",required:!1},{name:"仪表盘(非必填)",imageUrl:"",required:!1}]:"3"==i||"7"==i?[{name:"车头",imageUrl:"",required:!0},{name:"车尾",imageUrl:"",required:!0},{name:"仪表盘(非必填)",imageUrl:"",required:!1}]:"4"==i||"5"==i?[{name:"仪表盘(非必填)",imageUrl:"",required:!1},{name:"车头(非必填)",imageUrl:"",required:!1},{name:"车尾(非必填)",imageUrl:"",required:!1}]:[{name:"车头",imageUrl:"",required:!0},{name:"仪表盘",imageUrl:"",required:!0},{name:"车尾",imageUrl:"",required:!0}],this.form.tripType=i,"1"!==i){if(["3","5","7"].includes(i)){var n=this.tmsTripTables[0]||{};this.form.odometer=n.odometer}else this.form.odometer=0;this.$nextTick((function(){t.showPopup=!0}))}}},maskClick:function(){},afterRead:function(e){var t=this;return(0,u.default)(a.default.mark((function i(){var n,r,o,u,s;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:n=[].concat(e.file),r=t.fileList.length,n.map((function(e){t.fileList.push(f(f({},e),{},{status:"success",message:"上传中"}))})),o=0;case 4:if(!(o<n.length)){i.next=14;break}return i.next=7,t.uploadFilePromise(n[o].url);case 7:u=i.sent,s=t.fileList[r],t.fileList.splice(r,1,Object.assign(s,{status:u.status,message:"success"==u.status?"上传成功":"上传失败",urls:u.url})),r++;case 11:o++,i.next=4;break;case 14:case"end":return i.stop()}}),i)})))()},uploadFilePromise:function(t){return new Promise((function(i,n){e.uploadFile({url:c.default.host+"app/car/uploadImg",filePath:t,name:"file",header:{Authorization:m.default.state.sso_user_token},success:function(e){if(console.log(e),200==e.statusCode){var t=JSON.parse(e.data),n="";n=t.fileName.startsWith("http")?t.fileName:t.url?t.url:c.default.host.replace("/cwgltest-api/","")+t.fileName,i({url:n,status:"success"})}else i({status:"failed",msg:JSON.stringify(e)})},fail:function(e){n({status:"failed",msg:JSON.stringify(e)})}})}))},overSize:function(t){e.$u.toast("上传图片大小不能超过2MB!")},deletePic:function(e){this.fileList.splice(e.index,1)},onDateTimeChange:function(e){},changeValue:function(e){this.form.odometer=e},cleanFormData:function(e){var t={};for(var i in e)""!==e[i]&&null!==e[i]&&void 0!==e[i]&&(t[i]=e[i]);return t},goToAdvanceList:function(){var t=this;setTimeout((function(){e.$u.route("/pages/paymentList/index?name=垫付列表&router=/pages/examine/index&id="+t.formData.id)}),1e3)},chooseAreaPic:function(t){var i=this;e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){var n=e.tempFilePaths[0];i.uploadAreaPic(n,t)}})},uploadAreaPic:function(t,i){var n=this;return(0,u.default)(a.default.mark((function r(){var o;return a.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,n.uploadFilePromise(t);case 3:o=r.sent,"success"===o.status?n.uploadAreas[i].imageUrl=o.url:e.showToast({title:"上传失败"+o.msg,icon:"none"}),r.next=10;break;case 7:r.prev=7,r.t0=r["catch"](0),e.showToast({title:"上传失败"+r.t0.msg,icon:"none"});case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))()},deleteAreaPic:function(t){var i=this;e.showModal({title:"提示",content:"确定要删除这张图片吗?",success:function(e){e.confirm&&(i.uploadAreas[t].imageUrl="")}})},submitForm:function(){var t=this;if("upload"==this.activeTab){if(""==this.form.tripType)return void e.$u.toast("请选择行程类型");if(this.emptyNameStr=this.uploadAreas.filter((function(e){return""===e.imageUrl&&e.required})).map((function(e){return e.name})).join(","),this.emptyNameStr)n.showToast({title:"未上传:".concat(this.emptyNameStr),icon:"none",duration:3e3});else{var i=this.uploadAreas.map((function(e){return e.imageUrl&&""!==e.imageUrl})).join(",");this.form.voucherUrl=i,this.$refs.uForm.validate().then((function(i){i&&(t.form.dispatchOrderId=t.newForm.dispatchId,t.form.driverId=t.newForm.driverId,1==t.form.tripType?(e.setStorageSync("signContractForm",t.form),setTimeout((function(){e.$u.route("/pages/signContract/index")}),1e3)):(0,s.carUploadTrip)(t.form).then((function(i){1==i&&(e.$u.toast("操作成功"),t.form={address:"",tripTime:"",odometer:0,tripType:""},t.uploadAreas=t.uploadAreas.map((function(e){return f(f({},e),{},{imageUrl:""})})),t.selectedAction="",t.getDictList())})).catch((function(t){e.$u.toast("提交失败")})))})).catch((function(t){e.$u.toast("校验失败")}))}}else if("advance"==this.activeTab){if(0==this.fileList.length)return void e.$u.toast("图片上传不能为空");this.$refs.uForm.validate().then((function(i){if(i){var n=t.fileList.map((function(e){return e.urls})).join(",");t.form.feeVoucherUrl=n,t.form.dispatchOrderId=t.newForm.dispatchId,t.form.driverId=t.newForm.driverId,t.form.dispatchNo=t.newForm.dispatchNo,t.form.licensePlate=t.newForm.licensePlate,t.form.transportLine=t.newForm.transportLine,t.form.customerName=t.newForm.customerName,t.cleanedForm=t.cleanFormData(f({},t.form)),(0,s.carUploadFinance)(t.cleanedForm).then((function(i){1==i&&(e.$u.toast("操作成功"),t.form={address:"",tripTime:"",odometer:0,tripType:""},t.cleanedForm={},t.fileList=[],t.selectedAction="")})).catch((function(t){e.$u.toast("提交失败")}))}})).catch((function(t){e.$u.toast("校验失败")}))}},handleSubmit:function(){this.form.odometer<0?e.$u.toast("仪表里程不能为负数"):(this.getLocation(),this.form.tripTime=this.getCurrentDateTime(),this.showPopup=!1)}}};t.default=h}).call(this,i("df3c")["default"],i("3223")["default"])},"75b0":function(e,t,i){"use strict";i.r(t);var n=i("3560"),r=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=r.a},"88e6":function(e,t,i){"use strict";var n=i("cee9"),r=i.n(n);r.a},"8e4a":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("9f54");n(i("3240"));var r=n(i("1972"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(r.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},cee9:function(e,t,i){},fc6c:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={"u-Form":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--form/u--form")]).then(i.bind(null,"d268"))},uFormItem:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-form-item/u-form-item")]).then(i.bind(null,"4bed"))},"u-Image":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--image/u--image")]).then(i.bind(null,"141c"))},"u-Text":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--text/u--text")]).then(i.bind(null,"91c9"))},uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,"669e"))},uniDatetimePicker:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(i.bind(null,"80bd"))},uButton:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-button/u-button")]).then(i.bind(null,"e8a0"))},uniDataSelect:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(i.bind(null,"60ab"))},uNumberBox:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-number-box/u-number-box")]).then(i.bind(null,"1b97"))},"u-Input":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--input/u--input")]).then(i.bind(null,"6aab"))},uUpload:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-upload/u-upload")]).then(i.bind(null,"3254"))},uPopup:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(i.bind(null,"4289"))}},r=function(){var e=this,t=e.$createElement,i=(e._self._c,"upload"===e.activeTab&&e.ishowDisplay?e.__map(e.actionButtonRows,(function(t,i){var n=e.__get_orig(t),r=!["0","1","4","5","8","100"].includes(t.dictValue)&&t.count>0,a=e.getBtnDisabled(t),o=e.getBtnSuccess(t);return{$orig:n,g0:r,m0:a,m1:o}})):null),n=!e.activeActive.feeVoucherUrl||0===e.activeActive.feeVoucherUrl.length;e._isMounted||(e.e0=function(t){e.showPopup=!1},e.e1=function(t){e.showPopup=!1}),e.$mp.data=Object.assign({},{$root:{l0:i,g1:n}})},a=[]}},[["8e4a","common/runtime","common/vendor"]]]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/examine/index"],{1972:function(e,t,i){"use strict";i.r(t);var n=i("b68b"),r=i("75b0");for(var a in r)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(a);i("f9c0");var o=i("828b"),u=Object(o["a"])(r["default"],n["b"],n["c"],!1,null,"1a96f19f",null,!1,n["a"],void 0);t["default"]=u.exports},3560:function(e,t,i){"use strict";(function(e,n){var r=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(i("7eb4")),o=r(i("7ca3")),u=r(i("ee10")),s=i("c8e5"),c=r(i("8dcb")),l=r(i("3500")),m=r(i("da42"));function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){(0,o.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function p(e,t){return e.reduce((function(e,i){var n=String(i[t]);return(e[n]||(e[n]=[])).push(i),e}),{})}var h={data:function(){return{show:!1,showOdometerPopup:!1,showPopup:!1,activeTab:"upload",formData:{name:"",router:"",id:"",tripTime:""},uploadAreas:[{name:"血压酒精",imageUrl:"",required:!0},{name:"登记表",imageUrl:"",required:!0}],mapApiKey:"fdb2d2e64ffc9254045935d3227d5cd9",amapPlugin:null,fileList:[],range:[],historyList:[],currencyRange:[],feeTypeList:[],currencyList:[],ishowDisplay:!1,emptyNameStr:"",cleanedForm:{},newForm:{},selectedAction:"",infoList:[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"当前状态",value:"待发车",status:!0},{label:"要求最晚发车时间",value:""}],actionButtonRows:[],actionButtonArray:[],tmsTripTables:[],form:{address:"",tripTime:"",odometer:0,tripType:""},rules:{address:[{required:!0,message:"请输入地址",trigger:"blur"}],tripTime:[{required:!0,message:"请选择时间",trigger:"change"}],feeType:[{required:!0,message:"请选择费用类型",trigger:"change"}],currency:[{required:!0,message:"请选择币制",trigger:"change"}]},mapList:{},activeActive:{}}},onLoad:function(e){this.formData=e,"查看行程历史"==e.name?this.ishowDisplay=!1:"上传行程"==e.name&&(this.ishowDisplay=!0),this.amapPlugin=new l.default.AMapWX({key:this.mapApiKey}),e.id&&(this.getDispatch(),this.getDictList(),this.form.tripTime=this.getCurrentDateTime())},created:function(){},methods:{getBtnDisabled:function(e){if(1==e.dictValue&&e.count>0)return!0;if(0==e.dictValue){if(this.mapList["1"]&&0==this.mapList["1"].length)return!0;if(e.count>0)return!0}else if(this.mapList["0"]&&0==this.mapList["0"].length)return!0;return!1},getBtnSuccess:function(e){return 1==e.dictValue&&e.count>0||(0==e.dictValue&&e.count>0||(4==e.dictValue&&e.count>0||(5==e.dictValue&&e.count>0||(8==e.dictValue&&e.count>0||100==e.dictValue&&e.count>0))))},getDictList:function(){var e=this;return(0,u.default)(a.default.mark((function t(){var i,n,r,o,u;return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,s.getcarType)("fee_type");case 2:return i=t.sent,e.range=i.map((function(e){return{value:e.dictValue,text:e.dictLabel}})),t.next=6,(0,s.getcarType)("sys_currency");case 6:return n=t.sent,e.currencyRange=n.map((function(e){return{value:e.dictValue,text:e.dictLabel}})),t.next=10,(0,s.getcarType)("trip_type");case 10:return r=t.sent,e.actionButtonRows=r||[],t.next=14,(0,s.tmsTripList)(e.formData.id);case 14:if(t.t0=t.sent,t.t0){t.next=17;break}t.t0=[];case 17:o=t.t0,u=p(o,"tripType"),e.actionButtonRows.forEach((function(e){e.count=u[e.dictValue]?u[e.dictValue].length:0})),e.$forceUpdate(),e.mapList=u,e.tmsTripTables=o;case 23:case"end":return t.stop()}}),t)})))()},getDispatch:function(){var e=this,t=[];this.ishowDisplay?(this.infoList=[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"当前状态",value:"待发车",status:!0},{label:"要求最晚发车时间",value:""},{label:"装货地",value:""},{label:"卸货地",value:""}],t={dispatchNo:"调度单号",licensePlate:"运输工具号码",transportLine:"路线",customerName:"客户",statusStr:"当前状态",latestDeparture:"要求最晚发车时间",shipperAddress:"装货地",receiverAddress:"卸货地"}):(this.infoList=[{label:"调度单号",value:""},{label:"运输工具号码",value:""},{label:"路线",value:""},{label:"客户",value:""},{label:"完成时间",value:""},{label:"装货地",value:""},{label:"卸货地",value:""}],t={dispatchNo:"调度单号",licensePlate:"运输工具号码",transportLine:"路线",customerName:"客户",okTime:"完成时间",shipperAddress:"装货地",receiverAddress:"卸货地"}),(0,s.getcarDispatch)(this.formData.id).then((function(i){e.newForm=i,e.infoList=e.infoList.map((function(e){var n=Object.keys(t).find((function(i){return t[i]===e.label}));return n&&void 0!==i[n]?f(f({},e),{},{value:i[n]}):e}))})).catch((function(e){console.error("获取调度信息失败:",e)}))},getCurrentDateTime:function(){var e=new Date,t=e.getFullYear(),i=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0");return t+"-"+i+"-"+n+" "+r+":"+a+":"+o},goThistory:function(){var t=this;setTimeout((function(){e.$u.route("/pages/travelItinerary/index?id="+t.formData.id+"&name=行程历史&statusStr="+t.formData.statusStr+"&router=/pages/examine/index")}),1e3)},getList:function(){var e=this;(0,s.getcarType)("trip_type").then((function(t){e.actionButtonRows=t,t.length>0&&(0,s.tmsTripList)(e.formData.id).then((function(t){e.historyList=t,console.log(e.historyList,"this.historyList"),e.historyList.forEach((function(t){var i=e.actionButtonArray.find((function(e){return e.dictValue==t.tripType}));t.statusStr=i?i.dictLabel:""}))})).catch((function(e){console.error("获取调度信息失败:",e)}))})).catch((function(e){})),(0,s.getcarType)("fee_type").then((function(t){e.feeTypeList=t,e.range=t.map((function(e){return{value:e.dictValue,text:e.dictLabel}}))})).catch((function(e){})),(0,s.getcarType)("sys_currency").then((function(t){e.currencyList=t,e.currencyRange=t.map((function(e){return{value:e.dictValue,text:e.dictLabel}}))})).catch((function(e){}))},getLocation:function(){var e=this;n.getLocation({type:"gcj02",success:function(t){var i=t.latitude,n=t.longitude;e.getAddress(i,n)},fail:function(e){console.error("获取位置失败:",e),n.showToast({title:"获取位置失败"+e,icon:"none"})}})},getAddress:function(e,t){var i=this;this.amapPlugin.getRegeo({location:"".concat(t,",").concat(e),success:function(e){i.form.address=e[0].name},fail:function(i){console.error("SDK调用失败:",i),n.showToast({title:"地址解析失败"+JSON.stringify(i)+e+t,icon:"none"})}})},switchTab:function(e){this.activeTab=e,this.form={address:"",tripTime:"",odometer:0,tripType:"",actualFeeAmount:0},this.fileList=[],this.selectedAction=""},closeAction:function(){this.show=!1},selectAction:function(e){var t=this;if(this.getBtnSuccess(e))return this.activeActive=this.mapList[e.dictValue][0],this.activeActive.voucherUrl?this.activeActive.feeVoucherUrl=this.activeActive.voucherUrl.split(",").filter((function(e){return""!==e.trim()})):this.activeActive.feeVoucherUrl=[],void(this.show=!0);if(!this.getBtnDisabled(e)){var i=e.dictValue;if(this.selectedAction=i,console.log(i),this.uploadAreas="0"==i?[{name:"仪表盘",imageUrl:"",required:!0},{name:"左前方",imageUrl:"",required:!0},{name:"右前方",imageUrl:"",required:!0},{name:"后方",imageUrl:"",required:!0},{name:"开箱检查",imageUrl:"",required:!0}]:"1"==i?[{name:"血压酒精",imageUrl:"",required:!0},{name:"登记表",imageUrl:"",required:!0}]:"2"==i||"6"==i?[{name:"车头",imageUrl:"",required:!0},{name:"车尾(非必填)",imageUrl:"",required:!1},{name:"仪表盘(非必填)",imageUrl:"",required:!1}]:"3"==i||"7"==i?[{name:"车头",imageUrl:"",required:!0},{name:"车尾",imageUrl:"",required:!0},{name:"仪表盘(非必填)",imageUrl:"",required:!1}]:"4"==i||"5"==i?[{name:"仪表盘(非必填)",imageUrl:"",required:!1},{name:"车头(非必填)",imageUrl:"",required:!1},{name:"车尾(非必填)",imageUrl:"",required:!1}]:[{name:"车头",imageUrl:"",required:!0},{name:"仪表盘",imageUrl:"",required:!0},{name:"车尾",imageUrl:"",required:!0}],this.form.tripType=i,"1"!==i){if(["3","5","7"].includes(i)){var n=this.tmsTripTables[0]||{};this.form.odometer=n.odometer}else this.form.odometer=0;this.$nextTick((function(){t.showPopup=!0}))}}},maskClick:function(){},afterRead:function(e){var t=this;return(0,u.default)(a.default.mark((function i(){var n,r,o,u,s;return a.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:n=[].concat(e.file),r=t.fileList.length,n.map((function(e){t.fileList.push(f(f({},e),{},{status:"success",message:"上传中"}))})),o=0;case 4:if(!(o<n.length)){i.next=14;break}return i.next=7,t.uploadFilePromise(n[o].url);case 7:u=i.sent,s=t.fileList[r],t.fileList.splice(r,1,Object.assign(s,{status:u.status,message:"success"==u.status?"上传成功":"上传失败",urls:u.url})),r++;case 11:o++,i.next=4;break;case 14:case"end":return i.stop()}}),i)})))()},uploadFilePromise:function(t){return new Promise((function(i,n){e.uploadFile({url:c.default.host+"app/car/uploadImg",filePath:t,name:"file",header:{Authorization:m.default.state.sso_user_token},success:function(e){if(console.log(e),200==e.statusCode){var t=JSON.parse(e.data),n="";n=t.fileName.startsWith("http")?t.fileName:t.url?t.url:c.default.host.replace("/cwgltest-api/","")+t.fileName,i({url:n,status:"success"})}else i({status:"failed",msg:JSON.stringify(e)})},fail:function(e){n({status:"failed",msg:JSON.stringify(e)})}})}))},overSize:function(t){e.$u.toast("上传图片大小不能超过2MB!")},deletePic:function(e){this.fileList.splice(e.index,1)},onDateTimeChange:function(e){},changeValue:function(e){this.form.odometer=e},cleanFormData:function(e){var t={};for(var i in e)""!==e[i]&&null!==e[i]&&void 0!==e[i]&&(t[i]=e[i]);return t},goToAdvanceList:function(){var t=this;setTimeout((function(){e.$u.route("/pages/paymentList/index?name=垫付列表&router=/pages/examine/index&id="+t.formData.id)}),1e3)},chooseAreaPic:function(t){var i=this;e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){var n=e.tempFilePaths[0];i.uploadAreaPic(n,t)}})},uploadAreaPic:function(t,i){var n=this;return(0,u.default)(a.default.mark((function r(){var o;return a.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,n.uploadFilePromise(t);case 3:o=r.sent,"success"===o.status?n.uploadAreas[i].imageUrl=o.url:e.showToast({title:"上传失败"+o.msg,icon:"none"}),r.next=10;break;case 7:r.prev=7,r.t0=r["catch"](0),e.showToast({title:"上传失败"+r.t0.msg,icon:"none"});case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))()},deleteAreaPic:function(t){var i=this;e.showModal({title:"提示",content:"确定要删除这张图片吗?",success:function(e){e.confirm&&(i.uploadAreas[t].imageUrl="")}})},submitForm:function(){var t=this;if("upload"==this.activeTab){if(""==this.form.tripType)return void e.$u.toast("请选择行程类型");if(this.emptyNameStr=this.uploadAreas.filter((function(e){return""===e.imageUrl&&e.required})).map((function(e){return e.name})).join(","),this.emptyNameStr)n.showToast({title:"未上传:".concat(this.emptyNameStr),icon:"none",duration:3e3});else{var i=this.uploadAreas.filter((function(e){return""!==e.imageUrl})).map((function(e){return e.imageUrl})).join(",");this.form.voucherUrl=i,this.$refs.uForm.validate().then((function(i){i&&(t.form.dispatchOrderId=t.newForm.dispatchId,t.form.driverId=t.newForm.driverId,1==t.form.tripType?(e.setStorageSync("signContractForm",t.form),setTimeout((function(){e.$u.route("/pages/signContract/index")}),1e3)):(0,s.carUploadTrip)(t.form).then((function(i){1==i&&(e.$u.toast("操作成功"),t.form={address:"",tripTime:"",odometer:0,tripType:""},t.uploadAreas=t.uploadAreas.map((function(e){return f(f({},e),{},{imageUrl:""})})),t.selectedAction="",t.getDictList())})).catch((function(t){e.$u.toast("提交失败")})))})).catch((function(t){e.$u.toast("校验失败")}))}}else if("advance"==this.activeTab){if(0==this.fileList.length)return void e.$u.toast("图片上传不能为空");this.$refs.uForm.validate().then((function(i){if(i){var n=t.fileList.map((function(e){return e.urls})).join(",");t.form.feeVoucherUrl=n,t.form.dispatchOrderId=t.newForm.dispatchId,t.form.driverId=t.newForm.driverId,t.form.dispatchNo=t.newForm.dispatchNo,t.form.licensePlate=t.newForm.licensePlate,t.form.transportLine=t.newForm.transportLine,t.form.customerName=t.newForm.customerName,t.cleanedForm=t.cleanFormData(f({},t.form)),(0,s.carUploadFinance)(t.cleanedForm).then((function(i){1==i&&(e.$u.toast("操作成功"),t.form={address:"",tripTime:"",odometer:0,tripType:""},t.cleanedForm={},t.fileList=[],t.selectedAction="")})).catch((function(t){e.$u.toast("提交失败")}))}})).catch((function(t){e.$u.toast("校验失败")}))}},handleSubmit:function(){this.form.odometer<0?e.$u.toast("仪表里程不能为负数"):(this.getLocation(),this.form.tripTime=this.getCurrentDateTime(),this.showPopup=!1)}}};t.default=h}).call(this,i("df3c")["default"],i("3223")["default"])},"74d0":function(e,t,i){},"75b0":function(e,t,i){"use strict";i.r(t);var n=i("3560"),r=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=r.a},"8e4a":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("9f54");n(i("3240"));var r=n(i("1972"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(r.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},b68b:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={"u-Form":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--form/u--form")]).then(i.bind(null,"d268"))},uFormItem:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-form-item/u-form-item")]).then(i.bind(null,"4bed"))},"u-Image":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--image/u--image")]).then(i.bind(null,"141c"))},"u-Text":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--text/u--text")]).then(i.bind(null,"91c9"))},uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,"669e"))},uniDatetimePicker:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(i.bind(null,"80bd"))},uButton:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-button/u-button")]).then(i.bind(null,"e8a0"))},uniDataSelect:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(i.bind(null,"60ab"))},uNumberBox:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-number-box/u-number-box")]).then(i.bind(null,"1b97"))},"u-Input":function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u--input/u--input")]).then(i.bind(null,"6aab"))},uUpload:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-upload/u-upload")]).then(i.bind(null,"3254"))},uPopup:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(i.bind(null,"4289"))}},r=function(){var e=this,t=e.$createElement,i=(e._self._c,"upload"===e.activeTab&&e.ishowDisplay?e.__map(e.actionButtonRows,(function(t,i){var n=e.__get_orig(t),r=!["0","1","4","5","8","100"].includes(t.dictValue)&&t.count>0,a=e.getBtnDisabled(t),o=e.getBtnSuccess(t);return{$orig:n,g0:r,m0:a,m1:o}})):null),n=!e.activeActive.feeVoucherUrl||0===e.activeActive.feeVoucherUrl.length;e._isMounted||(e.e0=function(t){e.showPopup=!1},e.e1=function(t){e.showPopup=!1}),e.$mp.data=Object.assign({},{$root:{l0:i,g1:n}})},a=[]},f9c0:function(e,t,i){"use strict";var n=i("74d0"),r=i.n(n);r.a}},[["8e4a","common/runtime","common/vendor"]]]);