合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

705 lines
20 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="containers">
  3. <view class="header">
  4. <view class="header_info">
  5. <view class="header_info_icon" @click.native.stop.prevent="toBack" style="display: flex; justify-content: center; align-items: center;">
  6. <uni-icons type="left" size="30" color="#c2d4de" > </uni-icons>
  7. </view>
  8. <text class="header_text">付款信息</text>
  9. </view>
  10. </view>
  11. <view class="section" style="margin-top: 5%;">
  12. <view class="form-item">
  13. <text class="label">付款方式</text>
  14. <l-radio :checked="clientInfo.payType === '全款'" label="全款" fontSize="1rem" style="transform: scale(0.7);">
  15. <template #icon="{checked}">
  16. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  17. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  18. </template>
  19. </l-radio>
  20. </view>
  21. <view class="form-item">
  22. <text class="label">客户类型</text>
  23. <l-radio-group @change="onChange" class="radio-group" >
  24. <l-radio :checked= "clientInfo.custType == 0?true:false" value="个人" label="个人" fontSize="1rem" style="margin-right: 1rem; transform: scale(0.7);">
  25. <template #icon="{checked}">
  26. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  27. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  28. </template>
  29. </l-radio>
  30. <l-radio :checked= "clientInfo.custType == 1?true:false" value="公司" label="公司" fontSize="1rem" style="transform: scale(0.7);">
  31. <template #icon="{checked}">
  32. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  33. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  34. </template>
  35. </l-radio>
  36. </l-radio-group>
  37. </view>
  38. </view>
  39. <view class="idCard-box">
  40. <view class="reverse">
  41. <image :src="clientInfo.certFront == ''?positiveImg:clientInfo.certFront" @tap.prevent="uploadPositive">
  42. </image>
  43. </view>
  44. <view class="reverse">
  45. <image :src="clientInfo.certBack == ''?reverseImg:clientInfo.certBack" @tap.prevent="uploadReverse">
  46. </image>
  47. </view>
  48. <view class="reverse">
  49. <image :src="clientInfo.carPic == ''?carImg:clientInfo.carPic" @tap.prevent="uploadCarCert">
  50. </image>
  51. </view>
  52. </view>
  53. <!-- 客户基本信息 -->
  54. <view class="section">
  55. <view class="con_size">
  56. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>
  57. 客户基本信息
  58. </view>
  59. <view class="form-item">
  60. <text class="labels">*</text>
  61. <text class="label">产品名称</text>
  62. <text class="value">{{ clientInfo.productName }}</text>
  63. </view>
  64. <view class="form-item">
  65. <text class="labels">*</text>
  66. <text class="label">经销商</text>
  67. <text class="value">{{ clientInfo.storeName }}</text>
  68. </view>
  69. <view class="form-item">
  70. <text class="labels">*</text>
  71. <text class="label">客户姓名</text>
  72. <input class="input" v-model="clientInfo.custName" placeholder="请输入客户姓名" />
  73. </view>
  74. <view class="form-item">
  75. <text class="labels">*</text>
  76. <text class="label">居住地址</text>
  77. <input class="input" v-model="clientInfo.custAddress" placeholder="请输入居住地址" />
  78. </view>
  79. <view class="form-item">
  80. <text class="labels">*</text>
  81. <text class="label">身份证号码</text>
  82. <input class="input" v-model="clientInfo.custCardNo" placeholder="请输入身份证号码" />
  83. </view>
  84. <view class="form-item">
  85. <text class="labels">*</text>
  86. <text class="label">联系方式</text>
  87. <input class="input" v-model="clientInfo.custPhone" placeholder="请输入联系方式" />
  88. </view>
  89. <view class="form-item">
  90. <text class="labels">*</text>
  91. <text class="label">销售端口</text>
  92. <l-radio-group class="radio-group" @change="handleDepartmentChange">
  93. <label class="radio-label" v-for="item in departments" :key="item">
  94. <l-radio :value="item" :checked="clientInfo.salePort === item" >
  95. <template #icon="{checked}">
  96. <image v-show="checked" style="width:1.2rem; height:1.2rem;" src="/static/image/xuanzhong.png"></image>
  97. <image v-show="!checked" style="width:1.2rem; height:1.2rem" src="/static/image/weixuanzhong.png"></image>
  98. </template>
  99. </l-radio>
  100. <text style="margin-left:0.2rem;">{{ item }}</text>
  101. </label>
  102. </l-radio-group>
  103. </view>
  104. <view class="form-item">
  105. <text class="labels">*</text>
  106. <text class="label">促销销售顾问</text>
  107. <input class="input" v-model="clientInfo.saleName" placeholder="请输入店铺销售顾问" />
  108. </view>
  109. </view>
  110. <!-- 车辆信息 -->
  111. <view class="section">
  112. <view class="con_size">
  113. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>车辆信息</view>
  114. <view class="form-item">
  115. <text class="labels">*</text>
  116. <text class="label">车牌车系</text>
  117. <picker class="picker" @change="bindCarBrandChange" :value="carBrandIndex" :range="carBrands">
  118. <view class="picker-text">{{ clientInfo.appOrderCarList[0].carSeries || '请选择车辆品牌 >' }}</view>
  119. </picker>
  120. </view>
  121. <view class="form-item">
  122. <text class="labels">*</text>
  123. <text class="label">车架号</text>
  124. <input class="input" v-model="clientInfo.appOrderCarList[0].vin" placeholder="请填写车架号" />
  125. </view>
  126. </view>
  127. <!-- 产品描述 -->
  128. <view class="section">
  129. <view class="con_size">
  130. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>产品信息</view>
  131. <view class="form-item">
  132. <text class="labels">*</text>
  133. <text class="label">产品名称</text>
  134. <text class="value">{{ clientInfo.productName }}</text>
  135. </view>
  136. <view class="form-item">
  137. <text class="labels">*</text>
  138. <text class="label">服务年龄</text>
  139. <picker class="picker" @change="bindServiceAgeChange" :value="serviceAgeIndex" :range="serviceAges">
  140. <view class="picker-text">{{ serviceAges[serviceAgeIndex] || '请选择服务年限 >' }}</view>
  141. </picker>
  142. </view>
  143. <view class="form-item">
  144. <text class="labels">*</text>
  145. <text class="label">销售金额</text>
  146. <input class="input" v-model="clientInfo.productMoney" placeholder="请输入销售金额" />
  147. </view>
  148. </view>
  149. <!-- 付款信息 -->
  150. <view class="section">
  151. <view class="con_size">
  152. <image src="/static/image/矩形 5315.png" class='con_size_img' ></image>付款信息</view>
  153. <view class="form-item">
  154. <text class="labels">*</text>
  155. <text class="label">收款方</text>
  156. <picker class="picker" @change="bindPayeeChange" :value="payeeIndex" :range="payees">
  157. <view class="picker-text">{{ this.clientInfo.payee || '请选择收款方 >' }}</view>
  158. </picker>
  159. </view>
  160. <view class="form-item">
  161. <text class="labels">*</text>
  162. <text class="label">付款时间</text>
  163. <uni-datetime-picker type="datetime" v-model="clientInfo.payeeTime" :clearIcon="false" :border="false">
  164. </uni-datetime-picker>
  165. </view>
  166. <view class="con_size">
  167. <text class="labels">*</text>
  168. <text class="label">支付凭证</text>
  169. <uv-upload
  170. :fileList="fileList1"
  171. name="1"
  172. multiple
  173. :maxCount="1"
  174. @afterRead="afterRead"
  175. @delete="deletePic"
  176. ><image
  177. src="/static/image/组件 5 – 1.png"
  178. mode="widthFix"
  179. style="width: 100px;height: 150px;"
  180. ></image></uv-upload>
  181. </view>
  182. </view>
  183. <view class="sections">
  184. <view class="form-button">
  185. <button class=" button" @click="get_to" style="width: 60%;">提交去录单</button>
  186. </view>
  187. </view>
  188. </view>
  189. </template>
  190. <script>
  191. import {idCardInfo,carCert,upload,getChildListBatch,add,isToken} from '@/api.uts'
  192. export default {
  193. data() {
  194. return {
  195. uploadConfig:{
  196. // 上传地址
  197. url:'https://gpt.aiym.run/contract/miniapp/file/upload',
  198. // 文件字段名
  199. name: 'file',
  200. // 请求头
  201. header: {},
  202. // 附带的表单数据
  203. formData: {
  204. 'biz': 'cert'
  205. },
  206. // 是否开启实际上传
  207. enabled: true
  208. },
  209. clientInfo: {
  210. appOrderCarList: [
  211. {
  212. buyMoney: 0,
  213. buyTax: 0,
  214. buyTime: "",
  215. carModel: "",
  216. carNo: "",
  217. carSeries: "",
  218. carType: "",
  219. createBy: "",
  220. createTime: "",
  221. engineNo: "",
  222. id: "",
  223. mileage: "",
  224. newCar: 0,
  225. orderFkId: "",
  226. sysOrgCode: "",
  227. updateBy: "",
  228. updateTime: "",
  229. useType: "",
  230. vin: ""
  231. }
  232. ],
  233. appOrderFinanceList: [
  234. {
  235. createBy: "",
  236. createTime: "",
  237. id: "",
  238. lender: "",
  239. lenderMone: 0,
  240. lenderYear: "",
  241. orderFkId: "",
  242. sysOrgCode: "",
  243. updateBy: "",
  244. updateTime: ""
  245. }
  246. ],
  247. appOrderVoucherList: [
  248. {
  249. assigneeCardNo: "",
  250. assigneeName: "",
  251. assigneePhone: "",
  252. carInsuranceNo: "",
  253. createBy: "",
  254. createTime: "",
  255. dealerAddress: "",
  256. effectiveTime: "",
  257. endTime: "",
  258. equityPackage: "",
  259. firstBeneficiary: "",
  260. id: "",
  261. insuranceName: "",
  262. orderFkId: "",
  263. packageMoney: 0,
  264. payTime: "",
  265. registeredCity: "",
  266. serviceMoney: 0,
  267. serviceYear: "",
  268. sysOrgCode: "",
  269. updateBy: "",
  270. updateTime: ""
  271. }
  272. ],
  273. busLicense: "",
  274. carPic: "",
  275. certBack: "",
  276. certFront: "",
  277. contractUrl: "",
  278. createBy: "",
  279. createTime: "",
  280. custAddress: "",
  281. custCardNo: "",
  282. custName: "",
  283. custPhone: "",
  284. custType: 0,
  285. id: "",
  286. orderNum: "",
  287. payType: '全款', // 默认选中全款
  288. payVoucherUrl: "",
  289. payee: "",
  290. payeeTime: "",
  291. productContractTemp: "",
  292. productMone : null,
  293. productName: "自动填写所选商品服务分类",
  294. productServiceYear: "",
  295. saleName: "",
  296. salePort: ''||"售前",
  297. status: 0,
  298. storeName: "自动填写所选择的门店",
  299. sysOrgCode: "",
  300. updateBy: "",
  301. updateTime: ""
  302. },
  303. fileList1:[],
  304. departments: ['售前', '售后', '二网车'],
  305. carBrands: [],
  306. carBrandIndex: -1,
  307. serviceAges: ['1年', '2年', '3年'],
  308. serviceAgeIndex: -1,
  309. payees: [],
  310. payeeIndex: -1,
  311. // 扫描
  312. positiveImg: '/static/image/组件 4 – 1.png',//自己图片路径
  313. // 反面身份证
  314. reverseImg: '/static/image/组 71663.png', //自己图片路径
  315. // 行车驾驶证
  316. carImg: '/static/image/组件 2 – 1.png' //自己图片路径
  317. }
  318. },
  319. mounted() {
  320. isToken();
  321. this.clientInfo.storeName = getApp().storeName || "自动填写所选择的门店";
  322. this.clientInfo.productName = getApp().productName || "自动填写所选商品服务分类";
  323. for (var index = 0; index < getApp().allMsg.length; index++) {
  324. this.payees.push(getApp().allMsg[index].storeName);
  325. }
  326. this.clientInfo.payee = getApp().storeName;
  327. this.uploadConfig.header = {
  328. 'X-Access-Token':uni.getStorageSync('token')
  329. }
  330. getChildListBatch().then((res)=>{
  331. console.log(res.result.records)
  332. this.carBrands = [];
  333. for (var index = 0; index < res.result.records.length; index++) {
  334. this.carBrands.push(res.result.records[index].name);
  335. }
  336. })
  337. },
  338. methods: {
  339. // 凭证上传函数
  340. deletePic(event) {
  341. this[`fileList${event.name}`].splice(event.index, 1)
  342. },
  343. // 新增图片
  344. async afterRead(event) {
  345. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  346. let lists = [].concat(event.file)
  347. let fileListLen = this[`fileList${event.name}`].length
  348. lists.map((item) => {
  349. this[`fileList${event.name}`].push({
  350. ...item,
  351. status: 'uploading',
  352. message: '上传中'
  353. })
  354. })
  355. for (let i = 0; i < lists.length; i++) {
  356. const result = await this.uploadFilePromise(lists[i].url)
  357. let item = this[`fileList${event.name}`][fileListLen]
  358. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  359. status: 'success',
  360. message: '',
  361. url: result
  362. }))
  363. fileListLen++
  364. }
  365. },
  366. uploadFilePromise(url) {
  367. let token = uni.getStorageSync('token')
  368. return new Promise((resolve, reject) => {
  369. let a = uni.uploadFile({
  370. url: 'https://gpt.aiym.run/contract/miniapp/file/upload', // 仅为示例,非真实的接口地址
  371. filePath: url,
  372. name: 'file',
  373. formData: {
  374. biz: 'test'
  375. },
  376. header:{
  377. 'X-Access-Token':token
  378. },
  379. success: (res) => {
  380. this.clientInfo.payVoucherUrl = JSON.parse(res.data).message;
  381. setTimeout(() => {
  382. resolve(res.data.data)
  383. }, 1000)
  384. }
  385. });
  386. })
  387. },
  388. get_to(){
  389. console.log('clientInfo', JSON.parse(JSON.stringify(this.clientInfo)));
  390. add(JSON.parse(JSON.stringify(this.clientInfo))).then((res)=>{
  391. console.log(res)
  392. })
  393. uni.switchTab (
  394. { url: '/pages/index/dingdan' }
  395. )
  396. },
  397. toBack(){
  398. let canNavBack = getCurrentPages()
  399. if( canNavBack && canNavBack.length>1) {
  400. uni.navigateBack()
  401. } else {
  402. history.back();
  403. }
  404. },
  405. handleDepartmentChange(e) {
  406. this.clientInfo.salePort = e;
  407. },
  408. // 修改车辆品牌
  409. bindCarBrandChange(e) {
  410. this.carBrandIndex = e.detail.value
  411. this.clientInfo.appOrderCarList[0].carSeries = this.carBrands[this.carBrandIndex];
  412. },
  413. // 取服务年限
  414. bindServiceAgeChange(e) {
  415. this.serviceAgeIndex = e.detail.value
  416. this.clientInfo.productServiceYear = this.serviceAges[e.detail.value];
  417. },
  418. // 选择收款方
  419. bindPayeeChange(e) {
  420. this.payeeIndex = e.detail.value
  421. this.clientInfo.payee= this.payees[e.detail.value];
  422. },
  423. // 身份证正面上传
  424. uploadPositive() {
  425. uni.chooseImage({
  426. count: 1,
  427. sizeType: ['original', 'compressed'],
  428. sourceType: ['album', 'camera'],
  429. success: (res) => {
  430. let filePath = res.tempFilePaths[0];
  431. let token = uni.getStorageSync('token');
  432. this.uploadIdentify(token,'front',filePath,'sfz');
  433. }
  434. })
  435. },
  436. // 身份证反面上传
  437. uploadReverse() {
  438. uni.chooseImage({
  439. count: 1,
  440. sizeType: ['original', 'compressed'],
  441. sourceType: ['album', 'camera'],
  442. success: (res) => {
  443. let filePath = res.tempFilePaths[0];
  444. let token = uni.getStorageSync('token');
  445. this.uploadIdentify(token,'back',filePath,'sfz')
  446. }
  447. })
  448. },
  449. uploadCarCert() {
  450. uni.chooseImage({
  451. count: 1,
  452. sizeType: ['original', 'compressed'],
  453. sourceType: ['album', 'camera'],
  454. success: (res) => {
  455. let filePath = res.tempFilePaths[0];
  456. let token = uni.getStorageSync('token');
  457. this.uploadIdentify(token,'',filePath,'carCert')
  458. }
  459. })
  460. },
  461. // 上传识别
  462. uploadIdentify(token,side,filePath,type) {
  463. uni.uploadFile({
  464. url: 'https://gpt.aiym.run/contract/miniapp/file/upload', //仅为示例,非真实的接口地址
  465. filePath:filePath,
  466. name: 'file',
  467. formData: {
  468. 'biz': 'cert'
  469. },
  470. header:{
  471. 'X-Access-Token':token
  472. },
  473. success: (res) => {
  474. if(type == "sfz"){
  475. idCardInfo({'side':side,'url':JSON.parse(res.data).message}).then((res)=>{
  476. if(res.success){
  477. if(side == 'front'){
  478. this.clientInfo.custName =res.result.name;
  479. this.clientInfo.custAddress= res.result.address;
  480. this.clientInfo.custCardNo = res.result.idCard ;
  481. this.clientInfo.certFront = filePath;
  482. }else {
  483. this.clientInfo.certBack=filePath;
  484. }
  485. }else{
  486. uni.showToast({
  487. title: "身份证识别错误,请重新上传!",
  488. icon: 'error',
  489. duration: 500,
  490. success: (res) => {
  491. },
  492. fail: (res) => {
  493. },
  494. })
  495. }
  496. }).catch(err => {
  497. console.log("catch: ", err);
  498. })
  499. }else if(type == 'carCert' ){
  500. // 处理车辆信息
  501. carCert({'url':JSON.parse(res.data).message}).then((res)=>{
  502. if(res.success){
  503. console.log('res',res)
  504. // 车牌车系
  505. this.clientInfo.appOrderCarList[0].carSeries = res.result.CarBrand;
  506. // 车架号
  507. this.clientInfo.appOrderCarList[0].vin = res.result.VinNo;
  508. this.clientInfo.carPic = filePath;
  509. }else{
  510. uni.showToast({
  511. title: "识别错误,请重新上传!",
  512. icon: 'error',
  513. duration: 500,
  514. success: (res) => {
  515. },
  516. fail: (res) => {
  517. },
  518. })
  519. }
  520. }).catch((err)=>{
  521. console.log("catch: ", err);
  522. })
  523. }
  524. },
  525. fail:(err)=>{
  526. console.log(err)
  527. }
  528. });
  529. },
  530. onChange(e){
  531. console.log("e",e);
  532. if(e = '个人'){
  533. this.clientInfo.custType = 0;
  534. }else{
  535. this.clientInfo.custType = 1;
  536. }
  537. }
  538. }
  539. }
  540. </script>
  541. <style scoped lang="scss">
  542. .containers {
  543. height: 100%;
  544. width: 100%;
  545. background-color: #fff;
  546. overflow-y:scroll;
  547. }
  548. .container::-webkit-scrollbar {
  549. display: none;
  550. }
  551. .section {
  552. // margin-bottom: 30rpx;
  553. border-bottom: 1rpx solid #eee;
  554. margin: 0 1rem 0 1rem;
  555. }
  556. .sections{
  557. margin: 0 1rem 1rem 1rem;
  558. }
  559. .form-item {
  560. display: flex;
  561. flex-direction: row;
  562. justify-content: space-between;
  563. align-items: center;
  564. padding: 0.5rem 0;
  565. border-bottom: 0.1rem solid #f2f2f2;
  566. color: #767676;
  567. }
  568. .labels{
  569. color: red;
  570. display: flex;
  571. justify-content: center;
  572. align-items: center;
  573. }
  574. .label {
  575. font-size: 28rpx;
  576. color: #666;
  577. width: 200rpx;
  578. }
  579. .input {
  580. flex: 1;
  581. text-align: right;
  582. font-size: 28rpx;
  583. color: #737373;
  584. }
  585. .picker {
  586. flex: 1;
  587. }
  588. .picker-text {
  589. text-align: right;
  590. color: #737373;
  591. font-size: 0.8rem;
  592. }
  593. .radio-group {
  594. display: flex;
  595. flex: 1;
  596. justify-content: flex-end;
  597. flex-direction: row;
  598. }
  599. .radio-label {
  600. padding: 0;
  601. margin-left: 10rpx;
  602. display: flex;
  603. flex-direction: row;
  604. font-size: 1rem;
  605. transform: scale(0.7);
  606. }
  607. .value {
  608. flex: 1;
  609. text-align: right;
  610. color: #737373;
  611. font-size: 0.8rem;
  612. }
  613. // .timePiker{
  614. // display: flex;
  615. // justify-content: center;
  616. // align-items: center;
  617. // color: #3f3f3f;
  618. // }
  619. .idCard-box {
  620. margin-top: 10%;
  621. width: 100%;
  622. height: 50%;
  623. display: flex;
  624. flex-direction: row;
  625. /* background-color: red; */
  626. flex-wrap: wrap;
  627. .reverse {
  628. height: 30%;
  629. width: 40%;
  630. display: flex;
  631. align-items: center;
  632. justify-content: center;
  633. // background-color: blue;
  634. margin: 0 5% 0 5%;
  635. image {
  636. width: 100%;
  637. height: 100%;
  638. }
  639. }
  640. }
  641. /* 表单分区样式 */
  642. .con_size {
  643. font-size: 1rem;
  644. font-weight: bold;
  645. margin: 1rem 0;
  646. color: #000000;
  647. display: flex;
  648. flex-direction: row;
  649. align-items: center;
  650. }
  651. .con_size_img{
  652. height: 100%;
  653. width: 2%;
  654. margin-right: 2%;
  655. }
  656. .form-button{
  657. width: 100%;
  658. height:100%;
  659. // background-color: #000000;
  660. display: flex;
  661. align-items: center;
  662. justify-content: center;
  663. }
  664. .button{
  665. height: 100%;
  666. width: 100%;
  667. background-color: #044f7a;
  668. color: #ffffff;
  669. border-radius: 1rem;
  670. }
  671. </style>