@@ -13,7 +13,8 @@ let zaudio = new ZAudio({ | |||||
Vue.prototype.$zaudio = zaudio | Vue.prototype.$zaudio = zaudio | ||||
Vue.prototype.$dayjs = dayjs; | Vue.prototype.$dayjs = dayjs; | ||||
import common from 'utils/common.js' | |||||
Vue.prototype.$noMultipleClicks = common.noMultipleClicks; | |||||
// 引入全局uView | // 引入全局uView | ||||
@@ -317,7 +317,25 @@ | |||||
<!-- 加入常错词 --> | <!-- 加入常错词 --> | ||||
<view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | <view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | ||||
<view class="bounced" v-if="isshow2"> | |||||
<u-modal v-model="isshow2" title="添加常错词" :show-cancel-button="true" @cancel="Cancelout" @confirm="Confirmtheexit"> | |||||
<view class="tian-view"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">常错词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<textarea :auto-height="true" type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
<view class="tian-view" style="margin-bottom: 74rpx;"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">正确词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
</u-modal> | |||||
<!-- <view class="bounced" v-if="isshow2"> | |||||
<view class="tian-view"> | <view class="tian-view"> | ||||
<viwe class="tian-view-t1"></viwe> | <viwe class="tian-view-t1"></viwe> | ||||
<viwe class="tian-view-t2">常错词:</viwe> | <viwe class="tian-view-t2">常错词:</viwe> | ||||
@@ -336,7 +354,7 @@ | |||||
<view class="bounced3-1" @tap="Cancelout">取消</view> | <view class="bounced3-1" @tap="Cancelout">取消</view> | ||||
<view class="bounced3-2" @tap="Confirmtheexit">确认</view> | <view class="bounced3-2" @tap="Confirmtheexit">确认</view> | ||||
</view> | </view> | ||||
</view> | |||||
</view> --> | |||||
<!-- 加精华 --> | <!-- 加精华 --> | ||||
<view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | ||||
@@ -2373,4 +2391,7 @@ | |||||
.rotatearrow { | .rotatearrow { | ||||
transform: rotate(270deg); | transform: rotate(270deg); | ||||
} | } | ||||
/deep/ .u-model-title{ | |||||
padding: 34rpx 0 16rpx !important; | |||||
} | |||||
</style> | </style> |
@@ -74,6 +74,7 @@ | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
noClick:true, | |||||
tabbarList:tabbarList, | tabbarList:tabbarList, | ||||
current: 0, | current: 0, | ||||
buildingID: '', | buildingID: '', | ||||
@@ -213,24 +214,27 @@ | |||||
content: "确定更改当前客户接待状态为结束?", | content: "确定更改当前客户接待状态为结束?", | ||||
cancelColor: "#999999", | cancelColor: "#999999", | ||||
success: res => { | success: res => { | ||||
if (res.confirm) { | |||||
let that = this | |||||
clearTimeout(this.fdFlag) | |||||
this.fdFlag = setTimeout(() => { | |||||
this.$u.post("/customer/endReception", { | |||||
id: id, | |||||
houseId: this.buildingID | |||||
}).then(res => { | |||||
uni.showToast({ | |||||
icon: "none", | |||||
title: "操作成功" | |||||
}) | |||||
this.init(); | |||||
}); | |||||
that.fdFlag = null; | |||||
}, 500) | |||||
if (this.noClick) { | |||||
this.noClick= false; | |||||
if (res.confirm) { | |||||
if (res.confirm) { | |||||
this.$u.post("/customer/endReception", { | |||||
id: id, | |||||
houseId: this.buildingID | |||||
}).then(res => { | |||||
uni.showToast({ | |||||
icon: "none", | |||||
title: "操作成功" | |||||
}) | |||||
this.init(); | |||||
}); | |||||
} | |||||
} | |||||
setTimeout(()=> { | |||||
this.noClick= true; | |||||
}, 2000) | |||||
} else { | |||||
// 这里是重复点击的判断 | |||||
} | } | ||||
} | } | ||||
}) | }) | ||||
@@ -117,12 +117,30 @@ | |||||
</view> | </view> | ||||
<!-- 加入常错词 --> | <!-- 加入常错词 --> | ||||
<view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | <view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | ||||
<view class="bounced" v-if="isshow2"> | |||||
<u-modal v-model="isshow2" title="添加常错词" :show-cancel-button="true" @cancel="Cancelout" @confirm="Confirmtheexit"> | |||||
<view class="tian-view"> | <view class="tian-view"> | ||||
<viwe class="tian-view-t1"></viwe> | <viwe class="tian-view-t1"></viwe> | ||||
<viwe class="tian-view-t2">常错词:</viwe> | <viwe class="tian-view-t2">常错词:</viwe> | ||||
<viwe class="tian-view-t3"> | <viwe class="tian-view-t3"> | ||||
<input type="text" v-model="thewrongword" :disabled="true" class="tian-input" placeholder="请输入" /> | |||||
<textarea :auto-height="true" type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
<view class="tian-view" style="margin-bottom: 74rpx;"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">正确词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
</u-modal> | |||||
<!-- <view class="bounced" v-if="isshow2"> | |||||
<view class="tian-view"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">常错词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<input type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" /> | |||||
</viwe> | </viwe> | ||||
</view> | </view> | ||||
<view class="tian-view"> | <view class="tian-view"> | ||||
@@ -136,7 +154,7 @@ | |||||
<view class="bounced3-1" @tap="Cancelout">取消</view> | <view class="bounced3-1" @tap="Cancelout">取消</view> | ||||
<view class="bounced3-2" @tap="Confirmtheexit">确认</view> | <view class="bounced3-2" @tap="Confirmtheexit">确认</view> | ||||
</view> | </view> | ||||
</view> | |||||
</view> --> | |||||
<!-- 加精华 --> | <!-- 加精华 --> | ||||
<view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | ||||
<view class="bounced" v-if="isshow3"> | <view class="bounced" v-if="isshow3"> | ||||
@@ -251,10 +269,11 @@ | |||||
name: '其他' | name: '其他' | ||||
} | } | ||||
], | ], | ||||
effectiveitext: '', | |||||
textItself: '', | |||||
argtextindex1: 0, | |||||
argtextindex2: 0 | |||||
effectiveitext:'', | |||||
textItself:'', | |||||
argtextindex1:0, | |||||
argtextindex2:0, | |||||
isNum:false | |||||
}; | }; | ||||
}, | }, | ||||
@@ -696,50 +715,58 @@ | |||||
}, | }, | ||||
//确认加入常错词 | //确认加入常错词 | ||||
Confirmtheexit() { | Confirmtheexit() { | ||||
let reg = /^[0-9]+$/ | |||||
if(reg.test(this.thewrongword)){ | |||||
if(this.reswrongword.length>8 || this.thewrongword.length>8){ | |||||
this.$refs.uToast.show({ | this.$refs.uToast.show({ | ||||
title: '错误词不能为纯数字', | |||||
title: '正确词错误词不能超过8个字', | |||||
type: 'warning', | type: 'warning', | ||||
}) | }) | ||||
}else{ | }else{ | ||||
if (this.thewrongword) { | |||||
if (this.reswrongword) { | |||||
let parames = { | |||||
customerId: this.customerId, | |||||
cupid: this.luyinList[this.csdFileindex].id, | |||||
wrongWord: this.thewrongword, //错误词 | |||||
correctWord: this.reswrongword, //正确词 | |||||
translateHtmlContent: this.messagelisy, | |||||
} | |||||
this.isshow2 = false; | |||||
let sas = this.textItself.replace(this.thewrongword, this.reswrongword) | |||||
this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas | |||||
this.dialogList.forEach(res => { | |||||
res.message.forEach(asd => { | |||||
asd.isshow = false; | |||||
}) | |||||
}) | |||||
this.$u.post("/corpus/addCorrectWord", parames).then(data => { | |||||
this.thewrongword = ""; | |||||
this.reswrongword = ""; | |||||
let reg = /^[0-9]+$/ | |||||
if(reg.test(this.thewrongword)){ | |||||
this.$refs.uToast.show({ | |||||
title: '错误词不能为纯数字', | |||||
type: 'warning', | |||||
}) | }) | ||||
}else{ | |||||
if (this.thewrongword) { | |||||
if (this.reswrongword) { | |||||
let parames = { | |||||
customerId:this.customerId, | |||||
cupid: this.luyinList[this.csdFileindex].id, | |||||
wrongWord: this.thewrongword, //错误词 | |||||
correctWord: this.reswrongword, //正确词 | |||||
translateHtmlContent: this.messagelisy, | |||||
} | |||||
this.isshow2 = false; | |||||
let sas=this.textItself.replace(this.thewrongword,this.reswrongword) | |||||
this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest=sas | |||||
this.dialogList.forEach(res => { | |||||
res.message.forEach(asd => { | |||||
asd.isshow = false; | |||||
}) | |||||
}) | |||||
this.$u.post("/corpus/addCorrectWord", parames).then(data => { | |||||
this.thewrongword = ""; | |||||
this.reswrongword = ""; | |||||
}) | |||||
} else { | |||||
uni.showToast({ | |||||
title: '正确值不能为空', | |||||
duration: 2000 | |||||
}); | |||||
return | |||||
} | |||||
} else { | } else { | ||||
uni.showToast({ | uni.showToast({ | ||||
title: '正确值不能为空', | |||||
title: '错误词不能为空', | |||||
duration: 2000 | duration: 2000 | ||||
}); | }); | ||||
return | return | ||||
} | } | ||||
} else { | |||||
uni.showToast({ | |||||
title: '错误词不能为空', | |||||
duration: 2000 | |||||
}); | |||||
return | |||||
} | |||||
} | |||||
} | } | ||||
}, | }, | ||||
//取消加入常错词 | //取消加入常错词 | ||||
Cancelout() { | Cancelout() { | ||||
@@ -752,8 +779,13 @@ | |||||
}, | }, | ||||
//加入长错词 | //加入长错词 | ||||
Oftenthewrongword() { | Oftenthewrongword() { | ||||
this.isNum = false; | |||||
this.reswrongword = ""; | this.reswrongword = ""; | ||||
this.isshow2 = true; | this.isshow2 = true; | ||||
let reg = /^[0-9]+$/ | |||||
if (reg.test(this.thewrongword)) { | |||||
this.isNum = true | |||||
} | |||||
}, | }, | ||||
//加精华 | //加精华 | ||||
Addtheessence() { | Addtheessence() { | ||||
@@ -1779,4 +1811,7 @@ | |||||
color: #333333; | color: #333333; | ||||
} | } | ||||
} | } | ||||
/deep/ .u-model-title{ | |||||
padding: 34rpx 0 16rpx !important; | |||||
} | |||||
</style> | </style> |
@@ -125,13 +125,31 @@ | |||||
</view> | </view> | ||||
<view class="bounced3" style="margin-top: 20rpx;"> | <view class="bounced3" style="margin-top: 20rpx;"> | ||||
<view class="bounced3-1" @tap="unmarktap()">取消</view> | <view class="bounced3-1" @tap="unmarktap()">取消</view> | ||||
<view class="bounced3-2" @tap="Confirmthetag()">确认</view> | |||||
<view class="bounced3-2" @tap="$noMultipleClicks(Confirmthetag)">确认</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<!-- 加入常错词 --> | <!-- 加入常错词 --> | ||||
<view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | |||||
<view class="bounced" v-if="isshow2"> | |||||
<view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view> | |||||
<u-modal v-model="isshow2" title="添加常错词" :show-cancel-button="true" @cancel="Cancelout" @confirm="$noMultipleClicks(Confirmtheexit)"> | |||||
<view class="tian-view"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">常错词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<textarea :auto-height="true" type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
<view class="tian-view" style="margin-bottom: 74rpx;"> | |||||
<viwe class="tian-view-t1"></viwe> | |||||
<viwe class="tian-view-t2">正确词:</viwe> | |||||
<viwe class="tian-view-t3"> | |||||
<input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" /> | |||||
</viwe> | |||||
</view> | |||||
</u-modal> | |||||
<!-- <view class="bounced" v-if="isshow2"> | |||||
<view class="tian-view"> | <view class="tian-view"> | ||||
<viwe class="tian-view-t1"></viwe> | <viwe class="tian-view-t1"></viwe> | ||||
<viwe class="tian-view-t2">常错词:</viwe> | <viwe class="tian-view-t2">常错词:</viwe> | ||||
@@ -149,8 +167,8 @@ | |||||
<view class="bounced3"> | <view class="bounced3"> | ||||
<view class="bounced3-1" @tap="Cancelout">取消</view> | <view class="bounced3-1" @tap="Cancelout">取消</view> | ||||
<view class="bounced3-2" @tap="Confirmtheexit">确认</view> | <view class="bounced3-2" @tap="Confirmtheexit">确认</view> | ||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> --> | |||||
<!-- 加精华 --> | <!-- 加精华 --> | ||||
<view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view> | ||||
@@ -165,7 +183,7 @@ | |||||
</view> | </view> | ||||
<view class="bounced3"> | <view class="bounced3"> | ||||
<view class="bounced3-1" @tap="Cancelout2">取消</view> | <view class="bounced3-1" @tap="Cancelout2">取消</view> | ||||
<view class="bounced3-2" @tap="Confirmtheexit2">确认</view> | |||||
<view class="bounced3-2" @tap="$noMultipleClicks(Confirmtheexit2)">确认</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -356,7 +374,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="calibration" @click="tocalibration()">校准</view> | |||||
<view class="calibration" @click="$noMultipleClicks(tocalibration)">校准</view> | |||||
</view> | </view> | ||||
<view class="zhezhoa" v-if="effective"></view> | <view class="zhezhoa" v-if="effective"></view> | ||||
@@ -380,7 +398,7 @@ | |||||
</view> | </view> | ||||
<view class="bounced3"> | <view class="bounced3"> | ||||
<view class="bounced3-1" @click="effective=false">取消</view> | <view class="bounced3-1" @click="effective=false">取消</view> | ||||
<view class="bounced3-2" @click="effectiveAdd()">确认</view> | |||||
<view class="bounced3-2" @click="$noMultipleClicks(effectiveAdd)">确认</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -400,11 +418,13 @@ | |||||
</view> | </view> | ||||
<view class="bounced3" style="margin-top: 20rpx;"> | <view class="bounced3" style="margin-top: 20rpx;"> | ||||
<view class="bounced3-1" @tap="unmarktap()">取消</view> | <view class="bounced3-1" @tap="unmarktap()">取消</view> | ||||
<view class="bounced3-2" @tap="roletab()">确认</view> | |||||
<view class="bounced3-2" @tap="$noMultipleClicks(roletab)">确认</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
</view> | |||||
<u-toast ref="uToast" /> | |||||
</view> | |||||
</template> | </template> | ||||
<script> | <script> | ||||
@@ -823,23 +843,33 @@ | |||||
uni.showModal({ | uni.showModal({ | ||||
title: '提示', | title: '提示', | ||||
content: msg, | content: msg, | ||||
success: function(res) { | |||||
if (res.confirm) { | |||||
let parames = { | |||||
id: that.customerId, | |||||
validInvalid: '', | |||||
invalidReason: 0 | |||||
} | |||||
if (that.userlistobj.validInvalid == 0) { | |||||
parames.validInvalid = 1; | |||||
} else { | |||||
parames.validInvalid = 0; | |||||
} | |||||
that.$u.post("/customer/updateValidInvalid", parames).then(res => { | |||||
console.log(res) | |||||
that.Thetapeidisshow = false; | |||||
}) | |||||
} | |||||
success: function(res) { | |||||
if (this.noClick) { | |||||
this.noClick= false; | |||||
if (res.confirm) { | |||||
let parames = { | |||||
id: that.customerId, | |||||
validInvalid: '', | |||||
invalidReason: 0 | |||||
} | |||||
if (that.userlistobj.validInvalid == 0) { | |||||
parames.validInvalid = 1; | |||||
} else { | |||||
parames.validInvalid = 0; | |||||
} | |||||
that.$u.post("/customer/updateValidInvalid", parames).then(res => { | |||||
console.log(res) | |||||
that.Thetapeidisshow = false; | |||||
}) | |||||
} | |||||
setTimeout(()=> { | |||||
this.noClick= true; | |||||
}, 2000) | |||||
} else { | |||||
// 这里是重复点击的判断 | |||||
} | |||||
} | } | ||||
}); | }); | ||||
} else { | } else { | ||||
@@ -1287,14 +1317,16 @@ | |||||
this.$refs.uToast.show({ | this.$refs.uToast.show({ | ||||
title: '正确词错误词不能超过8个字', | title: '正确词错误词不能超过8个字', | ||||
type: 'warning', | type: 'warning', | ||||
}) | |||||
}) | |||||
this.isshow2 = true; | |||||
} else { | } else { | ||||
let reg = /^[0-9]+$/ | let reg = /^[0-9]+$/ | ||||
if (reg.test(this.thewrongword)) { | if (reg.test(this.thewrongword)) { | ||||
this.$refs.uToast.show({ | this.$refs.uToast.show({ | ||||
title: '错误词不能为纯数字', | title: '错误词不能为纯数字', | ||||
type: 'warning', | type: 'warning', | ||||
}) | |||||
}) | |||||
this.isshow2 = true; | |||||
} else { | } else { | ||||
if (this.thewrongword) { | if (this.thewrongword) { | ||||
if (this.reswrongword) { | if (this.reswrongword) { | ||||
@@ -1321,18 +1353,20 @@ | |||||
this.thewrongword = ""; | this.thewrongword = ""; | ||||
this.reswrongword = ""; | this.reswrongword = ""; | ||||
}) | }) | ||||
} else { | |||||
uni.showToast({ | |||||
title: '正确值不能为空', | |||||
duration: 2000 | |||||
}); | |||||
} else { | |||||
this.$refs.uToast.show({ | |||||
title: '正确值不能为空', | |||||
type: 'warning', | |||||
}) | |||||
this.isshow2 = true; | |||||
return | return | ||||
} | } | ||||
} else { | |||||
uni.showToast({ | |||||
title: '错误词不能为空', | |||||
duration: 2000 | |||||
}); | |||||
} else { | |||||
this.$refs.uToast.show({ | |||||
title: '错误词不能为空', | |||||
type: 'warning', | |||||
}) | |||||
this.isshow2 = true; | |||||
return | return | ||||
} | } | ||||
} | } | ||||
@@ -2628,6 +2662,9 @@ | |||||
height: 100rpx; | height: 100rpx; | ||||
padding: 20rpx; | padding: 20rpx; | ||||
border: 1rpx solid #E4F0FF; | border: 1rpx solid #E4F0FF; | ||||
} | |||||
/deep/ .u-model-title{ | |||||
padding: 34rpx 0 16rpx !important; | |||||
} | } | ||||
@@ -70,7 +70,7 @@ | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="clive" @click.stop="btnSave" :style="{background:(isBand==false?'#2671E2':'#949494')}">确定</view> | |||||
<view class="clive" @click.stop="$noMultipleClicks(save)" :style="{background:(isBand==false?'#2671E2':'#949494')}">确定</view> | |||||
<!-- <view v-if="Showhiddenunits"> --> | <!-- <view v-if="Showhiddenunits"> --> | ||||
<!-- <u-select v-model="show" :list="list"></u-select> --> | <!-- <u-select v-model="show" :list="list"></u-select> --> | ||||
@@ -92,6 +92,7 @@ | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
noClick: true, | |||||
Showhiddenunits: false, | Showhiddenunits: false, | ||||
list: [ | list: [ | ||||
// {label: '自然到访',value:'自然到访'}, | // {label: '自然到访',value:'自然到访'}, | ||||
@@ -0,0 +1,25 @@ | |||||
// 防止处理多次点击 | |||||
function noMultipleClicks(methods, info) { | |||||
// methods是点击后需要执行的函数, info是函数需要传的参数 | |||||
let that = this; | |||||
if (that.noClick) { | |||||
// 第一次点击 | |||||
console.log(methods) | |||||
that.noClick= false; | |||||
if((info && info !== '') || info ==0) { | |||||
// info是执行函数需要传的参数 | |||||
methods(info); | |||||
} else { | |||||
methods(); | |||||
} | |||||
setTimeout(()=> { | |||||
that.noClick= true; | |||||
}, 2000) | |||||
} else { | |||||
// 这里是重复点击的判断 | |||||
} | |||||
} | |||||
//导出 | |||||
export default { | |||||
noMultipleClicks, // 禁止多次点击 | |||||
} |