| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747 |
- <template>
- <view class="clueDetail_wrap">
- <view class="telPhone">
- <view class="left">
- <view class="phone"
- >电话:
- <show-real-text
- :real="receiptDetail.phone"
- :type="params.type"
- v-if="receiptDetail.phone"
- ></show-real-text>
- </view>
- <view
- class="copy_btn"
- v-if="params.type != '1'"
- @click="handleCopy(receiptDetail)"
- >复制</view
- >
- </view>
- <view class="right"> 发单人 : {{ receiptDetail.createNickName }} </view>
- </view>
- <view class="clueDetail_top_info">
- <view class="top_info_item">
- <view class="top">
- {{ defaultText(receiptDetail.clueOwnerName) }}
- </view>
- <view class="bottom"> 线索所属人 </view>
- </view>
- <view class="top_info_item">
- <view class="top">
- {{ defaultText(receiptDetail.brand) }}
- </view>
- <view class="bottom"> 品牌 </view>
- </view>
- <view class="top_info_item">
- <view class="top">
- {{ defaultText(receiptDetail.identificationName) }}
- </view>
- <view class="bottom"> 接单人 </view>
- </view>
- <view class="top_info_item">
- <view class="top">
- {{ crmFormCategoryFormat(receiptDetail.category) }}
- </view>
- <view class="bottom"> 类别 </view>
- </view>
- <view class="top_info_item">
- <view class="top">
- {{ crmFormTacticFormat(receiptDetail.tactic) }}
- </view>
- <view class="bottom"> 采用战术 </view>
- </view>
- <view class="top_info_item status-item">
- <view class="top">
- {{ crmFollowStatusFormat(receiptDetail.status) }}
- </view>
- <view class="bottom"> 跟进状态 </view>
- </view>
- </view>
- <view class="clue_state_wrap">
- <view class="top_left">阶段:</view>
- <view class="steps_wrap">
- <ld-select
- v-model="receiptDetail.state"
- :list="crmFormStateDict"
- value-key="dictValue"
- label-key="dictLabel"
- placeholder="点击选择阶段"
- @change="handleStateConfirm"
- >
- </ld-select>
- </view>
- </view>
- <!-- 跟进状态 -->
- <view class="order_action_wrap">
- <view class="action_title">状态:</view>
- <view
- class="action_buttons"
- v-if="['1', '2'].includes(receiptDetail.status)"
- >
- <u-button
- v-if="receiptDetail.status === '1'"
- type="success"
- size="small"
- text="接单"
- @click="handleOrderForm"
- customStyle="margin-right: 20rpx;"
- ></u-button>
- <u-button
- v-if="receiptDetail.status === '2'"
- type="primary"
- size="small"
- text="收单"
- @click="handleReceiptForm"
- customStyle="margin-right: 20rpx;"
- ></u-button>
- <u-button
- v-if="receiptDetail.status === '2'"
- type="warning"
- size="small"
- text="未收"
- @click="handleDenialForm"
- customStyle="margin-right: 20rpx;"
- ></u-button>
- <u-button
- v-if="receiptDetail.status === '1'"
- type="error"
- size="small"
- text="撤销"
- @click="handleDelete"
- customStyle="margin-right: 20rpx;"
- ></u-button>
- </view>
- <view v-else class="last_status">
- 该订单{{ crmFollowStatusFormat(receiptDetail.status) }}不可再操作
- </view>
- </view>
- <view class="clue_tag_wrap">
- <view class="clue_tag_add_btn" @click="handleAddClueTag">
- + 添加标签
- </view>
- <u-tag
- :text="tag.name"
- plain
- plainFill
- :closable="true"
- @close="hanldeTagClose(tag)"
- borderColor="#fff"
- v-for="tag in receiptDetail.tags"
- :key="tag.id"
- style="margin-left: 10px; margin-bottom: 10px"
- :bgColor="tag.color"
- color="#fff"
- ></u-tag>
- </view>
- <yui-tabs
- :tabs="tabs"
- v-model="activeIndex"
- :lineWidth="'120rpx'"
- :isLazyRender="false"
- color="#108cff"
- titleActiveColor="#108cff"
- :swipeable="true"
- :swiper="false"
- :ellipsis="false"
- :scroll-threshold="3"
- >
- <template #chatFile>
- <upload-file
- :clueId="clueId"
- :sourceId="orderId"
- ref="uploadFile1"
- type="2"
- orderFileType="1"
- isDuplicate="1"
- ></upload-file>
- </template>
- <template #quoteFile>
- <upload-file
- :clueId="clueId"
- :sourceId="orderId"
- ref="uploadFile2"
- type="2"
- orderFileType="2"
- isDuplicate="1"
- ></upload-file>
- </template>
- <template #hdImageFile>
- <upload-file
- :clueId="clueId"
- :sourceId="orderId"
- ref="uploadFile3"
- type="2"
- orderFileType="3"
- isDuplicate="1"
- ></upload-file>
- </template>
- <template #otherFile>
- <upload-file
- :clueId="clueId"
- :sourceId="orderId"
- ref="uploadFile4"
- type="2"
- orderFileType="4"
- isDuplicate="1"
- ></upload-file>
- </template>
- <template #frontendFile>
- <upload-file
- :clueId="clueId"
- ref="uploadFile5"
- type="6"
- isDuplicate="1"
- ></upload-file>
- </template>
- <template #frontendFollow>
- <clue-follow :clueId="clueId" ref="clueFollow" type="4"></clue-follow>
- </template>
- <template #followRecord>
- <clue-follow :clueId="clueId" ref="follow" type="5"></clue-follow>
- </template>
- <template #receiptInfo>
- <receipt-form-list
- :sendFormId="orderId"
- :clueId="clueId"
- :receiptDetail="receiptDetail"
- ref="receiptFormList"
- ></receipt-form-list>
- </template>
- <template #commissionInfo>
- <commission-form-list
- :sendFormId="orderId"
- :clueId="clueId"
- ref="commissionFormList"
- ></commission-form-list>
- </template>
- </yui-tabs>
- <u-tabbar
- class="clueDetail_tabber"
- :fixed="true"
- inactiveColor="#ffffff"
- :placeholder="true"
- :safeAreaInsetBottom="true"
- >
- <u-tabbar-item
- text="拨打电话"
- icon="../../static/clueDetail/icon-phone.png"
- @click="handleCallPhone"
- ></u-tabbar-item>
- <u-tabbar-item
- text="添加收单"
- icon="../../static/orderDetail/sd.png"
- @click="handleAddReceiptForm"
- ></u-tabbar-item>
- <u-tabbar-item
- text="新增分成"
- icon="../../static/orderDetail/add_commission.png"
- @click="handleAddCommission"
- ></u-tabbar-item>
- <u-tabbar-item
- text="添加跟进"
- icon="../../static/caseDetail/icon-follow.png"
- @click="handleAddFollow"
- ></u-tabbar-item>
- </u-tabbar>
- <group-select
- class="clueTagsSelect"
- :list="clueTagGroupVoList"
- scrollHeight="720rpx"
- groupName="groupName"
- groupChild="clueTagDataList"
- label-key="name"
- value-key="id"
- placeholder="请选择线索标签"
- v-model="checkTags"
- multiple
- clearable
- ref="clueTag"
- @confirm="handleClueTagConfirm"
- ></group-select>
- </view>
- </template>
- <script>
- import { cloneDeep } from "lodash";
- import { selectDictLabel } from "@/utils/util";
- import uploadFile from "../tabs/uploadFile/index.vue";
- import clueFollow from "../tabs/followRecord/index.vue";
- import receiptFormList from "../tabs/receiptFormList/receiptFormList.vue";
- import commissionFormList from "../tabs/commissionFormList/commissionFormList.vue";
- export default {
- components: {
- uploadFile,
- clueFollow,
- receiptFormList,
- commissionFormList,
- },
- props: {
- orderId: {
- type: [String, Number],
- required: true,
- },
- clueId: {
- type: [String, Number],
- required: true,
- },
- params: {
- type: Object,
- required: true,
- },
- },
- data() {
- return {
- showModal: false,
- showStateSelect: false,
- receiptDetail: {},
- checkTags: [],
- clueTagGroupVoList: [],
- crmFormCategoryDict: [],
- crmFormTacticDict: [],
- crmFormStateDict: [],
- crmHandelStatusDict: [],
- tabs: [
- {
- label: "聊天附件",
- slot: "chatFile",
- },
- {
- label: "报价附件",
- slot: "quoteFile",
- },
- {
- label: "高清图附件",
- slot: "hdImageFile",
- },
- {
- label: "其他附件",
- slot: "otherFile",
- },
- {
- label: "前端附件",
- slot: "frontendFile",
- },
- {
- label: "前端跟进",
- slot: "frontendFollow",
- },
- {
- label: "跟进记录",
- slot: "followRecord",
- },
- {
- label: "收单信息",
- slot: "receiptInfo",
- },
- {
- label: "收单分成",
- slot: "commissionInfo",
- },
- ],
- activeIndex: 0,
- };
- },
- methods: {
- async hanldeTagClose(tag) {
- const { id, tags } = this.receiptDetail;
- const copyTags = cloneDeep(tags);
- if (id == null) {
- uni.$u.toast("修改异常");
- return;
- }
- const index = copyTags.findIndex((v) => v.id === tag.id);
- if (index !== -1) {
- copyTags.splice(index, 1);
- const allTags = copyTags.map((v) => v.id).join(",");
- await uni.$u.api.updateTags({
- id: id,
- allTags,
- });
- this.receiptDetail.tags = copyTags;
- this.checkTags = this.receiptDetail.tags.map((v) => v.id);
- }
- },
- async handleClueTagConfirm() {
- const allTags = this.checkTags.join(",");
- await uni.$u.api.updateTags({
- id: this.receiptDetail.id,
- allTags,
- });
- this.getDetail();
- },
- handleAddClueTag() {
- this.$refs.clueTag.showModal();
- },
- async handleStateConfirm(e) {
- const state = e.value;
- await uni.$u.api.updateOrderState({
- id: this.receiptDetail.id,
- state,
- });
- uni.$u.toast("操作成功");
- },
- defaultText(text) {
- return text ? text : "-";
- },
- crmFormCategoryFormat(v) {
- return v ? selectDictLabel(this.crmFormCategoryDict, v) : "-";
- },
- crmFormTacticFormat(v) {
- return v ? selectDictLabel(this.crmFormTacticDict, v) : "-";
- },
- crmFollowStatusFormat(v) {
- return selectDictLabel(this.crmHandelStatusDict, v);
- },
- selectDictLabel,
- handleCopy(item) {
- uni.setClipboardData({
- data: item.phone,
- success: function () {
- uni.$u.toast("复制成功");
- },
- });
- },
- // 添加联系人
- handleCallPhone() {
- uni.makePhoneCall({
- phoneNumber: this.receiptDetail.phone,
- success: () => {
- this.$store.commit("call/SET_FORM", {
- clueId: this.receiptDetail.clueId,
- type: "3",
- callee: this.receiptDetail.phone,
- });
- },
- });
- },
- // 添加跟进记录
- handleAddFollow() {
- uni.navigateTo({
- url: `/pages/addFollow/index?orderId=${this.orderId}`,
- });
- },
- // 跳转到收单表单页面
- handleAddReceiptForm() {
- uni.navigateTo({
- url: `/pages/receiptForm/index?orderId=${this.orderId}&clueId=${this.clueId}`,
- });
- },
- // 跳转到新增分成页面
- handleAddCommission() {
- uni.navigateTo({
- url: `/pages/commissionForm/index?sendFormId=${this.orderId}&clueId=${this.clueId}`,
- });
- },
- handleUploadRecord() {
- uni.navigateTo({
- url: `/pages/uploadRecord/index?clueId=${this.orderId}`,
- });
- },
- // 接单操作
- async handleOrderForm() {
- if (this.receiptDetail.status === "2") {
- uni.$u.toast("当前订单已经被接单");
- return;
- }
- uni.showModal({
- title: "提示",
- content: "确定要接单吗?",
- success: async (res) => {
- if (res.confirm) {
- try {
- await uni.$u.api.oderForm({
- status: "2",
- id: this.receiptDetail.id,
- });
- uni.$u.toast("接单成功");
- this.getDetail(); // 刷新详情
- } catch (error) {
- uni.$u.toast("接单失败");
- }
- }
- },
- });
- },
- // 收单操作
- async handleReceiptForm() {
- if (
- this.receiptDetail.status === "3" ||
- this.receiptDetail.status === "4"
- ) {
- uni.$u.toast("当前订单已经被收单或未收");
- return;
- }
- uni.showModal({
- title: "提示",
- content: "确定要收单吗?",
- success: async (res) => {
- if (res.confirm) {
- try {
- await uni.$u.api.oderForm({
- status: "3",
- id: this.receiptDetail.id,
- });
- uni.$u.toast("收单成功");
- this.getDetail(); // 刷新详情
- } catch (error) {
- uni.$u.toast("收单失败");
- }
- }
- },
- });
- },
- // 未收操作
- async handleDenialForm() {
- if (
- this.receiptDetail.status === "3" ||
- this.receiptDetail.status === "4"
- ) {
- uni.$u.toast("当前订单已经被收单或未收");
- return;
- }
- uni.showModal({
- title: "提示",
- content: "确定要标记为未收吗?",
- success: async (res) => {
- if (res.confirm) {
- try {
- await uni.$u.api.oderForm({
- status: "4",
- id: this.receiptDetail.id,
- });
- uni.$u.toast("标记未收成功");
- this.getDetail(); // 刷新详情
- } catch (error) {
- uni.$u.toast("操作失败");
- }
- }
- },
- });
- },
- // 撤销操作
- async handleDelete() {
- uni.showModal({
- title: "提示",
- content: "是否确定撤销?",
- success: async (res) => {
- if (res.confirm) {
- try {
- await uni.$u.api.deleteOrder([this.receiptDetail.id]);
- uni.$u.toast("撤销成功");
- // 撤销后返回上一页
- setTimeout(() => {
- uni.navigateBack();
- }, 1500);
- } catch (error) {
- uni.$u.toast("撤销失败");
- }
- }
- },
- });
- },
- // 初始化详情页
- async handleInit() {
- this.getDetail();
- this.$getDicts("crm_form_category").then((res) => {
- this.crmFormCategoryDict = res;
- });
- this.$getDicts("crm_form_tactic").then((res) => {
- this.crmFormTacticDict = res;
- });
- this.$getDicts("crm_form_state").then((res) => {
- this.crmFormStateDict = res;
- });
- this.$getDicts("crm_form_status").then((res) => {
- this.crmHandelStatusDict = res;
- });
- uni.$u.api
- .getClueTagGroupVoList({
- tagGroupApplication: "2",
- })
- .then(({ data }) => {
- this.clueTagGroupVoList = data;
- });
- },
- getDetail() {
- uni.$u.api
- .getClueSendFormVoByOrderId({
- id: this.orderId,
- })
- .then((res) => {
- this.receiptDetail = res.data;
- this.checkTags = this.receiptDetail.tags
- ? this.receiptDetail.tags.map((v) => v.id)
- : [];
- });
- },
- },
- created() {
- this.handleInit();
- },
- };
- </script>
- <style lang="scss" scoped>
- .clueTagsSelect {
- height: 0;
- overflow: hidden;
- }
- .clue_tag_wrap {
- display: flex;
- align-items: center;
- background-color: #fff;
- padding: 0 10px;
- margin: 20px 0;
- flex-wrap: wrap;
- min-height: 50px;
- .clue_tag_add_btn {
- font-size: 14px;
- color: #108cff;
- }
- }
- .clue_state_wrap {
- background-color: #fff;
- padding: 10px;
- margin-bottom: 20px;
- display: flex;
- align-items: center;
- .top_left {
- font-size: 16px;
- flex: 0 0 50px;
- }
- .steps_wrap {
- flex: 1;
- }
- }
- .order_action_wrap {
- padding: 10px;
- margin: 15px 0;
- background: #fff;
- display: flex;
- align-items: center;
- .action_title {
- font-size: 16px;
- flex: 0 0 50px;
- }
- .last_status {
- color: #c0c0c7;
- font-size: 14px;
- }
- .action_buttons {
- display: grid;
- grid-template-columns: repeat(2, 1fr);
- gap: 10px;
- ::v-deep .u-button {
- height: 30px !important;
- font-size: 12px !important;
- border-radius: 8px !important;
- border: 1px solid #e2e8f0 !important;
- background: #ffffff !important;
- color: #2d3748 !important;
- font-weight: 500 !important;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
- transition: all 0.3s ease !important;
- &.u-button--success {
- background: #ffd025 !important;
- color: white !important;
- border-color: #ffd025 !important;
- }
- // 特别样式化不同按钮类型
- &.u-button--primary {
- background: #35dbd9 !important;
- color: white !important;
- border-color: #35dbd9 !important;
- }
- &.u-button--warning {
- background: #ba9fb0 !important;
- color: white !important;
- border-color: #ba9fb0 !important;
- }
- &.u-button--error {
- background: #e53e3e !important;
- color: white !important;
- border-color: #e53e3e !important;
- }
- }
- }
- }
- .clueDetail_tabber {
- ::v-deep .u-tabbar__content {
- background: #108cff;
- border-top-right-radius: 10px;
- border-top-left-radius: 10px;
- }
- }
- .clueDetail_wrap {
- .telPhone {
- display: flex;
- background: #fff;
- padding: 20px;
- justify-content: space-between;
- .left {
- display: flex;
- }
- .copy_btn {
- color: #4fa5fe;
- margin-left: 10px;
- }
- }
- .clueDetail_top_info {
- display: flex;
- flex-wrap: wrap;
- background-color: #ffffff;
- padding-top: 20px;
- margin: 18px 0;
- .top_info_item {
- width: 33.33%;
- text-align: center;
- margin-bottom: 20px;
- .top {
- font-size: 15px;
- color: #202020;
- margin-bottom: 5px;
- font-weight: bold;
- }
- .bottom {
- font-size: 15px;
- color: #c0c0c7;
- }
- }
- }
- }
- </style>
|