Commit 43da0b32 by 前端

fixed

1 parent 22891a8c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48 * @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-09 19:42:21 * @LastEditTime: 2024-04-09 20:49:12
* @FilePath: \gl_tape\mixin\click.js * @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -12,7 +12,6 @@ import { mapMutations, mapState } from "vuex"; ...@@ -12,7 +12,6 @@ import { mapMutations, mapState } from "vuex";
export default { export default {
data() { data() {
return { return {
receptionCustomerPaySourceList: [],
tipVisible: false, tipVisible: false,
voicePath: "", voicePath: "",
timer: null, timer: null,
...@@ -28,6 +27,7 @@ export default { ...@@ -28,6 +27,7 @@ export default {
computed: { computed: {
...mapState("audio", [ ...mapState("audio", [
"isEnd", "isEnd",
"booksList",
"audioList", "audioList",
"isStart", "isStart",
"receptionEndTime", "receptionEndTime",
...@@ -36,7 +36,12 @@ export default { ...@@ -36,7 +36,12 @@ export default {
...mapState(["user.customerInfo"]), ...mapState(["user.customerInfo"]),
}, },
methods: { methods: {
...mapMutations("audio", ["setAudioStart", "setAudioList", "setAudioEnd"]), ...mapMutations("audio", [
"setAudioStart",
"setAudioList",
"setAudioEnd",
"setBooks",
]),
//关闭提示 //关闭提示
tipCancel() { tipCancel() {
this.times = 0; this.times = 0;
...@@ -57,8 +62,7 @@ export default { ...@@ -57,8 +62,7 @@ export default {
const { merchantId, phone } = uni.$storage.get("userInfo"), const { merchantId, phone } = uni.$storage.get("userInfo"),
{ customerName, phoneNumber, salesUuid, carModel } = { customerName, phoneNumber, salesUuid, carModel } =
this.$store.state.user.customerInfo, this.$store.state.user.customerInfo,
receptionCustomerPaySourceList = receptionCustomerPaySourceList = this.booksList.map((item) => {
this.receptionCustomerPaySourceList.map((item) => {
return { return {
id: item.id, id: item.id,
sourceType: item.id, sourceType: item.id,
...@@ -80,6 +84,7 @@ export default { ...@@ -80,6 +84,7 @@ export default {
merchantId, merchantId,
}; };
console.log(params, "params"); console.log(params, "params");
this.setBooks([]);
uni.$api.commonApi.saveRecCustomer(params).then((res) => { uni.$api.commonApi.saveRecCustomer(params).then((res) => {
console.log(res); console.log(res);
}); });
...@@ -108,8 +113,7 @@ export default { ...@@ -108,8 +113,7 @@ export default {
}); });
}, },
//结束录音 //结束录音
stopAudio(receptionCustomerPaySourceList) { stopAudio() {
if (receptionCustomerPaySourceList) this.receptionCustomerPaySourceList;
this.setAudioStart(false); this.setAudioStart(false);
this.setAudioEnd(true); this.setAudioEnd(true);
recorderManager.stop(); recorderManager.stop();
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 14:54:28 * @Date: 2024-04-07 14:54:28
* @LastEditors: huyue * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-09 20:30:13 * @LastEditTime: 2024-04-09 20:46:24
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry">
...@@ -54,7 +54,9 @@ ...@@ -54,7 +54,9 @@
:isAutoClose="false" :isAutoClose="false"
> >
<view name="content"> <view name="content">
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view> <view class="error-tip" v-if="errorTip"
>以下信息不能为空,请完善信息后保存</view
>
<view class="pop-tips" v-else <view class="pop-tips" v-else
>检测到“交车通知书”中未填写客户档案,请填写后再完成接待。</view >检测到“交车通知书”中未填写客户档案,请填写后再完成接待。</view
> >
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,7 @@
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view class="form-item" :key="index"> <view class="form-item" :key="index">
<view class="label">{{ i.label }}</view> <view class="label">{{ i.label }}</view>
<view :class="['value', {error: i.error}]"> <view :class="['value', { error: i.error }]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input <input
:type="i.inputType" :type="i.inputType"
...@@ -153,6 +155,7 @@ const INFO_LIST = [ ...@@ -153,6 +155,7 @@ const INFO_LIST = [
]; ];
import myClick from "@/mixin/click"; import myClick from "@/mixin/click";
import env from "../../env"; import env from "../../env";
import { mapMutations } from "vuex";
export default { export default {
mixins: [myClick], mixins: [myClick],
data() { data() {
...@@ -202,7 +205,7 @@ export default { ...@@ -202,7 +205,7 @@ export default {
carlist: [], carlist: [],
employeeList: [], employeeList: [],
f_key: Date.now(), f_key: Date.now(),
errorTip: false errorTip: false,
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -211,12 +214,13 @@ export default { ...@@ -211,12 +214,13 @@ export default {
title: text, title: text,
}); });
this.$store.dispatch("getCustomerInfo").then((customerInfo) => { this.$store.dispatch("getCustomerInfo").then((customerInfo) => {
console.log(customerInfo,' =======') console.log(customerInfo, " =======");
this.formData = customerInfo this.formData = customerInfo;
this.isPass = Object.values(customerInfo).every((value) => !!value); this.isPass = Object.values(customerInfo).every((value) => !!value);
}); });
}, },
methods: { methods: {
...mapMutations("audio", ["setBooks"]),
// 上传图 // 上传图
choose(index) { choose(index) {
uni.chooseImage({ uni.chooseImage({
...@@ -266,22 +270,23 @@ export default { ...@@ -266,22 +270,23 @@ export default {
submit() { submit() {
console.log(this.formData); console.log(this.formData);
try { try {
for(let i in this.formData) { for (let i in this.formData) {
if (!this.formData[i] && i != 'salesUuid') throw i if (!this.formData[i] && i != "salesUuid") throw i;
} }
if (Object.values(this.formData).every((value) => !!value)) { if (Object.values(this.formData).every((value) => !!value)) {
this.messageBoxVisible = false; this.messageBoxVisible = false;
this.stopAudio(this.infoList); this.setBooks(this.infoList);
this.stopAudio();
uni.reLaunch({ uni.reLaunch({
url: "/pages/home/home", url: "/pages/home/home",
}); });
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
this.formObject.find(item => item.key == error).error = true this.formObject.find((item) => item.key == error).error = true;
console.log(this.formObject) console.log(this.formObject);
this.f_key = Date.now() this.f_key = Date.now();
this.errorTip = true this.errorTip = true;
} }
}, },
// 取消 // 取消
...@@ -301,20 +306,20 @@ export default { ...@@ -301,20 +306,20 @@ export default {
this.formData.staffName = item.staffName; this.formData.staffName = item.staffName;
} else this.formData.carModel = item.name; } else this.formData.carModel = item.name;
this.$store.dispatch("setCustomerInfo", this.formData); this.$store.dispatch("setCustomerInfo", this.formData);
console.log(this.formData) console.log(this.formData);
this.formObject.map(item => item.error = false) this.formObject.map((item) => (item.error = false));
this.f_key = Date.now() this.f_key = Date.now();
this.errorTip = false this.errorTip = false;
}, },
showPopup(e) { showPopup(e) {
this[e] = true; this[e] = true;
}, },
blur(popkey) { blur(popkey) {
console.log(popkey) console.log(popkey);
this.formObject.find(item => item.key == popkey).error = false this.formObject.find((item) => item.key == popkey).error = false;
this.f_key = Date.now() this.f_key = Date.now();
this.errorTip = false this.errorTip = false;
} },
}, },
}; };
</script> </script>
...@@ -457,7 +462,7 @@ export default { ...@@ -457,7 +462,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 0 40rpx; padding: 0 40rpx;
&.error { &.error {
border: 2rpx solid #F24724; border: 2rpx solid #f24724;
} }
.input, .input,
.select { .select {
......
...@@ -11,6 +11,7 @@ export default { ...@@ -11,6 +11,7 @@ export default {
namespaced: true, namespaced: true,
state() { state() {
return { return {
booksList: [],
audioList: [], audioList: [],
isStart: false, isStart: false,
isEnd: false, isEnd: false,
...@@ -22,6 +23,9 @@ export default { ...@@ -22,6 +23,9 @@ export default {
setAudioList(state, data) { setAudioList(state, data) {
state.audioList = data; state.audioList = data;
}, },
setBooks(state, data) {
state.booksList = data;
},
setAudioStart(state, data) { setAudioStart(state, data) {
state.isStart = data; state.isStart = data;
if (data) if (data)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!