|
|
- <template>
- <view class="containers">
- <view class="header">
- <view class="header_info">
- <view class="header_info_icon" @click.native.stop.prevent="toBack" style="display: flex; justify-content: center; align-items: center;">
- <uni-icons type="left" size="30" color="#c2d4de" > </uni-icons>
- </view>
- <text class="header_text">付款信息</text>
- </view>
- </view>
-
- <view class="section" style="margin-top: 5%;">
- <view class="form-item">
- <text class="label">付款方式</text>
- <l-radio :checked="clientInfo.payType === '全款'" label="全款" fontSize="1rem" style="transform: scale(0.7);">
- <template #icon="{checked}">
- <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
- <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
- </template>
- </l-radio>
- </view>
- <view class="form-item">
- <text class="label">客户类型</text>
- <l-radio-group @change="onChange" class="radio-group" >
- <l-radio :checked= "clientInfo.custType == 0?true:false" value="个人" label="个人" fontSize="1rem" style="margin-right: 1rem; transform: scale(0.7);">
- <template #icon="{checked}">
- <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
- <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
- </template>
- </l-radio>
- <l-radio :checked= "clientInfo.custType == 1?true:false" value="公司" label="公司" fontSize="1rem" style="transform: scale(0.7);">
- <template #icon="{checked}">
- <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
- <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
- </template>
- </l-radio>
- </l-radio-group>
- </view>
- </view>
-
- <view class="idCard-box">
- <view class="reverse">
- <image :src="clientInfo.certFront == ''?positiveImg:clientInfo.certFront" @tap.prevent="uploadPositive">
- </image>
- </view>
- <view class="reverse">
- <image :src="clientInfo.certBack == ''?reverseImg:clientInfo.certBack" @tap.prevent="uploadReverse">
- </image>
- </view>
- <view class="reverse">
- <image :src="clientInfo.carPic == ''?carImg:clientInfo.carPic" @tap.prevent="uploadCarCert">
- </image>
- </view>
- </view>
-
- <!-- 客户基本信息 -->
- <view class="section">
- <view class="con_size">
- <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>
- 客户基本信息
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">产品名称</text>
- <text class="value">{{ clientInfo.productName }}</text>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">经销商</text>
- <text class="value">{{ clientInfo.storeName }}</text>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">客户姓名</text>
- <input class="input" v-model="clientInfo.custName" placeholder="请输入客户姓名" />
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">居住地址</text>
- <input class="input" v-model="clientInfo.custAddress" placeholder="请输入居住地址" />
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">身份证号码</text>
- <input class="input" v-model="clientInfo.custCardNo" placeholder="请输入身份证号码" />
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">联系方式</text>
- <input class="input" v-model="clientInfo.custPhone" placeholder="请输入联系方式" />
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">销售端口</text>
- <l-radio-group class="radio-group" @change="handleDepartmentChange">
- <label class="radio-label" v-for="item in departments" :key="item">
- <l-radio :value="item" :checked="clientInfo.salePort === item" >
- <template #icon="{checked}">
- <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
- <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
- </template>
- </l-radio>
- <text style="margin-left:0.2rem;">{{ item }}</text>
- </label>
- </l-radio-group>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">促销销售顾问</text>
- <input class="input" v-model="clientInfo.saleName" placeholder="请输入店铺销售顾问" />
- </view>
- </view>
-
- <!-- 车辆信息 -->
- <view class="section">
- <view class="con_size">
- <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>车辆信息</view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">车牌车系</text>
- <picker class="picker" @change="bindCarBrandChange" :value="carBrandIndex" :range="carBrands">
- <view class="picker-text">{{ clientInfo.appOrderCarList[0].carSeries || '请选择车辆品牌 >' }}</view>
- </picker>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">车架号</text>
- <input class="input" v-model="clientInfo.appOrderCarList[0].vin" placeholder="请填写车架号" />
- </view>
- </view>
-
- <!-- 产品描述 -->
- <view class="section">
- <view class="con_size">
- <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>产品信息</view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">产品名称</text>
- <text class="value">{{ clientInfo.productName }}</text>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">服务年龄</text>
- <picker class="picker" @change="bindServiceAgeChange" :value="serviceAgeIndex" :range="serviceAges">
- <view class="picker-text">{{ serviceAges[serviceAgeIndex] || '请选择服务年限 >' }}</view>
- </picker>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">销售金额</text>
- <input class="input" v-model="clientInfo.productMoney" placeholder="请输入销售金额" />
- </view>
- </view>
-
- <!-- 付款信息 -->
- <view class="section">
- <view class="con_size">
- <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>付款信息</view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">收款方</text>
- <picker class="picker" @change="bindPayeeChange" :value="payeeIndex" :range="payees">
- <view class="picker-text">{{ this.clientInfo.payee || '请选择收款方 >' }}</view>
- </picker>
- </view>
- <view class="form-item">
- <text class="labels">*</text>
- <text class="label">付款时间</text>
- <uni-datetime-picker type="datetime" v-model="clientInfo.payeeTime" :clearIcon="false" :border="false">
- </uni-datetime-picker>
- </view>
-
- <view class="con_size">
- <text class="labels">*</text>
- <text class="label">支付凭证</text>
- <uv-upload
- :fileList="fileList1"
- name="1"
- multiple
- :maxCount="1"
- @afterRead="afterRead"
- @delete="deletePic"
- ><image
- src="/static/image/组件 5 – 1.png"
- mode="widthFix"
- style="width: 100px;height: 150px;"
- ></image></uv-upload>
- </view>
-
- </view>
-
- <view class="sections">
- <view class="form-button">
- <button class=" button" @click="get_to" style="width: 60%;">提交去录单</button>
- </view>
- </view>
-
-
- </view>
- </template>
-
- <script>
- import {idCardInfo,carCert,upload,getChildListBatch,add,isToken} from '@/api.uts'
- export default {
- data() {
- return {
- uploadConfig:{
- // 上传地址
- url:'https://gpt.aiym.run/contract/miniapp/file/upload',
- // 文件字段名
- name: 'file',
- // 请求头
- header: {},
- // 附带的表单数据
- formData: {
- 'biz': 'cert'
- },
- // 是否开启实际上传
- enabled: true
- },
- clientInfo: {
- appOrderCarList: [
- {
- buyMoney: 0,
- buyTax: 0,
- buyTime: "",
- carModel: "",
- carNo: "",
- carSeries: "",
- carType: "",
- createBy: "",
- createTime: "",
- engineNo: "",
- id: "",
- mileage: "",
- newCar: 0,
- orderFkId: "",
- sysOrgCode: "",
- updateBy: "",
- updateTime: "",
- useType: "",
- vin: ""
- }
- ],
- appOrderFinanceList: [
- {
- createBy: "",
- createTime: "",
- id: "",
- lender: "",
- lenderMone: 0,
- lenderYear: "",
- orderFkId: "",
- sysOrgCode: "",
- updateBy: "",
- updateTime: ""
- }
- ],
- appOrderVoucherList: [
- {
- assigneeCardNo: "",
- assigneeName: "",
- assigneePhone: "",
- carInsuranceNo: "",
- createBy: "",
- createTime: "",
- dealerAddress: "",
- effectiveTime: "",
- endTime: "",
- equityPackage: "",
- firstBeneficiary: "",
- id: "",
- insuranceName: "",
- orderFkId: "",
- packageMoney: 0,
- payTime: "",
- registeredCity: "",
- serviceMoney: 0,
- serviceYear: "",
- sysOrgCode: "",
- updateBy: "",
- updateTime: ""
- }
- ],
- busLicense: "",
- carPic: "",
- certBack: "",
- certFront: "",
- contractUrl: "",
- createBy: "",
- createTime: "",
- custAddress: "",
- custCardNo: "",
- custName: "",
- custPhone: "",
- custType: 0,
- id: "",
- orderNum: "",
- payType: '全款', // 默认选中全款
- payVoucherUrl: "",
- payee: "",
- payeeTime: "",
- productContractTemp: "",
- productMone : null,
- productName: "自动填写所选商品服务分类",
- productServiceYear: "",
- saleName: "",
- salePort: ''||"售前",
- status: 0,
- storeName: "自动填写所选择的门店",
- sysOrgCode: "",
- updateBy: "",
- updateTime: ""
- },
- fileList1:[],
- departments: ['售前', '售后', '二网车'],
- carBrands: [],
- carBrandIndex: -1,
- serviceAges: ['1年', '2年', '3年'],
- serviceAgeIndex: -1,
- payees: [],
- payeeIndex: -1,
- // 扫描
- positiveImg: '/static/image/组件 4 – 1.png',//自己图片路径
- // 反面身份证
- reverseImg: '/static/image/组 71663.png', //自己图片路径
- // 行车驾驶证
- carImg: '/static/image/组件 2 – 1.png' //自己图片路径
- }
- },
- mounted() {
- isToken();
- this.clientInfo.storeName = getApp().storeName || "自动填写所选择的门店";
- this.clientInfo.productName = getApp().productName || "自动填写所选商品服务分类";
- for (var index = 0; index < getApp().allMsg.length; index++) {
- this.payees.push(getApp().allMsg[index].storeName);
- }
- this.clientInfo.payee = getApp().storeName;
- this.uploadConfig.header = {
- 'X-Access-Token':uni.getStorageSync('token')
- }
- getChildListBatch().then((res)=>{
- console.log(res.result.records)
- this.carBrands = [];
- for (var index = 0; index < res.result.records.length; index++) {
- this.carBrands.push(res.result.records[index].name);
- }
- })
-
- },
- methods: {
- // 凭证上传函数
- deletePic(event) {
- this[`fileList${event.name}`].splice(event.index, 1)
- },
- // 新增图片
- async afterRead(event) {
- // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
- let lists = [].concat(event.file)
- let fileListLen = this[`fileList${event.name}`].length
- lists.map((item) => {
- this[`fileList${event.name}`].push({
- ...item,
- status: 'uploading',
- message: '上传中'
- })
- })
- for (let i = 0; i < lists.length; i++) {
- const result = await this.uploadFilePromise(lists[i].url)
- let item = this[`fileList${event.name}`][fileListLen]
- this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
- status: 'success',
- message: '',
- url: result
- }))
- fileListLen++
- }
- },
- uploadFilePromise(url) {
- let token = uni.getStorageSync('token')
- return new Promise((resolve, reject) => {
- let a = uni.uploadFile({
- url: 'https://gpt.aiym.run/contract/miniapp/file/upload', // 仅为示例,非真实的接口地址
- filePath: url,
- name: 'file',
- formData: {
- biz: 'test'
- },
- header:{
- 'X-Access-Token':token
- },
- success: (res) => {
- this.clientInfo.payVoucherUrl = JSON.parse(res.data).message;
- setTimeout(() => {
- resolve(res.data.data)
- }, 1000)
- }
- });
- })
- },
- get_to(){
- console.log('clientInfo', JSON.parse(JSON.stringify(this.clientInfo)));
- add(JSON.parse(JSON.stringify(this.clientInfo))).then((res)=>{
- console.log(res)
- })
- uni.switchTab (
- { url: '/pages/index/dingdan' }
- )
- },
- toBack(){
- let canNavBack = getCurrentPages()
- if( canNavBack && canNavBack.length>1) {
- uni.navigateBack()
- } else {
- history.back();
- }
- },
- handleDepartmentChange(e) {
- this.clientInfo.salePort = e;
- },
- // 修改车辆品牌
- bindCarBrandChange(e) {
- this.carBrandIndex = e.detail.value
- this.clientInfo.appOrderCarList[0].carSeries = this.carBrands[this.carBrandIndex];
- },
- // 取服务年限
- bindServiceAgeChange(e) {
- this.serviceAgeIndex = e.detail.value
- this.clientInfo.productServiceYear = this.serviceAges[e.detail.value];
- },
- // 选择收款方
- bindPayeeChange(e) {
- this.payeeIndex = e.detail.value
- this.clientInfo.payee= this.payees[e.detail.value];
-
- },
- // 身份证正面上传
- uploadPositive() {
- uni.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- let filePath = res.tempFilePaths[0];
- let token = uni.getStorageSync('token');
- this.uploadIdentify(token,'front',filePath,'sfz');
- }
- })
- },
- // 身份证反面上传
- uploadReverse() {
- uni.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- let filePath = res.tempFilePaths[0];
- let token = uni.getStorageSync('token');
- this.uploadIdentify(token,'back',filePath,'sfz')
- }
- })
- },
-
- uploadCarCert() {
- uni.chooseImage({
- count: 1,
- sizeType: ['original', 'compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- let filePath = res.tempFilePaths[0];
- let token = uni.getStorageSync('token');
- this.uploadIdentify(token,'',filePath,'carCert')
- }
- })
- },
- // 上传识别
- uploadIdentify(token,side,filePath,type) {
- uni.uploadFile({
- url: 'https://gpt.aiym.run/contract/miniapp/file/upload', //仅为示例,非真实的接口地址
- filePath:filePath,
- name: 'file',
- formData: {
- 'biz': 'cert'
- },
- header:{
- 'X-Access-Token':token
- },
- success: (res) => {
- if(type == "sfz"){
- idCardInfo({'side':side,'url':JSON.parse(res.data).message}).then((res)=>{
- if(res.success){
- if(side == 'front'){
- this.clientInfo.custName =res.result.name;
- this.clientInfo.custAddress= res.result.address;
- this.clientInfo.custCardNo = res.result.idCard ;
- this.clientInfo.certFront = filePath;
- }else {
- this.clientInfo.certBack=filePath;
- }
-
- }else{
- uni.showToast({
- title: "身份证识别错误,请重新上传!",
- icon: 'error',
- duration: 500,
- success: (res) => {
- },
- fail: (res) => {
- },
- })
- }
- }).catch(err => {
- console.log("catch: ", err);
- })
- }else if(type == 'carCert' ){
- // 处理车辆信息
- carCert({'url':JSON.parse(res.data).message}).then((res)=>{
- if(res.success){
- console.log('res',res)
- // 车牌车系
- this.clientInfo.appOrderCarList[0].carSeries = res.result.CarBrand;
- // 车架号
- this.clientInfo.appOrderCarList[0].vin = res.result.VinNo;
- this.clientInfo.carPic = filePath;
- }else{
- uni.showToast({
- title: "识别错误,请重新上传!",
- icon: 'error',
- duration: 500,
- success: (res) => {
- },
- fail: (res) => {
- },
- })
- }
- }).catch((err)=>{
- console.log("catch: ", err);
- })
-
- }
-
- },
- fail:(err)=>{
- console.log(err)
- }
- });
- },
- onChange(e){
- console.log("e",e);
- if(e = '个人'){
- this.clientInfo.custType = 0;
- }else{
- this.clientInfo.custType = 1;
- }
-
- }
- }
- }
- </script>
-
- <style scoped lang="scss">
- .containers {
- height: 100%;
- width: 100%;
- background-color: #fff;
- overflow-y:scroll;
-
- }
- .container::-webkit-scrollbar {
- display: none;
- }
- .section {
- // margin-bottom: 30rpx;
- border-bottom: 1rpx solid #eee;
- margin: 0 1rem 0 1rem;
- }
-
- .sections{
- margin: 0 1rem 1rem 1rem;
- }
- .form-item {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding: 0.5rem 0;
- border-bottom: 0.1rem solid #f2f2f2;
- color: #767676;
- }
- .labels{
- color: red;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .label {
- font-size: 28rpx;
- color: #666;
- width: 200rpx;
- }
-
- .input {
- flex: 1;
- text-align: right;
- font-size: 28rpx;
- color: #737373;
- }
-
- .picker {
- flex: 1;
- }
-
- .picker-text {
- text-align: right;
- color: #737373;
- font-size: 0.8rem;
- }
-
- .radio-group {
- display: flex;
- flex: 1;
- justify-content: flex-end;
- flex-direction: row;
- }
-
- .radio-label {
- padding: 0;
- margin-left: 10rpx;
- display: flex;
- flex-direction: row;
- font-size: 1rem;
- transform: scale(0.7);
- }
-
- .value {
- flex: 1;
- text-align: right;
- color: #737373;
- font-size: 0.8rem;
- }
- // .timePiker{
- // display: flex;
- // justify-content: center;
- // align-items: center;
- // color: #3f3f3f;
- // }
-
- .idCard-box {
- margin-top: 10%;
- width: 100%;
- height: 50%;
- display: flex;
- flex-direction: row;
- /* background-color: red; */
- flex-wrap: wrap;
-
- .reverse {
- height: 30%;
- width: 40%;
- display: flex;
- align-items: center;
- justify-content: center;
- // background-color: blue;
- margin: 0 5% 0 5%;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
-
- /* 表单分区样式 */
- .con_size {
- font-size: 1rem;
- font-weight: bold;
- margin: 1rem 0;
- color: #000000;
- display: flex;
- flex-direction: row;
- align-items: center;
- }
-
- .con_size_img{
- height: 100%;
- width: 2%;
- margin-right: 2%;
- }
-
-
- .form-button{
- width: 100%;
- height:100%;
- // background-color: #000000;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .button{
- height: 100%;
- width: 100%;
- background-color: #044f7a;
- color: #ffffff;
- border-radius: 1rem;
- }
- </style>
|