ctms/ctms-appgm/assets/pages-order-create-create.71dd49f2.js
2025-04-10 23:19:13 +08:00

2 lines
17 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{o as e,c as a,w as t,a as l,b as r,e as o,A as n,h as i,i as d,l as u,k as c,a7 as m,n as s,q as p,a0 as _,a1 as f,p as h,m as v,a2 as F,a3 as D,O as V}from"./index.e9f016fd.js";import{_ as y,a as b,b as g,c as x,d as k,e as U,f as I,g as C,h as q,l as P,p as T}from"./uni-forms.64597675.js";import{r as B}from"./uni-app.es.d4b58485.js";import{_ as j}from"./uni-section.1b5bcd39.js";import{_ as w}from"./uni-fab.ae2446dc.js";import{_ as R}from"./plugin-vue_export-helper.21dcd24c.js";import"./uni-icons.219b5d7c.js";import"./uni-cloud.es.aef258d0.js";var S=R({data:()=>({userinfo:{},FormData:{start_province:"460000",start_city:"三亚",aim_province:"230000",sign_date:Date().now,car_value:20,fee_total:0,fee_insurance:0,fee_deliver:0,fee_pickup:0,fee_extra:0,fee_truck:0,pay_send:0,pay_receive:0,carno_area:"A",isTempCarno:0},lsIndex:"OrderCreateDraft",horizontal:"right",vertical:"bottom",direction:"vertical",pattern:{color:"#7A7E83",backgroundColor:"#fff",selectedColor:"#007AFF",buttonColor:"#fd8008",iconColor:"#fff"},content:[{iconPath:"/static/c5.png",selectedIconPath:"/static/c5.png",text:"草稿-5",active:!1,diyfn:"-5"},{iconPath:"/static/c4.png",selectedIconPath:"/static/c4.png",text:"草稿-4",active:!1,diyfn:"-4"},{iconPath:"/static/c3.png",selectedIconPath:"/static/c3.png",text:"草稿-3",active:!1,diyfn:"-3"},{iconPath:"/static/c2.png",selectedIconPath:"/static/c2.png",text:"草稿-2",active:!1,diyfn:"-2"},{iconPath:"/static/c1.png",selectedIconPath:"/static/c1.png",text:"草稿-1",active:!1,diyfn:"-1"},{iconPath:"/static/draft.png",selectedIconPath:"/static/draft-active.png",text:"保存草稿",active:!1,diyfn:!1}],sexs:[{text:"男",value:0},{text:"女",value:1},{text:"保密",value:2}],payments:[{text:"微信",value:"wechat"},{text:"支付宝",value:"alipay"},{text:"现金",value:"cash"},{text:"银行卡",value:"bankcard"},{text:"银联",value:"bankunion"},{text:"其他",value:"others"}],provinces:[{value:"460000",text:"海南省"},{value:"110000",text:"北京"},{value:"130000",text:"河北省"},{value:"210000",text:"辽宁省"},{value:"220000",text:"吉林省"},{value:"230000",text:"黑龙江省"},{value:"440000",text:"广东省"},{value:"500000",text:"重庆"},{value:"510000",text:"四川省"}],carPs:q.list,letters:P.list,isTempCarno:[{text:"否",value:0},{text:"是",value:1}],formRules:{start_province:{rules:[{required:!0,errorMessage:"出发省份不能为空"}]},aim_province:{rules:[{required:!0,errorMessage:"运达省份不能为空"}]},start_city:{rules:[{required:!0,errorMessage:"出发城市不能为空"}]},aim_city:{rules:[{required:!0,errorMessage:"运达城市不能为空"}]}}}),onLoad(){this.checkLogin(),u("log","at pages/order/create/create.vue:230",T.listByTitle["海南省"])},onReady(){this.$refs.customForm.setRules(this.formRules)},onShow:function(){u("log","at pages/order/create/create.vue:237","运单创建界面显示");var e=this.lsIndex,a=c(e);a&&(this.FormData=a),this.provinces=T.listDatacom,this.userinfo=m().globalData,u("log","at pages/order/create/create.vue:245",this.userinfo)},onHide(){this.draft()},methods:{checkLogin(){var e=c("UserInfo");e?(this.userinfo=e,u("log","at pages/order/create/create.vue:258",e)):s({url:"../login/login"})},formCheck(e){this.$refs[e].validate().then((e=>{u("log","at pages/order/create/create.vue:268","success",e),this.formSubmit()})).catch((e=>{u("log","at pages/order/create/create.vue:271","err",e),p({icon:"error",title:e[0].errorMessage})}))},formSubmit:function(e){_({title:"网络请求中"});var a,t=this;e&&(u("log","at pages/order/create/create.vue:287","form发生了submit事件携带数据为"+JSON.stringify(e.detail.value)),a=e.detail.value),a=this.FormData,u("log","at pages/order/create/create.vue:291",a);var l=!0;if(a.pay_send>0&&(a.payment&&a.payto||(l=!1)),!l)return p({title:"现付信息不完整",icon:"error"}),f(),!1;if(a.carno_frame){if(a.carno_frame.length<6)return f(),p({title:"车架号不足6位",icon:"error"}),!1}else a.carno_p&&a.carno_area&&a.carno_left&&a.carno_p&&a.carno_area&&a.carno_left||(l=!1);if(!l)return f(),p({title:"车牌/车架号不全",icon:"error"}),!1;var r=this.lsIndex;h(r,a),a.pid=this.apis.appid;var o=this.apis.domain+this.apis.OrderCreate;v({url:o,data:a,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},dataType:"json",success:e=>{switch(f(),u("log","at pages/order/create/create.vue:355",e.data),e.data.code){case 100:case 101:default:p({title:"操作失败",icon:"error"});break;case 200:var l=e.data.data.id;p({title:"订单创建成功!",icon:"success"}),F({title:"订单创建成功",content:"是否前往查看订单详情",success:function(e){D(t.lsIndex),e.confirm?s({url:"../detail/detail?oid="+l}):e.cancel&&(u("log","at pages/order/create/create.vue:382","用户点击取消"),h(t.lsIndex+"-0",a),V({url:"create"}))}})}},fail:e=>{p({title:"云端错误",icon:"error"})}})},draft(e){u("log","at pages/order/create/create.vue:409",e);var a=this.lsIndex;e&&(a+=e),h(a,this.FormData),p({title:"草稿已保存"})},useDraft(e){var a=this;F({title:"覆盖提醒",content:"即将应用该草稿中的临时数据",success:function(t){if(t.confirm){var l=a.lsIndex+e;a.FormData=c(l)}else t.cancel&&u("log","at pages/order/create/create.vue:431","用户点击取消")}}),u("log","at pages/order/create/create.vue:435","使用本地缓存的草稿数据")},fabClick(e){u("log","at pages/order/create/create.vue:440","点击了悬浮按钮")},trigger(e){u("log","at pages/order/create/create.vue:444",e),e.index;var a=this.lsIndex;if(!e.item.diyfn)return this.draft();a+=e.item.diyfn;var t=c(a),l=this;return t?this.useDraft(e.item.diyfn):F({title:"提示",content:`${e.item.text}对应的草稿不存在,创建吗?`,success:function(a){return a.confirm?(l.content[e.index].active=!0,l.draft(e.item.diyfn)):a.cancel?(p({icon:"error",title:"操作已取消"}),!1):void 0}})},copySender(){this.FormData.receiver_name=this.FormData.sender_name,this.FormData.receiver_mobiles=this.FormData.sender_mobiles,this.FormData.receiver_idcard=this.FormData.sender_idcard},calFeeTotal(){this.FormData.fee_insurance=parseInt(this.FormData.fee_insurance,10),this.FormData.fee_deliver=parseInt(this.FormData.fee_deliver,10),this.FormData.fee_pickup=parseInt(this.FormData.fee_pickup,10),this.FormData.fee_extra=parseInt(this.FormData.fee_extra,10),this.FormData.fee_truck=parseInt(this.FormData.fee_truck,10),this.FormData.fee_total=parseInt(this.FormData.fee_insurance,10)+parseInt(this.FormData.fee_deliver,10)+parseInt(this.FormData.fee_pickup,10)+parseInt(this.FormData.fee_extra,10)+parseInt(this.FormData.fee_truck,10),this.calPayReceive()},calPayReceive(){this.FormData.pay_send=parseInt(this.FormData.pay_send,10),this.FormData.pay_receive=parseInt(this.FormData.fee_total,10)-parseInt(this.FormData.pay_send,10)}}},[["render",function(u,c,m,s,p,_){const f=B(o("uni-notice-bar"),y),h=B(o("uni-easyinput"),b),v=B(o("uni-forms-item"),g),F=B(o("uni-section"),j),D=n,V=B(o("uni-data-picker"),x),q=i,P=B(o("uni-data-checkbox"),k),T=B(o("uni-combox"),U),R=B(o("uni-datetime-picker"),I),S=B(o("uni-forms"),C),z=d,M=B(o("uni-fab"),w);return e(),a(z,{class:"content"},{default:t((()=>[l(f,{text:"请提醒客户不要随车放置 贵重小件物品(如 眼镜\\无线充电器\\数据线\\U盘\\手表\\Zipporr火机等)、精密仪器设备(如 电脑等)、易燃易爆物品,车内不得放置违规违禁物品(如 燃料油\\火机\\酒精\\散装酒等),否则司机有权拒载、平台有权拒单。"}),l(f,{"show-icon":"",scrollable:"",text:"炎热天气,不要随车装运水果,一定会闷坏的!!!。"}),l(z,{class:"order-form"},{default:t((()=>[l(S,{ref:"customForm",rules:p.formRules,modelValue:p.FormData},{default:t((()=>[l(F,{title:"发车人信息",type:"line"},{default:t((()=>[l(v,{label:"发车人",required:"",name:"sender_name"},{default:t((()=>[l(h,{modelValue:p.FormData.sender_name,"onUpdate:modelValue":c[0]||(c[0]=e=>p.FormData.sender_name=e),placeholder:"请输入姓名"},null,8,["modelValue"])])),_:1}),l(v,{label:"手机号",required:"",name:"sender_mobiles"},{default:t((()=>[l(h,{modelValue:p.FormData.sender_mobiles,"onUpdate:modelValue":c[1]||(c[1]=e=>p.FormData.sender_mobiles=e),placeholder:"请输入发车人电话"},null,8,["modelValue"])])),_:1}),l(v,{label:"身份证号",required:"",name:"sender_idcard"},{default:t((()=>[l(h,{modelValue:p.FormData.sender_idcard,"onUpdate:modelValue":c[2]||(c[2]=e=>p.FormData.sender_idcard=e),placeholder:"请输入发车人身份证号"},null,8,["modelValue"])])),_:1})])),_:1}),l(F,{title:"收车人信息",type:"line"},{default:t((()=>[l(D,{type:"success",onClick:_.copySender},{default:t((()=>[r("复制发车人信息")])),_:1},8,["onClick"]),l(v,{label:"收车人",required:"",name:"receiver_name"},{default:t((()=>[l(h,{modelValue:p.FormData.receiver_name,"onUpdate:modelValue":c[3]||(c[3]=e=>p.FormData.receiver_name=e),placeholder:"请输入姓名"},null,8,["modelValue"])])),_:1}),l(v,{label:"手机号",required:"",name:"receiver_mobiles"},{default:t((()=>[l(h,{modelValue:p.FormData.receiver_mobiles,"onUpdate:modelValue":c[4]||(c[4]=e=>p.FormData.receiver_mobiles=e),placeholder:"请输入发车人电话"},null,8,["modelValue"])])),_:1}),l(v,{label:"身份证号",required:"",name:"receiver_idcard"},{default:t((()=>[l(h,{modelValue:p.FormData.receiver_idcard,"onUpdate:modelValue":c[5]||(c[5]=e=>p.FormData.receiver_idcard=e),placeholder:"请输入收车人身份证号"},null,8,["modelValue"])])),_:1})])),_:1}),l(F,{title:"起止信息",type:"line"},{default:t((()=>[l(v,{label:"出发省份",required:"",name:"start_province"},{default:t((()=>[l(V,{placeholder:"请选择省份","popup-title":"请选择出发省份",localdata:p.provinces,modelValue:p.FormData.start_province,"onUpdate:modelValue":c[6]||(c[6]=e=>p.FormData.start_province=e)},null,8,["localdata","modelValue"])])),_:1}),l(v,{label:"始发城市",required:"",name:"start_city"},{default:t((()=>[l(h,{modelValue:p.FormData.start_city,"onUpdate:modelValue":c[7]||(c[7]=e=>p.FormData.start_city=e),placeholder:"请填写出发城市名称"},null,8,["modelValue"])])),_:1}),l(v,{label:"目标省份",required:"",name:"aim_province"},{default:t((()=>[l(V,{placeholder:"请选择省份","popup-title":"请选择运达省份",localdata:p.provinces,modelValue:p.FormData.aim_province,"onUpdate:modelValue":c[8]||(c[8]=e=>p.FormData.aim_province=e)},null,8,["localdata","modelValue"])])),_:1}),l(v,{label:"目标城市",required:"",name:"aim_city"},{default:t((()=>[l(h,{modelValue:p.FormData.aim_city,"onUpdate:modelValue":c[9]||(c[9]=e=>p.FormData.aim_city=e),placeholder:"请填写目标运达城市名称"},null,8,["modelValue"])])),_:1}),l(v,{label:"送车地址",name:"aim_address"},{default:t((()=>[l(h,{type:"textarea",modelValue:p.FormData.aim_address,"onUpdate:modelValue":c[10]||(c[10]=e=>p.FormData.aim_address=e),placeholder:"如果含送车服务,可填写"},null,8,["modelValue"])])),_:1})])),_:1}),l(F,{title:"费用信息",type:"line"},{default:t((()=>[l(v,{label:"车辆保价(万元)",required:"",name:"car_value"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.car_value,"onUpdate:modelValue":c[11]||(c[11]=e=>p.FormData.car_value=e),placeholder:"单位:万元;默认20"},null,8,["modelValue"])])),_:1}),l(v,{label:"保险费(元)",name:"fee_insurance"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_insurance,"onUpdate:modelValue":c[12]||(c[12]=e=>p.FormData.fee_insurance=e),placeholder:"请填写保险费",onBlur:_.calFeeTotal},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"送车费(元)",name:"fee_deliver"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_deliver,"onUpdate:modelValue":c[13]||(c[13]=e=>p.FormData.fee_deliver=e),placeholder:"请填写送车费",onBlur:_.calFeeTotal},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"提车费(元)",name:"fee_pickup"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_pickup,"onUpdate:modelValue":c[14]||(c[14]=e=>p.FormData.fee_pickup=e),placeholder:"请填写提车费",onBlur:_.calFeeTotal},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"其他费(元)",name:"fee_extra"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_extra,"onUpdate:modelValue":c[15]||(c[15]=e=>p.FormData.fee_extra=e),placeholder:"如:开票税费、代交停车费等",onBlur:_.calFeeTotal},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"运费(元)",required:"",name:"fee_truck"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_truck,"onUpdate:modelValue":c[16]||(c[16]=e=>p.FormData.fee_truck=e),placeholder:"请填写运费",onBlur:_.calFeeTotal},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"费用合计(元)",required:"",name:"fee_total"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.fee_total,"onUpdate:modelValue":c[17]||(c[17]=e=>p.FormData.fee_total=e),placeholder:"自动核算总费用,无须填写",disabled:""},null,8,["modelValue"])])),_:1}),l(q,{class:"uniui-h6 help-block"},{default:t((()=>[r("》》》收款支付记录《《《")])),_:1}),l(v,{label:"现付(元)",required:"",name:"pay_send"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.pay_send,"onUpdate:modelValue":c[18]||(c[18]=e=>p.FormData.pay_send=e),placeholder:"",onBlur:_.calPayReceive},null,8,["modelValue","onBlur"])])),_:1}),l(v,{label:"支付方式",name:"payment"},{default:t((()=>[l(P,{modelValue:p.FormData.payment,"onUpdate:modelValue":c[19]||(c[19]=e=>p.FormData.payment=e),multiple:!1,localdata:p.payments},null,8,["modelValue","localdata"])])),_:1}),l(v,{label:"收款人",name:"payto"},{default:t((()=>[l(h,{type:"string",modelValue:p.FormData.payto,"onUpdate:modelValue":c[20]||(c[20]=e=>p.FormData.payto=e),placeholder:"填写收款人名字"},null,8,["modelValue"])])),_:1}),l(v,{label:"到付(元)",required:"",name:"pay_receive"},{default:t((()=>[l(h,{type:"number",modelValue:p.FormData.pay_receive,"onUpdate:modelValue":c[21]||(c[21]=e=>p.FormData.pay_receive=e),placeholder:"自动计算,无须填写",disabled:""},null,8,["modelValue"])])),_:1})])),_:1}),l(F,{title:"车辆信息",type:"line"},{default:t((()=>[l(v,{label:"品牌车型",name:"car_title"},{default:t((()=>[l(h,{type:"text",modelValue:p.FormData.carno_title,"onUpdate:modelValue":c[22]||(c[22]=e=>p.FormData.carno_title=e),placeholder:"填写品牌车型"},null,8,["modelValue"])])),_:1}),l(v,{label:"车架号",name:"carno_frame"},{default:t((()=>[l(h,{type:"text",modelValue:p.FormData.carno_frame,"onUpdate:modelValue":c[23]||(c[23]=e=>p.FormData.carno_frame=e),placeholder:"无车牌/临时牌的填写,至少后六位"},null,8,["modelValue"])])),_:1}),l(q,{class:"uniui-h6 help-block"},{default:t((()=>[r("》》》车牌号填选《《《")])),_:1}),l(v,{label:"省份标识",name:"carno_p"},{default:t((()=>[l(T,{candidates:p.carPs,placeholder:"请选择或输入简称",modelValue:p.FormData.carno_p,"onUpdate:modelValue":c[24]||(c[24]=e=>p.FormData.carno_p=e)},null,8,["candidates","modelValue"])])),_:1}),l(v,{label:"区域标识",name:"carno_area"},{default:t((()=>[l(T,{candidates:p.letters,placeholder:"请选择或输入字母",modelValue:p.FormData.carno_area,"onUpdate:modelValue":c[25]||(c[25]=e=>p.FormData.carno_area=e)},null,8,["candidates","modelValue"])])),_:1}),l(v,{label:"车牌尾号",name:"carno_left"},{default:t((()=>[l(h,{type:"text",modelValue:p.FormData.carno_left,"onUpdate:modelValue":c[26]||(c[26]=e=>p.FormData.carno_left=e),placeholder:"填写车牌尾号"},null,8,["modelValue"])])),_:1}),l(v,{label:"是否临牌",name:"isTempCarno"},{default:t((()=>[l(P,{modelValue:p.FormData.isTempCarno,"onUpdate:modelValue":c[27]||(c[27]=e=>p.FormData.isTempCarno=e),multiple:!1,localdata:p.isTempCarno},null,8,["modelValue","localdata"])])),_:1})])),_:1}),l(F,{title:"其他信息",type:"line"}),l(v,{label:"签约日期",name:"sign_date"},{default:t((()=>[l(R,{type:"date","return-type":"timestamp",modelValue:p.FormData.sign_date,"onUpdate:modelValue":c[28]||(c[28]=e=>p.FormData.sign_date=e)},null,8,["modelValue"])])),_:1}),l(v,{label:"备注",name:"remark"},{default:t((()=>[l(h,{type:"textarea",modelValue:p.FormData.remark,"onUpdate:modelValue":c[29]||(c[29]=e=>p.FormData.remark=e),placeholder:"对运单做一些备注,比如 从哪里提车的;根据实际情况"},null,8,["modelValue"])])),_:1})])),_:1},8,["rules","modelValue"]),l(z,{class:"button-group"},{default:t((()=>[l(D,{type:"primary",size:"mini",onClick:c[30]||(c[30]=e=>_.formCheck("customForm"))},{default:t((()=>[r("确认提交")])),_:1}),l(D,{type:"default",size:"mini",onClick:_.draft},{default:t((()=>[r("保存草稿")])),_:1},8,["onClick"])])),_:1}),l(M,{ref:"fab",pattern:p.pattern,content:p.content,horizontal:p.horizontal,vertical:p.vertical,direction:p.direction,onTrigger:_.trigger,onFabClick:_.fabClick},null,8,["pattern","content","horizontal","vertical","direction","onTrigger","onFabClick"])])),_:1})])),_:1})}],["__scopeId","data-v-5807a5db"]]);export{S as default};