DESKTOP-2IO5MST\huting 1 год назад
Родитель
Сommit
32e374ffff

+ 0
- 2
composables/order/useOrderListItem.ts Просмотреть файл

} }
// 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单) // 订单发货后未激活 30天 以后 结束订单功能 insertTime >30 算出来距离今天是负数 updateTime<30(结束订单)
for (var k = 0; k < ordersList.value.length; k++) { for (var k = 0; k < ordersList.value.length; k++) {
console.log("ordersList.value1111", ordersList.value[k]['insertTime'].replace("T", " "))
console.log("ordersList.value1111", timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")))
if (ordersList.value[k]['insertTime']) { if (ordersList.value[k]['insertTime']) {
if (timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")).days > 30) { if (timesDiff(ordersList.value[k]['insertTime'].replace("T", " ")).days > 30) {
ordersList.value[k]['finishOrder'] = true //可以结束 ordersList.value[k]['finishOrder'] = true //可以结束

+ 75
- 72
subpackage/orders/order-evaluate-salesman.vue Просмотреть файл

:src="`${$imgUrl}common/icon-close.png`" @click="removeTag1(item)" /> :src="`${$imgUrl}common/icon-close.png`" @click="removeTag1(item)" />
</view> </view>
</view> </view>
<image
:src="`${$imgUrl}common/${state.showTagPop1 ? 'arror-top.png' : 'arror-down.png'}`"
<image :src="`${$imgUrl}common/${state.showTagPop1 ? 'arror-top.png' : 'arror-down.png'}`"
style="width: 40rpx;height: 40rpx;" @click="state.showTagPop1 = !state.showTagPop1"></image> style="width: 40rpx;height: 40rpx;" @click="state.showTagPop1 = !state.showTagPop1"></image>
</view> </view>
<textarea class="input-box" v-model="state.handle.content" placeholder-class="text-hint" <textarea class="input-box" v-model="state.handle.content" placeholder-class="text-hint"
:src="`${$imgUrl}common/icon-close.png`" @click="removeTag(item)" /> :src="`${$imgUrl}common/icon-close.png`" @click="removeTag(item)" />
</view> </view>
</view> </view>
<image
:src="`${$imgUrl}common/${state.showTagPop ? 'arror-top.png' : 'arror-down.png'}`"
<image :src="`${$imgUrl}common/${state.showTagPop ? 'arror-top.png' : 'arror-down.png'}`"
style="width: 40rpx;height: 40rpx;" @click="state.showTagPop = !state.showTagPop"></image> style="width: 40rpx;height: 40rpx;" @click="state.showTagPop = !state.showTagPop"></image>
</view> </view>
<textarea class="input-box" v-model="state.user.content" placeholder-class="text-hint" <textarea class="input-box" v-model="state.user.content" placeholder-class="text-hint"
<view class="uni-list" style='font-size:32rpx'> <view class="uni-list" style='font-size:32rpx'>
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否匿名</view> <view class="uni-list-cell-db">是否匿名</view>
<switch checked style="transform:scale(0.7)" @change="switchChange"/>
<switch checked style="transform:scale(0.7)" @change="switchChange" />
</view> </view>
</view> </view>
<view class="btn"> <view class="btn">
<submit-button @submit="publish" title="发布"></submit-button>
<submit-button @submit="publish" title="发布"></submit-button>
</view> </view>
<!-- 选择标签弹窗 业务员办理满意度弹框-->
<!-- 选择标签弹窗 业务员办理满意度弹框-->
<u-popup v-model="state.showTagPop1" mode="bottom" height="60%"> <u-popup v-model="state.showTagPop1" mode="bottom" height="60%">
<view v-if="state.showTagPop1"> <view v-if="state.showTagPop1">
<tag-popup :selTags="state.handle.tagList" :tagAllList="state.tagAllList" @cancel="state.showTagPop1 = !state.showTagPop1" @confirm="confirmSelectTag1"></tag-popup>
<tag-popup :selTags="state.handle.tagList" :tagAllList="state.tagAllList"
@cancel="state.showTagPop1 = !state.showTagPop1" @confirm="confirmSelectTag1"></tag-popup>
</view> </view>
</u-popup> </u-popup>
<!-- 选择标签弹窗 业务员满意度弹框--> <!-- 选择标签弹窗 业务员满意度弹框-->
<u-popup v-model="state.showTagPop" mode="bottom" height="60%"> <u-popup v-model="state.showTagPop" mode="bottom" height="60%">
<view v-if="state.showTagPop"> <view v-if="state.showTagPop">
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList" @cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup>
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList"
@cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup>
</view> </view>
</u-popup> </u-popup>
</template> </template>


<script setup lang="ts"> <script setup lang="ts">
import evaluateStar from "./components/evaluate-star.vue" import evaluateStar from "./components/evaluate-star.vue"
import {reactive} from "vue";
import {confirm, isBlank, msg} from "@/utils/utils";
import { reactive } from "vue";
import { confirm, isBlank, msg } from "@/utils/utils";
import tagPopup from "./components/popup-order-evaluate-tag"; import tagPopup from "./components/popup-order-evaluate-tag";
import { request } from "@/utils/network/request"; import { request } from "@/utils/network/request";
import { orderDetail,orderEvaluateTag,salesmanMsg,addEvaluation,judageSalesman} from "@/utils/network/api";
import {onLoad} from "@dcloudio/uni-app";
import { orderDetail, orderEvaluateTag, salesmanMsg, addEvaluation, judageSalesman } from "@/utils/network/api";
import { onLoad } from "@dcloudio/uni-app";
import { stringToJson } from "@/utils/network/encryption"; import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage"; import { getItem, StorageKeys } from "@/utils/storage";


const state = reactive({ const state = reactive({
orderInfo:{} as any, //订单信息
orderInfo: {} as any, //订单信息
haveUser: false, //存在有业务员发起的业务展示业务员评价模块 haveUser: false, //存在有业务员发起的业务展示业务员评价模块
showTagPop1:false, //第一个弹框
showTagPop1: false, //第一个弹框
showTagPop: false, //显示标签选择弹窗 showTagPop: false, //显示标签选择弹窗
handle: { //办理满意度 handle: { //办理满意度
score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选) score: 0, //星级得分 最高5分,0.5小数点 2.5分及以下为差评 2.5以上4.0以下为中评 4.0及4.0以上为好评(必选)
content: '', //评价内容 content: '', //评价内容
tagList: [], //已选择的评价标签列表 tagList: [], //已选择的评价标签列表
}, },
tagAllList:[],
orderId:'', //订单ID
id:'',
isAnonymity:1, //是否匿名 默认匿名
tagAllList: [],
orderId: '', //订单ID
id: '',
isAnonymity: 1, //是否匿名 默认匿名
}) })
/* 确认选择tag 满意度 */
/* 确认选择tag 满意度 */
const confirmSelectTag1 = (selectTag) => { const confirmSelectTag1 = (selectTag) => {
state.showTagPop1 = !state.showTagPop1 state.showTagPop1 = !state.showTagPop1
state.handle.tagList = [...selectTag]; state.handle.tagList = [...selectTag];
state.showTagPop = !state.showTagPop state.showTagPop = !state.showTagPop
state.user.tagList = [...selectTag]; state.user.tagList = [...selectTag];
} }
/* 删除评价标签 满意度*/
const removeTag1 = (item: any) => {
/* 删除评价标签 满意度*/
const removeTag1 = (item : any) => {
state.handle.tagList.map((tag, index) => { state.handle.tagList.map((tag, index) => {
if (tag.id === item.id) { if (tag.id === item.id) {
state.handle.tagList.splice(index, 1) state.handle.tagList.splice(index, 1)
}) })
} }
/* 删除评价标签 业务员*/ /* 删除评价标签 业务员*/
const removeTag = (item: any) => {
const removeTag = (item : any) => {
state.user.tagList.map((tag, index) => { state.user.tagList.map((tag, index) => {
if (tag.id === item.id) { if (tag.id === item.id) {
state.user.tagList.splice(index, 1) state.user.tagList.splice(index, 1)
const publish = (e) => { const publish = (e) => {
addService(); addService();
} }
const addService = ()=>{
const addService = () => {
if (state.handle.score === 0) { if (state.handle.score === 0) {
msg('请对业务员办理满意度进行打分!'); msg('请对业务员办理满意度进行打分!');
return; return;
state.handle.content = "默认好评"; state.handle.content = "默认好评";
} }
} }
const tagListArr=[];
for(var i=0;i<state.handle.tagList.length;i++){
const tagListArr = [];
for (var i = 0; i < state.handle.tagList.length; i++) {
tagListArr.push(state.handle.tagList[i].label) tagListArr.push(state.handle.tagList[i].label)
} }
const options = { const options = {
type: 2, type: 2,
data: { data: {
"orderId":state.orderId,
"serviceType":"service",
"score":state.handle.score,
"message":tagListArr.toString(),
"suggestion":state.handle.content,
"isAnonymity":state.isAnonymity
"orderId": state.orderId,
"serviceType": "service",
"score": state.handle.score,
"message": tagListArr.toString(),
"suggestion": state.handle.content,
"isAnonymity": state.isAnonymity
}, },
method: 'POST',
showLoading: true,
method: 'POST',
showLoading: true,
} }
request(addEvaluation,options).then((res)=>{
request(addEvaluation, options).then((res) => {
// 是否对业务员进行评价 // 是否对业务员进行评价
if(state.haveUser){
if (state.haveUser) {
addStaff(); addStaff();
}else{
confirm('您的评价已发布成功!',()=>{
} else {
confirm('您的评价已发布成功!', () => {
uni.$emit('refreshOrder'); uni.$emit('refreshOrder');
uni.navigateBack(); uni.navigateBack();
},'发布成功',false);
}, '发布成功', false);
} }
}) })
} }
const addStaff = ()=>{
const addStaff = () => {
if (state.haveUser && state.user.score === 0) { if (state.haveUser && state.user.score === 0) {
msg('请对业务员进行打分!'); msg('请对业务员进行打分!');
return; return;
state.user.content = "默认好评"; state.user.content = "默认好评";
} }
} }
const tagListArr=[];
for(var i=0;i<state.user.tagList.length;i++){
const tagListArr = [];
for (var i = 0; i < state.user.tagList.length; i++) {
tagListArr.push(state.user.tagList[i].label) tagListArr.push(state.user.tagList[i].label)
} }
const options = { const options = {
type: 2, type: 2,
data: { data: {
"orderId":state.orderId,
"serviceType":"staff",
"score":state.user.score,
"message":tagListArr.toString(),
"suggestion":state.user.content,
"isAnonymity":state.isAnonymity
"orderId": state.orderId,
"serviceType": "staff",
"score": state.user.score,
"message": tagListArr.toString(),
"suggestion": state.user.content,
"isAnonymity": state.isAnonymity
}, },
method: 'POST',
showLoading: true,
method: 'POST',
showLoading: true,
} }
request(addEvaluation,options).then((res)=>{
confirm('您的评价已发布成功!',()=>{
request(addEvaluation, options).then((res) => {
confirm('您的评价已发布成功!', () => {
uni.$emit('refreshOrder'); uni.$emit('refreshOrder');
uni.navigateBack(); uni.navigateBack();
},'发布成功',false);
}, '发布成功', false);
}) })
} }
/* 获取业务员标签ID */ /* 获取业务员标签ID */
const getTagIds = () => { const getTagIds = () => {
const list = []; const list = [];
state.user.tagList.map((tag)=>{
state.user.tagList.map((tag) => {
list.push(tag.id); list.push(tag.id);
}); });
return list; return list;
} }


/* 订单查询业务员简单信息 */ /* 订单查询业务员简单信息 */
const getSalesmanMsg = (id) => { const getSalesmanMsg = (id) => {
const options = { const options = {
type: 2, type: 2,
data: {"id": id},
data: { "id": id },
method: 'POST', method: 'POST',
showLoading: true, showLoading: true,
} }
request(salesmanMsg, options).then((res) => { request(salesmanMsg, options).then((res) => {
console.log("订单查询业务员简单信息",stringToJson(res.bizContent))
console.log("订单查询业务员简单信息", stringToJson(res.bizContent))
state.orderInfo = stringToJson(res.bizContent); state.orderInfo = stringToJson(res.bizContent);
}) })
} }
// 获取是否有业务员 // 获取是否有业务员
const isSalesman=(orderId)=>{
const isSalesman = (orderId) => {
const options = { const options = {
type: 2, type: 2,
data: {"orderId": orderId},
data: { "orderId": orderId },
method: 'POST', method: 'POST',
showLoading: true, showLoading: true,
} }
request(judageSalesman, options).then((res) => { request(judageSalesman, options).then((res) => {
console.log("获取是否有业务员",stringToJson(res.bizContent))
console.log("获取是否有业务员", stringToJson(res.bizContent))
state.haveUser = stringToJson(res.bizContent); state.haveUser = stringToJson(res.bizContent);
getSalesmanMsg(state.id); getSalesmanMsg(state.id);
}) })
showLoading: true, showLoading: true,
} }
request(orderEvaluateTag, options).then((res) => { request(orderEvaluateTag, options).then((res) => {

state.tagAllList = stringToJson(res.bizContent); state.tagAllList = stringToJson(res.bizContent);
}) })
} }
// 是否匿名 // 是否匿名
const switchChange=(e)=>{
const switchChange = (e) => {
console.log('switch1 发生 change 事件,携带值为', e.detail.value); console.log('switch1 发生 change 事件,携带值为', e.detail.value);
if(e.detail.value){
state.isAnonymity=1
}else{
state.isAnonymity=0
if (e.detail.value) {
state.isAnonymity = 1
} else {
state.isAnonymity = 0
} }
} }
onLoad((option) => { onLoad((option) => {
console.log("option",option)
state.orderId=option.orderId;
state.id=option.id;
console.log("option", option)
state.orderId = option.orderId;
state.id = option.id;
isSalesman(option.orderId); //获取是否有业务员 isSalesman(option.orderId); //获取是否有业务员
getEnvTag(); getEnvTag();
}) })
margin-top: 40rpx; margin-top: 40rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom: 1rpx solid #DCDCDC; border-bottom: 1rpx solid #DCDCDC;

.tags { .tags {
flex-wrap: wrap; flex-wrap: wrap;


.btn { .btn {
margin: 60rpx 40rpx 0rpx; margin: 60rpx 40rpx 0rpx;
} }
.uni-list-cell{

.uni-list-cell {
display: flex; display: flex;
margin: 10rpx auto; margin: 10rpx auto;
width: 90%; width: 90%;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
</style>
</style>

+ 37
- 34
subpackage/orders/order-evaluate.vue Просмотреть файл

<!-- 订单-评价 --> <!-- 订单-评价 -->
<template> <template>
<!-- 1,4 -->
<!-- 1,4 -->
<!-- 产品 --> <!-- 产品 -->
<view class="card" style="padding: 40rpx 30rpx;"> <view class="card" style="padding: 40rpx 30rpx;">
<view class="title">{{state.orderInfo.productName}}</view> <view class="title">{{state.orderInfo.productName}}</view>
style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。"> style="height: 260rpx;" placeholder="从多角度评价,可以帮助我们提升服务质量。">
</textarea> </textarea>
<view class="upload-img"> <view class="upload-img">
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;" :retract="-15"></form-image>
<form-image @backImg="backImg($event)" @removeImg="removeImg" :isUrl="false" style="width: 100%;"
:retract="-15"></form-image>
</view> </view>
</view> </view>


:src="`${$imgUrl}common/icon-close.png`" @click="removeTag(item)" /> :src="`${$imgUrl}common/icon-close.png`" @click="removeTag(item)" />
</view> </view>
</view> </view>
<image
:src="`${$imgUrl}common/${state.showTagPop ? 'arror-top.png' : 'arror-down.png'}`"
<image :src="`${$imgUrl}common/${state.showTagPop ? 'arror-top.png' : 'arror-down.png'}`"
style="width: 40rpx;height: 40rpx;" @click="state.showTagPop = !state.showTagPop"></image> style="width: 40rpx;height: 40rpx;" @click="state.showTagPop = !state.showTagPop"></image>
</view> </view>
<textarea class="input-box" v-model="state.user.content" placeholder-class="text-hint" <textarea class="input-box" v-model="state.user.content" placeholder-class="text-hint"
<!-- 选择标签弹窗 --> <!-- 选择标签弹窗 -->
<u-popup v-model="state.showTagPop" mode="bottom" height="60%"> <u-popup v-model="state.showTagPop" mode="bottom" height="60%">
<view v-if="state.showTagPop"> <view v-if="state.showTagPop">
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList" @cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup>
<tag-popup :selTags="state.user.tagList" :tagAllList="state.tagAllList"
@cancel="state.showTagPop = !state.showTagPop" @confirm="confirmSelectTag"></tag-popup>
</view> </view>
</u-popup> </u-popup>
</template> </template>


<script setup lang="ts"> <script setup lang="ts">
import evaluateStar from "./components/evaluate-star.vue" import evaluateStar from "./components/evaluate-star.vue"
import {reactive} from "vue";
import {confirm, isBlank, msg} from "@/utils/utils";
import { reactive } from "vue";
import { confirm, isBlank, msg } from "@/utils/utils";
import tagPopup from "./components/popup-order-evaluate-tag"; import tagPopup from "./components/popup-order-evaluate-tag";
import { request } from "@/utils/network/request"; import { request } from "@/utils/network/request";
import { orderDetail, orderEvaluate,orderEvaluateTag,saleMessage } from "@/utils/network/api";
import {onLoad} from "@dcloudio/uni-app";
import { orderDetail, orderEvaluate, orderEvaluateTag, saleMessage } from "@/utils/network/api";
import { onLoad } from "@dcloudio/uni-app";
import { stringToJson } from "@/utils/network/encryption"; import { stringToJson } from "@/utils/network/encryption";
import { getItem, StorageKeys } from "@/utils/storage"; import { getItem, StorageKeys } from "@/utils/storage";


const state = reactive({ const state = reactive({
orderInfo:{} as any, //订单信息
orderInfo: {} as any, //订单信息
haveUser: false, //存在有业务员发起的业务展示业务员评价模块 haveUser: false, //存在有业务员发起的业务展示业务员评价模块
showTagPop: false, //显示标签选择弹窗 showTagPop: false, //显示标签选择弹窗
product: { //产品 product: { //产品
content: '', //评价内容 content: '', //评价内容
tagList: [], //已选择的评价标签列表 tagList: [], //已选择的评价标签列表
}, },
tagAllList:[]
tagAllList: []
}) })


/* 确认选择tag */ /* 确认选择tag */
} }


//选择图片 //选择图片
const backImg = (e: any) => {
const backImg = (e : any) => {
state.product.imageList = e; state.product.imageList = e;
} }
//删除图片 //删除图片
const removeImg = (imgList) => { const removeImg = (imgList) => {
state.product.imageList = imgList state.product.imageList = imgList
} }


/* 删除评价标签 */ /* 删除评价标签 */
const removeTag = (item: any) => {
const removeTag = (item : any) => {
state.user.tagList.map((tag, index) => { state.user.tagList.map((tag, index) => {
if (tag.id === item.id) { if (tag.id === item.id) {
state.user.tagList.splice(index, 1) state.user.tagList.splice(index, 1)
state.user.content = "默认好评"; state.user.content = "默认好评";
} }
} }
const options = { const options = {
type: 2, type: 2,
data: { data: {
"id": state.orderInfo.id, "id": state.orderInfo.id,
'productScore': state.product.score, 'productScore': state.product.score,
'productAppraise':state.product.content,
'appraisePics':state.product.imageList.join(";"),
'staffId':state.orderInfo.staffId,
'staffName':state.orderInfo.staffName,
'staffScore':state.user.score,
'staffTips':getTagIds().join(';'),
'staffAppraise':state.user.content,
'opId':getItem(StorageKeys.OpenId)
'productAppraise': state.product.content,
'appraisePics': state.product.imageList.join(";"),
'staffId': state.orderInfo.staffId,
'staffName': state.orderInfo.staffName,
'staffScore': state.user.score,
'staffTips': getTagIds().join(';'),
'staffAppraise': state.user.content,
'opId': getItem(StorageKeys.OpenId)
}, },
method: 'POST',
showLoading: true,
method: 'POST',
showLoading: true,
} }
request(orderEvaluate,options).then((res)=>{
confirm('您的评价已发布成功!',()=>{
request(orderEvaluate, options).then((res) => {
confirm('您的评价已发布成功!', () => {
uni.$emit('refreshOrder'); uni.$emit('refreshOrder');
uni.navigateBack(); uni.navigateBack();
},'发布成功',false);
}, '发布成功', false);
}) })
} }
/* 获取业务员标签ID */ /* 获取业务员标签ID */
const getTagIds = () => { const getTagIds = () => {
const list = []; const list = [];
state.user.tagList.map((tag)=>{
state.user.tagList.map((tag) => {
list.push(tag.id); list.push(tag.id);
}); });
return list; return list;
const getOrderDetails = (id) => { const getOrderDetails = (id) => {
const options = { const options = {
type: 2, type: 2,
data: {"id": id},
data: { "id": id },
method: 'POST', method: 'POST',
showLoading: true, showLoading: true,
} }
state.haveUser = !isBlank(state.orderInfo.staffId); state.haveUser = !isBlank(state.orderInfo.staffId);
}) })
} }
/* 获取评价标签 */ /* 获取评价标签 */
const getEnvTag = () => { const getEnvTag = () => {
const options = { const options = {
showLoading: true, showLoading: true,
} }
request(orderEvaluateTag, options).then((res) => { request(orderEvaluateTag, options).then((res) => {
console.log("获取评价标签", stringToJson(res.bizContent))
state.tagAllList = stringToJson(res.bizContent); state.tagAllList = stringToJson(res.bizContent);
}) })
} }
onLoad((option) => { onLoad((option) => {
getOrderDetails(option.id); getOrderDetails(option.id);
getEnvTag(); getEnvTag();
margin-top: 40rpx; margin-top: 40rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom: 1rpx solid #DCDCDC; border-bottom: 1rpx solid #DCDCDC;

.tags { .tags {
flex-wrap: wrap; flex-wrap: wrap;


.btn { .btn {
margin: 60rpx 40rpx 0rpx; margin: 60rpx 40rpx 0rpx;
} }
</style>
</style>

Загрузка…
Отмена
Сохранить