| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('component/order-address', __DIR__);
- ComponentHelper::loadComponentView('component/order-shipping', __DIR__, ['is_electronic_bill' => $is_electronic_bill ?? false]);
- ComponentHelper::loadComponentView('com-export-dialog');
- ComponentHelper::loadComponentView('com-ellipsis');
- if (isset($is_electronic_bill) && $is_electronic_bill) {
- ComponentHelper::loadComponentView('electronic-bill-batch', \Yii::$app->basePath . '/../addons/' . \common\enums\AddonsEnum::ADDONS_NAME_ELECTRONIC_BILL . '/common/components/order');
- }
- ?>
- <style>
- @media screen and (max-width: 1500px) {
- #app {
- min-width: 1270px;
- }
- }
- .vue-line-clamp p {
- line-height: 22px;
- }
- .demo-form-inline .el-select .el-input {
- width: 100px;
- }
- .order_number {
- display: flex;
- justify-content: space-between;
- }
- .order_number .el-link {
- width: 140px;
- }
- /* 订单表格 start */
- .width-pre10 {
- width: 10%;
- }
- .width-50 {
- width: 50px;
- }
- .width-400 {
- width: 350px;
- }
- .order-table {
- overflow-x: scroll;
- }
- .tab-title,
- .tab-cont {
- width: 100%;
- min-width: 1290px;
- font-size: 13px;
- }
- .tab-title {
- padding: 20px 0;
- }
- .tab-title>li {
- padding: 0 10px;
- }
- .tab-cont {
- border: 1px solid #F2F2F2;
- margin-bottom: 20px;
- }
- .tab-cont-row {
- padding: 10px 0;
- background-color: #F7F7F7;
- }
- .tab-cont-info {
- height: 100px;
- }
- .tab-cont-info>li {
- /* display: flex;
- flex-direction: column;
- justify-content: center; */
- height: 100%;
- padding: 16px 10px;
- }
- .tab-btns {
- width: 320px;
- margin-right: 20px;
- }
- .tab-goods-name {
- margin: 0 10px;
- }
- .border-right {
- border-right: 1px solid #f2f2f2;
- }
- .border-bottom {
- border-bottom: 1px solid #f2f2f2;
- }
- .no-border-bottom {
- border-bottom: none !important;
- }
- .cursor {
- cursor: pointer;
- }
- .edit-icon {
- color: #03c5ff;
- cursor: pointer;
- }
- .popover-btn {
- font-size: 12px;
- padding: 0 10px;
- border-right: 1px solid var(--primary, #03c5ff);
- cursor: pointer;
- display: inline-block;
- line-height: 1;
- color: #03c5ff;
- }
- .popover-btn:last-child {
- border-right: none;
- }
- .width-s {
- width: 250px;
- }
- .el-button--text {
- padding: 0 !important;
- }
- .com-order-refund-status {
- position: absolute;
- bottom: 18px;
- left: 0px;
- height: 20px;
- width: 50px;
- background-color: #FF7171;
- color: #fff;
- text-align: center;
- border-radius: 0 0 5px 5px;
- font-size: 12px;
- }
- .fenRunData .el-dialog__body {
- padding: 0px 10px 0 10px;
- }
- .change_price p {
- padding: 5px;
- font-size: 15px;
- width: 200px;
- }
- .change_price {
- width: 200px;
- margin: 0px 0 0px 81%;
- }
- .change_price label {
- float: left;
- width: 100px;
- text-align: right;
- padding-right: 20px;
- }
- .change_formula {
- float: left;
- width: 300px;
- color: #6c6969;
- font-size: 12px;
- }
- .el-tabs--border-card {
- border: 0;
- }
- /* 订单表格 end */
- </style>
- <div id="app" v-cloak>
- <el-tabs type="border-card" v-model="orderTypeTab" @tab-click="orderTypeTabClick">
- <el-tab-pane label="商品订单" name="gorder">
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" v-loading="listLoading">
- <div slot="header">
- <span>订单列表</span>
- <div style="float: right; margin: -5px 0;display:flex;">
- <?php if (isset($is_electronic_bill) && $is_electronic_bill) { ?>
- <electronic-bill-batch :order-list="list" :params="search_data" @complete="getList(search_data)"></electronic-bill-batch>
- <?php } ?>
- <div style="margin-top: -5px;margin-right:10px;">
- <el-button type="primary" size="small" @click="detailOrder">批量删除</el-button>
- </div>
- <!-- <el-button type="primary" size="small" @click="handle('edit')">添加商品</el-button>-->
- <!-- <el-button type="primary" size="small">订单导出</el-button>-->
- <com-export-dialog style="float: right;margin-top: -5px" :field_list='export_list' :action_url="export_url" :params="search_data">
- </com-export-dialog>
- </div>
- </div>
- <div class="table-body">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane v-for="item in tabs" :key="item.value" :label="item.name" :name="item.value">
- <el-form :inline="true" :model="search_data" size="small" class="demo-form-inline">
- <el-form-item label="下单时间">
- <el-date-picker style="margin-top: 1px;" @change="changeTime" v-model="datetime" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" size="small"></el-date-picker>
- </el-form-item>
- <el-form-item label="">
- <div class="order_number">
- <el-input placeholder="请输入订单号" v-model="search_data.order_no" size="small"></el-input>
- <el-link type="primary" :underline="false" @click="upOrderNumber">订单批量查询</el-link>
- </div>
- </el-form-item>
- <el-form-item label="">
- <el-input placeholder="请输入内容" v-model="search_data.type_value" class="input-with-select">
- <el-select v-model="search_data.type" slot="prepend" clearable placeholder="请选择" size="small">
- <el-option label="收货人" value="consignee"></el-option>
- <el-option label="收货人手机" value="consignee_mobile"></el-option>
- <el-option label="订单ID" value="order_id"></el-option>
- <el-option label="用户ID" value="user_id"></el-option>
- <el-option label="会员编号" value="username"></el-option>
- <el-option label="手机号码" value="mobile"></el-option>
- <el-option label="商品名称" value="goods_name"></el-option>
- <el-option label="交易单号" value="trade_no"></el-option>
- </el-select>
- </el-input>
- </el-form-item>
- <el-form-item label="配送方式">
- <el-select v-model="search_data.shipping_type" placeholder="请选择">
- <el-option v-for="(val, key) in shipping_type_list" :key="key" :label="val" :value="key">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="订单标识">
- <el-select v-model="search_data.marketing_type" placeholder="请选择" size="small">
- <el-option v-for="(val, key) in marketing_type_map" :key="key" :label="val" :value="key">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="标识排除">
- <el-select v-model="search_data.not_marketing_type" placeholder="请选择" size="small">
- <el-option v-for="(val, key) in marketing_type_map" :key="key" :label="val" :value="key">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="支付方式">
- <el-select v-model="search_data.payment_type" placeholder="请选择" size="small">
- <el-option v-for="(val, key) in payment_type_arr" :key="key" :label="val" :value="key">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="优惠券抵扣">
- <el-select v-model="search_data.is_use_coupon" placeholder="请选择" size="small">
- <el-option v-for="(val, key) in user_coupon_map" :key="key" :label="val" :value="key">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="商品一级分类">
- <el-select v-model="search_data.cate_id" placeholder="请选择" clearable size="small">
- <el-option v-for="(val, key) in cateList" :key="val.id" :label="val.name" :value="val.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="收货地址筛选 省、市、区">
- <el-cascader
- @change="addressChange"
- :options="districtList"
- :props="addressProps"
- v-model="addressIdsMap"
- clearable @clear="clearAreaIds"
- size="small"
- >
- </el-cascader>
- </el-form-item>
- <template v-if="isShowStatistical">
- <el-form-item >
- <div><span>订单总额:</span><span>¥{{totalAreaMoney}}</span></div>
- </el-form-item>
- <el-form-item >
- <div><span>订单数量:</span><span>{{totalOrderCount}}条</span></div>
- </el-form-item>
- </template>
- <el-form-item>
- <el-button type="primary" @click="search" size="small">搜索</el-button>
- <el-button type="danger" @click="clearSearch" v-if="show_clear_search_btn" size="small">清除条件</el-button>
- </el-form-item>
- </el-form>
- <!-- 订单表格 start -->
- <div class="order-table">
- <ul class="tab-title" flex="dir:left cross:center">
- <li class="width-50" flex="main:center">
- <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="allSelOrder"></el-checkbox>
- </li>
- <li class="width-400">商品信息</li>
- <li class="width-pre10">价格/数量</li>
- <li class="width-pre10">实付款</li>
- <li class="width-s">收货人信息</li>
- <li class="width-s" v-if="is_show_username==1">真实姓名</li>
- <li class="width-s">配送方式</li>
- <li class="width-pre10">状态</li>
- <li class="width-pre10">备注</li>
- <li class="width-pre10">留言</li>
- <li class="width-400">操作</li>
- </ul>
- <div class="tab-cont" v-for="(item, index) in list" :key="index">
- <div class="tab-cont-row" flex="main:justify cross:center">
- <div flex="dir:left cross:center">
- <div class="width-50" flex="main:center">
- <!-- <el-checkbox v-model="item.select" @change=""></el-checkbox> -->
- <el-checkbox-group v-model="checkedOrder" @change="orderChange">
- <el-checkbox :label="item.id">{{''}}</el-checkbox>
- </el-checkbox-group>
- </div>
- <div style="padding-right: 20px;">订单({{ item.id }})编号:{{ item.order_no || '-' }}</div>
- <div v-if="item.base_user" style="padding-right: 20px;">
- <el-button type="text" @click="navUserDetail(item.base_user.id)" class="all_text">
- 用户({{item.base_user.id}}):{{ item.base_user.nickname || item.base_user.username }}
- </el-button>
- </div>
- <div style="padding-right: 20px;">下单时间:{{ item.created_at|dateTimeFormat('Y-m-d H:i:s')}}</div>
- <el-tag size="small" style="margin-right: 20px;" v-if="marketing_type_map[item.marketing_type]">{{marketing_type_map[item.marketing_type]}}</el-tag>
- <el-tag size="small" v-if="item.community_shipping_type && item.is_virtual == 0" :type="item.community_shipping_type.type">{{item.community_shipping_type.title}}</el-tag>
- <el-tag size="small" style="margin-left: 20px;" v-if="item.is_user_handle_finish == 1">放弃退换货</el-tag>
- <el-tag size="small" style="margin-left: 20px;" v-if="item.is_print == 1">已打印</el-tag>
- <el-tag size="small" type="warning" style="margin-left: 20px;" v-else>未打印</el-tag>
- <el-tag size="small" style="margin-left: 20px;" v-if="orderDetailStatusIdentical(item.detail)">部分发货</el-tag>
- <el-tag size="small" :type="item.order_status == -4 ? 'danger' : ''" style="margin-left: 20px;" v-else>{{ order_status_list[item.order_status] }}</el-tag>
- <el-tag size="small" style="margin-left: 20px;" v-if="item.goods_subtype == 1" type="warning">处方药</el-tag>
- </div>
- </div>
- <ul class="tab-cont-info" flex="dir:left cross:center" v-for="(it, i) in item.detail" v-if="true">
- <li class="width-50" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'"></li>
- <li class="tab-shop-info width-400" flex="dir:left" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
- <div style="position: relative;">
- <el-button type="text" @click="goodDetail(it.goods_id)">
- <el-image style="width: 50px; height: 50px; border-radius: 5px;" :src="it.pic_url"></el-image>
- </el-button>
- <span v-if="repeal_list[it.is_feedback]" class="com-order-refund-status">{{ repeal_list[it.is_feedback] }}</span>
- </div>
- <div class="tab-goods-name">
- <com-ellipsis :line="1" :text="it.goods_name+''"></com-ellipsis>
- <template>
- <el-popover
- trigger="hover"
- placement="top"
- >
- <el-tag size="small">
- {{ it.goods_attr_name || '无规格' }}
- </el-tag>
- <el-tag slot="reference" style="margin-right: 2px;margin-top: 5px;max-width: 187px;overflow: hidden;text-overflow: ellipsis; cursor: pointer;" size="small">
- {{ it.goods_attr_name || '无规格' }}
- </el-tag>
- </el-popover>
- </template>
- <div v-if="it.coupons_card_no">卡券编号: {{it.coupons_card_no}} <el-tag style="cursor: pointer" title="点击复制卡券编号" size="mini" type="primary" @click="onCopyCardNo(it.coupons_card_no)">复制</el-tag></div>
- </div>
- </li>
- <li class="width-pre10 border-right" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
- <div class="cursor" flex="cross:center" @mouseover="mouseOver(index, i)" @mouseleave="mouseLeave">
- <p style="padding-right: 10px;">
- {{ getOrderPrice(it) }}
- <span v-if="it.adjust_money != 0">(调价:¥{{ it.adjust_money }})</span>
- </p>
- </div>
- <p style="padding-right: 10px;">
- <span v-if="it.marketing_type == 'FunMall' && it.handling_fee_text">
- {{it.handling_fee_text}}
- </span>
- </p>
- <p>{{ it.num }}{{it.goods_unit||'件'}}</p>
- </li>
- <li class="width-pre10 border-right">
- <div v-show="i == 0">
- <p>{{ item.pay_money }}</p>
- <p>(含运费¥{{ item.shipping_money }})</p>
- <p>
- <el-tag size="small" type="warning">{{payment_type_list[item.payment_type]}}</el-tag>
- </p>
- </div>
- </li>
- <li class="width-s border-right">
- <div v-show="i == 0">
- <!-- 判断是否为自提点自提 -->
- <div v-if="item.province == 0 && item.community_addons_data && item.community_addons_data.head_info">
- <p>{{ item.community_addons_data.head_info.name | emptyFilled }}</p>
- <p>{{ item.community_addons_data.head_info.contact_name | emptyFilled }}</p>
- <p>{{ item.community_addons_data.head_info.contact_phone | emptyFilled}} </p>
- <p style="display: flex;align-items: center;">
- <com-ellipsis :line="1" :text="item.community_addons_data.head_info.address"></com-ellipsis>
- </p>
- </div>
- <div v-else>
- <p>{{ item.receiver_name | emptyFilled }}</p>
- <p>{{ item.mobile |emptyFilled}} </p>
- <p style="display: flex;align-items: center;">
- <com-ellipsis v-if="(item.region_name ).trim() != 'null'" :line="1" :text="item.region_name + '' + item.address"></com-ellipsis>
- <span v-else>--</span>
- </p>
- </div>
- </div>
- </li>
- <li class="width-s border-right" v-if="is_show_username==1&&item.base_user">
- <div v-show="i == 0">
- <p>{{ item.base_user.username }}</p>
- </div>
- </li>
- <li class="width-pre10 border-right">
- <p v-show="i == 0">
- <!-- 货到付款修改为送货上门 -->
- <div v-if="item.community_addons_data && item.community_addons_data.is_community_pickup == 1 && item.shipping_type == 3">
- 送货上门
- </div>
- <div v-else>
- <div v-if="item.is_virtual == 0">
- {{shipping_type_list[item.shipping_type]}}
- </div>
- <div v-else>
- -
- </div>
- </div>
- </p>
- </li>
- <li class="width-pre10 border-right" :class="i == item.detail.length - 1 ? 'no-border-bottom' : 'border-bottom'">
- <el-tag size="small" :type="it.order_status == -4 ? 'danger' : ''">{{ order_status_list[it.order_status] }}</el-tag>
- </li>
- <li class="width-pre10 border-right">
- <div v-if="i == 0">
- <com-ellipsis :line="1" :text="item.seller_remark"></com-ellipsis>
- </div>
- </li>
- <li class="width-pre10 border-right">
- <div v-if="i == 0">
- <com-ellipsis :line="1" :text="item.extra?.message ?? ''"></com-ellipsis>
- </div>
- </li>
- <li class="width-400">
- <div v-show="i == 0">
- <el-button size="small" type="text" @click="handle('detail',item)">详情</el-button>
- <el-button v-if="item.Printer && item.Printer.is_show_printer==1" size="small" type="text" @click="handle('printer',item)">打印小票</el-button>
- <!-- <template v-for="operate_item in status_operate_list[item.order_status]['operate']">-->
- <!-- <el-button size="small" type="text" @click="handle(operate_item.code,item)">{{operate_item.name}}</el-button>-->
- <!-- </template>-->
- <template>
- <template v-if="item.order_status == 0 && item.marketing_type == 'DepositPresale'">
- <template v-for="operate_item in special_status_nopay_operate">
- <el-button size="small" type="text" @click="handle(operate_item.code,item)">{{operate_item.name}}</el-button>
- </template>
- </template>
- <template v-else-if="status_operate_list[item.order_status] && status_operate_list[item.order_status]['operate']">
- <template v-for="operate_item in status_operate_list[item.order_status]['operate']">
- <el-button v-if="(is_compliance == 0 || operate_item.code != 'fen_run') && (item.show_botton || operate_item.code == 'fen_run') " size="small" type="text" @click="handle(operate_item.code,item)" :disabled="operate_item.code === 'shipping' && !item.is_allow_shipping">{{operate_item.name}}</el-button>
- </template>
- </template>
- <el-button size="small" type="text" @click="handle('print',item)">打印</el-button>
- </template>
- </div>
- </li>
- </ul>
- </div>
- </div>
- <div style="text-align: right;margin: 30px 0; display: flex; justify-content: space-between; align-items: center">
- <div class="block">
- <el-button type="primary"
- size="small"
- v-for="(item,index) in orderBatchButton"
- :key="index"
- @click="getOrderBatch(item.title,item.key)"
- v-html="item.title">
- </el-button>
- </div>
- <div style="text-align: right; display: flex; justify-content: space-between">
- <el-pagination @current-change="pagination" background layout="total, prev, pager, next" :page-size="pageSize" :page-count="pageCount" :current-page="currentPage" :total="rowCount"></el-pagination>
- <el-input v-model="page" placeholder="" size="small" @keyup.enter.native="pageSearch" style="width:50px; float: right; text-align: center; margin: 0;padding: 0;"></el-input>
- <!-- <el-pagination @current-change="pagination" background layout="prev, pager, next"-->
- <!-- :page-count="pageCount" :current-page="currentPage"></el-pagination>-->
- </div>
- </div>
- <!-- 订单表格 end -->
- </el-tab-pane>
- </el-tabs>
- </div>
- </el-card>
- </el-tab-pane>
- <el-tab-pane v-if="valid_addons.indexOf('ReservationService') !== -1 || valid_addons.indexOf('HomeMaking') !== -1" label="服务订单" name="rorder"></el-tab-pane>
- </el-tabs>
- <!-- 修改价格 -->
- <el-dialog :close-on-click-modal="false" title="订单改价" :visible.sync="isShowChangePrice">
- <el-form :model="change_price_form" ref="goodsValidateForm" label-width="80px" size="small">
- <el-table :data="change_price_form.detail" :span-method="objectSpanMethod" border>
- <el-table-column prop="goods_name" label="商品" width="180"></el-table-column>
- <el-table-column width="100" prop="price" label="单价(元)">
- <template slot-scope="scope">
- <span>{{scope.row.price}}元</span>
- </template>
- </el-table-column>
- <el-table-column width="50" prop="price" label="数量">
- <template slot-scope="scope">
- <span>{{scope.row.num}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="goods_price" label="小计">
- <template slot-scope="scope">
- <span>{{scope.row.price*scope.row.num}}元</span>
- </template>
- </el-table-column>
- <el-table-column prop="discount_sum" label="优惠">
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" content="优惠 = 会员折扣 + 优惠券 + 积分抵扣 + 会员价 + 涨减价" placement="top">
- <span>{{(scope.row.discount_sum).toFixed(2)}}元</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="" label="涨价或减价">
- <template slot-scope="scope">
- <el-input type="number" size="small" v-model="scope.row.adjust_money" @input="sumChangePrice(scope,$event)"></el-input>
- </template>
- </el-table-column>
- <el-table-column prop="" label="运费">
- <template slot-scope="scope">
- <el-input size="small" v-model="change_price_form.shipping_money" @input="sumChangeShipping($event)" onkeyup="if(value<0){value=0}else{value=toNumber(value,2)}"></el-input>
- </template>
- </el-table-column>
- </el-table>
- <div style="padding-top: 20px;" class="change_formula">
- <p> 实付总金额 = 小计 + 店铺优惠 + 小计涨减价 + 运费 </p>
- </div>
- <div style="padding-top: 20px;" class="change_price">
- <p> <label>实付总金额 </label> ¥{{change_price_form.new_pay_money}} </p>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="isShowChangePrice = false">取 消</el-button>
- <el-button type="primary" @click="handle('change_price',change_price_form,true)" :loading="changePriceLoading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 备注 -->
- <el-dialog :close-on-click-modal="false" title="备注" width="600px" :visible.sync="isShowRemark">
- <el-form :model="remark_form" ref="goodsValidateForm" label-width="80px" size="small">
- <el-form-item label="" prop="remark">
- <el-input type="textarea" placeholder="卖家备注" v-model="remark_form.seller_remark"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="isShowRemark = false">取 消</el-button>
- <el-button type="primary" @click="handle('remark',remark_form,true)" :loading="remarkLoading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 修改地址 -->
- <order-address :is_show="isShowChangeAddress" :change-address-loading="changeAddressLoading" @sure="handleChangeAddress" :order_info="change_address_form" @close="isShowChangeAddress = false"></order-address>
- <!-- 发货 -->
- <order-shipping :is_show="isShowChangeShipping" :change-shipping-loading="changeShippingLoading" :order_info="shipping_form" @submit="handleShipping" @close="isShowChangeShipping = false"></order-shipping>
- <el-dialog :close-on-click-modal="false" class="fenRunData" title="分润明细" :visible.sync="dialogTableVisible_fenRun">
- <el-tabs v-model="activeNames" @tab-click="commissionHandleClick">
- <!-- <el-tabs v-model="activeNames" @tab-click="commissionHandleClick">
- <el-tab-pane label="佣金" name="commission">
- <el-table :data="fenRunData">
- <el-table-column label="用户">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div>{{scope.row.nickname}}<span style="color:blue">({{scope.row.user_id}})</span></div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column property="change_num" label="佣金"></el-table-column>
- <el-table-column property="is_frozen" label="状态"></el-table-column>
- <el-table-column property="capital_type_text" label="类型"></el-table-column>
- <el-table-column property="from_type_text" label="所属插件"></el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="积分" name="score">
- <el-table :data="fenRunData">
- <el-table-column label="用户">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div>{{scope.row.nickname}}<span style="color:blue">({{scope.row.user_id}})</span></div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column property="change_num" label="积分">
- <template slot-scope="scope">
- <span v-if="scope.row.change_type == 'sub'" style="color:red;">-{{scope.row.change_num}}</span>
- <span v-else style="color:green;">+{{scope.row.change_num}}</span>
- </template>
- </el-table-column>
- <el-table-column property="is_frozen" label="状态"></el-table-column>
- <el-table-column property="capital_type_text" label="类型"></el-table-column>
- <el-table-column property="from_type_text" label="所属插件"></el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs> -->
- <el-tab-pane v-for="(v, k) in commission_type" :label="v.label" :key="v.name" :name="v.name">
- <el-table :data="fenRunData">
- <el-table-column label="用户">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div>{{scope.row.nickname}}<span style="color:blue">({{scope.row.user_id}})</span></div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column property="change_num" :label="v.label">
- <template slot-scope="scope">
- <span v-if="scope.row.change_type=='add'" style="color:green;">+{{scope.row.change_num}}</span>
- <span v-else style="color:red;">-{{scope.row.change_num}}</span>
- </template>
- </el-table-column>
- <el-table-column property="is_frozen" label="状态"></el-table-column>
- <el-table-column property="capital_type_text" label="类型">
- <template slot-scope="scope">
- {{scope.row.capital_type_text}} : {{scope.row.desc}}
- </template>
- </el-table-column>
- <el-table-column property="from_type_text" label="所属插件"></el-table-column>
- </el-table>
- </el-tab-pane>
- </el-dialog>
- <!-- 订单批量查询 -->
- <el-dialog :close-on-click-modal="false" ref="orderInquiryDialog" title="订单批量查询" width="600px" :visible.sync="orderInquiry.is_order_inquiry_show" @close="clearOrderNumber">
- <el-form :model="orderInquiry" label-width="80px" size="small" style="width: 90%;margin: 0 auto;">
- <el-form-item label="" prop="remark" label-width="0px">
- <div class="sub-title">
- <h2 style="margin: 0px!important;">查询订单范围</h2>
- <p>请批量填写订单号 (格式: 一行填写一个订单号)</p>
- </div>
- <el-input type="textarea"
- v-model="orderInquiry.order_no"
- placeholder="例: s20240606111151325321 s20240606111151325536 s20240607811151325536"
- :rows="12"
- resize="none">
- </el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="clearOrderNumber">取 消</el-button>
- <el-button type="primary" @click="confirmOrders" :loading="remarkLoading">确 定</el-button>
- </div>
- </el-dialog>
- <!-- 订单批量备注和留言 -->
- <el-dialog :close-on-click-modal="false" ref="orderInquiryDialog" :title="orderBatchDialog.title" width="600px" :visible.sync="orderBatchDialog.is_order_batch_show" @close="clearOrderBatch">
- <el-form :model="orderInquiry" label-width="80px" size="small" style="width: 95%;margin: 0 auto;">
- <el-form-item label="" prop="remark" label-width="0px">
- <el-input type="textarea"
- v-model="orderBatchDialog.content"
- :placeholder="orderBatchDialog.title"
- :rows="10"
- resize="none">
- </el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="clearOrderBatch">取 消</el-button>
- <el-button type="primary" @click.stop.prevent="orderBatchSubmit" :disabled="orderBatchDialog.is_order_button_disabled" :loading="remarkLoading">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- orderTypeTab:'gorder',
- price: 0,
- visibles: false,
- hidden: false,
- orderInquiry: {// 订单批量查询
- order_no: null,
- is_order_inquiry_show: false,
- },
- orderBatchButton: [// 订单批量按钮
- {title: '订单批量备注', key:'remarks'},
- {title: '订单批量留言', key:'leave'},
- ],
- orderLeave: { //订单留言
- is_order_show: false,
- content: null,
- },
- orderBatchDialog: {// 订单批量留言弹框
- is_order_batch_show: false,
- content: null,
- order_type: null,
- title: null,
- order_ids: null,
- is_order_button_disabled: false,
- },
- is_show_username: <?= $is_show_username ? json_encode($is_show_username) : 0 ?>,
- is_compliance: <?= $is_compliance ?? 0; ?>,
- current: -1,
- detailIndex: -1,
- checkAll: false,
- checked: false,
- select: '',
- input3: '',
- goods_name: '',
- goods_id: '',
- is_show_change_price: true,
- marketing_type_map: {},
- commission_type: [],
- user_coupon_map:{
- 1:'使用抵扣',
- 2:'未使用',
- },
- special_status_nopay_operate:[
- {
- 'type': 'text',
- 'name': '支付',
- 'code': 'pay'
- },{
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },
- ],
- // 操作按钮列表
- status_operate_list: {
- '0': {
- operate: [{
- 'type': 'text',
- 'name': '支付',
- 'code': 'pay'
- }, {
- 'type': 'text',
- 'name': '关闭交易',
- 'code': 'cancel'
- }, {
- 'type': 'text',
- 'name': '修改价格',
- 'code': 'change_price'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- }, {
- 'type': 'text',
- 'name': '留言',
- 'code': 'leave'
- }]
- },
- '1': {
- operate: [{
- 'type': 'text',
- 'name': '发货',
- 'code': 'shipping'
- }, {
- 'type': 'text',
- 'name': '修改地址',
- 'code': 'change_address'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '留言',
- 'code': 'leave'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- },]
- },
- '2': {
- operate: [{
- 'type': 'text',
- 'name': '确认收货',
- 'code': 'take-delivery'
- }, {
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- }, {
- 'type': 'text',
- 'name': '留言',
- 'code': 'leave'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '3': {
- operate: [{
- 'type': 'text',
- 'name': '订单完成',
- 'code': 'sales'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '4': {
- operate: [{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '6': {
- operate: [{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '7': {
- operate: [{
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '-1': {
- operate: [{
- 'type': 'text',
- 'name': '售后审核',
- 'code': 'sales_review'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '-2': {
- operate: [{
- 'type': 'text',
- 'name': '售后完成',
- 'code': 'sales_finish'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '-3': {
- operate: [{
- 'type': 'text',
- 'name': '售后完成',
- 'code': 'sales_finish'
- }, {
- 'type': 'text',
- 'name': '分润明细',
- 'code': 'fen_run'
- }, ]
- },
- '-4': {
- operate: [{
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '留言',
- 'code': 'leave'
- }, {
- 'type': 'text',
- 'name': '删除',
- 'code': 'destroy'
- }]
- },
- '-5': {
- operate: [{
- 'type': 'text',
- 'name': '备注',
- 'code': 'remark'
- },{
- 'type': 'text',
- 'name': '留言',
- 'code': 'leave'
- }, {
- 'type': 'text',
- 'name': '删除',
- 'code': 'destroy'
- }]
- }
- },
- repeal_list: {
- '1': '售后中',
- '2': '售后完成',
- },
- tabs: [{
- name: '全部',
- value: '999'
- },
- {
- name: '未付款',
- value: '0'
- },
- {
- name: '待发货',
- value: '1'
- },
- {
- name: '已发货',
- value: '2'
- },
- {
- name: '已收货',
- value: '3'
- },
- {
- name: '已完成',
- value: '4'
- },
- {
- name: '已关闭',
- value: '-4'
- },
- ],
- // 订单状态
- order_status_list: {
- "0": "待付款",
- "1": "待发货",
- "2": "已发货",
- "3": "已收货",
- "4": "已完成",
- "6": "待自提",
- "7": "自提成功",
- "-1": "售后申请",
- "-2": "退款中",
- "-3": "售后完成",
- "-4": "已关闭",
- "-5": "撤销申请",
- "-6": "售后拒绝",
- },
- payment_type_list: {
- '0': "未支付",
- '1': "微信",
- '2': "支付宝",
- '3': "银联卡",
- '5': "余额支付",
- '7': "汇聚支付",
- '8': "汇聚快捷支付",
- '12': "积分支付",
- '13': "礼包卡兑换",
- '15': "银典支付",
- '16': "通联支付",
- '17': "组合支付",
- '18': "汇付支付",
- '19': "衫德支付",
- '20': "衫德快捷支付",
- '100': "线下支付",
- '108': "金币支付"
- },
- payment_type_arr: {
- '1': "微信",
- '2': "支付宝",
- '3': "银联卡",
- '5': "余额支付",
- '7': "汇聚支付",
- '8': "汇聚快捷支付",
- '12': "积分支付",
- '13': "礼包卡兑换",
- '15': "银典支付",
- '16': "通联支付",
- '17': "组合支付",
- '18': "汇付支付",
- '19': "衫德支付",
- '20': "衫德快捷支付",
- },
- shipping_type_list: {
- '1': "物流配送",
- '2': "买家自提",
- '3': "商家配送",
- '4': "本地配送"
- },
- selectList: [{
- value: 'order_sn',
- name: '订单号'
- }, ],
- keyword_1: '1',
- activeName: '999',
- list: [],
- export_list: {},
- listLoading: false,
- page: 1,
- pageCount: 0,
- rowCount: 0,
- pageSize: 20, // 每页数量
- mch_id: 0, // 这个地方不知道要怎么获取
- searchCats: [],
- datetime: [],
- search_data: { // 筛选条件
- order_status: null,
- ids: [],
- cats: [],
- start: null,
- end: null,
- goods_id: null,
- order_no: null,
- type_value: null,
- type: null,
- order_id: 0,
- shipping_type: '',
- marketing_type: '',
- not_marketing_type: '',
- payment_type: '',
- r: 'mall/order/index',
- fields: [],
- province: null,
- cate_id: '',
- is_use_coupon:null,
- },
- isShowChangePrice: false,
- change_price_form: {
- detail: [],
- shipping_money: 0,
- },
- isShowChangeAddress: false,
- change_address_form: {},
- isShowChangeShipping: false,
- shipping_form: {},
- isShowRemark: false,
- remark_form: {},
- user_level: {},
- // loading
- changePriceLoading: false,
- remarkLoading: false,
- changeAddressLoading: false,
- changeShippingLoading: false,
- orderUrl: 'mall/order/index',
- export_url: 'mall/order/index',
- checkedOrder: [], //选中的订单
- isIndeterminate: false,
- dialogTableVisible_fenRun: false,
- activeNames: 'commission',
- orderId: 0,
- fenRunData: [],
- changesShipping: 0,
- changeprice: 0,
- changeprice_status: false,
- deleteIds: [],
- currentPage: 1,
- valid_addons: [],
- addressIdsMap: [],
- districtList: [],
- addressProps: {
- value: 'id',
- label: 'name',
- children: 'list',
- checkStrictly: true,
- multiple: true,
- },
- totalAreaMoney: 0,
- totalOrderCount: 0,
- cateList: [],
- isBatchMessage: 0, // 是否是批量留言
- print_url: '',
- };
- },
- mounted: function() {
- this.search_data.order_id = getQuery('order_id');
- this.search_data.order_no = getQuery('order_no');
- this.getList(this.search_data);
- this.getDistrict(3)
- this.getCateList()
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.search_data.cats) || !isEmpty(this.search_data.start) ||
- !isEmpty(this.search_data.end) || !isEmpty(this.search_data.goods_id) ||
- !isEmpty(this.search_data.order_no) || !isEmpty(this.search_data.type) ||
- !isEmpty(this.search_data.type_value) || !isEmpty(this.search_data.marketing_type) || !isEmpty(this.search_data.payment_type)
- || !isEmpty(this.search_data.province) || !isEmpty(this.search_data.cate_id) || !isEmpty(this.search_data.is_use_coupon) || !isEmpty(this.search_data.not_marketing_type);
- },
- isShowStatistical(){
- return (this.search_data.province && this.search_data.province.length > 0) || !isEmpty(this.search_data.cate_id)
- }
- },
- updated: function() {
- // console.log('ssssss')
- },
- methods: {
- change(e, type) {
- this.$forceUpdate();
- },
- // 判断多个订单时状态
- orderDetailStatusIdentical (orderList) {
- if (!Array.isArray(orderList)) return false;
- if (orderList.length <= 1) return false;
- let orderStatusListNum = 0; // 订单状态列表
- let shipmentsNum = 0;// 等级为2的数
- let repeal = 0; //等级为2的数
- for (let i = 0; i < orderList.length; i++) {
- if (orderList[i].order_status == 2 && orderList[i].order_status != -4) {
- orderStatusListNum++;
- }
- if (orderList[i].order_status == 2) {
- shipmentsNum++;
- } else if (orderList[i].order_status == -4) {
- repeal++;
- }
- }
- if (shipmentsNum === orderList.length || repeal === orderList.length) return false;
- return orderStatusListNum > 0;
- },
- //修改商品价格
- sumChangePrice(data, value) {
- if (value && !isNaN(value)) {
- if (value) {
- var change_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
- var changesShipping = this.change_price_form.shipping_money;
- if (this.changesShipping > 0) { //当运费有修改时去修改的值
- changesShipping = this.changesShipping;
- }
- if (!changesShipping) {
- changesShipping = 0;
- }
- var changeprice = 0;
- var new_pay_money = 0;
- for (var i = 0; i < this.change_price_form.detail.length; i++) {
- if (this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)) {
- var value_data = value.split(".");
- if (value_data.length > 1) {
- if (value_data[1].length > 2) {
- this.change_price_form.detail[i].adjust_money = parseFloat(value).toFixed(2);
- }
- }
- changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
- }
- new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
- }
- if (change_price < 0) {
- this.change_price_form.new_pay_money = parseFloat(new_pay_money + parseFloat(changesShipping)).toFixed(2);
- this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price);
- this.$message.error("单个商品支付金额不可以小于零");
- } else {
- this.change_price_form.new_pay_money = (new_pay_money + parseFloat(changeprice) + parseFloat(changesShipping)).toFixed(2);
- if (this.change_price_form.new_pay_money < 0.1) {
- this.$message.error("实付金额不可以小于0.1");
- return false;
- }
- this.changeprice_status = true;
- this.change_price_form.detail[data.$index].new_goods_price = parseFloat(this.change_price_form.detail[data.$index].goods_price) + parseFloat(value);
- }
- }
- }
- return value;
- },
- //修改邮费
- sumChangeShipping(value) { //change_price_form.detail shipping_money
- var changeprice = 0;
- var new_pay_money = 0;
- for (var i = 0; i < this.change_price_form.detail.length; i++) {
- if (this.change_price_form.detail[i].adjust_money && !isNaN(this.change_price_form.detail[i].adjust_money)) {
- changeprice = parseFloat(changeprice) + parseFloat(this.change_price_form.detail[i].adjust_money);
- }
- new_pay_money += parseFloat(this.change_price_form.detail[i].goods_price);
- }
- if (value && !isNaN(value)) {
- this.change_price_form.new_pay_money = (new_pay_money + parseFloat(value) + parseFloat(changeprice)).toFixed(2);
- this.changesShipping = parseFloat(value).toFixed(2);
- }
- },
- objectSpanMethod({
- row,
- column,
- rowIndex,
- columnIndex
- }) {
- if (columnIndex === 6) {
- console.log(rowIndex, 'rowIndex');
- if (rowIndex === 0) {
- return {
- rowspan: this.change_price_form.detail.length,
- colspan: 1
- };
- } else {
- return {
- rowspan: 0,
- colspan: 0
- };
- }
- }
- return {
- rowspan: 1,
- colspan: 1
- };
- },
- mouseOver(index, i) {
- // console.log(i)
- this.current = index
- this.detailIndex = i
- this.hidden = true
- },
- mouseLeave() {
- this.hidden = false
- },
- printReceipt() { // 打印小票
- this.$confirm('是否打印小票?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- }).then(() => {
- }).catch(() => {});
- },
- remark() { // 备注
- },
- changeTime(e) {
- // console.log(e)
- this.search_data.start = e[0]
- this.search_data.end = e[1]
- },
- handleClick(res) { //标签页切换
- this.list = []
- this.checkedOrder = []
- if (this.search_data.status == this.activeName) return;
- this.search_data.order_status = this.activeName;
- this.page = 1;
- this.getList(this.search_data);
- },
- navUserDetail(id) {
- this.$navigate({
- r: 'mall/user/user-detail',
- id: id
- })
- },
- goodDetail(goods_id) {
- let params = {
- r: 'mall/goods/edit'
- };
- params = Object.assign(params, {
- id: goods_id
- });
- navigateTo(params);
- },
- search() {
- this.page = 1;
- this.getList(this.search_data);
- },
- clearSearch() {
- this.search_data.cats = [];
- this.search_data.start = null;
- this.search_data.end = null;
- this.search_data.order_status = null;
- this.search_data.order_no = null;
- this.search_data.type = null;
- this.search_data.type_value = null;
- this.search_data.shipping_type = '';
- this.search_data.marketing_type = '';
- this.search_data.payment_type = '';
- this.search_data.province = null;
- this.search_data.cate_id = '';
- this.search_data.is_use_coupon = null;
- this.search_data.not_marketing_type = '';
- this.datetime = [];
- this.addressIdsMap = [];
- this.getList();
- },
- handleChangeAddress(data) {
- this.handle('change_address', data, true);
- },
- handleShipping(data) {
- this.handle('shipping', data, true);
- },
- orderTypeTabClick(tab,event){
- console.log(this.orderTypeTab)
- if('rorder' == this.orderTypeTab) navigateTo({r:'mall/order/reserve'});
- if('gorder' == this.orderTypeTab) navigateTo({r:'mall/order/index'});
- },
- handle(type, data = null, submit = false) {
- console.log(type)
- let id = data ? parseInt(data.id) : '';
- let url = 'mall/order/operate'
- switch (type) {
- // 订单详情
- case 'detail':
- let params = {
- r: 'mall/order/detail'
- };
- if (id) params = Object.assign(params, {
- id: id
- });
- navigateTo(params, true);
- break;
- // 删除订单
- case 'destroy':
- param = {
- id: data.id,
- type
- };
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mall/order/del', param)
- }).catch((err) => {})
- break;
- // 取消订单
- case 'cancel':
- param = {
- id: id
- };
- this.$confirm('确定关闭订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mall/order/close', param)
- }).catch((err) => {})
- break;
- // 支付订单
- case 'pay':
- param = {
- id: id
- };
- this.$confirm('确定付款吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mall/order/pay', param)
- }).catch((err) => {})
- break;
- // 修改价格
- case 'change_price':
- if (submit) {
- //检测每个商品修改价格不可以小于0和商品总价不可以小于0
- for (var i = 0; i < this.change_price_form.detail.length; i++) {
- var change_price = (parseFloat(this.change_price_form.detail[i].goods_price) + parseFloat(this.change_price_form.detail[i].adjust_money)).toFixed(2);
- if (change_price < 0) {
- this.$message.error('单个商品的减价值不可以大于商品实付金额');
- return false;
- }
- }
- if (this.change_price_form.new_pay_money < 0.1) {
- this.$message.error("实付金额不可以小于0.1");
- return false;
- }
- this.changePriceLoading = true;
- this.send('mall/order/change-price', this.change_price_form, (resp) => {
- if (resp.code == 0) this.isShowChangePrice = false;
- });
- setTimeout(() => {
- this.changePriceLoading = false;
- }, 100);
- } else {
- this.isShowChangePrice = true;
- var objString = JSON.stringify(data);
- this.change_price_form = JSON.parse(objString);
- this.$set(this.change_price_form, 'new_pay_money', this.change_price_form.pay_money);
- for (var i = 0; i < this.change_price_form.detail.length; i++) {
- this.$set(this.change_price_form.detail[i], 'new_goods_price', this.change_price_form.detail[i].goods_price);
- this.$set(this.change_price_form.detail[i], 'new_adjust_money', this.change_price_form.detail[i].adjust_money);
- //his.change_price_form.detail[i].adjust_money = 0;
- var discount_money = (parseFloat(this.change_price_form.detail[i].price) * this.change_price_form.detail[i].num) - parseFloat(this.change_price_form.detail[i].goods_price);
- this.$set(this.change_price_form.detail[i], 'discount_sum', discount_money);
- }
- }
- break;
- // 修改收货地址
- case 'change_address':
- if (submit) {
- this.changeAddressLoading = true;
- this.send('mall/order/change-address', data, (resp) => {
- if (resp.code == 0) this.isShowChangeAddress = false;
- });
- setTimeout(() => {
- this.changeAddressLoading = false;
- }, 100);
- } else {
- this.isShowChangeAddress = true
- var objString = JSON.stringify(data);
- this.change_address_form = JSON.parse(objString);
- }
- break;
- // 备注
- case 'remark':
- if (submit) {
- this.remarkLoading = true;
- this.send('mall/order/remark', this.remark_form, (resp) => {
- if (resp.code == 0) this.isShowRemark = false;
- });
- setTimeout(() => {
- this.remarkLoading = false;
- }, 100);
- } else {
- this.isShowRemark = true
- var objString = JSON.stringify(data);
- this.remark_form = JSON.parse(objString);
- }
- break;
- case 'leave':// 留言
- this.isBatchMessage = 0
- this.orderBatchDialog.is_order_batch_show = true;
- this.orderBatchDialog.content = data.leave;
- this.orderBatchDialog.title = '留言';
- this.orderBatchDialog.order_type = 'leave';
- this.orderBatchDialog.order_ids = [data.id];
- break;
- // 物流发货
- case 'shipping':
- if (submit) {
- this.changeShippingLoading = true;
- this.send('mall/order/shipping', data, (resp) => {
- if (resp.code == 0) this.isShowChangeShipping = false;
- });
- setTimeout(() => {
- this.changeShippingLoading = false;
- }, 100);
- } else {
- this.isShowChangeShipping = true
- var objString = JSON.stringify(data);
- this.shipping_form = JSON.parse(objString);
- }
- break;
- // 收货
- case 'take-delivery':
- param = {
- id: id
- };
- this.$confirm('确定收货吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mall/order/take-delivery', param)
- }).catch((err) => {})
- break;
- // 订单完成
- case 'sales':
- param = {
- id: id
- };
- this.$confirm('确定完成订单吗?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('mall/order/sales-order', param)
- }).catch((err) => {})
- break;
- case 'fen_run':
- this.dialogTableVisible_fenRun = true;
- this.orderId = id;
- this.getCapitalLog(id, this.activeNames)
- break;
- case 'printer':
- param = {
- order_id: id,
- print_type: 0 // 0 => 平台,1 => 门店,2 => 多商户
- };
- this.$confirm('确定打印?', '警告', {
- type: 'warning'
- }).then(() => {
- this.send('printer/default/printer', param)
- }).catch((err) => {})
- break;
- case 'print':
- // params = {
- // r: 'http://backend.qimall.com/kk.html'
- // };
- // window.location.href = 'http://backend.qimall.com/kk.html';
- window.open(this.print_url + '?id=' + data.id, '_blank');
- break;
- }
- },
- send(url, params, callback) {
- let self = this;
- request({
- params: {
- r: url,
- },
- method: 'post',
- data: params
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- self.getList(this.search_data);
- } else {
- self.$message.error(e.data.msg);
- }
- if (callback) callback(e.data);
- }).catch(e => {
- console.log(e);
- });
- },
- pageSearch() {
- this.getList();
- this.page_count = 1;
- },
- searchClick() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList(this.search_data);
- },
- // 获取商品列表
- getList(params = {}) {
- let self = this;
- let basic_params = {
- r: 'mall/order/index',
- page: self.page,
- };
- params = Object.assign(basic_params, params);
- if (self.listLoading == false) {
- self.listLoading = true;
- request({
- params: params,
- method: 'get',
- }).then(e => {
- self.listLoading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list;
- self.search_data.fields = e.data.data.fields;
- self.marketing_type_map = e.data.data.marketing_type_map;
- this.export_list = e.data.data.export_list;
- self.pageCount = e.data.data.page_count;
- self.rowCount = parseInt(e.data.data.row_count);
- self.pageSize = parseInt(e.data.data.page_size);
- if (this.page_count != 1) self.pageCount = e.data.data.page_count;
- self.commission_type = e.data.data.commission_type;
- this.currentPage = parseInt(this.page);
- self.shipping_type_list = e.data.data.shipping_type_list;
- self.valid_addons = e.data.data.valid_addons;
- self.seller_remark = e.data.data.seller_remark;
- self.totalAreaMoney = e.data.data.total_area_money
- self.totalOrderCount = e.data.data.total_order_count
- self.print_url = e.data.data.print_url;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.$message.error(e.data.msg);
- self.listLoading = false;
- });
- }
- },
- orderChange(val) {
- let checkedCount = val.length;
- this.checkAll = checkedCount == this.list.length;
- this.isIndeterminate = checkedCount > 0 && checkedCount < this.list.length;
- this.search_data.ids = val;
- this.deleteIds = val;
- this.orderBatchDialog.order_ids = val;
- },
- allSelOrder(boo) {
- let ids = [];
- this.list.forEach(v => {
- ids.push(v.id);
- })
- this.checkedOrder = boo ? ids : [];
- this.isIndeterminate = false;
- this.search_data.ids = ids;
- this.deleteIds = ids;
- this.orderBatchDialog.order_ids = ids;
- },
- commissionHandleClick(tab, event) {
- console.log(this.activeNames);
- this.getCapitalLog(this.orderId, this.activeNames)
- },
- getCapitalLog(orderId, wallet_type) {
- request({
- params: {
- r: 'mall/order/commission-and-score-list',
- order_id: orderId,
- wallet_type: wallet_type,
- },
- method: 'get',
- }).then(e => {
- if (e.data.code == 0) {
- this.fenRunData = e.data.data.list;
- this.user_level = e.data.data.user_level;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- getOrderPrice(data) {
- let text = '';
- switch (data.marketing_type) {
- case 'ScoreMall':
- case 'FunMall':
- text = data.extra_info;
- break;
- default:
- text = '¥' + data.goods_price;
- }
- return text;
- },
- detailOrder() {
- param = {
- id: this.deleteIds,
- };
- this.$confirm('删除这些数据后不可以恢复, 是否继续?', '警告', {
- type: 'warning'
- }).then(() => {
- let self = this;
- request({
- params: {
- r: 'mall/order/del',
- },
- method: 'post',
- data: param
- }).then(e => {
- if (e.data.code == 0) {
- this.checkedOrder = [];
- this.$message.success(e.data.msg);
- this.getList(this.search_data);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- }).catch((err) => {})
- },
- addressChange(e) {
- this.search_data.province = this.chooseJqfl(e)
- },
- getDistrict(level) {
- if (level) {
- level1 = level;
- } else{
- level1 = 1;
- }
- request({
- params: {
- r: 'common/region/get-district-list',
- level: level1
- },
- }).then(e => {
- if (e.data.code == 0) {
- this.districtList = e.data.data
- }
- }).catch(e => {
- });
- },
- clearAreaIds(){
- this.search_data.province = null
- },
- chooseJqfl(params) {
- let finalArray = [];
- if (params.length > 0) {
- const uniqueIn = (arr) => (x) => 1 == arr.filter((v) => v == x).length;
- const appendLastId = (result, ids) => [...result, ids[ids.length - 1]];
- const flatted = params.flat();
- const lastIds = params.reduce(appendLastId, []);
- finalArray = lastIds.filter(uniqueIn(flatted));
- }
- return finalArray
- },
- getCateList() {
- let self = this;
- request({
- params: {
- r: 'mall/cate/index',
- level: 1,
- },
- method: 'get',
- }).then(e => {
- self.cateList = e.data.data.list
- }).catch(e => {
- console.log(e);
- });
- },
- /* 订单批量查询 */
- upOrderNumber() { // 弹出批量订单弹窗
- if (this.search_data.order_no !== '' && this.search_data.order_no != null) {
- this.orderInquiry.order_no = this.search_data.order_no.split(',').map( el => el.trim()).filter(Boolean).join('\n');
- }
- this.orderInquiry.is_order_inquiry_show = true;
- },
- clearOrderNumber() {// 清空批量弹出订单
- this.orderInquiry = {
- is_order_inquiry_show: false,
- order_no: null,
- };
- },
- confirmOrders() {// 确认订单数据
- if (this.orderInquiry.order_no.split('\n').map( el => el.trim()).filter(Boolean).length > 100) {
- return this.$message.error('批量订单查询最大不能超过100条')
- }
- this.search_data.order_no = this.orderInquiry.order_no.split('\n').map( el => el.trim()).filter(Boolean).join(',');
- this.orderInquiry.is_order_inquiry_show = false;
- },
- /* 订单批量操作 */
- getOrderBatch(title,order_type) {
- this.orderBatchDialog.is_order_batch_show = true;
- this.orderBatchDialog.order_type = order_type;
- this.orderBatchDialog.title = title;
- this.isBatchMessage = 1
- },
- clearOrderBatch() {// 批量操作数据清除
- this.orderBatchDialog = {
- is_order_batch_show: false,
- content: null,
- order_type: null,
- order_ids: this.orderBatchDialog.order_ids,
- title: null,
- }
- },
- orderBatchSubmit() {// 订单数据批量提交
- if (this.orderBatchDialog.order_ids === '' || this.orderBatchDialog.order_ids == null){
- return this.$message.error("请选择要操作订单!");
- }
- if (this.orderBatchDialog.content === '' || this.orderBatchDialog.content == null){
- return this.$message.error("请填写" + this.orderBatchDialog.title + "内容!");
- }
- this.orderBatchDialog.is_order_button_disabled = true;// 防止订单二次点击
- let order_ids = this.orderBatchDialog.order_ids.join(',');
- request({
- params: {
- r: 'mall/order/order-batch',
- },
- method: 'post',
- data: {
- order_type: this.orderBatchDialog.order_type,
- content: this.orderBatchDialog.content,
- order_ids: order_ids,
- is_batch_message: this.isBatchMessage
- }
- }).then(e => {
- if (e.data.code === 0) {
- this.$message({
- message: e.data.msg,
- type: 'success',
- duration: 2000,
- onClose: () => {
- this.orderBatchDialog.is_order_batch_show = false;
- this.orderBatchDialog.is_order_button_disabled = false;
- window.location.reload();
- }
- });
- } else {
- this.orderBatchDialog.is_order_button_disabled = false;
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- onCopyCardNo(card_no) {
- var copyInput = document.createElement('input')
- copyInput.setAttribute('value', card_no)
- document.body.appendChild(copyInput)
- copyInput.select()
- try {
- var copyed = document.execCommand('copy')
- if (copyed) {
- document.body.removeChild(copyInput)
- this.$message.success('复制成功')
- }
- } catch {
- this.$message.success('复制失败,请检查浏览器兼容')
- }
- },
- }
- });
- </script>
|